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