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