[PATCH] D26937: llvm-nm: Print correct symbol types for init and fini sections

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 09:39:37 PST 2016


LGTM.

Thanks,
Rafael


On 21 November 2016 at 17:09, Meador Inge via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> meadori created this revision.
> meadori added reviewers: llvm-commits, Bigcheese, enderby.
>
> This patch fixes a small bug where symbols defined in the INIT
> and FINI sections were incorrectly getting a type of 'n'.
>
>
> https://reviews.llvm.org/D26937
>
> Files:
>   test/tools/llvm-nm/X86/Inputs/init-fini.out.elf-x86_64
>   test/tools/llvm-nm/X86/init-fini.test
>   tools/llvm-nm/llvm-nm.cpp
>
>
> Index: tools/llvm-nm/llvm-nm.cpp
> ===================================================================
> --- tools/llvm-nm/llvm-nm.cpp
> +++ tools/llvm-nm/llvm-nm.cpp
> @@ -778,6 +778,9 @@
>        break;
>      case ELF::SHT_NOBITS:
>        return 'b';
> +    case ELF::SHT_INIT_ARRAY:
> +    case ELF::SHT_FINI_ARRAY:
> +      return 't';
>      }
>    }
>
> Index: test/tools/llvm-nm/X86/init-fini.test
> ===================================================================
> --- /dev/null
> +++ test/tools/llvm-nm/X86/init-fini.test
> @@ -0,0 +1,8 @@
> +# RUN: llvm-nm -B -S %p/Inputs/init-fini.out.elf-x86_64 | FileCheck --match-full-lines %s
> +
> +CHECK: 00000000006000c2 0000000000000000 T __bss_start
> +CHECK: 00000000006000c2 0000000000000000 t __init_array_end
> +CHECK: 00000000006000ba 0000000000000000 t __init_array_start
> +CHECK: 00000000006000c2 0000000000000000 T _edata
> +CHECK: 00000000006000c8 0000000000000000 T _end
> +CHECK: 00000000004000b0 0000000000000000 T _start
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>


More information about the llvm-commits mailing list