binutils-gdb modified for the FreeChainXenon project
![]() gas handles local symbols specially in order to save memory, but the implementation using two separate hash tables is inefficient, particularly the scheme of duplicating a struct local_symbol when it needs to be converted to a full struct symbol. Also, updating symbol pointers with LOCAL_SYMBOL_CHECK is horrible and has led to some hard to find bugs. This changes the implementation to use a single hash table and avoids another copy of the symbol name in symbol_entry_t. When converting local symbols the struct local_symbol memory is reused. Not only does that save memory, but there is no need to twiddle symbol pointers with LOCAL_SYMBOL_CHECK. Assembling gcc-10 -g -Og gold/powerpc.cc output shows the following: old: symbol table hash statistics: 1371192 searches 1290398 collisions 143585 elements 262139 table size mini local symbol table hash statistics: 2966204 searches 2707489 collisions 523533 elements 1048573 table size 523533 mini local symbols created, 140453 converted new: symbol table hash statistics: 2828883 searches 2453138 collisions 526665 elements 1048573 table size 523533 mini local symbols created, 140453 converted * symbols.c (struct local_symbol): Add "hash" entry. Reorder fields. Delete union. Adjust code throughout file. (struct symbol): Add "hash", "name" and "x" entries. Reorder fields. Split off some to.. (struct xsymbol): ..this. New struct. Adjust code throughout file accessing these fields. (struct symbol_entry): Delete. (union symbol_entry): New. (hash_symbol_entry): Adjust for symbol_entry_t change. (symbol_entry_find): Likewise. (eq_symbol_entry): Compare hash values too. (symbol_entry_alloc): Delete. (local_symbol_converted_p, local_symbol_mark_converted): Delete. (local_symbol_get_real_symbol, local_symbol_set_real_symbol): Delete. (local_hash): Delete. (abs_symbol_x, dot_symbol_x): New static var. (symbol_init): New function. (symbol_create): Rewrite. (LOCAL_SYMBOL_CHECK): Delete. Replace uses throughout with simple test of flags.local_symbol. (local_symbol_make): Adjust for struct local_symbol changes. (local_symbol_convert): Rewrite. Adjust all callers. (symbol_table_insert): Simplify. (symbol_clone): Comment on local sym cloning. Handle split symbol struct. (get_real_sym): Delete. Remove all uses. (symbol_find_exact_noref): Simplify. (resolve_local_symbol): Don't resolve non-locals. (S_SET_SEGMENT): Don't special case reg_section. (S_SET_NAME): Set both name and bsym->name. (symbol_mark_resolved, symbol_resolved_p): Simplify. (symbol_symbolS): Update comment. (symbol_begin): Don't create local_hash. Adjust abs_symbol setup. (dot_symbol_init): Adjust dot_symbol setup. (symbol_print_statistics): Delete local_hash stats. |
||
---|---|---|
bfd | ||
binutils | ||
config | ||
contrib | ||
cpu | ||
elfcpp | ||
etc | ||
gas | ||
gdb | ||
gdbserver | ||
gdbsupport | ||
gnulib | ||
gold | ||
gprof | ||
include | ||
intl | ||
ld | ||
libctf | ||
libdecnumber | ||
libiberty | ||
opcodes | ||
readline | ||
sim | ||
texinfo | ||
zlib | ||
.cvsignore | ||
.gitattributes | ||
.gitignore | ||
ar-lib | ||
ChangeLog | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING.LIB | ||
COPYING.LIBGLOSS | ||
COPYING.NEWLIB | ||
COPYING3 | ||
COPYING3.LIB | ||
depcomp | ||
djunpack.bat | ||
install-sh | ||
libtool.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
lt~obsolete.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
makefile.vms | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
README-maintainer-mode | ||
setup.com | ||
src-release.sh | ||
symlink-tree | ||
test-driver | ||
ylwrap |
README for GNU development tools This directory contains various GNU compilers, assemblers, linkers, debuggers, etc., plus their support routines, definitions, and documentation. If you are receiving this as part of a GDB release, see the file gdb/README. If with a binutils release, see binutils/README; if with a libg++ release, see libg++/README, etc. That'll give you info about this package -- supported targets, how to use it, how to report bugs, etc. It is now possible to automatically configure and build a variety of tools with one command. To build all of the tools contained herein, run the ``configure'' script here, e.g.: ./configure make To install them (by default in /usr/local/bin, /usr/local/lib, etc), then do: make install (If the configure script can't determine your type of computer, give it the name as an argument, for instance ``./configure sun4''. You can use the script ``config.sub'' to test whether a name is recognized; if it is, config.sub translates it to a triplet specifying CPU, vendor, and OS.) If you have more than one compiler on your system, it is often best to explicitly set CC in the environment before running configure, and to also set CC when running make. For example (assuming sh/bash/ksh): CC=gcc ./configure make A similar example using csh: setenv CC gcc ./configure make Much of the code and documentation enclosed is copyright by the Free Software Foundation, Inc. See the file COPYING or COPYING.LIB in the various directories, for a description of the GNU General Public License terms under which you can copy the files. REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info on where and how to report problems.