On Wed, 21 Nov 2018, Edward Diener wrote:

On 11/21/2018 3:47 PM, Martin Storsjö wrote:
On Wed, 21 Nov 2018, Edward Diener wrote:

On 11/21/2018 3:26 PM, Martin Storsjö wrote:
On Wed, 21 Nov 2018, Edward Diener wrote:

On 11/21/2018 9:53 AM, Ozkan Sezer wrote:
On 11/21/18, Edward Diener <[email protected]> wrote:
[...]
Unfortunately this did not solve the problem using clang-7.0 with the
gcc-8.1 backend. Most probably clang is using its own linker, rather
than the mingw-64/gcc linker, and this is causing the problem. In
clang-6.0 everything works properly.

OK, maybe other here might be able to help.


Strangely enough when I use the clang -### option to see what it is using to link my executable it shows it is using the mingw-64/gcc linker.

Yes, unless your clang is built with different defaults, it defaults to use the normal linker in your environment.

Yet even with the changes I made to the linker scripts, to add '. = ALIGN(4);' before the '__rt_psrelocs_start = .;' line in each script, I am seeing the original problem I reported as soon as I try to debug my problem using the mingw-64 gdb debugger. So either the linker scripts are not being used when the mingw-64/gcc linker is being used or the problem lies in some other reason.

Just to be really clear, you did recompile your binutils ld linker and use the newly built copy of the executable after you changed the linker scripts right?

No, I did not do that. I had a feeling that just changing the linker scripts was not enough. So how do I rebuild the linker so that it uses the changes I made to the linker scripts ? I supposed I have to be in some sort of MSYS2 environment to do this.

Yes, the mingw64/msys2 environment should be good for that; running "./configure --prefix=/some/path; make; make install" in the binutils-gdb root directory should give you a ld.exe in the given path. If this ran fine you should be able to replace your normal ld.exe/x86_64-w64-mingw32-ld.exe with it.

Where is the binutils-gdb root directory ? Is this from within in a mingw-w64 installation which I have already installed ? Or is this some other directory from within an MSYS2 mingw shell ? In either case what is the actual directory I have to be in to run the "./configure --prefix=/some/path; make; make install" in order to rebuild ld.exe ?

Sorry, I'm out of time at the moment, hopefully someone else can help you to finish this. Or someone can provide a prebuilt ld.exe with this patch applied.

// Martin

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to