This is an archive of the discontinued LLVM Phabricator instance.

[IAS] Support '.word foo-.' on targets that permit this (e.g. Mips).
AbandonedPublic

Authored by dsanders on May 29 2015, 9:10 AM.

Details

Reviewers
None
Summary

This is necessary to support DW_EH_PE_pcrel encoded TType references in the
exception handling LSDA on Mips.

Previously for Mips, IAS would emit an R_MIPS_32 relocation given
'.word foo-.' making it functionally equivalent to '.word foo'. It now
emits a R_MIPS_PC32 relocation. Despite the name, R_MIPS_PC32 has
historically been used on data sections and the 'PC' in this context is
the address of the data being fixed up.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 26785.May 29 2015, 9:10 AM
dsanders retitled this revision from to [IAS] Support '.word foo-.' on targets that permit this (e.g. Mips)..
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a subscriber: Unknown Object (MLST).

What is Mips specific about this? With

.word foo-.

We already produce a R_X86_64_PC16 for example.

We already produce a R_X86_64_PC16 for example.

Hmm. Maybe I'm fixing this in the wrong place.
Do you know how it does this? The current implementation of EmitValueImpl() calls MCFixup::getKindForSize() with the isPCRel argument equal to false and I don't see anything that turns FK_Data_2 fixups into PC-relative equivalents.

I fixed the tip of the iceberg in r238751. It should be somewhat easy
to add the other sizes.

Thanks. That's much simpler than what I was doing. I'll go through the others.

dsanders abandoned this revision.Jun 1 2015, 8:22 AM

Abandoned this patch since there's a much better way to do it.