add missing file
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
20138696
DK
12010-01-12 Doug Kwan <dougkwan@google.com>
2
3 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4 (Arm_relobj::Mapping_symbol_position,
5 Arm_reloj::Mapping_symbol_position_less,
6 Arm_relobj::Mapping_symbols_info): New types.
7 (Target_arm::is_mapping_symbol_name): New method definition.
8 (Arm_relobj::do_count_local_symbols): Save information about mapping
9 symbols.
10
089d69dc
DK
112010-01-11 Doug Kwan <dougkwan@google.com>
12
13 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
14 Arm_relocate_functions::thumb32_branch_upper,
15 Arm_relocate_functions::thumb32_branch_lower,
16 Arm_relocate_functions::thumb32_cond_branch_offset,
17 Arm_relocate_functions::thumb32_cond_branch_upper,
18 Arm_relocate_functions::thumb32_cond_branch_lower,
19 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
20 branch offset encoding.
21 (Arm_relocate_functions::thumb_branch_common): Use new branch
22 offset encoding methods to avoid code duplication.
23 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
24 (Stub_addend_reader::operator()): Use new branch encoding method
25 to avoid code duplication.
26
99e5bff2
DK
272010-01-11 Doug Kwan <dougkwan@google.com>
28
29 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
30 (Target_arm::do_finalize_sections): Define special EXIDX section
31 symbols only if referenced.
32 * gc.h (Garbage_collection::add_reference): New method.
33 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
34 code duplication.
35
98e090bd
ILT
362010-01-11 Ian Lance Taylor <iant@google.com>
37
d0a91bd8
ILT
38 * script.cc (Version_script_info::build_expression_list_lookup):
39 Change complaing about duplicate wildcard match from error to
40 warning.
41
98e090bd
ILT
42 * script.cc (class Lazy_demangler): Recreate--revert part of patch
43 of 2009-12-30.
44 (Version_script_info::Version_script_info): Initialize globs_,
45 default_version_, default_is_global_, and exact_. Don't
46 initialize globals_ or locals_.
47 (Version_script_info::build_lookup_tables): Build local symbols
48 first.
49 (Version_script_info::unquote): New function.
50 (Version_script_info::add_exact_match): New function.
51 (Version_script_info::build_expression_list_lookup): Remove lookup
52 parameter. Add is_global parameter. Change all callers. Handle
53 wildcard pattern specially. Unquote pattern. Call
54 add_exact_match.
55 (Version_script_info::get_name_to_match): New function.
56 (Version_script_info::get_symbol_version): New function.
57 (Version_script_info::get_symbol_version_helper): Remove.
58 (Version_script_info::check_unmatched_names): Call unquote.
59 * script.h (class Version_script_info): Change get_symbol_version
60 to be non-inline and add is_global parameter; change all callers.
61 Rewrite symbol_is_local. Update declarations. Define struct
62 Version_tree_match, Exact, Globs. Don't define struct Lookup.
63 Remove globals_ and locals_ members. Add exact_, globs_,
64 default_version_, is_global_.
65 (Version_script_info::Glob): Remove pattern, add expression and
66 is_global. Update constructor. Change all callers.
67 * dynobj.cc (Versions::finalize): Mark the version symbol as the
68 default version.
69 (Versions::symbol_section_contents): If a symbol is undefined, or
70 defined in a dynamic object, set the version index to
71 VER_NDX_LOCAL.
72 * symtab.cc (Symbol_table::add_from_relobj): Don't call
73 symbol_is_local.
74 (Symbol_table::add_from_pluginobj): Likewise.
75 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
76
d56962d3
DK
772010-01-11 Doug Kwan <dougkwan@google.com>
78
79 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
80 (incremental_dump_LDADD): Add linking option for libintl.
81 * Makefile.in: Regenerate.
82
94e6ee91
L
832010-01-11 H.J. Lu <hongjiu.lu@intel.com>
84
85 PR gold/11144
86 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
87 instead of -Ds.
88 * testsuite/Makefile.in: Regenerated.
89
e96c574b
DK
902010-01-10 Doug Kwan <dougkwan@google.com>
91
92 * options.h (DEFINE_var): Use parentheses around argument varname__
93 in macro body to avoid any unintended subsequent substitutions.
94
7198066b
ILT
952010-01-10 Ian Lance Taylor <iant@google.com>
96
ba4d53bf
ILT
97 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
98 candidates before doing symbol resolution.
99
7198066b
ILT
100 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
101 ODR candidates if only one is weak.
102
a2beed37
ILT
1032010-01-08 Ian Lance Taylor <iant@google.com>
104
105 * script.cc (Version_script_info::build_expression_list_lookup):
106 Don't warn about ambiguous version, just record the ambiguity.
107 (Version_script_info::get_symbol_version_helper): Give error if
108 version is ambiguous.
109
2fb7225c
DK
1102010-01-08 Doug Kwan <dougkwan@google.com>
111
112 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
113 prev_data_size_ and prev_addralign_. Remove initializer for
114 deleted data member has_been_changed_.
115 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
116 to determine if the table is empty.
117 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
118 Remove.
119 (Stub_table::add_reloc_stub): Define method in class definition
120 instead of just declaring it there.
121 (Stub_table::add_cortex_a8_stub): New method definition.
122 (Stub_table::update_data_size_and_addralign): Ditto.
123 (Stub_table::finalize_stubs): Ditto.
124 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
125 (Stub_table::do_addralign_): Return address alignment in the
126 (Stub_table::do_reset_address_and_file_offset): Define method in
127 class definition instead of declaring it there. Set current data
128 size to be the data size of the previous pass.
129 (Stub_table::set_final_data_size): Use current data size as the
130 final data size.
131 (Stub_table::relocate_stub): Change parameter type of stub from
132 Reloc_stub pointer to Stub pointer.
133 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
134 (Stub_table::Cortex_a8_stub_list): New typedef.
135 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
136 Stub_table::prev_addralign_): New data member.
137 (Arm_relobj::Arm_relobj): Initialize data member
138 section_has_cortex_a8_workaround_.
139 (Arm_relobj::section_has_cortex_a8_workaround,
140 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
141 definitions.
142 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
143 declarations.
144 (Target_arm::relocate_stub): Change parameter type of stub from
145 Reloc_stub pointer to Stub pointer.
146 (Insn_template::size, Insn_template::alignment): Handle
147 THUMB16_SPECIAL_TYPE.
148 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
149 Stub_table::update_data_size_and_addralign,
150 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
151 definitions.
152 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
153 (Stub_table::do_write): Ditto.
154 (Target_arm::do_relax): Adjust code for changes in Stub_table.
155
880cd20d
ILT
1562010-01-08 Ian Lance Taylor <iant@google.com>
157
158 PR 11108
159 * symtab.h (class Symbol): Remove fields is_target_special_ and
160 has_plt_offset_. Add field is_defined_in_discarded_section_.
161 (Symbol::is_defined_in_discarded_section): New function.
162 (Symbol::set_is_defined_in_discarded_section): New function.
163 (Symbol::has_plt_offset): Rewrite.
164 (Symbol::set_plt_offset): Verify that new offset is not -1U.
165 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
166 Don't initialize is_target_special_ or has_plt_offset_.
167 Initialize is_defined_in_discarded_section_.
168 (Symbol_table::add_from_relobj): If appropriate, set
169 is_defined_in_discarded_section.
170 * resolve.cc (Symbol::override_base_with_special): Don't test
171 is_target_special_. Change has_plt_offset_ to has_plt_offset().
172 * target-reloc.h (relocate_section): Do special handling for
173 symbols defined in discarded sections for global symbols as well
174 as local symbols.
175
2703e3eb
ILT
1762010-01-08 Ian Lance Taylor <iant@google.com>
177
178 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
179 the SHT_SYMTAB case.
180
339d40a3
ILT
1812010-01-08 Ian Lance Taylor <iant@google.com>
182
183 * object.cc (Sized_relobj::do_layout): Don't get confused if
184 layout_eh_frame returns NULL.
185
abecea76
ILT
1862010-01-08 Ian Lance Taylor <iant@google.com>
187
188 PR 11084
189 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
190 dynamic symbol table, use the normal symbol table.
191 (Sized_dynobj::do_read_symbols): Remove assertion about type of
192 symbol table.
193
6b7dd3f3
ILT
1942010-01-08 Ian Lance Taylor <iant@google.com>
195
196 PR 11072
197 * layout.cc (Layout::include_section): Remove .gnu_debuglink
198 sections.
199
36c50e63
L
2002010-01-08 H.J. Lu <hongjiu.lu@intel.com>
201
202 * version.cc (print_version): Change to "Copyright 2010".
203
e291e7b9
ILT
2042010-01-08 Ian Lance Taylor <iant@google.com>
205
206 PR 10287
207 PR 11063
208 * i386.cc (class Target_i386): Change return type of plt_section
209 to be non-const.
210 (class Output_data_plt_i386): Add tls_desc_rel_ field.
211 (Output_data_plt_i386::Output_data_plt_i386): Initialize
212 tls_desc_rel_ field.
213 (Output_data_plt_i386::rel_tls_desc): New function.
214 (Target_i386::rel_tls_desc_section): New function.
215 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
216 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
217 R_386_TLS_DESC reloc in rel_tls_desc_section.
218 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
219 Define struct Tlsdesc_info.
220 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
221 (Target_x86_64::do_reloc_symbol_index): New function.
222 (Target_x86_64::add_tlsdesc_info): New function.
223 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
224 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
225 tlsdesc_rel_ field.
226 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
227 all callers.
228 (Output_data_plt_x86_64::rela_tlsdesc): New function.
229 (Target_x86_64::rela_tlsdesc_section): New function.
230 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
231 handling.
232 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
233 (Target_x86_64::do_reloc_addend): New function.
234 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
235 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
236 declarations. Define TARGET_CODE. Add arg field to u1_ union.
237 (Output_reloc::type): New function.
238 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
239 (Output_reloc::is_target_specific): New function.
240 (Output_reloc::target_arg): New function.
241 (class Output_reloc) [SHT_RELA]: Add four new constructors for
242 absolute relocs and target specific relocs.
243 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
244 add_target_specific.
245 (class Output_data_reloc) [SHT_RELA]: Likewise.
246 * output.cc (Output_reloc::Output_reloc): Add four new versions
247 for absolute relocs and target specific relocs.
248 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
249 (Output_reloc::get_symbol_index): Likewise.
250 (Output_reloc::local_section_offset): Check that local_sym_index_
251 is not TARGET_CODE or 0.
252 (Output_reloc::symbol_value): Likewise.
253 (Output_reloc::write) [SHT_RELA]: Call target for target specific
254 reloc.
255 * target.h (class Target): Add reloc_symbol_index and reloc_addend
256 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
257 functions.
258 * layout.cc (add_target_dynamic_tags): Use output section for
259 DT_PLTRELSZ and DT_JMPREL.
260
3a44184e
ILT
2612010-01-07 Ian Lance Taylor <iant@google.com>
262
263 PR 11061
264 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
265 function.
266 (class Output_data_reloc_generic): Define.
267 (class Output_data_reloc_base): Change base class to
268 Output_data_reloc_generic. Change add() method to call
269 bump_relative_reloc_count for a relative reloc. Remove
270 sort_relocs_ field.
271 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
272 to sort_relocs().
273 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
274 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
275 appropriate.
276 * layout.h (class Layout): Update declaration.
277
ea715a34
ILT
2782010-01-07 Ian Lance Taylor <iant@google.com>
279
280 * output.h (class Output_data): Add const version of
281 output_section and do_output_section.
282 (class Output_section_data): Add const version of
283 do_output_section.
284 (class Output_section): Likewise.
285 * layout.cc (Layout::add_target_dynamic_tags): New function.
286 * layout.h (class Layout): Update declarations.
287 * arm.cc (Target_arm::do_finalize_sections): Use
288 add_target_dynamic_tags.
289 * i386.cc (Target_i386::do_finalize_sections): Likewise.
290 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
291 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
292 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
293
659948a4
ILT
2942010-01-07 Ian Lance Taylor <iant@google.com>
295
296 PR 11042
297 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
298 object as needed.
299
9d3b86f6
ILT
3002010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
301 Ian Lance Taylor <iant@google.com>
302
303 PR 11019
304 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
305 Xindex::read_symtab_xindex.
306
bb0d3eb0
DK
3072010-01-07 Doug Kwan <dougkwan@google.com>
308
309 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
310 (Insn_template::thumb16_bcond_insn): New method declaration.
311 (Insn_template): Fix spelling.
312 (Stub::thumb16_special): New method declaration.
313 (Stub::do_write): Define virtual method which was previously pure
314 virtual.
315 (Stub::do_thumb16_special): New method declaration.
316 (Stub::do_fixed_endian_write): New template member.
317 (Reloc_stub::do_write): Remove.
318 (Reloc_stub::do_fixed_endian_write): Remove.
319 (Cortex_a8_stub): New class definition.
320 (Stub_factory::make_cortex_a8_stub): New method definition.
321 (Stub_factory::Stub_factory): Add missing static storage class
322 qualifier for elf32_arm_stub_a8_veneer_blx.
323
ffeef7df
ILT
3242010-01-07 Ian Lance Taylor <iant@google.com>
325
dc3f80fe
ILT
326 PR 10980
327 * options.h (class General_options): Add --warn-unresolved-symbols
328 and --error-unresolved-symbols.
329 * errors.cc (Errors::undefined_symbol): Implement
330 --warn-unresolved-symbols.
331
ffeef7df
ILT
332 * options.h (class General_options): Add -z text and -z textoff.
333 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
334
f1ec9ded
ST
3352010-01-06 Sriraman Tallam <tmsriram@google.com>
336
337 * gc.h (Garbage_collection::Cident_section_map): New typedef.
338 (Garbage_collection::cident_sections): New function.
339 (Garbage_collection::add_cident_section): New function.
340 (Garbage_collection::cident_sections_): New member.
341 (gc_process_relocs): Add references to sections whose names are C
342 identifiers.
343 * gold.h (cident_section_start_prefix): New constant.
344 (cident_section_stop_prefix): New constant.
345 (is_cident): New function.
346 * layout.cc (Layout::define_section_symbols): Replace string constants
347 with the newly defined constants.
348 * object.cc (Sized_relobj::do_layout): Track sections whose names are
349 C identifiers.
350 * testsuite/Makefile.am: Add gc_orphan_section_test.
351 * testsuite/Makefile.in: Regenerate.
352 * testsuite/gc_orphan_section_test.cc: New file.
353 * testsuite/gc_orphan_section_test.sh: New file.
354
6eda8c29
ILT
3552010-01-06 Ian Lance Taylor <iant@google.com>
356
b9674e17
ILT
357 PR 10980
358 * options.h (class General_options): Add --warn-shared-textrel.
359 * layout.cc (Layout::finish_dynamic_section): Implement
360 --warn-shared-textrel.
361
6eda8c29
ILT
362 PR 10980
363 * options.h (class General_options): Add --warn-multiple-gp.
364
32dcd44e
ILT
3652010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
366
367 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
368 $(THREADSLIB) and $(LIBDL).
369 * Makefile.in: Rebuild.
370
a192ba05
ILT
3712010-01-06 Ian Lance Taylor <iant@google.com>
372
373 PR 10980
374 * options.cc (General_options::parse_section_start): New function.
375 (General_options::section_start): New function.
376 (General_options::General_options): Initialize all members.
377 * options.h: Include <map>
378 (class General_options): Add --section-start. Add section_starts_
379 member.
380 * layout.cc (Layout::attach_allocated_section_to_segment): If
381 --section-start was used, set the address of the segment. Remove
382 local sort_sections.
383 (Layout::relaxation_loop_body): If the address of the load segment
384 has been set by --section-start, don't use it.
385 * output.h (Output_segment::update_flags_for_output_section): New
386 function.
387 * output.cc (Output_segment::add_output_section): Call
388 update_flags_for_output_section.
389
dde3f402
ILT
3902010-01-05 Ian Lance Taylor <iant@google.com>
391
62dfdd4d
ILT
392 PR 10980
393 * options.h (class General_options): Add --undefined-version.
394 * script.cc (struct Version_expression): Add was_matched_by_symbol
395 field.
396 (Version_script_info::matched_symbol): New function.
397 (Version_script_info::get_symbol_version_helper): Call
398 matched_symbol.
399 (Version_script_info::check_unmatched_names): New function.
400 * script.h (class Version_script_info): Update declarations.
401 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
402
9c4ae156
ILT
403 * options.h (class General_options): Use DEFINE_bool_alias for
404 allow_multiple_definition.
405 * resolve.cc (Symbol_table::should_override): Don't test
406 allow_multiple_definition.
407
dde3f402
ILT
408 PR 10980
409 * options.h (class General_options): Add --cref.
410 * main.cc (main): Print cref table if --cref. Don't close mapfile
411 until after printing cref table.
412 * cref.cc: Include "symtab.h".
413 (class Cref_inputs): Define Cref_table_compare and Cref_table.
414 (Cref_table_compare::operator()): New function.
415 (Cref_inputs::gather_cref): New function.
416 (filecol): New static const.
417 (Cref_inputs::print_cref): New function.
418 (Cref::print_cref): New function.
419 * cref.h: Include <cstdio>.
420 (class Cref): Update declarations.
421 * mapfile.h (Mapfile::file): New function.
422 * object.h (class Object): Define Symbols. Declare virtual
423 do_get_global_symbols.
424 (Object::get_global_symbols): New function.
425 * object.cc (Input_objects::add_object): Pass object to cref_ if
426 --cref.
427 (Input_objects::archive_start): Likewise.
428 (Input_objects::archive_stop): Likewise.
429 (Input_objects::print_cref): New function.
430 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
431 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
432 --cref.
433 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
434 function.
435 * plugin.h (class Sized_pluginobj): Update declarations.
436
8781f709
ILT
4372010-01-05 Ian Lance Taylor <iant@google.com>
438
439 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
440 to is_default_version. Rename insdef to insdefault.
441 (Symbol_table::add_from_relobj): Rename def to is_default_version
442 and local to is_forced_local.
443 (Symbol_table::add_from_pluginobj): Likewise.
444 (Symbol_table::add_from_dynobj): Likewise.
445 (Symbol_table::define_special_symbol): Rename insdef to
446 insdefault.
447
fe35d28d
ILT
4482010-01-04 Ian Lance Taylor <iant@google.com>
449
30bc8c46
ILT
450 PR 10980
451 * options.h (class General_options): Add
452 --allow-multiple-definition and -z muldefs.
453 * resolve.cc (Symbol_table::should_override): Don't warn about a
454 multiple symbol definition if --allow-multiple-definition or -z
455 muldefs.
456
7eaea549
ILT
457 PR 10980
458 * options.h (class General_options): Add --add-needed and
459 --copy-dt-needed-entries. Tweak --as-needed help entry.
460 * object.cc (Input_objects::check_dynamic_dependencies): Give an
461 error if --copy-dt-needed-entries aka --add-needed is used and
462 would cause a change in behaviour.
463
fe35d28d
ILT
464 PR 10980
465 * options.h (class General_options): Add -G as a short version of
466 --shared. Add no-op options -assert, -g, and -i.
467
55a2bb35
ST
4682010-01-04 Sriraman Tallam <tmsriram@google.com>
469
470 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
471 check for .text or .gnu.linkonce.t sections.
472 * icf.cc (Icf::find_identical_sections): Ditto.
473 Change the detection for mangled function name within the section
474 name.
475 * icf.h (is_section_foldable_candidate): New function.
476
719328e1
ILT
4772009-12-30 Ian Lance Taylor <iant@google.com>
478
479 PR 10980
480 * options.h (class General_options): Permit two dashes with
481 --retain-symbols-file.
482
d7bb5745
ILT
4832009-12-30 Ian Lance Taylor <iant@google.com>
484
403a15dd
ILT
485 PR 10979
486 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
487 don't put the file header and segment headers in the text
488 segment.
489
eda294df
ILT
490 PR 10979
491 * common.cc (Sort_commons::operator()): Stabilize sort when both
492 entries are NULL.
493 (Symbol_table::do_allocate_commons_list): When allocating common
494 symbols, skip a symbol which is no longer common.
495 * symtab.h (Symbol::is_common): Test whether the symbol comes from
496 an object before checking its type.
497 * testsuite/common_test_2.c: New file.
498 * testsuite/common_test_3.c: New file.
499 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
500 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
501 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
502 (common_test_2_pic.o, common_test_2.so): New targets.
503 (common_test_3_pic.o, common_test_3.so): New targets.
504 * testsuite/Makefile.in: Rebuild.
505
d7bb5745
ILT
506 PR 10979
507 * script.cc (read_input_script): If we see a new SECTIONS clause,
508 and we have added an input section, give an error.
509 * layout.h (class Layout): Add have_added_input_section function.
510 Add have_added_input_section_ field.
511 * layout.cc (Layout::Layout): Initialize
512 have_added_input_section_.
513 (Layout::layout): Set have_added_input_section_.
514 (Layout::layout_eh_frame): Likewise.
515
fc59c572
ILT
5162009-12-30 Ian Lance Taylor <iant@google.com>
517
518 PR 10931
519 * options.h (class General_options): Add --sort-common option.
520 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
521 * common.cc (Sort_common): Add sort_order parameter to
522 constructor. Add sort_order_ field.
523 (Sort_commons::operator): Check sort_order_.
524 (Symbol_table::allocate_commons): Determine the sort order.
525 (Symbol_table::do_allocate_commons): Add sort_order parameter.
526 Change all callers.
527 (Symbol_table::do_allocate_commons_list): Likewise.
528
1c74fab0
ILT
5292009-12-30 Ian Lance Taylor <iant@google.com>
530
531 PR 10916
532 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
533 symbols from this object, don't change the visibility of an
534 undefined symbol.
535 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
536
6affe781
ILT
5372009-12-30 Ian Lance Taylor <iant@google.com>
538
539 PR 10861
540 * script.h (class Version_script_info): Define Language enum.
541 Update declarations. Define Glob, Exact, and Lookup types. Add
542 new fields globals_, locals_, and is_finalized_.
543 * script.cc: Various formatting fixes.
544 (class Parser_closure): Change language_stack_ from a vector of
545 std::string to one of Version_script_info::Language. Adjust all
546 uses accordingly.
547 (class Lazy_demangler): Remove.
548 (struct Version_expression): Change language from std::string to
549 Version_script_info::Language.
550 (Version_script_info::Version_script_info): New function.
551 (Version_script_info::~Version_script_info): Don't call clear.
552 (Version_script_info::finalize): New function.
553 (Version_script_info::build_lookup_tables): New function.
554 (Version_script_info::build_expression_list_lookup): New
555 function.
556 (Version_script_info::get_symbol_version_helper): Rewrite to use
557 lookup tables.
558 (Version_script_info::print_expression_list): Adjust to use
559 Version_script_info::Language.
560 (script_push_lex_into_version_mode): Check that the version script
561 has not been finalized.
562 (version_script_push_lang): Change language string to
563 Version_script_info::Language.
564 * options.cc (Command_line::version_script): New function.
565 * options.h (class General_options): Add finalize_dynamic_list
566 function. Change version_script from declaration to definition.
567 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
568 * testsuite/version_script.map: Remove duplicate def of foo.
569 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
570 version_script.map.
571 * testsuite/Makefile.in: Rebuild.
572
818bf354
ILT
5732009-12-30 Ian Lance Taylor <iant@google.com>
574
575 PR 10843
576 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
577 if the input symbol index is 0, make the output symbol index 0.
578
ebcc8304
ILT
5792009-12-30 Ian Lance Taylor <iant@google.com>
580
581 PR 10670
582 * options.h (class General_options): Add -x/--discard-all.
583 * object.cc (Sized_relobj::do_count_local_symbols): Handle
584 --discard-all. If the local symbol needs a dynamic entry, check
585 that before handling --discard-locals.
586
176fe33f
ILT
5872009-12-30 Ian Lance Taylor <iant@google.com>
588
bb321bb1
ILT
589 PR 10450
590 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
591 flags to PF_R.
592 (Output_segment::add_output_section): Don't change the flags if
593 the type is PT_TLS.
594
176fe33f
ILT
595 PR 10450
596 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
597 GNU hash table if they need a dynamic value. Otherwise, don't add
598 them if they are defined in a dynamic object or are forced local.
599
e8cd95c7
ILT
6002009-12-29 Ian Lance Taylor <iant@google.com>
601
1b81fb71
ILT
602 PR 10450
603 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
604 .gnu.hash table for a 32-bit target.
605
8d6d383d
ILT
606 PR 10450
607 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
608 regular and a dynamic object only needs a dynamic symbol table
609 entry if it is externally visible.
610
e785ec03
ILT
611 PR 10450
612 * i386.cc (class Target_i386): Initialize global_offset_table_ in
613 constructor. Add global_offset_table_ field.
614 (Target_i386::got_section): Set global_offset_table_.
615 (Target_i386::do_finalize_sections): Set global_offset_table_
616 size.
617 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
618 in constructor. Add global_offset_table_ field.
619 (Target_x86_64::got_section): Set global_offset_table_.
620 (Target_x86_64::do_finalize_sections): Set global_offset_table_
621 size.
622
1a2dff53
ILT
623 * layout.cc (Layout::Layout): Initialize increase_relro_.
624 (Layout::get_output_section): Add is_relro, is_last_relro, and
625 is_first_non_relro parameters. Change all callers.
626 (Layout::choose_output_section): Likewise.
627 (Layout::add_output_section_data): Likewise.
628 (Layout::make_output_section): Likewise.
629 (Layout::set_segment_offsets): Clear increase_relro when using a
630 linker script.
631 * layout.h (class Layout): Add increase_relro method. Add
632 increase_relro_ field. Update declarations.
633 * output.cc (Output_section::Output_section): Initialize
634 is_last_relro_ and is_first_non_relro_.
635 (Output_segment::add_output_section): Group relro sections is
636 do_sort is true. Handle is_last_relro and is_first_non_relro.
637 (Output_segment::maximum_alignment): Remove relro handling.
638 (Output_segment::set_section_addresses): Add increase_relro
639 parameter. Change all callers. Add initial alignment to align
640 relro sections on separate page. Remove old relro handling.
641 (Output_segment::set_section_list_addresses): Remove in_relro
642 parameter. Change all callers.
643 (Output_segment::set_offset): Add increase parameter. Change all
644 callers. Remove old relro handling.
645 * output.h (class Output_section): Add new methods: is_last_relro,
646 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
647 Add is_last_relro_ and is_first_non_relro_ fields.
648 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
649 Create separate .got.plt section. Call increase_relro.
650 * x86_64.cc (Target_x86_64::got_section): Likewise.
651 * testsuite/relro_script_test.t: Add .got.plt.
652
f0ba79e2
ILT
653 PR 10450
654 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
655 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
656 (Layout::finalize): Call set_dynamic_symbol_size.
657 (Layout::set_dynamic_symbol_size): New function.
658 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
659 set_dynamic_symbol_size.
660
e8cd95c7
ILT
661 PR 10450
662 * output.h (class Output_section): Add is_entsize_zero_ field.
663 * output.cc (Output_section::Output_section): Initialize
664 is_entsize_zero_.
665 (Output_section::set_entsize): If two different entsizes are
666 requested, force it to zero.
667 (Output_section::add_input_section): Set flags for .debug_str
668 before updating section flags. Set entsize.
669 (Output_section::update_flags_for_input_section): Set SHF_MERGE
670 and SHF_STRING if all input sections have those flags.
671
3e1b9a8a
RÁE
6722009-12-29 Rafael Espindola <espindola@google.com>
673
674 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
675 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
676 reporting.
3e1b9a8a 677
3dcad376
ST
6782009-12-29 Sriraman Tallam <tmsriram@google.com>
679
680 * options.cc (General_options::parse_version): Allow -v to exit
681 without an error if there is nothing to link.
682
084e2665
ILT
6832009-12-29 Ian Lance Taylor <iant@google.com>
684
685 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
686 using a version of gcc before 4.1.
687 * configure: Rebuild.
688
250acde3
CD
6892009-12-28 Chris Demetriou <cgd@google.com>
690
691 * attributes.cc (Output_attributes_section_data::do_write): Use
692 std::vector::front rather than std::vector::data.
693
99fff23b
ILT
6942009-12-28 Ian Lance Taylor <iant@google.com>
695
696 * symtab.h (class Symbol_table): Add enum Defined.
697 * resolve.cc (Symbol_table::should_override): Add defined
698 parameter. Change all callers. Test whether object is NULL
699 before calling a method on it.
700 (Symbol_table::report_resolve_problem): Add defined parameter.
701 Change all callers.
702 (Symbol_table::should_override_with_special): Likewise.
703 * symtab.cc (Symbol_table::define_in_output_data): Add defined
704 parameter. Change all callers.
705 (Symbol_table::do_define_in_output_data): Likewise.
706 (Symbol_table::define_in_output_segment): Likewise.
707 (Symbol_table::do_define_in_output_segment): Likewise.
708 (Symbol_table::define_as_constant): Likewise.
709 (Symbol_table::do_define_as_constant): Likewise.
710 * script.h (class Symbol_assignment): Add is_defsym parameter to
711 constructor; change all callers.
712 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
713 parameter. Change all callers. Add is_defsym_ field.
714 (class Parser_closure): Add parsing_defsym parameter to
715 constructor; change all callers. Add parsing_defsym accessor
716 function. Add parsing_defsym_ field.
717
556bd683
ILT
7182009-12-28 Ian Lance Taylor <iant@google.com>
719
720 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 721 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 722
1782c879
ILT
7232009-12-23 Ian Lance Taylor <iant@google.com>
724
725 * i386.cc (Target_i386::do_calls_non_split): Recognize
726 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
727 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
728 -fsplit-stack prologue when using %r11.
1782c879 729
329ca2b1
ST
7302009-12-21 Sriraman Tallam <tmsriram@google.com>
731
732 * options.cc (General_options::parse_version): Make -v continue and do
733 the link like GNU ld does.
734
d675ff46
RÁE
7352009-12-17 Rafael Avila de Espindola <espindola@google.com>
736
737 * Makefile.am (CCFILES): Add timer.cc.
738 (HFILES): Add timer.h.
739 * configure.ac: Check for sysconf and times.
740 * main.cc: include timer.h.
741 (main): Use Timer instead of get_run_time.
742 * timer.cc: New.
743 * timer.h: New.
744 * workqueue.cc: include timer.h.
745 (Workqueue::find_and_run_task):
746 Report user, sys and wall time.
747 * Makefile.in: Regenerate.
748 * config.in: Regenerate.
749 * configure: Regenerate.
750
d6344fb5
DK
7512009-12-16 Doug Kwan <dougkwan@google.com>
752
753 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
754 sections.
755 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
756 relaxed input sections.
757 * output.cc (Output_section::find_relaxed_input_section): Change
758 return type to Output_relaxed_input_section pointer. Adjust code
759 for new type of relaxed_input_section_map_.
760 * output.h (Output_section::find_relaxed_input_section): Change
761 return type to Output_relaxed_input_section pointer.
762 (Output_section::Output_relaxed_input_section_by_input_section_map):
763 New type.
764 (Output_section::relaxed_input_section_map_): Change type to
765 Output_section::Output_relaxed_input_section_by_input_section_map.
766 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
767 input section.
768
0e0d5469
ILT
7692009-12-15 Ian Lance Taylor <iant@google.com>
770
771 * layout.cc (Layout::create_shstrtab): Only write out after input
772 sections if we are compressing debug sections.
773
0649a889
ILT
7742009-12-15 Ian Lance Taylor <iant@google.com>
775
776 * archive.cc (Archive::add_symbols): Only look up a symbol without
777 a version if there is, in fact, a version.
778
2ea97941
ILT
7792009-12-14 Ian Lance Taylor <iant@google.com>
780
781 Revert -Wshadow changes, all changes from:
782 2009-12-11 Doug Kwan <dougkwan@google.com>
783 2009-12-11 Nick Clifton <nickc@redhat.com>
784 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
785
b0eec2cc
DK
7862009-12-11 Doug Kwan <dougkwan@google.com>
787
788 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
789 due to -Wshadow.
790 * attributes.cc (Object_attribute::size): Ditto.
791 (Attributes_section_data::size): Ditto.
792 (Attributes_section_data::Attributes_section_data): Ditto.
793 (Output_attributes_section_data::do_write): Ditto.
794 * attributes.h (Object_attribute::set_type): Ditto.
795 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
796
91d6fa6a
NC
7972009-12-11 Nick Clifton <nickc@redhat.com>
798
799 * archive.cc: Fix shadowed variable warnings.
800 * arm.cc: Likewise.
801 * compressed_output.cc: Likewise.
802 * compressed_output.h: Likewise.
803 * configure: Likewise.
804 * dwarf_reader.cc: Likewise.
805 * dynobj.cc: Likewise.
806 * dynobj.h: Likewise.
807 * ehframe.cc: Likewise.
808 * ehframe.h: Likewise.
809 * errors.cc: Likewise.
810 * expression.cc: Likewise.
811 * fileread.cc: Likewise.
812 * fileread.h: Likewise.
813 * freebsd.h: Likewise.
814 * i386.cc: Likewise.
815 * icf.cc: Likewise.
816 * incremental.h: Likewise.
817 * layout.cc: Likewise.
818 * layout.h: Likewise.
819 * mapfile.cc: Likewise.
820 * merge.cc: Likewise.
821 * merge.h: Likewise.
822 * object.cc: Likewise.
823 * object.h: Likewise.
824 * options.h: Likewise.
825 * output.cc: Likewise.
826 * output.h: Likewise.
827 * parameters.cc: Likewise.
828 * plugin.cc: Likewise.
829 * powerpc.cc: Likewise.
830 * reduced_debug_output.cc: Likewise.
831 * reduced_debug_output.h: Likewise.
832 * reloc.cc: Likewise.
833 * reloc.h: Likewise.
834 * resolve.cc: Likewise.
835 * script-sections.cc: Likewise.
836 * script.cc: Likewise.
837 * script.h: Likewise.
838 * sparc.cc: Likewise.
839 * symtab.cc: Likewise.
840 * symtab.h: Likewise.
841 * target-select.cc: Likewise.
842 * target-select.h: Likewise.
843 * token.h: Likewise.
844 * workqueue.cc: Likewise.
845 * workqueue.h: Likewise.
846 * x86_64.cc: Likewise.
847
a0351a69
DK
8482009-12-10 Doug Kwan <dougkwan@google.com>
849
850 * arm.cc (attributes.h): New include.
851 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
852 (Arm_relobj::~Arm_relobj): Delete object pointed by
853 attributes_section_data_.
854 (Arm_relobj::attributes_section_data): New method definition.
855 (Arm_relobj::attributes_section_data_): New data member declaration.
856 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
857 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
858 attributes_section_data_.
859 (Arm_dynobj::attributes_section_data): New method definition.
860 (Arm_dynobj::attributes_section_data_): New data member declaration.
861 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
862 initialization value of may_use_blx_ to false.
863 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
864 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
865 object attributes to compute results instead of hard-coding.
866 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
867 Target_arm::get_secondary_compatible_arch,
868 Target_arm::set_secondary_compatible_arch
869 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
870 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
871 New method declarations.
872 (Target_arm::get_aeabi_object_attribute): New method definition.
873 (Target_arm::attributes_section_data_): New data member declaration.
874 (read_arm_attributes_section): New template definition.
875 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
876 (Arm_dynobj::do_read_symbols): Ditto.
877 (Target_arm::do_finalize_sections): Merge attributes sections from
878 input. Check for BLX use after attributes section merging.
879 Fix __exidx_start and __exidx_end visibility. Create an
880 .ARM.attributes section if necessary.
881 (Target_arm::get_secondary_compatible_arch,
882 Target_arm::set_secondary_compatible_arch,
883 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
884 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
885 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
886 New method definitions.
887
b59befec
ILT
8882009-12-09 Ian Lance Taylor <iant@google.com>
889
890 * plugin.cc (Plugin::load): Don't cast from void* to a function
891 pointer.
892
1276bc89
ILT
8932009-12-09 Ian Lance Taylor <iant@google.com>
894
895 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
896 information fields.
897
2f2de248
L
8982009-12-09 H.J. Lu <hongjiu.lu@intel.com>
899
900 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
901 Replace two_file_shared_1.so with two_file_shared_2.so.
902 * testsuite/Makefile.in: Regenerated.
903
4f787271
DK
9042009-12-08 Doug Kwan <dougkwan@google.com>
905
906 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
907 (HFILES): Add attributes.h and int_encoding.h.
908 * Makefile.in: Regenerate.
909 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
910 function definitions to int_encoding.cc
911 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
912 prototypes to int_encoding.h
913 * reduced_debug_output.cc (int_encoding.h): New include.
914 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
915 function definitions to int_encoding.cc
916 (insert_into_vector, read_from_pointer): Move template definitions to
917 int_encoding.h
918 * attributes.cc: New file.
919 * attributes.h: New file.
920 * int_encoding.cc: New file.
921 * int_encoding.h: New file.
922
20b52f1a
RÁE
9232009-12-07 Rafael Avila de Espindola <espindola@google.com>
924
925 PR gold/11055
926 * incremental-dump.cc (dump_incremental_inputs): New.
927 (main): Use dump_incremental_inputs.
928
53d7974c
L
9292009-12-07 H.J. Lu <hongjiu.lu@intel.com>
930
931 PR gold/10893
932 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
933 checking elfcpp::STT_FUNC.
934 (Target_i386::Relocate::relocate): Likewise.
935 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
936
937 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
938 symbols from shared libraries into normal FUNC symbols.
939
940 * symtab.h (Symbol): Add is_func and use it.
941
05a352e6
DK
9422009-12-05 Doug Kwan <dougkwan@google.com>
943
944 * arm.cc (Target_arm::arm_info): Initialize new fields
945 attributes_section and attributes_vendor.
946 * i386.cc (Target_i386::i386_info): Same.
947 * object.cc (Sized_relobj::do_layout): Skip attribute section.
948 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
949 fields attributes_section and attributes_vendor.
53d7974c 950 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
951 * target.h (Target::attributes_section, Target::attributes_vendor,
952 Target::is_attributes_section, Target::attribute_arg_type,
953 Target::attributes_order): New method definitions.
954 (Target::Target_info::attributes_section,
955 Target::Target_info::attributes_vendor): New fields.
956 (Target::do_attribute_arg_type, Target::do_attributes_order): New
957 virtual method definitions.
958 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
959 attributes_section and attributes_vendor.
960 * testsuite/testfile.cc (Target_test::test_target_info): Same.
961
f4e5969c
DK
9622009-12-05 Doug Kwan <dougkwan@google.com>
963
964 * arm.cc: Update comments about interworking and stub generation.
965 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
966 considered as non-PIC.
967 (Arm_relocate_functions::base_abs): Fix formatting.
968 (Arm_relocate_functions::got_prel): Fix comment. Change interface
969 of function to use GOT entry address instead of offset.
970 (Target_arm::Scan::global): Issue an error if a symbol would need a
971 PLT does not get one because it is untyped. Remove code to create
972 dynamic symbols for relative branches.
973 (Target_arm::Relocate::relocate: Use 0 instead of false since function
974 takes unsigned integer instead of boolean.
975
1abce4a6
L
9762009-12-05 H.J. Lu <hongjiu.lu@intel.com>
977
978 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
979 (two_file_test_LDADD): Likewise.
980 (common_test_1_LDADD): Likewise.
981 (exception_test_LDADD) Likewise.
982 (weak_test_LDADD): Likewise.
983 (many_sections_test_LDADD): Likewise.
984 (initpri1_LDADD): Likewise.
985 (script_test_1_LDADD): Likewise.
986 (script_test_2_LDADD): Likewise.
987 (justsyms_LDADD): Likewise.
988 (binary_test_LDADD): Likewise.
989 (large_LDADD): Likewise.
990 * testsuite/Makefile.in: Regenerated.
991
adcf2816 9922009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 993
adcf2816
L
994 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
995 (Symbol_table::override_with_special): Likewise.
996 (Symbol_table::add_from_object): Likewise.
997
28e67f5d
RÁE
9982009-12-04 Rafael Avila de Espindola <espindola@google.com>
999
1000 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
1001 Don't set the data_offset twice.
1002
ae10a101
RÁE
10032009-12-04 Rafael Avila de Espindola <espindola@google.com>
1004
1005 * testsuite/Makefile.in: Regenerate.
1006
f59f41f3
DK
10072009-12-03 Doug Kwan <dougkwan@google.com>
1008
1009 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
1010 (Target_arm::do_finalize_sections): Add parameter for symbol table
1011 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
1012 * i386.cc (Target_i386::do_finalize_sections): Add an additional
1013 parameter for symbol table pointer.
1014 * layout.cc (Layout::finalize): Call Target::finalize_sections with
1015 an additional parameter for a pointer to symbol table.
1016 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
1017 parameter for a symbol table pointer.
1018 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
1019 * target.h (Target::finalize_sections, Target::do_finalize_sections):
1020 Ditto.
1021 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
1022 parameter for a symbol table pointer.
1023
ca55d848
RÁE
10242009-12-03 Rafael Avila de Espindola <espindola@google.com>
1025
1026 * incremental.cc (Incremental_inputs_header)
1027 (Incremental_inputs_header_write, Incremental_inputs_entry)
1028 (Incremental_inputs_entry_write): Move ...
1029 * incremental.h (Incremental_inputs_header)
1030 (Incremental_inputs_header_write, Incremental_inputs_entry)
1031 (Incremental_inputs_entry_write): here.
1032
3aec4f9c
RÁE
10332009-12-02 Rafael Avila de Espindola <espindola@google.com>
1034
1035 * incremental.cc (make_sized_incremental_binary): Set the target.
1036 Error if it is incompatible.
1037 * output.h (Output_file): Add filename method.
1038
9c0ae74d
RÁE
10392009-12-02 Rafael Avila de Espindola <espindola@google.com>
1040
1041 * incremental.cc (Incremental_inputs_entry): Remove unused argument
1042 from the get_* methods.
1043
a45500ae
RÁE
10442009-12-02 Rafael Avila de Espindola <espindola@google.com>
1045
1046 * incremental-dump.cc (main): Check that the offeset of a script is 0.
1047 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
1048 Write 0 for the data_offset of scripts.
1049
325e6408
RÁE
10502009-12-02 Rafael Avila de Espindola <espindola@google.com>
1051
1052 * testsuite/Makefile.am: Add the incremental_test.sh test.
1053 * testsuite/incremental_test.sh: New.
1054 * testsuite/incremental_test_1.c: New.
1055 * testsuite/incremental_test_2.c: New.
1056
954c3e2e
RÁE
10572009-12-01 Rafael Avila de Espindola <espindola@google.com>
1058
1059 * incremental-dump.cc (main): Fix typos.
1060
f8086623
RÁE
10612009-11-27 Rafael Avila de Espindola <espindola@google.com>
1062
1063 PR gold/11025
1064 * incremental-dump.cc (main): Use llu to print 64 bit values.
1065
3b0dd6ac
L
10662009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
1067 H.J. Lu <hongjiu.lu@intel.com>
1068
1069 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
1070 $(LIBDL).
1071 (incremental_dump_LDADD): Likewise.
1072 * Makefile.in: Regenerated.
1073
a6d1ef57
DK
10742009-11-25 Doug Kwan <dougkwan@google.com>
1075
1076 Revert:
1077
1078 2009-11-25 Doug Kwan <dougkwan@google.com>
1079
1080 * arm.cc (Target_arm::Target_arm): Move method definition
1081 outside of class definition. Add code to handle
1082 --target1-rel, --target1-abs and --target2= options.
1083 (Target_arm::get_reloc_reloc_type): Change method to be
1084 non-static and const.
1085 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
1086 New data member declaration.
1087 (Target_arm::Scan::local, Target_arm::Scan::global,
1088 Target_arm::Relocate::relocate,
1089 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
1090 Adjust call to Target_arm::get_real_reloc_type.
1091 (Target_arm::get_real_reloc_type): Use command line options
1092 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
1093 * options.h (--target1-rel, --target1-abs, --target2): New
1094 ARM-only options.
1095
50aeb7d4
DK
10962009-11-25 Doug Kwan <dougkwan@google.com>
1097
1098 * arm.cc (Target_arm::Target_arm): Move method definition outside of
1099 class definition. Add code to handle --target1-rel, --target1-abs
1100 and --target2= options.
1101 (Target_arm::get_reloc_reloc_type): Change method to be non-static
1102 and const.
1103 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
1104 member declaration.
1105 (Target_arm::Scan::local, Target_arm::Scan::global,
1106 Target_arm::Relocate::relocate,
1107 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
1108 call to Target_arm::get_real_reloc_type.
1109 (Target_arm::get_real_reloc_type): Use command line options to
1110 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
1111 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
1112 options.
1113
51938283
DK
11142009-11-25 Doug Kwan <dougkwan@google.com>
1115
1116 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
1117 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
1118 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
1119 formatting.
1120 (Arm_relocate_functions::thm_call): Replace body with a call to
1121 Arm_relocate_functions::thumb_branch_common.
1122 (Arm_relocate_functions::thm_jump24,
1123 Arm_relocate_functions::thm_xpc22): New method definitions.
1124 (Arm_relocate_functions::thumb_branch_common): New method definition.
1125 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
1126 operator.
1127 (Target_arm::Relocate::relocate): Adjust call to thm_call.
1128 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
1129
e2b8f3c4
RÁE
11302009-11-24 Rafael Avila de Espindola <espindola@google.com>
1131
1132 * Makefile.am: Build incremental-dump
1133 * Makefile.in: Regenerate.
1134 * incremental-dump.cc: New.
1135 * incremental.cc (Incremental_inputs_header_data,
1136 Incremental_inputs_entry_data): Move to incremental.h
1137 * incremental.h: (Incremental_inputs_header_data,
1138 Incremental_inputs_entry_data): Move from incremental.cc
1139
bcba9aec
RÁE
11402009-11-24 Rafael Avila de Espindola <espindola@google.com>
1141
1142 * incremental.cc (Incremental_inputs_header,
1143 Incremental_inputs_header_write, Incremental_inputs_entry,
1144 Incremental_inputs_entry_write): Add a typedef with the data type.
1145
7c3afe08
RÁE
11462009-11-24 Rafael Avila de Espindola <espindola@google.com>
1147
1148 * incremental.cc (Incremental_inputs_header,
1149 Incremental_inputs_header_write, Incremental_inputs_entry,
1150 Incremental_inputs_entry_write): Update comment about which
1151 type has the filed descriptions.
1152
d204b6e9
DK
11532009-11-15 Doug Kwan <dougkwan@google.com>
1154
1155 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
1156 (Arm_relocate_functions::arm_branch_common): Change method defintion
1157 in class definition to a method declaration and update list of formal
1158 parameters.
1159 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
1160 Arm_relocation_functions::jump24): Adjust call to
1161 Arm_relocate_functions::arm_branch_common. Update list of formal
1162 parameters.
1163 (Arm_relocate_functions::xpc25): New method definition.
1164 (Arm_relocate_functions::arm_branch_common): Move method defintion
1165 out from class definition. Use stubs for mode-switching and extending
1166 branch ranges.
1167 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
1168 specially. Change code to enable use of stubs in ARM branches.
1169
43d12afe
DK
11702009-11-10 Doug Kwan <dougkwan@google.com>
1171
1172 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
1173 in method declaration.
1174 (Target_arm::relocate_stub): New method declaration.
1175 (Target_arm::default_target): Change to return a pointer instead of
1176 a const reference.
1177 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
1178 Target_arm::default_target.
1179 (Arm_Relobj::do_relocate_sections): Remove options paramater in
1180 method definition.
1181 (Target_arm::relocate_section): Adjust view.
1182 (Target_arm::relocate_stub): New method definition.
1183
ac33a407
DK
11842009-11-10 Doug Kwan <dougkwan@google.com>
1185
1186 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
1187 a format warning.
1188 * incremental.cc (open_incremental_binary): Initialized local
1189 variables to avoid warnings.
1190 * object.cc (make_elf_object): Ditto.
1191 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
1192 a format warning.
1193
88ee28e9
L
1194009-11-09 H.J. Lu <hongjiu.lu@intel.com>
1195
1196 PR gold/10930
1197 * testsuite/plugin_test.c: Include "config.h".
1198
2daedcd6
DK
11992009-11-09 Doug Kwan <dougkwan@google.com>
1200
1201 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
1202 (arm_symbol_value): Remove.
1203 (Arm_relocate_functions::arm_branch_common,
1204 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
1205 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
1206 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
1207 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
1208 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
1209 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
1210 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
1211 Arm_relocate_functions::thm_mobw_abs_nc,
1212 Arm_relocate_functions::thm_mov_abs,
1213 Arm_relocate_functions::movw_prel_nc,
1214 Arm_relocate_functions::thm_movt_abs,
1215 Arm_relocate_functions::movt_prel,
1216 Arm_relocate_functions::thm_movw_prel_nc,
1217 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
1218 (Target_arm::Relocate::relocate): Only decompose address into two
1219 parts if relocation type uses the thumb-bit and pass the actual
1220 bit instead of a flag indicating that the thumb-bit is used. Adjust
1221 calls to methods in Arm_relocate_functions for this change.
1222
1276bc89 12232009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
1224
1225 PR 10925
1226 * reloc.cc: Instantiate
1227 Sized_relobj::initialize_input_to_output_maps and
1228 Sized_relobj:free_input_to_output_maps.
1229
e53ad1b5
ILT
12302009-11-06 Ian Lance Taylor <iant@google.com>
1231
1232 PR 10876
1233 * defstd.cc (in_segment): Set only_if_ref true for "end".
1234
eb44217c
DK
12352009-11-06 Doug Kwan <dougkwan@google.com>
1236
1237 * arm.cc (class Reloc_stub): Correct a comment.
1238 (Target_arm::Target_arm): Initialize arm_input_section_map_.
1239 (Target_arm::scan_section_for_stubs): New method declaration.
1240 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
1241 Change methods from private to protected.
1242 (Target_arm::do_may_relax): New method definition.
1243 (Target_arm::do_relax, Target_arm::group_sections,
1244 Target_arm::scan_reloc_for_stub,
1245 Target_arm::scan_reloc_section_for_stubs): New method declarations.
1246 (Target_arm::arm_input_section_map_): New data member declaration.
1247 (Target_arm::scan_reloc_for_stub,
1248 Target_arm::scan_reloc_section_for_stubs,
1249 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
1250 Target_arm::do_relax): New method definitions.
1251
5d329b7d
ILT
12522009-11-06 Mikolaj Zalewski <mikolaj@google.com>
1253
1254 * configure.ac: Check for (struct stat)::st_mtim
1255 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
1256 * config.in: Regenerate.
1257 * configure: Regenerate.
1258
96a0d71b
ILT
12592009-11-05 Ian Lance Taylor <iant@google.com>
1260
1261 PR 10910
1262 * output.cc (Output_segment::add_output_section): Add missing
1263 return statement.
1264
594c8e5e
ILT
12652009-11-04 Ian Lance Taylor <iant@google.com>
1266
1267 PR 10880
1268 * object.h (class Object): Add is_needed and set_is_needed
1269 methods. Add is_needed_ field. Make bool fields into bitfields.
1270 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
1271 defined in a dynamic object and referenced by a regular object,
1272 set is_needed for the dynamic object.
1273 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
1274 if the file is marked with as_needed and it is not needed.
1275
22b127cc
ILT
12762009-11-04 Ian Lance Taylor <iant@google.com>
1277
1278 PR 10887
1279 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
1280 tags if data is discarded by linker script.
1281 * i386.cc (Target_i386::do_finalize_sections): Likewise.
1282 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
1283 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
1284 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1285
f5c870d2
ILT
12862009-11-04 Ian Lance Taylor <iant@google.com>
1287
1288 * layout.cc (Layout::get_output_section): Add is_interp and
1289 is_dynamic_linker_section parameters. Change all callers.
1290 (Layout::choose_output_section): Likewise.
1291 (Layout::make_output_section): Likewise.
1292 (Layout::add_output_section_data): Add is_dynamic_linker_section
1293 parameter. Change all callers.
1294 * layout.h (class Layout): Update declarations.
1295 * output.h (class Output_section): Add is_interp, set_is_interp,
1296 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
1297 Add is_interp_, is_dynamic_linker_section_ fields. Change
1298 generate_code_fills_at_write_ to a bitfield.
1299 * output.cc (Output_section::Output_sections): Initialize new
1300 fields.
1301 (Output_segment::add_output_section): Add do_sort parameter.
1302 Change all callers.
1303
1ae4d23b
ILT
13042009-11-03 Ian Lance Taylor <iant@google.com>
1305
1306 PR 10860
1307 * options.h (class General_options): Add --warn-common.
1308 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
1309 merging two common symbols.
1310 (Symbol_table::should_override): Handle --warn-common when merging
1311 a common symbol with a defined symbol. Use report_resolve_problem
1312 for multiple definitions.
1313 (Symbol_table::report_resolve_problem): New function.
1314 * symtab.h (class Symbol_table): Declare report_resolve_problem.
1315
55da9579
DK
13162009-11-03 Doug Kwan <dougkwan@google.com>
1317
1318 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
1319 stub_factory_.
1320 (Target_arm::stub_factory): New method definition.
1321 (Target_arm::new_arm_input_section,
1322 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
1323 Target_arm::reloc_uses_thumb_bit): New method declarations.
1324 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
1325 New type definitions.
1326 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
1327 member declarations.
1328 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
1329 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
1330 New method definitions.
1331
37a9ac43
ILT
13322009-11-03 Ian Lance Taylor <iant@google.com>
1333
1334 * options.h (class General_options): Add --warn_constructors.
1335
b3d6a3d4
ILT
13362009-11-03 Ian Lance Taylor <iant@google.com>
1337
1338 PR 10893
1339 * defstd.cc (in_section): Add entries for __rel_iplt_start,
1340 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
1341
934b01dd
ILT
13422009-11-03 Ian Lance Taylor <iant@google.com>
1343
1344 PR 10895
1345 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
1346 --msgid-bugs-address.
1347 (install-pdf): New target.
1348 (install-data_yes): Look up one directory to find mkinstalldirs.
1349
03c1939b
L
13502009-11-03 H.J. Lu <hongjiu.lu@intel.com>
1351
1352 * po/Make-in (.po.gmo): Don't generate .gmo files in source
1353 tree.
1354
ebd95253
DK
13552009-10-30 Doug Kwan <dougkwan@google.com>
1356
1357 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
1358
e9bbb538
DK
13592009-10-30 Doug Kwan <dougkwan@google.com>
1360
1361 * arm.cc (Stub_addend_reader): New struct template definition
1362 and partial specializations.
1363 (Stub_addend_reader::operator()): New method definition for a
1364 partially specialized template.
1365
d5b40221
DK
13662009-10-30 Doug Kwan <dougkwan@google.com>
1367
1368 * arm.cc (Arm_relobj::processor_specific_flags): New method
1369 definition.
1370 (Arm_relobj::do_read_symbols): New method declaration.
1371 (Arm_relobj::processor_specific_flags_): New data member declaration.
1372 (Arm_dynobj): New class definition.
1373 (Target_arm::do_finalize_sections): Add input_objects parameter.
1374 (Target_arm::do_adjust_elf_header): New method declaration.
1375 (Target_arm::are_eabi_versions_compatible,
1376 (Target_arm::merge_processor_specific_flags): New method declaration.
1377 (Target_arm::do_make_elf_object): New overloaded method definitions
1378 and declaration.
1379 (Arm_relobj::do_read_symbols): New method definition.
1380 (Arm_dynobj::do_read_symbols): Ditto.
1381 (Target_arm::do_finalize_sections): Add input_objects parameters.
1382 Merge processor-specific flags from all input objects.
1383 (Target_arm::are_eabi_versions_compatible,
1384 Target_arm::merge_processor_specific_flags,
1385 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
1386 New method definitions.
1387 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
1388 Input_objects pointer type parameter.
1389 * layout.cc (Layout::finalize): Pass input objects to target's.
1390 finalize_sections function.
1391 * output.cc (Output_file_header::do_sized_write): Set ELF file
1392 header's processor-specific flags.
1393 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
1394 Input_objects pointer type parameter.
1395 * sparc.cc (Target_sparc::do_finalize_sections): Same.
1396 * target.h (Input_objects): New forward class declaration.
1397 (Target::processor_specific_flags,
1398 Target::are_processor_specific_flags_sect): New method definitions.
1399 (Target::finalize_sections): Add input_objects parameter.
1400 (Target::Target): Initialize processor_specific_flags_ and
1401 are_processor_specific_flags_set_.
1402 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
1403 parameter.
1404 (Target::set_processor_specific_flags): New method definition.
1405 (Target::processor_specific_flags_,
1406 Target::are_processor_specific_flags_set_): New data member
1407 declarations.
1408 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
1409 Input_objects pointer type parameter.
1410
ebabffbd
DK
14112009-10-30 Doug Kwan <dougkwan@google.com>
1412
1413 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
1414
ad0f2072
ILT
14152009-10-28 Ian Lance Taylor <iant@google.com>
1416
1417 * object.h (class Relobj): Drop options parameter from
1418 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
1419 do_scan_relocs, do_relocate. Change all callers.
1420 (class Sized_relobj): Drop options parameters from
1421 do_gc_process_relocs, do_scan_relocs, do_relocate,
1422 do_relocate_sections, relocate_sections, emit_relocs_scan,
1423 emit_relocs_scan_reltype. Change all callers.
1424 (struct Relocate_info): Remove options field and all references to
1425 it.
1426 * reloc.h (class Read_relocs): Remove options constructor
1427 parameter and options_ field. Change all callers.
1428 (class Gc_process_relocs, class Scan_relocs): Likewise.
1429 (class Relocate_task): Likewise.
1430 * target-reloc.h (scan_relocs): Remove options parameter. Change
1431 all callers.
1432 (scan_relocatable_relocs): Likewise.
1433 * target.h (class Sized_target): Remove options parameter from
1434 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
1435 all callers.
1436 * gc.h (gc_process_relocs): Remove options parameter. Change all
1437 callers.
1438 * arm.cc: Update functions to remove options parameters.
1439 * i386.cc: Likewise.
1440 * powerpc.cc: Likewise.
1441 * sparc.cc: Likewise.
1442 * x86_64.cc: Likewise.
1443 * testsuite/testfile.cc: Likewise.
1444
8ffa3667
DK
14452009-10-28 Doug Kwan <dougkwan@google.com>
1446
1447 * arm.cc (Arm_relobj): New class definition.
1448 (Arm_relobj::scan_sections_for_stubs,
1449 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
1450 New method definitions.
1451
40f36857
CC
14522009-10-28 Cary Coutant <ccoutant@google.com>
1453
1454 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
1455 (Plugin::cleanup_done_): New member.
1456 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
1457 (Plugin_manager::cleanup_done_): Remove.
1458 (Plugin_manager::add_input_file): Edit error message.
1459 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
1460 (Plugin_manager::cleanup): Remove use of cleanup_done_.
1461
2c849493
ILT
14622009-10-27 Mikolaj Zalewski <mikolajz@google.com>
1463
1464 * fileread.cc: (File_read::View::~View): Use the new
1465 data_ownership_ filed.
1466 (File_read::~File_read): Dispose the new whole_file_view_.
1467 (File_read::open): Mmap the whole file if needed.
1468 (File_read::open): Use whole_file_view_ instead of contents_.
1469 (File_read::find_view): Use whole_file_view_ if applicable.
1470 (File_read::do_read): Use whole_file_view_ instead of contents_.
1471 (File_read::make_view): Use whole_file_view_ instead of contents_,
1472 update File_read::View::View call.
1473 (File_read::find_or_make_view): Update File_read::View::View
1474 call.
1475 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
1476 remove contents_
1477 (File_read::View::Data_ownership): New enum.
1478 (File_read::View::View): Replace bool mapped_ with Data_ownership
1479 argument.
1480 (File_read::View::mapped_): Remove (replaced by data_ownership_).
1481 (File_read::View::data_ownership_): New field.
1482 (File_read::contents_): Remove (replaced by whole_file_view_).
1483 (File_read::whole_file_view_): New field.
1484 * options.h (class General_options): Add --keep-files-mapped.
1485
24998053
CC
14862009-10-27 Cary Coutant <ccoutant@google.com>
1487
1488 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
1489 * testsuite/Makefile.am (plugin_test_5): New test case.
1490 * testsuite/Makefile.in: Regenerate.
1491
72adc4fa
DK
14922009-10-25 Doug Kwan <dougkwan@google.com>
1493
1494 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
1495 from private to protected to allow access by child class.
1496 (Sized_relobj::do_relocate_sections): New method declaration.
1497 (Sized_relobj::relocate_sections): Virtualize.
1498 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
1499 Sized_relobj::relocate_sections. Instantiate template explicitly
1500 for different target sizes and endianity.
1501
07f508a2
DK
15022009-10-24 Doug Kwan <dougkwan@google.com>
1503
1504 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
1505 (Arm_input_section::as_arm_input_section): New method.
1506 (Arm_output_section): New class definition.
1507 (Arm_output_section::create_stub_group,
1508 Arm_output_section::group_sections): New method definitions.
1509
10ad9fe5
DK
15102009-10-22 Doug Kwan <dougkwan@google.com>
1511
1512 * arm.cc (Arm_input_section): New class definition.
1513 (Arm_input_section::init, Arm_input_section:do_write,
1514 Arm_input_section::set_final_data_size,
1515 Arm_input_section::do_reset_address_and_file_offset): New method
1516 definitions.
1517
56ee5e00
DK
15182009-10-21 Doug Kwan <dougkwan@google.com>
1519
1520 * arm.cc (Stub_table, Arm_input_section): New forward class
1521 declarations.
1522 (Stub_table): New class defintion.
1523 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
1524 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
1525 New method definition.
1526
b569affa
DK
15272009-10-21 Doug Kwan <dougkwan@google.com>
1528
1529 * arm.cc: Update copyright comments.
1530 (Target_arm): New forward class template declaration.
1531 (Arm_address): New type.
1532 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
1533 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
1534 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
1535 constants.
1536 (Insn_template): Same.
1537 (DEF_STUBS): New macro.
1538 (Stub_type): New enum type.
1539 (Stub_template): New class definition.
1540 (Stub): Same.
1541 (Reloc_stub): Same.
1542 (Stub_factory): Same.
1543 (Target_arm::Target_arm): Initialize may_use_blx_ and
1544 should_force_pic_veneer_.
1545 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
1546 Target_arm::should_force_pic_veneer,
1547 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
1548 Target_arm::using_thumb_only, Target_arm:;default_target): New
1549 method defintions.
1550 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
1551 New data member declarations.
1552 (Insn_template::size, Insn_template::alignment): New method defintions.
1553 (Stub_template::Stub_template): New method definition.
1554 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
1555 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
1556 (Stub_factory::Stub_factory): New method definition.
1557 * gold.h (string_hash): New template.
1558 * output.h (Input_section_specifier::hash_value): Use
1559 gold::string_hash.
1560 (Input_section_specifier::string_hash): Remove.
1561 * stringpool.cc (Stringpool_template::string_hash): Use
1562 gold::string_hash.
1563
6c172549
DK
15642009-10-20 Doug Kwan <dougkwan@google.com>
1565
1566 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
1567 symbols of relaxed input sections.
1568 * output.h (Output_section::find_relaxed_input_section): Make
1569 method public.
1570
c5617f2f
DK
15712009-10-16 Doug Kwan <dougkwan@google.com>
1572
1573 * dynobj.cc (Versions::Versions): Initialize version_script_.
1574 Only insert base version symbol definition for a shared object
1575 if version script defines any version versions.
1576 (Versions::define_base_version): New method definition.
1577 (Versions::add_def): Check that base version is not needed.
1578 (Versions::add_need): Define base version lazily.
1579 * dynobj.h (Versions::define_base_version): New method declaration.
1580 (Versions::needs_base_version_): New data member declaration.
1581 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
1582 (check_DATA): Add no_version_test.stdout.
1583 (libno_version_test.so, no_version_test.o no_version_test.stdout):
1584 New make rules.
1585 * testsuite/Makefile.in: Regenerate.
1586 * testsuite/no_version_test.c: New file.
1587 * testsuite/no_version_test.sh: Ditto.
1588
3c12dcdb
DK
15892009-10-16 Doug Kwan <dougkwan@google.com>
1590
1591 * expression.cc (class Segment_start_expression): New class definition.
1592 (Segment_start_expression::value): New method definition.
1593 (script_exp_function_segment_start): Return a new
1594 Segment_start_expression.
1595 * gold/script-c.h (script_saw_segment_start_expression): New function
1596 prototype.
1597 * script-sections.cc (Script_sections::Script_sections): Initialize
1598 SAW_SEGMENT_START_EXPRESSION_ to false.
1599 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
1600 and -Tbbs options to specify section addresses if given in
1601 command line and no SEGMENT_START expression is seen in a script.
1602 * script-sections.h (Script_sections::saw_segment_start_expression,
1603 Script_sections::set_saw_segment_start_expression): New method
1604 definition.
1605 (Script_sections::saw_segment_start_expression_): New data member
1606 declaration.
1607 * script.cc (script_saw_segment_start_expression): New function.
1608 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
1609 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
1610 script_test_7.sh and script_test_8.sh.
1611 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
1612 script_test_8.stdout.
1613 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
1614 (script_test_6, script_test_6.stdout, script_test_7,
1615 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
1616 * Makefile.in: Regenerate.
1617 * testsuite/script_test_6.sh: New file.
1618 * testsuite/script_test_6.t: Same.
1619 * testsuite/script_test_7.sh: Same.
1620 * testsuite/script_test_7.t: Same.
1621 * testsuite/script_test_8.sh: Same.
1622
64b1ae37
DK
16232009-10-16 Doug Kwan <dougkwan@google.com>
1624
1625 * output.cc (Output_segment::set_section_list_address): Cast
1626 expressions to unsigned long long type to avoid format warnings.
1627
661be1e2
ILT
16282009-10-15 Ian Lance Taylor <iant@google.com>
1629
12edd763 1630 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 1631 dot assignment to script_sections_.
12edd763
ILT
1632 * script-sections.cc (Script_sections::add_dot_assignment):
1633 Initialize if necessary.
1634
68b6574b
ILT
1635 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
1636 program headers with no load segment if there is a linker script.
1637
661be1e2
ILT
1638 * layout.cc (Layout::set_segment_offsets): Align the file offset
1639 to the segment aligment for -N or -n with no load segment.
1640 * output.cc (Output_segment::add_output_section): Don't crash if
1641 the first section is a TLS section.
1642 (Output_segment::set_section_list_addresses): Print an error
1643 message if the address moves backward in a linker script.
1644 * script-sections.cc
1645 (Output_section_element_input::set_section_addresses): Don't
1646 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
1647 (Orphan_output_section::set_section_addresses): Likewise.
1648
f15f61a7
DK
16492009-10-15 Doug Kwan <dougkwan@google.com>
1650
1651 * layout.cc (Layout::finish_dynamic_section): Generate tags
1652 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
1653 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
1654 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
1655
82bb573a
ILT
16562009-10-14 Ian Lance Taylor <iant@google.com>
1657
1658 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
1659 fields.
1660 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
1661 data_shdr fields of relinfo.
1662 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
1663 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
1664 R_386_TLS_LDO_32, adjust based on section flags.
1665 (Target_i386::Relocate::fix_up_ldo): Remove.
1666
374ad285
ILT
16672009-10-13 Ian Lance Taylor <iant@google.com>
1668
1669 Add support for -pie.
1670 * options.h (class General_options): Add -pie and
1671 --pic-executable.
1672 (General_options::output_is_position_independent): Test -pie.
1673 (General_options::output_is_executable): Return true if not shared
1674 and not relocatable.
1675 (General_options::output_is_pie): Remove.
1676 * options.cc (General_options::finalize): Reject incompatible uses
1677 of -pie.
1678 * gold.cc (queue_middle_tasks): A -pie link is not static.
1679 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
1680 * symtab.cc (Symbol::final_value_is_known): Return false if
1681 output_is_position_independent.
1682 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
1683 output_is_position_independent.
1684 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
1685 output_is_position_independent.
1686 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
1687 output_is_position_independent.
1688 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
1689 two_file_pie_test.
1690 (basic_pie_test.o, basic_pie_test): New targets.
1691 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
1692 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
1693 (two_file_pie_test): New target.
1694 * testsuite/Makefile.in: Rebuild.
1695 * README: Remove note saying that -pie is not supported.
1696
c6585162
ILT
16972009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1698
1699 * options.h (class General_options): Add -init and -fini.
1700 * layout.cc (Layout::finish_dynamic_section): Emit
1701 given init and fini functions.
1702
032ce4e9
ST
17032009-10-13 Sriraman Tallam <tmsriram@google.com>
1704
1705 * gc.h (gc_process_relocs): Check if icf is enabled using new
1706 function.
1707 * gold.cc (queue_initial_tasks): Likewise.
1708 (queue_middle_tasks): Likewise.
1709 * object.cc (do_layout): Likewise.
1710 * symtab.cc (is_section_folded): Likewise.
1711 * main.cc (main): Likewise.
1712 * reloc.cc (Read_relocs::run): Likewise.
1713 (Sized_relobj::do_scan_relocs): Likewise.
1714 * icf.cc (is_function_ctor_or_dtor): New function.
1715 (Icf::find_identical_sections): Check if function is ctor or dtor when
1716 safe icf is chosen.
1717 * options.h (General_options::icf): Change option to be an enum.
1718 (Icf_status): New enum.
1719 (icf_enabled): New method.
1720 (icf_safe_folding): New method.
1721 (set_icf_status): New method.
1722 (icf_status_): New variable.
1723 * (options.cc) (General_options::finalize): Set icf_status_.
1724 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
1725 icf_test and icf_keep_unique_test to use the --icf enum flag.
1726 * testsuite/icf_safe_test.sh: New file.
1727 * testsuite/icf_safe_test.cc: New file.
1728
f345227a
ST
17292009-10-12 Sriraman Tallam <tmsriram@google.com>
1730
1731 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
1732 includes to gc.h and icf.h.
1733 * arm.cc: Include gc.h.
1734 * gold.cc: Likewise.
1735 * i386.cc: Likewise.
1736 * powerpc.cc: Likewise.
1737 * sparc.cc: Likewise.
1738 * x86_64.cc: Likewise.
1739 * gc.h: Include icf.h.
1740
1c7814ed
ILT
17412009-10-11 Ian Lance Taylor <iant@google.com>
1742
1743 * plugin.cc: Include "gold.h" before other header files.
1744
ae3b5189
CD
17452009-10-10 Chris Demetriou <cgd@google.com>
1746
1747 * options.h (Input_file_argument::Input_file_type): New enum.
1748 (Input_file_argument::is_lib_): Replace with...
1749 (Input_file_argument::type_): New member.
1750 (Input_file_argument::Input_file_argument): Take Input_file_type
1751 'type' rather than boolean 'is_lib' as second argument.
1752 (Input_file_argument::is_lib): Use type_.
1753 (Input_file_argument::is_searched_file): New function.
1754 (Input_file_argument::may_need_search): Handle is_searched_file.
1755 * options.cc (General_options::parse_library): Support -l:filename.
1756 (General_options::parse_just_symbols): Update for Input_file_argument
1757 changes.
1758 (Command_line::process): Likewise.
1759 * archive.cc (Archive::get_file_and_offset): Likewise.
1760 * plugin.cc (Plugin_manager::release_input_file): Likewise.
1761 * script.cc (read_script_file, script_add_file): Likewise.
1762 * fileread.cc (Input_file::Input_file): Likewise.
1763 (Input_file::will_search_for): Handle is_searched_file.
1764 (Input_file::open): Likewise.
1765 * readsyms.cc (Read_symbols::get_name): Likewise.
1766 * testsuite/Makefile.am (searched_file_test): New test.
1767 * testsuite/Makefile.in: Regenerate.
1768 * testsuite/searched_file_test.cc: New file.
1769 * testsuite/searched_file_test_lib.cc: New file.
1770
f3048a1d
ILT
17712009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1772 Ian Lance Taylor <iant@google.com>
1773
1774 * descriptor.cc: Include <cstdio> and "binary-io.h".
1775 (Descriptors::open): Open the files in binary mode always.
1776 * script.cc (Lex::get_token): Treat \r as whitespace.
1777
d4780e57
ILT
17782009-10-09 Ian Lance Taylor <iant@google.com>
1779
1780 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
1781
d9a893b8
ILT
17822009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1783 Ian Lance Taylor <iant@google.com>
1784
1785 * configure.ac: Check for readv function also.
1786 * fileread.cc (readv): Define if not HAVE_READV.
1787 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
1788 does not exist.
1789 * config.in: Regenerate.
1790 * configure: Regenerate.
1791
c0a62865
DK
17922009-10-09 Doug Kwan <dougkwan@google.com>
1793
1794 * layout.cc (Layout::make_output_section): Call target hook to make
1795 ordinary output section.
1796 (Layout::finalize): Adjust parameter list of call the
1797 Target::may_relax().
1798 * layout.h (class Layout::section_list): New method.
1799 * merge.h (Output_merge_base::entsize): Change visibility to public.
1800 (Output_merge_base::is_string, Output_merge_base::do_is_string):
1801 New methods.
1802 (Output_merge_string::do_is_string): New method.
1803 * object.cc (Sized_relobj::do_setup): renamed from
1804 Sized_relobj::set_up.
1805 * object.h (Sized_relobj::adjust_shndx,
1806 Sized_relobj::initializ_input_to_output_maps,
1807 Sized_relobj::free_input_to_output_maps): Change visibilities to
1808 protected.
1809 (Sized_relobj::setup): Virtualize.
1810 (Sized_relobj::do_setup): New method declaration.
1811 (Sized_relobj::invalidate_section_offset,
1812 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
1813 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
1814 * options.cc (parse_int): New function.
1815 * options.h (parse_int): New declaration.
1816 (DEFINE_int): New macro.
1817 (stub_group_size): New option.
1818 * output.cc (Output_section::Output_section): Initialize memebers
1819 merge_section_map_, merge_section_by_properties_map_,
1820 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
1821 (Output_section::add_input_section): Handled deferred code-fill
1822 generation and remove an old comment.
1823 (Output_section::add_relaxed_input_section): New method definition.
1824 (Output_section::add_merge_input_section): Use merge section by
1825 properties map to speed to search. Update merge section maps
1826 as appropriate.
1827 (Output_section::build_relaxation_map): New method definition.
1828 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1829 Same.
1830 (Output_section::relax_input_section): Renamed to
1831 Output_section::convert_input_sections_to_relaxed_sections and change
1832 interface to take a vector of pointers to relaxed sections.
1833 (Output_section::find_merge_section,
1834 Output_section::find_relaxed_input_section): New method definitions.
1835 (Output_section::is_input_address_mapped,
1836 Output_section::output_offset, Output_section::output_address):
1837 Use output section data maps to speed up searching.
1838 (Output_section::find_starting_output_address): Add comments.
1839 (Output_section::do_write,
1840 Output_section::write_to_postprocessing_buffer): Do code-fill
1841 generation as appropriate.
1842 (Output_section::get_input_sections): Invalidate relaxed input section
1843 map.
1844 (Output_section::restore_states): Adjust type of checkpoint .
1845 Invalidate relaxed input section map.
1846 * output.h (Output_merge_base): New class declaration.
1847 (Input_section_specifier): New class defintion.
1848 (class Output_relaxed_input_section) Change base class to
1849 Output_section_data_build.
1850 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
1851 base class initializer.
1852 (Output_section::add_relaxed_input_section): New method declaration.
1853 (Output_section::Input_section): Change visibility to protected.
1854 (Output_section::Input_section::relobj,
1855 Output_section::Input_section::shndx): Handle relaxed input sections.
1856 Output_section::input_sections) Change visibility to protected. Also
1857 define overload to return a non-const pointer.
1858 (Output_section::Merge_section_properties): New class defintion.
1859 (Output_section::Merge_section_by_properties_map,
1860 Output_section::Output_section_data_by_input_section_map,
1861 Output_section::Relaxation_map): New types.
1862 (Output_section::relax_input_section): Rename method to
1863 Output_section::convert_input_sections_to_relaxed_sections and change
1864 interface to take a vector of relaxed section pointers.
1865 (Output_section::find_merge_section,
1866 Output_section::find_relaxed_input_section,
1867 Output_section::build_relaxation_map,
1868 Output_section::convert_input_sections_in_list_to_relaxed_sections):
1869 New method declarations.
1870 (Output_section::merge_section_map_
1871 Output_section::merge_section_by_properties_map_,
1872 Output_section::relaxed_input_section_map_,
1873 Output_section::is_relaxed_input_section_map_valid_,
1874 Output_section::generate_code_fills_at_write_): New data members.
1875 * script-sections.cc
1876 (Output_section_element_input::set_section_addresses): Call
1877 current_data_size and addralign methods of relaxed input sections.
1878 (Orphan_output_section::set_section_addresses): Call current_data_size
1879 and addralign methods of relaxed input sections.
1880 * symtab.cc (Symbol_table::compute_final_value): Extract template
1881 from the body of Symbol_table::sized_finalize_symbol.
1882 (Symbol_table::sized_finalized_symbol): Call
1883 Symbol_table::compute_final_value.
1884 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
1885 (Symbol_table::compute_final_value): New templated method declaration.
1886 * target.cc (Target::do_make_output_section): New method defintion.
1887 * target.h (Target::make_output_section): New method declaration.
1888 (Target::relax): Add more parameters for input objects, symbol table
1889 and layout. Adjust call to do_relax.
1890 (Target::do_make_output_section): New method declaration.
1891 (Target::do_relax): Add parameters for input objects, symbol table
1892 and layout.
1893
d446d6c4
ILT
18942009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1895
1896 * pread.c: Include stdio.h.
1897
bc06c745
ILT
18982009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1899
1900 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
1901 defined.
1902
75aea3d0
ILT
19032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1904
1905 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1906 Change read_shndx type to unsigned int.
1907 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
1908 int.
1909 (Sized_dwarf_line_info::read_line_mappings): Likewise.
1910 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
1911 Change read_shndx type to unsigned int.
1912 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
1913 int.
1914 (Sized_dwarf_line_info::read_line_mappings): Likewise.
1915 * layout.cc (Layout::create_symtab_sections): Cast the result of
1916 local_symcount * symsize to off_t in the gold_assert.
1917
be8fcb75
ILT
19182009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1919
1920 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
1921 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
1922 R_ARM_BASE_ABS.
1923 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
1924 (Arm_relocate_functions::thm_abs5): New function.
1925 (Arm_relocate_functions::abs12): New function.
1926 (Arm_relocate_functions::abs16): New function.
1927 (Arm_relocate_functions::base_abs): New function.
1928 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
1929 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
1930 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
1931 R_ARM_BASE_ABS.
1932 (Scan::global): Likewise.
1933 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
1934 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
1935 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
1936 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
1937 R_ARM_BASE_ABS.
1938
c2a122b6
ILT
19392009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1940
1941 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
1942 (Arm_relocate_functions::movt_prel): New function.
1943 (Arm_relocate_functions::thm_movw_prel_nc): New function.
1944 (Arm_relocate_functions::thm_movt_prel): New function.
1945 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
1946 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
1947 (Scan::global, Relocate::relocate): Likewise.
1948 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
1949
c4aa1e2d
ILT
19502009-10-09 Mikolaj Zalewski <mikolajz@google.com>
1951
1952 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
1953 Incremental_checker.
1954 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
1955 unsigned int.
1956 (class Incremental_inputs_header): New class.
1957 (Incremental_inputs_header_writer): Edit comment.
1958 (Incremental_inputs_entry): New class.
1959 (Incremental_inputs_entry_writer): Edit comment.
1960 (Sized_incremental_binary::do_find_incremental_inputs_section):
1961 Add *strtab_shndx parameter, fill it.
1962 (Sized_incremental_binary::do_check_inputs): New method.
1963 (Incremental_checker::can_incrementally_link_output_file): Use
1964 Sized_incremental_binary::check_inputs.
1965 (Incremental_inputs::report_command_line): Save command line in
1966 command_line_.
1967 * incremental.h:
1968 (Incremental_binary::find_incremental_inputs_section): New
1969 method.
1970 (Incremental_binary::do_find_incremental_inputs_section): Add
1971 strtab_shndx parameter.
1972 (Incremental_binary::do_check_inputs): New pure virtual method.
1973 (Sized_incremental_binary::do_check_inputs): Declare.
1974 (Incremental_checker::Incremental_checker): Add incremental_inputs
1975 parameter, use it to initialize incremental_inputs_.
1976 (Incremental_checker::incremental_inputs_): New field.
1977 (Incremental_checker::command_line): New method.
1978 (Incremental_checker::inputs): New method.
1979 (Incremental_checker::command_line_): New field.
1980
c549a694
ILT
19812009-10-09 Mikolaj Zalewski <mikolajz@google.com>
1982
1983 * incremental.cc: Include <cstdarg> and "target-select.h".
1984 (vexplain_no_incremental): New function.
1985 (explain_no_incremental): New function.
1986 (Incremental_binary::error): New method.
1987 (Sized_incremental_binary::do_find_incremental_inputs_section): New
1988 method.
1989 (make_sized_incremental_binary): New function.
1990 (open_incremental_binary): New function.
1991 (can_incrementally_link_file): Add checks if output is ELF and has
1992 inputs section.
1993 * incremental.h: Include "elfcpp_file.h" and "output.h".
1994 (Incremental_binary): New class.
1995 (Sized_incremental_binary): New class.
1996 (open_incremental_binary): Declare.
1997 * object.cc (is_elf_object): Use
1998 elfcpp::Elf_recognizer::is_elf_file.
1999 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
2000 * output.h (Output_file::filesize): New method.
2001
fd3c5f0b
ILT
20022009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2003
2004 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
2005 New function.
2006 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
2007 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
2008 function.
2009 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
2010 function.
2011 (Arm_relocate_functions::movw_abs_nc): New function.
2012 (Arm_relocate_functions::movt_abs): New function.
2013 (Arm_relocate_functions::thm_movw_abs_nc): New function.
2014 (Arm_relocate_functions::thm_movt_abs): New function.
2015 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
2016 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
2017 (Scan::global): Likewise.
2018 (Relocate::relocate): Likewise.
2019 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2020
7f5309a5
ILT
20212009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2022
2023 * arm.cc (Arm_relocate_functions::got_prel) New function.
2024 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
2025 (Relocate::relocate): Likewise.
2026 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2027
364c7fa5
ILT
20282009-10-06 Ian Lance Taylor <iant@google.com>
2029
2030 * options.h (class General_options): Define
2031 split_stack_adjust_size parameter.
2032 * object.h (class Object): Add uses_split_stack_ and
2033 has_no_split_stack_ fields. Add uses_split_stack and
2034 has_no_split_stack accessor functions. Declare
2035 handle_split_stack_section.
2036 (class Reloc_symbol_changes): Define.
2037 (class Sized_relobj): Define Function_offsets. Declare
2038 split_stack_adjust, split_stack_adjust_reltype, and
2039 find_functions.
2040 * object.cc (Object::handle_split_stack_section): New function.
2041 (Sized_relobj::do_layout): Call handle_split_stack_section.
2042 * dynobj.cc (Sized_dynobj::do_layout): Call
2043 handle_split_stack_section.
2044 * reloc.cc (Sized_relobj::relocate_sections): Call
2045 split_stack_adjust for executable sections in split_stack
2046 objects. Pass reloc_map to relocate_section.
2047 (Sized_relobj::split_stack_adjust): New function.
2048 (Sized_relobj::split_stack_adjust_reltype): New function.
2049 (Sized_relobj::find_functions): New function.
2050 * target-reloc.h: Include "object.h".
2051 (relocate_section): Add reloc_symbol_changes parameter. Change
2052 all callers.
2053 * target.h (class Target): Add calls_non_split method. Declare
2054 do_calls_non_split virtual method. Declare match_view and
2055 set_view_to_nop.
2056 * target.cc: Include "elfcpp.h".
2057 (Target::do_calls_non_split): New function.
2058 (Target::match_view): New function.
2059 (Target::set_view_to_nop): New function.
2060 * gold.cc (queue_middle_tasks): Give an error if mixing
2061 split-stack and non-split-stack objects with -r.
2062 * i386.cc (Target_i386::relocate_section): Add
2063 reloc_symbol_changes parameter.
2064 (Target_i386::do_calls_non_split): New function.
2065 * x86_64.cc (Target_x86_64::relocate_section): Add
2066 reloc_symbol_changes parameter.
2067 (Target_x86_64::do_calls_non_split): New function.
2068 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
2069 parameter.
2070 * powerpc.cc (Target_powerpc::relocate_section): Add
2071 reloc_symbol_changes parameter.
2072 * sparc.cc (Target_sparc::relocate_section): Add
2073 reloc_symbol_changes parameter.
2074 * configure.ac: Call AM_CONDITIONAL for the default target.
2075 * configure: Rebuild.
2076 * testsuite/Makefile.am (TEST_AS): New variable.
2077 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
2078 (check_DATA): Add split_i386 and split_x86_64 files.
2079 (SPLIT_DEFSYMS): Define.
2080 (split_i386_[1234n].o): New targets.
2081 (split_i386_[124]): New targets.
2082 (split_i386_[1234r].stdout): New targets.
2083 (split_x86_64_[1234n].o): New targets.
2084 (split_x86_64_[124]): New targets.
2085 (split_x86_64_[1234r].stdout): New targets.
2086 (MOSTLYCLEANFILES): Add new executables.
2087 * testsuite/split_i386.sh: New file.
2088 * testsuite/split_x86_64.sh: New file.
2089 * testsuite/split_i386_1.s: New file.
2090 * testsuite/split_i386_2.s: New file.
2091 * testsuite/split_i386_3.s: New file.
2092 * testsuite/split_i386_4.s: New file.
2093 * testsuite/split_i386_n.s: New file.
2094 * testsuite/split_x86_64_1.s: New file.
2095 * testsuite/split_x86_64_2.s: New file.
2096 * testsuite/split_x86_64_3.s: New file.
2097 * testsuite/split_x86_64_4.s: New file.
2098 * testsuite/split_x86_64_n.s: New file.
2099 * testsuite/testfile.cc (Target_test): Update relocation_section
2100 function.
2101 * testsuite/Makefile.in: Rebuild.
2102
e8a9fcda
ILT
21032009-10-06 Ian Lance Taylor <iant@google.com>
2104
2105 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
2106 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
2107 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
2108 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
2109 the address on ldo_addrs_.
2110 (Target_i386::Relocate::fix_up_ldo): New function.
2111
e99daf92
ILT
21122009-10-06 Rafael Espindola <espindola@google.com>
2113
2114 * plugin.cc (add_input_library): New.
2115 (Plugin::load): Add add_input_library to tv.
2116 (Plugin_manager::add_input_file): Add the is_lib argument.
2117 (add_input_file): Update call to Plugin_manager::add_input_file.
2118 (add_input_library): New.
2119 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
2120
966d4097
DK
21212009-09-30 Doug Kwan <dougkwan@google.com>
2122
2123 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
2124 symbol and call Symbol::may_need_copy_reloc to determine if
2125 a copy reloc is needed.
2126 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
2127 nocopyreloc is given in command line.
2128 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
2129 given in command line.
2130 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
2131 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
2132 of the removed Target_i386::may_need_copy_reloc.
2133 * options.h (copyreloc): New option with default value false.
2134 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
2135 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
2136 instead of the removed Target_powerpc::may_need_copy_reloc.
2137 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
2138 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
2139 instead of the removed Target_sparc::may_need_copy_reloc.
2140 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
2141 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
2142 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
2143 instead of the removed Target_x86_64::may_need_copy_reloc.
2144
029ba973
ILT
21452009-09-30 Ian Lance Taylor <iant@google.com>
2146
2147 * object.h (class Object): Remove target_ field, and target,
2148 sized_target, and set_target methods.
2149 (Object::sized_target): Remove.
2150 (class Sized_relobj): Update declarations. Remove sized_target.
2151 * object.cc (Sized_relobj::setup): Remove target parameter.
2152 Change all callers.
2153 (Input_objects::add_object): Don't do anything with the target.
2154 (make_elf_sized_object): Add punconfigured parameter. Change all
2155 callers. Set or test parameter target.
2156 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
2157 Change all callers.
2158 * parameters.cc (Parameters::set_target): Change parameter type to
2159 be non-const.
2160 (Parameters::default_target): Remove.
2161 (set_parameters_target): Change parameter type to be non-const.
2162 (parameters_force_valid_target): New function.
2163 (parameters_clear_target): New function.
2164 * parameters.h (class Parameters): Update declarations. Remove
2165 default_target method. Add sized_target and clear_target
2166 methods. Change target_ to be non-const.
2167 (set_parameters_target): Update declaration.
2168 (parameters_force_valid_target): Declare.
2169 (parameters_clear_target): Declare.
2170 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
2171 as NULL if we aren't searching.
2172 (Add_symbols::run): Don't check for compatible target.
2173 * fileread.cc (Input_file::open_binary): Call
2174 parameters_force_valid_target.
2175 * gold.cc (queue_middle_tasks): Likewise.
2176 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
2177 set_target on object.
2178 * dynobj.h (class Sized_dynobj): Update declarations.
2179 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
2180 make_elf_object returns NULL.
2181 (Archive::include_member): Don't check whether object target is
2182 compatible.
2183 * output.cc (Output_section::add_input_section): Get target from
2184 parameters.
2185 (Output_section::relax_input_section): Likewise.
2186 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
2187 parameters.
2188 (Sized_relobj::do_scan_relocs): Likewise.
2189 (Sized_relobj::relocate_sections): Likewise.
2190 * resolve.cc (Symbol_table::resolve): Likewise.
2191 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
2192 parameter. Change all callers.
2193 (Symbol_table::add_from_object): Get target from parameters.
2194 (Symbol_table::add_from_relobj): Don't check object target.
2195 (Symbol_table::add_from_dynobj): Likewise.
2196 (Symbol_table::define_special_symbol): Get target from
2197 parameters.
2198 * symtab.h (class Symbol_table): Update declaration.
2199 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
2200 parameter. Change all callers. Clear parameter target.
2201 (Binary_test): Test target here.
2202 * testsuite/object_unittest.cc (gold_testsuite): Remove
2203 target_test_pointer parameter. Change all callers.
2204 (Object_test): Test target here.
2205
a6a22b83
ILT
22062009-09-26 Ian Lance Taylor <iant@google.com>
2207
2208 * testsuite/initpri1.c: Don't try to use constructor priorities if
2209 compiling with gcc before 4.3.
2210
6a8f49fe
ILT
22112009-09-22 Mikolaj Zalewski <mikolajz@google.com>
2212
2213 * testsuite/retain_symbols_file_test.sh (check_present): Change
2214 output file name to retain_symbols_file_test.stdout.
2215 (check_absent): Likewise.
2216
8c604651
CS
22172009-09-18 Craig Silverstein <csilvers@google.com>
2218
2219 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
2220 * options.cc: Include <cerrno> and <fstream>.
2221 (General_options::finalize): Parse -retain-symbols-file tag.
2222 * options.h: New flag.
2223 (General_options): New method should_retain_symbol, new
2224 variable symbols_to_retain.
2225 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
2226 should_retain_symbol map.
2227 * testsuite/Makefile.am (retain_symbols_file_test): New test.
2228 * testsuite/Makefile.in: Regenerate.
2229 * testsuite/retain_symbols_file_test.sh: New file.
2230
ca58b19f
NC
22312009-09-18 Nick Clifton <nickc@redhat.com>
2232
2233 * po/es.po: Updated Spanish translation.
2234
20e6d0d6
DK
22352009-09-17 Doug Kwan <dougkwan@google.com>
2236
2237 * debug.h (DEBUG_RELAXATION): New constant.
2238 (DEBUG_ALL): Add DEBUG_RELAXATION.
2239 (debug_string_to_enum): Add relaxation debug option.
2240 * layout.cc
2241 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
2242 Layout::Relaxation_debug_check::read_sections,
2243 Layout::Relaxation_debug_check::read_sections): New method definitions.
2244 (Layout::Layout): Initialize data members
2245 record_output_section_data_from_scrips_,
2246 script_output_section_data_list_ and relaxation_debug_check_.
2247 (Layout::save_segments, Layout::restore_segments,
2248 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
2249 Layout::relaxation_loop_body): New method definitions.
2250 (Layout::finalize): Support relaxation. Move section layout code to
2251 Layout::relaxation_loop_body.
2252 (Layout::set_asection_address_from_script): Move code for orphan
2253 section placement out.
2254 (Layout::place_orphan_sections_in_script): New method definition.
2255 * layout.h (Output_segment_headers, Output_file_header):
2256 New forward class declarations.
2257 (Layout::~Layout): Define.
2258 (Layout::new_output_section_data_from_script): New method definition.
2259 (Layout::place_orphan_sections_in_script): New method declaration.
2260 (Layout::Segment_states): New type declaration.
2261 (Layout::save_segments, Layout::restore_segments,
2262 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
2263 Layout::relaxation_loop_body): New method declarations.
2264 (Layout::Output_section_data_list): New type declaration.
2265 (Layout::Relaxation_debug_check): New class definition.
2266 (Layout::record_output_section_data_from_script_,
2267 Layout::script_output_section_data_list_, Layout::segment_states_,
2268 Layout::relaxation_debug_check_): New data members.
2269 * output.cc: (Output_section_headers::do_size): New method definition.
2270 (Output_section_headers::Output_section_headers): Move size
2271 computation to Output_section_headers::do_size.
2272 (Output_segment_headers::do_size): New method definition.
2273 (Output_file_header::Output_file_header): Move size computation to
2274 Output_file_header::do_size and call it.
2275 (Output_file_header::do_size): New method definition.
2276 (Output_data_group::Output_data_group): Adjust call to
2277 Output_section_data.
2278 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
2279 (Output_symtab_xindex::do_write): Add array bound check.
2280 (Output_section::Input_section::print_to_mapfile): Handle
2281 RELAXED_INPUT_SECTION_CODE.
2282 (Output_section::Output_section): Initialize data member checkpoint_.
2283 (Output_section::~Output_section): Delete checkpoint object pointed
2284 by checkpoint_.
2285 (Output_section::add_input_section): Always add an Input_section if
2286 relaxing.
2287 (Output_section::add_merge_input_section): Add assert.
2288 (Output_section::relax_input_section): New method definition.
2289 (Output_section::set_final_data_size): Set load address to zero for
2290 an unallocated section.
2291 (Output_section::do_address_and_file_offset_have_reset_values):
2292 New method definition.
2293 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
2294 Handle relaxed input section.
2295 (Output_section::sort_attached_input_sections): Checkpoint input
2296 section list lazily.
2297 (Output_section::get_input_sections): Change type of input_sections to
2298 list of Simple_input_section pointers. Checkpoint input section list
2299 lazily. Also handle relaxed input sections.
2300 (Output_section::add_input_section_for_script): Take a reference to
2301 a Simple_input_section object instead of Relobj pointer and section
2302 index as parameter. Handle relaxed input sections.
2303 (Output_section::save_states, Output_section::restore_states): New
2304 method definitions.
2305 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
2306 (Output_data::is_data_size_fixed): New method definition.
2307 (Output_data::reset_addresss_and_file_offset): Do not reset data size
2308 if it is fixed.
2309 (Output_data::address_and_file_offset_have_reset_values): New method
2310 definition.
2311 (Output_data::do_address_and_file_offset_have_reset_values): New method
2312 definition.
2313 (Output_data::set_data_size): Check that data size is not fixed.
2314 (Output_data::fix_data_size): New method definition.
2315 (Output_data::is_data_size_fixed_): New data member.
2316 (Output_section_headers::set_final_data_size): New method definition.
2317 (Output_section_headers::do_size): New method declaration.
2318 (Output_segment_headers::set_final_data_size): New method definition.
2319 (Output_segment_headers::do_size): New method declaration.
2320 (Output_file_header::set_final_data_size)::New method definition.
2321 (Output_file_header::do_size)::New method declaration.
2322 (Output_section_data::Output_section_data): Add new parameter
2323 is_data_size_fixed and use it to fix data size.
2324 (Output_data_const::Output_data_const): Adjust call to base class
2325 constructor and fix data size.
2326 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
2327 base class constructor and fix data size.
2328 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
2329 base class constructor and fix data size.
2330 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
2331 class constructor and fix data size.
2332 (Output_data_group::set_final_data_size): New method definition.
2333 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
2334 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
2335 class constructor and fix data size.
2336 (Output_relaxed_input_section): New class definition.
2337 (Output_section::Simple_input_section): New class definition.
2338 (Output_section::get_input_sections): Adjust parameter list.
2339 (Output_section::add_input_section_for_script): Same.
2340 (Output_section::save_states, Output_section::restore_states,
2341 Output_section::do_address_and_file_offset_have_reset_values,
2342 (Output_section::Input_section::Input_section): Handle
2343 RELAXED_INPUT_SECTION_CODE. Add new overload for
2344 Output_relaxed_input_section.
2345 (Output_section::Input_section::is_input_section,
2346 Output_section::Input_section::set_output_section): Handle relaxed
2347 input section.
2348 (Output_section::Input_section::is_relaxed_input_section,
2349 Output_section::Input_section::output_section_data,
2350 Output_section::Input_section::relaxed_input_section): New method
2351 definitions.
2352 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
2353 value.
2354 (Output_section::Input_section::u1_): Update comments.
2355 (Output_section::Input_section::u2_): Add new union member poris.
2356 (Output_section::Checkpoint_output_section): New classs definition.
2357 (Output_section::relax_input_section): New method declaration.
2358 (Output_section::checkpoint_): New data member.
2359 (Output_segment): Update comments.
2360 (Output_segment::Output_segment): Un-privatize copy constructor.
2361 (Output_segment::operator=): Un-privatize.
2362 * script-sections.cc (Output_section_element::Input_section_list):
2363 Change element type to Output_section::Simple_input_section.
2364 (Output_section_element_dot_assignment::set_section_addresses):
2365 Register output section data for relaxation clean up.
2366 (Output_data_exression::Output_data_expression): Adjust call to base
2367 constructor to fix data size.
2368 (Output_section_element_data::set_section_addresses): Register
2369 Output_data_expression object for relaxation clean up.
2370 (struct Input_section_info): Replace Relobj pointer and section index
2371 pair with Output_section::Simple_input_section and Convert struct to a
2372 class.
2373 (Input_section_sorter::operator()): Adjust access to
2374 Input_section_info data member to use accessors.
2375 (Output_section_element_input::set_section_addresses): Use layout
2376 parameter. Adjust code to use Output_section::Simple_input_section
2377 and Input_secction_info classes. Register filler for relaxation
2378 clean up.
2379 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
2380 and section index pair with Output_section::Simple_input_section
2381 class. Adjust code accordingly.
2382 (Phdrs_element::release_segment): New method definition.
2383 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
2384 segment list.
2385 (Script_sections::release_segments): New method definition.
2386 * gold/script-sections.h (Script_sections::release_segments): New
2387 method declaration.
2388 * gold/target.h (Target::may_relax, Target::relax,
2389 Target::do_may_relax, Target::do_relax): New method definitions.
2390
5e445df6
ILT
23912009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2392
2393 * arm.cc (has_signed_unsigned_overflow): New function.
2394 (Arm_relocate_functions::abs8): New function.
2395 (Target_arm::Scan::local): Handle R_ARM_ABS8.
2396 (Target_arm::Scan::global): Likewise.
2397 (Target_arm::relocate::relocate): Likewise.
2398 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2399 Likewise.
2400
8c604651 24012009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
2402
2403 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
2404 * testsuite/Makefile.in: Regenerate.
2405
1e9cc1c2
NC
24062009-09-11 Nick Clifton <nickc@redhat.com>
2407
2408 * po/gold.pot: Updated by the Translation project.
2409
6a89f575
CC
24102009-09-08 Cary Coutant <ccoutant@google.com>
2411
2412 * output.cc (Output_file::open): Add execute permission to empty file.
2413 * testsuite/Makefile.am (permission_test): New test.
2414 * testsuite/Makefile.in: Regenerate.
2415
fdcac5af
ILT
24162009-09-02 Ian Lance Taylor <iant@google.com>
2417
2418 * output.cc (Output_file::resize): Call map_no_anonymous rather
2419 than map.
2420
44453f85
ILT
24212009-09-01 Mikolaj Zalewski <mikolajz@google.com>
2422
2423 * gold.cc: Include "incremental.h".
2424 (queue_initial_tasks): Call Incremental_checker methods.
2425 * incremental.cc: Include "output.h".
2426 (Incremental_checker::can_incrementally_link_output_file): New
2427 method.
2428 * incremental.h (Incremental_checker): New class.
2429
2430 * output.cc (Output_file::open_for_modification): New method.
2431 (Output_file::map_anonymous): Changed return type to bool. Record
2432 map in base_ field.
2433 (Output_file::map_no_anonymous): New method, broken out of map.
2434 (Output_file::map): Use map_no_anonymous and map_anonymous.
2435 * output.h (class Output_file): Update declarations.
2436
293c1386
CC
24372009-08-24 Cary Coutant <ccoutant@google.com>
2438
2439 * options.h (Command_line::Pre_options): New class.
2440 (Command_line::pre_options): New member.
2441 * options.cc (gold::options::ready_to_register): New variable.
2442 (One_option::register_option): Do nothing if not registering options.
2443 Assert if same short option registered twice.
2444 (General_options::General_options): Turn off option registration when
2445 done constructing.
2446 (Command_line::Pre_options::Pre_options): New constructor.
2447
f773f3d2
CC
24482009-08-24 Cary Coutant <ccoutant@google.com>
2449
06a73cfe
CC
2450 * options.h (General_options::no_keep_memory): Remove incorrect
2451 short option.
f773f3d2 2452
a15af8e2
RW
24532009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2454
2455 * Makefile.am (am__skiplex, am__skipyacc): New.
2456 * Makefile.in: Regenerate.
2457
c462b41b
RW
24582009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2459
14ec8efd
RW
2460 * Makefile.am (AM_CPPFLAGS): Renamed from ...
2461 (INCLUDES): ... this.
2462 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
2463 (AM_CPPFLAGS): Renamed from ...
2464 (INCLUDE): ... this.
2465 * Makefile.in, testsuite/Makefile.in: Regenerate.
2466
81ecdfbb
RW
2467 * Makefile.in: Regenerate.
2468 * aclocal.m4: Likewise.
2469 * config.in: Likewise.
2470 * configure: Likewise.
2471 * testsuite/Makefile.in: Likewise.
2472
c462b41b
RW
2473 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
2474 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
2475 * Makefile.in: Regenerate.
2476 * testsuite/Makefile.in: Regenerate.
2477
2da73f13
CC
24782009-08-19 Cary Coutant <ccoutant@google.com>
2479
2480 * resolve.cc (Symbol_table::resolve): Don't complain about defined
2481 symbols in shared libraries overridden by hidden or internal symbols
2482 in the main program.
2483
2db70501
CD
24842009-08-19 Chris Demetriou <cgd@google.com>
2485
2486 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
2487 checking source file names in error messages.
2488
f733487b
DK
24892009-08-18 Doug Kwan <dougkwan@google.com>
2490
2491 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
2492 an elcpp::Ehdr as parameter. Adjust call to set_target.
2493 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
2494 an elfcpp::Ehdr as parameter.
2495 * object.cc (Object::set_target): Remove the version that looks up
2496 a target and sets it.
2497 (Sized_relobj::setup): Take a Target object instead of
2498 an elfcpp::Ehdr as parameter. Adjust call to set_target.
2499 (make_elf_sized_object): Find target and ask target to
2500 make an ELF object.
2501 * object.h: (Object::set_target): Remove the version that looks up
2502 a target and sets it.
2503 (Sized_relobj::setup): Take a Target object instead of
2504 an elfcpp:Ehdr as parameter.
2505 * target.cc: Include dynobj.h.
2506 (Target::do_make_elf_object_implementation): New.
2507 (Target::do_make_elf_object): New.
2508 * target.h (Target::make_elf_object): New template declaration.
2509 (Target::do_make_elf_object): New method declarations.
2510 (Target::do_make_elf_object_implementation): New template declaration.
2511
cc70f101
ILT
25122009-08-14 Ian Lance Taylor <iant@google.com>
2513
2514 * gold.h (FUNCTION_NAME): Define.
2515 (gold_unreachable): Use FUNCTION_NAME.
2516
ef5e0cb1
ST
25172009-08-12 Sriraman Tallam <tmsriram@google.com>
2518
2519 * icf.cc (Icf::find_identical_sections): Issue a warning when a
2520 symbol in the --keep-unique list is not found.
2521
48c187ce
ST
25222009-08-12 Sriraman Tallam <tmsriram@google.com>
2523
2524 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
2525 been maked as --keep-unique.
2526 (Icf::unfold_section): New function.
2527 * icf.h (Icf::unfold_section): New function.
2528 * options.h (General_options::keep_unique): New option.
2529 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
2530 * testsuite/Makefile.in: Regenerate.
2531 * testsuite/icf_keep_unique_test.sh: New file.
2532 * testsuite/icf_keep_unique_test.cc: New file.
2533
645afe0c
CC
25342009-08-12 Cary Coutant <ccoutant@google.com>
2535
2536 PR 10471
2537 * resolve.cc (Symbol_table::resolve): Check for references from
2538 dynamic objects to hidden and internal symbols.
2539 * testsuite/Makefile.am (hidden_test.sh): New test.
2540 * testsuite/Makefile.in: Regenerate.
2541 * testsuite/hidden_test.sh: New script.
2542 * testsuite/hidden_test_1.c: New test source.
2543 * testsuite/hidden_test_main.c: New test source.
2544
11af873f
DK
25452009-08-11 Doug Kwan <dougkwan@google.com>
2546
2547 * arm.cc: Update comments.
2548 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
2549 segment to locate the .ARM.exidx section if present.
2550
b9f7d72d
DK
25512009-08-09 Doug Kwan <dougkwan@google.com>
2552
2553 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
2554 patch.
2555
ddd3c53c
ST
25562009-08-07 Sriraman Tallam <tmsriram@google.com>
2557 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
2558 compiler warnings.
2559
27721062
ST
25602009-08-06 Sriraman Tallam <tmsriram@google.com>
2561
2562 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
2563 valid tls_segment only for non-debug-section relocations.
2564 * testsuite/Makefile.am: Add gc_tls_test.
2565 * testsuite/Makefile.in: Regenerate.
2566 * testsuite/gc_tls_test.cc: New file.
2567 * testsuite/gc_tls_test.sh: New file.
2568
ef15dade
ST
25692009-08-05 Sriraman Tallam <tmsriram@google.com>
2570
2571 * icf.cc: New file.
2572 * icf.h: New file.
2573 * Makefile.am (CCFILES): Add icf.cc.
2574 (HFILES): Add icf.h
2575 * Makefile.in: Regenerate.
2576 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
2577 * gc.h (gc_process_relocs): Populate lists used by icf to contain
2578 section, symbol and addend information for the relocs.
2579 * gold.cc (queue_middle_tasks): Call identical code folding.
2580 * gold.h: Add defines for multimap.
2581 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
2582 to the call of finalize_local_symbols.
2583 * main.cc (main): Create object of class Icf.
2584 * object.cc (Sized_relobj::do_layout): Allow this function to be
2585 called twice during icf.
2586 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
2587 to sections marked as identical by icf.
2588 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
2589 when available.
2590 (Sized_relobj::do_section_entsize): New function.
2591 * object.h (Object::section_entsize): New function.
2592 (Object::do_section_entsize): New pure virtual function.
2593 (Relobj::finalize_local_symbols): Add new parameter.
2594 (Relobj::do_section_entsize): New function.
2595 * options.h (General_options::icf): New option.
2596 (General_options::icf_iterations): New option.
2597 (General_options::print_icf_sections): New option.
2598 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
2599 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
2600 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
2601 icf.
2602 * symtab.cc (Symbol_table::is_section_folded): New function.
2603 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
2604 to sections marked as identical by icf.
2605 * symtab.h (Symbol_table::set_icf): New function.
2606 (Symbol_table::icf): New function.
2607 (Symbol_table::is_section_folded): New function.
2608 (Symbol_table::icf_): New data member.
2609 * target-reloc.h (relocate_section): Ignore sections folded by icf.
2610 * testsuite/Makefile.am: Add commands to build icf_test.
2611 * testsuite/Makefile.in: Regenerate.
2612 * testsuite/icf_test.sh: New file.
2613 * testsuite/icf_test.cc: New file.
2614
c3b65ac4
CD
26152009-07-24 Chris Demetriou <cgd@google.com>
2616
2617 * layout.cc (is_compressible_debug_section): Fix incorrect
2618 comment about compressed section names.
2619
1caf2c51
ILT
26202009-07-20 Ian Lance Taylor <ian@airs.com>
2621
2622 PR 10419
2623 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
2624
1ef4d87f
ILT
26252009-07-16 Ian Lance Taylor <iant@google.com>
2626
2627 PR 10400
2628 * layout.h: #include <map>.
2629 (class Kept_section): Change from struct to class. Add accessors
2630 and setters. Add section size to Comdat_group mapping. Change
2631 Comdat_group to std::map. Add is_comdat_ field. Add
2632 linkonce_size field in union.
2633 (class Layout): Update declaration of find_or_add_kept_section.
2634 Don't declare find_kept_object.
2635 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
2636 parameter. Add object, shndx, is_comdat, and is_group_name
2637 parameters. Change all callers. Adjust for new Kept_section.
2638 (Layout::find_kept_object): Remove.
2639 * object.cc (Sized_relobj::include_section_group): Update use of
2640 Kept_section. Rename secnum to shndx. Only record
2641 Kept_comdat_section if sections are the same size.
2642 (Sized_relobj::include_linkonce_section): Update use of
2643 Kept_section. Only record Kept_comdat_section if sections are the
2644 same size. Set size of linkonce section.
2645 (Sized_relobj::map_to_kept_section): Update call to
2646 get_kept_comdat_section.
2647 * object.h (class Sized_relobj): Rename fields in
2648 Kept_comdat_section to drop trailing underscores; change object
2649 field to Relobj*. Change Kept_comdat_section_table to store
2650 struct rather than pointer.
2651 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
2652 Add kept_object and kept_shndx parameters. Change all callers.
2653 (Sized_relobj::get_kept_comdat_section): Change return type to
2654 bool. Add kept_object and kept_shndx parameters. Change all
2655 callers.
2656 * plugin.cc (Pluginobj::include_comdat_group): Update call to
2657 Layout::find_or_add_kept_section.
2658
37c3b7b0
ILT
26592009-07-09 Ian Lance Taylor <iant@google.com>
2660
2661 * merge.cc (Object_merge_map::initialize_input_to_output_map):
2662 Reserve space in the hash table.
2663
98fa85cb
ILT
26642009-07-06 Mikolaj Zalewski <mikolajz@google.com>
2665
2666 * fileread.cc (File_read::get_mtime): New method.
2667 * fileread.h (Timespec): New structure.
2668 (File_read::get_mtime): New method.
2669 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
2670 Renamed from timestamp_nsec.
2671 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
2672 Elf_Xword.
2673 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
2674 timestamp_nsec.
2675 (Incremental_inputs::report_archive): Save mtime; style fix.
2676 (Incremental_inputs::report_obejct): Save mtime; style fix.
2677 (Incremental_inputs::report_script): Save mtime; style fix.
2678 (Incremental_inputs::finalize_inputs): Style fix.
2679 (Incremental_inputs::finalize): Style fix.
2680 (Incremental_inputs::create_input_section_data): Store inputs
2681 mtime.
2682 * incremental.h (Incremental_inputs::report_script): Add mtime
2683 argument.
2684 (Incremental_inputs::Input_info::Input_info): Intialize only one
2685 union member.
2686 (Incremental_inputs::Input_info::archive): Move to nameless
2687 union.
2688 (Incremental_inputs::Input_info::obejct): Move to nameless union.
2689 (Incremental_inputs::Input_info::script): Move to nameless union.
2690 (Incremental_inputs::mtime): New field.
2691 * script.cc (read_input_script): Pass file mtime to
2692 Incremental_input.
2693 * script.h (Script_info::inputs): Style fix.
2694
c9d70757
ILT
26952009-07-01 Ian Lance Taylor <ian@airs.com>
2696
2697 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
2698 instead of 32.
2699
9c547ec3
ILT
27002009-06-24 Ian Lance Taylor <iant@google.com>
2701
2702 PR 10156
2703 * layout.cc (Layout::choose_output_section): If we find an
2704 existing section, update the flags.
2705 (Layout::create_notes): New function, broken out of
2706 Layout::finalize.
2707 (Layout::finalize): Don't create note sections.
2708 (Layout::create_note): Don't crash if linker script discards
2709 section.
2710 (Layout::create_gold_note): Likewise.
2711 (Layout::create_build_id): Likewise. Don't set
2712 after_input_sections on the section.
2713 (Layout::create_executable_stack_info): Remove target parameter.
2714 Change caller.
2715 * layout.h (class Layout): Declare create_notes. Update
2716 declaration of create_executable_stack_info.
2717 * gold.cc (queue_middle_tasks): Call create_notes.
2718 * output.cc (Output_section::update_flags_for_input_section): Move
2719 here from output.h. If SHF_ALLOC flag is newly set, mark address
2720 invalid.
2721 * output.h (Output_data::mark_address_invalid): New function.
2722 (class Output_section): Only declare, not define,
2723 update_flags_for_input_section. Remove set_flags.
2724
55458500
ILT
27252009-06-24 Ian Lance Taylor <iant@google.com>
2726
2727 * script-sections.cc (Output_section_definition::
2728 set_section_addresses): Rename shadowing local load_address to
2729 laddr.
2730
1307d6cd
ILT
27312009-06-24 Ian Lance Taylor <iant@google.com>
2732
2733 PR 10244
2734 * reloc.cc (relocate_sections): Skip empty relocation sections.
2735
ec3f783e
ILT
27362009-06-23 Ian Lance Taylor <iant@google.com>
2737
2738 PR 10156
2739 * layout.cc (Layout::create_note): Use choose_output_section
2740 rather than make_output_section.
2741
459c9f1c
ILT
27422009-06-23 Ian Lance Taylor <iant@google.com>
2743
2744 PR 10237
2745 * options.cc (General_options::parse_V): Set printed_version_.
2746 (General_options::General_options): Initialize printed_version_.
2747 * options.h (class General_options): Add printed_version_ field.
2748 * gold.cc (queue_initial_tasks): If there are no input files,
2749 don't give a fatal error if we printed the version information.
2750 (queue_middle_tasks): If using -r with a shared object, give a
2751 fatal error rather than an ordinary error.
2752
1518dc8f
ILT
27532009-06-23 Ian Lance Taylor <iant@google.com>
2754
2755 PR 10219
2756 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
2757 (Layout::make_output_section): Set have_stabstr_section_ if we see
2758 a .stab*str section.
2759 (Layout::finalize): Call link_stabs_sections.
2760 (Layout::link_stabs_sections): New file.
2761 * layout.h (class Layout): Add have_stabstr_section_ field.
2762 Declare link_stabs_sections.
2763
3d857b98
DK
27642009-06-23 Doug Kwan <dougkwan@google.com>
2765
2766 * Makefile.am (libgold_a_LIBADD): New.
2767 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2768 * Makefile.in: Regenerate.
2769 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
2770 * configure: Regenerate.
2771 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
2772 * fileread.cc: Include sys/state.h
2773 * gold.h: Declare memmem and strndup if found missing.
2774 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
2775
0639a6f6
ILT
27762009-06-23 Ian Lance Taylor <iant@google.com>
2777
2778 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
2779 * configure: Rebuild.
2780
8d63875c
ILT
27812009-06-23 Ian Lance Taylor <iant@google.com>
2782
2783 PR 10147
2784 * object.cc (Object::section_contents): Don't try to get a view if
2785 the section has length zero.
2786 (Object::handle_gnu_warning_section): If the section is empty, use
2787 the name of the section as the warning.
2788
f7c8a183
ILT
27892009-06-23 Ian Lance Taylor <iant@google.com>
2790
2791 PR 10133
2792 * stringpool.h (class Stringpool_template): Add optimize_ field.
2793 (Stringpool_template::set_optimize): New function.
2794 * stringpool.cc (Stringpool_template::Stringpool_template):
2795 Initialize optimize_ field.
2796 (Stringpool_template::set_string_offsets): Test local optimize
2797 fild rather than parameter.
2798 * layout.cc (Layout::Layout): Call set_optimize on the section
2799 name stringpool.
2800
e6a307ba
ILT
28012009-06-22 Ian Lance Taylor <iant@google.com>
2802
2803 PR 10030
2804 * yyscript.y: Parse TARGET.
2805 * script.cc (script_set_target): New function.
2806 * script-c.h (script_set_target): Declare.
2807 * options.cc (General_options::string_to_object_format): Rename
2808 from string_to_object_format in anonymous namespace. Change
2809 callers.
2810 * options.h (class General_options): Declare
2811 string_to_object_format.
2812
3ee173de
ILT
28132009-06-22 Ian Lance Taylor <iant@google.com>
2814
2815 * script-sections.cc (Script_sections::create_segments): Don't put
2816 program headers in a PT_LOAD segment if -n or -N.
2817
28182009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
2819
2820 PR 10141
2821 * options.h (class General_options): Add -z lazy and -z now. Sort
2822 -z options into alphabetical order.
2823 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
2824
cd6739a1 28252009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
2826
2827 * layout.cc (Layout::make_output_section): Call
2828 Target::new_output_section.
2829 (Layout::attach_allocated_section_to_segment): Put large section
2830 sections in a separate load segment with the large segment flag
2831 set.
2832 (Layout::segment_precedes): Sort large data segments after other
2833 load segments.
2834 (align_file_offset): New static function.
2835 (Layout::set_segment_offsets): Use align_file_offset.
2836 * output.h (class Output_section): Add is_small_section_ and
2837 is_large_section_ fields.
2838 (Output_section::is_small_section): New function.
2839 (Output_section::set_is_small_section): New function.
2840 (Output_section::is_large_section): New function.
2841 (Output_section::set_is_large_section): New function.
2842 (Output_section::is_large_data_section): New function.
2843 (class Output_segment): Add is_large_data_segment_ field.
2844 (Output_segment::is_large_data_segment): New function.
2845 (Output_segment::set_is_large_data_segment): New function.
2846 * output.cc (Output_section::Output_section): Initialize new
2847 fields.
2848 (Output_segment::Output_segment): Likewise.
2849 (Output_segment::add_output_section): Add assertion that large
2850 data sections always go in large data segments. Force small data
2851 sections to the end of the list of data sections. Force small BSS
2852 sections to the start of the list of BSS sections. For large BSS
2853 sections to the end of the list of BSS sections.
2854 * symtab.h (class Symbol): Declare is_common_shndx.
2855 (Symbol::is_defined): Check Symbol::is_common_shndx.
2856 (Symbol::is_common): Likewise.
2857 (class Symbol_table): Define enum Commons_section_type. Update
2858 declarations. Add small_commons_ and large_commons_ fields.
2859 * symtab.cc (Symbol::is_common_shndx): New function.
2860 (Symbol_table::Symbol_table): Initialize new fields.
2861 (Symbol_table::add_from_object): Put small and large common
2862 symbols in the right list.
2863 (Symbol_table::sized_finalized_symbol): Check
2864 Symbol::is_common_shndx.
2865 (Symbol_table::sized_write_globals): Likewise.
2866 * common.cc (Symbol_table::do_allocate_commons): Allocate new
2867 common symbol lists. Don't call do_allocate_commons_list if the
2868 list is empty.
2869 (Symbol_table::do_allocate_commons_list): Remove is_tls
2870 parameter. Add comons_section_type parameter. Change all
2871 callers. Handle small and large common symbols.
2872 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
2873 Symbol::is_common_shndx.
2874 * resolve.cc (symbol_to_bits): Likewise.
2875 * target.h (Target::small_common_shndx): New function.
2876 (Target::small_common_section_flags): New function.
2877 (Target::large_common_shndx): New function.
2878 (Target::large_common_section_flags): New function.
2879 (Target::new_output_section): New function.
2880 (Target::Target_info): Add small_common_shndx, large_common_shndx,
2881 small_common_section_flags, and large_common_section_flags
2882 fields.
2883 (Target::do_new_output_section): New virtual function.
2884 * arm.cc (Target_arm::arm_info): Initialize new fields.
2885 * i386.cc (Target_i386::i386_info): Likewise.
2886 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2887 Likewise.
2888 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
2889 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2890 (Target_x86_64::do_new_output_section): New function.
2891 * configure.ac: Define conditional MCMODEL_MEDIUM.
2892 * testsuite/Makefile.am (check_PROGRAMS): Add large.
2893 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
2894 (large_LDFLAGS): Define.
2895 * testsuite/large.c: New file.
2896 * testsuite/testfile.cc (Target_test::test_target_info):
2897 Initialize new fields.
2898 * configure, testsuite/Makefile.in: Rebuild.
2899
bb04269c
DK
29002009-06-05 Doug Kwan <dougkwan@google.com>
2901
2902 * Makefile.am (CCFILES): Add target.cc.
2903 * Makefile.in: Regenerate.
2904 * i386.cc (class Target_i386): Define new virtual method to
2905 override do_is_local_label_name in parent.
2906 * object.cc (Sized_relobj::do_count_local_symbols): Discard
2907 local symbols if --discard-locals or -X is given.
2908 * options.h (class General_options): Declare new options
2909 '--discard-locals' and '-X' for discarding locals.
2910 * target.h (class Target): Define new methods is_local_label_name.
2911 Declare new virtual method do_is_local_label_name.
2912 * target.cc: New file.
2913 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
2914 (check_SCRIPTS): Add discard_locals_test.sh.
2915 (check_DATA): Add discard_local_tests.syms.
2916 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
2917 (discard_local_tests.syms, discard_locals_test.o): New make rules.
2918 * testsuite/Makefile.in: Regenerate.
2919 * testsuite/discard_locals_test.c: New file.
2920 * testsuite/discard_locals_test.sh: Same.
2921
805bb01c
DK
29222009-06-05 Doug Kwan <dougkwan@google.com>
2923
2924 * object.cc (Sized_relobj::Sized_relobj): Initialize
2925 discarded_eh_frame_shndx_ to -1U.
2926 (Sized_relobj::do_layout): Record index of a discard .eh_frame
2927 section.
2928 (Sized_relobj::do_count_local_symbols): Skip local symbols in
2929 a discarded .eh_frame section.
2930 (Sized_relobj::do_finalize_local_symbols): Ditto.
2931 * object.h (class Sized_relobj): Declare new member
2932 discarded_eh_frame_shndx_.
2933 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
2934 (local_labels_test.o, local_labels_test): New rules.
2935 * testsuite/Makefile.in: Regenerate.
2936
1dcd334d
DK
29372009-06-04 Doug Kwan <dougkwan@google.com>
2938
2939 * layout.cc (Layout::section_name_mapping): Add mapping for
2940 special ARM sections.
2941
96d49306
DK
29422009-06-03 Doug Kwan <dougkwan@google.com>
2943
2944 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
2945 (utils::has_overflow): Same.
2946
dff16297
ILT
29472009-06-03 Ian Lance Taylor <iant@google.com>
2948
2949 * layout.cc (Layout::section_name_mapping): New array, replacing
2950 Layout::linkonce_mapping.
2951 (Layout::section_name_mapping_count): New variable, replacing
2952 Layout::linkonce_mapping_count.
2953 (Layout::linkonce_output_name): Remove.
2954 (Layout::output_section_name): Rewrite.
2955 * layout.h (class Layout): Rename Linkonce_mapping to
2956 Section_name_mapping, linkonce_mapping to section_name_mapping,
2957 linkonce_mapping_count to section_name_mapping_count. Don't
2958 declare linkonce_output_name.
2959
c121c671
DK
29602009-06-03 Doug Kwan <dougkwan@google.com>
2961
2962 * gold/arm.cc (namespace utils): New.
2963 (Target_arm::reloc_is_non_pic): Define new method.
2964 (class Arm_relocate_functions): New.
2965 (Target_arm::Relocate::relocate): Handle relocation types used by
2966 Android.
2967
07800fab
ILT
29682009-06-03 Ian Lance Taylor <iant@google.com>
2969
2970 * arm.cc (Target_arm::scan::global): Use || instead of |.
2971
c121c671
DK
29722009-06-02 Doug Kwan <dougkwan@google.com>
2973
2974 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
2975 issued_non_pic_error_.
2976 (class Target_arm::Scan): Declare new method check_non_pic.
2977 Define new method symbol_needs_plt_entry.
2978 Declare new data member issued_non_pic_error_.
2979 (class Target_arm::Relocate): Declare new method
2980 should_apply_static_reloc.
2981 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
2982 (Target_arm::Scan::check_non_pic): Define new method.
2983 (Target_arm::Scan::local): Handle a small subset of reloc types used
2984 by Android.
2985 (Target_arm::Scan::local): Same.
2986 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
2987
b19b0c6d
ILT
29882009-05-31 Mikolaj Zalewski <mikolajz@google.com>
2989
2990 * incremental.cc (Incremental_inputs::report_command_line): Filter
2991 out --incremental-* options.
2992
94cdfcff
DK
29932009-05-29 Doug Kwan <dougkwan@google.com>
2994
2995 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
2996 template class.
2997 (class Target_arm): Update comment.
2998 (Target_arm::Target_arm): Initialize new data members GOT_,
2999 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
3000 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
3001 and Target_arm::rel_dyn_section.
3002 Declare new_enum Target_arm::Got_type.
3003 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
3004 and DYNBSS_.
3005 Update commments for member do_dynsym_value.
3006 (Target_arm::got_size, Target_arm::plt_section,
3007 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
3008 new methods inside class defintion.
3009 (Target_arm::got_section): Define new method.
3010 (Target_arm::rel_dyn_section): Same.
3011 (Output_data_plt_arm): New template class.
3012 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
3013 (Output_data_plt_arm:do_adjust_output_section): Define new method.
3014 (Output_data_plt_arm::add_entry): Same.
3015 (Output_data_plt_arm::first_plt_entry): Define new
3016 static data member for PLT instruction template.
3017 (Output_data_plt_arm::plt_entry): Same.
3018 (Output_data_plt_arm::do_write): Define new method.
3019 (Target_arm::make_plt_entry): Same.
3020 (Target_arm::do_finalize_sections): Same.
3021 (Target_arm::do_dynsym_value): Same.
3022
4a657b0d
DK
30232009-05-28 Doug Kwan <dougkwan@google.com>
3024
3025 * Makefile.am (TARGETSOURCES): Add arm.cc.
3026 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
3027 * Makefile.in: Regenerate.
3028 * arm.cc: New file.
3029 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
3030
e7ae8c36
DK
30312009-05-26 Doug Kwan <dougkwan@google.com>
3032
3033 * options.cc (General_options::parse_exclude_libs). Fix a comment.
3034 (General_options::check_excluded_libs): Strip off directories in
3035 archive name before matching like GNU ld does.
3036 * testsuite/Makefile.am (MOSTLYCLEANFILES,
3037 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
3038 (exclude_libs_test_LDFLAGS): Add linker option
3039 -Wl,--exclude-libs,libexclude_libs_test_3
3040 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
3041 an explicit archive without using -l.
3042 (alt/libexclude_libs_test_3.a): New make rule.
3043 * testsuite/Makefile.in: Regenerate.
3044 * testsuite/exclude_libs_test.c : Declare lib3_default().
3045 (main): Call it.
3046 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
3047 * exclude_libs_test_3.c: New file.
3048
f12e7348
NC
30492009-05-26 Nick Clifton <nickc@redhat.com>
3050
3051 * po/id.po: New Indonesian translation.
3052 * po/gold.pot: Updated template file.
3053
4daadc0d
ST
30542009-05-22 Sriraman Tallam <tmsriram@google.com>
3055
3056 * testsuite/Makefile.am: Add -ffunction-sections to compile
3057 gc_comdat_test files. Add -Wl,--gc-sections to build
3058 gc_comdat_test.
3059 * testsuite/Makefile.in: Regenerate.
3060 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
3061
531813ad
ST
30622009-05-21 Sriraman Tallam <tmsriram@google.com>
3063
3064 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
3065 kept comdat section was garbage collected.
3066 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
3067 * testsuite/Makefile.in: Regenerate.
3068 * testsuite/gc_comdat_test.sh: New file.
3069 * testsuite/gc_comdat_test_1.cc: New file.
3070 * testsuite/gc_comdat_test_2.cc: New file.
3071
65514900
CC
30722009-05-19 Doug Kwan <dougkwan@google.com>
3073
3074 * archive.cc (Archive::Archive): Move constructor from archive.h
3075 to here. Initialize no_export_.
3076 (Archive::get_elf_object_for_member): Set no_export flag of object.
3077 * archive.h (Archive::Archive): Move constructor body to
3078 archive.cc.
3079 (Archive::no_export): New method.
3080 (Archive::no_export_): New field.
3081 * object.h (Object::Object): Initialize no_export_ to false.
3082 (Object::no_export, Object::set_no_export): New methods.
3083 (Object::no_export_): New field.
3084 * options.cc (General_options::parse_exclude_libs): New method.
3085 (General_options::check_excluded_libs) Same.
3086 * options.h (exclude_libs): New option.
3087 (General_options::check_excluded_libs): New method declaration.
3088 (General_options::excluded_libs_): New field.
3089 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
3090 default or protected visibility if an object has no-export flag set.
3091 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
3092 (check_SCRIPTS): Add exclude_libs_test.sh.
3093 (check_DATA): Add exclude_libs_test.syms.
3094 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
3095 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
3096 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
3097 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
3098 (exclude_libs_test.syms, libexclude_libs_test_1.a,
3099 libexclude_libs_test_2.a): New rules.
3100 * testsuite/Makefile.in: Regenerate.
3101 * testsuite/exclude_libs_test.c: New file.
3102 * testsuite/exclude_libs_test.sh: Ditto.
3103 * testsuite/exclude_libs_test_1.c: Ditto.
3104 * testsuite/exclude_libs_test_2.c: Ditto.
3105
1b77ea50
ILT
31062009-05-15 Ian Lance Taylor <iant@google.com>
3107
3108 * configure.ac: Check for declarations for cases where libiberty.h
3109 checks HAVE_DECL_xxx.
3110 * configure, config.in: Rebuild.
3111
072fe7ce
ILT
31122009-05-15 Mikolaj Zalewski <mikolajz@google.com>
3113
3114 * gold.h (Incremental_argument_list): Remove (invalid) forward
3115 declaration.
3116 * incremental.cc (Incremental_inputs::report_achive): New method.
3117 (Incremental_inputs::report_object): New method.
3118 (Incremental_inputs::report_script): New method.
3119 (Incremental_inputs::finalize_inputs): New method.
3120 (Incremental_inputs::finalize): Call finalize_inputs().
3121 (Incremental_inputs::sized_create_incremental_inputs_section_data):
3122 Create inputs entries.
3123 * incremental.h (Incremental_input_type): New enum.
3124 (Incremental_inputs::Incremental_input): Initialize new fields.
3125 (Incremental_inputs::report_inputs): New method.
3126 (Incremental_inputs::report_achive): New method.
3127 (Incremental_inputs::report_object): New method.
3128 (Incremental_inputs::report_script): New method.
3129 (Incremental_inputs::finalize_inputs): New method.
3130 (Incremental_inputs::Input_info): New struct.
3131 (Incremental_inputs::Input_info_map): New typedef.
3132 (Incremental_inputs::lock_): New field.
3133 (Incremental_inputs::Inputs_): New field.
3134 (Incremental_inputs::Inputs_map): New field.
3135 * main.cc (main): Call Incremental_input::report_inputs.
3136 * options.h (Input_argument_list): Typedef moved from
3137 Input_arguments.
3138 (Input_file_group::Files): Remove, use ::Input_argument_list.
3139 (Input_file_group::Input_argument_list): Remove, use
3140 ::Input_argument_list.
3141 * plugin.cc (Plugin_manager::add_input_file): Add error in
3142 incremental build.
3143 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
3144 functions.
3145 * script.cc (read_input_script): Call
3146 Incremental_input::report_script.
3147 * script.h (Script_info): New class.
3148
b0481b0b
ILT
31492009-04-27 Ian Lance Taylor <iant@google.com>
3150
3151 * x86_64.cc (do_adjust_output_section): Set entsize to
3152 plt_entry_size.
3153
b22a5a41 31542009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
3155
3156 * output.cc (Output_file::close): After short writes, continue
3157 writing from the correct offset in the buffer being written.
3158
40fde488
CD
31592009-04-23 Chris Demetriou <cgd@google.com>
3160
3161 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
3162 * configure: Regenerate.
3163 * config.in: Regenerate.
3164 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
3165 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
3166
3ce2c28e
ILT
31672009-04-21 Mikolaj Zalewski <mikolajz@google.com>
3168
3169 * incremental.cc (Incremental_inputs_header_data): Renamed from
3170 Incremental_input_header_data.
3171 (Incremental_inputs_header_data::data_size): New field.
3172 (Incremental_inputs_header_data::put_input_file_count): Renamed
3173 from input_file_count.
3174 (Incremental_inputs_header_data::put_command_line_offset): Renamed
3175 from command_line_offset.
3176 (Incremental_inputs_header_data::put_reserved): Renamed from
3177 put_reserved.
3178 (Incremental_inputs_entry_data): Renamed from
3179 Incremental_input_entry_data.
3180 (Incremental_inputs_entry_data::data_size): New field.
3181 (Incremental_inputs::report_command_line): New method.
3182 (Incremental_inputs::finalize): New method.
3183 (Incremental_inputs::create_incremental_inputs_data): New method.
3184 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
3185 * incremental.h: New file.
3186 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
3187 (Layout::finalize): Create incremental inputs section in
3188 incremental builds.
3189 (Layout::create_incremental_info_sections): New method.
3190 * layout.h (Layout::incremental_inputs): New method.
3191 (Layout::create_incremental_info_sections): New method.
3192 (Layout::incremental_inputs_): New field.
3193 * main.cc (main): Notify Incremental_input of the command line.
3194
e55bde5e
ILT
31952009-04-01 Ian Lance Taylor <iant@google.com>
3196 Mikolaj Zalewski <mikolajz@google.com>
3197
3198 * gold.h (reserve_unordered_map): Define, three versions, one for
3199 each version of Unordered_map.
3200 * layout.cc (Layout::Layout): Remove options parameter. Add
3201 number_of_input_files parameter. Don't initialize options_.
3202 Initialize number_of_input_files_ and resized_signatures_. Move
3203 sections_are_attached_.
3204 (Layout::layout_group): Reserve space for group_signatures_.
3205 (Layout::find_or_add_kept_section): Change name parameter to be a
3206 reference. Resize signatures_ map when it gets large enough.
3207 (Layout::layout_eh_frame): Use parameters->options() instead of
3208 this->options_.
3209 (Layout::make_output_section): Likewise.
3210 (Layout::attach_allocated_section_to_segment): Likewise.
3211 (Layout::finalize, Layout::create_executable_stack): Likewise.
3212 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
3213 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
3214 * layout.h (class Layout): Update declarations. Remove options_
3215 field. Add number_of_input_files_ and resized_signatures_
3216 fields. Move sections_are_attached_ field.
3217 * main.cc (main): Pass number of input files to Layout
3218 constructor. Don't pass options.
3219
154b857c
ILT
32202009-03-30 Ian Lance Taylor <iant@google.com>
3221
3222 * ffsll.c (ffsll): Correct implementation.
3223
2f35ab9b
ILT
32242009-03-27 Ian Lance Taylor <iant@google.com>
3225
fd03461a
ILT
3226 * ffsll.c: New file.
3227 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
3228 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
3229 * ftruncate.c (ftruncate): Declare before definition.
3230 * mremap.c (mremap): Likewise.
3231 * pread.c (pread): Likewise.
3232 * configure, Makefile.in, config.in: Rebuild.
3233
2f35ab9b
ILT
3234 * mremap.c: New file.
3235 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
3236 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
3237 (mremap): Declare if HAVE_MREMAP is not defined.
3238 * configure, Makefile.in, config.in: Rebuild.
3239
33aea2fd
CC
32402009-03-27 Cary Coutant <ccoutant@google.com>
3241
3242 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
3243 position independent.
3244 * sparc.cc (Target_sparc::check_non_pic): Likewise.
3245 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
3246
6d479619
CC
32472009-03-24 Cary Coutant <ccoutant@google.com>
3248
3249 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
3250 an executable.
3251 (needs_dynamic_reloc): Likewise.
3252
afc06bb8
ILT
32532009-03-24 Ian Lance Taylor <iant@google.com>
3254
3255 * yyscript.y (file_cmd): Recognize EXTERN.
3256 (extern_name_list, extern_name_list_body): New nonterminals.
3257 * script.cc (script_add_extern): Define.
3258 * script-c.h (script_add_extern): Declare.
3259
f6060a4d
ILT
32602009-03-24 Rafael Avila de Espindola <espindola@google.com>
3261
3262 * object.cc (is_elf_object): Define.
3263 * object.h (is_elf_object): Declare.
3264 * archive.cc (Archive::get_elf_object_for_member): Call
3265 is_elf_object.
33aea2fd 3266 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 3267
26736d8e
ILT
32682009-03-24 Elliott Hughes <enh@google.com>
3269
3270 * output.cc (Output_file::map_anonymous): Define.
3271 (Output_file::map): Use map_anonymous. If the regular mmap fails,
3272 try an anonymous one. Report the size if the mmap fails.
3273 * output.h (class Output_file): Declare map_anonymous.
3274
22fd9730
ILT
32752009-03-24 Ian Lance Taylor <iant@google.com>
3276
3277 * target-select.cc (instantiate_target): Don't acquire the lock if
3278 the instantiated_target_ field has already been set.
3279
cb010894
ILT
32802009-03-23 Ian Lance Taylor <iant@google.com>
3281
7f055c20
ILT
3282 * gold-threads.h (class Initialize_lock): Define.
3283 * gold-threads.cc (class Initialize_lock_once): Define.
3284 (initialize_lock_control): New static variable.
3285 (initialize_lock_pointer): New static variable.
3286 (initialize_lock_once): New static function.
3287 (Initialize_lock::Initialize_lock): Define.
3288 (Initialize_lock::initialize): Define.
3289 * target-select.h: Include "gold-threads.h".
3290 (class Target_selector): Add lock_ and initialize_lock_ fields.
3291 Don't define instantiate_target, just declare it.
3292 * target-select.cc (Target_selector::Target_selector): Initialize
3293 new fields.
3294 (Target_selector::instantiate_target): Define.
3295 * descriptors.h: Include "gold-threads.h".
3296 (class Descriptors): Add initialize_lock_ field.
3297 * descriptors.cc (Descriptors::Descriptors): Initialize new
3298 field.
3299 (Descriptors::open): Use initialize_lock_ field
3300 * errors.h (class Errors): Add initialize_lock_ field.
3301 * errors.cc (Errors::Errors): Initialize new field.
3302 (Errors::initialize_lock): Use initialize_lock_ field.
3303 * powerpc.cc (class Target_selector_powerpc): Remove
3304 instantiated_target_ field. In do_recognize call
3305 instantiate_target rather than do_instantiate_target. In
3306 do_instantiate_target just allocate a new target.
3307 * sparc.cc (class Target_selector_sparc): Likewise.
3308
36959681
ILT
3309 * freebsd.h: New file.
3310 * i386.cc: Include "freebsd.h".
3311 (Target_i386): Derive from Target_freebsd rather than
3312 Sized_target.
3313 (Target_selector_i386): Derive from Target_selector_freebsd rather
3314 than Target_selector.
3315 * x86_64.cc: Include "freebsd.h".
3316 (Target_x86_64): Derive from Target_freebsd rather than
3317 Sized_target.
3318 (Target_selector_x86_64): Derive from Target_selector_freebsd
3319 rather than Target_selector.
3320 * target.h (class Target): Add adjust_elf_header and
3321 do_adjust_elf_header.
3322 * output.cc (Output_file_header:: do_sized_write): Call target
3323 adjust_elf_header routine.
3324 * configure.tgt: Set targ_osabi.
3325 * configure.ac: Define GOLD_DEFAULT_OSABI.
3326 * parameters.cc (Parameters::default_target): Pass
3327 GOLD_DEFAULT_OSABI to select_target.
3328 * target-select.h (class Target_selector): Make instantiate_target
3329 protected rather than private.
3330 * Makefile.am (HFILES): Add freebsd.h.
3331 * configure, Makefile.in, config.in: Rebuild.
3332
cb010894
ILT
3333 * merge.cc (do_add_input_section): Correct pend value. Change
3334 message about last entry not being null terminated from error to
3335 warning.
3336
0e879927
ILT
33372009-03-20 Mikolaj Zalewski <mikolajz@google.com>
3338
3339 * incremental.cc: New file.
3340 * Makefile.am (CCFILES): Add incremental.cc.
3341 * Makefile.in: Rebuild.
3342
41105937
PP
33432009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
3344
3345 * layout.cc (Layout::output_section_name): Preserve names
3346 of '.note.' sections.
3347
60439920
ILT
33482009-03-19 Ian Lance Taylor <iant@google.com>
3349
3350 * descriptors.cc (Descriptors::open): Check that the options are
3351 valid before using them.
3352
0d371ad3
ILT
33532009-03-18 Ian Lance Taylor <iant@google.com>
3354
3355 * script-sections.h: Include <list>.
3356 (class Script_sections): Change Sections_elements from std::vector
3357 to std::list. Typedef public Elements_iterator. Add
3358 orphan_section_placement_, data_segment_align_start_, and
3359 saw_data_segment_align_ fields. Remove data_segment_align_index_
3360 field.
3361 * script-sections.cc (class Orphan_section_placement): New class.
3362 (class Sections_element): Add virtual functions is_relro and
3363 orphan_section_init. Remove virtual function place_orphan_here.
3364 (class Output_section_definition): Add is_relro and
3365 orphan_section_init. Remove place_orphan_here.
3366 (class Orphan_output_section): Likewise.
3367 (Script_sections::Script_sections): Update for field changes.
3368 (Script_sections::data_segment_align): Set saw_data_segment_align_
3369 and data_segment_align_start_, not data_segment_align_index.
3370 (Script_sections::data_segment_relro_end): Check
3371 saw_data_segment_align_. Use data_segment_align_start_ rather
3372 than data_segment_align_index_.
3373 (Script_sections::place_orphan): Rewrite to use
3374 Orphan_section_placement.
3375
9201d894
ILT
33762009-03-17 Ian Lance Taylor <iant@google.com>
3377
9c5b8369
ILT
3378 * archive.cc (Archive::add_symbols): Check for a version attached
3379 to the symbol name in the archive map.
3380 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
3381 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
3382 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
3383 (ver_test_11.a): New target.
3384 * testsuite/Makefile.in: Rebuild.
3385
9201d894
ILT
3386 * configure.ac: Check for chsize and posix_fallocate. Replace
3387 ftruncate.
3388 * ftruncate.c: New file, from gnulib.
3389 * output.cc (posix_fallocate): Define dummy version if not
3390 HAVE_POSIX_FALLOCATE.
3391 (Output_file::map): Call posix_fallocate rather than lseek and
3392 write.
3393 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
3394 * configure, Makefile.in, config.in: Rebuild.
3395
ef4ab7a8
PP
33962009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
3397
3398 * layout.h (Layout::create_note): Add section_name parameter.
3399 * layout.cc (Layout::create_note): Likewise.
3400 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
3401
8c500701
ILT
34022009-03-17 Ian Lance Taylor <iant@google.com>
3403
e85b18e1
ILT
3404 * descriptors.cc: Include "options.h".
3405 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
3406 (Descriptors::open): Always use O_CLOEXEC when opening a new
3407 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
3408 then set FD_CLOEXEC.
3409
9efe6174
ILT
3410 * sparc.cc (class Target_sparc): Add has_got_section.
3411 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
3412 make sure we have a GOT section.
3413
3414 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
3415 (Target_sparc::Scan::local): Likewise.
3416 (Target_sparc::Scan::global): Likewise.
3417 (Target_sparc::Relocate::relocate): Likewise.
3418 (Target_sparc::Relocate::relocate_tls): Likewise.
3419
8c500701
ILT
3420 * symtab.cc (Symbol_table::define_default_version): New function,
3421 broken out of add_from_object.
3422 (Symbol_table::add_from_object): Call define_default_version.
3423 (Symbol_table::define_special_symbol): Add resolve_oldsym
3424 parameter. Change all callers. If the version for a symbol comes
3425 from a version script, resolve it with the symbol with the same
3426 name with no version. Also add the symbol without a version if
3427 appropriate.
3428 (do_define_in_output_data): If resolving with oldsym, don't delete
3429 sym.
3430 (do_define_in_output_segment): Likewise.
3431 (do_define_as_constant): Likewise.
3432 * symtab.h (class Symbol_table): Update declarations.
3433
f1ed28fb
ILT
34342009-03-13 Ian Lance Taylor <iant@google.com>
3435
15f8229b
ILT
3436 * readsyms.cc (Read_symbols::incompatible_warning): New function.
3437 (Read_symbols::requeue): New function.
3438 (Read_symbols::do_read_symbols): If make_elf_object fails because
3439 the target type is not configured, and the file was searched for,
3440 issue a warning and retry with the next directory.
3441 (Add_symbols::run): If the file has an incompatible format, and
3442 it was searched for, requeue the Read_symbols task. On error,
3443 release the object.
3444 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
3445 dirindex parameter to constructor. Change all callers. Declare
3446 incompatible_warning and requeue.
3447 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
3448 input_argument_ and input_group_ fields. Add them to
3449 constructor. Change all callers.
3450 (class Read_script): Add dirindex_ field. Add it to constructor.
3451 Change all callers.
3452 * archive.cc (Archive::setup): Remove input_objects parameter.
3453 Change all callers.
3454 (Archive::get_file_and_offset): Likewise.
3455 (Archive::read_all_symbols): Likewise.
3456 (Archive::read_symbols): Likewise.
3457 (Archive::get_elf_object_for_member): Remove input_objects
3458 parameter. Add punconfigured parameter. Change all callers.
3459 (Archive::add_symbols): Change return type to bool. Check return
3460 value of include_member.
3461 (Archive::include_all_members): Likewise.
3462 (Archive::include_member): Change return type to bool. Return
3463 false if first included object has incompatible target. Set
3464 included_member_ field.
3465 (Add_archive_symbols::run): If add_symbols returns false, requeue
3466 Read_symbols task.
3467 * archive.h (class Archive): Add included_member_ field.
3468 Initialize it in constructor. Add input_file and searched_for
3469 methods. Update declarations.
3470 (class Add_archive_symbols): Add dirpath_, dirindex_, and
3471 input_argument_ fields. Add them to constructor. Change all
3472 callers.
3473 * script.cc: Include "target-select.h".
3474 (class Parser_closure): Add skip_on_incompatible_target_ and
3475 found_incompatible_target_ fields. Add
3476 skip_on_incompatible_target parameter to constructor. Change all
3477 callers. Add methods skip_on_incompatible_target,
3478 clear_skip_on_incompatible_target, found_incompatible_target, and
3479 set_found_incompatible_target.
3480 (read_input_script): Add dirindex parameter. Change all callers.
3481 If parser finds an incompatible target, requeue Read_symbols
3482 task.
3483 (script_set_symbol): Clear skip_on_incompatible_target in
3484 closure.
3485 (script_add_assertion, script_parse_option): Likewise.
3486 (script_start_sections, script_add_phdr): Likewise.
3487 (script_check_output_format): New function.
3488 * script.h (read_input_script): Update declaration.
3489 * script-c.h (script_check_output_format): Declare.
3490 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
3491 (ignore_cmd): Remove OUTPUT_FORMAT.
3492 * fileread.cc (Input_file::Input_file): Add explicit this.
3493 (Input_file::will_search_for): New function.
3494 (Input_file::open): Add pindex parameter. Change all callers.
3495 * fileread.h (class Input_file): Add input_file_argument method.
3496 Declare will_search_for. Update declarations.
3497 * object.cc (make_elf_object): Add punconfigured parameter.
3498 Change all callers.
3499 * object.h (class Object): Make input_file public. Add
3500 searched_for method.
3501 (make_elf_object): Update declaration.
3502 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
3503 restart search.
3504 * dirsearch.h (class Dirsearch): Update declaration.
3505 * options.h (class General_options): Add --warn-search-mismatch.
3506 * parameters.cc (Parameters::is_compatible_target): New function.
3507 * parameters.h (class Parameters): Declare is_compatible_target.
3508 * workqueue.cc (Workqueue::add_blocker): New function.
3509 * workqueue.h (class Workqueue): Declare add_blocker.
3510
f1ed28fb
ILT
3511 * fileread.cc (Input_file::open): Remove options parameter.
3512 Change all callers.
3513 (Input_file::open_binary): Likewise.
3514 * script.cc (read_input_script): Likewise.
3515 * readsyms.h (class Read_symbols): Remove options_ field. Remove
3516 options parameter from constructor. Change all callers.
3517 (class Read_script): Likewise.
3518 * fileread.h (class Input_file): Update declarations.
3519 * script.h (read_input_script): Update declaration.
3520
34dd024a
NC
35212009-03-10 Nick Clifton <nickc@redhat.com>
3522
3523 * po/es.po: New Spanish translation.
3524
6d71b17c
CC
35252009-03-06 Cary Coutant <ccoutant@google.com>
3526
3527 * options.cc (parse_short_option): Keep dash_z from registering itself.
3528
031cdbed
ILT
35292009-03-03 Ian Lance Taylor <iant@google.com>
3530
3531 PR 9918
3532 * target-reloc.h (relocate_section): Pass output_section to
3533 relocate.
3534 * i386.cc (Target_i386::should_apply_static_reloc): Add
3535 output_section parameter. Change all callers.
3536 (Target_i386::Relocate::relocate): Add output_section parameter.
3537 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3538 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3539 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3540 * testsuite/two_file_shared.sh: New script.
3541 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
3542 (check_DATA): Add two_file_shared.dbg.
3543 (two_file_shared.dbg): New target.
3544 * testsuite/Makefile.in: Rebuild.
3545
15d5fa16
ILT
35462009-03-01 Ian Lance Taylor <iant@google.com>
3547
3548 * configure.ac: Check for byteswap.h.
3549 * configure: Rebuild.
3550 * config.in: Rebuild.
3551
8a4c0b0d
ILT
35522009-03-01 Mikolaj Zalewski <mikolajz@google.com>
3553
3554 * layout.cc (Layout::find_or_add_kept_section): New function.
3555 (Layout::add_comdat): Removed.
3556 * layout.h (struct Kept_section): Move out of class Layout.
3557 Remove trailing underscores from field names. Add group_sections
3558 field. Rename group_ field to is_group. Change all uses.
3559 (class Layout): Declare find_or_add_kept_section, not add_comdat.
3560 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
3561 comdat_groups_ field.
3562 (Sized_relobj::include_section_group): Use
3563 find_or_add_kept_section and Kept_section::group_sections.
3564 (Sized_relobj::include_linkonce_section): Likewise.
3565 * object.cc (class Sized_relobj): Don't define Comdat_group or
3566 Comdat_group_table. Remove find_comdat_group and
3567 add_comdat_group. Remove comdat_groups_ field.
3568 * plugin.cc (include_comdat_group): Use
3569 Layout::find_or_add_kept_section.
3570
b4ecf66b
ILT
35712009-02-28 Ian Lance Taylor <iant@google.com>
3572
14359ca0
ILT
3573 * README: --gc-sections and map files are now supported. Document
3574 some build requirements.
3575
b4ecf66b
ILT
3576 PR 6992
3577 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
3578 relocatable link set the value of the section symbol to zero.
3579 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
3580 relocatable link don't include the section address in the local
3581 symbol value.
3582
0602e05a
ILT
35832009-02-27 Ian Lance Taylor <iant@google.com>
3584
fd9d194f
ILT
3585 PR 6811
3586 * options.h (class Search_directory): Add is_system_directory.
3587 (class General_options): Declare is_in_system_directory.
3588 * options.cc (get_relative_sysroot): Make static.
3589 (get_default_sysroot): Make static.
3590 (General_optoins::is_in_system_directory): New function.
3591 * fileread.cc (Input_file::is_in_system_directory): New function.
3592 * fileread.h (class Input_file): Declare is_in_system_directory.
3593 * object.h (class Object): Add is_in_system_directory.
3594 (class Input_objects): Remove system_library_directory_ field.
3595 * object.cc (Input_objects::add_object): Don't set
3596 system_library_directory_.
3597 (input_objects::found_in_system_library_directory): Remove.
3598 * symtab.cc (Symbol_table::write_globals): Remove input_objects
3599 parameter. Change all callers.
3600 (Symbol_table::sized_write_globals): Likewise.
3601 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
3602 Call Object::is_in_system_directory.
3603 * symtab.h (class Symbol_table): Update declarations.
3604
61edd21f
ILT
3605 PR 5990
3606 * descriptors.h (Open_descriptor): Add is_on_stack field.
3607 * descriptors.cc (Descriptors::open): If the descriptor is on the
3608 top of the stack, remove it. Initialize is_on_stack field.
3609 (Descriptors::release): Only add pod to stack if it is not on the
3610 stack already.
3611 (Descriptors::close_some_descriptor): Clear stack_next and
3612 is_on_stack fields.
3613
e29e076a
ILT
3614 PR 7091
3615 * output.cc (Output_section::find_starting_output_address): Rename
3616 from starting_output_address; add PADDR parameter; change return
3617 type.
3618 * output.h (class Output_section): Declare
3619 find_starting_output_address instead of starting_output_address.
3620 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
3621 section symbol for which we can't find a merge section.
3622
0602e05a
ILT
3623 PR 9836
3624 * symtab.cc (Symbol_table::add_from_object): If the visibility is
3625 hidden or internal, force the symbol to be local.
3626 * resolve.cc (Symbol::override_visibility): Define.
3627 (Symbol::override_base): Use override_visibility.
3628 (Symbol_table::resolve): Likewise.
3629 (Symbol::override_base_with_special): Likewise.
3630 (Symbol_table::override_with_special): If the visibility is hidden
3631 or internal, force the symbol to be local.
3632 * symtab.h (class Symbol): Add set_visibility and
3633 override_visibility.
3634 * testsuite/ver_test_1.sh: New file.
3635 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
3636 (check_DATA): Add ver_test_1.syms.
3637 (ver_test_1.syms): New target.
3638 * testsuite/Makefile.in: Rebuild.
3639
401a9a73
CC
36402009-02-25 Cary Coutant <ccoutant@google.com>
3641
3642 * layout.cc (Layout::choose_output_section): Don't rename sections
3643 when using a linker script that has a SECTIONS clause.
3644 * Makefile.in: Regenerate.
3645
3646 * testsuite/Makefile.am (script_test_5.sh): New test case.
3647 * testsuite/Makefile.in: Regenerate.
3648 * testsuite/script_test_5.cc: New file.
3649 * testsuite/script_test_5.sh: New file.
3650 * testsuite/script_test_5.t: New file.
3651
f488e4b0
CC
36522009-02-13 Rafael Avila de Espindola <espindola@google.com>
3653
3654 * archive.cc (Archive::include_member): Update calls to add_symbols.
3655 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
3656 the Layout argument.
3657 * dynobj.h (do_add_symbols): Add the Layout argument.
3658 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
3659 Layout argument.
3660 * object.h (Object::add_symbols): Add the Layout argument.
3661 (Object::do_add_symbols): Add the Layout argument.
3662 (Sized_relobj::do_add_symbols): Add the Layout argument.
3663 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
3664 Unify the two versions.
3665 (Add_plugin_symbols): Remove.
3666 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
3667 (Sized_pluginobj::do_add_symbols): Unify the two versions.
3668 (Add_plugin_symbols): Remove.
3669 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
3670 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
3671 (Add_symbols::run): Make it work with Pulginobj.
3672
89dd1680
ILT
36732009-02-06 Ian Lance Taylor <iant@google.com>
3674
3675 * object.cc (Sized_relobj::do_layout): Make info message start
3676 with lower case letter.
3677
266d0a74
ILT
36782009-02-06 Mikolaj Zalewski <mikolajz@google.com>
3679
602b464e
ILT
3680 * binary.cc: Fix file comment.
3681
266d0a74
ILT
3682 * options.h (enum Incremental_disposition): Define.
3683 (class General_options): Add new options: --incremental,
3684 --incremental_changed, --incremental_unchanged,
3685 --incremental_unknown. Add incremental_disposition_ and
3686 implicit_incremental_ fields.
3687 (General_options::incremental_disposition): New function.
3688 (class Position_dependent_options): Add incremental_disposition
3689 option.
3690 (Position_dependent_options::copy_from_options): Set incremental
3691 dispositions.
3692 * options.cc (General_options::parse_incremental_changed): New
3693 function.
3694 (General_options::parse_incremental_unchanged): New function.
3695 (General_options::parse_incremental_unknown): New function.
3696 (General_options::General_options): Initialize new fields
3697 incremental_disposition_ and implicit_incremental_.
3698 (General_options::finalize): Check for uasge of --incremental-*
3699 without --incremental.
3700
f073bbf7
CD
37012009-02-06 Chris Demetriou <cgd@google.com>
3702
3703 * gold.h (gold_undefined_symbol): Change to take only a Symbol
3704 pointer and to report location as the file name associated with
3705 the symbol.
3706 (gold_undefined_symbol_at_location): New function to replace the
3707 old gold_undefined_symbol functionality.
3708 * target-reloc.h (relocate_section): Update to use
3709 gold_undefined_symbol_at_location.
3710 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
3711 Call gold_undefined_symbol function rather than gold_error.
3712 * errors.h (Errors::undefined_symbol): Take location as a
3713 string, rather than calculating it from a relocation.
3714 * errors.cc (Errors::fatal): Print "fatal error:" before the
3715 formatted message.
3716 (Errors::error, Errors::error_at_location): Print "error: "
3717 before the formatted message.
3718 (Errors::undefined_symbol): Take location as a string, rather
3719 than calculating it from a relocation.
3720 (gold_undefined_symbol_at_location): New function akin to
3721 old gold_undefined_symbol, calculates location from relocation.
3722 (gold_undefined_symbol): Change to take only a Symbol pointer
3723 and to report location as the file name associated with the symbol.
3724 * testsuite/debug_msg.sh: Update for changed error messages.
3725 * testsuite/undef_symbol.sh: Likewise.
3726
8e94a90c
ILT
37272009-02-04 Duncan Sands <baldrick@free.fr>
3728
3729 PR 9812
3730 * reduced_debug_output.h
3731 (Output_reduced_debug_abbrev_section::failed): Use format for
3732 gold_warning.
3733 (Output_reduced_debug_info_section::faild): Likewise.
3734
88a0e15b
ILT
37352009-01-31 Mikolaj Zalewski <mikolajz@google.com>
3736
3737 * script.cc (Lazy_demangler): New class.
3738 (Version_script_info::get_symbol_version_helper): Demangle a
3739 symbol only once.
3740
5efc7cd2
CC
37412009-01-29 Cary Coutant <ccoutant@google.com>
3742
3743 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
3744 to __tls_get_addr.
3745 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3746
e0ebcf42
ILT
37472009-01-28 Ian Lance Taylor <iant@google.com>
3748
5efc7cd2 3749 * version.cc (version_string): Bump to 1.9.
75fe7426 3750
e0ebcf42
ILT
3751 * gold.h: Include <cstring> and <stdint.h>.
3752 * version.cc: Include <cstdio>.
3753 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
3754 warning.
3755 * reduced_debug_output.cc (insert_into_vector): Rename from
3756 Insert_into_vector; change all callers. Use Swap_unaligned to
3757 avoid aliasing issue; remove union since it is unnecessary.
3758
8e2813be 37592009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
3760
3761 * Makefile.am (CCFILES): Add gc.cc.
3762 (HFILES): Add gc.h.
3763 * Makefile.in: Regenerate.
3764 * gold.cc (Gc_runner): New class.
3765 (queue_initial_tasks): Call garbage collection related tasks
3766 when corresponding options are invoked.
3767 (queue_middle_gc_tasks): New function.
3768 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
3769 processed early before laying out sections during garbage collection.
3770 * gold.h (queue_middle_gc_tasks): New function.
3771 (is_prefix_of): Move from "layout.cc".
3772 * i386.cc (Target_i386::gc_process_relocs): New function.
3773 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
3774 * main.cc (main): Create object of class "Garbage_collection".
3775 * object.cc (Relobj::copy_symbols_data): New function.
3776 (Relobj::is_section_name_included): New function.
3777 (Sized_relobj::do_layout): Allow this function to be called twice
3778 during garbage collection and defer layout of section during the
3779 first call.
3780 * object.h (Relobj::get_symbols_data): New function.
3781 (Relobj::is_section_name_included): New function.
3782 (Relobj::copy_symbols_data): New function.
3783 (Relobj::set_symbols_data): New function.
3784 (Relobj::get_relocs_data): New function.
3785 (Relobj::set_relocs_data): New function.
3786 (Relobj::is_output_section_offset_invalid): New pure virtual function.
3787 (Relobj::gc_process_relocs): New function.
3788 (Relobj::do_gc_process_relocs): New pure virtual function.
3789 (Relobj::sd_): New data member.
3790 (Sized_relobj::is_output_section_offset_invalid): New function.
3791 (Sized_relobj::do_gc_process_relocs): New function.
3792 * options.h (General_options::gc_sections): Modify to not be a no-op.
3793 (General_options::print_gc_sections): New option.
3794 * plugin.cc (Plugin_finish::run): Remove function call to
3795 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
3796 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
3797 * reloc.cc (Read_relocs::run): Add task to process relocs and
3798 determine unreferenced sections when doing garbage collection.
3799 (Gc_process_relocs): New class.
3800 (Sized_relobj::do_gc_process_relocs): New function.
3801 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
3802 sections that are garbage collected.
3803 * reloc.h (Gc_process_relocs): New class.
3804 * sparc.cc (Target_sparc::gc_process_relocs): New function.
3805 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
3806 symbols whose corresponding sections are garbage collected.
3807 (Symbol_table::Symbol_table): Add new parameter for the garbage
3808 collection object.
3809 (Symbol_table::gc_mark_undef_symbols): New function.
3810 (Symbol_table::gc_mark_symbol_for_shlib): New function.
3811 (Symbol_table::gc_mark_dyn_syms): New function.
3812 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
3813 as garbage.
3814 (Symbol_table::add_from_object): Likewise.
3815 (Symbol_table::add_from_relobj): When building shared objects, do not
3816 treat externally visible symbols as garbage.
3817 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
3818 table information for static and relocatable links.
3819 * symtab.h (Symbol_table::set_gc): New function.
3820 (Symbol_table::gc): New function.
3821 (Symbol_table::gc_mark_undef_symbols): New function.
3822 (Symbol_table::gc_mark_symbol_for_shlib): New function.
3823 (Symbol_table::gc_mark_dyn_syms): New function.
3824 (Symbol_table::gc_): New data member.
3825 * target.h (Sized_target::gc_process_relocs): New pure virtual
3826 function.
3827 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
3828 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
3829
3b293544
CF
38302009-01-20 Chris Faylor <me.sourceware@sourceware.org>
3831
3832 * options.h (General_options::gc_sections): Define as a no-op for now.
3833 (General_options::no_keep_memory): Ditto.
3834 (General_options::Bshareable): Define.
3835 * options.cc (General_options::finalize): Honor -Bshareable.
3836
83d22aa8
AS
38372009-01-20 Andreas Schwab <schwab@suse.de>
3838
3839 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
3840 read the value in the contents, since we don't use it. Use the
3841 template endianness when writing.
3842 (Relocate::relocate): Use it for R_PPC_REL16_HA.
3843
cd536b21
AS
38442009-01-19 Andreas Schwab <schwab@suse.de>
3845
3846 * configure.tgt (powerpc64-*): Fix targ_obj.
3847
99e9a495
ILT
38482009-01-15 Ian Lance Taylor <iant@google.com>
3849
3850 * object.cc (Sized_relobj::write_local_symbols): Don't write out
3851 local symbols when stripping all symbols.
3852
bbbfea06
CC
38532009-01-14 Cary Coutant <ccoutant@google.com>
3854
99e9a495 3855 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 3856
0f7c0701
CC
38572009-01-14 Cary Coutant <ccoutant@google.com>
3858
3859 * archive.cc (Archive::get_elf_object_for_member): Remove call
3860 to File_read::claim_for_plugin.
3861 * descriptors.cc (Descriptors::open): Remove reference to
3862 is_claimed.
3863 (Descriptors::claim_for_plugin): Remove.
3864 * descriptors.h (Descriptors::claim_for_plugin): Remove.
3865 (Descriptors::is_claimed): Remove.
3866 (claim_descriptor_for_plugin): Remove.
3867 * fileread.cc (File_read::claim_for_plugin): Remove.
3868 * fileread.h (File_read::claim_for_plugin): Remove.
3869 (File_read::descriptor): Reopen descriptor if necessary.
3870 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
3871 (Plugin_manager::all_symbols_read): Add task parameter. Change
3872 all callers.
3873 (Plugin_manager::get_input_file): New function.
3874 (Plugin_manager::release_input_file): New function.
3875 (Pluginobj::Pluginobj): Add filesize parameter and initialize
3876 corresponding data member.
3877 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
3878 and pass to base constructor. Change all callers.
3879 (get_input_file, release_input_file): New functions.
3880 (make_sized_plugin_object): Add filesize parameter. Change all callers.
3881 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
3882 (Plugin_manager::all_symbols_read): Add task parameter.
3883 (Plugin_manager::get_input_file): New function.
3884 (Plugin_manager::release_input_file): New function.
3885 (Plugin_manager::task_): New data member.
3886 (Pluginobj::Pluginobj): Add filesize parameter.
3887 (Pluginobj::filename): New function.
3888 (Pluginobj::descriptor): New function.
3889 (Pluginobj::filesize): New function.
3890 (Pluginobj::filesize_): New data member.
3891 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
3892 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
3893 File_read::claim_for_plugin; use Object::unlock to unlock the file.
3894
3895 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
3896 with archive libraries.
3897 * testsuite/Makefile.in: Regenerate.
3898 * testsuite/plugin_test.c (struct sym_info): New type.
3899 (get_input_file, release_input_file): New static variables.
3900 (onload): Capture new transfer vector entries.
3901 (claim_file_hook): Stop reading at end of file according to filesize.
3902 Factor out parsing of readelf output into separate function.
3903 (all_symbols_read_hook): Exercise get_input_file and release_input_file
3904 APIs and get the source file name from the symbol table. Convert
3905 source file name to corresponding object file name. Print info
3906 message when adding new input files.
3907 (parse_readelf_line): New function.
3908 * testsuite/plugin_test_1.sh: Add checks for new info messages.
3909 * testsuite/plugin_test_2.sh: Likewise.
3910 * testsuite/plugin_test_3.sh: Likewise.
3911 * testsuite/plugin_test_4.sh: New test case.
3912
62a6d109
ILT
39132009-01-07 Ian Lance Taylor <iant@google.com>
3914
3915 * version.cc (version_string): Bump to 1.8.
3916
483620e8
CC
39172008-12-23 Cary Coutant <ccoutant@google.com>
3918
3919 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
3920 * plugin.cc (Plugin_manager::finish): Rename as
3921 layout_deferred_objects. Move cleanup to separate function.
3922 (Plugin_manager::cleanup): New function.
3923 (Plugin_finish::run): Call layout_deferred_objects and cleanup
3924 separately.
3925 * plugin.h (Plugin_manager::finish): Rename as
3926 layout_deferred_objects.
3927 (Plugin_manager::cleanup): New function.
3928 (Plugin_manager::cleanup_done): New field.
3929
d66a9eb3
CC
39302008-12-23 Cary Coutant <ccoutant@google.com>
3931
3932 * plugin.cc (is_visible_from_outside): New function.
3933 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
3934 so we don't return "IR only" status for exported symbols or -r links.
3935
3936 * testsuite/Makefile.am (plugin_test_3): New test case.
3937 * testsuite/Makefile.in: Regenerate.
3938 * testsuite/plugin_test_3.sh: New file.
3939
5995b570
CC
39402008-12-22 Cary Coutant <ccoutant@google.com>
3941
3942 * object.cc (Sized_relobj::layout_section): New function.
3943 (Sized_relobj::do_layout): Defer layout of input sections until after
3944 plugin has provided replacement files.
3945 (Sized_relobj::do_layout_deferred_sections): New function.
3946 * object.h (Relobj::set_section_offset): Remove virtual keyword.
3947 (Relobj::layout_deferred_sections): New function.
3948 (Relobj::do_layout_deferred_sections): New function.
3949 (Sized_relobj::do_layout_deferred_sections): New function.
3950 (Sized_relobj::layout_section): New function.
3951 (Sized_relobj::Deferred_layout): New structure.
3952 (Sized_relobj::deferred_layout_): New field.
3953 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
3954 Change all callers. Layout deferred sections.
3955 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
3956 references.
3957 (Plugin_hook::run): Move code from do_plugin_hook inline.
3958 (Plugin_hook::do_plugin_hook): Remove.
3959 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
3960 (Plugin_manager::finish): Renamed, was cleanup.
3961 (Plugin_manager::should_defer_layout): New function.
3962 (Plugin_manager::add_deferred_layout_object): New function.
3963 (Plugin_manager::Deferred_layout_list): New type.
3964 (Plugin_manager::deferred_layout_objects_): New field.
3965 (Plugin_hook::do_plugin_hook): Remove.
3966
ee769c88
ILT
39672008-12-17 Ian Lance Taylor <iant@google.com>
3968
3969 * options.h (class General_options): Add --no case for
3970 --export-dynamic.
3971
abc8dcba
CC
39722008-12-16 Cary Coutant <ccoutant@google.com>
3973
3974 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
3975 vector.
3976 (Plugin_manager::claim_file): Create plugin object even if
3977 plugin did not call the add_symbols callback.
3978 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
3979 asking for more symbols than were added.
3980 * testsuite/Makefile.am (plugin_test_1): Add test case with
3981 no global symbols.
3982 (empty.syms): New target.
3983 * testsuite/Makefile.in: Regenerate.
3984 * testsuite/plugin_test.c (claim_file_hook): Add new debug
3985 message. Don't call add_symbols if no globals.
3986 (all_symbols_read_hook): Don't provide replacement for empty
3987 claimed file.
3988
b0074644
ILT
39892008-12-12 Ian Lance Taylor <iant@google.com>
3990
68943102
ILT
3991 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
3992 r_type == 0 for a local symbol with r_sym == 0.
3993 (scan_relocatable_relocs): Pass r_sym to
3994 local_non_section_strategy.
3995 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
3996 r_sym parameter.
3997
b0074644
ILT
3998 * configure.ac: Update test for TLS descriptors: they are
3999 supported as of glibc 2.9.
4000 * configure: Rebuild.
4001
c2508178
ILT
40022008-12-11 Ian Lance Taylor <iant@google.com>
4003
4004 PR 7091
4005 * target-reloc.h (Default_scan_relocatable_relocs): For each
4006 function, map r_type == 0 to RELOC_DISCARD.
4007
2756a258
CC
40082008-12-10 Cary Coutant <ccoutant@google.com>
4009
4010 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
4011 object to override a kept COMDAT group from a plugin object.
4012
bb6f53d3
ILT
40132008-12-09 Ian Lance Taylor <iant@google.com>
4014
fbc558e1
ILT
4015 PR 7088
4016 * yyscript.y (file_cmd): Handle INPUT.
4017
bb6f53d3
ILT
4018 * testsuite/initpri1.c: Change all declarations to be full
4019 prototypes by adding void, to avoid compiler warnings.
4020
4674ecfc
CC
40212008-12-05 Rafael Avila de Espindola <espindola@google.com>
4022
4023 * options.cc (General_options::parse_plugin_opt): New.
4024 (General_options::add_plugin): The argument now is just the filename.
4025 (General_options::add_plugin_option): New.
4026 * options.h (plugin_opt): New.
4027 (add_plugin): Change argument name.
4028 (add_plugin_option): New.
4029 * plugin.cc (Plugin::load): Don't parse the plugin option.
4030 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
4031 (Plugin::add_option): New.
4032 (Plugin::args_): Change type.
4033 (Plugin::filename_): New.
4034 (Plugin_manager::add_plugin_option): New.
4035 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
4036 * testsuite/Makefile.in: Regenerate.
4037
fd06b4aa
CC
40382008-12-05 Cary Coutant <ccoutant@google.com>
4039
4040 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
4041 Handle --strip-lto-sections option.
4042 * options.h (strip_lto_sections): New option.
4043
6c52134c
CC
40442008-12-01 Cary Coutant <ccoutant@google.com>
4045
4046 * plugin.cc (ld_plugin_message): Change format parameter to const.
4047 Fix mismatch between new[] and delete.
4048
a45248e0
CC
40492008-11-14 Cary Coutant <ccoutant@google.com>
4050
4051 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
4052 instead of -1U.
4053
c82fbeee
CS
40542008-11-05 Craig Silverstein <csilvers@google.com>
4055
4056 * options.cc (General_options::parse_dynamic_list): New function.
4057 * options.h (General_options): New flags dynamic_list,
4058 dynamic_list_data, dynamic_list_cpp_new, and
4059 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
4060 (General_options::in_dynamic_list): New function.
4061 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
4062 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
4063 (Lex::can_continue_name): Likewise.
4064 (yylex): Likewise.
4065 (read_script_file): New parameter script_options.
4066 (read_dynamic_list): New function.
4067 (Script_options::define_dynamic_list): New function.
4068 (dynamic_list_keyword_parsecodes): New variable.
4069 (dynamic_list_keywords): New variable.
4070 * script.h (Script_options::define_dynamic_list): New function
4071 prototype.
4072 (read_dynamic_list): New function prototype.
4073 * symtab.cc (strprefix): New macro.
4074 (Symbol::should_add_dynsym_entry): Support dynamic_list,
4075 dynamic_list_data, dynamic_list_cpp_new, and
4076 dynamic_list_cpp_typeinfo.
4077 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
4078 (dynamic_list_expr): New rule.
4079 (dynamic_list_nodes): Likewise.
4080 (dynamic_list_node): Likewise.
4081 * testsuite/Makefile.am (dynamic_list): New test.
4082 * testsuite/Makefile.in: Regenerated.
4083 * testsuite/dynamic_list.t: New file.
4084 * testsuite/dynamic_list.sh: New file.
4085
e0bb29a5
CS
40862008-11-05 Craig Silverstein <csilvers@google.com>
4087
4088 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
4089 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
4090 (t11_last): Likewise.
4091 * testsuite/ver_test_6.c (main): Likewise.
4092
4e1e25e0
CC
40932008-10-07 Cary Coutant <ccoutant@google.com>
4094
4095 * options.c (General_options::finalize): Add check for -static and
4096 -shared.
4097 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
4098 is not empty.
4099
92f03fcb
CC
41002008-10-02 Cary Coutant <ccoutant@google.com>
4101
4102 * plugin.cc (make_sized_plugin_object): Fix conditional
4103 compilation to work when not all targets are enabled.
4104
fbd8a257
CC
41052008-09-29 Cary Coutant <ccoutant@google.com>
4106
4107 * archive.cc (Archive::get_file_and_offset): Use filename instead
4108 of name to get library path.
4109 (Archive::include_member): Unlock external member of a thin archive.
4110
4111 * testsuite/Makefile.am (TEST_AR): New variable.
4112 (thin_archive_test_1): New test.
4113 (thin_archive_test_2): New test.
81636b3f
CC
4114 * testsuite/Makefile.in: Regenerate.
4115 * testsuite/thin_archive_main.cc: New file.
4116 * testsuite/thin_archive_test_1.cc: New file.
4117 * testsuite/thin_archive_test_2.cc: New file.
4118 * testsuite/thin_archive_test_3.cc: New file.
4119 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 4120
eff45813
CC
41212008-09-29 Cary Coutant <ccoutant@google.com>
4122
4123 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
4124 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
4125 instead of -1U.
4126 (Sized_relobj::do_finalize_local_symbols): Likewise.
4127 (Sized_relobj::map_to_kept_section): Likewise.
4128 * object.h (Sized_relobj::invalid_address): New constant.
4129 (Sized_relobj::do_output_section_offset): Check for invalid_address
4130 and return -1ULL.
4131 * output.cc (Output_reloc::local_section_offset): Use constant
4132 invalid_address instead of -1U.
4133 (Output_reloc::get_address): Likewise.
4134 (Output_section::output_address): Change -1U to -1ULL.
4135 * output.h (Output_reloc::invalid_address): New constant.
4136 * reloc.cc (Sized_relobj::write_sections): Use constant
4137 invalid_address instead of -1U.
4138 (Sized_relobj::relocate_sections): Likewise.
4139 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
4140 values for merge sections.
4141 * target-reloc.h (relocate_for_relocatable): Use constant
4142 invalid_address instead of -1U.
4143
89fc3421
CC
41442008-09-19 Cary Coutant <ccoutant@google.com>
4145
4146 Add plugin functionality for link-time optimization (LTO).
4147 * configure.ac (plugins): Add --enable-plugins option.
4148 * configure: Regenerate.
4149 * config.in: Regenerate.
4150 * Makefile.am (LIBDL): New variable.
4151 (CCFILES): Add plugin.cc.
4152 (HFILES): Add plugin.h.
4153 (ldadd_var): Add LIBDL.
4154 * Makefile.in: Regenerate.
4155
4156 * archive.cc: Include "plugin.h".
4157 (Archive::setup): Don't preread archive symbols when using a plugin.
4158 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
4159 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
4160 files.
4161 (Archive::include_member): Add symbols from plugin objects.
4162 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
4163 * descriptors.cc (Descriptors::open): Check for file descriptors
4164 abandoned by plugins.
4165 (Descriptors::claim_for_plugin): New function.
4166 * descriptors.h (Descriptors::claim_for_plugin): New function.
4167 (Open_descriptor::is_claimed): New field.
4168 (claim_descriptor_for_plugin): New function.
4169 * fileread.cc (File_read::claim_for_plugin): New function.
4170 * fileread.h (File_read::claim_for_plugin): New function.
4171 (File_read::descriptor): New function.
4172 * gold.cc: Include "plugin.h".
4173 (queue_initial_tasks): Add task to call plugin hooks for generating
4174 new object files.
4175 * main.cc: Include "plugin.h".
4176 (main): Load plugin libraries.
4177 * object.h (Pluginobj): Declare.
4178 (Object::pluginobj): New function.
4179 (Object::do_pluginobj): New function.
4180 (Object::set_target): New function.
4181 * options.cc: Include "plugin.h".
4182 (General_options::parse_plugin): New function.
4183 (General_options::General_options): Initialize plugins_ field.
4184 (General_options::add_plugin): New function.
4185 * options.h (Plugin_manager): Declare.
4186 (General_options): Add --plugin option.
4187 (General_options::has_plugins): New function.
4188 (General_options::plugins): New function.
4189 (General_options::add_plugin): New function.
4190 (General_options::plugins_): New field.
4191 * plugin.cc: New file.
4192 * plugin.h: New file.
4193 * readsyms.cc: Include "plugin.h".
4194 (Read_symbols::do_read_symbols): Check for archive before checking
4195 for ELF file. Call plugin hooks to claim files.
4196 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
4197 from a real object file; force override when processing replacement
4198 files.
4199 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
4200 (Symbol::init_base_object): Likewise.
4201 (Symbol::init_base_output_data): Likewise.
4202 (Symbol::init_base_output_segment): Likewise.
4203 (Symbol::init_base_constant): Likewise.
4204 (Symbol::init_base_undefined): Likewise.
4205 (Symbol::output_section): Assert that object is not a plugin.
4206 (Symbol_table::add_from_pluginobj): New function.
4207 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
4208 undefined.
4209 (Symbol_table::sized_write_globals): Likewise.
4210 (Symbol_table::add_from_pluginobj): Instantiate template.
4211 * symtab.h (Sized_pluginobj): Declare.
4212 (Symbol::in_real_elf): New function.
4213 (Symbol::set_in_real_elf): New function.
4214 (Symbol::in_real_elf_): New field.
4215 (Symbol_table::add_from_pluginobj): New function.
4216
4217 * testsuite/Makefile.am (AM_CFLAGS): New variable.
4218 (LIBDL): New variable.
4219 (LDADD): Add LIBDL.
4220 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
4221 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
4222 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
4223 (MOSTLYCLEANFILES): Likewise.
4224 * testsuite/Makefile.in: Regenerate.
4225 * testsuite/plugin_test.c: New file.
4226 * testsuite/plugin_test_1.sh: New file.
4227 * testsuite/plugin_test_2.sh: New file.
4228
de31bda5
ILT
42292008-09-16 Ian Lance Taylor <iant@google.com>
4230
9c2d0ef9
ILT
4231 * target-reloc.h (relocate_section): Check whether a symbol is
4232 defined by the ABI before reporting an undefined symbol error.
4233 * target.h (Target::is_defined_by_abi): Make parameter const.
4234 (Target::do_is_defined_by_abi): Likewise.
4235 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
4236 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
4237 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
4238 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
4239 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
4240 * testsuite/Makefile.in: Rebuild.
4241
de31bda5
ILT
4242 * fileread.cc (make_view): Add casts to avoid warning.
4243
9fa33bee
AO
42442008-09-16 Alexandre Oliva <aoliva@redhat.com>
4245
4246 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
4247 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
4248
183fd0e3
AO
42492008-09-16 Alexandre Oliva <aoliva@redhat.com>
4250
4251 * options.h (General_options::output_is_executable): New.
4252 (General_options::output_is_pie): New.
4253 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
4254 for shared libraries.
4255 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
4256
7be8330a
CD
42572008-09-11 Chris Demetriou <cgd@google.com>
4258
4259 * options.h (origin): New -z option.
4260 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
4261 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
4262 in DT_FLAGS_1.
4263
a9caad02
CC
42642008-09-05 Cary Coutant <ccoutant@google.com>
4265
4266 * fileread.cc (File_read::make_view): Add check for attempt to map
4267 beyond end of file.
4268
ae6dce4d
CC
42692008-09-05 Cary Coutant <ccoutant@google.com>
4270
4271 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
4272 explicit instantiations.
4273
d7ab2a47
KVH
42742008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
4275
4276 PR gold/6858
4277 * options.cc (General_options::finalize): Allow undefined symbols
4278 in shlibs if linking -shared.
4279
4280 PR gold/6859
4281 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
4282 symbols as not needing a dynsym entry.
4283
1e52a9c1
CS
42842008-08-20 Craig Silverstein <csilvers@google.com>
4285
4286 * fileread.cc (File_read::open): Do not lock the file unless it
4287 was successfully opened.
4288
d85c80a3
CC
42892008-08-14 Cary Coutant <ccoutant@google.com>
4290
4291 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
4292 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
4293 * testsuite/tls_test.cc (struct int128): 128-bit struct
4294 for testing TLS relocs with non-zero addend.
4295 (v12): New TLS variable.
4296 (t12): New test.
4297 (t_last): Add check for v12.
4298 * testsuite/tls_test.h (t12): New function.
4299 * testsuite/tls_test_main.cc (thread_routine): Call new test.
4300
2d924fd9
ILT
43012008-08-13 Ian Lance Taylor <iant@google.com>
4302
4303 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
4304 set tls_segment_ or relro_segment_.
4305 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
4306 when appropriate.
4307 * output.h (Output_section::clear_is_relro): New function.
4308 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
4309 sections specially even when output_data_ is empty.
4310 (Output_segment::maximum_alignment): When first section is relro,
4311 only force alignment for PT_LOAD segments.
4312 * script.cc (script_data_segment_align): New function.
4313 (script_data_segment_relro_end): New function.
4314 * script-c.h (script_data_segment_align): Declare.
4315 (script_data_segment_relro_end): Declare.
4316 * script-sections.h (class Script_sections): Declare
4317 data_segment_align and data_segment_relro_end. Add fields
4318 segment_align_index_ and saw_relro_end_.
4319 * script-sections.cc (class Sections_element): Add set_is_relro
4320 virtual function. Add new bool* parameter to place_orphan_here.
4321 Add get_output_section virtual function.
4322 (class Output_section_definition): Add set_is_relro. Add new
4323 bool* parameter to place_orphan_here. Add get_output_section.
4324 Add is_relro_ field.
4325 (Output_section_definition::Output_section_definition): Initialize
4326 evaluated_address_, evaluated_load_address, evaluated_addralign_,
4327 and is_relro_ fields.
4328 (Output_section_definition::place_orphan_here): Add is_relro
4329 parameter.
4330 (Output_section_definition::set_section_addresses): Set relro for
4331 output section.
4332 (Output_section_definition::alternate_constraint): Likewise.
4333 (class Orphan_output_section): Add new bool* parameter to
4334 place_orphan_here. Add get_output_section.
4335 (Orphan_output_section::place_orphan_here): Add is_relro
4336 parameter.
4337 (Script_sections::Script_sections): Initialize
4338 data_segment_align_index_ and saw_relro_end_.
4339 (Script_sections::data_segment_align): New function.
4340 (Script_sections::data_segment_relro_end): New function.
4341 (Script_sections::place_orphan): Set or clear is_relro.
4342 (Script_sections::set_section_addresses): Force alignment of first
4343 TLS section.
4344 * yyscript.y (exp): Call script_data_segment_align and
4345 script_data_segment_relro_end.
4346 * testsuite/relro_script_test.t: New file.
4347 * testsuite/relro_test.cc (using_script): Declare.
4348 (t1, t2): Test using_script.
4349 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
4350 (relro_script_test_SOURCES): Define.
4351 (relro_script_test_DEPENDENCIES): Define.
4352 (relro_script_test_LDFLAGS): Define.
4353 (relro_script_test_LDADD): Define.
4354 (relro_script_test.so): New target.
4355 * testsuite/Makefile.in: Rebuild.
4356
f827c9a9
CC
43572008-08-06 Cary Coutant <ccoutant@google.com>
4358
4359 * archive.cc (Archive::total_archives, Archive::total_members)
4360 (Archive::total_members_loaded): New variables.
4361 (Archive::setup): Add parameter. Add option to preread
4362 archive symbols.
4363 (Archive::read_armap): Add counter.
4364 (Archive::get_file_and_offset): New function.
4365 (Archive::get_elf_object_for_member): New function.
4366 (Archive::read_all_symbols): New function.
4367 (Archive::read_symbols): New function.
4368 (Archive::add_symbols): Add counters.
4369 (Archive::include_all_members): Use armap to find members if it's
4370 already built.
4371 (Archive::include_member): Skip reading symbols if already read.
4372 Factored code into Archive::get_file_and_offset and
4373 Archive::get_elf_object_for_member. Changed call to
4374 Mapfile::report_include_archive_member.
4375 (Archive::print_stats): New function.
4376 * archive.h: Declare Object and Read_symbols_data classes.
4377 (Archive::Archive): Add initializers for new members.
4378 (Archive::setup): Add parameter.
4379 (Archive::print_stats): New function.
4380 (Archive::total_archives, Archive::total_members)
4381 (Archive::total_members_loaded): New variables.
4382 (Archive::get_file_and_offset): New function.
4383 (Archive::get_elf_object_for_member): New function.
4384 (Archive::read_all_symbols): New function.
4385 (Archive::read_symbols): New function.
4386 (Archive::Archive_member): New class.
4387 (Archive::members_): New member.
4388 (Archive::num_members_): New member.
4389 * main.cc: Include archive.h.
4390 (main): Call Archive::print_stats.
4391 * mapfile.cc (Mapfile::report_include_archive_member): Delete
4392 archive parameter; member_name is now the fully-decorated name.
4393 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
4394 * options.h: (General_options): Add --preread-archive-symbols option.
4395 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
4396 Archive::setup.
4397
de4c45bd
ILT
43982008-08-04 Ian Lance Taylor <iant@google.com>
4399
4400 * symtab.h (Symbol::use_plt_offset): New function.
4401 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
4402 * powerpc.cc (Relocate::relocate): Likewise.
4403 * sparc.cc (Relocate::relocate): Likewise.
4404 * x86_64.cc (Relocate::relocate): Likewise.
4405 * testsuite/weak_plt.sh: New test.
4406 * testsuite/weak_plt_main.cc: New test.
4407 * testsuite/weak_plt_shared.cc: New test.
4408 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
4409 (check_PROGRAMS): Add weak_plt.
4410 (check_DATA): Add weak_plt_shared.so.
4411 (weak_plt_main_pic.o, weak_plt): New targets.
4412 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
4413 * testsuite/Makefile.in: Rebuild.
4414
4415 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
4416 gcctestdir/ld.
4417 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
4418 * testsuite/Makefile.in: Rebuild.
4419
323ee3f4
AM
44202008-08-04 Alan Modra <amodra@bigpond.net.au>
4421
4422 * Makefile.am (POTFILES.in): Set LC_ALL=C.
4423 * Makefile.in: Regenerate.
4424 * po/POTFILES.in: Regenerate.
4425
7c07ecec
ILT
44262008-07-29 Ian Lance Taylor <iant@google.com>
4427
4428 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
4429 symbols before other symbols.
4430 * testsuite/script_test_2.cc (test_addr): Declare.
4431 (test_addr_alias): Declare.
4432 (main): Check that test_addr and test_addr_alias have the right
cd536b21 4433 values.
7c07ecec
ILT
4434 * testsuite/script_test_2.t: Define test_addr_alias and
4435 test_addr.
4436
5778530e
ILT
44372008-07-24 Ian Lance Taylor <iant@google.com>
4438
2a00e4fb
ILT
4439 PR 5990
4440 * descriptors.cc: New file.
4441 * descriptors.h: New file.
4442 * gold-threads.h (class Hold_optional_lock): New class.
4443 * fileread.cc: Include "descriptors.h".
4444 (File_read::~File_read): Release descriptor rather than closing
4445 it.
4446 (File_read::open) [file]: Call open_descriptor rather than open.
4447 Set is_descriptor_opened_.
4448 (File_read::open) [memory]: Assert that descriptor is not open.
4449 (File_read::reopen_descriptor): New function.
4450 (File_read::release): Release descriptor.
4451 (File_read::do_read): Make non-const. Reopen descriptor.
4452 (File_read::read): Make non-const.
4453 (File_read::make_view): Reopen descriptor.
4454 (File_read::do_readv): Likewise.
4455 * fileread.h (class File_read): Add is_descriptor_opened_ field.
4456 Update declarations.
4457 * layout.cc: Include "descriptors.h".
4458 (Layout::create_build_id): Use open_descriptor rather than open.
4459 * output.cc: Include "descriptors.h".
4460 (Output_file::open): Use open_descriptor rather than open.
4461 * archive.cc (Archive::const_iterator): Change Archive to be
4462 non-const.
4463 (Archive::begin, Archive::end): Make non-const.
4464 (Archive::count_members): Likewise.
4465 * archive.h (class Archive): Update declarations.
4466 * object.h (Object::read): Make non-const.
4467 * Makefile.am (CCFILES): Add descriptors.cc.
4468 (HFILES): Add descriptors.h.
4469 * Makefile.in: Rebuild.
4470
801647d1
ILT
4471 PR 6716
4472 * gold.h: Always include <clocale>. Add Solaris workarounds
4473 following code in binutils/sysdep.h.
4474
5edd166e
ILT
4475 PR 6048
4476 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
4477 this->eh_frame_hdr_ is NULL before using it.
4478
c89ad728
ILT
4479 * dynobj.cc (Versions::Versions): Update comment.
4480
aa86f06b
ILT
4481 * dynobj.cc (Versions::Versions): If there is an soname, use it as
4482 the base version name.
4483
5778530e
ILT
4484 * stringpool.cc (Stringpool_template::add_with_length): Set key to
4485 array size plus one.
4486 (Stringpool_template::set_string_offsets): Subtract one from key
4487 before using it as an array index.
4488 (Stringpool_template::get_offset_with_length): Likewise.
4489 (Stringpool_template::write_to_buffer): Likewise.
4490 * stringpool.h (Stringpool_template::get_offset_from_key):
4491 Likewise.
4492
057ead22
ILT
44932008-07-23 Ian Lance Taylor <iant@google.com>
4494
7f649c59
ILT
4495 PR 6658
4496 * object.h (Merged_symbol_value::value): Do our best to handle a
4497 negative addend.
4498
057ead22
ILT
4499 PR 6647
4500 * script.cc (Version_script_info::get_versions): Don't add empty
4501 version tag to return value.
4502 (Version_script_info::get_symbol_version_helper): Change return
4503 type to bool. Add pversion parameter. Change all callers.
4504 (script_register_vers_node): Don't require a non-NULL tag.
4505 * script.h (class Version_script_info): Update declarations.
4506 (Version_script_info::get_symbol_version): Change return type to
4507 bool. Add version parameter. Change all callers.
4508 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
4509 handling. Handle an empty version from a version script.
4510 (Symbol_table::define_special_symbol): Likewise.
4511 * testsuite/ver_test_10.script: New file.
4512 * testsuite/ver_test_10.sh: New file.
4513 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
4514 (check_DATA): Add ver_test_10.syms.
4515 (ver_test_10.syms, ver_test_10.so): New target.
4516 * testsuite/Makefile.in: Rebuild.
4517
58e54ac2
CD
45182008-07-23 Simon Baldwin <simonb@google.com>
4519
4520 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
4521 to zero for undefined symbols from dynamic libraries.
4522
95d14cd3
ILT
45232008-07-23 Ian Lance Taylor <iant@google.com>
4524
4525 * symtab.cc (Symbol_table::resolve): Remove version parameter.
4526 Change all callers.
4527 * symtab.h (class Symbol_table): Update declaration.
4528 * testsuite/ver_test_9.cc: New file.
4529 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
4530 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
4531 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
4532 (ver_test_9.so, ver_test_9.o): New targets.
4533 * testsuite/Makefile.in: Rebuild.
4534
92de84a6
ILT
45352008-07-22 Ian Lance Taylor <iant@google.com>
4536
34810851
ILT
4537 * options.h (class General_options): Define --check-sections.
4538 * layout.cc (Layout::set_segment_offsets): Handle
4539 --check-sections.
4540
af6156ef
ILT
4541 * options.h (class General_options): Define -n/--nmagic and
4542 -N/--omagic.
4543 * options.cc (General_options::finalize): For -n/--nmagic or
4544 -N/--omagic, set -static.
4545 * layout.cc (Layout::attach_allocated_section_to_segment): If
4546 -N/--omagic, don't put read-only and read-write sections in
4547 different segments.
4548 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
4549 finding a read-only segment.
4550 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
4551 don't set the minimum segment alignment to the common page size,
4552 and don't set the file offset to the address modulo the page size.
4553 * script-sections.cc (Script_sections::create_segments): If
4554 -n/--omagic, don't put read-only and read-write sections in
4555 different segments.
4556
92de84a6
ILT
4557 * cref.cc: New file.
4558 * cref.h: New file.
4559 * options.h (class General_options): Add --print-symbol-counts.
4560 * main.cc (main): Issue defined symbol report if requested.
4561 * archive.cc (Archive::interpret_header): Make into a const member
4562 function.
4563 (Archive::add_symbols): Call Input_objects::archive_start and
4564 archive_stop.
4565 (Archive::const_iterator): Define new class.
4566 (Archive::begin, Archive::end): New functions.
4567 (Archive::include_all_members): Rewrite to use iterator.
4568 (Archive::count_members): New function.
4569 * archive.h (class Archive): Update declarations.
4570 (Archive::filename): New function.
4571 * object.cc: Include "cref.h".
4572 (Sized_relobj::Sized_relobj): Initialize defined_count_.
4573 (Sized_relobj::do_get_global_symbol_counts): New function.
4574 (Input_objects::add_object): Add object to cross-referencer.
4575 (Input_objects::archive_start): New function.
4576 (Input_objects::archive_stop): New function.
4577 (Input_objects::print_symbol_counts): New function.
4578 * object.h: Declare Cref and Archive.
4579 (Object::get_global_symbol_counts): New function.
4580 (Object::do_get_global_symbol_counts): New pure virtual function.
4581 (class Sized_relobj): Add defined_count_ field. Update
4582 declarations.
4583 (class Input_objects): Add cref_ field. Update constructor.
4584 Update declarations.
4585 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
4586 defined_count_.
4587 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
4588 symbol counts.
4589 (Sized_dynobj::do_get_global_symbol_counts): New function.
4590 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
4591 defined_count_. Update declarations. Define Symbols typedef.
4592 * symtab.cc (Symbol_table::add_from_relobj): Add defined
4593 parameter. Change all callers.
4594 (Symbol_table::add_from_dynobj): Add sympointers and defined
4595 parameters. Change all callers.
4596 * symtab.h (class Symbol_table): Update declarations.
4597 * Makefile.am (CCFILES): Add cref.cc.
4598 (HFILES): Add cref.h.
4599 * Makefile.in: Rebuild.
4600
3f7c5e1d
CD
46012008-07-22 Simon Baldwin <simonb@google.com>
4602
4603 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
4604 to zero when writing undefined symbols.
4605
e0b64032
ILT
46062008-07-22 Ian Lance Taylor <iant@google.com>
4607
4608 * output.cc (Output_section::add_input_section): Don't try to
4609 merge empty merge sections.
4610
096b02cf
CS
46112008-07-21 Craig Silverstein <csilvers@google.com>
4612
4613 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
4614 Include symbol version in error message.
cd536b21 4615
1d1f116d
CD
46162008-07-20 Chris Demetriou <cgd@google.com>
4617
cd536b21 4618 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
4619 (RANDOM_SEED_CFLAGS): New substituted variable.
4620 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
4621 * configure: Rebuild.
4622 * Makefile.in: Likewise.
4623 * testsuite/Makefile.in: Likewise.
4624
a18f591e
ILT
46252008-07-18 Ian Lance Taylor <iant@google.com>
4626
4627 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
4628 where we see NAME/NULL and NAME/VERSION as separate symbols.
4629 * testsuite/ver_test_main.cc (main): Call t4.
4630 (t4, t4_2a): Define.
4631 * testsuite/ver_test_2.cc (t4_2): Define.
4632 * testsuite/ver_test_2.script: Put t4_2a in VER2.
4633 * testsuite/ver_test_4.cc (t4_2a): Define.
4634 * testsuite/ver_test_4.script: Put t4_2a in VER2.
4635 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
4636
c6e3f6ed
ILT
46372008-07-17 Ian Lance Taylor <iant@google.com>
4638
4639 * dynobj.cc (Versions::add_def): If we give an error about a
4640 missing version, go ahead and create the version anyhow.
4641
ef9beddf
ILT
46422008-07-10 Ian Lance Taylor <iant@google.com>
4643
4644 Handle output sections with more than 0x7fffffff bytes.
4645 * object.h (class Relobj): Change map_to_output_ to
4646 output_sections_, and just keep a section pointer. Change all
4647 uses. Move comdat group support to Sized_relobj.
4648 (Relobj::is_section_specially_mapped): Remove.
4649 (Relobj::output_section): Remove poff parameter. Change all
4650 callers.
4651 (Relobj::output_section_offset): New function.
4652 (Relobj::set_section_offset): Rewrite.
4653 (Relobj::map_to_output): Remove.
4654 (Relobj::output_sections): New function.
4655 (Relobj::do_output_section_offset): New pure virtual function.
4656 (Relobj::do_set_section_offset): Likewise.
4657 (class Sized_relobj): Add section_offsets_ field. Add comdat
4658 group support from Relobj. Update declarations.
4659 (Sized_relobj::get_output_section_offset): New function.
4660 (Sized_relobj::do_output_section_offset): New function.
4661 (Sized_relobj::do_set_section_offset): New function.
4662 * object.cc (Relobj::output_section_address): Remove.
4663 (Sized_relobj::Sized_relobj): Initialize new fields.
4664 (Sized_relobj::include_section_group): Cast find_kept_object to
4665 Sized_relobj.
4666 (Sized_relobj::include_linkonce_section): Likewise.
4667 (Sized_relobj::do_layout): Use separate arrays for output section
4668 and output offset.
4669 (Sized_relobj::do_count_local_symbols): Change map_to_output to
4670 output_sections.
4671 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
4672 output_sections and section_offsets.
4673 (Sized_relobj::write_local_symbols): Likewise.
4674 (map_to_kept_section): Compute output address directly.
4675 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
4676 output_sections and section_offsets.
4677 (Sized_relobj::write_sections): Likewise.
4678 (Sized_relobj::relocate_sections): Likewise.
4679 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
4680 * output.h (class Output_reloc): Update declarations. Change
4681 u2_.relobj to Sized_relobj*.
4682 (class Output_data_reloc): Change add functions to use
4683 Sized_relobj*.
4684 * output.cc (Output_reloc::Output_reloc): Change relobj to
4685 Sized_relobj*.
4686 (Output_reloc::local_section_offset): Change return type to
4687 Elf_Addr. Use get_output_section_offset.
4688 (Output_reloc::get_address): Likewise.
4689 (Output_section::is_input_address_mapped): Don't call
4690 is_section_specially_mapped.
4691 (Output_section::output_offset): Likewise.
4692 (Output_section::output_address): Likewise.
4693 (Output_section::starting_output_address): Likewise.
4694 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
4695 parameter to Sized_relobj*.
4696 (Copy_relocs::need_copy_reloc): Likewise.
4697 (Copy_relocs::save): Likewise.
4698 * copy-relocs.h (class Copy_relocs): Update declarations.
4699 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
4700 Sized_relobj*. Change relobj_ field to Sized_relobj*.
4701 * target-reloc.h (relocate_for_relocatable): Change
4702 offset_in_output_section type to Elf_Addr. Change code that uses
4703 it as well.
4704 * layout.cc (Layout::layout): Always set *off.
4705 * mapfile.cc (Mapfile::print_input_section): Use
4706 output_section_offset.
4707 * i386.cc (Target_i386::copy_reloc): Change object parameter to
4708 Sized_relobj*.
4709 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
4710 * sparc.cc (Target_sparc::copy_reloc): Likewise.
4711 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
4712
5cb66f97
ILT
47132008-07-03 Ian Lance Taylor <iant@google.com>
4714
4715 * layout.cc (Layout::include_section): Do not discard unrecognized
4716 SHT_STRTAB sections.
4717
afe47622
CS
47182008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
4719
4720 * script.cc (Lex::can_continue_name): Make '?' allowable in
4721 version-script names.
4722 * testsuite/version_script.map: Change glob pattern to use '?'
4723
5adf9721
ILT
47242008-06-30 Manish Singh <yosh@gimp.org>
4725
4726 PR 6585
4727 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
4728 Correct typo.
4729
e6fde208
ILT
47302008-06-30 Ian Lance Taylor <iant@google.com>
4731
4732 PR 6660
4733 PR 6682
4734 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
4735 versions]: Don't try to read the value in the contents, since we
4736 don't use it. Use the template endianness when writing.
4737
3f2e6a2d
CC
47382008-06-25 Cary Coutant <ccoutant@google.com>
4739
4740 * fileread.cc (File_read::make_view): Assert on zero-length view.
4741 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
4742 symbol table when there are no symbols to read.
4743
c43d3a48
CS
47442008-06-23 Craig Silverstein <csilvers@google.com>
4745
4746 * version.cc (version_string): Bump to 1.7
4747
5f494ea0
CS
47482008-06-18 Craig Silverstein <csilvers@google.com>
4749
4750 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
4751 constant 0xFFFF to type Valtype.
4752 (Powerpc_relocate_functions::rel16_ha): Likewise.
4753
c42e122e
ILT
47542008-06-17 Ian Lance Taylor <iant@google.com>
4755
f34787f8
ILT
4756 * output.h (Output_section::Input_section): Initialize p2align_ to
4757 zero for Output_section_data constructors.
4758 (Output_section::Input_section::addralign): If not an input
4759 section, return the alignment of the Output_section_data.
4760 * testsuite/copy_test.cc: New file.
4761 * testsuite/copy_test_1.cc: New file.
4762 * testsuite/copy_test_2.cc: New file.
4763 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
4764 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
4765 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
4766 (copy_test_1_pic.o, copy_test_1.so): New targets.
4767 (copy_test_2_pic.o, copy_test_2.so): New targets.
4768 * testsuite/Makefile.in: Rebuild.
4769
c42e122e
ILT
4770 * script-sections.cc (Script_sections::place_orphan): Initialize
4771 local variable exact.
4772
ce3ac18a
DE
47732008-06-13 David Edelsohn <edelsohn@gnu.org>
4774
4775 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
4776
42cacb20
DE
47772008-06-12 David Edelsohn <edelsohn@gnu.org>
4778 David S. Miller <davem@davemloft.net>
4779
4780 * powerpc.cc: New file.
4781 * Makefile.am (TARGETSOURCES): Add powerpc.cc
4782 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
4783 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
4784 * Makefile.in: Rebuild.
4785
7b308235
ILT
47862008-06-09 Ian Lance Taylor <iant@google.com>
4787
4788 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
4789 <exception>.
4790 (throwing, orig_terminate): New static variables.
4791 (terminate_handler): New static function.
4792 (t2): Set terminate handler.
4793
f0b886e3
ILT
47942008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
4795
4796 PR 6584
cd536b21 4797 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
4798 alignment.
4799
3e90f135
CC
48002008-05-30 Cary Coutant <ccoutant@google.com>
4801
4802 * archive.cc (Archive::include_all_members) Correct to step
4803 over symbol table and extended name table in thin archives.
4804
e09ad04a
ILT
48052008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
4806
4807 PR 6407
4808 * target-reloc.h (relocate_for_relocatable): Fix new_offset
4809 calculation.
4810
62b01cb5
ILT
48112008-05-28 Caleb Howe <cshowe@google.com>
4812
4813 * reduced_debug_output.cc: New file.
4814 * reduced_debug_output.h: New file.
92de84a6 4815 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
4816 * options.cc (General_options::finalize): Add strip_debug_non_line
4817 to the strip heirarchy.
4818 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
4819 fields.
4820 * layout.cc: Include "reduced_debug_output.h".
4821 (Layout::Layout): Initialize new fields.
4822 (line_only_debug_sections): New static array.
4823 (is_lines_only_debug_sections): New static inline function.
4824 (Layout::include_section): Handle --strip-debug-non-line.
4825 (Layout::make_output_section): If --strip-debug-non-line, build
4826 new output sections for .debug_abbrev and .debug_info.
4827 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
4828 gold. Warn about possible overflow.
4829 (read_signed_LEB_128): Likewise.
4830 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
4831 (read_signed_LEB_128): Declare.
4832 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
4833 (HFILES): Add reduced_debug_output.h.
4834 * Makefile.in: Rebuild.
4835
7d9e3d98
ILT
48362008-05-21 Ian Lance Taylor <iant@google.com>
4837
4838 * mapfile.cc: New file.
4839 * mapfile.h: New file.
4840 * options.h (class General_options): Add -M/--print-map and -Map.
4841 * options.cc (General_options::finalize): Make -M equivalent to
4842 -Map -.
4843 * main.cc: Include <cstdio> and "mapfile.h".
4844 (main): Open mapfile if requested.
4845 * gold.cc (class Middle_runner): Add mapfile_ field. Update
4846 constructor. Change caller.
4847 (queue_initial_tasks): Add mapfile parameter. Change caller.
4848 (queue_middle_tasks): Likewise.
4849 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
4850 declarations.
4851 * archive.cc: Include "mapfile.h".
4852 (Archive::add_symbols): Add mapfile parameter. Change all
4853 callers. Pass mapfile, symbol, and reason to include_member.
4854 (Archive::include_all_members): Add mapfile parameter. Change all
4855 callers.
4856 (Archive::include_member): Add mapfile, sym, and why parameters.
4857 Change all callers. Report inclusion to map file.
4858 * archive.h: Include "fileread.h".
4859 (class Archive): Update declarations.
4860 (Archive::file): New const method.
4861 (class Add_archive_symbols): Add mapfile_ field. Update
4862 constructor. Change all callers.
4863 * readsyms.h (class Read_symbols): Likewise.
4864 (class Finish_group): Likewise.
4865 (class Read_script): Likewise.
4866 * common.cc: Include "mapfile.h".
4867 (Symbol_table::allocate_commons): Add mapfile parameter. Change
4868 all callers.
4869 (Symbol_table::do_allocate_commons): Likewise.
4870 (Symbol_table::do_allocate_commons_list): Likewise. Report common
4871 symbol allocation to mapfile.
4872 * common.h (class Allocate_commons_task): Add mapfile_ field.
4873 Update constructor. Change all callers.
4874 * symtab.h (class Symbol_table): Update declarations.
4875 * layout.cc: Include "mapfile.h".
4876 (Layout_task_runner::run): Print information to mapfile.
4877 (Layout::create_gold_note): Change Output_data_fixed_space to
4878 Output_data_zero_fill.
4879 (Layout::create_build_id): Likewise.
4880 (Layout::print_to_mapfile): New function.
4881 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
4882 constructor. Change caller.
4883 (class Layout): Declare print_to_mapfile.
4884 * output.cc (Output_section::Input_section::print_to_mapfile): New
4885 function.
4886 (Output_section::add_input_section): If producing a map, always
4887 add to input_sections_ list.
4888 (Output_section::do_print_to_mapfile): New function.
4889 (Output_segment::print_sections_to_mapfile): New function.
4890 (Output_segment::print_section_list_to_mapfile): New function.
4891 * output.h: Include "mapfile.h".
4892 (Output_data::print_to_mapfile): New function.
4893 (Output_data::do_print_to_mapfile): New virtual function.
4894 (Output_segment_headers::do_print_to_mapfile): New function.
4895 (Output_file_header::do_print_to_mapfile): New function.
4896 (Output_data_const::do_print_to_mapfile): New function.
4897 (class Output_data_const_buffer): Add map_name_ field. Update
4898 constructor. Change all callers. Add do_print_to_mapfile
4899 function.
4900 (class Output_data_fixed_space): Likewise.
4901 (class Output_data_space): Likewise.
4902 (class Output_data_zero_fill): New class.
4903 (Output_data_strtab::do_print_to_mapfile): New function.
4904 (Output_data_reloc_base::do_print_to_mapfile): New function.
4905 (Output_relocatable_relocs::do_print_to_mapfile): New function.
4906 (Output_data_group::do_print_to_mapfile): New function.
4907 (Output_data_got::do_print_to_mapfile): New function.
4908 (Output_data_dynamic::do_print_to_mapfile): New function.
4909 (Output_symtab_xindex::do_print_to_mapfile): New function.
4910 (class Output_section): Declare do_print_to_mapflie. Declare
4911 print_to_mapfile in Input_section.
4912 (class Output_segment): Declare new functions.
4913 * object.h (Sized_relobj::symbol_count): New function.
4914 * script-sections.cc
4915 (Output_section_element_dot_assignment::set_section_addresses):
4916 Change Output_data_fixed_space to Output_data_zero_fill.
4917 (Output_data_expression::do_print_to_mapfile): New function.
4918 * script.cc (read_input_script): Add mapfile parameter. Change
4919 all callers.
4920 * script.h (read_input_script): Update declaration.
4921 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
4922 (Eh_frame::do_print_to_mapfile): New function.
4923 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
4924 (Output_merge_string::do_print_to_mapfile): New function.
4925 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
4926 function.
4927 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
4928 function.
4929 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
4930 function.
4931 * Makefile.am (CCFILES): Add mapfile.cc.
4932 (HFILES): Add mapfile.h.
4933 * Makefile.in: Rebuild.
4934
9f1d377b
ILT
49352008-05-19 Ian Lance Taylor <iant@google.com>
4936
4937 * options.h (class General_options): Add -z relro.
4938 * layout.cc (Layout::Layout): Initialize relro_segment_.
4939 (Layout::add_output_section_data): Return the output section.
4940 (Layout::make_output_section): Rcognize relro sections and mark
4941 them appropriately.
4942 (Layout::attach_allocated_section_to_segment): Put relro sections
4943 in a PT_GNU_RELRO segment.
4944 (Layout::create_initial_dynamic_sections): Mark the .dynamic
4945 section as relro.
4946 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
4947 PT_TLS segments.
4948 (Layout::linkonce_mapping): Map d.rel.ro.local to
4949 .data.rel.ro.local.
4950 (Layout::output_section_name): Us .data.rel.ro.local for any
4951 section which begins with that.
4952 * layout.h (class Layout): Update add_output_section_data
4953 declaration. Add relro_segment_ field.
4954 * output.cc (Output_section::Output_section): Initialize is_relro_
4955 and is_relro_local_ fields.
4956 (Output_segment::add_output_section): Group relro sections.
4957 (Output_segment::is_first_section_relro): New function.
4958 (Output_segment::maximum_alignment): If there is a relro section,
4959 align the segment to the common page size.
4960 (Output_segment::set_section_addresses): Track whether we are
4961 looking at relro sections. If the last section is a relro
4962 section, align to the common page size.
4963 (Output_segment::set_section_list_addresses): Add in_relro
4964 parameter. Change all callers. Align to the page size when
4965 moving from relro to non-relro section.
4966 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
4967 segment.
4968 * output.h (class Output_section): Add is_relro_ and
4969 is_relro_local_ fields.
4970 (Output_section::is_relro): New function.
4971 (Output_section::set_is_relro): New function.
4972 (Output_section::is_relro_local): New function.
4973 (Output_section::set_is_relro_local): New function.
4974 (class Output_segment): Update declarations.
4975 * i386.cc (Target_i386::got_section): Mark .got section as relro.
4976 * sparc.cc (Target_sparc::got_section): Likewise.
4977 * x86_64.cc (Target_x86_64::got_section): Likewise.
4978 * testsuite/relro_test_main.cc: New file.
4979 * testsuite/relro_test.cc: New file.
4980 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
4981 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
4982 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
4983 (relro_test.so, relro_test_pic.o): New targets.
4984 * testsuite/Makefile.in: Rebuild.
4985
a984ee1d
ILT
49862008-05-16 Ian Lance Taylor <iant@google.com>
4987
01676dcd
ILT
4988 * output.cc (Output_segment::add_output_section): Remove front
4989 parameter.
4990 * output.h (class Output_segment): Remove
4991 add_initial_output_section and overloaded add_output_section.
4992 Update declaration of remaining add_output_section.
4993 * layout.cc (Layout::create_interp): Call add_output_section
4994 rather than add_initial_output_section.
4995 (Layout::finish_dynamic_section): Likewise.
4996
497897f9
ILT
4997 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
4998 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
4999 know the dynamic type.
5000 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
5001 field. Initialize it in constructor.
5002 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
5003 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
5004 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
5005 reloc.
5006
a984ee1d
ILT
5007 * output.cc (Output_reloc::get_address): Change return type to
5008 Elf_Addr.
5009 * output.h (class Output_reloc): Update get_address declaration.
5010 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
5011 for section addresses.
5012
55ba0940
ILT
50132008-05-09 Ian Lance Taylor <iant@google.com>
5014
5015 PR 6493
5016 * gold.cc (gold_nomem): Use return value of write.
5017
75517b77
ILT
50182008-05-08 Ian Lance Taylor <iant@google.com>
5019
5020 * symtab.c (Symbol::init_base_output_data): Add version
5021 parameter. Change all callers.
5022 (Symbol::init_base_output_segment): Likewise.
5023 (Symbol::init_base_constant): Likewise.
5024 (Symbol::init_base_undefined): Likewise.
5025 (Sized_symbol::init_output_data): Likewise.
5026 (Sized_symbol::init_output_segment): Likewise.
5027 (Sized_symbol::init_constant): Likewise.
5028 (Sized_symbol::init_undefined): Likewise.
5029 (Symbol_table::do_define_in_output_data): If the new symbol has a
5030 version, mark it as the default.
5031 (Symbol_table::do_define_in_output_segment): Likewise.
5032 (Symbol_table::do_define_as_constant): Likewise.
5033 * symtab.h (class Symbol): Update declarations.
5034 (class Sized_symbol): Likewise.
5035 * resolve.cc (Symbol::override_version): New function.
c42e122e 5036 (Symbol::override_base): Call override_version.
75517b77
ILT
5037 (Symbol::override_base_with_special): Likewise.
5038 * testsuite/ver_script_8.script: New file.
5039 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
5040 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
5041 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
5042 (ver_test_8_1.so, ver_test_8_2.so): New targets.
5043
f1f70eae
ILT
50442008-05-06 Ian Lance Taylor <iant@google.com>
5045
f3e9c5c5
ILT
5046 PR 6049
5047 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
5048 functions.
5049 (class General_options): Remove existing --undefined, and add
5050 --no-undefined instead. Add new --undefined as synonym for -u.
5051 * archive.cc (Archive::add_symbols): Check whether symbol was
5052 named with -u.
5053 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
5054 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
5055 all uses. Add IS_UNDEFINED. Update declarations to split
5056 different versions of init_base. Declare init_base_undefined.
5057 (Symbol::is_defined): Handle IS_UNDEFINED.
5058 (Symbol::is_undefined): Likewise.
5059 (Symbol::is_weak_undefined): Call is_undefined.
5060 (Symbol::is_absolute): Handle IS_CONSTANT.
5061 (class Sized_symbol): Update declarations to split different
5062 versions of init. Declare init_undefined.
5063 (class Symbol_table): Declare new functions.
5064 * symtab.cc (Symbol::init_base_object): Rename from init_base.
5065 Change all callers.
5066 (Symbol::init_base_output_data): Likewise.
5067 (Symbol::init_base_output_segment): Likewise.
5068 (Symbol::init_base_constant): Likewise.
5069 (Symbol::init_base_undefined): New function.
5070 (Sized_symbol::init_object): Rename from init. Change all
5071 callers.
5072 (Sized_symbol::init_output_data): Likewise.
5073 (Sized_symbol::init_output_segment): Likewise.
5074 (Sized_symbol::init_constant): Likewise.
5075 (Sized_symbol::init_undefined): New function.
5076 (Symbol_table::add_undefined_symbols_from_command_line): New
5077 function.
5078 (Symbol_table::do_add_undefined_symbols_from_command_line): New
5079 function.
5080 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
5081 (Symbol::output_section): Likewise.
5082 (Symbol::set_output_section): Likewise.
5083 (Symbol_table::sized_finalize_symbol): Likewise.
5084 (Symbol_table::sized_write_globals): Likewise.
5085 * resolve.cc (Symbol_table::should_override): Likewise.
5086 (Symbol::override_base_with_special): Likewise.
5087
8bdcdf2c
ILT
5088 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
5089 symbol, change it to have default visibility.
5090 * testsuite/protected_1.cc: New file.
5091 * testsuite/protected_2.cc: New file.
5092 * testsuite/protected_3.cc: New file.
5093 * testsuite/protected_main_1.cc: New file.
5094 * testsuite/protected_main_2.cc: New file.
5095 * testsuite/protected_main_3.cc: New file.
5096 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
5097 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
5098 (protected_1_LDFLAGS, protected_1_LDADD): Define.
5099 (protected_1.so): New target.
5100 (protected_1_pic.o, protected_2_pic.o): New targets.
5101 (protected_3_pic.o): New target.
5102 (check_PROGRAMS): Add protected_2.
5103 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
5104 (protected_2_LDFLAGS, protected_2_LDADD): Define.
5105 * testsuite/Makefile.in: Rebuild.
5106
2b706932
ILT
5107 * options.h (DEFINE_var): Add set_user_set_##varname__.
5108 (DEFINE_bool_alias): New macro.
5109 (class General_options): Define -Bstatic using DEFINE_bool_alias
5110 rather than DEFINE_special. Add --undefined as an alias for -z
5111 defs.
5112 * options.cc (General_options::parse_Bstatic): Remove.
5113
d82a5bcc
ILT
5114 * options.h (class General_options): Add --fatal-warnings.
5115 * main.cc (main): Implement --fatal-warnings.
5116 * errors.h (Errors::warning_count): New function.
5117
f1f70eae
ILT
5118 * options.h (class General_options): Add -Bsymbolic-functions.
5119 * symtab.h (Symbol::is_preemptible): Check for
5120 -Bsymbolic-functions.
5121
8825ac63
ILT
51222008-05-05 Ian Lance Taylor <iant@google.com>
5123
d98bc257
ILT
5124 * options.h (DEFINE_bool): For DASH_Z, create the negative option
5125 as noVARNAME rather than no-VARNAME.
5126 (class General_options): Add option -z combreloc.
5127 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
5128 get_address.
5129 (Output_reloc::sort_before) [SHT_REL]: New function.
5130 (Output_reloc::sort_before) [SHT_RELA]: New function.
5131 (class Output_data_reloc_base): Add sort_relocs_ field. Define
5132 Sort_relocs_comparison.
5133 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
5134 parameter. Change all callers.
5135 (Output_data_reloc::Output_data_reloc) [both versions]: Add
5136 sort_relocs parameter. Change all callers.
5137 * output.cc (Output_reloc::get_address): New function, broken out
5138 of write_rel.
5139 (Output_reloc::write_rel): Call it.
5140 (Output_reloc::compare): New function.
5141 (Output_data_reloc_base::do_write): Optionally sort relocs.
5142
60b2b4e7
ILT
5143 * configure.ac: If targ_extra_obj is set, link it in.
5144 * configure.tgt: Initialize all variables.
5145 (x86_64*): Set targ_extra_obj and targ_extra_size.
5146 * configure: Rebuild.
5147
8825ac63
ILT
5148 * object.cc (Sized_relobj::include_section_group): Adjust section
5149 indexes read from group data. Build vector to pass to
5150 layout_group.
5151 * layout.cc (Layout::layout_group): Add flags and shndxes
5152 parameters. Remove contents parameter. Change caller. Update
5153 explicit instantiations.
5154 * layout.h (class Layout): Update layout_group declaration.
5155 * output.cc (Output_data_group::Output_data_group): Add flags and
5156 input_shndxes parameters. Remove contents parameter. Change
5157 caller.
5158 (Output_data_group::do_write): Change input_sections_ to
5159 input_shndxes_.
5160 * output.h (class Output_data_group): Update constructor
5161 declaration. Rename input_sections_ to input_shndxes_.
5162 * testsuite/many_sections_test.cc: Add template.
5163
e94cf127
CC
51642008-04-30 Cary Coutant <ccoutant@google.com>
5165
4418b2d5
CC
5166 * target-reloc.h (relocate_section): Fix dead-pointer bug.
5167
e94cf127
CC
5168 * layout.cc (Layout::include_section): Refactored check for debug
5169 info section.
5170 (Layout::add_comdat): Add new parameters. Change type
5171 of signature parameter. Add object and shndx to signatures table.
5172 (Layout::find_kept_object): New function.
5173 * layout.h: Include <cstring>.
5174 (Layout::is_debug_info_section): New function.
5175 (Layout::add_comdat): Add new parameters.
5176 (Layout::find_kept_object): New function.
5177 (Layout::Kept_section): New struct.
5178 (Layout::Signatures): Change type of map range.
5179 * object.cc (Relobj::output_section_address): New function.
5180 (Sized_relobj::include_section_group): Add new parameters. Change
5181 calls to Layout::add_comdat. Change to build table of kept comdat
5182 groups and table mapping discarded sections to kept sections.
5183 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
5184 (Sized_relobj::do_layout): Change calls to include_section_group and
5185 include_linkonce_section.
5186 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
5187 value to zero when section is discarded.
5188 (Sized_relobj::map_to_kept_section): New function.
5189 * object.h (Relobj::output_section_address): New function.
5190 (Relobj::Comdat_group): New type.
5191 (Relobj::find_comdat_group): New function.
5192 (Relobj::Comdat_group_table): New type.
5193 (Relobj::Kept_comdat_section): New type.
5194 (Relobj::Kept_comdat_section_table): New type.
5195 (Relobj::add_comdat_group): New function.
5196 (Relobj::set_kept_comdat_section): New function.
5197 (Relobj::get_kept_comdat_section): New function.
5198 (Relobj::comdat_groups_): New field.
5199 (Relobj::kept_comdat_sections_): New field.
5200 (Symbol_value::input_value): Update comment.
5201 (Sized_relobj::map_to_kept_section) New function.
5202 (Sized_relobj::include_linkonce_section): Add new parameter.
5203 * target-reloc.h (Comdat_behavior): New type.
5204 (get_comdat_behavior): New function.
5205 (relocate_section): Add code to map a discarded section to the
5206 corresponding kept section when applying a relocation.
5207
e4e5049b
CS
52082008-04-30 Craig Silverstein <csilvers@google.com>
5209
5210 * dwarf_reader.cc (next_generation_count): New static var.
5211 (Addr2line_cache_entry): New struct.
5212 (addr2line_cache): New static var.
5213 (Dwarf_line_info::one_addr2line): Added caching.
5214 (Dwarf_line_info::clear_addr2line_cache): New function.
5215 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
5216 cache-size parameter.
5217 (Dwarf_line_info::one_addr2line_cache): New function.
5218 * symtab.cc (Symbol_table::detect_odr_violations): Pass
5219 new cache-size argument to one_addr2line(), and clear cache.
5220
d09e9154
CC
52212008-04-28 Cary Coutant <ccoutant@google.com>
5222
5223 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
5224 R_386_PC8 relocations.
5225
7ef73768
ILT
52262008-04-23 Ian Lance Taylor <iant@google.com>
5227
55438702
ILT
5228 * object.cc (Sized_relobj::include_section_group): Check for
5229 invalid section group.
5230
c165fb93
ILT
5231 * object.cc (make_elf_object): Correct test for 64-bit ELF file
5232 header size.
5233
7ef73768
ILT
5234 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
5235 than read for file header.
5236 * archive.cc (Archive::include_member): Likewise.
5237
6194aaab
L
52382008-04-23 Paolo Bonzini <bonzini@gnu.org>
5239
5240 * aclocal.m4: Regenerate.
5241 * configure: Regenerate.
5242
d491d34e
ILT
52432008-04-19 Ian Lance Taylor <iant@google.com>
5244
5ea2bac6
ILT
5245 * version.cc (version_string): Bump to 1.6.
5246
7bc3e21a
ILT
5247 * testsuite/Makefile.am (many_sections_r_test): New target.
5248 (many_sections_r_test_SOURCES): Remove.
5249 (many_sections_r_test_DEPENDENCIES): Remove.
5250 (many_sections_r_test_LDFLAGS): Remove.
5251 (many_sections_r_test_LDADD): Remove.
5252
7fcd3aa9
ILT
5253 * object.cc (Sized_relobj::do_add_symbols): Always pass
5254 local_symbol_count_ to add_from_relobj.
5255
4c94d6ae
ILT
5256 * testsuite/Makefile.am (many_sections_check.h): Only check one in
5257 every thousand variables.
5258 * testsuite/Makefile.in: Rebuild.
5259
d491d34e
ILT
5260 * object.cc (Xindex::initialize_symtab_xindex): New function.
5261 (Xindex::read_symtab_xindex): New function.
5262 (Xindex::sym_xindex_to_shndx): New function.
5263 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
5264 available.
5265 (Sized_relobj::do_initialize_xindex): New function.
5266 (Sized_relobj::do_read_symbols): Adjust section links.
5267 (Sized_relobj::symbol_section_and_value): Add is_ordinary
5268 parameter. Change all callers.
5269 (Sized_relobj::include_section_group): Adjust section links and
5270 symbol section indexes.
5271 (Sized_relobj::do_layout): Adjust section links.
5272 (Sized_relobj::do_count_local_symbols): Adjust section links and
5273 symbol section indexes.
5274 (Sized_relobj::do_finalize_local_symbols): Distinguish between
5275 ordinary and special symbols.
5276 (Sized_relobj::write_local_symbols): Add symtab_xindex and
5277 dynsym_xindex parameters. Change all callers. Adjust section
5278 links. Use SHN_XINDEX when needed.
5279 (Sized_relobj::get_symbol_location_info): Adjust section links.
5280 Don't get fooled by special symbols.
5281 * object.h (class Xindex): Define.
5282 (class Object): Add xindex_ parameter. Declare virtual functoin
5283 do_initialize_xindex.
5284 (Object::adjust_sym_shndx): New function.
5285 (Object::set_xindex): New protected function.
5286 (class Symbol_value): Add is_ordinary_shndx_ field.
5287 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
5288 (Symbol_value::value): Assert ordinary section.
5289 (Symbol_value::initialize_input_to_output_map): Likewise.
5290 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
5291 Change all callers.
5292 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
5293 all callers.
5294 (class Sized_relobj): Update declarations.
5295 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
5296 parameter. Change all callers.
5297 (Sized_relobj::adjust_shndx): New function.
5298 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
5299 field.
5300 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
5301 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
5302 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
5303 (Sized_dynobj::read_dynsym_section): Adjust section links.
5304 (Sized_dynobj::read_dynamic): Likewise.
5305 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
5306 section links.
5307 (Sized_dynobj::do_initialize_xindex): New function.
5308 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
5309 do_initialize_xindex.
5310 (Sized_dynobj::adjust_shndx): New function.
5311 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
5312 dynsym_xindex_ fields.
5313 (Layout::finalize): Add a call to set_section_indexes before
5314 creating the symtab sections.
5315 (Layout::set_section_indexes): Don't do anything if the section
5316 already has a section index.
5317 (Layout::create_symtab_sections): Add shnum parameter. Change
5318 caller. Create .symtab_shndx section if needed.
5319 (Layout::create_shdrs): Add shstrtab_section parameter. Change
5320 caller.
5321 (Layout::allocated_output_section_count): New function.
5322 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
5323 needed.
5324 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
5325 fields. Update declarations.
5326 (Layout::symtab_xindex): New function.
5327 (Layout::dynsym_xindex): New function.
5328 (class Write_symbols_task): Add layout_ field.
5329 (Write_symbols_task::Write_symbols_task): Add layout parameter.
5330 Change caller.
5331 * output.cc (Output_section_headers::Output_section_headers): Add
5332 shstrtab_section parameter. Change all callers.
5333 (Output_section_headers::do_sized_write): Store overflow values
5334 for section count and section string table section index in
5335 section header zero.
5336 (Output_file_header::do_sized_write): Check for overflow of
5337 section count and section string table section index.
5338 (Output_symtab_xindex::do_write): New function.
5339 (Output_symtab_xindex::endian_do_write): New function.
5340 * output.h (class Output_section_headers): Add shstrtab_section_.
5341 Update declarations.
5342 (class Output_symtab_xindex): Define.
5343 (Output_section::has_out_shndx): New function.
5344 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
5345 field.
5346 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
5347 Change all callers.
5348 (Sized_symbol::init): Likewise.
5349 (Symbol::output_section): Check for ordinary symbol.
5350 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
5351 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
5352 callers.
5353 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
5354 Change all callers. Simplify handling of symbols from sections
5355 not included in the link.
5356 (Symbol_table::add_from_dynobj): Handle ordinary symbol
5357 distinction.
5358 (Weak_alias_sorter::operator()): Assert that symbols are
5359 ordinary.
5360 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
5361 distinction.
5362 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
5363 parameters. Change all callers.
5364 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
5365 symbol distinction. Use SHN_XINDEX when needed.
5366 (Symbol_table::write_section_symbol): Add symtab_xindex
5367 parameter. Change all callers.
5368 (Symbol_table::sized_write_section_symbol): Likewise. Use
5369 SHN_XINDEX when needed.
5370 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
5371 declarations.
5372 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
5373 (Symbol::is_defined): Check is_ordinary.
5374 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
5375 (Symbol::is_absolute, Symbol::is_common): Likewise.
5376 (class Sized_symbol): Update declarations.
5377 (class Symbol_table): Update declarations.
5378 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
5379 parameters. Change all callers.
5380 (Sized_symbol::override): Likewise.
5381 (Symbol_table::override): Likewise.
5382 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
5383 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
5384 is_ordinary, and orig_st_shndx parameters. Change all callers.
5385 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
5386 to be in an ordinary section.
5387 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
5388 object and is_ordinary parameters. Change all callers.
5389 (Sized_dwarf_line_info::read_relocs): Add object parameter.
5390 Change all callers. Don't add undefined or non-ordinary symbols
5391 to reloc_map_.
5392 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
5393 Change all callers.
5394 * dwarf_reader.h (class Sized_dwarf_line_info): Update
5395 declarations.
5396 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
5397 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
5398 (Sized_relobj::relocate_sections): Likewise.
5399 * target-reloc.h (scan_relocs): Adjust section symbol index.
5400 (scan_relocatable_relocs): Likewise.
5401 * i386.cc (Scan::local): Check for ordinary symbols.
5402 * sparc.cc (Scan::local): Likewise.
5403 * x86_64.cc (Scan::local): Likewise.
5404 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
5405 to symbol_section_and_value.
5406 * testsuite/many_sections_test.cc: New file.
5407 * testsuite/Makefile.am (BUILT_SOURCES): Define.
5408 (check_PROGRAMS): Add many_sections_test.
5409 (many_sections_test_SOURCES): Define.
5410 (many_sections_test_DEPENDENCIES): Define.
5411 (many_sections_test_LDFLAGS): Define.
5412 (BUILT_SOURCES): Add many_sections_define.h.
5413 (many_sections_define.h): New target.
5414 (BUILT_SOURCES): Add many_sections_check.h.
5415 (many_sections_check.h): New target.
5416 (check_PROGRAMS): Add many_sections_r_test.
5417 (many_sections_r_test_SOURCES): Define.
5418 (many_sections_r_test_DEPENDENCIES): Define.
5419 (many_sections_r_test_LDFLAGS): Define.
5420 (many_sections_r_test_LDADD): Define.
5421 (many_sections_r_test.o): New target.
5422 * testsuite/Makefile.in: Rebuild.
5423
c5818ff1
CC
54242008-04-17 Cary Coutant <ccoutant@google.com>
5425
5426 * errors.cc (Errors::info): New function.
5427 (gold_info): New function.
5428 * errors.h (Errors::info): New function.
5429 * gold.h (gold_info): New function.
5430 * object.cc (Input_objects::add_object): Print trace output.
5431 * options.cc (options::parse_set): New function.
5432 (General_options::parse_wrap): Deleted.
5433 (General_options::General_options): Deleted initializer.
5434 * options.h (options::String_set): New typedef.
5435 (options::parse_set): New function.
5436 (DEFINE_set): New macro.
5437 (General_options::wrap): Changed to use DEFINE_set. Changed
5438 callers of any_wrap_symbols and is_wrap_symbol.
5439 (General_options::trace, General_options::trace_symbol):
5440 New options.
5441 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
5442 (General_options::wrap_symbols_): Deleted.
5443 * symtab.cc (Symbol_table::add_from_object): Print trace output.
5444
b5be4a7c
DM
54452008-04-17 David S. Miller <davem@davemloft.net>
5446
5447 * options.cc (General_options::parse_V): New function.
5448 * options.h: Add entries for -V and -Qy.
5449
155a0dd7
ILT
54502008-04-17 Ian Lance Taylor <iant@google.com>
5451
5452 * common.cc (Symbol_table::allocate_commons): Remove options
5453 parameter. Change caller.
5454 (Symbol_table::do_allocate_commons): Remove options parameter.
5455 Change caller. Just call do_allocate_commons_list twice.
5456 (Symbol_table::do_allocate_commons_list): New function, broken out
5457 of do_allocate_commons.
5458 * common.h (class Allocate_commons_task): Remove options_ field.
5459 Update constructor.
5460 * symtab.cc (Symbol_table::Symbol_table): Initialize
5461 tls_commons_.
5462 (Symbol_table::add_from_object): Put TLS common symbols on
5463 tls_commons_ list.
5464 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
5465 which are IN_OUTPUT_DATA.
5466 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
5467 allocate_commons and do_allocate_commons declarations. Declare
5468 do_allocate_commons_list.
5469 * gold.cc (queue_middle_tasks): Update creation of
5470 Allocate_commons_task to not pass options.
5471 * testsuite/Makefile.am (INCLUDES): Add -I.. .
5472 (TLS_TEST_C_FLAGS): New variable.
5473 (tls_test_c_pic.o): New target.
5474 (tls_test_shared.so): Link in tls_test_c_pic.o.
5475 (tls_test_c_pic_ie.o): New target.
5476 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
5477 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
5478 (tls_test_c.o): New target.
5479 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
5480 (tls_pic_test_LDADD): Likewise.
5481 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
5482 (tls_shared_gd_to_ie_test_LDADD): Likewise.
5483 (tls_test_c_gnu2.o): New target.
5484 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
5485 tls_test_c_gnu2.o.
5486 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
5487 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
5488 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
5489 * testsuite/tls_test.cc: Include "config.h".
5490 (t_last): Call t11_last.
5491 * testsuite/tls_test.h (t11, t11_last): Declare.
5492 * testsuite/tls_test_c.c: New file.
5493 * testsuite/tls_test_main.cc (thread_routine): Call t11.
5494 * configure.ac: Check for OpenMP support.
5495 * configure, config.in, Makefile.in: Rebuild.
5496 * testsuite/Makefile.in: Rebuild.
5497
edfbb029
CC
54982008-04-16 Cary Coutant <ccoutant@google.com>
5499
5500 * i386.cc (Target_i386::define_tls_base_symbol): New function.
5501 (Target_i386::tls_base_symbol_defined_): New field.
5502 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
5503 (Target_i386::Scan::global): Likewise.
5504 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
5505 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
5506 (Target_x86_64::tls_base_symbol_defined_): New field.
5507 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
5508 (Target_x86_64::Scan::global): Likewise.
5509
f3c69fca
CC
55102008-04-16 Cary Coutant <ccoutant@google.com>
5511
5512 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
5513 (Symbol::needs_plt_entry): Allow weak undefined symbols.
5514 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
5515 building shared libraries.
5516 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
5517 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
5518 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
5519 * testsuite/Makefile.in: Rebuild.
5520 * testsuite/weak_undef.h: New file.
5521 * testsuite/weak_undef_file1.cc: Add extra test cases.
5522 * testsuite/weak_undef_file2.cc: Likewise.
5523 * testsuite/weak_undef_test.cc: Likewise.
5524
7c414435
DM
55252008-04-16 David S. Miller <davem@davemloft.net>
5526
32b769e1
DM
5527 * sparc.cc (Target_sparc::Scan): Change from struct to class.
5528 Add issued_non_pic_error_ field. Declare check_non_pic.
5529 (Target_sparc::Scan::check_non_pic): New function.
5530 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
5531 (Target_sparc::Scan::global): Likewise.
5532
11936fb1
DM
5533 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
5534 * configure: Rebuild.
5535
7c414435
DM
5536 * options.h (DEFINE_enable): New macro.
5537 (new_dtags): New enable option.
5538 (initfirst, interpose, loadfltr, nodefaultlib,
5539 nodelete, nodlopen, nodump): New -z options.
5540 * layout.cc (Layout:finish_dynamic_section): If new
5541 dtags enabled, emit DT_RUNPATH. Also, emit a
5542 DT_FLAGS_1 containing any specified -z flags.
5543
85c7bf8b
ILT
55442008-04-16 Ian Lance Taylor <iant@google.com>
5545
12c0daef
ILT
5546 * copy-relocs.cc: New file.
5547 * copy-relocs.h: New file.
5548 * reloc.cc: Remove Copy_relocs code.
5549 * reloc.h: Likewise.
5550 * reloc-types.h (struct Reloc_types) [both versions]: Add
5551 get_reloc_addend_noerror.
5552 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
5553 variants of add_global which take an addend which must be zero.
5554 * i386.cc: Include "copy-relocs.h".
5555 (class Target_i386): Change type of copy_relocs_ to variable,
5556 update initializer.
5557 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
5558 Change all callers.
5559 (Target_i386::do_finalize_sections): Change handling of
5560 copy_relocs_.
5561 * sparc.cc: Include "copy-relocs.h".
5562 (class Target_sparc): Change type of copy_relocs_ to variable,
5563 update initializer.
5564 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
5565 Change all callers.
5566 (Target_sparc::do_finalize_sections): Change handling of
5567 copy_relocs_.
5568 * x86_64.cc: Include "copy-relocs.h".
5569 (class Target_x86_64): Change type of copy_relocs_ to variable,
5570 update initializer.
5571 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
5572 class. Change all callers.
5573 (Target_x86_64::do_finalize_sections): Change handling of
5574 copy_relocs_.
5575 * Makefile.am (CCFILES): Add copy-relocs.cc.
5576 (HFILES): Add copy-relocs.h.
5577
4f4995b6
ILT
5578 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
5579
85c7bf8b
ILT
5580 * testsuite/script_test_4.sh: Permit leading zeroes.
5581
4f2a9edd
ILT
55822008-04-15 Ian Lance Taylor <iant@google.com>
5583
e6188289
ILT
5584 * script-sections.cc (Script_sections::create_segments): Use
5585 header_size_adjustment even when there is enough room for the
5586 headers.
5587 * testsuite/script_test_4.sh: New file.
5588 * testsuite/script_test_4.t: New file.
5589 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
5590 (check_DATA): Add script_test_4.stdout.
5591 (MOSTLYCLEANFILES): Likewise.
5592 (script_test_4): New target.
5593 (script_test_4.stdout): New target.
5594 * testsuite/Makefile.in: Rebuild.
5595
4f2a9edd
ILT
5596 * sparc.cc: Add definitions for Output_data_plt_sparc class
5597 constants.
5598
f5314dd5
DM
55992008-04-14 David S. Miller <davem@davemloft.net>
5600
5601 * sparc.cc: New file.
5602 * Makefile.am (TARGETSOURCES): Add sparc.cc
5603 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
5604 * configure.tgt: Document targ_extra_size and
5605 targ_extra_big_endian. Add entries for sparc-* and
5606 sparc64-*.
5607 * configure.ac: Handle targ_extra_size and
5608 targ_extra_big_endian.
5609 * Makefile.in: Rebuild.
5610 * configure: Likewise.
5611 * po/POTFILES.in: Likewise.
5612 * po/gold.pot: Likewise.
5613
154e0e9a
ILT
56142008-04-14 Ian Lance Taylor <iant@google.com>
5615
5616 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
5617 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
5618 in the name/type/flags to section mapping. Don't call
5619 allocate_output_section.
5620 (Layout::choose_output_section): Change parameter from adjust_name
5621 to is_input_section. Don't permit input sections after sections
5622 are attached to segments. Don't call allocate_output_section.
5623 (Layout::layout_eh_frame): Call update_flags_for_input_section,
5624 not write_enable_output_section.
5625 (Layout::make_output_section): Don't push to
5626 unattached_section_list_ nor call attach_to_segment. Call
5627 attach_section_to_segment if sections are attached.
5628 (Layout::attach_sections_to_segments): New function.
5629 (Layout::attach_section_to_segment): New function.
5630 (Layout::attach_allocated_section_to_segment): Rename from
5631 attach_to_segment. Remove flags parameter.
5632 (Layout::allocate_output_section): Remove function.
5633 (Layout::write_enable_output_section): Remove function.
5634 * layout.h (class Layout): Update for above changes. Add new
5635 field sections_are_attached_.
5636 * output.h (Output_section::update_flags_for_input_section): New
5637 function.
5638 * output.cc (Output_section::add_input_section): Call
5639 update_flags_for_input_section.
5640 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
5641
009a67a2
CC
56422008-04-11 Cary Coutant <ccoutant@google.com>
5643
5644 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
5645 thought unnecessary.
5646 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
5647
759b1a24
ILT
56482008-04-11 Ian Lance Taylor <iant@google.com>
5649
5650 * output.h (class Output_section_data): Remove inline definition
5651 of set_addralign.
5652 * output.cc (Output_section_data::set_addralign): New function.
5653
c2b45e22
CC
56542008-04-11 Cary Coutant <ccoutant@google.com>
5655
5656 Add support for TLS descriptors for i386 and x86_64.
5657 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
5658 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
5659 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
5660 GOT_TYPE_TLS_DESC.
5661 (Target_i386::got_mod_index_entry): Remove unnecessary code.
5662 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
5663 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
5664 relocations.
5665 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
5666 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
5667 Fix problem with initial-exec relocations.
5668 (Target_i386::Relocate::relocate_tls): Likewise.
5669 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
5670 relaxation.
5671 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
5672 support for section-plus-offset dynamic table entries.
5673 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
5674 (Output_data_dynamic::Dynamic_entry): Add support for
5675 section-plus-offset dynamic table entries.
5676 (Output_data_dynamic::Classification): Likewise.
5677 (Output_data_dynamic::classification_): Renamed offset_.
5678 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
5679 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
5680 (Target_x86_64::make_plt_section): New function.
5681 (Target_x86_64::reserve_tlsdesc_entries): New function.
5682 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
5683 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
5684 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
5685 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
5686 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
5687 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
5688 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
5689 add extra PLT entry for TLS descriptors.
5690 (Output_data_plt_x86_64::got_): New field.
5691 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
5692 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
5693 fields.
5694 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
5695 descriptors.
5696 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
5697 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
5698 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
5699 R_386_TLS_DESC_CALL relocations.
5700 (Target_x86_64::Scan::global): Likewise.
5701 (Target_x86_64::do_finalize_sections): Add dynamic table entries
5702 for TLS descriptors.
5703 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
5704 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
5705 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
5706 GD-to-IE relaxation.
5707 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
5708 and TLS_DESCRIPTORS.
5709 * Makefile.in: Rebuild.
5710 * configure: Rebuild.
5711 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
5712 (tls_test_shared2.so): New target.
5713 (tls_shared_gd_to_ie_test_SOURCES): New variable.
5714 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
5715 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
5716 (tls_shared_gd_to_ie_test_LDADD): New variable.
5717 (tls_shared_gnu2_gd_to_ie_test): New target.
5718 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
5719 New targets.
5720 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
5721 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
5722 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
5723 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
5724 (tls_shared_gnu2_test): New target.
5725 (tls_test_gnu2_shared.so): New target.
5726 (tls_shared_gnu2_test_SOURCES): New variable.
5727 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
5728 (tls_shared_gnu2_test_LDFLAGS): New variable.
5729 (tls_shared_gnu2_test_LDADD): New variable.
5730 * testsuite/Makefile.in: Rebuild.
5731 * testsuite/Makefile.
5732
83bfb6b7
ILT
57332008-04-11 Ian Lance Taylor <iant@google.com>
5734
5735 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
5736 justsyms.t.
5737 * testsuite/Makefile.in: Rebuild.
5738
5739 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
5740 long.
5741 * testsuite/script_test_2.cc (main): Adjust test.
5742
706e1f5e
ILT
57432008-04-11 David S. Miller <davem@davemloft.net>
5744 Ian Lance Taylor <iant@google.com>
5745
5746 * options.h (General_options): Add entries for '-Y' and
5747 '-relax'.
5748 * options.cc (General_options:finalize): If -Y was used, add those
5749 entries to the library path instead of the default "/lib" and
5750 "/usr/lib".
5751
7c98e6bb
DM
57522008-04-11 David S. Miller <davem@davemloft.net>
5753
5754 * testsuite/justsyms.t: Start at 0x100.
5755 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
5756 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
5757 long.
5758 * testsuite/script_test_2.cc: Adjust string and section length
5759 checks.
7c98e6bb 5760
99a37bfd
ILT
57612008-04-09 Ian Lance Taylor <iant@google.com>
5762
2cefc357
ILT
5763 PR gold/5996
5764 * script-sections.cc (Sections_element::allocate_to_segment): Add
5765 orphan parameter.
5766 (Output_section_definition::allocate_to_segment): Likewise.
5767 (Orphan_output_section::allocate_to_segment): Likewise.
5768 (Script_sections::attach_sections_using_phdrs_clause): Don't
5769 propagate non-PT_LOAD segments to orphan sections.
5770 * testsuite/Makefile.am (script_test_3.stdout): Generate using
5771 readelf rather than objdump.
5772 * testsuite/script_test_3.sh: Adjust accordingly. Test that
5773 .interp section and PT_INTERP segment are the same size.
5774 * testsuite/Makefile.in: Rebuild.
5775
99a37bfd
ILT
5776 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
5777 aliases for symbols defined in the same object.
5778 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
5779 (weak_alias_test_SOURCES): New variable.
5780 (weak_alias_test_DEPENDENCIES): New variable.
5781 (weak_alias_test_LDFLAGS): New variable.
5782 (weak_alias_test_LDADD): New variable.
5783 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
5784 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
5785 (weak_alias_test_3.o): New target.
5786 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
5787 * testsuite/weak_alias_test_main.cc: New file.
5788 * testsuite/weak_alias_test_1.cc: New file.
5789 * testsuite/weak_alias_test_2.cc: New file.
5790 * testsuite/weak_alias_test_3.cc: New file.
5791
780e49c5
ILT
57922008-04-08 Ian Lance Taylor <iant@google.com>
5793
cdb0b8f5
ILT
5794 * options.h (class General_options): Add --noinhibit-exec option.
5795 * main.cc (main): Check --noinhibit-exec.
5796
0864d551
ILT
5797 * options.h (class General_options): Define --wrap as a special
5798 option. Add wrap_symbols_ field.
5799 (General_options::any_wrap_symbols): New function.
5800 (General_options::is_wrap_symbol): New function.
5801 * options.cc (General_options::parse_wrap): New function.
5802 (General_options::General_options): Initialize wrap_symbols_.
5803 * symtab.cc (Symbol_table::wrap_symbol): New function.
5804 (Symbol_table::add_from_object): Handle --wrap.
5805 * symtab.h (class Symbol_table): Declare wrap_symbol.
5806 * target.h (Target::wrap_char): New function.
5807 (Target::Target_info): Add wrap_char field.
5808 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
5809 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5810 * testsuite/testfile.cc (Target_test::test_target_info):
5811 Likewise.
5812
789aa6de
ILT
5813 * errors.cc (Errors::undefined_symbol): Mention symbol version if
5814 there is one.
5815
2c38906f
ILT
5816 * layout.h (class Layout): Add added_eh_frame_data_ field.
5817 * layout.cc (Layout::Layout): Initialize new field.
5818 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
5819 output section until we find a section we merged successfully.
5820 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
5821 that the size be non-zero.
5822
780e49c5
ILT
5823 * merge.cc (Object_merge_map::get_output_offset): Remove inline
5824 qualifier.
5825
7fcd0256
ILT
58262008-04-08 Craig Silverstein <csilvers@google.com>
5827
5828 * configure.ac: Export new conditional variable HAVE_ZLIB.
5829 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
5830 on HAVE_ZLIB.
5831 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
5832 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
5833
6835af53
ILT
58342008-04-07 Ian Lance Taylor <iant@google.com>
5835
e24f324c
ILT
5836 * version.cc (version_string): Set to "1.5".
5837
a036edd8
ILT
5838 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
5839 Add issued_non_pic_error_ field. Declare check_non_pic.
5840 (Target_x86_64::Scan::check_non_pic): New function.
5841 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
5842 (Target_x86_64::Scan::global): Likewise.
5843
624f8810
ILT
5844 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
5845 addend parameter. Change caller. Handle merge sections.
5846 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
5847 Address to Addend. Don't add in the result of
5848 local_section_offset, pass down the addend and use the returned
5849 value.
5850 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
5851 Update declarations of local_section_offset and symbol_value.
5852 * testsuite/two_file_test_1.cc (t18): New function.
5853 * testsuite/two_file_test_2.cc (f18): New function.
5854 * testsuite/two_file_test_main.cc (main): Call t18.
5855 * testsuite/two_file_test.h (t18, f18): Declare.
5856
6835af53
ILT
5857 * configure.ac: Don't test for objdump, c++filt, or readelf.
5858 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
5859 conditionals.
5860 (TEST_READELF): New variable.
5861 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
5862 (check_PROGRAMS): Add two_file_strip_test.
5863 (two_file_strip_test): New target.
5864 (check_PROGRAMS): Add two_file_same_shared_strip_test.
5865 (two_file_same_shared_strip_test_SOURCES): New variable.
5866 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
5867 (two_file_same_shared_strip_test_LDFLAGS): New variable.
5868 (two_file_same_shared_strip_test_LDADD): New variable.
5869 (two_file_shared_strip.so): New target.
5870 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
5871 (ver_test_5.syms, ver_test_7.syms): Likewise.
5872 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
5873 (strip_test_3.stdout): Use TEST_OBJDUMP.
5874 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
5875
86925eef
CC
58762008-04-04 Cary Coutant <ccoutant@google.com>
5877
5878 * symtab.h (Symbol::is_weak_undefined): New function.
5879 (Symbol::is_strong_undefined): New function.
5880 (Symbol::is_absolute): New function.
5881 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
5882 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
5883 absolute symbols.
5884 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
5885 (weak_undef_test): New target.
5886 * testsuite/Makefile.in: Rebuild.
5887 * testsuite/weak_undef_file1.cc: New file.
5888 * testsuite/weak_undef_file2.cc: New file.
5889 * testsuite/weak_undef_test.cc: New file.
5890
126f3ece
ILT
58912008-04-03 Craig Silverstein <csilvers@google.com>
5892
5893 * compressed_output.h (class Output_compressed_section): Use
5894 unsigned buffer.
5895 * compressed_output.cc (zlib_compress): Use unsigned buffers,
5896 add zlib header.
5897 (zlib_compressed_suffix): Removed.
5898 (Output_compressed_section::set_final_data_size): Use unsigned
5899 buffers.
5900 * testsuite/Makefile.am (flagstest_compress_debug_sections):
5901 Fix linker invocation.
5902 (flagstest_o_specialfile_and_compress_debug_sections):
5903 Likewise.
5904 * testsuite/Makefile.in: Regenerated.
5905
deae2a14
DM
59062008-04-02 David S. Miller <davem@davemloft.net>
5907
5908 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
5909 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
5910
70752818
ILT
59112008-04-02 Craig Silverstein <csilvers@google.com>
5912
5913 * TODO: New file.
5914
39d0cb0e
ILT
59152008-04-02 Ian Lance Taylor <iant@google.com>
5916
5917 * fileread.cc (File_read::find_view): Add byteshift and vshifted
5918 parameters. Update for new key type to views_. Change all
5919 callers.
5920 (File_read::read): Adjust for byteshift in returned view.
5921 (File_read::add_view): New function, broken out of
5922 find_and_make_view.
5923 (File_read::make_view): New function, broken out of
5924 find_and_make_view.
5925 (File_read::find_or_make_view): Add offset and aligned
5926 parameters. Rewrite accordingly. Change all callers.
5927 (File_read::get_view): Add offset and aligned parameters. Adjust
5928 for byteshift in return value.
5929 (File_read::get_lasting_view): Likewise.
5930 * fileread.h (class File_read): Update declarations.
5931 (class File_read::View): Add byteshift_ field. Add byteshift to
5932 constructor. Add byteshift method.
5933 * archive.h (Archive::clear_uncached_views): New function.
5934 (Archive::get_view): Add aligned parameter. Change all callers.
5935 * object.h (Object::get_view): Add aligned parameter. Change all
5936 callers.
5937 (Object::get_lasting_view): Likewise.
5938
5939 * fileread.cc (File_read::release): Don't call clear_views if
5940 there are multiple objects.
5941 * fileread.h (File_read::clear_uncached_views): New function.
5942 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
5943 on the archive.
5944
a1207466
CC
59452008-03-31 Cary Coutant <ccoutant@google.com>
5946
5947 Add thin archive support.
5948 * archive.cc (Archive::armagt): New const.
5949 (Archive::setup): Remove task parameter and calls to unlock.
5950 (Archive::unlock_nested_archives): New function.
5951 (Archive::read_header): Add nested_off parameter. Change
5952 all callers.
5953 (Archive::interpret_header): Likewise.
5954 (Archive::include_all_members): Change to handle thin
5955 archives.
5956 (Archive::include_member): Likewise.
5957 * archive.h (Archive::Archive): Add new parameters and
5958 initializers.
5959 (Archive::armagt): New const.
5960 (Archive::setup): Remove task parameter.
5961 (Archive::unlock_nested_archives): New function.
5962 (Archive::read_header): Add nested_off parameter.
5963 (Archive::interpret_header): Likewise.
5964 (Archive::Nested_archive_table): New typedef.
5965 (Archive::is_thin_archive_): New field.
5966 (Archive::nested_archives_): New field.
5967 (Archive::options_): New field.
5968 (Archive::dirpath_): New field.
5969 (Archive::task_): New field.
5970 * readsyms.cc (Read_symbols::do_read_symbols): Add check
5971 for thin archives. Pass additional parameters to
5972 Archive::Archive. Unlock the archive file after calling
5973 Archive::setup.
cd536b21 5974
479f6503
ILT
59752008-03-29 Ian Lance Taylor <iant@google.com>
5976
686c8caf
ILT
5977 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
5978 version symbol to be local.
5979 * testsuite/ver_test_4.sh: New file.
5980 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
5981 (check_DATA): Add ver_test_4.syms.
5982 (ver_test_4.syms): New target.
5983 * testsuite/Makefile.in: Rebuild.
5984
ab794b6b
ILT
5985 * output.cc
5986 (Output_section::Input_section_sort_entry::has_priority): New
5987 function.
5988 (Output_section::Input_section_sort_entry::match_file_name): New
5989 function.
5990 (Output_section::Input_section_sort_entry::match_section_name):
5991 Remove.
5992 (Output_section::Input_section_sort_entry::match_section_name_prefix):
5993 Remove.
5994 (Output_section::Input_section_sort_entry::match_section_file):
5995 Remove.
5996 (Output_section::Input_section_sort_compare::operator()): Rewrite
5997 using new Input_section_sort_entry functions. Sort crtbegin and
5998 crtend first. Sort sections with no priority before sections with
5999 a priority.
6000 * testsuite/initpri1.c (d3): Check j != 4.
6001 (cd5): New constructor/destructor function.
6002 (main): Check j != 2.
6003
479f6503
ILT
6004 * symtab.cc (Symbol_table::add_from_object): If we don't use the
6005 new symbol when resolving, don't call set_is_default.
6006 * testsuite/ver_test_7.cc: New file.
6007 * testsuite/ver_test_7.sh: New file.
6008 * testsuite/Makefile.am (ver_test_7.so): New target.
6009 (ver_test_7.o): New target.
6010 (check_SCRIPTS): Add ver_test_7.sh.
6011 (check_DATA): Add ver_test_7.syms.
6012 (ver_test_7.syms): New target.
6013
2fd32231
ILT
60142008-03-28 Ian Lance Taylor <iant@google.com>
6015
6016 * layout.cc (Layout::layout): If we see an input section with a
6017 name that needs sorting, set the must_sort flag for the output
6018 section.
6019 (Layout::make_output_section): If the name of the output section
6020 indicates that it might require sorting, set the may_sort flag.
6021 * output.h (Output_section::may_sort_attached_input_sections): New
6022 function.
6023 (Output_section::set_may_sort_attached_input_sections): New
6024 function.
6025 (Output_section::must_sort_attached_input_sections): New
6026 function.
6027 (Output_section::set_must_sort_attached_input_sections): New
6028 function.
6029 (class Output_section): Declare Input_section_sort_entry. Define
6030 Input_section_sort_compare. Declare
6031 sort_attached_input_sections. Add new fields:
6032 may_sort_attached_input_sections_,
6033 must_sort_attached_input_sections_,
6034 attached_input_sections_are_sorted_.
6035 * output.cc (Output_section::Output_section): Initialize new
6036 fields.
6037 (Output_section::add_input_section): Add an entry to
6038 input_sections_ if may_sort or must_sort are true.
6039 (Output_section::set_final_data_size): Call
6040 sort_attached_input_sections if necessary.
6041 (Output_section::Input_section_sort_entry): Define new class.
6042 (Output_section::Input_section_sort_compare::operator()): New
6043 function.
6044 (Output_section::sort_attached_input_sections): New function.
6045 * configure.ac: Check whether the compiler supports constructor
6046 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
6047 * testsuite/initpri1.c: New file.
6048 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
6049 CONSTRUCTOR_PRIORITY.
6050 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
6051 (initpri1_LDFLAGS): New variable.
6052 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
6053
18e6b24e
ILT
60542008-03-27 Ian Lance Taylor <iant@google.com>
6055
49bdd526
ILT
6056 * common.cc (Sort_commons::operator): Correct sorting algorithm.
6057 * testsuite/common_test_1.c: New file.
6058 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
6059 (common_test_1_SOURCES): New variable.
6060 (common_test_1_DEPENDENCIES): New variable.
6061 (common_test_1_LDFLAGS): New variable.
6062
18e6b24e
ILT
6063 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
6064 and commons_ correctly when NAME/VERSION does not override
6065 NAME/NULL.
6066 * testsuite/ver_test_6.c: New file.
6067 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
6068 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
6069 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
6070
04bf7072
ILT
60712008-03-26 Ian Lance Taylor <iant@google.com>
6072
5871526f
ILT
6073 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
6074 of an undefined symbol from a version script.
6075 * testsuite/Makefile.am (ver_test_5.so): New target.
6076 (ver_test_5.o): New target.
6077 (check_SCRIPTS): Add ver_test_5.sh.
6078 (check_DATA): Add ver_test_5.syms.
6079 (ver_test_5.syms): New target.
6080 * testsuite/ver_test_5.cc: New file.
6081 * testsuite/ver_test_5.script: New file.
6082 * testsuite/ver_test_5.sh: New file.
6083 * Makefile.in, testsuite/Makefile.in: Rebuild.
6084
04bf7072
ILT
6085 PR gold/5986
6086 Fix problems building gold with gcc 4.3.0.
6087 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
6088 (gold_error_at_location, gold_warning_at_location): Use it.
6089 * configure.ac: Check whether we can compile and use a template
6090 function with a printf attribute.
6091 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
6092 when jumping over bytes.
6093 * object.cc: Instantiate Object::read_section_data.
6094 * debug.h: Include <cstring>
6095 * dwarf_reader.cc: Include <algorithm>
6096 * main.cc: Include <cstring>.
6097 * options.cc: Include <cstring>.
6098 * output.cc: Include <cstring>.
6099 * script.cc: Include <cstring>.
6100 * script.h: Include <string>.
6101 * symtab.cc: Include <cstring> and <algorithm>.
6102 * target-select.cc: Include <cstring>.
6103 * version.cc: Include <string>.
6104 * testsuite/testmain.cc: Include <cstdlib>.
6105 * configure, config.in: Rebuild.
6106
874c5b28
ILT
61072008-03-25 Ian Lance Taylor <iant@google.com>
6108
819d6c3a
ILT
6109 * options.cc: Include "../bfd/bfdver.h".
6110 (options::help): Print bug reporting address.
6111
f4b2c6f5
ILT
6112 * version.cc (print_version): Adjust output for current value of
6113 BFD_VERSION_STRING.
6114
6115 * NEWS: New file.
6116
e96caa79
ILT
6117 * options.cc (options::help): Print list of supported targets.
6118 * target-select.h: Include <vector>.
6119 (class Target_selector): Make machine_, size_, and is_big_endian_
6120 fields const. Add bfd_name_ and instantiated_target_ fields.
6121 (Target_selector::Target_selector): Add bfd_name parameter.
6122 (Target_selector::recognize): Make non-virtual, call
6123 do_recognize.
6124 (Target_selector::recognize_by_name): Make non-virtual, call
6125 do_recognize_by_name.
6126 (Target_selector::supported_names): New function.
6127 (Target_selector::bfd_name): New function.
6128 (Target_selector::do_instantiate_target): New pure virtual
6129 function.
6130 (Target_selector::do_recognize): New virtual function.
6131 (Target_selector::do_recognize_by_name): New virtual function.
6132 (Target_selector::instantiate_target): New private function.
6133 (supported_target_names): Declare.
6134 * target-select.cc (Target_selector::Target_selector): Update for
6135 new parameter and fields.
6136 (select_target_by_name): Check that the name matches before
6137 calling recognize_by_name.
6138 (supported_target_names): New function.
6139 * i386.cc (class Target_selector_i386): Update Target_selector
6140 constructor call. Remove recognize and recognize_by_name. Add
6141 do_instantiate_target.
6142 * x86_64.cc (class Target_selector_x86_64): Likewise.
6143 * testsuite/testfile.cc (class Target_selector_test): Update for
6144 changes to Target_selector.
6145
874c5b28
ILT
6146 * README: Rewrite, with some notes on unsupported features.
6147
0a65a3a7
CC
61482008-03-24 Cary Coutant <ccoutant@google.com>
6149
6150 * i386.cc (Target_i386::Got_type): New enum declaration.
6151 (Target_i386::Scan::local): Updated callers of Output_data_got
6152 member functions.
6153 (Target_i386::Scan::global): Likewise.
6154 (Target_i386::Relocate::relocate): Likewise.
6155 (Target_i386::Relocate::relocate_tls): Likewise.
6156 * object.h (Got_offset_list): New class.
6157 (Sized_relobj::local_has_got_offset): Added got_type parameter.
6158 (Sized_relobj::local_got_offset): Likewise.
6159 (Sized_relobj::set_local_got_offset): Likewise.
6160 (Sized_relobj::local_has_tls_got_offset): Removed.
6161 (Sized_relobj::local_tls_got_offset): Removed.
6162 (Sized_relobj::set_local_tls_got_offset): Removed.
6163 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
6164 * output.cc (Output_data_got::add_global): Added got_type parameter.
6165 (Output_data_got::add_global_with_rel): Likewise.
6166 (Output_data_got::add_global_with_rela): Likewise.
6167 (Output_data_got::add_global_pair_with_rel): New function.
6168 (Output_data_got::add_global_pair_with_rela): New function.
6169 (Output_data_got::add_local): Added got_type parameter.
6170 (Output_data_got::add_local_with_rel): Likewise.
6171 (Output_data_got::add_local_with_rela): Likewise.
6172 (Output_data_got::add_local_pair_with_rel): New function.
6173 (Output_data_got::add_local_pair_with_rela): New function.
6174 (Output_data_got::add_global_tls): Removed.
6175 (Output_data_got::add_global_tls_with_rel): Removed.
6176 (Output_data_got::add_global_tls_with_rela): Removed.
6177 (Output_data_got::add_local_tls): Removed.
6178 (Output_data_got::add_local_tls_with_rel): Removed.
6179 (Output_data_got::add_local_tls_with_rela): Removed.
6180 * output.h (Output_data_got::add_global): Added got_type parameter.
6181 (Output_data_got::add_global_with_rel): Likewise.
6182 (Output_data_got::add_global_with_rela): Likewise.
6183 (Output_data_got::add_global_pair_with_rel): New function.
6184 (Output_data_got::add_global_pair_with_rela): New function.
6185 (Output_data_got::add_local): Added got_type parameter.
6186 (Output_data_got::add_local_with_rel): Likewise.
6187 (Output_data_got::add_local_with_rela): Likewise.
6188 (Output_data_got::add_local_pair_with_rel): New function.
6189 (Output_data_got::add_local_pair_with_rela): New function.
6190 (Output_data_got::add_global_tls): Removed.
6191 (Output_data_got::add_global_tls_with_rel): Removed.
6192 (Output_data_got::add_global_tls_with_rela): Removed.
6193 (Output_data_got::add_local_tls): Removed.
6194 (Output_data_got::add_local_tls_with_rel): Removed.
6195 (Output_data_got::add_local_tls_with_rela): Removed.
6196 * resolve.cc (Symbol::override_base_with_special): Removed
6197 reference to has_got_offset_ field.
6198 * symtab.cc (Symbol::init_fields): Replaced initialization
6199 of got_offset_ with got_offsets_. Removed initialization
6200 of has_got_offset_
53fcba31 6201 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
6202 (Symbol::got_offset): Likewise.
6203 (Symbol::set_got_offset): Likewise.
6204 (Symbol::has_tls_got_offset): Removed.
6205 (Symbol::tls_got_offset): Removed.
6206 (Symbol::set_tls_got_offset): Removed.
6207 (Symbol::got_offset_): Removed.
6208 (Symbol::tls_mod_got_offset_): Removed.
6209 (Symbol::tls_pair_got_offset_): Removed.
6210 (Symbol::got_offsets_): New field.
6211 (Symbol::has_got_offset): Removed.
6212 (Symbol::has_tls_mod_got_offset): Removed.
6213 (Symbol::has_tls_pair_got_offset): Removed.
6214 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
6215 (Target_x86_64::Scan::local): Updated callers of Output_data_got
6216 member functions.
6217 (Target_x86_64::Scan::global): Likewise.
6218 (Target_x86_64::Relocate::relocate): Likewise.
6219 (Target_x86_64::Relocate::relocate_tls): Likewise.
6220
bd52eafb
BE
62212008-03-25 Ben Elliston <bje@au.ibm.com>
6222
6223 * yyscript.y: Fix spelling error in comment.
6224
8b105e34
ILT
62252008-03-24 Ian Lance Taylor <iant@google.com>
6226
8ed814a9
ILT
6227 * options.h (class General_options): Define build_id option.
6228 * layout.h (class Layout): Declare write_build_id, create_note,
6229 create_build_id. Add build_id_note_ member.
6230 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
6231 "libiberty.h", "md5.h", "sha1.h".
6232 (Layout::Layout): Initialize eh_frame_data_,
6233 eh_frame_hdr_section_, and build_id_note_.
6234 (Layout::finalize): Call create_build_id.
6235 (Layout::create_note): New function, broken out of
6236 Layout::create_gold_note.
6237 (Layout::create_gold_note): Call create_note.
6238 (Layout::create_build_id): New function.
6239 (Layout::write_build_id): New function.
6240 (Close_task_runner::run): Call write_build_id.
6241
8b105e34
ILT
6242 * x86_64.cc: Correct license to GPLv3.
6243
086a1841
ILT
62442008-03-23 Ian Lance Taylor <iant@google.com>
6245
6246 * options.cc: Include "demangle.h".
6247 (parse_optional_string): New function.
6248 (parse_long_option): Handle takes_optional_argument.
6249 (parse_short_option): Update dash_z initializer. Handle
6250 takes_optional_argument.
6251 (General_options::General_options): Initialize do_demangle_.
6252 (General_options::finalize): Set do_demangle_. Handle demangling
6253 style.
6254 * options.h (parse_optional_string): Declare.
6255 (struct One_option): Add optional_arg field. Update constructor.
6256 Update call constructor calls. Add takes_optional_argument
6257 function.
6258 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
6259 (DEFINE_optional_string): Define.
6260 (General_options::demangle): Change from DEFINE_bool to
6261 DEFINE_optional_string.
6262 (General_options::no_demangle): New function.
6263 (General_options::do_demangle): New function.
6264 (General_options::set_do_demangle): New function.
6265 (General_options::execstack_status_): Move definition to end of
6266 class definition.
6267 (General_options::static_): Likewise.
6268 (General_options::do_demangle_): New field.
6269 * object.cc (big_endian>::get_symbol_location_info): Call
6270 Options::do_demangle, not Options::demangle.
6271 * symtab.cc (demangle): Likewise.
6272
cbb93e63
ILT
62732008-03-22 Ian Lance Taylor <iant@google.com>
6274
6275 * gold.h: Include <cstddef> and <sys/types.h>
6276 * options.h: Include <cstring>.
6277
ec531623
ILT
62782008-03-21 Ian Lance Taylor <iant@google.com>
6279
6280 * Added source code to GNU binutils.
This page took 0.368942 seconds and 4 git commands to generate.