Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit f45adc2

Browse files
committed
Rename K_MIPS64 to K_GNU64
This patch renames K_MIPS64 to K_GNU64 as part of a change to add support for writing archives with 64-bit indexes in the symbol table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313787 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent ca18763 commit f45adc2

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

include/llvm/Object/Archive.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class Archive : public Binary {
229229

230230
enum Kind {
231231
K_GNU,
232-
K_MIPS64,
232+
K_GNU64,
233233
K_BSD,
234234
K_DARWIN,
235235
K_DARWIN64,

lib/Object/Archive.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Expected<StringRef> ArchiveMemberHeader::getName(uint64_t Size) const {
179179

180180
// GNU long file names end with a "/\n".
181181
if (Parent->kind() == Archive::K_GNU ||
182-
Parent->kind() == Archive::K_MIPS64) {
182+
Parent->kind() == Archive::K_GNU64) {
183183
StringRef::size_type End = StringRef(addr).find('\n');
184184
return StringRef(addr, End - 1);
185185
}
@@ -338,7 +338,7 @@ Archive::Child::Child(const Archive *Parent, const char *Start, Error *Err)
338338

339339
ErrorAsOutParameter ErrAsOutParam(Err);
340340

341-
// If there was an error in the construction of the Header
341+
// If there was an error in the construction of the Header
342342
// then just return with the error now set.
343343
if (*Err)
344344
return;
@@ -698,7 +698,7 @@ Archive::Archive(MemoryBufferRef Source, Error &Err)
698698
}
699699

700700
if (Name == "//") {
701-
Format = has64SymTable ? K_MIPS64 : K_GNU;
701+
Format = has64SymTable ? K_GNU64 : K_GNU;
702702
// The string table is never an external member, but we still
703703
// must check any Expected<> return value.
704704
Expected<StringRef> BufOrErr = C->getBuffer();
@@ -715,7 +715,7 @@ Archive::Archive(MemoryBufferRef Source, Error &Err)
715715
}
716716

717717
if (Name[0] != '/') {
718-
Format = has64SymTable ? K_MIPS64 : K_GNU;
718+
Format = has64SymTable ? K_GNU64 : K_GNU;
719719
setFirstRegular(*C);
720720
Err = Error::success();
721721
return;
@@ -797,14 +797,14 @@ StringRef Archive::Symbol::getName() const {
797797
Expected<Archive::Child> Archive::Symbol::getMember() const {
798798
const char *Buf = Parent->getSymbolTable().begin();
799799
const char *Offsets = Buf;
800-
if (Parent->kind() == K_MIPS64 || Parent->kind() == K_DARWIN64)
800+
if (Parent->kind() == K_GNU64 || Parent->kind() == K_DARWIN64)
801801
Offsets += sizeof(uint64_t);
802802
else
803803
Offsets += sizeof(uint32_t);
804804
uint32_t Offset = 0;
805805
if (Parent->kind() == K_GNU) {
806806
Offset = read32be(Offsets + SymbolIndex * 4);
807-
} else if (Parent->kind() == K_MIPS64) {
807+
} else if (Parent->kind() == K_GNU64) {
808808
Offset = read64be(Offsets + SymbolIndex * 8);
809809
} else if (Parent->kind() == K_BSD) {
810810
// The SymbolIndex is an index into the ranlib structs that start at
@@ -902,7 +902,7 @@ Archive::symbol_iterator Archive::symbol_begin() const {
902902
uint32_t symbol_count = 0;
903903
symbol_count = read32be(buf);
904904
buf += sizeof(uint32_t) + (symbol_count * (sizeof(uint32_t)));
905-
} else if (kind() == K_MIPS64) {
905+
} else if (kind() == K_GNU64) {
906906
uint64_t symbol_count = read64be(buf);
907907
buf += sizeof(uint64_t) + (symbol_count * (sizeof(uint64_t)));
908908
} else if (kind() == K_BSD) {
@@ -959,7 +959,7 @@ uint32_t Archive::getNumberOfSymbols() const {
959959
const char *buf = getSymbolTable().begin();
960960
if (kind() == K_GNU)
961961
return read32be(buf);
962-
if (kind() == K_MIPS64)
962+
if (kind() == K_GNU64)
963963
return read64be(buf);
964964
if (kind() == K_BSD)
965965
return read32le(buf) / 8;

lib/Object/ArchiveWriter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static bool isBSDLike(object::Archive::Kind Kind) {
133133
case object::Archive::K_BSD:
134134
case object::Archive::K_DARWIN:
135135
return true;
136-
case object::Archive::K_MIPS64:
136+
case object::Archive::K_GNU64:
137137
case object::Archive::K_DARWIN64:
138138
case object::Archive::K_COFF:
139139
break;

0 commit comments

Comments
 (0)