[ECOS] Re: Problem linking eCos application

Daniel Néri daniel.neri@sigicom.se
Thu May 8 09:56:00 GMT 2003


Hmm, something went wrong with that last post. Here it goes again, w/
the patch inline instead of as an attachment...


Thomas Koeller <thomas@koeller.dyndns.org> writes:

> I have come across a strange problem when building an eCos
> application for the ARM AT91 target. I noticed that code placed
> in section .text is misaligned.

[snip]

> The problem does only show for debug builds (-O0 -ggdb3), not for
> release builds (-O3), where everything is properly aligned.

I've seen this problem too, a few weeks ago when I was playing with
debugging options (changed -g to -ggdb).

I ended up inserting an explicit align directive (see patch below),
and haven't had any problems since then (though I also went back to
plain old -g).

It looks like a binutils problem, but I haven't had time to research
it properly.

> I am using gcc-3.2.2 and binutils 2.13.2.1, all built from sources
> (on Linux).

I used the same tool versions.


Regards,
   --Daniel



------------ begin ARM reset_vector misalign "fix" ----------------
diff -u -5 -p -r1.1 -r1.2
--- vectors.S	2003/01/27 11:15:30	1.1
+++ vectors.S	2003/03/28 18:24:53	1.2
@@ -254,11 +254,12 @@ ice_thread_vector:
 // Other vectors - this may include "fixed" locations
 #ifdef PLATFORM_VECTORS
         PLATFORM_VECTORS
 #endif
                         
-        .text   
+        .text
+        .balign 4
 // Startup code which will get the machine into supervisor mode
         .global reset_vector
         .type   reset_vector,function
 reset_vector:
         PLATFORM_SETUP1         // Early stage platform initialization

------------ end ARM reset_vector misalign "fix" ------------------


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list