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

Eric Christopher echristo at gmail.com
Fri Feb 15 16:44:07 PST 2013


Comments?


> -  if (!TypeName.empty()) {
> +  if (TypeName.empty()) {
>

Technically don't need the braces here, but honestly in this case I like
them :)


> +    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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130215/dba1534b/attachment.html>


More information about the llvm-commits mailing list