The linker produces a segmentation fault on undefined references in the small
data area.
Test program:
extern int i;
void f()
{
i = 1;
}
powerpc-rtems4.9-gcc -meabi -msdata -c test.c
Binutils version:
/tmp/binutils/bin/powerpc-rtems4.9-ld --version
GNU ld (GNU Binutils) 2.19.50.20080911
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
GDB output:
gdb --args /tmp/binutils/bin/powerpc-rtems4.9-ld test.o
GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-suse-linux"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) r
Starting program: /tmp/binutils/bin/powerpc-rtems4.9-ld test.o
/tmp/binutils/bin/powerpc-rtems4.9-ld: warning: cannot find entry symbol _start;
defaulting to 01800054
test.o: In function `f':
test.c:(.text+0x10): undefined reference to `i'
/tmp/binutils/bin/powerpc-rtems4.9-ld: BFD (GNU Binutils) 2.19.50.20080911
assertion fail /home/sebastian_h/cvs-binutils/bfd/elf32-ppc.c:7076
Program received signal SIGSEGV, Segmentation fault.
ppc_elf_relocate_section (output_bfd=0x71aee0, info=0x706920,
input_bfd=0x727510, input_section=0x7299f8, contents=0x745900
"\224!��\223�",
relocs=, local_syms=0x7459f0, local_sections=0x745ae0)
at /home/sebastian_h/cvs-binutils/bfd/elf32-ppc.c:7077
7077name = bfd_get_section_name (abfd, sec->output_section);
(gdb) info stack
#0 ppc_elf_relocate_section (output_bfd=0x71aee0, info=0x706920,
input_bfd=0x727510, input_section=0x7299f8, contents=0x745900
"\224!��\223�",
relocs=, local_syms=0x7459f0, local_sections=0x745ae0)
at /home/sebastian_h/cvs-binutils/bfd/elf32-ppc.c:7077
#1 0x0045c0e2 in bfd_elf_final_link (abfd=0x71aee0, info=0x706920) at
/home/sebastian_h/cvs-binutils/bfd/elflink.c:9251
#2 0x00415591 in ldwrite () at
/home/sebastian_h/cvs-binutils/ld/ldwrite.c:567
#3 0x00414da2 in main (argc=2, argv=0x7fffa6ec6b98) at
/home/sebastian_h/cvs-binutils/ld/ldmain.c:462
(gdb) quit
--
Summary: Segmentation fault for PowerPC ld and EABI + SDATA
Product: binutils
Version: 2.20 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: sebastian dot huber at embedded-brains dot de
CC: bug-binutils at gnu dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=6888
--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.
___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils