Commit Graph

6 Commits

Author SHA1 Message Date
Augusto Noronha
529845056b Fix functions not being kept for debugger
At Onone, many types of functions (anything user written, compiler
generated setters and getters, etc), should be kept in the final
binary so they're accessible by the debugger.

rdar://126763340
2024-05-14 10:31:44 -07:00
Alastair Houghton
9d9c123858 [Test] Update section_asm to work on non-ELF platforms again.
On ELF platforms, the output will be slightly different to non-ELF
platforms.  The test should ideally run everywhere, however, so
we need to be able to distinguish these platforms by changing
the lit.cfg to add some extra variables.

rdar://123504095
2024-04-29 10:48:22 +01:00
Alastair Houghton
3c029ebd3f [IRGen] Use llvm.used on ELF instead of llvm.compiler.used.
We changed to `llvm.compiler.used` because of the behaviour of `gold`,
which refuses to coalesce sections that have different `SHF_GNU_RETAIN`
flags, which causes problems with metadata.

Originally I thought we were going to have to generate two sections
with distinct names and have the runtime look for both of them, but
it turns out that the runtime only wants to see sections that have
`SHF_GNU_RETAIN` in any case.  It's really the reflection code that
is interested in being able to see non-retained sections.  The upshot
is that we don't need to use `llvm.compiler.used`; it's just fine if
we have duplicate sections, as long as the reflection code looks for
them when it's inspecting an ELF image.

This also means we no longer need to pass `-z nostart-stop-gc` to the
linker if we're using `lld`.

rdar://123504095
2024-04-29 10:48:22 +01:00
Kuba Mracek
5f037efee3 Update tests and test expectations on IRGen/section.swift + IRGen/section_asm.swift 2023-10-18 20:23:36 -07:00
Yuta Saito
34359eb6a4 [test][IRGen] Cover WebAssembly specific @_section behaviors
Wasm has quite different asm output than other archs, so added new
separate test file.
2023-10-12 16:17:39 +00:00
Yuta Saito
da67eb8a85 [test][IRGen] Split arch specific checks in section.swift into a separate file 2023-10-09 14:51:38 +00:00