1 2010-02-09 David S. Miller <davem@davemloft.net>
3 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4 R_SPARC_RELATIVE using ->add_local_relative().
5 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7 2010-02-08 Doug Kwan <dougkwan@google.com>
9 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
12 Arm_relobj::scan_section_for_cortex_a8_stubs,
13 Arm_relobj::do_relocation_section): Instead of calling
14 Output_section::output_address, use faster
15 Arm_relobj::simple_input_section_output_address.
17 2010-02-08 David S. Miller <davem@davemloft.net>
19 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
20 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
21 relocation helper function.
23 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
24 just like R_SPARC_GOT{10,13,22}.
25 (Target_sparc::Scan::local): Likewise.
26 (Target_sparc::Relocate:relocate): Likewise.
28 2010-02-06 Ian Lance Taylor <iant@google.com>
30 * configure.ac: Rewrite targetobjs duplicate removal code to use
31 only shell constructs.
34 2010-02-05 Doug Kwan <dougkwan@google.com>
37 * arm.cc (Arm_relobj::section_is_scannable): New method.
38 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
39 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
41 2010-02-04 Doug Kwan <dougkwan@google.com>
44 * arm-reloc-property.cc (cstdio): Include.
45 * configure.ac (targetobjs): Remove duplicates.
46 * configure: Regenerate.
47 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
48 big and little endian version for a given address size.
50 2010-02-03 Doug Kwan <dougkwan@google.com>
52 * arm-reloc-property.cc
53 (Arm_reloc_property_table::reloc_name_in_error_message): New method
55 * arm-reloc-property.h
56 (Arm_reloc_property_table::get_implemented_static_reloc_property):
57 New method definition.
58 (Arm_reloc_property_table::reloc_name_in_error_message): New method
60 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
62 (GOT_PREL): Change implemented to Y.
63 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
64 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
65 (Arm_relocate_functions::movw_abs_nc): Remove method.
66 (Arm_relocate_functions::movt_abs): Ditto.
67 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
68 (Arm_relocate_functions::thm_movt_abs): Ditto.
69 (Arm_relocate_functions::movw_rel_nc): Ditto.
70 (Arm_relocate_functions::movw_rel): Ditto.
71 (Arm_relocate_functions::movt_rel): Ditto.
72 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
73 (Arm_relocate_functions:thm_movw_rel): Ditto.
74 (Arm_relocate_functions:thm_movt_rel): Ditto.
75 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
76 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
77 New method definitions.
78 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
79 (Arm_relocation_functions::arm_grp_ldr): Ditto.
80 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
81 (Arm_relocation_functions::arm_grp_ldc): Ditto.
82 (Target_arm::Relocate::relocate): Check for non-static or
83 unimplemented relocation code and exit early. Change calls to
84 Target_arm::reloc_uses_thumb_bit and
85 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
86 instead. Refactor code to handle similar relocations to increase
87 code sharing. Remove check for unsupported relocation code in switch
89 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
90 relocation property table to find out size. Change error message to
91 print out the name of a relocation code instead of the numeric value.
92 (Target_arm::scan_reloc_for_stub): Use relocation property table
93 instead of calling Target_arm::reloc_uses_thumb_bit().
95 2010-02-02 Doug Kwan <dougkwan@google.com>
97 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
98 types of relaxed input section.
100 2010-02-02 Doug Kwan <dougkwan@google.com>
102 * Makefile.am (HFILES): Add arm-reloc-property.h.
104 (TARGETSOURCES): Add arm-reloc-property.cc
105 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
106 (libgold_a_SOURCES): $(DEFFILES)
107 * Makefile.in: Regenerate.
108 * arm-reloc-property.cc: New file.
109 * arm-reloc-property.h: New file.
110 * arm-reloc.def: New file.
111 * arm.cc: Update comments.
112 (arm-reloc-property.h): New included header.
113 (arm_reloc_property_table): New global variable.
114 (Target_arm::do_select_as_default_target): New method definition.
115 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
116 arm-reloc-property to targ_extra_obj.
117 * parameters.cc (set_parameters_target): Call
118 Target::select_as_default_target().
119 * target.h (Target::select_as_default_target): New method definition.
120 (Target::do_select_as_default_target): Same.
122 2010-02-01 Doug Kwan <dougkwan@google.com>
124 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
125 first_output_text_section_.
126 (Arm_exidx_fixup::first_output_text_section): New method definition.
127 (Arm_exidx_fixup::first_output_text_section_): New data member.
128 (Arm_exidx_fixup::process_exidx_section): Record the first text
130 (Arm_output_section::fix_exidx_coverage): Set correct linked section
131 and entsize in output section header.
133 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
135 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
136 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
137 (Arm_relocate_functions::thm_alu11): New Method.
138 (Arm_relocate_functions::thm_pc8): New Method.
139 (Arm_relocate_functions::thm_pc12): New Method.
140 (Target_arm::Scan::local): Handle the relocations.
141 (Target_arm::Scan::global): Likewise.
142 (Target_arm::Relocate::relocate): Likewise.
143 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
145 2010-01-29 Doug Kwan <dougkwan@google.com>
147 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
148 of relocation types as ld.
150 2010-01-29 Doug Kwan <dougkwan@google.com>
152 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
154 (Arm_relocate_functions::thumb_branch_common): Ditto.
155 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
156 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
157 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
158 Arm_relocate_functions::jump24): Remove.
159 (Target_arm::Relocate::relocate): Adjust code to call
160 Arm_relocation_functions::arm_branch_common and
161 Arm_relocation_functions::thumb_branch_common instead of their removed
162 wrappers. Merge switch-cases together to reduce source code size.
164 2010-01-29 Doug Kwan <dougkwan@google.com>
166 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
167 output_local_symbol_count_needs_update_.
168 (Arm_relobj::output_local_symbol_count_needs_update,
169 Arm_relobj::set_output_local_symbol_count_needs_update,
170 Arm_relobj::update_output_local_symbol_count): New methods.
171 (Arm_relobj::output_local_symbol_count_needs_update_): New data
173 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
174 of pointed function as in a R_ARM_PREL31 relocation.
175 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
176 for output local symbol count updating.
177 (Target_arm::do_relax): Update output local symbol counts in objects
179 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
181 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
183 * arm.cc: Added support for the ARM relocations:
184 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
185 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
186 (Arm_relocate_functions::movw_rel_nc): Renamed (was
188 (Arm_relocate_functions::movw_rel): New method.
189 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
190 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
192 (Arm_relocate_functions::thm_movw_rel): New method.
193 (Arm_relocate_functions::thm_movt_rel): Renamed (was
195 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
197 (Target_arm::Scan::global): Likewise.
198 (Target_arm::Relocate::relocate): Likewise.
199 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
202 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
204 * arm.cc: Added support for ARM group relocations.
205 (Target_arm::reloc_needs_sym_origin): New method.
206 (Arm_relocate_functions::calc_grp_kn): New method.
207 (Arm_relocate_functions::calc_grp_residual): New method.
208 (Arm_relocate_functions::calc_grp_gn): New method.
209 (Arm_relocate_functions::arm_grp_alu): New Method.
210 (Arm_relocate_functions::arm_grp_ldr): New Method.
211 (Arm_relocate_functions::arm_grp_ldrs): New Method.
212 (Arm_relocate_functions::arm_grp_ldc): New Method.
213 (Target_arm::Scan::local): Handle the ARM group relocations.
214 (Target_arm::Scan::global): Likewise.
215 (Target_arm::Relocate::relocate): Likewise.
216 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
219 2010-01-26 Doug Kwan <dougkwan@google.com>
221 * arm.cc (set): Include.
222 (class Arm_exidx_fixup): Change type of last_input_section_ to const
224 (Arm_output_section::Text_section_list): New type.
225 (Arm_output_section::append_text_sections_to_list): New method.
226 (Arm_output_section::fix_exidx_coverage): Ditto.
227 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
228 (Arm_relobj::convert_input_section_to_relaxed_section): Use
229 Relobj::set_section_offset() instead of
230 Sized_relobj::invalidate_section_offset().
231 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
232 parameter for section headers. Ignore relocation sections for
233 unallocated sections and EXIDX sections.
234 (Target_arm::fix_exidx_coverage): New method.
235 (Target_arm::output_section_address_less_than): New type.
236 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
237 linked text section instead of the EXIDX section.
238 (Arm_output_section::create_stub_group): Add an assertion to check
239 that this is not an EXIDX output section.
240 (Arm_output_section::append_text_sections_to_list): New method.
241 (Arm_output_section::fix_exidx_coverage): Ditto.
242 (Arm_relobj::scan_sections_for_stubs): Adjust call to
243 Arm_relobj::section_needs_reloc_stub_scanning.
244 (Target_arm::do_relax): Fix EXIDX output section coverage in the
246 (Target_arm::fix_exidx_coverage): New method.
247 * object.h (Relobj::set_output_section): New method.
248 (Sized_relobj::invalidate_section_offset): Remove method.
249 (Sized_relobj::do_invalidate_section_offset): Remove method.
250 (Sized_relobj::do_set_section_offset): Handle offset value -1.
252 2010-01-25 Doug Kwan <dougkwan@google.com>
254 * arm.cc (Arm_exidx_merged_section::do_output_offset):
255 Fix warning due to signed and unsigned comparison on a 32-bit host.
257 2010-01-22 Doug Kwan <dougkwan@google.com>
259 * arm.cc (Target_arm::do_relax): Record an output section for section
260 offset adjustment it contains any stub table that has changed.
261 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
262 offsets in an output section if necessary.
263 * output.cc (Output_section::Output_section): Initialize
264 section_offsets_need_adjustments_.
265 (Output_section::add_input_section_for_script): Renamed to
266 Output_section::add_simple_input_section.
267 (Output_section::save_states): Add a comment.
268 (Output_section::discard_states): New method defintion.
269 (Output_section::adjust_section_offsets): Same.
270 * output.h (Output_section::add_input_section_for_script): Renamed to
271 Output_section::add_simple_input_section.
272 (Output_section::discard_states): New method declaration.
273 (Output_section::adjust_section_offsets): Same.
274 (Output_section::section_offsets_need_adjustment,
275 Output_section::set_section_offsets_need_adjustment): New method
277 (Output_section::section_offsets_need_adjustment_): New data member.
279 (Output_section_element_input::set_section_address): Adjust code for
280 renaming of Output_section::add_input_section_for_script.
281 (Orphan_output_section::set_section_address): Same.
283 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
285 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
286 Fix_v4bx enum values .
287 * gold/options.h (General_options): New option definitions.
288 (General_options::fix_v4bx): New method.
289 (General_options::Fix_v4bx): New enum.
290 * gold/options.cc (General_options::parse_fix_v4bx): New method.
291 (General_options::parse_fix_v4bx_interworking): New method.
293 2010-01-22 Doug Kwan <dougkwan@google.com>
295 * arm.cc (Arm_exidx_fixup): New class.
297 2010-01-21 Doug Kwan <dougkwan@google.com>
299 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
301 (Arm_exidx_section_offset_map): New type.
303 2010-01-21 Doug Kwan <dougkwan@google.com>
305 * arm.cc (Arm_exidx_input_section): New class.
306 (Arm_relobj::exidx_input_section_by_link,
307 Arm_relobj::exidx_input_section_by_shndx,
308 Arm_relobj::make_exidx_input_section): New methods.
309 (read_arm_attributes_section): Remove.
310 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
311 information about them.
312 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
315 2010-01-20 Doug Kwan <dougkwan@google.com>
317 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
318 Input_section_specifier to Section_id.
319 (Target_arm::new_arm_input_section: Adjust code for change of key
321 (Target_arm::find_arm_input_section): Ditto.
322 * gc.h (object.h): Include for Section_id nand Section_id_hash.
323 (Section_id): Remove.
324 (Garbage_collection::Section_id_hash): Remove.
325 * icf.h (object.h): Include for Section_id nand Section_id_hash.
326 (Section_id): Remove.
327 (Icf::Section_id_hash): Remove.
328 * object.h (Section_id, Const_section_id, Section_id_hash,
329 Const_section_id_hash): New type definitions.
330 * output.cc (Output_section::add_relaxed_input_section): Change to
331 use Const_section_id instead of Input_section_specifier as key type.
332 (Output_section::add_merge_input_section): Ditto.
333 (Output_section::build_relaxation_map): Change to use Section_id
334 instead of Input_section_specifier as key type.
335 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
337 (Output_section::convert_input_sections_to_relaxed_sections): Change
338 to use Const_section_id instead of Input_section_specifier as key type.
339 (Output_section::find_merge_section): Ditto.
340 (Output_section::find_relaxed_input_section): Ditto.
341 * output.h (Input_section_specifier): Remove class.
342 (Output_section::Output_section_data_by_input_section_map): Change
343 key type to Const_section_id.
344 (Output_section::Output_relaxed_input_section_by_input_section_map):
346 (Output_section::Relaxation_map): Change key type to Section_id.
348 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
350 * gold/arm.cc: Added support for R_ARM_V4BX relocation
351 (class Arm_v4bx_stub): New class.
352 (DEF_STUBS): Updated definition to support v4_veneer_bx.
353 (Stub_factory::make_arm_v4bx_stub): New method.
354 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
355 (Stub_table::empty): Handle v4bx stubs.
356 (Stub_table::add_arm_v4bx_stub): New method.
357 (Stub_table::find_arm_v4bx_stub): New method.
358 (Arm_relocate_functions::v4bx): New method.
359 (Target_arm::fix_v4bx): New method.
360 (Target_arm::Target_arm): Handle R_ARM_V4BX.
361 (Stub_table::relocate_stubs): Likewise.
362 (Stub_table::do_write): Likewise.
363 (Stub_table::update_data_size_and_addralign): Likewise.
364 (Stub_table::finalize_stubs): Likewise.
365 (Target_arm::Scan::local): Likewise.
366 (Target_arm::Scan::global): Likewise.
367 (Target_arm::do_finalize_sections): Likewise.
368 (Target_arm::Relocate::relocate): Likewise.
369 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
371 (Target_arm::scan_reloc_for_stub): Likewise.
372 (Target_arm::scan_reloc_section_for_stubs): Likewise.
374 2010-01-19 Ian Lance Taylor <iant@google.com>
376 * output.cc (Output_section_headers::do_sized_write): Write large
377 segment count to sh_info field.
378 (Output_file_header::do_sized_write): For large segment count,
379 write PN_XNUM to e_phnum field.
381 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
383 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
384 (Arm_relocate_functions::thm_jump8): New function.
385 (Arm_relocate_functions::thm_jump11): New function.
386 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
388 (Target_arm::Scan::global): Likewise.
389 (Target_arm::Relocate::relocate): Likewise.
390 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
393 2010-01-14 Doug Kwan <dougkwan@google.com>
395 * arm.cc (map, utility): Include headers.
396 (Target_arm::apply_cortex_a8_workaround): New method.
397 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
398 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
399 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
400 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
401 the --[no-]fix-cortex-a8 command line options.
402 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
403 (Target_arm::relocate_stub): Use addend in instruction template.
404 * options.h (DEFINE_bool): Set the user-set flag.
405 (General_options): Add --[no-]-fix-cortex options.
406 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
407 : Update fast look-up map after conversion.
409 2010-01-14 Sriraman Tallam <tmsriram@google.com>
411 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
412 in the first pass of do_layout.
414 2010-01-13 Doug Kwan <dougkwan@google.com>
416 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
417 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
418 apparent compiler problem of not folding static constant integral
419 data members of elfcpp::Elf_sizes<32>.
421 2010-01-13 Doug Kwan <dougkwan@google.com>
423 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
424 Arm_relobj::section_needs_cortex_a8_stub_scanning,
425 Arm_relobj::scan_section_for_cortex_a8_erratum,
426 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
427 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
428 sections to scan for relocation stubs into a new method
429 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
430 relocation and Cortex-A8 stub scanning.
431 (Target_arm::do_relax): Force stubs to be after stubbed sections
432 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
433 the beginning of a new relaxation pass. Update a comment.
434 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
436 2010-01-12 Ian Lance Taylor <iant@google.com>
438 * target-reloc.h (visibility_error): New inline function.
439 (relocate_section): Call visibility_error.
440 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
441 (MOSTLYCLEANFILES): Likewise.
442 (protected_4_pic.o, protected_3.err): New targets.
443 * testsuite/protected_4.cc: New file.
445 2010-01-12 Doug Kwan <dougkwan@google.com>
447 * arm.cc (Cortex_a8_reloc): New class.
448 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
449 and cortex_a8_relocs_info_.
450 (Target_arm::fix_cortex_a8): New method definition.
451 (Target_arm::Cortex_a8_relocs_info): New type.
452 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
453 New data member declarations.
454 (Target_arm::scan_reloc_for_stub): Record information about
455 relocations for THUMB branches that might be exempted from the
456 Cortex-A8 workaround.
457 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
458 at the beginning of a relaxation pass.
460 2010-01-12 Doug Kwan <dougkwan@google.com>
462 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
463 (Arm_relobj::Mapping_symbol_position,
464 Arm_reloj::Mapping_symbol_position_less,
465 Arm_relobj::Mapping_symbols_info): New types.
466 (Target_arm::is_mapping_symbol_name): New method definition.
467 (Arm_relobj::do_count_local_symbols): Save information about mapping
470 2010-01-11 Doug Kwan <dougkwan@google.com>
472 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
473 Arm_relocate_functions::thumb32_branch_upper,
474 Arm_relocate_functions::thumb32_branch_lower,
475 Arm_relocate_functions::thumb32_cond_branch_offset,
476 Arm_relocate_functions::thumb32_cond_branch_upper,
477 Arm_relocate_functions::thumb32_cond_branch_lower,
478 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
479 branch offset encoding.
480 (Arm_relocate_functions::thumb_branch_common): Use new branch
481 offset encoding methods to avoid code duplication.
482 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
483 (Stub_addend_reader::operator()): Use new branch encoding method
484 to avoid code duplication.
486 2010-01-11 Doug Kwan <dougkwan@google.com>
488 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
489 (Target_arm::do_finalize_sections): Define special EXIDX section
490 symbols only if referenced.
491 * gc.h (Garbage_collection::add_reference): New method.
492 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
495 2010-01-11 Ian Lance Taylor <iant@google.com>
497 * script.cc (Version_script_info::build_expression_list_lookup):
498 Change complaing about duplicate wildcard match from error to
501 * script.cc (class Lazy_demangler): Recreate--revert part of patch
503 (Version_script_info::Version_script_info): Initialize globs_,
504 default_version_, default_is_global_, and exact_. Don't
505 initialize globals_ or locals_.
506 (Version_script_info::build_lookup_tables): Build local symbols
508 (Version_script_info::unquote): New function.
509 (Version_script_info::add_exact_match): New function.
510 (Version_script_info::build_expression_list_lookup): Remove lookup
511 parameter. Add is_global parameter. Change all callers. Handle
512 wildcard pattern specially. Unquote pattern. Call
514 (Version_script_info::get_name_to_match): New function.
515 (Version_script_info::get_symbol_version): New function.
516 (Version_script_info::get_symbol_version_helper): Remove.
517 (Version_script_info::check_unmatched_names): Call unquote.
518 * script.h (class Version_script_info): Change get_symbol_version
519 to be non-inline and add is_global parameter; change all callers.
520 Rewrite symbol_is_local. Update declarations. Define struct
521 Version_tree_match, Exact, Globs. Don't define struct Lookup.
522 Remove globals_ and locals_ members. Add exact_, globs_,
523 default_version_, is_global_.
524 (Version_script_info::Glob): Remove pattern, add expression and
525 is_global. Update constructor. Change all callers.
526 * dynobj.cc (Versions::finalize): Mark the version symbol as the
528 (Versions::symbol_section_contents): If a symbol is undefined, or
529 defined in a dynamic object, set the version index to
531 * symtab.cc (Symbol_table::add_from_relobj): Don't call
533 (Symbol_table::add_from_pluginobj): Likewise.
534 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
536 2010-01-11 Doug Kwan <dougkwan@google.com>
538 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
539 (incremental_dump_LDADD): Add linking option for libintl.
540 * Makefile.in: Regenerate.
542 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
545 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
547 * testsuite/Makefile.in: Regenerated.
549 2010-01-10 Doug Kwan <dougkwan@google.com>
551 * options.h (DEFINE_var): Use parentheses around argument varname__
552 in macro body to avoid any unintended subsequent substitutions.
554 2010-01-10 Ian Lance Taylor <iant@google.com>
556 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
557 candidates before doing symbol resolution.
559 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
560 ODR candidates if only one is weak.
562 2010-01-08 Ian Lance Taylor <iant@google.com>
564 * script.cc (Version_script_info::build_expression_list_lookup):
565 Don't warn about ambiguous version, just record the ambiguity.
566 (Version_script_info::get_symbol_version_helper): Give error if
567 version is ambiguous.
569 2010-01-08 Doug Kwan <dougkwan@google.com>
571 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
572 prev_data_size_ and prev_addralign_. Remove initializer for
573 deleted data member has_been_changed_.
574 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
575 to determine if the table is empty.
576 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
578 (Stub_table::add_reloc_stub): Define method in class definition
579 instead of just declaring it there.
580 (Stub_table::add_cortex_a8_stub): New method definition.
581 (Stub_table::update_data_size_and_addralign): Ditto.
582 (Stub_table::finalize_stubs): Ditto.
583 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
584 (Stub_table::do_addralign_): Return address alignment in the
585 (Stub_table::do_reset_address_and_file_offset): Define method in
586 class definition instead of declaring it there. Set current data
587 size to be the data size of the previous pass.
588 (Stub_table::set_final_data_size): Use current data size as the
590 (Stub_table::relocate_stub): Change parameter type of stub from
591 Reloc_stub pointer to Stub pointer.
592 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
593 (Stub_table::Cortex_a8_stub_list): New typedef.
594 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
595 Stub_table::prev_addralign_): New data member.
596 (Arm_relobj::Arm_relobj): Initialize data member
597 section_has_cortex_a8_workaround_.
598 (Arm_relobj::section_has_cortex_a8_workaround,
599 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
601 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
603 (Target_arm::relocate_stub): Change parameter type of stub from
604 Reloc_stub pointer to Stub pointer.
605 (Insn_template::size, Insn_template::alignment): Handle
606 THUMB16_SPECIAL_TYPE.
607 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
608 Stub_table::update_data_size_and_addralign,
609 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
611 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
612 (Stub_table::do_write): Ditto.
613 (Target_arm::do_relax): Adjust code for changes in Stub_table.
615 2010-01-08 Ian Lance Taylor <iant@google.com>
618 * symtab.h (class Symbol): Remove fields is_target_special_ and
619 has_plt_offset_. Add field is_defined_in_discarded_section_.
620 (Symbol::is_defined_in_discarded_section): New function.
621 (Symbol::set_is_defined_in_discarded_section): New function.
622 (Symbol::has_plt_offset): Rewrite.
623 (Symbol::set_plt_offset): Verify that new offset is not -1U.
624 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
625 Don't initialize is_target_special_ or has_plt_offset_.
626 Initialize is_defined_in_discarded_section_.
627 (Symbol_table::add_from_relobj): If appropriate, set
628 is_defined_in_discarded_section.
629 * resolve.cc (Symbol::override_base_with_special): Don't test
630 is_target_special_. Change has_plt_offset_ to has_plt_offset().
631 * target-reloc.h (relocate_section): Do special handling for
632 symbols defined in discarded sections for global symbols as well
635 2010-01-08 Ian Lance Taylor <iant@google.com>
637 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
640 2010-01-08 Ian Lance Taylor <iant@google.com>
642 * object.cc (Sized_relobj::do_layout): Don't get confused if
643 layout_eh_frame returns NULL.
645 2010-01-08 Ian Lance Taylor <iant@google.com>
648 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
649 dynamic symbol table, use the normal symbol table.
650 (Sized_dynobj::do_read_symbols): Remove assertion about type of
653 2010-01-08 Ian Lance Taylor <iant@google.com>
656 * layout.cc (Layout::include_section): Remove .gnu_debuglink
659 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
661 * version.cc (print_version): Change to "Copyright 2010".
663 2010-01-08 Ian Lance Taylor <iant@google.com>
667 * i386.cc (class Target_i386): Change return type of plt_section
669 (class Output_data_plt_i386): Add tls_desc_rel_ field.
670 (Output_data_plt_i386::Output_data_plt_i386): Initialize
672 (Output_data_plt_i386::rel_tls_desc): New function.
673 (Target_i386::rel_tls_desc_section): New function.
674 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
675 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
676 R_386_TLS_DESC reloc in rel_tls_desc_section.
677 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
678 Define struct Tlsdesc_info.
679 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
680 (Target_x86_64::do_reloc_symbol_index): New function.
681 (Target_x86_64::add_tlsdesc_info): New function.
682 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
683 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
685 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
687 (Output_data_plt_x86_64::rela_tlsdesc): New function.
688 (Target_x86_64::rela_tlsdesc_section): New function.
689 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
691 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
692 (Target_x86_64::do_reloc_addend): New function.
693 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
694 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
695 declarations. Define TARGET_CODE. Add arg field to u1_ union.
696 (Output_reloc::type): New function.
697 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
698 (Output_reloc::is_target_specific): New function.
699 (Output_reloc::target_arg): New function.
700 (class Output_reloc) [SHT_RELA]: Add four new constructors for
701 absolute relocs and target specific relocs.
702 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
704 (class Output_data_reloc) [SHT_RELA]: Likewise.
705 * output.cc (Output_reloc::Output_reloc): Add four new versions
706 for absolute relocs and target specific relocs.
707 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
708 (Output_reloc::get_symbol_index): Likewise.
709 (Output_reloc::local_section_offset): Check that local_sym_index_
710 is not TARGET_CODE or 0.
711 (Output_reloc::symbol_value): Likewise.
712 (Output_reloc::write) [SHT_RELA]: Call target for target specific
714 * target.h (class Target): Add reloc_symbol_index and reloc_addend
715 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
717 * layout.cc (add_target_dynamic_tags): Use output section for
718 DT_PLTRELSZ and DT_JMPREL.
720 2010-01-07 Ian Lance Taylor <iant@google.com>
723 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
725 (class Output_data_reloc_generic): Define.
726 (class Output_data_reloc_base): Change base class to
727 Output_data_reloc_generic. Change add() method to call
728 bump_relative_reloc_count for a relative reloc. Remove
730 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
732 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
733 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
735 * layout.h (class Layout): Update declaration.
737 2010-01-07 Ian Lance Taylor <iant@google.com>
739 * output.h (class Output_data): Add const version of
740 output_section and do_output_section.
741 (class Output_section_data): Add const version of
743 (class Output_section): Likewise.
744 * layout.cc (Layout::add_target_dynamic_tags): New function.
745 * layout.h (class Layout): Update declarations.
746 * arm.cc (Target_arm::do_finalize_sections): Use
747 add_target_dynamic_tags.
748 * i386.cc (Target_i386::do_finalize_sections): Likewise.
749 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
750 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
751 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
753 2010-01-07 Ian Lance Taylor <iant@google.com>
756 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
759 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
760 Ian Lance Taylor <iant@google.com>
763 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
764 Xindex::read_symtab_xindex.
766 2010-01-07 Doug Kwan <dougkwan@google.com>
768 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
769 (Insn_template::thumb16_bcond_insn): New method declaration.
770 (Insn_template): Fix spelling.
771 (Stub::thumb16_special): New method declaration.
772 (Stub::do_write): Define virtual method which was previously pure
774 (Stub::do_thumb16_special): New method declaration.
775 (Stub::do_fixed_endian_write): New template member.
776 (Reloc_stub::do_write): Remove.
777 (Reloc_stub::do_fixed_endian_write): Remove.
778 (Cortex_a8_stub): New class definition.
779 (Stub_factory::make_cortex_a8_stub): New method definition.
780 (Stub_factory::Stub_factory): Add missing static storage class
781 qualifier for elf32_arm_stub_a8_veneer_blx.
783 2010-01-07 Ian Lance Taylor <iant@google.com>
786 * options.h (class General_options): Add --warn-unresolved-symbols
787 and --error-unresolved-symbols.
788 * errors.cc (Errors::undefined_symbol): Implement
789 --warn-unresolved-symbols.
791 * options.h (class General_options): Add -z text and -z textoff.
792 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
794 2010-01-06 Sriraman Tallam <tmsriram@google.com>
796 * gc.h (Garbage_collection::Cident_section_map): New typedef.
797 (Garbage_collection::cident_sections): New function.
798 (Garbage_collection::add_cident_section): New function.
799 (Garbage_collection::cident_sections_): New member.
800 (gc_process_relocs): Add references to sections whose names are C
802 * gold.h (cident_section_start_prefix): New constant.
803 (cident_section_stop_prefix): New constant.
804 (is_cident): New function.
805 * layout.cc (Layout::define_section_symbols): Replace string constants
806 with the newly defined constants.
807 * object.cc (Sized_relobj::do_layout): Track sections whose names are
809 * testsuite/Makefile.am: Add gc_orphan_section_test.
810 * testsuite/Makefile.in: Regenerate.
811 * testsuite/gc_orphan_section_test.cc: New file.
812 * testsuite/gc_orphan_section_test.sh: New file.
814 2010-01-06 Ian Lance Taylor <iant@google.com>
817 * options.h (class General_options): Add --warn-shared-textrel.
818 * layout.cc (Layout::finish_dynamic_section): Implement
819 --warn-shared-textrel.
822 * options.h (class General_options): Add --warn-multiple-gp.
824 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
826 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
827 $(THREADSLIB) and $(LIBDL).
828 * Makefile.in: Rebuild.
830 2010-01-06 Ian Lance Taylor <iant@google.com>
833 * options.cc (General_options::parse_section_start): New function.
834 (General_options::section_start): New function.
835 (General_options::General_options): Initialize all members.
836 * options.h: Include <map>
837 (class General_options): Add --section-start. Add section_starts_
839 * layout.cc (Layout::attach_allocated_section_to_segment): If
840 --section-start was used, set the address of the segment. Remove
842 (Layout::relaxation_loop_body): If the address of the load segment
843 has been set by --section-start, don't use it.
844 * output.h (Output_segment::update_flags_for_output_section): New
846 * output.cc (Output_segment::add_output_section): Call
847 update_flags_for_output_section.
849 2010-01-05 Ian Lance Taylor <iant@google.com>
852 * options.h (class General_options): Add --undefined-version.
853 * script.cc (struct Version_expression): Add was_matched_by_symbol
855 (Version_script_info::matched_symbol): New function.
856 (Version_script_info::get_symbol_version_helper): Call
858 (Version_script_info::check_unmatched_names): New function.
859 * script.h (class Version_script_info): Update declarations.
860 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
862 * options.h (class General_options): Use DEFINE_bool_alias for
863 allow_multiple_definition.
864 * resolve.cc (Symbol_table::should_override): Don't test
865 allow_multiple_definition.
868 * options.h (class General_options): Add --cref.
869 * main.cc (main): Print cref table if --cref. Don't close mapfile
870 until after printing cref table.
871 * cref.cc: Include "symtab.h".
872 (class Cref_inputs): Define Cref_table_compare and Cref_table.
873 (Cref_table_compare::operator()): New function.
874 (Cref_inputs::gather_cref): New function.
875 (filecol): New static const.
876 (Cref_inputs::print_cref): New function.
877 (Cref::print_cref): New function.
878 * cref.h: Include <cstdio>.
879 (class Cref): Update declarations.
880 * mapfile.h (Mapfile::file): New function.
881 * object.h (class Object): Define Symbols. Declare virtual
882 do_get_global_symbols.
883 (Object::get_global_symbols): New function.
884 * object.cc (Input_objects::add_object): Pass object to cref_ if
886 (Input_objects::archive_start): Likewise.
887 (Input_objects::archive_stop): Likewise.
888 (Input_objects::print_cref): New function.
889 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
890 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
892 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
894 * plugin.h (class Sized_pluginobj): Update declarations.
896 2010-01-05 Ian Lance Taylor <iant@google.com>
898 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
899 to is_default_version. Rename insdef to insdefault.
900 (Symbol_table::add_from_relobj): Rename def to is_default_version
901 and local to is_forced_local.
902 (Symbol_table::add_from_pluginobj): Likewise.
903 (Symbol_table::add_from_dynobj): Likewise.
904 (Symbol_table::define_special_symbol): Rename insdef to
907 2010-01-04 Ian Lance Taylor <iant@google.com>
910 * options.h (class General_options): Add
911 --allow-multiple-definition and -z muldefs.
912 * resolve.cc (Symbol_table::should_override): Don't warn about a
913 multiple symbol definition if --allow-multiple-definition or -z
917 * options.h (class General_options): Add --add-needed and
918 --copy-dt-needed-entries. Tweak --as-needed help entry.
919 * object.cc (Input_objects::check_dynamic_dependencies): Give an
920 error if --copy-dt-needed-entries aka --add-needed is used and
921 would cause a change in behaviour.
924 * options.h (class General_options): Add -G as a short version of
925 --shared. Add no-op options -assert, -g, and -i.
927 2010-01-04 Sriraman Tallam <tmsriram@google.com>
929 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
930 check for .text or .gnu.linkonce.t sections.
931 * icf.cc (Icf::find_identical_sections): Ditto.
932 Change the detection for mangled function name within the section
934 * icf.h (is_section_foldable_candidate): New function.
936 2009-12-30 Ian Lance Taylor <iant@google.com>
939 * options.h (class General_options): Permit two dashes with
940 --retain-symbols-file.
942 2009-12-30 Ian Lance Taylor <iant@google.com>
945 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
946 don't put the file header and segment headers in the text
950 * common.cc (Sort_commons::operator()): Stabilize sort when both
952 (Symbol_table::do_allocate_commons_list): When allocating common
953 symbols, skip a symbol which is no longer common.
954 * symtab.h (Symbol::is_common): Test whether the symbol comes from
955 an object before checking its type.
956 * testsuite/common_test_2.c: New file.
957 * testsuite/common_test_3.c: New file.
958 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
959 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
960 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
961 (common_test_2_pic.o, common_test_2.so): New targets.
962 (common_test_3_pic.o, common_test_3.so): New targets.
963 * testsuite/Makefile.in: Rebuild.
966 * script.cc (read_input_script): If we see a new SECTIONS clause,
967 and we have added an input section, give an error.
968 * layout.h (class Layout): Add have_added_input_section function.
969 Add have_added_input_section_ field.
970 * layout.cc (Layout::Layout): Initialize
971 have_added_input_section_.
972 (Layout::layout): Set have_added_input_section_.
973 (Layout::layout_eh_frame): Likewise.
975 2009-12-30 Ian Lance Taylor <iant@google.com>
978 * options.h (class General_options): Add --sort-common option.
979 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
980 * common.cc (Sort_common): Add sort_order parameter to
981 constructor. Add sort_order_ field.
982 (Sort_commons::operator): Check sort_order_.
983 (Symbol_table::allocate_commons): Determine the sort order.
984 (Symbol_table::do_allocate_commons): Add sort_order parameter.
986 (Symbol_table::do_allocate_commons_list): Likewise.
988 2009-12-30 Ian Lance Taylor <iant@google.com>
991 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
992 symbols from this object, don't change the visibility of an
994 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
996 2009-12-30 Ian Lance Taylor <iant@google.com>
999 * script.h (class Version_script_info): Define Language enum.
1000 Update declarations. Define Glob, Exact, and Lookup types. Add
1001 new fields globals_, locals_, and is_finalized_.
1002 * script.cc: Various formatting fixes.
1003 (class Parser_closure): Change language_stack_ from a vector of
1004 std::string to one of Version_script_info::Language. Adjust all
1006 (class Lazy_demangler): Remove.
1007 (struct Version_expression): Change language from std::string to
1008 Version_script_info::Language.
1009 (Version_script_info::Version_script_info): New function.
1010 (Version_script_info::~Version_script_info): Don't call clear.
1011 (Version_script_info::finalize): New function.
1012 (Version_script_info::build_lookup_tables): New function.
1013 (Version_script_info::build_expression_list_lookup): New
1015 (Version_script_info::get_symbol_version_helper): Rewrite to use
1017 (Version_script_info::print_expression_list): Adjust to use
1018 Version_script_info::Language.
1019 (script_push_lex_into_version_mode): Check that the version script
1020 has not been finalized.
1021 (version_script_push_lang): Change language string to
1022 Version_script_info::Language.
1023 * options.cc (Command_line::version_script): New function.
1024 * options.h (class General_options): Add finalize_dynamic_list
1025 function. Change version_script from declaration to definition.
1026 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
1027 * testsuite/version_script.map: Remove duplicate def of foo.
1028 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
1030 * testsuite/Makefile.in: Rebuild.
1032 2009-12-30 Ian Lance Taylor <iant@google.com>
1035 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
1036 if the input symbol index is 0, make the output symbol index 0.
1038 2009-12-30 Ian Lance Taylor <iant@google.com>
1041 * options.h (class General_options): Add -x/--discard-all.
1042 * object.cc (Sized_relobj::do_count_local_symbols): Handle
1043 --discard-all. If the local symbol needs a dynamic entry, check
1044 that before handling --discard-locals.
1046 2009-12-30 Ian Lance Taylor <iant@google.com>
1049 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
1051 (Output_segment::add_output_section): Don't change the flags if
1055 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
1056 GNU hash table if they need a dynamic value. Otherwise, don't add
1057 them if they are defined in a dynamic object or are forced local.
1059 2009-12-29 Ian Lance Taylor <iant@google.com>
1062 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
1063 .gnu.hash table for a 32-bit target.
1066 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
1067 regular and a dynamic object only needs a dynamic symbol table
1068 entry if it is externally visible.
1071 * i386.cc (class Target_i386): Initialize global_offset_table_ in
1072 constructor. Add global_offset_table_ field.
1073 (Target_i386::got_section): Set global_offset_table_.
1074 (Target_i386::do_finalize_sections): Set global_offset_table_
1076 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
1077 in constructor. Add global_offset_table_ field.
1078 (Target_x86_64::got_section): Set global_offset_table_.
1079 (Target_x86_64::do_finalize_sections): Set global_offset_table_
1082 * layout.cc (Layout::Layout): Initialize increase_relro_.
1083 (Layout::get_output_section): Add is_relro, is_last_relro, and
1084 is_first_non_relro parameters. Change all callers.
1085 (Layout::choose_output_section): Likewise.
1086 (Layout::add_output_section_data): Likewise.
1087 (Layout::make_output_section): Likewise.
1088 (Layout::set_segment_offsets): Clear increase_relro when using a
1090 * layout.h (class Layout): Add increase_relro method. Add
1091 increase_relro_ field. Update declarations.
1092 * output.cc (Output_section::Output_section): Initialize
1093 is_last_relro_ and is_first_non_relro_.
1094 (Output_segment::add_output_section): Group relro sections is
1095 do_sort is true. Handle is_last_relro and is_first_non_relro.
1096 (Output_segment::maximum_alignment): Remove relro handling.
1097 (Output_segment::set_section_addresses): Add increase_relro
1098 parameter. Change all callers. Add initial alignment to align
1099 relro sections on separate page. Remove old relro handling.
1100 (Output_segment::set_section_list_addresses): Remove in_relro
1101 parameter. Change all callers.
1102 (Output_segment::set_offset): Add increase parameter. Change all
1103 callers. Remove old relro handling.
1104 * output.h (class Output_section): Add new methods: is_last_relro,
1105 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
1106 Add is_last_relro_ and is_first_non_relro_ fields.
1107 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
1108 Create separate .got.plt section. Call increase_relro.
1109 * x86_64.cc (Target_x86_64::got_section): Likewise.
1110 * testsuite/relro_script_test.t: Add .got.plt.
1113 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
1114 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
1115 (Layout::finalize): Call set_dynamic_symbol_size.
1116 (Layout::set_dynamic_symbol_size): New function.
1117 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
1118 set_dynamic_symbol_size.
1121 * output.h (class Output_section): Add is_entsize_zero_ field.
1122 * output.cc (Output_section::Output_section): Initialize
1124 (Output_section::set_entsize): If two different entsizes are
1125 requested, force it to zero.
1126 (Output_section::add_input_section): Set flags for .debug_str
1127 before updating section flags. Set entsize.
1128 (Output_section::update_flags_for_input_section): Set SHF_MERGE
1129 and SHF_STRING if all input sections have those flags.
1131 2009-12-29 Rafael Espindola <espindola@google.com>
1133 * main.cc (main): Fix the sys time reporting.
1134 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
1137 2009-12-29 Sriraman Tallam <tmsriram@google.com>
1139 * options.cc (General_options::parse_version): Allow -v to exit
1140 without an error if there is nothing to link.
1142 2009-12-29 Ian Lance Taylor <iant@google.com>
1144 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
1145 using a version of gcc before 4.1.
1146 * configure: Rebuild.
1148 2009-12-28 Chris Demetriou <cgd@google.com>
1150 * attributes.cc (Output_attributes_section_data::do_write): Use
1151 std::vector::front rather than std::vector::data.
1153 2009-12-28 Ian Lance Taylor <iant@google.com>
1155 * symtab.h (class Symbol_table): Add enum Defined.
1156 * resolve.cc (Symbol_table::should_override): Add defined
1157 parameter. Change all callers. Test whether object is NULL
1158 before calling a method on it.
1159 (Symbol_table::report_resolve_problem): Add defined parameter.
1161 (Symbol_table::should_override_with_special): Likewise.
1162 * symtab.cc (Symbol_table::define_in_output_data): Add defined
1163 parameter. Change all callers.
1164 (Symbol_table::do_define_in_output_data): Likewise.
1165 (Symbol_table::define_in_output_segment): Likewise.
1166 (Symbol_table::do_define_in_output_segment): Likewise.
1167 (Symbol_table::define_as_constant): Likewise.
1168 (Symbol_table::do_define_as_constant): Likewise.
1169 * script.h (class Symbol_assignment): Add is_defsym parameter to
1170 constructor; change all callers.
1171 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
1172 parameter. Change all callers. Add is_defsym_ field.
1173 (class Parser_closure): Add parsing_defsym parameter to
1174 constructor; change all callers. Add parsing_defsym accessor
1175 function. Add parsing_defsym_ field.
1177 2009-12-28 Ian Lance Taylor <iant@google.com>
1179 * gold.cc (queue_middle_tasks): Fix formatting.
1180 * object.cc (Relobj::is_section_name_included): Likewise.
1182 2009-12-23 Ian Lance Taylor <iant@google.com>
1184 * i386.cc (Target_i386::do_calls_non_split): Recognize
1185 -fsplit-stack prologue for a function with a static chain.
1186 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
1187 -fsplit-stack prologue when using %r11.
1189 2009-12-21 Sriraman Tallam <tmsriram@google.com>
1191 * options.cc (General_options::parse_version): Make -v continue and do
1192 the link like GNU ld does.
1194 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
1196 * Makefile.am (CCFILES): Add timer.cc.
1197 (HFILES): Add timer.h.
1198 * configure.ac: Check for sysconf and times.
1199 * main.cc: include timer.h.
1200 (main): Use Timer instead of get_run_time.
1203 * workqueue.cc: include timer.h.
1204 (Workqueue::find_and_run_task):
1205 Report user, sys and wall time.
1206 * Makefile.in: Regenerate.
1207 * config.in: Regenerate.
1208 * configure: Regenerate.
1210 2009-12-16 Doug Kwan <dougkwan@google.com>
1212 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
1214 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
1215 relaxed input sections.
1216 * output.cc (Output_section::find_relaxed_input_section): Change
1217 return type to Output_relaxed_input_section pointer. Adjust code
1218 for new type of relaxed_input_section_map_.
1219 * output.h (Output_section::find_relaxed_input_section): Change
1220 return type to Output_relaxed_input_section pointer.
1221 (Output_section::Output_relaxed_input_section_by_input_section_map):
1223 (Output_section::relaxed_input_section_map_): Change type to
1224 Output_section::Output_relaxed_input_section_by_input_section_map.
1225 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
1228 2009-12-15 Ian Lance Taylor <iant@google.com>
1230 * layout.cc (Layout::create_shstrtab): Only write out after input
1231 sections if we are compressing debug sections.
1233 2009-12-15 Ian Lance Taylor <iant@google.com>
1235 * archive.cc (Archive::add_symbols): Only look up a symbol without
1236 a version if there is, in fact, a version.
1238 2009-12-14 Ian Lance Taylor <iant@google.com>
1240 Revert -Wshadow changes, all changes from:
1241 2009-12-11 Doug Kwan <dougkwan@google.com>
1242 2009-12-11 Nick Clifton <nickc@redhat.com>
1243 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
1245 2009-12-11 Doug Kwan <dougkwan@google.com>
1247 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
1249 * attributes.cc (Object_attribute::size): Ditto.
1250 (Attributes_section_data::size): Ditto.
1251 (Attributes_section_data::Attributes_section_data): Ditto.
1252 (Output_attributes_section_data::do_write): Ditto.
1253 * attributes.h (Object_attribute::set_type): Ditto.
1254 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
1256 2009-12-11 Nick Clifton <nickc@redhat.com>
1258 * archive.cc: Fix shadowed variable warnings.
1260 * compressed_output.cc: Likewise.
1261 * compressed_output.h: Likewise.
1262 * configure: Likewise.
1263 * dwarf_reader.cc: Likewise.
1264 * dynobj.cc: Likewise.
1265 * dynobj.h: Likewise.
1266 * ehframe.cc: Likewise.
1267 * ehframe.h: Likewise.
1268 * errors.cc: Likewise.
1269 * expression.cc: Likewise.
1270 * fileread.cc: Likewise.
1271 * fileread.h: Likewise.
1272 * freebsd.h: Likewise.
1273 * i386.cc: Likewise.
1275 * incremental.h: Likewise.
1276 * layout.cc: Likewise.
1277 * layout.h: Likewise.
1278 * mapfile.cc: Likewise.
1279 * merge.cc: Likewise.
1280 * merge.h: Likewise.
1281 * object.cc: Likewise.
1282 * object.h: Likewise.
1283 * options.h: Likewise.
1284 * output.cc: Likewise.
1285 * output.h: Likewise.
1286 * parameters.cc: Likewise.
1287 * plugin.cc: Likewise.
1288 * powerpc.cc: Likewise.
1289 * reduced_debug_output.cc: Likewise.
1290 * reduced_debug_output.h: Likewise.
1291 * reloc.cc: Likewise.
1292 * reloc.h: Likewise.
1293 * resolve.cc: Likewise.
1294 * script-sections.cc: Likewise.
1295 * script.cc: Likewise.
1296 * script.h: Likewise.
1297 * sparc.cc: Likewise.
1298 * symtab.cc: Likewise.
1299 * symtab.h: Likewise.
1300 * target-select.cc: Likewise.
1301 * target-select.h: Likewise.
1302 * token.h: Likewise.
1303 * workqueue.cc: Likewise.
1304 * workqueue.h: Likewise.
1305 * x86_64.cc: Likewise.
1307 2009-12-10 Doug Kwan <dougkwan@google.com>
1309 * arm.cc (attributes.h): New include.
1310 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
1311 (Arm_relobj::~Arm_relobj): Delete object pointed by
1312 attributes_section_data_.
1313 (Arm_relobj::attributes_section_data): New method definition.
1314 (Arm_relobj::attributes_section_data_): New data member declaration.
1315 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
1316 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
1317 attributes_section_data_.
1318 (Arm_dynobj::attributes_section_data): New method definition.
1319 (Arm_dynobj::attributes_section_data_): New data member declaration.
1320 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
1321 initialization value of may_use_blx_ to false.
1322 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
1323 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
1324 object attributes to compute results instead of hard-coding.
1325 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
1326 Target_arm::get_secondary_compatible_arch,
1327 Target_arm::set_secondary_compatible_arch
1328 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
1329 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
1330 New method declarations.
1331 (Target_arm::get_aeabi_object_attribute): New method definition.
1332 (Target_arm::attributes_section_data_): New data member declaration.
1333 (read_arm_attributes_section): New template definition.
1334 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
1335 (Arm_dynobj::do_read_symbols): Ditto.
1336 (Target_arm::do_finalize_sections): Merge attributes sections from
1337 input. Check for BLX use after attributes section merging.
1338 Fix __exidx_start and __exidx_end visibility. Create an
1339 .ARM.attributes section if necessary.
1340 (Target_arm::get_secondary_compatible_arch,
1341 Target_arm::set_secondary_compatible_arch,
1342 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
1343 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
1344 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
1345 New method definitions.
1347 2009-12-09 Ian Lance Taylor <iant@google.com>
1349 * plugin.cc (Plugin::load): Don't cast from void* to a function
1352 2009-12-09 Ian Lance Taylor <iant@google.com>
1354 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
1357 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
1359 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
1360 Replace two_file_shared_1.so with two_file_shared_2.so.
1361 * testsuite/Makefile.in: Regenerated.
1363 2009-12-08 Doug Kwan <dougkwan@google.com>
1365 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
1366 (HFILES): Add attributes.h and int_encoding.h.
1367 * Makefile.in: Regenerate.
1368 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
1369 function definitions to int_encoding.cc
1370 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
1371 prototypes to int_encoding.h
1372 * reduced_debug_output.cc (int_encoding.h): New include.
1373 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
1374 function definitions to int_encoding.cc
1375 (insert_into_vector, read_from_pointer): Move template definitions to
1377 * attributes.cc: New file.
1378 * attributes.h: New file.
1379 * int_encoding.cc: New file.
1380 * int_encoding.h: New file.
1382 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
1385 * incremental-dump.cc (dump_incremental_inputs): New.
1386 (main): Use dump_incremental_inputs.
1388 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
1391 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
1392 checking elfcpp::STT_FUNC.
1393 (Target_i386::Relocate::relocate): Likewise.
1394 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1396 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
1397 symbols from shared libraries into normal FUNC symbols.
1399 * symtab.h (Symbol): Add is_func and use it.
1401 2009-12-05 Doug Kwan <dougkwan@google.com>
1403 * arm.cc (Target_arm::arm_info): Initialize new fields
1404 attributes_section and attributes_vendor.
1405 * i386.cc (Target_i386::i386_info): Same.
1406 * object.cc (Sized_relobj::do_layout): Skip attribute section.
1407 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
1408 fields attributes_section and attributes_vendor.
1409 * sparc.cc (Target_sparc::sparc_info): Same.
1410 * target.h (Target::attributes_section, Target::attributes_vendor,
1411 Target::is_attributes_section, Target::attribute_arg_type,
1412 Target::attributes_order): New method definitions.
1413 (Target::Target_info::attributes_section,
1414 Target::Target_info::attributes_vendor): New fields.
1415 (Target::do_attribute_arg_type, Target::do_attributes_order): New
1416 virtual method definitions.
1417 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
1418 attributes_section and attributes_vendor.
1419 * testsuite/testfile.cc (Target_test::test_target_info): Same.
1421 2009-12-05 Doug Kwan <dougkwan@google.com>
1423 * arm.cc: Update comments about interworking and stub generation.
1424 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
1425 considered as non-PIC.
1426 (Arm_relocate_functions::base_abs): Fix formatting.
1427 (Arm_relocate_functions::got_prel): Fix comment. Change interface
1428 of function to use GOT entry address instead of offset.
1429 (Target_arm::Scan::global): Issue an error if a symbol would need a
1430 PLT does not get one because it is untyped. Remove code to create
1431 dynamic symbols for relative branches.
1432 (Target_arm::Relocate::relocate: Use 0 instead of false since function
1433 takes unsigned integer instead of boolean.
1435 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
1437 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
1438 (two_file_test_LDADD): Likewise.
1439 (common_test_1_LDADD): Likewise.
1440 (exception_test_LDADD) Likewise.
1441 (weak_test_LDADD): Likewise.
1442 (many_sections_test_LDADD): Likewise.
1443 (initpri1_LDADD): Likewise.
1444 (script_test_1_LDADD): Likewise.
1445 (script_test_2_LDADD): Likewise.
1446 (justsyms_LDADD): Likewise.
1447 (binary_test_LDADD): Likewise.
1448 (large_LDADD): Likewise.
1449 * testsuite/Makefile.in: Regenerated.
1451 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1453 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
1454 (Symbol_table::override_with_special): Likewise.
1455 (Symbol_table::add_from_object): Likewise.
1457 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
1459 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
1460 Don't set the data_offset twice.
1462 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
1464 * testsuite/Makefile.in: Regenerate.
1466 2009-12-03 Doug Kwan <dougkwan@google.com>
1468 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
1469 (Target_arm::do_finalize_sections): Add parameter for symbol table
1470 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
1471 * i386.cc (Target_i386::do_finalize_sections): Add an additional
1472 parameter for symbol table pointer.
1473 * layout.cc (Layout::finalize): Call Target::finalize_sections with
1474 an additional parameter for a pointer to symbol table.
1475 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
1476 parameter for a symbol table pointer.
1477 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
1478 * target.h (Target::finalize_sections, Target::do_finalize_sections):
1480 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
1481 parameter for a symbol table pointer.
1483 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
1485 * incremental.cc (Incremental_inputs_header)
1486 (Incremental_inputs_header_write, Incremental_inputs_entry)
1487 (Incremental_inputs_entry_write): Move ...
1488 * incremental.h (Incremental_inputs_header)
1489 (Incremental_inputs_header_write, Incremental_inputs_entry)
1490 (Incremental_inputs_entry_write): here.
1492 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
1494 * incremental.cc (make_sized_incremental_binary): Set the target.
1495 Error if it is incompatible.
1496 * output.h (Output_file): Add filename method.
1498 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
1500 * incremental.cc (Incremental_inputs_entry): Remove unused argument
1501 from the get_* methods.
1503 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
1505 * incremental-dump.cc (main): Check that the offeset of a script is 0.
1506 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
1507 Write 0 for the data_offset of scripts.
1509 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
1511 * testsuite/Makefile.am: Add the incremental_test.sh test.
1512 * testsuite/incremental_test.sh: New.
1513 * testsuite/incremental_test_1.c: New.
1514 * testsuite/incremental_test_2.c: New.
1516 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
1518 * incremental-dump.cc (main): Fix typos.
1520 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
1523 * incremental-dump.cc (main): Use llu to print 64 bit values.
1525 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
1526 H.J. Lu <hongjiu.lu@intel.com>
1528 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
1530 (incremental_dump_LDADD): Likewise.
1531 * Makefile.in: Regenerated.
1533 2009-11-25 Doug Kwan <dougkwan@google.com>
1537 2009-11-25 Doug Kwan <dougkwan@google.com>
1539 * arm.cc (Target_arm::Target_arm): Move method definition
1540 outside of class definition. Add code to handle
1541 --target1-rel, --target1-abs and --target2= options.
1542 (Target_arm::get_reloc_reloc_type): Change method to be
1543 non-static and const.
1544 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
1545 New data member declaration.
1546 (Target_arm::Scan::local, Target_arm::Scan::global,
1547 Target_arm::Relocate::relocate,
1548 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
1549 Adjust call to Target_arm::get_real_reloc_type.
1550 (Target_arm::get_real_reloc_type): Use command line options
1551 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
1552 * options.h (--target1-rel, --target1-abs, --target2): New
1555 2009-11-25 Doug Kwan <dougkwan@google.com>
1557 * arm.cc (Target_arm::Target_arm): Move method definition outside of
1558 class definition. Add code to handle --target1-rel, --target1-abs
1559 and --target2= options.
1560 (Target_arm::get_reloc_reloc_type): Change method to be non-static
1562 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
1564 (Target_arm::Scan::local, Target_arm::Scan::global,
1565 Target_arm::Relocate::relocate,
1566 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
1567 call to Target_arm::get_real_reloc_type.
1568 (Target_arm::get_real_reloc_type): Use command line options to
1569 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
1570 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
1573 2009-11-25 Doug Kwan <dougkwan@google.com>
1575 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
1576 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
1577 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
1579 (Arm_relocate_functions::thm_call): Replace body with a call to
1580 Arm_relocate_functions::thumb_branch_common.
1581 (Arm_relocate_functions::thm_jump24,
1582 Arm_relocate_functions::thm_xpc22): New method definitions.
1583 (Arm_relocate_functions::thumb_branch_common): New method definition.
1584 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
1586 (Target_arm::Relocate::relocate): Adjust call to thm_call.
1587 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
1589 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
1591 * Makefile.am: Build incremental-dump
1592 * Makefile.in: Regenerate.
1593 * incremental-dump.cc: New.
1594 * incremental.cc (Incremental_inputs_header_data,
1595 Incremental_inputs_entry_data): Move to incremental.h
1596 * incremental.h: (Incremental_inputs_header_data,
1597 Incremental_inputs_entry_data): Move from incremental.cc
1599 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
1601 * incremental.cc (Incremental_inputs_header,
1602 Incremental_inputs_header_write, Incremental_inputs_entry,
1603 Incremental_inputs_entry_write): Add a typedef with the data type.
1605 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
1607 * incremental.cc (Incremental_inputs_header,
1608 Incremental_inputs_header_write, Incremental_inputs_entry,
1609 Incremental_inputs_entry_write): Update comment about which
1610 type has the filed descriptions.
1612 2009-11-15 Doug Kwan <dougkwan@google.com>
1614 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
1615 (Arm_relocate_functions::arm_branch_common): Change method defintion
1616 in class definition to a method declaration and update list of formal
1618 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
1619 Arm_relocation_functions::jump24): Adjust call to
1620 Arm_relocate_functions::arm_branch_common. Update list of formal
1622 (Arm_relocate_functions::xpc25): New method definition.
1623 (Arm_relocate_functions::arm_branch_common): Move method defintion
1624 out from class definition. Use stubs for mode-switching and extending
1626 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
1627 specially. Change code to enable use of stubs in ARM branches.
1629 2009-11-10 Doug Kwan <dougkwan@google.com>
1631 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
1632 in method declaration.
1633 (Target_arm::relocate_stub): New method declaration.
1634 (Target_arm::default_target): Change to return a pointer instead of
1636 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
1637 Target_arm::default_target.
1638 (Arm_Relobj::do_relocate_sections): Remove options paramater in
1640 (Target_arm::relocate_section): Adjust view.
1641 (Target_arm::relocate_stub): New method definition.
1643 2009-11-10 Doug Kwan <dougkwan@google.com>
1645 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
1647 * incremental.cc (open_incremental_binary): Initialized local
1648 variables to avoid warnings.
1649 * object.cc (make_elf_object): Ditto.
1650 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
1653 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
1656 * testsuite/plugin_test.c: Include "config.h".
1658 2009-11-09 Doug Kwan <dougkwan@google.com>
1660 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
1661 (arm_symbol_value): Remove.
1662 (Arm_relocate_functions::arm_branch_common,
1663 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
1664 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
1665 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
1666 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
1667 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
1668 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
1669 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
1670 Arm_relocate_functions::thm_mobw_abs_nc,
1671 Arm_relocate_functions::thm_mov_abs,
1672 Arm_relocate_functions::movw_prel_nc,
1673 Arm_relocate_functions::thm_movt_abs,
1674 Arm_relocate_functions::movt_prel,
1675 Arm_relocate_functions::thm_movw_prel_nc,
1676 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
1677 (Target_arm::Relocate::relocate): Only decompose address into two
1678 parts if relocation type uses the thumb-bit and pass the actual
1679 bit instead of a flag indicating that the thumb-bit is used. Adjust
1680 calls to methods in Arm_relocate_functions for this change.
1682 2009-11-08 Ian Lance Taylor <iant@google.com>
1685 * reloc.cc: Instantiate
1686 Sized_relobj::initialize_input_to_output_maps and
1687 Sized_relobj:free_input_to_output_maps.
1689 2009-11-06 Ian Lance Taylor <iant@google.com>
1692 * defstd.cc (in_segment): Set only_if_ref true for "end".
1694 2009-11-06 Doug Kwan <dougkwan@google.com>
1696 * arm.cc (class Reloc_stub): Correct a comment.
1697 (Target_arm::Target_arm): Initialize arm_input_section_map_.
1698 (Target_arm::scan_section_for_stubs): New method declaration.
1699 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
1700 Change methods from private to protected.
1701 (Target_arm::do_may_relax): New method definition.
1702 (Target_arm::do_relax, Target_arm::group_sections,
1703 Target_arm::scan_reloc_for_stub,
1704 Target_arm::scan_reloc_section_for_stubs): New method declarations.
1705 (Target_arm::arm_input_section_map_): New data member declaration.
1706 (Target_arm::scan_reloc_for_stub,
1707 Target_arm::scan_reloc_section_for_stubs,
1708 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
1709 Target_arm::do_relax): New method definitions.
1711 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
1713 * configure.ac: Check for (struct stat)::st_mtim
1714 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
1715 * config.in: Regenerate.
1716 * configure: Regenerate.
1718 2009-11-05 Ian Lance Taylor <iant@google.com>
1721 * output.cc (Output_segment::add_output_section): Add missing
1724 2009-11-04 Ian Lance Taylor <iant@google.com>
1727 * object.h (class Object): Add is_needed and set_is_needed
1728 methods. Add is_needed_ field. Make bool fields into bitfields.
1729 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
1730 defined in a dynamic object and referenced by a regular object,
1731 set is_needed for the dynamic object.
1732 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
1733 if the file is marked with as_needed and it is not needed.
1735 2009-11-04 Ian Lance Taylor <iant@google.com>
1738 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
1739 tags if data is discarded by linker script.
1740 * i386.cc (Target_i386::do_finalize_sections): Likewise.
1741 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
1742 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
1743 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1745 2009-11-04 Ian Lance Taylor <iant@google.com>
1747 * layout.cc (Layout::get_output_section): Add is_interp and
1748 is_dynamic_linker_section parameters. Change all callers.
1749 (Layout::choose_output_section): Likewise.
1750 (Layout::make_output_section): Likewise.
1751 (Layout::add_output_section_data): Add is_dynamic_linker_section
1752 parameter. Change all callers.
1753 * layout.h (class Layout): Update declarations.
1754 * output.h (class Output_section): Add is_interp, set_is_interp,
1755 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
1756 Add is_interp_, is_dynamic_linker_section_ fields. Change
1757 generate_code_fills_at_write_ to a bitfield.
1758 * output.cc (Output_section::Output_sections): Initialize new
1760 (Output_segment::add_output_section): Add do_sort parameter.
1763 2009-11-03 Ian Lance Taylor <iant@google.com>
1766 * options.h (class General_options): Add --warn-common.
1767 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
1768 merging two common symbols.
1769 (Symbol_table::should_override): Handle --warn-common when merging
1770 a common symbol with a defined symbol. Use report_resolve_problem
1771 for multiple definitions.
1772 (Symbol_table::report_resolve_problem): New function.
1773 * symtab.h (class Symbol_table): Declare report_resolve_problem.
1775 2009-11-03 Doug Kwan <dougkwan@google.com>
1777 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
1779 (Target_arm::stub_factory): New method definition.
1780 (Target_arm::new_arm_input_section,
1781 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
1782 Target_arm::reloc_uses_thumb_bit): New method declarations.
1783 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
1784 New type definitions.
1785 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
1786 member declarations.
1787 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
1788 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
1789 New method definitions.
1791 2009-11-03 Ian Lance Taylor <iant@google.com>
1793 * options.h (class General_options): Add --warn_constructors.
1795 2009-11-03 Ian Lance Taylor <iant@google.com>
1798 * defstd.cc (in_section): Add entries for __rel_iplt_start,
1799 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
1801 2009-11-03 Ian Lance Taylor <iant@google.com>
1804 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
1805 --msgid-bugs-address.
1806 (install-pdf): New target.
1807 (install-data_yes): Look up one directory to find mkinstalldirs.
1809 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
1811 * po/Make-in (.po.gmo): Don't generate .gmo files in source
1814 2009-10-30 Doug Kwan <dougkwan@google.com>
1816 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
1818 2009-10-30 Doug Kwan <dougkwan@google.com>
1820 * arm.cc (Stub_addend_reader): New struct template definition
1821 and partial specializations.
1822 (Stub_addend_reader::operator()): New method definition for a
1823 partially specialized template.
1825 2009-10-30 Doug Kwan <dougkwan@google.com>
1827 * arm.cc (Arm_relobj::processor_specific_flags): New method
1829 (Arm_relobj::do_read_symbols): New method declaration.
1830 (Arm_relobj::processor_specific_flags_): New data member declaration.
1831 (Arm_dynobj): New class definition.
1832 (Target_arm::do_finalize_sections): Add input_objects parameter.
1833 (Target_arm::do_adjust_elf_header): New method declaration.
1834 (Target_arm::are_eabi_versions_compatible,
1835 (Target_arm::merge_processor_specific_flags): New method declaration.
1836 (Target_arm::do_make_elf_object): New overloaded method definitions
1838 (Arm_relobj::do_read_symbols): New method definition.
1839 (Arm_dynobj::do_read_symbols): Ditto.
1840 (Target_arm::do_finalize_sections): Add input_objects parameters.
1841 Merge processor-specific flags from all input objects.
1842 (Target_arm::are_eabi_versions_compatible,
1843 Target_arm::merge_processor_specific_flags,
1844 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
1845 New method definitions.
1846 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
1847 Input_objects pointer type parameter.
1848 * layout.cc (Layout::finalize): Pass input objects to target's.
1849 finalize_sections function.
1850 * output.cc (Output_file_header::do_sized_write): Set ELF file
1851 header's processor-specific flags.
1852 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
1853 Input_objects pointer type parameter.
1854 * sparc.cc (Target_sparc::do_finalize_sections): Same.
1855 * target.h (Input_objects): New forward class declaration.
1856 (Target::processor_specific_flags,
1857 Target::are_processor_specific_flags_sect): New method definitions.
1858 (Target::finalize_sections): Add input_objects parameter.
1859 (Target::Target): Initialize processor_specific_flags_ and
1860 are_processor_specific_flags_set_.
1861 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
1863 (Target::set_processor_specific_flags): New method definition.
1864 (Target::processor_specific_flags_,
1865 Target::are_processor_specific_flags_set_): New data member
1867 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
1868 Input_objects pointer type parameter.
1870 2009-10-30 Doug Kwan <dougkwan@google.com>
1872 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
1874 2009-10-28 Ian Lance Taylor <iant@google.com>
1876 * object.h (class Relobj): Drop options parameter from
1877 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
1878 do_scan_relocs, do_relocate. Change all callers.
1879 (class Sized_relobj): Drop options parameters from
1880 do_gc_process_relocs, do_scan_relocs, do_relocate,
1881 do_relocate_sections, relocate_sections, emit_relocs_scan,
1882 emit_relocs_scan_reltype. Change all callers.
1883 (struct Relocate_info): Remove options field and all references to
1885 * reloc.h (class Read_relocs): Remove options constructor
1886 parameter and options_ field. Change all callers.
1887 (class Gc_process_relocs, class Scan_relocs): Likewise.
1888 (class Relocate_task): Likewise.
1889 * target-reloc.h (scan_relocs): Remove options parameter. Change
1891 (scan_relocatable_relocs): Likewise.
1892 * target.h (class Sized_target): Remove options parameter from
1893 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
1895 * gc.h (gc_process_relocs): Remove options parameter. Change all
1897 * arm.cc: Update functions to remove options parameters.
1898 * i386.cc: Likewise.
1899 * powerpc.cc: Likewise.
1900 * sparc.cc: Likewise.
1901 * x86_64.cc: Likewise.
1902 * testsuite/testfile.cc: Likewise.
1904 2009-10-28 Doug Kwan <dougkwan@google.com>
1906 * arm.cc (Arm_relobj): New class definition.
1907 (Arm_relobj::scan_sections_for_stubs,
1908 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
1909 New method definitions.
1911 2009-10-28 Cary Coutant <ccoutant@google.com>
1913 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
1914 (Plugin::cleanup_done_): New member.
1915 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
1916 (Plugin_manager::cleanup_done_): Remove.
1917 (Plugin_manager::add_input_file): Edit error message.
1918 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
1919 (Plugin_manager::cleanup): Remove use of cleanup_done_.
1921 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
1923 * fileread.cc: (File_read::View::~View): Use the new
1924 data_ownership_ filed.
1925 (File_read::~File_read): Dispose the new whole_file_view_.
1926 (File_read::open): Mmap the whole file if needed.
1927 (File_read::open): Use whole_file_view_ instead of contents_.
1928 (File_read::find_view): Use whole_file_view_ if applicable.
1929 (File_read::do_read): Use whole_file_view_ instead of contents_.
1930 (File_read::make_view): Use whole_file_view_ instead of contents_,
1931 update File_read::View::View call.
1932 (File_read::find_or_make_view): Update File_read::View::View
1934 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
1936 (File_read::View::Data_ownership): New enum.
1937 (File_read::View::View): Replace bool mapped_ with Data_ownership
1939 (File_read::View::mapped_): Remove (replaced by data_ownership_).
1940 (File_read::View::data_ownership_): New field.
1941 (File_read::contents_): Remove (replaced by whole_file_view_).
1942 (File_read::whole_file_view_): New field.
1943 * options.h (class General_options): Add --keep-files-mapped.
1945 2009-10-27 Cary Coutant <ccoutant@google.com>
1947 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
1948 * testsuite/Makefile.am (plugin_test_5): New test case.
1949 * testsuite/Makefile.in: Regenerate.
1951 2009-10-25 Doug Kwan <dougkwan@google.com>
1953 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
1954 from private to protected to allow access by child class.
1955 (Sized_relobj::do_relocate_sections): New method declaration.
1956 (Sized_relobj::relocate_sections): Virtualize.
1957 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
1958 Sized_relobj::relocate_sections. Instantiate template explicitly
1959 for different target sizes and endianity.
1961 2009-10-24 Doug Kwan <dougkwan@google.com>
1963 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
1964 (Arm_input_section::as_arm_input_section): New method.
1965 (Arm_output_section): New class definition.
1966 (Arm_output_section::create_stub_group,
1967 Arm_output_section::group_sections): New method definitions.
1969 2009-10-22 Doug Kwan <dougkwan@google.com>
1971 * arm.cc (Arm_input_section): New class definition.
1972 (Arm_input_section::init, Arm_input_section:do_write,
1973 Arm_input_section::set_final_data_size,
1974 Arm_input_section::do_reset_address_and_file_offset): New method
1977 2009-10-21 Doug Kwan <dougkwan@google.com>
1979 * arm.cc (Stub_table, Arm_input_section): New forward class
1981 (Stub_table): New class defintion.
1982 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
1983 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
1984 New method definition.
1986 2009-10-21 Doug Kwan <dougkwan@google.com>
1988 * arm.cc: Update copyright comments.
1989 (Target_arm): New forward class template declaration.
1990 (Arm_address): New type.
1991 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
1992 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
1993 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
1995 (Insn_template): Same.
1996 (DEF_STUBS): New macro.
1997 (Stub_type): New enum type.
1998 (Stub_template): New class definition.
2001 (Stub_factory): Same.
2002 (Target_arm::Target_arm): Initialize may_use_blx_ and
2003 should_force_pic_veneer_.
2004 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
2005 Target_arm::should_force_pic_veneer,
2006 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
2007 Target_arm::using_thumb_only, Target_arm:;default_target): New
2009 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
2010 New data member declarations.
2011 (Insn_template::size, Insn_template::alignment): New method defintions.
2012 (Stub_template::Stub_template): New method definition.
2013 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
2014 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
2015 (Stub_factory::Stub_factory): New method definition.
2016 * gold.h (string_hash): New template.
2017 * output.h (Input_section_specifier::hash_value): Use
2019 (Input_section_specifier::string_hash): Remove.
2020 * stringpool.cc (Stringpool_template::string_hash): Use
2023 2009-10-20 Doug Kwan <dougkwan@google.com>
2025 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
2026 symbols of relaxed input sections.
2027 * output.h (Output_section::find_relaxed_input_section): Make
2030 2009-10-16 Doug Kwan <dougkwan@google.com>
2032 * dynobj.cc (Versions::Versions): Initialize version_script_.
2033 Only insert base version symbol definition for a shared object
2034 if version script defines any version versions.
2035 (Versions::define_base_version): New method definition.
2036 (Versions::add_def): Check that base version is not needed.
2037 (Versions::add_need): Define base version lazily.
2038 * dynobj.h (Versions::define_base_version): New method declaration.
2039 (Versions::needs_base_version_): New data member declaration.
2040 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
2041 (check_DATA): Add no_version_test.stdout.
2042 (libno_version_test.so, no_version_test.o no_version_test.stdout):
2044 * testsuite/Makefile.in: Regenerate.
2045 * testsuite/no_version_test.c: New file.
2046 * testsuite/no_version_test.sh: Ditto.
2048 2009-10-16 Doug Kwan <dougkwan@google.com>
2050 * expression.cc (class Segment_start_expression): New class definition.
2051 (Segment_start_expression::value): New method definition.
2052 (script_exp_function_segment_start): Return a new
2053 Segment_start_expression.
2054 * gold/script-c.h (script_saw_segment_start_expression): New function
2056 * script-sections.cc (Script_sections::Script_sections): Initialize
2057 SAW_SEGMENT_START_EXPRESSION_ to false.
2058 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
2059 and -Tbbs options to specify section addresses if given in
2060 command line and no SEGMENT_START expression is seen in a script.
2061 * script-sections.h (Script_sections::saw_segment_start_expression,
2062 Script_sections::set_saw_segment_start_expression): New method
2064 (Script_sections::saw_segment_start_expression_): New data member
2066 * script.cc (script_saw_segment_start_expression): New function.
2067 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
2068 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
2069 script_test_7.sh and script_test_8.sh.
2070 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
2071 script_test_8.stdout.
2072 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
2073 (script_test_6, script_test_6.stdout, script_test_7,
2074 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
2075 * Makefile.in: Regenerate.
2076 * testsuite/script_test_6.sh: New file.
2077 * testsuite/script_test_6.t: Same.
2078 * testsuite/script_test_7.sh: Same.
2079 * testsuite/script_test_7.t: Same.
2080 * testsuite/script_test_8.sh: Same.
2082 2009-10-16 Doug Kwan <dougkwan@google.com>
2084 * output.cc (Output_segment::set_section_list_address): Cast
2085 expressions to unsigned long long type to avoid format warnings.
2087 2009-10-15 Ian Lance Taylor <iant@google.com>
2089 * script.cc (Script_options::add_symbol_assignment): Always add a
2090 dot assignment to script_sections_.
2091 * script-sections.cc (Script_sections::add_dot_assignment):
2092 Initialize if necessary.
2094 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
2095 program headers with no load segment if there is a linker script.
2097 * layout.cc (Layout::set_segment_offsets): Align the file offset
2098 to the segment aligment for -N or -n with no load segment.
2099 * output.cc (Output_segment::add_output_section): Don't crash if
2100 the first section is a TLS section.
2101 (Output_segment::set_section_list_addresses): Print an error
2102 message if the address moves backward in a linker script.
2103 * script-sections.cc
2104 (Output_section_element_input::set_section_addresses): Don't
2105 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
2106 (Orphan_output_section::set_section_addresses): Likewise.
2108 2009-10-15 Doug Kwan <dougkwan@google.com>
2110 * layout.cc (Layout::finish_dynamic_section): Generate tags
2111 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
2112 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
2113 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
2115 2009-10-14 Ian Lance Taylor <iant@google.com>
2117 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
2119 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
2120 data_shdr fields of relinfo.
2121 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
2122 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
2123 R_386_TLS_LDO_32, adjust based on section flags.
2124 (Target_i386::Relocate::fix_up_ldo): Remove.
2126 2009-10-13 Ian Lance Taylor <iant@google.com>
2128 Add support for -pie.
2129 * options.h (class General_options): Add -pie and
2131 (General_options::output_is_position_independent): Test -pie.
2132 (General_options::output_is_executable): Return true if not shared
2133 and not relocatable.
2134 (General_options::output_is_pie): Remove.
2135 * options.cc (General_options::finalize): Reject incompatible uses
2137 * gold.cc (queue_middle_tasks): A -pie link is not static.
2138 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
2139 * symtab.cc (Symbol::final_value_is_known): Return false if
2140 output_is_position_independent.
2141 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
2142 output_is_position_independent.
2143 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
2144 output_is_position_independent.
2145 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
2146 output_is_position_independent.
2147 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
2149 (basic_pie_test.o, basic_pie_test): New targets.
2150 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
2151 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
2152 (two_file_pie_test): New target.
2153 * testsuite/Makefile.in: Rebuild.
2154 * README: Remove note saying that -pie is not supported.
2156 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2158 * options.h (class General_options): Add -init and -fini.
2159 * layout.cc (Layout::finish_dynamic_section): Emit
2160 given init and fini functions.
2162 2009-10-13 Sriraman Tallam <tmsriram@google.com>
2164 * gc.h (gc_process_relocs): Check if icf is enabled using new
2166 * gold.cc (queue_initial_tasks): Likewise.
2167 (queue_middle_tasks): Likewise.
2168 * object.cc (do_layout): Likewise.
2169 * symtab.cc (is_section_folded): Likewise.
2170 * main.cc (main): Likewise.
2171 * reloc.cc (Read_relocs::run): Likewise.
2172 (Sized_relobj::do_scan_relocs): Likewise.
2173 * icf.cc (is_function_ctor_or_dtor): New function.
2174 (Icf::find_identical_sections): Check if function is ctor or dtor when
2176 * options.h (General_options::icf): Change option to be an enum.
2177 (Icf_status): New enum.
2178 (icf_enabled): New method.
2179 (icf_safe_folding): New method.
2180 (set_icf_status): New method.
2181 (icf_status_): New variable.
2182 * (options.cc) (General_options::finalize): Set icf_status_.
2183 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
2184 icf_test and icf_keep_unique_test to use the --icf enum flag.
2185 * testsuite/icf_safe_test.sh: New file.
2186 * testsuite/icf_safe_test.cc: New file.
2188 2009-10-12 Sriraman Tallam <tmsriram@google.com>
2190 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
2191 includes to gc.h and icf.h.
2192 * arm.cc: Include gc.h.
2193 * gold.cc: Likewise.
2194 * i386.cc: Likewise.
2195 * powerpc.cc: Likewise.
2196 * sparc.cc: Likewise.
2197 * x86_64.cc: Likewise.
2198 * gc.h: Include icf.h.
2200 2009-10-11 Ian Lance Taylor <iant@google.com>
2202 * plugin.cc: Include "gold.h" before other header files.
2204 2009-10-10 Chris Demetriou <cgd@google.com>
2206 * options.h (Input_file_argument::Input_file_type): New enum.
2207 (Input_file_argument::is_lib_): Replace with...
2208 (Input_file_argument::type_): New member.
2209 (Input_file_argument::Input_file_argument): Take Input_file_type
2210 'type' rather than boolean 'is_lib' as second argument.
2211 (Input_file_argument::is_lib): Use type_.
2212 (Input_file_argument::is_searched_file): New function.
2213 (Input_file_argument::may_need_search): Handle is_searched_file.
2214 * options.cc (General_options::parse_library): Support -l:filename.
2215 (General_options::parse_just_symbols): Update for Input_file_argument
2217 (Command_line::process): Likewise.
2218 * archive.cc (Archive::get_file_and_offset): Likewise.
2219 * plugin.cc (Plugin_manager::release_input_file): Likewise.
2220 * script.cc (read_script_file, script_add_file): Likewise.
2221 * fileread.cc (Input_file::Input_file): Likewise.
2222 (Input_file::will_search_for): Handle is_searched_file.
2223 (Input_file::open): Likewise.
2224 * readsyms.cc (Read_symbols::get_name): Likewise.
2225 * testsuite/Makefile.am (searched_file_test): New test.
2226 * testsuite/Makefile.in: Regenerate.
2227 * testsuite/searched_file_test.cc: New file.
2228 * testsuite/searched_file_test_lib.cc: New file.
2230 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2231 Ian Lance Taylor <iant@google.com>
2233 * descriptor.cc: Include <cstdio> and "binary-io.h".
2234 (Descriptors::open): Open the files in binary mode always.
2235 * script.cc (Lex::get_token): Treat \r as whitespace.
2237 2009-10-09 Ian Lance Taylor <iant@google.com>
2239 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
2241 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2242 Ian Lance Taylor <iant@google.com>
2244 * configure.ac: Check for readv function also.
2245 * fileread.cc (readv): Define if not HAVE_READV.
2246 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
2248 * config.in: Regenerate.
2249 * configure: Regenerate.
2251 2009-10-09 Doug Kwan <dougkwan@google.com>
2253 * layout.cc (Layout::make_output_section): Call target hook to make
2254 ordinary output section.
2255 (Layout::finalize): Adjust parameter list of call the
2256 Target::may_relax().
2257 * layout.h (class Layout::section_list): New method.
2258 * merge.h (Output_merge_base::entsize): Change visibility to public.
2259 (Output_merge_base::is_string, Output_merge_base::do_is_string):
2261 (Output_merge_string::do_is_string): New method.
2262 * object.cc (Sized_relobj::do_setup): renamed from
2263 Sized_relobj::set_up.
2264 * object.h (Sized_relobj::adjust_shndx,
2265 Sized_relobj::initializ_input_to_output_maps,
2266 Sized_relobj::free_input_to_output_maps): Change visibilities to
2268 (Sized_relobj::setup): Virtualize.
2269 (Sized_relobj::do_setup): New method declaration.
2270 (Sized_relobj::invalidate_section_offset,
2271 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
2272 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
2273 * options.cc (parse_int): New function.
2274 * options.h (parse_int): New declaration.
2275 (DEFINE_int): New macro.
2276 (stub_group_size): New option.
2277 * output.cc (Output_section::Output_section): Initialize memebers
2278 merge_section_map_, merge_section_by_properties_map_,
2279 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
2280 (Output_section::add_input_section): Handled deferred code-fill
2281 generation and remove an old comment.
2282 (Output_section::add_relaxed_input_section): New method definition.
2283 (Output_section::add_merge_input_section): Use merge section by
2284 properties map to speed to search. Update merge section maps
2286 (Output_section::build_relaxation_map): New method definition.
2287 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2289 (Output_section::relax_input_section): Renamed to
2290 Output_section::convert_input_sections_to_relaxed_sections and change
2291 interface to take a vector of pointers to relaxed sections.
2292 (Output_section::find_merge_section,
2293 Output_section::find_relaxed_input_section): New method definitions.
2294 (Output_section::is_input_address_mapped,
2295 Output_section::output_offset, Output_section::output_address):
2296 Use output section data maps to speed up searching.
2297 (Output_section::find_starting_output_address): Add comments.
2298 (Output_section::do_write,
2299 Output_section::write_to_postprocessing_buffer): Do code-fill
2300 generation as appropriate.
2301 (Output_section::get_input_sections): Invalidate relaxed input section
2303 (Output_section::restore_states): Adjust type of checkpoint .
2304 Invalidate relaxed input section map.
2305 * output.h (Output_merge_base): New class declaration.
2306 (Input_section_specifier): New class defintion.
2307 (class Output_relaxed_input_section) Change base class to
2308 Output_section_data_build.
2309 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
2310 base class initializer.
2311 (Output_section::add_relaxed_input_section): New method declaration.
2312 (Output_section::Input_section): Change visibility to protected.
2313 (Output_section::Input_section::relobj,
2314 Output_section::Input_section::shndx): Handle relaxed input sections.
2315 Output_section::input_sections) Change visibility to protected. Also
2316 define overload to return a non-const pointer.
2317 (Output_section::Merge_section_properties): New class defintion.
2318 (Output_section::Merge_section_by_properties_map,
2319 Output_section::Output_section_data_by_input_section_map,
2320 Output_section::Relaxation_map): New types.
2321 (Output_section::relax_input_section): Rename method to
2322 Output_section::convert_input_sections_to_relaxed_sections and change
2323 interface to take a vector of relaxed section pointers.
2324 (Output_section::find_merge_section,
2325 Output_section::find_relaxed_input_section,
2326 Output_section::build_relaxation_map,
2327 Output_section::convert_input_sections_in_list_to_relaxed_sections):
2328 New method declarations.
2329 (Output_section::merge_section_map_
2330 Output_section::merge_section_by_properties_map_,
2331 Output_section::relaxed_input_section_map_,
2332 Output_section::is_relaxed_input_section_map_valid_,
2333 Output_section::generate_code_fills_at_write_): New data members.
2334 * script-sections.cc
2335 (Output_section_element_input::set_section_addresses): Call
2336 current_data_size and addralign methods of relaxed input sections.
2337 (Orphan_output_section::set_section_addresses): Call current_data_size
2338 and addralign methods of relaxed input sections.
2339 * symtab.cc (Symbol_table::compute_final_value): Extract template
2340 from the body of Symbol_table::sized_finalize_symbol.
2341 (Symbol_table::sized_finalized_symbol): Call
2342 Symbol_table::compute_final_value.
2343 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
2344 (Symbol_table::compute_final_value): New templated method declaration.
2345 * target.cc (Target::do_make_output_section): New method defintion.
2346 * target.h (Target::make_output_section): New method declaration.
2347 (Target::relax): Add more parameters for input objects, symbol table
2348 and layout. Adjust call to do_relax.
2349 (Target::do_make_output_section): New method declaration.
2350 (Target::do_relax): Add parameters for input objects, symbol table
2353 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2355 * pread.c: Include stdio.h.
2357 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2359 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
2362 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
2364 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2365 Change read_shndx type to unsigned int.
2366 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
2368 (Sized_dwarf_line_info::read_line_mappings): Likewise.
2369 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
2370 Change read_shndx type to unsigned int.
2371 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
2373 (Sized_dwarf_line_info::read_line_mappings): Likewise.
2374 * layout.cc (Layout::create_symtab_sections): Cast the result of
2375 local_symcount * symsize to off_t in the gold_assert.
2377 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2379 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
2380 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
2382 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
2383 (Arm_relocate_functions::thm_abs5): New function.
2384 (Arm_relocate_functions::abs12): New function.
2385 (Arm_relocate_functions::abs16): New function.
2386 (Arm_relocate_functions::base_abs): New function.
2387 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
2388 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
2389 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
2391 (Scan::global): Likewise.
2392 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
2393 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
2394 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
2395 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
2398 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2400 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
2401 (Arm_relocate_functions::movt_prel): New function.
2402 (Arm_relocate_functions::thm_movw_prel_nc): New function.
2403 (Arm_relocate_functions::thm_movt_prel): New function.
2404 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
2405 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
2406 (Scan::global, Relocate::relocate): Likewise.
2407 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2409 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
2411 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
2412 Incremental_checker.
2413 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
2415 (class Incremental_inputs_header): New class.
2416 (Incremental_inputs_header_writer): Edit comment.
2417 (Incremental_inputs_entry): New class.
2418 (Incremental_inputs_entry_writer): Edit comment.
2419 (Sized_incremental_binary::do_find_incremental_inputs_section):
2420 Add *strtab_shndx parameter, fill it.
2421 (Sized_incremental_binary::do_check_inputs): New method.
2422 (Incremental_checker::can_incrementally_link_output_file): Use
2423 Sized_incremental_binary::check_inputs.
2424 (Incremental_inputs::report_command_line): Save command line in
2427 (Incremental_binary::find_incremental_inputs_section): New
2429 (Incremental_binary::do_find_incremental_inputs_section): Add
2430 strtab_shndx parameter.
2431 (Incremental_binary::do_check_inputs): New pure virtual method.
2432 (Sized_incremental_binary::do_check_inputs): Declare.
2433 (Incremental_checker::Incremental_checker): Add incremental_inputs
2434 parameter, use it to initialize incremental_inputs_.
2435 (Incremental_checker::incremental_inputs_): New field.
2436 (Incremental_checker::command_line): New method.
2437 (Incremental_checker::inputs): New method.
2438 (Incremental_checker::command_line_): New field.
2440 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
2442 * incremental.cc: Include <cstdarg> and "target-select.h".
2443 (vexplain_no_incremental): New function.
2444 (explain_no_incremental): New function.
2445 (Incremental_binary::error): New method.
2446 (Sized_incremental_binary::do_find_incremental_inputs_section): New
2448 (make_sized_incremental_binary): New function.
2449 (open_incremental_binary): New function.
2450 (can_incrementally_link_file): Add checks if output is ELF and has
2452 * incremental.h: Include "elfcpp_file.h" and "output.h".
2453 (Incremental_binary): New class.
2454 (Sized_incremental_binary): New class.
2455 (open_incremental_binary): Declare.
2456 * object.cc (is_elf_object): Use
2457 elfcpp::Elf_recognizer::is_elf_file.
2458 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
2459 * output.h (Output_file::filesize): New method.
2461 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2463 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
2465 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
2466 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
2468 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
2470 (Arm_relocate_functions::movw_abs_nc): New function.
2471 (Arm_relocate_functions::movt_abs): New function.
2472 (Arm_relocate_functions::thm_movw_abs_nc): New function.
2473 (Arm_relocate_functions::thm_movt_abs): New function.
2474 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
2475 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
2476 (Scan::global): Likewise.
2477 (Relocate::relocate): Likewise.
2478 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2480 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2482 * arm.cc (Arm_relocate_functions::got_prel) New function.
2483 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
2484 (Relocate::relocate): Likewise.
2485 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2487 2009-10-06 Ian Lance Taylor <iant@google.com>
2489 * options.h (class General_options): Define
2490 split_stack_adjust_size parameter.
2491 * object.h (class Object): Add uses_split_stack_ and
2492 has_no_split_stack_ fields. Add uses_split_stack and
2493 has_no_split_stack accessor functions. Declare
2494 handle_split_stack_section.
2495 (class Reloc_symbol_changes): Define.
2496 (class Sized_relobj): Define Function_offsets. Declare
2497 split_stack_adjust, split_stack_adjust_reltype, and
2499 * object.cc (Object::handle_split_stack_section): New function.
2500 (Sized_relobj::do_layout): Call handle_split_stack_section.
2501 * dynobj.cc (Sized_dynobj::do_layout): Call
2502 handle_split_stack_section.
2503 * reloc.cc (Sized_relobj::relocate_sections): Call
2504 split_stack_adjust for executable sections in split_stack
2505 objects. Pass reloc_map to relocate_section.
2506 (Sized_relobj::split_stack_adjust): New function.
2507 (Sized_relobj::split_stack_adjust_reltype): New function.
2508 (Sized_relobj::find_functions): New function.
2509 * target-reloc.h: Include "object.h".
2510 (relocate_section): Add reloc_symbol_changes parameter. Change
2512 * target.h (class Target): Add calls_non_split method. Declare
2513 do_calls_non_split virtual method. Declare match_view and
2515 * target.cc: Include "elfcpp.h".
2516 (Target::do_calls_non_split): New function.
2517 (Target::match_view): New function.
2518 (Target::set_view_to_nop): New function.
2519 * gold.cc (queue_middle_tasks): Give an error if mixing
2520 split-stack and non-split-stack objects with -r.
2521 * i386.cc (Target_i386::relocate_section): Add
2522 reloc_symbol_changes parameter.
2523 (Target_i386::do_calls_non_split): New function.
2524 * x86_64.cc (Target_x86_64::relocate_section): Add
2525 reloc_symbol_changes parameter.
2526 (Target_x86_64::do_calls_non_split): New function.
2527 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
2529 * powerpc.cc (Target_powerpc::relocate_section): Add
2530 reloc_symbol_changes parameter.
2531 * sparc.cc (Target_sparc::relocate_section): Add
2532 reloc_symbol_changes parameter.
2533 * configure.ac: Call AM_CONDITIONAL for the default target.
2534 * configure: Rebuild.
2535 * testsuite/Makefile.am (TEST_AS): New variable.
2536 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
2537 (check_DATA): Add split_i386 and split_x86_64 files.
2538 (SPLIT_DEFSYMS): Define.
2539 (split_i386_[1234n].o): New targets.
2540 (split_i386_[124]): New targets.
2541 (split_i386_[1234r].stdout): New targets.
2542 (split_x86_64_[1234n].o): New targets.
2543 (split_x86_64_[124]): New targets.
2544 (split_x86_64_[1234r].stdout): New targets.
2545 (MOSTLYCLEANFILES): Add new executables.
2546 * testsuite/split_i386.sh: New file.
2547 * testsuite/split_x86_64.sh: New file.
2548 * testsuite/split_i386_1.s: New file.
2549 * testsuite/split_i386_2.s: New file.
2550 * testsuite/split_i386_3.s: New file.
2551 * testsuite/split_i386_4.s: New file.
2552 * testsuite/split_i386_n.s: New file.
2553 * testsuite/split_x86_64_1.s: New file.
2554 * testsuite/split_x86_64_2.s: New file.
2555 * testsuite/split_x86_64_3.s: New file.
2556 * testsuite/split_x86_64_4.s: New file.
2557 * testsuite/split_x86_64_n.s: New file.
2558 * testsuite/testfile.cc (Target_test): Update relocation_section
2560 * testsuite/Makefile.in: Rebuild.
2562 2009-10-06 Ian Lance Taylor <iant@google.com>
2564 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
2565 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
2566 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
2567 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
2568 the address on ldo_addrs_.
2569 (Target_i386::Relocate::fix_up_ldo): New function.
2571 2009-10-06 Rafael Espindola <espindola@google.com>
2573 * plugin.cc (add_input_library): New.
2574 (Plugin::load): Add add_input_library to tv.
2575 (Plugin_manager::add_input_file): Add the is_lib argument.
2576 (add_input_file): Update call to Plugin_manager::add_input_file.
2577 (add_input_library): New.
2578 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
2580 2009-09-30 Doug Kwan <dougkwan@google.com>
2582 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
2583 symbol and call Symbol::may_need_copy_reloc to determine if
2584 a copy reloc is needed.
2585 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
2586 nocopyreloc is given in command line.
2587 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
2588 given in command line.
2589 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
2590 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
2591 of the removed Target_i386::may_need_copy_reloc.
2592 * options.h (copyreloc): New option with default value false.
2593 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
2594 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
2595 instead of the removed Target_powerpc::may_need_copy_reloc.
2596 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
2597 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
2598 instead of the removed Target_sparc::may_need_copy_reloc.
2599 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
2600 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
2601 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
2602 instead of the removed Target_x86_64::may_need_copy_reloc.
2604 2009-09-30 Ian Lance Taylor <iant@google.com>
2606 * object.h (class Object): Remove target_ field, and target,
2607 sized_target, and set_target methods.
2608 (Object::sized_target): Remove.
2609 (class Sized_relobj): Update declarations. Remove sized_target.
2610 * object.cc (Sized_relobj::setup): Remove target parameter.
2612 (Input_objects::add_object): Don't do anything with the target.
2613 (make_elf_sized_object): Add punconfigured parameter. Change all
2614 callers. Set or test parameter target.
2615 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
2617 * parameters.cc (Parameters::set_target): Change parameter type to
2619 (Parameters::default_target): Remove.
2620 (set_parameters_target): Change parameter type to be non-const.
2621 (parameters_force_valid_target): New function.
2622 (parameters_clear_target): New function.
2623 * parameters.h (class Parameters): Update declarations. Remove
2624 default_target method. Add sized_target and clear_target
2625 methods. Change target_ to be non-const.
2626 (set_parameters_target): Update declaration.
2627 (parameters_force_valid_target): Declare.
2628 (parameters_clear_target): Declare.
2629 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
2630 as NULL if we aren't searching.
2631 (Add_symbols::run): Don't check for compatible target.
2632 * fileread.cc (Input_file::open_binary): Call
2633 parameters_force_valid_target.
2634 * gold.cc (queue_middle_tasks): Likewise.
2635 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
2636 set_target on object.
2637 * dynobj.h (class Sized_dynobj): Update declarations.
2638 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
2639 make_elf_object returns NULL.
2640 (Archive::include_member): Don't check whether object target is
2642 * output.cc (Output_section::add_input_section): Get target from
2644 (Output_section::relax_input_section): Likewise.
2645 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
2647 (Sized_relobj::do_scan_relocs): Likewise.
2648 (Sized_relobj::relocate_sections): Likewise.
2649 * resolve.cc (Symbol_table::resolve): Likewise.
2650 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
2651 parameter. Change all callers.
2652 (Symbol_table::add_from_object): Get target from parameters.
2653 (Symbol_table::add_from_relobj): Don't check object target.
2654 (Symbol_table::add_from_dynobj): Likewise.
2655 (Symbol_table::define_special_symbol): Get target from
2657 * symtab.h (class Symbol_table): Update declaration.
2658 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
2659 parameter. Change all callers. Clear parameter target.
2660 (Binary_test): Test target here.
2661 * testsuite/object_unittest.cc (gold_testsuite): Remove
2662 target_test_pointer parameter. Change all callers.
2663 (Object_test): Test target here.
2665 2009-09-26 Ian Lance Taylor <iant@google.com>
2667 * testsuite/initpri1.c: Don't try to use constructor priorities if
2668 compiling with gcc before 4.3.
2670 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
2672 * testsuite/retain_symbols_file_test.sh (check_present): Change
2673 output file name to retain_symbols_file_test.stdout.
2674 (check_absent): Likewise.
2676 2009-09-18 Craig Silverstein <csilvers@google.com>
2678 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
2679 * options.cc: Include <cerrno> and <fstream>.
2680 (General_options::finalize): Parse -retain-symbols-file tag.
2681 * options.h: New flag.
2682 (General_options): New method should_retain_symbol, new
2683 variable symbols_to_retain.
2684 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
2685 should_retain_symbol map.
2686 * testsuite/Makefile.am (retain_symbols_file_test): New test.
2687 * testsuite/Makefile.in: Regenerate.
2688 * testsuite/retain_symbols_file_test.sh: New file.
2690 2009-09-18 Nick Clifton <nickc@redhat.com>
2692 * po/es.po: Updated Spanish translation.
2694 2009-09-17 Doug Kwan <dougkwan@google.com>
2696 * debug.h (DEBUG_RELAXATION): New constant.
2697 (DEBUG_ALL): Add DEBUG_RELAXATION.
2698 (debug_string_to_enum): Add relaxation debug option.
2700 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
2701 Layout::Relaxation_debug_check::read_sections,
2702 Layout::Relaxation_debug_check::read_sections): New method definitions.
2703 (Layout::Layout): Initialize data members
2704 record_output_section_data_from_scrips_,
2705 script_output_section_data_list_ and relaxation_debug_check_.
2706 (Layout::save_segments, Layout::restore_segments,
2707 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
2708 Layout::relaxation_loop_body): New method definitions.
2709 (Layout::finalize): Support relaxation. Move section layout code to
2710 Layout::relaxation_loop_body.
2711 (Layout::set_asection_address_from_script): Move code for orphan
2712 section placement out.
2713 (Layout::place_orphan_sections_in_script): New method definition.
2714 * layout.h (Output_segment_headers, Output_file_header):
2715 New forward class declarations.
2716 (Layout::~Layout): Define.
2717 (Layout::new_output_section_data_from_script): New method definition.
2718 (Layout::place_orphan_sections_in_script): New method declaration.
2719 (Layout::Segment_states): New type declaration.
2720 (Layout::save_segments, Layout::restore_segments,
2721 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
2722 Layout::relaxation_loop_body): New method declarations.
2723 (Layout::Output_section_data_list): New type declaration.
2724 (Layout::Relaxation_debug_check): New class definition.
2725 (Layout::record_output_section_data_from_script_,
2726 Layout::script_output_section_data_list_, Layout::segment_states_,
2727 Layout::relaxation_debug_check_): New data members.
2728 * output.cc: (Output_section_headers::do_size): New method definition.
2729 (Output_section_headers::Output_section_headers): Move size
2730 computation to Output_section_headers::do_size.
2731 (Output_segment_headers::do_size): New method definition.
2732 (Output_file_header::Output_file_header): Move size computation to
2733 Output_file_header::do_size and call it.
2734 (Output_file_header::do_size): New method definition.
2735 (Output_data_group::Output_data_group): Adjust call to
2736 Output_section_data.
2737 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
2738 (Output_symtab_xindex::do_write): Add array bound check.
2739 (Output_section::Input_section::print_to_mapfile): Handle
2740 RELAXED_INPUT_SECTION_CODE.
2741 (Output_section::Output_section): Initialize data member checkpoint_.
2742 (Output_section::~Output_section): Delete checkpoint object pointed
2744 (Output_section::add_input_section): Always add an Input_section if
2746 (Output_section::add_merge_input_section): Add assert.
2747 (Output_section::relax_input_section): New method definition.
2748 (Output_section::set_final_data_size): Set load address to zero for
2749 an unallocated section.
2750 (Output_section::do_address_and_file_offset_have_reset_values):
2751 New method definition.
2752 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
2753 Handle relaxed input section.
2754 (Output_section::sort_attached_input_sections): Checkpoint input
2755 section list lazily.
2756 (Output_section::get_input_sections): Change type of input_sections to
2757 list of Simple_input_section pointers. Checkpoint input section list
2758 lazily. Also handle relaxed input sections.
2759 (Output_section::add_input_section_for_script): Take a reference to
2760 a Simple_input_section object instead of Relobj pointer and section
2761 index as parameter. Handle relaxed input sections.
2762 (Output_section::save_states, Output_section::restore_states): New
2764 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
2765 (Output_data::is_data_size_fixed): New method definition.
2766 (Output_data::reset_addresss_and_file_offset): Do not reset data size
2768 (Output_data::address_and_file_offset_have_reset_values): New method
2770 (Output_data::do_address_and_file_offset_have_reset_values): New method
2772 (Output_data::set_data_size): Check that data size is not fixed.
2773 (Output_data::fix_data_size): New method definition.
2774 (Output_data::is_data_size_fixed_): New data member.
2775 (Output_section_headers::set_final_data_size): New method definition.
2776 (Output_section_headers::do_size): New method declaration.
2777 (Output_segment_headers::set_final_data_size): New method definition.
2778 (Output_segment_headers::do_size): New method declaration.
2779 (Output_file_header::set_final_data_size)::New method definition.
2780 (Output_file_header::do_size)::New method declaration.
2781 (Output_section_data::Output_section_data): Add new parameter
2782 is_data_size_fixed and use it to fix data size.
2783 (Output_data_const::Output_data_const): Adjust call to base class
2784 constructor and fix data size.
2785 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
2786 base class constructor and fix data size.
2787 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
2788 base class constructor and fix data size.
2789 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
2790 class constructor and fix data size.
2791 (Output_data_group::set_final_data_size): New method definition.
2792 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
2793 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
2794 class constructor and fix data size.
2795 (Output_relaxed_input_section): New class definition.
2796 (Output_section::Simple_input_section): New class definition.
2797 (Output_section::get_input_sections): Adjust parameter list.
2798 (Output_section::add_input_section_for_script): Same.
2799 (Output_section::save_states, Output_section::restore_states,
2800 Output_section::do_address_and_file_offset_have_reset_values,
2801 (Output_section::Input_section::Input_section): Handle
2802 RELAXED_INPUT_SECTION_CODE. Add new overload for
2803 Output_relaxed_input_section.
2804 (Output_section::Input_section::is_input_section,
2805 Output_section::Input_section::set_output_section): Handle relaxed
2807 (Output_section::Input_section::is_relaxed_input_section,
2808 Output_section::Input_section::output_section_data,
2809 Output_section::Input_section::relaxed_input_section): New method
2811 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
2813 (Output_section::Input_section::u1_): Update comments.
2814 (Output_section::Input_section::u2_): Add new union member poris.
2815 (Output_section::Checkpoint_output_section): New classs definition.
2816 (Output_section::relax_input_section): New method declaration.
2817 (Output_section::checkpoint_): New data member.
2818 (Output_segment): Update comments.
2819 (Output_segment::Output_segment): Un-privatize copy constructor.
2820 (Output_segment::operator=): Un-privatize.
2821 * script-sections.cc (Output_section_element::Input_section_list):
2822 Change element type to Output_section::Simple_input_section.
2823 (Output_section_element_dot_assignment::set_section_addresses):
2824 Register output section data for relaxation clean up.
2825 (Output_data_exression::Output_data_expression): Adjust call to base
2826 constructor to fix data size.
2827 (Output_section_element_data::set_section_addresses): Register
2828 Output_data_expression object for relaxation clean up.
2829 (struct Input_section_info): Replace Relobj pointer and section index
2830 pair with Output_section::Simple_input_section and Convert struct to a
2832 (Input_section_sorter::operator()): Adjust access to
2833 Input_section_info data member to use accessors.
2834 (Output_section_element_input::set_section_addresses): Use layout
2835 parameter. Adjust code to use Output_section::Simple_input_section
2836 and Input_secction_info classes. Register filler for relaxation
2838 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
2839 and section index pair with Output_section::Simple_input_section
2840 class. Adjust code accordingly.
2841 (Phdrs_element::release_segment): New method definition.
2842 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
2844 (Script_sections::release_segments): New method definition.
2845 * gold/script-sections.h (Script_sections::release_segments): New
2847 * gold/target.h (Target::may_relax, Target::relax,
2848 Target::do_may_relax, Target::do_relax): New method definitions.
2850 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2852 * arm.cc (has_signed_unsigned_overflow): New function.
2853 (Arm_relocate_functions::abs8): New function.
2854 (Target_arm::Scan::local): Handle R_ARM_ABS8.
2855 (Target_arm::Scan::global): Likewise.
2856 (Target_arm::relocate::relocate): Likewise.
2857 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2860 2009-09-16 Cary Coutant <ccoutant@google.com>
2862 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
2863 * testsuite/Makefile.in: Regenerate.
2865 2009-09-11 Nick Clifton <nickc@redhat.com>
2867 * po/gold.pot: Updated by the Translation project.
2869 2009-09-08 Cary Coutant <ccoutant@google.com>
2871 * output.cc (Output_file::open): Add execute permission to empty file.
2872 * testsuite/Makefile.am (permission_test): New test.
2873 * testsuite/Makefile.in: Regenerate.
2875 2009-09-02 Ian Lance Taylor <iant@google.com>
2877 * output.cc (Output_file::resize): Call map_no_anonymous rather
2880 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
2882 * gold.cc: Include "incremental.h".
2883 (queue_initial_tasks): Call Incremental_checker methods.
2884 * incremental.cc: Include "output.h".
2885 (Incremental_checker::can_incrementally_link_output_file): New
2887 * incremental.h (Incremental_checker): New class.
2889 * output.cc (Output_file::open_for_modification): New method.
2890 (Output_file::map_anonymous): Changed return type to bool. Record
2892 (Output_file::map_no_anonymous): New method, broken out of map.
2893 (Output_file::map): Use map_no_anonymous and map_anonymous.
2894 * output.h (class Output_file): Update declarations.
2896 2009-08-24 Cary Coutant <ccoutant@google.com>
2898 * options.h (Command_line::Pre_options): New class.
2899 (Command_line::pre_options): New member.
2900 * options.cc (gold::options::ready_to_register): New variable.
2901 (One_option::register_option): Do nothing if not registering options.
2902 Assert if same short option registered twice.
2903 (General_options::General_options): Turn off option registration when
2905 (Command_line::Pre_options::Pre_options): New constructor.
2907 2009-08-24 Cary Coutant <ccoutant@google.com>
2909 * options.h (General_options::no_keep_memory): Remove incorrect
2912 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2914 * Makefile.am (am__skiplex, am__skipyacc): New.
2915 * Makefile.in: Regenerate.
2917 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2919 * Makefile.am (AM_CPPFLAGS): Renamed from ...
2920 (INCLUDES): ... this.
2921 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
2922 (AM_CPPFLAGS): Renamed from ...
2923 (INCLUDE): ... this.
2924 * Makefile.in, testsuite/Makefile.in: Regenerate.
2926 * Makefile.in: Regenerate.
2927 * aclocal.m4: Likewise.
2928 * config.in: Likewise.
2929 * configure: Likewise.
2930 * testsuite/Makefile.in: Likewise.
2932 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
2933 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
2934 * Makefile.in: Regenerate.
2935 * testsuite/Makefile.in: Regenerate.
2937 2009-08-19 Cary Coutant <ccoutant@google.com>
2939 * resolve.cc (Symbol_table::resolve): Don't complain about defined
2940 symbols in shared libraries overridden by hidden or internal symbols
2941 in the main program.
2943 2009-08-19 Chris Demetriou <cgd@google.com>
2945 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
2946 checking source file names in error messages.
2948 2009-08-18 Doug Kwan <dougkwan@google.com>
2950 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
2951 an elcpp::Ehdr as parameter. Adjust call to set_target.
2952 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
2953 an elfcpp::Ehdr as parameter.
2954 * object.cc (Object::set_target): Remove the version that looks up
2955 a target and sets it.
2956 (Sized_relobj::setup): Take a Target object instead of
2957 an elfcpp::Ehdr as parameter. Adjust call to set_target.
2958 (make_elf_sized_object): Find target and ask target to
2960 * object.h: (Object::set_target): Remove the version that looks up
2961 a target and sets it.
2962 (Sized_relobj::setup): Take a Target object instead of
2963 an elfcpp:Ehdr as parameter.
2964 * target.cc: Include dynobj.h.
2965 (Target::do_make_elf_object_implementation): New.
2966 (Target::do_make_elf_object): New.
2967 * target.h (Target::make_elf_object): New template declaration.
2968 (Target::do_make_elf_object): New method declarations.
2969 (Target::do_make_elf_object_implementation): New template declaration.
2971 2009-08-14 Ian Lance Taylor <iant@google.com>
2973 * gold.h (FUNCTION_NAME): Define.
2974 (gold_unreachable): Use FUNCTION_NAME.
2976 2009-08-12 Sriraman Tallam <tmsriram@google.com>
2978 * icf.cc (Icf::find_identical_sections): Issue a warning when a
2979 symbol in the --keep-unique list is not found.
2981 2009-08-12 Sriraman Tallam <tmsriram@google.com>
2983 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
2984 been maked as --keep-unique.
2985 (Icf::unfold_section): New function.
2986 * icf.h (Icf::unfold_section): New function.
2987 * options.h (General_options::keep_unique): New option.
2988 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
2989 * testsuite/Makefile.in: Regenerate.
2990 * testsuite/icf_keep_unique_test.sh: New file.
2991 * testsuite/icf_keep_unique_test.cc: New file.
2993 2009-08-12 Cary Coutant <ccoutant@google.com>
2996 * resolve.cc (Symbol_table::resolve): Check for references from
2997 dynamic objects to hidden and internal symbols.
2998 * testsuite/Makefile.am (hidden_test.sh): New test.
2999 * testsuite/Makefile.in: Regenerate.
3000 * testsuite/hidden_test.sh: New script.
3001 * testsuite/hidden_test_1.c: New test source.
3002 * testsuite/hidden_test_main.c: New test source.
3004 2009-08-11 Doug Kwan <dougkwan@google.com>
3006 * arm.cc: Update comments.
3007 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
3008 segment to locate the .ARM.exidx section if present.
3010 2009-08-09 Doug Kwan <dougkwan@google.com>
3012 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
3015 2009-08-07 Sriraman Tallam <tmsriram@google.com>
3016 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
3019 2009-08-06 Sriraman Tallam <tmsriram@google.com>
3021 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
3022 valid tls_segment only for non-debug-section relocations.
3023 * testsuite/Makefile.am: Add gc_tls_test.
3024 * testsuite/Makefile.in: Regenerate.
3025 * testsuite/gc_tls_test.cc: New file.
3026 * testsuite/gc_tls_test.sh: New file.
3028 2009-08-05 Sriraman Tallam <tmsriram@google.com>
3032 * Makefile.am (CCFILES): Add icf.cc.
3034 * Makefile.in: Regenerate.
3035 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
3036 * gc.h (gc_process_relocs): Populate lists used by icf to contain
3037 section, symbol and addend information for the relocs.
3038 * gold.cc (queue_middle_tasks): Call identical code folding.
3039 * gold.h: Add defines for multimap.
3040 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
3041 to the call of finalize_local_symbols.
3042 * main.cc (main): Create object of class Icf.
3043 * object.cc (Sized_relobj::do_layout): Allow this function to be
3044 called twice during icf.
3045 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
3046 to sections marked as identical by icf.
3047 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
3049 (Sized_relobj::do_section_entsize): New function.
3050 * object.h (Object::section_entsize): New function.
3051 (Object::do_section_entsize): New pure virtual function.
3052 (Relobj::finalize_local_symbols): Add new parameter.
3053 (Relobj::do_section_entsize): New function.
3054 * options.h (General_options::icf): New option.
3055 (General_options::icf_iterations): New option.
3056 (General_options::print_icf_sections): New option.
3057 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
3058 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
3059 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
3061 * symtab.cc (Symbol_table::is_section_folded): New function.
3062 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
3063 to sections marked as identical by icf.
3064 * symtab.h (Symbol_table::set_icf): New function.
3065 (Symbol_table::icf): New function.
3066 (Symbol_table::is_section_folded): New function.
3067 (Symbol_table::icf_): New data member.
3068 * target-reloc.h (relocate_section): Ignore sections folded by icf.
3069 * testsuite/Makefile.am: Add commands to build icf_test.
3070 * testsuite/Makefile.in: Regenerate.
3071 * testsuite/icf_test.sh: New file.
3072 * testsuite/icf_test.cc: New file.
3074 2009-07-24 Chris Demetriou <cgd@google.com>
3076 * layout.cc (is_compressible_debug_section): Fix incorrect
3077 comment about compressed section names.
3079 2009-07-20 Ian Lance Taylor <ian@airs.com>
3082 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
3084 2009-07-16 Ian Lance Taylor <iant@google.com>
3087 * layout.h: #include <map>.
3088 (class Kept_section): Change from struct to class. Add accessors
3089 and setters. Add section size to Comdat_group mapping. Change
3090 Comdat_group to std::map. Add is_comdat_ field. Add
3091 linkonce_size field in union.
3092 (class Layout): Update declaration of find_or_add_kept_section.
3093 Don't declare find_kept_object.
3094 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
3095 parameter. Add object, shndx, is_comdat, and is_group_name
3096 parameters. Change all callers. Adjust for new Kept_section.
3097 (Layout::find_kept_object): Remove.
3098 * object.cc (Sized_relobj::include_section_group): Update use of
3099 Kept_section. Rename secnum to shndx. Only record
3100 Kept_comdat_section if sections are the same size.
3101 (Sized_relobj::include_linkonce_section): Update use of
3102 Kept_section. Only record Kept_comdat_section if sections are the
3103 same size. Set size of linkonce section.
3104 (Sized_relobj::map_to_kept_section): Update call to
3105 get_kept_comdat_section.
3106 * object.h (class Sized_relobj): Rename fields in
3107 Kept_comdat_section to drop trailing underscores; change object
3108 field to Relobj*. Change Kept_comdat_section_table to store
3109 struct rather than pointer.
3110 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
3111 Add kept_object and kept_shndx parameters. Change all callers.
3112 (Sized_relobj::get_kept_comdat_section): Change return type to
3113 bool. Add kept_object and kept_shndx parameters. Change all
3115 * plugin.cc (Pluginobj::include_comdat_group): Update call to
3116 Layout::find_or_add_kept_section.
3118 2009-07-09 Ian Lance Taylor <iant@google.com>
3120 * merge.cc (Object_merge_map::initialize_input_to_output_map):
3121 Reserve space in the hash table.
3123 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
3125 * fileread.cc (File_read::get_mtime): New method.
3126 * fileread.h (Timespec): New structure.
3127 (File_read::get_mtime): New method.
3128 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
3129 Renamed from timestamp_nsec.
3130 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
3132 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
3134 (Incremental_inputs::report_archive): Save mtime; style fix.
3135 (Incremental_inputs::report_obejct): Save mtime; style fix.
3136 (Incremental_inputs::report_script): Save mtime; style fix.
3137 (Incremental_inputs::finalize_inputs): Style fix.
3138 (Incremental_inputs::finalize): Style fix.
3139 (Incremental_inputs::create_input_section_data): Store inputs
3141 * incremental.h (Incremental_inputs::report_script): Add mtime
3143 (Incremental_inputs::Input_info::Input_info): Intialize only one
3145 (Incremental_inputs::Input_info::archive): Move to nameless
3147 (Incremental_inputs::Input_info::obejct): Move to nameless union.
3148 (Incremental_inputs::Input_info::script): Move to nameless union.
3149 (Incremental_inputs::mtime): New field.
3150 * script.cc (read_input_script): Pass file mtime to
3152 * script.h (Script_info::inputs): Style fix.
3154 2009-07-01 Ian Lance Taylor <ian@airs.com>
3156 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
3159 2009-06-24 Ian Lance Taylor <iant@google.com>
3162 * layout.cc (Layout::choose_output_section): If we find an
3163 existing section, update the flags.
3164 (Layout::create_notes): New function, broken out of
3166 (Layout::finalize): Don't create note sections.
3167 (Layout::create_note): Don't crash if linker script discards
3169 (Layout::create_gold_note): Likewise.
3170 (Layout::create_build_id): Likewise. Don't set
3171 after_input_sections on the section.
3172 (Layout::create_executable_stack_info): Remove target parameter.
3174 * layout.h (class Layout): Declare create_notes. Update
3175 declaration of create_executable_stack_info.
3176 * gold.cc (queue_middle_tasks): Call create_notes.
3177 * output.cc (Output_section::update_flags_for_input_section): Move
3178 here from output.h. If SHF_ALLOC flag is newly set, mark address
3180 * output.h (Output_data::mark_address_invalid): New function.
3181 (class Output_section): Only declare, not define,
3182 update_flags_for_input_section. Remove set_flags.
3184 2009-06-24 Ian Lance Taylor <iant@google.com>
3186 * script-sections.cc (Output_section_definition::
3187 set_section_addresses): Rename shadowing local load_address to
3190 2009-06-24 Ian Lance Taylor <iant@google.com>
3193 * reloc.cc (relocate_sections): Skip empty relocation sections.
3195 2009-06-23 Ian Lance Taylor <iant@google.com>
3198 * layout.cc (Layout::create_note): Use choose_output_section
3199 rather than make_output_section.
3201 2009-06-23 Ian Lance Taylor <iant@google.com>
3204 * options.cc (General_options::parse_V): Set printed_version_.
3205 (General_options::General_options): Initialize printed_version_.
3206 * options.h (class General_options): Add printed_version_ field.
3207 * gold.cc (queue_initial_tasks): If there are no input files,
3208 don't give a fatal error if we printed the version information.
3209 (queue_middle_tasks): If using -r with a shared object, give a
3210 fatal error rather than an ordinary error.
3212 2009-06-23 Ian Lance Taylor <iant@google.com>
3215 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
3216 (Layout::make_output_section): Set have_stabstr_section_ if we see
3217 a .stab*str section.
3218 (Layout::finalize): Call link_stabs_sections.
3219 (Layout::link_stabs_sections): New file.
3220 * layout.h (class Layout): Add have_stabstr_section_ field.
3221 Declare link_stabs_sections.
3223 2009-06-23 Doug Kwan <dougkwan@google.com>
3225 * Makefile.am (libgold_a_LIBADD): New.
3226 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
3227 * Makefile.in: Regenerate.
3228 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
3229 * configure: Regenerate.
3230 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
3231 * fileread.cc: Include sys/state.h
3232 * gold.h: Declare memmem and strndup if found missing.
3233 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
3235 2009-06-23 Ian Lance Taylor <iant@google.com>
3237 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
3238 * configure: Rebuild.
3240 2009-06-23 Ian Lance Taylor <iant@google.com>
3243 * object.cc (Object::section_contents): Don't try to get a view if
3244 the section has length zero.
3245 (Object::handle_gnu_warning_section): If the section is empty, use
3246 the name of the section as the warning.
3248 2009-06-23 Ian Lance Taylor <iant@google.com>
3251 * stringpool.h (class Stringpool_template): Add optimize_ field.
3252 (Stringpool_template::set_optimize): New function.
3253 * stringpool.cc (Stringpool_template::Stringpool_template):
3254 Initialize optimize_ field.
3255 (Stringpool_template::set_string_offsets): Test local optimize
3256 fild rather than parameter.
3257 * layout.cc (Layout::Layout): Call set_optimize on the section
3260 2009-06-22 Ian Lance Taylor <iant@google.com>
3263 * yyscript.y: Parse TARGET.
3264 * script.cc (script_set_target): New function.
3265 * script-c.h (script_set_target): Declare.
3266 * options.cc (General_options::string_to_object_format): Rename
3267 from string_to_object_format in anonymous namespace. Change
3269 * options.h (class General_options): Declare
3270 string_to_object_format.
3272 2009-06-22 Ian Lance Taylor <iant@google.com>
3274 * script-sections.cc (Script_sections::create_segments): Don't put
3275 program headers in a PT_LOAD segment if -n or -N.
3277 2009-06-22 Ian Lance Taylor <iant@google.com>
3280 * options.h (class General_options): Add -z lazy and -z now. Sort
3281 -z options into alphabetical order.
3282 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
3284 2009-06-21 Ian Lance Taylor <iant@google.com>
3286 * layout.cc (Layout::make_output_section): Call
3287 Target::new_output_section.
3288 (Layout::attach_allocated_section_to_segment): Put large section
3289 sections in a separate load segment with the large segment flag
3291 (Layout::segment_precedes): Sort large data segments after other
3293 (align_file_offset): New static function.
3294 (Layout::set_segment_offsets): Use align_file_offset.
3295 * output.h (class Output_section): Add is_small_section_ and
3296 is_large_section_ fields.
3297 (Output_section::is_small_section): New function.
3298 (Output_section::set_is_small_section): New function.
3299 (Output_section::is_large_section): New function.
3300 (Output_section::set_is_large_section): New function.
3301 (Output_section::is_large_data_section): New function.
3302 (class Output_segment): Add is_large_data_segment_ field.
3303 (Output_segment::is_large_data_segment): New function.
3304 (Output_segment::set_is_large_data_segment): New function.
3305 * output.cc (Output_section::Output_section): Initialize new
3307 (Output_segment::Output_segment): Likewise.
3308 (Output_segment::add_output_section): Add assertion that large
3309 data sections always go in large data segments. Force small data
3310 sections to the end of the list of data sections. Force small BSS
3311 sections to the start of the list of BSS sections. For large BSS
3312 sections to the end of the list of BSS sections.
3313 * symtab.h (class Symbol): Declare is_common_shndx.
3314 (Symbol::is_defined): Check Symbol::is_common_shndx.
3315 (Symbol::is_common): Likewise.
3316 (class Symbol_table): Define enum Commons_section_type. Update
3317 declarations. Add small_commons_ and large_commons_ fields.
3318 * symtab.cc (Symbol::is_common_shndx): New function.
3319 (Symbol_table::Symbol_table): Initialize new fields.
3320 (Symbol_table::add_from_object): Put small and large common
3321 symbols in the right list.
3322 (Symbol_table::sized_finalized_symbol): Check
3323 Symbol::is_common_shndx.
3324 (Symbol_table::sized_write_globals): Likewise.
3325 * common.cc (Symbol_table::do_allocate_commons): Allocate new
3326 common symbol lists. Don't call do_allocate_commons_list if the
3328 (Symbol_table::do_allocate_commons_list): Remove is_tls
3329 parameter. Add comons_section_type parameter. Change all
3330 callers. Handle small and large common symbols.
3331 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
3332 Symbol::is_common_shndx.
3333 * resolve.cc (symbol_to_bits): Likewise.
3334 * target.h (Target::small_common_shndx): New function.
3335 (Target::small_common_section_flags): New function.
3336 (Target::large_common_shndx): New function.
3337 (Target::large_common_section_flags): New function.
3338 (Target::new_output_section): New function.
3339 (Target::Target_info): Add small_common_shndx, large_common_shndx,
3340 small_common_section_flags, and large_common_section_flags
3342 (Target::do_new_output_section): New virtual function.
3343 * arm.cc (Target_arm::arm_info): Initialize new fields.
3344 * i386.cc (Target_i386::i386_info): Likewise.
3345 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3347 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
3348 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3349 (Target_x86_64::do_new_output_section): New function.
3350 * configure.ac: Define conditional MCMODEL_MEDIUM.
3351 * testsuite/Makefile.am (check_PROGRAMS): Add large.
3352 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
3353 (large_LDFLAGS): Define.
3354 * testsuite/large.c: New file.
3355 * testsuite/testfile.cc (Target_test::test_target_info):
3356 Initialize new fields.
3357 * configure, testsuite/Makefile.in: Rebuild.
3359 2009-06-05 Doug Kwan <dougkwan@google.com>
3361 * Makefile.am (CCFILES): Add target.cc.
3362 * Makefile.in: Regenerate.
3363 * i386.cc (class Target_i386): Define new virtual method to
3364 override do_is_local_label_name in parent.
3365 * object.cc (Sized_relobj::do_count_local_symbols): Discard
3366 local symbols if --discard-locals or -X is given.
3367 * options.h (class General_options): Declare new options
3368 '--discard-locals' and '-X' for discarding locals.
3369 * target.h (class Target): Define new methods is_local_label_name.
3370 Declare new virtual method do_is_local_label_name.
3371 * target.cc: New file.
3372 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
3373 (check_SCRIPTS): Add discard_locals_test.sh.
3374 (check_DATA): Add discard_local_tests.syms.
3375 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
3376 (discard_local_tests.syms, discard_locals_test.o): New make rules.
3377 * testsuite/Makefile.in: Regenerate.
3378 * testsuite/discard_locals_test.c: New file.
3379 * testsuite/discard_locals_test.sh: Same.
3381 2009-06-05 Doug Kwan <dougkwan@google.com>
3383 * object.cc (Sized_relobj::Sized_relobj): Initialize
3384 discarded_eh_frame_shndx_ to -1U.
3385 (Sized_relobj::do_layout): Record index of a discard .eh_frame
3387 (Sized_relobj::do_count_local_symbols): Skip local symbols in
3388 a discarded .eh_frame section.
3389 (Sized_relobj::do_finalize_local_symbols): Ditto.
3390 * object.h (class Sized_relobj): Declare new member
3391 discarded_eh_frame_shndx_.
3392 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
3393 (local_labels_test.o, local_labels_test): New rules.
3394 * testsuite/Makefile.in: Regenerate.
3396 2009-06-04 Doug Kwan <dougkwan@google.com>
3398 * layout.cc (Layout::section_name_mapping): Add mapping for
3399 special ARM sections.
3401 2009-06-03 Doug Kwan <dougkwan@google.com>
3403 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
3404 (utils::has_overflow): Same.
3406 2009-06-03 Ian Lance Taylor <iant@google.com>
3408 * layout.cc (Layout::section_name_mapping): New array, replacing
3409 Layout::linkonce_mapping.
3410 (Layout::section_name_mapping_count): New variable, replacing
3411 Layout::linkonce_mapping_count.
3412 (Layout::linkonce_output_name): Remove.
3413 (Layout::output_section_name): Rewrite.
3414 * layout.h (class Layout): Rename Linkonce_mapping to
3415 Section_name_mapping, linkonce_mapping to section_name_mapping,
3416 linkonce_mapping_count to section_name_mapping_count. Don't
3417 declare linkonce_output_name.
3419 2009-06-03 Doug Kwan <dougkwan@google.com>
3421 * gold/arm.cc (namespace utils): New.
3422 (Target_arm::reloc_is_non_pic): Define new method.
3423 (class Arm_relocate_functions): New.
3424 (Target_arm::Relocate::relocate): Handle relocation types used by
3427 2009-06-03 Ian Lance Taylor <iant@google.com>
3429 * arm.cc (Target_arm::scan::global): Use || instead of |.
3431 2009-06-02 Doug Kwan <dougkwan@google.com>
3433 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
3434 issued_non_pic_error_.
3435 (class Target_arm::Scan): Declare new method check_non_pic.
3436 Define new method symbol_needs_plt_entry.
3437 Declare new data member issued_non_pic_error_.
3438 (class Target_arm::Relocate): Declare new method
3439 should_apply_static_reloc.
3440 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
3441 (Target_arm::Scan::check_non_pic): Define new method.
3442 (Target_arm::Scan::local): Handle a small subset of reloc types used
3444 (Target_arm::Scan::local): Same.
3445 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
3447 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
3449 * incremental.cc (Incremental_inputs::report_command_line): Filter
3450 out --incremental-* options.
3452 2009-05-29 Doug Kwan <dougkwan@google.com>
3454 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
3456 (class Target_arm): Update comment.
3457 (Target_arm::Target_arm): Initialize new data members GOT_,
3458 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
3459 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
3460 and Target_arm::rel_dyn_section.
3461 Declare new_enum Target_arm::Got_type.
3462 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
3464 Update commments for member do_dynsym_value.
3465 (Target_arm::got_size, Target_arm::plt_section,
3466 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
3467 new methods inside class defintion.
3468 (Target_arm::got_section): Define new method.
3469 (Target_arm::rel_dyn_section): Same.
3470 (Output_data_plt_arm): New template class.
3471 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
3472 (Output_data_plt_arm:do_adjust_output_section): Define new method.
3473 (Output_data_plt_arm::add_entry): Same.
3474 (Output_data_plt_arm::first_plt_entry): Define new
3475 static data member for PLT instruction template.
3476 (Output_data_plt_arm::plt_entry): Same.
3477 (Output_data_plt_arm::do_write): Define new method.
3478 (Target_arm::make_plt_entry): Same.
3479 (Target_arm::do_finalize_sections): Same.
3480 (Target_arm::do_dynsym_value): Same.
3482 2009-05-28 Doug Kwan <dougkwan@google.com>
3484 * Makefile.am (TARGETSOURCES): Add arm.cc.
3485 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
3486 * Makefile.in: Regenerate.
3488 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
3490 2009-05-26 Doug Kwan <dougkwan@google.com>
3492 * options.cc (General_options::parse_exclude_libs). Fix a comment.
3493 (General_options::check_excluded_libs): Strip off directories in
3494 archive name before matching like GNU ld does.
3495 * testsuite/Makefile.am (MOSTLYCLEANFILES,
3496 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
3497 (exclude_libs_test_LDFLAGS): Add linker option
3498 -Wl,--exclude-libs,libexclude_libs_test_3
3499 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
3500 an explicit archive without using -l.
3501 (alt/libexclude_libs_test_3.a): New make rule.
3502 * testsuite/Makefile.in: Regenerate.
3503 * testsuite/exclude_libs_test.c : Declare lib3_default().
3505 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
3506 * exclude_libs_test_3.c: New file.
3508 2009-05-26 Nick Clifton <nickc@redhat.com>
3510 * po/id.po: New Indonesian translation.
3511 * po/gold.pot: Updated template file.
3513 2009-05-22 Sriraman Tallam <tmsriram@google.com>
3515 * testsuite/Makefile.am: Add -ffunction-sections to compile
3516 gc_comdat_test files. Add -Wl,--gc-sections to build
3518 * testsuite/Makefile.in: Regenerate.
3519 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
3521 2009-05-21 Sriraman Tallam <tmsriram@google.com>
3523 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
3524 kept comdat section was garbage collected.
3525 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
3526 * testsuite/Makefile.in: Regenerate.
3527 * testsuite/gc_comdat_test.sh: New file.
3528 * testsuite/gc_comdat_test_1.cc: New file.
3529 * testsuite/gc_comdat_test_2.cc: New file.
3531 2009-05-19 Doug Kwan <dougkwan@google.com>
3533 * archive.cc (Archive::Archive): Move constructor from archive.h
3534 to here. Initialize no_export_.
3535 (Archive::get_elf_object_for_member): Set no_export flag of object.
3536 * archive.h (Archive::Archive): Move constructor body to
3538 (Archive::no_export): New method.
3539 (Archive::no_export_): New field.
3540 * object.h (Object::Object): Initialize no_export_ to false.
3541 (Object::no_export, Object::set_no_export): New methods.
3542 (Object::no_export_): New field.
3543 * options.cc (General_options::parse_exclude_libs): New method.
3544 (General_options::check_excluded_libs) Same.
3545 * options.h (exclude_libs): New option.
3546 (General_options::check_excluded_libs): New method declaration.
3547 (General_options::excluded_libs_): New field.
3548 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
3549 default or protected visibility if an object has no-export flag set.
3550 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
3551 (check_SCRIPTS): Add exclude_libs_test.sh.
3552 (check_DATA): Add exclude_libs_test.syms.
3553 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
3554 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
3555 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
3556 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
3557 (exclude_libs_test.syms, libexclude_libs_test_1.a,
3558 libexclude_libs_test_2.a): New rules.
3559 * testsuite/Makefile.in: Regenerate.
3560 * testsuite/exclude_libs_test.c: New file.
3561 * testsuite/exclude_libs_test.sh: Ditto.
3562 * testsuite/exclude_libs_test_1.c: Ditto.
3563 * testsuite/exclude_libs_test_2.c: Ditto.
3565 2009-05-15 Ian Lance Taylor <iant@google.com>
3567 * configure.ac: Check for declarations for cases where libiberty.h
3568 checks HAVE_DECL_xxx.
3569 * configure, config.in: Rebuild.
3571 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
3573 * gold.h (Incremental_argument_list): Remove (invalid) forward
3575 * incremental.cc (Incremental_inputs::report_achive): New method.
3576 (Incremental_inputs::report_object): New method.
3577 (Incremental_inputs::report_script): New method.
3578 (Incremental_inputs::finalize_inputs): New method.
3579 (Incremental_inputs::finalize): Call finalize_inputs().
3580 (Incremental_inputs::sized_create_incremental_inputs_section_data):
3581 Create inputs entries.
3582 * incremental.h (Incremental_input_type): New enum.
3583 (Incremental_inputs::Incremental_input): Initialize new fields.
3584 (Incremental_inputs::report_inputs): New method.
3585 (Incremental_inputs::report_achive): New method.
3586 (Incremental_inputs::report_object): New method.
3587 (Incremental_inputs::report_script): New method.
3588 (Incremental_inputs::finalize_inputs): New method.
3589 (Incremental_inputs::Input_info): New struct.
3590 (Incremental_inputs::Input_info_map): New typedef.
3591 (Incremental_inputs::lock_): New field.
3592 (Incremental_inputs::Inputs_): New field.
3593 (Incremental_inputs::Inputs_map): New field.
3594 * main.cc (main): Call Incremental_input::report_inputs.
3595 * options.h (Input_argument_list): Typedef moved from
3597 (Input_file_group::Files): Remove, use ::Input_argument_list.
3598 (Input_file_group::Input_argument_list): Remove, use
3599 ::Input_argument_list.
3600 * plugin.cc (Plugin_manager::add_input_file): Add error in
3602 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
3604 * script.cc (read_input_script): Call
3605 Incremental_input::report_script.
3606 * script.h (Script_info): New class.
3608 2009-04-27 Ian Lance Taylor <iant@google.com>
3610 * x86_64.cc (do_adjust_output_section): Set entsize to
3613 2009-04-23 Elliott Hughes <enh@google.com>
3615 * output.cc (Output_file::close): After short writes, continue
3616 writing from the correct offset in the buffer being written.
3618 2009-04-23 Chris Demetriou <cgd@google.com>
3620 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
3621 * configure: Regenerate.
3622 * config.in: Regenerate.
3623 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
3624 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
3626 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
3628 * incremental.cc (Incremental_inputs_header_data): Renamed from
3629 Incremental_input_header_data.
3630 (Incremental_inputs_header_data::data_size): New field.
3631 (Incremental_inputs_header_data::put_input_file_count): Renamed
3632 from input_file_count.
3633 (Incremental_inputs_header_data::put_command_line_offset): Renamed
3634 from command_line_offset.
3635 (Incremental_inputs_header_data::put_reserved): Renamed from
3637 (Incremental_inputs_entry_data): Renamed from
3638 Incremental_input_entry_data.
3639 (Incremental_inputs_entry_data::data_size): New field.
3640 (Incremental_inputs::report_command_line): New method.
3641 (Incremental_inputs::finalize): New method.
3642 (Incremental_inputs::create_incremental_inputs_data): New method.
3643 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
3644 * incremental.h: New file.
3645 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
3646 (Layout::finalize): Create incremental inputs section in
3648 (Layout::create_incremental_info_sections): New method.
3649 * layout.h (Layout::incremental_inputs): New method.
3650 (Layout::create_incremental_info_sections): New method.
3651 (Layout::incremental_inputs_): New field.
3652 * main.cc (main): Notify Incremental_input of the command line.
3654 2009-04-01 Ian Lance Taylor <iant@google.com>
3655 Mikolaj Zalewski <mikolajz@google.com>
3657 * gold.h (reserve_unordered_map): Define, three versions, one for
3658 each version of Unordered_map.
3659 * layout.cc (Layout::Layout): Remove options parameter. Add
3660 number_of_input_files parameter. Don't initialize options_.
3661 Initialize number_of_input_files_ and resized_signatures_. Move
3662 sections_are_attached_.
3663 (Layout::layout_group): Reserve space for group_signatures_.
3664 (Layout::find_or_add_kept_section): Change name parameter to be a
3665 reference. Resize signatures_ map when it gets large enough.
3666 (Layout::layout_eh_frame): Use parameters->options() instead of
3668 (Layout::make_output_section): Likewise.
3669 (Layout::attach_allocated_section_to_segment): Likewise.
3670 (Layout::finalize, Layout::create_executable_stack): Likewise.
3671 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
3672 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
3673 * layout.h (class Layout): Update declarations. Remove options_
3674 field. Add number_of_input_files_ and resized_signatures_
3675 fields. Move sections_are_attached_ field.
3676 * main.cc (main): Pass number of input files to Layout
3677 constructor. Don't pass options.
3679 2009-03-30 Ian Lance Taylor <iant@google.com>
3681 * ffsll.c (ffsll): Correct implementation.
3683 2009-03-27 Ian Lance Taylor <iant@google.com>
3685 * ffsll.c: New file.
3686 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
3687 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
3688 * ftruncate.c (ftruncate): Declare before definition.
3689 * mremap.c (mremap): Likewise.
3690 * pread.c (pread): Likewise.
3691 * configure, Makefile.in, config.in: Rebuild.
3693 * mremap.c: New file.
3694 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
3695 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
3696 (mremap): Declare if HAVE_MREMAP is not defined.
3697 * configure, Makefile.in, config.in: Rebuild.
3699 2009-03-27 Cary Coutant <ccoutant@google.com>
3701 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
3702 position independent.
3703 * sparc.cc (Target_sparc::check_non_pic): Likewise.
3704 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
3706 2009-03-24 Cary Coutant <ccoutant@google.com>
3708 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
3710 (needs_dynamic_reloc): Likewise.
3712 2009-03-24 Ian Lance Taylor <iant@google.com>
3714 * yyscript.y (file_cmd): Recognize EXTERN.
3715 (extern_name_list, extern_name_list_body): New nonterminals.
3716 * script.cc (script_add_extern): Define.
3717 * script-c.h (script_add_extern): Declare.
3719 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
3721 * object.cc (is_elf_object): Define.
3722 * object.h (is_elf_object): Declare.
3723 * archive.cc (Archive::get_elf_object_for_member): Call
3725 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
3727 2009-03-24 Elliott Hughes <enh@google.com>
3729 * output.cc (Output_file::map_anonymous): Define.
3730 (Output_file::map): Use map_anonymous. If the regular mmap fails,
3731 try an anonymous one. Report the size if the mmap fails.
3732 * output.h (class Output_file): Declare map_anonymous.
3734 2009-03-24 Ian Lance Taylor <iant@google.com>
3736 * target-select.cc (instantiate_target): Don't acquire the lock if
3737 the instantiated_target_ field has already been set.
3739 2009-03-23 Ian Lance Taylor <iant@google.com>
3741 * gold-threads.h (class Initialize_lock): Define.
3742 * gold-threads.cc (class Initialize_lock_once): Define.
3743 (initialize_lock_control): New static variable.
3744 (initialize_lock_pointer): New static variable.
3745 (initialize_lock_once): New static function.
3746 (Initialize_lock::Initialize_lock): Define.
3747 (Initialize_lock::initialize): Define.
3748 * target-select.h: Include "gold-threads.h".
3749 (class Target_selector): Add lock_ and initialize_lock_ fields.
3750 Don't define instantiate_target, just declare it.
3751 * target-select.cc (Target_selector::Target_selector): Initialize
3753 (Target_selector::instantiate_target): Define.
3754 * descriptors.h: Include "gold-threads.h".
3755 (class Descriptors): Add initialize_lock_ field.
3756 * descriptors.cc (Descriptors::Descriptors): Initialize new
3758 (Descriptors::open): Use initialize_lock_ field
3759 * errors.h (class Errors): Add initialize_lock_ field.
3760 * errors.cc (Errors::Errors): Initialize new field.
3761 (Errors::initialize_lock): Use initialize_lock_ field.
3762 * powerpc.cc (class Target_selector_powerpc): Remove
3763 instantiated_target_ field. In do_recognize call
3764 instantiate_target rather than do_instantiate_target. In
3765 do_instantiate_target just allocate a new target.
3766 * sparc.cc (class Target_selector_sparc): Likewise.
3768 * freebsd.h: New file.
3769 * i386.cc: Include "freebsd.h".
3770 (Target_i386): Derive from Target_freebsd rather than
3772 (Target_selector_i386): Derive from Target_selector_freebsd rather
3773 than Target_selector.
3774 * x86_64.cc: Include "freebsd.h".
3775 (Target_x86_64): Derive from Target_freebsd rather than
3777 (Target_selector_x86_64): Derive from Target_selector_freebsd
3778 rather than Target_selector.
3779 * target.h (class Target): Add adjust_elf_header and
3780 do_adjust_elf_header.
3781 * output.cc (Output_file_header:: do_sized_write): Call target
3782 adjust_elf_header routine.
3783 * configure.tgt: Set targ_osabi.
3784 * configure.ac: Define GOLD_DEFAULT_OSABI.
3785 * parameters.cc (Parameters::default_target): Pass
3786 GOLD_DEFAULT_OSABI to select_target.
3787 * target-select.h (class Target_selector): Make instantiate_target
3788 protected rather than private.
3789 * Makefile.am (HFILES): Add freebsd.h.
3790 * configure, Makefile.in, config.in: Rebuild.
3792 * merge.cc (do_add_input_section): Correct pend value. Change
3793 message about last entry not being null terminated from error to
3796 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
3798 * incremental.cc: New file.
3799 * Makefile.am (CCFILES): Add incremental.cc.
3800 * Makefile.in: Rebuild.
3802 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
3804 * layout.cc (Layout::output_section_name): Preserve names
3805 of '.note.' sections.
3807 2009-03-19 Ian Lance Taylor <iant@google.com>
3809 * descriptors.cc (Descriptors::open): Check that the options are
3810 valid before using them.
3812 2009-03-18 Ian Lance Taylor <iant@google.com>
3814 * script-sections.h: Include <list>.
3815 (class Script_sections): Change Sections_elements from std::vector
3816 to std::list. Typedef public Elements_iterator. Add
3817 orphan_section_placement_, data_segment_align_start_, and
3818 saw_data_segment_align_ fields. Remove data_segment_align_index_
3820 * script-sections.cc (class Orphan_section_placement): New class.
3821 (class Sections_element): Add virtual functions is_relro and
3822 orphan_section_init. Remove virtual function place_orphan_here.
3823 (class Output_section_definition): Add is_relro and
3824 orphan_section_init. Remove place_orphan_here.
3825 (class Orphan_output_section): Likewise.
3826 (Script_sections::Script_sections): Update for field changes.
3827 (Script_sections::data_segment_align): Set saw_data_segment_align_
3828 and data_segment_align_start_, not data_segment_align_index.
3829 (Script_sections::data_segment_relro_end): Check
3830 saw_data_segment_align_. Use data_segment_align_start_ rather
3831 than data_segment_align_index_.
3832 (Script_sections::place_orphan): Rewrite to use
3833 Orphan_section_placement.
3835 2009-03-17 Ian Lance Taylor <iant@google.com>
3837 * archive.cc (Archive::add_symbols): Check for a version attached
3838 to the symbol name in the archive map.
3839 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
3840 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
3841 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
3842 (ver_test_11.a): New target.
3843 * testsuite/Makefile.in: Rebuild.
3845 * configure.ac: Check for chsize and posix_fallocate. Replace
3847 * ftruncate.c: New file, from gnulib.
3848 * output.cc (posix_fallocate): Define dummy version if not
3849 HAVE_POSIX_FALLOCATE.
3850 (Output_file::map): Call posix_fallocate rather than lseek and
3852 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
3853 * configure, Makefile.in, config.in: Rebuild.
3855 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
3857 * layout.h (Layout::create_note): Add section_name parameter.
3858 * layout.cc (Layout::create_note): Likewise.
3859 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
3861 2009-03-17 Ian Lance Taylor <iant@google.com>
3863 * descriptors.cc: Include "options.h".
3864 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
3865 (Descriptors::open): Always use O_CLOEXEC when opening a new
3866 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
3867 then set FD_CLOEXEC.
3869 * sparc.cc (class Target_sparc): Add has_got_section.
3870 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
3871 make sure we have a GOT section.
3873 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
3874 (Target_sparc::Scan::local): Likewise.
3875 (Target_sparc::Scan::global): Likewise.
3876 (Target_sparc::Relocate::relocate): Likewise.
3877 (Target_sparc::Relocate::relocate_tls): Likewise.
3879 * symtab.cc (Symbol_table::define_default_version): New function,
3880 broken out of add_from_object.
3881 (Symbol_table::add_from_object): Call define_default_version.
3882 (Symbol_table::define_special_symbol): Add resolve_oldsym
3883 parameter. Change all callers. If the version for a symbol comes
3884 from a version script, resolve it with the symbol with the same
3885 name with no version. Also add the symbol without a version if
3887 (do_define_in_output_data): If resolving with oldsym, don't delete
3889 (do_define_in_output_segment): Likewise.
3890 (do_define_as_constant): Likewise.
3891 * symtab.h (class Symbol_table): Update declarations.
3893 2009-03-13 Ian Lance Taylor <iant@google.com>
3895 * readsyms.cc (Read_symbols::incompatible_warning): New function.
3896 (Read_symbols::requeue): New function.
3897 (Read_symbols::do_read_symbols): If make_elf_object fails because
3898 the target type is not configured, and the file was searched for,
3899 issue a warning and retry with the next directory.
3900 (Add_symbols::run): If the file has an incompatible format, and
3901 it was searched for, requeue the Read_symbols task. On error,
3903 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
3904 dirindex parameter to constructor. Change all callers. Declare
3905 incompatible_warning and requeue.
3906 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
3907 input_argument_ and input_group_ fields. Add them to
3908 constructor. Change all callers.
3909 (class Read_script): Add dirindex_ field. Add it to constructor.
3911 * archive.cc (Archive::setup): Remove input_objects parameter.
3913 (Archive::get_file_and_offset): Likewise.
3914 (Archive::read_all_symbols): Likewise.
3915 (Archive::read_symbols): Likewise.
3916 (Archive::get_elf_object_for_member): Remove input_objects
3917 parameter. Add punconfigured parameter. Change all callers.
3918 (Archive::add_symbols): Change return type to bool. Check return
3919 value of include_member.
3920 (Archive::include_all_members): Likewise.
3921 (Archive::include_member): Change return type to bool. Return
3922 false if first included object has incompatible target. Set
3923 included_member_ field.
3924 (Add_archive_symbols::run): If add_symbols returns false, requeue
3926 * archive.h (class Archive): Add included_member_ field.
3927 Initialize it in constructor. Add input_file and searched_for
3928 methods. Update declarations.
3929 (class Add_archive_symbols): Add dirpath_, dirindex_, and
3930 input_argument_ fields. Add them to constructor. Change all
3932 * script.cc: Include "target-select.h".
3933 (class Parser_closure): Add skip_on_incompatible_target_ and
3934 found_incompatible_target_ fields. Add
3935 skip_on_incompatible_target parameter to constructor. Change all
3936 callers. Add methods skip_on_incompatible_target,
3937 clear_skip_on_incompatible_target, found_incompatible_target, and
3938 set_found_incompatible_target.
3939 (read_input_script): Add dirindex parameter. Change all callers.
3940 If parser finds an incompatible target, requeue Read_symbols
3942 (script_set_symbol): Clear skip_on_incompatible_target in
3944 (script_add_assertion, script_parse_option): Likewise.
3945 (script_start_sections, script_add_phdr): Likewise.
3946 (script_check_output_format): New function.
3947 * script.h (read_input_script): Update declaration.
3948 * script-c.h (script_check_output_format): Declare.
3949 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
3950 (ignore_cmd): Remove OUTPUT_FORMAT.
3951 * fileread.cc (Input_file::Input_file): Add explicit this.
3952 (Input_file::will_search_for): New function.
3953 (Input_file::open): Add pindex parameter. Change all callers.
3954 * fileread.h (class Input_file): Add input_file_argument method.
3955 Declare will_search_for. Update declarations.
3956 * object.cc (make_elf_object): Add punconfigured parameter.
3958 * object.h (class Object): Make input_file public. Add
3959 searched_for method.
3960 (make_elf_object): Update declaration.
3961 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
3963 * dirsearch.h (class Dirsearch): Update declaration.
3964 * options.h (class General_options): Add --warn-search-mismatch.
3965 * parameters.cc (Parameters::is_compatible_target): New function.
3966 * parameters.h (class Parameters): Declare is_compatible_target.
3967 * workqueue.cc (Workqueue::add_blocker): New function.
3968 * workqueue.h (class Workqueue): Declare add_blocker.
3970 * fileread.cc (Input_file::open): Remove options parameter.
3972 (Input_file::open_binary): Likewise.
3973 * script.cc (read_input_script): Likewise.
3974 * readsyms.h (class Read_symbols): Remove options_ field. Remove
3975 options parameter from constructor. Change all callers.
3976 (class Read_script): Likewise.
3977 * fileread.h (class Input_file): Update declarations.
3978 * script.h (read_input_script): Update declaration.
3980 2009-03-10 Nick Clifton <nickc@redhat.com>
3982 * po/es.po: New Spanish translation.
3984 2009-03-06 Cary Coutant <ccoutant@google.com>
3986 * options.cc (parse_short_option): Keep dash_z from registering itself.
3988 2009-03-03 Ian Lance Taylor <iant@google.com>
3991 * target-reloc.h (relocate_section): Pass output_section to
3993 * i386.cc (Target_i386::should_apply_static_reloc): Add
3994 output_section parameter. Change all callers.
3995 (Target_i386::Relocate::relocate): Add output_section parameter.
3996 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3997 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3998 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3999 * testsuite/two_file_shared.sh: New script.
4000 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
4001 (check_DATA): Add two_file_shared.dbg.
4002 (two_file_shared.dbg): New target.
4003 * testsuite/Makefile.in: Rebuild.
4005 2009-03-01 Ian Lance Taylor <iant@google.com>
4007 * configure.ac: Check for byteswap.h.
4008 * configure: Rebuild.
4009 * config.in: Rebuild.
4011 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
4013 * layout.cc (Layout::find_or_add_kept_section): New function.
4014 (Layout::add_comdat): Removed.
4015 * layout.h (struct Kept_section): Move out of class Layout.
4016 Remove trailing underscores from field names. Add group_sections
4017 field. Rename group_ field to is_group. Change all uses.
4018 (class Layout): Declare find_or_add_kept_section, not add_comdat.
4019 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
4020 comdat_groups_ field.
4021 (Sized_relobj::include_section_group): Use
4022 find_or_add_kept_section and Kept_section::group_sections.
4023 (Sized_relobj::include_linkonce_section): Likewise.
4024 * object.cc (class Sized_relobj): Don't define Comdat_group or
4025 Comdat_group_table. Remove find_comdat_group and
4026 add_comdat_group. Remove comdat_groups_ field.
4027 * plugin.cc (include_comdat_group): Use
4028 Layout::find_or_add_kept_section.
4030 2009-02-28 Ian Lance Taylor <iant@google.com>
4032 * README: --gc-sections and map files are now supported. Document
4033 some build requirements.
4036 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
4037 relocatable link set the value of the section symbol to zero.
4038 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
4039 relocatable link don't include the section address in the local
4042 2009-02-27 Ian Lance Taylor <iant@google.com>
4045 * options.h (class Search_directory): Add is_system_directory.
4046 (class General_options): Declare is_in_system_directory.
4047 * options.cc (get_relative_sysroot): Make static.
4048 (get_default_sysroot): Make static.
4049 (General_optoins::is_in_system_directory): New function.
4050 * fileread.cc (Input_file::is_in_system_directory): New function.
4051 * fileread.h (class Input_file): Declare is_in_system_directory.
4052 * object.h (class Object): Add is_in_system_directory.
4053 (class Input_objects): Remove system_library_directory_ field.
4054 * object.cc (Input_objects::add_object): Don't set
4055 system_library_directory_.
4056 (input_objects::found_in_system_library_directory): Remove.
4057 * symtab.cc (Symbol_table::write_globals): Remove input_objects
4058 parameter. Change all callers.
4059 (Symbol_table::sized_write_globals): Likewise.
4060 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
4061 Call Object::is_in_system_directory.
4062 * symtab.h (class Symbol_table): Update declarations.
4065 * descriptors.h (Open_descriptor): Add is_on_stack field.
4066 * descriptors.cc (Descriptors::open): If the descriptor is on the
4067 top of the stack, remove it. Initialize is_on_stack field.
4068 (Descriptors::release): Only add pod to stack if it is not on the
4070 (Descriptors::close_some_descriptor): Clear stack_next and
4074 * output.cc (Output_section::find_starting_output_address): Rename
4075 from starting_output_address; add PADDR parameter; change return
4077 * output.h (class Output_section): Declare
4078 find_starting_output_address instead of starting_output_address.
4079 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
4080 section symbol for which we can't find a merge section.
4083 * symtab.cc (Symbol_table::add_from_object): If the visibility is
4084 hidden or internal, force the symbol to be local.
4085 * resolve.cc (Symbol::override_visibility): Define.
4086 (Symbol::override_base): Use override_visibility.
4087 (Symbol_table::resolve): Likewise.
4088 (Symbol::override_base_with_special): Likewise.
4089 (Symbol_table::override_with_special): If the visibility is hidden
4090 or internal, force the symbol to be local.
4091 * symtab.h (class Symbol): Add set_visibility and
4092 override_visibility.
4093 * testsuite/ver_test_1.sh: New file.
4094 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
4095 (check_DATA): Add ver_test_1.syms.
4096 (ver_test_1.syms): New target.
4097 * testsuite/Makefile.in: Rebuild.
4099 2009-02-25 Cary Coutant <ccoutant@google.com>
4101 * layout.cc (Layout::choose_output_section): Don't rename sections
4102 when using a linker script that has a SECTIONS clause.
4103 * Makefile.in: Regenerate.
4105 * testsuite/Makefile.am (script_test_5.sh): New test case.
4106 * testsuite/Makefile.in: Regenerate.
4107 * testsuite/script_test_5.cc: New file.
4108 * testsuite/script_test_5.sh: New file.
4109 * testsuite/script_test_5.t: New file.
4111 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
4113 * archive.cc (Archive::include_member): Update calls to add_symbols.
4114 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
4115 the Layout argument.
4116 * dynobj.h (do_add_symbols): Add the Layout argument.
4117 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
4119 * object.h (Object::add_symbols): Add the Layout argument.
4120 (Object::do_add_symbols): Add the Layout argument.
4121 (Sized_relobj::do_add_symbols): Add the Layout argument.
4122 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
4123 Unify the two versions.
4124 (Add_plugin_symbols): Remove.
4125 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
4126 (Sized_pluginobj::do_add_symbols): Unify the two versions.
4127 (Add_plugin_symbols): Remove.
4128 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
4129 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
4130 (Add_symbols::run): Make it work with Pulginobj.
4132 2009-02-06 Ian Lance Taylor <iant@google.com>
4134 * object.cc (Sized_relobj::do_layout): Make info message start
4135 with lower case letter.
4137 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
4139 * binary.cc: Fix file comment.
4141 * options.h (enum Incremental_disposition): Define.
4142 (class General_options): Add new options: --incremental,
4143 --incremental_changed, --incremental_unchanged,
4144 --incremental_unknown. Add incremental_disposition_ and
4145 implicit_incremental_ fields.
4146 (General_options::incremental_disposition): New function.
4147 (class Position_dependent_options): Add incremental_disposition
4149 (Position_dependent_options::copy_from_options): Set incremental
4151 * options.cc (General_options::parse_incremental_changed): New
4153 (General_options::parse_incremental_unchanged): New function.
4154 (General_options::parse_incremental_unknown): New function.
4155 (General_options::General_options): Initialize new fields
4156 incremental_disposition_ and implicit_incremental_.
4157 (General_options::finalize): Check for uasge of --incremental-*
4158 without --incremental.
4160 2009-02-06 Chris Demetriou <cgd@google.com>
4162 * gold.h (gold_undefined_symbol): Change to take only a Symbol
4163 pointer and to report location as the file name associated with
4165 (gold_undefined_symbol_at_location): New function to replace the
4166 old gold_undefined_symbol functionality.
4167 * target-reloc.h (relocate_section): Update to use
4168 gold_undefined_symbol_at_location.
4169 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
4170 Call gold_undefined_symbol function rather than gold_error.
4171 * errors.h (Errors::undefined_symbol): Take location as a
4172 string, rather than calculating it from a relocation.
4173 * errors.cc (Errors::fatal): Print "fatal error:" before the
4175 (Errors::error, Errors::error_at_location): Print "error: "
4176 before the formatted message.
4177 (Errors::undefined_symbol): Take location as a string, rather
4178 than calculating it from a relocation.
4179 (gold_undefined_symbol_at_location): New function akin to
4180 old gold_undefined_symbol, calculates location from relocation.
4181 (gold_undefined_symbol): Change to take only a Symbol pointer
4182 and to report location as the file name associated with the symbol.
4183 * testsuite/debug_msg.sh: Update for changed error messages.
4184 * testsuite/undef_symbol.sh: Likewise.
4186 2009-02-04 Duncan Sands <baldrick@free.fr>
4189 * reduced_debug_output.h
4190 (Output_reduced_debug_abbrev_section::failed): Use format for
4192 (Output_reduced_debug_info_section::faild): Likewise.
4194 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
4196 * script.cc (Lazy_demangler): New class.
4197 (Version_script_info::get_symbol_version_helper): Demangle a
4200 2009-01-29 Cary Coutant <ccoutant@google.com>
4202 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
4204 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
4206 2009-01-28 Ian Lance Taylor <iant@google.com>
4208 * version.cc (version_string): Bump to 1.9.
4210 * gold.h: Include <cstring> and <stdint.h>.
4211 * version.cc: Include <cstdio>.
4212 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
4214 * reduced_debug_output.cc (insert_into_vector): Rename from
4215 Insert_into_vector; change all callers. Use Swap_unaligned to
4216 avoid aliasing issue; remove union since it is unnecessary.
4218 2009-01-27 Sriraman Tallam <tmsriram@google.com>
4220 * Makefile.am (CCFILES): Add gc.cc.
4222 * Makefile.in: Regenerate.
4223 * gold.cc (Gc_runner): New class.
4224 (queue_initial_tasks): Call garbage collection related tasks
4225 when corresponding options are invoked.
4226 (queue_middle_gc_tasks): New function.
4227 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
4228 processed early before laying out sections during garbage collection.
4229 * gold.h (queue_middle_gc_tasks): New function.
4230 (is_prefix_of): Move from "layout.cc".
4231 * i386.cc (Target_i386::gc_process_relocs): New function.
4232 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
4233 * main.cc (main): Create object of class "Garbage_collection".
4234 * object.cc (Relobj::copy_symbols_data): New function.
4235 (Relobj::is_section_name_included): New function.
4236 (Sized_relobj::do_layout): Allow this function to be called twice
4237 during garbage collection and defer layout of section during the
4239 * object.h (Relobj::get_symbols_data): New function.
4240 (Relobj::is_section_name_included): New function.
4241 (Relobj::copy_symbols_data): New function.
4242 (Relobj::set_symbols_data): New function.
4243 (Relobj::get_relocs_data): New function.
4244 (Relobj::set_relocs_data): New function.
4245 (Relobj::is_output_section_offset_invalid): New pure virtual function.
4246 (Relobj::gc_process_relocs): New function.
4247 (Relobj::do_gc_process_relocs): New pure virtual function.
4248 (Relobj::sd_): New data member.
4249 (Sized_relobj::is_output_section_offset_invalid): New function.
4250 (Sized_relobj::do_gc_process_relocs): New function.
4251 * options.h (General_options::gc_sections): Modify to not be a no-op.
4252 (General_options::print_gc_sections): New option.
4253 * plugin.cc (Plugin_finish::run): Remove function call to
4254 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
4255 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
4256 * reloc.cc (Read_relocs::run): Add task to process relocs and
4257 determine unreferenced sections when doing garbage collection.
4258 (Gc_process_relocs): New class.
4259 (Sized_relobj::do_gc_process_relocs): New function.
4260 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
4261 sections that are garbage collected.
4262 * reloc.h (Gc_process_relocs): New class.
4263 * sparc.cc (Target_sparc::gc_process_relocs): New function.
4264 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
4265 symbols whose corresponding sections are garbage collected.
4266 (Symbol_table::Symbol_table): Add new parameter for the garbage
4268 (Symbol_table::gc_mark_undef_symbols): New function.
4269 (Symbol_table::gc_mark_symbol_for_shlib): New function.
4270 (Symbol_table::gc_mark_dyn_syms): New function.
4271 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
4273 (Symbol_table::add_from_object): Likewise.
4274 (Symbol_table::add_from_relobj): When building shared objects, do not
4275 treat externally visible symbols as garbage.
4276 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
4277 table information for static and relocatable links.
4278 * symtab.h (Symbol_table::set_gc): New function.
4279 (Symbol_table::gc): New function.
4280 (Symbol_table::gc_mark_undef_symbols): New function.
4281 (Symbol_table::gc_mark_symbol_for_shlib): New function.
4282 (Symbol_table::gc_mark_dyn_syms): New function.
4283 (Symbol_table::gc_): New data member.
4284 * target.h (Sized_target::gc_process_relocs): New pure virtual
4286 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
4287 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
4289 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
4291 * options.h (General_options::gc_sections): Define as a no-op for now.
4292 (General_options::no_keep_memory): Ditto.
4293 (General_options::Bshareable): Define.
4294 * options.cc (General_options::finalize): Honor -Bshareable.
4296 2009-01-20 Andreas Schwab <schwab@suse.de>
4298 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
4299 read the value in the contents, since we don't use it. Use the
4300 template endianness when writing.
4301 (Relocate::relocate): Use it for R_PPC_REL16_HA.
4303 2009-01-19 Andreas Schwab <schwab@suse.de>
4305 * configure.tgt (powerpc64-*): Fix targ_obj.
4307 2009-01-15 Ian Lance Taylor <iant@google.com>
4309 * object.cc (Sized_relobj::write_local_symbols): Don't write out
4310 local symbols when stripping all symbols.
4312 2009-01-14 Cary Coutant <ccoutant@google.com>
4314 * output.cc (Output_reloc): Add explicit instantiations.
4316 2009-01-14 Cary Coutant <ccoutant@google.com>
4318 * archive.cc (Archive::get_elf_object_for_member): Remove call
4319 to File_read::claim_for_plugin.
4320 * descriptors.cc (Descriptors::open): Remove reference to
4322 (Descriptors::claim_for_plugin): Remove.
4323 * descriptors.h (Descriptors::claim_for_plugin): Remove.
4324 (Descriptors::is_claimed): Remove.
4325 (claim_descriptor_for_plugin): Remove.
4326 * fileread.cc (File_read::claim_for_plugin): Remove.
4327 * fileread.h (File_read::claim_for_plugin): Remove.
4328 (File_read::descriptor): Reopen descriptor if necessary.
4329 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
4330 (Plugin_manager::all_symbols_read): Add task parameter. Change
4332 (Plugin_manager::get_input_file): New function.
4333 (Plugin_manager::release_input_file): New function.
4334 (Pluginobj::Pluginobj): Add filesize parameter and initialize
4335 corresponding data member.
4336 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
4337 and pass to base constructor. Change all callers.
4338 (get_input_file, release_input_file): New functions.
4339 (make_sized_plugin_object): Add filesize parameter. Change all callers.
4340 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
4341 (Plugin_manager::all_symbols_read): Add task parameter.
4342 (Plugin_manager::get_input_file): New function.
4343 (Plugin_manager::release_input_file): New function.
4344 (Plugin_manager::task_): New data member.
4345 (Pluginobj::Pluginobj): Add filesize parameter.
4346 (Pluginobj::filename): New function.
4347 (Pluginobj::descriptor): New function.
4348 (Pluginobj::filesize): New function.
4349 (Pluginobj::filesize_): New data member.
4350 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
4351 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
4352 File_read::claim_for_plugin; use Object::unlock to unlock the file.
4354 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
4355 with archive libraries.
4356 * testsuite/Makefile.in: Regenerate.
4357 * testsuite/plugin_test.c (struct sym_info): New type.
4358 (get_input_file, release_input_file): New static variables.
4359 (onload): Capture new transfer vector entries.
4360 (claim_file_hook): Stop reading at end of file according to filesize.
4361 Factor out parsing of readelf output into separate function.
4362 (all_symbols_read_hook): Exercise get_input_file and release_input_file
4363 APIs and get the source file name from the symbol table. Convert
4364 source file name to corresponding object file name. Print info
4365 message when adding new input files.
4366 (parse_readelf_line): New function.
4367 * testsuite/plugin_test_1.sh: Add checks for new info messages.
4368 * testsuite/plugin_test_2.sh: Likewise.
4369 * testsuite/plugin_test_3.sh: Likewise.
4370 * testsuite/plugin_test_4.sh: New test case.
4372 2009-01-07 Ian Lance Taylor <iant@google.com>
4374 * version.cc (version_string): Bump to 1.8.
4376 2008-12-23 Cary Coutant <ccoutant@google.com>
4378 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
4379 * plugin.cc (Plugin_manager::finish): Rename as
4380 layout_deferred_objects. Move cleanup to separate function.
4381 (Plugin_manager::cleanup): New function.
4382 (Plugin_finish::run): Call layout_deferred_objects and cleanup
4384 * plugin.h (Plugin_manager::finish): Rename as
4385 layout_deferred_objects.
4386 (Plugin_manager::cleanup): New function.
4387 (Plugin_manager::cleanup_done): New field.
4389 2008-12-23 Cary Coutant <ccoutant@google.com>
4391 * plugin.cc (is_visible_from_outside): New function.
4392 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
4393 so we don't return "IR only" status for exported symbols or -r links.
4395 * testsuite/Makefile.am (plugin_test_3): New test case.
4396 * testsuite/Makefile.in: Regenerate.
4397 * testsuite/plugin_test_3.sh: New file.
4399 2008-12-22 Cary Coutant <ccoutant@google.com>
4401 * object.cc (Sized_relobj::layout_section): New function.
4402 (Sized_relobj::do_layout): Defer layout of input sections until after
4403 plugin has provided replacement files.
4404 (Sized_relobj::do_layout_deferred_sections): New function.
4405 * object.h (Relobj::set_section_offset): Remove virtual keyword.
4406 (Relobj::layout_deferred_sections): New function.
4407 (Relobj::do_layout_deferred_sections): New function.
4408 (Sized_relobj::do_layout_deferred_sections): New function.
4409 (Sized_relobj::layout_section): New function.
4410 (Sized_relobj::Deferred_layout): New structure.
4411 (Sized_relobj::deferred_layout_): New field.
4412 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
4413 Change all callers. Layout deferred sections.
4414 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
4416 (Plugin_hook::run): Move code from do_plugin_hook inline.
4417 (Plugin_hook::do_plugin_hook): Remove.
4418 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
4419 (Plugin_manager::finish): Renamed, was cleanup.
4420 (Plugin_manager::should_defer_layout): New function.
4421 (Plugin_manager::add_deferred_layout_object): New function.
4422 (Plugin_manager::Deferred_layout_list): New type.
4423 (Plugin_manager::deferred_layout_objects_): New field.
4424 (Plugin_hook::do_plugin_hook): Remove.
4426 2008-12-17 Ian Lance Taylor <iant@google.com>
4428 * options.h (class General_options): Add --no case for
4431 2008-12-16 Cary Coutant <ccoutant@google.com>
4433 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
4435 (Plugin_manager::claim_file): Create plugin object even if
4436 plugin did not call the add_symbols callback.
4437 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
4438 asking for more symbols than were added.
4439 * testsuite/Makefile.am (plugin_test_1): Add test case with
4441 (empty.syms): New target.
4442 * testsuite/Makefile.in: Regenerate.
4443 * testsuite/plugin_test.c (claim_file_hook): Add new debug
4444 message. Don't call add_symbols if no globals.
4445 (all_symbols_read_hook): Don't provide replacement for empty
4448 2008-12-12 Ian Lance Taylor <iant@google.com>
4450 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
4451 r_type == 0 for a local symbol with r_sym == 0.
4452 (scan_relocatable_relocs): Pass r_sym to
4453 local_non_section_strategy.
4454 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
4457 * configure.ac: Update test for TLS descriptors: they are
4458 supported as of glibc 2.9.
4459 * configure: Rebuild.
4461 2008-12-11 Ian Lance Taylor <iant@google.com>
4464 * target-reloc.h (Default_scan_relocatable_relocs): For each
4465 function, map r_type == 0 to RELOC_DISCARD.
4467 2008-12-10 Cary Coutant <ccoutant@google.com>
4469 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
4470 object to override a kept COMDAT group from a plugin object.
4472 2008-12-09 Ian Lance Taylor <iant@google.com>
4475 * yyscript.y (file_cmd): Handle INPUT.
4477 * testsuite/initpri1.c: Change all declarations to be full
4478 prototypes by adding void, to avoid compiler warnings.
4480 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
4482 * options.cc (General_options::parse_plugin_opt): New.
4483 (General_options::add_plugin): The argument now is just the filename.
4484 (General_options::add_plugin_option): New.
4485 * options.h (plugin_opt): New.
4486 (add_plugin): Change argument name.
4487 (add_plugin_option): New.
4488 * plugin.cc (Plugin::load): Don't parse the plugin option.
4489 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
4490 (Plugin::add_option): New.
4491 (Plugin::args_): Change type.
4492 (Plugin::filename_): New.
4493 (Plugin_manager::add_plugin_option): New.
4494 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
4495 * testsuite/Makefile.in: Regenerate.
4497 2008-12-05 Cary Coutant <ccoutant@google.com>
4499 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
4500 Handle --strip-lto-sections option.
4501 * options.h (strip_lto_sections): New option.
4503 2008-12-01 Cary Coutant <ccoutant@google.com>
4505 * plugin.cc (ld_plugin_message): Change format parameter to const.
4506 Fix mismatch between new[] and delete.
4508 2008-11-14 Cary Coutant <ccoutant@google.com>
4510 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
4513 2008-11-05 Craig Silverstein <csilvers@google.com>
4515 * options.cc (General_options::parse_dynamic_list): New function.
4516 * options.h (General_options): New flags dynamic_list,
4517 dynamic_list_data, dynamic_list_cpp_new, and
4518 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
4519 (General_options::in_dynamic_list): New function.
4520 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
4521 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
4522 (Lex::can_continue_name): Likewise.
4524 (read_script_file): New parameter script_options.
4525 (read_dynamic_list): New function.
4526 (Script_options::define_dynamic_list): New function.
4527 (dynamic_list_keyword_parsecodes): New variable.
4528 (dynamic_list_keywords): New variable.
4529 * script.h (Script_options::define_dynamic_list): New function
4531 (read_dynamic_list): New function prototype.
4532 * symtab.cc (strprefix): New macro.
4533 (Symbol::should_add_dynsym_entry): Support dynamic_list,
4534 dynamic_list_data, dynamic_list_cpp_new, and
4535 dynamic_list_cpp_typeinfo.
4536 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
4537 (dynamic_list_expr): New rule.
4538 (dynamic_list_nodes): Likewise.
4539 (dynamic_list_node): Likewise.
4540 * testsuite/Makefile.am (dynamic_list): New test.
4541 * testsuite/Makefile.in: Regenerated.
4542 * testsuite/dynamic_list.t: New file.
4543 * testsuite/dynamic_list.sh: New file.
4545 2008-11-05 Craig Silverstein <csilvers@google.com>
4547 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
4548 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
4549 (t11_last): Likewise.
4550 * testsuite/ver_test_6.c (main): Likewise.
4552 2008-10-07 Cary Coutant <ccoutant@google.com>
4554 * options.c (General_options::finalize): Add check for -static and
4556 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
4559 2008-10-02 Cary Coutant <ccoutant@google.com>
4561 * plugin.cc (make_sized_plugin_object): Fix conditional
4562 compilation to work when not all targets are enabled.
4564 2008-09-29 Cary Coutant <ccoutant@google.com>
4566 * archive.cc (Archive::get_file_and_offset): Use filename instead
4567 of name to get library path.
4568 (Archive::include_member): Unlock external member of a thin archive.
4570 * testsuite/Makefile.am (TEST_AR): New variable.
4571 (thin_archive_test_1): New test.
4572 (thin_archive_test_2): New test.
4573 * testsuite/Makefile.in: Regenerate.
4574 * testsuite/thin_archive_main.cc: New file.
4575 * testsuite/thin_archive_test_1.cc: New file.
4576 * testsuite/thin_archive_test_2.cc: New file.
4577 * testsuite/thin_archive_test_3.cc: New file.
4578 * testsuite/thin_archive_test_4.cc: New file.
4580 2008-09-29 Cary Coutant <ccoutant@google.com>
4582 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
4583 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
4585 (Sized_relobj::do_finalize_local_symbols): Likewise.
4586 (Sized_relobj::map_to_kept_section): Likewise.
4587 * object.h (Sized_relobj::invalid_address): New constant.
4588 (Sized_relobj::do_output_section_offset): Check for invalid_address
4590 * output.cc (Output_reloc::local_section_offset): Use constant
4591 invalid_address instead of -1U.
4592 (Output_reloc::get_address): Likewise.
4593 (Output_section::output_address): Change -1U to -1ULL.
4594 * output.h (Output_reloc::invalid_address): New constant.
4595 * reloc.cc (Sized_relobj::write_sections): Use constant
4596 invalid_address instead of -1U.
4597 (Sized_relobj::relocate_sections): Likewise.
4598 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
4599 values for merge sections.
4600 * target-reloc.h (relocate_for_relocatable): Use constant
4601 invalid_address instead of -1U.
4603 2008-09-19 Cary Coutant <ccoutant@google.com>
4605 Add plugin functionality for link-time optimization (LTO).
4606 * configure.ac (plugins): Add --enable-plugins option.
4607 * configure: Regenerate.
4608 * config.in: Regenerate.
4609 * Makefile.am (LIBDL): New variable.
4610 (CCFILES): Add plugin.cc.
4611 (HFILES): Add plugin.h.
4612 (ldadd_var): Add LIBDL.
4613 * Makefile.in: Regenerate.
4615 * archive.cc: Include "plugin.h".
4616 (Archive::setup): Don't preread archive symbols when using a plugin.
4617 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
4618 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
4620 (Archive::include_member): Add symbols from plugin objects.
4621 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
4622 * descriptors.cc (Descriptors::open): Check for file descriptors
4623 abandoned by plugins.
4624 (Descriptors::claim_for_plugin): New function.
4625 * descriptors.h (Descriptors::claim_for_plugin): New function.
4626 (Open_descriptor::is_claimed): New field.
4627 (claim_descriptor_for_plugin): New function.
4628 * fileread.cc (File_read::claim_for_plugin): New function.
4629 * fileread.h (File_read::claim_for_plugin): New function.
4630 (File_read::descriptor): New function.
4631 * gold.cc: Include "plugin.h".
4632 (queue_initial_tasks): Add task to call plugin hooks for generating
4634 * main.cc: Include "plugin.h".
4635 (main): Load plugin libraries.
4636 * object.h (Pluginobj): Declare.
4637 (Object::pluginobj): New function.
4638 (Object::do_pluginobj): New function.
4639 (Object::set_target): New function.
4640 * options.cc: Include "plugin.h".
4641 (General_options::parse_plugin): New function.
4642 (General_options::General_options): Initialize plugins_ field.
4643 (General_options::add_plugin): New function.
4644 * options.h (Plugin_manager): Declare.
4645 (General_options): Add --plugin option.
4646 (General_options::has_plugins): New function.
4647 (General_options::plugins): New function.
4648 (General_options::add_plugin): New function.
4649 (General_options::plugins_): New field.
4650 * plugin.cc: New file.
4651 * plugin.h: New file.
4652 * readsyms.cc: Include "plugin.h".
4653 (Read_symbols::do_read_symbols): Check for archive before checking
4654 for ELF file. Call plugin hooks to claim files.
4655 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
4656 from a real object file; force override when processing replacement
4658 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
4659 (Symbol::init_base_object): Likewise.
4660 (Symbol::init_base_output_data): Likewise.
4661 (Symbol::init_base_output_segment): Likewise.
4662 (Symbol::init_base_constant): Likewise.
4663 (Symbol::init_base_undefined): Likewise.
4664 (Symbol::output_section): Assert that object is not a plugin.
4665 (Symbol_table::add_from_pluginobj): New function.
4666 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
4668 (Symbol_table::sized_write_globals): Likewise.
4669 (Symbol_table::add_from_pluginobj): Instantiate template.
4670 * symtab.h (Sized_pluginobj): Declare.
4671 (Symbol::in_real_elf): New function.
4672 (Symbol::set_in_real_elf): New function.
4673 (Symbol::in_real_elf_): New field.
4674 (Symbol_table::add_from_pluginobj): New function.
4676 * testsuite/Makefile.am (AM_CFLAGS): New variable.
4677 (LIBDL): New variable.
4679 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
4680 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
4681 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
4682 (MOSTLYCLEANFILES): Likewise.
4683 * testsuite/Makefile.in: Regenerate.
4684 * testsuite/plugin_test.c: New file.
4685 * testsuite/plugin_test_1.sh: New file.
4686 * testsuite/plugin_test_2.sh: New file.
4688 2008-09-16 Ian Lance Taylor <iant@google.com>
4690 * target-reloc.h (relocate_section): Check whether a symbol is
4691 defined by the ABI before reporting an undefined symbol error.
4692 * target.h (Target::is_defined_by_abi): Make parameter const.
4693 (Target::do_is_defined_by_abi): Likewise.
4694 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
4695 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
4696 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
4697 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
4698 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
4699 * testsuite/Makefile.in: Rebuild.
4701 * fileread.cc (make_view): Add casts to avoid warning.
4703 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
4705 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
4706 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
4708 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
4710 * options.h (General_options::output_is_executable): New.
4711 (General_options::output_is_pie): New.
4712 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
4713 for shared libraries.
4714 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
4716 2008-09-11 Chris Demetriou <cgd@google.com>
4718 * options.h (origin): New -z option.
4719 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
4720 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
4723 2008-09-05 Cary Coutant <ccoutant@google.com>
4725 * fileread.cc (File_read::make_view): Add check for attempt to map
4728 2008-09-05 Cary Coutant <ccoutant@google.com>
4730 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
4731 explicit instantiations.
4733 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
4736 * options.cc (General_options::finalize): Allow undefined symbols
4737 in shlibs if linking -shared.
4740 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
4741 symbols as not needing a dynsym entry.
4743 2008-08-20 Craig Silverstein <csilvers@google.com>
4745 * fileread.cc (File_read::open): Do not lock the file unless it
4746 was successfully opened.
4748 2008-08-14 Cary Coutant <ccoutant@google.com>
4750 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
4751 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
4752 * testsuite/tls_test.cc (struct int128): 128-bit struct
4753 for testing TLS relocs with non-zero addend.
4754 (v12): New TLS variable.
4756 (t_last): Add check for v12.
4757 * testsuite/tls_test.h (t12): New function.
4758 * testsuite/tls_test_main.cc (thread_routine): Call new test.
4760 2008-08-13 Ian Lance Taylor <iant@google.com>
4762 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
4763 set tls_segment_ or relro_segment_.
4764 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
4766 * output.h (Output_section::clear_is_relro): New function.
4767 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
4768 sections specially even when output_data_ is empty.
4769 (Output_segment::maximum_alignment): When first section is relro,
4770 only force alignment for PT_LOAD segments.
4771 * script.cc (script_data_segment_align): New function.
4772 (script_data_segment_relro_end): New function.
4773 * script-c.h (script_data_segment_align): Declare.
4774 (script_data_segment_relro_end): Declare.
4775 * script-sections.h (class Script_sections): Declare
4776 data_segment_align and data_segment_relro_end. Add fields
4777 segment_align_index_ and saw_relro_end_.
4778 * script-sections.cc (class Sections_element): Add set_is_relro
4779 virtual function. Add new bool* parameter to place_orphan_here.
4780 Add get_output_section virtual function.
4781 (class Output_section_definition): Add set_is_relro. Add new
4782 bool* parameter to place_orphan_here. Add get_output_section.
4783 Add is_relro_ field.
4784 (Output_section_definition::Output_section_definition): Initialize
4785 evaluated_address_, evaluated_load_address, evaluated_addralign_,
4786 and is_relro_ fields.
4787 (Output_section_definition::place_orphan_here): Add is_relro
4789 (Output_section_definition::set_section_addresses): Set relro for
4791 (Output_section_definition::alternate_constraint): Likewise.
4792 (class Orphan_output_section): Add new bool* parameter to
4793 place_orphan_here. Add get_output_section.
4794 (Orphan_output_section::place_orphan_here): Add is_relro
4796 (Script_sections::Script_sections): Initialize
4797 data_segment_align_index_ and saw_relro_end_.
4798 (Script_sections::data_segment_align): New function.
4799 (Script_sections::data_segment_relro_end): New function.
4800 (Script_sections::place_orphan): Set or clear is_relro.
4801 (Script_sections::set_section_addresses): Force alignment of first
4803 * yyscript.y (exp): Call script_data_segment_align and
4804 script_data_segment_relro_end.
4805 * testsuite/relro_script_test.t: New file.
4806 * testsuite/relro_test.cc (using_script): Declare.
4807 (t1, t2): Test using_script.
4808 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
4809 (relro_script_test_SOURCES): Define.
4810 (relro_script_test_DEPENDENCIES): Define.
4811 (relro_script_test_LDFLAGS): Define.
4812 (relro_script_test_LDADD): Define.
4813 (relro_script_test.so): New target.
4814 * testsuite/Makefile.in: Rebuild.
4816 2008-08-06 Cary Coutant <ccoutant@google.com>
4818 * archive.cc (Archive::total_archives, Archive::total_members)
4819 (Archive::total_members_loaded): New variables.
4820 (Archive::setup): Add parameter. Add option to preread
4822 (Archive::read_armap): Add counter.
4823 (Archive::get_file_and_offset): New function.
4824 (Archive::get_elf_object_for_member): New function.
4825 (Archive::read_all_symbols): New function.
4826 (Archive::read_symbols): New function.
4827 (Archive::add_symbols): Add counters.
4828 (Archive::include_all_members): Use armap to find members if it's
4830 (Archive::include_member): Skip reading symbols if already read.
4831 Factored code into Archive::get_file_and_offset and
4832 Archive::get_elf_object_for_member. Changed call to
4833 Mapfile::report_include_archive_member.
4834 (Archive::print_stats): New function.
4835 * archive.h: Declare Object and Read_symbols_data classes.
4836 (Archive::Archive): Add initializers for new members.
4837 (Archive::setup): Add parameter.
4838 (Archive::print_stats): New function.
4839 (Archive::total_archives, Archive::total_members)
4840 (Archive::total_members_loaded): New variables.
4841 (Archive::get_file_and_offset): New function.
4842 (Archive::get_elf_object_for_member): New function.
4843 (Archive::read_all_symbols): New function.
4844 (Archive::read_symbols): New function.
4845 (Archive::Archive_member): New class.
4846 (Archive::members_): New member.
4847 (Archive::num_members_): New member.
4848 * main.cc: Include archive.h.
4849 (main): Call Archive::print_stats.
4850 * mapfile.cc (Mapfile::report_include_archive_member): Delete
4851 archive parameter; member_name is now the fully-decorated name.
4852 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
4853 * options.h: (General_options): Add --preread-archive-symbols option.
4854 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
4857 2008-08-04 Ian Lance Taylor <iant@google.com>
4859 * symtab.h (Symbol::use_plt_offset): New function.
4860 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
4861 * powerpc.cc (Relocate::relocate): Likewise.
4862 * sparc.cc (Relocate::relocate): Likewise.
4863 * x86_64.cc (Relocate::relocate): Likewise.
4864 * testsuite/weak_plt.sh: New test.
4865 * testsuite/weak_plt_main.cc: New test.
4866 * testsuite/weak_plt_shared.cc: New test.
4867 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
4868 (check_PROGRAMS): Add weak_plt.
4869 (check_DATA): Add weak_plt_shared.so.
4870 (weak_plt_main_pic.o, weak_plt): New targets.
4871 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
4872 * testsuite/Makefile.in: Rebuild.
4874 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
4876 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
4877 * testsuite/Makefile.in: Rebuild.
4879 2008-08-04 Alan Modra <amodra@bigpond.net.au>
4881 * Makefile.am (POTFILES.in): Set LC_ALL=C.
4882 * Makefile.in: Regenerate.
4883 * po/POTFILES.in: Regenerate.
4885 2008-07-29 Ian Lance Taylor <iant@google.com>
4887 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
4888 symbols before other symbols.
4889 * testsuite/script_test_2.cc (test_addr): Declare.
4890 (test_addr_alias): Declare.
4891 (main): Check that test_addr and test_addr_alias have the right
4893 * testsuite/script_test_2.t: Define test_addr_alias and
4896 2008-07-24 Ian Lance Taylor <iant@google.com>
4899 * descriptors.cc: New file.
4900 * descriptors.h: New file.
4901 * gold-threads.h (class Hold_optional_lock): New class.
4902 * fileread.cc: Include "descriptors.h".
4903 (File_read::~File_read): Release descriptor rather than closing
4905 (File_read::open) [file]: Call open_descriptor rather than open.
4906 Set is_descriptor_opened_.
4907 (File_read::open) [memory]: Assert that descriptor is not open.
4908 (File_read::reopen_descriptor): New function.
4909 (File_read::release): Release descriptor.
4910 (File_read::do_read): Make non-const. Reopen descriptor.
4911 (File_read::read): Make non-const.
4912 (File_read::make_view): Reopen descriptor.
4913 (File_read::do_readv): Likewise.
4914 * fileread.h (class File_read): Add is_descriptor_opened_ field.
4915 Update declarations.
4916 * layout.cc: Include "descriptors.h".
4917 (Layout::create_build_id): Use open_descriptor rather than open.
4918 * output.cc: Include "descriptors.h".
4919 (Output_file::open): Use open_descriptor rather than open.
4920 * archive.cc (Archive::const_iterator): Change Archive to be
4922 (Archive::begin, Archive::end): Make non-const.
4923 (Archive::count_members): Likewise.
4924 * archive.h (class Archive): Update declarations.
4925 * object.h (Object::read): Make non-const.
4926 * Makefile.am (CCFILES): Add descriptors.cc.
4927 (HFILES): Add descriptors.h.
4928 * Makefile.in: Rebuild.
4931 * gold.h: Always include <clocale>. Add Solaris workarounds
4932 following code in binutils/sysdep.h.
4935 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
4936 this->eh_frame_hdr_ is NULL before using it.
4938 * dynobj.cc (Versions::Versions): Update comment.
4940 * dynobj.cc (Versions::Versions): If there is an soname, use it as
4941 the base version name.
4943 * stringpool.cc (Stringpool_template::add_with_length): Set key to
4944 array size plus one.
4945 (Stringpool_template::set_string_offsets): Subtract one from key
4946 before using it as an array index.
4947 (Stringpool_template::get_offset_with_length): Likewise.
4948 (Stringpool_template::write_to_buffer): Likewise.
4949 * stringpool.h (Stringpool_template::get_offset_from_key):
4952 2008-07-23 Ian Lance Taylor <iant@google.com>
4955 * object.h (Merged_symbol_value::value): Do our best to handle a
4959 * script.cc (Version_script_info::get_versions): Don't add empty
4960 version tag to return value.
4961 (Version_script_info::get_symbol_version_helper): Change return
4962 type to bool. Add pversion parameter. Change all callers.
4963 (script_register_vers_node): Don't require a non-NULL tag.
4964 * script.h (class Version_script_info): Update declarations.
4965 (Version_script_info::get_symbol_version): Change return type to
4966 bool. Add version parameter. Change all callers.
4967 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
4968 handling. Handle an empty version from a version script.
4969 (Symbol_table::define_special_symbol): Likewise.
4970 * testsuite/ver_test_10.script: New file.
4971 * testsuite/ver_test_10.sh: New file.
4972 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
4973 (check_DATA): Add ver_test_10.syms.
4974 (ver_test_10.syms, ver_test_10.so): New target.
4975 * testsuite/Makefile.in: Rebuild.
4977 2008-07-23 Simon Baldwin <simonb@google.com>
4979 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
4980 to zero for undefined symbols from dynamic libraries.
4982 2008-07-23 Ian Lance Taylor <iant@google.com>
4984 * symtab.cc (Symbol_table::resolve): Remove version parameter.
4986 * symtab.h (class Symbol_table): Update declaration.
4987 * testsuite/ver_test_9.cc: New file.
4988 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
4989 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
4990 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
4991 (ver_test_9.so, ver_test_9.o): New targets.
4992 * testsuite/Makefile.in: Rebuild.
4994 2008-07-22 Ian Lance Taylor <iant@google.com>
4996 * options.h (class General_options): Define --check-sections.
4997 * layout.cc (Layout::set_segment_offsets): Handle
5000 * options.h (class General_options): Define -n/--nmagic and
5002 * options.cc (General_options::finalize): For -n/--nmagic or
5003 -N/--omagic, set -static.
5004 * layout.cc (Layout::attach_allocated_section_to_segment): If
5005 -N/--omagic, don't put read-only and read-write sections in
5007 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
5008 finding a read-only segment.
5009 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
5010 don't set the minimum segment alignment to the common page size,
5011 and don't set the file offset to the address modulo the page size.
5012 * script-sections.cc (Script_sections::create_segments): If
5013 -n/--omagic, don't put read-only and read-write sections in
5016 * cref.cc: New file.
5018 * options.h (class General_options): Add --print-symbol-counts.
5019 * main.cc (main): Issue defined symbol report if requested.
5020 * archive.cc (Archive::interpret_header): Make into a const member
5022 (Archive::add_symbols): Call Input_objects::archive_start and
5024 (Archive::const_iterator): Define new class.
5025 (Archive::begin, Archive::end): New functions.
5026 (Archive::include_all_members): Rewrite to use iterator.
5027 (Archive::count_members): New function.
5028 * archive.h (class Archive): Update declarations.
5029 (Archive::filename): New function.
5030 * object.cc: Include "cref.h".
5031 (Sized_relobj::Sized_relobj): Initialize defined_count_.
5032 (Sized_relobj::do_get_global_symbol_counts): New function.
5033 (Input_objects::add_object): Add object to cross-referencer.
5034 (Input_objects::archive_start): New function.
5035 (Input_objects::archive_stop): New function.
5036 (Input_objects::print_symbol_counts): New function.
5037 * object.h: Declare Cref and Archive.
5038 (Object::get_global_symbol_counts): New function.
5039 (Object::do_get_global_symbol_counts): New pure virtual function.
5040 (class Sized_relobj): Add defined_count_ field. Update
5042 (class Input_objects): Add cref_ field. Update constructor.
5043 Update declarations.
5044 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
5046 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
5048 (Sized_dynobj::do_get_global_symbol_counts): New function.
5049 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
5050 defined_count_. Update declarations. Define Symbols typedef.
5051 * symtab.cc (Symbol_table::add_from_relobj): Add defined
5052 parameter. Change all callers.
5053 (Symbol_table::add_from_dynobj): Add sympointers and defined
5054 parameters. Change all callers.
5055 * symtab.h (class Symbol_table): Update declarations.
5056 * Makefile.am (CCFILES): Add cref.cc.
5057 (HFILES): Add cref.h.
5058 * Makefile.in: Rebuild.
5060 2008-07-22 Simon Baldwin <simonb@google.com>
5062 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
5063 to zero when writing undefined symbols.
5065 2008-07-22 Ian Lance Taylor <iant@google.com>
5067 * output.cc (Output_section::add_input_section): Don't try to
5068 merge empty merge sections.
5070 2008-07-21 Craig Silverstein <csilvers@google.com>
5072 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
5073 Include symbol version in error message.
5075 2008-07-20 Chris Demetriou <cgd@google.com>
5077 * configure.ac (gold_cv_c_random_seed): New configured variable.
5078 (RANDOM_SEED_CFLAGS): New substituted variable.
5079 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
5080 * configure: Rebuild.
5081 * Makefile.in: Likewise.
5082 * testsuite/Makefile.in: Likewise.
5084 2008-07-18 Ian Lance Taylor <iant@google.com>
5086 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
5087 where we see NAME/NULL and NAME/VERSION as separate symbols.
5088 * testsuite/ver_test_main.cc (main): Call t4.
5089 (t4, t4_2a): Define.
5090 * testsuite/ver_test_2.cc (t4_2): Define.
5091 * testsuite/ver_test_2.script: Put t4_2a in VER2.
5092 * testsuite/ver_test_4.cc (t4_2a): Define.
5093 * testsuite/ver_test_4.script: Put t4_2a in VER2.
5094 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
5096 2008-07-17 Ian Lance Taylor <iant@google.com>
5098 * dynobj.cc (Versions::add_def): If we give an error about a
5099 missing version, go ahead and create the version anyhow.
5101 2008-07-10 Ian Lance Taylor <iant@google.com>
5103 Handle output sections with more than 0x7fffffff bytes.
5104 * object.h (class Relobj): Change map_to_output_ to
5105 output_sections_, and just keep a section pointer. Change all
5106 uses. Move comdat group support to Sized_relobj.
5107 (Relobj::is_section_specially_mapped): Remove.
5108 (Relobj::output_section): Remove poff parameter. Change all
5110 (Relobj::output_section_offset): New function.
5111 (Relobj::set_section_offset): Rewrite.
5112 (Relobj::map_to_output): Remove.
5113 (Relobj::output_sections): New function.
5114 (Relobj::do_output_section_offset): New pure virtual function.
5115 (Relobj::do_set_section_offset): Likewise.
5116 (class Sized_relobj): Add section_offsets_ field. Add comdat
5117 group support from Relobj. Update declarations.
5118 (Sized_relobj::get_output_section_offset): New function.
5119 (Sized_relobj::do_output_section_offset): New function.
5120 (Sized_relobj::do_set_section_offset): New function.
5121 * object.cc (Relobj::output_section_address): Remove.
5122 (Sized_relobj::Sized_relobj): Initialize new fields.
5123 (Sized_relobj::include_section_group): Cast find_kept_object to
5125 (Sized_relobj::include_linkonce_section): Likewise.
5126 (Sized_relobj::do_layout): Use separate arrays for output section
5128 (Sized_relobj::do_count_local_symbols): Change map_to_output to
5130 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
5131 output_sections and section_offsets.
5132 (Sized_relobj::write_local_symbols): Likewise.
5133 (map_to_kept_section): Compute output address directly.
5134 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
5135 output_sections and section_offsets.
5136 (Sized_relobj::write_sections): Likewise.
5137 (Sized_relobj::relocate_sections): Likewise.
5138 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
5139 * output.h (class Output_reloc): Update declarations. Change
5140 u2_.relobj to Sized_relobj*.
5141 (class Output_data_reloc): Change add functions to use
5143 * output.cc (Output_reloc::Output_reloc): Change relobj to
5145 (Output_reloc::local_section_offset): Change return type to
5146 Elf_Addr. Use get_output_section_offset.
5147 (Output_reloc::get_address): Likewise.
5148 (Output_section::is_input_address_mapped): Don't call
5149 is_section_specially_mapped.
5150 (Output_section::output_offset): Likewise.
5151 (Output_section::output_address): Likewise.
5152 (Output_section::starting_output_address): Likewise.
5153 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
5154 parameter to Sized_relobj*.
5155 (Copy_relocs::need_copy_reloc): Likewise.
5156 (Copy_relocs::save): Likewise.
5157 * copy-relocs.h (class Copy_relocs): Update declarations.
5158 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
5159 Sized_relobj*. Change relobj_ field to Sized_relobj*.
5160 * target-reloc.h (relocate_for_relocatable): Change
5161 offset_in_output_section type to Elf_Addr. Change code that uses
5163 * layout.cc (Layout::layout): Always set *off.
5164 * mapfile.cc (Mapfile::print_input_section): Use
5165 output_section_offset.
5166 * i386.cc (Target_i386::copy_reloc): Change object parameter to
5168 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
5169 * sparc.cc (Target_sparc::copy_reloc): Likewise.
5170 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
5172 2008-07-03 Ian Lance Taylor <iant@google.com>
5174 * layout.cc (Layout::include_section): Do not discard unrecognized
5175 SHT_STRTAB sections.
5177 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
5179 * script.cc (Lex::can_continue_name): Make '?' allowable in
5180 version-script names.
5181 * testsuite/version_script.map: Change glob pattern to use '?'
5183 2008-06-30 Manish Singh <yosh@gimp.org>
5186 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
5189 2008-06-30 Ian Lance Taylor <iant@google.com>
5193 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
5194 versions]: Don't try to read the value in the contents, since we
5195 don't use it. Use the template endianness when writing.
5197 2008-06-25 Cary Coutant <ccoutant@google.com>
5199 * fileread.cc (File_read::make_view): Assert on zero-length view.
5200 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
5201 symbol table when there are no symbols to read.
5203 2008-06-23 Craig Silverstein <csilvers@google.com>
5205 * version.cc (version_string): Bump to 1.7
5207 2008-06-18 Craig Silverstein <csilvers@google.com>
5209 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
5210 constant 0xFFFF to type Valtype.
5211 (Powerpc_relocate_functions::rel16_ha): Likewise.
5213 2008-06-17 Ian Lance Taylor <iant@google.com>
5215 * output.h (Output_section::Input_section): Initialize p2align_ to
5216 zero for Output_section_data constructors.
5217 (Output_section::Input_section::addralign): If not an input
5218 section, return the alignment of the Output_section_data.
5219 * testsuite/copy_test.cc: New file.
5220 * testsuite/copy_test_1.cc: New file.
5221 * testsuite/copy_test_2.cc: New file.
5222 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
5223 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
5224 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
5225 (copy_test_1_pic.o, copy_test_1.so): New targets.
5226 (copy_test_2_pic.o, copy_test_2.so): New targets.
5227 * testsuite/Makefile.in: Rebuild.
5229 * script-sections.cc (Script_sections::place_orphan): Initialize
5230 local variable exact.
5232 2008-06-13 David Edelsohn <edelsohn@gnu.org>
5234 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
5236 2008-06-12 David Edelsohn <edelsohn@gnu.org>
5237 David S. Miller <davem@davemloft.net>
5239 * powerpc.cc: New file.
5240 * Makefile.am (TARGETSOURCES): Add powerpc.cc
5241 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
5242 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
5243 * Makefile.in: Rebuild.
5245 2008-06-09 Ian Lance Taylor <iant@google.com>
5247 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
5249 (throwing, orig_terminate): New static variables.
5250 (terminate_handler): New static function.
5251 (t2): Set terminate handler.
5253 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
5256 * binary.cc (Binary_to_elf::sized_convert): Fix .data
5259 2008-05-30 Cary Coutant <ccoutant@google.com>
5261 * archive.cc (Archive::include_all_members) Correct to step
5262 over symbol table and extended name table in thin archives.
5264 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
5267 * target-reloc.h (relocate_for_relocatable): Fix new_offset
5270 2008-05-28 Caleb Howe <cshowe@google.com>
5272 * reduced_debug_output.cc: New file.
5273 * reduced_debug_output.h: New file.
5274 * options.h (class General_options): Add --strip-debug-non-line.
5275 * options.cc (General_options::finalize): Add strip_debug_non_line
5276 to the strip heirarchy.
5277 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
5279 * layout.cc: Include "reduced_debug_output.h".
5280 (Layout::Layout): Initialize new fields.
5281 (line_only_debug_sections): New static array.
5282 (is_lines_only_debug_sections): New static inline function.
5283 (Layout::include_section): Handle --strip-debug-non-line.
5284 (Layout::make_output_section): If --strip-debug-non-line, build
5285 new output sections for .debug_abbrev and .debug_info.
5286 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
5287 gold. Warn about possible overflow.
5288 (read_signed_LEB_128): Likewise.
5289 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
5290 (read_signed_LEB_128): Declare.
5291 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
5292 (HFILES): Add reduced_debug_output.h.
5293 * Makefile.in: Rebuild.
5295 2008-05-21 Ian Lance Taylor <iant@google.com>
5297 * mapfile.cc: New file.
5298 * mapfile.h: New file.
5299 * options.h (class General_options): Add -M/--print-map and -Map.
5300 * options.cc (General_options::finalize): Make -M equivalent to
5302 * main.cc: Include <cstdio> and "mapfile.h".
5303 (main): Open mapfile if requested.
5304 * gold.cc (class Middle_runner): Add mapfile_ field. Update
5305 constructor. Change caller.
5306 (queue_initial_tasks): Add mapfile parameter. Change caller.
5307 (queue_middle_tasks): Likewise.
5308 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
5310 * archive.cc: Include "mapfile.h".
5311 (Archive::add_symbols): Add mapfile parameter. Change all
5312 callers. Pass mapfile, symbol, and reason to include_member.
5313 (Archive::include_all_members): Add mapfile parameter. Change all
5315 (Archive::include_member): Add mapfile, sym, and why parameters.
5316 Change all callers. Report inclusion to map file.
5317 * archive.h: Include "fileread.h".
5318 (class Archive): Update declarations.
5319 (Archive::file): New const method.
5320 (class Add_archive_symbols): Add mapfile_ field. Update
5321 constructor. Change all callers.
5322 * readsyms.h (class Read_symbols): Likewise.
5323 (class Finish_group): Likewise.
5324 (class Read_script): Likewise.
5325 * common.cc: Include "mapfile.h".
5326 (Symbol_table::allocate_commons): Add mapfile parameter. Change
5328 (Symbol_table::do_allocate_commons): Likewise.
5329 (Symbol_table::do_allocate_commons_list): Likewise. Report common
5330 symbol allocation to mapfile.
5331 * common.h (class Allocate_commons_task): Add mapfile_ field.
5332 Update constructor. Change all callers.
5333 * symtab.h (class Symbol_table): Update declarations.
5334 * layout.cc: Include "mapfile.h".
5335 (Layout_task_runner::run): Print information to mapfile.
5336 (Layout::create_gold_note): Change Output_data_fixed_space to
5337 Output_data_zero_fill.
5338 (Layout::create_build_id): Likewise.
5339 (Layout::print_to_mapfile): New function.
5340 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
5341 constructor. Change caller.
5342 (class Layout): Declare print_to_mapfile.
5343 * output.cc (Output_section::Input_section::print_to_mapfile): New
5345 (Output_section::add_input_section): If producing a map, always
5346 add to input_sections_ list.
5347 (Output_section::do_print_to_mapfile): New function.
5348 (Output_segment::print_sections_to_mapfile): New function.
5349 (Output_segment::print_section_list_to_mapfile): New function.
5350 * output.h: Include "mapfile.h".
5351 (Output_data::print_to_mapfile): New function.
5352 (Output_data::do_print_to_mapfile): New virtual function.
5353 (Output_segment_headers::do_print_to_mapfile): New function.
5354 (Output_file_header::do_print_to_mapfile): New function.
5355 (Output_data_const::do_print_to_mapfile): New function.
5356 (class Output_data_const_buffer): Add map_name_ field. Update
5357 constructor. Change all callers. Add do_print_to_mapfile
5359 (class Output_data_fixed_space): Likewise.
5360 (class Output_data_space): Likewise.
5361 (class Output_data_zero_fill): New class.
5362 (Output_data_strtab::do_print_to_mapfile): New function.
5363 (Output_data_reloc_base::do_print_to_mapfile): New function.
5364 (Output_relocatable_relocs::do_print_to_mapfile): New function.
5365 (Output_data_group::do_print_to_mapfile): New function.
5366 (Output_data_got::do_print_to_mapfile): New function.
5367 (Output_data_dynamic::do_print_to_mapfile): New function.
5368 (Output_symtab_xindex::do_print_to_mapfile): New function.
5369 (class Output_section): Declare do_print_to_mapflie. Declare
5370 print_to_mapfile in Input_section.
5371 (class Output_segment): Declare new functions.
5372 * object.h (Sized_relobj::symbol_count): New function.
5373 * script-sections.cc
5374 (Output_section_element_dot_assignment::set_section_addresses):
5375 Change Output_data_fixed_space to Output_data_zero_fill.
5376 (Output_data_expression::do_print_to_mapfile): New function.
5377 * script.cc (read_input_script): Add mapfile parameter. Change
5379 * script.h (read_input_script): Update declaration.
5380 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
5381 (Eh_frame::do_print_to_mapfile): New function.
5382 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
5383 (Output_merge_string::do_print_to_mapfile): New function.
5384 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
5386 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
5388 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
5390 * Makefile.am (CCFILES): Add mapfile.cc.
5391 (HFILES): Add mapfile.h.
5392 * Makefile.in: Rebuild.
5394 2008-05-19 Ian Lance Taylor <iant@google.com>
5396 * options.h (class General_options): Add -z relro.
5397 * layout.cc (Layout::Layout): Initialize relro_segment_.
5398 (Layout::add_output_section_data): Return the output section.
5399 (Layout::make_output_section): Rcognize relro sections and mark
5401 (Layout::attach_allocated_section_to_segment): Put relro sections
5402 in a PT_GNU_RELRO segment.
5403 (Layout::create_initial_dynamic_sections): Mark the .dynamic
5405 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
5407 (Layout::linkonce_mapping): Map d.rel.ro.local to
5409 (Layout::output_section_name): Us .data.rel.ro.local for any
5410 section which begins with that.
5411 * layout.h (class Layout): Update add_output_section_data
5412 declaration. Add relro_segment_ field.
5413 * output.cc (Output_section::Output_section): Initialize is_relro_
5414 and is_relro_local_ fields.
5415 (Output_segment::add_output_section): Group relro sections.
5416 (Output_segment::is_first_section_relro): New function.
5417 (Output_segment::maximum_alignment): If there is a relro section,
5418 align the segment to the common page size.
5419 (Output_segment::set_section_addresses): Track whether we are
5420 looking at relro sections. If the last section is a relro
5421 section, align to the common page size.
5422 (Output_segment::set_section_list_addresses): Add in_relro
5423 parameter. Change all callers. Align to the page size when
5424 moving from relro to non-relro section.
5425 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
5427 * output.h (class Output_section): Add is_relro_ and
5428 is_relro_local_ fields.
5429 (Output_section::is_relro): New function.
5430 (Output_section::set_is_relro): New function.
5431 (Output_section::is_relro_local): New function.
5432 (Output_section::set_is_relro_local): New function.
5433 (class Output_segment): Update declarations.
5434 * i386.cc (Target_i386::got_section): Mark .got section as relro.
5435 * sparc.cc (Target_sparc::got_section): Likewise.
5436 * x86_64.cc (Target_x86_64::got_section): Likewise.
5437 * testsuite/relro_test_main.cc: New file.
5438 * testsuite/relro_test.cc: New file.
5439 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
5440 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
5441 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
5442 (relro_test.so, relro_test_pic.o): New targets.
5443 * testsuite/Makefile.in: Rebuild.
5445 2008-05-16 Ian Lance Taylor <iant@google.com>
5447 * output.cc (Output_segment::add_output_section): Remove front
5449 * output.h (class Output_segment): Remove
5450 add_initial_output_section and overloaded add_output_section.
5451 Update declaration of remaining add_output_section.
5452 * layout.cc (Layout::create_interp): Call add_output_section
5453 rather than add_initial_output_section.
5454 (Layout::finish_dynamic_section): Likewise.
5456 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
5457 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
5458 know the dynamic type.
5459 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
5460 field. Initialize it in constructor.
5461 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
5462 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
5463 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
5466 * output.cc (Output_reloc::get_address): Change return type to
5468 * output.h (class Output_reloc): Update get_address declaration.
5469 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
5470 for section addresses.
5472 2008-05-09 Ian Lance Taylor <iant@google.com>
5475 * gold.cc (gold_nomem): Use return value of write.
5477 2008-05-08 Ian Lance Taylor <iant@google.com>
5479 * symtab.c (Symbol::init_base_output_data): Add version
5480 parameter. Change all callers.
5481 (Symbol::init_base_output_segment): Likewise.
5482 (Symbol::init_base_constant): Likewise.
5483 (Symbol::init_base_undefined): Likewise.
5484 (Sized_symbol::init_output_data): Likewise.
5485 (Sized_symbol::init_output_segment): Likewise.
5486 (Sized_symbol::init_constant): Likewise.
5487 (Sized_symbol::init_undefined): Likewise.
5488 (Symbol_table::do_define_in_output_data): If the new symbol has a
5489 version, mark it as the default.
5490 (Symbol_table::do_define_in_output_segment): Likewise.
5491 (Symbol_table::do_define_as_constant): Likewise.
5492 * symtab.h (class Symbol): Update declarations.
5493 (class Sized_symbol): Likewise.
5494 * resolve.cc (Symbol::override_version): New function.
5495 (Symbol::override_base): Call override_version.
5496 (Symbol::override_base_with_special): Likewise.
5497 * testsuite/ver_script_8.script: New file.
5498 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
5499 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
5500 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
5501 (ver_test_8_1.so, ver_test_8_2.so): New targets.
5503 2008-05-06 Ian Lance Taylor <iant@google.com>
5506 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
5508 (class General_options): Remove existing --undefined, and add
5509 --no-undefined instead. Add new --undefined as synonym for -u.
5510 * archive.cc (Archive::add_symbols): Check whether symbol was
5512 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
5513 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
5514 all uses. Add IS_UNDEFINED. Update declarations to split
5515 different versions of init_base. Declare init_base_undefined.
5516 (Symbol::is_defined): Handle IS_UNDEFINED.
5517 (Symbol::is_undefined): Likewise.
5518 (Symbol::is_weak_undefined): Call is_undefined.
5519 (Symbol::is_absolute): Handle IS_CONSTANT.
5520 (class Sized_symbol): Update declarations to split different
5521 versions of init. Declare init_undefined.
5522 (class Symbol_table): Declare new functions.
5523 * symtab.cc (Symbol::init_base_object): Rename from init_base.
5525 (Symbol::init_base_output_data): Likewise.
5526 (Symbol::init_base_output_segment): Likewise.
5527 (Symbol::init_base_constant): Likewise.
5528 (Symbol::init_base_undefined): New function.
5529 (Sized_symbol::init_object): Rename from init. Change all
5531 (Sized_symbol::init_output_data): Likewise.
5532 (Sized_symbol::init_output_segment): Likewise.
5533 (Sized_symbol::init_constant): Likewise.
5534 (Sized_symbol::init_undefined): New function.
5535 (Symbol_table::add_undefined_symbols_from_command_line): New
5537 (Symbol_table::do_add_undefined_symbols_from_command_line): New
5539 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
5540 (Symbol::output_section): Likewise.
5541 (Symbol::set_output_section): Likewise.
5542 (Symbol_table::sized_finalize_symbol): Likewise.
5543 (Symbol_table::sized_write_globals): Likewise.
5544 * resolve.cc (Symbol_table::should_override): Likewise.
5545 (Symbol::override_base_with_special): Likewise.
5547 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
5548 symbol, change it to have default visibility.
5549 * testsuite/protected_1.cc: New file.
5550 * testsuite/protected_2.cc: New file.
5551 * testsuite/protected_3.cc: New file.
5552 * testsuite/protected_main_1.cc: New file.
5553 * testsuite/protected_main_2.cc: New file.
5554 * testsuite/protected_main_3.cc: New file.
5555 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
5556 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
5557 (protected_1_LDFLAGS, protected_1_LDADD): Define.
5558 (protected_1.so): New target.
5559 (protected_1_pic.o, protected_2_pic.o): New targets.
5560 (protected_3_pic.o): New target.
5561 (check_PROGRAMS): Add protected_2.
5562 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
5563 (protected_2_LDFLAGS, protected_2_LDADD): Define.
5564 * testsuite/Makefile.in: Rebuild.
5566 * options.h (DEFINE_var): Add set_user_set_##varname__.
5567 (DEFINE_bool_alias): New macro.
5568 (class General_options): Define -Bstatic using DEFINE_bool_alias
5569 rather than DEFINE_special. Add --undefined as an alias for -z
5571 * options.cc (General_options::parse_Bstatic): Remove.
5573 * options.h (class General_options): Add --fatal-warnings.
5574 * main.cc (main): Implement --fatal-warnings.
5575 * errors.h (Errors::warning_count): New function.
5577 * options.h (class General_options): Add -Bsymbolic-functions.
5578 * symtab.h (Symbol::is_preemptible): Check for
5579 -Bsymbolic-functions.
5581 2008-05-05 Ian Lance Taylor <iant@google.com>
5583 * options.h (DEFINE_bool): For DASH_Z, create the negative option
5584 as noVARNAME rather than no-VARNAME.
5585 (class General_options): Add option -z combreloc.
5586 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
5588 (Output_reloc::sort_before) [SHT_REL]: New function.
5589 (Output_reloc::sort_before) [SHT_RELA]: New function.
5590 (class Output_data_reloc_base): Add sort_relocs_ field. Define
5591 Sort_relocs_comparison.
5592 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
5593 parameter. Change all callers.
5594 (Output_data_reloc::Output_data_reloc) [both versions]: Add
5595 sort_relocs parameter. Change all callers.
5596 * output.cc (Output_reloc::get_address): New function, broken out
5598 (Output_reloc::write_rel): Call it.
5599 (Output_reloc::compare): New function.
5600 (Output_data_reloc_base::do_write): Optionally sort relocs.
5602 * configure.ac: If targ_extra_obj is set, link it in.
5603 * configure.tgt: Initialize all variables.
5604 (x86_64*): Set targ_extra_obj and targ_extra_size.
5605 * configure: Rebuild.
5607 * object.cc (Sized_relobj::include_section_group): Adjust section
5608 indexes read from group data. Build vector to pass to
5610 * layout.cc (Layout::layout_group): Add flags and shndxes
5611 parameters. Remove contents parameter. Change caller. Update
5612 explicit instantiations.
5613 * layout.h (class Layout): Update layout_group declaration.
5614 * output.cc (Output_data_group::Output_data_group): Add flags and
5615 input_shndxes parameters. Remove contents parameter. Change
5617 (Output_data_group::do_write): Change input_sections_ to
5619 * output.h (class Output_data_group): Update constructor
5620 declaration. Rename input_sections_ to input_shndxes_.
5621 * testsuite/many_sections_test.cc: Add template.
5623 2008-04-30 Cary Coutant <ccoutant@google.com>
5625 * target-reloc.h (relocate_section): Fix dead-pointer bug.
5627 * layout.cc (Layout::include_section): Refactored check for debug
5629 (Layout::add_comdat): Add new parameters. Change type
5630 of signature parameter. Add object and shndx to signatures table.
5631 (Layout::find_kept_object): New function.
5632 * layout.h: Include <cstring>.
5633 (Layout::is_debug_info_section): New function.
5634 (Layout::add_comdat): Add new parameters.
5635 (Layout::find_kept_object): New function.
5636 (Layout::Kept_section): New struct.
5637 (Layout::Signatures): Change type of map range.
5638 * object.cc (Relobj::output_section_address): New function.
5639 (Sized_relobj::include_section_group): Add new parameters. Change
5640 calls to Layout::add_comdat. Change to build table of kept comdat
5641 groups and table mapping discarded sections to kept sections.
5642 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
5643 (Sized_relobj::do_layout): Change calls to include_section_group and
5644 include_linkonce_section.
5645 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
5646 value to zero when section is discarded.
5647 (Sized_relobj::map_to_kept_section): New function.
5648 * object.h (Relobj::output_section_address): New function.
5649 (Relobj::Comdat_group): New type.
5650 (Relobj::find_comdat_group): New function.
5651 (Relobj::Comdat_group_table): New type.
5652 (Relobj::Kept_comdat_section): New type.
5653 (Relobj::Kept_comdat_section_table): New type.
5654 (Relobj::add_comdat_group): New function.
5655 (Relobj::set_kept_comdat_section): New function.
5656 (Relobj::get_kept_comdat_section): New function.
5657 (Relobj::comdat_groups_): New field.
5658 (Relobj::kept_comdat_sections_): New field.
5659 (Symbol_value::input_value): Update comment.
5660 (Sized_relobj::map_to_kept_section) New function.
5661 (Sized_relobj::include_linkonce_section): Add new parameter.
5662 * target-reloc.h (Comdat_behavior): New type.
5663 (get_comdat_behavior): New function.
5664 (relocate_section): Add code to map a discarded section to the
5665 corresponding kept section when applying a relocation.
5667 2008-04-30 Craig Silverstein <csilvers@google.com>
5669 * dwarf_reader.cc (next_generation_count): New static var.
5670 (Addr2line_cache_entry): New struct.
5671 (addr2line_cache): New static var.
5672 (Dwarf_line_info::one_addr2line): Added caching.
5673 (Dwarf_line_info::clear_addr2line_cache): New function.
5674 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
5675 cache-size parameter.
5676 (Dwarf_line_info::one_addr2line_cache): New function.
5677 * symtab.cc (Symbol_table::detect_odr_violations): Pass
5678 new cache-size argument to one_addr2line(), and clear cache.
5680 2008-04-28 Cary Coutant <ccoutant@google.com>
5682 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
5683 R_386_PC8 relocations.
5685 2008-04-23 Ian Lance Taylor <iant@google.com>
5687 * object.cc (Sized_relobj::include_section_group): Check for
5688 invalid section group.
5690 * object.cc (make_elf_object): Correct test for 64-bit ELF file
5693 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
5694 than read for file header.
5695 * archive.cc (Archive::include_member): Likewise.
5697 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
5699 * aclocal.m4: Regenerate.
5700 * configure: Regenerate.
5702 2008-04-19 Ian Lance Taylor <iant@google.com>
5704 * version.cc (version_string): Bump to 1.6.
5706 * testsuite/Makefile.am (many_sections_r_test): New target.
5707 (many_sections_r_test_SOURCES): Remove.
5708 (many_sections_r_test_DEPENDENCIES): Remove.
5709 (many_sections_r_test_LDFLAGS): Remove.
5710 (many_sections_r_test_LDADD): Remove.
5712 * object.cc (Sized_relobj::do_add_symbols): Always pass
5713 local_symbol_count_ to add_from_relobj.
5715 * testsuite/Makefile.am (many_sections_check.h): Only check one in
5716 every thousand variables.
5717 * testsuite/Makefile.in: Rebuild.
5719 * object.cc (Xindex::initialize_symtab_xindex): New function.
5720 (Xindex::read_symtab_xindex): New function.
5721 (Xindex::sym_xindex_to_shndx): New function.
5722 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
5724 (Sized_relobj::do_initialize_xindex): New function.
5725 (Sized_relobj::do_read_symbols): Adjust section links.
5726 (Sized_relobj::symbol_section_and_value): Add is_ordinary
5727 parameter. Change all callers.
5728 (Sized_relobj::include_section_group): Adjust section links and
5729 symbol section indexes.
5730 (Sized_relobj::do_layout): Adjust section links.
5731 (Sized_relobj::do_count_local_symbols): Adjust section links and
5732 symbol section indexes.
5733 (Sized_relobj::do_finalize_local_symbols): Distinguish between
5734 ordinary and special symbols.
5735 (Sized_relobj::write_local_symbols): Add symtab_xindex and
5736 dynsym_xindex parameters. Change all callers. Adjust section
5737 links. Use SHN_XINDEX when needed.
5738 (Sized_relobj::get_symbol_location_info): Adjust section links.
5739 Don't get fooled by special symbols.
5740 * object.h (class Xindex): Define.
5741 (class Object): Add xindex_ parameter. Declare virtual functoin
5742 do_initialize_xindex.
5743 (Object::adjust_sym_shndx): New function.
5744 (Object::set_xindex): New protected function.
5745 (class Symbol_value): Add is_ordinary_shndx_ field.
5746 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
5747 (Symbol_value::value): Assert ordinary section.
5748 (Symbol_value::initialize_input_to_output_map): Likewise.
5749 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
5751 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
5753 (class Sized_relobj): Update declarations.
5754 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
5755 parameter. Change all callers.
5756 (Sized_relobj::adjust_shndx): New function.
5757 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
5759 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
5760 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
5761 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
5762 (Sized_dynobj::read_dynsym_section): Adjust section links.
5763 (Sized_dynobj::read_dynamic): Likewise.
5764 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
5766 (Sized_dynobj::do_initialize_xindex): New function.
5767 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
5768 do_initialize_xindex.
5769 (Sized_dynobj::adjust_shndx): New function.
5770 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
5771 dynsym_xindex_ fields.
5772 (Layout::finalize): Add a call to set_section_indexes before
5773 creating the symtab sections.
5774 (Layout::set_section_indexes): Don't do anything if the section
5775 already has a section index.
5776 (Layout::create_symtab_sections): Add shnum parameter. Change
5777 caller. Create .symtab_shndx section if needed.
5778 (Layout::create_shdrs): Add shstrtab_section parameter. Change
5780 (Layout::allocated_output_section_count): New function.
5781 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
5783 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
5784 fields. Update declarations.
5785 (Layout::symtab_xindex): New function.
5786 (Layout::dynsym_xindex): New function.
5787 (class Write_symbols_task): Add layout_ field.
5788 (Write_symbols_task::Write_symbols_task): Add layout parameter.
5790 * output.cc (Output_section_headers::Output_section_headers): Add
5791 shstrtab_section parameter. Change all callers.
5792 (Output_section_headers::do_sized_write): Store overflow values
5793 for section count and section string table section index in
5794 section header zero.
5795 (Output_file_header::do_sized_write): Check for overflow of
5796 section count and section string table section index.
5797 (Output_symtab_xindex::do_write): New function.
5798 (Output_symtab_xindex::endian_do_write): New function.
5799 * output.h (class Output_section_headers): Add shstrtab_section_.
5800 Update declarations.
5801 (class Output_symtab_xindex): Define.
5802 (Output_section::has_out_shndx): New function.
5803 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
5805 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
5807 (Sized_symbol::init): Likewise.
5808 (Symbol::output_section): Check for ordinary symbol.
5809 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
5810 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
5812 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
5813 Change all callers. Simplify handling of symbols from sections
5814 not included in the link.
5815 (Symbol_table::add_from_dynobj): Handle ordinary symbol
5817 (Weak_alias_sorter::operator()): Assert that symbols are
5819 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
5821 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
5822 parameters. Change all callers.
5823 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
5824 symbol distinction. Use SHN_XINDEX when needed.
5825 (Symbol_table::write_section_symbol): Add symtab_xindex
5826 parameter. Change all callers.
5827 (Symbol_table::sized_write_section_symbol): Likewise. Use
5828 SHN_XINDEX when needed.
5829 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
5831 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
5832 (Symbol::is_defined): Check is_ordinary.
5833 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
5834 (Symbol::is_absolute, Symbol::is_common): Likewise.
5835 (class Sized_symbol): Update declarations.
5836 (class Symbol_table): Update declarations.
5837 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
5838 parameters. Change all callers.
5839 (Sized_symbol::override): Likewise.
5840 (Symbol_table::override): Likewise.
5841 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
5842 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
5843 is_ordinary, and orig_st_shndx parameters. Change all callers.
5844 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
5845 to be in an ordinary section.
5846 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
5847 object and is_ordinary parameters. Change all callers.
5848 (Sized_dwarf_line_info::read_relocs): Add object parameter.
5849 Change all callers. Don't add undefined or non-ordinary symbols
5851 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
5853 * dwarf_reader.h (class Sized_dwarf_line_info): Update
5855 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
5856 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
5857 (Sized_relobj::relocate_sections): Likewise.
5858 * target-reloc.h (scan_relocs): Adjust section symbol index.
5859 (scan_relocatable_relocs): Likewise.
5860 * i386.cc (Scan::local): Check for ordinary symbols.
5861 * sparc.cc (Scan::local): Likewise.
5862 * x86_64.cc (Scan::local): Likewise.
5863 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
5864 to symbol_section_and_value.
5865 * testsuite/many_sections_test.cc: New file.
5866 * testsuite/Makefile.am (BUILT_SOURCES): Define.
5867 (check_PROGRAMS): Add many_sections_test.
5868 (many_sections_test_SOURCES): Define.
5869 (many_sections_test_DEPENDENCIES): Define.
5870 (many_sections_test_LDFLAGS): Define.
5871 (BUILT_SOURCES): Add many_sections_define.h.
5872 (many_sections_define.h): New target.
5873 (BUILT_SOURCES): Add many_sections_check.h.
5874 (many_sections_check.h): New target.
5875 (check_PROGRAMS): Add many_sections_r_test.
5876 (many_sections_r_test_SOURCES): Define.
5877 (many_sections_r_test_DEPENDENCIES): Define.
5878 (many_sections_r_test_LDFLAGS): Define.
5879 (many_sections_r_test_LDADD): Define.
5880 (many_sections_r_test.o): New target.
5881 * testsuite/Makefile.in: Rebuild.
5883 2008-04-17 Cary Coutant <ccoutant@google.com>
5885 * errors.cc (Errors::info): New function.
5886 (gold_info): New function.
5887 * errors.h (Errors::info): New function.
5888 * gold.h (gold_info): New function.
5889 * object.cc (Input_objects::add_object): Print trace output.
5890 * options.cc (options::parse_set): New function.
5891 (General_options::parse_wrap): Deleted.
5892 (General_options::General_options): Deleted initializer.
5893 * options.h (options::String_set): New typedef.
5894 (options::parse_set): New function.
5895 (DEFINE_set): New macro.
5896 (General_options::wrap): Changed to use DEFINE_set. Changed
5897 callers of any_wrap_symbols and is_wrap_symbol.
5898 (General_options::trace, General_options::trace_symbol):
5900 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
5901 (General_options::wrap_symbols_): Deleted.
5902 * symtab.cc (Symbol_table::add_from_object): Print trace output.
5904 2008-04-17 David S. Miller <davem@davemloft.net>
5906 * options.cc (General_options::parse_V): New function.
5907 * options.h: Add entries for -V and -Qy.
5909 2008-04-17 Ian Lance Taylor <iant@google.com>
5911 * common.cc (Symbol_table::allocate_commons): Remove options
5912 parameter. Change caller.
5913 (Symbol_table::do_allocate_commons): Remove options parameter.
5914 Change caller. Just call do_allocate_commons_list twice.
5915 (Symbol_table::do_allocate_commons_list): New function, broken out
5916 of do_allocate_commons.
5917 * common.h (class Allocate_commons_task): Remove options_ field.
5919 * symtab.cc (Symbol_table::Symbol_table): Initialize
5921 (Symbol_table::add_from_object): Put TLS common symbols on
5923 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
5924 which are IN_OUTPUT_DATA.
5925 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
5926 allocate_commons and do_allocate_commons declarations. Declare
5927 do_allocate_commons_list.
5928 * gold.cc (queue_middle_tasks): Update creation of
5929 Allocate_commons_task to not pass options.
5930 * testsuite/Makefile.am (INCLUDES): Add -I.. .
5931 (TLS_TEST_C_FLAGS): New variable.
5932 (tls_test_c_pic.o): New target.
5933 (tls_test_shared.so): Link in tls_test_c_pic.o.
5934 (tls_test_c_pic_ie.o): New target.
5935 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
5936 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
5937 (tls_test_c.o): New target.
5938 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
5939 (tls_pic_test_LDADD): Likewise.
5940 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
5941 (tls_shared_gd_to_ie_test_LDADD): Likewise.
5942 (tls_test_c_gnu2.o): New target.
5943 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
5945 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
5946 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
5947 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
5948 * testsuite/tls_test.cc: Include "config.h".
5949 (t_last): Call t11_last.
5950 * testsuite/tls_test.h (t11, t11_last): Declare.
5951 * testsuite/tls_test_c.c: New file.
5952 * testsuite/tls_test_main.cc (thread_routine): Call t11.
5953 * configure.ac: Check for OpenMP support.
5954 * configure, config.in, Makefile.in: Rebuild.
5955 * testsuite/Makefile.in: Rebuild.
5957 2008-04-16 Cary Coutant <ccoutant@google.com>
5959 * i386.cc (Target_i386::define_tls_base_symbol): New function.
5960 (Target_i386::tls_base_symbol_defined_): New field.
5961 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
5962 (Target_i386::Scan::global): Likewise.
5963 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
5964 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
5965 (Target_x86_64::tls_base_symbol_defined_): New field.
5966 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
5967 (Target_x86_64::Scan::global): Likewise.
5969 2008-04-16 Cary Coutant <ccoutant@google.com>
5971 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
5972 (Symbol::needs_plt_entry): Allow weak undefined symbols.
5973 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
5974 building shared libraries.
5975 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
5976 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
5977 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
5978 * testsuite/Makefile.in: Rebuild.
5979 * testsuite/weak_undef.h: New file.
5980 * testsuite/weak_undef_file1.cc: Add extra test cases.
5981 * testsuite/weak_undef_file2.cc: Likewise.
5982 * testsuite/weak_undef_test.cc: Likewise.
5984 2008-04-16 David S. Miller <davem@davemloft.net>
5986 * sparc.cc (Target_sparc::Scan): Change from struct to class.
5987 Add issued_non_pic_error_ field. Declare check_non_pic.
5988 (Target_sparc::Scan::check_non_pic): New function.
5989 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
5990 (Target_sparc::Scan::global): Likewise.
5992 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
5993 * configure: Rebuild.
5995 * options.h (DEFINE_enable): New macro.
5996 (new_dtags): New enable option.
5997 (initfirst, interpose, loadfltr, nodefaultlib,
5998 nodelete, nodlopen, nodump): New -z options.
5999 * layout.cc (Layout:finish_dynamic_section): If new
6000 dtags enabled, emit DT_RUNPATH. Also, emit a
6001 DT_FLAGS_1 containing any specified -z flags.
6003 2008-04-16 Ian Lance Taylor <iant@google.com>
6005 * copy-relocs.cc: New file.
6006 * copy-relocs.h: New file.
6007 * reloc.cc: Remove Copy_relocs code.
6008 * reloc.h: Likewise.
6009 * reloc-types.h (struct Reloc_types) [both versions]: Add
6010 get_reloc_addend_noerror.
6011 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
6012 variants of add_global which take an addend which must be zero.
6013 * i386.cc: Include "copy-relocs.h".
6014 (class Target_i386): Change type of copy_relocs_ to variable,
6016 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
6018 (Target_i386::do_finalize_sections): Change handling of
6020 * sparc.cc: Include "copy-relocs.h".
6021 (class Target_sparc): Change type of copy_relocs_ to variable,
6023 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
6025 (Target_sparc::do_finalize_sections): Change handling of
6027 * x86_64.cc: Include "copy-relocs.h".
6028 (class Target_x86_64): Change type of copy_relocs_ to variable,
6030 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
6031 class. Change all callers.
6032 (Target_x86_64::do_finalize_sections): Change handling of
6034 * Makefile.am (CCFILES): Add copy-relocs.cc.
6035 (HFILES): Add copy-relocs.h.
6037 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
6039 * testsuite/script_test_4.sh: Permit leading zeroes.
6041 2008-04-15 Ian Lance Taylor <iant@google.com>
6043 * script-sections.cc (Script_sections::create_segments): Use
6044 header_size_adjustment even when there is enough room for the
6046 * testsuite/script_test_4.sh: New file.
6047 * testsuite/script_test_4.t: New file.
6048 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
6049 (check_DATA): Add script_test_4.stdout.
6050 (MOSTLYCLEANFILES): Likewise.
6051 (script_test_4): New target.
6052 (script_test_4.stdout): New target.
6053 * testsuite/Makefile.in: Rebuild.
6055 * sparc.cc: Add definitions for Output_data_plt_sparc class
6058 2008-04-14 David S. Miller <davem@davemloft.net>
6060 * sparc.cc: New file.
6061 * Makefile.am (TARGETSOURCES): Add sparc.cc
6062 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
6063 * configure.tgt: Document targ_extra_size and
6064 targ_extra_big_endian. Add entries for sparc-* and
6066 * configure.ac: Handle targ_extra_size and
6067 targ_extra_big_endian.
6068 * Makefile.in: Rebuild.
6069 * configure: Likewise.
6070 * po/POTFILES.in: Likewise.
6071 * po/gold.pot: Likewise.
6073 2008-04-14 Ian Lance Taylor <iant@google.com>
6075 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
6076 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
6077 in the name/type/flags to section mapping. Don't call
6078 allocate_output_section.
6079 (Layout::choose_output_section): Change parameter from adjust_name
6080 to is_input_section. Don't permit input sections after sections
6081 are attached to segments. Don't call allocate_output_section.
6082 (Layout::layout_eh_frame): Call update_flags_for_input_section,
6083 not write_enable_output_section.
6084 (Layout::make_output_section): Don't push to
6085 unattached_section_list_ nor call attach_to_segment. Call
6086 attach_section_to_segment if sections are attached.
6087 (Layout::attach_sections_to_segments): New function.
6088 (Layout::attach_section_to_segment): New function.
6089 (Layout::attach_allocated_section_to_segment): Rename from
6090 attach_to_segment. Remove flags parameter.
6091 (Layout::allocate_output_section): Remove function.
6092 (Layout::write_enable_output_section): Remove function.
6093 * layout.h (class Layout): Update for above changes. Add new
6094 field sections_are_attached_.
6095 * output.h (Output_section::update_flags_for_input_section): New
6097 * output.cc (Output_section::add_input_section): Call
6098 update_flags_for_input_section.
6099 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
6101 2008-04-11 Cary Coutant <ccoutant@google.com>
6103 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
6104 thought unnecessary.
6105 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
6107 2008-04-11 Ian Lance Taylor <iant@google.com>
6109 * output.h (class Output_section_data): Remove inline definition
6111 * output.cc (Output_section_data::set_addralign): New function.
6113 2008-04-11 Cary Coutant <ccoutant@google.com>
6115 Add support for TLS descriptors for i386 and x86_64.
6116 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
6117 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
6118 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
6120 (Target_i386::got_mod_index_entry): Remove unnecessary code.
6121 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
6122 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
6124 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
6125 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
6126 Fix problem with initial-exec relocations.
6127 (Target_i386::Relocate::relocate_tls): Likewise.
6128 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
6130 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
6131 support for section-plus-offset dynamic table entries.
6132 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
6133 (Output_data_dynamic::Dynamic_entry): Add support for
6134 section-plus-offset dynamic table entries.
6135 (Output_data_dynamic::Classification): Likewise.
6136 (Output_data_dynamic::classification_): Renamed offset_.
6137 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
6138 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
6139 (Target_x86_64::make_plt_section): New function.
6140 (Target_x86_64::reserve_tlsdesc_entries): New function.
6141 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
6142 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
6143 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
6144 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
6145 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
6146 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
6147 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
6148 add extra PLT entry for TLS descriptors.
6149 (Output_data_plt_x86_64::got_): New field.
6150 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
6151 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
6153 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
6155 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
6156 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
6157 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
6158 R_386_TLS_DESC_CALL relocations.
6159 (Target_x86_64::Scan::global): Likewise.
6160 (Target_x86_64::do_finalize_sections): Add dynamic table entries
6161 for TLS descriptors.
6162 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
6163 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
6164 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
6165 GD-to-IE relaxation.
6166 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
6167 and TLS_DESCRIPTORS.
6168 * Makefile.in: Rebuild.
6169 * configure: Rebuild.
6170 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
6171 (tls_test_shared2.so): New target.
6172 (tls_shared_gd_to_ie_test_SOURCES): New variable.
6173 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
6174 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
6175 (tls_shared_gd_to_ie_test_LDADD): New variable.
6176 (tls_shared_gnu2_gd_to_ie_test): New target.
6177 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
6179 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
6180 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
6181 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
6182 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
6183 (tls_shared_gnu2_test): New target.
6184 (tls_test_gnu2_shared.so): New target.
6185 (tls_shared_gnu2_test_SOURCES): New variable.
6186 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
6187 (tls_shared_gnu2_test_LDFLAGS): New variable.
6188 (tls_shared_gnu2_test_LDADD): New variable.
6189 * testsuite/Makefile.in: Rebuild.
6190 * testsuite/Makefile.
6192 2008-04-11 Ian Lance Taylor <iant@google.com>
6194 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
6196 * testsuite/Makefile.in: Rebuild.
6198 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
6200 * testsuite/script_test_2.cc (main): Adjust test.
6202 2008-04-11 David S. Miller <davem@davemloft.net>
6203 Ian Lance Taylor <iant@google.com>
6205 * options.h (General_options): Add entries for '-Y' and
6207 * options.cc (General_options:finalize): If -Y was used, add those
6208 entries to the library path instead of the default "/lib" and
6211 2008-04-11 David S. Miller <davem@davemloft.net>
6213 * testsuite/justsyms.t: Start at 0x100.
6214 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
6215 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
6217 * testsuite/script_test_2.cc: Adjust string and section length
6220 2008-04-09 Ian Lance Taylor <iant@google.com>
6223 * script-sections.cc (Sections_element::allocate_to_segment): Add
6225 (Output_section_definition::allocate_to_segment): Likewise.
6226 (Orphan_output_section::allocate_to_segment): Likewise.
6227 (Script_sections::attach_sections_using_phdrs_clause): Don't
6228 propagate non-PT_LOAD segments to orphan sections.
6229 * testsuite/Makefile.am (script_test_3.stdout): Generate using
6230 readelf rather than objdump.
6231 * testsuite/script_test_3.sh: Adjust accordingly. Test that
6232 .interp section and PT_INTERP segment are the same size.
6233 * testsuite/Makefile.in: Rebuild.
6235 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
6236 aliases for symbols defined in the same object.
6237 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
6238 (weak_alias_test_SOURCES): New variable.
6239 (weak_alias_test_DEPENDENCIES): New variable.
6240 (weak_alias_test_LDFLAGS): New variable.
6241 (weak_alias_test_LDADD): New variable.
6242 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
6243 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
6244 (weak_alias_test_3.o): New target.
6245 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
6246 * testsuite/weak_alias_test_main.cc: New file.
6247 * testsuite/weak_alias_test_1.cc: New file.
6248 * testsuite/weak_alias_test_2.cc: New file.
6249 * testsuite/weak_alias_test_3.cc: New file.
6251 2008-04-08 Ian Lance Taylor <iant@google.com>
6253 * options.h (class General_options): Add --noinhibit-exec option.
6254 * main.cc (main): Check --noinhibit-exec.
6256 * options.h (class General_options): Define --wrap as a special
6257 option. Add wrap_symbols_ field.
6258 (General_options::any_wrap_symbols): New function.
6259 (General_options::is_wrap_symbol): New function.
6260 * options.cc (General_options::parse_wrap): New function.
6261 (General_options::General_options): Initialize wrap_symbols_.
6262 * symtab.cc (Symbol_table::wrap_symbol): New function.
6263 (Symbol_table::add_from_object): Handle --wrap.
6264 * symtab.h (class Symbol_table): Declare wrap_symbol.
6265 * target.h (Target::wrap_char): New function.
6266 (Target::Target_info): Add wrap_char field.
6267 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
6268 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
6269 * testsuite/testfile.cc (Target_test::test_target_info):
6272 * errors.cc (Errors::undefined_symbol): Mention symbol version if
6275 * layout.h (class Layout): Add added_eh_frame_data_ field.
6276 * layout.cc (Layout::Layout): Initialize new field.
6277 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
6278 output section until we find a section we merged successfully.
6279 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
6280 that the size be non-zero.
6282 * merge.cc (Object_merge_map::get_output_offset): Remove inline
6285 2008-04-08 Craig Silverstein <csilvers@google.com>
6287 * configure.ac: Export new conditional variable HAVE_ZLIB.
6288 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
6290 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
6291 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
6293 2008-04-07 Ian Lance Taylor <iant@google.com>
6295 * version.cc (version_string): Set to "1.5".
6297 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
6298 Add issued_non_pic_error_ field. Declare check_non_pic.
6299 (Target_x86_64::Scan::check_non_pic): New function.
6300 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
6301 (Target_x86_64::Scan::global): Likewise.
6303 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
6304 addend parameter. Change caller. Handle merge sections.
6305 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
6306 Address to Addend. Don't add in the result of
6307 local_section_offset, pass down the addend and use the returned
6309 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
6310 Update declarations of local_section_offset and symbol_value.
6311 * testsuite/two_file_test_1.cc (t18): New function.
6312 * testsuite/two_file_test_2.cc (f18): New function.
6313 * testsuite/two_file_test_main.cc (main): Call t18.
6314 * testsuite/two_file_test.h (t18, f18): Declare.
6316 * configure.ac: Don't test for objdump, c++filt, or readelf.
6317 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
6319 (TEST_READELF): New variable.
6320 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
6321 (check_PROGRAMS): Add two_file_strip_test.
6322 (two_file_strip_test): New target.
6323 (check_PROGRAMS): Add two_file_same_shared_strip_test.
6324 (two_file_same_shared_strip_test_SOURCES): New variable.
6325 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
6326 (two_file_same_shared_strip_test_LDFLAGS): New variable.
6327 (two_file_same_shared_strip_test_LDADD): New variable.
6328 (two_file_shared_strip.so): New target.
6329 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
6330 (ver_test_5.syms, ver_test_7.syms): Likewise.
6331 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
6332 (strip_test_3.stdout): Use TEST_OBJDUMP.
6333 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
6335 2008-04-04 Cary Coutant <ccoutant@google.com>
6337 * symtab.h (Symbol::is_weak_undefined): New function.
6338 (Symbol::is_strong_undefined): New function.
6339 (Symbol::is_absolute): New function.
6340 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
6341 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
6343 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
6344 (weak_undef_test): New target.
6345 * testsuite/Makefile.in: Rebuild.
6346 * testsuite/weak_undef_file1.cc: New file.
6347 * testsuite/weak_undef_file2.cc: New file.
6348 * testsuite/weak_undef_test.cc: New file.
6350 2008-04-03 Craig Silverstein <csilvers@google.com>
6352 * compressed_output.h (class Output_compressed_section): Use
6354 * compressed_output.cc (zlib_compress): Use unsigned buffers,
6356 (zlib_compressed_suffix): Removed.
6357 (Output_compressed_section::set_final_data_size): Use unsigned
6359 * testsuite/Makefile.am (flagstest_compress_debug_sections):
6360 Fix linker invocation.
6361 (flagstest_o_specialfile_and_compress_debug_sections):
6363 * testsuite/Makefile.in: Regenerated.
6365 2008-04-02 David S. Miller <davem@davemloft.net>
6367 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
6368 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
6370 2008-04-02 Craig Silverstein <csilvers@google.com>
6374 2008-04-02 Ian Lance Taylor <iant@google.com>
6376 * fileread.cc (File_read::find_view): Add byteshift and vshifted
6377 parameters. Update for new key type to views_. Change all
6379 (File_read::read): Adjust for byteshift in returned view.
6380 (File_read::add_view): New function, broken out of
6382 (File_read::make_view): New function, broken out of
6384 (File_read::find_or_make_view): Add offset and aligned
6385 parameters. Rewrite accordingly. Change all callers.
6386 (File_read::get_view): Add offset and aligned parameters. Adjust
6387 for byteshift in return value.
6388 (File_read::get_lasting_view): Likewise.
6389 * fileread.h (class File_read): Update declarations.
6390 (class File_read::View): Add byteshift_ field. Add byteshift to
6391 constructor. Add byteshift method.
6392 * archive.h (Archive::clear_uncached_views): New function.
6393 (Archive::get_view): Add aligned parameter. Change all callers.
6394 * object.h (Object::get_view): Add aligned parameter. Change all
6396 (Object::get_lasting_view): Likewise.
6398 * fileread.cc (File_read::release): Don't call clear_views if
6399 there are multiple objects.
6400 * fileread.h (File_read::clear_uncached_views): New function.
6401 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
6404 2008-03-31 Cary Coutant <ccoutant@google.com>
6406 Add thin archive support.
6407 * archive.cc (Archive::armagt): New const.
6408 (Archive::setup): Remove task parameter and calls to unlock.
6409 (Archive::unlock_nested_archives): New function.
6410 (Archive::read_header): Add nested_off parameter. Change
6412 (Archive::interpret_header): Likewise.
6413 (Archive::include_all_members): Change to handle thin
6415 (Archive::include_member): Likewise.
6416 * archive.h (Archive::Archive): Add new parameters and
6418 (Archive::armagt): New const.
6419 (Archive::setup): Remove task parameter.
6420 (Archive::unlock_nested_archives): New function.
6421 (Archive::read_header): Add nested_off parameter.
6422 (Archive::interpret_header): Likewise.
6423 (Archive::Nested_archive_table): New typedef.
6424 (Archive::is_thin_archive_): New field.
6425 (Archive::nested_archives_): New field.
6426 (Archive::options_): New field.
6427 (Archive::dirpath_): New field.
6428 (Archive::task_): New field.
6429 * readsyms.cc (Read_symbols::do_read_symbols): Add check
6430 for thin archives. Pass additional parameters to
6431 Archive::Archive. Unlock the archive file after calling
6434 2008-03-29 Ian Lance Taylor <iant@google.com>
6436 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
6437 version symbol to be local.
6438 * testsuite/ver_test_4.sh: New file.
6439 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
6440 (check_DATA): Add ver_test_4.syms.
6441 (ver_test_4.syms): New target.
6442 * testsuite/Makefile.in: Rebuild.
6445 (Output_section::Input_section_sort_entry::has_priority): New
6447 (Output_section::Input_section_sort_entry::match_file_name): New
6449 (Output_section::Input_section_sort_entry::match_section_name):
6451 (Output_section::Input_section_sort_entry::match_section_name_prefix):
6453 (Output_section::Input_section_sort_entry::match_section_file):
6455 (Output_section::Input_section_sort_compare::operator()): Rewrite
6456 using new Input_section_sort_entry functions. Sort crtbegin and
6457 crtend first. Sort sections with no priority before sections with
6459 * testsuite/initpri1.c (d3): Check j != 4.
6460 (cd5): New constructor/destructor function.
6461 (main): Check j != 2.
6463 * symtab.cc (Symbol_table::add_from_object): If we don't use the
6464 new symbol when resolving, don't call set_is_default.
6465 * testsuite/ver_test_7.cc: New file.
6466 * testsuite/ver_test_7.sh: New file.
6467 * testsuite/Makefile.am (ver_test_7.so): New target.
6468 (ver_test_7.o): New target.
6469 (check_SCRIPTS): Add ver_test_7.sh.
6470 (check_DATA): Add ver_test_7.syms.
6471 (ver_test_7.syms): New target.
6473 2008-03-28 Ian Lance Taylor <iant@google.com>
6475 * layout.cc (Layout::layout): If we see an input section with a
6476 name that needs sorting, set the must_sort flag for the output
6478 (Layout::make_output_section): If the name of the output section
6479 indicates that it might require sorting, set the may_sort flag.
6480 * output.h (Output_section::may_sort_attached_input_sections): New
6482 (Output_section::set_may_sort_attached_input_sections): New
6484 (Output_section::must_sort_attached_input_sections): New
6486 (Output_section::set_must_sort_attached_input_sections): New
6488 (class Output_section): Declare Input_section_sort_entry. Define
6489 Input_section_sort_compare. Declare
6490 sort_attached_input_sections. Add new fields:
6491 may_sort_attached_input_sections_,
6492 must_sort_attached_input_sections_,
6493 attached_input_sections_are_sorted_.
6494 * output.cc (Output_section::Output_section): Initialize new
6496 (Output_section::add_input_section): Add an entry to
6497 input_sections_ if may_sort or must_sort are true.
6498 (Output_section::set_final_data_size): Call
6499 sort_attached_input_sections if necessary.
6500 (Output_section::Input_section_sort_entry): Define new class.
6501 (Output_section::Input_section_sort_compare::operator()): New
6503 (Output_section::sort_attached_input_sections): New function.
6504 * configure.ac: Check whether the compiler supports constructor
6505 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
6506 * testsuite/initpri1.c: New file.
6507 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
6508 CONSTRUCTOR_PRIORITY.
6509 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
6510 (initpri1_LDFLAGS): New variable.
6511 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
6513 2008-03-27 Ian Lance Taylor <iant@google.com>
6515 * common.cc (Sort_commons::operator): Correct sorting algorithm.
6516 * testsuite/common_test_1.c: New file.
6517 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
6518 (common_test_1_SOURCES): New variable.
6519 (common_test_1_DEPENDENCIES): New variable.
6520 (common_test_1_LDFLAGS): New variable.
6522 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
6523 and commons_ correctly when NAME/VERSION does not override
6525 * testsuite/ver_test_6.c: New file.
6526 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
6527 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
6528 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
6530 2008-03-26 Ian Lance Taylor <iant@google.com>
6532 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
6533 of an undefined symbol from a version script.
6534 * testsuite/Makefile.am (ver_test_5.so): New target.
6535 (ver_test_5.o): New target.
6536 (check_SCRIPTS): Add ver_test_5.sh.
6537 (check_DATA): Add ver_test_5.syms.
6538 (ver_test_5.syms): New target.
6539 * testsuite/ver_test_5.cc: New file.
6540 * testsuite/ver_test_5.script: New file.
6541 * testsuite/ver_test_5.sh: New file.
6542 * Makefile.in, testsuite/Makefile.in: Rebuild.
6545 Fix problems building gold with gcc 4.3.0.
6546 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
6547 (gold_error_at_location, gold_warning_at_location): Use it.
6548 * configure.ac: Check whether we can compile and use a template
6549 function with a printf attribute.
6550 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
6551 when jumping over bytes.
6552 * object.cc: Instantiate Object::read_section_data.
6553 * debug.h: Include <cstring>
6554 * dwarf_reader.cc: Include <algorithm>
6555 * main.cc: Include <cstring>.
6556 * options.cc: Include <cstring>.
6557 * output.cc: Include <cstring>.
6558 * script.cc: Include <cstring>.
6559 * script.h: Include <string>.
6560 * symtab.cc: Include <cstring> and <algorithm>.
6561 * target-select.cc: Include <cstring>.
6562 * version.cc: Include <string>.
6563 * testsuite/testmain.cc: Include <cstdlib>.
6564 * configure, config.in: Rebuild.
6566 2008-03-25 Ian Lance Taylor <iant@google.com>
6568 * options.cc: Include "../bfd/bfdver.h".
6569 (options::help): Print bug reporting address.
6571 * version.cc (print_version): Adjust output for current value of
6576 * options.cc (options::help): Print list of supported targets.
6577 * target-select.h: Include <vector>.
6578 (class Target_selector): Make machine_, size_, and is_big_endian_
6579 fields const. Add bfd_name_ and instantiated_target_ fields.
6580 (Target_selector::Target_selector): Add bfd_name parameter.
6581 (Target_selector::recognize): Make non-virtual, call
6583 (Target_selector::recognize_by_name): Make non-virtual, call
6584 do_recognize_by_name.
6585 (Target_selector::supported_names): New function.
6586 (Target_selector::bfd_name): New function.
6587 (Target_selector::do_instantiate_target): New pure virtual
6589 (Target_selector::do_recognize): New virtual function.
6590 (Target_selector::do_recognize_by_name): New virtual function.
6591 (Target_selector::instantiate_target): New private function.
6592 (supported_target_names): Declare.
6593 * target-select.cc (Target_selector::Target_selector): Update for
6594 new parameter and fields.
6595 (select_target_by_name): Check that the name matches before
6596 calling recognize_by_name.
6597 (supported_target_names): New function.
6598 * i386.cc (class Target_selector_i386): Update Target_selector
6599 constructor call. Remove recognize and recognize_by_name. Add
6600 do_instantiate_target.
6601 * x86_64.cc (class Target_selector_x86_64): Likewise.
6602 * testsuite/testfile.cc (class Target_selector_test): Update for
6603 changes to Target_selector.
6605 * README: Rewrite, with some notes on unsupported features.
6607 2008-03-24 Cary Coutant <ccoutant@google.com>
6609 * i386.cc (Target_i386::Got_type): New enum declaration.
6610 (Target_i386::Scan::local): Updated callers of Output_data_got
6612 (Target_i386::Scan::global): Likewise.
6613 (Target_i386::Relocate::relocate): Likewise.
6614 (Target_i386::Relocate::relocate_tls): Likewise.
6615 * object.h (Got_offset_list): New class.
6616 (Sized_relobj::local_has_got_offset): Added got_type parameter.
6617 (Sized_relobj::local_got_offset): Likewise.
6618 (Sized_relobj::set_local_got_offset): Likewise.
6619 (Sized_relobj::local_has_tls_got_offset): Removed.
6620 (Sized_relobj::local_tls_got_offset): Removed.
6621 (Sized_relobj::set_local_tls_got_offset): Removed.
6622 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
6623 * output.cc (Output_data_got::add_global): Added got_type parameter.
6624 (Output_data_got::add_global_with_rel): Likewise.
6625 (Output_data_got::add_global_with_rela): Likewise.
6626 (Output_data_got::add_global_pair_with_rel): New function.
6627 (Output_data_got::add_global_pair_with_rela): New function.
6628 (Output_data_got::add_local): Added got_type parameter.
6629 (Output_data_got::add_local_with_rel): Likewise.
6630 (Output_data_got::add_local_with_rela): Likewise.
6631 (Output_data_got::add_local_pair_with_rel): New function.
6632 (Output_data_got::add_local_pair_with_rela): New function.
6633 (Output_data_got::add_global_tls): Removed.
6634 (Output_data_got::add_global_tls_with_rel): Removed.
6635 (Output_data_got::add_global_tls_with_rela): Removed.
6636 (Output_data_got::add_local_tls): Removed.
6637 (Output_data_got::add_local_tls_with_rel): Removed.
6638 (Output_data_got::add_local_tls_with_rela): Removed.
6639 * output.h (Output_data_got::add_global): Added got_type parameter.
6640 (Output_data_got::add_global_with_rel): Likewise.
6641 (Output_data_got::add_global_with_rela): Likewise.
6642 (Output_data_got::add_global_pair_with_rel): New function.
6643 (Output_data_got::add_global_pair_with_rela): New function.
6644 (Output_data_got::add_local): Added got_type parameter.
6645 (Output_data_got::add_local_with_rel): Likewise.
6646 (Output_data_got::add_local_with_rela): Likewise.
6647 (Output_data_got::add_local_pair_with_rel): New function.
6648 (Output_data_got::add_local_pair_with_rela): New function.
6649 (Output_data_got::add_global_tls): Removed.
6650 (Output_data_got::add_global_tls_with_rel): Removed.
6651 (Output_data_got::add_global_tls_with_rela): Removed.
6652 (Output_data_got::add_local_tls): Removed.
6653 (Output_data_got::add_local_tls_with_rel): Removed.
6654 (Output_data_got::add_local_tls_with_rela): Removed.
6655 * resolve.cc (Symbol::override_base_with_special): Removed
6656 reference to has_got_offset_ field.
6657 * symtab.cc (Symbol::init_fields): Replaced initialization
6658 of got_offset_ with got_offsets_. Removed initialization
6660 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
6661 (Symbol::got_offset): Likewise.
6662 (Symbol::set_got_offset): Likewise.
6663 (Symbol::has_tls_got_offset): Removed.
6664 (Symbol::tls_got_offset): Removed.
6665 (Symbol::set_tls_got_offset): Removed.
6666 (Symbol::got_offset_): Removed.
6667 (Symbol::tls_mod_got_offset_): Removed.
6668 (Symbol::tls_pair_got_offset_): Removed.
6669 (Symbol::got_offsets_): New field.
6670 (Symbol::has_got_offset): Removed.
6671 (Symbol::has_tls_mod_got_offset): Removed.
6672 (Symbol::has_tls_pair_got_offset): Removed.
6673 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
6674 (Target_x86_64::Scan::local): Updated callers of Output_data_got
6676 (Target_x86_64::Scan::global): Likewise.
6677 (Target_x86_64::Relocate::relocate): Likewise.
6678 (Target_x86_64::Relocate::relocate_tls): Likewise.
6680 2008-03-25 Ben Elliston <bje@au.ibm.com>
6682 * yyscript.y: Fix spelling error in comment.
6684 2008-03-24 Ian Lance Taylor <iant@google.com>
6686 * options.h (class General_options): Define build_id option.
6687 * layout.h (class Layout): Declare write_build_id, create_note,
6688 create_build_id. Add build_id_note_ member.
6689 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
6690 "libiberty.h", "md5.h", "sha1.h".
6691 (Layout::Layout): Initialize eh_frame_data_,
6692 eh_frame_hdr_section_, and build_id_note_.
6693 (Layout::finalize): Call create_build_id.
6694 (Layout::create_note): New function, broken out of
6695 Layout::create_gold_note.
6696 (Layout::create_gold_note): Call create_note.
6697 (Layout::create_build_id): New function.
6698 (Layout::write_build_id): New function.
6699 (Close_task_runner::run): Call write_build_id.
6701 * x86_64.cc: Correct license to GPLv3.
6703 2008-03-23 Ian Lance Taylor <iant@google.com>
6705 * options.cc: Include "demangle.h".
6706 (parse_optional_string): New function.
6707 (parse_long_option): Handle takes_optional_argument.
6708 (parse_short_option): Update dash_z initializer. Handle
6709 takes_optional_argument.
6710 (General_options::General_options): Initialize do_demangle_.
6711 (General_options::finalize): Set do_demangle_. Handle demangling
6713 * options.h (parse_optional_string): Declare.
6714 (struct One_option): Add optional_arg field. Update constructor.
6715 Update call constructor calls. Add takes_optional_argument
6717 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
6718 (DEFINE_optional_string): Define.
6719 (General_options::demangle): Change from DEFINE_bool to
6720 DEFINE_optional_string.
6721 (General_options::no_demangle): New function.
6722 (General_options::do_demangle): New function.
6723 (General_options::set_do_demangle): New function.
6724 (General_options::execstack_status_): Move definition to end of
6726 (General_options::static_): Likewise.
6727 (General_options::do_demangle_): New field.
6728 * object.cc (big_endian>::get_symbol_location_info): Call
6729 Options::do_demangle, not Options::demangle.
6730 * symtab.cc (demangle): Likewise.
6732 2008-03-22 Ian Lance Taylor <iant@google.com>
6734 * gold.h: Include <cstddef> and <sys/types.h>
6735 * options.h: Include <cstring>.
6737 2008-03-21 Ian Lance Taylor <iant@google.com>
6739 * Added source code to GNU binutils.