* BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 @ 2005-01-24 21:51 Andrew Cagney 2005-01-24 21:53 ` Ian Lance Taylor 2005-01-25 9:54 ` Alan Modra 0 siblings, 2 replies; 6+ messages in thread From: Andrew Cagney @ 2005-01-24 21:51 UTC (permalink / raw) To: binutils Hello, On 32-bit PPC GNU/Linux when running: $ nm --synthetic ... BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 10010900 ? *ABS*@plt 10010918 B bar . . . I'm seeing the above (and similar on i386, ....). Is this valid? Andrew ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 2005-01-24 21:51 BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 Andrew Cagney @ 2005-01-24 21:53 ` Ian Lance Taylor 2005-01-24 22:24 ` Andrew Cagney 2005-01-25 9:54 ` Alan Modra 1 sibling, 1 reply; 6+ messages in thread From: Ian Lance Taylor @ 2005-01-24 21:53 UTC (permalink / raw) To: Andrew Cagney; +Cc: binutils Andrew Cagney <cagney@gnu.org> writes: > On 32-bit PPC GNU/Linux when running: > > $ nm --synthetic ... > BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid > symbol index 1 > 10010900 ? *ABS*@plt > 10010918 B bar > . > . > . > > I'm seeing the above (and similar on i386, ....). Is this valid? Probably not. However, you will get better information, and a more reliable answer, if you provide output from objdump -t and readelf -s. Ian ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 2005-01-24 21:53 ` Ian Lance Taylor @ 2005-01-24 22:24 ` Andrew Cagney 0 siblings, 0 replies; 6+ messages in thread From: Andrew Cagney @ 2005-01-24 22:24 UTC (permalink / raw) To: Ian Lance Taylor; +Cc: binutils [-- Attachment #1: Type: text/plain, Size: 555 bytes --] Ian Lance Taylor wrote: > Andrew Cagney <cagney@gnu.org> writes: > > >>On 32-bit PPC GNU/Linux when running: >> >>$ nm --synthetic ... >>BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid >>symbol index 1 >>10010900 ? *ABS*@plt >>10010918 B bar >>. >>. >>. >> >>I'm seeing the above (and similar on i386, ....). Is this valid? > > > Probably not. However, you will get better information, and a more > reliable answer, if you provide output from objdump -t and readelf -s. Both attached (but they don't issue the warning :-). Andrew [-- Attachment #2: objdump-t --] [-- Type: text/plain, Size: 11603 bytes --] /home/cagney/tmp/a.out: file format elf32-powerpc SYMBOL TABLE: 10000134 l d .interp 00000000 .interp 10000144 l d .note.ABI-tag 00000000 .note.ABI-tag 10000164 l d .hash 00000000 .hash 1000018c l d .dynsym 00000000 .dynsym 100001dc l d .dynstr 00000000 .dynstr 10000236 l d .gnu.version 00000000 .gnu.version 10000240 l d .gnu.version_r 00000000 .gnu.version_r 10000260 l d .rela.dyn 00000000 .rela.dyn 1000026c l d .rela.plt 00000000 .rela.plt 10000278 l d .init 00000000 .init 100002a0 l d .text 00000000 .text 10000778 l d .fini 00000000 .fini 10000798 l d .rodata 00000000 .rodata 100007ac l d .sdata2 00000000 .sdata2 100007ac l d .eh_frame 00000000 .eh_frame 100107b0 l d .ctors 00000000 .ctors 100107b8 l d .dtors 00000000 .dtors 100107c0 l d .jcr 00000000 .jcr 100107c4 l d .got2 00000000 .got2 100107d4 l d .dynamic 00000000 .dynamic 1001089c l d .data 00000000 .data 100108a4 l d .got 00000000 .got 100108b8 l d .sdata 00000000 .sdata 100108b8 l d .sbss 00000000 .sbss 100108b8 l d .plt 00000000 .plt 10010910 l d .bss 00000000 .bss 00000000 l d .comment 00000000 .comment 00000000 l d .debug_aranges 00000000 .debug_aranges 00000000 l d .debug_pubnames 00000000 .debug_pubnames 00000000 l d .debug_info 00000000 .debug_info 00000000 l d .debug_abbrev 00000000 .debug_abbrev 00000000 l d .debug_line 00000000 .debug_line 00000000 l d .debug_frame 00000000 .debug_frame 00000000 l d .debug_macinfo 00000000 .debug_macinfo 00000000 l d *ABS* 00000000 .shstrtab 00000000 l d *ABS* 00000000 .symtab 00000000 l d *ABS* 00000000 .strtab 100002c4 l F .text 00000000 call_gmon_start 00000000 l df *ABS* 00000000 crtstuff.c 100107b0 l O .ctors 00000000 __CTOR_LIST__ 100107b8 l O .dtors 00000000 __DTOR_LIST__ 100107c0 l O .jcr 00000000 __JCR_LIST__ 100108a0 l O .data 00000000 p.0 10010910 l O .bss 00000001 completed.1 10000304 l F .text 00000000 __do_global_dtors_aux 10000370 l F .text 00000000 call___do_global_dtors_aux 1000038c l F .text 00000000 frame_dummy 100003d4 l F .text 00000000 call_frame_dummy 00000000 l df *ABS* 00000000 crtstuff.c 100107b4 l O .ctors 00000000 __CTOR_END__ 100107bc l O .dtors 00000000 __DTOR_END__ 100007ac l O .eh_frame 00000000 __FRAME_END__ 100107c0 l O .jcr 00000000 __JCR_END__ 10000710 l F .text 00000000 __do_global_ctors_aux 1000075c l F .text 00000000 call___do_global_ctors_aux 00000000 l df *ABS* 00000000 foo.c 00000000 l df *ABS* 00000000 crtsavres.S 00000000 l df *ABS* 00000000 ./include/ppc-asm.h 00000000 l df *ABS* 00000000 crtsavres.asm 00000000 l df *ABS* 00000000 crtsavres.S 00000000 l df *ABS* 00000000 <command line> 00000000 l df *ABS* 00000000 <built-in> 00000000 l df *ABS* 00000000 crtsavres.S 10000624 g F .text 0000003c _restgpr_18 100006fc g F .text 00000014 _restgpr_31_x 10000644 g F .text 0000001c _restgpr_26 100005b0 g F .text 00000018 _savegpr_27 1000063c g F .text 00000024 _restgpr_24 100006dc g F .text 00000034 _restgpr_23_x 100005d4 g F .text 00000040 _restfpr_17 10000618 g F .text 00000048 _restgpr_15 1000068c g F .text 0000002c _restfpr_25_x 100006bc g F .text 00000054 _restgpr_15_x 100005ec g F .text 00000028 _restfpr_23 100107d4 g O .dynamic 00000000 _DYNAMIC 10000640 g F .text 00000020 _restgpr_25 1000057c g F .text 0000004c _savegpr_14 10000670 g F .text 00000048 _restfpr_18_x 10000538 g F .text 00000044 _savefpr_16 10000658 g F .text 00000008 _restgpr_31 10000668 g F .text 00000050 _restfpr_16_x 100006cc g F .text 00000044 _restgpr_19_x 1000054c g F .text 00000030 _savefpr_21 10000580 g F .text 00000048 _savegpr_15 100006f8 g F .text 00000018 _restgpr_30_x 100006c4 g F .text 0000004c _restgpr_17_x 100107b0 g *ABS* 00000000 .hidden __fini_array_end 10000568 g F .text 00000014 _savefpr_28 100006f4 g F .text 0000001c _restgpr_29_x 100005fc g F .text 00000018 _restfpr_27 10000694 g F .text 00000024 _restfpr_27_x 100006a4 g F .text 00000014 _restfpr_31_x 100005dc g F .text 00000038 _restfpr_19 1001089c g O .data 00000000 .hidden __dso_handle 10000688 g F .text 00000030 _restfpr_24_x 100005b4 g F .text 00000014 _savegpr_28 100004a8 g F .text 00000088 __libc_csu_fini 100005ac g F .text 0000001c _savegpr_26 10000614 g F .text 0000004c _restgpr_14 10000534 g F .text 00000048 _savefpr_15 10000564 g F .text 00000018 _savefpr_27 10000664 g F .text 00000054 _restfpr_15_x 100005cc g F .text 00000048 _restfpr_15 10000684 g F .text 00000034 _restfpr_23_x 10000550 g F .text 0000002c _savefpr_22 10000278 g F .init 00000000 _init 100005e4 g F .text 00000030 _restfpr_21 10000660 g F .text 00000058 _restfpr_14_x 10000630 g F .text 00000030 _restgpr_21 1000053c g F .text 00000040 _savefpr_17 100005f4 g F .text 00000020 _restfpr_25 100005e8 g F .text 0000002c _restfpr_22 100006d8 g F .text 00000038 _restgpr_22_x 10000530 g F .text 0000004c _savefpr_14 100006e8 g F .text 00000028 _restgpr_26_x 100006f0 g F .text 00000020 _restgpr_28_x 100005a8 g F .text 00000020 _savegpr_25 100006a0 g F .text 00000018 _restfpr_30_x 100006e4 g F .text 0000002c _restgpr_25_x 100006e0 g F .text 00000030 _restgpr_24_x 10000598 g F .text 00000030 _savegpr_21 100002a0 g F .text 00000024 _start 10000548 g F .text 00000034 _savefpr_20 1000064c g F .text 00000014 _restgpr_28 100188b8 g O .sdata 00000000 _SDA_BASE_ 100005c8 g F .text 0000004c _restfpr_14 1000056c g F .text 00000010 _savefpr_29 10000628 g F .text 00000038 _restgpr_19 1000062c g F .text 00000034 _restgpr_20 100006c8 g F .text 00000048 _restgpr_18_x 1000067c g F .text 0000003c _restfpr_21_x 10000574 g F .text 00000008 _savefpr_31 10000594 g F .text 00000034 _savegpr_20 100107b0 g *ABS* 00000000 .hidden __fini_array_start 10000418 g F .text 0000008c __libc_csu_init 10000650 g F .text 00000010 _restgpr_29 100108b8 g *ABS* 00000000 __bss_start 1000058c g F .text 0000003c _savegpr_18 100003f0 g F .text 00000024 main 10000544 g F .text 00000038 _savefpr_19 10010900 F *UND* 000001d0 __libc_start_main@@GLIBC_2.0 10000600 g F .text 00000014 _restfpr_28 100005f8 g F .text 0000001c _restfpr_26 100107b0 g *ABS* 00000000 .hidden __init_array_end 10000588 g F .text 00000040 _savegpr_17 10000698 g F .text 00000020 _restfpr_28_x 100005e0 g F .text 00000034 _restfpr_20 1001089c w .data 00000000 data_start 1000066c g F .text 0000004c _restfpr_17_x 10000570 g F .text 0000000c _savefpr_30 1000055c g F .text 00000020 _savefpr_25 100005c0 g F .text 00000008 _savegpr_31 100005a0 g F .text 00000028 _savegpr_23 10000558 g F .text 00000024 _savefpr_24 10000778 g F .fini 00000000 _fini 1000069c g F .text 0000001c _restfpr_29_x 10000540 g F .text 0000003c _savefpr_18 100005b8 g F .text 00000010 _savegpr_29 10000674 g F .text 00000044 _restfpr_19_x 100107b0 g *ABS* 00000000 .hidden __preinit_array_end 10000648 g F .text 00000018 _restgpr_27 10000634 g F .text 0000002c _restgpr_22 100005a4 g F .text 00000024 _savegpr_24 100108b8 g *ABS* 00000000 _edata 100108a8 g O .got 00000000 _GLOBAL_OFFSET_TABLE_ 10010930 g *ABS* 00000000 _end 10000690 g F .text 00000028 _restfpr_26_x 100005d8 g F .text 0000003c _restfpr_18 10000590 g F .text 00000038 _savegpr_19 100005d0 g F .text 00000044 _restfpr_16 100006b8 g F .text 00000058 _restgpr_14_x 10000554 g F .text 00000028 _savefpr_23 10000608 g F .text 0000000c _restfpr_30 10000584 g F .text 00000044 _savegpr_16 100107b0 g *ABS* 00000000 .hidden __init_array_start 10000678 g F .text 00000040 _restfpr_20_x 10010918 g O .bss 00000018 bar 100007a8 g O .rodata 00000004 _IO_stdin_used 10000604 g F .text 00000010 _restfpr_29 100005f0 g F .text 00000024 _restfpr_24 100005bc g F .text 0000000c _savegpr_30 100006d4 g F .text 0000003c _restgpr_21_x 10000654 g F .text 0000000c _restgpr_30 10000680 g F .text 00000038 _restfpr_22_x 100006c0 g F .text 00000050 _restgpr_16_x 100006ec g F .text 00000024 _restgpr_27_x 1000059c g F .text 0000002c _savegpr_22 1001089c g .data 00000000 __data_start 1000061c g F .text 00000044 _restgpr_16 00000000 w *UND* 00000000 _Jv_RegisterClasses 100107b0 g *ABS* 00000000 .hidden __preinit_array_start 10000638 g F .text 00000028 _restgpr_23 100087ac g O .sdata2 00000000 _SDA2_BASE_ 10000620 g F .text 00000040 _restgpr_17 10000560 g F .text 0000001c _savefpr_26 100006d0 g F .text 00000040 _restgpr_20_x 1000060c g F .text 00000008 _restfpr_31 00000000 w *UND* 00000000 __gmon_start__ [-- Attachment #3: readelf-s --] [-- Type: text/plain, Size: 12827 bytes --] Symbol table '.dynsym' contains 5 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 10010900 464 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.0 (2) 2: 100007a8 4 OBJECT GLOBAL DEFAULT 13 _IO_stdin_used 3: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 4: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ Symbol table '.symtab' contains 199 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 10000134 0 SECTION LOCAL DEFAULT 1 2: 10000144 0 SECTION LOCAL DEFAULT 2 3: 10000164 0 SECTION LOCAL DEFAULT 3 4: 1000018c 0 SECTION LOCAL DEFAULT 4 5: 100001dc 0 SECTION LOCAL DEFAULT 5 6: 10000236 0 SECTION LOCAL DEFAULT 6 7: 10000240 0 SECTION LOCAL DEFAULT 7 8: 10000260 0 SECTION LOCAL DEFAULT 8 9: 1000026c 0 SECTION LOCAL DEFAULT 9 10: 10000278 0 SECTION LOCAL DEFAULT 10 11: 100002a0 0 SECTION LOCAL DEFAULT 11 12: 10000778 0 SECTION LOCAL DEFAULT 12 13: 10000798 0 SECTION LOCAL DEFAULT 13 14: 100007ac 0 SECTION LOCAL DEFAULT 14 15: 100007ac 0 SECTION LOCAL DEFAULT 15 16: 100107b0 0 SECTION LOCAL DEFAULT 16 17: 100107b8 0 SECTION LOCAL DEFAULT 17 18: 100107c0 0 SECTION LOCAL DEFAULT 18 19: 100107c4 0 SECTION LOCAL DEFAULT 19 20: 100107d4 0 SECTION LOCAL DEFAULT 20 21: 1001089c 0 SECTION LOCAL DEFAULT 21 22: 100108a4 0 SECTION LOCAL DEFAULT 22 23: 100108b8 0 SECTION LOCAL DEFAULT 23 24: 100108b8 0 SECTION LOCAL DEFAULT 24 25: 100108b8 0 SECTION LOCAL DEFAULT 25 26: 10010910 0 SECTION LOCAL DEFAULT 26 27: 00000000 0 SECTION LOCAL DEFAULT 27 28: 00000000 0 SECTION LOCAL DEFAULT 28 29: 00000000 0 SECTION LOCAL DEFAULT 29 30: 00000000 0 SECTION LOCAL DEFAULT 30 31: 00000000 0 SECTION LOCAL DEFAULT 31 32: 00000000 0 SECTION LOCAL DEFAULT 32 33: 00000000 0 SECTION LOCAL DEFAULT 33 34: 00000000 0 SECTION LOCAL DEFAULT 34 35: 00000000 0 SECTION LOCAL DEFAULT 35 36: 00000000 0 SECTION LOCAL DEFAULT 36 37: 00000000 0 SECTION LOCAL DEFAULT 37 38: 100002c4 0 FUNC LOCAL DEFAULT 11 call_gmon_start 39: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 40: 100107b0 0 OBJECT LOCAL DEFAULT 16 __CTOR_LIST__ 41: 100107b8 0 OBJECT LOCAL DEFAULT 17 __DTOR_LIST__ 42: 100107c0 0 OBJECT LOCAL DEFAULT 18 __JCR_LIST__ 43: 100108a0 0 OBJECT LOCAL DEFAULT 21 p.0 44: 10010910 1 OBJECT LOCAL DEFAULT 26 completed.1 45: 10000304 0 FUNC LOCAL DEFAULT 11 __do_global_dtors_aux 46: 10000370 0 FUNC LOCAL DEFAULT 11 call___do_global_dtors_au 47: 1000038c 0 FUNC LOCAL DEFAULT 11 frame_dummy 48: 100003d4 0 FUNC LOCAL DEFAULT 11 call_frame_dummy 49: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c 50: 100107b4 0 OBJECT LOCAL DEFAULT 16 __CTOR_END__ 51: 100107bc 0 OBJECT LOCAL DEFAULT 17 __DTOR_END__ 52: 100007ac 0 OBJECT LOCAL DEFAULT 15 __FRAME_END__ 53: 100107c0 0 OBJECT LOCAL DEFAULT 18 __JCR_END__ 54: 10000710 0 FUNC LOCAL DEFAULT 11 __do_global_ctors_aux 55: 1000075c 0 FUNC LOCAL DEFAULT 11 call___do_global_ctors_au 56: 00000000 0 FILE LOCAL DEFAULT ABS foo.c 57: 00000000 0 FILE LOCAL DEFAULT ABS crtsavres.S 58: 00000000 0 FILE LOCAL DEFAULT ABS ./include/ppc-asm.h 59: 00000000 0 FILE LOCAL DEFAULT ABS crtsavres.asm 60: 00000000 0 FILE LOCAL DEFAULT ABS crtsavres.S 61: 00000000 0 FILE LOCAL DEFAULT ABS <command line> 62: 00000000 0 FILE LOCAL DEFAULT ABS <built-in> 63: 00000000 0 FILE LOCAL DEFAULT ABS crtsavres.S 64: 10000624 60 FUNC GLOBAL DEFAULT 11 _restgpr_18 65: 100006fc 20 FUNC GLOBAL DEFAULT 11 _restgpr_31_x 66: 10000644 28 FUNC GLOBAL DEFAULT 11 _restgpr_26 67: 100005b0 24 FUNC GLOBAL DEFAULT 11 _savegpr_27 68: 1000063c 36 FUNC GLOBAL DEFAULT 11 _restgpr_24 69: 100006dc 52 FUNC GLOBAL DEFAULT 11 _restgpr_23_x 70: 100005d4 64 FUNC GLOBAL DEFAULT 11 _restfpr_17 71: 10000618 72 FUNC GLOBAL DEFAULT 11 _restgpr_15 72: 1000068c 44 FUNC GLOBAL DEFAULT 11 _restfpr_25_x 73: 100006bc 84 FUNC GLOBAL DEFAULT 11 _restgpr_15_x 74: 100005ec 40 FUNC GLOBAL DEFAULT 11 _restfpr_23 75: 100107d4 0 OBJECT GLOBAL DEFAULT 20 _DYNAMIC 76: 10000640 32 FUNC GLOBAL DEFAULT 11 _restgpr_25 77: 1000057c 76 FUNC GLOBAL DEFAULT 11 _savegpr_14 78: 10000670 72 FUNC GLOBAL DEFAULT 11 _restfpr_18_x 79: 10000538 68 FUNC GLOBAL DEFAULT 11 _savefpr_16 80: 10000658 8 FUNC GLOBAL DEFAULT 11 _restgpr_31 81: 10000668 80 FUNC GLOBAL DEFAULT 11 _restfpr_16_x 82: 100006cc 68 FUNC GLOBAL DEFAULT 11 _restgpr_19_x 83: 1000054c 48 FUNC GLOBAL DEFAULT 11 _savefpr_21 84: 10000580 72 FUNC GLOBAL DEFAULT 11 _savegpr_15 85: 100006f8 24 FUNC GLOBAL DEFAULT 11 _restgpr_30_x 86: 100006c4 76 FUNC GLOBAL DEFAULT 11 _restgpr_17_x 87: 100107b0 0 NOTYPE GLOBAL HIDDEN ABS __fini_array_end 88: 10000568 20 FUNC GLOBAL DEFAULT 11 _savefpr_28 89: 100006f4 28 FUNC GLOBAL DEFAULT 11 _restgpr_29_x 90: 100005fc 24 FUNC GLOBAL DEFAULT 11 _restfpr_27 91: 10000694 36 FUNC GLOBAL DEFAULT 11 _restfpr_27_x 92: 100006a4 20 FUNC GLOBAL DEFAULT 11 _restfpr_31_x 93: 100005dc 56 FUNC GLOBAL DEFAULT 11 _restfpr_19 94: 1001089c 0 OBJECT GLOBAL HIDDEN 21 __dso_handle 95: 10000688 48 FUNC GLOBAL DEFAULT 11 _restfpr_24_x 96: 100005b4 20 FUNC GLOBAL DEFAULT 11 _savegpr_28 97: 100004a8 136 FUNC GLOBAL DEFAULT 11 __libc_csu_fini 98: 100005ac 28 FUNC GLOBAL DEFAULT 11 _savegpr_26 99: 10000614 76 FUNC GLOBAL DEFAULT 11 _restgpr_14 100: 10000534 72 FUNC GLOBAL DEFAULT 11 _savefpr_15 101: 10000564 24 FUNC GLOBAL DEFAULT 11 _savefpr_27 102: 10000664 84 FUNC GLOBAL DEFAULT 11 _restfpr_15_x 103: 100005cc 72 FUNC GLOBAL DEFAULT 11 _restfpr_15 104: 10000684 52 FUNC GLOBAL DEFAULT 11 _restfpr_23_x 105: 10000550 44 FUNC GLOBAL DEFAULT 11 _savefpr_22 106: 10000278 0 FUNC GLOBAL DEFAULT 10 _init 107: 100005e4 48 FUNC GLOBAL DEFAULT 11 _restfpr_21 108: 10000660 88 FUNC GLOBAL DEFAULT 11 _restfpr_14_x 109: 10000630 48 FUNC GLOBAL DEFAULT 11 _restgpr_21 110: 1000053c 64 FUNC GLOBAL DEFAULT 11 _savefpr_17 111: 100005f4 32 FUNC GLOBAL DEFAULT 11 _restfpr_25 112: 100005e8 44 FUNC GLOBAL DEFAULT 11 _restfpr_22 113: 100006d8 56 FUNC GLOBAL DEFAULT 11 _restgpr_22_x 114: 10000530 76 FUNC GLOBAL DEFAULT 11 _savefpr_14 115: 100006e8 40 FUNC GLOBAL DEFAULT 11 _restgpr_26_x 116: 100006f0 32 FUNC GLOBAL DEFAULT 11 _restgpr_28_x 117: 100005a8 32 FUNC GLOBAL DEFAULT 11 _savegpr_25 118: 100006a0 24 FUNC GLOBAL DEFAULT 11 _restfpr_30_x 119: 100006e4 44 FUNC GLOBAL DEFAULT 11 _restgpr_25_x 120: 100006e0 48 FUNC GLOBAL DEFAULT 11 _restgpr_24_x 121: 10000598 48 FUNC GLOBAL DEFAULT 11 _savegpr_21 122: 100002a0 36 FUNC GLOBAL DEFAULT 11 _start 123: 10000548 52 FUNC GLOBAL DEFAULT 11 _savefpr_20 124: 1000064c 20 FUNC GLOBAL DEFAULT 11 _restgpr_28 125: 100188b8 0 OBJECT GLOBAL DEFAULT 23 _SDA_BASE_ 126: 100005c8 76 FUNC GLOBAL DEFAULT 11 _restfpr_14 127: 1000056c 16 FUNC GLOBAL DEFAULT 11 _savefpr_29 128: 10000628 56 FUNC GLOBAL DEFAULT 11 _restgpr_19 129: 1000062c 52 FUNC GLOBAL DEFAULT 11 _restgpr_20 130: 100006c8 72 FUNC GLOBAL DEFAULT 11 _restgpr_18_x 131: 1000067c 60 FUNC GLOBAL DEFAULT 11 _restfpr_21_x 132: 10000574 8 FUNC GLOBAL DEFAULT 11 _savefpr_31 133: 10000594 52 FUNC GLOBAL DEFAULT 11 _savegpr_20 134: 100107b0 0 NOTYPE GLOBAL HIDDEN ABS __fini_array_start 135: 10000418 140 FUNC GLOBAL DEFAULT 11 __libc_csu_init 136: 10000650 16 FUNC GLOBAL DEFAULT 11 _restgpr_29 137: 100108b8 0 NOTYPE GLOBAL DEFAULT ABS __bss_start 138: 1000058c 60 FUNC GLOBAL DEFAULT 11 _savegpr_18 139: 100003f0 36 FUNC GLOBAL DEFAULT 11 main 140: 10000544 56 FUNC GLOBAL DEFAULT 11 _savefpr_19 141: 10010900 464 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_ 142: 10000600 20 FUNC GLOBAL DEFAULT 11 _restfpr_28 143: 100005f8 28 FUNC GLOBAL DEFAULT 11 _restfpr_26 144: 100107b0 0 NOTYPE GLOBAL HIDDEN ABS __init_array_end 145: 10000588 64 FUNC GLOBAL DEFAULT 11 _savegpr_17 146: 10000698 32 FUNC GLOBAL DEFAULT 11 _restfpr_28_x 147: 100005e0 52 FUNC GLOBAL DEFAULT 11 _restfpr_20 148: 1001089c 0 NOTYPE WEAK DEFAULT 21 data_start 149: 1000066c 76 FUNC GLOBAL DEFAULT 11 _restfpr_17_x 150: 10000570 12 FUNC GLOBAL DEFAULT 11 _savefpr_30 151: 1000055c 32 FUNC GLOBAL DEFAULT 11 _savefpr_25 152: 100005c0 8 FUNC GLOBAL DEFAULT 11 _savegpr_31 153: 100005a0 40 FUNC GLOBAL DEFAULT 11 _savegpr_23 154: 10000558 36 FUNC GLOBAL DEFAULT 11 _savefpr_24 155: 10000778 0 FUNC GLOBAL DEFAULT 12 _fini 156: 1000069c 28 FUNC GLOBAL DEFAULT 11 _restfpr_29_x 157: 10000540 60 FUNC GLOBAL DEFAULT 11 _savefpr_18 158: 100005b8 16 FUNC GLOBAL DEFAULT 11 _savegpr_29 159: 10000674 68 FUNC GLOBAL DEFAULT 11 _restfpr_19_x 160: 100107b0 0 NOTYPE GLOBAL HIDDEN ABS __preinit_array_end 161: 10000648 24 FUNC GLOBAL DEFAULT 11 _restgpr_27 162: 10000634 44 FUNC GLOBAL DEFAULT 11 _restgpr_22 163: 100005a4 36 FUNC GLOBAL DEFAULT 11 _savegpr_24 164: 100108b8 0 NOTYPE GLOBAL DEFAULT ABS _edata 165: 100108a8 0 OBJECT GLOBAL DEFAULT 22 _GLOBAL_OFFSET_TABLE_ 166: 10010930 0 NOTYPE GLOBAL DEFAULT ABS _end 167: 10000690 40 FUNC GLOBAL DEFAULT 11 _restfpr_26_x 168: 100005d8 60 FUNC GLOBAL DEFAULT 11 _restfpr_18 169: 10000590 56 FUNC GLOBAL DEFAULT 11 _savegpr_19 170: 100005d0 68 FUNC GLOBAL DEFAULT 11 _restfpr_16 171: 100006b8 88 FUNC GLOBAL DEFAULT 11 _restgpr_14_x 172: 10000554 40 FUNC GLOBAL DEFAULT 11 _savefpr_23 173: 10000608 12 FUNC GLOBAL DEFAULT 11 _restfpr_30 174: 10000584 68 FUNC GLOBAL DEFAULT 11 _savegpr_16 175: 100107b0 0 NOTYPE GLOBAL HIDDEN ABS __init_array_start 176: 10000678 64 FUNC GLOBAL DEFAULT 11 _restfpr_20_x 177: 10010918 24 OBJECT GLOBAL DEFAULT 26 bar 178: 100007a8 4 OBJECT GLOBAL DEFAULT 13 _IO_stdin_used 179: 10000604 16 FUNC GLOBAL DEFAULT 11 _restfpr_29 180: 100005f0 36 FUNC GLOBAL DEFAULT 11 _restfpr_24 181: 100005bc 12 FUNC GLOBAL DEFAULT 11 _savegpr_30 182: 100006d4 60 FUNC GLOBAL DEFAULT 11 _restgpr_21_x 183: 10000654 12 FUNC GLOBAL DEFAULT 11 _restgpr_30 184: 10000680 56 FUNC GLOBAL DEFAULT 11 _restfpr_22_x 185: 100006c0 80 FUNC GLOBAL DEFAULT 11 _restgpr_16_x 186: 100006ec 36 FUNC GLOBAL DEFAULT 11 _restgpr_27_x 187: 1000059c 44 FUNC GLOBAL DEFAULT 11 _savegpr_22 188: 1001089c 0 NOTYPE GLOBAL DEFAULT 21 __data_start 189: 1000061c 68 FUNC GLOBAL DEFAULT 11 _restgpr_16 190: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 191: 100107b0 0 NOTYPE GLOBAL HIDDEN ABS __preinit_array_start 192: 10000638 40 FUNC GLOBAL DEFAULT 11 _restgpr_23 193: 100087ac 0 OBJECT GLOBAL DEFAULT 14 _SDA2_BASE_ 194: 10000620 64 FUNC GLOBAL DEFAULT 11 _restgpr_17 195: 10000560 28 FUNC GLOBAL DEFAULT 11 _savefpr_26 196: 100006d0 64 FUNC GLOBAL DEFAULT 11 _restgpr_20_x 197: 1000060c 8 FUNC GLOBAL DEFAULT 11 _restfpr_31 198: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 2005-01-24 21:51 BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 Andrew Cagney 2005-01-24 21:53 ` Ian Lance Taylor @ 2005-01-25 9:54 ` Alan Modra 2005-01-25 10:30 ` Alan Modra 1 sibling, 1 reply; 6+ messages in thread From: Alan Modra @ 2005-01-25 9:54 UTC (permalink / raw) To: Andrew Cagney; +Cc: binutils On Mon, Jan 24, 2005 at 04:51:12PM -0500, Andrew Cagney wrote: > $ nm --synthetic ... > BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol > index 1 > 10010900 ? *ABS*@plt > 10010918 B bar It's a bug. _bfd_elf_get_synthetic_symtab is trying to slurp dynamic relocs before the dynamic symbol table has been read. "nm -D --synthetic" works. It looks like "nm --synthetic" is supposed to work too. Oh well, fixing. -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 2005-01-25 9:54 ` Alan Modra @ 2005-01-25 10:30 ` Alan Modra 2005-01-26 20:33 ` Andrew Cagney 0 siblings, 1 reply; 6+ messages in thread From: Alan Modra @ 2005-01-25 10:30 UTC (permalink / raw) To: Andrew Cagney, binutils On Tue, Jan 25, 2005 at 08:23:59PM +1030, Alan Modra wrote: > On Mon, Jan 24, 2005 at 04:51:12PM -0500, Andrew Cagney wrote: > > $ nm --synthetic ... > > BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol > > index 1 > > 10010900 ? *ABS*@plt > > 10010918 B bar > > It's a bug. _bfd_elf_get_synthetic_symtab is trying to slurp dynamic > relocs before the dynamic symbol table has been read. > > "nm -D --synthetic" works. It looks like "nm --synthetic" is supposed > to work too. Oh well, fixing. As well as fixing the above, I've restricted the relocs returned by _bfd_elf_canonicalize_dynamic_reloc to those for loadable sections. The idea is to exclude debug relocs, and any other weird stuff that generally isn't of interest for "objdump -dR". I see gdb makes calls to bfd_canonicalize_dynamic_reloc too, but I think gdb/dbxread.c and gdb/solib-frv.c aren't interested in debug relocs either. bfd/ * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound): Only include loadable reloc sections. (_bfd_elf_canonicalize_dynamic_reloc): Likewise. (_bfd_elf_get_synthetic_symtab): Return 0 if no dynamic syms. binutils/ * nm.c (display_rel_file): Read dynamic syms before calling bfd_get_synthetic_symtab. Index: bfd/elf.c =================================================================== RCS file: /cvs/src/src/bfd/elf.c,v retrieving revision 1.260 diff -u -p -r1.260 elf.c --- bfd/elf.c 7 Jan 2005 09:52:00 -0000 1.260 +++ bfd/elf.c 25 Jan 2005 10:07:51 -0000 @@ -5977,10 +5977,10 @@ _bfd_elf_canonicalize_dynamic_symtab (bf return symcount; } -/* Return the size required for the dynamic reloc entries. Any - section that was actually installed in the BFD, and has type - SHT_REL or SHT_RELA, and uses the dynamic symbol table, is - considered to be a dynamic reloc section. */ +/* Return the size required for the dynamic reloc entries. Any loadable + section that was actually installed in the BFD, and has type SHT_REL + or SHT_RELA, and uses the dynamic symbol table, is considered to be a + dynamic reloc section. */ long _bfd_elf_get_dynamic_reloc_upper_bound (bfd *abfd) @@ -5996,7 +5996,8 @@ _bfd_elf_get_dynamic_reloc_upper_bound ( ret = sizeof (arelent *); for (s = abfd->sections; s != NULL; s = s->next) - if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) + if ((s->flags & SEC_LOAD) != 0 + && elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) && (elf_section_data (s)->this_hdr.sh_type == SHT_REL || elf_section_data (s)->this_hdr.sh_type == SHT_RELA)) ret += ((s->size / elf_section_data (s)->this_hdr.sh_entsize) @@ -6005,14 +6006,13 @@ _bfd_elf_get_dynamic_reloc_upper_bound ( return ret; } -/* Canonicalize the dynamic relocation entries. Note that we return - the dynamic relocations as a single block, although they are - actually associated with particular sections; the interface, which - was designed for SunOS style shared libraries, expects that there - is only one set of dynamic relocs. Any section that was actually - installed in the BFD, and has type SHT_REL or SHT_RELA, and uses - the dynamic symbol table, is considered to be a dynamic reloc - section. */ +/* Canonicalize the dynamic relocation entries. Note that we return the + dynamic relocations as a single block, although they are actually + associated with particular sections; the interface, which was + designed for SunOS style shared libraries, expects that there is only + one set of dynamic relocs. Any loadable section that was actually + installed in the BFD, and has type SHT_REL or SHT_RELA, and uses the + dynamic symbol table, is considered to be a dynamic reloc section. */ long _bfd_elf_canonicalize_dynamic_reloc (bfd *abfd, @@ -6033,7 +6033,8 @@ _bfd_elf_canonicalize_dynamic_reloc (bfd ret = 0; for (s = abfd->sections; s != NULL; s = s->next) { - if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) + if ((s->flags & SEC_LOAD) != 0 + && elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) && (elf_section_data (s)->this_hdr.sh_type == SHT_REL || elf_section_data (s)->this_hdr.sh_type == SHT_RELA)) { @@ -7908,7 +7909,7 @@ long _bfd_elf_get_synthetic_symtab (bfd *abfd, long symcount ATTRIBUTE_UNUSED, asymbol **syms ATTRIBUTE_UNUSED, - long dynsymcount ATTRIBUTE_UNUSED, + long dynsymcount, asymbol **dynsyms, asymbol **ret) { @@ -7924,10 +7925,14 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd char *names; asection *plt; + *ret = NULL; + if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0) return 0; - *ret = NULL; + if (dynsymcount <= 0) + return 0; + if (!bed->plt_sym_val) return 0; Index: binutils/nm.c =================================================================== RCS file: /cvs/src/src/binutils/nm.c,v retrieving revision 1.43 diff -u -p -r1.43 nm.c --- binutils/nm.c 14 Oct 2004 09:36:54 -0000 1.43 +++ binutils/nm.c 25 Jan 2005 10:07:56 -0000 @@ -1026,8 +1026,18 @@ display_rel_file (bfd *abfd, bfd *archiv } else { + long storage = bfd_get_dynamic_symtab_upper_bound (abfd); + static_count = symcount; static_syms = minisyms; + + if (storage > 0) + { + dyn_syms = xmalloc (storage); + dyn_count = bfd_canonicalize_dynamic_symtab (abfd, dyn_syms); + if (dyn_count < 0) + bfd_fatal (bfd_get_filename (abfd)); + } } synth_count = bfd_get_synthetic_symtab (abfd, static_count, static_syms, dyn_count, dyn_syms, &synthsyms); -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 2005-01-25 10:30 ` Alan Modra @ 2005-01-26 20:33 ` Andrew Cagney 0 siblings, 0 replies; 6+ messages in thread From: Andrew Cagney @ 2005-01-26 20:33 UTC (permalink / raw) To: Alan Modra; +Cc: binutils Alan Modra wrote: > On Tue, Jan 25, 2005 at 08:23:59PM +1030, Alan Modra wrote: > >>On Mon, Jan 24, 2005 at 04:51:12PM -0500, Andrew Cagney wrote: >> >>>$ nm --synthetic ... >>>BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol >>>index 1 >>>10010900 ? *ABS*@plt >>>10010918 B bar >> >>It's a bug. _bfd_elf_get_synthetic_symtab is trying to slurp dynamic >>relocs before the dynamic symbol table has been read. >> >>"nm -D --synthetic" works. It looks like "nm --synthetic" is supposed >>to work too. Oh well, fixing. > > > As well as fixing the above, I've restricted the relocs returned by > _bfd_elf_canonicalize_dynamic_reloc to those for loadable sections. > The idea is to exclude debug relocs, and any other weird stuff that > generally isn't of interest for "objdump -dR". Works for me. > I see gdb makes > calls to bfd_canonicalize_dynamic_reloc too, but I think gdb/dbxread.c > and gdb/solib-frv.c aren't interested in debug relocs either. Agreed. thanks! Andrew > > bfd/ > * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound): Only include > loadable reloc sections. > (_bfd_elf_canonicalize_dynamic_reloc): Likewise. > (_bfd_elf_get_synthetic_symtab): Return 0 if no dynamic syms. > binutils/ > * nm.c (display_rel_file): Read dynamic syms before calling > bfd_get_synthetic_symtab. > > Index: bfd/elf.c > =================================================================== > RCS file: /cvs/src/src/bfd/elf.c,v > retrieving revision 1.260 > diff -u -p -r1.260 elf.c > --- bfd/elf.c 7 Jan 2005 09:52:00 -0000 1.260 > +++ bfd/elf.c 25 Jan 2005 10:07:51 -0000 > @@ -5977,10 +5977,10 @@ _bfd_elf_canonicalize_dynamic_symtab (bf > return symcount; > } > > -/* Return the size required for the dynamic reloc entries. Any > - section that was actually installed in the BFD, and has type > - SHT_REL or SHT_RELA, and uses the dynamic symbol table, is > - considered to be a dynamic reloc section. */ > +/* Return the size required for the dynamic reloc entries. Any loadable > + section that was actually installed in the BFD, and has type SHT_REL > + or SHT_RELA, and uses the dynamic symbol table, is considered to be a > + dynamic reloc section. */ > > long > _bfd_elf_get_dynamic_reloc_upper_bound (bfd *abfd) > @@ -5996,7 +5996,8 @@ _bfd_elf_get_dynamic_reloc_upper_bound ( > > ret = sizeof (arelent *); > for (s = abfd->sections; s != NULL; s = s->next) > - if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) > + if ((s->flags & SEC_LOAD) != 0 > + && elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) > && (elf_section_data (s)->this_hdr.sh_type == SHT_REL > || elf_section_data (s)->this_hdr.sh_type == SHT_RELA)) > ret += ((s->size / elf_section_data (s)->this_hdr.sh_entsize) > @@ -6005,14 +6006,13 @@ _bfd_elf_get_dynamic_reloc_upper_bound ( > return ret; > } > > -/* Canonicalize the dynamic relocation entries. Note that we return > - the dynamic relocations as a single block, although they are > - actually associated with particular sections; the interface, which > - was designed for SunOS style shared libraries, expects that there > - is only one set of dynamic relocs. Any section that was actually > - installed in the BFD, and has type SHT_REL or SHT_RELA, and uses > - the dynamic symbol table, is considered to be a dynamic reloc > - section. */ > +/* Canonicalize the dynamic relocation entries. Note that we return the > + dynamic relocations as a single block, although they are actually > + associated with particular sections; the interface, which was > + designed for SunOS style shared libraries, expects that there is only > + one set of dynamic relocs. Any loadable section that was actually > + installed in the BFD, and has type SHT_REL or SHT_RELA, and uses the > + dynamic symbol table, is considered to be a dynamic reloc section. */ > > long > _bfd_elf_canonicalize_dynamic_reloc (bfd *abfd, > @@ -6033,7 +6033,8 @@ _bfd_elf_canonicalize_dynamic_reloc (bfd > ret = 0; > for (s = abfd->sections; s != NULL; s = s->next) > { > - if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) > + if ((s->flags & SEC_LOAD) != 0 > + && elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd) > && (elf_section_data (s)->this_hdr.sh_type == SHT_REL > || elf_section_data (s)->this_hdr.sh_type == SHT_RELA)) > { > @@ -7908,7 +7909,7 @@ long > _bfd_elf_get_synthetic_symtab (bfd *abfd, > long symcount ATTRIBUTE_UNUSED, > asymbol **syms ATTRIBUTE_UNUSED, > - long dynsymcount ATTRIBUTE_UNUSED, > + long dynsymcount, > asymbol **dynsyms, > asymbol **ret) > { > @@ -7924,10 +7925,14 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd > char *names; > asection *plt; > > + *ret = NULL; > + > if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0) > return 0; > > - *ret = NULL; > + if (dynsymcount <= 0) > + return 0; > + > if (!bed->plt_sym_val) > return 0; > > Index: binutils/nm.c > =================================================================== > RCS file: /cvs/src/src/binutils/nm.c,v > retrieving revision 1.43 > diff -u -p -r1.43 nm.c > --- binutils/nm.c 14 Oct 2004 09:36:54 -0000 1.43 > +++ binutils/nm.c 25 Jan 2005 10:07:56 -0000 > @@ -1026,8 +1026,18 @@ display_rel_file (bfd *abfd, bfd *archiv > } > else > { > + long storage = bfd_get_dynamic_symtab_upper_bound (abfd); > + > static_count = symcount; > static_syms = minisyms; > + > + if (storage > 0) > + { > + dyn_syms = xmalloc (storage); > + dyn_count = bfd_canonicalize_dynamic_symtab (abfd, dyn_syms); > + if (dyn_count < 0) > + bfd_fatal (bfd_get_filename (abfd)); > + } > } > synth_count = bfd_get_synthetic_symtab (abfd, static_count, static_syms, > dyn_count, dyn_syms, &synthsyms); > > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-01-26 20:33 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-01-24 21:51 BFD: /home/cagney/tmp/a.out(.rela.plt): relocation 0 has invalid symbol index 1 Andrew Cagney 2005-01-24 21:53 ` Ian Lance Taylor 2005-01-24 22:24 ` Andrew Cagney 2005-01-25 9:54 ` Alan Modra 2005-01-25 10:30 ` Alan Modra 2005-01-26 20:33 ` Andrew Cagney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).