public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Freddie Chopin <freddie_chopin@op.pl>
To: gcc@gcc.gnu.org
Subject: Re: LTO vs GCC 8
Date: Tue, 15 May 2018 19:39:00 -0000	[thread overview]
Message-ID: <b3ee5dba77dd01dde5b4923ebbbf1b97c234cc8f.camel@op.pl> (raw)
In-Reply-To: <49DC31D9-92D9-48A1-935C-4B5B8A3BE47E@gmail.com>

On Fri, 2018-05-11 at 18:51 +0200, Richard Biener wrote:
> That's an interesting result. Do you have any non-LTO objects?
> Basically I'm curious what ld eliminates that gcc with LTO doesn't. 

Whole project is compiled with LTO, part of the project is provided as
a library (which is archived with arm-none-eabi-gcc-ar). Only non-LTO
stuff in the final executable are objects from standard toolchain
libraries and I suppose they are the culprit here - the toolchain is
compiled with -ffunction-sections -fdata-sections, but without -flto.
Maybe I should actually compile the whole toolchain with -flto -ffat-
lto-objects? Is this a sane idea?

> As to a workaround for the ld bug you can try keeping all .debug_*
> sections. IIRC 2.30 has the bug fixed (on the branch). 

Indeed - "keeping" all the debug sections is a viable alternative. I've
found out that it is enough to "keep" just these:

	/* DWARF 2 */
	.debug_info 0 : { KEEP(*(.debug_info .gnu.linkonce.wi.*)); }
	 ...
	.debug_frame 0 : { KEEP(*(.debug_frame)); }

I have to check whether debugging something like that is actually
possible (; Thanks for the workaround!

Regards,
FCh

  reply	other threads:[~2018-05-15 19:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 21:32 Freddie Chopin
2018-05-11  9:19 ` Richard Biener
2018-05-11 11:06   ` David Brown
2018-05-11 15:50     ` Freddie Chopin
2018-05-11 16:51       ` Richard Biener
2018-05-15 19:39         ` Freddie Chopin [this message]
2018-05-15 20:13           ` Freddie Chopin
2018-05-16  5:26             ` Richard Biener
2018-05-14 14:34       ` David Brown
2018-05-15 20:04         ` Freddie Chopin
2018-05-16  7:37           ` David Brown
2018-05-11 15:33   ` Freddie Chopin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b3ee5dba77dd01dde5b4923ebbbf1b97c234cc8f.camel@op.pl \
    --to=freddie_chopin@op.pl \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).