[PATCH] D40070: [ELF] - Don't emit broken relocations for SHF_MERGE sections when --emit-relocs is used.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 00:04:19 PST 2017


>> +    // Relocations are not using REL[A] section symbols.
>> +    if (IS->Type == SHT_REL || IS->Type == SHT_RELA)
>> +      continue;
>> +
>> +    // We do not create symbol for synthetic sections because do not have
>> +    // relocations that might use it, but SHF_MERGE sections is an exception
>> +    // used for -r. After applying merging optimisation we want to rewrite
>> +    // relocations and need section symbol for synthetic mergeable sections to
>> +    // refer to.
>> +    if (isa<SyntheticSection>(IS) && !(IS->Flags & SHF_MERGE))
>>        continue;
>
>Not just for -r.

Right, will change "used for -r" to "used for --emit-relocs" for this patch before commit
and update this comment in patch for -r (D40026).

>LGTM
>
>Thanks,
>.Rafael

Thanks ! Rui, what do you think, can we land it to unblock D40026 which depends on this one ?

George.


More information about the llvm-commits mailing list