summaryrefslogtreecommitdiff
path: root/gold/symtab.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-12-31 01:57:55 +0000
committerIan Lance Taylor <ian@airs.com>2009-12-31 01:57:55 +0000
commitfc59c57250878209dbcacd68712643d88b1c7adc (patch)
treee118bf36e60d29e554aa23c914a510c9c50998fe /gold/symtab.h
parent1c74fab0d1fd52933617779be761ce2cc860fa31 (diff)
downloadbinutils-gdb-fc59c57250878209dbcacd68712643d88b1c7adc.tar.gz
PR 10931
* options.h (class General_options): Add --sort-common option. * symtab.h (class Symbol_table): Define Sort_commons_order enum. * common.cc (Sort_common): Add sort_order parameter to constructor. Add sort_order_ field. (Sort_commons::operator): Check sort_order_. (Symbol_table::allocate_commons): Determine the sort order. (Symbol_table::do_allocate_commons): Add sort_order parameter. Change all callers. (Symbol_table::do_allocate_commons_list): Likewise.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r--gold/symtab.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gold/symtab.h b/gold/symtab.h
index cac7beed861..8ee2091418b 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -1195,6 +1195,14 @@ class Symbol_table
PREDEFINED,
};
+ // The order in which we sort common symbols.
+ enum Sort_commons_order
+ {
+ SORT_COMMONS_BY_SIZE_DESCENDING,
+ SORT_COMMONS_BY_ALIGNMENT_DESCENDING,
+ SORT_COMMONS_BY_ALIGNMENT_ASCENDING
+ };
+
// COUNT is an estimate of how many symbosl will be inserted in the
// symbol table. It's ok to put 0 if you don't know; a correct
// guess will just save some CPU by reducing hashtable resizes.
@@ -1603,13 +1611,13 @@ class Symbol_table
// Allocate the common symbols, sized version.
template<int size>
void
- do_allocate_commons(Layout*, Mapfile*);
+ do_allocate_commons(Layout*, Mapfile*, Sort_commons_order);
// Allocate the common symbols from one list.
template<int size>
void
do_allocate_commons_list(Layout*, Commons_section_type, Commons_type*,
- Mapfile*);
+ Mapfile*, Sort_commons_order);
// Implement detect_odr_violations.
template<int size, bool big_endian>