[all-commits] [llvm/llvm-project] e1f830: [WebAssembly] Support debug info for TLS + global ...
Heejin Ahn via All-commits
all-commits at lists.llvm.org
Fri Mar 17 20:17:27 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e1f830bde8bad22d375bc92f2084e9055059cc77
https://github.com/llvm/llvm-project/commit/e1f830bde8bad22d375bc92f2084e9055059cc77
Author: Heejin Ahn <aheejin at gmail.com>
Date: 2023-03-17 (Fri, 17 Mar 2023)
Changed paths:
M llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
M llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
A llvm/test/DebugInfo/WebAssembly/tls_pic_globals.ll
Log Message:
-----------
[WebAssembly] Support debug info for TLS + global in PIC mode
This adds debug info support for
- `thread_local` global variables, both in non-PIC and PIC modes
- (non-thread_local) Global variables in PIC mode
The former needs to read the value from an offset relative to
`__tls_base` and the latter an offset from `__memory_base`. The code for
doing this overlaps with some of the existing code to add
`__stack_pointer` global, so this adds a new member function to add a
a global in `TI_GLOBAL_RELOC` mode and use it in all three places.
Split DWARF support is currently patchy at best, because the index for
`__tls_base` is not fixed after dynamic linking. The preexisting split
DWARF support for `__stack_pointer` relies on that in practice it is
always index 0. This does similar hardcoding for `__tls_base` and
`__memory_base`, but `__tls_base`'s index in dynamic linking is not
fixed now (See
https://github.com/llvm/llvm-project/blob/19afbfe33156d211fa959dadeea46cd17b9c723c/lld/wasm/Driver.cpp#L786-L823
for details), TLS + dynamic linking will not work at the moment.
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1416702.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D145626
More information about the All-commits
mailing list