This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: The problem with linkonce sections in ELF
- To: Ian Lance Taylor <ian at zembu dot com>
- Subject: Re: The problem with linkonce sections in ELF
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Tue, 1 Feb 2000 13:35:06 -0800
- Cc: binutils at sourceware dot cygnus dot com
- References: <20000131184519.A14245@valinux.com> <20000201042719.11854.qmail@daffy.airs.com> <20000201131850.A22685@valinux.com> <20000201212450.4180.qmail@daffy.airs.com>
On Tue, Feb 01, 2000 at 04:24:50PM -0500, Ian Lance Taylor wrote:
>
> Leaving a hole in the address space is clearly a bug. Your patch
> should not be necessary. Why are these sections being created with a
> non-zero size, and then being removed? That makes no sense.
>
I was given some .o files with .rel.text sections and linker
removes them when generating DSO with -Bsymbolic.
BTW, I have a feeling that those .o files are not compiled
with PIC. I will check it out.
> Your patch is just papering over whatever the real problem is. There
> is no reason to treat .rel.text differently from any other .rel
> section.
That may be true.
>
> However, there is another bug. Under certain conditions,
> _bfd_elf_set_section_contents will be called on the ".rel.init"
> sections with the section offset == 0, which corrupts the ELF header
> among others. I have no idea why _bfd_elf_set_section_contents is
> called with section offset == 0. I will be happy to provide a binary
> testcase on Linux/x86.
>
> This, too, is evidently a bug. Can you investigate why the sh_offset
> field is 0? What is the size of the section? Who is calling
All fields are zero.
> _bfd_elf_set_section_contents?
>
bfd_set_section_contents in section.c. It looks like a -Bsymbolic bug.
--
H.J. Lu (hjl@gnu.org)