Skip to content

Instantly share code, notes, and snippets.

@jlevon
Created February 19, 2020 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlevon/0dcda36103380125f59aa2d6c80d3027 to your computer and use it in GitHub Desktop.
Save jlevon/0dcda36103380125f59aa2d6c80d3027 to your computer and use it in GitHub Desktop.
binutils and _start_crt relocations in crt1.o
OI hipster:
jlevon:~ $ gas --version
GNU assembler (GNU Binutils) 2.32
$ gcc -m64 -G -o b.so b.c
$ elfdump -r b.so
...
R_AMD64_JUMP_SLOT 0x115a0 0 .rela.plt _start_crt
SmartOS:
$ /opt/SmartOS/build-cache/2018Q4/x86_64/7d3d5fd52c4f9652ad8735869512edc363e630ce/usr/gnu/bin/gas --version
GNU assembler (GNU Binutils) 2.25.1
f905ddb5-9113-c52a-d3ce-d0db83321d72:illumos $ /home/gk/src/master/proto.strap/usr/gcc/7/bin/gcc -m64 -G -o b.so b.c
f905ddb5-9113-c52a-d3ce-d0db83321d72:illumos $ elfdump -r b.so
...
Relocation Section: .SUNW_reloc
type offset addend section symbol
R_AMD64_PC32 0x13b4 0xfffffffffffffffc .SUNW_reloc _start_crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment