This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Problems with the --gc-sections flags for ld
- From: Ian Lance Taylor <iant at google dot com>
- To: Steven Stewart-Gallus <sstewartgallus00 at mylangara dot bc dot ca>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 29 Aug 2013 12:54:36 -0700
- Subject: Re: Problems with the --gc-sections flags for ld
- Authentication-results: sourceware.org; auth=none
- References: <fb71d7ba76bc dot 521f95f4 at langara dot bc dot ca>
On Thu, Aug 29, 2013 at 11:41 AM, Steven Stewart-Gallus
<sstewartgallus00@mylangara.bc.ca> wrote:
>
> I am having troubles using the --gc-sections flag with ld. It causes a
> bug in the compiler I use (see
> https://github.com/mozilla/rust/issues/8647 .) It makes sense that it
> would cause the Rust compiler to bug out because the Rust compiler is
> still in 0.8. I would still like to diagnose, and fix the problem
> though. Does anyone have any ideas on how Rust could miscommunicate
> with ld, and cause it to strip out the metadata that Rust attaches to
> a library?
I know very little about Rust, but my guess would be that ld
--gc-sections is discarding the Rust metadata information because it
is not referenced.
It may help to pass --print-gc-sections to ld to see which sections it
is discarding.
Ian