summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.h
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-11-03 08:21:51 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-11-03 08:21:51 +0000
commit8c825db25e32365652c9d68177224f8c3c1a551a (patch)
tree0dff873d733bbbbf74e69f6276538974552da14a /lld/ELF/LinkerScript.h
parentcbed0e615b3658add66600d89e1d47c80a99a22d (diff)
downloadbcm5719-llvm-8c825db25e32365652c9d68177224f8c3c1a551a.tar.gz
bcm5719-llvm-8c825db25e32365652c9d68177224f8c3c1a551a.zip
[ELF] - Linkerscript: fixed non-determinism when handling MEMORY.
When findMemoryRegion do search to find a region for output section it iterates over MemoryRegions which is DenseMap and so does not guarantee iteration in insertion order. As a result selected region depends on its name and not on its definition position Testcase shows the issue, patch fixes it. Behavior after applying the patch seems consistent with bfd. Differential revision: https://reviews.llvm.org/D39544 llvm-svn: 317307
Diffstat (limited to 'lld/ELF/LinkerScript.h')
-rw-r--r--lld/ELF/LinkerScript.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index 478405d463f..ba9e87720f7 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -277,7 +277,7 @@ public:
std::vector<InputSectionDescription *> KeptSections;
// A map from memory region name to a memory region descriptor.
- llvm::DenseMap<llvm::StringRef, MemoryRegion *> MemoryRegions;
+ llvm::MapVector<llvm::StringRef, MemoryRegion *> MemoryRegions;
// A list of symbols referenced by the script.
std::vector<llvm::StringRef> ReferencedSymbols;
OpenPOWER on IntegriCloud