[lld] r309048 - LTO: Handle sections with valid C names.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 07:17:53 PDT 2017


Thanks!
Teresa

On Tue, Jul 25, 2017 at 3:51 PM, Rafael Espindola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rafael
> Date: Tue Jul 25 15:51:05 2017
> New Revision: 309048
>
> URL: http://llvm.org/viewvc/llvm-project?rev=309048&view=rev
> Log:
> LTO: Handle sections with valid C names.
>
> These can be referenced with __start_/__stop_ symbols. I will try to make
> this more precise in a followup patch.
>
> Added:
>     lld/trunk/test/ELF/lto/section-name.ll
> Modified:
>     lld/trunk/ELF/LTO.cpp
>
> Modified: lld/trunk/ELF/LTO.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?
> rev=309048&r1=309047&r2=309048&view=diff
> ============================================================
> ==================
> --- lld/trunk/ELF/LTO.cpp (original)
> +++ lld/trunk/ELF/LTO.cpp Tue Jul 25 15:51:05 2017
> @@ -136,8 +136,9 @@ void BitcodeCompiler::add(BitcodeFile &F
>      // be removed.
>      R.Prevailing = !ObjSym.isUndefined() && B->File == &F;
>
> -    R.VisibleToRegularObj =
> -        Sym->IsUsedInRegularObj || (R.Prevailing &&
> Sym->includeInDynsym());
> +    R.VisibleToRegularObj = Sym->IsUsedInRegularObj ||
> +                            (R.Prevailing && Sym->includeInDynsym()) ||
> +                            isValidCIdentifier(ObjSym.getSectionName());
>      if (R.Prevailing)
>        undefine(Sym);
>      R.LinkerRedefined = Config->RenamedSymbols.count(Sym);
>
> Added: lld/trunk/test/ELF/lto/section-name.ll
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/
> lto/section-name.ll?rev=309048&view=auto
> ============================================================
> ==================
> --- lld/trunk/test/ELF/lto/section-name.ll (added)
> +++ lld/trunk/test/ELF/lto/section-name.ll Tue Jul 25 15:51:05 2017
> @@ -0,0 +1,11 @@
> +; REQUIRES: x86
> +; RUN: llvm-as %s -o %t.o
> +; RUN: ld.lld %t.o -o %t.so -shared
> +; RUN: llvm-readelf -s %t.so | FileCheck %s
> +
> +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> +target triple = "x86_64-unknown-linux-gnu"
> +
> + at foo = hidden global i32 42, section "foo_section"
> +
> +; CHECK: foo_section PROGBITS
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>



-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170726/69516e8f/attachment.html>


More information about the llvm-commits mailing list