On 7/17/24 12:27 PM, Georg-Johann Lay wrote:
y.

May be that's already the case with -mlink-relax?  IIRC that was
introduced to keep the assembler from resolving label differences
when the linker may relax and hence change label differences, because
it shredded debug info.
You never know if a given chunk of library code is going to be used in a relaxing link or not. So the safe thing is to disable those resolutions unconditionally if the port has relaxing linker support.



}

with -mrelax, the code is:

0000004c <trelax>:
   4c:    01 c0           rjmp    .+2          ; 0x50 <L0^A+0x2>

0000004e <L0^A>:
   4e:    15 c0           rjmp    .+42         ; 0x7a <main>
   50:    03 94           inc    r0
   52:    08 95           ret
Often when I'm looking at this stuff I use objdump -dr so that I can see the relocations as well.


And there is the complication that a zero_reg optimization
must only be performed on asm code from C/C++ that is using
the avr-gcc ABI.  But that could be handled by options, so
we'd have a change to the decide-specs again :-/
Or maybe better by a directive like .abi gcc or so.
Can't really give much guidance on this...  Sorry.

jeff

Reply via email to