This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Allow getErrPlace() to work before Out::bufferStart is set
ClosedPublic

Authored by arichardson on Nov 25 2019, 2:01 AM.

Details

Summary

So far it seems like the only test affected by this change is the one I
recently added for R_MIPS_JALR relocations since the other test cases that
use this function early (unknown-relocation-*) do not have a valid input
section for the relocation offset.

Diff Detail

Event Timeline

arichardson created this revision.Nov 25 2019, 2:01 AM
MaskRay accepted this revision.Nov 25 2019, 12:54 PM
This revision is now accepted and ready to land.Nov 25 2019, 12:54 PM
ruiu added inline comments.Nov 25 2019, 4:56 PM
lld/ELF/Target.cpp
109

If Out::bufferStart is a nullptr, does this if statement always succeed?

arichardson marked an inline comment as done.Dec 2 2019, 2:58 AM
arichardson added inline comments.
lld/ELF/Target.cpp
109

I don't believe so, since isec->data().data() will only be in range for the matching input section

ruiu accepted this revision.Dec 12 2019, 12:18 AM

LGTM

This revision was automatically updated to reflect the committed changes.
arichardson reopened this revision.Dec 13 2019, 2:07 PM
This revision is now accepted and ready to land.Dec 13 2019, 2:07 PM

Fix for UBSAN failure

Unit tests: pass. 60867 tests passed, 0 failed and 726 were skipped.

clang-format: pass.

Build artifacts: console-log.txt, CMakeCache.txt, test-results.xml, diff.json

This revision was automatically updated to reflect the committed changes.