https://sourceware.org/bugzilla/show_bug.cgi?id=16910
Bug ID: 16910 Summary: Failed to relocate attributes of debug information when the sym is wrapped Product: binutils Version: 2.25 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: qiyao at gcc dot gnu.org We find this bug when we run gdb test gdb.dwarf2/dwz.exp. Here are the steps to reproduce this bug: 1. Compile and link $ gcc 1.c -c -o 1.o $ gcc 2.c -c -o 2.o $ gcc dwz.S -c -o dwz.o $ build-x86/ld/ld-new 1.o dwz.o 2.o --wrap main -o 1.exe 2. Examine the address of main and __wrap_main $ readelf -s 1.exe | grep main 10: 08048088 18 FUNC GLOBAL DEFAULT 1 __wrap_main 12: 08048074 20 FUNC GLOBAL DEFAULT 1 main 3. Examine the DW_AT_low_pc attribute for main, $ readelf -wi ./1.exe Contents of the .debug_info section: Compilation Unit @ offset 0x0: Length: 0x17 (32-bit) Version: 4 Abbrev Offset: 0x0 Pointer Size: 4 <0><b>: Abbrev Number: 2 (DW_TAG_partial_unit) <1><c>: Abbrev Number: 3 (DW_TAG_subprogram) <d> DW_AT_name : main <12> DW_AT_low_pc : 0x8048088 <------- [1] <16> DW_AT_high_pc : 0x8048092 As we can see, DW_AT_low_pc should be the address of main instead of __wrap_main, otherwise, GDB will be confused. We find this problem on both x86 and arm targets. -- 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