[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/11539] ld --gc-sections should work for PE-COFF on MinGW
From: |
shinji.igarashi at gmail dot com |
Subject: |
[Bug ld/11539] ld --gc-sections should work for PE-COFF on MinGW |
Date: |
Wed, 05 Oct 2011 03:42:15 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=11539
--- Comment #5 from Shinji Igarashi <shinji.igarashi at gmail dot com>
2011-10-05 03:42:15 UTC ---
Created attachment 5960
--> http://sourceware.org/bugzilla/attachment.cgi?id=5960
Add KEEPs to the linker script template
Very nice. The patch saves me from some boring works splitting source files per
function.
- entry symbol
I think "-Wl,-e" works and is better than "-Wl,--undefined" in this case.
For PE-COFF targets, the default entry symbol is used according to the
subsystem,
unless explicitly specified by a command-line or a linker script.
And the code setting the gc root (search gc_sym_list in ldlang.c) ignores the
linker's default.
MinGW-GCC's default specs file gives -e option to the linker only if the
generating file is a DLL, so for now the linker's default is used for EXE
unless you specify the explicit one.
I don't know whether ignoring the default entry symbol makes sense.
Anyway the current manual says --gc-sections requires -Wl,-e or -Wl,-u
or using KEEPs in a linker script to keep sections.
- .rsrc section
Default linker scripts(generated from pe.sc) lack KEEP commands.
The attached patch may fix it.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
- [Bug ld/11539] ld --gc-sections should work for PE-COFF on MinGW,
shinji.igarashi at gmail dot com <=