Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error: internal_relocation (type: OFFSET_IMM) not fixed up

1,638 views
Skip to first unread message

nik

unread,
Sep 28, 2008, 5:30:36 AM9/28/08
to
Hello

I am using gcc 4.1.1 as a cross compiler for arm on ubuntu.
Being a rookie in gcc, I have very little knowledge of it.

I am trying to assemble the crt0.s file using the command
-desktop:~/armgcc$ arm-elf-as crt0.s


But what I am getting is :

crt0.s: Assembler messages:
crt0.s:157: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.s:160: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.s:162: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.s:163: Error: internal_relocation (type: OFFSET_IMM) not fixed up


The lines 157,160,162,163 that are giving errors are :
str r0,[r1,#PS_PCER_OFF]

str r0,[r1,#PIO_PER_OFF]

str r0,[r1,#PIO_CODR_OFF]

str r0,[r1,#PIO_OER_OFF]

Please help me out with the cause and solution for this error.

Thanks.

nik

unread,
Sep 29, 2008, 1:23:37 AM9/29/08
to

Tauno Voipio

unread,
Sep 28, 2008, 10:09:21 AM9/28/08
to


There are unexpanded macros for the PIO port offsets.

Are you sure that the source file is crt0.s and not crt0.S?

--

Tauno Voipio

nik

unread,
Sep 29, 2008, 6:42:56 AM9/29/08
to

Hello Tauno.
Thanks for the reply.

Sorry it was an typing mistake. Its crt0.S.
But still the error is the same.
~/armgcc$ arm-elf-as crt0.S -o crt0.o
crt0.S: Assembler messages:
crt0.S:166: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.S:169: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.S:171: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.S:172: Error: internal_relocation (type: OFFSET_IMM) not fixed up

So, any suggestion ?

One more question - Do i need both - startup.S and crt0.S ?

Thanks.
Nik.

Tauno Voipio

unread,
Sep 29, 2008, 2:55:48 PM9/29/08
to


You need a header where the PIO offset macros are
#define'd, and you need to feed the source through
the pre-processor.

Use arm-elf-gcc to translate - it does understand
to feed the source via the C pre-processor.

Try this:

arm-elf-gcc -c -Wa,-ahlms=crt0.lst crt0.S

You'll get an assembly listing, too.

--

Tauno Voipio
tauno voipio (at) iki fi

nik

unread,
Sep 30, 2008, 3:40:34 AM9/30/08
to

Thanks Tauno.


I tried the above mentioned option. But its still the same

desktop:~/armgcc$ arm-elf-gcc -c -Wa,-ahlms=crt0.lst crt0.S
crt0.S: Assembler messages:
crt0.S:54: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.S:55: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.S:56: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.S:57: Error: internal_relocation (type: OFFSET_IMM) not fixed up
crt0.S:60: Error: internal_relocation (type: OFFSET_IMM) not fixed up


Expecting your further help.

And sorry for the double post. It was by mistake.

Thanks.

Tauno Voipio

unread,
Sep 30, 2008, 12:26:36 PM9/30/08
to

OK - Now find the missing header file.

The macros are probably in a .h file that should be
#include'd into the source.

Where is your source from?
What is your target processor? (The offsets are for
registers outside the ARM core, so the exact chip type
is needed).

nik

unread,
Oct 1, 2008, 2:32:36 AM10/1/08
to

Hello Tauno,

Thanks for the response.

The source is hand written by myself.Its just the simple code to
switch pins high and low continuously.
My target processor is LPC2368 by NXP. I have modified the RAM and ROM
addresses according to the user manual.

Thanks.

Tauno Voipio

unread,
Oct 1, 2008, 2:26:37 PM10/1/08
to


Good.

Please name it to something else than crt0.S - it is the
usual name for the C runtime startup module. This time,
it mislead my responses - it would have been plenty quicker,
if I had known that we are talking about a self-coded module.

So, go get the PIO definitions and you'll have the translated
code. It is a different story whether it will work ...

--

Regards,
Tauno

druck

unread,
Oct 1, 2008, 7:35:03 PM10/1/08
to
On 1 Oct 2008 Tauno Voipio <tauno....@INVALIDiki.fi> wrote:

[ EIGHTY SIX lines of quoting snipped]

[ 7 lines of reply snipped]

FFS please learn to remove anything from the previous messages you
aren't directly replying to, we've got better things to do than
scroll through it all.

---druck

--
The ARM Club Free Software - http://www.armclub.org.uk/free/
The 32bit Conversions Page - http://www.quantumsoft.co.uk/druck/

Tauno Voipio

unread,
Oct 2, 2008, 12:22:03 PM10/2/08
to
druck wrote:
> On 1 Oct 2008 Tauno Voipio <tauno....@INVALIDiki.fi> wrote:
>

(- quoting of snips clipped off -)

> FFS please learn to remove anything from the previous messages you
> aren't directly replying to, we've got better things to do than
> scroll through it all.
>
> ---druck
>

Sorry - I was simply lazy, maybe pissed off
by the misleading info at first.

--

Tauno Voipio

nik

unread,
Oct 6, 2008, 11:31:43 AM10/6/08
to
Thank you all guys.
The prob got solved with some changes in the startup file.


Thanks a lot.

0 new messages