Author: Fangrui Song Date: 2022-02-09T10:11:10-08:00 New Revision: 7efa49801166f221d8fd7b20ac0d04368b8ea9d5
URL: https://github.com/llvm/llvm-project/commit/7efa49801166f221d8fd7b20ac0d04368b8ea9d5 DIFF: https://github.com/llvm/llvm-project/commit/7efa49801166f221d8fd7b20ac0d04368b8ea9d5.diff LOG: [ELF] Warn about to-be-removed -d, -dc, -dp, and --[no-]define-common See https://github.com/llvm/llvm-project/issues/53660 Added: Modified: lld/ELF/Driver.cpp lld/test/ELF/relocatable-common.s Removed: ################################################################################ diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index ca56f5ee0f10f..54b487bdc2434 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1240,6 +1240,9 @@ static void readConfigs(opt::InputArgList &args) { error(errPrefix + toString(pat.takeError())); } + if (args.hasArg(OPT_define_common, OPT_no_define_common)) + warn("-d, -dc, -dp, and --[no-]define-common will be removed. See https://github.com/llvm/llvm-project/issues/53660"); + cl::ResetAllOptionOccurrences(); // Parse LTO options. diff --git a/lld/test/ELF/relocatable-common.s b/lld/test/ELF/relocatable-common.s index 0c89cea9be406..1b87358217f12 100644 --- a/lld/test/ELF/relocatable-common.s +++ b/lld/test/ELF/relocatable-common.s @@ -2,17 +2,19 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o # RUN: ld.lld -r %t1.o -o %t # RUN: llvm-readobj --symbols -r %t | FileCheck %s -# RUN: ld.lld -r --no-define-common %t1.o -o %t +# RUN: ld.lld -r --no-define-common %t1.o -o %t 2>&1 | FileCheck %s --check-prefix=WARN # RUN: llvm-readobj --symbols -r %t | FileCheck %s -# RUN: ld.lld -r --define-common %t1.o -o %t +# RUN: ld.lld -r --define-common %t1.o -o %t 2>&1 | FileCheck %s --check-prefix=WARN # RUN: llvm-readobj --symbols -r %t | FileCheck -check-prefix=DEFCOMM %s -# RUN: ld.lld -r -d %t1.o -o %t +# RUN: ld.lld -r -d %t1.o -o %t 2>&1 | FileCheck %s --check-prefix=WARN # RUN: llvm-readobj --symbols -r %t | FileCheck -check-prefix=DEFCOMM %s -# RUN: ld.lld -r -dc %t1.o -o %t +# RUN: ld.lld -r -dc %t1.o -o %t 2>&1 | FileCheck %s --check-prefix=WARN # RUN: llvm-readobj --symbols -r %t | FileCheck -check-prefix=DEFCOMM %s -# RUN: ld.lld -r -dp %t1.o -o %t +# RUN: ld.lld -r -dp %t1.o -o %t 2>&1 | FileCheck %s --check-prefix=WARN # RUN: llvm-readobj --symbols -r %t | FileCheck -check-prefix=DEFCOMM %s +# WARN: warning: -d, -dc, -dp, and --[no-]define-common will be removed. See https://github.com/llvm/llvm-project/issues/53660 + # CHECK: Symbol { # CHECK: Name: common # CHECK-NEXT: Value: 0x4 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits