mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 06:06:07 +00:00

Rather than report "undefined symbol: ", give more informative message about the object file that defines the discarded section. In particular, PR41133, if the section is a discarded COMDAT, print the section group signature and the object file with the prevailing definition. This is useful to track down some ODR issues. We need to * add `uint32_t DiscardedSecIdx` to Undefined for this feature. * make ComdatGroups public and change its type to DenseMap<CachedHashStringRef, const InputFile *> Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D59649 llvm-svn: 361359
16 lines
367 B
ArmAsm
16 lines
367 B
ArmAsm
# REQUIRES: x86
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
|
|
# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s
|
|
|
|
# CHECK: error: relocation refers to a symbol in a discarded section: foo
|
|
# CHECK-NEXT: >>> defined in {{.*}}.o
|
|
# CHECK-NEXT: >>> referenced by {{.*}}.o:(.text+0x1)
|
|
|
|
.globl _start
|
|
_start:
|
|
jmp foo
|
|
|
|
.section .foo,"ae"
|
|
.globl foo
|
|
foo:
|