summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r--lld/ELF/Writer.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 42c1c0bac5f..c48c4bfb833 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -2384,9 +2384,21 @@ static uint16_t getELFType() {
static uint8_t getAbiVersion() {
// MIPS non-PIC executable gets ABI version 1.
- if (Config->EMachine == EM_MIPS && getELFType() == ET_EXEC &&
- (Config->EFlags & (EF_MIPS_PIC | EF_MIPS_CPIC)) == EF_MIPS_CPIC)
- return 1;
+ if (Config->EMachine == EM_MIPS) {
+ if (getELFType() == ET_EXEC &&
+ (Config->EFlags & (EF_MIPS_PIC | EF_MIPS_CPIC)) == EF_MIPS_CPIC)
+ return 1;
+ return 0;
+ }
+
+ if (Config->EMachine == EM_AMDGPU) {
+ uint8_t Ver = ObjectFiles[0]->ABIVersion;
+ for (InputFile *File : makeArrayRef(ObjectFiles).slice(1))
+ if (File->ABIVersion != Ver)
+ error("incompatible ABI version: " + toString(File));
+ return Ver;
+ }
+
return 0;
}
OpenPOWER on IntegriCloud