On 7/4/19 5:03 PM, David Edelsohn wrote: > On Thu, Jul 4, 2019 at 10:38 AM Martin Liška <mli...@suse.cz> wrote: >> >> Hi. >> >> Recently I've introduced a new .gnu.lto_.lto section that >> is supposed to provide meta information about a LTO bytecode. >> >> As a further step, I'm planning to teach binutils about >> existence of the section and I'll remove in the future >> emission of __gnu_lto_slim and __gnu_lto_v1 symbols. >> The former one is used by binutils to identify if >> an object is a slim LTO object. The later one is currently >> used only in gcc/collect2.c and was added by David's patch. >> >> My question is: Can we remove __gnu_lto_v1 right now and >> XCOFF will use something similar to ELF (has_lto_section)? >> Can you David help me with that please? > > LTO currently does not work on AIX. I added the __gnu_lto_v1 as a > test. You can rip it out and XCOFF will follow a different path when > implementing LTO.
Great. Then I'm sending revert of the patch. Ready to be installed? Thanks, Martin > > Thanks David >
>From d34a25ca594e9b8c41af56b812faf2f8cdafd010 Mon Sep 17 00:00:00 2001 From: Martin Liska <mli...@suse.cz> Date: Thu, 4 Jul 2019 17:38:33 +0200 Subject: [PATCH] Revert r254460 (collect2 LTO for AIX). gcc/ChangeLog: 2019-07-04 Martin Liska <mli...@suse.cz> * collect2.c (defined): Revert to before r254460. (scan_prog_file): Revert to before r254460. --- gcc/collect2.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/gcc/collect2.c b/gcc/collect2.c index d6a7355e218..e25e33962fb 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -616,7 +616,7 @@ static const char *const target_machine = TARGET_MACHINE; Return 0 if not found, otherwise return its name, allocated with malloc. */ -#if defined (OBJECT_FORMAT_NONE) || defined (OBJECT_FORMAT_COFF) +#ifdef OBJECT_FORMAT_NONE /* Add an entry for the object file NAME to object file list LIST. New entries are added at the end of the list. The original pointer @@ -636,7 +636,7 @@ add_lto_object (struct lto_object_list *list, const char *name) list->last = n; } -#endif +#endif /* OBJECT_FORMAT_NONE */ /* Perform a link-time recompilation and relink if any of the object @@ -2799,10 +2799,8 @@ scan_prog_file (const char *prog_name, scanpass which_pass, LDFILE *ldptr = NULL; int sym_index, sym_count; int is_shared = 0; - int found_lto = 0; - if (which_pass != PASS_FIRST && which_pass != PASS_OBJ - && which_pass != PASS_LTOINFO) + if (which_pass != PASS_FIRST && which_pass != PASS_OBJ) return; #ifdef COLLECT_EXPORT_LIST @@ -2815,7 +2813,6 @@ scan_prog_file (const char *prog_name, scanpass which_pass, eliminate scan_libraries() function. */ do { - found_lto = 0; #endif /* Some platforms (e.g. OSF4) declare ldopen as taking a non-const char * filename parameter, even though it will not @@ -2858,19 +2855,6 @@ scan_prog_file (const char *prog_name, scanpass which_pass, ++name; #endif - if (which_pass == PASS_LTOINFO) - { - if (found_lto) - continue; - if (strncmp (name, "__gnu_lto_v1", 12) == 0) - { - add_lto_object (<o_objects, prog_name); - found_lto = 1; - break; - } - continue; - } - switch (is_ctor_dtor (name)) { #if TARGET_AIX_VERSION -- 2.22.0