AtomSection<ELFT> *DefaultLayout<ELFT>::getSection(
StringRef sectionName, int32_t contentType,
DefinedAtom::ContentPermissions permissions) {
- const SectionKey sectionKey(sectionName, permissions);
+ // FIXME: We really need the file path here in the SectionKey, when that
+ // is available, replace the sectionKey that has outputSectionName to the
+ // inputSectionName.
+ StringRef outputSectionName = getOutputSectionName(sectionName);
+ const SectionKey sectionKey(outputSectionName, permissions);
auto sec = _sectionMap.find(sectionKey);
if (sec != _sectionMap.end())
return sec->second;
getSectionOrder(sectionName, contentType, permissions);
AtomSection<ELFT> *newSec =
createSection(sectionName, contentType, permissions, sectionOrder);
- newSec->setOutputSectionName(getOutputSectionName(sectionName));
+ newSec->setOutputSectionName(outputSectionName);
newSec->setOrder(sectionOrder);
_sections.push_back(newSec);
_sectionMap.insert(std::make_pair(sectionKey, newSec));
# RUN: yaml2obj -format=elf -docnum 3 %s > %t-obj.o
# RUN: lld -flavor gnu -target mipsel -shared --output-filetype=yaml \
# RUN: %t-crtbeginS.o %t-obj.o %t-crtendS.o | FileCheck %s
+# RUN: lld -flavor gnu -target mipsel -shared -o %t.so \
+# RUN: %t-crtbeginS.o %t-obj.o %t-crtendS.o
+# RUN: llvm-objdump -s %t.so | FileCheck -check-prefix=RAW %s
# CHECK: defined-atoms:
# CHECK-NEXT: - ref-name: L000
# CHECK-NEXT: section-choice: custom-required
# CHECK-NEXT: section-name: .ctors
+# RAW: Contents of section .ctors:
+# RAW-NEXT: 2000 ffffffff 11111111 22222222 00000000
# crtbeginS.o
---
FileHeader: