[llvm] r175327 - Derive ELF section type from the name in some cases where GNU as does

Eli Bendersky eliben at google.com
Fri Feb 15 16:47:22 PST 2013


On Fri, Feb 15, 2013 at 4:44 PM, Eric Christopher <echristo at gmail.com> wrote:
>
> Comments?
>
>>
>> -  if (!TypeName.empty()) {
>> +  if (TypeName.empty()) {
>
>
> Technically don't need the braces here, but honestly in this case I like
> them :)
>

Dangling else ambiguity avoidance FTW ;-)


>>
>> +    if (SectionName.startswith(".note"))
>> +      Type = ELF::SHT_NOTE;
>> +    else if (SectionName == ".init_array")
>> +      Type = ELF::SHT_INIT_ARRAY;
>> +    else if (SectionName == ".fini_array")
>> +      Type = ELF::SHT_FINI_ARRAY;
>> +    else if (SectionName == ".preinit_array")
>> +      Type = ELF::SHT_PREINIT_ARRAY;
>> +  } else {
>>      if (TypeName == "init_array")
>>        Type = ELF::SHT_INIT_ARRAY;
>>      else if (TypeName == "fini_array")
>
>
> -eric
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list