[PATCH] D40063: Propagate sh_entsize out

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 09:22:39 PST 2017


>I don't think it is possible, but I might be missing something.
>
>If it is not SHF_STRINGS, every piece in one section will have size X
>and size Y != X in the other.
>
>If it is SHF_STRINGS, every piece in one section will end with a X sized
>null and end with a Y sized null in the other.

Yeah, looks true, my mistake.

>> ================
>> Comment at: ELF/SyntheticSections.cpp:2531
>>        S = Syn;
>> +      Syn->Entsize = MS->Entsize;
>>      } else {
>> ----------------
>> That is probably fine for this patch, but I find confusing that we emit SHF_MERGE flag and wrong EntSize to
>> regular output. Currently we select max entrysize when adding input sections to output section.
>> That does not make much sence I believe.
>>
>> We probably might want to drop entry size and flag when doing non-relocatable link in followups.
>
>From an lld organization I think it makes sense for the synthetic section
>to have a entsize. What I think is odd is the logic keeping the max for
>the output section. It might be best to use 0 if an output section has
>input sections of different entsize.
>

I fully agree here.

George.



More information about the llvm-commits mailing list