Subject: Assember error msg

From: "Adam 'WeirdArms' Wiggins" <[email-masked]>
Date: Wed, 29 Sep 1999 02:36:32 +1000 (EST)

Can anyone shed some light on the following error:

syscall.S: Assembler messages:
syscall.S:170: Error: Internal_relocation (type 178) not fixed up
(IMMEDIATE)
make[1]: *** [syscall.o] Error 1

	Its part of my own code (not linux). The instruction is:

	adr     tmp0, fast_syscall_return

tmp0 is a #define to a register, fast_syscall_return is a label in another
source file (doesn't matter if I make it local)

	Its the first time I've used adr so maybe my syntax is wrong?

	Cheers Adam

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Ben Williamson <[email-masked]>
Date: Mon, 2 Aug 1999 10:21:58 -0700 (PWT)

> source file (doesn't matter if I make it local)

I think it has to be local AND in the same section as the instruction, ie
in the .text section.  Otherwise the assembler can't figure out how far it
is from the instruction to the label, and there's a good chance it will
be too far anyway.  Hope that helps,

- Ben.

-------------------------------------------------------------------
Ben Williamson       [email-masked]     http://www.pobox.com/~benw/

---

From: "Adam 'WeirdArms' Wiggins" <[email-masked]>
Date: Wed, 29 Sep 1999 03:23:46 +1000 (EST)

> be too far anyway.  Hope that helps,

	Ah, ok, when i changed it to local I did change sections. Is there
anyway to get around the local restriction?

	Cheers Adam

---

From: Nicolas Pitre <[email-masked]>
Date: Tue, 28 Sep 1999 13:28:05 -0400 (EDT)

> 	Its the first time I've used adr so maybe my syntax is wrong?

I think adr is a macro in the assembler  that loads the address of a
symbol by adding a value to the pc.  It may not be used across files and
sections I think.

Nicolas

---

From: Philip Blundell <[email-masked]>
Date: Tue, 28 Sep 1999 19:38:37 +0100

>source file (doesn't matter if I make it local)

Remember that ADR is syntactic sugar for 'add rN, pc, #const'.  If the label 
is in another file then the offset to it is not an assemble-time constant and 
the instruction can't be generated (currently the GNU tools don't support 
immediate relocations).

You can do 'ldr tmp0, =fast_syscall_return' which will be slightly less 
efficient but more robust.  Otherwise you have to make the symbol definition
visible to the assembler or teach it how to handle the necessary relocations.

I can't offhand think why it would fail when the label is local (assuming it's 
in the same section).  It might always be an assembler bug -- I think you'll 
have to post a more complete example if you still have trouble.

p.

---

From: "Adam 'WeirdArms' Wiggins" <[email-masked]>
Date: Wed, 29 Sep 1999 21:29:35 +1000 (EST)

> the instruction can't be generated (currently the GNU tools don't support 

	Or sub :)
> visible to the assembler or teach it how to handle the necessary relocations.
	I'm avoiding ldr's, the problem was wrong section for the local
label. I moved the real label into the same file, now all works even if
the file is a little bloated now.

	Cheers Adam