summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
diff options
context:
space:
mode:
authorShankar Easwaran <shankarke@gmail.com>2014-03-31 03:16:37 +0000
committerShankar Easwaran <shankarke@gmail.com>2014-03-31 03:16:37 +0000
commit79cfed55fc923b137a1a41702534b6830c4f5851 (patch)
tree2517c558ff2a49c338922de8956ab30559ba881a /lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
parent82ec13e3d56dc463a0bbd49d5922e3387119ab27 (diff)
downloadbcm5719-llvm-79cfed55fc923b137a1a41702534b6830c4f5851.tar.gz
bcm5719-llvm-79cfed55fc923b137a1a41702534b6830c4f5851.zip
[core] support .gnu.linkonce sections
.gnu.linkonce sections are similar to section groups. They were supported before section groups existed and provided a way to resolve COMDAT sections using a different design. There are few implementations that use .gnu.linkonce sections to store simple floating point constants which doesnot require complex section group support but need a way to store only one copy of the floating point constant. .gnu.linkonce based symbol resolution achieves that. llvm-svn: 205163
Diffstat (limited to 'lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp')
-rw-r--r--lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
index 49de7f551cf..b2295f87d66 100644
--- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
+++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
@@ -71,7 +71,9 @@ public:
if (!atom->name().empty())
buildDuplicateNameMap(*atom);
- if (atom->contentType() == DefinedAtom::typeGroupComdat) {
+ if (atom->contentType() == DefinedAtom::typeGroupComdat ||
+ atom->contentType() == DefinedAtom::typeGnuLinkOnce) {
+
for (const lld::Reference *ref : *atom) {
if (ref->kindNamespace() != lld::Reference::KindNamespace::all)
continue;
@@ -229,7 +231,8 @@ private:
}
if (const lld::DefinedAtom *da = dyn_cast<DefinedAtom>(atom)) {
- if (da->contentType() == DefinedAtom::typeGroupComdat) {
+ if (da->contentType() == DefinedAtom::typeGroupComdat ||
+ da->contentType() == DefinedAtom::typeGnuLinkOnce) {
if (_groupMap.count(name)) {
_io.setError(Twine("duplicate group name: ") + name);
} else {
@@ -476,7 +479,8 @@ template <> struct ScalarEnumerationTraits<lld::DefinedAtom::ContentType> {
io.enumCase(value, "ro-note", DefinedAtom::typeRONote);
io.enumCase(value, "rw-note", DefinedAtom::typeRWNote);
io.enumCase(value, "no-alloc", DefinedAtom::typeNoAlloc);
- io.enumCase(value, "group-comdat", DefinedAtom::typeGroupComdat);
+ io.enumCase(value, "group-comdat", DefinedAtom::typeGroupComdat);
+ io.enumCase(value, "gnu-linkonce", DefinedAtom::typeGnuLinkOnce);
}
};
OpenPOWER on IntegriCloud