Bug 1568634 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I have problem:

The launcher process needs to call `RtlCaptureStackBackTrace` which is exported from `ntdll.dll`. Unfortunately, the same function is also exported from `kernel32.dll` but forwards to the implementation in `ntdll.dll`.

Unfortunately the build system is linking the `kernel32` variant of `RtlCaptureStackBackTrace` into `firefox.exe` instead of the `ntdll` variant.

I cannot use the `kernel32.dll` version because the code in question is running before `kernel32.dll` has even been linked into the process.

With the MSVC linker, order is important, so if we were to specify `ntdll.lib` ahead of `kernel32.lib`, the linker would use the former.

I don't know whether `lld` honors this or not. If so, then I need a way to be able to tell the build system that `ntdll.lib` must be the first entry in `OS_LIBS`.

If not, I need to find some other way to tell the linker that `RtlCaptureStackBackTrace` must come from `ntdll.lib` and not `kernel32.lib`
I have problem:

The launcher process needs to call `RtlCaptureStackBackTrace` which is exported from `ntdll.dll`. Unfortunately, the same function is also exported from `kernel32.dll` but forwards to the implementation in `ntdll.dll`.

Unfortunately the build system is linking the `kernel32` variant of `RtlCaptureStackBackTrace` into `firefox.exe` instead of the `ntdll` variant.

I cannot use the `kernel32.dll` version because the code in question is running before `kernel32.dll` has even been linked into the process.

With the MSVC linker, order is important, so if we were to specify `ntdll.lib` ahead of `kernel32.lib`, the linker would use the former.

I don't know whether `lld` honors this or not. If so, then I need a way to be able to tell the build system that `ntdll.lib` must be the first entry in `OS_LIBS` (or at least must appear ahead of `kernel32.lib`).

If not, I need to find some other way to tell the linker that `RtlCaptureStackBackTrace` must come from `ntdll.lib` and not `kernel32.lib`

Back to Bug 1568634 Comment 0