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