Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: arm-elf-ld trouble

2006-05-27 by Richard Duits

Make sure the identifier from your error message is exactly the same as 
the identifier after the .global. I used to code x86 assembler in masm 
or tasm and there you had to prefix the identifier with an underscore ( 
_ ). When I started with ARM also did this and it gave the same errors 
you are getting now.

Make sure you use extern "C" { ..... } if you are coding in c++, 
otherwise the identifiers are decorated (to make overloading possible 
and add some extra error checking).

Regards,
Richard.


dgaydou wrote:
> i\ufffdm afraid, i\ufffdve already done it, as you tell me in your example. It
> must be something else... another idea, please.
> Thanks for your help
>
> --- In lpc2000@yahoogroups.com, "brendanmurphy37"
> <brendanmurphy37@...> wrote:
> >
> > --- In lpc2000@yahoogroups.com, "dgaydou" <dgaydou@> wrote:
> > >
> > > Hi group,
> > > i`m doing my first steps with LPC2114 and gnuarm. I\ufffdve found a
> > trouble
> > > when i try to link the objects files from c-sources and as-
> sources
> > with
> > > arm-elf-ld and the following parameters : -Map main.map -
> > TPruebaLPC.ld -
> > > t. The linker tell me: Undefined reference to `THOSE FUNCTIONS
> > THAT ARE
> > > WROTE IN ASSEMBLER`; although i\ufffdve declared those functions in my
> > > headers files and properly included. Hope someone can help me.
> > Thanks.
> > >
> >
> > Do you have the assembler directive ".global" in the assembler
> > source file? Without it the function name is not visible to the
> > linker. This behaviour is different from 'C' in that the default is
> > NOT to make function names visible.
> >
> > Example:
> >
> > /* list functions exported from this file */
> >
> > .global      GetCPSR, SomeOtherFunction
> >
> > /* implementation of GetCPSR */
> >
> > GetCPSR:
> >     mrs  r0, cpsr  /* Get CPSR */
> >     bx   lr        /* return to caller */
> >
> > This can be declared in 'C' as:
> >
> > unsigned int GetCPSR(void);
> >
> > and used as:
> >
> > unsigned int cpsr = GetCPSR();
> >
> > My guess is that this is your problem.
> >
> > Brendan
> >
>
>
>
>
>
>
> SPONSORED LINKS
> Microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microcontrollers&w2=Microprocessor&w3=Intel+microprocessors&c=3&s=69&.sig=c-HXthtbZy4TZbI3ib0PMg> 
> 	Microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microcontrollers&w2=Microprocessor&w3=Intel+microprocessors&c=3&s=69&.sig=ijt0SspWtjogcHCuFD0lUQ> 
> 	Intel microprocessors 
> <http://groups.yahoo.com/gads?t=ms&k=Intel+microprocessors&w1=Microcontrollers&w2=Microprocessor&w3=Intel+microprocessors&c=3&s=69&.sig=WOZdpklkgHbXR5quAgrl5w> 
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "lpc2000
>       <http://groups.yahoo.com/group/lpc2000>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        lpc2000-unsubscribe@yahoogroups.com
>       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.