forked from OSchip/llvm-project
parent
1a043aefc4
commit
51f604ce66
|
@ -38,21 +38,21 @@ AMDGPU::AMDGPU() {
|
||||||
GotEntrySize = 8;
|
GotEntrySize = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t AMDGPU::calcEFlags() const {
|
static uint32_t getEFlags(InputFile *File) {
|
||||||
if (ObjectFiles.empty())
|
return cast<ObjFile<ELF64LE>>(File)->getObj().getHeader()->e_flags;
|
||||||
return 0;
|
}
|
||||||
|
|
||||||
uint32_t Ret =
|
uint32_t AMDGPU::calcEFlags() const {
|
||||||
cast<ObjFile<ELF64LE>>(ObjectFiles.front())->getObj().getHeader()->e_flags;
|
assert(!ObjectFiles.empty());
|
||||||
|
uint32_t Ret = getEFlags(ObjectFiles[0]);
|
||||||
|
|
||||||
// Verify that all input files have the same e_flags.
|
// Verify that all input files have the same e_flags.
|
||||||
for (InputFile *F : ArrayRef<InputFile*>(ObjectFiles).slice(1)) {
|
for (InputFile *F : makeArrayRef(ObjectFiles).slice(1)) {
|
||||||
if (Ret != cast<ObjFile<ELF64LE>>(F)->getObj().getHeader()->e_flags) {
|
if (Ret == getEFlags(F))
|
||||||
|
continue;
|
||||||
error("incompatible e_flags: " + toString(F));
|
error("incompatible e_flags: " + toString(F));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue