diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index dd785cc698cb15..175fc6be05ae55 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1058,7 +1058,7 @@ static void readConfigs(opt::InputArgList &args) { config->fixCortexA8 = args.hasArg(OPT_fix_cortex_a8) && !args.hasArg(OPT_relocatable); config->fortranCommon = - args.hasFlag(OPT_fortran_common, OPT_no_fortran_common, true); + args.hasFlag(OPT_fortran_common, OPT_no_fortran_common, false); config->gcSections = args.hasFlag(OPT_gc_sections, OPT_no_gc_sections, false); config->gnuUnique = args.hasFlag(OPT_gnu_unique, OPT_no_gnu_unique, true); config->gdbIndex = args.hasFlag(OPT_gdb_index, OPT_no_gdb_index, false); diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst index dc74b8abd17b3c..fc493b3f724d42 100644 --- a/lld/docs/ReleaseNotes.rst +++ b/lld/docs/ReleaseNotes.rst @@ -28,6 +28,7 @@ ELF Improvements * ``-z pack-relative-relocs`` is now available to support ``DT_RELR`` for glibc 2.36+. (`D120701 `_) +* ``--no-fortran-common`` (pre 12.0.0 behavior) is now the default. Breaking changes ---------------- diff --git a/lld/test/ELF/common-archive-lookup.s b/lld/test/ELF/common-archive-lookup.s index bbfadb448f2d68..0e073591491a2d 100644 --- a/lld/test/ELF/common-archive-lookup.s +++ b/lld/test/ELF/common-archive-lookup.s @@ -25,10 +25,10 @@ ## Bitcode archive. # RUN: llvm-ar crs 4.a 1.bc 2.bc -# RUN: ld.lld -o 1 main.o 1.a +# RUN: ld.lld -o 1 main.o 1.a --fortran-common # RUN: llvm-objdump -D -j .data 1 | FileCheck --check-prefix=TEST1 %s -# RUN: ld.lld -o 2 main.o --start-lib 1.o strong_data_only.o --end-lib +# RUN: ld.lld -o 2 main.o --start-lib 1.o strong_data_only.o --end-lib --fortran-common # RUN: llvm-objdump -D -j .data 2 | FileCheck --check-prefix=TEST1 %s # RUN: ld.lld -o 3 main.o 2.a @@ -45,23 +45,25 @@ # RUN: ld.lld -o 7 main.o 2.o --start-lib 1.o strong_data_only.o --end-lib # RUN: llvm-objdump -D -j .data 7 | FileCheck --check-prefix=TEST2 %s -# RUN: not ld.lld -o 8 main.o 1.a strong_data_only.o 2>&1 | \ +# RUN: not ld.lld -o 8 main.o 1.a strong_data_only.o --fortran-common 2>&1 | \ # RUN: FileCheck --check-prefix=ERR %s -# RUN: not ld.lld -o 9 main.o --start-lib 1.o 2.o --end-lib strong_data_only.o 2>&1 | \ +# RUN: not ld.lld -o 9 main.o --start-lib 1.o 2.o --end-lib strong_data_only.o --fortran-common 2>&1 | \ # RUN: FileCheck --check-prefix=ERR %s # ERR: ld.lld: error: duplicate symbol: block # RUN: ld.lld --no-fortran-common -o 10 main.o 1.a # RUN: llvm-readobj --syms 10 | FileCheck --check-prefix=NFC %s +# RUN: ld.lld -o 10 main.o 1.a +# RUN: llvm-readobj --syms 10 | FileCheck --check-prefix=NFC %s # RUN: ld.lld --no-fortran-common -o 11 main.o --start-lib 1.o strong_data_only.o --end-lib # RUN: llvm-readobj --syms 11 | FileCheck --check-prefix=NFC %s -# RUN: ld.lld -o - main.o 4.a --lto-emit-asm | FileCheck --check-prefix=ASM %s +# RUN: ld.lld -o - main.o 4.a --fortran-common --lto-emit-asm | FileCheck --check-prefix=ASM %s -# RUN: ld.lld -o - main.o --start-lib 1.bc 2.bc --end-lib --lto-emit-asm | \ +# RUN: ld.lld -o - main.o --start-lib 1.bc 2.bc --end-lib --fortran-common --lto-emit-asm | \ # RUN: FileCheck --check-prefix=ASM %s ## COMMON overrides weak. Don't extract 3.bc which provides a weak definition. diff --git a/lld/test/ELF/warn-backrefs.s b/lld/test/ELF/warn-backrefs.s index 907f042c0e8183..483ef8a2decefb 100644 --- a/lld/test/ELF/warn-backrefs.s +++ b/lld/test/ELF/warn-backrefs.s @@ -77,7 +77,7 @@ # RUN: llvm-ar rcs %tcomm.a %tcomm.o # RUN: llvm-ar rcs %tstrong.a %tstrong.o # RUN: ld.lld --warn-backrefs %tcomm.a %t1.o %t5.o 2>&1 -o /dev/null | FileCheck --check-prefix=COMM %s -# RUN: ld.lld --fatal-warnings --warn-backrefs %tcomm.a %t1.o %t5.o %tstrong.a 2>&1 -o /dev/null +# RUN: ld.lld --fatal-warnings --fortran-common --warn-backrefs %tcomm.a %t1.o %t5.o %tstrong.a 2>&1 -o /dev/null # RUN: ld.lld --warn-backrefs --no-fortran-common %tcomm.a %t1.o %t5.o %tstrong.a 2>&1 -o /dev/null | FileCheck --check-prefix=COMM %s # COMM: ld.lld: warning: backward reference detected: obj in {{.*}}5.o refers to {{.*}}comm.a