[PATCH] D33763: [ELF] - Assign SHF_INFO_LINK flag to REL[A] sections.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 2 02:18:16 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL304531: [ELF] - Assign SHF_INFO_LINK flag to REL[A] sections. (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D33763?vs=100985&id=101175#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33763

Files:
  lld/trunk/ELF/OutputSections.cpp
  lld/trunk/test/ELF/emit-relocs.s


Index: lld/trunk/test/ELF/emit-relocs.s
===================================================================
--- lld/trunk/test/ELF/emit-relocs.s
+++ lld/trunk/test/ELF/emit-relocs.s
@@ -1,7 +1,7 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
 # RUN: ld.lld --emit-relocs %t1.o -o %t
-# RUN: llvm-readobj -t -r %t | FileCheck %s
+# RUN: llvm-readobj -t -r -s %t | FileCheck %s
 
 ## Check single dash form.
 # RUN: ld.lld -emit-relocs %t1.o -o %t1
@@ -11,6 +11,13 @@
 # RUN: ld.lld -q %t1.o -o %t2
 # RUN: llvm-readobj -t -r %t2 | FileCheck %s
 
+# CHECK:      Section {
+# CHECK:        Index: 2
+# CHECK-NEXT:   Name: .rela.text
+# CHECK-NEXT:   Type: SHT_RELA
+# CHECK-NEXT:   Flags [
+# CHECK-NEXT:     SHF_INFO_LINK
+# CHECK-NEXT:   ]
 # CHECK:      Relocations [
 # CHECK-NEXT:   Section ({{.*}}) .rela.text {
 # CHECK-NEXT:     0x201002 R_X86_64_32 .text 0x1
Index: lld/trunk/ELF/OutputSections.cpp
===================================================================
--- lld/trunk/ELF/OutputSections.cpp
+++ lld/trunk/ELF/OutputSections.cpp
@@ -128,6 +128,7 @@
   // the section to which the relocation applies.
   InputSectionBase *S = First->getRelocatedSection();
   Info = S->getOutputSection()->SectionIndex;
+  Flags |= SHF_INFO_LINK;
 }
 
 static uint64_t updateOffset(uint64_t Off, InputSection *S) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33763.101175.patch
Type: text/x-patch
Size: 1359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170602/4f797c2d/attachment.bin>


More information about the llvm-commits mailing list