This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
RE: Section alignment question
- To: Grant Edwards <grante at visi dot com>
- Subject: RE: [ECOS] Section alignment question
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Fri, 18 Feb 2000 05:25:53 -0700 (MST)
- Cc: ecos-discuss at sourceware dot cygnus dot com
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.