Error: internal_relocation (type: OFFSET_IMM) not fixed up

Sep 28, 2008 16 Replies

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.


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

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.

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.

You must define these constants (the immediate value can not be resolved during linking).

42Bastian Do not email to bastian42@yahoo.com, it's a spam-only account :-) Use @monlynx.de instead !

Thanks Bastian ! Is there any tutorial which explains the runtime file crt0.S ?

One more question. Is it necessary to link both- crt0.S and startup.S ?

Thanks !

Nik

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.

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

Please do not start a new thread with the same question. I already answered the original thread.

Tauno Voipio tauno voipio (at) iki fi

p
p
p
p

Thanks Tauno.

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

desktop:~/armgcc$ arm-elf-gcc -c -Wa,-ahlms=3Dcrt0.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.

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).

Tauno Voipio tauno voipio (at) iki fi

up

up

up

up

p
p
p
p

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.

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
[ 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/

(- quoting of snips clipped off -)

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

Tauno Voipio

Thank you all guys. The prob got solved with some changes in the startup file.

Thanks a lot.

This usually means there is a #define statement that wasn't defined. The 'not fixed up' part means the value in the assembler was not present.

Jon

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required