[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:54 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 rLLD326503: 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=136615#toc

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D43920

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


Index: test/ELF/ztext-text-notext.s
===================================================================
--- test/ELF/ztext-text-notext.s
+++ 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
Index: ELF/SyntheticSections.cpp
===================================================================
--- ELF/SyntheticSections.cpp
+++ 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);


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


More information about the llvm-commits mailing list