diff options
author | Cary Coutant <ccoutant@google.com> | 2012-04-24 22:05:28 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2012-04-24 22:05:28 +0000 |
commit | f038d49652c08bc36a5f606879d59c2a8270ad4a (patch) | |
tree | 6821ff1df888d9a49b665dbbec4863cb735984f5 /gold/incremental-dump.cc | |
parent | 6321c22a8c33b07349532156764fecf9a01a2396 (diff) | |
download | gdb-f038d49652c08bc36a5f606879d59c2a8270ad4a.zip gdb-f038d49652c08bc36a5f606879d59c2a8270ad4a.tar.gz gdb-f038d49652c08bc36a5f606879d59c2a8270ad4a.tar.bz2 |
* incremental-dump.cc (find_input_containing_global): Replace
magic number with symbolic constant.
(dump_incremental_inputs): Update version number.
* incremental.cc (Output_section_incremental_inputs): Update version
number; import symbolic constants from Incremental_inputs_reader.
(Incremental_inputs::create_data_sections): Align relocations
section correctly for 64-bit targets.
(Output_section_incremental_inputs::set_final_data_size): Use symbolic
constants; add padding.
(Output_section_incremental_inputs::write_header): Add assert for
header_size.
(Output_section_incremental_inputs::write_input_files): Add assert
for input_entry_size.
(Output_section_incremental_inputs::write_info_blocks): Add padding;
add assert for object_info_size, input_section_entry_size,
global_sym_entry_size.
* incremental.h (Incremental_inputs_reader): Add symbolic constants
for data structure sizes; use them.
(Incremental_input_entry_reader): Import symbolic constants from
Incremental_inputs_reader; use them.
Diffstat (limited to 'gold/incremental-dump.cc')
-rw-r--r-- | gold/incremental-dump.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gold/incremental-dump.cc b/gold/incremental-dump.cc index fb3d25f..5365265 100644 --- a/gold/incremental-dump.cc +++ b/gold/incremental-dump.cc @@ -52,6 +52,9 @@ find_input_containing_global( unsigned int* symndx) { typedef Incremental_inputs_reader<size, big_endian> Inputs_reader; + static const unsigned int global_sym_entry_size = + Incremental_inputs_reader<size, big_endian>::global_sym_entry_size; + for (unsigned int i = 0; i < incremental_inputs.input_file_count(); ++i) { typename Inputs_reader::Incremental_input_entry_reader input_file = @@ -63,7 +66,8 @@ find_input_containing_global( if (offset >= input_file.get_symbol_offset(0) && offset < input_file.get_symbol_offset(nsyms)) { - *symndx = (offset - input_file.get_symbol_offset(0)) / 20; + *symndx = ((offset - input_file.get_symbol_offset(0)) + / global_sym_entry_size); return input_file; } } @@ -92,7 +96,7 @@ dump_incremental_inputs(const char* argv0, const char* filename, Incremental_inputs_reader<size, big_endian> incremental_inputs(inc->inputs_reader()); - if (incremental_inputs.version() != 1) + if (incremental_inputs.version() != 2) { fprintf(stderr, "%s: %s: unknown incremental version %d\n", argv0, filename, incremental_inputs.version()); |