Skip to content

Commit 86dd23e

Browse files
Jordan Yatesnashif
authored andcommitted
scripts: build: gen_handles: exit on relocatable files
Print a clean error message when provided a relocatable file, instead of generating a source file which will cause compilation errors further away from the source. Signed-off-by: Jordan Yates <[email protected]>
1 parent 60aa9e1 commit 86dd23e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/build/gen_handles.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ def main():
121121
edt = pickle.load(f)
122122

123123
parsed_elf = ZephyrElf(args.kernel, edt, args.start_symbol)
124+
if parsed_elf.relocatable:
125+
# While relocatable elf files will load cleanly, the pointers pulled from
126+
# the symbol table are invalid (as expected, because the structures have not
127+
# yet been allocated addresses). Fixing this will require iterating over
128+
# the relocation sections to find the symbols those pointers will end up
129+
# referring to.
130+
sys.exit('Relocatable elf files are not yet supported')
124131

125132
if args.output_graphviz:
126133
# Try and output the dependency tree

0 commit comments

Comments
 (0)