[PATCH] D43920: Set DF_TEXTREL instead of creating an empty DT_TEXTREL.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 14:59:53 PST 2018


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL326503: Set DF_TEXTREL to executables that need text relocations. (authored by ruiu, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D43920?vs=136607&id=136614#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43920

Files:
  lld/trunk/ELF/SyntheticSections.cpp
  lld/trunk/test/ELF/ztext-text-notext.s


Index: lld/trunk/ELF/SyntheticSections.cpp
===================================================================
--- lld/trunk/ELF/SyntheticSections.cpp
+++ lld/trunk/ELF/SyntheticSections.cpp
@@ -1046,6 +1046,8 @@
     DtFlags |= DF_ORIGIN;
     DtFlags1 |= DF_1_ORIGIN;
   }
+  if (!Config->ZText)
+    DtFlags |= DF_TEXTREL;
 
   if (DtFlags)
     addInt(DT_FLAGS, DtFlags);
Index: lld/trunk/test/ELF/ztext-text-notext.s
===================================================================
--- lld/trunk/test/ELF/ztext-text-notext.s
+++ lld/trunk/test/ELF/ztext-text-notext.s
@@ -18,17 +18,21 @@
 # CHECK-NEXT:      0x1010 R_X86_64_PC64 zed 0x0
 # CHECK-NEXT:    }
 # CHECK-NEXT:  ]
+
 # CHECK: DynamicSection [
-# CHECK: 0x0000000000000016 TEXTREL 0x0
+# CHECK:   FLAGS TEXTREL
+# CHECK:   TEXTREL 0x0
 
 # STATIC:      Relocations [
 # STATIC-NEXT:    Section {{.*}} .rela.dyn {
 # STATIC-NEXT:      0x201008 R_X86_64_64 bar 0x0
 # STATIC-NEXT:      0x201010 R_X86_64_PC64 zed 0x0
 # STATIC-NEXT:    }
 # STATIC-NEXT:  ]
+
 # STATIC: DynamicSection [
-# STATIC: 0x0000000000000016 TEXTREL 0x0
+# STATIC:   FLAGS TEXTREL
+# STATIC:   TEXTREL 0x0
 
 foo:
 .quad foo


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43920.136614.patch
Type: text/x-patch
Size: 1166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180301/7d410bfa/attachment.bin>


More information about the llvm-commits mailing list