This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with relocation records (PowerPC)


On Thu, 1 Feb 2001, Paul Mikell wrote:

>       28:   80 60 00 00       lwz r3,0(r0)
>                   2a: R_PPC_EMB_SDA21 __DBInterface

Whatever generated this violates the PPC processor specific ABI

"Relocation entries apply to halfwords or words. In either case, the
r_offset value designates the offset or virtual address of the first byte
of the affected storage unit. The relocation type specifies which bits to
change and how to calculate their values."

R_PPC_EMB_SDA21 changes 21 bits (5 register bits + 16 offset bits), so it
falls into the class of relocs that apply to words.  ie. the GNU tools are
correct to place the offset at the start of the instruction.

> instruction? If the latter, is there a tool for adjusting the addresses of
> relocation records in pre-compiled libraries?

Not that I'm aware of.  You could always write one.  There's plenty of
example code to handle reading and writing of relocs in bfd/

Alan Modra
-- 
Linuxcare.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]