This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: compiled result not align to 4 bytes
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Frank Lin <franklin373 at gmail dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Thu, 22 May 2008 05:08:56 -0600
- Subject: Re: [ECOS] compiled result not align to 4 bytes
- References: <004101c8bbe0$96ba7690$9c1efea9@self9873de9bd3>
Frank Lin wrote:
I developed an application, but has problem, I use arm-elf-object -D ??? to got latter result, I find these code compiled from assembly file context.s not aligh to 4 bytes.
My global compiler flags is:
mcpu=arm7tdmi -mno-short-load-words -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -gdwarf-2 -g3 -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority
My global linker flags is:
-mcpu=arm7tdmi -mno-short-load-words -Wl,--gc-sections -Wl,-static -gdwarf-2 -g3 -nostdlib
Whether it is caused by gcc bug? To solve this problem, whether I should place .align 4 to every assembly file, or any simple way exists?
Latter disassembly code's right part is my comments.
What version of GCC & BINUTILS are you using?
Note that these come from different source files, so it may be a linker problem.
0c1102a8 <hal_lsbindex>:
0c110345 <hal_thread_switch_context>: <-----------not aligh to 4 bytes
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss