[llvm] 64c8560 - Revert "[Object][x86-64] Add support for `R_X86_64_GLOB_DAT` relocations. (#103029)" (#103497)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 09:01:12 PDT 2024


Author: Fangrui Song
Date: 2024-08-15T17:01:06+01:00
New Revision: 64c856055aed97603510410fd2feab273e1d5b8a

URL: https://github.com/llvm/llvm-project/commit/64c856055aed97603510410fd2feab273e1d5b8a
DIFF: https://github.com/llvm/llvm-project/commit/64c856055aed97603510410fd2feab273e1d5b8a.diff

LOG: Revert "[Object][x86-64] Add support for `R_X86_64_GLOB_DAT` relocations. (#103029)" (#103497)

This reverts commit 5ae9faa538d100ab38f6f4f99c924de0e4270272.

RelocationResolver is only supposed to handle static relocation types.
Introducing GLOB_DAT could negatively impact other RelocationResolver
users who solely handle static relocations and want to report errors for
dynamic relocations.

If GLOB_DAT is the sole required relocation, explicitly checking for it
in the caller would be more reliable. Additionally, the caller should
handle GLOB_DAT on other architectures.

Added: 
    

Modified: 
    llvm/lib/Object/RelocationResolver.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Object/RelocationResolver.cpp b/llvm/lib/Object/RelocationResolver.cpp
index 7f90834c3d2199..d9bb8f175ef83a 100644
--- a/llvm/lib/Object/RelocationResolver.cpp
+++ b/llvm/lib/Object/RelocationResolver.cpp
@@ -47,7 +47,6 @@ static bool supportsX86_64(uint64_t Type) {
   case ELF::R_X86_64_PC64:
   case ELF::R_X86_64_32:
   case ELF::R_X86_64_32S:
-  case ELF::R_X86_64_GLOB_DAT:
     return true;
   default:
     return false;
@@ -69,8 +68,6 @@ static uint64_t resolveX86_64(uint64_t Type, uint64_t Offset, uint64_t S,
   case ELF::R_X86_64_32:
   case ELF::R_X86_64_32S:
     return (S + Addend) & 0xFFFFFFFF;
-  case ELF::R_X86_64_GLOB_DAT:
-    return S;
   default:
     llvm_unreachable("Invalid relocation type");
   }


        


More information about the llvm-commits mailing list