This is an archive of the discontinued LLVM Phabricator instance.

[dsymutil][DWARFLinker][NFC] Make interface of AddressMap more general.
ClosedPublic

Authored by avl on Sep 15 2020, 1:48 PM.

Details

Summary

Current interface of AddressMap assumes that relocations exist.
That is correct for not-linked object file but is not correct
for linked executable. This patch changes interface in such way
that AddressMap could be used not only with not-linked object files:

hasValidRelocationAt()

replaced with:

hasLiveMemoryLocation()
hasLiveAddressRange()

Diff Detail

Event Timeline

avl created this revision.Sep 15 2020, 1:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2020, 1:48 PM
avl requested review of this revision.Sep 15 2020, 1:48 PM

What's the scenario where you run the DWARF linker with already-linked binaries?

llvm/include/llvm/DWARFLinker/DWARFLinker.h
67–78
73–75
avl marked 2 inline comments as done.Sep 22 2020, 12:57 AM

What's the scenario where you run the DWARF linker with already-linked binaries?

That is currently discussed proposal of dsymutil-like tool for ELF - http://lists.llvm.org/pipermail/llvm-dev/2020-August/144579.html
Though the proposal is still being discussed it is useful to have interfaces to be in general form so that DWARFLinker could be re-used in various scenarios.

avl updated this revision to Diff 302128.Nov 1 2020, 1:58 AM

addressed comments(changed text of commentary).

JDevlieghere accepted this revision.Dec 4 2020, 3:22 PM

Oops, sorry this got lost in my review queue. This LGTM.

This revision is now accepted and ready to land.Dec 4 2020, 3:22 PM
This revision was landed with ongoing or failed builds.Dec 10 2020, 3:57 AM
This revision was automatically updated to reflect the committed changes.