Skip to content

Commit

Permalink
[ELF2] merge-string.s test fixed for win32 configuration.
Browse files Browse the repository at this point in the history
Differential revision: http://reviews.llvm.org/D14171

llvm-svn: 251644
  • Loading branch information
George Rimar committed Oct 29, 2015
1 parent b488a74 commit 8b8222b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lld/ELF/InputSection.cpp
Expand Up @@ -164,7 +164,7 @@ MergeInputSection<ELFT>::getOffset(uintX_t Offset) {
// Find the element this offset points to.
auto I = std::upper_bound(
this->Offsets.begin(), this->Offsets.end(), Offset,
[](const uintX_t &A, const std::pair<uintX_t, uintX_t> &B) {
[](const uintX_t &A, const std::pair<uintX_t, size_t> &B) {
return A < B.first;
});
size_t End = I == this->Offsets.end() ? Data.size() : I->first;
Expand All @@ -173,8 +173,8 @@ MergeInputSection<ELFT>::getOffset(uintX_t Offset) {

// Compute the Addend and if the Base is cached, return.
uintX_t Addend = Offset - Start;
uintX_t &Base = I->second;
if (Base != uintX_t(-1))
size_t &Base = I->second;
if (Base != size_t(-1))
return Base + Addend;

// Map the base to the offset in the output section and cashe it.
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/InputSection.h
Expand Up @@ -84,7 +84,7 @@ template <class ELFT> class MergeInputSection : public InputSectionBase<ELFT> {
typedef typename llvm::object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;

public:
std::vector<std::pair<uintX_t, uintX_t>> Offsets;
std::vector<std::pair<uintX_t, size_t>> Offsets;
MergeInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header);
static bool classof(const InputSectionBase<ELFT> *S);
// Translate an offset in the input section to an offset in the output
Expand Down

0 comments on commit 8b8222b

Please sign in to comment.