diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2011-09-30 15:48:51 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2011-09-30 08:48:51 -0700 |
commit | ad7715f324194274f98b65b631f38750c94be717 (patch) | |
tree | b1c7697f32847eac92ce0179e818e846546c227b /lto-plugin/lto-plugin.c | |
parent | 11e69edcdc7031f74bf09d582851caf909a4a198 (diff) | |
download | gcc-ad7715f324194274f98b65b631f38750c94be717.zip gcc-ad7715f324194274f98b65b631f38750c94be717.tar.gz gcc-ad7715f324194274f98b65b631f38750c94be717.tar.bz2 |
Use 64bit integer for LTO symbol ID.
gcc/lto
2011-09-30 H.J. Lu <hongjiu.lu@intel.com>
Andi Kleen <ak@linux.intel.com>
PR lto/50568
* lto.c (lto_splay_tree_delete_id): New.
(lto_splay_tree_compare_ids): Likewise.
(lto_splay_tree_lookup): Likewise.
(lto_splay_tree_id_equal_p): Likewise.
(lto_splay_tree_insert): Likewise.
(lto_splay_tree_new): Likewise.
(lto_resolution_read): Change id to unsigned HOST_WIDE_INT.
Use lto_splay_tree_id_equal_p and lto_splay_tree_lookup.
(create_subid_section_table): Use lto_splay_tree_lookup and
lto_splay_tree_insert.
(lto_file_read): Use lto_splay_tree_new.
lto-plugin/
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.
Co-Authored-By: Andi Kleen <ak@linux.intel.com>
From-SVN: r179395
Diffstat (limited to 'lto-plugin/lto-plugin.c')
-rw-r--r-- | lto-plugin/lto-plugin.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c index 4b5828b..9323bd2 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. */ @@ -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); } @@ -759,7 +761,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 +811,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) |