This is the mail archive of the binutils@sourceware.org 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: PATCH: PR ld/4504: Copy relocation doesn't preserve section alignment


On Mon, May 14, 2007 at 03:51:49PM -0700, H. J. Lu wrote:
> On Mon, May 14, 2007 at 12:52:44PM -0700, H. J. Lu wrote:
> > This patch fixes the longstanding ELF linker bug by applying
> > the maximum alignment to all symbols needing copy relocation.  We
> > can get the maximum alignment from the section alignment where
> > they are defined.
> > 
> > 
> 
> Here are an updated patch and a testcase patch.
> 
> There may be more than one shared libraries with different section
> alignments. The alignment of .dynbss is the maximum alignment among
> all section alignments.  When we align the symbol in .dynbss, we only
> need to apply the current section alignment, not the maximum alignment
> of .dynbss. 
> 
> 

We can move symbol setup and section size adjustment to the generic
function. Also shared libray can only guarantee symbol alignment up
to the page size. So my original test will fail on systems which don't
use copy relocation.

Here are updated patches. Tested on Linux/ia32/Intel64/ia64.


H.J.

Attachment: bfd-dynbss-4.patch
Description: Text document

Attachment: ld-test-dynbss-2.patch
Description: Text document


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