I'm trying to recreate the behaviour of the command nm
in C, and although I was successful getting the names of the symbols and sections, I find out that some extra names appear in my version.
$> ./my_nm -a obj.o
0000000000000000 b .bss
0000000000000000 n .comment
0000000000000000 d .data
0000000000000000 r .eh_frame
0000000000000000 n .note.GNU-stack
0000000000000000 r .note.gnu.property
0000000000000000 d .rela.eh_frame
0000000000000000 d .rela.text
0000000000000000 t .text
U _GLOBAL_OFFSET_TABLE_
0000000000000000 T elf64_syms
0000000000000000 a elf64_syms.c
U malloc
$> nm -a obj.o
0000000000000000 b .bss
0000000000000000 n .comment
0000000000000000 d .data
0000000000000000 r .eh_frame
0000000000000000 n .note.GNU-stack
0000000000000000 r .note.gnu.property
0000000000000000 t .text
U _GLOBAL_OFFSET_TABLE_
0000000000000000 T elf64_syms
0000000000000000 a elf64_syms.c
U malloc
I did some research about them and found that they are some sort of a reference to a section or symbol. I wonder if there is anything special about them. If so, how can I differentiate between them and other .rela...
?