[PATCH] D145626: [WebAssembly] Support debug info for TLS + global in PIC mode

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 10:21:15 PDT 2023


dschuff accepted this revision.
dschuff added a comment.
This revision is now accepted and ready to land.

> I guess you mean not __stack_pointer but __tls_base and __memory_base, right?

Yes, sorry.

> Yes, I can do that, but AFAIK llvm-readobj doesn't provide any specific info on which global indices contain which reloc. All I can test is that in non-split objects there are relocations referring to __tls_base/__memory_base in .debug_info section, and there are no relocations in dwo files.

Yes, exactly. We can test part of the behavior we want this way, but not all of it. Hence me not being sure whether it's worth it. But I do like what you've come up with here, it seems pretty straightforward.

> I guess the latter should be ensured, like, by definition of split DWARF though.

I'm not actually sure what would happen if we accidentally did something wrong here. e.g. I'm not sure whether the dwo file is created via the same MC mechanism that creates object files (in which case it might be possible or even easy to accidentally create a relocation) or some other mechanism, which case it might not be likely.

> I used to do that for some tests too, especially the ones that involve control flow (e.g. comments in https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/WebAssembly/exception.ll). For this code, I removed unnecessary parts from the generated code so it wouldn't be exactly the same, but I can come up with C code more or less matches the structure.

Makes sense, thanks.

This looks good now overall.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145626/new/

https://reviews.llvm.org/D145626



More information about the llvm-commits mailing list