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