From: Rui Ueyama Date: Mon, 21 Nov 2016 13:49:57 +0000 (+0000) Subject: Change the way how we print out line numbers. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8785ba4d7fab0c537d381a1438dd82cb093d514;p=platform%2Fupstream%2Fllvm.git Change the way how we print out line numbers. LLD's error messages contain line numbers, function names or section names. Currently they are formatter as follows. foo.c (32): symbol 'foo' not found foo.c (function bar): symbol 'foo' not found foo.c (.text+0x1234): symbol 'foo' not found This patch changes them so that they are consistent with Clang's output. foo.c:32: symbol 'foo' not found foo.c:(function bar): symbol 'foo' not found foo.c:(.text+0x1234): symbol 'foo' not found Differential Revision: https://reviews.llvm.org/D26901 llvm-svn: 287537 --- diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 72d8148..ae16a63 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -91,7 +91,7 @@ std::string elf::ObjectFile::getLineInfo(InputSectionBase *S, Info); if (Info.Line == 0) return ""; - return Info.FileName + " (" + std::to_string(Info.Line) + ")"; + return Info.FileName + ":" + std::to_string(Info.Line); } // Returns "(internal)", "foo.a(bar.o)" or "baz.o". diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 8bcf4d2..d6bfe10 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -554,11 +554,11 @@ std::string getLocation(InputSectionBase &S, typename ELFT::uint Offset) { DefinedRegular *Encl = getSymbolAt(&S, Offset); if (Encl && Encl->Type == STT_FUNC) { StringRef Func = getSymbolName(File->getStringTable(), *Encl); - return SrcFile + " (function " + maybeDemangle(Func) + ")"; + return SrcFile + ":(function " + maybeDemangle(Func) + ")"; } // If there's no symbol, print out the offset instead of a symbol name. - return (SrcFile + " (" + S.Name + "+0x" + Twine::utohexstr(Offset) + ")") + return (SrcFile + ":(" + S.Name + "+0x" + Twine::utohexstr(Offset) + ")") .str(); } diff --git a/lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.s b/lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.s index 4757ed2..0ebd0fd 100644 --- a/lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.s +++ b/lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.s @@ -1,7 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o add x0, x0, :lo12:dat .data diff --git a/lld/test/ELF/aarch64-fpic-adr_prel_lo21.s b/lld/test/ELF/aarch64-fpic-adr_prel_lo21.s index fb51450..d017496 100644 --- a/lld/test/ELF/aarch64-fpic-adr_prel_lo21.s +++ b/lld/test/ELF/aarch64-fpic-adr_prel_lo21.s @@ -1,7 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_AARCH64_ADR_PREL_LO21 against symbol 'dat' defined in {{.*}}.o +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_ADR_PREL_LO21 against symbol 'dat' defined in {{.*}}.o adr x0, dat .data diff --git a/lld/test/ELF/aarch64-fpic-adr_prel_pg_hi21.s b/lld/test/ELF/aarch64-fpic-adr_prel_pg_hi21.s index 9ca1e67..3da4b2e 100644 --- a/lld/test/ELF/aarch64-fpic-adr_prel_pg_hi21.s +++ b/lld/test/ELF/aarch64-fpic-adr_prel_pg_hi21.s @@ -1,7 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol 'dat' defined in {{.*}}.o +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol 'dat' defined in {{.*}}.o adrp x0, dat .data diff --git a/lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s b/lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s index fba314d..8df5821 100644 --- a/lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s +++ b/lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s @@ -1,7 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_AARCH64_LDST32_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_LDST32_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o ldr s4, [x0, :lo12:dat] .data diff --git a/lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s b/lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s index 8147398..fe80e65 100644 --- a/lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s +++ b/lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s @@ -1,7 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_AARCH64_LDST64_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_LDST64_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o ldr x0, [x0, :lo12:dat] .data diff --git a/lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s b/lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s index aa6d5a0..8442062 100644 --- a/lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s +++ b/lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s @@ -1,7 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_AARCH64_LDST8_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_LDST8_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o ldrsb x0, [x1, :lo12:dat] .data diff --git a/lld/test/ELF/arm-target1.s b/lld/test/ELF/arm-target1.s index 8ad4089..b62d6d6 100644 --- a/lld/test/ELF/arm-target1.s +++ b/lld/test/ELF/arm-target1.s @@ -29,4 +29,4 @@ // RELATIVE: SYMBOL TABLE: // RELATIVE: 00001004 .text 00000000 patatino -// ABS: {{.*}}.o (.text+0x0): can't create dynamic relocation R_ARM_TARGET1 against symbol 'patatino' defined in {{.*}}.o +// ABS: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_ARM_TARGET1 against symbol 'patatino' defined in {{.*}}.o diff --git a/lld/test/ELF/basic.s b/lld/test/ELF/basic.s index 5c10d45..2ced3f2 100644 --- a/lld/test/ELF/basic.s +++ b/lld/test/ELF/basic.s @@ -237,8 +237,8 @@ _start: # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t # RUN: not ld.lld %t %t -o %t2 2>&1 | FileCheck --check-prefix=DUP %s -# DUP: {{.*}} (.text+0x0): duplicate symbol '_start' -# DUP: {{.*}} (.text+0x0): previous definition was here +# DUP: {{.*}}:(.text+0x0): duplicate symbol '_start' +# DUP: {{.*}}:(.text+0x0): previous definition was here # RUN: not ld.lld %t -o %t -m wrong_emul_fbsd 2>&1 | FileCheck --check-prefix=UNKNOWN_EMUL %s # UNKNOWN_EMUL: unknown emulation: wrong_emul_fbsd diff --git a/lld/test/ELF/conflict.s b/lld/test/ELF/conflict.s index fde285d..b9bb505 100644 --- a/lld/test/ELF/conflict.s +++ b/lld/test/ELF/conflict.s @@ -3,18 +3,18 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o # RUN: not ld.lld %t1.o %t1.o -o %t2 2>&1 | FileCheck -check-prefix=DEMANGLE %s -# DEMANGLE: {{.*}} (.text+0x0): duplicate symbol 'mul(double, double)' -# DEMANGLE-NEXT: {{.*}} (.text+0x0): previous definition was here -# DEMANGLE-NEXT: {{.*}} (.text+0x0): duplicate symbol 'foo' -# DEMANGLE-NEXT: {{.*}} (.text+0x0): previous definition was here +# DEMANGLE: {{.*}}:(.text+0x0): duplicate symbol 'mul(double, double)' +# DEMANGLE-NEXT: {{.*}}:(.text+0x0): previous definition was here +# DEMANGLE-NEXT: {{.*}}:(.text+0x0): duplicate symbol 'foo' +# DEMANGLE-NEXT: {{.*}}:(.text+0x0): previous definition was here # RUN: not ld.lld %t1.o %t1.o -o %t2 --no-demangle 2>&1 | \ # RUN: FileCheck -check-prefix=NO_DEMANGLE %s -# NO_DEMANGLE: {{.*}} (.text+0x0): duplicate symbol '_Z3muldd' -# NO_DEMANGLE-NEXT: {{.*}} (.text+0x0): previous definition was here -# NO_DEMANGLE-NEXT: {{.*}} (.text+0x0): duplicate symbol 'foo' -# NO_DEMANGLE-NEXT: {{.*}} (.text+0x0): previous definition was here +# NO_DEMANGLE: {{.*}}:(.text+0x0): duplicate symbol '_Z3muldd' +# NO_DEMANGLE-NEXT: {{.*}}:(.text+0x0): previous definition was here +# NO_DEMANGLE-NEXT: {{.*}}:(.text+0x0): duplicate symbol 'foo' +# NO_DEMANGLE-NEXT: {{.*}}:(.text+0x0): previous definition was here # RUN: not ld.lld %t1.o %t1.o -o %t2 --demangle --no-demangle 2>&1 | \ # RUN: FileCheck -check-prefix=NO_DEMANGLE %s @@ -25,14 +25,14 @@ # RUN: llvm-ar rcs %t3.a %t2.o # RUN: not ld.lld %t1.o %t3.a -u baz -o %t2 2>&1 | FileCheck -check-prefix=ARCHIVE %s -# ARCHIVE: {{.*}}3.a({{.*}}2.o) (.text+0x0): duplicate symbol 'foo' -# ARCHIVE-NEXT: {{.*}}1.o (.text+0x0): previous definition was here +# ARCHIVE: {{.*}}3.a({{.*}}2.o):(.text+0x0): duplicate symbol 'foo' +# ARCHIVE-NEXT: {{.*}}1.o:(.text+0x0): previous definition was here # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/conflict-debug.s -o %t-dbg.o # RUN: not ld.lld %t-dbg.o %t-dbg.o -o %t-dbg 2>&1 | FileCheck -check-prefix=DBGINFO %s -# DBGINFO: conflict-debug.s (4): duplicate symbol 'zed' -# DBGINFO-NEXT: conflict-debug.s (4): previous definition was here +# DBGINFO: conflict-debug.s:4: duplicate symbol 'zed' +# DBGINFO-NEXT: conflict-debug.s:4: previous definition was here .globl _Z3muldd, foo _Z3muldd: diff --git a/lld/test/ELF/copy-errors.s b/lld/test/ELF/copy-errors.s index c370c4b..b0d56c9 100644 --- a/lld/test/ELF/copy-errors.s +++ b/lld/test/ELF/copy-errors.s @@ -9,7 +9,7 @@ _start: call bar -// CHECK: {{.*}}.o (.text+0x1): cannot preempt symbol 'bar' defined in {{.*}}.so +// CHECK: {{.*}}.o:(.text+0x1): cannot preempt symbol 'bar' defined in {{.*}}.so call zed // CHECK: symbol 'zed' defined in {{.*}}.so is missing type diff --git a/lld/test/ELF/copy-in-shared.s b/lld/test/ELF/copy-in-shared.s index c5dbc7f..b8e57ce 100644 --- a/lld/test/ELF/copy-in-shared.s +++ b/lld/test/ELF/copy-in-shared.s @@ -7,4 +7,4 @@ .quad foo -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.so +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.so diff --git a/lld/test/ELF/copy-rel-pie-error.s b/lld/test/ELF/copy-rel-pie-error.s index 9418eee..7cb6700 100644 --- a/lld/test/ELF/copy-rel-pie-error.s +++ b/lld/test/ELF/copy-rel-pie-error.s @@ -3,8 +3,8 @@ // RUN: ld.lld %t2.o -o %t2.so -shared // RUN: not ld.lld %t.o %t2.so -o %t.exe -pie 2>&1 | FileCheck %s -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_X86_64_64 against symbol 'bar' defined in {{.*}}.so -// CHECK: {{.*}}.o (.text+0x8): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.so +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_X86_64_64 against symbol 'bar' defined in {{.*}}.so +// CHECK: {{.*}}.o:(.text+0x8): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.so .global _start _start: diff --git a/lld/test/ELF/dynamic-reloc-in-ro.s b/lld/test/ELF/dynamic-reloc-in-ro.s index cd469da..682dbdd 100644 --- a/lld/test/ELF/dynamic-reloc-in-ro.s +++ b/lld/test/ELF/dynamic-reloc-in-ro.s @@ -5,4 +5,4 @@ foo: .quad foo -// CHECK: {{.*}}.o (.text+0x0): can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment defined in {{.*}}.o +// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment defined in {{.*}}.o diff --git a/lld/test/ELF/eh-frame-dyn-rel.s b/lld/test/ELF/eh-frame-dyn-rel.s index 00b7b12..91baf59 100644 --- a/lld/test/ELF/eh-frame-dyn-rel.s +++ b/lld/test/ELF/eh-frame-dyn-rel.s @@ -7,4 +7,4 @@ .cfi_personality 0x8c, foo .cfi_endproc -// CHECK: {{.*}}.o (.eh_frame+0x12): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.o +// CHECK: {{.*}}.o:(.eh_frame+0x12): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.o diff --git a/lld/test/ELF/libsearch.s b/lld/test/ELF/libsearch.s index 730445b..20783c5 100644 --- a/lld/test/ELF/libsearch.s +++ b/lld/test/ELF/libsearch.s @@ -22,7 +22,7 @@ // Should not link because of undefined symbol _bar // RUN: not ld.lld -o %t3 %t.o %tbar.o 2>&1 \ // RUN: | FileCheck --check-prefix=UNDEFINED %s -// UNDEFINED: error: {{.*}} (.bar+0x0): undefined symbol '_bar' +// UNDEFINED: error: {{.*}}:(.bar+0x0): undefined symbol '_bar' // Should fail if cannot find specified library (without -L switch) // RUN: not ld.lld -o %t3 %t.o -lls 2>&1 \ diff --git a/lld/test/ELF/linkerscript/edata-etext.s b/lld/test/ELF/linkerscript/edata-etext.s index e6da8d4..fdf5ec1 100644 --- a/lld/test/ELF/linkerscript/edata-etext.s +++ b/lld/test/ELF/linkerscript/edata-etext.s @@ -2,9 +2,9 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: echo "SECTIONS { }" > %t.script # RUN: not ld.lld %t.o -script %t.script -o %t 2>&1 | FileCheck %s -# CHECK: error: {{.*}} (.text+0x0): undefined symbol '_edata' -# CHECK: error: {{.*}} (.text+0x8): undefined symbol '_etext' -# CHECK: error: {{.*}} (.text+0x10): undefined symbol '_end' +# CHECK: error: {{.*}}:(.text+0x0): undefined symbol '_edata' +# CHECK: error: {{.*}}:(.text+0x8): undefined symbol '_etext' +# CHECK: error: {{.*}}:(.text+0x10): undefined symbol '_end' .global _start,_end,_etext,_edata .text diff --git a/lld/test/ELF/linkerscript/ehdr_start.s b/lld/test/ELF/linkerscript/ehdr_start.s index 48055d5..0ae4a4d 100644 --- a/lld/test/ELF/linkerscript/ehdr_start.s +++ b/lld/test/ELF/linkerscript/ehdr_start.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o # RUN: echo "SECTIONS { }" > %t.script # RUN: not ld.lld %t.o -script %t.script -o %t 2>&1 | FileCheck %s -# CHECK: error: {{.*}} (.text+0x0): undefined symbol '__ehdr_start' +# CHECK: error: {{.*}}:(.text+0x0): undefined symbol '__ehdr_start' .text .global _start, __ehdr_start diff --git a/lld/test/ELF/lto/combined-lto-object-name.ll b/lld/test/ELF/lto/combined-lto-object-name.ll index 60b7224..f46efc4 100644 --- a/lld/test/ELF/lto/combined-lto-object-name.ll +++ b/lld/test/ELF/lto/combined-lto-object-name.ll @@ -11,4 +11,4 @@ define void @_start() { ret void } -; CHECK: error: ld-temp.o (function _start): undefined symbol 'foo' +; CHECK: error: ld-temp.o:(function _start): undefined symbol 'foo' diff --git a/lld/test/ELF/relocation-relative-absolute.s b/lld/test/ELF/relocation-relative-absolute.s index 69f5e41..e1636c7 100644 --- a/lld/test/ELF/relocation-relative-absolute.s +++ b/lld/test/ELF/relocation-relative-absolute.s @@ -7,6 +7,6 @@ .globl _start _start: -# CHECK: {{.*}}input1.o (.text+0x1): relocation R_X86_64_PLT32 cannot refer to absolute symbol 'answer' defined in {{.*}}input2.o +# CHECK: {{.*}}input1.o:(.text+0x1): relocation R_X86_64_PLT32 cannot refer to absolute symbol 'answer' defined in {{.*}}input2.o call answer@PLT diff --git a/lld/test/ELF/sysroot.s b/lld/test/ELF/sysroot.s index 6ddb6cf..0b7b172 100644 --- a/lld/test/ELF/sysroot.s +++ b/lld/test/ELF/sysroot.s @@ -9,7 +9,7 @@ // Should not link because of undefined symbol _bar // RUN: not ld.lld -o %t/r %t/m.o 2>&1 \ // RUN: | FileCheck --check-prefix=UNDEFINED %s -// UNDEFINED: error: {{.*}} (.text+0x1): undefined symbol '_bar' +// UNDEFINED: error: {{.*}}:(.text+0x1): undefined symbol '_bar' // We need to be sure that there is no suitable library in the /lib directory // RUN: not ld.lld -o %t/r %t/m.o -L/lib -l:libls.a 2>&1 \ diff --git a/lld/test/ELF/tls-static.s b/lld/test/ELF/tls-static.s index 31ae3e5..b098b68 100644 --- a/lld/test/ELF/tls-static.s +++ b/lld/test/ELF/tls-static.s @@ -10,4 +10,4 @@ _start: call __tls_get_addr -// CHECK: error: {{.*}} (.text+0x1): undefined symbol '__tls_get_addr' +// CHECK: error: {{.*}}:(.text+0x1): undefined symbol '__tls_get_addr' diff --git a/lld/test/ELF/undef-shared.s b/lld/test/ELF/undef-shared.s index 6bb237e..3f01ec2 100644 --- a/lld/test/ELF/undef-shared.s +++ b/lld/test/ELF/undef-shared.s @@ -1,15 +1,15 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o # RUN: not ld.lld %t.o -o %t.so -shared 2>&1 | FileCheck %s -# CHECK: error: {{.*}} (.data+0x0): undefined symbol 'hidden' +# CHECK: error: {{.*}}:(.data+0x0): undefined symbol 'hidden' .global hidden .hidden hidden -# CHECK: error: {{.*}} (.data+0x8): undefined symbol 'internal' +# CHECK: error: {{.*}}:(.data+0x8): undefined symbol 'internal' .global internal .internal internal -# CHECK: error: {{.*}} (.data+0x10): undefined symbol 'protected' +# CHECK: error: {{.*}}:(.data+0x10): undefined symbol 'protected' .global protected .protected protected diff --git a/lld/test/ELF/undef.s b/lld/test/ELF/undef.s index 1ab5e82..5ef0b3b 100644 --- a/lld/test/ELF/undef.s +++ b/lld/test/ELF/undef.s @@ -5,17 +5,17 @@ # RUN: llvm-ar rc %t2.a %t2.o # RUN: not ld.lld %t.o %t2.a %t3.o -o %t.exe 2>&1 | FileCheck %s # RUN: not ld.lld -pie %t.o %t2.a %t3.o -o %t.exe 2>&1 | FileCheck %s -# CHECK: error: undef.s (.text+0x1): undefined symbol 'foo' -# CHECK: error: undef.s (.text+0x6): undefined symbol 'bar' -# CHECK: error: undef.s (.text+0x10): undefined symbol 'foo(int)' -# CHECK: error: {{.*}}2.a({{.*}}.o) (.text+0x0): undefined symbol 'zed2' -# CHECK: error: undef-debug.s (3): undefined symbol 'zed3' -# CHECK: error: undef-debug.s (7): undefined symbol 'zed4' -# CHECK: error: undef-debug.s (11): undefined symbol 'zed5' +# CHECK: error: undef.s:(.text+0x1): undefined symbol 'foo' +# CHECK: error: undef.s:(.text+0x6): undefined symbol 'bar' +# CHECK: error: undef.s:(.text+0x10): undefined symbol 'foo(int)' +# CHECK: error: {{.*}}2.a({{.*}}.o):(.text+0x0): undefined symbol 'zed2' +# CHECK: error: undef-debug.s:3: undefined symbol 'zed3' +# CHECK: error: undef-debug.s:7: undefined symbol 'zed4' +# CHECK: error: undef-debug.s:11: undefined symbol 'zed5' # RUN: not ld.lld %t.o %t2.a -o %t.exe -no-demangle 2>&1 | \ # RUN: FileCheck -check-prefix=NO-DEMANGLE %s -# NO-DEMANGLE: error: undef.s (.text+0x10): undefined symbol '_Z3fooi' +# NO-DEMANGLE: error: undef.s:(.text+0x10): undefined symbol '_Z3fooi' .file "undef.s" diff --git a/lld/test/ELF/unresolved-symbols.s b/lld/test/ELF/unresolved-symbols.s index 9c37421..3c33b92 100644 --- a/lld/test/ELF/unresolved-symbols.s +++ b/lld/test/ELF/unresolved-symbols.s @@ -6,7 +6,7 @@ ## Check that %t2.o contains undefined symbol undef. # RUN: not ld.lld %t1.o %t2.o -o %t 2>&1 | \ # RUN: FileCheck -check-prefix=UNDCHECK %s -# UNDCHECK: error: {{.*}}2.o (.text+0x1): undefined symbol 'undef' +# UNDCHECK: error: {{.*}}2.o:(.text+0x1): undefined symbol 'undef' ## Error out if unknown option value was set. # RUN: not ld.lld %t1.o %t2.o -o %t --unresolved-symbols=xxx 2>&1 | \ @@ -19,7 +19,7 @@ # RUN: llvm-readobj %t1_1 > /dev/null 2>&1 # RUN: not ld.lld %t2.o -o %t1_2 --unresolved-symbols=ignore-all --no-undefined 2>&1 | \ # RUN: FileCheck -check-prefix=ERRUND %s -# ERRUND: error: {{.*}} (.text+0x1): undefined symbol 'undef' +# ERRUND: error: {{.*}}:(.text+0x1): undefined symbol 'undef' ## Also ignore all should not produce error for symbols from DSOs. # RUN: ld.lld %t1.o %t.so -o %t1_3 --unresolved-symbols=ignore-all # RUN: llvm-readobj %t1_3 > /dev/null 2>&1 diff --git a/lld/test/ELF/verneed-local.s b/lld/test/ELF/verneed-local.s index 9da0673..94336fd 100644 --- a/lld/test/ELF/verneed-local.s +++ b/lld/test/ELF/verneed-local.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: not ld.lld %t.o %S/Inputs/verneed1.so -o %t 2>&1 | FileCheck %s -# CHECK: error: {{.*}} (.text+0x1): undefined symbol 'f3' +# CHECK: error: {{.*}}:(.text+0x1): undefined symbol 'f3' .globl _start _start: call f3 diff --git a/lld/test/ELF/zdefs.s b/lld/test/ELF/zdefs.s index 333905c..420f602 100644 --- a/lld/test/ELF/zdefs.s +++ b/lld/test/ELF/zdefs.s @@ -2,6 +2,6 @@ # RUN: ld.lld -shared %t.o -o %t1.so # RUN: not ld.lld -z defs -shared %t.o -o %t1.so 2>&1 | FileCheck -check-prefix=ERR %s -# ERR: error: {{.*}} (.text+0x1): undefined symbol 'foo' +# ERR: error: {{.*}}:(.text+0x1): undefined symbol 'foo' callq foo@PLT