[ELF][MIPS] Make stable an order of GOT page address entries
authorSimon Atanasyan <simon@atanasyan.com>
Tue, 29 Nov 2016 13:26:04 +0000 (13:26 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Tue, 29 Nov 2016 13:26:04 +0000 (13:26 +0000)
llvm-svn: 288137

lld/ELF/SyntheticSections.h
lld/test/ELF/mips-got16.s

index 9434c8d..7677678 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "GdbIndex.h"
 #include "InputSection.h"
-#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/MapVector.h"
 
 namespace lld {
 namespace elf {
@@ -170,7 +170,7 @@ private:
   uint32_t PageEntriesNum = 0;
   // Map output sections referenced by MIPS GOT relocations
   // to the first index of "Page" entries allocated for this section.
-  llvm::SmallDenseMap<const OutputSectionBase *, size_t> PageIndexMap;
+  llvm::SmallMapVector<const OutputSectionBase *, size_t, 16> PageIndexMap;
 
   typedef std::pair<const SymbolBody *, uintX_t> GotEntry;
   typedef std::vector<GotEntry> GotEntries;
index 69b9f95..c4c14e4 100644 (file)
@@ -2,16 +2,11 @@
 
 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
 # RUN: ld.lld %t.o -shared -o %t.so
-# RUN: llvm-objdump -s %t.so | FileCheck -check-prefix=RAW %s
+# RUN: llvm-objdump -d -t %t.so | FileCheck %s
 # RUN: llvm-readobj -r -mips-plt-got %t.so | FileCheck -check-prefix=GOT %s
 
 # REQUIRES: mips
 
-# RAW:      Contents of section .got:
-# RAW-NEXT:  20000 00000000 80000000 00010000 00020000
-# RAW-NEXT:  20010 00030000 00040000 00050000 00060000
-# RAW-NEXT:  20020 00051008 00000000
-
 # CHECK:      Disassembly of section .text:
 # CHECK-NEXT: __start:
 # CHECK-NEXT:    10000:       8f 88 80 18     lw      $8, -32744($gp)