corvvs / num

A program behaves like the nm on Linux.
0 stars 0 forks source link

m1macでビルドしたELFをLinuxで見ると`-a`で2つ不足する #34

Closed corvvs closed 1 year ago

corvvs commented 1 year ago
asterozoa:num corvvs$ cat test.c 
int main() {}

#include <stdnoreturn.h>

_Noreturn
void _exit(int code) {
        while(1);
}
asterozoa:num corvvs$ arm-none-eabi-gcc test.c -o hello_arm.elf
asterozoa:num corvvs$ make it
docker-compose exec app bash
root@9a2a0b2a4feb:/home# diff  -u <(nm -a hello_arm.elf) <(./ft_nm -a hello_arm.elf)
--- /dev/fd/63  2023-05-08 15:03:13.618084008 +0000
+++ /dev/fd/62  2023-05-08 15:03:13.619084008 +0000
@@ -1,7 +1,5 @@
 000086e4 r 
 00000000 a 
-00000000 n .ARM.attributes
-000086dc r .ARM.exidx
 00018b2c b .bss
 00000000 n .comment
 000186f8 d .data
root@9a2a0b2a4feb:/home# 
corvvs commented 1 year ago

.ARM.attributes, .ARM.exidxはいずれもARM固有のセクションで, 「プロセッサ固有」レンジのセクションタイプを持つ。

see also: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#id30