This is the mail archive of the mailing list for the GDB 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: DSO with relocations and GDB.

> > BFD internal section data structure for .debug_info section is not
> > marked with SEC_RELOC in flags and number of relocation records for
> > the section is 0.  objdump -h output shows that sh_link(points to
> > .symtab) and sh_link(points to .debug_info) are set correctly for the
> > section.
> That's the real problem; you may want to ask the binutils list
> or debug how with sh_link/sh_info set there is still no SEC_RELOC
> flag.
> --
> Daniel Jacobowitz
> CodeSourcery
Thanks for your suggestion.  One correction and further observation follows:
 sh_info points to .debug_info  and sh_link is pointing to .dynsym,
not .symtab. This is expected outcome in a ET_DYN file.

However, the bfd/elf.c code shown below does not handle relocations
using .dynsym.

/* If this reloc section does not use the main symbol table we
           don't treat it as a reloc section.  BFD can't adequately
           represent such a section, so at least for now, we don't
           try.  We just present it as a normal section.  We also
           can't use it as a reloc section if it points to the null
           section, an invalid section, or another reloc section.  */
        if (hdr->sh_link != elf_onesymtab (abfd)
            || hdr->sh_info == SHN_UNDEF
            || (hdr->sh_info >= SHN_LORESERVE && hdr->sh_info <= SHN_HIRESERVE)
            || hdr->sh_info >= num_sec
            || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL
            || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA)
          return _bfd_elf_make_section_from_shdr (abfd, hdr, name,

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