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: ARM section alignment


Nick:

Sorry for delay. I was off hunting other snarks.

I decided to see where else __QNXTARGET__ is being used. It is used for
three targets, and always in the same way:

  efl32-arm.c:    change min section alignment from 0x8000 to 0x1000
  elf32-ppc.c:    change min section alignment from 0x10000 to 0x1000
  elf32-sh.c:     change min section alignment from 0x80 to 0x1000

In my opinion, two guidelines should determine the min section alignment
restriction:

  1. the minimal alignment in binutils should be a consequence of the
     hardware-imposed requirements under the normal use-case. It
     should not depend on the target triple. I think you and I agree
     about this.

  2. If a particular target triple wants a larger (more pessimistic)
     alignment, this should be done in an ldscript file.

     I think you and I agree about this as well.

I think you and I now agree on what to do about elf32-arm.c

I am inclined to think that elf32-ppc.c should probably be
MAX_PAGESIZE=0x1000 in all cases, and any alignment restrictions that
are more restrictive than that should be implemented in the ldscript
template file for ppc-elf if required. I don't know whether such a
requirement actually exists. If the QNX setting actually works, then it
seems likely that there is no hard requirement for a more pessimistic
alignment.

I'm uncertain what to do about the SuperSH target. My concern is that an
ldscript apparently cannot override the alignment value to anything that
is less than MAX_PAGESIZE. Given this, I am concerned that 0x80 wasn't a
randomly chosen value and I'm concerned about the possibility of
increasing the address space span requirement on this architecture.

All of that being said, my suggestion is to set all of them to 0x1000 in
all cases, and drop the __QNXTARGET__ macro throughout.

Concur?


shap

On Wed, 2008-06-18 at 12:33 +0100, Nick Clifton wrote:
> Hi Jonathan,
> 
> > This is why I raised the possibility of the fix that I suggested in
> > earlier email:
> > 
> >   1. Change MAXPAGESIZE to 0x1000, matching the majority of current
> >      usage and permitting linker scripts to operate in the way that
> >      you propose (which doesn't work now).
> > 
> >   2. Having done so, kill the __QNXTARGET__macro off -- at least here.
> > 
> >   3. Let users who require 0x8000 alignment do it with a linker script,
> >      which seems like it might have been the right approach all along.
> 
> OK, this makes sense to me now.  I am sorry that you had to keep banging 
> my head against a wall until I could see this, but now I agree with you.
> 
> So - next step is to implement a patch that does this.  Presumably you 
> have something in mind ?
> 
> Cheers
>    Nick
> 


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