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
On Tue, Feb 01, 2000 at 04:39:00PM -0500, Ian Lance Taylor wrote:
> Date: Tue, 1 Feb 2000 13:35:06 -0800
> From: "H . J . Lu" <hjl@valinux.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.
>
> .rel.text section normally hold relocations. The linker expects them
> to do so. Do these .rel.text sections hold relocations? If they do,
> then naturally the linker will remove them, just as it removes all
> relocation sections.
Yes. Those rel.text sections do hold relocations. But the .o files are
not compiled with -fPIC. Without -Bsymbolic, linker will create/copy
those .rel.text sections in the resulting DSO. With -Bsymbolic, those
.rel.text sections seem to be removed. The Solaris/x86 linker generates
the .rel.text section with and without -Bsymbolic. I will check why
those .rel.text sections are removed.
H.J.