summaryrefslogtreecommitdiff
path: root/lto-plugin
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-03 06:17:33 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-03 06:17:33 +0000
commit5c9447f2404b5360adfe707fe0589fef24099834 (patch)
treef12f99097c64e655b05b6ea40051798edb1a610e /lto-plugin
parente1a03d245eace16ae09fbcda2f7480a99845ccf1 (diff)
downloadgcc-5c9447f2404b5360adfe707fe0589fef24099834.tar.gz
2011-10-03 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 179444 using svnmerge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@179445 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'lto-plugin')
-rw-r--r--lto-plugin/ChangeLog17
-rw-r--r--lto-plugin/lto-plugin.c26
2 files changed, 35 insertions, 8 deletions
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 3fb20a9c0af..bf149e4b880 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,20 @@
+2011-10-02 Jan Hubicka <jh@suse.cz>
+
+ PR lto/47247
+ * lto-plugin.c (get_symbols_v2): New variable.
+ (write_resolution): Use V2 API when available.
+ (onload): Handle LDPT_GET_SYMBOLS_V2.
+
+2011-09-30 H.J. Lu <hongjiu.lu@intel.com>
+ Andi Kleen <ak@linux.intel.com>
+
+ PR lto/50568
+ * lto-plugin.c (sym_aux): Change id to unsigned long long.
+ (plugin_symtab): Likewise.
+ (dump_symtab): Likewise.
+ (resolve_conflicts): Likewise.
+ (process_symtab): Likewise.
+
2011-08-10 Richard Guenther <rguenther@suse.de>
PR bootstrap/49907
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 4b5828b3912..d7a78136827 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -80,12 +80,13 @@ along with this program; see the file COPYING3. If not see
/* The part of the symbol table the plugin has to keep track of. Note that we
must keep SYMS until all_symbols_read is called to give the linker time to
- copy the symbol information. */
+ copy the symbol information.
+ The id must be 64bit to minimze collisions. */
struct sym_aux
{
uint32_t slot;
- unsigned id;
+ unsigned long long id;
unsigned next_conflict;
};
@@ -94,7 +95,7 @@ struct plugin_symtab
int nsyms;
struct sym_aux *aux;
struct ld_plugin_symbol *syms;
- unsigned id;
+ unsigned long long id;
};
/* Encapsulates object file data during symbol scan. */
@@ -129,7 +130,7 @@ enum symbol_style
static char *arguments_file_name;
static ld_plugin_register_claim_file register_claim_file;
static ld_plugin_register_all_symbols_read register_all_symbols_read;
-static ld_plugin_get_symbols get_symbols;
+static ld_plugin_get_symbols get_symbols, get_symbols_v2;
static ld_plugin_register_cleanup register_cleanup;
static ld_plugin_add_input_file add_input_file;
static ld_plugin_add_input_library add_input_library;
@@ -359,7 +360,8 @@ dump_symtab (FILE *f, struct plugin_symtab *symtab)
assert (resolution != LDPR_UNKNOWN);
- fprintf (f, "%u %x %s %s\n", (unsigned int) slot, symtab->aux[j].id,
+ fprintf (f, "%u %llx %s %s\n",
+ (unsigned int) slot, symtab->aux[j].id,
lto_resolution_str[resolution],
symtab->syms[j].name);
}
@@ -441,7 +443,12 @@ write_resolution (void)
struct plugin_symtab *symtab = &info->symtab;
struct ld_plugin_symbol *syms = symtab->syms;
- get_symbols (info->handle, symtab->nsyms, syms);
+ /* Version 2 of API supports IRONLY_EXP resolution that is
+ accepted by GCC-4.7 and newer. */
+ if (get_symbols_v2)
+ get_symbols_v2 (info->handle, symtab->nsyms, syms);
+ else
+ get_symbols (info->handle, symtab->nsyms, syms);
finish_conflict_resolution (symtab, &info->conflicts);
@@ -759,7 +766,7 @@ resolve_conflicts (struct plugin_symtab *t, struct plugin_symtab *conflicts)
{
SWAP (struct ld_plugin_symbol, *orig, *s);
SWAP (uint32_t, orig_aux->slot, aux->slot);
- SWAP (unsigned, orig_aux->id, aux->id);
+ SWAP (unsigned long long, orig_aux->id, aux->id);
/* Don't swap conflict chain pointer */
}
@@ -809,7 +816,7 @@ process_symtab (void *data, const char *name, off_t offset, off_t length)
s = strrchr (name, '.');
if (s)
- sscanf (s, ".%x", &obj->out->id);
+ sscanf (s, ".%llx", &obj->out->id);
secdata = xmalloc (length);
offset += obj->file->offset;
if (offset != lseek (obj->file->fd, offset, SEEK_SET)
@@ -986,6 +993,9 @@ onload (struct ld_plugin_tv *tv)
case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK:
register_all_symbols_read = p->tv_u.tv_register_all_symbols_read;
break;
+ case LDPT_GET_SYMBOLS_V2:
+ get_symbols_v2 = p->tv_u.tv_get_symbols;
+ break;
case LDPT_GET_SYMBOLS:
get_symbols = p->tv_u.tv_get_symbols;
break;