Section layout with ld script for flash based ARM system : what's wrong?

Vincent Rubiolo vincent.rubiolo@st.com
Tue Jun 10 14:22:00 GMT 2003


Thanks Bill for the information.

I added the -mlong-calls switch and lots of errors are gone but, as the docs 
say, it doesn't handle the calls via function pointers (I keep having a 
relocation error for call_via_r2 and call_via_r3 functions).
I will investigate that more carefully.

A few others questions while I have you :)
1. What is the difference between .section "SectionName","rx" and .text only? If 
I look at 
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=utf-8&threadm=3AC03478.1B406FA1%40iis.fhg.de&rnum=3&prev=/groups%3Fq%3Dvariables%2B%2Busing%2B%2Bld%2B%2BGNU%2B%2Bscript%2B%2Bmemory%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3Dutf-8%26selm%3D3AC03478.1B406FA1%2540iis.fhg.de%26rnum%3D3
it seems the linker does not properly set LMA != VMA if a section doesn't have 
these attributes.
2. Here a very simple script:
	.text 0x01000080 :	
	{
		test1.o (.text .rodata)
		test2.o (.text .rodata)
		Text_End = .	;
	}
	
	.data 0x00000000 : AT(Text_End)  <===========here
	{
		* (.data .bss COMMON)
	}
	end = . ;

If I change the Text_End reference in the AT command to 0x01000080+ 
SIZEOF(.text), the error about .data section overlapping .text section is gone. 
I can't understand why since, AFAIK both are the same...

3. (and last, thanks for keeping reading :)
What are .glue7 and .glue7t sections? I suspect it is the equivalent of ADS 
veneers but I'm not sure. I also have a .rodata.str1.4 section which seems odd 
to me.

Thanks for these answers, it is hard to find information about these

Vincent

bgat@billgatliff.com wrote:

> Vincent:
> 
> 
> Among other things, "Relocation truncated to fit" means that the linker 
> tried to generate a reference to something in a short B or BL 
> instruction, and couldn't fit it into the 24 bits (IIRC) available in 
> that opcode.  In other words, the reference destination is too far away 
> from the reference to represent.
> 
> Check out gcc's -mlong-calls switch.
> 
> Also, you may want to give gdb's ARM instruction set simulator a try. 
> Could be quicker than crashing and burning on real hardware.  :^)
> 
> 
> b.g.
> 


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list