Error: internal_relocation (type: OFFSET_IMM) not fixed up

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.

Reply to
nik
Loading thread data ...

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
Reply to
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.

Reply to
nik

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.

Reply to
nik

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 !
Reply to
42Bastian Schick

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

Reply to
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.

Reply to
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
Reply to
Tauno Voipio

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

--

Tauno Voipio
tauno voipio (at) iki fi
Reply to
Tauno Voipio

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.

Reply to
nik

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
Reply to
Tauno Voipio

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.

Reply to
nik

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
Reply to
Tauno Voipio
[ 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/
Reply to
druck

(- quoting of snips clipped off -)

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

--

Tauno Voipio
Reply to
Tauno Voipio

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

Thanks a lot.

Reply to
nik

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

Reply to
jonnio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.