[clang] 679c77e - [Driver][Android] Removed obsoleted --warn-shared-textrel

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 4 09:30:15 PST 2022


Author: Fangrui Song
Date: 2022-02-04T09:30:11-08:00
New Revision: 679c77ede35aee6f6a5d1feee28a057e3705f58b

URL: https://github.com/llvm/llvm-project/commit/679c77ede35aee6f6a5d1feee28a057e3705f58b
DIFF: https://github.com/llvm/llvm-project/commit/679c77ede35aee6f6a5d1feee28a057e3705f58b.diff

LOG: [Driver][Android] Removed obsoleted --warn-shared-textrel

--warn-shared-textrel is ignored in ld.lld and obsoleted in GNU ld
(https://sourceware.org/bugzilla/show_bug.cgi?id=22909).

Note: binutils can be configured with --enable-textrel-check=[yes|error]
to make GNU ld error for text relocations by default, like ld.lld.

Reviewed By: srhines

Differential Revision: https://reviews.llvm.org/D118942

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Gnu.cpp
    clang/test/Driver/linux-ld.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 7a9570a686f4b..12eaf1fb8b514 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -451,11 +451,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
       CmdArgs.push_back("--fix-cortex-a53-843419");
   }
 
-  // Android does not allow shared text relocations. Emit a warning if the
-  // user's code contains any.
-  if (isAndroid)
-      CmdArgs.push_back("--warn-shared-textrel");
-
   ToolChain.addExtraOpts(CmdArgs);
 
   CmdArgs.push_back("--eh-frame-hdr");

diff  --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
index b70b712c2eb77..fc0a40d0cbe66 100644
--- a/clang/test/Driver/linux-ld.c
+++ b/clang/test/Driver/linux-ld.c
@@ -989,12 +989,6 @@
 // CHECK-ANDROID-HASH-STYLE-M: "{{.*}}ld{{(.exe)?}}"
 // CHECK-ANDROID-HASH-STYLE-M: "--hash-style=gnu"
 
-// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN:     --target=armv7-linux-android21 \
-// RUN:   | FileCheck --check-prefix=CHECK-ANDROID-WARN-SHARED-TEXTREL %s
-// CHECK-ANDROID-WARN-SHARED-TEXTREL: "{{.*}}ld{{(.exe)?}}"
-// CHECK-ANDROID-WARN-SHARED-TEXTREL: "--warn-shared-textrel"
-
 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64-linux-gnuabin32 \
 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABIN32 %s
 // CHECK-MIPS64EL-GNUABIN32: "{{.*}}ld{{(.exe)?}}"


        


More information about the cfe-commits mailing list