This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: ralocation entries and relaxation questions.


Hi Ravi,

> I do not understand your reason for not doing it at the assembly stage
> itself. Why should the existence of branches between 'br .l1' and
> '.l1:'. matter ? 

For example consider next code snippet:

	br  .l1		; local branch
	...
	br  ext_global	; branch to external 
	...
.l1:
	...

In case of assembly time relaxation the code will be transformed to:

	jmp	.l1	; short local branch. Reloc entry is deleted.
			; assume, this reloc was '.text + 10'
	...
	br	ext_global
	...
.l1:			; this is a location .text + 10

If ext_global is not too far linker will produce:
	
	0:	jmp	.text + 10	
		...
	6:	jmp ext_global	; this jmp jumps to correct place
		...
	.l1:			; now this is .text + 8 and we want to jump
here
	8:	some_insn 			
	10:	...		; first jmp will land here which is wrong
place


Therefore I want to keep all relocs. However, '.text+XXX's are neither
listed in locals nor in globals. 

Cheers,
Dmitry.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]