Skip to content

Commit 679c77e

Browse files
committed
[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
1 parent fa6b9e4 commit 679c77e

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
451451
CmdArgs.push_back("--fix-cortex-a53-843419");
452452
}
453453

454-
// Android does not allow shared text relocations. Emit a warning if the
455-
// user's code contains any.
456-
if (isAndroid)
457-
CmdArgs.push_back("--warn-shared-textrel");
458-
459454
ToolChain.addExtraOpts(CmdArgs);
460455

461456
CmdArgs.push_back("--eh-frame-hdr");

clang/test/Driver/linux-ld.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -989,12 +989,6 @@
989989
// CHECK-ANDROID-HASH-STYLE-M: "{{.*}}ld{{(.exe)?}}"
990990
// CHECK-ANDROID-HASH-STYLE-M: "--hash-style=gnu"
991991

992-
// RUN: %clang %s -### -o %t.o 2>&1 \
993-
// RUN: --target=armv7-linux-android21 \
994-
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-WARN-SHARED-TEXTREL %s
995-
// CHECK-ANDROID-WARN-SHARED-TEXTREL: "{{.*}}ld{{(.exe)?}}"
996-
// CHECK-ANDROID-WARN-SHARED-TEXTREL: "--warn-shared-textrel"
997-
998992
// RUN: %clang %s -### -o %t.o 2>&1 --target=mips64-linux-gnuabin32 \
999993
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABIN32 %s
1000994
// CHECK-MIPS64EL-GNUABIN32: "{{.*}}ld{{(.exe)?}}"

0 commit comments

Comments
 (0)