Commit Graph

2 Commits

Author SHA1 Message Date
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