[lld] r250739 - [OutputSection] Set the symbolic bit in DT_FLAGS and not DT_FLAGS_1.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 14:34:00 PDT 2015


Author: davide
Date: Mon Oct 19 16:34:00 2015
New Revision: 250739

URL: http://llvm.org/viewvc/llvm-project?rev=250739&view=rev
Log:
[OutputSection] Set the symbolic bit in DT_FLAGS and not DT_FLAGS_1.

The two names are similar enough that they might lead to confusion.
The output of readobj clarifies but I missed it when I originally
committed this. Found while linking FreeBSD userland with lld.

Modified:
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/test/elf2/dt_flags.s

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=250739&r1=250738&r2=250739&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Mon Oct 19 16:34:00 2015
@@ -369,6 +369,9 @@ template <class ELFT> void DynamicSectio
   uint32_t Flags = 0;
   if (Config->Bsymbolic)
     Flags |= DF_SYMBOLIC;
+  if (Flags)
+    WriteVal(DT_FLAGS, Flags);
+  Flags = 0;
   if (Config->ZNow)
     Flags |= DF_1_NOW;
   if (Flags)

Modified: lld/trunk/test/elf2/dt_flags.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/dt_flags.s?rev=250739&r1=250738&r2=250739&view=diff
==============================================================================
--- lld/trunk/test/elf2/dt_flags.s (original)
+++ lld/trunk/test/elf2/dt_flags.s Mon Oct 19 16:34:00 2015
@@ -2,17 +2,19 @@
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
 # RUN: ld.lld2 -shared %t -o %t.so
-# RUN: ld.lld2 -z now -Bsymbolic %t %t.so -o %t1
+# RUN: ld.lld2 -z now -z nodelete -Bsymbolic %t %t.so -o %t1
 # RUN: ld.lld2 %t %t.so -o %t2
 # RUN: llvm-readobj -dynamic-table %t1 | FileCheck -check-prefix=FLAGS %s
 # RUN: llvm-readobj -dynamic-table %t2 | FileCheck %s
 
 # FLAGS: DynamicSection [
-# FLAGS:   0x000000006FFFFFFB FLAGS_1 NOW GLOBAL
+# FLAGS:   0x000000000000001E FLAGS SYMBOLIC
+# FLAGS:   0x000000006FFFFFFB FLAGS_1 NOW
 # FLAGS: ]
 
 # CHECK: DynamicSection [
-# CHECK-NOT:   0x000000006FFFFFFB FLAGS_1 NOW GLOBAL
+# CHECK-NOT:   0x000000000000001E FLAGS SYMBOLIC
+# CHECK-NOT:   0x000000006FFFFFFB FLAGS_1 NOW
 # CHECK: ]
 
 .globl _start




More information about the llvm-commits mailing list