This is an archive of the discontinued LLVM Phabricator instance.

[DWARF] - Add API to allow DWARFContextInMemory to delegate relocations handling to client.
AbandonedPublic

Authored by grimar on Jul 5 2017, 4:05 AM.

Details

Summary

Previously DWARFContextInMemory handled relocations by itself.
(or used pre-relocated section content via another API)
This patch adds way to delegate relocations handling to client for each
relocation section.

I am using it in patch for LLD to speedup .gdb_index building, will
upload it and add dependency to this one really soon.

That allows to do some custom things, for example when building .gdb_index
looks we do not need to perform relocations computations for .debug_ranges,
all we need is to scan relocations to find the section indexes for futher use.

Diff Detail

Event Timeline

grimar created this revision.Jul 5 2017, 4:05 AM
grimar added a comment.Jul 5 2017, 4:35 AM

LLD patch where it is used is: D35005.

This patch also may be useful if client wants just to skip relocations proccessing for
particular sections. For example we do not need to proccess relocations for .debug_line when building
.gdb_index, patch allows to ignore this section.

dblaikie added inline comments.Jul 5 2017, 10:06 AM
include/llvm/DebugInfo/DIContext.h
225–231

Three slashes for a doxy comment?

232

Probably call this 'gatherRelocations' (since it doesn't actually modify the section, etc - but puts the relocations in the RelocAddrMap)

233

Looks like 'Map' should be taken by reference rather than pointer (since it's never null)

grimar abandoned this revision.Jul 17 2017, 8:30 AM

D35005 was abandoned.