[lld] r298093 - [ELF][MIPS] Always collect .reginfo, .MIPS.options, and .MIPS.abiflags input sections

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 07:27:56 PDT 2017


Author: atanasyan
Date: Fri Mar 17 09:27:55 2017
New Revision: 298093

URL: http://llvm.org/viewvc/llvm-project?rev=298093&view=rev
Log:
[ELF][MIPS] Always collect .reginfo, .MIPS.options, and .MIPS.abiflags input sections

Do not take in account the `Live` flag while collecting .reginfo, .MIPS.options,
and .MIPS.abiflags input sections to produce corresponding output sections.
These sections have information purpose and should be always produced per
ABI requirements.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp
    lld/trunk/test/ELF/mips-elf-flags.s
    lld/trunk/test/ELF/mips-options.s
    lld/trunk/test/ELF/mips-reginfo.s

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=298093&r1=298092&r2=298093&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Fri Mar 17 09:27:55 2017
@@ -131,7 +131,7 @@ MipsAbiFlagsSection<ELFT> *MipsAbiFlagsS
   bool Create = false;
 
   for (InputSectionBase *Sec : InputSections) {
-    if (!Sec->Live || Sec->Type != SHT_MIPS_ABIFLAGS)
+    if (Sec->Type != SHT_MIPS_ABIFLAGS)
       continue;
     Sec->Live = false;
     Create = true;
@@ -200,7 +200,7 @@ MipsOptionsSection<ELFT> *MipsOptionsSec
   bool Create = false;
 
   for (InputSectionBase *Sec : InputSections) {
-    if (!Sec->Live || Sec->Type != SHT_MIPS_OPTIONS)
+    if (Sec->Type != SHT_MIPS_OPTIONS)
       continue;
     Sec->Live = false;
     Create = true;
@@ -258,7 +258,7 @@ MipsReginfoSection<ELFT> *MipsReginfoSec
   bool Create = false;
 
   for (InputSectionBase *Sec : InputSections) {
-    if (!Sec->Live || Sec->Type != SHT_MIPS_REGINFO)
+    if (Sec->Type != SHT_MIPS_REGINFO)
       continue;
     Sec->Live = false;
     Create = true;

Modified: lld/trunk/test/ELF/mips-elf-flags.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-elf-flags.s?rev=298093&r1=298092&r2=298093&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-elf-flags.s (original)
+++ lld/trunk/test/ELF/mips-elf-flags.s Fri Mar 17 09:27:55 2017
@@ -2,7 +2,7 @@
 
 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
 # RUN:         %S/Inputs/mips-dynamic.s -o %t-so.o
-# RUN: ld.lld %t-so.o -shared -o %t.so
+# RUN: ld.lld %t-so.o --gc-sections -shared -o %t.so
 # RUN: llvm-readobj -h -mips-abi-flags %t.so | FileCheck -check-prefix=SO %s
 
 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o

Modified: lld/trunk/test/ELF/mips-options.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-options.s?rev=298093&r1=298092&r2=298093&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-options.s (original)
+++ lld/trunk/test/ELF/mips-options.s Fri Mar 17 09:27:55 2017
@@ -6,7 +6,7 @@
 # RUN: echo "SECTIONS { \
 # RUN:          . = 0x100000000; \
 # RUN:          .got  : { *(.got) } }" > %t.rel.script
-# RUN: ld.lld %t1.o %t2.o --script %t.rel.script -shared -o %t.so
+# RUN: ld.lld %t1.o %t2.o --gc-sections --script %t.rel.script -shared -o %t.so
 # RUN: llvm-readobj -symbols -mips-options %t.so | FileCheck %s
 
 # REQUIRES: mips

Modified: lld/trunk/test/ELF/mips-reginfo.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-reginfo.s?rev=298093&r1=298092&r2=298093&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-reginfo.s (original)
+++ lld/trunk/test/ELF/mips-reginfo.s Fri Mar 17 09:27:55 2017
@@ -3,7 +3,7 @@
 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t1.o
 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
 # RUN:         %S/Inputs/mips-dynamic.s -o %t2.o
-# RUN: ld.lld %t1.o %t2.o -shared -o %t.so
+# RUN: ld.lld %t1.o %t2.o --gc-sections -shared -o %t.so
 # RUN: llvm-readobj -symbols -mips-reginfo %t.so | FileCheck %s
 
 # REQUIRES: mips




More information about the llvm-commits mailing list