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

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 08:18:44 PST 2017


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

I've extracted those tests into https://reviews.llvm.org/D40253.

> 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.

AFAIK, llvm-nm sorts its output by symbol names by default, so we shouldn't see "qux" before "bar".

Best Regards,
Igor Kudrin
C++ Developer, Access Softek, Inc.

________________________________________
From: Rafael Avila de Espindola <rafael.espindola at gmail.com>
Sent: Saturday, November 18, 2017 5:37 AM
To: reviews+D38790+public+70267618f08aebae at reviews.llvm.org; Igor Kudrin; ruiu at google.com; peter at pcc.me.uk
Cc: llvm-commits at lists.llvm.org; emaste at freebsd.org; adhemerval.zanella at linaro.org
Subject: Re: [PATCH] D38790: [ELF] Avoid keeping useless undefined symbols in .dynsym.

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