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