Login

Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.

ARM Community: a link error when build PI codes use RVCT3.1 - ARM Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

a link error when build PI codes use RVCT3.1 Rate Topic: -----

#1 User is offline   fulean 

  • Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 27-July 09

Posted 28 March 2012 - 01:48 AM

i get the below link error when compiled with --apcs /ropi under rvct3.1 (while ads1.2 don't have this problem):

Error: L6248E: al_thumb.o<aApp_ENGINE_AS> in PI region 'ER_RO' cannot have address type relocation to Image$$RO$$Limit in PI region 'ER_RO'

and if i comment out " ldr r2,=|Image$$RO$$Limit| " in al_thumb.s, this error can be eliminated.

can any body tell me what's the problem ? how can i solve it ? thanks!
0

#2 User is offline   fulean 

  • Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 27-July 09

Posted 28 March 2012 - 08:26 AM

any suggestion ?
0

#3 User is offline   scott 

  • Regular Contributor
  • PipPipPip
  • Group: Members.
  • Posts: 207
  • Joined: 05-October 06

Posted 28 March 2012 - 03:54 PM

The problem with the (pseudo) instruction
	LDR r2,=|Image$RO$Limit|



is that |Image$RO$Limit| *is* position-independent. Effectively the linker is saying "I can't tell what the value of |Image$RO$Limit| is going to be at runtime because it's defined in a position-independent section. (Well, not 'in' exactly, but you know what I mean.) And I don't know the run-time addresses of position-independent sections."

[ADS shouldn't have let you link with --ropi either; I wonder what it did do.]

What use is the code making of |Image$RO$Limit|? It's kindof a suspect thing to want to determine in position-independent code.

If you're sure that you really want that value, I suspect the easiest way to get it is to compile the following --apcs /ropi and either just call the function or examine what the compiler does to determine the value.
	extern const char Image$RO$Limit[];
	const void *get_RO_Limit() { return Image$RO$Limit; }


1

#4 User is offline   fulean 

  • Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 27-July 09

Posted 29 March 2012 - 01:18 AM

scott,thanks you very much.
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic