llvm.org GIT mirror llvm / f45adc2
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 Jake Ehrlich 2 years ago
3 changed file(s) with 10 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
228228
229229 enum Kind {
230230 K_GNU,
231 K_MIPS64,
231 K_GNU64,
232232 K_BSD,
233233 K_DARWIN,
234234 K_DARWIN64,
178178
179179 // GNU long file names end with a "/\n".
180180 if (Parent->kind() == Archive::K_GNU ||
181 Parent->kind() == Archive::K_MIPS64) {
181 Parent->kind() == Archive::K_GNU64) {
182182 StringRef::size_type End = StringRef(addr).find('\n');
183183 return StringRef(addr, End - 1);
184184 }
337337
338338 ErrorAsOutParameter ErrAsOutParam(Err);
339339
340 // If there was an error in the construction of the Header
340 // If there was an error in the construction of the Header
341341 // then just return with the error now set.
342342 if (*Err)
343343 return;
697697 }
698698
699699 if (Name == "//") {
700 Format = has64SymTable ? K_MIPS64 : K_GNU;
700 Format = has64SymTable ? K_GNU64 : K_GNU;
701701 // The string table is never an external member, but we still
702702 // must check any Expected<> return value.
703703 Expected BufOrErr = C->getBuffer();
714714 }
715715
716716 if (Name[0] != '/') {
717 Format = has64SymTable ? K_MIPS64 : K_GNU;
717 Format = has64SymTable ? K_GNU64 : K_GNU;
718718 setFirstRegular(*C);
719719 Err = Error::success();
720720 return;
796796 Expected Archive::Symbol::getMember() const {
797797 const char *Buf = Parent->getSymbolTable().begin();
798798 const char *Offsets = Buf;
799 if (Parent->kind() == K_MIPS64 || Parent->kind() == K_DARWIN64)
799 if (Parent->kind() == K_GNU64 || Parent->kind() == K_DARWIN64)
800800 Offsets += sizeof(uint64_t);
801801 else
802802 Offsets += sizeof(uint32_t);
803803 uint32_t Offset = 0;
804804 if (Parent->kind() == K_GNU) {
805805 Offset = read32be(Offsets + SymbolIndex * 4);
806 } else if (Parent->kind() == K_MIPS64) {
806 } else if (Parent->kind() == K_GNU64) {
807807 Offset = read64be(Offsets + SymbolIndex * 8);
808808 } else if (Parent->kind() == K_BSD) {
809809 // The SymbolIndex is an index into the ranlib structs that start at
901901 uint32_t symbol_count = 0;
902902 symbol_count = read32be(buf);
903903 buf += sizeof(uint32_t) + (symbol_count * (sizeof(uint32_t)));
904 } else if (kind() == K_MIPS64) {
904 } else if (kind() == K_GNU64) {
905905 uint64_t symbol_count = read64be(buf);
906906 buf += sizeof(uint64_t) + (symbol_count * (sizeof(uint64_t)));
907907 } else if (kind() == K_BSD) {
958958 const char *buf = getSymbolTable().begin();
959959 if (kind() == K_GNU)
960960 return read32be(buf);
961 if (kind() == K_MIPS64)
961 if (kind() == K_GNU64)
962962 return read64be(buf);
963963 if (kind() == K_BSD)
964964 return read32le(buf) / 8;
132132 case object::Archive::K_BSD:
133133 case object::Archive::K_DARWIN:
134134 return true;
135 case object::Archive::K_MIPS64:
135 case object::Archive::K_GNU64:
136136 case object::Archive::K_DARWIN64:
137137 case object::Archive::K_COFF:
138138 break;