This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Possible problem debug sections default addresses on powerpc-linux-gnu
- To: Alan Modra <alan at linuxcare dot com dot au>
- Subject: Re: Possible problem debug sections default addresses on powerpc-linux-gnu
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Fri, 14 Apr 2000 16:37:01 +0200
- Cc: binutils at sourceware dot cygnus dot com
- References: <00041401520100.01764@enzo.bigblue.local>
At 01:13 14.04.00, Alan Modra wrote:
>On Fri, 14 Apr 2000, Franz Sirl wrote:
>
> > arch/ppc/kernel/head.o: In function `start_here':
> > arch/ppc/kernel/head.o(.text+0x2214): relocation truncated to fit:
> R_PPC_REL24 identify_machine
> > ...
> > arch/ppc/kernel/kernel.o: In function `m8xx_init_IRQ':
> > arch/ppc/kernel/kernel.o(.text.init+0x558): relocation truncated to
> fit: R_PPC_REL24 cpm_interrupt_init
> > arch/ppc/kernel/kernel.o: In function `m8xx_init':
> > arch/ppc/kernel/kernel.o(.text.init+0x5cc): relocation truncated to
> fit: R_PPC_REL24 memcpy
> > arch/ppc/kernel/kernel.o(.text.init+0x610): relocation truncated to
> fit: R_PPC_REL24 strcpy
>
>The above is likely caused by a bug is the reloc range checking (one of
>mine, sorry) which was fixed a couple of days ago. H.J. has a 2.9.5.0.35
>release with the fix.
Ok, I used .35 this time. Without your patch everything is fine, though I
noticed that 3 sections are placed different from a plain .34. Here the
output of a plain .34:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk
Inf Al
[ 0] NULL 00000000 000000 000000
00 0 0 0
[ 1] .text PROGBITS c0000000 010000 174318
00 AX 0 0 16
[ 2] .rodata PROGBITS c0174320 184320 0415e0
00 A 0 0 16
[ 3] .kstrtab PROGBITS c01b5900 1c5900 003a54
00 A 0 0 4
[ 4] __ksymtab PROGBITS c01b9354 1c9354 001c88
00 A 0 0 4
[ 5] .data PROGBITS c01bb000 1cb000 022f14
00 WA 0 0 16
[ 6] .eh_frame PROGBITS c01ddf14 1edf14 026f34
00 WA 0 0 4
[ 7] __ex_table PROGBITS c0204e48 214e48 000f50
00 A 0 0 4
[ 8] .data.cacheline_a PROGBITS c0205da0 215da0 000020
00 WA 0 0 4
[ 9] .text.init PROGBITS c0206000 216000 020270
00 AX 0 0 4
[10] .data.init PROGBITS c0226270 236270 0074b4
00 WA 0 0 4
[11] .text.pmac PROGBITS c022e000 23e000 002d2c
00 AX 0 0 4
[12] .data.pmac PROGBITS c0230d2c 240d2c 000020
00 WA 0 0 4
[13] .text.prep PROGBITS c0231000 241000 001070
00 AX 0 0 4
[14] .data.prep PROGBITS c0232070 242070 006b9c
00 WA 0 0 4
[15] .text.openfirmwar PROGBITS c0239000 249000 002bec
00 AX 0 0 4
[16] .data.openfirmwar PROGBITS c023bbec 24bbec 000200
00 WA 0 0 1
[17] .bss NOBITS c023c000 24c000 0436f0
00 WA 0 0 16
[18] .debug_abbrev PROGBITS c027f6f0 24c000 05e994
00 0 0 1
[19] .debug_info PROGBITS c02de084 2aa994 220ed6e
00 0 0 1
[20] .debug_line PROGBITS c24ecdf2 24b9702 40395c
00 0 0 1
[21] .debug_pubnames PROGBITS c28f074e 28bd05e 01e794
00 0 0 1
[22] .debug_aranges PROGBITS c290eee2 28db7f2 003db0
00 0 0 1
[23] .comment PROGBITS c2912c92 28df5a2 004a70
00 0 0 1
[24] .shstrtab STRTAB 00000000 28e4012 00012a
00 0 0 1
[25] .symtab SYMTAB 00000000 28e4574 02af00
10 26 1640 4
[26] .strtab STRTAB 00000000 290f474 027f65
00 0 0 1
And now a plain .35 output:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk
Inf Al
[ 0] NULL 00000000 000000 000000
00 0 0 0
[ 1] .text PROGBITS c0000000 010000 174318
00 AX 0 0 16
[ 2] .rodata PROGBITS c0174320 184320 0415e0
00 A 0 0 16
[ 3] .data PROGBITS c01bb000 1cb000 022f14
00 WA 0 0 16
[ 4] __ex_table PROGBITS c0204e48 214e48 000f50
00 A 0 0 4
[ 5] .data.cacheline_a PROGBITS c0205da0 215da0 000020
00 WA 0 0 4
[ 6] .text.init PROGBITS c0206000 216000 020270
00 AX 0 0 4
[ 7] .data.init PROGBITS c0226270 236270 0074b4
00 WA 0 0 4
[ 8] .text.pmac PROGBITS c022e000 23e000 002d2c
00 AX 0 0 4
[ 9] .data.pmac PROGBITS c0230d2c 240d2c 000020
00 WA 0 0 4
[10] .text.prep PROGBITS c0231000 241000 001070
00 AX 0 0 4
[11] .data.prep PROGBITS c0232070 242070 006b9c
00 WA 0 0 4
[12] .text.openfirmwar PROGBITS c0239000 249000 002bec
00 AX 0 0 4
[13] .data.openfirmwar PROGBITS c023bbec 24bbec 000200
00 WA 0 0 1
[14] .bss NOBITS c023c000 24c000 0436f0
00 WA 0 0 16
[15] .debug_abbrev PROGBITS c027f6f0 24c000 05e994
00 0 0 1
[16] .debug_info PROGBITS c02de084 2aa994 220ed6e
00 0 0 1
[17] .debug_line PROGBITS c24ecdf2 24b9702 40395c
00 0 0 1
[18] .eh_frame PROGBITS c01ddf14 1edf14 026f34
00 WA 0 0 4
[19] .debug_pubnames PROGBITS c28f074e 28bd05e 01e794
00 0 0 1
[20] .debug_aranges PROGBITS c290eee2 28db7f2 003db0
00 0 0 1
[21] .comment PROGBITS c2912c92 28df5a2 004a70
00 0 0 1
[22] .kstrtab PROGBITS c01b5900 1c5900 003a54
00 A 0 0 4
[23] __ksymtab PROGBITS c01b9354 1c9354 001c88
00 A 0 0 4
[24] .shstrtab STRTAB 00000000 28e4012 00012a
00 0 0 1
[25] .symtab SYMTAB 00000000 28e4574 02af00
10 26 1640 4
[26] .strtab STRTAB 00000000 290f474 027f65
00 0 0 1
Note how .eh_frame, .kstrtab and __ksymtab changed places. I know that this
is another omission in the PPC vmlinux.lds linker script, but I thought you
might be interested in this effect of your "keep orphans in order" patch.
Now, with .35+patch, the segfault is gone, but I still get the relocation
errors and even a lot more of them. If I add the debug sections to the
linker script, everything works fine though, so it's definitely the new
handling of orphaned debug sections, that lets this relocation errors show
up. I have a feeling though, that this might be a bug in the PPC part of
the linker you are triggering here. What if the address field in debug
sections is incorrectly used on PPC by the linker? And maybe with a correct
linker script the address field is zeroed out later than with your patch?
> > make: *** [vmlinux] Segmentation fault (core dumped)
> > make: *** Deleting file `vmlinux'
>
>This is more worrying. Can you report a little more detail on the core
>dump? A gdb back-trace might be useful.
Here is the backtrace you requested. I'm willing to debug it further, if
you are still interested in the reasons, now that .35+patch doesn't
segfault anymore. I'm off for snowboarding til Sunday evening though.
(gdb) bt
#0 0xff9ab68 in bfd_getb32 () from /usr/lib/libbfd-2.9.5.0.34.so
#1 0xffbffd8 in read_4_bytes () from /usr/lib/libbfd-2.9.5.0.34.so
#2 0xffc0d1c in decode_line_info () from /usr/lib/libbfd-2.9.5.0.34.so
#3 0xffc1cd0 in comp_unit_find_nearest_line () from
/usr/lib/libbfd-2.9.5.0.34.so
#4 0xffc1fe4 in _bfd_dwarf2_find_nearest_line () from
/usr/lib/libbfd-2.9.5.0.34.so
#5 0xffbe5c4 in _bfd_elf_find_nearest_line () from
/usr/lib/libbfd-2.9.5.0.34.so
#6 0x10017bf4 in _init ()
#7 0x10018164 in _init ()
#8 0x10013dd8 in _init ()
#9 0xffab850 in ppc_elf_relocate_section () from /usr/lib/libbfd-2.9.5.0.34.so
#10 0xffb4f4c in elf_link_input_bfd () from /usr/lib/libbfd-2.9.5.0.34.so
#11 0xffb34ec in bfd_elf32_bfd_final_link () from /usr/lib/libbfd-2.9.5.0.34.so
#12 0xffb6834 in _bfd_elf32_gc_common_final_link () from
/usr/lib/libbfd-2.9.5.0.34.so
#13 0x10014c88 in _init ()
#14 0x10011474 in _init ()
#15 0xfe6573c in __libc_start_main (argc=268763136, argv=0x0,
envp=0x10050000, auxvec=0x10052f64, rtld_fini=0xc2c3a54e,
Franz.