1 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
4 * incremental-dump.cc (main): Use llu to print 64 bit values.
6 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7 H.J. Lu <hongjiu.lu@intel.com>
9 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11 (incremental_dump_LDADD): Likewise.
12 * Makefile.in: Regenerated.
14 2009-11-25 Doug Kwan <dougkwan@google.com>
18 2009-11-25 Doug Kwan <dougkwan@google.com>
20 * arm.cc (Target_arm::Target_arm): Move method definition
21 outside of class definition. Add code to handle
22 --target1-rel, --target1-abs and --target2= options.
23 (Target_arm::get_reloc_reloc_type): Change method to be
25 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
26 New data member declaration.
27 (Target_arm::Scan::local, Target_arm::Scan::global,
28 Target_arm::Relocate::relocate,
29 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
30 Adjust call to Target_arm::get_real_reloc_type.
31 (Target_arm::get_real_reloc_type): Use command line options
32 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
33 * options.h (--target1-rel, --target1-abs, --target2): New
36 2009-11-25 Doug Kwan <dougkwan@google.com>
38 * arm.cc (Target_arm::Target_arm): Move method definition outside of
39 class definition. Add code to handle --target1-rel, --target1-abs
40 and --target2= options.
41 (Target_arm::get_reloc_reloc_type): Change method to be non-static
43 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
45 (Target_arm::Scan::local, Target_arm::Scan::global,
46 Target_arm::Relocate::relocate,
47 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
48 call to Target_arm::get_real_reloc_type.
49 (Target_arm::get_real_reloc_type): Use command line options to
50 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
51 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
54 2009-11-25 Doug Kwan <dougkwan@google.com>
56 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
57 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
58 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
60 (Arm_relocate_functions::thm_call): Replace body with a call to
61 Arm_relocate_functions::thumb_branch_common.
62 (Arm_relocate_functions::thm_jump24,
63 Arm_relocate_functions::thm_xpc22): New method definitions.
64 (Arm_relocate_functions::thumb_branch_common): New method definition.
65 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
67 (Target_arm::Relocate::relocate): Adjust call to thm_call.
68 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
70 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
72 * Makefile.am: Build incremental-dump
73 * Makefile.in: Regenerate.
74 * incremental-dump.cc: New.
75 * incremental.cc (Incremental_inputs_header_data,
76 Incremental_inputs_entry_data): Move to incremental.h
77 * incremental.h: (Incremental_inputs_header_data,
78 Incremental_inputs_entry_data): Move from incremental.cc
80 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
82 * incremental.cc (Incremental_inputs_header,
83 Incremental_inputs_header_write, Incremental_inputs_entry,
84 Incremental_inputs_entry_write): Add a typedef with the data type.
86 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
88 * incremental.cc (Incremental_inputs_header,
89 Incremental_inputs_header_write, Incremental_inputs_entry,
90 Incremental_inputs_entry_write): Update comment about which
91 type has the filed descriptions.
93 2009-11-15 Doug Kwan <dougkwan@google.com>
95 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
96 (Arm_relocate_functions::arm_branch_common): Change method defintion
97 in class definition to a method declaration and update list of formal
99 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
100 Arm_relocation_functions::jump24): Adjust call to
101 Arm_relocate_functions::arm_branch_common. Update list of formal
103 (Arm_relocate_functions::xpc25): New method definition.
104 (Arm_relocate_functions::arm_branch_common): Move method defintion
105 out from class definition. Use stubs for mode-switching and extending
107 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
108 specially. Change code to enable use of stubs in ARM branches.
110 2009-11-10 Doug Kwan <dougkwan@google.com>
112 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
113 in method declaration.
114 (Target_arm::relocate_stub): New method declaration.
115 (Target_arm::default_target): Change to return a pointer instead of
117 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
118 Target_arm::default_target.
119 (Arm_Relobj::do_relocate_sections): Remove options paramater in
121 (Target_arm::relocate_section): Adjust view.
122 (Target_arm::relocate_stub): New method definition.
124 2009-11-10 Doug Kwan <dougkwan@google.com>
126 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
128 * incremental.cc (open_incremental_binary): Initialized local
129 variables to avoid warnings.
130 * object.cc (make_elf_object): Ditto.
131 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
134 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
137 * testsuite/plugin_test.c: Include "config.h".
139 2009-11-09 Doug Kwan <dougkwan@google.com>
141 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
142 (arm_symbol_value): Remove.
143 (Arm_relocate_functions::arm_branch_common,
144 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
145 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
146 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
147 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
148 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
149 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
150 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
151 Arm_relocate_functions::thm_mobw_abs_nc,
152 Arm_relocate_functions::thm_mov_abs,
153 Arm_relocate_functions::movw_prel_nc,
154 Arm_relocate_functions::thm_movt_abs,
155 Arm_relocate_functions::movt_prel,
156 Arm_relocate_functions::thm_movw_prel_nc,
157 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
158 (Target_arm::Relocate::relocate): Only decompose address into two
159 parts if relocation type uses the thumb-bit and pass the actual
160 bit instead of a flag indicating that the thumb-bit is used. Adjust
161 calls to methods in Arm_relocate_functions for this change.
163 2009-11-08 Ian Lance Taylor <ian@airs.com>
166 * reloc.cc: Instantiate
167 Sized_relobj::initialize_input_to_output_maps and
168 Sized_relobj:free_input_to_output_maps.
170 2009-11-06 Ian Lance Taylor <iant@google.com>
173 * defstd.cc (in_segment): Set only_if_ref true for "end".
175 2009-11-06 Doug Kwan <dougkwan@google.com>
177 * arm.cc (class Reloc_stub): Correct a comment.
178 (Target_arm::Target_arm): Initialize arm_input_section_map_.
179 (Target_arm::scan_section_for_stubs): New method declaration.
180 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
181 Change methods from private to protected.
182 (Target_arm::do_may_relax): New method definition.
183 (Target_arm::do_relax, Target_arm::group_sections,
184 Target_arm::scan_reloc_for_stub,
185 Target_arm::scan_reloc_section_for_stubs): New method declarations.
186 (Target_arm::arm_input_section_map_): New data member declaration.
187 (Target_arm::scan_reloc_for_stub,
188 Target_arm::scan_reloc_section_for_stubs,
189 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
190 Target_arm::do_relax): New method definitions.
192 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
194 * configure.ac: Check for (struct stat)::st_mtim
195 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
196 * config.in: Regenerate.
197 * configure: Regenerate.
199 2009-11-05 Ian Lance Taylor <iant@google.com>
202 * output.cc (Output_segment::add_output_section): Add missing
205 2009-11-04 Ian Lance Taylor <iant@google.com>
208 * object.h (class Object): Add is_needed and set_is_needed
209 methods. Add is_needed_ field. Make bool fields into bitfields.
210 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
211 defined in a dynamic object and referenced by a regular object,
212 set is_needed for the dynamic object.
213 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
214 if the file is marked with as_needed and it is not needed.
216 2009-11-04 Ian Lance Taylor <iant@google.com>
219 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
220 tags if data is discarded by linker script.
221 * i386.cc (Target_i386::do_finalize_sections): Likewise.
222 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
223 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
224 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
226 2009-11-04 Ian Lance Taylor <iant@google.com>
228 * layout.cc (Layout::get_output_section): Add is_interp and
229 is_dynamic_linker_section parameters. Change all callers.
230 (Layout::choose_output_section): Likewise.
231 (Layout::make_output_section): Likewise.
232 (Layout::add_output_section_data): Add is_dynamic_linker_section
233 parameter. Change all callers.
234 * layout.h (class Layout): Update declarations.
235 * output.h (class Output_section): Add is_interp, set_is_interp,
236 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
237 Add is_interp_, is_dynamic_linker_section_ fields. Change
238 generate_code_fills_at_write_ to a bitfield.
239 * output.cc (Output_section::Output_sections): Initialize new
241 (Output_segment::add_output_section): Add do_sort parameter.
244 2009-11-03 Ian Lance Taylor <iant@google.com>
247 * options.h (class General_options): Add --warn-common.
248 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
249 merging two common symbols.
250 (Symbol_table::should_override): Handle --warn-common when merging
251 a common symbol with a defined symbol. Use report_resolve_problem
252 for multiple definitions.
253 (Symbol_table::report_resolve_problem): New function.
254 * symtab.h (class Symbol_table): Declare report_resolve_problem.
256 2009-11-03 Doug Kwan <dougkwan@google.com>
258 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
260 (Target_arm::stub_factory): New method definition.
261 (Target_arm::new_arm_input_section,
262 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
263 Target_arm::reloc_uses_thumb_bit): New method declarations.
264 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
265 New type definitions.
266 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
268 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
269 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
270 New method definitions.
272 2009-11-03 Ian Lance Taylor <iant@google.com>
274 * options.h (class General_options): Add --warn_constructors.
276 2009-11-03 Ian Lance Taylor <iant@google.com>
279 * defstd.cc (in_section): Add entries for __rel_iplt_start,
280 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
282 2009-11-03 Ian Lance Taylor <iant@google.com>
285 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
286 --msgid-bugs-address.
287 (install-pdf): New target.
288 (install-data_yes): Look up one directory to find mkinstalldirs.
290 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
292 * po/Make-in (.po.gmo): Don't generate .gmo files in source
295 2009-10-30 Doug Kwan <dougkwan@google.com>
297 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
299 2009-10-30 Doug Kwan <dougkwan@google.com>
301 * arm.cc (Stub_addend_reader): New struct template definition
302 and partial specializations.
303 (Stub_addend_reader::operator()): New method definition for a
304 partially specialized template.
306 2009-10-30 Doug Kwan <dougkwan@google.com>
308 * arm.cc (Arm_relobj::processor_specific_flags): New method
310 (Arm_relobj::do_read_symbols): New method declaration.
311 (Arm_relobj::processor_specific_flags_): New data member declaration.
312 (Arm_dynobj): New class definition.
313 (Target_arm::do_finalize_sections): Add input_objects parameter.
314 (Target_arm::do_adjust_elf_header): New method declaration.
315 (Target_arm::are_eabi_versions_compatible,
316 (Target_arm::merge_processor_specific_flags): New method declaration.
317 (Target_arm::do_make_elf_object): New overloaded method definitions
319 (Arm_relobj::do_read_symbols): New method definition.
320 (Arm_dynobj::do_read_symbols): Ditto.
321 (Target_arm::do_finalize_sections): Add input_objects parameters.
322 Merge processor-specific flags from all input objects.
323 (Target_arm::are_eabi_versions_compatible,
324 Target_arm::merge_processor_specific_flags,
325 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
326 New method definitions.
327 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
328 Input_objects pointer type parameter.
329 * layout.cc (Layout::finalize): Pass input objects to target's.
330 finalize_sections function.
331 * output.cc (Output_file_header::do_sized_write): Set ELF file
332 header's processor-specific flags.
333 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
334 Input_objects pointer type parameter.
335 * sparc.cc (Target_sparc::do_finalize_sections): Same.
336 * target.h (Input_objects): New forward class declaration.
337 (Target::processor_specific_flags,
338 Target::are_processor_specific_flags_sect): New method definitions.
339 (Target::finalize_sections): Add input_objects parameter.
340 (Target::Target): Initialize processor_specific_flags_ and
341 are_processor_specific_flags_set_.
342 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
344 (Target::set_processor_specific_flags): New method definition.
345 (Target::processor_specific_flags_,
346 Target::are_processor_specific_flags_set_): New data member
348 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
349 Input_objects pointer type parameter.
351 2009-10-30 Doug Kwan <dougkwan@google.com>
353 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
355 2009-10-28 Ian Lance Taylor <iant@google.com>
357 * object.h (class Relobj): Drop options parameter from
358 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
359 do_scan_relocs, do_relocate. Change all callers.
360 (class Sized_relobj): Drop options parameters from
361 do_gc_process_relocs, do_scan_relocs, do_relocate,
362 do_relocate_sections, relocate_sections, emit_relocs_scan,
363 emit_relocs_scan_reltype. Change all callers.
364 (struct Relocate_info): Remove options field and all references to
366 * reloc.h (class Read_relocs): Remove options constructor
367 parameter and options_ field. Change all callers.
368 (class Gc_process_relocs, class Scan_relocs): Likewise.
369 (class Relocate_task): Likewise.
370 * target-reloc.h (scan_relocs): Remove options parameter. Change
372 (scan_relocatable_relocs): Likewise.
373 * target.h (class Sized_target): Remove options parameter from
374 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
376 * gc.h (gc_process_relocs): Remove options parameter. Change all
378 * arm.cc: Update functions to remove options parameters.
380 * powerpc.cc: Likewise.
381 * sparc.cc: Likewise.
382 * x86_64.cc: Likewise.
383 * testsuite/testfile.cc: Likewise.
385 2009-10-28 Doug Kwan <dougkwan@google.com>
387 * arm.cc (Arm_relobj): New class definition.
388 (Arm_relobj::scan_sections_for_stubs,
389 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
390 New method definitions.
392 2009-10-28 Cary Coutant <ccoutant@google.com>
394 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
395 (Plugin::cleanup_done_): New member.
396 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
397 (Plugin_manager::cleanup_done_): Remove.
398 (Plugin_manager::add_input_file): Edit error message.
399 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
400 (Plugin_manager::cleanup): Remove use of cleanup_done_.
402 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
404 * fileread.cc: (File_read::View::~View): Use the new
405 data_ownership_ filed.
406 (File_read::~File_read): Dispose the new whole_file_view_.
407 (File_read::open): Mmap the whole file if needed.
408 (File_read::open): Use whole_file_view_ instead of contents_.
409 (File_read::find_view): Use whole_file_view_ if applicable.
410 (File_read::do_read): Use whole_file_view_ instead of contents_.
411 (File_read::make_view): Use whole_file_view_ instead of contents_,
412 update File_read::View::View call.
413 (File_read::find_or_make_view): Update File_read::View::View
415 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
417 (File_read::View::Data_ownership): New enum.
418 (File_read::View::View): Replace bool mapped_ with Data_ownership
420 (File_read::View::mapped_): Remove (replaced by data_ownership_).
421 (File_read::View::data_ownership_): New field.
422 (File_read::contents_): Remove (replaced by whole_file_view_).
423 (File_read::whole_file_view_): New field.
424 * options.h (class General_options): Add --keep-files-mapped.
426 2009-10-27 Cary Coutant <ccoutant@google.com>
428 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
429 * testsuite/Makefile.am (plugin_test_5): New test case.
430 * testsuite/Makefile.in: Regenerate.
432 2009-10-25 Doug Kwan <dougkwan@google.com>
434 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
435 from private to protected to allow access by child class.
436 (Sized_relobj::do_relocate_sections): New method declaration.
437 (Sized_relobj::relocate_sections): Virtualize.
438 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
439 Sized_relobj::relocate_sections. Instantiate template explicitly
440 for different target sizes and endianity.
442 2009-10-24 Doug Kwan <dougkwan@google.com>
444 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
445 (Arm_input_section::as_arm_input_section): New method.
446 (Arm_output_section): New class definition.
447 (Arm_output_section::create_stub_group,
448 Arm_output_section::group_sections): New method definitions.
450 2009-10-22 Doug Kwan <dougkwan@google.com>
452 * arm.cc (Arm_input_section): New class definition.
453 (Arm_input_section::init, Arm_input_section:do_write,
454 Arm_input_section::set_final_data_size,
455 Arm_input_section::do_reset_address_and_file_offset): New method
458 2009-10-21 Doug Kwan <dougkwan@google.com>
460 * arm.cc (Stub_table, Arm_input_section): New forward class
462 (Stub_table): New class defintion.
463 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
464 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
465 New method definition.
467 2009-10-21 Doug Kwan <dougkwan@google.com>
469 * arm.cc: Update copyright comments.
470 (Target_arm): New forward class template declaration.
471 (Arm_address): New type.
472 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
473 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
474 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
476 (Insn_template): Same.
477 (DEF_STUBS): New macro.
478 (Stub_type): New enum type.
479 (Stub_template): New class definition.
482 (Stub_factory): Same.
483 (Target_arm::Target_arm): Initialize may_use_blx_ and
484 should_force_pic_veneer_.
485 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
486 Target_arm::should_force_pic_veneer,
487 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
488 Target_arm::using_thumb_only, Target_arm:;default_target): New
490 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
491 New data member declarations.
492 (Insn_template::size, Insn_template::alignment): New method defintions.
493 (Stub_template::Stub_template): New method definition.
494 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
495 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
496 (Stub_factory::Stub_factory): New method definition.
497 * gold.h (string_hash): New template.
498 * output.h (Input_section_specifier::hash_value): Use
500 (Input_section_specifier::string_hash): Remove.
501 * stringpool.cc (Stringpool_template::string_hash): Use
504 2009-10-20 Doug Kwan <dougkwan@google.com>
506 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
507 symbols of relaxed input sections.
508 * output.h (Output_section::find_relaxed_input_section): Make
511 2009-10-16 Doug Kwan <dougkwan@google.com>
513 * dynobj.cc (Versions::Versions): Initialize version_script_.
514 Only insert base version symbol definition for a shared object
515 if version script defines any version versions.
516 (Versions::define_base_version): New method definition.
517 (Versions::add_def): Check that base version is not needed.
518 (Versions::add_need): Define base version lazily.
519 * dynobj.h (Versions::define_base_version): New method declaration.
520 (Versions::needs_base_version_): New data member declaration.
521 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
522 (check_DATA): Add no_version_test.stdout.
523 (libno_version_test.so, no_version_test.o no_version_test.stdout):
525 * testsuite/Makefile.in: Regenerate.
526 * testsuite/no_version_test.c: New file.
527 * testsuite/no_version_test.sh: Ditto.
529 2009-10-16 Doug Kwan <dougkwan@google.com>
531 * expression.cc (class Segment_start_expression): New class definition.
532 (Segment_start_expression::value): New method definition.
533 (script_exp_function_segment_start): Return a new
534 Segment_start_expression.
535 * gold/script-c.h (script_saw_segment_start_expression): New function
537 * script-sections.cc (Script_sections::Script_sections): Initialize
538 SAW_SEGMENT_START_EXPRESSION_ to false.
539 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
540 and -Tbbs options to specify section addresses if given in
541 command line and no SEGMENT_START expression is seen in a script.
542 * script-sections.h (Script_sections::saw_segment_start_expression,
543 Script_sections::set_saw_segment_start_expression): New method
545 (Script_sections::saw_segment_start_expression_): New data member
547 * script.cc (script_saw_segment_start_expression): New function.
548 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
549 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
550 script_test_7.sh and script_test_8.sh.
551 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
552 script_test_8.stdout.
553 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
554 (script_test_6, script_test_6.stdout, script_test_7,
555 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
556 * Makefile.in: Regenerate.
557 * testsuite/script_test_6.sh: New file.
558 * testsuite/script_test_6.t: Same.
559 * testsuite/script_test_7.sh: Same.
560 * testsuite/script_test_7.t: Same.
561 * testsuite/script_test_8.sh: Same.
563 2009-10-16 Doug Kwan <dougkwan@google.com>
565 * output.cc (Output_segment::set_section_list_address): Cast
566 expressions to unsigned long long type to avoid format warnings.
568 2009-10-15 Ian Lance Taylor <iant@google.com>
570 * script.cc (Script_options::add_symbol_assignment): Always add a
571 dot assignment to script_sections_.
572 * script-sections.cc (Script_sections::add_dot_assignment):
573 Initialize if necessary.
575 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
576 program headers with no load segment if there is a linker script.
578 * layout.cc (Layout::set_segment_offsets): Align the file offset
579 to the segment aligment for -N or -n with no load segment.
580 * output.cc (Output_segment::add_output_section): Don't crash if
581 the first section is a TLS section.
582 (Output_segment::set_section_list_addresses): Print an error
583 message if the address moves backward in a linker script.
585 (Output_section_element_input::set_section_addresses): Don't
586 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
587 (Orphan_output_section::set_section_addresses): Likewise.
589 2009-10-15 Doug Kwan <dougkwan@google.com>
591 * layout.cc (Layout::finish_dynamic_section): Generate tags
592 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
593 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
594 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
596 2009-10-14 Ian Lance Taylor <iant@google.com>
598 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
600 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
601 data_shdr fields of relinfo.
602 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
603 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
604 R_386_TLS_LDO_32, adjust based on section flags.
605 (Target_i386::Relocate::fix_up_ldo): Remove.
607 2009-10-13 Ian Lance Taylor <iant@google.com>
609 Add support for -pie.
610 * options.h (class General_options): Add -pie and
612 (General_options::output_is_position_independent): Test -pie.
613 (General_options::output_is_executable): Return true if not shared
615 (General_options::output_is_pie): Remove.
616 * options.cc (General_options::finalize): Reject incompatible uses
618 * gold.cc (queue_middle_tasks): A -pie link is not static.
619 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
620 * symtab.cc (Symbol::final_value_is_known): Return false if
621 output_is_position_independent.
622 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
623 output_is_position_independent.
624 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
625 output_is_position_independent.
626 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
627 output_is_position_independent.
628 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
630 (basic_pie_test.o, basic_pie_test): New targets.
631 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
632 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
633 (two_file_pie_test): New target.
634 * testsuite/Makefile.in: Rebuild.
635 * README: Remove note saying that -pie is not supported.
637 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
639 * options.h (class General_options): Add -init and -fini.
640 * layout.cc (Layout::finish_dynamic_section): Emit
641 given init and fini functions.
643 2009-10-13 Sriraman Tallam <tmsriram@google.com>
645 * gc.h (gc_process_relocs): Check if icf is enabled using new
647 * gold.cc (queue_initial_tasks): Likewise.
648 (queue_middle_tasks): Likewise.
649 * object.cc (do_layout): Likewise.
650 * symtab.cc (is_section_folded): Likewise.
651 * main.cc (main): Likewise.
652 * reloc.cc (Read_relocs::run): Likewise.
653 (Sized_relobj::do_scan_relocs): Likewise.
654 * icf.cc (is_function_ctor_or_dtor): New function.
655 (Icf::find_identical_sections): Check if function is ctor or dtor when
657 * options.h (General_options::icf): Change option to be an enum.
658 (Icf_status): New enum.
659 (icf_enabled): New method.
660 (icf_safe_folding): New method.
661 (set_icf_status): New method.
662 (icf_status_): New variable.
663 * (options.cc) (General_options::finalize): Set icf_status_.
664 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
665 icf_test and icf_keep_unique_test to use the --icf enum flag.
666 * testsuite/icf_safe_test.sh: New file.
667 * testsuite/icf_safe_test.cc: New file.
669 2009-10-12 Sriraman Tallam <tmsriram@google.com>
671 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
672 includes to gc.h and icf.h.
673 * arm.cc: Include gc.h.
676 * powerpc.cc: Likewise.
677 * sparc.cc: Likewise.
678 * x86_64.cc: Likewise.
679 * gc.h: Include icf.h.
681 2009-10-11 Ian Lance Taylor <iant@google.com>
683 * plugin.cc: Include "gold.h" before other header files.
685 2009-10-10 Chris Demetriou <cgd@google.com>
687 * options.h (Input_file_argument::Input_file_type): New enum.
688 (Input_file_argument::is_lib_): Replace with...
689 (Input_file_argument::type_): New member.
690 (Input_file_argument::Input_file_argument): Take Input_file_type
691 'type' rather than boolean 'is_lib' as second argument.
692 (Input_file_argument::is_lib): Use type_.
693 (Input_file_argument::is_searched_file): New function.
694 (Input_file_argument::may_need_search): Handle is_searched_file.
695 * options.cc (General_options::parse_library): Support -l:filename.
696 (General_options::parse_just_symbols): Update for Input_file_argument
698 (Command_line::process): Likewise.
699 * archive.cc (Archive::get_file_and_offset): Likewise.
700 * plugin.cc (Plugin_manager::release_input_file): Likewise.
701 * script.cc (read_script_file, script_add_file): Likewise.
702 * fileread.cc (Input_file::Input_file): Likewise.
703 (Input_file::will_search_for): Handle is_searched_file.
704 (Input_file::open): Likewise.
705 * readsyms.cc (Read_symbols::get_name): Likewise.
706 * testsuite/Makefile.am (searched_file_test): New test.
707 * testsuite/Makefile.in: Regenerate.
708 * testsuite/searched_file_test.cc: New file.
709 * testsuite/searched_file_test_lib.cc: New file.
711 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
712 Ian Lance Taylor <iant@google.com>
714 * descriptor.cc: Include <cstdio> and "binary-io.h".
715 (Descriptors::open): Open the files in binary mode always.
716 * script.cc (Lex::get_token): Treat \r as whitespace.
718 2009-10-09 Ian Lance Taylor <iant@google.com>
720 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
722 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
723 Ian Lance Taylor <iant@google.com>
725 * configure.ac: Check for readv function also.
726 * fileread.cc (readv): Define if not HAVE_READV.
727 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
729 * config.in: Regenerate.
730 * configure: Regenerate.
732 2009-10-09 Doug Kwan <dougkwan@google.com>
734 * layout.cc (Layout::make_output_section): Call target hook to make
735 ordinary output section.
736 (Layout::finalize): Adjust parameter list of call the
738 * layout.h (class Layout::section_list): New method.
739 * merge.h (Output_merge_base::entsize): Change visibility to public.
740 (Output_merge_base::is_string, Output_merge_base::do_is_string):
742 (Output_merge_string::do_is_string): New method.
743 * object.cc (Sized_relobj::do_setup): renamed from
744 Sized_relobj::set_up.
745 * object.h (Sized_relobj::adjust_shndx,
746 Sized_relobj::initializ_input_to_output_maps,
747 Sized_relobj::free_input_to_output_maps): Change visibilities to
749 (Sized_relobj::setup): Virtualize.
750 (Sized_relobj::do_setup): New method declaration.
751 (Sized_relobj::invalidate_section_offset,
752 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
753 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
754 * options.cc (parse_int): New function.
755 * options.h (parse_int): New declaration.
756 (DEFINE_int): New macro.
757 (stub_group_size): New option.
758 * output.cc (Output_section::Output_section): Initialize memebers
759 merge_section_map_, merge_section_by_properties_map_,
760 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
761 (Output_section::add_input_section): Handled deferred code-fill
762 generation and remove an old comment.
763 (Output_section::add_relaxed_input_section): New method definition.
764 (Output_section::add_merge_input_section): Use merge section by
765 properties map to speed to search. Update merge section maps
767 (Output_section::build_relaxation_map): New method definition.
768 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
770 (Output_section::relax_input_section): Renamed to
771 Output_section::convert_input_sections_to_relaxed_sections and change
772 interface to take a vector of pointers to relaxed sections.
773 (Output_section::find_merge_section,
774 Output_section::find_relaxed_input_section): New method definitions.
775 (Output_section::is_input_address_mapped,
776 Output_section::output_offset, Output_section::output_address):
777 Use output section data maps to speed up searching.
778 (Output_section::find_starting_output_address): Add comments.
779 (Output_section::do_write,
780 Output_section::write_to_postprocessing_buffer): Do code-fill
781 generation as appropriate.
782 (Output_section::get_input_sections): Invalidate relaxed input section
784 (Output_section::restore_states): Adjust type of checkpoint .
785 Invalidate relaxed input section map.
786 * output.h (Output_merge_base): New class declaration.
787 (Input_section_specifier): New class defintion.
788 (class Output_relaxed_input_section) Change base class to
789 Output_section_data_build.
790 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
791 base class initializer.
792 (Output_section::add_relaxed_input_section): New method declaration.
793 (Output_section::Input_section): Change visibility to protected.
794 (Output_section::Input_section::relobj,
795 Output_section::Input_section::shndx): Handle relaxed input sections.
796 Output_section::input_sections) Change visibility to protected. Also
797 define overload to return a non-const pointer.
798 (Output_section::Merge_section_properties): New class defintion.
799 (Output_section::Merge_section_by_properties_map,
800 Output_section::Output_section_data_by_input_section_map,
801 Output_section::Relaxation_map): New types.
802 (Output_section::relax_input_section): Rename method to
803 Output_section::convert_input_sections_to_relaxed_sections and change
804 interface to take a vector of relaxed section pointers.
805 (Output_section::find_merge_section,
806 Output_section::find_relaxed_input_section,
807 Output_section::build_relaxation_map,
808 Output_section::convert_input_sections_in_list_to_relaxed_sections):
809 New method declarations.
810 (Output_section::merge_section_map_
811 Output_section::merge_section_by_properties_map_,
812 Output_section::relaxed_input_section_map_,
813 Output_section::is_relaxed_input_section_map_valid_,
814 Output_section::generate_code_fills_at_write_): New data members.
816 (Output_section_element_input::set_section_addresses): Call
817 current_data_size and addralign methods of relaxed input sections.
818 (Orphan_output_section::set_section_addresses): Call current_data_size
819 and addralign methods of relaxed input sections.
820 * symtab.cc (Symbol_table::compute_final_value): Extract template
821 from the body of Symbol_table::sized_finalize_symbol.
822 (Symbol_table::sized_finalized_symbol): Call
823 Symbol_table::compute_final_value.
824 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
825 (Symbol_table::compute_final_value): New templated method declaration.
826 * target.cc (Target::do_make_output_section): New method defintion.
827 * target.h (Target::make_output_section): New method declaration.
828 (Target::relax): Add more parameters for input objects, symbol table
829 and layout. Adjust call to do_relax.
830 (Target::do_make_output_section): New method declaration.
831 (Target::do_relax): Add parameters for input objects, symbol table
834 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
836 * pread.c: Include stdio.h.
838 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
840 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
843 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
845 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
846 Change read_shndx type to unsigned int.
847 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
849 (Sized_dwarf_line_info::read_line_mappings): Likewise.
850 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
851 Change read_shndx type to unsigned int.
852 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
854 (Sized_dwarf_line_info::read_line_mappings): Likewise.
855 * layout.cc (Layout::create_symtab_sections): Cast the result of
856 local_symcount * symsize to off_t in the gold_assert.
858 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
860 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
861 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
863 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
864 (Arm_relocate_functions::thm_abs5): New function.
865 (Arm_relocate_functions::abs12): New function.
866 (Arm_relocate_functions::abs16): New function.
867 (Arm_relocate_functions::base_abs): New function.
868 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
869 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
870 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
872 (Scan::global): Likewise.
873 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
874 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
875 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
876 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
879 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
881 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
882 (Arm_relocate_functions::movt_prel): New function.
883 (Arm_relocate_functions::thm_movw_prel_nc): New function.
884 (Arm_relocate_functions::thm_movt_prel): New function.
885 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
886 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
887 (Scan::global, Relocate::relocate): Likewise.
888 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
890 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
892 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
894 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
896 (class Incremental_inputs_header): New class.
897 (Incremental_inputs_header_writer): Edit comment.
898 (Incremental_inputs_entry): New class.
899 (Incremental_inputs_entry_writer): Edit comment.
900 (Sized_incremental_binary::do_find_incremental_inputs_section):
901 Add *strtab_shndx parameter, fill it.
902 (Sized_incremental_binary::do_check_inputs): New method.
903 (Incremental_checker::can_incrementally_link_output_file): Use
904 Sized_incremental_binary::check_inputs.
905 (Incremental_inputs::report_command_line): Save command line in
908 (Incremental_binary::find_incremental_inputs_section): New
910 (Incremental_binary::do_find_incremental_inputs_section): Add
911 strtab_shndx parameter.
912 (Incremental_binary::do_check_inputs): New pure virtual method.
913 (Sized_incremental_binary::do_check_inputs): Declare.
914 (Incremental_checker::Incremental_checker): Add incremental_inputs
915 parameter, use it to initialize incremental_inputs_.
916 (Incremental_checker::incremental_inputs_): New field.
917 (Incremental_checker::command_line): New method.
918 (Incremental_checker::inputs): New method.
919 (Incremental_checker::command_line_): New field.
921 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
923 * incremental.cc: Include <cstdarg> and "target-select.h".
924 (vexplain_no_incremental): New function.
925 (explain_no_incremental): New function.
926 (Incremental_binary::error): New method.
927 (Sized_incremental_binary::do_find_incremental_inputs_section): New
929 (make_sized_incremental_binary): New function.
930 (open_incremental_binary): New function.
931 (can_incrementally_link_file): Add checks if output is ELF and has
933 * incremental.h: Include "elfcpp_file.h" and "output.h".
934 (Incremental_binary): New class.
935 (Sized_incremental_binary): New class.
936 (open_incremental_binary): Declare.
937 * object.cc (is_elf_object): Use
938 elfcpp::Elf_recognizer::is_elf_file.
939 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
940 * output.h (Output_file::filesize): New method.
942 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
944 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
946 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
947 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
949 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
951 (Arm_relocate_functions::movw_abs_nc): New function.
952 (Arm_relocate_functions::movt_abs): New function.
953 (Arm_relocate_functions::thm_movw_abs_nc): New function.
954 (Arm_relocate_functions::thm_movt_abs): New function.
955 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
956 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
957 (Scan::global): Likewise.
958 (Relocate::relocate): Likewise.
959 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
961 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
963 * arm.cc (Arm_relocate_functions::got_prel) New function.
964 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
965 (Relocate::relocate): Likewise.
966 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
968 2009-10-06 Ian Lance Taylor <iant@google.com>
970 * options.h (class General_options): Define
971 split_stack_adjust_size parameter.
972 * object.h (class Object): Add uses_split_stack_ and
973 has_no_split_stack_ fields. Add uses_split_stack and
974 has_no_split_stack accessor functions. Declare
975 handle_split_stack_section.
976 (class Reloc_symbol_changes): Define.
977 (class Sized_relobj): Define Function_offsets. Declare
978 split_stack_adjust, split_stack_adjust_reltype, and
980 * object.cc (Object::handle_split_stack_section): New function.
981 (Sized_relobj::do_layout): Call handle_split_stack_section.
982 * dynobj.cc (Sized_dynobj::do_layout): Call
983 handle_split_stack_section.
984 * reloc.cc (Sized_relobj::relocate_sections): Call
985 split_stack_adjust for executable sections in split_stack
986 objects. Pass reloc_map to relocate_section.
987 (Sized_relobj::split_stack_adjust): New function.
988 (Sized_relobj::split_stack_adjust_reltype): New function.
989 (Sized_relobj::find_functions): New function.
990 * target-reloc.h: Include "object.h".
991 (relocate_section): Add reloc_symbol_changes parameter. Change
993 * target.h (class Target): Add calls_non_split method. Declare
994 do_calls_non_split virtual method. Declare match_view and
996 * target.cc: Include "elfcpp.h".
997 (Target::do_calls_non_split): New function.
998 (Target::match_view): New function.
999 (Target::set_view_to_nop): New function.
1000 * gold.cc (queue_middle_tasks): Give an error if mixing
1001 split-stack and non-split-stack objects with -r.
1002 * i386.cc (Target_i386::relocate_section): Add
1003 reloc_symbol_changes parameter.
1004 (Target_i386::do_calls_non_split): New function.
1005 * x86_64.cc (Target_x86_64::relocate_section): Add
1006 reloc_symbol_changes parameter.
1007 (Target_x86_64::do_calls_non_split): New function.
1008 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
1010 * powerpc.cc (Target_powerpc::relocate_section): Add
1011 reloc_symbol_changes parameter.
1012 * sparc.cc (Target_sparc::relocate_section): Add
1013 reloc_symbol_changes parameter.
1014 * configure.ac: Call AM_CONDITIONAL for the default target.
1015 * configure: Rebuild.
1016 * testsuite/Makefile.am (TEST_AS): New variable.
1017 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
1018 (check_DATA): Add split_i386 and split_x86_64 files.
1019 (SPLIT_DEFSYMS): Define.
1020 (split_i386_[1234n].o): New targets.
1021 (split_i386_[124]): New targets.
1022 (split_i386_[1234r].stdout): New targets.
1023 (split_x86_64_[1234n].o): New targets.
1024 (split_x86_64_[124]): New targets.
1025 (split_x86_64_[1234r].stdout): New targets.
1026 (MOSTLYCLEANFILES): Add new executables.
1027 * testsuite/split_i386.sh: New file.
1028 * testsuite/split_x86_64.sh: New file.
1029 * testsuite/split_i386_1.s: New file.
1030 * testsuite/split_i386_2.s: New file.
1031 * testsuite/split_i386_3.s: New file.
1032 * testsuite/split_i386_4.s: New file.
1033 * testsuite/split_i386_n.s: New file.
1034 * testsuite/split_x86_64_1.s: New file.
1035 * testsuite/split_x86_64_2.s: New file.
1036 * testsuite/split_x86_64_3.s: New file.
1037 * testsuite/split_x86_64_4.s: New file.
1038 * testsuite/split_x86_64_n.s: New file.
1039 * testsuite/testfile.cc (Target_test): Update relocation_section
1041 * testsuite/Makefile.in: Rebuild.
1043 2009-10-06 Ian Lance Taylor <iant@google.com>
1045 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
1046 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
1047 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
1048 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
1049 the address on ldo_addrs_.
1050 (Target_i386::Relocate::fix_up_ldo): New function.
1052 2009-10-06 Rafael Espindola <espindola@google.com>
1054 * plugin.cc (add_input_library): New.
1055 (Plugin::load): Add add_input_library to tv.
1056 (Plugin_manager::add_input_file): Add the is_lib argument.
1057 (add_input_file): Update call to Plugin_manager::add_input_file.
1058 (add_input_library): New.
1059 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
1061 2009-09-30 Doug Kwan <dougkwan@google.com>
1063 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
1064 symbol and call Symbol::may_need_copy_reloc to determine if
1065 a copy reloc is needed.
1066 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
1067 nocopyreloc is given in command line.
1068 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
1069 given in command line.
1070 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
1071 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
1072 of the removed Target_i386::may_need_copy_reloc.
1073 * options.h (copyreloc): New option with default value false.
1074 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
1075 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
1076 instead of the removed Target_powerpc::may_need_copy_reloc.
1077 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
1078 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
1079 instead of the removed Target_sparc::may_need_copy_reloc.
1080 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
1081 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
1082 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
1083 instead of the removed Target_x86_64::may_need_copy_reloc.
1085 2009-09-30 Ian Lance Taylor <iant@google.com>
1087 * object.h (class Object): Remove target_ field, and target,
1088 sized_target, and set_target methods.
1089 (Object::sized_target): Remove.
1090 (class Sized_relobj): Update declarations. Remove sized_target.
1091 * object.cc (Sized_relobj::setup): Remove target parameter.
1093 (Input_objects::add_object): Don't do anything with the target.
1094 (make_elf_sized_object): Add punconfigured parameter. Change all
1095 callers. Set or test parameter target.
1096 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
1098 * parameters.cc (Parameters::set_target): Change parameter type to
1100 (Parameters::default_target): Remove.
1101 (set_parameters_target): Change parameter type to be non-const.
1102 (parameters_force_valid_target): New function.
1103 (parameters_clear_target): New function.
1104 * parameters.h (class Parameters): Update declarations. Remove
1105 default_target method. Add sized_target and clear_target
1106 methods. Change target_ to be non-const.
1107 (set_parameters_target): Update declaration.
1108 (parameters_force_valid_target): Declare.
1109 (parameters_clear_target): Declare.
1110 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
1111 as NULL if we aren't searching.
1112 (Add_symbols::run): Don't check for compatible target.
1113 * fileread.cc (Input_file::open_binary): Call
1114 parameters_force_valid_target.
1115 * gold.cc (queue_middle_tasks): Likewise.
1116 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
1117 set_target on object.
1118 * dynobj.h (class Sized_dynobj): Update declarations.
1119 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
1120 make_elf_object returns NULL.
1121 (Archive::include_member): Don't check whether object target is
1123 * output.cc (Output_section::add_input_section): Get target from
1125 (Output_section::relax_input_section): Likewise.
1126 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
1128 (Sized_relobj::do_scan_relocs): Likewise.
1129 (Sized_relobj::relocate_sections): Likewise.
1130 * resolve.cc (Symbol_table::resolve): Likewise.
1131 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
1132 parameter. Change all callers.
1133 (Symbol_table::add_from_object): Get target from parameters.
1134 (Symbol_table::add_from_relobj): Don't check object target.
1135 (Symbol_table::add_from_dynobj): Likewise.
1136 (Symbol_table::define_special_symbol): Get target from
1138 * symtab.h (class Symbol_table): Update declaration.
1139 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
1140 parameter. Change all callers. Clear parameter target.
1141 (Binary_test): Test target here.
1142 * testsuite/object_unittest.cc (gold_testsuite): Remove
1143 target_test_pointer parameter. Change all callers.
1144 (Object_test): Test target here.
1146 2009-09-26 Ian Lance Taylor <iant@google.com>
1148 * testsuite/initpri1.c: Don't try to use constructor priorities if
1149 compiling with gcc before 4.3.
1151 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
1153 * testsuite/retain_symbols_file_test.sh (check_present): Change
1154 output file name to retain_symbols_file_test.stdout.
1155 (check_absent): Likewise.
1157 2009-09-18 Craig Silverstein <csilvers@google.com>
1159 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
1160 * options.cc: Include <cerrno> and <fstream>.
1161 (General_options::finalize): Parse -retain-symbols-file tag.
1162 * options.h: New flag.
1163 (General_options): New method should_retain_symbol, new
1164 variable symbols_to_retain.
1165 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
1166 should_retain_symbol map.
1167 * testsuite/Makefile.am (retain_symbols_file_test): New test.
1168 * testsuite/Makefile.in: Regenerate.
1169 * testsuite/retain_symbols_file_test.sh: New file.
1171 2009-09-18 Nick Clifton <nickc@redhat.com>
1173 * po/es.po: Updated Spanish translation.
1175 2009-09-17 Doug Kwan <dougkwan@google.com>
1177 * debug.h (DEBUG_RELAXATION): New constant.
1178 (DEBUG_ALL): Add DEBUG_RELAXATION.
1179 (debug_string_to_enum): Add relaxation debug option.
1181 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
1182 Layout::Relaxation_debug_check::read_sections,
1183 Layout::Relaxation_debug_check::read_sections): New method definitions.
1184 (Layout::Layout): Initialize data members
1185 record_output_section_data_from_scrips_,
1186 script_output_section_data_list_ and relaxation_debug_check_.
1187 (Layout::save_segments, Layout::restore_segments,
1188 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
1189 Layout::relaxation_loop_body): New method definitions.
1190 (Layout::finalize): Support relaxation. Move section layout code to
1191 Layout::relaxation_loop_body.
1192 (Layout::set_asection_address_from_script): Move code for orphan
1193 section placement out.
1194 (Layout::place_orphan_sections_in_script): New method definition.
1195 * layout.h (Output_segment_headers, Output_file_header):
1196 New forward class declarations.
1197 (Layout::~Layout): Define.
1198 (Layout::new_output_section_data_from_script): New method definition.
1199 (Layout::place_orphan_sections_in_script): New method declaration.
1200 (Layout::Segment_states): New type declaration.
1201 (Layout::save_segments, Layout::restore_segments,
1202 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
1203 Layout::relaxation_loop_body): New method declarations.
1204 (Layout::Output_section_data_list): New type declaration.
1205 (Layout::Relaxation_debug_check): New class definition.
1206 (Layout::record_output_section_data_from_script_,
1207 Layout::script_output_section_data_list_, Layout::segment_states_,
1208 Layout::relaxation_debug_check_): New data members.
1209 * output.cc: (Output_section_headers::do_size): New method definition.
1210 (Output_section_headers::Output_section_headers): Move size
1211 computation to Output_section_headers::do_size.
1212 (Output_segment_headers::do_size): New method definition.
1213 (Output_file_header::Output_file_header): Move size computation to
1214 Output_file_header::do_size and call it.
1215 (Output_file_header::do_size): New method definition.
1216 (Output_data_group::Output_data_group): Adjust call to
1217 Output_section_data.
1218 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
1219 (Output_symtab_xindex::do_write): Add array bound check.
1220 (Output_section::Input_section::print_to_mapfile): Handle
1221 RELAXED_INPUT_SECTION_CODE.
1222 (Output_section::Output_section): Initialize data member checkpoint_.
1223 (Output_section::~Output_section): Delete checkpoint object pointed
1225 (Output_section::add_input_section): Always add an Input_section if
1227 (Output_section::add_merge_input_section): Add assert.
1228 (Output_section::relax_input_section): New method definition.
1229 (Output_section::set_final_data_size): Set load address to zero for
1230 an unallocated section.
1231 (Output_section::do_address_and_file_offset_have_reset_values):
1232 New method definition.
1233 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
1234 Handle relaxed input section.
1235 (Output_section::sort_attached_input_sections): Checkpoint input
1236 section list lazily.
1237 (Output_section::get_input_sections): Change type of input_sections to
1238 list of Simple_input_section pointers. Checkpoint input section list
1239 lazily. Also handle relaxed input sections.
1240 (Output_section::add_input_section_for_script): Take a reference to
1241 a Simple_input_section object instead of Relobj pointer and section
1242 index as parameter. Handle relaxed input sections.
1243 (Output_section::save_states, Output_section::restore_states): New
1245 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
1246 (Output_data::is_data_size_fixed): New method definition.
1247 (Output_data::reset_addresss_and_file_offset): Do not reset data size
1249 (Output_data::address_and_file_offset_have_reset_values): New method
1251 (Output_data::do_address_and_file_offset_have_reset_values): New method
1253 (Output_data::set_data_size): Check that data size is not fixed.
1254 (Output_data::fix_data_size): New method definition.
1255 (Output_data::is_data_size_fixed_): New data member.
1256 (Output_section_headers::set_final_data_size): New method definition.
1257 (Output_section_headers::do_size): New method declaration.
1258 (Output_segment_headers::set_final_data_size): New method definition.
1259 (Output_segment_headers::do_size): New method declaration.
1260 (Output_file_header::set_final_data_size)::New method definition.
1261 (Output_file_header::do_size)::New method declaration.
1262 (Output_section_data::Output_section_data): Add new parameter
1263 is_data_size_fixed and use it to fix data size.
1264 (Output_data_const::Output_data_const): Adjust call to base class
1265 constructor and fix data size.
1266 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
1267 base class constructor and fix data size.
1268 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
1269 base class constructor and fix data size.
1270 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
1271 class constructor and fix data size.
1272 (Output_data_group::set_final_data_size): New method definition.
1273 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
1274 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
1275 class constructor and fix data size.
1276 (Output_relaxed_input_section): New class definition.
1277 (Output_section::Simple_input_section): New class definition.
1278 (Output_section::get_input_sections): Adjust parameter list.
1279 (Output_section::add_input_section_for_script): Same.
1280 (Output_section::save_states, Output_section::restore_states,
1281 Output_section::do_address_and_file_offset_have_reset_values,
1282 (Output_section::Input_section::Input_section): Handle
1283 RELAXED_INPUT_SECTION_CODE. Add new overload for
1284 Output_relaxed_input_section.
1285 (Output_section::Input_section::is_input_section,
1286 Output_section::Input_section::set_output_section): Handle relaxed
1288 (Output_section::Input_section::is_relaxed_input_section,
1289 Output_section::Input_section::output_section_data,
1290 Output_section::Input_section::relaxed_input_section): New method
1292 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
1294 (Output_section::Input_section::u1_): Update comments.
1295 (Output_section::Input_section::u2_): Add new union member poris.
1296 (Output_section::Checkpoint_output_section): New classs definition.
1297 (Output_section::relax_input_section): New method declaration.
1298 (Output_section::checkpoint_): New data member.
1299 (Output_segment): Update comments.
1300 (Output_segment::Output_segment): Un-privatize copy constructor.
1301 (Output_segment::operator=): Un-privatize.
1302 * script-sections.cc (Output_section_element::Input_section_list):
1303 Change element type to Output_section::Simple_input_section.
1304 (Output_section_element_dot_assignment::set_section_addresses):
1305 Register output section data for relaxation clean up.
1306 (Output_data_exression::Output_data_expression): Adjust call to base
1307 constructor to fix data size.
1308 (Output_section_element_data::set_section_addresses): Register
1309 Output_data_expression object for relaxation clean up.
1310 (struct Input_section_info): Replace Relobj pointer and section index
1311 pair with Output_section::Simple_input_section and Convert struct to a
1313 (Input_section_sorter::operator()): Adjust access to
1314 Input_section_info data member to use accessors.
1315 (Output_section_element_input::set_section_addresses): Use layout
1316 parameter. Adjust code to use Output_section::Simple_input_section
1317 and Input_secction_info classes. Register filler for relaxation
1319 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
1320 and section index pair with Output_section::Simple_input_section
1321 class. Adjust code accordingly.
1322 (Phdrs_element::release_segment): New method definition.
1323 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
1325 (Script_sections::release_segments): New method definition.
1326 * gold/script-sections.h (Script_sections::release_segments): New
1328 * gold/target.h (Target::may_relax, Target::relax,
1329 Target::do_may_relax, Target::do_relax): New method definitions.
1331 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1333 * arm.cc (has_signed_unsigned_overflow): New function.
1334 (Arm_relocate_functions::abs8): New function.
1335 (Target_arm::Scan::local): Handle R_ARM_ABS8.
1336 (Target_arm::Scan::global): Likewise.
1337 (Target_arm::relocate::relocate): Likewise.
1338 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
1341 2009-09-16 Cary Coutant <ccoutant@google.com>
1343 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
1344 * testsuite/Makefile.in: Regenerate.
1346 2009-09-11 Nick Clifton <nickc@redhat.com>
1348 * po/gold.pot: Updated by the Translation project.
1350 2009-09-08 Cary Coutant <ccoutant@google.com>
1352 * output.cc (Output_file::open): Add execute permission to empty file.
1353 * testsuite/Makefile.am (permission_test): New test.
1354 * testsuite/Makefile.in: Regenerate.
1356 2009-09-02 Ian Lance Taylor <iant@google.com>
1358 * output.cc (Output_file::resize): Call map_no_anonymous rather
1361 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
1363 * gold.cc: Include "incremental.h".
1364 (queue_initial_tasks): Call Incremental_checker methods.
1365 * incremental.cc: Include "output.h".
1366 (Incremental_checker::can_incrementally_link_output_file): New
1368 * incremental.h (Incremental_checker): New class.
1370 * output.cc (Output_file::open_for_modification): New method.
1371 (Output_file::map_anonymous): Changed return type to bool. Record
1373 (Output_file::map_no_anonymous): New method, broken out of map.
1374 (Output_file::map): Use map_no_anonymous and map_anonymous.
1375 * output.h (class Output_file): Update declarations.
1377 2009-08-24 Cary Coutant <ccoutant@google.com>
1379 * options.h (Command_line::Pre_options): New class.
1380 (Command_line::pre_options): New member.
1381 * options.cc (gold::options::ready_to_register): New variable.
1382 (One_option::register_option): Do nothing if not registering options.
1383 Assert if same short option registered twice.
1384 (General_options::General_options): Turn off option registration when
1386 (Command_line::Pre_options::Pre_options): New constructor.
1388 2009-08-24 Cary Coutant <ccoutant@google.com>
1390 * options.h (General_options::no_keep_memory): Remove incorrect
1393 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1395 * Makefile.am (am__skiplex, am__skipyacc): New.
1396 * Makefile.in: Regenerate.
1398 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1400 * Makefile.am (AM_CPPFLAGS): Renamed from ...
1401 (INCLUDES): ... this.
1402 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
1403 (AM_CPPFLAGS): Renamed from ...
1404 (INCLUDE): ... this.
1405 * Makefile.in, testsuite/Makefile.in: Regenerate.
1407 * Makefile.in: Regenerate.
1408 * aclocal.m4: Likewise.
1409 * config.in: Likewise.
1410 * configure: Likewise.
1411 * testsuite/Makefile.in: Likewise.
1413 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
1414 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
1415 * Makefile.in: Regenerate.
1416 * testsuite/Makefile.in: Regenerate.
1418 2009-08-19 Cary Coutant <ccoutant@google.com>
1420 * resolve.cc (Symbol_table::resolve): Don't complain about defined
1421 symbols in shared libraries overridden by hidden or internal symbols
1422 in the main program.
1424 2009-08-19 Chris Demetriou <cgd@google.com>
1426 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
1427 checking source file names in error messages.
1429 2009-08-18 Doug Kwan <dougkwan@google.com>
1431 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
1432 an elcpp::Ehdr as parameter. Adjust call to set_target.
1433 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
1434 an elfcpp::Ehdr as parameter.
1435 * object.cc (Object::set_target): Remove the version that looks up
1436 a target and sets it.
1437 (Sized_relobj::setup): Take a Target object instead of
1438 an elfcpp::Ehdr as parameter. Adjust call to set_target.
1439 (make_elf_sized_object): Find target and ask target to
1441 * object.h: (Object::set_target): Remove the version that looks up
1442 a target and sets it.
1443 (Sized_relobj::setup): Take a Target object instead of
1444 an elfcpp:Ehdr as parameter.
1445 * target.cc: Include dynobj.h.
1446 (Target::do_make_elf_object_implementation): New.
1447 (Target::do_make_elf_object): New.
1448 * target.h (Target::make_elf_object): New template declaration.
1449 (Target::do_make_elf_object): New method declarations.
1450 (Target::do_make_elf_object_implementation): New template declaration.
1452 2009-08-14 Ian Lance Taylor <iant@google.com>
1454 * gold.h (FUNCTION_NAME): Define.
1455 (gold_unreachable): Use FUNCTION_NAME.
1457 2009-08-12 Sriraman Tallam <tmsriram@google.com>
1459 * icf.cc (Icf::find_identical_sections): Issue a warning when a
1460 symbol in the --keep-unique list is not found.
1462 2009-08-12 Sriraman Tallam <tmsriram@google.com>
1464 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
1465 been maked as --keep-unique.
1466 (Icf::unfold_section): New function.
1467 * icf.h (Icf::unfold_section): New function.
1468 * options.h (General_options::keep_unique): New option.
1469 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
1470 * testsuite/Makefile.in: Regenerate.
1471 * testsuite/icf_keep_unique_test.sh: New file.
1472 * testsuite/icf_keep_unique_test.cc: New file.
1474 2009-08-12 Cary Coutant <ccoutant@google.com>
1477 * resolve.cc (Symbol_table::resolve): Check for references from
1478 dynamic objects to hidden and internal symbols.
1479 * testsuite/Makefile.am (hidden_test.sh): New test.
1480 * testsuite/Makefile.in: Regenerate.
1481 * testsuite/hidden_test.sh: New script.
1482 * testsuite/hidden_test_1.c: New test source.
1483 * testsuite/hidden_test_main.c: New test source.
1485 2009-08-11 Doug Kwan <dougkwan@google.com>
1487 * arm.cc: Update comments.
1488 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
1489 segment to locate the .ARM.exidx section if present.
1491 2009-08-09 Doug Kwan <dougkwan@google.com>
1493 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
1496 2009-08-07 Sriraman Tallam <tmsriram@google.com>
1497 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
1500 2009-08-06 Sriraman Tallam <tmsriram@google.com>
1502 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
1503 valid tls_segment only for non-debug-section relocations.
1504 * testsuite/Makefile.am: Add gc_tls_test.
1505 * testsuite/Makefile.in: Regenerate.
1506 * testsuite/gc_tls_test.cc: New file.
1507 * testsuite/gc_tls_test.sh: New file.
1509 2009-08-05 Sriraman Tallam <tmsriram@google.com>
1513 * Makefile.am (CCFILES): Add icf.cc.
1515 * Makefile.in: Regenerate.
1516 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
1517 * gc.h (gc_process_relocs): Populate lists used by icf to contain
1518 section, symbol and addend information for the relocs.
1519 * gold.cc (queue_middle_tasks): Call identical code folding.
1520 * gold.h: Add defines for multimap.
1521 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
1522 to the call of finalize_local_symbols.
1523 * main.cc (main): Create object of class Icf.
1524 * object.cc (Sized_relobj::do_layout): Allow this function to be
1525 called twice during icf.
1526 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
1527 to sections marked as identical by icf.
1528 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
1530 (Sized_relobj::do_section_entsize): New function.
1531 * object.h (Object::section_entsize): New function.
1532 (Object::do_section_entsize): New pure virtual function.
1533 (Relobj::finalize_local_symbols): Add new parameter.
1534 (Relobj::do_section_entsize): New function.
1535 * options.h (General_options::icf): New option.
1536 (General_options::icf_iterations): New option.
1537 (General_options::print_icf_sections): New option.
1538 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
1539 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
1540 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
1542 * symtab.cc (Symbol_table::is_section_folded): New function.
1543 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
1544 to sections marked as identical by icf.
1545 * symtab.h (Symbol_table::set_icf): New function.
1546 (Symbol_table::icf): New function.
1547 (Symbol_table::is_section_folded): New function.
1548 (Symbol_table::icf_): New data member.
1549 * target-reloc.h (relocate_section): Ignore sections folded by icf.
1550 * testsuite/Makefile.am: Add commands to build icf_test.
1551 * testsuite/Makefile.in: Regenerate.
1552 * testsuite/icf_test.sh: New file.
1553 * testsuite/icf_test.cc: New file.
1555 2009-07-24 Chris Demetriou <cgd@google.com>
1557 * layout.cc (is_compressible_debug_section): Fix incorrect
1558 comment about compressed section names.
1560 2009-07-20 Ian Lance Taylor <ian@airs.com>
1563 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
1565 2009-07-16 Ian Lance Taylor <iant@google.com>
1568 * layout.h: #include <map>.
1569 (class Kept_section): Change from struct to class. Add accessors
1570 and setters. Add section size to Comdat_group mapping. Change
1571 Comdat_group to std::map. Add is_comdat_ field. Add
1572 linkonce_size field in union.
1573 (class Layout): Update declaration of find_or_add_kept_section.
1574 Don't declare find_kept_object.
1575 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
1576 parameter. Add object, shndx, is_comdat, and is_group_name
1577 parameters. Change all callers. Adjust for new Kept_section.
1578 (Layout::find_kept_object): Remove.
1579 * object.cc (Sized_relobj::include_section_group): Update use of
1580 Kept_section. Rename secnum to shndx. Only record
1581 Kept_comdat_section if sections are the same size.
1582 (Sized_relobj::include_linkonce_section): Update use of
1583 Kept_section. Only record Kept_comdat_section if sections are the
1584 same size. Set size of linkonce section.
1585 (Sized_relobj::map_to_kept_section): Update call to
1586 get_kept_comdat_section.
1587 * object.h (class Sized_relobj): Rename fields in
1588 Kept_comdat_section to drop trailing underscores; change object
1589 field to Relobj*. Change Kept_comdat_section_table to store
1590 struct rather than pointer.
1591 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
1592 Add kept_object and kept_shndx parameters. Change all callers.
1593 (Sized_relobj::get_kept_comdat_section): Change return type to
1594 bool. Add kept_object and kept_shndx parameters. Change all
1596 * plugin.cc (Pluginobj::include_comdat_group): Update call to
1597 Layout::find_or_add_kept_section.
1599 2009-07-09 Ian Lance Taylor <iant@google.com>
1601 * merge.cc (Object_merge_map::initialize_input_to_output_map):
1602 Reserve space in the hash table.
1604 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
1606 * fileread.cc (File_read::get_mtime): New method.
1607 * fileread.h (Timespec): New structure.
1608 (File_read::get_mtime): New method.
1609 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
1610 Renamed from timestamp_nsec.
1611 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
1613 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
1615 (Incremental_inputs::report_archive): Save mtime; style fix.
1616 (Incremental_inputs::report_obejct): Save mtime; style fix.
1617 (Incremental_inputs::report_script): Save mtime; style fix.
1618 (Incremental_inputs::finalize_inputs): Style fix.
1619 (Incremental_inputs::finalize): Style fix.
1620 (Incremental_inputs::create_input_section_data): Store inputs
1622 * incremental.h (Incremental_inputs::report_script): Add mtime
1624 (Incremental_inputs::Input_info::Input_info): Intialize only one
1626 (Incremental_inputs::Input_info::archive): Move to nameless
1628 (Incremental_inputs::Input_info::obejct): Move to nameless union.
1629 (Incremental_inputs::Input_info::script): Move to nameless union.
1630 (Incremental_inputs::mtime): New field.
1631 * script.cc (read_input_script): Pass file mtime to
1633 * script.h (Script_info::inputs): Style fix.
1635 2009-07-01 Ian Lance Taylor <ian@airs.com>
1637 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
1640 2009-06-24 Ian Lance Taylor <iant@google.com>
1643 * layout.cc (Layout::choose_output_section): If we find an
1644 existing section, update the flags.
1645 (Layout::create_notes): New function, broken out of
1647 (Layout::finalize): Don't create note sections.
1648 (Layout::create_note): Don't crash if linker script discards
1650 (Layout::create_gold_note): Likewise.
1651 (Layout::create_build_id): Likewise. Don't set
1652 after_input_sections on the section.
1653 (Layout::create_executable_stack_info): Remove target parameter.
1655 * layout.h (class Layout): Declare create_notes. Update
1656 declaration of create_executable_stack_info.
1657 * gold.cc (queue_middle_tasks): Call create_notes.
1658 * output.cc (Output_section::update_flags_for_input_section): Move
1659 here from output.h. If SHF_ALLOC flag is newly set, mark address
1661 * output.h (Output_data::mark_address_invalid): New function.
1662 (class Output_section): Only declare, not define,
1663 update_flags_for_input_section. Remove set_flags.
1665 2009-06-24 Ian Lance Taylor <iant@google.com>
1667 * script-sections.cc (Output_section_definition::
1668 set_section_addresses): Rename shadowing local load_address to
1671 2009-06-24 Ian Lance Taylor <iant@google.com>
1674 * reloc.cc (relocate_sections): Skip empty relocation sections.
1676 2009-06-23 Ian Lance Taylor <iant@google.com>
1679 * layout.cc (Layout::create_note): Use choose_output_section
1680 rather than make_output_section.
1682 2009-06-23 Ian Lance Taylor <iant@google.com>
1685 * options.cc (General_options::parse_V): Set printed_version_.
1686 (General_options::General_options): Initialize printed_version_.
1687 * options.h (class General_options): Add printed_version_ field.
1688 * gold.cc (queue_initial_tasks): If there are no input files,
1689 don't give a fatal error if we printed the version information.
1690 (queue_middle_tasks): If using -r with a shared object, give a
1691 fatal error rather than an ordinary error.
1693 2009-06-23 Ian Lance Taylor <iant@google.com>
1696 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
1697 (Layout::make_output_section): Set have_stabstr_section_ if we see
1698 a .stab*str section.
1699 (Layout::finalize): Call link_stabs_sections.
1700 (Layout::link_stabs_sections): New file.
1701 * layout.h (class Layout): Add have_stabstr_section_ field.
1702 Declare link_stabs_sections.
1704 2009-06-23 Doug Kwan <dougkwan@google.com>
1706 * Makefile.am (libgold_a_LIBADD): New.
1707 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
1708 * Makefile.in: Regenerate.
1709 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
1710 * configure: Regenerate.
1711 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
1712 * fileread.cc: Include sys/state.h
1713 * gold.h: Declare memmem and strndup if found missing.
1714 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
1716 2009-06-23 Ian Lance Taylor <iant@google.com>
1718 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
1719 * configure: Rebuild.
1721 2009-06-23 Ian Lance Taylor <iant@google.com>
1724 * object.cc (Object::section_contents): Don't try to get a view if
1725 the section has length zero.
1726 (Object::handle_gnu_warning_section): If the section is empty, use
1727 the name of the section as the warning.
1729 2009-06-23 Ian Lance Taylor <iant@google.com>
1732 * stringpool.h (class Stringpool_template): Add optimize_ field.
1733 (Stringpool_template::set_optimize): New function.
1734 * stringpool.cc (Stringpool_template::Stringpool_template):
1735 Initialize optimize_ field.
1736 (Stringpool_template::set_string_offsets): Test local optimize
1737 fild rather than parameter.
1738 * layout.cc (Layout::Layout): Call set_optimize on the section
1741 2009-06-22 Ian Lance Taylor <iant@google.com>
1744 * yyscript.y: Parse TARGET.
1745 * script.cc (script_set_target): New function.
1746 * script-c.h (script_set_target): Declare.
1747 * options.cc (General_options::string_to_object_format): Rename
1748 from string_to_object_format in anonymous namespace. Change
1750 * options.h (class General_options): Declare
1751 string_to_object_format.
1753 2009-06-22 Ian Lance Taylor <iant@google.com>
1755 * script-sections.cc (Script_sections::create_segments): Don't put
1756 program headers in a PT_LOAD segment if -n or -N.
1758 2009-06-22 Ian Lance Taylor <iant@google.com>
1761 * options.h (class General_options): Add -z lazy and -z now. Sort
1762 -z options into alphabetical order.
1763 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
1765 2009-06-21 Ian Lance Taylor <iant@google.com>
1767 * layout.cc (Layout::make_output_section): Call
1768 Target::new_output_section.
1769 (Layout::attach_allocated_section_to_segment): Put large section
1770 sections in a separate load segment with the large segment flag
1772 (Layout::segment_precedes): Sort large data segments after other
1774 (align_file_offset): New static function.
1775 (Layout::set_segment_offsets): Use align_file_offset.
1776 * output.h (class Output_section): Add is_small_section_ and
1777 is_large_section_ fields.
1778 (Output_section::is_small_section): New function.
1779 (Output_section::set_is_small_section): New function.
1780 (Output_section::is_large_section): New function.
1781 (Output_section::set_is_large_section): New function.
1782 (Output_section::is_large_data_section): New function.
1783 (class Output_segment): Add is_large_data_segment_ field.
1784 (Output_segment::is_large_data_segment): New function.
1785 (Output_segment::set_is_large_data_segment): New function.
1786 * output.cc (Output_section::Output_section): Initialize new
1788 (Output_segment::Output_segment): Likewise.
1789 (Output_segment::add_output_section): Add assertion that large
1790 data sections always go in large data segments. Force small data
1791 sections to the end of the list of data sections. Force small BSS
1792 sections to the start of the list of BSS sections. For large BSS
1793 sections to the end of the list of BSS sections.
1794 * symtab.h (class Symbol): Declare is_common_shndx.
1795 (Symbol::is_defined): Check Symbol::is_common_shndx.
1796 (Symbol::is_common): Likewise.
1797 (class Symbol_table): Define enum Commons_section_type. Update
1798 declarations. Add small_commons_ and large_commons_ fields.
1799 * symtab.cc (Symbol::is_common_shndx): New function.
1800 (Symbol_table::Symbol_table): Initialize new fields.
1801 (Symbol_table::add_from_object): Put small and large common
1802 symbols in the right list.
1803 (Symbol_table::sized_finalized_symbol): Check
1804 Symbol::is_common_shndx.
1805 (Symbol_table::sized_write_globals): Likewise.
1806 * common.cc (Symbol_table::do_allocate_commons): Allocate new
1807 common symbol lists. Don't call do_allocate_commons_list if the
1809 (Symbol_table::do_allocate_commons_list): Remove is_tls
1810 parameter. Add comons_section_type parameter. Change all
1811 callers. Handle small and large common symbols.
1812 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
1813 Symbol::is_common_shndx.
1814 * resolve.cc (symbol_to_bits): Likewise.
1815 * target.h (Target::small_common_shndx): New function.
1816 (Target::small_common_section_flags): New function.
1817 (Target::large_common_shndx): New function.
1818 (Target::large_common_section_flags): New function.
1819 (Target::new_output_section): New function.
1820 (Target::Target_info): Add small_common_shndx, large_common_shndx,
1821 small_common_section_flags, and large_common_section_flags
1823 (Target::do_new_output_section): New virtual function.
1824 * arm.cc (Target_arm::arm_info): Initialize new fields.
1825 * i386.cc (Target_i386::i386_info): Likewise.
1826 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1828 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
1829 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1830 (Target_x86_64::do_new_output_section): New function.
1831 * configure.ac: Define conditional MCMODEL_MEDIUM.
1832 * testsuite/Makefile.am (check_PROGRAMS): Add large.
1833 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
1834 (large_LDFLAGS): Define.
1835 * testsuite/large.c: New file.
1836 * testsuite/testfile.cc (Target_test::test_target_info):
1837 Initialize new fields.
1838 * configure, testsuite/Makefile.in: Rebuild.
1840 2009-06-05 Doug Kwan <dougkwan@google.com>
1842 * Makefile.am (CCFILES): Add target.cc.
1843 * Makefile.in: Regenerate.
1844 * i386.cc (class Target_i386): Define new virtual method to
1845 override do_is_local_label_name in parent.
1846 * object.cc (Sized_relobj::do_count_local_symbols): Discard
1847 local symbols if --discard-locals or -X is given.
1848 * options.h (class General_options): Declare new options
1849 '--discard-locals' and '-X' for discarding locals.
1850 * target.h (class Target): Define new methods is_local_label_name.
1851 Declare new virtual method do_is_local_label_name.
1852 * target.cc: New file.
1853 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
1854 (check_SCRIPTS): Add discard_locals_test.sh.
1855 (check_DATA): Add discard_local_tests.syms.
1856 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
1857 (discard_local_tests.syms, discard_locals_test.o): New make rules.
1858 * testsuite/Makefile.in: Regenerate.
1859 * testsuite/discard_locals_test.c: New file.
1860 * testsuite/discard_locals_test.sh: Same.
1862 2009-06-05 Doug Kwan <dougkwan@google.com>
1864 * object.cc (Sized_relobj::Sized_relobj): Initialize
1865 discarded_eh_frame_shndx_ to -1U.
1866 (Sized_relobj::do_layout): Record index of a discard .eh_frame
1868 (Sized_relobj::do_count_local_symbols): Skip local symbols in
1869 a discarded .eh_frame section.
1870 (Sized_relobj::do_finalize_local_symbols): Ditto.
1871 * object.h (class Sized_relobj): Declare new member
1872 discarded_eh_frame_shndx_.
1873 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
1874 (local_labels_test.o, local_labels_test): New rules.
1875 * testsuite/Makefile.in: Regenerate.
1877 2009-06-04 Doug Kwan <dougkwan@google.com>
1879 * layout.cc (Layout::section_name_mapping): Add mapping for
1880 special ARM sections.
1882 2009-06-03 Doug Kwan <dougkwan@google.com>
1884 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
1885 (utils::has_overflow): Same.
1887 2009-06-03 Ian Lance Taylor <iant@google.com>
1889 * layout.cc (Layout::section_name_mapping): New array, replacing
1890 Layout::linkonce_mapping.
1891 (Layout::section_name_mapping_count): New variable, replacing
1892 Layout::linkonce_mapping_count.
1893 (Layout::linkonce_output_name): Remove.
1894 (Layout::output_section_name): Rewrite.
1895 * layout.h (class Layout): Rename Linkonce_mapping to
1896 Section_name_mapping, linkonce_mapping to section_name_mapping,
1897 linkonce_mapping_count to section_name_mapping_count. Don't
1898 declare linkonce_output_name.
1900 2009-06-03 Doug Kwan <dougkwan@google.com>
1902 * gold/arm.cc (namespace utils): New.
1903 (Target_arm::reloc_is_non_pic): Define new method.
1904 (class Arm_relocate_functions): New.
1905 (Target_arm::Relocate::relocate): Handle relocation types used by
1908 2009-06-03 Ian Lance Taylor <iant@google.com>
1910 * arm.cc (Target_arm::scan::global): Use || instead of |.
1912 2009-06-02 Doug Kwan <dougkwan@google.com>
1914 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
1915 issued_non_pic_error_.
1916 (class Target_arm::Scan): Declare new method check_non_pic.
1917 Define new method symbol_needs_plt_entry.
1918 Declare new data member issued_non_pic_error_.
1919 (class Target_arm::Relocate): Declare new method
1920 should_apply_static_reloc.
1921 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
1922 (Target_arm::Scan::check_non_pic): Define new method.
1923 (Target_arm::Scan::local): Handle a small subset of reloc types used
1925 (Target_arm::Scan::local): Same.
1926 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
1928 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
1930 * incremental.cc (Incremental_inputs::report_command_line): Filter
1931 out --incremental-* options.
1933 2009-05-29 Doug Kwan <dougkwan@google.com>
1935 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
1937 (class Target_arm): Update comment.
1938 (Target_arm::Target_arm): Initialize new data members GOT_,
1939 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
1940 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
1941 and Target_arm::rel_dyn_section.
1942 Declare new_enum Target_arm::Got_type.
1943 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
1945 Update commments for member do_dynsym_value.
1946 (Target_arm::got_size, Target_arm::plt_section,
1947 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
1948 new methods inside class defintion.
1949 (Target_arm::got_section): Define new method.
1950 (Target_arm::rel_dyn_section): Same.
1951 (Output_data_plt_arm): New template class.
1952 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
1953 (Output_data_plt_arm:do_adjust_output_section): Define new method.
1954 (Output_data_plt_arm::add_entry): Same.
1955 (Output_data_plt_arm::first_plt_entry): Define new
1956 static data member for PLT instruction template.
1957 (Output_data_plt_arm::plt_entry): Same.
1958 (Output_data_plt_arm::do_write): Define new method.
1959 (Target_arm::make_plt_entry): Same.
1960 (Target_arm::do_finalize_sections): Same.
1961 (Target_arm::do_dynsym_value): Same.
1963 2009-05-28 Doug Kwan <dougkwan@google.com>
1965 * Makefile.am (TARGETSOURCES): Add arm.cc.
1966 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
1967 * Makefile.in: Regenerate.
1969 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
1971 2009-05-26 Doug Kwan <dougkwan@google.com>
1973 * options.cc (General_options::parse_exclude_libs). Fix a comment.
1974 (General_options::check_excluded_libs): Strip off directories in
1975 archive name before matching like GNU ld does.
1976 * testsuite/Makefile.am (MOSTLYCLEANFILES,
1977 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
1978 (exclude_libs_test_LDFLAGS): Add linker option
1979 -Wl,--exclude-libs,libexclude_libs_test_3
1980 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
1981 an explicit archive without using -l.
1982 (alt/libexclude_libs_test_3.a): New make rule.
1983 * testsuite/Makefile.in: Regenerate.
1984 * testsuite/exclude_libs_test.c : Declare lib3_default().
1986 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
1987 * exclude_libs_test_3.c: New file.
1989 2009-05-26 Nick Clifton <nickc@redhat.com>
1991 * po/id.po: New Indonesian translation.
1992 * po/gold.pot: Updated template file.
1994 2009-05-22 Sriraman Tallam <tmsriram@google.com>
1996 * testsuite/Makefile.am: Add -ffunction-sections to compile
1997 gc_comdat_test files. Add -Wl,--gc-sections to build
1999 * testsuite/Makefile.in: Regenerate.
2000 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
2002 2009-05-21 Sriraman Tallam <tmsriram@google.com>
2004 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
2005 kept comdat section was garbage collected.
2006 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
2007 * testsuite/Makefile.in: Regenerate.
2008 * testsuite/gc_comdat_test.sh: New file.
2009 * testsuite/gc_comdat_test_1.cc: New file.
2010 * testsuite/gc_comdat_test_2.cc: New file.
2012 2009-05-19 Doug Kwan <dougkwan@google.com>
2014 * archive.cc (Archive::Archive): Move constructor from archive.h
2015 to here. Initialize no_export_.
2016 (Archive::get_elf_object_for_member): Set no_export flag of object.
2017 * archive.h (Archive::Archive): Move constructor body to
2019 (Archive::no_export): New method.
2020 (Archive::no_export_): New field.
2021 * object.h (Object::Object): Initialize no_export_ to false.
2022 (Object::no_export, Object::set_no_export): New methods.
2023 (Object::no_export_): New field.
2024 * options.cc (General_options::parse_exclude_libs): New method.
2025 (General_options::check_excluded_libs) Same.
2026 * options.h (exclude_libs): New option.
2027 (General_options::check_excluded_libs): New method declaration.
2028 (General_options::excluded_libs_): New field.
2029 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
2030 default or protected visibility if an object has no-export flag set.
2031 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
2032 (check_SCRIPTS): Add exclude_libs_test.sh.
2033 (check_DATA): Add exclude_libs_test.syms.
2034 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
2035 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
2036 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
2037 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
2038 (exclude_libs_test.syms, libexclude_libs_test_1.a,
2039 libexclude_libs_test_2.a): New rules.
2040 * testsuite/Makefile.in: Regenerate.
2041 * testsuite/exclude_libs_test.c: New file.
2042 * testsuite/exclude_libs_test.sh: Ditto.
2043 * testsuite/exclude_libs_test_1.c: Ditto.
2044 * testsuite/exclude_libs_test_2.c: Ditto.
2046 2009-05-15 Ian Lance Taylor <iant@google.com>
2048 * configure.ac: Check for declarations for cases where libiberty.h
2049 checks HAVE_DECL_xxx.
2050 * configure, config.in: Rebuild.
2052 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
2054 * gold.h (Incremental_argument_list): Remove (invalid) forward
2056 * incremental.cc (Incremental_inputs::report_achive): New method.
2057 (Incremental_inputs::report_object): New method.
2058 (Incremental_inputs::report_script): New method.
2059 (Incremental_inputs::finalize_inputs): New method.
2060 (Incremental_inputs::finalize): Call finalize_inputs().
2061 (Incremental_inputs::sized_create_incremental_inputs_section_data):
2062 Create inputs entries.
2063 * incremental.h (Incremental_input_type): New enum.
2064 (Incremental_inputs::Incremental_input): Initialize new fields.
2065 (Incremental_inputs::report_inputs): New method.
2066 (Incremental_inputs::report_achive): New method.
2067 (Incremental_inputs::report_object): New method.
2068 (Incremental_inputs::report_script): New method.
2069 (Incremental_inputs::finalize_inputs): New method.
2070 (Incremental_inputs::Input_info): New struct.
2071 (Incremental_inputs::Input_info_map): New typedef.
2072 (Incremental_inputs::lock_): New field.
2073 (Incremental_inputs::Inputs_): New field.
2074 (Incremental_inputs::Inputs_map): New field.
2075 * main.cc (main): Call Incremental_input::report_inputs.
2076 * options.h (Input_argument_list): Typedef moved from
2078 (Input_file_group::Files): Remove, use ::Input_argument_list.
2079 (Input_file_group::Input_argument_list): Remove, use
2080 ::Input_argument_list.
2081 * plugin.cc (Plugin_manager::add_input_file): Add error in
2083 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
2085 * script.cc (read_input_script): Call
2086 Incremental_input::report_script.
2087 * script.h (Script_info): New class.
2089 2009-04-27 Ian Lance Taylor <iant@google.com>
2091 * x86_64.cc (do_adjust_output_section): Set entsize to
2094 2009-04-23 Elliott Hughes <enh@google.com>
2096 * output.cc (Output_file::close): After short writes, continue
2097 writing from the correct offset in the buffer being written.
2099 2009-04-23 Chris Demetriou <cgd@google.com>
2101 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
2102 * configure: Regenerate.
2103 * config.in: Regenerate.
2104 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
2105 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
2107 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
2109 * incremental.cc (Incremental_inputs_header_data): Renamed from
2110 Incremental_input_header_data.
2111 (Incremental_inputs_header_data::data_size): New field.
2112 (Incremental_inputs_header_data::put_input_file_count): Renamed
2113 from input_file_count.
2114 (Incremental_inputs_header_data::put_command_line_offset): Renamed
2115 from command_line_offset.
2116 (Incremental_inputs_header_data::put_reserved): Renamed from
2118 (Incremental_inputs_entry_data): Renamed from
2119 Incremental_input_entry_data.
2120 (Incremental_inputs_entry_data::data_size): New field.
2121 (Incremental_inputs::report_command_line): New method.
2122 (Incremental_inputs::finalize): New method.
2123 (Incremental_inputs::create_incremental_inputs_data): New method.
2124 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
2125 * incremental.h: New file.
2126 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
2127 (Layout::finalize): Create incremental inputs section in
2129 (Layout::create_incremental_info_sections): New method.
2130 * layout.h (Layout::incremental_inputs): New method.
2131 (Layout::create_incremental_info_sections): New method.
2132 (Layout::incremental_inputs_): New field.
2133 * main.cc (main): Notify Incremental_input of the command line.
2135 2009-04-01 Ian Lance Taylor <iant@google.com>
2136 Mikolaj Zalewski <mikolajz@google.com>
2138 * gold.h (reserve_unordered_map): Define, three versions, one for
2139 each version of Unordered_map.
2140 * layout.cc (Layout::Layout): Remove options parameter. Add
2141 number_of_input_files parameter. Don't initialize options_.
2142 Initialize number_of_input_files_ and resized_signatures_. Move
2143 sections_are_attached_.
2144 (Layout::layout_group): Reserve space for group_signatures_.
2145 (Layout::find_or_add_kept_section): Change name parameter to be a
2146 reference. Resize signatures_ map when it gets large enough.
2147 (Layout::layout_eh_frame): Use parameters->options() instead of
2149 (Layout::make_output_section): Likewise.
2150 (Layout::attach_allocated_section_to_segment): Likewise.
2151 (Layout::finalize, Layout::create_executable_stack): Likewise.
2152 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
2153 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
2154 * layout.h (class Layout): Update declarations. Remove options_
2155 field. Add number_of_input_files_ and resized_signatures_
2156 fields. Move sections_are_attached_ field.
2157 * main.cc (main): Pass number of input files to Layout
2158 constructor. Don't pass options.
2160 2009-03-30 Ian Lance Taylor <iant@google.com>
2162 * ffsll.c (ffsll): Correct implementation.
2164 2009-03-27 Ian Lance Taylor <iant@google.com>
2166 * ffsll.c: New file.
2167 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
2168 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
2169 * ftruncate.c (ftruncate): Declare before definition.
2170 * mremap.c (mremap): Likewise.
2171 * pread.c (pread): Likewise.
2172 * configure, Makefile.in, config.in: Rebuild.
2174 * mremap.c: New file.
2175 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
2176 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
2177 (mremap): Declare if HAVE_MREMAP is not defined.
2178 * configure, Makefile.in, config.in: Rebuild.
2180 2009-03-27 Cary Coutant <ccoutant@google.com>
2182 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
2183 position independent.
2184 * sparc.cc (Target_sparc::check_non_pic): Likewise.
2185 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
2187 2009-03-24 Cary Coutant <ccoutant@google.com>
2189 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
2191 (needs_dynamic_reloc): Likewise.
2193 2009-03-24 Ian Lance Taylor <iant@google.com>
2195 * yyscript.y (file_cmd): Recognize EXTERN.
2196 (extern_name_list, extern_name_list_body): New nonterminals.
2197 * script.cc (script_add_extern): Define.
2198 * script-c.h (script_add_extern): Declare.
2200 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
2202 * object.cc (is_elf_object): Define.
2203 * object.h (is_elf_object): Declare.
2204 * archive.cc (Archive::get_elf_object_for_member): Call
2206 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
2208 2009-03-24 Elliott Hughes <enh@google.com>
2210 * output.cc (Output_file::map_anonymous): Define.
2211 (Output_file::map): Use map_anonymous. If the regular mmap fails,
2212 try an anonymous one. Report the size if the mmap fails.
2213 * output.h (class Output_file): Declare map_anonymous.
2215 2009-03-24 Ian Lance Taylor <iant@google.com>
2217 * target-select.cc (instantiate_target): Don't acquire the lock if
2218 the instantiated_target_ field has already been set.
2220 2009-03-23 Ian Lance Taylor <iant@google.com>
2222 * gold-threads.h (class Initialize_lock): Define.
2223 * gold-threads.cc (class Initialize_lock_once): Define.
2224 (initialize_lock_control): New static variable.
2225 (initialize_lock_pointer): New static variable.
2226 (initialize_lock_once): New static function.
2227 (Initialize_lock::Initialize_lock): Define.
2228 (Initialize_lock::initialize): Define.
2229 * target-select.h: Include "gold-threads.h".
2230 (class Target_selector): Add lock_ and initialize_lock_ fields.
2231 Don't define instantiate_target, just declare it.
2232 * target-select.cc (Target_selector::Target_selector): Initialize
2234 (Target_selector::instantiate_target): Define.
2235 * descriptors.h: Include "gold-threads.h".
2236 (class Descriptors): Add initialize_lock_ field.
2237 * descriptors.cc (Descriptors::Descriptors): Initialize new
2239 (Descriptors::open): Use initialize_lock_ field
2240 * errors.h (class Errors): Add initialize_lock_ field.
2241 * errors.cc (Errors::Errors): Initialize new field.
2242 (Errors::initialize_lock): Use initialize_lock_ field.
2243 * powerpc.cc (class Target_selector_powerpc): Remove
2244 instantiated_target_ field. In do_recognize call
2245 instantiate_target rather than do_instantiate_target. In
2246 do_instantiate_target just allocate a new target.
2247 * sparc.cc (class Target_selector_sparc): Likewise.
2249 * freebsd.h: New file.
2250 * i386.cc: Include "freebsd.h".
2251 (Target_i386): Derive from Target_freebsd rather than
2253 (Target_selector_i386): Derive from Target_selector_freebsd rather
2254 than Target_selector.
2255 * x86_64.cc: Include "freebsd.h".
2256 (Target_x86_64): Derive from Target_freebsd rather than
2258 (Target_selector_x86_64): Derive from Target_selector_freebsd
2259 rather than Target_selector.
2260 * target.h (class Target): Add adjust_elf_header and
2261 do_adjust_elf_header.
2262 * output.cc (Output_file_header:: do_sized_write): Call target
2263 adjust_elf_header routine.
2264 * configure.tgt: Set targ_osabi.
2265 * configure.ac: Define GOLD_DEFAULT_OSABI.
2266 * parameters.cc (Parameters::default_target): Pass
2267 GOLD_DEFAULT_OSABI to select_target.
2268 * target-select.h (class Target_selector): Make instantiate_target
2269 protected rather than private.
2270 * Makefile.am (HFILES): Add freebsd.h.
2271 * configure, Makefile.in, config.in: Rebuild.
2273 * merge.cc (do_add_input_section): Correct pend value. Change
2274 message about last entry not being null terminated from error to
2277 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
2279 * incremental.cc: New file.
2280 * Makefile.am (CCFILES): Add incremental.cc.
2281 * Makefile.in: Rebuild.
2283 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
2285 * layout.cc (Layout::output_section_name): Preserve names
2286 of '.note.' sections.
2288 2009-03-19 Ian Lance Taylor <iant@google.com>
2290 * descriptors.cc (Descriptors::open): Check that the options are
2291 valid before using them.
2293 2009-03-18 Ian Lance Taylor <iant@google.com>
2295 * script-sections.h: Include <list>.
2296 (class Script_sections): Change Sections_elements from std::vector
2297 to std::list. Typedef public Elements_iterator. Add
2298 orphan_section_placement_, data_segment_align_start_, and
2299 saw_data_segment_align_ fields. Remove data_segment_align_index_
2301 * script-sections.cc (class Orphan_section_placement): New class.
2302 (class Sections_element): Add virtual functions is_relro and
2303 orphan_section_init. Remove virtual function place_orphan_here.
2304 (class Output_section_definition): Add is_relro and
2305 orphan_section_init. Remove place_orphan_here.
2306 (class Orphan_output_section): Likewise.
2307 (Script_sections::Script_sections): Update for field changes.
2308 (Script_sections::data_segment_align): Set saw_data_segment_align_
2309 and data_segment_align_start_, not data_segment_align_index.
2310 (Script_sections::data_segment_relro_end): Check
2311 saw_data_segment_align_. Use data_segment_align_start_ rather
2312 than data_segment_align_index_.
2313 (Script_sections::place_orphan): Rewrite to use
2314 Orphan_section_placement.
2316 2009-03-17 Ian Lance Taylor <iant@google.com>
2318 * archive.cc (Archive::add_symbols): Check for a version attached
2319 to the symbol name in the archive map.
2320 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
2321 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
2322 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
2323 (ver_test_11.a): New target.
2324 * testsuite/Makefile.in: Rebuild.
2326 * configure.ac: Check for chsize and posix_fallocate. Replace
2328 * ftruncate.c: New file, from gnulib.
2329 * output.cc (posix_fallocate): Define dummy version if not
2330 HAVE_POSIX_FALLOCATE.
2331 (Output_file::map): Call posix_fallocate rather than lseek and
2333 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
2334 * configure, Makefile.in, config.in: Rebuild.
2336 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
2338 * layout.h (Layout::create_note): Add section_name parameter.
2339 * layout.cc (Layout::create_note): Likewise.
2340 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
2342 2009-03-17 Ian Lance Taylor <iant@google.com>
2344 * descriptors.cc: Include "options.h".
2345 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
2346 (Descriptors::open): Always use O_CLOEXEC when opening a new
2347 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
2348 then set FD_CLOEXEC.
2350 * sparc.cc (class Target_sparc): Add has_got_section.
2351 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
2352 make sure we have a GOT section.
2354 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
2355 (Target_sparc::Scan::local): Likewise.
2356 (Target_sparc::Scan::global): Likewise.
2357 (Target_sparc::Relocate::relocate): Likewise.
2358 (Target_sparc::Relocate::relocate_tls): Likewise.
2360 * symtab.cc (Symbol_table::define_default_version): New function,
2361 broken out of add_from_object.
2362 (Symbol_table::add_from_object): Call define_default_version.
2363 (Symbol_table::define_special_symbol): Add resolve_oldsym
2364 parameter. Change all callers. If the version for a symbol comes
2365 from a version script, resolve it with the symbol with the same
2366 name with no version. Also add the symbol without a version if
2368 (do_define_in_output_data): If resolving with oldsym, don't delete
2370 (do_define_in_output_segment): Likewise.
2371 (do_define_as_constant): Likewise.
2372 * symtab.h (class Symbol_table): Update declarations.
2374 2009-03-13 Ian Lance Taylor <iant@google.com>
2376 * readsyms.cc (Read_symbols::incompatible_warning): New function.
2377 (Read_symbols::requeue): New function.
2378 (Read_symbols::do_read_symbols): If make_elf_object fails because
2379 the target type is not configured, and the file was searched for,
2380 issue a warning and retry with the next directory.
2381 (Add_symbols::run): If the file has an incompatible format, and
2382 it was searched for, requeue the Read_symbols task. On error,
2384 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
2385 dirindex parameter to constructor. Change all callers. Declare
2386 incompatible_warning and requeue.
2387 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
2388 input_argument_ and input_group_ fields. Add them to
2389 constructor. Change all callers.
2390 (class Read_script): Add dirindex_ field. Add it to constructor.
2392 * archive.cc (Archive::setup): Remove input_objects parameter.
2394 (Archive::get_file_and_offset): Likewise.
2395 (Archive::read_all_symbols): Likewise.
2396 (Archive::read_symbols): Likewise.
2397 (Archive::get_elf_object_for_member): Remove input_objects
2398 parameter. Add punconfigured parameter. Change all callers.
2399 (Archive::add_symbols): Change return type to bool. Check return
2400 value of include_member.
2401 (Archive::include_all_members): Likewise.
2402 (Archive::include_member): Change return type to bool. Return
2403 false if first included object has incompatible target. Set
2404 included_member_ field.
2405 (Add_archive_symbols::run): If add_symbols returns false, requeue
2407 * archive.h (class Archive): Add included_member_ field.
2408 Initialize it in constructor. Add input_file and searched_for
2409 methods. Update declarations.
2410 (class Add_archive_symbols): Add dirpath_, dirindex_, and
2411 input_argument_ fields. Add them to constructor. Change all
2413 * script.cc: Include "target-select.h".
2414 (class Parser_closure): Add skip_on_incompatible_target_ and
2415 found_incompatible_target_ fields. Add
2416 skip_on_incompatible_target parameter to constructor. Change all
2417 callers. Add methods skip_on_incompatible_target,
2418 clear_skip_on_incompatible_target, found_incompatible_target, and
2419 set_found_incompatible_target.
2420 (read_input_script): Add dirindex parameter. Change all callers.
2421 If parser finds an incompatible target, requeue Read_symbols
2423 (script_set_symbol): Clear skip_on_incompatible_target in
2425 (script_add_assertion, script_parse_option): Likewise.
2426 (script_start_sections, script_add_phdr): Likewise.
2427 (script_check_output_format): New function.
2428 * script.h (read_input_script): Update declaration.
2429 * script-c.h (script_check_output_format): Declare.
2430 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
2431 (ignore_cmd): Remove OUTPUT_FORMAT.
2432 * fileread.cc (Input_file::Input_file): Add explicit this.
2433 (Input_file::will_search_for): New function.
2434 (Input_file::open): Add pindex parameter. Change all callers.
2435 * fileread.h (class Input_file): Add input_file_argument method.
2436 Declare will_search_for. Update declarations.
2437 * object.cc (make_elf_object): Add punconfigured parameter.
2439 * object.h (class Object): Make input_file public. Add
2440 searched_for method.
2441 (make_elf_object): Update declaration.
2442 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
2444 * dirsearch.h (class Dirsearch): Update declaration.
2445 * options.h (class General_options): Add --warn-search-mismatch.
2446 * parameters.cc (Parameters::is_compatible_target): New function.
2447 * parameters.h (class Parameters): Declare is_compatible_target.
2448 * workqueue.cc (Workqueue::add_blocker): New function.
2449 * workqueue.h (class Workqueue): Declare add_blocker.
2451 * fileread.cc (Input_file::open): Remove options parameter.
2453 (Input_file::open_binary): Likewise.
2454 * script.cc (read_input_script): Likewise.
2455 * readsyms.h (class Read_symbols): Remove options_ field. Remove
2456 options parameter from constructor. Change all callers.
2457 (class Read_script): Likewise.
2458 * fileread.h (class Input_file): Update declarations.
2459 * script.h (read_input_script): Update declaration.
2461 2009-03-10 Nick Clifton <nickc@redhat.com>
2463 * po/es.po: New Spanish translation.
2465 2009-03-06 Cary Coutant <ccoutant@google.com>
2467 * options.cc (parse_short_option): Keep dash_z from registering itself.
2469 2009-03-03 Ian Lance Taylor <iant@google.com>
2472 * target-reloc.h (relocate_section): Pass output_section to
2474 * i386.cc (Target_i386::should_apply_static_reloc): Add
2475 output_section parameter. Change all callers.
2476 (Target_i386::Relocate::relocate): Add output_section parameter.
2477 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2478 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2479 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2480 * testsuite/two_file_shared.sh: New script.
2481 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
2482 (check_DATA): Add two_file_shared.dbg.
2483 (two_file_shared.dbg): New target.
2484 * testsuite/Makefile.in: Rebuild.
2486 2009-03-01 Ian Lance Taylor <iant@google.com>
2488 * configure.ac: Check for byteswap.h.
2489 * configure: Rebuild.
2490 * config.in: Rebuild.
2492 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
2494 * layout.cc (Layout::find_or_add_kept_section): New function.
2495 (Layout::add_comdat): Removed.
2496 * layout.h (struct Kept_section): Move out of class Layout.
2497 Remove trailing underscores from field names. Add group_sections
2498 field. Rename group_ field to is_group. Change all uses.
2499 (class Layout): Declare find_or_add_kept_section, not add_comdat.
2500 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
2501 comdat_groups_ field.
2502 (Sized_relobj::include_section_group): Use
2503 find_or_add_kept_section and Kept_section::group_sections.
2504 (Sized_relobj::include_linkonce_section): Likewise.
2505 * object.cc (class Sized_relobj): Don't define Comdat_group or
2506 Comdat_group_table. Remove find_comdat_group and
2507 add_comdat_group. Remove comdat_groups_ field.
2508 * plugin.cc (include_comdat_group): Use
2509 Layout::find_or_add_kept_section.
2511 2009-02-28 Ian Lance Taylor <iant@google.com>
2513 * README: --gc-sections and map files are now supported. Document
2514 some build requirements.
2517 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
2518 relocatable link set the value of the section symbol to zero.
2519 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
2520 relocatable link don't include the section address in the local
2523 2009-02-27 Ian Lance Taylor <iant@google.com>
2526 * options.h (class Search_directory): Add is_system_directory.
2527 (class General_options): Declare is_in_system_directory.
2528 * options.cc (get_relative_sysroot): Make static.
2529 (get_default_sysroot): Make static.
2530 (General_optoins::is_in_system_directory): New function.
2531 * fileread.cc (Input_file::is_in_system_directory): New function.
2532 * fileread.h (class Input_file): Declare is_in_system_directory.
2533 * object.h (class Object): Add is_in_system_directory.
2534 (class Input_objects): Remove system_library_directory_ field.
2535 * object.cc (Input_objects::add_object): Don't set
2536 system_library_directory_.
2537 (input_objects::found_in_system_library_directory): Remove.
2538 * symtab.cc (Symbol_table::write_globals): Remove input_objects
2539 parameter. Change all callers.
2540 (Symbol_table::sized_write_globals): Likewise.
2541 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
2542 Call Object::is_in_system_directory.
2543 * symtab.h (class Symbol_table): Update declarations.
2546 * descriptors.h (Open_descriptor): Add is_on_stack field.
2547 * descriptors.cc (Descriptors::open): If the descriptor is on the
2548 top of the stack, remove it. Initialize is_on_stack field.
2549 (Descriptors::release): Only add pod to stack if it is not on the
2551 (Descriptors::close_some_descriptor): Clear stack_next and
2555 * output.cc (Output_section::find_starting_output_address): Rename
2556 from starting_output_address; add PADDR parameter; change return
2558 * output.h (class Output_section): Declare
2559 find_starting_output_address instead of starting_output_address.
2560 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
2561 section symbol for which we can't find a merge section.
2564 * symtab.cc (Symbol_table::add_from_object): If the visibility is
2565 hidden or internal, force the symbol to be local.
2566 * resolve.cc (Symbol::override_visibility): Define.
2567 (Symbol::override_base): Use override_visibility.
2568 (Symbol_table::resolve): Likewise.
2569 (Symbol::override_base_with_special): Likewise.
2570 (Symbol_table::override_with_special): If the visibility is hidden
2571 or internal, force the symbol to be local.
2572 * symtab.h (class Symbol): Add set_visibility and
2573 override_visibility.
2574 * testsuite/ver_test_1.sh: New file.
2575 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
2576 (check_DATA): Add ver_test_1.syms.
2577 (ver_test_1.syms): New target.
2578 * testsuite/Makefile.in: Rebuild.
2580 2009-02-25 Cary Coutant <ccoutant@google.com>
2582 * layout.cc (Layout::choose_output_section): Don't rename sections
2583 when using a linker script that has a SECTIONS clause.
2584 * Makefile.in: Regenerate.
2586 * testsuite/Makefile.am (script_test_5.sh): New test case.
2587 * testsuite/Makefile.in: Regenerate.
2588 * testsuite/script_test_5.cc: New file.
2589 * testsuite/script_test_5.sh: New file.
2590 * testsuite/script_test_5.t: New file.
2592 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
2594 * archive.cc (Archive::include_member): Update calls to add_symbols.
2595 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
2596 the Layout argument.
2597 * dynobj.h (do_add_symbols): Add the Layout argument.
2598 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
2600 * object.h (Object::add_symbols): Add the Layout argument.
2601 (Object::do_add_symbols): Add the Layout argument.
2602 (Sized_relobj::do_add_symbols): Add the Layout argument.
2603 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
2604 Unify the two versions.
2605 (Add_plugin_symbols): Remove.
2606 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
2607 (Sized_pluginobj::do_add_symbols): Unify the two versions.
2608 (Add_plugin_symbols): Remove.
2609 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
2610 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
2611 (Add_symbols::run): Make it work with Pulginobj.
2613 2009-02-06 Ian Lance Taylor <iant@google.com>
2615 * object.cc (Sized_relobj::do_layout): Make info message start
2616 with lower case letter.
2618 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
2620 * binary.cc: Fix file comment.
2622 * options.h (enum Incremental_disposition): Define.
2623 (class General_options): Add new options: --incremental,
2624 --incremental_changed, --incremental_unchanged,
2625 --incremental_unknown. Add incremental_disposition_ and
2626 implicit_incremental_ fields.
2627 (General_options::incremental_disposition): New function.
2628 (class Position_dependent_options): Add incremental_disposition
2630 (Position_dependent_options::copy_from_options): Set incremental
2632 * options.cc (General_options::parse_incremental_changed): New
2634 (General_options::parse_incremental_unchanged): New function.
2635 (General_options::parse_incremental_unknown): New function.
2636 (General_options::General_options): Initialize new fields
2637 incremental_disposition_ and implicit_incremental_.
2638 (General_options::finalize): Check for uasge of --incremental-*
2639 without --incremental.
2641 2009-02-06 Chris Demetriou <cgd@google.com>
2643 * gold.h (gold_undefined_symbol): Change to take only a Symbol
2644 pointer and to report location as the file name associated with
2646 (gold_undefined_symbol_at_location): New function to replace the
2647 old gold_undefined_symbol functionality.
2648 * target-reloc.h (relocate_section): Update to use
2649 gold_undefined_symbol_at_location.
2650 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
2651 Call gold_undefined_symbol function rather than gold_error.
2652 * errors.h (Errors::undefined_symbol): Take location as a
2653 string, rather than calculating it from a relocation.
2654 * errors.cc (Errors::fatal): Print "fatal error:" before the
2656 (Errors::error, Errors::error_at_location): Print "error: "
2657 before the formatted message.
2658 (Errors::undefined_symbol): Take location as a string, rather
2659 than calculating it from a relocation.
2660 (gold_undefined_symbol_at_location): New function akin to
2661 old gold_undefined_symbol, calculates location from relocation.
2662 (gold_undefined_symbol): Change to take only a Symbol pointer
2663 and to report location as the file name associated with the symbol.
2664 * testsuite/debug_msg.sh: Update for changed error messages.
2665 * testsuite/undef_symbol.sh: Likewise.
2667 2009-02-04 Duncan Sands <baldrick@free.fr>
2670 * reduced_debug_output.h
2671 (Output_reduced_debug_abbrev_section::failed): Use format for
2673 (Output_reduced_debug_info_section::faild): Likewise.
2675 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
2677 * script.cc (Lazy_demangler): New class.
2678 (Version_script_info::get_symbol_version_helper): Demangle a
2681 2009-01-29 Cary Coutant <ccoutant@google.com>
2683 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
2685 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2687 2009-01-28 Ian Lance Taylor <iant@google.com>
2689 * version.cc (version_string): Bump to 1.9.
2691 * gold.h: Include <cstring> and <stdint.h>.
2692 * version.cc: Include <cstdio>.
2693 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
2695 * reduced_debug_output.cc (insert_into_vector): Rename from
2696 Insert_into_vector; change all callers. Use Swap_unaligned to
2697 avoid aliasing issue; remove union since it is unnecessary.
2699 2009-01-27 Sriraman Tallam <tmsriram@google.com>
2701 * Makefile.am (CCFILES): Add gc.cc.
2703 * Makefile.in: Regenerate.
2704 * gold.cc (Gc_runner): New class.
2705 (queue_initial_tasks): Call garbage collection related tasks
2706 when corresponding options are invoked.
2707 (queue_middle_gc_tasks): New function.
2708 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
2709 processed early before laying out sections during garbage collection.
2710 * gold.h (queue_middle_gc_tasks): New function.
2711 (is_prefix_of): Move from "layout.cc".
2712 * i386.cc (Target_i386::gc_process_relocs): New function.
2713 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
2714 * main.cc (main): Create object of class "Garbage_collection".
2715 * object.cc (Relobj::copy_symbols_data): New function.
2716 (Relobj::is_section_name_included): New function.
2717 (Sized_relobj::do_layout): Allow this function to be called twice
2718 during garbage collection and defer layout of section during the
2720 * object.h (Relobj::get_symbols_data): New function.
2721 (Relobj::is_section_name_included): New function.
2722 (Relobj::copy_symbols_data): New function.
2723 (Relobj::set_symbols_data): New function.
2724 (Relobj::get_relocs_data): New function.
2725 (Relobj::set_relocs_data): New function.
2726 (Relobj::is_output_section_offset_invalid): New pure virtual function.
2727 (Relobj::gc_process_relocs): New function.
2728 (Relobj::do_gc_process_relocs): New pure virtual function.
2729 (Relobj::sd_): New data member.
2730 (Sized_relobj::is_output_section_offset_invalid): New function.
2731 (Sized_relobj::do_gc_process_relocs): New function.
2732 * options.h (General_options::gc_sections): Modify to not be a no-op.
2733 (General_options::print_gc_sections): New option.
2734 * plugin.cc (Plugin_finish::run): Remove function call to
2735 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
2736 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
2737 * reloc.cc (Read_relocs::run): Add task to process relocs and
2738 determine unreferenced sections when doing garbage collection.
2739 (Gc_process_relocs): New class.
2740 (Sized_relobj::do_gc_process_relocs): New function.
2741 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
2742 sections that are garbage collected.
2743 * reloc.h (Gc_process_relocs): New class.
2744 * sparc.cc (Target_sparc::gc_process_relocs): New function.
2745 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
2746 symbols whose corresponding sections are garbage collected.
2747 (Symbol_table::Symbol_table): Add new parameter for the garbage
2749 (Symbol_table::gc_mark_undef_symbols): New function.
2750 (Symbol_table::gc_mark_symbol_for_shlib): New function.
2751 (Symbol_table::gc_mark_dyn_syms): New function.
2752 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
2754 (Symbol_table::add_from_object): Likewise.
2755 (Symbol_table::add_from_relobj): When building shared objects, do not
2756 treat externally visible symbols as garbage.
2757 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
2758 table information for static and relocatable links.
2759 * symtab.h (Symbol_table::set_gc): New function.
2760 (Symbol_table::gc): New function.
2761 (Symbol_table::gc_mark_undef_symbols): New function.
2762 (Symbol_table::gc_mark_symbol_for_shlib): New function.
2763 (Symbol_table::gc_mark_dyn_syms): New function.
2764 (Symbol_table::gc_): New data member.
2765 * target.h (Sized_target::gc_process_relocs): New pure virtual
2767 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
2768 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
2770 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
2772 * options.h (General_options::gc_sections): Define as a no-op for now.
2773 (General_options::no_keep_memory): Ditto.
2774 (General_options::Bshareable): Define.
2775 * options.cc (General_options::finalize): Honor -Bshareable.
2777 2009-01-20 Andreas Schwab <schwab@suse.de>
2779 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
2780 read the value in the contents, since we don't use it. Use the
2781 template endianness when writing.
2782 (Relocate::relocate): Use it for R_PPC_REL16_HA.
2784 2009-01-19 Andreas Schwab <schwab@suse.de>
2786 * configure.tgt (powerpc64-*): Fix targ_obj.
2788 2009-01-15 Ian Lance Taylor <iant@google.com>
2790 * object.cc (Sized_relobj::write_local_symbols): Don't write out
2791 local symbols when stripping all symbols.
2793 2009-01-14 Cary Coutant <ccoutant@google.com>
2795 * output.cc (Output_reloc): Add explicit instantiations.
2797 2009-01-14 Cary Coutant <ccoutant@google.com>
2799 * archive.cc (Archive::get_elf_object_for_member): Remove call
2800 to File_read::claim_for_plugin.
2801 * descriptors.cc (Descriptors::open): Remove reference to
2803 (Descriptors::claim_for_plugin): Remove.
2804 * descriptors.h (Descriptors::claim_for_plugin): Remove.
2805 (Descriptors::is_claimed): Remove.
2806 (claim_descriptor_for_plugin): Remove.
2807 * fileread.cc (File_read::claim_for_plugin): Remove.
2808 * fileread.h (File_read::claim_for_plugin): Remove.
2809 (File_read::descriptor): Reopen descriptor if necessary.
2810 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
2811 (Plugin_manager::all_symbols_read): Add task parameter. Change
2813 (Plugin_manager::get_input_file): New function.
2814 (Plugin_manager::release_input_file): New function.
2815 (Pluginobj::Pluginobj): Add filesize parameter and initialize
2816 corresponding data member.
2817 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
2818 and pass to base constructor. Change all callers.
2819 (get_input_file, release_input_file): New functions.
2820 (make_sized_plugin_object): Add filesize parameter. Change all callers.
2821 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
2822 (Plugin_manager::all_symbols_read): Add task parameter.
2823 (Plugin_manager::get_input_file): New function.
2824 (Plugin_manager::release_input_file): New function.
2825 (Plugin_manager::task_): New data member.
2826 (Pluginobj::Pluginobj): Add filesize parameter.
2827 (Pluginobj::filename): New function.
2828 (Pluginobj::descriptor): New function.
2829 (Pluginobj::filesize): New function.
2830 (Pluginobj::filesize_): New data member.
2831 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
2832 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
2833 File_read::claim_for_plugin; use Object::unlock to unlock the file.
2835 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
2836 with archive libraries.
2837 * testsuite/Makefile.in: Regenerate.
2838 * testsuite/plugin_test.c (struct sym_info): New type.
2839 (get_input_file, release_input_file): New static variables.
2840 (onload): Capture new transfer vector entries.
2841 (claim_file_hook): Stop reading at end of file according to filesize.
2842 Factor out parsing of readelf output into separate function.
2843 (all_symbols_read_hook): Exercise get_input_file and release_input_file
2844 APIs and get the source file name from the symbol table. Convert
2845 source file name to corresponding object file name. Print info
2846 message when adding new input files.
2847 (parse_readelf_line): New function.
2848 * testsuite/plugin_test_1.sh: Add checks for new info messages.
2849 * testsuite/plugin_test_2.sh: Likewise.
2850 * testsuite/plugin_test_3.sh: Likewise.
2851 * testsuite/plugin_test_4.sh: New test case.
2853 2009-01-07 Ian Lance Taylor <iant@google.com>
2855 * version.cc (version_string): Bump to 1.8.
2857 2008-12-23 Cary Coutant <ccoutant@google.com>
2859 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
2860 * plugin.cc (Plugin_manager::finish): Rename as
2861 layout_deferred_objects. Move cleanup to separate function.
2862 (Plugin_manager::cleanup): New function.
2863 (Plugin_finish::run): Call layout_deferred_objects and cleanup
2865 * plugin.h (Plugin_manager::finish): Rename as
2866 layout_deferred_objects.
2867 (Plugin_manager::cleanup): New function.
2868 (Plugin_manager::cleanup_done): New field.
2870 2008-12-23 Cary Coutant <ccoutant@google.com>
2872 * plugin.cc (is_visible_from_outside): New function.
2873 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
2874 so we don't return "IR only" status for exported symbols or -r links.
2876 * testsuite/Makefile.am (plugin_test_3): New test case.
2877 * testsuite/Makefile.in: Regenerate.
2878 * testsuite/plugin_test_3.sh: New file.
2880 2008-12-22 Cary Coutant <ccoutant@google.com>
2882 * object.cc (Sized_relobj::layout_section): New function.
2883 (Sized_relobj::do_layout): Defer layout of input sections until after
2884 plugin has provided replacement files.
2885 (Sized_relobj::do_layout_deferred_sections): New function.
2886 * object.h (Relobj::set_section_offset): Remove virtual keyword.
2887 (Relobj::layout_deferred_sections): New function.
2888 (Relobj::do_layout_deferred_sections): New function.
2889 (Sized_relobj::do_layout_deferred_sections): New function.
2890 (Sized_relobj::layout_section): New function.
2891 (Sized_relobj::Deferred_layout): New structure.
2892 (Sized_relobj::deferred_layout_): New field.
2893 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
2894 Change all callers. Layout deferred sections.
2895 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
2897 (Plugin_hook::run): Move code from do_plugin_hook inline.
2898 (Plugin_hook::do_plugin_hook): Remove.
2899 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
2900 (Plugin_manager::finish): Renamed, was cleanup.
2901 (Plugin_manager::should_defer_layout): New function.
2902 (Plugin_manager::add_deferred_layout_object): New function.
2903 (Plugin_manager::Deferred_layout_list): New type.
2904 (Plugin_manager::deferred_layout_objects_): New field.
2905 (Plugin_hook::do_plugin_hook): Remove.
2907 2008-12-17 Ian Lance Taylor <iant@google.com>
2909 * options.h (class General_options): Add --no case for
2912 2008-12-16 Cary Coutant <ccoutant@google.com>
2914 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
2916 (Plugin_manager::claim_file): Create plugin object even if
2917 plugin did not call the add_symbols callback.
2918 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
2919 asking for more symbols than were added.
2920 * testsuite/Makefile.am (plugin_test_1): Add test case with
2922 (empty.syms): New target.
2923 * testsuite/Makefile.in: Regenerate.
2924 * testsuite/plugin_test.c (claim_file_hook): Add new debug
2925 message. Don't call add_symbols if no globals.
2926 (all_symbols_read_hook): Don't provide replacement for empty
2929 2008-12-12 Ian Lance Taylor <iant@google.com>
2931 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
2932 r_type == 0 for a local symbol with r_sym == 0.
2933 (scan_relocatable_relocs): Pass r_sym to
2934 local_non_section_strategy.
2935 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
2938 * configure.ac: Update test for TLS descriptors: they are
2939 supported as of glibc 2.9.
2940 * configure: Rebuild.
2942 2008-12-11 Ian Lance Taylor <iant@google.com>
2945 * target-reloc.h (Default_scan_relocatable_relocs): For each
2946 function, map r_type == 0 to RELOC_DISCARD.
2948 2008-12-10 Cary Coutant <ccoutant@google.com>
2950 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
2951 object to override a kept COMDAT group from a plugin object.
2953 2008-12-09 Ian Lance Taylor <iant@google.com>
2956 * yyscript.y (file_cmd): Handle INPUT.
2958 * testsuite/initpri1.c: Change all declarations to be full
2959 prototypes by adding void, to avoid compiler warnings.
2961 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
2963 * options.cc (General_options::parse_plugin_opt): New.
2964 (General_options::add_plugin): The argument now is just the filename.
2965 (General_options::add_plugin_option): New.
2966 * options.h (plugin_opt): New.
2967 (add_plugin): Change argument name.
2968 (add_plugin_option): New.
2969 * plugin.cc (Plugin::load): Don't parse the plugin option.
2970 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
2971 (Plugin::add_option): New.
2972 (Plugin::args_): Change type.
2973 (Plugin::filename_): New.
2974 (Plugin_manager::add_plugin_option): New.
2975 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
2976 * testsuite/Makefile.in: Regenerate.
2978 2008-12-05 Cary Coutant <ccoutant@google.com>
2980 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
2981 Handle --strip-lto-sections option.
2982 * options.h (strip_lto_sections): New option.
2984 2008-12-01 Cary Coutant <ccoutant@google.com>
2986 * plugin.cc (ld_plugin_message): Change format parameter to const.
2987 Fix mismatch between new[] and delete.
2989 2008-11-14 Cary Coutant <ccoutant@google.com>
2991 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
2994 2008-11-05 Craig Silverstein <csilvers@google.com>
2996 * options.cc (General_options::parse_dynamic_list): New function.
2997 * options.h (General_options): New flags dynamic_list,
2998 dynamic_list_data, dynamic_list_cpp_new, and
2999 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
3000 (General_options::in_dynamic_list): New function.
3001 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
3002 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
3003 (Lex::can_continue_name): Likewise.
3005 (read_script_file): New parameter script_options.
3006 (read_dynamic_list): New function.
3007 (Script_options::define_dynamic_list): New function.
3008 (dynamic_list_keyword_parsecodes): New variable.
3009 (dynamic_list_keywords): New variable.
3010 * script.h (Script_options::define_dynamic_list): New function
3012 (read_dynamic_list): New function prototype.
3013 * symtab.cc (strprefix): New macro.
3014 (Symbol::should_add_dynsym_entry): Support dynamic_list,
3015 dynamic_list_data, dynamic_list_cpp_new, and
3016 dynamic_list_cpp_typeinfo.
3017 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
3018 (dynamic_list_expr): New rule.
3019 (dynamic_list_nodes): Likewise.
3020 (dynamic_list_node): Likewise.
3021 * testsuite/Makefile.am (dynamic_list): New test.
3022 * testsuite/Makefile.in: Regenerated.
3023 * testsuite/dynamic_list.t: New file.
3024 * testsuite/dynamic_list.sh: New file.
3026 2008-11-05 Craig Silverstein <csilvers@google.com>
3028 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
3029 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
3030 (t11_last): Likewise.
3031 * testsuite/ver_test_6.c (main): Likewise.
3033 2008-10-07 Cary Coutant <ccoutant@google.com>
3035 * options.c (General_options::finalize): Add check for -static and
3037 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
3040 2008-10-02 Cary Coutant <ccoutant@google.com>
3042 * plugin.cc (make_sized_plugin_object): Fix conditional
3043 compilation to work when not all targets are enabled.
3045 2008-09-29 Cary Coutant <ccoutant@google.com>
3047 * archive.cc (Archive::get_file_and_offset): Use filename instead
3048 of name to get library path.
3049 (Archive::include_member): Unlock external member of a thin archive.
3051 * testsuite/Makefile.am (TEST_AR): New variable.
3052 (thin_archive_test_1): New test.
3053 (thin_archive_test_2): New test.
3054 * testsuite/Makefile.in: Regenerate.
3055 * testsuite/thin_archive_main.cc: New file.
3056 * testsuite/thin_archive_test_1.cc: New file.
3057 * testsuite/thin_archive_test_2.cc: New file.
3058 * testsuite/thin_archive_test_3.cc: New file.
3059 * testsuite/thin_archive_test_4.cc: New file.
3061 2008-09-29 Cary Coutant <ccoutant@google.com>
3063 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
3064 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
3066 (Sized_relobj::do_finalize_local_symbols): Likewise.
3067 (Sized_relobj::map_to_kept_section): Likewise.
3068 * object.h (Sized_relobj::invalid_address): New constant.
3069 (Sized_relobj::do_output_section_offset): Check for invalid_address
3071 * output.cc (Output_reloc::local_section_offset): Use constant
3072 invalid_address instead of -1U.
3073 (Output_reloc::get_address): Likewise.
3074 (Output_section::output_address): Change -1U to -1ULL.
3075 * output.h (Output_reloc::invalid_address): New constant.
3076 * reloc.cc (Sized_relobj::write_sections): Use constant
3077 invalid_address instead of -1U.
3078 (Sized_relobj::relocate_sections): Likewise.
3079 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
3080 values for merge sections.
3081 * target-reloc.h (relocate_for_relocatable): Use constant
3082 invalid_address instead of -1U.
3084 2008-09-19 Cary Coutant <ccoutant@google.com>
3086 Add plugin functionality for link-time optimization (LTO).
3087 * configure.ac (plugins): Add --enable-plugins option.
3088 * configure: Regenerate.
3089 * config.in: Regenerate.
3090 * Makefile.am (LIBDL): New variable.
3091 (CCFILES): Add plugin.cc.
3092 (HFILES): Add plugin.h.
3093 (ldadd_var): Add LIBDL.
3094 * Makefile.in: Regenerate.
3096 * archive.cc: Include "plugin.h".
3097 (Archive::setup): Don't preread archive symbols when using a plugin.
3098 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
3099 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
3101 (Archive::include_member): Add symbols from plugin objects.
3102 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
3103 * descriptors.cc (Descriptors::open): Check for file descriptors
3104 abandoned by plugins.
3105 (Descriptors::claim_for_plugin): New function.
3106 * descriptors.h (Descriptors::claim_for_plugin): New function.
3107 (Open_descriptor::is_claimed): New field.
3108 (claim_descriptor_for_plugin): New function.
3109 * fileread.cc (File_read::claim_for_plugin): New function.
3110 * fileread.h (File_read::claim_for_plugin): New function.
3111 (File_read::descriptor): New function.
3112 * gold.cc: Include "plugin.h".
3113 (queue_initial_tasks): Add task to call plugin hooks for generating
3115 * main.cc: Include "plugin.h".
3116 (main): Load plugin libraries.
3117 * object.h (Pluginobj): Declare.
3118 (Object::pluginobj): New function.
3119 (Object::do_pluginobj): New function.
3120 (Object::set_target): New function.
3121 * options.cc: Include "plugin.h".
3122 (General_options::parse_plugin): New function.
3123 (General_options::General_options): Initialize plugins_ field.
3124 (General_options::add_plugin): New function.
3125 * options.h (Plugin_manager): Declare.
3126 (General_options): Add --plugin option.
3127 (General_options::has_plugins): New function.
3128 (General_options::plugins): New function.
3129 (General_options::add_plugin): New function.
3130 (General_options::plugins_): New field.
3131 * plugin.cc: New file.
3132 * plugin.h: New file.
3133 * readsyms.cc: Include "plugin.h".
3134 (Read_symbols::do_read_symbols): Check for archive before checking
3135 for ELF file. Call plugin hooks to claim files.
3136 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
3137 from a real object file; force override when processing replacement
3139 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
3140 (Symbol::init_base_object): Likewise.
3141 (Symbol::init_base_output_data): Likewise.
3142 (Symbol::init_base_output_segment): Likewise.
3143 (Symbol::init_base_constant): Likewise.
3144 (Symbol::init_base_undefined): Likewise.
3145 (Symbol::output_section): Assert that object is not a plugin.
3146 (Symbol_table::add_from_pluginobj): New function.
3147 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
3149 (Symbol_table::sized_write_globals): Likewise.
3150 (Symbol_table::add_from_pluginobj): Instantiate template.
3151 * symtab.h (Sized_pluginobj): Declare.
3152 (Symbol::in_real_elf): New function.
3153 (Symbol::set_in_real_elf): New function.
3154 (Symbol::in_real_elf_): New field.
3155 (Symbol_table::add_from_pluginobj): New function.
3157 * testsuite/Makefile.am (AM_CFLAGS): New variable.
3158 (LIBDL): New variable.
3160 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
3161 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
3162 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
3163 (MOSTLYCLEANFILES): Likewise.
3164 * testsuite/Makefile.in: Regenerate.
3165 * testsuite/plugin_test.c: New file.
3166 * testsuite/plugin_test_1.sh: New file.
3167 * testsuite/plugin_test_2.sh: New file.
3169 2008-09-16 Ian Lance Taylor <iant@google.com>
3171 * target-reloc.h (relocate_section): Check whether a symbol is
3172 defined by the ABI before reporting an undefined symbol error.
3173 * target.h (Target::is_defined_by_abi): Make parameter const.
3174 (Target::do_is_defined_by_abi): Likewise.
3175 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
3176 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
3177 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
3178 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
3179 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
3180 * testsuite/Makefile.in: Rebuild.
3182 * fileread.cc (make_view): Add casts to avoid warning.
3184 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
3186 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
3187 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
3189 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
3191 * options.h (General_options::output_is_executable): New.
3192 (General_options::output_is_pie): New.
3193 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
3194 for shared libraries.
3195 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
3197 2008-09-11 Chris Demetriou <cgd@google.com>
3199 * options.h (origin): New -z option.
3200 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
3201 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
3204 2008-09-05 Cary Coutant <ccoutant@google.com>
3206 * fileread.cc (File_read::make_view): Add check for attempt to map
3209 2008-09-05 Cary Coutant <ccoutant@google.com>
3211 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
3212 explicit instantiations.
3214 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
3217 * options.cc (General_options::finalize): Allow undefined symbols
3218 in shlibs if linking -shared.
3221 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
3222 symbols as not needing a dynsym entry.
3224 2008-08-20 Craig Silverstein <csilvers@google.com>
3226 * fileread.cc (File_read::open): Do not lock the file unless it
3227 was successfully opened.
3229 2008-08-14 Cary Coutant <ccoutant@google.com>
3231 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
3232 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
3233 * testsuite/tls_test.cc (struct int128): 128-bit struct
3234 for testing TLS relocs with non-zero addend.
3235 (v12): New TLS variable.
3237 (t_last): Add check for v12.
3238 * testsuite/tls_test.h (t12): New function.
3239 * testsuite/tls_test_main.cc (thread_routine): Call new test.
3241 2008-08-13 Ian Lance Taylor <iant@google.com>
3243 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
3244 set tls_segment_ or relro_segment_.
3245 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
3247 * output.h (Output_section::clear_is_relro): New function.
3248 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
3249 sections specially even when output_data_ is empty.
3250 (Output_segment::maximum_alignment): When first section is relro,
3251 only force alignment for PT_LOAD segments.
3252 * script.cc (script_data_segment_align): New function.
3253 (script_data_segment_relro_end): New function.
3254 * script-c.h (script_data_segment_align): Declare.
3255 (script_data_segment_relro_end): Declare.
3256 * script-sections.h (class Script_sections): Declare
3257 data_segment_align and data_segment_relro_end. Add fields
3258 segment_align_index_ and saw_relro_end_.
3259 * script-sections.cc (class Sections_element): Add set_is_relro
3260 virtual function. Add new bool* parameter to place_orphan_here.
3261 Add get_output_section virtual function.
3262 (class Output_section_definition): Add set_is_relro. Add new
3263 bool* parameter to place_orphan_here. Add get_output_section.
3264 Add is_relro_ field.
3265 (Output_section_definition::Output_section_definition): Initialize
3266 evaluated_address_, evaluated_load_address, evaluated_addralign_,
3267 and is_relro_ fields.
3268 (Output_section_definition::place_orphan_here): Add is_relro
3270 (Output_section_definition::set_section_addresses): Set relro for
3272 (Output_section_definition::alternate_constraint): Likewise.
3273 (class Orphan_output_section): Add new bool* parameter to
3274 place_orphan_here. Add get_output_section.
3275 (Orphan_output_section::place_orphan_here): Add is_relro
3277 (Script_sections::Script_sections): Initialize
3278 data_segment_align_index_ and saw_relro_end_.
3279 (Script_sections::data_segment_align): New function.
3280 (Script_sections::data_segment_relro_end): New function.
3281 (Script_sections::place_orphan): Set or clear is_relro.
3282 (Script_sections::set_section_addresses): Force alignment of first
3284 * yyscript.y (exp): Call script_data_segment_align and
3285 script_data_segment_relro_end.
3286 * testsuite/relro_script_test.t: New file.
3287 * testsuite/relro_test.cc (using_script): Declare.
3288 (t1, t2): Test using_script.
3289 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
3290 (relro_script_test_SOURCES): Define.
3291 (relro_script_test_DEPENDENCIES): Define.
3292 (relro_script_test_LDFLAGS): Define.
3293 (relro_script_test_LDADD): Define.
3294 (relro_script_test.so): New target.
3295 * testsuite/Makefile.in: Rebuild.
3297 2008-08-06 Cary Coutant <ccoutant@google.com>
3299 * archive.cc (Archive::total_archives, Archive::total_members)
3300 (Archive::total_members_loaded): New variables.
3301 (Archive::setup): Add parameter. Add option to preread
3303 (Archive::read_armap): Add counter.
3304 (Archive::get_file_and_offset): New function.
3305 (Archive::get_elf_object_for_member): New function.
3306 (Archive::read_all_symbols): New function.
3307 (Archive::read_symbols): New function.
3308 (Archive::add_symbols): Add counters.
3309 (Archive::include_all_members): Use armap to find members if it's
3311 (Archive::include_member): Skip reading symbols if already read.
3312 Factored code into Archive::get_file_and_offset and
3313 Archive::get_elf_object_for_member. Changed call to
3314 Mapfile::report_include_archive_member.
3315 (Archive::print_stats): New function.
3316 * archive.h: Declare Object and Read_symbols_data classes.
3317 (Archive::Archive): Add initializers for new members.
3318 (Archive::setup): Add parameter.
3319 (Archive::print_stats): New function.
3320 (Archive::total_archives, Archive::total_members)
3321 (Archive::total_members_loaded): New variables.
3322 (Archive::get_file_and_offset): New function.
3323 (Archive::get_elf_object_for_member): New function.
3324 (Archive::read_all_symbols): New function.
3325 (Archive::read_symbols): New function.
3326 (Archive::Archive_member): New class.
3327 (Archive::members_): New member.
3328 (Archive::num_members_): New member.
3329 * main.cc: Include archive.h.
3330 (main): Call Archive::print_stats.
3331 * mapfile.cc (Mapfile::report_include_archive_member): Delete
3332 archive parameter; member_name is now the fully-decorated name.
3333 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
3334 * options.h: (General_options): Add --preread-archive-symbols option.
3335 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
3338 2008-08-04 Ian Lance Taylor <iant@google.com>
3340 * symtab.h (Symbol::use_plt_offset): New function.
3341 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
3342 * powerpc.cc (Relocate::relocate): Likewise.
3343 * sparc.cc (Relocate::relocate): Likewise.
3344 * x86_64.cc (Relocate::relocate): Likewise.
3345 * testsuite/weak_plt.sh: New test.
3346 * testsuite/weak_plt_main.cc: New test.
3347 * testsuite/weak_plt_shared.cc: New test.
3348 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
3349 (check_PROGRAMS): Add weak_plt.
3350 (check_DATA): Add weak_plt_shared.so.
3351 (weak_plt_main_pic.o, weak_plt): New targets.
3352 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
3353 * testsuite/Makefile.in: Rebuild.
3355 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
3357 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
3358 * testsuite/Makefile.in: Rebuild.
3360 2008-08-04 Alan Modra <amodra@bigpond.net.au>
3362 * Makefile.am (POTFILES.in): Set LC_ALL=C.
3363 * Makefile.in: Regenerate.
3364 * po/POTFILES.in: Regenerate.
3366 2008-07-29 Ian Lance Taylor <iant@google.com>
3368 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
3369 symbols before other symbols.
3370 * testsuite/script_test_2.cc (test_addr): Declare.
3371 (test_addr_alias): Declare.
3372 (main): Check that test_addr and test_addr_alias have the right
3374 * testsuite/script_test_2.t: Define test_addr_alias and
3377 2008-07-24 Ian Lance Taylor <iant@google.com>
3380 * descriptors.cc: New file.
3381 * descriptors.h: New file.
3382 * gold-threads.h (class Hold_optional_lock): New class.
3383 * fileread.cc: Include "descriptors.h".
3384 (File_read::~File_read): Release descriptor rather than closing
3386 (File_read::open) [file]: Call open_descriptor rather than open.
3387 Set is_descriptor_opened_.
3388 (File_read::open) [memory]: Assert that descriptor is not open.
3389 (File_read::reopen_descriptor): New function.
3390 (File_read::release): Release descriptor.
3391 (File_read::do_read): Make non-const. Reopen descriptor.
3392 (File_read::read): Make non-const.
3393 (File_read::make_view): Reopen descriptor.
3394 (File_read::do_readv): Likewise.
3395 * fileread.h (class File_read): Add is_descriptor_opened_ field.
3396 Update declarations.
3397 * layout.cc: Include "descriptors.h".
3398 (Layout::create_build_id): Use open_descriptor rather than open.
3399 * output.cc: Include "descriptors.h".
3400 (Output_file::open): Use open_descriptor rather than open.
3401 * archive.cc (Archive::const_iterator): Change Archive to be
3403 (Archive::begin, Archive::end): Make non-const.
3404 (Archive::count_members): Likewise.
3405 * archive.h (class Archive): Update declarations.
3406 * object.h (Object::read): Make non-const.
3407 * Makefile.am (CCFILES): Add descriptors.cc.
3408 (HFILES): Add descriptors.h.
3409 * Makefile.in: Rebuild.
3412 * gold.h: Always include <clocale>. Add Solaris workarounds
3413 following code in binutils/sysdep.h.
3416 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
3417 this->eh_frame_hdr_ is NULL before using it.
3419 * dynobj.cc (Versions::Versions): Update comment.
3421 * dynobj.cc (Versions::Versions): If there is an soname, use it as
3422 the base version name.
3424 * stringpool.cc (Stringpool_template::add_with_length): Set key to
3425 array size plus one.
3426 (Stringpool_template::set_string_offsets): Subtract one from key
3427 before using it as an array index.
3428 (Stringpool_template::get_offset_with_length): Likewise.
3429 (Stringpool_template::write_to_buffer): Likewise.
3430 * stringpool.h (Stringpool_template::get_offset_from_key):
3433 2008-07-23 Ian Lance Taylor <iant@google.com>
3436 * object.h (Merged_symbol_value::value): Do our best to handle a
3440 * script.cc (Version_script_info::get_versions): Don't add empty
3441 version tag to return value.
3442 (Version_script_info::get_symbol_version_helper): Change return
3443 type to bool. Add pversion parameter. Change all callers.
3444 (script_register_vers_node): Don't require a non-NULL tag.
3445 * script.h (class Version_script_info): Update declarations.
3446 (Version_script_info::get_symbol_version): Change return type to
3447 bool. Add version parameter. Change all callers.
3448 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
3449 handling. Handle an empty version from a version script.
3450 (Symbol_table::define_special_symbol): Likewise.
3451 * testsuite/ver_test_10.script: New file.
3452 * testsuite/ver_test_10.sh: New file.
3453 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
3454 (check_DATA): Add ver_test_10.syms.
3455 (ver_test_10.syms, ver_test_10.so): New target.
3456 * testsuite/Makefile.in: Rebuild.
3458 2008-07-23 Simon Baldwin <simonb@google.com>
3460 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
3461 to zero for undefined symbols from dynamic libraries.
3463 2008-07-23 Ian Lance Taylor <iant@google.com>
3465 * symtab.cc (Symbol_table::resolve): Remove version parameter.
3467 * symtab.h (class Symbol_table): Update declaration.
3468 * testsuite/ver_test_9.cc: New file.
3469 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
3470 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
3471 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
3472 (ver_test_9.so, ver_test_9.o): New targets.
3473 * testsuite/Makefile.in: Rebuild.
3475 2008-07-22 Ian Lance Taylor <iant@google.com>
3477 * options.h (class General_options): Define --check-sections.
3478 * layout.cc (Layout::set_segment_offsets): Handle
3481 * options.h (class General_options): Define -n/--nmagic and
3483 * options.cc (General_options::finalize): For -n/--nmagic or
3484 -N/--omagic, set -static.
3485 * layout.cc (Layout::attach_allocated_section_to_segment): If
3486 -N/--omagic, don't put read-only and read-write sections in
3488 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
3489 finding a read-only segment.
3490 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
3491 don't set the minimum segment alignment to the common page size,
3492 and don't set the file offset to the address modulo the page size.
3493 * script-sections.cc (Script_sections::create_segments): If
3494 -n/--omagic, don't put read-only and read-write sections in
3497 * cref.cc: New file.
3499 * options.h (class General_options): Add --print-symbol-counts.
3500 * main.cc (main): Issue defined symbol report if requested.
3501 * archive.cc (Archive::interpret_header): Make into a const member
3503 (Archive::add_symbols): Call Input_objects::archive_start and
3505 (Archive::const_iterator): Define new class.
3506 (Archive::begin, Archive::end): New functions.
3507 (Archive::include_all_members): Rewrite to use iterator.
3508 (Archive::count_members): New function.
3509 * archive.h (class Archive): Update declarations.
3510 (Archive::filename): New function.
3511 * object.cc: Include "cref.h".
3512 (Sized_relobj::Sized_relobj): Initialize defined_count_.
3513 (Sized_relobj::do_get_global_symbol_counts): New function.
3514 (Input_objects::add_object): Add object to cross-referencer.
3515 (Input_objects::archive_start): New function.
3516 (Input_objects::archive_stop): New function.
3517 (Input_objects::print_symbol_counts): New function.
3518 * object.h: Declare Cref and Archive.
3519 (Object::get_global_symbol_counts): New function.
3520 (Object::do_get_global_symbol_counts): New pure virtual function.
3521 (class Sized_relobj): Add defined_count_ field. Update
3523 (class Input_objects): Add cref_ field. Update constructor.
3524 Update declarations.
3525 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
3527 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
3529 (Sized_dynobj::do_get_global_symbol_counts): New function.
3530 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
3531 defined_count_. Update declarations. Define Symbols typedef.
3532 * symtab.cc (Symbol_table::add_from_relobj): Add defined
3533 parameter. Change all callers.
3534 (Symbol_table::add_from_dynobj): Add sympointers and defined
3535 parameters. Change all callers.
3536 * symtab.h (class Symbol_table): Update declarations.
3537 * Makefile.am (CCFILES): Add cref.cc.
3538 (HFILES): Add cref.h.
3539 * Makefile.in: Rebuild.
3541 2008-07-22 Simon Baldwin <simonb@google.com>
3543 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
3544 to zero when writing undefined symbols.
3546 2008-07-22 Ian Lance Taylor <iant@google.com>
3548 * output.cc (Output_section::add_input_section): Don't try to
3549 merge empty merge sections.
3551 2008-07-21 Craig Silverstein <csilvers@google.com>
3553 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
3554 Include symbol version in error message.
3556 2008-07-20 Chris Demetriou <cgd@google.com>
3558 * configure.ac (gold_cv_c_random_seed): New configured variable.
3559 (RANDOM_SEED_CFLAGS): New substituted variable.
3560 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
3561 * configure: Rebuild.
3562 * Makefile.in: Likewise.
3563 * testsuite/Makefile.in: Likewise.
3565 2008-07-18 Ian Lance Taylor <iant@google.com>
3567 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
3568 where we see NAME/NULL and NAME/VERSION as separate symbols.
3569 * testsuite/ver_test_main.cc (main): Call t4.
3570 (t4, t4_2a): Define.
3571 * testsuite/ver_test_2.cc (t4_2): Define.
3572 * testsuite/ver_test_2.script: Put t4_2a in VER2.
3573 * testsuite/ver_test_4.cc (t4_2a): Define.
3574 * testsuite/ver_test_4.script: Put t4_2a in VER2.
3575 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
3577 2008-07-17 Ian Lance Taylor <iant@google.com>
3579 * dynobj.cc (Versions::add_def): If we give an error about a
3580 missing version, go ahead and create the version anyhow.
3582 2008-07-10 Ian Lance Taylor <iant@google.com>
3584 Handle output sections with more than 0x7fffffff bytes.
3585 * object.h (class Relobj): Change map_to_output_ to
3586 output_sections_, and just keep a section pointer. Change all
3587 uses. Move comdat group support to Sized_relobj.
3588 (Relobj::is_section_specially_mapped): Remove.
3589 (Relobj::output_section): Remove poff parameter. Change all
3591 (Relobj::output_section_offset): New function.
3592 (Relobj::set_section_offset): Rewrite.
3593 (Relobj::map_to_output): Remove.
3594 (Relobj::output_sections): New function.
3595 (Relobj::do_output_section_offset): New pure virtual function.
3596 (Relobj::do_set_section_offset): Likewise.
3597 (class Sized_relobj): Add section_offsets_ field. Add comdat
3598 group support from Relobj. Update declarations.
3599 (Sized_relobj::get_output_section_offset): New function.
3600 (Sized_relobj::do_output_section_offset): New function.
3601 (Sized_relobj::do_set_section_offset): New function.
3602 * object.cc (Relobj::output_section_address): Remove.
3603 (Sized_relobj::Sized_relobj): Initialize new fields.
3604 (Sized_relobj::include_section_group): Cast find_kept_object to
3606 (Sized_relobj::include_linkonce_section): Likewise.
3607 (Sized_relobj::do_layout): Use separate arrays for output section
3609 (Sized_relobj::do_count_local_symbols): Change map_to_output to
3611 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
3612 output_sections and section_offsets.
3613 (Sized_relobj::write_local_symbols): Likewise.
3614 (map_to_kept_section): Compute output address directly.
3615 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
3616 output_sections and section_offsets.
3617 (Sized_relobj::write_sections): Likewise.
3618 (Sized_relobj::relocate_sections): Likewise.
3619 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
3620 * output.h (class Output_reloc): Update declarations. Change
3621 u2_.relobj to Sized_relobj*.
3622 (class Output_data_reloc): Change add functions to use
3624 * output.cc (Output_reloc::Output_reloc): Change relobj to
3626 (Output_reloc::local_section_offset): Change return type to
3627 Elf_Addr. Use get_output_section_offset.
3628 (Output_reloc::get_address): Likewise.
3629 (Output_section::is_input_address_mapped): Don't call
3630 is_section_specially_mapped.
3631 (Output_section::output_offset): Likewise.
3632 (Output_section::output_address): Likewise.
3633 (Output_section::starting_output_address): Likewise.
3634 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
3635 parameter to Sized_relobj*.
3636 (Copy_relocs::need_copy_reloc): Likewise.
3637 (Copy_relocs::save): Likewise.
3638 * copy-relocs.h (class Copy_relocs): Update declarations.
3639 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
3640 Sized_relobj*. Change relobj_ field to Sized_relobj*.
3641 * target-reloc.h (relocate_for_relocatable): Change
3642 offset_in_output_section type to Elf_Addr. Change code that uses
3644 * layout.cc (Layout::layout): Always set *off.
3645 * mapfile.cc (Mapfile::print_input_section): Use
3646 output_section_offset.
3647 * i386.cc (Target_i386::copy_reloc): Change object parameter to
3649 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
3650 * sparc.cc (Target_sparc::copy_reloc): Likewise.
3651 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
3653 2008-07-03 Ian Lance Taylor <iant@google.com>
3655 * layout.cc (Layout::include_section): Do not discard unrecognized
3656 SHT_STRTAB sections.
3658 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
3660 * script.cc (Lex::can_continue_name): Make '?' allowable in
3661 version-script names.
3662 * testsuite/version_script.map: Change glob pattern to use '?'
3664 2008-06-30 Manish Singh <yosh@gimp.org>
3667 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
3670 2008-06-30 Ian Lance Taylor <iant@google.com>
3674 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
3675 versions]: Don't try to read the value in the contents, since we
3676 don't use it. Use the template endianness when writing.
3678 2008-06-25 Cary Coutant <ccoutant@google.com>
3680 * fileread.cc (File_read::make_view): Assert on zero-length view.
3681 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
3682 symbol table when there are no symbols to read.
3684 2008-06-23 Craig Silverstein <csilvers@google.com>
3686 * version.cc (version_string): Bump to 1.7
3688 2008-06-18 Craig Silverstein <csilvers@google.com>
3690 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
3691 constant 0xFFFF to type Valtype.
3692 (Powerpc_relocate_functions::rel16_ha): Likewise.
3694 2008-06-17 Ian Lance Taylor <iant@google.com>
3696 * output.h (Output_section::Input_section): Initialize p2align_ to
3697 zero for Output_section_data constructors.
3698 (Output_section::Input_section::addralign): If not an input
3699 section, return the alignment of the Output_section_data.
3700 * testsuite/copy_test.cc: New file.
3701 * testsuite/copy_test_1.cc: New file.
3702 * testsuite/copy_test_2.cc: New file.
3703 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
3704 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
3705 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
3706 (copy_test_1_pic.o, copy_test_1.so): New targets.
3707 (copy_test_2_pic.o, copy_test_2.so): New targets.
3708 * testsuite/Makefile.in: Rebuild.
3710 * script-sections.cc (Script_sections::place_orphan): Initialize
3711 local variable exact.
3713 2008-06-13 David Edelsohn <edelsohn@gnu.org>
3715 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
3717 2008-06-12 David Edelsohn <edelsohn@gnu.org>
3718 David S. Miller <davem@davemloft.net>
3720 * powerpc.cc: New file.
3721 * Makefile.am (TARGETSOURCES): Add powerpc.cc
3722 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
3723 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
3724 * Makefile.in: Rebuild.
3726 2008-06-09 Ian Lance Taylor <iant@google.com>
3728 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
3730 (throwing, orig_terminate): New static variables.
3731 (terminate_handler): New static function.
3732 (t2): Set terminate handler.
3734 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
3737 * binary.cc (Binary_to_elf::sized_convert): Fix .data
3740 2008-05-30 Cary Coutant <ccoutant@google.com>
3742 * archive.cc (Archive::include_all_members) Correct to step
3743 over symbol table and extended name table in thin archives.
3745 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
3748 * target-reloc.h (relocate_for_relocatable): Fix new_offset
3751 2008-05-28 Caleb Howe <cshowe@google.com>
3753 * reduced_debug_output.cc: New file.
3754 * reduced_debug_output.h: New file.
3755 * options.h (class General_options): Add --strip-debug-non-line.
3756 * options.cc (General_options::finalize): Add strip_debug_non_line
3757 to the strip heirarchy.
3758 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
3760 * layout.cc: Include "reduced_debug_output.h".
3761 (Layout::Layout): Initialize new fields.
3762 (line_only_debug_sections): New static array.
3763 (is_lines_only_debug_sections): New static inline function.
3764 (Layout::include_section): Handle --strip-debug-non-line.
3765 (Layout::make_output_section): If --strip-debug-non-line, build
3766 new output sections for .debug_abbrev and .debug_info.
3767 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
3768 gold. Warn about possible overflow.
3769 (read_signed_LEB_128): Likewise.
3770 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
3771 (read_signed_LEB_128): Declare.
3772 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
3773 (HFILES): Add reduced_debug_output.h.
3774 * Makefile.in: Rebuild.
3776 2008-05-21 Ian Lance Taylor <iant@google.com>
3778 * mapfile.cc: New file.
3779 * mapfile.h: New file.
3780 * options.h (class General_options): Add -M/--print-map and -Map.
3781 * options.cc (General_options::finalize): Make -M equivalent to
3783 * main.cc: Include <cstdio> and "mapfile.h".
3784 (main): Open mapfile if requested.
3785 * gold.cc (class Middle_runner): Add mapfile_ field. Update
3786 constructor. Change caller.
3787 (queue_initial_tasks): Add mapfile parameter. Change caller.
3788 (queue_middle_tasks): Likewise.
3789 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
3791 * archive.cc: Include "mapfile.h".
3792 (Archive::add_symbols): Add mapfile parameter. Change all
3793 callers. Pass mapfile, symbol, and reason to include_member.
3794 (Archive::include_all_members): Add mapfile parameter. Change all
3796 (Archive::include_member): Add mapfile, sym, and why parameters.
3797 Change all callers. Report inclusion to map file.
3798 * archive.h: Include "fileread.h".
3799 (class Archive): Update declarations.
3800 (Archive::file): New const method.
3801 (class Add_archive_symbols): Add mapfile_ field. Update
3802 constructor. Change all callers.
3803 * readsyms.h (class Read_symbols): Likewise.
3804 (class Finish_group): Likewise.
3805 (class Read_script): Likewise.
3806 * common.cc: Include "mapfile.h".
3807 (Symbol_table::allocate_commons): Add mapfile parameter. Change
3809 (Symbol_table::do_allocate_commons): Likewise.
3810 (Symbol_table::do_allocate_commons_list): Likewise. Report common
3811 symbol allocation to mapfile.
3812 * common.h (class Allocate_commons_task): Add mapfile_ field.
3813 Update constructor. Change all callers.
3814 * symtab.h (class Symbol_table): Update declarations.
3815 * layout.cc: Include "mapfile.h".
3816 (Layout_task_runner::run): Print information to mapfile.
3817 (Layout::create_gold_note): Change Output_data_fixed_space to
3818 Output_data_zero_fill.
3819 (Layout::create_build_id): Likewise.
3820 (Layout::print_to_mapfile): New function.
3821 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
3822 constructor. Change caller.
3823 (class Layout): Declare print_to_mapfile.
3824 * output.cc (Output_section::Input_section::print_to_mapfile): New
3826 (Output_section::add_input_section): If producing a map, always
3827 add to input_sections_ list.
3828 (Output_section::do_print_to_mapfile): New function.
3829 (Output_segment::print_sections_to_mapfile): New function.
3830 (Output_segment::print_section_list_to_mapfile): New function.
3831 * output.h: Include "mapfile.h".
3832 (Output_data::print_to_mapfile): New function.
3833 (Output_data::do_print_to_mapfile): New virtual function.
3834 (Output_segment_headers::do_print_to_mapfile): New function.
3835 (Output_file_header::do_print_to_mapfile): New function.
3836 (Output_data_const::do_print_to_mapfile): New function.
3837 (class Output_data_const_buffer): Add map_name_ field. Update
3838 constructor. Change all callers. Add do_print_to_mapfile
3840 (class Output_data_fixed_space): Likewise.
3841 (class Output_data_space): Likewise.
3842 (class Output_data_zero_fill): New class.
3843 (Output_data_strtab::do_print_to_mapfile): New function.
3844 (Output_data_reloc_base::do_print_to_mapfile): New function.
3845 (Output_relocatable_relocs::do_print_to_mapfile): New function.
3846 (Output_data_group::do_print_to_mapfile): New function.
3847 (Output_data_got::do_print_to_mapfile): New function.
3848 (Output_data_dynamic::do_print_to_mapfile): New function.
3849 (Output_symtab_xindex::do_print_to_mapfile): New function.
3850 (class Output_section): Declare do_print_to_mapflie. Declare
3851 print_to_mapfile in Input_section.
3852 (class Output_segment): Declare new functions.
3853 * object.h (Sized_relobj::symbol_count): New function.
3854 * script-sections.cc
3855 (Output_section_element_dot_assignment::set_section_addresses):
3856 Change Output_data_fixed_space to Output_data_zero_fill.
3857 (Output_data_expression::do_print_to_mapfile): New function.
3858 * script.cc (read_input_script): Add mapfile parameter. Change
3860 * script.h (read_input_script): Update declaration.
3861 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
3862 (Eh_frame::do_print_to_mapfile): New function.
3863 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
3864 (Output_merge_string::do_print_to_mapfile): New function.
3865 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
3867 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
3869 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
3871 * Makefile.am (CCFILES): Add mapfile.cc.
3872 (HFILES): Add mapfile.h.
3873 * Makefile.in: Rebuild.
3875 2008-05-19 Ian Lance Taylor <iant@google.com>
3877 * options.h (class General_options): Add -z relro.
3878 * layout.cc (Layout::Layout): Initialize relro_segment_.
3879 (Layout::add_output_section_data): Return the output section.
3880 (Layout::make_output_section): Rcognize relro sections and mark
3882 (Layout::attach_allocated_section_to_segment): Put relro sections
3883 in a PT_GNU_RELRO segment.
3884 (Layout::create_initial_dynamic_sections): Mark the .dynamic
3886 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
3888 (Layout::linkonce_mapping): Map d.rel.ro.local to
3890 (Layout::output_section_name): Us .data.rel.ro.local for any
3891 section which begins with that.
3892 * layout.h (class Layout): Update add_output_section_data
3893 declaration. Add relro_segment_ field.
3894 * output.cc (Output_section::Output_section): Initialize is_relro_
3895 and is_relro_local_ fields.
3896 (Output_segment::add_output_section): Group relro sections.
3897 (Output_segment::is_first_section_relro): New function.
3898 (Output_segment::maximum_alignment): If there is a relro section,
3899 align the segment to the common page size.
3900 (Output_segment::set_section_addresses): Track whether we are
3901 looking at relro sections. If the last section is a relro
3902 section, align to the common page size.
3903 (Output_segment::set_section_list_addresses): Add in_relro
3904 parameter. Change all callers. Align to the page size when
3905 moving from relro to non-relro section.
3906 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
3908 * output.h (class Output_section): Add is_relro_ and
3909 is_relro_local_ fields.
3910 (Output_section::is_relro): New function.
3911 (Output_section::set_is_relro): New function.
3912 (Output_section::is_relro_local): New function.
3913 (Output_section::set_is_relro_local): New function.
3914 (class Output_segment): Update declarations.
3915 * i386.cc (Target_i386::got_section): Mark .got section as relro.
3916 * sparc.cc (Target_sparc::got_section): Likewise.
3917 * x86_64.cc (Target_x86_64::got_section): Likewise.
3918 * testsuite/relro_test_main.cc: New file.
3919 * testsuite/relro_test.cc: New file.
3920 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
3921 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
3922 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
3923 (relro_test.so, relro_test_pic.o): New targets.
3924 * testsuite/Makefile.in: Rebuild.
3926 2008-05-16 Ian Lance Taylor <iant@google.com>
3928 * output.cc (Output_segment::add_output_section): Remove front
3930 * output.h (class Output_segment): Remove
3931 add_initial_output_section and overloaded add_output_section.
3932 Update declaration of remaining add_output_section.
3933 * layout.cc (Layout::create_interp): Call add_output_section
3934 rather than add_initial_output_section.
3935 (Layout::finish_dynamic_section): Likewise.
3937 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
3938 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
3939 know the dynamic type.
3940 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
3941 field. Initialize it in constructor.
3942 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
3943 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
3944 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
3947 * output.cc (Output_reloc::get_address): Change return type to
3949 * output.h (class Output_reloc): Update get_address declaration.
3950 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
3951 for section addresses.
3953 2008-05-09 Ian Lance Taylor <iant@google.com>
3956 * gold.cc (gold_nomem): Use return value of write.
3958 2008-05-08 Ian Lance Taylor <iant@google.com>
3960 * symtab.c (Symbol::init_base_output_data): Add version
3961 parameter. Change all callers.
3962 (Symbol::init_base_output_segment): Likewise.
3963 (Symbol::init_base_constant): Likewise.
3964 (Symbol::init_base_undefined): Likewise.
3965 (Sized_symbol::init_output_data): Likewise.
3966 (Sized_symbol::init_output_segment): Likewise.
3967 (Sized_symbol::init_constant): Likewise.
3968 (Sized_symbol::init_undefined): Likewise.
3969 (Symbol_table::do_define_in_output_data): If the new symbol has a
3970 version, mark it as the default.
3971 (Symbol_table::do_define_in_output_segment): Likewise.
3972 (Symbol_table::do_define_as_constant): Likewise.
3973 * symtab.h (class Symbol): Update declarations.
3974 (class Sized_symbol): Likewise.
3975 * resolve.cc (Symbol::override_version): New function.
3976 (Symbol::override_base): Call override_version.
3977 (Symbol::override_base_with_special): Likewise.
3978 * testsuite/ver_script_8.script: New file.
3979 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
3980 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
3981 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
3982 (ver_test_8_1.so, ver_test_8_2.so): New targets.
3984 2008-05-06 Ian Lance Taylor <iant@google.com>
3987 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
3989 (class General_options): Remove existing --undefined, and add
3990 --no-undefined instead. Add new --undefined as synonym for -u.
3991 * archive.cc (Archive::add_symbols): Check whether symbol was
3993 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
3994 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
3995 all uses. Add IS_UNDEFINED. Update declarations to split
3996 different versions of init_base. Declare init_base_undefined.
3997 (Symbol::is_defined): Handle IS_UNDEFINED.
3998 (Symbol::is_undefined): Likewise.
3999 (Symbol::is_weak_undefined): Call is_undefined.
4000 (Symbol::is_absolute): Handle IS_CONSTANT.
4001 (class Sized_symbol): Update declarations to split different
4002 versions of init. Declare init_undefined.
4003 (class Symbol_table): Declare new functions.
4004 * symtab.cc (Symbol::init_base_object): Rename from init_base.
4006 (Symbol::init_base_output_data): Likewise.
4007 (Symbol::init_base_output_segment): Likewise.
4008 (Symbol::init_base_constant): Likewise.
4009 (Symbol::init_base_undefined): New function.
4010 (Sized_symbol::init_object): Rename from init. Change all
4012 (Sized_symbol::init_output_data): Likewise.
4013 (Sized_symbol::init_output_segment): Likewise.
4014 (Sized_symbol::init_constant): Likewise.
4015 (Sized_symbol::init_undefined): New function.
4016 (Symbol_table::add_undefined_symbols_from_command_line): New
4018 (Symbol_table::do_add_undefined_symbols_from_command_line): New
4020 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
4021 (Symbol::output_section): Likewise.
4022 (Symbol::set_output_section): Likewise.
4023 (Symbol_table::sized_finalize_symbol): Likewise.
4024 (Symbol_table::sized_write_globals): Likewise.
4025 * resolve.cc (Symbol_table::should_override): Likewise.
4026 (Symbol::override_base_with_special): Likewise.
4028 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
4029 symbol, change it to have default visibility.
4030 * testsuite/protected_1.cc: New file.
4031 * testsuite/protected_2.cc: New file.
4032 * testsuite/protected_3.cc: New file.
4033 * testsuite/protected_main_1.cc: New file.
4034 * testsuite/protected_main_2.cc: New file.
4035 * testsuite/protected_main_3.cc: New file.
4036 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
4037 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
4038 (protected_1_LDFLAGS, protected_1_LDADD): Define.
4039 (protected_1.so): New target.
4040 (protected_1_pic.o, protected_2_pic.o): New targets.
4041 (protected_3_pic.o): New target.
4042 (check_PROGRAMS): Add protected_2.
4043 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
4044 (protected_2_LDFLAGS, protected_2_LDADD): Define.
4045 * testsuite/Makefile.in: Rebuild.
4047 * options.h (DEFINE_var): Add set_user_set_##varname__.
4048 (DEFINE_bool_alias): New macro.
4049 (class General_options): Define -Bstatic using DEFINE_bool_alias
4050 rather than DEFINE_special. Add --undefined as an alias for -z
4052 * options.cc (General_options::parse_Bstatic): Remove.
4054 * options.h (class General_options): Add --fatal-warnings.
4055 * main.cc (main): Implement --fatal-warnings.
4056 * errors.h (Errors::warning_count): New function.
4058 * options.h (class General_options): Add -Bsymbolic-functions.
4059 * symtab.h (Symbol::is_preemptible): Check for
4060 -Bsymbolic-functions.
4062 2008-05-05 Ian Lance Taylor <iant@google.com>
4064 * options.h (DEFINE_bool): For DASH_Z, create the negative option
4065 as noVARNAME rather than no-VARNAME.
4066 (class General_options): Add option -z combreloc.
4067 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
4069 (Output_reloc::sort_before) [SHT_REL]: New function.
4070 (Output_reloc::sort_before) [SHT_RELA]: New function.
4071 (class Output_data_reloc_base): Add sort_relocs_ field. Define
4072 Sort_relocs_comparison.
4073 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
4074 parameter. Change all callers.
4075 (Output_data_reloc::Output_data_reloc) [both versions]: Add
4076 sort_relocs parameter. Change all callers.
4077 * output.cc (Output_reloc::get_address): New function, broken out
4079 (Output_reloc::write_rel): Call it.
4080 (Output_reloc::compare): New function.
4081 (Output_data_reloc_base::do_write): Optionally sort relocs.
4083 * configure.ac: If targ_extra_obj is set, link it in.
4084 * configure.tgt: Initialize all variables.
4085 (x86_64*): Set targ_extra_obj and targ_extra_size.
4086 * configure: Rebuild.
4088 * object.cc (Sized_relobj::include_section_group): Adjust section
4089 indexes read from group data. Build vector to pass to
4091 * layout.cc (Layout::layout_group): Add flags and shndxes
4092 parameters. Remove contents parameter. Change caller. Update
4093 explicit instantiations.
4094 * layout.h (class Layout): Update layout_group declaration.
4095 * output.cc (Output_data_group::Output_data_group): Add flags and
4096 input_shndxes parameters. Remove contents parameter. Change
4098 (Output_data_group::do_write): Change input_sections_ to
4100 * output.h (class Output_data_group): Update constructor
4101 declaration. Rename input_sections_ to input_shndxes_.
4102 * testsuite/many_sections_test.cc: Add template.
4104 2008-04-30 Cary Coutant <ccoutant@google.com>
4106 * target-reloc.h (relocate_section): Fix dead-pointer bug.
4108 * layout.cc (Layout::include_section): Refactored check for debug
4110 (Layout::add_comdat): Add new parameters. Change type
4111 of signature parameter. Add object and shndx to signatures table.
4112 (Layout::find_kept_object): New function.
4113 * layout.h: Include <cstring>.
4114 (Layout::is_debug_info_section): New function.
4115 (Layout::add_comdat): Add new parameters.
4116 (Layout::find_kept_object): New function.
4117 (Layout::Kept_section): New struct.
4118 (Layout::Signatures): Change type of map range.
4119 * object.cc (Relobj::output_section_address): New function.
4120 (Sized_relobj::include_section_group): Add new parameters. Change
4121 calls to Layout::add_comdat. Change to build table of kept comdat
4122 groups and table mapping discarded sections to kept sections.
4123 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
4124 (Sized_relobj::do_layout): Change calls to include_section_group and
4125 include_linkonce_section.
4126 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
4127 value to zero when section is discarded.
4128 (Sized_relobj::map_to_kept_section): New function.
4129 * object.h (Relobj::output_section_address): New function.
4130 (Relobj::Comdat_group): New type.
4131 (Relobj::find_comdat_group): New function.
4132 (Relobj::Comdat_group_table): New type.
4133 (Relobj::Kept_comdat_section): New type.
4134 (Relobj::Kept_comdat_section_table): New type.
4135 (Relobj::add_comdat_group): New function.
4136 (Relobj::set_kept_comdat_section): New function.
4137 (Relobj::get_kept_comdat_section): New function.
4138 (Relobj::comdat_groups_): New field.
4139 (Relobj::kept_comdat_sections_): New field.
4140 (Symbol_value::input_value): Update comment.
4141 (Sized_relobj::map_to_kept_section) New function.
4142 (Sized_relobj::include_linkonce_section): Add new parameter.
4143 * target-reloc.h (Comdat_behavior): New type.
4144 (get_comdat_behavior): New function.
4145 (relocate_section): Add code to map a discarded section to the
4146 corresponding kept section when applying a relocation.
4148 2008-04-30 Craig Silverstein <csilvers@google.com>
4150 * dwarf_reader.cc (next_generation_count): New static var.
4151 (Addr2line_cache_entry): New struct.
4152 (addr2line_cache): New static var.
4153 (Dwarf_line_info::one_addr2line): Added caching.
4154 (Dwarf_line_info::clear_addr2line_cache): New function.
4155 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
4156 cache-size parameter.
4157 (Dwarf_line_info::one_addr2line_cache): New function.
4158 * symtab.cc (Symbol_table::detect_odr_violations): Pass
4159 new cache-size argument to one_addr2line(), and clear cache.
4161 2008-04-28 Cary Coutant <ccoutant@google.com>
4163 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
4164 R_386_PC8 relocations.
4166 2008-04-23 Ian Lance Taylor <iant@google.com>
4168 * object.cc (Sized_relobj::include_section_group): Check for
4169 invalid section group.
4171 * object.cc (make_elf_object): Correct test for 64-bit ELF file
4174 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
4175 than read for file header.
4176 * archive.cc (Archive::include_member): Likewise.
4178 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
4180 * aclocal.m4: Regenerate.
4181 * configure: Regenerate.
4183 2008-04-19 Ian Lance Taylor <iant@google.com>
4185 * version.cc (version_string): Bump to 1.6.
4187 * testsuite/Makefile.am (many_sections_r_test): New target.
4188 (many_sections_r_test_SOURCES): Remove.
4189 (many_sections_r_test_DEPENDENCIES): Remove.
4190 (many_sections_r_test_LDFLAGS): Remove.
4191 (many_sections_r_test_LDADD): Remove.
4193 * object.cc (Sized_relobj::do_add_symbols): Always pass
4194 local_symbol_count_ to add_from_relobj.
4196 * testsuite/Makefile.am (many_sections_check.h): Only check one in
4197 every thousand variables.
4198 * testsuite/Makefile.in: Rebuild.
4200 * object.cc (Xindex::initialize_symtab_xindex): New function.
4201 (Xindex::read_symtab_xindex): New function.
4202 (Xindex::sym_xindex_to_shndx): New function.
4203 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
4205 (Sized_relobj::do_initialize_xindex): New function.
4206 (Sized_relobj::do_read_symbols): Adjust section links.
4207 (Sized_relobj::symbol_section_and_value): Add is_ordinary
4208 parameter. Change all callers.
4209 (Sized_relobj::include_section_group): Adjust section links and
4210 symbol section indexes.
4211 (Sized_relobj::do_layout): Adjust section links.
4212 (Sized_relobj::do_count_local_symbols): Adjust section links and
4213 symbol section indexes.
4214 (Sized_relobj::do_finalize_local_symbols): Distinguish between
4215 ordinary and special symbols.
4216 (Sized_relobj::write_local_symbols): Add symtab_xindex and
4217 dynsym_xindex parameters. Change all callers. Adjust section
4218 links. Use SHN_XINDEX when needed.
4219 (Sized_relobj::get_symbol_location_info): Adjust section links.
4220 Don't get fooled by special symbols.
4221 * object.h (class Xindex): Define.
4222 (class Object): Add xindex_ parameter. Declare virtual functoin
4223 do_initialize_xindex.
4224 (Object::adjust_sym_shndx): New function.
4225 (Object::set_xindex): New protected function.
4226 (class Symbol_value): Add is_ordinary_shndx_ field.
4227 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
4228 (Symbol_value::value): Assert ordinary section.
4229 (Symbol_value::initialize_input_to_output_map): Likewise.
4230 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
4232 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
4234 (class Sized_relobj): Update declarations.
4235 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
4236 parameter. Change all callers.
4237 (Sized_relobj::adjust_shndx): New function.
4238 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
4240 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
4241 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
4242 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
4243 (Sized_dynobj::read_dynsym_section): Adjust section links.
4244 (Sized_dynobj::read_dynamic): Likewise.
4245 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
4247 (Sized_dynobj::do_initialize_xindex): New function.
4248 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
4249 do_initialize_xindex.
4250 (Sized_dynobj::adjust_shndx): New function.
4251 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
4252 dynsym_xindex_ fields.
4253 (Layout::finalize): Add a call to set_section_indexes before
4254 creating the symtab sections.
4255 (Layout::set_section_indexes): Don't do anything if the section
4256 already has a section index.
4257 (Layout::create_symtab_sections): Add shnum parameter. Change
4258 caller. Create .symtab_shndx section if needed.
4259 (Layout::create_shdrs): Add shstrtab_section parameter. Change
4261 (Layout::allocated_output_section_count): New function.
4262 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
4264 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
4265 fields. Update declarations.
4266 (Layout::symtab_xindex): New function.
4267 (Layout::dynsym_xindex): New function.
4268 (class Write_symbols_task): Add layout_ field.
4269 (Write_symbols_task::Write_symbols_task): Add layout parameter.
4271 * output.cc (Output_section_headers::Output_section_headers): Add
4272 shstrtab_section parameter. Change all callers.
4273 (Output_section_headers::do_sized_write): Store overflow values
4274 for section count and section string table section index in
4275 section header zero.
4276 (Output_file_header::do_sized_write): Check for overflow of
4277 section count and section string table section index.
4278 (Output_symtab_xindex::do_write): New function.
4279 (Output_symtab_xindex::endian_do_write): New function.
4280 * output.h (class Output_section_headers): Add shstrtab_section_.
4281 Update declarations.
4282 (class Output_symtab_xindex): Define.
4283 (Output_section::has_out_shndx): New function.
4284 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
4286 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
4288 (Sized_symbol::init): Likewise.
4289 (Symbol::output_section): Check for ordinary symbol.
4290 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
4291 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
4293 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
4294 Change all callers. Simplify handling of symbols from sections
4295 not included in the link.
4296 (Symbol_table::add_from_dynobj): Handle ordinary symbol
4298 (Weak_alias_sorter::operator()): Assert that symbols are
4300 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
4302 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
4303 parameters. Change all callers.
4304 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
4305 symbol distinction. Use SHN_XINDEX when needed.
4306 (Symbol_table::write_section_symbol): Add symtab_xindex
4307 parameter. Change all callers.
4308 (Symbol_table::sized_write_section_symbol): Likewise. Use
4309 SHN_XINDEX when needed.
4310 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
4312 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
4313 (Symbol::is_defined): Check is_ordinary.
4314 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
4315 (Symbol::is_absolute, Symbol::is_common): Likewise.
4316 (class Sized_symbol): Update declarations.
4317 (class Symbol_table): Update declarations.
4318 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
4319 parameters. Change all callers.
4320 (Sized_symbol::override): Likewise.
4321 (Symbol_table::override): Likewise.
4322 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
4323 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
4324 is_ordinary, and orig_st_shndx parameters. Change all callers.
4325 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
4326 to be in an ordinary section.
4327 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
4328 object and is_ordinary parameters. Change all callers.
4329 (Sized_dwarf_line_info::read_relocs): Add object parameter.
4330 Change all callers. Don't add undefined or non-ordinary symbols
4332 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
4334 * dwarf_reader.h (class Sized_dwarf_line_info): Update
4336 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
4337 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
4338 (Sized_relobj::relocate_sections): Likewise.
4339 * target-reloc.h (scan_relocs): Adjust section symbol index.
4340 (scan_relocatable_relocs): Likewise.
4341 * i386.cc (Scan::local): Check for ordinary symbols.
4342 * sparc.cc (Scan::local): Likewise.
4343 * x86_64.cc (Scan::local): Likewise.
4344 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
4345 to symbol_section_and_value.
4346 * testsuite/many_sections_test.cc: New file.
4347 * testsuite/Makefile.am (BUILT_SOURCES): Define.
4348 (check_PROGRAMS): Add many_sections_test.
4349 (many_sections_test_SOURCES): Define.
4350 (many_sections_test_DEPENDENCIES): Define.
4351 (many_sections_test_LDFLAGS): Define.
4352 (BUILT_SOURCES): Add many_sections_define.h.
4353 (many_sections_define.h): New target.
4354 (BUILT_SOURCES): Add many_sections_check.h.
4355 (many_sections_check.h): New target.
4356 (check_PROGRAMS): Add many_sections_r_test.
4357 (many_sections_r_test_SOURCES): Define.
4358 (many_sections_r_test_DEPENDENCIES): Define.
4359 (many_sections_r_test_LDFLAGS): Define.
4360 (many_sections_r_test_LDADD): Define.
4361 (many_sections_r_test.o): New target.
4362 * testsuite/Makefile.in: Rebuild.
4364 2008-04-17 Cary Coutant <ccoutant@google.com>
4366 * errors.cc (Errors::info): New function.
4367 (gold_info): New function.
4368 * errors.h (Errors::info): New function.
4369 * gold.h (gold_info): New function.
4370 * object.cc (Input_objects::add_object): Print trace output.
4371 * options.cc (options::parse_set): New function.
4372 (General_options::parse_wrap): Deleted.
4373 (General_options::General_options): Deleted initializer.
4374 * options.h (options::String_set): New typedef.
4375 (options::parse_set): New function.
4376 (DEFINE_set): New macro.
4377 (General_options::wrap): Changed to use DEFINE_set. Changed
4378 callers of any_wrap_symbols and is_wrap_symbol.
4379 (General_options::trace, General_options::trace_symbol):
4381 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
4382 (General_options::wrap_symbols_): Deleted.
4383 * symtab.cc (Symbol_table::add_from_object): Print trace output.
4385 2008-04-17 David S. Miller <davem@davemloft.net>
4387 * options.cc (General_options::parse_V): New function.
4388 * options.h: Add entries for -V and -Qy.
4390 2008-04-17 Ian Lance Taylor <iant@google.com>
4392 * common.cc (Symbol_table::allocate_commons): Remove options
4393 parameter. Change caller.
4394 (Symbol_table::do_allocate_commons): Remove options parameter.
4395 Change caller. Just call do_allocate_commons_list twice.
4396 (Symbol_table::do_allocate_commons_list): New function, broken out
4397 of do_allocate_commons.
4398 * common.h (class Allocate_commons_task): Remove options_ field.
4400 * symtab.cc (Symbol_table::Symbol_table): Initialize
4402 (Symbol_table::add_from_object): Put TLS common symbols on
4404 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
4405 which are IN_OUTPUT_DATA.
4406 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
4407 allocate_commons and do_allocate_commons declarations. Declare
4408 do_allocate_commons_list.
4409 * gold.cc (queue_middle_tasks): Update creation of
4410 Allocate_commons_task to not pass options.
4411 * testsuite/Makefile.am (INCLUDES): Add -I.. .
4412 (TLS_TEST_C_FLAGS): New variable.
4413 (tls_test_c_pic.o): New target.
4414 (tls_test_shared.so): Link in tls_test_c_pic.o.
4415 (tls_test_c_pic_ie.o): New target.
4416 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
4417 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
4418 (tls_test_c.o): New target.
4419 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
4420 (tls_pic_test_LDADD): Likewise.
4421 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
4422 (tls_shared_gd_to_ie_test_LDADD): Likewise.
4423 (tls_test_c_gnu2.o): New target.
4424 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
4426 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
4427 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
4428 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
4429 * testsuite/tls_test.cc: Include "config.h".
4430 (t_last): Call t11_last.
4431 * testsuite/tls_test.h (t11, t11_last): Declare.
4432 * testsuite/tls_test_c.c: New file.
4433 * testsuite/tls_test_main.cc (thread_routine): Call t11.
4434 * configure.ac: Check for OpenMP support.
4435 * configure, config.in, Makefile.in: Rebuild.
4436 * testsuite/Makefile.in: Rebuild.
4438 2008-04-16 Cary Coutant <ccoutant@google.com>
4440 * i386.cc (Target_i386::define_tls_base_symbol): New function.
4441 (Target_i386::tls_base_symbol_defined_): New field.
4442 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
4443 (Target_i386::Scan::global): Likewise.
4444 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
4445 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
4446 (Target_x86_64::tls_base_symbol_defined_): New field.
4447 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
4448 (Target_x86_64::Scan::global): Likewise.
4450 2008-04-16 Cary Coutant <ccoutant@google.com>
4452 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
4453 (Symbol::needs_plt_entry): Allow weak undefined symbols.
4454 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
4455 building shared libraries.
4456 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
4457 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
4458 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
4459 * testsuite/Makefile.in: Rebuild.
4460 * testsuite/weak_undef.h: New file.
4461 * testsuite/weak_undef_file1.cc: Add extra test cases.
4462 * testsuite/weak_undef_file2.cc: Likewise.
4463 * testsuite/weak_undef_test.cc: Likewise.
4465 2008-04-16 David S. Miller <davem@davemloft.net>
4467 * sparc.cc (Target_sparc::Scan): Change from struct to class.
4468 Add issued_non_pic_error_ field. Declare check_non_pic.
4469 (Target_sparc::Scan::check_non_pic): New function.
4470 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
4471 (Target_sparc::Scan::global): Likewise.
4473 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
4474 * configure: Rebuild.
4476 * options.h (DEFINE_enable): New macro.
4477 (new_dtags): New enable option.
4478 (initfirst, interpose, loadfltr, nodefaultlib,
4479 nodelete, nodlopen, nodump): New -z options.
4480 * layout.cc (Layout:finish_dynamic_section): If new
4481 dtags enabled, emit DT_RUNPATH. Also, emit a
4482 DT_FLAGS_1 containing any specified -z flags.
4484 2008-04-16 Ian Lance Taylor <iant@google.com>
4486 * copy-relocs.cc: New file.
4487 * copy-relocs.h: New file.
4488 * reloc.cc: Remove Copy_relocs code.
4489 * reloc.h: Likewise.
4490 * reloc-types.h (struct Reloc_types) [both versions]: Add
4491 get_reloc_addend_noerror.
4492 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
4493 variants of add_global which take an addend which must be zero.
4494 * i386.cc: Include "copy-relocs.h".
4495 (class Target_i386): Change type of copy_relocs_ to variable,
4497 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
4499 (Target_i386::do_finalize_sections): Change handling of
4501 * sparc.cc: Include "copy-relocs.h".
4502 (class Target_sparc): Change type of copy_relocs_ to variable,
4504 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
4506 (Target_sparc::do_finalize_sections): Change handling of
4508 * x86_64.cc: Include "copy-relocs.h".
4509 (class Target_x86_64): Change type of copy_relocs_ to variable,
4511 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
4512 class. Change all callers.
4513 (Target_x86_64::do_finalize_sections): Change handling of
4515 * Makefile.am (CCFILES): Add copy-relocs.cc.
4516 (HFILES): Add copy-relocs.h.
4518 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
4520 * testsuite/script_test_4.sh: Permit leading zeroes.
4522 2008-04-15 Ian Lance Taylor <iant@google.com>
4524 * script-sections.cc (Script_sections::create_segments): Use
4525 header_size_adjustment even when there is enough room for the
4527 * testsuite/script_test_4.sh: New file.
4528 * testsuite/script_test_4.t: New file.
4529 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
4530 (check_DATA): Add script_test_4.stdout.
4531 (MOSTLYCLEANFILES): Likewise.
4532 (script_test_4): New target.
4533 (script_test_4.stdout): New target.
4534 * testsuite/Makefile.in: Rebuild.
4536 * sparc.cc: Add definitions for Output_data_plt_sparc class
4539 2008-04-14 David S. Miller <davem@davemloft.net>
4541 * sparc.cc: New file.
4542 * Makefile.am (TARGETSOURCES): Add sparc.cc
4543 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
4544 * configure.tgt: Document targ_extra_size and
4545 targ_extra_big_endian. Add entries for sparc-* and
4547 * configure.ac: Handle targ_extra_size and
4548 targ_extra_big_endian.
4549 * Makefile.in: Rebuild.
4550 * configure: Likewise.
4551 * po/POTFILES.in: Likewise.
4552 * po/gold.pot: Likewise.
4554 2008-04-14 Ian Lance Taylor <iant@google.com>
4556 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
4557 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
4558 in the name/type/flags to section mapping. Don't call
4559 allocate_output_section.
4560 (Layout::choose_output_section): Change parameter from adjust_name
4561 to is_input_section. Don't permit input sections after sections
4562 are attached to segments. Don't call allocate_output_section.
4563 (Layout::layout_eh_frame): Call update_flags_for_input_section,
4564 not write_enable_output_section.
4565 (Layout::make_output_section): Don't push to
4566 unattached_section_list_ nor call attach_to_segment. Call
4567 attach_section_to_segment if sections are attached.
4568 (Layout::attach_sections_to_segments): New function.
4569 (Layout::attach_section_to_segment): New function.
4570 (Layout::attach_allocated_section_to_segment): Rename from
4571 attach_to_segment. Remove flags parameter.
4572 (Layout::allocate_output_section): Remove function.
4573 (Layout::write_enable_output_section): Remove function.
4574 * layout.h (class Layout): Update for above changes. Add new
4575 field sections_are_attached_.
4576 * output.h (Output_section::update_flags_for_input_section): New
4578 * output.cc (Output_section::add_input_section): Call
4579 update_flags_for_input_section.
4580 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
4582 2008-04-11 Cary Coutant <ccoutant@google.com>
4584 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
4585 thought unnecessary.
4586 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
4588 2008-04-11 Ian Lance Taylor <iant@google.com>
4590 * output.h (class Output_section_data): Remove inline definition
4592 * output.cc (Output_section_data::set_addralign): New function.
4594 2008-04-11 Cary Coutant <ccoutant@google.com>
4596 Add support for TLS descriptors for i386 and x86_64.
4597 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
4598 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
4599 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
4601 (Target_i386::got_mod_index_entry): Remove unnecessary code.
4602 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
4603 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
4605 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
4606 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
4607 Fix problem with initial-exec relocations.
4608 (Target_i386::Relocate::relocate_tls): Likewise.
4609 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
4611 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
4612 support for section-plus-offset dynamic table entries.
4613 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
4614 (Output_data_dynamic::Dynamic_entry): Add support for
4615 section-plus-offset dynamic table entries.
4616 (Output_data_dynamic::Classification): Likewise.
4617 (Output_data_dynamic::classification_): Renamed offset_.
4618 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
4619 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
4620 (Target_x86_64::make_plt_section): New function.
4621 (Target_x86_64::reserve_tlsdesc_entries): New function.
4622 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
4623 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
4624 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
4625 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
4626 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
4627 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
4628 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
4629 add extra PLT entry for TLS descriptors.
4630 (Output_data_plt_x86_64::got_): New field.
4631 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
4632 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
4634 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
4636 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
4637 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
4638 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
4639 R_386_TLS_DESC_CALL relocations.
4640 (Target_x86_64::Scan::global): Likewise.
4641 (Target_x86_64::do_finalize_sections): Add dynamic table entries
4642 for TLS descriptors.
4643 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
4644 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
4645 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
4646 GD-to-IE relaxation.
4647 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
4648 and TLS_DESCRIPTORS.
4649 * Makefile.in: Rebuild.
4650 * configure: Rebuild.
4651 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
4652 (tls_test_shared2.so): New target.
4653 (tls_shared_gd_to_ie_test_SOURCES): New variable.
4654 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
4655 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
4656 (tls_shared_gd_to_ie_test_LDADD): New variable.
4657 (tls_shared_gnu2_gd_to_ie_test): New target.
4658 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
4660 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
4661 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
4662 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
4663 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
4664 (tls_shared_gnu2_test): New target.
4665 (tls_test_gnu2_shared.so): New target.
4666 (tls_shared_gnu2_test_SOURCES): New variable.
4667 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
4668 (tls_shared_gnu2_test_LDFLAGS): New variable.
4669 (tls_shared_gnu2_test_LDADD): New variable.
4670 * testsuite/Makefile.in: Rebuild.
4671 * testsuite/Makefile.
4673 2008-04-11 Ian Lance Taylor <iant@google.com>
4675 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
4677 * testsuite/Makefile.in: Rebuild.
4679 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
4681 * testsuite/script_test_2.cc (main): Adjust test.
4683 2008-04-11 David S. Miller <davem@davemloft.net>
4684 Ian Lance Taylor <iant@google.com>
4686 * options.h (General_options): Add entries for '-Y' and
4688 * options.cc (General_options:finalize): If -Y was used, add those
4689 entries to the library path instead of the default "/lib" and
4692 2008-04-11 David S. Miller <davem@davemloft.net>
4694 * testsuite/justsyms.t: Start at 0x100.
4695 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
4696 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
4698 * testsuite/script_test_2.cc: Adjust string and section length
4701 2008-04-09 Ian Lance Taylor <iant@google.com>
4704 * script-sections.cc (Sections_element::allocate_to_segment): Add
4706 (Output_section_definition::allocate_to_segment): Likewise.
4707 (Orphan_output_section::allocate_to_segment): Likewise.
4708 (Script_sections::attach_sections_using_phdrs_clause): Don't
4709 propagate non-PT_LOAD segments to orphan sections.
4710 * testsuite/Makefile.am (script_test_3.stdout): Generate using
4711 readelf rather than objdump.
4712 * testsuite/script_test_3.sh: Adjust accordingly. Test that
4713 .interp section and PT_INTERP segment are the same size.
4714 * testsuite/Makefile.in: Rebuild.
4716 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
4717 aliases for symbols defined in the same object.
4718 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
4719 (weak_alias_test_SOURCES): New variable.
4720 (weak_alias_test_DEPENDENCIES): New variable.
4721 (weak_alias_test_LDFLAGS): New variable.
4722 (weak_alias_test_LDADD): New variable.
4723 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
4724 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
4725 (weak_alias_test_3.o): New target.
4726 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
4727 * testsuite/weak_alias_test_main.cc: New file.
4728 * testsuite/weak_alias_test_1.cc: New file.
4729 * testsuite/weak_alias_test_2.cc: New file.
4730 * testsuite/weak_alias_test_3.cc: New file.
4732 2008-04-08 Ian Lance Taylor <iant@google.com>
4734 * options.h (class General_options): Add --noinhibit-exec option.
4735 * main.cc (main): Check --noinhibit-exec.
4737 * options.h (class General_options): Define --wrap as a special
4738 option. Add wrap_symbols_ field.
4739 (General_options::any_wrap_symbols): New function.
4740 (General_options::is_wrap_symbol): New function.
4741 * options.cc (General_options::parse_wrap): New function.
4742 (General_options::General_options): Initialize wrap_symbols_.
4743 * symtab.cc (Symbol_table::wrap_symbol): New function.
4744 (Symbol_table::add_from_object): Handle --wrap.
4745 * symtab.h (class Symbol_table): Declare wrap_symbol.
4746 * target.h (Target::wrap_char): New function.
4747 (Target::Target_info): Add wrap_char field.
4748 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
4749 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4750 * testsuite/testfile.cc (Target_test::test_target_info):
4753 * errors.cc (Errors::undefined_symbol): Mention symbol version if
4756 * layout.h (class Layout): Add added_eh_frame_data_ field.
4757 * layout.cc (Layout::Layout): Initialize new field.
4758 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
4759 output section until we find a section we merged successfully.
4760 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
4761 that the size be non-zero.
4763 * merge.cc (Object_merge_map::get_output_offset): Remove inline
4766 2008-04-08 Craig Silverstein <csilvers@google.com>
4768 * configure.ac: Export new conditional variable HAVE_ZLIB.
4769 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
4771 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
4772 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4774 2008-04-07 Ian Lance Taylor <iant@google.com>
4776 * version.cc (version_string): Set to "1.5".
4778 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
4779 Add issued_non_pic_error_ field. Declare check_non_pic.
4780 (Target_x86_64::Scan::check_non_pic): New function.
4781 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
4782 (Target_x86_64::Scan::global): Likewise.
4784 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
4785 addend parameter. Change caller. Handle merge sections.
4786 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
4787 Address to Addend. Don't add in the result of
4788 local_section_offset, pass down the addend and use the returned
4790 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
4791 Update declarations of local_section_offset and symbol_value.
4792 * testsuite/two_file_test_1.cc (t18): New function.
4793 * testsuite/two_file_test_2.cc (f18): New function.
4794 * testsuite/two_file_test_main.cc (main): Call t18.
4795 * testsuite/two_file_test.h (t18, f18): Declare.
4797 * configure.ac: Don't test for objdump, c++filt, or readelf.
4798 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
4800 (TEST_READELF): New variable.
4801 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
4802 (check_PROGRAMS): Add two_file_strip_test.
4803 (two_file_strip_test): New target.
4804 (check_PROGRAMS): Add two_file_same_shared_strip_test.
4805 (two_file_same_shared_strip_test_SOURCES): New variable.
4806 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
4807 (two_file_same_shared_strip_test_LDFLAGS): New variable.
4808 (two_file_same_shared_strip_test_LDADD): New variable.
4809 (two_file_shared_strip.so): New target.
4810 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
4811 (ver_test_5.syms, ver_test_7.syms): Likewise.
4812 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
4813 (strip_test_3.stdout): Use TEST_OBJDUMP.
4814 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4816 2008-04-04 Cary Coutant <ccoutant@google.com>
4818 * symtab.h (Symbol::is_weak_undefined): New function.
4819 (Symbol::is_strong_undefined): New function.
4820 (Symbol::is_absolute): New function.
4821 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
4822 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
4824 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
4825 (weak_undef_test): New target.
4826 * testsuite/Makefile.in: Rebuild.
4827 * testsuite/weak_undef_file1.cc: New file.
4828 * testsuite/weak_undef_file2.cc: New file.
4829 * testsuite/weak_undef_test.cc: New file.
4831 2008-04-03 Craig Silverstein <csilvers@google.com>
4833 * compressed_output.h (class Output_compressed_section): Use
4835 * compressed_output.cc (zlib_compress): Use unsigned buffers,
4837 (zlib_compressed_suffix): Removed.
4838 (Output_compressed_section::set_final_data_size): Use unsigned
4840 * testsuite/Makefile.am (flagstest_compress_debug_sections):
4841 Fix linker invocation.
4842 (flagstest_o_specialfile_and_compress_debug_sections):
4844 * testsuite/Makefile.in: Regenerated.
4846 2008-04-02 David S. Miller <davem@davemloft.net>
4848 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
4849 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
4851 2008-04-02 Craig Silverstein <csilvers@google.com>
4855 2008-04-02 Ian Lance Taylor <iant@google.com>
4857 * fileread.cc (File_read::find_view): Add byteshift and vshifted
4858 parameters. Update for new key type to views_. Change all
4860 (File_read::read): Adjust for byteshift in returned view.
4861 (File_read::add_view): New function, broken out of
4863 (File_read::make_view): New function, broken out of
4865 (File_read::find_or_make_view): Add offset and aligned
4866 parameters. Rewrite accordingly. Change all callers.
4867 (File_read::get_view): Add offset and aligned parameters. Adjust
4868 for byteshift in return value.
4869 (File_read::get_lasting_view): Likewise.
4870 * fileread.h (class File_read): Update declarations.
4871 (class File_read::View): Add byteshift_ field. Add byteshift to
4872 constructor. Add byteshift method.
4873 * archive.h (Archive::clear_uncached_views): New function.
4874 (Archive::get_view): Add aligned parameter. Change all callers.
4875 * object.h (Object::get_view): Add aligned parameter. Change all
4877 (Object::get_lasting_view): Likewise.
4879 * fileread.cc (File_read::release): Don't call clear_views if
4880 there are multiple objects.
4881 * fileread.h (File_read::clear_uncached_views): New function.
4882 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
4885 2008-03-31 Cary Coutant <ccoutant@google.com>
4887 Add thin archive support.
4888 * archive.cc (Archive::armagt): New const.
4889 (Archive::setup): Remove task parameter and calls to unlock.
4890 (Archive::unlock_nested_archives): New function.
4891 (Archive::read_header): Add nested_off parameter. Change
4893 (Archive::interpret_header): Likewise.
4894 (Archive::include_all_members): Change to handle thin
4896 (Archive::include_member): Likewise.
4897 * archive.h (Archive::Archive): Add new parameters and
4899 (Archive::armagt): New const.
4900 (Archive::setup): Remove task parameter.
4901 (Archive::unlock_nested_archives): New function.
4902 (Archive::read_header): Add nested_off parameter.
4903 (Archive::interpret_header): Likewise.
4904 (Archive::Nested_archive_table): New typedef.
4905 (Archive::is_thin_archive_): New field.
4906 (Archive::nested_archives_): New field.
4907 (Archive::options_): New field.
4908 (Archive::dirpath_): New field.
4909 (Archive::task_): New field.
4910 * readsyms.cc (Read_symbols::do_read_symbols): Add check
4911 for thin archives. Pass additional parameters to
4912 Archive::Archive. Unlock the archive file after calling
4915 2008-03-29 Ian Lance Taylor <iant@google.com>
4917 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
4918 version symbol to be local.
4919 * testsuite/ver_test_4.sh: New file.
4920 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
4921 (check_DATA): Add ver_test_4.syms.
4922 (ver_test_4.syms): New target.
4923 * testsuite/Makefile.in: Rebuild.
4926 (Output_section::Input_section_sort_entry::has_priority): New
4928 (Output_section::Input_section_sort_entry::match_file_name): New
4930 (Output_section::Input_section_sort_entry::match_section_name):
4932 (Output_section::Input_section_sort_entry::match_section_name_prefix):
4934 (Output_section::Input_section_sort_entry::match_section_file):
4936 (Output_section::Input_section_sort_compare::operator()): Rewrite
4937 using new Input_section_sort_entry functions. Sort crtbegin and
4938 crtend first. Sort sections with no priority before sections with
4940 * testsuite/initpri1.c (d3): Check j != 4.
4941 (cd5): New constructor/destructor function.
4942 (main): Check j != 2.
4944 * symtab.cc (Symbol_table::add_from_object): If we don't use the
4945 new symbol when resolving, don't call set_is_default.
4946 * testsuite/ver_test_7.cc: New file.
4947 * testsuite/ver_test_7.sh: New file.
4948 * testsuite/Makefile.am (ver_test_7.so): New target.
4949 (ver_test_7.o): New target.
4950 (check_SCRIPTS): Add ver_test_7.sh.
4951 (check_DATA): Add ver_test_7.syms.
4952 (ver_test_7.syms): New target.
4954 2008-03-28 Ian Lance Taylor <iant@google.com>
4956 * layout.cc (Layout::layout): If we see an input section with a
4957 name that needs sorting, set the must_sort flag for the output
4959 (Layout::make_output_section): If the name of the output section
4960 indicates that it might require sorting, set the may_sort flag.
4961 * output.h (Output_section::may_sort_attached_input_sections): New
4963 (Output_section::set_may_sort_attached_input_sections): New
4965 (Output_section::must_sort_attached_input_sections): New
4967 (Output_section::set_must_sort_attached_input_sections): New
4969 (class Output_section): Declare Input_section_sort_entry. Define
4970 Input_section_sort_compare. Declare
4971 sort_attached_input_sections. Add new fields:
4972 may_sort_attached_input_sections_,
4973 must_sort_attached_input_sections_,
4974 attached_input_sections_are_sorted_.
4975 * output.cc (Output_section::Output_section): Initialize new
4977 (Output_section::add_input_section): Add an entry to
4978 input_sections_ if may_sort or must_sort are true.
4979 (Output_section::set_final_data_size): Call
4980 sort_attached_input_sections if necessary.
4981 (Output_section::Input_section_sort_entry): Define new class.
4982 (Output_section::Input_section_sort_compare::operator()): New
4984 (Output_section::sort_attached_input_sections): New function.
4985 * configure.ac: Check whether the compiler supports constructor
4986 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
4987 * testsuite/initpri1.c: New file.
4988 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
4989 CONSTRUCTOR_PRIORITY.
4990 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
4991 (initpri1_LDFLAGS): New variable.
4992 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4994 2008-03-27 Ian Lance Taylor <iant@google.com>
4996 * common.cc (Sort_commons::operator): Correct sorting algorithm.
4997 * testsuite/common_test_1.c: New file.
4998 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
4999 (common_test_1_SOURCES): New variable.
5000 (common_test_1_DEPENDENCIES): New variable.
5001 (common_test_1_LDFLAGS): New variable.
5003 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
5004 and commons_ correctly when NAME/VERSION does not override
5006 * testsuite/ver_test_6.c: New file.
5007 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
5008 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
5009 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
5011 2008-03-26 Ian Lance Taylor <iant@google.com>
5013 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
5014 of an undefined symbol from a version script.
5015 * testsuite/Makefile.am (ver_test_5.so): New target.
5016 (ver_test_5.o): New target.
5017 (check_SCRIPTS): Add ver_test_5.sh.
5018 (check_DATA): Add ver_test_5.syms.
5019 (ver_test_5.syms): New target.
5020 * testsuite/ver_test_5.cc: New file.
5021 * testsuite/ver_test_5.script: New file.
5022 * testsuite/ver_test_5.sh: New file.
5023 * Makefile.in, testsuite/Makefile.in: Rebuild.
5026 Fix problems building gold with gcc 4.3.0.
5027 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
5028 (gold_error_at_location, gold_warning_at_location): Use it.
5029 * configure.ac: Check whether we can compile and use a template
5030 function with a printf attribute.
5031 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
5032 when jumping over bytes.
5033 * object.cc: Instantiate Object::read_section_data.
5034 * debug.h: Include <cstring>
5035 * dwarf_reader.cc: Include <algorithm>
5036 * main.cc: Include <cstring>.
5037 * options.cc: Include <cstring>.
5038 * output.cc: Include <cstring>.
5039 * script.cc: Include <cstring>.
5040 * script.h: Include <string>.
5041 * symtab.cc: Include <cstring> and <algorithm>.
5042 * target-select.cc: Include <cstring>.
5043 * version.cc: Include <string>.
5044 * testsuite/testmain.cc: Include <cstdlib>.
5045 * configure, config.in: Rebuild.
5047 2008-03-25 Ian Lance Taylor <iant@google.com>
5049 * options.cc: Include "../bfd/bfdver.h".
5050 (options::help): Print bug reporting address.
5052 * version.cc (print_version): Adjust output for current value of
5057 * options.cc (options::help): Print list of supported targets.
5058 * target-select.h: Include <vector>.
5059 (class Target_selector): Make machine_, size_, and is_big_endian_
5060 fields const. Add bfd_name_ and instantiated_target_ fields.
5061 (Target_selector::Target_selector): Add bfd_name parameter.
5062 (Target_selector::recognize): Make non-virtual, call
5064 (Target_selector::recognize_by_name): Make non-virtual, call
5065 do_recognize_by_name.
5066 (Target_selector::supported_names): New function.
5067 (Target_selector::bfd_name): New function.
5068 (Target_selector::do_instantiate_target): New pure virtual
5070 (Target_selector::do_recognize): New virtual function.
5071 (Target_selector::do_recognize_by_name): New virtual function.
5072 (Target_selector::instantiate_target): New private function.
5073 (supported_target_names): Declare.
5074 * target-select.cc (Target_selector::Target_selector): Update for
5075 new parameter and fields.
5076 (select_target_by_name): Check that the name matches before
5077 calling recognize_by_name.
5078 (supported_target_names): New function.
5079 * i386.cc (class Target_selector_i386): Update Target_selector
5080 constructor call. Remove recognize and recognize_by_name. Add
5081 do_instantiate_target.
5082 * x86_64.cc (class Target_selector_x86_64): Likewise.
5083 * testsuite/testfile.cc (class Target_selector_test): Update for
5084 changes to Target_selector.
5086 * README: Rewrite, with some notes on unsupported features.
5088 2008-03-24 Cary Coutant <ccoutant@google.com>
5090 * i386.cc (Target_i386::Got_type): New enum declaration.
5091 (Target_i386::Scan::local): Updated callers of Output_data_got
5093 (Target_i386::Scan::global): Likewise.
5094 (Target_i386::Relocate::relocate): Likewise.
5095 (Target_i386::Relocate::relocate_tls): Likewise.
5096 * object.h (Got_offset_list): New class.
5097 (Sized_relobj::local_has_got_offset): Added got_type parameter.
5098 (Sized_relobj::local_got_offset): Likewise.
5099 (Sized_relobj::set_local_got_offset): Likewise.
5100 (Sized_relobj::local_has_tls_got_offset): Removed.
5101 (Sized_relobj::local_tls_got_offset): Removed.
5102 (Sized_relobj::set_local_tls_got_offset): Removed.
5103 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
5104 * output.cc (Output_data_got::add_global): Added got_type parameter.
5105 (Output_data_got::add_global_with_rel): Likewise.
5106 (Output_data_got::add_global_with_rela): Likewise.
5107 (Output_data_got::add_global_pair_with_rel): New function.
5108 (Output_data_got::add_global_pair_with_rela): New function.
5109 (Output_data_got::add_local): Added got_type parameter.
5110 (Output_data_got::add_local_with_rel): Likewise.
5111 (Output_data_got::add_local_with_rela): Likewise.
5112 (Output_data_got::add_local_pair_with_rel): New function.
5113 (Output_data_got::add_local_pair_with_rela): New function.
5114 (Output_data_got::add_global_tls): Removed.
5115 (Output_data_got::add_global_tls_with_rel): Removed.
5116 (Output_data_got::add_global_tls_with_rela): Removed.
5117 (Output_data_got::add_local_tls): Removed.
5118 (Output_data_got::add_local_tls_with_rel): Removed.
5119 (Output_data_got::add_local_tls_with_rela): Removed.
5120 * output.h (Output_data_got::add_global): Added got_type parameter.
5121 (Output_data_got::add_global_with_rel): Likewise.
5122 (Output_data_got::add_global_with_rela): Likewise.
5123 (Output_data_got::add_global_pair_with_rel): New function.
5124 (Output_data_got::add_global_pair_with_rela): New function.
5125 (Output_data_got::add_local): Added got_type parameter.
5126 (Output_data_got::add_local_with_rel): Likewise.
5127 (Output_data_got::add_local_with_rela): Likewise.
5128 (Output_data_got::add_local_pair_with_rel): New function.
5129 (Output_data_got::add_local_pair_with_rela): New function.
5130 (Output_data_got::add_global_tls): Removed.
5131 (Output_data_got::add_global_tls_with_rel): Removed.
5132 (Output_data_got::add_global_tls_with_rela): Removed.
5133 (Output_data_got::add_local_tls): Removed.
5134 (Output_data_got::add_local_tls_with_rel): Removed.
5135 (Output_data_got::add_local_tls_with_rela): Removed.
5136 * resolve.cc (Symbol::override_base_with_special): Removed
5137 reference to has_got_offset_ field.
5138 * symtab.cc (Symbol::init_fields): Replaced initialization
5139 of got_offset_ with got_offsets_. Removed initialization
5141 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
5142 (Symbol::got_offset): Likewise.
5143 (Symbol::set_got_offset): Likewise.
5144 (Symbol::has_tls_got_offset): Removed.
5145 (Symbol::tls_got_offset): Removed.
5146 (Symbol::set_tls_got_offset): Removed.
5147 (Symbol::got_offset_): Removed.
5148 (Symbol::tls_mod_got_offset_): Removed.
5149 (Symbol::tls_pair_got_offset_): Removed.
5150 (Symbol::got_offsets_): New field.
5151 (Symbol::has_got_offset): Removed.
5152 (Symbol::has_tls_mod_got_offset): Removed.
5153 (Symbol::has_tls_pair_got_offset): Removed.
5154 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
5155 (Target_x86_64::Scan::local): Updated callers of Output_data_got
5157 (Target_x86_64::Scan::global): Likewise.
5158 (Target_x86_64::Relocate::relocate): Likewise.
5159 (Target_x86_64::Relocate::relocate_tls): Likewise.
5161 2008-03-25 Ben Elliston <bje@au.ibm.com>
5163 * yyscript.y: Fix spelling error in comment.
5165 2008-03-24 Ian Lance Taylor <iant@google.com>
5167 * options.h (class General_options): Define build_id option.
5168 * layout.h (class Layout): Declare write_build_id, create_note,
5169 create_build_id. Add build_id_note_ member.
5170 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
5171 "libiberty.h", "md5.h", "sha1.h".
5172 (Layout::Layout): Initialize eh_frame_data_,
5173 eh_frame_hdr_section_, and build_id_note_.
5174 (Layout::finalize): Call create_build_id.
5175 (Layout::create_note): New function, broken out of
5176 Layout::create_gold_note.
5177 (Layout::create_gold_note): Call create_note.
5178 (Layout::create_build_id): New function.
5179 (Layout::write_build_id): New function.
5180 (Close_task_runner::run): Call write_build_id.
5182 * x86_64.cc: Correct license to GPLv3.
5184 2008-03-23 Ian Lance Taylor <iant@google.com>
5186 * options.cc: Include "demangle.h".
5187 (parse_optional_string): New function.
5188 (parse_long_option): Handle takes_optional_argument.
5189 (parse_short_option): Update dash_z initializer. Handle
5190 takes_optional_argument.
5191 (General_options::General_options): Initialize do_demangle_.
5192 (General_options::finalize): Set do_demangle_. Handle demangling
5194 * options.h (parse_optional_string): Declare.
5195 (struct One_option): Add optional_arg field. Update constructor.
5196 Update call constructor calls. Add takes_optional_argument
5198 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
5199 (DEFINE_optional_string): Define.
5200 (General_options::demangle): Change from DEFINE_bool to
5201 DEFINE_optional_string.
5202 (General_options::no_demangle): New function.
5203 (General_options::do_demangle): New function.
5204 (General_options::set_do_demangle): New function.
5205 (General_options::execstack_status_): Move definition to end of
5207 (General_options::static_): Likewise.
5208 (General_options::do_demangle_): New field.
5209 * object.cc (big_endian>::get_symbol_location_info): Call
5210 Options::do_demangle, not Options::demangle.
5211 * symtab.cc (demangle): Likewise.
5213 2008-03-22 Ian Lance Taylor <iant@google.com>
5215 * gold.h: Include <cstddef> and <sys/types.h>
5216 * options.h: Include <cstring>.
5218 2008-03-21 Ian Lance Taylor <iant@google.com>
5220 * Added source code to GNU binutils.