[llvm] r317470 - [mips] Fix PR35140
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 6 02:56:29 PST 2017
On Mon, Nov 6, 2017 at 1:50 PM, Simon Dardis via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: sdardis
> Date: Mon Nov 6 02:50:04 2017
> New Revision: 317470
>
> URL: http://llvm.org/viewvc/llvm-project?rev=317470&view=rev
> Log:
> [mips] Fix PR35140
>
> Mark all symbols involved with TLS relocations as being TLS symbols.
Please write better commit messages. Assume that the commit messages
will be read when there is no more bugzilla, so all the links are dead already
The "[mips] Fix PR35140" is a subject that is not easy to understant.
"[mips] Mark all symbols involved with TLS relocations as being TLS symbols."
would be a better subject.
> This resolves PR35140.
>
> Thanks to Alex Crichton for reporting the issue!
>
> Reviewers: atanasyan
>
> Differential Revision: https://reviews.llvm.org/D39591
>
> Added:
> llvm/trunk/test/MC/Mips/tls-symbols.s
> Modified:
> llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp
>
> Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp?rev=317470&r1=317469&r2=317470&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp (original)
> +++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp Mon Nov 6 02:50:04 2017
> @@ -246,8 +246,6 @@ void MipsMCExpr::fixELFSymbolsInTLSFixup
> break;
> case MEK_CALL_HI16:
> case MEK_CALL_LO16:
> - case MEK_DTPREL_HI:
> - case MEK_DTPREL_LO:
> case MEK_GOT:
> case MEK_GOT_CALL:
> case MEK_GOT_DISP:
> @@ -263,14 +261,16 @@ void MipsMCExpr::fixELFSymbolsInTLSFixup
> case MEK_NEG:
> case MEK_PCREL_HI16:
> case MEK_PCREL_LO16:
> - case MEK_TLSLDM:
> // If we do have nested target-specific expressions, they will be in
> // a consecutive chain.
> if (const MipsMCExpr *E = dyn_cast<const MipsMCExpr>(getSubExpr()))
> E->fixELFSymbolsInTLSFixups(Asm);
> break;
> - case MEK_GOTTPREL:
> + case MEK_DTPREL_HI:
> + case MEK_DTPREL_LO:
> + case MEK_TLSLDM:
> case MEK_TLSGD:
> + case MEK_GOTTPREL:
> case MEK_TPREL_HI:
> case MEK_TPREL_LO:
> fixELFSymbolsInTLSFixupsImpl(getSubExpr(), Asm);
>
> Added: llvm/trunk/test/MC/Mips/tls-symbols.s
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/tls-symbols.s?rev=317470&view=auto
> ==============================================================================
> --- llvm/trunk/test/MC/Mips/tls-symbols.s (added)
> +++ llvm/trunk/test/MC/Mips/tls-symbols.s Mon Nov 6 02:50:04 2017
> @@ -0,0 +1,28 @@
> +# RUN: llvm-mc -arch=mips < %s -position-independent -filetype=obj \
> +# RUN: | llvm-readelf -symbols | FileCheck %s
> +# RUN: llvm-mc -arch=mips < %s -filetype=obj | llvm-readelf -symbols \
> +# RUN: | FileCheck %s
> +
> +# Test that TLS relocations cause symbols to be marked as TLS symbols.
> +
> + .set noat
> + lui $3, %tlsgd(foo1)
> + lui $1, %dtprel_hi(foo2)
> + lui $1, %dtprel_lo(foo3)
> + lui $1, %tprel_hi(foo4)
> + lui $1, %tprel_lo(foo5)
> + lw $2, %gottprel(foo6)($28)
> +
> + .hidden foo1
> + .hidden foo2
> + .hidden foo3
> + .hidden foo4
> + .hidden foo5
> + .hidden foo6
> +
> +# CHECK: 1: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo1
> +# CHECK: 2: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo2
> +# CHECK: 3: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo3
> +# CHECK: 4: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo4
> +# CHECK: 5: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo5
> +# CHECK: 6: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo6
>
>
> _______________________________________________
> 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