[patch ld]: Fix for bug ld/11539: ld --gc-sections should work for PE-COFF on MinGW

xunxun xunxun1982@gmail.com
Tue Aug 14 08:06:00 GMT 2012


Hello, Kai

于 2012/8/13 20:37, Kai Tietz 写道:
> Hello,
>
> This patch addresses for pe-coff and pe+-coff the issue reported about
> --gc-sections.
>
>
I notice that the patch only modifies the linker script

I remembered --gc-sections option is ignored by the linker on MinGW, so 
to enable the option also should modify libbfd?
I saw the initial patch in ld/11539 also modify bfd, but I don't know 
whether the bfd part is fixed now.



And you also added

KEEP(*(.eh_frame*))

When I tested the KEEP half one year ago, I really found 
KEEP(*(.eh_frame*)) can make all --gc-sections target to work, but exe 
target using the KEEP will increase the size. Can we only use the KEEP 
to dll target?

-- 
Best Regards,
xunxun



More information about the Binutils mailing list