forked from OSchip/llvm-project
parent
f10cc02591
commit
9f37543cf8
|
@ -72,6 +72,11 @@ public:
|
|||
|
||||
Kind kind() const { return FileKind; }
|
||||
|
||||
bool isElf() const {
|
||||
Kind K = kind();
|
||||
return K == ObjKind || K == SharedKind;
|
||||
}
|
||||
|
||||
StringRef getName() const { return MB.getBufferIdentifier(); }
|
||||
MemoryBufferRef MB;
|
||||
|
||||
|
@ -121,10 +126,7 @@ public:
|
|||
typedef typename ELFT::SymRange Elf_Sym_Range;
|
||||
|
||||
ELFFileBase(Kind K, MemoryBufferRef M);
|
||||
static bool classof(const InputFile *F) {
|
||||
Kind K = F->kind();
|
||||
return K == ObjKind || K == SharedKind;
|
||||
}
|
||||
static bool classof(const InputFile *F) { return F->isElf(); }
|
||||
|
||||
llvm::object::ELFFile<ELFT> getObj() const {
|
||||
return check(llvm::object::ELFFile<ELFT>::create(MB.getBuffer()));
|
||||
|
|
|
@ -44,8 +44,8 @@ static InputFile *getFirstElf() {
|
|||
// All input object files must be for the same architecture
|
||||
// (e.g. it does not make sense to link x86 object files with
|
||||
// MIPS object files.) This function checks for that error.
|
||||
template <class ELFT> static bool isCompatible(InputFile *F) {
|
||||
if (!isa<ELFFileBase<ELFT>>(F) && !isa<BitcodeFile>(F))
|
||||
static bool isCompatible(InputFile *F) {
|
||||
if (!F->isElf() && !isa<BitcodeFile>(F))
|
||||
return true;
|
||||
|
||||
if (F->EKind == Config->EKind && F->EMachine == Config->EMachine) {
|
||||
|
@ -64,7 +64,7 @@ template <class ELFT> static bool isCompatible(InputFile *F) {
|
|||
|
||||
// Add symbols in File to the symbol table.
|
||||
template <class ELFT> void SymbolTable::addFile(InputFile *File) {
|
||||
if (!isCompatible<ELFT>(File))
|
||||
if (!isCompatible(File))
|
||||
return;
|
||||
|
||||
// Binary file
|
||||
|
|
Loading…
Reference in New Issue