<div dir="ltr">This change appears to break the bootstrap when using the steps given in PR27482.<div><br></div><div>I get:</div><div><br></div><div>ld.lld: ../lib/MC/StringTableBuilder.cpp:180: size_t llvm::StringTableBuilder::getOffset(llvm::StringRef) const: Assertion `I != StringIndexMap.end() && "String is not in table!"' failed.<br></div><div><br></div><div>when linking llvm-profdata during stage 2.</div><div><br></div><div>Peter</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 22, 2016 at 9:46 AM, Rafael Espindola via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Fri Apr 22 11:46:08 2016<br>
New Revision: 267164<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=267164&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=267164&view=rev</a><br>
Log:<br>
GC entries of SHF_MERGE sections.<br>
<br>
It is a fairly direct extension of the gc algorithm. For merge sections<br>
instead of remembering just a live bit, we remember which offsets were<br>
used.<br>
<br>
This reduces the .rodata sections in chromium from 9648861 to 9477472<br>
bytes.<br>
<br>
Added:<br>
lld/trunk/test/ELF/gc-sections-merge-addend.s<br>
lld/trunk/test/ELF/gc-sections-merge-implicit-addend.s<br>
lld/trunk/test/ELF/gc-sections-merge.s<br>
Modified:<br>
lld/trunk/ELF/InputSection.cpp<br>
lld/trunk/ELF/InputSection.h<br>
lld/trunk/ELF/MarkLive.cpp<br>
lld/trunk/ELF/OutputSections.cpp<br>
<br>
Modified: lld/trunk/ELF/InputSection.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=267164&r1=267163&r2=267164&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=267164&r1=267163&r2=267164&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/InputSection.cpp (original)<br>
+++ lld/trunk/ELF/InputSection.cpp Fri Apr 22 11:46:08 2016<br>
@@ -77,23 +77,41 @@ InputSectionBase<ELFT>::getOffset(const<br>
return getOffset(Sym.Value);<br>
}<br>
<br>
-// Returns a section that Rel relocation is pointing to.<br>
template <class ELFT><br>
-InputSectionBase<ELFT> *<br>
-InputSectionBase<ELFT>::getRelocTarget(const Elf_Rel &Rel) const {<br>
- // Global symbol<br>
+static DefinedRegular<ELFT> *getRelocTargetSym(ObjectFile<ELFT> *File,<br>
+ const typename ELFT::Rel &Rel) {<br>
uint32_t SymIndex = Rel.getSymbol(Config->Mips64EL);<br>
SymbolBody &B = File->getSymbolBody(SymIndex).repl();<br>
if (auto *D = dyn_cast<DefinedRegular<ELFT>>(&B))<br>
if (D->Section)<br>
- return D->Section->Repl;<br>
+ return D;<br>
return nullptr;<br>
}<br>
<br>
+// Returns a section that Rel relocation is pointing to.<br>
+template <class ELFT><br>
+std::pair<InputSectionBase<ELFT> *, typename ELFT::uint><br>
+InputSectionBase<ELFT>::getRelocTarget(const Elf_Rel &Rel) const {<br>
+ auto *D = getRelocTargetSym(File, Rel);<br>
+ if (!D)<br>
+ return std::make_pair(nullptr, 0);<br>
+ if (!D->isSection())<br>
+ return std::make_pair(D->Section->Repl, D->Value);<br>
+ const uint8_t *BufLoc = getSectionData().begin() + Rel.r_offset;<br>
+ uintX_t Addend =<br>
+ Target->getImplicitAddend(BufLoc, Rel.getType(Config->Mips64EL));<br>
+ return std::make_pair(D->Section->Repl, D->Value + Addend);<br>
+}<br>
+<br>
template <class ELFT><br>
-InputSectionBase<ELFT> *<br>
+std::pair<InputSectionBase<ELFT> *, typename ELFT::uint><br>
InputSectionBase<ELFT>::getRelocTarget(const Elf_Rela &Rel) const {<br>
- return getRelocTarget(reinterpret_cast<const Elf_Rel &>(Rel));<br>
+ auto *D = getRelocTargetSym(File, Rel);<br>
+ if (!D)<br>
+ return std::make_pair(nullptr, 0);<br>
+ if (!D->isSection())<br>
+ return std::make_pair(D->Section->Repl, D->Value);<br>
+ return std::make_pair(D->Section->Repl, D->Value + Rel.r_addend);<br>
}<br>
<br>
template <class ELFT><br>
@@ -368,10 +386,49 @@ typename ELFT::uint EHInputSection<ELFT><br>
return Base + Addend;<br>
}<br>
<br>
+static size_t findNull(StringRef S, size_t EntSize) {<br>
+ // Optimize the common case.<br>
+ if (EntSize == 1)<br>
+ return S.find(0);<br>
+<br>
+ for (unsigned I = 0, N = S.size(); I != N; I += EntSize) {<br>
+ const char *B = S.begin() + I;<br>
+ if (std::all_of(B, B + EntSize, [](char C) { return C == 0; }))<br>
+ return I;<br>
+ }<br>
+ return StringRef::npos;<br>
+}<br>
+<br>
template <class ELFT><br>
MergeInputSection<ELFT>::MergeInputSection(elf::ObjectFile<ELFT> *F,<br>
const Elf_Shdr *Header)<br>
- : SplitInputSection<ELFT>(F, Header, InputSectionBase<ELFT>::Merge) {}<br>
+ : SplitInputSection<ELFT>(F, Header, InputSectionBase<ELFT>::Merge) {<br>
+ uintX_t EntSize = Header->sh_entsize;<br>
+ ArrayRef<uint8_t> D = this->getSectionData();<br>
+ StringRef Data((const char *)D.data(), D.size());<br>
+ std::vector<std::pair<uintX_t, uintX_t>> &Offsets = this->Offsets;<br>
+<br>
+ uintX_t V = Config->GcSections ? -1 : 0;<br>
+ if (Header->sh_flags & SHF_STRINGS) {<br>
+ uintX_t Offset = 0;<br>
+ while (!Data.empty()) {<br>
+ size_t End = findNull(Data, EntSize);<br>
+ if (End == StringRef::npos)<br>
+ fatal("string is not null terminated");<br>
+ Offsets.push_back(std::make_pair(Offset, V));<br>
+ uintX_t Size = End + EntSize;<br>
+ Data = Data.substr(Size);<br>
+ Offset += Size;<br>
+ }<br>
+ return;<br>
+ }<br>
+<br>
+ // If this is not of type string, every entry has the same size.<br>
+ size_t Size = Data.size();<br>
+ assert((Size % EntSize) == 0);<br>
+ for (unsigned I = 0, N = Size; I != N; I += EntSize)<br>
+ Offsets.push_back(std::make_pair(I, V));<br>
+}<br>
<br>
template <class ELFT><br>
bool MergeInputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {<br>
<br>
Modified: lld/trunk/ELF/InputSection.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=267164&r1=267163&r2=267164&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=267164&r1=267163&r2=267164&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/InputSection.h (original)<br>
+++ lld/trunk/ELF/InputSection.h Fri Apr 22 11:46:08 2016<br>
@@ -124,8 +124,10 @@ public:<br>
ArrayRef<uint8_t> getSectionData() const;<br>
<br>
// Returns a section that Rel is pointing to. Used by the garbage collector.<br>
- InputSectionBase<ELFT> *getRelocTarget(const Elf_Rel &Rel) const;<br>
- InputSectionBase<ELFT> *getRelocTarget(const Elf_Rela &Rel) const;<br>
+ std::pair<InputSectionBase<ELFT> *, uintX_t><br>
+ getRelocTarget(const Elf_Rel &Rel) const;<br>
+ std::pair<InputSectionBase<ELFT> *, uintX_t><br>
+ getRelocTarget(const Elf_Rela &Rel) const;<br>
<br>
void relocate(uint8_t *Buf, uint8_t *BufEnd);<br>
std::vector<Relocation> Relocations;<br>
<br>
Modified: lld/trunk/ELF/MarkLive.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=267164&r1=267163&r2=267164&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=267164&r1=267163&r2=267164&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/MarkLive.cpp (original)<br>
+++ lld/trunk/ELF/MarkLive.cpp Fri Apr 22 11:46:08 2016<br>
@@ -40,20 +40,29 @@ using namespace lld::elf;<br>
<br>
// Calls Fn for each section that Sec refers to via relocations.<br>
template <class ELFT><br>
-static void forEachSuccessor(InputSection<ELFT> *Sec,<br>
- std::function<void(InputSectionBase<ELFT> *)> Fn) {<br>
+static void forEachSuccessor(<br>
+ InputSection<ELFT> *Sec,<br>
+ std::function<void(InputSectionBase<ELFT> *, typename ELFT::uint Offset)><br>
+ Fn) {<br>
typedef typename ELFT::Rel Elf_Rel;<br>
typedef typename ELFT::Rela Elf_Rela;<br>
typedef typename ELFT::Shdr Elf_Shdr;<br>
+ typedef typename ELFT::uint uintX_t;<br>
<br>
ELFFile<ELFT> &Obj = Sec->getFile()->getObj();<br>
for (const Elf_Shdr *RelSec : Sec->RelocSections) {<br>
if (RelSec->sh_type == SHT_RELA) {<br>
- for (const Elf_Rela &RI : Obj.relas(RelSec))<br>
- Fn(Sec->getRelocTarget(RI));<br>
+ for (const Elf_Rela &RI : Obj.relas(RelSec)) {<br>
+ std::pair<InputSectionBase<ELFT> *, uintX_t> P =<br>
+ Sec->getRelocTarget(RI);<br>
+ Fn(P.first, P.second);<br>
+ }<br>
} else {<br>
- for (const Elf_Rel &RI : Obj.rels(RelSec))<br>
- Fn(Sec->getRelocTarget(RI));<br>
+ for (const Elf_Rel &RI : Obj.rels(RelSec)) {<br>
+ std::pair<InputSectionBase<ELFT> *, uintX_t> P =<br>
+ Sec->getRelocTarget(RI);<br>
+ Fn(P.first, P.second);<br>
+ }<br>
}<br>
}<br>
}<br>
@@ -85,10 +94,18 @@ template <class ELFT> static bool isRese<br>
// Starting from GC-root sections, this function visits all reachable<br>
// sections to set their "Live" bits.<br>
template <class ELFT> void elf::markLive(SymbolTable<ELFT> *Symtab) {<br>
+ typedef typename ELFT::uint uintX_t;<br>
SmallVector<InputSection<ELFT> *, 256> Q;<br>
<br>
- auto Enqueue = [&](InputSectionBase<ELFT> *Sec) {<br>
- if (!Sec || Sec->Live)<br>
+ auto Enqueue = [&](InputSectionBase<ELFT> *Sec, uintX_t Offset) {<br>
+ if (!Sec)<br>
+ return;<br>
+ if (auto *MS = dyn_cast<MergeInputSection<ELFT>>(Sec)) {<br>
+ std::pair<std::pair<uintX_t, uintX_t> *, uintX_t> T =<br>
+ MS->getRangeAndSize(Offset);<br>
+ T.first->second = 0;<br>
+ }<br>
+ if (Sec->Live)<br>
return;<br>
Sec->Live = true;<br>
if (InputSection<ELFT> *S = dyn_cast<InputSection<ELFT>>(Sec))<br>
@@ -98,7 +115,7 @@ template <class ELFT> void elf::markLive<br>
auto MarkSymbol = [&](SymbolBody *Sym) {<br>
if (Sym)<br>
if (auto *D = dyn_cast<DefinedRegular<ELFT>>(Sym))<br>
- Enqueue(D->Section);<br>
+ Enqueue(D->Section, D->Value);<br>
};<br>
<br>
// Add GC root symbols.<br>
@@ -125,7 +142,7 @@ template <class ELFT> void elf::markLive<br>
for (InputSectionBase<ELFT> *Sec : F->getSections())<br>
if (Sec && Sec != &InputSection<ELFT>::Discarded)<br>
if (isReserved(Sec) || Script<ELFT>::X->shouldKeep(Sec))<br>
- Enqueue(Sec);<br>
+ Enqueue(Sec, 0);<br>
<br>
// Mark all reachable sections.<br>
while (!Q.empty())<br>
<br>
Modified: lld/trunk/ELF/OutputSections.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=267164&r1=267163&r2=267164&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=267164&r1=267163&r2=267164&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/OutputSections.cpp (original)<br>
+++ lld/trunk/ELF/OutputSections.cpp Fri Apr 22 11:46:08 2016<br>
@@ -1132,7 +1132,7 @@ void EHOutputSection<ELFT>::addSectionAu<br>
} else {<br>
if (!HasReloc)<br>
fatal("FDE doesn't reference another section");<br>
- InputSectionBase<ELFT> *Target = S->getRelocTarget(*RelI);<br>
+ InputSectionBase<ELFT> *Target = S->getRelocTarget(*RelI).first;<br>
if (Target && Target->Live) {<br>
uint32_t CieOffset = Offset + 4 - ID;<br>
auto I = OffsetToIndex.find(CieOffset);<br>
@@ -1227,19 +1227,6 @@ template <class ELFT> void MergeOutputSe<br>
}<br>
}<br>
<br>
-static size_t findNull(StringRef S, size_t EntSize) {<br>
- // Optimize the common case.<br>
- if (EntSize == 1)<br>
- return S.find(0);<br>
-<br>
- for (unsigned I = 0, N = S.size(); I != N; I += EntSize) {<br>
- const char *B = S.begin() + I;<br>
- if (std::all_of(B, B + EntSize, [](char C) { return C == 0; }))<br>
- return I;<br>
- }<br>
- return StringRef::npos;<br>
-}<br>
-<br>
template <class ELFT><br>
void MergeOutputSection<ELFT>::addSection(InputSectionBase<ELFT> *C) {<br>
auto *S = cast<MergeInputSection<ELFT>>(C);<br>
@@ -1250,31 +1237,32 @@ void MergeOutputSection<ELFT>::addSectio<br>
StringRef Data((const char *)D.data(), D.size());<br>
uintX_t EntSize = S->getSectionHdr()->sh_entsize;<br>
this->Header.sh_entsize = EntSize;<br>
+ MutableArrayRef<std::pair<uintX_t, uintX_t>> Offsets = S->Offsets;<br>
<br>
// If this is of type string, the contents are null-terminated strings.<br>
if (this->Header.sh_flags & SHF_STRINGS) {<br>
- uintX_t Offset = 0;<br>
- while (!Data.empty()) {<br>
- size_t End = findNull(Data, EntSize);<br>
- if (End == StringRef::npos)<br>
- fatal("string is not null terminated");<br>
- StringRef Entry = Data.substr(0, End + EntSize);<br>
+ for (unsigned I = 0, N = Offsets.size(); I != N; ++I) {<br>
+ auto &P = Offsets[I];<br>
+ if (P.second == (uintX_t)-1)<br>
+ continue;<br>
+<br>
+ uintX_t Start = P.first;<br>
+ uintX_t End = (I == N - 1) ? Data.size() : Offsets[I + 1].first;<br>
+ StringRef Entry = Data.substr(Start, End - Start);<br>
uintX_t OutputOffset = Builder.add(Entry);<br>
if (shouldTailMerge())<br>
OutputOffset = -1;<br>
- S->Offsets.push_back(std::make_pair(Offset, OutputOffset));<br>
- uintX_t Size = End + EntSize;<br>
- Data = Data.substr(Size);<br>
- Offset += Size;<br>
+ P.second = OutputOffset;<br>
}<br>
return;<br>
}<br>
<br>
// If this is not of type string, every entry has the same size.<br>
- for (unsigned I = 0, N = Data.size(); I != N; I += EntSize) {<br>
- StringRef Entry = Data.substr(I, EntSize);<br>
- size_t OutputOffset = Builder.add(Entry);<br>
- S->Offsets.push_back(std::make_pair(I, OutputOffset));<br>
+ for (auto &P : Offsets) {<br>
+ if (P.second == (uintX_t)-1)<br>
+ continue;<br>
+ StringRef Entry = Data.substr(P.first, EntSize);<br>
+ P.second = Builder.add(Entry);<br>
}<br>
}<br>
<br>
<br>
Added: lld/trunk/test/ELF/gc-sections-merge-addend.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-merge-addend.s?rev=267164&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-merge-addend.s?rev=267164&view=auto</a><br>
==============================================================================<br>
--- lld/trunk/test/ELF/gc-sections-merge-addend.s (added)<br>
+++ lld/trunk/test/ELF/gc-sections-merge-addend.s Fri Apr 22 11:46:08 2016<br>
@@ -0,0 +1,39 @@<br>
+// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux<br>
+// RUN: ld.lld %t.o -o %t.so -shared --gc-sections<br>
+// RUN: llvm-readobj -s -section-data %t.so | FileCheck %s<br>
+<br>
+<br>
+// CHECK: Name: .rodata<br>
+// CHECK-NEXT: Type: SHT_PROGBITS<br>
+// CHECK-NEXT: Flags [<br>
+// CHECK-NEXT: SHF_ALLOC<br>
+// CHECK-NEXT: SHF_MERGE<br>
+// CHECK-NEXT: SHF_STRINGS<br>
+// CHECK-NEXT: ]<br>
+// CHECK-NEXT: Address:<br>
+// CHECK-NEXT: Offset:<br>
+// CHECK-NEXT: Size: 4<br>
+// CHECK-NEXT: Link: 0<br>
+// CHECK-NEXT: Info: 0<br>
+// CHECK-NEXT: AddressAlignment: 1<br>
+// CHECK-NEXT: EntrySize: 1<br>
+// CHECK-NEXT: SectionData (<br>
+// CHECK-NEXT: 0000: 62617200 |bar.|<br>
+// CHECK-NEXT: )<br>
+<br>
+ .section .data.f,"aw",@progbits<br>
+ .globl f<br>
+f:<br>
+ .quad .rodata.str1.1 + 4<br>
+<br>
+ .section .data.g,"aw",@progbits<br>
+ .hidden g<br>
+ .globl g<br>
+g:<br>
+ .quad .rodata.str1.1<br>
+<br>
+ .section .rodata.str1.1,"aMS",@progbits,1<br>
+.L.str:<br>
+ .asciz "foo"<br>
+.L.str.1:<br>
+ .asciz "bar"<br>
<br>
Added: lld/trunk/test/ELF/gc-sections-merge-implicit-addend.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-merge-implicit-addend.s?rev=267164&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-merge-implicit-addend.s?rev=267164&view=auto</a><br>
==============================================================================<br>
--- lld/trunk/test/ELF/gc-sections-merge-implicit-addend.s (added)<br>
+++ lld/trunk/test/ELF/gc-sections-merge-implicit-addend.s Fri Apr 22 11:46:08 2016<br>
@@ -0,0 +1,39 @@<br>
+// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=i386-pc-linux<br>
+// RUN: ld.lld %t.o -o %t.so -shared --gc-sections<br>
+// RUN: llvm-readobj -s -section-data %t.so | FileCheck %s<br>
+<br>
+<br>
+// CHECK: Name: .rodata<br>
+// CHECK-NEXT: Type: SHT_PROGBITS<br>
+// CHECK-NEXT: Flags [<br>
+// CHECK-NEXT: SHF_ALLOC<br>
+// CHECK-NEXT: SHF_MERGE<br>
+// CHECK-NEXT: SHF_STRINGS<br>
+// CHECK-NEXT: ]<br>
+// CHECK-NEXT: Address:<br>
+// CHECK-NEXT: Offset:<br>
+// CHECK-NEXT: Size: 4<br>
+// CHECK-NEXT: Link: 0<br>
+// CHECK-NEXT: Info: 0<br>
+// CHECK-NEXT: AddressAlignment: 1<br>
+// CHECK-NEXT: EntrySize: 1<br>
+// CHECK-NEXT: SectionData (<br>
+// CHECK-NEXT: 0000: 62617200 |bar.|<br>
+// CHECK-NEXT: )<br>
+<br>
+ .section .data.f,"aw",@progbits<br>
+ .globl f<br>
+f:<br>
+ .long .rodata.str1.1 + 4<br>
+<br>
+ .section .data.g,"aw",@progbits<br>
+ .hidden g<br>
+ .globl g<br>
+g:<br>
+ .long .rodata.str1.1<br>
+<br>
+ .section .rodata.str1.1,"aMS",@progbits,1<br>
+.L.str:<br>
+ .asciz "foo"<br>
+.L.str.1:<br>
+ .asciz "bar"<br>
<br>
Added: lld/trunk/test/ELF/gc-sections-merge.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-merge.s?rev=267164&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-merge.s?rev=267164&view=auto</a><br>
==============================================================================<br>
--- lld/trunk/test/ELF/gc-sections-merge.s (added)<br>
+++ lld/trunk/test/ELF/gc-sections-merge.s Fri Apr 22 11:46:08 2016<br>
@@ -0,0 +1,61 @@<br>
+// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux<br>
+// RUN: ld.lld %t.o -o %t.so -shared<br>
+// RUN: ld.lld %t.o -o %<a href="http://t.gc.so" rel="noreferrer" target="_blank">t.gc.so</a> -shared --gc-sections<br>
+// RUN: llvm-readobj -s -section-data %t.so | FileCheck %s<br>
+// RUN: llvm-readobj -s -section-data %<a href="http://t.gc.so" rel="noreferrer" target="_blank">t.gc.so</a> | FileCheck --check-prefix=GC %s<br>
+<br>
+<br>
+// CHECK: Name: .rodata<br>
+// CHECK-NEXT: Type: SHT_PROGBITS<br>
+// CHECK-NEXT: Flags [<br>
+// CHECK-NEXT: SHF_ALLOC<br>
+// CHECK-NEXT: SHF_MERGE<br>
+// CHECK-NEXT: SHF_STRINGS<br>
+// CHECK-NEXT: ]<br>
+// CHECK-NEXT: Address:<br>
+// CHECK-NEXT: Offset:<br>
+// CHECK-NEXT: Size: 8<br>
+// CHECK-NEXT: Link: 0<br>
+// CHECK-NEXT: Info: 0<br>
+// CHECK-NEXT: AddressAlignment: 1<br>
+// CHECK-NEXT: EntrySize: 1<br>
+// CHECK-NEXT: SectionData (<br>
+// CHECK-NEXT: 0000: 666F6F00 62617200 |foo.bar.|<br>
+// CHECK-NEXT: )<br>
+<br>
+// GC: Name: .rodata<br>
+// GC-NEXT: Type: SHT_PROGBITS<br>
+// GC-NEXT: Flags [<br>
+// GC-NEXT: SHF_ALLOC<br>
+// GC-NEXT: SHF_MERGE<br>
+// GC-NEXT: SHF_STRINGS<br>
+// GC-NEXT: ]<br>
+// GC-NEXT: Address:<br>
+// GC-NEXT: Offset:<br>
+// GC-NEXT: Size: 4<br>
+// GC-NEXT: Link: 0<br>
+// GC-NEXT: Info: 0<br>
+// GC-NEXT: AddressAlignment: 1<br>
+// GC-NEXT: EntrySize: 1<br>
+// GC-NEXT: SectionData (<br>
+// GC-NEXT: 0000: 666F6F00 |foo.|<br>
+// GC-NEXT: )<br>
+<br>
+ .section .text.f,"ax",@progbits<br>
+ .globl f<br>
+f:<br>
+ leaq .L.str(%rip), %rax<br>
+ retq<br>
+<br>
+ .section .text.g,"ax",@progbits<br>
+ .hidden g<br>
+ .globl g<br>
+g:<br>
+ leaq .L.str.1(%rip), %rax<br>
+ retq<br>
+<br>
+ .section .rodata.str1.1,"aMS",@progbits,1<br>
+.L.str:<br>
+ .asciz "foo"<br>
+.L.str.1:<br>
+ .asciz "bar"<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div>