Given an assembly file like: *** asm file *** .global foo lis 3, foo@h+4 **************** When I assemble and run objdump I get: *** as/objdump output *** $ as -o test.o test.s && objdump -Dr test.o test.o: file format elf32-powerpc Disassembly of section .text: 00000000 <l1>: 0: 3c 60 00 00 lis r3,0 2: R_PPC_ADDR16_HI foo+0x8 ************************* It appears that the relocation is being applied to the result of '<address of foo> + 0x8'. My understanding is that the immediate field of the 'lis' should have a value of 0x8 and the relocation should only apply to 'foo'. The output I expect would look like: *** expected as/objdump output *** $ as -o test.o test.s && objdump -Dr test.o test.o: file format elf32-powerpc Disassembly of section .text: 00000000 <l1>: 0: 3c 60 00 08 lis r3,8 2: R_PPC_ADDR16_HI foo ********************************** I'm using ubuntu jaunty ppc. My binutils package is version '2.19.1-0ubuntu3'. Is this a problem with my understanding of how arguments in ppc assembly should be parsed, or in the way gas does assembly?
Powerpc uses RELA relocations where the addend is stored in the relocation entry.
Thanks for the quick clarification.