[PATCH] D76085: [DWARFLinker][dsymutil][NFC] add section index into address range.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 14:35:18 PDT 2020


dblaikie added a comment.

In D76085#1927241 <https://reviews.llvm.org/D76085#1927241>, @avl wrote:

> > I'm not sure I understand the alternative - are you picturing doing the DWARF reduction and updating relocations and then feeding the reduced but unrelocated DWARF into lld's linking step?
>
> yes. I planned to do in that way.
>
> 1. Do DWARF reduction. (Do not patch DWARF address values(LowPC, HighPC...) as dsymutil usually does, fix relocations in-sections offsets)
> 2. Go through usual linking process which would resolve relocations and put proper address values.


While these are understandably different situations, keeping them similar seems like there's some value - so I'd be inclined to encourage you to see if there's a way to make the lld situation more like the llvm-dsymutil situation (where the DWARF reduction also applies relocations, essentially) or potentially make the llvm-dsymutil situation more like lld (could be useful to reuse pieces of lld that make for efficient section rewriting, etc, to improve llvm-dsymutil/share more code there).

Certainly llvm-dwp would probably benefit from being rephrased in terms of lld functionality (as binutils dwp uses some of gold's infrastructure - though admittedly not a lot, in part because dwp doesn't need to apply relocations, for instance).

>> The debug map seems like it should be the same data structure that would be used for applying relocations anyway - is it not? I'd be surprised if it was significantly different/new cost to have that data available for the DWARF linking as it would be for the relocation application.
> 
> I would check it more. If all necessary info could be produced from the single relocation(without preliminary gathering data and creating additional maps) then - yes, it is cheap.

I think that'd be worthwhile to investigate/understand.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76085/new/

https://reviews.llvm.org/D76085





More information about the llvm-commits mailing list