public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/52489] New: LTO drops init_array/fini_array sections
@ 2012-03-05 11:36 krisztian.kocsis at optimaster dot eu
  2012-03-05 11:44 ` [Bug lto/52489] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: krisztian.kocsis at optimaster dot eu @ 2012-03-05 11:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52489

             Bug #: 52489
           Summary: LTO drops init_array/fini_array sections
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: krisztian.kocsis@optimaster.eu


Hi!

When both optimization (-O > 0) and LTO are enabled then init_array and
fini_array sections are missing from the final binary. Without -flto or with
-O0 these sections are not removed.

This prevents building e.g. glibc with LTO (check for init/fini array fails
because the compiled binary does not contain them - I'v checked it by hand
also).

Here is the conftest code:

int _start (void) { return 0; }
int __start (void) { return 0; }
int foo (void) { return 1; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;

CFLAGS: -O2 -flto -static -nostartfiles -nostdlib

This bug may be the same with #51255!


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-12-11 18:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-05 11:36 [Bug lto/52489] New: LTO drops init_array/fini_array sections krisztian.kocsis at optimaster dot eu
2012-03-05 11:44 ` [Bug lto/52489] " rguenth at gcc dot gnu.org
2012-03-05 12:47 ` krisztian.kocsis at optimaster dot eu
2012-03-05 13:36 ` krisztian.kocsis at optimaster dot eu
2012-03-05 13:39 ` krisztian.kocsis at optimaster dot eu
2012-03-05 13:40 ` krisztian.kocsis at optimaster dot eu
2012-03-05 13:47 ` rguenth at gcc dot gnu.org
2012-03-05 13:50 ` krisztian.kocsis at optimaster dot eu
2012-03-05 18:41 ` pinskia at gcc dot gnu.org
2021-12-11 18:59 ` pinskia at gcc dot gnu.org

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).