This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Explicitly list supported relocations for x86 target.
ClosedPublic

Authored by grimar on Jan 10 2017, 7:40 AM.

Details

Summary

Previously some value was returned by default for relocations by getRelExpr(),
even if relocation actually was not supported.

This is orthogonal alternative to D28094.
Instead of implementing probably useless R_386_PC8/R_386_8 relocations,
this patch uses them in a testcase to demonstrate what happens
when LLD mets unsupported relocations.

Patch passes all testcases and changes logic only for x86.
Patches for other targets can be posted separatelly.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 83807.Jan 10 2017, 7:40 AM
grimar retitled this revision from to [ELF] - Explicitly list supported relocations for x86 target..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.
grimar planned changes to this revision.Jan 10 2017, 7:42 AM

Going to recheck this, sorry,

grimar requested a review of this revision.Jan 10 2017, 8:06 AM

What I was not sure is if R_ABS correct value for R_386_TLS_LDO_32,
but that is unrelative to logic of this patch, R_ABS was returned before that change by default.
So I suggest to land this one and I'll check R_386_TLS_LDO_32 handling separatelly.

ruiu accepted this revision.Jan 10 2017, 12:15 PM
ruiu edited edge metadata.

LGTM

ELF/Target.cpp
387 ↗(On Diff #83807)

Put a space before '('.

This revision is now accepted and ready to land.Jan 10 2017, 12:15 PM
This revision was automatically updated to reflect the committed changes.