aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm/bindings.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2024-02-29 23:47:48 +0100
committerJakub Konka <kubkon@jakubkonka.com>2024-03-01 10:18:10 +0100
commit9e402704e2fc01369dfbf2c9a20ac1ee7d66ca7c (patch)
tree3d7d9e687088cec8ca5495709d8daa57b859a81a /src/codegen/llvm/bindings.zig
parent147beec7da5f3eb3a858037b806ad8b1b66bfffc (diff)
downloadzig-9e402704e2fc01369dfbf2c9a20ac1ee7d66ca7c.tar.gz
zig-9e402704e2fc01369dfbf2c9a20ac1ee7d66ca7c.zip
macho: correctly find N_GSYM symbols when parsing symbol stabs
In `ld -r` mode, the linker will emit `N_GSYM` for any defined external symbols as well as private externals. In the former case, the thing is easy since `N_EXT` bit will be set in the nlist's type. In the latter however we will encounter a local symbol with `N_PEXT` bit set (non-extern, but was private external) which we also need to include when resolving symbol stabs. The major change in the logic for parsing symbol stabs per input object file is that we no longer try to force-resolve a `N_GSYM` as a global symbol. This was a mistake since every symbol stab always describes a symbol defined within the parsed input object file. We then work out if we should forward `N_GSYM` in the output symtab after we have resolved all symbols, but never before - intel we lack when initially parsing symbol stabs. Therefore, we simply record which symbol has a debug symbol stab, and work out its precise type when emitting output symtab after symbol resolution has been done.
Diffstat (limited to 'src/codegen/llvm/bindings.zig')
0 files changed, 0 insertions, 0 deletions