https://sourceware.org/bugzilla/show_bug.cgi?id=19891
Bug ID: 19891 Summary: arm: The order of IFUNC (R_ARM_IRELATIVE and R_ARM_JUMP_SLOT) relocations is incorrect Product: binutils Version: 2.25 Status: NEW Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: dimitry at google dot com CC: ian at airs dot com Target Milestone: --- Here readelf -r -W output for arm library: Relocation section '.rel.dyn' at offset 0x5f8 contains 29 entries: Offset Info Type Sym. Value Symbol's Name 00003e30 00000017 R_ARM_RELATIVE 00003e34 00000017 R_ARM_RELATIVE 00003e40 00000017 R_ARM_RELATIVE 00003e44 00000017 R_ARM_RELATIVE 00003e48 00000017 R_ARM_RELATIVE 00003e4c 00000017 R_ARM_RELATIVE 00003e50 00000017 R_ARM_RELATIVE 00003e54 00000017 R_ARM_RELATIVE 00003e58 00000017 R_ARM_RELATIVE 00003e5c 00000017 R_ARM_RELATIVE 00003e60 00000017 R_ARM_RELATIVE 00003e64 00000017 R_ARM_RELATIVE 00003e68 00000017 R_ARM_RELATIVE 00003e6c 00000017 R_ARM_RELATIVE 00003e70 00000017 R_ARM_RELATIVE 00003e74 00000017 R_ARM_RELATIVE 00003e78 00000017 R_ARM_RELATIVE 00003e7c 00000017 R_ARM_RELATIVE 00003fb0 00000017 R_ARM_RELATIVE 00003fb4 00000017 R_ARM_RELATIVE 00003fb8 00000017 R_ARM_RELATIVE 00004000 00000017 R_ARM_RELATIVE 00003fa8 00000815 R_ARM_GLOB_DAT 00000000 __stack_chk_guard 00003fac 00000b15 R_ARM_GLOB_DAT 00000000 stderr 00003f98 00000f15 R_ARM_GLOB_DAT 000008f5 return_true 00003f9c 00001015 R_ARM_GLOB_DAT 00000901 return_false 00003fa4 00001515 R_ARM_GLOB_DAT 0000090d f1 00003fa0 00001815 R_ARM_GLOB_DAT 00000919 f2 00003ffc 000000a0 R_ARM_IRELATIVE Relocation section '.rel.plt' at offset 0x6e0 contains 13 entries: Offset Info Type Sym. Value Symbol's Name 00003fc8 00000116 R_ARM_JUMP_SLOT 00000000 __cxa_finalize 00003fcc 00000316 R_ARM_JUMP_SLOT 00000000 __cxa_atexit 00003fd0 00000416 R_ARM_JUMP_SLOT 00000000 __register_atfork 00003fd4 00000616 R_ARM_JUMP_SLOT 00000000 getenv 00003fd8 00001216 R_ARM_JUMP_SLOT foo() foo 00003fdc 00000716 R_ARM_JUMP_SLOT 00000000 __stack_chk_fail 00003fe0 00000916 R_ARM_JUMP_SLOT 00000000 abort 00003fe4 00000a16 R_ARM_JUMP_SLOT 00000000 fprintf 00003fe8 00000e16 R_ARM_JUMP_SLOT 00000000 __aeabi_memcpy 00003fec 00000d16 R_ARM_JUMP_SLOT 00000000 __aeabi_memclr8 00003ff0 00000216 R_ARM_JUMP_SLOT 00000000 dladdr 00003ff4 00000516 R_ARM_JUMP_SLOT 00000000 __snprintf_chk 00003ff8 00000c16 R_ARM_JUMP_SLOT 00000000 __gnu_Unwind_Find_exidx 2 problems: 1. R_ARM_IRELATIVE -> to make sure that the function is ready to be called by this relocation it needs to be in .rel.plt segment and go after everything else. 2. 00003fd8 00001216 R_ARM_JUMP_SLOT foo() foo same problem here - should be last Here is output for the same library on arm64 (for the reference): Relocation section '.rela.dyn' at offset 0x600 contains 6 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000001d50 0000000000000403 R_AARCH64_RELATIVE 7b0 0000000000001d58 0000000000000403 R_AARCH64_RELATIVE 7a0 0000000000001f98 0000000500000401 R_AARCH64_GLOB_DAT 0000000000000860 return_true + 0 0000000000001fa0 0000000600000401 R_AARCH64_GLOB_DAT 000000000000086c return_false + 0 0000000000001fb0 0000000b00000401 R_AARCH64_GLOB_DAT 0000000000000878 f1 + 0 0000000000001fa8 0000000e00000401 R_AARCH64_GLOB_DAT 0000000000000884 f2 + 0 Relocation section '.rela.plt' at offset 0x690 contains 6 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000001fd0 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 __cxa_finalize + 0 0000000000001fd8 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000000000 __cxa_atexit + 0 0000000000001fe0 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 __register_atfork + 0 0000000000001fe8 0000000300000402 R_AARCH64_JUMP_SLOT 0000000000000000 getenv + 0 0000000000001ff0 0000000800000402 R_AARCH64_JUMP_SLOT foo() foo + 0 0000000000001ff8 0000000000000408 R_AARCH64_IRELATIVE 890 -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils