[ELF][MIPS] Make stable an order of GOT page address entries

llvm-svn: 288137
This commit is contained in:
Simon Atanasyan 2016-11-29 13:26:04 +00:00
parent c17fb85090
commit 160bf723f5
2 changed files with 3 additions and 8 deletions

View 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;

View 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)