Skip to content

Commit

Permalink
Fix insertion of magic bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAssassin committed Aug 15, 2024
1 parent a9a68bf commit d49643b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/build-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ objcopy --only-keep-debug runtime runtime.debug

strip --strip-debug --strip-unneeded runtime

# "classic" magic bytes which cannot be embedded with compiler magic, always do AFTER strip
# TODO: should be part of the Makefile
echo -ne 'AI\x02' | dd of=runtime bs=1 count=3 seek=8 conv=notrunc

ls -lh runtime runtime.debug

# append architecture prefix
Expand All @@ -54,6 +50,11 @@ mv runtime.debug runtime-"$architecture".debug

objcopy --add-gnu-debuglink runtime-"$architecture".debug runtime-"$architecture"

# "classic" magic bytes which cannot be embedded with compiler magic, always do AFTER strip
# needs to be done after calls to objcopy, strip etc.
# TODO: all these calls should be part of the Makefile
echo -ne 'AI\x02' | dd of=runtime-"$architecture" bs=1 count=3 seek=8 conv=notrunc

cp runtime-"$architecture" "$out_dir"/
cp runtime-"$architecture".debug "$out_dir"/

Expand Down

0 comments on commit d49643b

Please sign in to comment.