[lld] 16ca490 - [ELF] Change getRISCVPCRelHi20 error to conventional errorOrWarn

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 12 21:15:11 PDT 2022


Author: Fangrui Song
Date: 2022-06-12T21:15:06-07:00
New Revision: 16ca490f450ea3ceaeda92addd8546967af4b2e1

URL: https://github.com/llvm/llvm-project/commit/16ca490f450ea3ceaeda92addd8546967af4b2e1
DIFF: https://github.com/llvm/llvm-project/commit/16ca490f450ea3ceaeda92addd8546967af4b2e1.diff

LOG: [ELF] Change getRISCVPCRelHi20 error to conventional errorOrWarn

Added: 
    

Modified: 
    lld/ELF/InputSection.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 6acf4067b907e..97fc18b58244d 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -532,8 +532,8 @@ static uint64_t getARMStaticBase(const Symbol &sym) {
 static Relocation *getRISCVPCRelHi20(const Symbol *sym, uint64_t addend) {
   const Defined *d = cast<Defined>(sym);
   if (!d->section) {
-    error("R_RISCV_PCREL_LO12 relocation points to an absolute symbol: " +
-          sym->getName());
+    errorOrWarn("R_RISCV_PCREL_LO12 relocation points to an absolute symbol: " +
+                sym->getName());
     return nullptr;
   }
   InputSection *isec = cast<InputSection>(d->section);
@@ -557,8 +557,9 @@ static Relocation *getRISCVPCRelHi20(const Symbol *sym, uint64_t addend) {
         it->type == R_RISCV_TLS_GD_HI20 || it->type == R_RISCV_TLS_GOT_HI20)
       return &*it;
 
-  error("R_RISCV_PCREL_LO12 relocation points to " + isec->getObjMsg(d->value) +
-        " without an associated R_RISCV_PCREL_HI20 relocation");
+  errorOrWarn("R_RISCV_PCREL_LO12 relocation points to " +
+              isec->getObjMsg(d->value) +
+              " without an associated R_RISCV_PCREL_HI20 relocation");
   return nullptr;
 }
 


        


More information about the llvm-commits mailing list