}
}
- if (config->isPic) {
- errorOrWarn("relocation " + toString(type) + " cannot be used against " +
- (sym.getName().empty() ? "local symbol"
- : "symbol '" + toString(sym) + "'") +
- "; recompile with -fPIC" + getLocation(sec, sym, offset));
- return;
- }
-
- errorOrWarn("symbol '" + toString(sym) + "' has no type" +
- getLocation(sec, sym, offset));
+ errorOrWarn("relocation " + toString(type) + " cannot be used against " +
+ (sym.getName().empty() ? "local symbol"
+ : "symbol '" + toString(sym) + "'") +
+ "; recompile with -fPIC" + getLocation(sec, sym, offset));
}
// This function is similar to the `handleTlsRelocation`. MIPS does not
// CHECK: >>> defined in {{.*}}.so
// CHECK: >>> referenced by {{.*}}.o:(.text+0x1)
-// CHECK: error: symbol 'zed' has no type
+// CHECK: error: relocation R_X86_64_PC32 cannot be used against symbol 'zed'; recompile with -fPIC
// CHECK-NEXT: >>> defined in {{.*}}.so
// CHECK-NEXT: >>> referenced by {{.*}}.o:(.text+0x6)
// NOINHIBIT: warning: cannot preempt symbol: bar
// NOINHIBIT-NEXT: >>> defined in {{.*}}.so
// NOINHIBIT-NEXT: >>> referenced by {{.*}}.o:(.text+0x1)
-// NOINHIBIT: warning: symbol 'zed' has no type
+// NOINHIBIT: warning: relocation R_X86_64_PC32 cannot be used against symbol 'zed'; recompile with -fPIC
// NOINHIBIT-NEXT: >>> defined in {{.*}}.so
// NOINHIBIT-NEXT: >>> referenced by {{.*}}.o:(.text+0x6)
# RUN: ld.lld -shared %tdef.o -o %tdef.so
# RUN: not ld.lld %texec.o %tdef.so -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR %s
-# ERROR: symbol 'le' has no type
+# ERROR: error: relocation R_X86_64_TPOFF32 cannot be used against symbol 'le'; recompile with -fPIC
#--- ledef.s
.tbss
// RUN: ld.lld --noinhibit-exec %t.o %t2.so -o /dev/null 2>&1 | FileCheck --check-prefix=WARN %s
// RUN: not ld.lld --export-dynamic --unresolved-symbols=ignore-all %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=WARN %s
-// WARN: symbol 'zed' has no type
+// WARN: relocation R_X86_64_32 cannot be used against symbol 'zed'; recompile with -fPIC