In this new version of the patch we remove the projects/mingw-w64/i686-w64-mingw32-* files (which are now created in projects/mingw-w64/build).
I think this needs revision as we need the relocation patch for 64-bit builds as well. Having the DLL characteristics showing proper output as the script we use does is necessary but not sufficient. We need an relocation table as well. Otherwise we land in the same situation as the bitcoin people (https://github.com/bitcoin/bitcoin/issues/8248) (I guess we can point them to our stuff to fix their problem?)). (comment:description:ticket:10505 summarizes the requirements, too)
skruffy wrote the patch for Tor Browser on Windows 32 platforms (PE) but we need to fix it for 64-bit (PE+ or probably PEP in binutils lingo). I think the way to go is to look at the pep-dll.c to understand what it does and add the missing things (I guess we could think about patching pep.em as well to rename pe_dll_enable_reloc_section to pep_dll_enable_reloc_section to make things more straightforward, but maybe not. I have not looked that close).
Something for a different ticket I guess: Given that the script that checks the headers for ASLR is not enough to be sure we have ASLR enabled we should think about a better test.
Trac: Status: needs_review to needs_revision Keywords: TorBrowserTeam201709R deleted, TorBrowserTeam201709 added
Just looking at the patch skruffy wrote: what about the attached patch trying to take the 64bit case into account? The compile issue is gone. Not sure if ASLR is working, though. If there are some binaries with and without the patch I could test I guess. Maybe tor binaries would already be enough.
Ah, I just noticed that I forgot re-adding the --enable-reloc-section flag to the x86_64 builds, so the builds with the patch are probably wrong. I will redo them.
Ah, I just noticed that I forgot re-adding the --enable-reloc-section flag to the x86_64 builds, so the builds with the patch are probably wrong. I will redo them.
I can confirm that they match the no-patch-behavior. :)
Looks better. The ImageBase address changes for me on different restarts, so, yay! You can test that yourself with e.g. ProcessExplorer (opening the lower pane and there should be a column for the addresses). The .exe without the patch has 0x400000 as ImageBase address.
This might need more testing, I guess, and someone familiar with binutils to look over the changes.
Not finding anyone to do so should at least not block nightly builds with the new toolchain.
I can confirm that both tor.exe and firefox.exe have 0x400000 as ImageBase in the version without patch, and something different in the version with the patch.
I can confirm that both tor.exe and firefox.exe have 0x400000 as ImageBase in the version without patch, and something different in the version with the patch.
You mean something different with every restart, right? If so, I guess we can start using that idea and close #23458 (moved)? If you agree could you provide an updated patch for this ticket for review?
Yes, I wish but aren't we doing that? If not, how would a fix look like?
That patches are hacks and are not upstreamable. The fix would change the behavior of ld back to normal and would fulfill the requirements of https://sourceware.org/bugzilla/show_bug.cgi?id=19011.
I can confirm that both tor.exe and firefox.exe have 0x400000 as ImageBase in the version without patch, and something different in the version with the patch.
You mean something different with every restart, right? If so, I guess we can start using that idea and close #23458 (moved)? If you agree could you provide an updated patch for this ticket for review?
Yes. I checked again with a new build that ImageBase is changing on each restart.
Looks good to me. This is commit b82d82d9cf9cb751e088085fb1093026b20a0e4d on master, thanks. boklm: Could you update the other patches for the win64 series accordingly so that we get nightlies built asap?
Trac: Resolution: N/Ato fixed Status: needs_review to closed