Граф коммитов

152 Коммитов

Автор SHA1 Сообщение Дата
Joel Maher 3ad9f06697 Bug 1710923 - migrate windows 7x32 debug tests to windows 10x32. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D115017
2021-05-24 20:06:43 +00:00
Csoregi Natalia 814d52a59c Backed out changeset 7ed8d739fe9a (bug 1710923) for causing cppunit failures. CLOSED TREE 2021-05-20 20:48:22 +03:00
Joel Maher 359e6f6227 Bug 1710923 - migrate windows 7x32 debug tests to windows 10x32. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D115017
2021-05-20 16:31:20 +00:00
Sandor Molnar 4e346690ad Backed out changeset 7fb52bd0c5b6 (bug 1710923) for causing win10 reftest failures. CLOSED TREE 2021-05-19 17:11:39 +03:00
Joel Maher ce8b9ba202 Bug 1710923 - migrate windows 7x32 debug tests to windows 10x32. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D115017
2021-05-19 12:47:29 +00:00
Iulian Moraru a2a59b7c80 Backed out changeset bdc93c5c667f (bug 1710923) for causing reftest failures on scrollbar-marks-overlay.html. CLOSED TREE 2021-05-14 01:51:04 +03:00
Joel Maher bd3999c92b Bug 1710923 - migrate windows 7x32 debug tests to windows 10x32. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D115017
2021-05-13 15:07:48 +00:00
Jon Coppeard 692d8936cd Bug 1686219 - Add BitSet::SetAll and ResetAll methods r=heycam
These set or clear every bit, taking care not to set trailing unused bits at the end of storage.

Differential Revision: https://phabricator.services.mozilla.com/D101775
2021-01-20 10:03:53 +00:00
Chris Fronk a7c75776e8 Bug 1432988 - Add hash for pair types. r=botond
Add HashFunctions for std::pair and CompactPair to mfbt

Differential Revision: https://phabricator.services.mozilla.com/D97865
2020-12-04 21:57:03 +00:00
Toshihito Kikuchi 83d95e2106 Bug 1671316 - Part1. Introduce CrossExecTransferManager. r=mhowell
This patch introduces a class `CrossExecTransferManager` to manage the data
transfer from the current process to a remote process via `WriteProcessMemory`.
The class also encapsulates a logic to bridge the gap between two executable's
imagebase.

Differential Revision: https://phabricator.services.mozilla.com/D94652
2020-10-27 14:09:00 +00:00
Toshihito Kikuchi e61c0c2555 Bug 1671314 - Expand the region to be scanned for a trampoline. r=mhowell
The latest launcher process ping showed one of the reasons why we failed to
detour `NtMapViewOfSection` is that `MMPolicyBase::FindRegion` failed to find
a free region.  Inspecting the function carefully, there were three problems.

Firstly, `FindRegion` did not fully scan the given range.  To randomize
the address of a free region we use, we start scanning from a random address
within the given range.  The problem is we scan only addresses bigger than
that random address, without scanning smaller addresses.  Probably this is
the reason why `FindRegion` fails.

Secondly, `FindRegion` may return an address not aligned with the allocation
granularity because `VirtualQueryEx` returns such an address.  If that happens,
the subsequent mapping API fails with the alignment error.

Lastly, when we randomize an address to start scanning from, we divide a random
number by `maxOffset`, but with that, we never start scanning from the last
region.  It does not affect the product's behavior, but to have fair randomization,
a divisor should be `maxOffset + 1`.

This patch fixes all of these three problems along with a new test program.

Differential Revision: https://phabricator.services.mozilla.com/D94110
2020-10-20 22:51:00 +00:00
Alexis Beingessner 4484175a12 Bug 1601980 - Introduce a MOZ_ATOMIC_BITFIELDS macro. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D91622
2020-10-01 08:25:15 +00:00
Tom Ritter 73764ca6a5 Bug 1656896 - Improve the Tainting macros and add unit tests r=froydnj
The patch:
 - Changes from an explicit capture in MOZ_VALIDATE_AND_GET_HELPER3/MOZ_IS_VALID
   to a default capture, to support referencing local variables in conditions.
 - Moves things around in Tainting.h and adds comments
 - Adds unit tests for the macros

Differential Revision: https://phabricator.services.mozilla.com/D85889
2020-08-07 19:14:22 +00:00
Simon Giesecke 47b44d078e Bug 1642666 - Remove obsolete test for removed nsIAppShell::RunBeforeNextEvent function. r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D78013
2020-06-03 16:16:09 +00:00
Geoff Brown 49600f0317 Bug 1642686 - Remove signaling_unittests from cppunittest.ini; r=dminor
signaling_unittests and signaling_unittests_standalone are no longer part of the build;
clean up the test manifest.

Differential Revision: https://phabricator.services.mozilla.com/D78046
2020-06-03 15:23:11 +00:00
Geoff Brown b12c9c3b81 Bug 1575773 - Warn when cppunit test file missing, and cleanup cppunit manifest; r=bc
Differential Revision: https://phabricator.services.mozilla.com/D77717
2020-06-02 15:52:09 +00:00
Chris Fronk 048799bff2 Bug 1490781 - Add FunctionRef, a non-owning reference to a callable value (function pointer, lambda, etc.). r=botond
Differential Revision: https://phabricator.services.mozilla.com/D62684

--HG--
extra : moz-landing-system : lando
2020-03-24 00:12:41 +00:00
Chris Fronk d5b004443b Bug 1143478 - Rename mozilla::Pair to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64511

--HG--
rename : mfbt/Pair.h => mfbt/CompactPair.h
extra : moz-landing-system : lando
2020-03-17 12:42:12 +00:00
shindli b02b3a6e1a Backed out changeset a08637fb30c8 (bug 1143478) for causing bustages in /builds/worker/checkouts/gecko/ipc/mscom/Registration.cpp CLOSED TREE
--HG--
rename : mfbt/CompactPair.h => mfbt/Pair.h
2020-03-11 14:30:54 +02:00
Chris Fronk a27e438c2d Bug 1143478 - Rename mozilla::Pair to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64511

--HG--
rename : mfbt/Pair.h => mfbt/CompactPair.h
extra : moz-landing-system : lando
2020-03-11 12:18:13 +00:00
Toshihito Kikuchi f6a7430688 Bug 1610790: Part 2 - Implement GetProcAddress for a remote process. r=handyman
This patch adds a function to get an exported function in a remote process.
We need this implementation to address Bug 1604008, Bug 1608645, and Bug 1610790.

When `WindowsDllInterceptor` detours a function in a remote process, we used the
native `GetProcAddress` locally, and then detours the returned address in the
target process.  The problem is if the caller's export table was modified, the
address returned from `GetProcAddress` might be invalid in the target process,
which is Bug 1604008.

I implemented `GetProcAddress` depending on both local and remote process image,
but it caused two regressions Bug 1608645 and Bug 1610790 because multiple
applications modify firefox's export table in multiple ways, such as replacing
an entry of EAT, replacing an RVA to Export section, or etc.

With this patch, we can use `PEExportSection<MMPolicy>::GetProcAddress` to get
an exported function in a remote process without relying on any local data so
that it's not impacted by modification of the local export table.

Differential Revision: https://phabricator.services.mozilla.com//D62315

Depends on D62314
2020-02-11 22:21:10 +02:00
Cosmin Sabou aa2a505209 Backed out 2 changesets (bug 1610790) for causing build bustages about ShowSSEConfig.
CLOSED TREE
2020-02-12 01:10:38 +02:00
Toshihito Kikuchi 23b368208e Bug 1610790: Part 2 - Implement GetProcAddress for a remote process. r=handyman
This patch adds a function to get an exported function in a remote process.
We need this implementation to address Bug 1604008, Bug 1608645, and Bug 1610790.

When `WindowsDllInterceptor` detours a function in a remote process, we used the
native `GetProcAddress` locally, and then detours the returned address in the
target process.  The problem is if the caller's export table was modified, the
address returned from `GetProcAddress` might be invalid in the target process,
which is Bug 1604008.

I implemented `GetProcAddress` depending on both local and remote process image,
but it caused two regressions Bug 1608645 and Bug 1610790 because multiple
applications modify firefox's export table in multiple ways, such as replacing
an entry of EAT, replacing an RVA to Export section, or etc.

With this patch, we can use `PEExportSection<MMPolicy>::GetProcAddress` to get
an exported function in a remote process without relying on any local data so
that it's not impacted by modification of the local export table.

Differential Revision: https://phabricator.services.mozilla.com/D62315

Depends on D62314

--HG--
extra : rebase_source : 3088f5997a2097ef22ce8567783375e5f7866ab2
2020-02-11 22:21:10 +02:00
Toshihito Kikuchi 3694eeda43 Bug 1592486 - Store ModuleLoadFrame::sTopFrame as a global variable if TLS is not ready. r=aklotz
We had a thread-local varialbe `ModuleLoadFrame::sTopFrame` to track the topmost
stack frame of `LdrLoadDll`.  However, our hook function `patched_LdrLoadDll` can
be called even before TLS is initialized.  In such a case, accessing `sTopFrame`
causes AV.

This patch introduces `SafeThreadLocal` to safely access a thread-local varialbe.
If TLS is not initialized, it falls back to a global variable because in that
early stage there is only a single thread running.

Differential Revision: https://phabricator.services.mozilla.com/D55870

--HG--
extra : moz-landing-system : lando
2020-02-07 18:08:11 +00:00
Narcis Beleuzu 614e851352 Backed out changeset 6866be136e53 (bug 1592486) for cppunit failures on TestNativeNt.exe . CLOSED TREE 2020-02-06 11:53:45 +02:00
Toshihito Kikuchi c531413173 Bug 1592486 - Store ModuleLoadFrame::sTopFrame as a global variable if TLS is not ready. r=aklotz
We had a thread-local varialbe `ModuleLoadFrame::sTopFrame` to track the topmost
stack frame of `LdrLoadDll`.  However, our hook function `patched_LdrLoadDll` can
be called even before TLS is initialized.  In such a case, accessing `sTopFrame`
causes AV.

This patch introduces `SafeThreadLocal` to safely access a thread-local varialbe.
If TLS is not initialized, it falls back to a global variable because in that
early stage there is only a single thread running.

Differential Revision: https://phabricator.services.mozilla.com/D55870

--HG--
extra : moz-landing-system : lando
2020-02-06 03:10:57 +00:00
Toshihito Kikuchi db6fc91531 Bug 1601796 - Use GetSystemTimePreciseAsFileTime instead of GetSystemTime+SystemTimeToFileTime. r=mayhemer,aklotz
`GetProcessTimes` is based on QPC, while `GetSystemTime` is based on clock
interruption whose accuracy is lower than QPC.  This means in a process's early
stage, `GetSystemTime` may return a timestamp earlier than creation timestamp.
If this happens we'll keep a negative process uptime which causes overflow in
telemetry processing.

Win8+ has a handy API `GetSystemTimePreciseAsFileTime` that solves everything.

On Win7, `GetSystemTimeAsFileTime` still solves this issue.  In the worst case,
it returns the exact same timestamp as process creation, but it's ok.

Because the system time is stored as a `FILETIME` in `KUSER`, converting it to
a `SYSTEMTIME` with `GetSystemTime` drops accuracy.  We should avoid it unless
needed.

This patch also moves the call to `GetProcessTimes` before getting the current
timestamp in case clock interruption happens in between those two function calls.

Differential Revision: https://phabricator.services.mozilla.com/D56273

--HG--
extra : moz-landing-system : lando
2020-01-08 16:53:17 +00:00
Aaron Klotz ea529fe28c Bug 1598703: Part 2 - Add IAT Patching capabilities to the Windows DLL Interceptor; r=mhowell
This is a pretty straightforward patch; we add `WindowsIATPatcher` to
implement the actual IAT patching, and use a partial specialization of
`FuncHook` to account for the underlying differences in implementation vs our
existing interceptor code.

Differential Revision: https://phabricator.services.mozilla.com/D57831

--HG--
extra : moz-landing-system : lando
2019-12-23 23:11:35 +00:00
Gurzau Raul e014bf8778 Backed out 2 changesets (bug 1598703) for bustage at WindowsDllBlocklist.obj on a CLOSED TREE.
Backed out changeset b9c2e8b94733 (bug 1598703)
Backed out changeset 6d7358a0e785 (bug 1598703)
2019-12-23 22:53:32 +02:00
Aaron Klotz 1a8cc2849d Bug 1598703: Part 2 - Add IAT Patching capabilities to the Windows DLL Interceptor; r=mhowell
This is a pretty straightforward patch; we add `WindowsIATPatcher` to
implement the actual IAT patching, and use a partial specialization of
`FuncHook` to account for the underlying differences in implementation vs our
existing interceptor code.

Differential Revision: https://phabricator.services.mozilla.com/D57831

--HG--
extra : moz-landing-system : lando
2019-12-23 20:13:31 +00:00
Toshihito Kikuchi ee1f6d7a78 Bug 1529593 - Make LauncherRegistryInfo delay write to the registry. r=aklotz
We have the `LauncherRegistryInfo` class to check the launcher process was
launched successfully on Windows by comparing the timestamps in the registry
when each process was launched.

The problem was when the process is launched from an elevated process, we
relaunch a new launcher process via shell after we updated the launcher's
timestamp.  As a result, `LauncherRegistryInfo` unexpectedly disabled the
launcher process even though there was nothing wrong.

A proposed fix is to introduce delay-write to the `LauncherRegistryInfo`.  With
this, `LauncherRegistryInfo::Check` modifies only the image timestamp. To update
the launcher/browser timestamps, we need to call `LauncherRegistryInfo::Commit`.
When we ask shell to relaunch a new process, we hold back commit, delegating it
to the new process.

There is another consideration needed.  If something fails during `LauncherMain`,
we call `DisableDueToFailure()` to disable the launcher until the image timestamp
is changed.  In such a case, we should not change the stored timestamps even
though commit is attempted.  The problem is we use a different instance to call
`DisableDueToFailure()` in `HandleLauncherError`.  To deal with this design,
`LauncherRegistryInfo` has a static boolean to indicate disablement happens or not.

Differential Revision: https://phabricator.services.mozilla.com/D44928

--HG--
extra : moz-landing-system : lando
2019-10-14 17:14:54 +00:00
Toshihito Kikuchi 1cc025cecd Bug 1578895 - Compare NT paths if NtOpenFile failed with STATUS_OBJECT_PATH_NOT_FOUND. r=aklotz
We compare two file ids to check the current process is launched from the same
executable.  However, our telemetry showed a number of Win7 users failed to open
a file handle of the parent process with STATUS_OBJECT_PATH_NOT_FOUND even
though we opened a process handle and retrieved a module path of the parent
process successfully.  We don't have data to explain how this happens or why
this happens only on Win7, Win10 10240, and 10586.

To mitigate this situation, this patch introduces a logic to compare NT path
strings.  The benefit from doing this is 1) we don't have to open a file handle
of a parent process executable and 2) when we get an NT path, a network drive
or a symbolic link is already solved.

This new logic is much faster, but we still compare file ids on the first
attempt to minimize the impact.  We fall back to the new logic only if we
detect the STATUS_OBJECT_PATH_NOT_FOUND failure.

Differential Revision: https://phabricator.services.mozilla.com/D45476

--HG--
extra : moz-landing-system : lando
2019-09-23 17:59:42 +00:00
Toshihito Kikuchi c703e904b1 Bug 1575655 - Add skip-if for TestNativeNt. r=aklotz
The previous commit 4eca0f08c43b73dc1dd908fad58bdfd7f6973119 mistakenly removed
`skip-if` from TestNativeNt.  We need to add it back.

Differential Revision: https://phabricator.services.mozilla.com/D42961

--HG--
extra : moz-landing-system : lando
2019-08-21 21:47:43 +00:00
Toshihito Kikuchi d5a7d77f4f Bug 1573051 - Use both SHParseDisplayName and CreateUri to validate a uri. r=aklotz
For launching with an external protocol handler on Windows, we validate a uri
before sending it to `ShellExecute`, by converting a string into `PIDL` using
`SHParseDisplayName` and extract a string back from PIDL using
`IShellFolder::GetDisplayNameOf`.  The problem was that if a fragment, a
string following a hash mark (#), is always dropped after this validation.
This is caused by the intended design of Windows.

A proposed fix is to use `CreateUri` for validation, which is used behind
`IShellFolder::GetDisplayNameOf`.  However, we also keep `SHParseDisplayName`
because there are cases where `CreateUri` succeeds while `SHParseDisplayName`
fails such as a non-existent `file:` uri and we want to keep the same
validation result for those cases.

Adding `CreateUri` broke MinGW build because of our toolkit issue.  We use
dynamic linking for MinGW build in the meantime.

This patch adds a new unittest to make sure the new validation logic
behaves the same as the old one except the fragment issue.

Differential Revision: https://phabricator.services.mozilla.com/D42041

--HG--
extra : moz-landing-system : lando
2019-08-19 22:10:32 +00:00
Razvan Maries 8275452b39 Backed out changeset 722bc0469e8e (bug 1573051) for Windows MinGW bustages. CLOSED TREE 2019-08-17 00:57:50 +03:00
Toshihito Kikuchi 27093f2f3d Bug 1573051 - Use both SHParseDisplayName and CreateUri to validate a uri. r=aklotz
For launching with an external protocol handler on Windows, we validate a uri
before sending it to `ShellExecute`, by converting a string into `PIDL` using
`SHParseDisplayName` and extract a string back from PIDL using
`IShellFolder::GetDisplayNameOf`.  The problem was that if a fragment, a
string following a hash mark (#), is always dropped after this validation.
This is caused by the intended design of Windows.

A proposed fix is to use `CreateUri` for validation, which is used behind
`IShellFolder::GetDisplayNameOf`.  However, we also keep `SHParseDisplayName`
because there are cases where `CreateUri` succeeds while `SHParseDisplayName`
fails such as a non-existent `file:` uri and we want to keep the same
validation result for those cases.

This patch adds a new unittest to make sure the new validation logic
behaves the same as the old one except the fragment issue.

Differential Revision: https://phabricator.services.mozilla.com/D42041

--HG--
extra : moz-landing-system : lando
2019-08-16 19:06:01 +00:00
Aaron Klotz fc8369c57d Bug 1558350: Add TestNativeNt to cppunittest.ini; r=mhowell
We also s/mincore/version/ in OS_LIBS because the former breaks the test on
Windows 7.

Differential Revision: https://phabricator.services.mozilla.com/D34437

--HG--
extra : moz-landing-system : lando
2019-06-11 00:11:58 +00:00
Gerald Squelart 63fa790be8 Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

Differential Revision: https://phabricator.services.mozilla.com/D31926

--HG--
extra : moz-landing-system : lando
2019-06-06 06:18:09 +00:00
Noemi Erli 31c85bd5fe Backed out 13 changesets (bug 1492121) for valgrind bustage
Backed out changeset e707f1890820 (bug 1492121)
Backed out changeset 90aeaad4a4de (bug 1492121)
Backed out changeset 2ffb6ccca437 (bug 1492121)
Backed out changeset 4215fefb6ef3 (bug 1492121)
Backed out changeset b54b813c4c6c (bug 1492121)
Backed out changeset 46f57504c087 (bug 1492121)
Backed out changeset a3fe26927b31 (bug 1492121)
Backed out changeset 39c486afacec (bug 1492121)
Backed out changeset bf1731627e07 (bug 1492121)
Backed out changeset 77e7b13c6237 (bug 1492121)
Backed out changeset 1f10b50f758f (bug 1492121)
Backed out changeset db1506f94d0d (bug 1492121)
Backed out changeset 72c4026e9455 (bug 1492121)
2019-06-06 04:01:24 +03:00
Gerald Squelart 7635e5d9da Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

Differential Revision: https://phabricator.services.mozilla.com/D31926

--HG--
extra : moz-landing-system : lando
2019-06-05 23:40:09 +00:00
Bogdan Tara 47274faae8 Backed out 12 changesets (bug 1492121) for platform.cpp and TestBaseProfiler.cpp related bustages CLOSED TREE
Backed out changeset 9d768006784a (bug 1492121)
Backed out changeset 1bf52d547eb7 (bug 1492121)
Backed out changeset da72675c0d37 (bug 1492121)
Backed out changeset bdf3b865c947 (bug 1492121)
Backed out changeset 0c6cf7bc131f (bug 1492121)
Backed out changeset 0cddbdfdfae2 (bug 1492121)
Backed out changeset ac8da816859d (bug 1492121)
Backed out changeset 3800ef0a0e37 (bug 1492121)
Backed out changeset 5f30af0d0f63 (bug 1492121)
Backed out changeset de1c3ae8df14 (bug 1492121)
Backed out changeset 0689c1b8f4f7 (bug 1492121)
Backed out changeset 5e7817b385fc (bug 1492121)
2019-06-04 12:08:39 +03:00
Gerald Squelart b12d32ba33 Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

Differential Revision: https://phabricator.services.mozilla.com/D31926

--HG--
extra : moz-landing-system : lando
2019-06-04 06:53:21 +00:00
Chris Martin 6f57bf69b4 Bug 1402282 - Move CSPRNG logic to common area r=froydnj
The logic in JSMath for generating cryptographically-secure
pseudorandom numbers without NSS is independently useful, and so
it's been moved to a common area.

It will eventually be used for generated random arena ids.

Differential Revision: https://phabricator.services.mozilla.com/D8597

--HG--
extra : moz-landing-system : lando
2018-10-25 18:00:15 +00:00
Cosmin Sabou de8cde8599 Backed out changeset b283e9a224e0 (bug 1402282) build bustages on RandomNum.cpp. 2018-10-24 03:00:42 +03:00
Cosmin Sabou 035c4c098e Bug 1402282 - Move CSPRNG logic to common area r=froydnj
--HG--
extra : rebase_source : a273743c193ebfb054105949068578a4a57cf3a0
2018-10-24 02:49:33 +03:00
Botond Ballo 63264c57f4 Bug 1498767 - Add missing MFBT tests to testing/cppunittest.py. r=froydnj
Also add a comment to mfbt/tests/moz.build to remind people that tests
need to be added to testing/cppunittest.py.

Differential Revision: https://phabricator.services.mozilla.com/D8664

--HG--
extra : moz-landing-system : lando
2018-10-13 21:54:27 +00:00
Andreea Pavel 99c88126b6 Bug 1468199 - remove references to b2g in test manifests r=jmaher 2018-06-12 14:57:00 +03:00
Mike Hommey 5c6ce84a4c Bug 1464084 - Don't export std:🧵:_M_start_thread symbols with --enable-stdcxx-compat. r=froydnj
This relies on the fact that providing multiple --version-script
combines them all, so we effectively create a new symbol version
that has no global symbol, but hides the std:🧵:_M_start_thread
symbols.

This version script trick happens to work with BFD ld, gold, and lld.

The downside is that when providing multiple --version-script's, ld
doesn't want any of them to have no version at all. So for the libraries
that do already have a version script (through SYMBOLS_FILE), we use a
version where there used to be none, using the library name as the
version. Practically speaking, this binds the libraries a little closer
than they used to be, kind of non-flat namespace on OSX (which is the
default there), meaning the dynamic linker will actively want to use
symbols from those libraries instead of a system library that might
happen to have the same symbol name.

--HG--
extra : rebase_source : a7f672c35609d993849385ddb874ba791b34f929
2018-06-01 08:10:25 +09:00
Gurzau Raul 7e4f5e7dc6 Backed out changeset 838c0ab9cbdb (bug 1464084) for Linux static bustage on a CLOSED TREE 2018-06-02 02:42:52 +03:00
Mike Hommey cc7ff037ab Bug 1464084 - Don't export libstdc++ symbols with --enable-stdcxx-compat. r=froydnj
This relies on the fact that providing multiple --version-script
combines them all, so we effectively create a new symbol version
that has no global symbol, but hides as much std::* stuff as possible.

The added symbol script could use `extern "C++"` syntax and demangled
symbols but there is no guarantee the demangled symbols won't change.
Plus, it's not possible to match demangled symbols that have a return
type: they contain a space, and the only way to match that is to use
double quotes, which doesn't allow globs at the same time.

This version script trick happens to work with BFD ld, gold, and lld.

The downside is that when providing multiple --version-script's, ld
doesn't want any of them to have no version at all. So for the libraries
that do already have a version script (through SYMBOLS_FILE), we use a
version where there used to be none, using the library name as the
version. Practically speaking, this binds the libraries a little closer
than they used to be, kind of non-flat namespace on OSX (which is the
default there), meaning the dynamic linker will actively want to use
symbols from those libraries instead of a system library that might
happen to have the same symbol name.

--HG--
extra : rebase_source : 78adb64b90e75ebad203b8a647b305c9d7198d16
2018-06-01 08:10:25 +09:00