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]
Other format: [Raw text]

Re: Fwd: Problems with -ffunction-sections


On Tue, Jul 09, 2002 at 01:22:13AM +0200, Helge Deller wrote:
> ----------  Forwarded Message  ----------
> Subject: Re: Problems with -ffunction-sections
> To: deller@gmx.de (Helge Deller)
> Date: Sun, 23 Jun 2002 02:15:52 -0400 (EDT)
> From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
> 
> I tried building the package with 3.2.  Unfortunately, I wasn't successful.
> With "-ffunction-sections", I hit a linker segmentation fault.

Ouch.  Me too.

Program received signal SIGSEGV, Segmentation fault.
elf32_hppa_relocate_section (output_bfd=0xbbde0, info=0xab7d4,
    input_bfd=0x18e9310, input_section=0x18f7d34, contents=0x4027c008 "",
    relocs=0x18f43e0, local_syms=0x20231b0, local_sections=0x22198a0)
    at /home/amodra/binutils-current/bfd/elf32-hppa.c:4023

                  if (! plabel
                      && sym_sec != NULL
                      && sym_sec->output_section != NULL
                      && ! bfd_is_abs_section (sym_sec))
                    {
=>                    indx = elf_section_data (sym_sec->output_section)->dynind\
x;
                      /* We are turning this relocation into one
                         against a section symbol, so subtract out the
                         output section's address but not the offset
                         of the input section in the output section.  */
                      outrel.r_addend -= sym_sec->output_section->vma;
                    }

(gdb) p sym_sec->name
$1 = 0x18ea3e9 ".rodata.str1.4"
(gdb) p sym_sec->output_section
$2 = (struct sec *) 0x8ca1c
(gdb) p ((struct bfd_elf_section_data*)sym_sec->output_section->used_by_bfd)
$3 = (struct bfd_elf_section_data *) 0x0
(gdb) p *sym_sec->output_section
$4 = {name = 0x8c890 "*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 = 0x8ca1c,
  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 = 0x8c8d0,
  symbol_ptr_ptr = 0x8ca18, link_order_head = 0x0, link_order_tail = 0x0}
(gdb) p *sym_sec
$5 = {name = 0x18ea3e9 ".rodata.str1.4", id = 21837, index = 3,
  next = 0x18f7ad4, flags = 1610875475, 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 = 0, _raw_size = 84, output_offset = 0,
  output_section = 0x8ca1c, alignment_power = 2, relocation = 0x0,
  orelocation = 0x0, reloc_count = 0, filepos = 64, rel_filepos = 0,
  line_filepos = 0, userdata = 0x0, contents = 0x0, lineno = 0x0,
  lineno_count = 0, entsize = 1, comdat = 0x0, moving_line_filepos = 0,
  target_index = 0, used_by_bfd = 0x18fca58, constructor_chain = 0x0,
  owner = 0x18e9310, symbol = 0x18fca20, symbol_ptr_ptr = 0x18f7ab4,
  link_order_head = 0x0, link_order_tail = 0x0}
(gdb) p/x sym_sec->flags
$6 = 0x60040253

It's a SEC_MERGE section, which is why sym_sec->output_section is
set to bfd_abs_section.  I'll bet this problem affects binutils all
over the place.  :-(

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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