[lld] r309225 - Fix the name of the section end symbol.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 15:52:53 PDT 2017


Author: rafael
Date: Wed Jul 26 15:52:53 2017
New Revision: 309225

URL: http://llvm.org/viewvc/llvm-project?rev=309225&view=rev
Log:
Fix the name of the section end symbol.

It is __stop_<sec>, not __end_<sec>.

Modified:
    lld/trunk/ELF/MarkLive.cpp
    lld/trunk/test/ELF/startstop-gccollect.s

Modified: lld/trunk/ELF/MarkLive.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=309225&r1=309224&r2=309225&view=diff
==============================================================================
--- lld/trunk/ELF/MarkLive.cpp (original)
+++ lld/trunk/ELF/MarkLive.cpp Wed Jul 26 15:52:53 2017
@@ -253,7 +253,7 @@ template <class ELFT> void elf::markLive
       Enqueue({Sec, 0});
     else if (isValidCIdentifier(Sec->Name)) {
       CNamedSections[Saver.save("__start_" + Sec->Name)].push_back(Sec);
-      CNamedSections[Saver.save("__end_" + Sec->Name)].push_back(Sec);
+      CNamedSections[Saver.save("__stop_" + Sec->Name)].push_back(Sec);
     }
   }
 

Modified: lld/trunk/test/ELF/startstop-gccollect.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/startstop-gccollect.s?rev=309225&r1=309224&r2=309225&view=diff
==============================================================================
--- lld/trunk/test/ELF/startstop-gccollect.s (original)
+++ lld/trunk/test/ELF/startstop-gccollect.s Wed Jul 26 15:52:53 2017
@@ -13,19 +13,19 @@
 
 # DISASM:      _start:
 # DISASM-NEXT: 201000:        e8 05 00 00 00  callq   5 <__start_foo>
-# DISASM-NEXT: 201005:        e8 01 00 00 00  callq   1 <__start_bar>
+# DISASM-NEXT: 201005:        e8 02 00 00 00  callq   2 <__stop_bar>
 # DISASM-NEXT: Disassembly of section foo:
 # DISASM-NEXT: __start_foo:
 # DISASM-NEXT: 20100a:        90      nop
 # DISASM-NEXT: Disassembly of section bar:
-# DISASM-NEXT: __start_bar:
+# DISASM-NEXT: bar:
 # DISASM-NEXT: 20100b:        90      nop
 
 .global _start
 .text
 _start:
  callq __start_foo
- callq __start_bar
+ callq __stop_bar
 
 .section foo,"ax"
  nop




More information about the llvm-commits mailing list