This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: binutils is broken on ELF/mips (Re: binutils is broken on Linux/alpha)


On Thu, Oct 04, 2001 at 10:19:12AM -0700, H . J . Lu wrote:
> On Thu, Oct 04, 2001 at 09:56:38AM -0700, H . J . Lu wrote:
> > On Fri, Oct 05, 2001 at 02:09:51AM +0930, Alan Modra wrote:
> > > On Thu, Oct 04, 2001 at 09:31:15AM -0700, H . J . Lu wrote:
> > > > 
> > > > http://sources.redhat.com/ml/binutils/2001-09/msg00507.html
> > > > 
> > > > breaks ELF/mips. I am trying to find out why. I think ELF/mips does
> > > > its own symbol tracking. Removing some linkonce symbols causes the
> > > > ELF/mips backend to crash. I don't know what other targets are also
> > > > affected.
> > > 
> > > Or is it just that the mips back-end relies on isec->symbol->value
> > > being set?
> > 
> > The ELF/mips backend died at
> > 
> >    5878             {
> >    5879               indx = elf_section_data (sec->output_section)->dynindx;
> > 			     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >    5880               if (indx == 0)
> >    5881                 abort ();
> >    5882             }
> > 
> 
> Here is the problem at line 6083 in elf32-mips.c, the working ld has
> 
> (gdb) p *sec                
> $42 = {name = 0x82bddf0 ".gnu.linkonce.t.postError__8GLUnurbsi", id = 123, 
>   index = 11, next = 0x82bf574, flags = 1049143, user_set_vma = 1, 
>   reloc_done = 0, linker_mark = 0, linker_has_input = 0, gc_mark = 0, 
>   segment_mark = 0, vma = 0, lma = 0, _cooked_size = 120, _raw_size = 120, 
>   output_offset = 637476, output_section = 0x83946d0, alignment_power = 2, 
>   relocation = 0x0, orelocation = 0x0, reloc_count = 2, filepos = 7216, 
>   rel_filepos = 21880, line_filepos = 0, userdata = 0x0, contents = 0x0, 
>   lineno = 0x0, lineno_count = 0, entsize = 0, comdat = 0x0, 
>   kept_section = 0x82b3724, moving_line_filepos = 0, target_index = 0, 
>   used_by_bfd = 0x82bf46c, constructor_chain = 0x0, owner = 0x82a5470, 
>   symbol = 0x82bf42c, symbol_ptr_ptr = 0x82bf41c, link_order_head = 0x0, 
>   link_order_tail = 0x0}
> (gdb) p *sec->output_section
> $41 = {name = 0x8282270 ".text", id = 1698, index = 9, next = 0x8394884, 
>   flags = 8520243, user_set_vma = 1, reloc_done = 0, linker_mark = 0, 
>   linker_has_input = 1, gc_mark = 0, segment_mark = 0, vma = 80032, 
>   lma = 80032, _cooked_size = 0, _raw_size = 662356, output_offset = 0, 
>   output_section = 0x83946d0, alignment_power = 4, relocation = 0x0, 
>   orelocation = 0x0, reloc_count = 0, filepos = 80032, rel_filepos = 0, 
>   line_filepos = 0, userdata = 0x8285360, contents = 0x0, lineno = 0x0, 
>   lineno_count = 0, entsize = 0, comdat = 0x0, kept_section = 0x0, 
>   moving_line_filepos = 0, target_index = 9, used_by_bfd = 0x83947c0, 
>   constructor_chain = 0x0, owner = 0x8285508, symbol = 0x8394780, 
>   symbol_ptr_ptr = 0x8394770, link_order_head = 0x8654320, 
>   link_order_tail = 0x86569b8}
> 
> The broken one has
> 
> (gdb) p *sec
> $18 = {name = 0x8131e18 ".gnu.linkonce.t.postError__8GLUnurbsi", id = 123, 
>   index = 11, next = 0x81334d8, flags = 1049143, user_set_vma = 1, 
>   reloc_done = 0, linker_mark = 0, linker_has_input = 0, gc_mark = 0, 
>   segment_mark = 0, vma = 0, lma = 0, _cooked_size = 120, _raw_size = 120, 
>   output_offset = 0, output_section = 0x80cc200, alignment_power = 2, 
>   relocation = 0x0, orelocation = 0x0, reloc_count = 2, filepos = 7216, 
>   rel_filepos = 21880, line_filepos = 0, userdata = 0x0, contents = 0x0, 
>   lineno = 0x0, lineno_count = 0, entsize = 0, comdat = 0x0, 
>   moving_line_filepos = 0, target_index = 0, used_by_bfd = 0x81333d0, 
>   constructor_chain = 0x0, owner = 0x8119498, symbol = 0x8133390, 
>   symbol_ptr_ptr = 0x8133380, link_order_head = 0x0, link_order_tail = 0x0}
> (gdb) p *sec->output_section
> $19 = {name = 0x80d6f53 "*ABS*", id = 2, index = 0, next = 0x0, flags = 0, 
>   user_set_vma = 0, reloc_done = 0, linker_mark = 0, linker_has_input = 0, 
>   gc_mark = 1, segment_mark = 0, vma = 0, lma = 0, _cooked_size = 0, 
>   _raw_size = 0, output_offset = 0, output_section = 0x80cc200, 
>   alignment_power = 0, relocation = 0x0, orelocation = 0x0, reloc_count = 0, 
>   filepos = 0, rel_filepos = 0, line_filepos = 0, userdata = 0x0, 
>   contents = 0x0, lineno = 0x0, lineno_count = 0, entsize = 0, comdat = 0x0, 
>   moving_line_filepos = 0, target_index = 0, used_by_bfd = 0x0, 
>   constructor_chain = 0x0, owner = 0x0, symbol = 0x80cc020, 
>   symbol_ptr_ptr = 0x80cc1ec, link_order_head = 0x0, link_order_tail = 0x0}
> 

That is it. The ELF/mips tries to perform relocation in a linkonce
section which has been removed. I will take a look.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]