[PATCH] D38790: [ELF] Avoid keeping useless undefined symbols in .dynsym.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 14:37:16 PST 2017


Igor Kudrin via Phabricator <reviews at reviews.llvm.org> writes:

> Index: test/ELF/weak-undef.s
> ===================================================================
> --- test/ELF/weak-undef.s
> +++ test/ELF/weak-undef.s
> @@ -28,3 +28,6 @@
>  
>  .globl _start
>  _start:
> +
> +.data
> +	.dc.a	foo

Most of these changes are to make sure we still produce an undefined
reference. As such I think they are an independent improvement (make the
test more explicit) and can be committed before the rest, correct?

Could you please extract them to another patch that is committed first
and rebase this patch on top of it?


> Index: test/ELF/gc-collect-undefined.s
> ===================================================================
> --- /dev/null
> +++ test/ELF/gc-collect-undefined.s
> @@ -0,0 +1,18 @@
> +# REQUIRES: x86
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
> +# RUN: ld.lld %t -o %tout --gc-sections -shared
> +# RUN: llvm-nm -D %tout | FileCheck %s
> +
> +# CHECK: bar
> +# CHECK-NOT: qux

I think you need

# CHECK-NOT: qux
# CHECK: bar
# CHECK-NOT: qux

To make sure qux doesn't show up. Otherwise you are depending on an
order that can change if we ever change the hash table.

Cheers,
Rafael


More information about the llvm-commits mailing list