I think I am seeing a possible compiler code generation error. Look at the
following

--------------
  14: 3d 20 00 00  lis r9,0
   16: R_PPC_ADDR16_HA .rodata
  18: 38 69 00 00  addi r3,r9,0
   1a: R_PPC_ADDR16_LO .rodata
  1c: 38 80 00 00  li r4,0
  20: 48 00 00 01  bl 20 <GlobalProc+0x20>
--------------

This is part of an objdump of a PowerPC  code segment so this does not apply
to Intel compatibles.
The error (so I believe) is the use of 'addi' to load the least-significant
part of the jump address. Accordingly to the manual (and I tested this also
- of cause) if the most-significant bit in the least-significant part if 1
(0x00008000) you will loose that bit because 'addi' will look at it signed
which means it will subtract instead.
IMHO 'ori' should be used instead.

Any comments? Am I wrong?

Cheers,
Karsten Jeppesen

Reply via email to