This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] MIPS: Incorrect calculation for R_MIPS_LO16 relocs
On Tue, 29 Jun 2004, Richard Sandiford wrote:
> Still, it is an ABI change, as indicated by your follow-on patches.
Yep, a fix for the current BFD MIPS ABI to bring it back to sanity. ;-)
Note that all the follow-on patches patches fix real bugs, that can lead
to broken binaries for certain offsets, where a carry from a LO16 reloc
has nowhere to propagate to.
> We've traditionally been able to cope with R_MIPS_LO16 relocations
> without finding their corresponding high part. So...
Perhaps this was wrong -- the MIPS ABI is explicit about using HI16
relocations for calculating the addend associated with LO16 ones;
repeating the quote:
"R_MIPS_LO16 entries without an R_MIPS_HI16 entry immediately preceding
are orphaned and the previously defined R_MIPS_HI16 is used for computing
the addend."
> > IMO this should be fixed some other way.
>
> ...I still think this is true.
Feel free to write a different fix.
I'm actually very happy about my changes -- they've let me discover a lot
of bugs hidden elsewhere. There are bugs in current GCC, too, that are
easily revealed now by "orphaned %lo relocation" messages. They're quite
rare -- only a bunch of them for a Linux kernel build, but still. I'll
look for a possible fix.
Maciej