Commit Graph

13 Commits

Author SHA1 Message Date
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
Arnold Schwaighofer
fc766a39d3 Fix some more tests 2023-06-29 16:16:56 -07:00
Arnold Schwaighofer
316e982bbf Fix linux tests 2023-06-14 10:49:50 -07:00
Erik Eckstein
76258ea435 rebranch: fix the ELF-remove-autolink-section.swift test
It failed on linux
2023-01-12 10:42:00 +01:00
Richard Wei
94e8f5393e Enable string processing by default.
Make frontend flag `-enable-experimental-string-processing` default to true.
2022-06-12 20:25:16 -07:00
Saleem Abdulrasool
24ba2d1b20 Update ELF-remove-autolink-section.swift 2021-09-11 16:15:36 -07:00
Saleem Abdulrasool
857bcb4d25 Remove the now obsolete check for the ELF gadget 2021-09-11 14:58:57 -07:00
Doug Gregor
568e943115 Enable import of the _Concurrency module by default. 2021-04-13 23:14:06 -07:00
Arnold Schwaighofer
9286ece71c Revert "Enable import of the _Concurrency module by default." 2021-04-09 13:20:30 -07:00
Doug Gregor
ff06bb4051 Fix a few tests for implicit _Concurrency import on Linux 2021-04-06 14:19:29 -07:00
Meghana Gupta
b34791a0a0 Update code as per Apple Style Guide
whitelist -> allowlist
blacklist -> denylist
2020-07-24 11:37:15 -07:00
Saleem Abdulrasool
837e331f16 IRGen: handle ASAN better with importing on ELF
ELF's lack of linker directives is worked around by a custom section
(`.swift1_autolink_entries`).  This is metadata that is not intended to
be emitted into the linked binary.  A previous change introduced the use
of a module (global) assembly gadget to discard the section.  However,
this interacts poorly with ASAN which would instrument the section,
resulting in a strong reference.  This reference would persist to a
discarded symbol.  lld would object to this.  Blacklist the symbol to
ensure that ASAN + autolinking can co-exist.
2020-01-09 21:48:25 -08:00
sameerasal
fa13be22ec Remove .swift1_autolink_entries from ther final linked binary
Mark the section .swift1_autolink_entries as SHF_EXCLUDE
  so the section will get dropped by the linker after linking the final
  binary.

  This section is used to save the flags needed for auto link and there
  is no reason it should stay in the final linked binary.Mark the
  section .swift1_autolink_entries as SHF_EXCLUDE
  so the section will get dropped by the linker after linking the final
  binary.

  This section is used to save the flags needed for auto link and there
  is no reason it should stay in the final linked binary.

  This solves issue SR-11247
2019-08-08 14:38:46 -07:00