This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/4701: binutils generates invalid klibc-based binary on Linux x86_64
On Thu, Jun 28, 2007 at 11:13:46AM +0930, Alan Modra wrote:
> On Wed, Jun 27, 2007 at 05:38:52PM -0700, H. J. Lu wrote:
> > On Thu, Jun 28, 2007 at 09:31:40AM +0930, Alan Modra wrote:
> > > On Wed, Jun 27, 2007 at 11:44:10AM -0700, H. J. Lu wrote:
> > > > On Wed, Jun 27, 2007 at 11:09:03AM -0700, H. J. Lu wrote:
> > > > > I don't think we can skip segment alignment on disk when its offset
> > > > > < alignment. This patch fixes it. I will try to find a small testcase.
> > >
> > > Why ever does file offset matter for a segment that isn't loaded from
> > > disk??
> >
> > >From gABI:
> [snip]
> > I don't think it follows gABI.
>
> I'd like to weasel out of this by claiming that a PT_LOAD segment
> isn't a loadable segment if it isn't actually loaded, but I guess I'm
> stretching the standard. Also, I'd still like to understand why file
> offset matters to klibc for PT_LOAD segments that contain no file
> contents. I know ld.so is OK with them. Demand paging of
> executables, the underlying reason why p_offset must equal p_vaddr
> modulo pagesize, clearly isn't affected.
>
Linux ld.so isn't OK with your change. We haven't seen the problem
because we won't get a PT_LOAD segment with .bss sections only
using the default linker script. I uploaded a testcase to:
http://sourceware.org/bugzilla/show_bug.cgi?id=4701
You should be to reproduce it on Linux/ia32 and Linux/x86-64.
H.J.