llvm-project/lld/test/wasm/debuginfo-relocs.s
Sam Clegg cf2b8722d4 [WebAssembly][lld] Fix crash when applying relocations to debug sections
Debug sections are special in that they can contain relocations against
symbols that are not present in the final output (i.e. not live).
However it is also possible to have R_WASM_TABLE_INDEX relocations
against symbols that don't have a table index assigned (since they are
not address taken by actual code.

Fixes: https://github.com/emscripten-core/emscripten/issues/9023

Differential Revision: https://reviews.llvm.org/D66435

llvm-svn: 369423
2019-08-20 18:39:24 +00:00

24 lines
615 B
ArmAsm

# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
# RUN: wasm-ld %t.o -o %t.wasm
# RUN: obj2yaml %t.wasm | FileCheck %s
bar:
.functype bar () -> ()
end_function
.globl _start
_start:
.functype _start () -> ()
call bar
end_function
.section .debug_info,"",@
.int32 bar
# Even though `bar` is live in the final binary it doesn't have a table entry
# since its not address taken in the code. In this case any relocations in the
# debug sections see a address of zero.
# CHECK: Name: .debug_info
# CHECK-NEXT: Payload: '00000000'