Commit Graph

36 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
1d44e2e8e0 [Distributed] Undo new record and mangling scheme for dist.p.witnesses (#71801) 2024-02-22 23:02:29 +09:00
Konrad `ktoso` Malawski
e9c7f3c382 [Distributed] Target identifiers for protocol calls (#70928) 2024-02-16 07:19:20 -08:00
Jonathan Grynspan
b2bbf00bd7 Remove unused infrastructure added for runtime attributes (#62971) 2023-01-12 04:16:45 -08:00
Alastair Houghton
e73de539b8 Move _swift_win32_withDbgHelpLibrary into the new header.
It makes sense to move this function into the new Win32 header.

rdar://103397975
2022-12-21 11:44:37 +00:00
Jonathan Grynspan
11033c6aa4 Fill out dynamic loading of the runtime attributes section 2022-12-20 09:45:01 -08:00
Jonathan Grynspan
26fc627ad0 Fix a use-after-free bug on Win32 when calling lookupSymbol() (#62484) 2022-12-13 09:04:34 -05:00
Jonathan Grynspan
024f018b22 Missed a bool -> HANDLE conversion 2022-11-30 16:33:07 -05:00
Jonathan Grynspan
687f754c8f Rename the runtime function to 'namespace' it in 'win32' 2022-11-30 15:32:24 -05:00
Jonathan Grynspan
e199f0b077 Refactor _swift_withWin32DbgHelpLibrary to avoid using GetCurrentProcess() per Microsoft documentation 2022-11-29 16:02:53 -05:00
Jonathan Grynspan
70062a89f7 Change the signature of _swift_withWin32DbgHelpLibrary() to not use
std::function (which is not ABI-safe in C functions.)
2022-04-22 11:59:20 -04:00
Jonathan Grynspan
0db7b5abc4 Ensure Debug Help library calls on Windows are made in as thread-safe a manner as possible by wrapping them in a scoped lock. 2022-01-12 12:37:45 -05:00
Jonathan Grynspan
099fdc2e41 Fix an issue on COFF/ELF targets where the runtime would register each loaded image twice (at least early on.) 2022-01-01 11:39:25 -05:00
Arnold Schwaighofer
cf3951394a Revert "Fix an issue on COFF/ELF targets where the runtime would register each loaded image twice (at least early on.)" 2021-12-21 07:15:08 -08:00
Jonathan Grynspan
7fe5ea7398 Fix an issue on COFF/ELF targets where the runtime would register each loaded image twice (at least early on.) 2021-12-20 15:15:02 -05:00
Pavel Yaskevich
3f4c06eb1b [Distributed] Runtime: Add skeleton support for accessible function sections 2021-12-17 10:52:56 -08:00
Mike Ash
6aab257c33 [Concurrency] Add compatibility overrides to Concurrency library.
Take the existing CompatibilityOverride mechanism and generalize it so it can be used in both the runtime and Concurrency libraries. The mechanism is preprocessor-heavy, so this requires some tricks. Use the SWIFT_TARGET_LIBRARY_NAME define to distinguish the libraries, and use a different .def file and mach-o section name accordingly.

We want the global/main executor functions to be a little more flexible. Instead of using the override mechanism, we expose function pointers that can be set by the compatibility library, or by any other code that wants to use a custom implementation.

rdar://73726764
2021-03-22 11:09:06 -04:00
Augusto Noronha
8c8360b660 Move 'MetadataSections' from 'ImageInspectionElf.h' to SwiftShims 2020-06-22 16:12:01 -03:00
pschuh
37c6414e77 Fix usage of uninitialized memory in swift_addNewDSOImage. (#26275)
This should address https://bugs.swift.org/browse/SR-6848.

Couldn't transform the unsafeGet to get because it would produce an
infinite loop.
2019-08-13 13:23:33 -07:00
Arnold Schwaighofer
5c3a4d329b Fix dynamic replacement of some type when used with associated types
rdar://50638228
2019-05-18 10:34:52 -07:00
Saleem Abdulrasool
618d525b91 runtime: enable stack traces on Windows
We would not previously symbolicate the stack trace and as a result
would not display the stack trace.  Add symbolication support to the
runtime to actually make use of the captured stack trace.  This allows
us to get a stack trace when the standard library or swift code reports
a fatal error.
2019-03-04 10:39:10 -08:00
Arnold Schwaighofer
152e8db8bb IRGen and runtime implementation for dynamic replacements 2018-11-06 09:58:36 -08:00
Joe Groff
2a8b7f76bf Runtime: Don't register fieldmd sections.
They're no longer necessary to track separately from types.
2018-08-15 16:20:53 -07:00
Mike Ash
9e8d4da76f [Runtime] Add a hooking mechanism to allow future apps to extend dynamic casting and type lookup. Make swift_dynamicCast and swift_getTypeByMangledName use these hooks.
rdar://problem/36997475
2018-03-20 16:33:37 -07:00
Pavel Yaskevich
bc1c170a45 [Runtime] Register type field metadata section 2018-02-20 18:18:48 -08:00
Doug Gregor
a7fef62a44 [Runtime] Search through protocols to resolve protocol declarations.
Search through the new section containing Swift protocol descriptor
references to resolve protocols by mangled name. Use this
functionality to support protocol composition types within
_typeForMangledName.
2018-01-09 20:17:44 -08:00
Michael Gottesman
112f344264 [gardening] Fix header #defines. NFC. 2017-05-02 13:57:48 -07:00
Michael Gottesman
ccef0215ff [gardening] Fix style inconsistencies.
Some places in this header were following the LLVM convention of:

namespace ... {

struct Foo {

};

}

and one-two places had extra indentation. I standardized the code on the LLVM
convention.
2017-05-02 13:56:05 -07:00
Michael Gottesman
43c5acbb19 [gardening] Fix doxygen headers in ImageInspection files. 2017-05-02 13:53:11 -07:00
Simon Evans
30436f4077 [runtime] ELF DSO binary section fixes
- Rename swift::addNewDSOImage() to swift_addNewDSOImage() and
  export using SWIFT_RUNTIME_EXPORT.

- Move ELF specific parts of ImageInspection.h into
  ImageInspectionELF.h.
2017-01-27 14:04:54 +00:00
Simon Evans
e07c0d21c2 [runtime] Binary section data loading for extra ELF images
- For ELF targets, keep track of shared objects as they are
  dynamically loaded so that section data can be added to
  the protocol conformance and type metadata caches after
  initialisation (rdar://problem/19045112).
2017-01-27 10:28:46 +00:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Simon Evans
c17ca759aa [runtime] Add platform independent version of dladdr() / Dl_info
- Win32 does not support dlfcn.h, Dl_info or dladdr() so add
  lookupSymbol() as a wrapper for ELF/MachO/Win32

- Win32 version needs an implementation, currently it just returns
  an error for `cannot lookup address'
2016-11-29 00:05:11 +00:00
practicalswift
2fe4254cb7 Merge pull request #5878 from practicalswift/https-swift-org
[gardening] Use the correct base URL (https://swift.org) in references to the Swift website
2016-11-22 09:17:57 +01:00
practicalswift
02d88d73ed [gardening] Fix inconsistent headers. 2016-11-20 19:30:20 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Joe Groff
87b27c6451 Runtime: Refactor platform-dependent image inspection code.
The code we use to interface with the platform dynamic linker is turning into a rat's nest of conditionals that's hard to maintain and extend. Since ELF, Mach-O, and PE platforms have pretty fundamentally different dynamic linker interfaces and capabilities, it makes sense to factor that code into a separate file per-platform, instead of trying to conditionalize the logic in-line. This patch factors out a much simpler portable interface for lazily kicking off the protocol conformance and type metadata lookup caches, and factors the guts out into separate MachO, ELF, and Win32 backends. This should also be a much cleaner interface to interface static binary behavior into, assisting #5349.
2016-11-17 16:50:04 -08:00