This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: SIGSEGV in ld at elflink.h:5500
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: amodra at bigpond dot net dot au (Alan Modra)
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 18 Jul 2002 03:45:03 -0400 (EDT)
- Subject: Re: SIGSEGV in ld at elflink.h:5500
> On Thu, Jul 18, 2002 at 02:06:50AM -0400, John David Anglin wrote:
> > > > So, what do we do? We have have a reference in the data section
> > > > to a local label in a function that has been deleted. On hppa-linux,
> > > > the above data is in .eh_frame. Is it somehow special?
> > >
> > > OK, so it's likely a gcc bug. You want the eh data in .eh_frame, as
> > > .eh_frame is special. See bfd/elflink.h:elf_bfd_discard_info.
> >
> > I put the eh data into .eh_frame. However, I still get a seg fault
> > at the same spot although the symbol and section have changed. It
> > looks as if the code figured out that the reloc symbol was deleted
> > but still the fault.
>
> Take a look at what's happening at elf64-hppa.c:1514 under gdb.
> I suspect you have forced-local syms being added as local dynamic
> syms. Bad.
I believe that only dynamic local syms are being added. reloc_entries
are added to list by count_dyn_reloc. This is only called when need_entry
has NEED_DYNREL, and sec->flags & SEC_ALLOC. However, this is the path
by which the local dyn symbols are being added. This must be something
wrong with the removal process for local dyn symbols.
I hacked elflink.h to skip discarded sections. However, now ld
seg faults linking apps:
/xxx/gnu/gcc-3.2/objdir/gcc/libgcc.a(__main.o): In function `__do_global_dtors':
/xxx/gnu/gcc-3.2/objdir/gcc/../../gcc/gcc/libgcc2.c:1899: undefined reference to `__EH_FRAME_BEGIN__'
Program received signal SIGSEGV, Segmentation fault.
0x4000000000063164 in elf64_hppa_finalize_dlt (dyn_h=???, data=???)
at ../../src/bfd/elf64-hppa.c:2271
2271 value += h->root.u.def.section->output_section->vma;
(gdb) p h->root
$3 = {root = {next = 0x8000000000154490,
string = 0x800000000017e4be "__EH_FRAME_BEGIN__", hash = 60347007},
type = bfd_link_hash_undefined, next = 0x80000000000eea30, u = {undef = {
abfd = 0x8000000000091ad0}, def = {value = 9223372036855372496,
section = 0x4000000000096420}, i = {link = 0x8000000000091ad0,
warning = 0x4000000000096420 "òs\020!\n\223\n3òs\020c\n³\n36u"}, c = {
size = 9223372036855372496, p = 0x4000000000096420}}}
Too many bugs.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)