mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
d73932922b
If rexflag is non-zero, it's used to insert an REX prefix byte in asmins. That's a while after put4 and put8 take note of the address of a relocation. So let them be aware that if rexflag is non-zero, the relocation's address is to be higher. Reproduction: The program int global; int f(void){return global;} is compiled to the IR assembly TEXT f+0(SB),0,$0 MOVL global+0(SB),AX RET , RET , GLOBL global+0(SB),$4 END , and (using 6l -u) the machine code 8b042508 000000c3 The relocation (see a.out(6)) correctly applies to the 08 00 00 00. The program int *global; int *f(void){return global;} is compiled to TEXT f+0(SB),0,$0 MOVQ global+0(SB),AX RET , RET , GLOBL global+0(SB),$8 END , and the machine code 488b0425 10000000 c3020000 00000000 What's different is the added REX prefix 0x48, but the relocation is done at the same place in the binary, which now is 25 10 00 00 instead of the correct 10 00 00 00. |
||
---|---|---|
.. | ||
doc | ||
games/lib | ||
include | ||
lib | ||
man | ||
src |