Writing addend into instructions

Torbjorn Granlund tege@swox.com
Tue Mar 13 12:53:00 GMT 2001


Some assembler backends write addends into relocation fields, in
addition to into the relocation record itself.  An example is
tc-ppc.c.

For some object file formats, that is actually desirable.  IBM's XCOFF
format is one example.

But for ELF, writing the addends into, say, a 16-bit instruction field
seems like a strange thing to do.  Most ELF ABIs require that such
addends are ignored anyway.

We've rewritten md_apply_fix3 of tc-ppc.c, and the new version only
patches relocation addresses when a fixup is fully resolved, never
when a relocation with a separate addend is generated.

Does anybody see any problems with such a change?

-- 
Torbjörn



More information about the Binutils mailing list