[PATCH] D39959: [ELF] - Allow merging of strings sections for -relocatable output.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 06:38:33 PST 2017


>> jhenderson added a comment.
>>
>> Given that the issue with not combining sections was purely restricted to .debug_str, which only ever has an entsize of 1, would it not >make more sense to not combine the InputSections for different entsize values?
>>
>> I'm wary about removing the SHF_MERGE flag, because I'm pretty sure mergeable sections of different sizes are not that rare, although >they do not typically have the same name, so maybe it's okay.
>
>I agree. We should merge SHF_MERGE sections in pretty much the same way
>we do for regular (non -r) output. We then just assign each
>MergeSyntheticSection to its own OutputSection and keep the SHF_MERGE
>flag.
>
>Cheers,
>Rafael

Well, that was not that simple (because I had to fix relocations which turned out to have broken info/addend),
but patch is: https://reviews.llvm.org/D40026.

Honestly not sure how much it is good way. It required more changes I expected to see.
May be we should just stop merging sections with different sh_entsize instead ?
(if just dropping merge optimization like my first patch did is not acceptable).

George.


More information about the llvm-commits mailing list