This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


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

RE: Section alignment question



On 17-Feb-00 Grant Edwards wrote:
> 
> I just ran into a bug caused by the .data section not being
> word-aligned on the ARM target.  I changed the line in target.ld
> from
> 
>      .data   ALIGN (0x1)  : [...]
> to      
>      .data   ALIGN (0x4)  : [...]
> 
> and now everything is fine.  Obviously the real fix needs to be
> further upstream. The target.ld file for arm/pidBE forces the
> .bss section to be word aligned, but not any of the others.
> AFAICT, they all need to be word aligned (at least they do for
> my processor).  Apparently I've just been lucky in the past.
> 
> Is this alignment requirement unique to my hardware (Samsung
> KS32C5000)?
> 
> If not, why hasn't this been a problem before now -- is there
> some mechanism (other than luck) that I don't understand (and
> have now borken in my new platform configuration) that in the
> past causing the other sections to be aligned properly?
> 
> -- 
> Grant Edwards
> grante@visi.com
> 

Making all of the subsections aligned thus would seem prudent.  We'll
look into it.

For the moment though, I'm curious how you created a subsection which
messed up the alignment in the first place.  All the examples I can
find (and most likely every program we've ever run) do not have this
problem.

Can you send me a map of your file?  Use the command:
  arm-elf-objdump -h <file>
This will clue me in on how this has happened.  (Of course I want to
see it built with the old align(1) directives).

Thanks.

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