1 2012-04-16 David S. Miller <davem@davemloft.net>
3 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4 -fpic and -fpie respectively.
5 * Makefile.in: Regenerate.
7 * sparc.cc (class Target_sparc): Add rela_ifunc_.
8 (Target_sparc::Target_sparc): Initialize new field.
9 (Target_sparc::do_plt_section_for_global): New function.
10 (Target_sparc::do_plt_section_for_local): New function.
11 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
12 (Target_sparc::make_plt_section): New function, broken out of
13 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
14 (Target_sparc::make_plt_entry): Call make_plt_section.
15 (Target_sparc::make_local_ifunc_plt_entry): New function.
16 (Target_sparc::rela_ifunc_section): New function.
17 (Target_sparc::plt_section): Remove const.
18 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
19 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
20 and ifunc_count_ fields.
21 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
22 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
23 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
24 (Output_data_plt_sparc::rela_ifunc): New function.
25 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
26 (Output_data_plt_sparc::has_ifunc_section): New function.
27 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
28 (Output_data_plt_sparc::address_for_global): New function.
29 (Output_data_plt_sparc::address_for_local): New function.
30 (Output_data_plt_sparc::plt_index_to_offset): New function.
31 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
33 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
35 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
36 R_SPARC_JMP_IREL to switch.
37 (Target_sparc::Scan::check_non_pic): Likewise.
38 (Target_sparc::Scan::local): Handle IFUNC symbols.
39 (Target_sparc::Scan::local): Likewise.
40 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
41 and plt_address_for_local.
42 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
43 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
45 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
46 (class Output_data_reloc): Adjust calls to Output_reloc_type.
47 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
48 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
50 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
51 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
53 * sparc.cc (Target_sparc::Scan::global): Likewise.
54 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
56 2012-04-16 Cary Coutant <ccoutant@google.com>
58 * archive.cc (Library_base::should_include_member): Check for
59 --export-dynamic-symbol.
60 * options.h (class General_options): Add --export-dynamic-symbol.
61 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
62 --export-dynamic-symbol.
63 (Symbol_table::gc_mark_undef_symbols): Likewise.
64 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
66 2012-04-12 David S. Miller <davem@davemloft.net>
68 * sparc.cc (Reloc::wdisp10): New relocation method.
69 (Reloc::h34): Likewise.
70 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
71 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
73 (Target_sparc::Scan::local): Likewise.
74 (Target_sparc::Scan::global): Likewise.
75 (Target_sparc::Relocate::relocate): Likewise.
77 2012-04-09 Cary Coutant <ccoutant@google.com>
79 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
82 2012-04-06 Ian Lance Taylor <iant@google.com>
84 * timer.cc: #include <unistd.h>.
86 2012-04-06 Roland McGrath <mcgrathr@google.com>
88 * configure.in (AC_CHECK_HEADERS): Add locale.h.
89 * config.in: Regenerate.
90 * configure: Regenerate.
92 2012-04-05 Nick Clifton <nickc@redhat.com>
94 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
95 (AM_LC_MESSAGES): Add.
96 * aclocal.m4: Regenerate.
97 * config.in: Regenerate.
98 * configure: Regenerate.
100 2012-03-21 Cary Coutant <ccoutant@google.com>
102 * Makefile.am: Add gdb-index.cc, gdb-index.h.
103 * Makefile.in: Regenerate.
104 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
105 (Sized_elf_reloc_mapper::symbol_section): New function.
106 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
107 (make_elf_reloc_mapper): New function.
108 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
109 (Dwarf_abbrev_table::do_read_abbrevs): New function.
110 (Dwarf_abbrev_table::do_get_abbrev): New function.
111 (Dwarf_ranges_table::read_ranges_table): New function.
112 (Dwarf_ranges_table::read_range_list): New function.
113 (Dwarf_pubnames_table::read_section): New function.
114 (Dwarf_pubnames_table::read_header): New function.
115 (Dwarf_pubnames_table::next_name): New function.
116 (Dwarf_die::Dwarf_die): New function.
117 (Dwarf_die::read_attributes): New function.
118 (Dwarf_die::skip_attributes): New function.
119 (Dwarf_die::set_name): New function.
120 (Dwarf_die::set_linkage_name): New function.
121 (Dwarf_die::attribute): New function.
122 (Dwarf_die::string_attribute): New function.
123 (Dwarf_die::int_attribute): New function.
124 (Dwarf_die::uint_attribute): New function.
125 (Dwarf_die::ref_attribute): New function.
126 (Dwarf_die::child_offset): New function.
127 (Dwarf_die::sibling_offset): New function.
128 (Dwarf_info_reader::check_buffer): New function.
129 (Dwarf_info_reader::parse): New function.
130 (Dwarf_info_reader::do_parse): New function.
131 (Dwarf_info_reader::do_read_string_table): New function.
132 (Dwarf_info_reader::lookup_reloc): New function.
133 (Dwarf_info_reader::get_string): New function.
134 (Dwarf_info_reader::visit_compilation_unit): New function.
135 (Dwarf_info_reader::visit_type_unit): New function.
136 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
137 Sized_elf_reloc_mapper.
138 (Sized_dwarf_line_info::symbol_section): Remove function.
139 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
140 (Sized_dwarf_line_info::read_line_mappings): Remove object
141 parameter, adjust callers.
142 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
143 * dwarf_reader.h: Include <sys/types.h>.
144 (class Track_relocs): Remove forward declaration.
145 (class Elf_reloc_mapper): New class.
146 (class Sized_elf_reloc_mapper): New class.
147 (class Dwarf_abbrev_table): New class.
148 (class Dwarf_range_list): New class.
149 (class Dwarf_ranges_table): New class.
150 (class Dwarf_pubnames_table): New class.
151 (class Dwarf_die): New class.
152 (class Dwarf_info_reader): New class.
153 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
154 (Sized_dwarf_line_info::symbol_section): Remove member function.
155 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
157 * gdb-index.cc: New source file.
158 * gdb-index.h: New source file.
159 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
160 and .debug_types sections, call Layout::add_to_gdb_index.
161 (Sized_relobj_incr::do_section_name): Implement.
162 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
163 return type; Implement.
164 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
166 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
167 parameter list and return type.
168 (Sized_incr_dynobj::do_section_contents): Likewise.
169 * layout.cc: Include gdb-index.h.
170 (Layout::Layout): Initialize gdb_index_data_.
171 (Layout::init_fixed_output_section): Check for .gdb_index section.
172 (Layout::add_to_gdb_index): New function. Instantiate.
173 * layout.h: Add forward declaration for class Gdb_index.
174 (Layout::add_to_gdb_index): New member function.
175 (Layout::gdb_index_data_): New data member.
176 * main.cc: Include gdb-index.h.
177 (main): Print statistics for gdb index.
178 * object.cc (Object::section_contents): Move code into
180 (need_decompressed_section): Check for sections needed when building
182 (build_compressed_section_map): Likewise.
183 (Sized_relobj_file::do_read_symbols): Need local symbols when building
185 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
186 sections; call Layout::add_to_gdb_index.
187 (Sized_relobj_file::do_decompressed_section_contents): Call
188 do_section_contents directly.
189 * object.h (Object::do_section_contents): Adjust parameter list and
191 (Object::do_decompressed_section_contents): Call do_section_contents
193 (Sized_relobj_file::do_section_contents): Adjust parameter list and
195 * options.h (class General_options): Add --gdb-index option.
196 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
197 list and return type.
198 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
199 * reloc.h (Track_relocs::checkpoint): New function.
200 (Track_relocs::reset): New function.
202 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
204 * testsuite/Makefile.in: Regenerate.
205 * testsuite/gdb_index_test.cc: New test source file.
206 * testsuite/gdb_index_test_1.sh: New test source file.
207 * testsuite/gdb_index_test_2.sh: New test source file.
209 2012-03-19 Doug Kwan <dougkwan@google.com>
211 * arm.cc (Target_arm::do_define_standard_symbols): New method.
212 (Target_arm::do_finalize_sections): Remove code which defines
213 __exidx_start and __exidx_end. Make symbol table parameter
214 anonymous as it is not used.
215 * gold.cc (queue_middle_tasks): Call target hook to define any
216 target-specific symbols.
217 * target.h (Target::define_standard_symbols): New method.
218 (Target::do_define_standard_symbols): Same.
219 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
220 * testsuite/Makefile.in: Regenerate.
221 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
223 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
224 relocations are generated for __exidx_start and __exidx_end.
226 2012-03-16 Doug Kwan <dougkwan@google.com>
228 * testsuite/Makefile.am: Disable test initpri3b.
229 * testsuite/Makefile.in: Regenerate.
231 2012-03-15 Doug Kwan <dougkwan@google.com>
233 * arm.cc (Target_arm::got_section): Make .got section read-only
236 2012-03-15 Ian Lance Taylor <iant@google.com>
239 * layout.cc (Layout::make_output_section): Correctly mark
240 SHT_INIT_ARRAY, et. al., as relro.
242 2012-03-14 Doug Kwan <dougkwan@google.com>
244 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
245 dynamic relocations for protected symbols in shared objects.
247 2012-03-13 Ian Lance Taylor <iant@google.com>
249 * resolve.cc (Symbol_table::resolve): When merging common symbols,
250 keep the larger alignment.
252 2012-03-12 Cary Coutant <ccoutant@google.com>
254 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
255 handling of DW_LNE_define_file.
257 2012-03-12 Cary Coutant <ccoutant@google.com>
259 * reduced_debug_output.cc
260 (Output_reduced_debug_info_section::get_die_end): Add new FORM
263 2012-02-29 Cary Coutant <ccoutant@google.com>
265 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
267 2012-02-29 Cary Coutant <ccoutant@google.com>
269 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
270 Call Object::decompressed_section_contents.
271 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
273 (Sized_dwarf_line_info::buffer_start_): New data member.
274 * merge.cc (Output_merge_data::do_add_input_section): Call
275 Object::decompressed_section_contents.
276 (Output_merge_string::do_add_input_section): Likewise.
277 * object.cc (need_decompressed_section): New function.
278 (build_compressed_section_map): Decompress sections needed later.
279 (Sized_relobj_file::do_decompressed_section_contents): New function.
280 (Sized_relobj_file::do_discard_decompressed_sections): New function.
281 * object.h (Object::decompressed_section_contents): New function.
282 (Object::discard_decompressed_sections): New function.
283 (Object::do_decompressed_section_contents): New function.
284 (Object::do_discard_decompressed_sections): New function.
285 (Compressed_section_info): New type.
286 (Compressed_section_map): Include decompressed section contents.
287 (Sized_relobj_file::do_decompressed_section_contents): New function.
288 (Sized_relobj_file::do_discard_decompressed_sections): New function.
290 2012-02-16 Cary Coutant <ccoutant@google.com>
292 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
293 * testsuite/Makefile.in: Regenerate.
295 2012-02-14 Cary Coutant <ccoutant@google.com>
297 * options.cc (General_options::finalize): Disallow -pie and -static.
299 2012-02-03 Doug Kwan <dougkwan@google.com>
301 * arm.cc (Arm_relocate_functions::abs8,
302 Arm_relocate_functions::abs16): Use
303 Bits::has_signed_unsigned_overflow32.
304 (Arm_relocate_functions::thm_abs8): Correct range of
306 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
309 2012-02-02 Doug Kwan <dougkwan@google.com>
311 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
312 position independent outputs, not just shared objects.
314 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
316 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
317 * configure: Regenerated.
319 2012-01-27 Ian Lance Taylor <iant@google.com>
321 * reloc.h (Bits): New class with static functions, copied from
322 namespace utils in arm.cc.
323 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
326 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
328 * incremental.cc (write_info_blocks): Correct relocation offset.
330 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
332 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
333 (Relocate::tls_gd_to_le): Likewise.
335 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
337 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
339 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
341 * configure.ac: Check if -mcmodel=medium works.
342 * configure: Regenerated.
344 2012-01-24 Cary Coutant <ccoutant@google.com>
346 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
348 (read_unsigned_LEB_128_x): ... this new function.
349 (read_signed_LEB_128): Replaced with inline definition and ...
350 (read_signed_LEB_128_x): ... this new function.
351 * int_encoding.h (read_unsigned_LEB_128_x): New function.
352 (read_unsigned_LEB_128): Add inline definition.
353 (read_signed_LEB_128_x): New function.
354 (read_signed_LEB_128): Add inline definition.
355 * testsuite/Makefile.am (leb128_unittest): New unit test.
356 * testsuite/Makefile.in: Regenerate.
357 * testsuite/leb128_unittest.cc: New unit test.
359 2012-01-23 Ian Lance Taylor <iant@google.com>
362 * i386.cc (Target_i386::do_code_fill): When using a jmp
363 instruction, pad with nop instructions.
364 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
366 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
368 * x86_64.cc (gc_process_relocs): Add typename on types used in
370 (scan_relocs): Likewise.
371 (relocate_section): Likewise.
372 (apply_relocation): Likewise.
374 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
376 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
377 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
380 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
382 * x86_64.cc: Initial support for x32.
384 2012-01-03 Cary Coutant <ccoutant@google.com>
386 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
387 Use abstract base class for GOT.
388 * gold/output.h (class Output_data_got_base): New abstract base class.
389 (class Output_data_got): Derive from new base class, adjust ctors.
390 (Output_data_got::reserve_slot): Make virtual; rename to
391 do_reserve_slot; Adjust callers.
392 * gold/target.h (Sized_target::init_got_plt_for_update): Return
393 pointer to abstract base class.
394 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
396 2011-12-18 Ian Lance Taylor <iant@google.com>
398 * object.h (Relobj::local_symbol_value): New function.
399 (Relobj::local_plt_offset): New function.
400 (Relobj::local_has_got_offset): New function.
401 (Relobj::local_got_offset): New function.
402 (Relobj::set_local_got_offset): New function.
403 (Relobj::do_local_symbol_value): New pure virtual function.
404 (Relobj::do_local_plt_offset): Likewise.
405 (Relobj::do_local_has_got_offset): Likewise.
406 (Relobj::do_local_got_offset): Likewise.
407 (Relobj::do_set_local_got_offset): Likewise.
408 (Sized_relobj::do_local_has_got_offset): Rename from
409 local_has_got_offset.
410 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
411 (Sized_relobj::do_set_local_got_offset): Rename from
412 set_local_got_offset.
413 (Sized_relobj_file::do_local_plt_offset): Rename from
415 (Sized_relobj_file::do_local_symbol_value): New function.
416 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
418 * output.cc (Output_data_got::Got_entry::write): Change object to
419 Relobj. Use local_symbol_value.
420 (Output_data_got::add_global_with_rel): Change rel_dyn to
421 Output_data_reloc_generic*. Use add_global_generic.
422 (Output_data_got::add_global_with_rela): Remove. Change all
423 callers to use add_global_with_rel.
424 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
425 Output_data_reloc_generic*. Use add_global_generic.
426 (Output_data_got::add_global_pair_with_rela): Remove. Change all
427 callers to use add_global_pair_with_rel.
428 (Output_data_got::add_local): Change object to Relobj*.
429 (Output_data_got::add_local_plt): Likewise.
430 (Output_data_got::add_local_with_rel): Change object to Relobj*,
431 change rel_dyn to Output_data_reloc_generic*. Use
433 (Output_data_got::add_local_with_rela): Remove. Change all
434 callers to use all_local_with_rel.
435 (Output_data_got::add_local_pair_with_rel): Change object to
436 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
437 add_output_section_generic.
438 (Output_data_got::add_local_pair_with_rela): Remove. Change all
439 callers to use add_local_pair_with_rel.
440 (Output_data_got::reserve_local): Change object to Relobj*.
441 * output.h: (class Output_data_reloc_generic): Add pure virtual
442 declarations for add_global_generic, add_local_generic,
443 add_output_section_generic.
444 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
445 functions for Output_data_reloc_generic. Update declarations for
446 changes listed in output.cc.
447 (class Output_data_got): Change template parameter to got_size.
448 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
449 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
451 (Sized_relobj_incr::do_local_plt_offset): New function.
452 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
455 2011-12-17 Cary Coutant <ccoutant@google.com>
457 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
458 * resolve.cc (Symbol_table::resolve): Likewise.
459 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
461 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
463 2011-12-16 Ian Lance Taylor <iant@google.com>
465 * output.h (Output_data_reloc_generic::add): Only call
466 add_dynamic_reloc if this is a dynamic reloc section.
468 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
471 * target-reloc.h (apply_relocation): Replace <64, false> with
474 2011-11-25 Nick Clifton <nickc@redhat.com>
476 * po/it.po: New Italian translation.
478 2011-11-17 Sterling Augustine <saugustine@google.com>
480 * script.cc (script_include_directive): Implement.
481 (read_script_file): New local variables name and search_path. Update
482 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
483 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
484 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
486 2011-11-11 Sterling Augustine <saugustine@google.com>
488 * yyscript.y (section_cmd): Add support for INCLUDE directive.
489 (file_or_sections_cmd): Likewise.
491 2011-11-11 Doug Kwan <dougkwan@google.com>
493 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
494 if --just-symbols is given.
496 2011-11-10 Doug Kwan <dougkwan@google.com>
499 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
500 when processing data relocs.
501 * reloc.h (Relocate_functions::rel_unaligned): New method.
502 (Relocate_functions::pcrel_unaligned): Ditto.
503 (Relocate_functions::rel32_unaligned): Ditto.
504 (Relocate_functions::pcrel32_unaligned): Ditto.
506 2011-11-09 Doug Kwan <dougkwan@google.com>
509 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
510 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
511 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
512 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
513 (Relocate_functions::rel_unaligned): New.
514 (Relocate_functions::rel32_unaligned): New.
515 * target-reloc.h (relocate_for_relocatable): Add code to handle
516 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
517 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
518 arm_unaligned_reloc_r): New targets.
519 * testsuite/Makefile.in: Regenerate.
520 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
523 2011-11-02 Ian Lance Taylor <iant@google.com>
525 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
527 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
528 * options.cc (General_options::finalize): Use library search path
529 from configure script if specified. If not native and no sysroot,
530 only search TOOLLIBDIR.
531 * options.h (Search_directory::Search_directory): Change name to
533 (General_options::add_to_library_path_with_sysroot): Change arg to
535 * configure, Makefile.in, config.in: Rebuild.
537 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
539 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
540 we are working around the ARM1176 Erratum.
541 * options.h (General_options::fix_arm1176): Add option.
542 * testsuite/Makefile.am: Add testcases, and keep current ones
544 * testsuite/Makefile.in: Regenerate.
545 * testsuite/arm_fix_1176.s: New file.
546 * testsuite/arm_fix_1176.sh: Likewise.
548 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
550 * arm.cc (Target_arm::Target_arm): Remove initialisation of
552 (Target_arm::may_use_blx): Remove method.
553 (Target_arm::set_may_use_blx): Likewise.
554 (Target_arm::may_use_v4t_interworking): New method.
555 (Target_arm::may_use_v5t_interworking): Likewise.
556 (Target_arm::may_use_blx_): Remove member variable.
557 (Arm_relocate_functions::arm_branch_common): Check for v5T
559 (Arm_relocate_functions::thumb_branch_common): Likewise.
560 (Reloc_stub::stub_type_for_reloc): Likewise.
561 (Target_arm::do_finalize_sections): Correct interworking checks.
562 * testsuite/Makefile.am: Add new tests.
563 * testsuite/Makefile.in: Regenerate.
564 * testsuite/arm_farcall_arm_arm.s: New test.
565 * testsuite/arm_farcall_arm_arm.sh: Likewise.
566 * testsuite/arm_farcall_arm_thumb.s: Likewise.
567 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
568 * testsuite/arm_farcall_thumb_arm.s: Likewise.
569 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
570 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
571 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
573 2011-10-31 Cary Coutant <ccoutant@google.com>
576 * expression.cc (Expression::eval_with_dot): Add
577 is_section_dot_assignment parameter.
578 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
579 absolute and assigning to dot within a section.
581 (Output_section_element_assignment::set_section_addresses): Pass
582 dot_section to set_if_absolute.
583 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
584 as is_section_dot_assignment flag to eval_with_dot.
585 (Output_section_element_dot_assignment::set_section_addresses):
587 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
588 parameter. Also set value if relative to dot_section; set the
589 symbol's output_section.
590 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
591 parameter. Adjust all callers.
592 (Expression::eval_maybe_dot): Likewise.
593 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
595 * testsuite/script_test_2.t: Test assignment of an absolute value
596 to dot within an output section element.
598 2011-10-31 Cary Coutant <ccoutant@google.com>
600 * options.h (class General_options): Add --[no-]gnu-unique options.
601 * symtab.cc (Symbol_table::sized_write_globals): Convert
602 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
604 2011-10-31 Cary Coutant <ccoutant@google.com>
607 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
608 unnecessary assertion.
609 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
611 2011-10-31 Sriraman Tallam <tmsriram@google.com>
613 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
615 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
617 Change to just keep the section associated with symbol.
618 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
619 they are externally visible and --export-dynamic is turned on.
620 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
622 2011-10-19 Ian Lance Taylor <iant@google.com>
626 (Output_section_element_dot_assignment::needs_output_section): New
629 2011-10-19 Ian Lance Taylor <iant@google.com>
632 * layout.cc (Layout::segment_precedes): Don't assert failure if a
633 --section-start option was seen.
634 * options.h (General_options::any_section_start): New function.
636 2011-10-18 David S. Miller <davem@davemloft.net>
639 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
640 member to track relocation locations that have moved during TLS
642 (Target_sparc::Relocate::Relocate): Initialize to NULL.
643 (Target_sparc::Relocate::relocate): Adjust view down by 4
644 bytes if it matches reloc_adjust_addr_.
645 (Target_sparc::Relocate::relocate_tls): Always move the
646 __tls_get_addr call delay slot instruction forward 4 bytes when
647 performing relaxation.
649 2011-10-18 Cary Coutant <ccoutant@google.com>
651 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
652 (Output_file::map_no_anonymous): Check for non-zero
653 return code from posix_fallocate.
655 2011-10-17 Cary Coutant <ccoutant@google.com>
658 * plugin.cc (is_visible_from_outside): Check for symbols
659 referenced from dynamic objects.
660 * resolve.cc (Symbol_table::resolve): Don't count references
661 from dynamic objects as references from real ELF files.
662 * testsuite/plugin_test_2.sh: Adjust expected result.
664 2011-10-17 Cary Coutant <ccoutant@google.com>
666 * gold.cc: Include timer.h.
667 (queue_middle_tasks): Stamp time.
668 (queue_final_tasks): Likewise.
669 * main.cc (main): Store timer in parameters. Print timers
671 * parameters.cc (Parameters::Parameters): Initialize timer_.
672 (Parameters::set_timer): New function.
673 (set_parameters_timer): New function.
674 * parameters.h (Parameters::set_timer): New function.
675 (Parameters::timer): New function.
676 (Parameters::timer_): New data member.
677 (set_parameters_timer): New function.
678 * timer.cc (Timer::stamp): New function.
679 (Timer::get_pass_time): New function.
680 * timer.h (Timer::stamp): New function.
681 (Timer::get_pass_time): New function.
682 (Timer::pass_times_): New data member.
684 2011-10-17 Cary Coutant <ccoutant@google.com>
686 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
687 task for members of lib groups.
689 2011-10-17 Cary Coutant <ccoutant@google.com>
692 * fileread.cc (File_read::find_view): Add assert.
693 (File_read::make_view): Move bounds check (replace with assert)...
694 (File_read::find_or_make_view): ... to here.
696 2011-10-12 Cary Coutant <ccoutant@google.com>
698 * output.cc (Output_file::open_base_file): Handle case where
699 ::read returns less than requested size.
701 2011-10-10 Cary Coutant <ccoutant@google.com>
703 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
704 Initialize defined_count_.
705 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
706 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
707 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
708 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
709 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
710 * incremental.h (Sized_relobj_incr::defined_count_): New data
712 (Sized_incr_dynobj::defined_count_): New data member.
713 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
714 Return zeroes instead of internal error.
716 2011-10-10 Cary Coutant <ccoutant@google.com>
719 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
720 (Output_reloc::symbol_value): Return PLT offset if flag is set.
721 * output.h (class Output_reloc): Add use_plt_offset flag.
722 (Output_reloc::type_): Adjust size of bit field.
723 (Output_reloc::use_plt_offset_): New bit field.
724 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
725 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
726 flag. Adjust all callers.
727 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
728 creating RELATIVE relocations.
730 2011-10-10 Nick Clifton <nickc@redhat.com>
732 * po/es.po: Updated Spanish translation.
733 * po/fi.po: Updated Finnish translation.
735 2011-10-03 Diego Novillo <dnovillo@google.com>
737 * options.cc (parse_uint): Fix dereference of RETVAL.
739 2011-09-29 Sriraman Tallam <tmsriram@google.com>
741 * layout.h (section_order_map_): New member.
742 (get_section_order_map): New member function.
743 * output.cc (Output_section::add_input_section): Check for patterns
744 only when --section-ordering-file is specified.
745 * gold.cc (queue_middle_tasks): Delay updating order of sections till
746 output_sections have been formed.
747 * layout.cc (Layout_Layout): Initialize section_order_map_.
748 * plugin.cc (update_section_order): Store order in order_map. Do not
750 * testsuite/Makefile.am: Add test case for plugin_final_layout.
751 * testsuite/Makefile.in: Regenerate.
752 * testsuite/plugin_section_order.c: New file.
753 * testsuite/plugin_final_layout.cc: New file.
754 * testsuite/plugin_final_layout.sh: New file.
756 2011-09-29 Cary Coutant <ccoutant@google.com>
758 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
760 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
761 symbols during incremental update.
762 (Symbol_table::add_from_dynobj): Likewise.
764 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
765 Ian Lance Taylor <iant@google.com>
767 * symtab.cc (Symbol_table::define_special_symbol): Always
768 canonicalize version string.
770 2011-09-26 Cary Coutant <ccoutant@google.com>
772 * gold.cc (queue_initial_tasks): Move option checks ...
773 * options.cc (General_options::finalize): ... to here. Disable
774 some options; make others fatal.
776 2011-09-26 Cary Coutant <ccoutant@google.com>
779 * plugin.cc (get_symbols_v2): New function.
780 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
781 (is_referenced_from_outside): New function.
782 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
783 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
784 (get_symbols): Pass version parameter.
785 (get_symbols_v2): New function.
786 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
788 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
789 (onload): Add LDPT_GET_SYMBOLS_V2.
790 (all_symbols_read_hook): Use get_symbols_v2; check for
791 LDPR_PREVAILING_DEF_IRONLY_EXP.
792 * testsuite/plugin_test_3.sh: Update expected results.
794 2011-09-23 Simon Baldwin <simonb@google.com>
796 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
797 configuration options.
798 * configure: Regenerate.
799 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
800 * Makefile.in: Regenerate.
801 * testsuite/Makefile.in: Regenerate.
803 2011-09-19 Sriraman Tallam <tmsriram@google.com>
805 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
807 2011-09-19 Cary Coutant <ccoutant@google.com>
809 * incremental.cc (can_incremental_update): Fix typo in comment.
810 * incremental.h (can_incremental_update): Likewise.
812 2011-09-18 Cary Coutant <ccoutant@google.com>
814 * incremental.cc (can_incremental_update): New function.
815 * incremental.h (can_incremental_update): New function.
816 * layout.cc (Layout::init_fixed_output_section): Call it.
817 (Layout::make_output_section): Don't allow patch space in .eh_frame.
818 * object.cc (Sized_relobj_file::do_layout): Call
819 can_incremental_update.
821 2011-09-13 Cary Coutant <ccoutant@google.com>
823 * configure.ac: Check for glibc support for gnu_indirect_function
824 support with static linking, setting automake conditional
826 * Makefile.in: Regenerate.
827 * configure: Regenerate.
829 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
830 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
832 * testsuite/Makefile.in: Regenerate.
834 2011-09-13 Cary Coutant <ccoutant@google.com>
836 * incremental.cc (Sized_relobj_incr::do_layout): Call
837 report_comdat_group for kept comdat sections.
838 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
839 * testsuite/Makefile.in: Regenerate.
840 * testsuite/incr_comdat_test_1.cc: New source file.
841 * testsuite/incr_comdat_test_2_v1.cc: New source file.
842 * testsuite/incr_comdat_test_2_v2.cc: New source file.
843 * testsuite/incr_comdat_test_2_v3.cc: New source file.
845 2011-09-13 Ian Lance Taylor <iant@google.com>
847 * object.cc (Sized_relobj_file::do_layout): Remove unused local
848 variable external_symbols_offset.
850 2011-09-12 Ian Lance Taylor <iant@google.com>
852 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
853 triggered if object has no symbols.
855 2011-09-09 David S. Miller <davem@davemloft.net>
857 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
858 (Output_fill_debug_line::do_write): Likewise.
860 2011-08-29 Cary Coutant <ccoutant@google.com>
862 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
863 casts to match formatting specs.
864 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
866 2011-08-26 Cary Coutant <ccoutant@google.com>
868 * layout.cc (Free_list::allocate): Provide guarantee of minimum
869 remaining hole size when allocating.
870 (Layout::make_output_section): Set fill methods for debug sections.
871 * layout.h (Free_list::Free_list_node): Move from private to
873 (Free_list::set_min_hole_size): New function.
874 (Free_list::begin, Free_list::end): New functions.
875 (Free_list::min_hole_): New data member.
876 * output.cc: Include dwarf.h.
877 (Output_fill_debug_info::do_minimum_hole_size): New function.
878 (Output_fill_debug_info::do_write): New function.
879 (Output_fill_debug_line::do_minimum_hole_size): New function.
880 (Output_fill_debug_line::do_write): New function.
881 (Output_section::Output_section): Initialize new data member.
882 (Output_section::set_final_data_size): Ensure patch space is larger
883 than minimum hole size.
884 (Output_section::do_write): Fill holes in debug sections.
885 * output.h (Output_fill): New class.
886 (Output_fill_debug_info): New class.
887 (Output_fill_debug_line): New class.
888 (Output_section::set_free_space_fill): New function.
889 (Output_section::free_space_fill_): New data member.
890 * testsuite/Makefile.am (incremental_test_3): Add
891 --incremental-patch option.
892 (incremental_test_4): Likewise.
893 (incremental_test_5): Likewise.
894 (incremental_test_6): Likewise.
895 (incremental_copy_test): Likewise.
896 (incremental_common_test_1): Likewise.
897 * testsuite/Makefile.in: Regenerate.
899 2011-08-26 Nick Clifton <nickc@redhat.com>
901 * po/es.po: Updated Spanish translation.
903 2011-08-01 Cary Coutant <ccoutant@google.com>
905 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
906 * gold/testsuite/Makefile.in: Regenerate.
907 * gold/testsuite/justsyms_exec.c: New source file.
908 * gold/testsuite/justsyms_lib.c: New source file.
910 2011-08-01 Cary Coutant <ccoutant@google.com>
912 * layout.cc (Layout::set_segment_offsets): Don't realign text
913 segment if -Ttext was specified.
914 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
916 * object.h (Sized_relobj_file::e_type): New function.
917 (Sized_relobj_file::e_type_): New data member.
918 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
919 base address for ET_EXEC files.
920 * target.cc (Target::do_make_elf_object_implementation): Allow
921 ET_EXEC files with --just-symbols option.
923 2011-07-28 Cary Coutant <ccoutant@google.com>
925 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
926 Add thread_number parameter.
927 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
928 * workqueue-threads.cc
929 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
930 current thread if its thread number is greater than desired thread
932 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
933 Add thread_number parameter.
934 (Workqueue::should_cancel_thread): Likewise.
935 (Workqueue::find_runnable_or_wait): Pass thread_number to
936 should_cancel_thread.
937 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
940 2011-07-22 Sriraman Tallam <tmsriram@google.com>
942 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
943 only after checking if it cannot be forced local.
944 * symtab.h (is_externally_visible): Check if the symbol is not forced
947 2011-07-15 Ian Lance Taylor <iant@google.com>
949 * options.h (class General_options): Add --print-output-format.
950 Move -EL next to -EB, for better --help output.
951 * target-select.cc: Include <cstdio>, "options.h", and
953 (Target_selector::do_target_bfd_name): New function.
954 (print_output_format): New function.
955 * target-select.h (class Target_selector): Update declarations.
956 (Target_selector::target_bfd_name): New function.
957 (print_output_format): Declare.
958 * main.cc: Include "target-select.h".
959 (main): Handle --print-output-format.
960 * gold.cc: Include "target-select.h".
961 (queue_initial_tasks): Handle --print-output-format when there are
963 * parameters.cc (parameters_force_valid_target): Give a better
964 error message if -EB/-EL does not match target.
965 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
968 2011-07-15 Ian Lance Taylor <iant@google.com>
970 * i386.cc (class Output_data_plt_i386): Add layout_ field.
971 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
972 (Output_data_plt_i386::do_write): Write address of .dynamic
973 section to first entry in .got.plt section.
974 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
975 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
977 (Output_data_plt_x86_64::do_write): Write address of .dynamic
978 section to first entry in .got.plt section.
979 * layout.h (Layout::dynamic_section): New function.
981 2011-07-13 Sriraman Tallam <tmsriram@google.com>
983 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
985 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
986 input_section_position_, and input_section_glob_.
987 (read_layout_from_file): Call function section_ordering_specified.
988 * layout.h (is_section_ordering_specified): New function.
989 (section_ordering_specified): New function.
990 (section_ordering_specified_): New boolean member.
991 * main.cc(main): Call load_plugins after layout object is defined.
992 * output.cc (Output_section::add_input_section): Use
993 function section_ordering_specified to check if section ordering is
995 * output.cc (Output_section::add_relaxed_input_section): Use
996 function section_ordering_specified to check if section ordering is
998 (Output_section::update_section_layout): New function.
999 (Output_section::sort_attached_input_sections): Check if input section
1001 * output.h (Output_section::update_section_layout): New function.
1002 * plugin.cc (get_section_count): New function.
1003 (get_section_type): New function.
1004 (get_section_name): New function.
1005 (get_section_contents): New function.
1006 (update_section_order): New function.
1007 (allow_section_ordering): New function.
1008 (Plugin::load): Add the new interfaces to the transfer vector.
1009 (Plugin_manager::load_plugins): New parameter.
1010 (Plugin_manager::all_symbols_read): New parameter.
1011 (Plugin_manager::claim_file): New parameter. Save the elf object for
1013 (Plugin_manager::get_elf_object): New function.
1014 (Plugin_manager::get_view): Change to directly use the bool to check
1015 if get_view is called from claim_file_hook.
1016 * plugin.h (input_objects): New function
1017 (Plugin__manager::load_plugins): New parameter.
1018 (Plugin_manager::claim_file): New parameter.
1019 (Plugin_manager::get_elf_object): New function.
1020 (Plugin_manager::in_claim_file_handler): New function.
1021 (Plugin_manager::in_claim_file_handler_): New member.
1022 (layout): New function.
1023 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1024 handler with an extra parameter. Make the elf object before calling
1026 * testsuite/plugin_test.c (get_section_count): New function pointer.
1027 (get_section_type): New function pointer.
1028 (get_section_name): New function pointer.
1029 (get_section_contents): New function pointer.
1030 (update_section_order): New function pointer.
1031 (allow_section_ordering): New function pointer.
1032 (onload): Check if the new interfaces exist.
1034 2011-07-13 Ian Lance Taylor <iant@google.com>
1036 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1038 * x86_64.cc (Target_x86_64::got_section): Likewise.
1039 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1040 (relro_now_test_SOURCES): New variable.
1041 (relro_now_test_DEPENDENCIES): New variable.
1042 (relro_now_test_LDFLAGS): New variable.
1043 (relro_now_test_LDADD): New variable.
1044 (relro_now_test.so): New target.
1045 * testsuite/Makefile.in: Rebuild.
1047 2011-07-12 Ian Lance Taylor <iant@google.com>
1050 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1051 GLOB_DAT relocation rather than a RELATIVE relocation for a
1052 protected symbol when creating a shared library.
1053 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1054 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1055 * testsuite/protected_main_1.cc (main): Test that protected
1056 function has same address.
1058 2011-07-11 Ian Lance Taylor <iant@google.com>
1061 * options.h (class General_options): Add -Bgroup.
1062 * options.cc (General_options::finalize): If -Bgroup is set,
1063 default to --unresolved-symbols=report-all.
1064 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1065 * target-reloc.h (issue_undefined_symbol_error): Handle
1066 --unresolved-symbols=report-all.
1068 2011-07-08 Ian Lance Taylor <iant@google.com>
1071 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1072 if linker script discards key sections.
1073 (Layout::create_dynamic_symtab): Likewise.
1074 (Layout::assign_local_dynsym_offsets): Likewise.
1075 (Layout::sized_create_version_sections): Likewise.
1076 (Layout::create_interp): Likewise.
1077 (Layout::finish_dynamic_section): Likewise.
1078 (Layout::set_dynamic_symbol_size): Likewise.
1080 2011-07-08 Ian Lance Taylor <iant@google.com>
1083 * options.h (class General_options): Add --unresolved-symbols.
1084 * target-reloc.h (issue_undefined_symbol_error): Check
1085 --unresolved-symbols. Add comments.
1087 2011-07-08 Ian Lance Taylor <iant@google.com>
1089 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1090 expression more complex.
1092 2011-07-08 Ian Lance Taylor <iant@google.com>
1095 * target-reloc.h (issue_undefined_symbol_error): New inline
1096 function, broken out of relocate_section.
1097 (relocate_section): Call issue_undefined_symbol_error.
1098 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1099 there is no TLS segment if we are about to issue an undefined
1101 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1103 2011-07-08 Ian Lance Taylor <iant@google.com>
1106 * resolve.cc (Symbol_table::should_override): Add fromtype
1107 parameter. Change all callers. Give error when linking together
1108 TLS and non-TLS symbol.
1109 (Symbol_table::should_override_with_special): Add fromtype
1110 parameter. Change all callers.
1111 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1112 there is no TLS segment if we have reported some errors.
1113 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1115 2011-07-08 Ian Lance Taylor <iant@google.com>
1118 * target.h (Target::plt_address_for_global): New function.
1119 (Target::plt_address_for_local): New function.
1120 (Target::plt_section_for_global): Remove.
1121 (Target::plt_section_for_local): Remove.
1122 (Target::do_plt_address_for_global): New virtual function.
1123 (Target::do_plt_address_for_local): New virtual function.
1124 (Target::do_plt_section_for_global): Remove.
1125 (Target::do_plt_section_for_local): Remove.
1126 (Target::register_global_plt_entry): Add Symbol_table and Layout
1128 * output.cc (Output_data_got::Got_entry::write): Use
1129 plt_address_for_global and plt_address_for_local.
1130 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1131 address of output section.
1132 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1133 got_irelative_, and irelative_count_ fields. Update
1135 (Output_data_plt_i386::has_irelative_section): New function.
1136 (Output_data_plt_i386::entry_count): Add irelative_count_.
1137 (Output_data_plt_i386::set_final_data_size): Likewise.
1138 (class Target_i386): Add got_irelative_ and rel_irelative_
1139 fields. Update declarations.
1140 (Target_i386::Target_i386): Initialize new fields.
1141 (Target_i386::do_plt_address_for_global): New function replacing
1142 do_plt_section_for_global.
1143 (Target_i386::do_plt_address_for_local): New function replacing
1144 do_plt_section_for_local.
1145 (Target_i386::got_section): Create got_irelative_.
1146 (Target_i386::rel_irelative_section): New function.
1147 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1148 fields. Don't define __rel_iplt_{start,end}.
1149 (Output_data_plt_i386::add_entry): Add symtab and layout
1150 parameters. Change all callers. Use different PLT and GOT for
1152 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1153 layout parameters. Change all callers. Use different PLT and
1155 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1156 (Output_data_plt_i386::rel_irelative): New function.
1157 (Output_data_plt_i386::address_for_global): New function.
1158 (Output_data_plt_i386::address_for_local): New function.
1159 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1160 IRELATIVE GOT when changing IFUNC GOT entries.
1161 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1163 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1164 if we didn't create an IRELATIVE GOT.
1165 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1166 plt_address_for_local.
1167 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1168 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1169 got_irelative_, and irelative_count_ fields. Update
1171 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1172 Initialize new fields. Remove symtab parameter. Change all
1174 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1176 (Output_data_plt_x86_64::has_irelative_section): New function.
1177 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1178 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1179 fields. Update declarations.
1180 (Target_x86_64::Target_x86_64): Initialize new fields.
1181 (Target_x86_64::do_plt_address_for_global): New function replacing
1182 do_plt_section_for_global.
1183 (Target_x86_64::do_plt_address_for_local): New function replacing
1184 do_plt_section_for_local.
1185 (Target_x86_64::got_section): Create got_irelative_.
1186 (Target_x86_64::rela_irelative_section): New function.
1187 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1188 all callers. Don't create __rel_iplt_{start,end}.
1189 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1190 parameters. Change all callers. Use different PLT and GOT for
1192 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1193 layout parameters. Change all callers. Use different PLT and
1195 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1196 parameters. Change all callers. Use different PLT and GOT for
1198 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1199 (Output_data_plt_x86_64::rela_irelative): New function.
1200 (Output_data_plt_x86_64::address_for_global): New function.
1201 (Output_data_plt_x86_64::address_for_local): New function.
1202 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1203 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1204 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1205 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1207 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1209 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1210 symbols if we didn't create an IRELATIVE GOT.
1211 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1212 plt_address_for_local.
1213 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1214 * testsuite/ifuncvar1.c: New test file.
1215 * testsuite/ifuncvar2.c: New test file.
1216 * testsuite/ifuncvar3.c: New test file.
1217 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1218 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1219 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1220 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1221 * testsuite/Makefile.in: Rebuild.
1223 2011-07-07 Cary Coutant <ccoutant@google.com>
1225 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1226 (two_file_test_1_ndebug.o): Likewise.
1227 (two_file_test_1b_ndebug.o): Likewise.
1228 (two_file_test_2_ndebug.o): Likewise.
1229 (two_file_test_main_ndebug.o): Likewise.
1230 (incremental_test_2): Link with no-debug versions.
1232 2011-07-06 Cary Coutant <ccoutant@google.com>
1234 * gold/incremental.cc
1235 (Output_section_incremental_inputs::write_info_blocks): Check for
1236 hidden and internal symbols.
1238 2011-07-06 Cary Coutant <ccoutant@google.com>
1240 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1241 Check disposition for startup file.
1242 (Incremental_inputs::report_command_line): Ignore
1243 --incremental-startup-unchanged option.
1244 * options.cc (General_options::parse_incremental_startup_unchanged):
1246 (General_options::General_options): Initialize new data member.
1247 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1248 (General_options): Add --incremental-startup-unchanged option.
1249 (General_options::incremental_startup_disposition): New function.
1250 (General_options::incremental_startup_disposition_): New data member.
1252 2011-07-06 Cary Coutant <ccoutant@google.com>
1254 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1255 input file index to Script_info ctor.
1256 (Sized_incremental_binary::do_file_has_changed): Find the
1257 command-line argument for files named in scripts.
1258 * incremental.h (Script_info::Script_info): New ctor
1259 with input file index.
1260 (Script_info::input_file_index): New function.
1261 (Script_info::input_file_index_): New data member.
1262 (Incremental_binary::get_library): Add const.
1263 (Incremental_binary::get_script_info): Add const.
1264 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1265 * testsuite/Makefile.am (incremental_test_5): New test case.
1266 (incremental_test_6): New test case.
1267 * testsuite/Makefile.in: Regenerate.
1269 2011-07-06 Cary Coutant <ccoutant@google.com>
1271 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1272 debug output when command lines differ.
1274 2011-07-06 Cary Coutant <ccoutant@google.com>
1276 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1277 --incremental-patch option.
1278 * layout.cc (Free_list::allocate): Extend allocation beyond original
1280 (Layout::make_output_section): Mark sections that should get
1282 * options.cc (parse_percent): New function.
1283 * options.h (parse_percent): New function.
1284 (DEFINE_percent): New macro.
1285 (General_options): Add --incremental-patch option.
1286 * output.cc (Output_section::Output_section): Initialize new data
1288 (Output_section::add_input_section): Print section name when out
1290 (Output_section::add_output_section_data): Likewise.
1291 (Output_section::set_final_data_size): Add patch space when
1292 doing --incremental-full.
1293 (Output_section::do_reset_address_and_file_offset): Remove patch
1295 (Output_segment::set_section_list_addresses): Print debug output
1296 only if --incremental-update.
1297 * output.h (Output_section::set_is_patch_space_allowed): New function.
1298 (Output_section::is_patch_space_allowed_): New data member.
1299 (Output_section::patch_space_): New data member.
1300 * parameters.cc (Parameters::incremental_full): New function.
1301 * parameters.h (Parameters::incremental_full): New function
1302 * testsuite/Makefile.am (incremental_test_2): Add test for
1303 --incremental-patch option.
1304 * testsuite/Makefile.in: Regenerate.
1305 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1306 (t18): Remove function body.
1308 2011-07-05 Doug Kwan <dougkwan@google.com>
1311 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1312 Arm_Address type for relocation result.
1313 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1315 (Arm_relocate_functions::abs32): Use unaligned access.
1316 (Arm_relocate_functions::rel32): Ditto.
1317 (Arm_relocate_functions::prel31): Ditto.
1318 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1319 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1320 static data relocations.
1321 * testsuite/Makefile.in: Regnerate.
1322 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1324 2011-07-05 Ian Lance Taylor <iant@google.com>
1327 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1328 symbols if necessary.
1329 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1331 2011-07-05 Ian Lance Taylor <iant@google.com>
1334 * resolve.cc (Symbol::override_base_with_special): Simply override
1335 version with special symbol version, ignoring previous version.
1337 2011-07-05 Ian Lance Taylor <iant@google.com>
1339 * object.cc (Sized_relobj_file::include_section_group): Add
1340 information to comment about signature location.
1342 2011-07-02 Ian Lance Taylor <iant@google.com>
1345 * options.h (class General_options): Add -f and -F.
1346 * options.cc (General_options::finalize): Fatal error if -f/-F
1347 are used without -shared.
1348 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1350 2011-07-02 Ian Lance Taylor <iant@google.com>
1352 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1354 2011-07-01 Ian Lance Taylor <iant@google.com>
1358 * resolve.cc (Symbol::override_base_with_special): Don't override
1359 the version if the overriding symbol has a different name.
1360 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1361 all callers. If we give an error about an undefined version,
1362 define the base version if necessary.
1363 * dynobj.h (class Versions): Update declaration.
1364 * testsuite/weak_alias_test_5.cc: New file.
1365 * testsuite/weak_alias_test.script: New file.
1366 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1367 and versioned_alias have the right value, and call t2.
1368 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1369 weak_alias_test_5.so.
1370 (weak_alias_test_LDADD): Likewise.
1371 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1372 * testsuite/Makefile.in: Rebuild.
1374 2011-07-01 Ian Lance Taylor <iant@google.com>
1377 * options.h (class General_options): Support -z notext.
1378 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1380 (two_file_shared_nonpic.so): Likewise.
1381 (two_file_shared_mixed.so): Likewise.
1382 (two_file_shared_mixed_1.so): Likewise.
1383 (weak_undef_lib_nonpic.so): Likewise.
1384 (alt/weak_undef_lib_nonpic.so): Likewise.
1385 (tls_test_shared_nonpic.so): Likewise.
1386 * testsuite/Makefile.in: Rebuild.
1388 2011-07-01 Ian Lance Taylor <iant@google.com>
1391 * configure.ac: Test whether static linking works, setting
1392 the automake conditional HAVE_STATIC.
1393 * testsuite/Makefile.am: Disable tests using -static if
1394 HAVE_STATIC is not true.
1395 * configure, testsuite/Makefile.in: Rebuild.
1397 2011-07-01 Ian Lance Taylor <iant@google.com>
1400 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1401 Assert if we see DW_EH_PE_indirect.
1402 * target.h (Target::ehframe_datarel_base): New function.
1403 (Target::do_ehframe_datarel_base): New target function.
1404 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1405 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1408 2011-07-01 Ian Lance Taylor <iant@google.com>
1411 * options.h (class General_options): Add
1412 --ld-generated-unwind-info.
1413 * ehframe.cc (Fde::write): Add address parameter. Change all
1414 callers. If associated with PLT, fill in address and size.
1415 (Cie::set_output_offset): Only add merge mapping if there is an
1417 (Cie::write): Add address parameter. Change all callers.
1418 (Eh_frame::add_ehframe_for_plt): New function.
1419 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1420 input_offset_ fields into union u_, with new plt field.
1421 (Fde::Fde): Adjust for new union field.
1422 (Fde::Fde) [Output_data version]: New constructor.
1423 (Fde::add_mapping): Only add merge mapping if there is an object.
1424 (class Cie): Update declarations.
1425 (class Eh_frame): Declare add_ehframe_for_plt.
1426 * layout.cc (Layout::layout_eh_frame): Break out code into
1427 make_eh_frame_section, and call it.
1428 (Layout::make_eh_frame_section): New function.
1429 (Layout::add_eh_frame_for_plt): New function.
1430 * layout.h (class Layout): Update declarations.
1431 * merge.cc (Merge_map::add_mapping): Add assertion.
1432 * i386.cc: Include "dwarf.h".
1433 (class Output_data_plt_i386): Make first_plt_entry,
1434 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1435 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1436 and plt_eh_frame_fde.
1437 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1438 boundary. Call add_eh_frame_for_plt if appropriate.
1439 * x86_64.cc: Include "dwarf.h".
1440 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1441 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1442 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1443 and plt_eh_frame_fde.
1444 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1447 2011-06-29 Ian Lance Taylor <iant@google.com>
1450 * object.cc (Sized_relobj_file::layout_section): Change shdr
1451 parameter to be const.
1452 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1454 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1455 appropriate. Call layout_eh_frame_section.
1456 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1458 * object.h (class Sized_relobj_file): Update declarations.
1460 2011-06-29 Ian Lance Taylor <iant@google.com>
1463 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1465 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1467 2011-06-29 Ian Lance Taylor <iant@google.com>
1470 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1472 * layout.cc (Layout::layout_eh_frame): Likewise.
1474 2011-06-29 Ian Lance Taylor <iant@google.com>
1477 * layout.cc (Layout::symtab_section_shndx): New function.
1478 * layout.h (class Layout): Declare symtab_section_shndx.
1479 * output.cc (Output_section::write_header): Call it.
1481 2011-06-29 Ian Lance Taylor <iant@google.com>
1484 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1485 symbols which are not used in a relocation.
1487 2011-06-28 Ian Lance Taylor <iant@google.com>
1490 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1491 script create indistinguishable segments.
1492 (Layout::set_segment_offsets): Use stable_sort when sorting
1493 segments. Pass this to Compare_segments constructor.
1494 * layout.h (class Layout): Make segment_precedes non-static.
1495 (class Compare_segments): Change from struct to class. Add
1496 layout_ field. Add constructor.
1497 * script-sections.cc
1498 (Script_sections::attach_sections_using_phdrs_clause): Rename
1499 local orphan to is_orphan. Don't report failure to put empty
1500 section in segment. On attachment failure, report name of
1501 section, and attach to first PT_LOAD segment.
1503 2011-06-28 Ian Lance Taylor <iant@google.com>
1506 * target-select.cc (Target_selector::Target_selector): Add
1507 emulation parameter. Change all callers.
1508 (select_target_by_bfd_name): Rename from select_target_by_name.
1510 (select_target_by_emulation): New function.
1511 (supported_emulation_names): New function.
1512 * target-select.h (class Target_selector): Add emulation_ field.
1513 Update declarations.
1514 (Target_selector::recognize_by_bfd_name): Rename from
1515 recognize_by_name. Change all callers.
1516 (Target_selector::supported_bfd_names): Rename from
1517 supported_names. Change all callers.
1518 (Target_selector::recognize_by_emulation): New function.
1519 (Target_selector::supported_emulations): New function.
1520 (Target_selector::emulation): New function.
1521 (Target_selector::do_recognize_by_bfd_name): Rename from
1522 do_recognize_by_name. Change all callers.
1523 (Target_selector::do_supported_bfd_names): Rename from
1524 do_supported_names. Change all callers.
1525 (Target_selector::do_recognize_by_emulation): New function.
1526 (Target_selector::do_supported_emulations): New function.
1527 (select_target_by_bfd_name): Change name in declaration.
1528 (select_target_by_emulation): Declare.
1529 (supported_emulation_names): Declare.
1530 * parameters.cc (parameters_force_valid_target): Try to find
1531 target based on emulation from -m option.
1532 * options.h (class General_options): Change doc string for -m.
1533 * options.cc (help): Print emulations.
1534 (General_options::parse_V): Likewise.
1535 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1536 Add emulation parameter. Change all callers.
1538 2011-06-28 Ian Lance Taylor <iant@google.com>
1540 * target.h (class Target): Add osabi_ field.
1541 (Target::osabi): New function.
1542 (Target::set_osabi): New function.
1543 (Target::Target): Initialize osabi_.
1544 (Target::do_adjust_elf_header): Make pure virtual.
1545 (Sized_target::do_adjust_elf_header): Declare.
1546 * target.cc (Sized_target::do_adjust_elf_header): New function.
1547 (class Sized_target): Instantiate all versions.
1548 * freebsd.h (class Target_freebsd): Remove.
1549 (Target_selector_freebsd::do_recognize): Call set_osabi on
1551 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1552 (Target_selector_freebsd::set_osabi): Remove.
1553 * i386.cc (class Target_i386): Inherit from Sized_target rather
1554 than Target_freebsd.
1555 * x86_64.cc (class Target_x86_64): Likewise.
1557 2011-06-28 Ian Lance Taylor <iant@google.com>
1559 * target.h (Target::can_check_for_function_pointers): Rewrite.
1561 (Target::can_icf_inline_merge_sections): Likewise.
1562 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1563 (Target::Target_info): Add can_icf_inline_merge_sections field.
1564 (Target::do_can_check_for_function_pointers): New virtual
1566 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1567 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1568 from can_check_for_function_pointers, move in file.
1569 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1570 section_may_have_icf_unsafe_poineters, move in file.
1571 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1572 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1573 Rename from can_check_for_function_pointers, move in file.
1574 (Target_i386::can_icf_inline_merge_sections): Remove.
1575 (Target_i386::i386_info): Initialize
1576 can_icf_inline_merge_sections.
1577 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1578 Initialize can_icf_inline_merge_sections.
1579 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1580 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1581 Rename from can_check_for_function_pointers, move in file.
1582 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1583 (Target_x86_64::x86_64_info): Initialize
1584 can_icf_inline_merge_sections.
1585 * testsuite/testfile.cc (Target_test::test_target_info):
1587 * icf.cc (get_section_contents): Correct formatting.
1589 2011-06-27 Ian Lance Taylor <iant@google.com>
1591 * symtab.cc (Symbol::versioned_name): New function.
1592 (Symbol_table::add_to_final_symtab): Use versioned_name when
1594 (Symbol_table::sized_write_symbol): Likewise.
1595 * symtab.h (class Symbol): Declare versioned_name.
1596 * stringpool.h (class Stringpool_template): Add variant of add
1597 which takes a std::basic_string.
1598 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1599 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1600 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1601 (ver_test_12.o): New target.
1602 * testsuite/Makefile.in: Rebuild.
1604 2011-06-27 Doug Kwan <dougkwan@google.com>
1606 * arm.cc (Arm_relocate_functions::thm_jump8,
1607 Arm_relocate_functions::thm_jump11): Use a wider signed
1608 type to compute offset.
1609 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1611 * testsuite/Makefile.in: Regenerate.
1612 * testsuite/arm_branch_in_range.sh: Check test results of
1613 arm_thm_jump11 and arm_thm_jump8.
1614 * testsuite/arm_thm_jump11.s: New test source file.
1615 * testsuite/arm_thm_jump11.t: New linker script.
1616 * testsuite/arm_thm_jump8.s: New test source file.
1617 * testsuite/arm_thm_jump8.t: New linker script.
1619 2011-06-24 Ian Lance Taylor <iant@google.com>
1621 * layout.cc: Include "object.h".
1622 (ctors_sections_in_init_array): New static variable.
1623 (Layout::is_ctors_in_init_array): New function.
1624 (Layout::layout): Add entry to ctors_sections_in_init_array if
1626 * layout.h (class Layout): Declare is_ctors_in_init_array.
1627 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1628 is_ctors_reverse_view is set.
1629 (Sized_relobj_file::write_sections): Add layout parameter. Change
1630 all callers. Set is_ctors_reverse_view field of View_size.
1631 (Sized_relobj_file::reverse_words): New function.
1632 * object.h (Sized_relobj_file::View_size): Add
1633 is_ctors_reverse_view field.
1634 (class Sized_relobj_file): Update declarations.
1635 * testsuite/initpri3.c: New test.
1636 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1638 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1639 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1640 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1641 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1642 * testsuite/Makefile.in: Rebuild.
1644 2011-06-24 Cary Coutant <ccoutant@google.com>
1646 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1647 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1648 (debug_msg_cdebug.err): New targets.
1649 * testsuite/Makefile.in: Regenerate.
1650 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1651 Fix checks for link with shared library.
1653 2011-06-24 Doug Kwan <dougkwan@google.com>
1655 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1656 skip empty text sections.
1657 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1659 2011-06-22 Ian Lance Taylor <iant@google.com>
1662 * options.h (class General_options): Add --ctors-in-init-array.
1663 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1664 friends as SHT_PROGBITS for merging sections.
1665 (Layout::layout): Remove special handling of .init_array and
1666 friends. Don't sort if doing relocatable link. Sort for .ctors
1667 and .dtors if ctors_in_init_array.
1668 (Layout::make_output_section): Force correct section types for
1669 .init_array and friends. Don't sort if doing relocatable link,
1670 Don't sort .ctors and .dtors if ctors_in_init_array.
1671 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1672 (Layout::output_section_name): Add relobj parameter. Change all
1673 callers. Handle .ctors. and .dtors. in code rather than table.
1674 Handle .ctors and .dtors if ctors_in_init_array.
1675 (Layout::match_file_name): New function, moved from output.cc.
1676 * layout.h (class Layout): Update declarations.
1677 * output.cc: Include "layout.h".
1678 (Input_section_sort_entry::get_priority): New function.
1679 (Input_section_sort_entry::match_file_name): Just call
1680 Layout::match_file_name.
1681 (Output_section::Input_section_sort_init_fini_compare::operator()):
1682 Handle .ctors and .dtors. Sort by explicit priority rather than
1684 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1685 * testsuite/initpri2.c: New test.
1686 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1687 (check_PROGRAMS): Add initpri2.
1688 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1689 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1690 * configure, testsuite/Makefile.in: Rebuild.
1692 2011-06-19 Ian Lance Taylor <iant@google.com>
1695 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1696 .interp section to a PT_INTERP segment even if we have seen a
1697 --dynamic-linker option. Don't do it if we have seen a PHDRS
1698 clause in a linker script.
1699 (Layout::finalize): Don't create a .interp section if we've
1700 already create a PT_INTERP segment.
1701 (Layout::create_interp): Always call choose_output_section (revert
1702 patch of 2011-06-17). Don't create PT_INTERP segment.
1703 * script-sections.cc
1704 (Script_sections::create_note_and_tls_segments): Add a .interp
1705 section to a PT_INTERP segment even if we have seen a
1706 --dynamic-linker option.
1708 2011-06-18 Ian Lance Taylor <iant@google.com>
1710 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1711 merely because a non-PT_LOAD segment has a dynamic reloc.
1713 2011-06-18 Ian Lance Taylor <iant@google.com>
1715 * layout.cc (Layout::finish_dynamic_section): Don't create
1716 DT_FLAGS entry if not needed.
1718 2011-06-18 Ian Lance Taylor <iant@google.com>
1721 * layout.cc (Layout::layout_eh_frame): Correct handling of
1722 writable .eh_frame section.
1724 2011-06-17 Ian Lance Taylor <iant@google.com>
1727 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1728 symbol is redefined with the exact same object and value.
1730 2011-06-17 Ian Lance Taylor <iant@google.com>
1733 * layout.h (class Layout): Add interp_segment_ field.
1734 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1735 (Layout::attach_allocated_section_to_segment): If making shared
1736 library, put .interp section in PT_INTERP segment.
1737 (Layout::finalize): Also call create_interp if -dynamic-linker
1739 (Layout::create_interp): Assert that there is no PT_INTERP
1740 segment. If not using a SECTIONS clause, use make_output_section.
1741 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1742 * script-sections.cc
1743 (Script_sections::create_note_and_tls_segments): If making shared
1744 library, put .interp section in PT_INTERP segment.
1746 2011-06-17 Ian Lance Taylor <iant@google.com>
1748 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1749 when making a shared library.
1751 2011-06-17 Ian Lance Taylor <iant@google.com>
1753 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1754 parameter. Change all callers. Don't issue warning about PC32
1755 against locally defined symbol.
1757 2011-06-16 Ian Lance Taylor <iant@google.com>
1759 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1760 occurs in same object.
1762 2011-06-14 Alan Modra <amodra@gmail.com>
1764 * po/POTFILES.in: Regenerate.
1766 2011-06-09 Ian Lance Taylor <iant@google.com>
1768 * script-sections.cc
1769 (Orphan_output_section::set_section_addresses): For a relocatable
1770 link set address to 0.
1772 2011-06-09 Cary Coutant <ccoutant@google.com>
1775 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1776 used with --compress-debug-sections.
1777 * gold/object.cc (Sized_relobj_file::do_layout): Report
1778 uncompressed size of compressed input sections.
1780 2011-06-08 Cary Coutant <ccoutant@google.com>
1783 * testsuite/two_file_test_2_v1.cc: Change initialization of
1784 v2 to keep it in .data.
1786 2011-06-07 Cary Coutant <ccoutant@google.com>
1788 * common.cc (Symbol_table::do_allocate_commons_list): Call
1790 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1791 (Errors::fallback): New function.
1792 (gold_fallback): New function.
1793 * errors.h (Errors::fallback): New function.
1794 * gold.cc (gold_exit): Change status parameter to enum; adjust
1796 (queue_initial_tasks): Call gold_fallback.
1797 * gold.h: Include cstdlib.
1798 (Exit_status): New enum type.
1799 (gold_exit): Change status parameter to enum.
1800 (gold_fallback): New function.
1801 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1802 (Layout::create_symtab_sections): Likewise.
1803 (Layout::create_shdrs): Likewise.
1804 * main.cc (main): Adjust call to gold_exit.
1805 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1806 (Output_data_got::add_got_entry_pair): Likewise.
1807 (Output_section::add_input_section): Likewise.
1808 (Output_section::add_output_section_data): Likewise.
1809 (Output_segment::set_section_list_addresses): Likewise.
1810 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1812 2011-06-07 Cary Coutant <ccoutant@google.com>
1814 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1815 for incremental links.
1816 * output.cc (Output_segment::set_section_list_addresses): Remove
1817 FIXME and test for TLS or BSS.
1819 2011-06-07 Cary Coutant <ccoutant@google.com>
1821 * testsuite/Makefile.am: Add incremental_copy_test,
1822 incremental_common_test_1.
1823 * testsuite/Makefile.in: Regenerate.
1824 * testsuite/common_test_1_v1.c: New source file.
1825 * testsuite/common_test_1_v2.c: New source file.
1826 * testsuite/copy_test_v1.cc: New source file.
1828 2011-06-07 Cary Coutant <ccoutant@google.com>
1830 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1831 update, allocate common from bss section's free list.
1832 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1833 linker-defined symbols.
1834 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1835 Skip GOT and PLT entries that are no longer referenced.
1836 (Output_section_incremental_inputs::write_info_blocks): Mark
1837 linker-defined symbols.
1838 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1839 * output.cc (Output_section::allocate): New function.
1840 * output.h (Output_section::allocate): New function.
1841 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1842 linker-defined symbols.
1843 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1844 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1845 (Symbol::init_base_output_data): Likewise.
1846 (Symbol::init_base_output_segment): Likewise.
1847 (Symbol::init_base_constant): Likewise.
1848 (Sized_symbol::init_output_data): Likewise.
1849 (Sized_symbol::init_output_segment): Likewise.
1850 (Sized_symbol::init_constant): Likewise.
1851 (Symbol_table::do_define_in_output_data): Likewise.
1852 (Symbol_table::do_define_in_output_segment): Likewise.
1853 (Symbol_table::do_define_as_constant): Likewise.
1854 * symtab.h (Symbol::is_predefined): New function.
1855 (Symbol::init_base_output_data): Add is_predefined parameter.
1856 (Symbol::init_base_output_segment): Likewise.
1857 (Symbol::init_base_constant): Likewise.
1858 (Symbol::is_predefined_): New data member.
1859 (Sized_symbol::init_output_data): Add is_predefined parameter.
1860 (Sized_symbol::init_output_segment): Likewise.
1861 (Sized_symbol::init_constant): Likewise.
1862 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1864 2011-06-07 Cary Coutant <ccoutant@google.com>
1866 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1867 instead of emit_copy_reloc.
1868 (Copy_relocs::emit_copy_reloc): Refactor.
1869 (Copy_relocs::make_copy_reloc): New function.
1870 (Copy_relocs::add_copy_reloc): Remove.
1871 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1873 (Copy_relocs::make_copy_reloc): New function.
1874 (Copy_relocs::add_copy_reloc): Remove.
1875 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1876 unchanged input files.
1877 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1878 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1879 Reserve BSS space for COPY relocations.
1880 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1881 (Output_section_incremental_inputs::write_info_blocks): Record
1882 whether a symbol is copied from a shared object.
1883 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1884 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1885 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1886 (Incremental_input_entry_reader::get_output_symbol_index): Add
1888 (Incremental_binary::emit_copy_relocs): New function.
1889 (Incremental_binary::do_emit_copy_relocs): New function.
1890 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1892 (Sized_incremental_binary::add_copy_reloc): New function.
1893 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1894 (Sized_incremental_binary::Copy_reloc): New struct.
1895 (Sized_incremental_binary::Copy_relocs): New typedef.
1896 (Sized_incremental_binary::copy_relocs_): New data member.
1897 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1898 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1899 * target.h (Sized_target::emit_copy_reloc): New function.
1900 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1902 2011-06-02 Cary Coutant <ccoutant@google.com>
1905 * gold/archive.cc (Archive::Archive): Initialize new data member.
1906 (Archive::include_all_members): Return if archive has already been
1908 * gold/archive.h (Archive::include_all_members_): New data member.
1910 2011-06-02 Nick Clifton <nickc@redhat.com>
1912 * dynobj.h: Fix spelling mistake in comment.
1913 * output.cc: Likewise.
1915 2011-05-31 Doug Kwan <dougkwan@google.com>
1919 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
1920 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1921 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1922 redundant arm_exidx_test.so.
1923 * testsuite/Makefile.in: Regenerate.
1924 (check_SCRIPTS): Add pr12826.sh
1925 (check_DATA): Add pr12826.stdout
1926 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1927 * testsuite/pr12826.sh: New file.
1928 * testsuite/pr12826_1.s: Ditto.
1929 * testsuite/pr12826_1.s: Ditto.
1931 2011-05-30 Ian Lance Taylor <iant@google.com>
1933 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1936 2011-05-29 Ian Lance Taylor <iant@google.com>
1939 * testsuite/Makefile.am: Use different file name for two_file_test
1940 temporary file for each incremental test.
1941 * testsuite/Makefile.in: Rebuild.
1943 2011-05-29 Ian Lance Taylor <iant@google.com>
1945 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1946 binary input file is empty.
1948 2011-05-27 Ian Lance Taylor <iant@google.com>
1950 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1951 (ver_test_9.so): Likewise.
1952 * testsuite/Makefile.in: Rebuild.
1954 2011-05-26 Cary Coutant <ccoutant@google.com>
1956 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1957 * incremental.cc (Incremental_inputs::report_input_section): Fix
1958 comment, indentation.
1959 (Incremental_inputs::report_comdat_group): New function.
1960 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1961 of data for incremental input file entry.
1962 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1963 group count, COMDAT group signatures.
1964 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1965 an unchanged input file.
1966 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1967 Initialize new data member.
1968 (Incremental_object_entry::add_comdat_group): New function.
1969 (Incremental_object_entry::get_comdat_group_count): New function.
1970 (Incremental_object_entry::get_comdat_signature_key): New function.
1971 (Incremental_object_entry::groups_): New data member.
1972 (Incremental_inputs::report_comdat_group): New function.
1973 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1974 data for incremental input file entry.
1975 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1976 (Incremental_input_entry_reader::get_input_section): Adjust size of
1977 data for incremental input file entry.
1978 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1979 (Incremental_input_entry_reader::get_comdat_group_signature): New
1981 * object.cc (Sized_relobj::include_section_group): Report kept
1982 COMDAT groups for incremental links.
1984 2011-05-24 David Meyer <pdox@google.com>
1986 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1987 with name parameter. Add found_name parameter.
1988 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1989 * dirsearch.h (class Dirsearch): Update declaration.
1991 2011-05-24 Ian Lance Taylor <iant@google.com>
1993 * archive.cc (Library_base::should_include_member): Pull in object
1994 from archive if it defines the entry symbol.
1995 * parameters.cc (Parameters::entry): New function.
1996 * parameters.h (class Parameters): Declare entry.
1997 * output.h (class Output_file_header): Remove entry_ field.
1998 * output.cc (Output_file_header::Output_file_header): Remove entry
1999 parameter. Change all callers.
2000 (Output_file_header::entry): Use parameters->entry.
2001 * gold.cc (queue_middle_tasks): Likewise.
2002 * plugin.cc (Plugin_hook::run): Likewise.
2004 2011-05-24 Cary Coutant <ccoutant@google.com>
2006 * gold.cc (queue_initial_tasks): Pass incremental base filename
2007 to Output_file::open_base_file; don't print error message.
2008 * incremental-dump.cc (main): Adjust call to
2009 Output_file::open_for_modification.
2010 * incremental-dump.cc (main): Likewise.
2011 * incremental.cc (Incremental_inputs::report_command_line):
2012 Ignore --incremental-base option when comparing command lines.
2013 Ignore parameter when given as separate argument.
2014 * options.h (class General_options): Add --incremental-base.
2015 * output.cc (Output_file::Output_file):
2016 (Output_file::open_base_file): Add base_name and writable parameters;
2017 read base file into new file; print error message here.
2018 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2020 * output.h (Output_file::open_for_modification): Rename to...
2021 (Output_file::open_base_file): ...this; add base_name and
2022 writable parameters; adjust all callers.
2023 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2025 * testsuite/Makefile.am (incremental_test_4): Test
2027 * testsuite/Makefile.in: Regenerate.
2029 2011-05-24 Cary Coutant <ccoutant@google.com>
2031 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2033 * testsuite/Makefile.in: Regenerate.
2034 * testsuite/two_file_test_1_v1.cc: New test source file.
2035 * testsuite/two_file_test_1b_v1.cc: New test source file.
2036 * testsuite/two_file_test_2_v1.cc: New test source file.
2038 2011-05-24 Cary Coutant <ccoutant@google.com>
2040 * dynobj.h (Dynobj::do_dynobj): New function.
2041 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2042 flag and soname for shared objects.
2043 * incremental.cc (Incremental_inputs::report_object): Make
2044 either Incremental_object_entry or Incremental_dynobj_entry; add
2045 soname to string table.
2046 (Incremental_inputs::report_input_section): Add assertion.
2047 (Output_section_incremental_inputs::set_final_data_size): Adjust
2048 type of input file entry for shared libraries; adjust size of
2049 shared library info entry.
2050 (Output_section_incremental_inputs::write_input_files): Write
2051 as_needed flag for shared libraries.
2052 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2053 of input file entry for shared libraries; write soname.
2054 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2055 soname from incremental info.
2056 * incremental.h (enum Incremental_input_flags): Add
2057 INCREMENTAL_INPUT_AS_NEEDED.
2058 (Incremental_input_entry::Incremental_input_entry): Initialize new
2060 (Incremental_input_entry::set_as_needed): New function.
2061 (Incremental_input_entry::as_needed): New function.
2062 (Incremental_input_entry::do_dynobj_entry): New function.
2063 (Incremental_input_entry::as_needed_): New data member.
2064 (Incremental_object_entry::Incremental_object_entry): Don't check
2066 (Incremental_object_entry::do_type): Likewise.
2067 (class Incremental_dynobj_entry): New class.
2068 (Incremental_input_entry_reader::as_needed): New function.
2069 (Incremental_input_entry_reader::get_soname): New function.
2070 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2071 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2072 size of shared library info entry.
2073 * layout.cc (Layout::finish_dynamic_section): Don't test for
2074 incremental link when adding DT_NEEDED entries.
2075 * object.h (Object::Object): Initialize new data member.
2076 (Object::dynobj): New function.
2077 (Object::set_as_needed): New function.
2078 (Object::as_needed): New function.
2079 (Object::do_dynobj): New function.
2080 (Object::as_needed_): New data member.
2082 2011-05-24 Cary Coutant <ccoutant@google.com>
2084 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2085 info; adjust display of GOT entries.
2086 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2087 vector of input objects; remove file_status_.
2088 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2089 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2090 got_plt reader; call target hooks to reserve GOT entries.
2091 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2092 of input file info header and GOT info entry.
2093 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2095 (Got_plt_view_info::got_descriptor): Remove.
2096 (Got_plt_view_info::sym_index): New data member.
2097 (Got_plt_view_info::input_index): New data member.
2098 (Local_got_offset_visitor::visit): Write input file index.
2099 (Global_got_offset_visitor::visit): Write 0 for input file index.
2100 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2101 with sym_index and input_index.
2102 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2103 incremental info GOT entry; replace got_descriptor with input_index.
2104 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2105 map from input file index to object.
2106 (Sized_relobj_incr::do_layout): Replace direct data member reference
2107 with accessor function.
2108 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2109 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2110 Adjust size of input file info header.
2111 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2112 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2113 (Incremental_input_entry_reader::get_input_section): Adjust size of
2114 input file info header.
2115 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2116 of incremental info GOT entry.
2117 (Incremental_got_plt_reader::get_got_desc): Remove.
2118 (Incremental_got_plt_reader::get_got_symndx): New function.
2119 (Incremental_got_plt_reader::get_got_input_index): New function.
2120 (Sized_incremental_binary::Sized_incremental_binary): Remove
2121 file_status_; add input_objects_.
2122 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2123 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2124 (Sized_incremental_binary::file_is_unchanged): Remove.
2125 (Sized_incremental_binary::set_input_object): New function.
2126 (Sized_incremental_binary::input_object): New function.
2127 (Sized_incremental_binary::file_status_): Remove.
2128 (Sized_incremental_binary::input_objects_): New data member.
2129 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2131 (Sized_relobj_incr::invalid_address): Move to base class.
2132 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2134 (Sized_relobj_incr::do_output_section_offset): Likewise.
2135 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2136 (Sized_relobj_incr::section_offsets_): Likewise.
2137 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2139 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2140 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2141 with accessor function.
2142 (Sized_relobj_file::do_layout): Likewise.
2143 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2144 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2145 (Sized_relobj_file::compute_final_local_value): Replace refs to
2146 section_offsets_ with accessor function.
2147 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2148 * object.h (Relobj::Relobj): Initialize new data members.
2149 (Relobj::add_dyn_reloc): New function.
2150 (Relobj::first_dyn_reloc): New function.
2151 (Relobj::dyn_reloc_count): New function.
2152 (Relobj::first_dyn_reloc_): New data member.
2153 (Relobj::dyn_reloc_count_): New data member.
2154 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2156 (Sized_relobj::Address): New typedef.
2157 (Sized_relobj::invalid_address): Move here from child class.
2158 (Sized_relobj::Sized_relobj): Initialize new data members.
2159 (Sized_relobj::sized_relobj): New function.
2160 (Sized_relobj::is_output_section_offset_invalid): Move here from
2162 (Sized_relobj::get_output_section_offset): Likewise.
2163 (Sized_relobj::local_has_got_offset): Likewise.
2164 (Sized_relobj::local_got_offset): Likewise.
2165 (Sized_relobj::set_local_got_offset): Likewise.
2166 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2167 (Sized_relobj::clear_got_offsets): New function.
2168 (Sized_relobj::section_offsets): Move here from child class.
2169 (Sized_relobj::do_output_section_offset): Likewise.
2170 (Sized_relobj::do_set_section_offset): Likewise.
2171 (Sized_relobj::Local_got_offsets): Likewise.
2172 (Sized_relobj::local_got_offsets_): Likewise.
2173 (Sized_relobj::section_offsets_): Likewise.
2174 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2176 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2178 (Sized_relobj_file::sized_relobj): New function
2179 (Sized_relobj_file::local_has_got_offset): Move to base class.
2180 (Sized_relobj_file::local_got_offset): Likewise.
2181 (Sized_relobj_file::set_local_got_offset): Likewise.
2182 (Sized_relobj_file::get_output_section_offset): Likewise.
2183 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2184 (Sized_relobj_file::do_output_section_offset): Likewise.
2185 (Sized_relobj_file::do_set_section_offset): Likewise.
2186 (Sized_relobj_file::Local_got_offsets): Likewise.
2187 (Sized_relobj_file::local_got_offsets_): Likewise.
2188 (Sized_relobj_file::section_offsets_): Likewise.
2189 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2191 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2192 (Output_reloc::get_symbol_index): Likewise.
2193 (Output_reloc::local_section_offset): Likewise.
2194 (Output_reloc::get_address): Likewise.
2195 (Output_reloc::symbol_value): Likewise.
2196 (Output_data_got::reserve_slot): Move to class definition.
2197 (Output_data_got::reserve_local): New function.
2198 (Output_data_got::reserve_slot_for_global): Remove.
2199 (Output_data_got::reserve_global): New function.
2200 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2201 (all constructors, two instantiations).
2202 (Output_reloc::get_relobj): New function (two instantiations).
2203 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2204 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2205 (Output_data_reloc::add_global): Adjust type of relobj.
2206 (Output_data_reloc::add_global_relative): Likewise.
2207 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2208 (Output_data_reloc::add_local): Likewise.
2209 (Output_data_reloc::add_local_relative): Likewise.
2210 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2211 (Output_data_reloc::add_local_section): Likewise.
2212 (Output_data_reloc::add_output_section): Likewise.
2213 (Output_data_reloc::add_absolute): Likewise.
2214 (Output_data_reloc::add_target_specific): Likewise.
2215 (Output_data_got::reserve_slot): Move definition here.
2216 (Output_data_got::reserve_local): New function.
2217 (Output_data_got::reserve_global): New function.
2218 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2219 section_offsets_ with accessor function.
2220 (Sized_relobj_file::write_sections): Likewise.
2221 (Sized_relobj_file::do_relocate_sections): Likewise.
2222 * target.h (Sized_target::reserve_local_got_entry): New function.
2223 (Sized_target::reserve_global_got_entry): New function.
2224 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2225 (Target_x86_64::reserve_global_got_entry): New function.
2226 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2228 2011-05-23 Cary Coutant <ccoutant@google.com>
2230 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2231 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2232 bit when checking got_type.
2233 * incremental.cc (Sized_incremental_binary::setup_readers):
2234 Store symbol table and string table locations; initialize bit vector
2235 of file status flags.
2236 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2238 (Sized_incremental_binary::do_process_got_plt): New function.
2239 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2240 (Output_section_incremental_inputs::set_final_data_size): Record
2241 file index for each input file.
2242 (Output_section_incremental_inputs::write_got_plt): Store file index
2243 instead of input entry offset for each GOT entry.
2245 (Incremental_input_entry::Incremental_input_entry): Initialize new
2247 (Incremental_input_entry::set_offset): Store file index.
2248 (Incremental_input_entry::get_file_index): New function.
2249 (Incremental_input_entry::file_index_): New data member.
2250 (Incremental_binary::process_got_plt): New function.
2251 (Incremental_binary::do_process_got_plt): New function.
2252 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2254 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2255 (Sized_incremental_binary::set_file_is_unchanged): New function.
2256 (Sized_incremental_binary::file_is_unchanged): New function.
2257 (Sized_incremental_binary::do_process_got_plt): New function.
2258 (Sized_incremental_binary::file_status_): New data member.
2259 (Sized_incremental_binary::main_symtab_loc_): New data member.
2260 (Sized_incremental_binary::main_strtab_loc_): New data member.
2261 * output.cc (Output_data_got::Got_entry::write): Add case
2263 (Output_data_got::add_global): Call add_got_entry.
2264 (Output_data_got::add_global_plt): Likewise.
2265 (Output_data_got::add_global_with_rel): Likewise.
2266 (Output_data_got::add_global_with_rela): Likewise.
2267 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2268 (Output_data_got::add_global_pair_with_rela): Likewise.
2269 (Output_data_got::add_local): Call add_got_entry.
2270 (Output_data_got::add_local_plt): Likewise.
2271 (Output_data_got::add_local_with_rel): Likewise.
2272 (Output_data_got::add_local_with_rela): Likewise.
2273 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2274 (Output_data_got::add_local_pair_with_rela): Likewise.
2275 (Output_data_got::reserve_slot): New function.
2276 (Output_data_got::reserve_slot_for_global): New function.
2277 (Output_data_got::add_got_entry): New function.
2278 (Output_data_got::add_got_entry_pair): New function.
2279 (Output_section::add_output_section_data): Edit FIXME.
2281 (Output_section_data_build::Output_section_data_build): New
2282 constructor with size parameter.
2283 (Output_data_space::Output_data_space): Likewise.
2284 (Output_data_got::Output_data_got): Initialize new data member; new
2285 constructor with size parameter.
2286 (Output_data_got::add_constant): Call add_got_entry.
2287 (Output_data_got::reserve_slot): New function.
2288 (Output_data_got::reserve_slot_for_global): New function.
2289 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2290 (Output_data_got::add_got_entry): New function.
2291 (Output_data_got::add_got_entry_pair): New function.
2292 (Output_data_got::free_list_): New data member.
2293 * target.h (Sized_target::init_got_plt_for_update): New function.
2294 (Sized_target::register_global_plt_entry): New function.
2295 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2296 Initialize new data member; call init; add constructor with PLT count.
2297 (Output_data_plt_x86_64::init): New function.
2298 (Output_data_plt_x86_64::add_relocation): New function.
2299 (Output_data_plt_x86_64::reserve_slot): New function.
2300 (Output_data_plt_x86_64::free_list_): New data member.
2301 (Target_x86_64::init_got_plt_for_update): New function.
2302 (Target_x86_64::register_global_plt_entry): New function.
2303 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2304 incremental updates.
2305 (Output_data_plt_x86_64::add_relocation): New function.
2306 * testsuite/object_unittest.cc (Object_test): Set default options.
2308 2011-05-16 Ian Lance Taylor <iant@google.com>
2310 * options.h (class General_options): Make -i a synonym for -r.
2312 2011-05-16 Ian Lance Taylor <iant@google.com>
2314 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2316 2011-05-10 Cary Coutant <ccoutant@google.com>
2318 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2321 2011-05-06 Ian Lance Taylor <iant@google.com>
2323 * layout.cc (Layout::layout): If the output section flags change,
2324 update the ordering.
2326 2011-04-25 Cary Coutant <ccoutant@google.com>
2328 * incremental-dump.cc (dump_incremental_inputs): Print local
2329 symbol info for each input file.
2331 (Output_section_incremental_inputs::set_final_data_size): Add local
2332 symbol info to input file entries in incremental info.
2333 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2334 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2335 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2336 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2338 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2339 (Sized_incr_relobj::do_relocate): Write the local symbols.
2340 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2341 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2342 Adjust size of input file header.
2343 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2344 (Incremental_inputs_reader::get_local_symbol_count): New function.
2345 (Incremental_inputs_reader::get_input_section): Adjust size of input
2347 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2348 (Sized_incr_relobj::This): New typedef.
2349 (Sized_incr_relobj::sym_size): New const data member.
2350 (Sized_incr_relobj::Local_symbol): New struct.
2351 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2352 (Sized_incr_relobj::do_local_symbol_offset): New function.
2353 (Sized_incr_relobj::local_symbol_count_): New data member.
2354 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2355 (Sized_incr_relobj::local_symbol_index_): New data member.
2356 (Sized_incr_relobj::local_symbol_offset_): New data member.
2357 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2358 (Sized_incr_relobj::local_symbols_): New data member.
2359 * object.h (Relobj::output_local_symbol_count): New function.
2360 (Relobj::local_symbol_offset): New function.
2361 (Relobj::do_output_local_symbol_count): New function.
2362 (Relobj::do_local_symbol_offset): New function.
2363 (Sized_relobj::do_output_local_symbol_count): New function.
2364 (Sized_relobj::do_local_symbol_offset): New function.
2366 2011-04-22 Vladimir Simonov <sv@sw.ru>
2368 * descriptors.cc (set_close_on_exec): New function.
2369 (Descriptors::open): Use set_close_on_exec.
2370 * output.cc (S_ISLNK): Define if not defined.
2372 2011-04-22 Cary Coutant <ccoutant@google.com>
2374 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2376 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2377 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2378 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2380 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2381 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2382 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2384 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2386 (Incremental_binary::apply_incremental_relocs): New function.
2387 (Incremental_binary::do_apply_incremental_relocs): New function.
2388 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2390 (Sized_incremental_binary::add_global_symbol): New function.
2391 (Sized_incremental_binary::global_symbol): New function.
2392 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2393 (Sized_incremental_binary::symbol_map_): New data member.
2394 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2395 * target.h (Sized_target::apply_relocation): New function.
2396 * target-reloc.h (apply_relocation): New function.
2397 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2399 2011-04-22 Doug Kwan <dougkwan@google.com>
2401 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2402 flag of a SHT_ARM_EXIDX section.
2403 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2404 * testsuite/Makefile.in: Regenerate.
2405 * testsuite/arm_exidx_test.s: New file.
2406 * testsuite/arm_exidx_test.sh: Same.
2408 2011-04-20 Cary Coutant <ccoutant@google.com>
2411 * archive.h (Incremental_archive_entry::Archive_member):
2412 Initialize arg_serial_ (second constructor).
2414 2011-04-17 Ian Lance Taylor <iant@google.com>
2416 * object.cc (Relocate_info::location): Simplify location string.
2417 * errors.cc (Errors::error_at_location): Don't print program
2419 (Errors::warning_at_location): Likewise.
2420 (Errors::undefined_symbol): Likewise.
2421 * testsuite/debug_msg.sh: Update accordingly.
2423 2011-04-14 Cary Coutant <ccoutant@google.com>
2425 * gold/layout.cc (Layout::symtab_section_offset): New function.
2426 * gold/layout.h (Layout::symtab_section_offset): New function.
2427 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2429 2011-04-12 Ian Lance Taylor <iant@google.com>
2431 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2432 with MREMAP_MAYMOVE.
2433 * output.h (class Output_file): Add map_is_allocated_ field.
2434 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2435 not available, provide stubs. If mremap is not available, #define
2437 (MREMAP_MAYMOVE): Define if not defined.
2438 (Output_file::Output_file): Initialize map_is_allocated_.
2439 (Output_file::resize): Check map_is_allocated_.
2440 (Output_file::map_anonymous): If mmap fails, use malloc.
2441 (Output_file::unmap): Don't do anything for an anonymous map.
2442 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2443 is not available, provide stubs.
2444 (File_read::View::~View): Use free rather than delete[].
2445 (File_read::make_view): Use malloc rather than new[]. If mmap
2447 (File_read::find_or_make_view): Use malloc rather than new[].
2448 * gold.h: Remove HAVE_REMAP code.
2449 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2450 exists. Rename mremap to gold_mremap. If mmap is not available
2452 * configure, config.in: Rebuild.
2454 2011-04-11 Ian Lance Taylor <iant@google.com>
2456 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2457 initialize local variable v.
2459 2011-04-11 Cary Coutant <ccoutant@google.com>
2461 * archive.cc (Archive::include_member): Adjust call to
2463 (Add_archive_symbols::run): Track argument serial numbers.
2464 (Lib_group::include_member): Likewise.
2465 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2466 * archive.h (Incremental_archive_entry::Archive_member):
2467 Initialize arg_serial_.
2468 (Archive_member::arg_serial_): New data member.
2469 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2470 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2472 (Sized_dynobj::do_for_all_local_got_entries): New function.
2473 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2475 * fileread.cc (get_mtime): New function.
2476 * fileread.h (get_mtime): New function.
2477 * gold.cc (queue_initial_tasks): Check for incremental update.
2478 (process_incremental_input): New function.
2479 (queue_middle_tasks): Don't force valid target for incremental
2481 * incremental-dump.cc (find_input_containing_global): Adjust
2482 size of symbol info entry.
2483 (dump_incremental_inputs): Dump argument serial number and
2484 in_system_directory flag; bias shndx by 1; print symbol names
2485 when dumping per-file symbol lists; use new symbol info readers.
2487 (Output_section_incremental_inputs:update_data_size): New function.
2488 (Sized_incremental_binary::setup_readers): Setup input readers
2489 for each input file; build maps for files added from libraries
2491 (Sized_incremental_binary::check_input_args): New function.
2492 (Sized_incremental_binary::do_check_inputs): Build map of argument
2493 serial numbers to input arguments.
2494 (Sized_incremental_binary::do_file_has_changed): Rename
2495 do_file_is_unchanged to this; compare file modification times.
2496 (Sized_incremental_binary::do_init_layout): New function.
2497 (Sized_incremental_binary::do_reserve_layout): New function.
2498 (Sized_incremental_binary::do_get_input_reader): Remove.
2499 (Sized_incremental_binary::get_symtab_view): New function.
2500 (Incremental_checker::can_incrementally_link_output_file): Remove.
2501 (Incremental_inputs::report_command_line): Exclude --debug options.
2502 (Incremental_inputs::report_archive_begin): Add parameter; track
2503 argument serial numbers; don't put input file entry for archive
2504 before archive members.
2505 (Incremental_inputs::report_archive_end): Put input file entry
2506 for archive after archive members.
2507 (Incremental_inputs::report_object): Add parameter; track argument
2508 serial numbers and in_system_directory flag.
2509 (Incremental_inputs::report_script): Add parameter; track argument
2511 (Output_section_incremental_inputs::set_final_data_size): Adjust
2512 size of symbol info entry; check for forwarding symbols.
2513 (Output_section_incremental_inputs::write_input_files): Write
2514 in_system_directory flag and argument serial number.
2515 (Output_section_incremental_inputs::write_info_blocks): Map section
2516 indices between incremental info and original input file; store
2517 input section index for each symbol.
2518 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2519 change operator() to visit().
2520 (class Global_got_offset_visitor): Likewise.
2521 (class Global_symbol_visitor_got_plt):
2522 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2524 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2525 (Sized_incr_relobj::do_read_symbols): New function.
2526 (Sized_incr_relobj::do_layout): New function.
2527 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2528 (Sized_incr_relobj::do_add_symbols): New function.
2529 (Sized_incr_relobj::do_should_include_member): New function.
2530 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2531 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2532 (Sized_incr_relobj::do_section_size): New function.
2533 (Sized_incr_relobj::do_section_name): New function.
2534 (Sized_incr_relobj::do_section_contents): New function.
2535 (Sized_incr_relobj::do_section_flags): New function.
2536 (Sized_incr_relobj::do_section_entsize): New function.
2537 (Sized_incr_relobj::do_section_address): New function.
2538 (Sized_incr_relobj::do_section_type): New function.
2539 (Sized_incr_relobj::do_section_link): New function.
2540 (Sized_incr_relobj::do_section_info): New function.
2541 (Sized_incr_relobj::do_section_addralign): New function.
2542 (Sized_incr_relobj::do_initialize_xindex): New function.
2543 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2544 (Sized_incr_relobj::do_read_relocs): New function.
2545 (Sized_incr_relobj::do_gc_process_relocs): New function.
2546 (Sized_incr_relobj::do_scan_relocs): New function.
2547 (Sized_incr_relobj::do_count_local_symbols): New function.
2548 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2549 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2550 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2551 (Sized_incr_relobj::do_relocate): New function.
2552 (Sized_incr_relobj::do_set_section_offset): New function.
2553 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2554 (Sized_incr_dynobj::do_read_symbols): New function.
2555 (Sized_incr_dynobj::do_layout): New function.
2556 (Sized_incr_dynobj::do_add_symbols): New function.
2557 (Sized_incr_dynobj::do_should_include_member): New function.
2558 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2559 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2560 (Sized_incr_dynobj::do_section_size): New function.
2561 (Sized_incr_dynobj::do_section_name): New function.
2562 (Sized_incr_dynobj::do_section_contents): New function.
2563 (Sized_incr_dynobj::do_section_flags): New function.
2564 (Sized_incr_dynobj::do_section_entsize): New function.
2565 (Sized_incr_dynobj::do_section_address): New function.
2566 (Sized_incr_dynobj::do_section_type): New function.
2567 (Sized_incr_dynobj::do_section_link): New function.
2568 (Sized_incr_dynobj::do_section_info): New function.
2569 (Sized_incr_dynobj::do_section_addralign): New function.
2570 (Sized_incr_dynobj::do_initialize_xindex): New function.
2571 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2572 (make_sized_incremental_object): New function.
2573 (Incremental_library::copy_unused_symbols): New function.
2574 (Incremental_library::do_for_all_unused_symbols): New function.
2575 * incremental.h (enum Incremental_input_flags): New type.
2576 (class Incremental_checker): Remove.
2577 (Incremental_input_entry::Incremental_input_entry): Add argument
2579 (Incremental_input_entry::arg_serial): New function.
2580 (Incremental_input_entry::set_is_in_system_directory): New function.
2581 (Incremental_input_entry::is_in_system_directory): New function.
2582 (Incremental_input_entry::arg_serial_): New data member.
2583 (Incremental_input_entry::is_in_system_directory_): New data member.
2584 (class Script_info): Move here from script.h.
2585 (Script_info::Script_info): Add filename parameter.
2586 (Script_info::filename): New function.
2587 (Script_info::filename_): New data member.
2588 (Incremental_script_entry::Incremental_script_entry): Add argument
2590 (Incremental_object_entry::Incremental_object_entry): Likewise.
2591 (Incremental_object_entry::add_input_section): Build list of input
2592 sections with map to original shndx.
2593 (Incremental_object_entry::get_input_section_index): New function.
2594 (Incremental_object_entry::shndx_): New data member.
2595 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2596 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2597 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2599 (Incremental_inputs::report_archive_begin): Likewise.
2600 (Incremental_inputs::report_object): Likewise.
2601 (Incremental_inputs::report_script): Likewise.
2602 (class Incremental_global_symbol_reader): New class.
2603 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2604 and store flags and input file type.
2605 (Incremental_input_entry_reader::arg_serial): New function.
2606 (Incremental_input_entry_reader::type): Extract type from flags.
2607 (Incremental_input_entry_reader::is_in_system_directory): New function.
2608 (Incremental_input_entry_reader::get_input_section_count): Call
2609 accessor function for type.
2610 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2611 function for type; adjust size of global symbol entry.
2612 (Incremental_input_entry_reader::get_global_symbol_count): Call
2613 accessor function for type.
2614 (Incremental_input_entry_reader::get_object_count): Likewise.
2615 (Incremental_input_entry_reader::get_object_offset): Likewise.
2616 (Incremental_input_entry_reader::get_member_count): Likewise.
2617 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2618 (Incremental_input_entry_reader::get_member_offset): Likewise.
2619 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2620 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2621 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2622 (Incremental_input_entry_reader::get_global_symbol_reader): New
2624 (Incremental_input_entry_reader::get_output_symbol_index): New
2626 (Incremental_input_entry_reader::type_): Remove.
2627 (Incremental_input_entry_reader::flags_): New data member.
2628 (Incremental_inputs_reader::input_file_offset): New function.
2629 (Incremental_inputs_reader::input_file_index): New function.
2630 (Incremental_inputs_reader::input_file): Call input_file_offset.
2631 (Incremental_inputs_reader::input_file_at_offset): New function.
2632 (Incremental_relocs_reader::get_r_type): Reformat.
2633 (Incremental_relocs_reader::get_r_shndx): Reformat.
2634 (Incremental_relocs_reader::get_r_offset): Reformat.
2635 (Incremental_relocs_reader::data): New function.
2636 (Incremental_binary::Incremental_binary): Initialize new data members.
2637 (Incremental_binary::check_inputs): Add cmdline parameter.
2638 (Incremental_binary::file_is_unchanged): Remove.
2639 (Input_reader::arg_serial): New function.
2640 (Input_reader::get_unused_symbol_count): New function.
2641 (Input_reader::get_unused_symbol): New function.
2642 (Input_reader::do_arg_serial): New function.
2643 (Input_reader::do_get_unused_symbol_count): New function.
2644 (Input_reader::do_get_unused_symbol): New function.
2645 (Incremental_binary::input_file_count): New function.
2646 (Incremental_binary::get_input_reader): Change signature to use
2647 index instead of filename.
2648 (Incremental_binary::file_has_changed): New function.
2649 (Incremental_binary::get_input_argument): New function.
2650 (Incremental_binary::get_library): New function.
2651 (Incremental_binary::get_script_info): New function.
2652 (Incremental_binary::init_layout): New function.
2653 (Incremental_binary::reserve_layout): New function.
2654 (Incremental_binary::output_file): New function.
2655 (Incremental_binary::do_check_inputs): New function.
2656 (Incremental_binary::do_file_is_unchanged): Remove.
2657 (Incremental_binary::do_file_has_changed): New function.
2658 (Incremental_binary::do_init_layout): New function.
2659 (Incremental_binary::do_reserve_layout): New function.
2660 (Incremental_binary::do_input_file_count): New function.
2661 (Incremental_binary::do_get_input_reader): Change signature.
2662 (Incremental_binary::input_args_map_): New data member.
2663 (Incremental_binary::library_map_): New data member.
2664 (Incremental_binary::script_map_): New data member.
2665 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2667 (Sized_incremental_binary::output_section): New function.
2668 (Sized_incremental_binary::inputs_reader): Add const.
2669 (Sized_incremental_binary::symtab_reader): Add const.
2670 (Sized_incremental_binary::relocs_reader): Add const.
2671 (Sized_incremental_binary::got_plt_reader): Add const.
2672 (Sized_incremental_binary::get_symtab_view): New function.
2673 (Sized_incremental_binary::Inputs_reader): New typedef.
2674 (Sized_incremental_binary::Input_entry_reader): New typedef.
2675 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2676 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2677 (Sized_incremental_binary::do_file_has_changed): New function.
2678 (Sized_incremental_binary::do_init_layout): New function.
2679 (Sized_incremental_binary::do_reserve_layout): New function.
2680 (Sized_input_reader::Inputs_reader): Remove.
2681 (Sized_input_reader::Input_entry_reader): Remove.
2682 (Sized_input_reader::do_arg_serial): New function.
2683 (Sized_input_reader::do_get_unused_symbol_count): New function.
2684 (Sized_input_reader::do_get_unused_symbol): New function.
2685 (Sized_incremental_binary::do_input_file_count): New function.
2686 (Sized_incremental_binary::do_get_input_reader): Change signature;
2687 use index instead of filename.
2688 (Sized_incremental_binary::section_map_): New data member.
2689 (Sized_incremental_binary::input_entry_readers_): New data member.
2690 (class Sized_incr_relobj): New class.
2691 (class Sized_incr_dynobj): New class.
2692 (make_sized_incremental_object): New function.
2693 (class Incremental_library): New class.
2694 * layout.cc (Free_list::num_lists): New static data member.
2695 (Free_list::num_nodes): New static data member.
2696 (Free_list::num_removes): New static data member.
2697 (Free_list::num_remove_visits): New static data member.
2698 (Free_list::num_allocates): New static data member.
2699 (Free_list::num_allocate_visits): New static data member.
2700 (Free_list::init): New function.
2701 (Free_list::remove): New function.
2702 (Free_list::allocate): New function.
2703 (Free_list::dump): New function.
2704 (Free_list::print_stats): New function.
2705 (Layout_task_runner::run): Resize output file for incremental updates.
2706 (Layout::Layout): Initialize new data members.
2707 (Layout::set_incremental_base): New function.
2708 (Layout::init_fixed_output_section): New function.
2709 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2710 incremental updates.
2711 (Layout::create_gold_note): Do not create gold note section for
2712 incremental updates.
2713 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2714 for incremental updates.
2715 (Layout::set_section_offsets): For incremental updates, allocate space
2717 (Layout::create_symtab_sections): Layout with offsets relative to
2718 start of section; for incremental updates, allocate space from free
2720 (Layout::create_shdrs): For incremental updates, allocate space from
2722 (Layout::finish_dynamic_section): For incremental updates, do not
2723 check --as-needed (fixed in subsequent patch).
2724 * layout.h (class Free_list): New class.
2725 (Layout::set_incremental_base): New function.
2726 (Layout::incremental_base): New function.
2727 (Layout::init_fixed_output_section): New function.
2728 (Layout::allocate): New function.
2729 (Layout::incremental_base_): New data member.
2730 (Layout::free_list_): New data member.
2731 * main.cc (main): Print Free_list statistics.
2732 * object.cc (Relobj::finalize_incremental_relocs): Add
2733 clear_counts parameter; clear counts only when clear_counts is set.
2734 (Sized_relobj::Sized_relobj): Initialize new base class.
2735 (Sized_relobj::do_layout): Don't report special sections.
2736 (Sized_relobj::do_for_all_local_got_entries): New function.
2737 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2738 symtab_off to all symbol table offsets.
2739 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2740 * object.h (class Got_offset_list): Move to top of file.
2741 (Object::Object): Allow case where input_file == NULL.
2742 (Object::~Object): Likewise.
2743 (Object::input_file): Assert that input_file != NULL.
2744 (Object::lock): Allow case where input_file == NULL.
2745 (Object::unlock): Likewise.
2746 (Object::is_locked): Likewise.
2747 (Object::token): Likewise.
2748 (Object::release): Likewise.
2749 (Object::is_incremental): New function.
2750 (Object::get_mtime): New function.
2751 (Object::for_all_local_got_entries): New function.
2752 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2753 (Object::set_is_in_system_directory): New function.
2754 (Object::is_in_system_directory): New function.
2755 (Object::do_is_incremental): New function.
2756 (Object::do_get_mtime): New function.
2757 (Object::do_for_all_local_got_entries): New function.
2758 (Object::is_in_system_directory_): New data member.
2759 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2760 (class Sized_relobj_base): New class.
2761 (class Sized_relobj): Derive from Sized_relobj_base.
2762 (class Sized_relobj::Symbols): Redeclare from base class.
2763 (class Sized_relobj::local_got_offset_list): Remove.
2764 (class Sized_relobj::Output_sections): Redeclare from base class.
2765 (class Sized_relobj::do_for_all_local_got_entries): New function.
2766 (class Sized_relobj::write_local_symbols): Add offset parameter.
2767 (class Sized_relobj::local_symbol_offset_): Update comment.
2768 (class Sized_relobj::local_dynsym_offset_): Update comment.
2769 * options.cc (Input_arguments::add_file): Remove const.
2770 * options.h (Input_file_argument::Input_file_argument):
2771 Initialize arg_serial_ (all constructors).
2772 (Input_file_argument::set_arg_serial): New function.
2773 (Input_file_argument::arg_serial): New function.
2774 (Input_file_argument::arg_serial_): New data member.
2775 (Input_arguments::Input_arguments): Initialize file_count_.
2776 (Input_arguments::add_file): Remove const.
2777 (Input_arguments::number_of_input_files): New function.
2778 (Input_arguments::file_count_): New data member.
2779 (Command_line::number_of_input_files): Call
2780 Input_arguments::number_of_input_files.
2781 * output.cc (Output_segment_headers::Output_segment_headers):
2783 (Output_section::Input_section::current_data_size): New function.
2784 (Output_section::Output_section): Initialize new data members.
2785 (Output_section::add_input_section): Don't do merge sections for
2786 an incremental link; allocate space from free list for an
2788 (Output_section::add_output_section_data): Allocate space from
2789 free list for an incremental update.
2790 (Output_section::update_data_size): New function.
2791 (Output_section::set_fixed_layout): New function.
2792 (Output_section::reserve): New function.
2793 (Output_segment::set_section_addresses): Remove const.
2794 (Output_segment::set_section_list_addresses): Remove const; allocate
2795 space from free list for an incremental update.
2796 (Output_segment::set_offset): Adjust size of RELRO segment for an
2798 * output.h (Output_data::current_data_size): Move here from
2800 (Output_data::pre_finalize_data_size): New function.
2801 (Output_data::update_data_size): New function.
2802 (Output_section_headers::update_data_size): new function.
2803 (Output_section_data_build::current_data_size): Move to Output_data.
2804 (Output_data_strtab::update_data_size): New function.
2805 (Output_section::current_data_size): Move to Output_data.
2806 (Output_section::set_fixed_layout): New function.
2807 (Output_section::has_fixed_layout): New function.
2808 (Output_section::reserve): New function.
2809 (Output_section::update_data_size): New function.
2810 (Output_section::has_fixed_layout_): New data member.
2811 (Output_section::free_list_): New data member.
2812 (Output_segment::set_section_addresses): Remove const.
2813 (Output_segment::set_section_list_addresses): Remove const.
2814 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2816 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2818 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2819 parameter when calling Add_symbols constructor; store argument
2820 serial number for members of a lib group.
2821 (Add_symbols::locks): Allow case where token == NULL.
2822 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2823 (Read_member::~Read_member): New function.
2824 (Read_member::is_runnable): New function.
2825 (Read_member::locks): New function.
2826 (Read_member::run): New function.
2827 (Check_script::~Check_script): New function.
2828 (Check_script::is_runnable): New function.
2829 (Check_script::locks): New function.
2830 (Check_script::run): New function.
2831 (Check_library::~Check_library): New function.
2832 (Check_library::is_runnable): New function.
2833 (Check_library::locks): New function.
2834 (Check_library::run): New function.
2835 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2836 (Add_symbols::library_): New data member.
2837 (class Read_member): New class.
2838 (class Check_script): New class.
2839 (class Check_library): New class.
2840 * reloc.cc (Read_relocs::is_runnable): Allow case where
2842 (Read_relocs::locks): Likewise.
2843 (Scan_relocs::locks): Likewise.
2844 (Relocate_task::locks): Likewise.
2845 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2847 (Sized_relobj::incremental_relocs_scan): Fix comment.
2848 (Sized_relobj::do_relocate): Pass output file offset to
2849 write_local_symbols.
2850 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2851 from class declaration.
2852 * script.cc (read_input_script): Allocate Script_info; pass
2853 argument serial number to report_script.
2854 * script.h (class Script_info): Move to incremental.h.
2855 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2856 * symtab.h (Symbol_table::add_from_incrobj): New function.
2857 (Symbol_table::set_file_offset): New function.
2859 2011-04-05 Cary Coutant <ccoutant@google.com>
2861 * incremental-dump.cc (dump_incremental_inputs): Change signature
2862 to take a Sized_incremental_binary; change caller. Use readers
2863 in Sized_incremental_binary.
2865 (Sized_incremental_binary::find_incremental_inputs_sections):
2866 Rename do_find_incremental_inputs_sections to this.
2867 (Sized_incremental_binary::setup_readers): New function.
2868 (Sized_incremental_binary::do_check_inputs): Check
2869 has_incremental_info_ flag; move setup code to setup_readers;
2871 (Sized_incremental_binary::do_file_is_unchanged): New function.
2872 (Sized_incremental_binary::do_get_input_reader): New function.
2873 * incremental.h (class Incremental_binary): Move to end of file.
2874 (Incremental_binary::file_is_unchanged): New function.
2875 (Incremental_binary::do_file_is_unchanged): New function.
2876 (Incremental_binary::Input_reader): New class.
2877 (Incremental_binary::get_input_reader): New function.
2878 (class Sized_incremental_binary): Move to end of file.
2879 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2880 input section reader classes.
2881 (Sized_incremental_binary::has_incremental_info): New function.
2882 (Sized_incremental_binary::inputs_reader): New function.
2883 (Sized_incremental_binary::symtab_reader): New function.
2884 (Sized_incremental_binary::relocs_reader): New function.
2885 (Sized_incremental_binary::got_plt_reader): New function.
2886 (Sized_incremental_binary::do_file_is_unchanged): New function.
2887 (Sized_incremental_binary::Sized_input_reader): New class.
2888 (Sized_incremental_binary::get_input_reader): New function.
2889 (Sized_incremental_binary::find_incremental_inputs_sections):
2890 Rename do_find_incremental_inputs_sections to this.
2891 (Sized_incremental_binary::setup_readers): New function.
2892 (Sized_incremental_binary::has_incremental_info_): New data member.
2893 (Sized_incremental_binary::inputs_reader_): New data member.
2894 (Sized_incremental_binary::symtab_reader_): New data member.
2895 (Sized_incremental_binary::relocs_reader_): New data member.
2896 (Sized_incremental_binary::got_plt_reader_): New data member.
2897 (Sized_incremental_binary::current_input_file_): New data member.
2899 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2902 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2905 2011-03-30 Cary Coutant <ccoutant@google.com>
2907 * archive.cc (Archive::include_member): Adjust call to report_object.
2908 (Add_archive_symbols::run): Add script_info to call to
2909 report_archive_begin.
2910 (Lib_group::include_member): Adjust call to report_object.
2911 (Add_lib_group_symbols::run): Adjust call to report_object.
2912 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2913 blocks. Add object count for script input files.
2914 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2915 script_info parameter; change all callers.
2916 (Incremental_inputs::report_object): Add script_info parameter;
2918 (Incremental_inputs::report_script): Store backpointer to
2919 incremental info entry.
2920 (Output_section_incremental_inputs::set_final_data_size): Record
2921 additional information for scripts.
2922 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2923 * incremental.h (Incremental_script_entry::add_object): New function.
2924 (Incremental_script_entry::get_object_count): New function.
2925 (Incremental_script_entry::get_object): New function.
2926 (Incremental_script_entry::objects_): New data member; adjust
2928 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2929 (Incremental_inputs::report_object): Add script_info parameter.
2930 (Incremental_inputs_reader::get_object_count): New function.
2931 (Incremental_inputs_reader::get_object_offset): New function.
2932 * options.cc (Input_arguments::add_file): Return reference to
2934 * options.h (Input_argument::set_script_info): New function.
2935 (Input_argument::script_info): New function.
2936 (Input_argument::script_info_): New data member; adjust all
2938 (Input_file_group::add_file): Return reference to new input argument.
2939 (Input_file_lib::add_file): Likewise.
2940 (Input_arguments::add_file): Likewise.
2941 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2942 * script.cc (Parser_closure::Parser_closure): Add script_info
2943 parameter; adjust all callers.
2944 (Parser_closure::script_info): New function.
2945 (Parser_closure::script_info_): New data member.
2946 (read_input_script): Report scripts earlier to incremental info.
2947 (script_add_file): Set script_info in Input_argument.
2948 (script_add_library): Likewise.
2949 * script.h (Script_options::Script_info): Rewrite class.
2951 2011-03-29 Cary Coutant <ccoutant@google.com>
2953 * archive.cc (Library_base::should_include_member): Move
2954 method here from class Archive.
2955 (Archive::Archive): Initialize base class.
2956 (Archive::should_include_member): Move to base class.
2957 (Archive::do_for_all_unused_symbols): New function.
2958 (Add_archive_symbols::run): Remove redundant access to
2960 (Lib_group::Lib_group): Initialize base class.
2961 (Lib_group::do_filename): New function.
2962 (Lib_group::include_member): Pass pointer to Lib_group to
2964 (Lib_group::do_for_all_unused_symbols): New function.
2965 (Add_lib_group_symbols::run): Report archive information for
2967 * archive.h (class Library_base): New base class.
2968 (class Archive): Derive from Library_base.
2969 (Archive::filename): Move to base class.
2970 (Archive::set_incremental_info): Likewise.
2971 (Archive::incremental_info): Likewise.
2972 (Archive::Should_include): Likewise.
2973 (Archive::should_include_member): Likewise.
2974 (Archive::Armap_entry): Remove.
2975 (Archive::Unused_symbol_iterator): Remove.
2976 (Archive::unused_symbols_begin): Remove.
2977 (Archive::unused_symbols_end): Remove.
2978 (Archive::do_filename): New function.
2979 (Archive::do_get_mtime): New function.
2980 (Archive::do_for_all_unused_symbols): New function.
2981 (Archive::task_): Move to base class.
2982 (Archive::incremental_info_): Likewise.
2983 (class Lib_group): Derive from Library_base.
2984 (Lib_group::do_filename): New function.
2985 (Lib_group::do_get_mtime): New function.
2986 (Lib_group::do_for_all_unused_symbols): New function.
2987 (Lib_group::task_): Move to base class.
2988 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2990 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2992 * incremental.cc (Incremental_inputs::report_archive_begin):
2993 Use Library_base; call library's get_mtime; add incremental inputs
2994 entry before members.
2995 (class Unused_symbol_visitor): New class.
2996 (Incremental_inputs::report_archive_end): Use Library_base; use
2997 visitor class to record unused symbols; don't add incremental inputs
2998 entry after members.
2999 (Incremental_inputs::report_object): Use Library_base.
3001 (Incremental_archive_entry::Incremental_archive_entry): Remove
3002 unused Archive parameter.
3003 (Incremental_inputs::report_archive_begin): Use Library_base.
3004 (Incremental_inputs::report_archive_end): Likewise.
3005 (Incremental_inputs::report_object): Likewise.
3006 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3008 * object.h (Object::for_all_global_symbols): New function.
3009 (Object::do_for_all_global_symbols): New function.
3010 (Sized_relobj::do_for_all_global_symbols): New function.
3011 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3013 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3016 2011-03-27 Ian Lance Taylor <iant@google.com>
3018 * archive.cc (Archive::interpret_header): Return -1 if something
3019 goes wrong. Change callers accordingly.
3021 2011-03-25 Cary Coutant <ccoutant@google.com>
3023 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3024 * testsuite/Makefile.in: Regenerate.
3026 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3028 * plugin.cc (get_view): New.
3029 (Plugin::load): Pass get_view to the plugin.
3030 (Plugin_manager::get_view): New.
3032 2011-03-21 Ian Lance Taylor <iant@google.com>
3034 * testsuite/final_layout.sh: Rewrite to not use dc.
3035 * testsuite/relro_test.sh: Fail if dc is not present.
3037 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3039 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3041 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3042 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3044 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3045 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3047 2011-03-14 Ian Lance Taylor <iant@google.com>
3049 * script-sections.cc (Sort_output_sections::script_compare):
3050 Rename from is_before, change return type.
3051 (Sort_output_sections::operator()): Adjust accordingly.
3053 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3056 * testsuite/odr_violation2.cc: Add comment to make all error line
3057 numbers double digits.
3058 * testsuite/debug_msg.sh: Adjust expected errors.
3060 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3062 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3063 but mark earlier ones as non-canonical
3064 (offset_to_iterator): Update search target and example
3065 (do_addr2line): Return extra lines in a vector*
3066 (format_file_lineno): Extract from do_addr2line
3067 (one_addr2line): Add vector* out-param
3068 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3069 when a lineno entry appeared last for its instruction
3070 (Dwarf_line_info): Add vector* out-param
3071 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3072 * symtab.cc (Odr_violation_compare): Include the lineno in the
3074 (linenos_from_loc): New. Combine the canonical line for an
3075 address with its other lines.
3076 (True_if_intersect): New. Helper functor to make
3077 std::set_intersection a query.
3078 (detect_odr_violations): Compare sets of lines instead of just
3079 one line for each function. This became less deterministic, but
3080 has fewer false positives.
3081 * symtab.h: Declarations.
3082 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3083 mix an optimized and non-optimized object in the same binary
3084 (odr_violation2.so): Same.
3085 * testsuite/Makefile.in: Regenerate from Makefile.am.
3086 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3087 * testsuite/debug_msg.sh: Update line numbers and add
3089 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3090 non-optimized context.
3091 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3092 isn't inlined, and use OdrDerived in an optimized context.
3093 * testsuite/odr_header1.h: Defines OdrDerived, where
3094 optimization will change the
3095 first-instruction-in-the-destructor's file and line number.
3096 * testsuite/odr_header2.h: Defines OdrBase.
3098 2011-03-09 Ian Lance Taylor <iant@google.com>
3100 * fileread.cc (File_read::clear_views): Don't delete the whole
3103 2011-03-08 Ian Lance Taylor <iant@google.com>
3106 * fileread.cc: #include <climits>.
3107 (GOLD_IOV_MAX): Define.
3108 (File_read::read_multiple): Limit number of entries by iov_max.
3109 * fileread.h (class File_read): Always set max_readv_entries to
3112 2011-03-07 Ian Lance Taylor <iant@google.com>
3115 * options.h (class General_options): Add -dy and -dn.
3117 2011-03-02 Cary Coutant <ccoutant@google.com>
3119 * testsuite/script_test_9.t: Add TLS segment.
3121 2011-03-02 Simon Baldwin <simonb@google.com>
3123 * configure.ac: Add check for gnu_indirect_function support in
3124 the toolchain building binutils.
3125 * configure: Rebuild.
3127 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3129 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3130 plugin only symbols.
3131 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3132 in plugin files as not needed in the symbol table.
3134 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3136 * output.cc (Output_section::add_input_section): Delay fill
3137 generation for section ordering.
3139 2011-02-09 Ian Lance Taylor <iant@google.com>
3142 * object.h (class Sized_relobj): Remove clear_local_symbols.
3143 * reloc.cc (Sized_relobj::do_relocate): Don't call
3144 clear_local_symbols.
3146 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3148 * plugin.cc (is_visible_from_outside): Return true for symbols
3151 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3153 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3156 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3158 * icf.h (is_section_foldable_candidate): Change type of parameter
3160 * icf.cc (Icf::find_identical_sections): Change type of local variable
3161 section_name to be std::string.
3162 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3164 2011-01-25 Ian Lance Taylor <iant@google.com>
3166 * script.cc (script_add_extern): Rewrite to use
3167 add_symbol_reference.
3169 2011-01-25 Doug Kwan <dougkwan@google.com>
3171 * icf.cc (get_section_contents): Always lock section's object.
3173 2011-01-24 Ian Lance Taylor <iant@google.com>
3175 * options.h (class General_options): Accept
3176 --no-detect-odr-violations.
3178 2011-01-24 Ian Lance Taylor <iant@google.com>
3180 * version.cc (version_string): Bump to 1.11.
3182 2011-01-24 Ian Lance Taylor <iant@google.com>
3184 * plugin.cc (class Plugin_rescan): Define new class.
3185 (Plugin_manager::claim_file): Set any_claimed_.
3186 (Plugin_manager::save_archive): New function.
3187 (Plugin_manager::save_input_group): New function.
3188 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3190 (Plugin_manager::new_undefined_symbol): New function.
3191 (Plugin_manager::rescan): New function.
3192 (Plugin_manager::rescannable_defines): New function.
3193 (Plugin_manager::add_input_file): Set any_added_.
3194 * plugin.h (class Plugin_manager): define new fields rescannable_,
3195 undefined_symbols_, any_claimed_, and any_added_. Declare
3196 Plugin_rescan as friend. Declare new functions.
3197 (Plugin_manager::Rescannable): Define type.
3198 (Plugin_manager::Rescannable_list): Define type.
3199 (Plugin_manager::Undefined_symbol_list): Define type.
3200 (Plugin_manager::Plugin_manager): Initialize new fields.
3201 * archive.cc (Archive::defines_symbol): New function.
3202 (Add_archive_symbols::run): Pass archive to plugins if any.
3203 * archive.h (class Archive): Declare defines_symbol.
3204 * readsyms.cc (Input_group::~Input_group): New function.
3205 (Finish_group::run): Pass input_group to plugins if any.
3206 * readsyms.h (class Input_group): Declare destructor.
3207 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3210 2011-01-10 Ian Lance Taylor <iant@google.com>
3212 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3214 (Layout::set_segment_offsets): Reset increase_relro before calling
3215 set_section_addresses a second time.
3217 2011-01-04 Cary Coutant <ccoutant@google.com>
3219 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3220 sections before NOBITS sections.
3222 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3224 * version.cc (print_version): Update copyright to 2011.
3226 2010-12-23 Cary Coutant <ccoutant@google.com>
3228 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3229 of OS to this->add. Add OD parameter to second form of the function.
3231 2010-12-20 Ian Lance Taylor <iant@google.com>
3233 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3234 second of two consecutive entries with same offset.
3236 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3238 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3239 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3240 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3241 to avoid unneeded links against $(LDADD).
3242 * testsuite/Makefile.in: Regenerate.
3244 2010-12-15 Ian Lance Taylor <iant@google.com>
3247 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3248 for R_X86_64_32 and R_X86_64_PC32.
3249 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3250 ver_matching_def_pic.o.
3251 (ver_matching_def_pic.o): New target.
3253 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3255 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3256 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3257 Move definition before File_read::View member definitions.
3258 (File_read::View::~View): Initialize and hold lock before
3259 updating current_mapped_bytes.
3261 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3263 * dwarf_reader.cc: Remove outdated comment.
3264 * gold-threads.cc: Fix typo in error message.
3265 * archive.cc: Fix typos in comments.
3266 * archive.h: Likewise.
3267 * arm-reloc-property.cc: Likewise.
3268 * arm-reloc-property.h: Likewise.
3269 * arm-reloc.def: Likewise.
3271 * attributes.h: Likewise.
3272 * cref.cc: Likewise.
3273 * ehframe.cc: Likewise.
3274 * fileread.h: Likewise.
3276 * i386.cc: Likewise.
3278 * incremental.h: Likewise.
3279 * int_encoding.cc: Likewise.
3280 * layout.h: Likewise.
3281 * main.cc: Likewise.
3282 * merge.h: Likewise.
3283 * object.cc: Likewise.
3284 * object.h: Likewise.
3285 * options.cc: Likewise.
3286 * readsyms.cc: Likewise.
3287 * reduced_debug_output.cc: Likewise.
3288 * reloc.cc: Likewise.
3289 * script-sections.cc: Likewise.
3290 * sparc.cc: Likewise.
3291 * symtab.h: Likewise.
3292 * target-reloc.h: Likewise.
3293 * target.cc: Likewise.
3294 * target.h: Likewise.
3295 * timer.cc: Likewise.
3296 * timer.h: Likewise.
3297 * x86_64.cc: Likewise.
3299 2010-12-09 Cary Coutant <ccoutant@google.com>
3301 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3303 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3304 parameter; change all callers.
3305 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3306 * options.h (warn_execstack): New option.
3308 2010-12-07 Doug Kwan <dougkwan@google.com>
3310 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3311 like function call relocations.
3313 2010-12-07 Ian Lance Taylor <iant@google.com>
3315 * archive.cc (Archive::get_elf_object_for_member): Permit
3316 punconfigured to be NULL.
3317 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3318 (Archive::include_member): Pass NULL to get_elf_object_for_member
3319 if we searched for the archive and this is the first included
3322 2010-12-01 Ian Lance Taylor <iant@google.com>
3324 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3325 track_relocs_type_ field.
3326 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3327 Set track_relocs_type_.
3328 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3329 contents when using RELA relocs.
3330 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3332 * reloc.cc (Track_relocs::next_addend): New function.
3333 * reloc.h (class Track_relocs): Declare next_addend.
3335 2010-12-01 Ian Lance Taylor <iant@google.com>
3337 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3340 2010-12-01 Ian Lance Taylor <iant@google.com>
3342 * README: Update compilers known to work and fail.
3344 2010-11-23 Matthias Klose <doko@ubuntu.com>
3346 * configure.in: For --enable-gold, handle value `default' instead of
3347 `both*'. Always install ld as ld.bfd, install as ld if gold is
3349 * configure: Regenerate.
3351 2010-11-18 Doug Kwan <dougkwan@google.com>
3353 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3354 and right_alignment to be zero. Store result alignment only if it is
3355 greater than existing alignment.
3357 2010-11-16 Cary Coutant <ccoutant@google.com>
3360 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3361 Check for ".zdebug_line".
3363 2010-11-16 Doug Kwan <dougkwan@google.com>
3364 Cary Coutant <ccoutant@google.com>
3366 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3367 by reference; adjust all callers.
3368 * output.cc (Output_segment::set_section_addresses): Adjust references
3369 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3371 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3372 end at page boundary.
3374 2010-11-16 Cary Coutant <ccoutant@google.com>
3377 * layout.cc (Layout::choose_output_section): Transform names of
3378 compressed sections even when using a script with a SECTIONS clause.
3379 (Layout::output_section_name): Remove code to transform
3380 compressed debug section names.
3381 * output.cc (Output_section::add_input_section): Use uncompressed
3382 section size when tracking input sections.
3384 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3386 * symtab.h (Symbol::NON_PIC_REF): Remove.
3387 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3388 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3389 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3390 (Symbol::use_plt_offset): Take a flags argument and pass it
3391 directly to needs_dynamic_reloc. Restrict check for undefined
3392 weak symbols to function calls.
3393 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3394 (Target_arm::Scan::global): Use it.
3395 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3396 (Target_arm::Relocate::relocate): Likewise.
3397 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3398 parameter with an r_type parameter. Use get_reference_flags
3400 (Target_arm::Relocate::relocate): Update accordingly.
3401 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3402 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3403 (Target_i386::Scan::global): Likewise.
3404 (Target_i386::Relocate::relocate): Likewise.
3405 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3406 parameter with an r_type parameter. Use get_reference_flags
3408 (Target_i386::Relocate::relocate): Update accordingly.
3409 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3410 (Target_powerpc::Scan::global): Use it.
3411 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3412 (Target_powerpc::Relocate::relocate): Likewise.
3413 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3414 (Target_sparc::Scan::global): Use it.
3415 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3416 (Target_sparc::Relocate::relocate): Likewise.
3417 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3418 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3419 (Target_x86_64::Scan::global): Likewise.
3420 (Target_x86_64::Relocate::relocate): Likewise.
3422 2010-11-08 Doug Kwan <dougkwan@google.com>
3423 Cary Coutant <ccoutant@google.com>
3425 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3426 (Arm_exidx_merge_section::section_contents_): New data member.
3427 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3428 (Arm_input_section::~Arm_input_section): De-allocate memory.
3429 (Arm_input_section::original_contents_): New data member.
3430 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3431 in parameters instead of calling Object::section_contents without
3433 (Arm_output_section::group_section): New parameter TASK. Pass it
3434 to callees that need locking objects.
3435 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3436 to lock EXIDX input sections. Fix a formatting issue. Call
3437 Arm_exidx_merged_section::build_contents to create merged section
3439 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3440 to lock object of stub table owner.
3441 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3442 TEXT_SIZE to initialize data member TEXT_SIZE_.
3443 (Arm_exidx_input_section::addralign): Fix typo in comment.
3444 (Arm_exidx_input_section::text_size): New method.
3445 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3446 that require locking objects. Lock objects before scanning for stubs
3447 and updating local symbols.
3448 (Arm_input_section<big_endian>::init): Copy contents of original
3450 (Arm_input_section<big_endian>::do_write): Use saved contents of
3451 original input section instead of calling Object::section_contents
3453 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3454 size without calling Object::section_size().
3455 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3456 for size. Allocate a buffer for merged EXIDX entries.
3457 (Arm_exidx_merged_section::build_contents): New method.
3458 (Arm_exidx_merged_section::do_write): Move merge section contents
3459 building code to Arm_exidx_merged_section::build_contetns. Write
3460 out contetns in buffer instead of building it on the fly.
3461 (Arm_relobj::make_exidx_input_section): Also pass text section size
3462 to Arm_exidx_input_section constructor.
3463 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3464 (Arm_dynobj::do_read_symbols): Fix memory leak.
3465 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3466 * target.h: (class Task): Add forward declaration.
3467 (Target::relax): Add new parameter TASK and pass it to
3469 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3471 2010-11-05 Cary Coutant <ccoutant@google.com>
3474 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3475 object when reading from the file.
3476 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3478 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3479 when reading section contents.
3480 (get_section_contents): Likewise.
3481 (icf::find_identical_sections): Likewise.
3482 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3483 object when reading from the file.
3484 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3485 the object when doing deferred section layout.
3487 2010-11-03 Nick Clifton <nickc@redhat.com>
3490 * script.h (class Symbol_assignment: name): New member. Returns
3491 the name of the symbol.
3492 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3493 Returns true if the given symbol name is on the list of
3494 assignments wating to be processed.
3495 * archive.cc (should_incldue_member): If the symbol is undefined,
3496 check to see if it is on the list of symbols pending assignment.
3498 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3500 * script-sections.cc (Script_sections::find_memory_region): Check
3501 for a NULL output section pointer.
3503 2010-10-29 Doug Kwan <dougkwan@google.com>
3505 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3506 Output_section::add_relaxed_input_section.
3507 * output.cc (Output_section::add_relaxed_input_section): Add new
3508 arguments LAYOUT and NAME. Set section order index.
3509 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3510 Copy section order index.
3511 * output.h (Output_section::add_relaxed_input_section): Add new
3512 arguments LAYOUT and NAME.
3514 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3516 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3517 NATIVE_OR_CROSS_LINKER.
3518 * testsuite/Makefile.in: Regenerate.
3520 2010-10-20 Doug Kwan <dougkwan@google.com>
3522 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3523 without SHF_LINK_ORDER flags.
3524 * layout.cc (Layout::choose_output_section): Do not filter
3525 SHF_LINK_ORDER flag in a relocatable link.
3527 2010-10-17 Cary Coutant <ccoutant@google.com>
3529 * output.h (Output_segment::set_section_addresses): Change function
3530 signature. Update all callers.
3531 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3533 (Output_segment::set_section_addresses): Align after last TLS
3534 section. Add padding before last relro section instead of after.
3536 2010-10-17 Doug Kwan <dougkwan@google.com>
3538 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3539 GOT output section to be writable.
3541 2010-10-14 Cary Coutant <ccoutant@google.com>
3543 * debug.h (DEBUG_INCREMENTAL): New flag.
3544 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3545 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3547 * incremental.cc (report_command_line): Ignore all forms of
3549 * layout.cc (Layout::Layout): Check parameters for incremental link
3551 * options.cc (General_options::parse_incremental): New function.
3552 (General_options::parse_no_incremental): New function.
3553 (General_options::parse_incremental_full): New function.
3554 (General_options::parse_incremental_update): New function.
3555 (General_options::incremental_mode_): New data member.
3556 (General_options::finalize): Check incremental_mode_.
3557 * options.h (General_options): Update help text for --incremental.
3558 Add --no-incremental, --incremental-full, --incremental-update.
3559 (General_options::Incremental_mode): New enum type.
3560 (General_options::incremental_mode): New function.
3561 (General_options::incremental_mode_): New data member.
3562 * parameters.cc (Parameters::incremental_mode_): New data member.
3563 (Parameters::set_options): Set incremental_mode_.
3564 (Parameters::set_incremental_full): New function.
3565 (Parameters::incremental): New function.
3566 (Parameters::incremental_update): New function.
3567 (set_parameters_incremental_full): New function.
3568 * parameters.h (Parameters::set_incremental_full): New function.
3569 (Parameters::incremental): New function.
3570 (Parameters::incremental_update): New function.
3571 (Parameters::incremental_mode_): New data member.
3572 (set_parameters_incremental_full): New function.
3573 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3574 incremental link mode.
3575 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3576 (Sized_relobj::do_relocate_sections): Likewise.
3577 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3579 * testsuite/Makefile.in: Regenerate.
3580 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3582 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3584 * script-sections.h (class Script_sections): Make
3585 Sections_elements typedef public.
3586 * script-sections.cc (class Sort_output_sections): Add elements_
3587 field. Add constructor which sets it; change all callers.
3588 (Sort_output_sections::is_before): New function.
3589 (Sort_output_sections::operator()): Call is_before.
3590 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3592 * testsuite/script_test_10.sh: New test. Test script section
3594 * testsuite/script_test_10.t: Likewise.
3595 * testsuite/script_test_10.s: Likewise.
3596 * testsuite/Makefile.am: Wrap the cross linker tests and the
3597 common tests into NATIVE_OR_CROSS_LINKER.
3598 (check_SCRIPTS): Add script_test_10.sh.
3599 (check_DATA): Add script_test_10.stdout.
3600 (script_test_10.o, script_test_10): New targets.
3601 (script_test_10.stdout): New target.
3602 * configure, testsuite/Makefile.in: Regenerate.
3604 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3606 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3607 error for the deprecated relocations.
3608 (Target_arm::Scan::global): Likewise.
3609 (Target_arm::Relocate::relocate): Likewise.
3611 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3613 * fileread.cc (Input_file::find_file): Initialize *found_name
3614 and *namep when using the fallback search for case 4.
3616 2010-10-11 Cary Coutant <ccoutant@google.com>
3618 * options.h (class General_options): Redefine -z lazy as an alias for
3619 the negation of -z now.
3621 2010-10-11 Ian Lance Taylor <iant@google.com>
3623 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3626 2010-10-06 Nick Clifton <nickc@redhat.com>
3628 * script-sections.cc(class Memory_region): Remove
3629 current_lma_offset_ field. Rename current_vma_offset_ to
3630 current_offset_. Add last_section_ field.
3631 (Memory_region::get_current_vma_address): Rename to
3632 get_current_address.
3633 (Memory_region::get_current_lma_address): Delete.
3634 (Memory_region::increment_vma_offset): Rename to
3636 (Memory_region::increment_lma_offset): Delete.
3637 (Memory_region::attributes_compatible): New method. Returns
3638 true if the provided section is compatible with the region.
3639 (Memory_region::get_last_section): New method. Returns the last
3640 section to use the region.
3641 (Memory_region::set_last_section): New method. Stores the last
3642 section to use the region.
3643 (Script_sections::block_in_region): New method. Returns true if
3644 a block of memory is contained within a region.
3645 (Script_sections::find_memory_region): New method. Locates a
3646 memory region to be used to set a VMA or LMA address.
3647 (Output_section_definition::set_section_addresses): Add code to
3648 check for addresses set by memory regions.
3649 (Output_segment::set_section_addresses): Remove memory region
3651 (Script_sections::create_segment): Add a warning if a header
3652 segment is created outside of any region.
3653 * script-sections.h (class Script_sections): Add prototypes for
3654 find_memory_region and block_in_region methods.
3655 * testsuite/memory_test.s: Use .long instead of .word.
3656 * testsuite/memory_test.t: Add some more output sections.
3657 * testsuite/memory_test.sh: Update expected output.
3659 2010-10-02 Doug Kwan <dougkwan@google.com>
3661 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3662 defintion to symtab.h
3663 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3664 declaration to defintion.
3666 2010-10-01 Nick Clifton <nickc@redhat.com>
3668 * expression.cc (eval): Replace dummy argument with NULL.
3669 (eval_maybe_dot): Check for a NULL result section pointer.
3670 (Symbol_expression::value): Likewise.
3671 (Dot_expression::value): Likewise.
3672 (BINARY_EXPRESSION): Likewise.
3673 (Max_expression::value): Likewise.
3674 (Min_expression::value): Likewise.
3675 (Absolute_expression::value): Likewise.
3676 (Addr_expression::value_from_output_section): Likewise.
3677 (Loaddddr_expression::value_from_output_section): Likewise.
3678 (Segment_start_expression::value): Likewise.
3679 * script-sections.cc
3680 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3682 (Sections_elememt_dot_assignment::set_section_addresses):
3684 (Output_data_expression::do_write_to_buffer): Likewise.
3685 (Output_section_definition::finalize_symbols): Likewise.
3686 (Output_section_definition::set_section_addresses): Likewise.
3688 2010-09-30 Doug Kwan <dougkwan@google.com>
3690 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3692 2010-09-28 Sriraman Tallam <tmsriram@google.com>
3694 * target.h (Target::can_icf_inline_merge_sections): New virtual
3696 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3698 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3700 * icf.cc (get_section_contents): Inline merge sections only when
3703 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3705 * configure: Regenerate.
3707 2010-09-17 Ian Lance Taylor <iant@google.com>
3709 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
3710 * testsuite/Makefile.am (memory_test.o): New target.
3711 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3713 * testsuite/Makefile.in: Rebuild.
3715 2010-09-17 Doug Kwan <dougkwan@google.com>
3717 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3718 defintion if relocation uses GOT entries of the symbol.
3719 * testsuite/icf_safe_test.sh: Fix test.
3720 * testsuite/icf_safe_so_test.sh: Fix test.
3722 2010-09-16 Cary Coutant <ccoutant@google.com>
3724 * script_sections.cc (class Memory_region): Remove "NULL" from
3725 vector initializations.
3727 2010-09-15 Cary Coutant <ccoutant@google.com>
3729 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3730 Resolve forwarding symbols.
3732 2010-09-15 Doug Kwan <dougkwan@google.com>
3734 * gold/testsuite/script_test_3.t: Add ARM special sections.
3735 * gold/testsuite/script_test_4.t: Same.
3736 * gold/testsuite/script_test_5.t: Same.
3737 * gold/testsuite/script_test_6.t: Same.
3738 * gold/testsuite/script_test_7.t: Same.
3739 * gold/testsuite/script_test_7.t: Same.
3740 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3742 2010-09-14 Cary Coutant <ccoutant@google.com>
3744 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3745 (Target_x86_64::Relocate::relocate_tls): Replace check for
3746 saw_tls_block_reloc_ with test for executable section.
3748 2010-09-12 Cary Coutant <ccoutant@google.com>
3750 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3751 position-independent executables to shared libraries need dynamic
3753 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3754 position-independent executables.
3755 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3756 * testsuite/Makefile.in: Regenerate.
3758 2010-09-10 Nick Clifton <nickc@redhat.com>
3761 * testsuite/memory_test.t: Discard any sections that are not
3764 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3767 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3768 "This::" to work around a bug in gcc 4.2.
3770 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3772 2010-09-09 Rafael Espindola <espindola@google.com>
3774 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3775 sections with different PF_X flags in the same segment.
3776 (Layout::find_first_load_seg): Search all segments to find the first
3778 * options.h (rosegment): New.
3780 2010-09-08 Rafael Espindola <espindola@google.com>
3782 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
3784 2010-09-08 Doug Kwan <dougkwan@google.com>
3786 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3787 (Arm_relobj::do_relocate_sections): Add new parameter for output
3788 file to match the parent.
3789 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3790 of local symbols instead of input values. Update code to track
3791 changes in gold::relocate_section.
3792 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3793 (Sized_relobj::compute_final_local_value_internal): New methods.
3794 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3795 body into private version of Sized_relobj::compute_final_local_value.
3796 Call the inline method.
3797 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3798 merged symbol value if there is one.
3799 (Symbol_value::has_output_value): New method defintiion.
3800 (Sized_relobj::Compute_final_local_value_status): New enum type.
3801 (Sized_relobj::compute_final_local_value): New methods.
3802 (Sized_relobj::compute_final_local_value_internal): New methods.
3803 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3804 and arm_cortex_a8.sh.
3805 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3806 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3808 * Makefile.in: Regenerate.
3809 * testsuite/arm_bl_out_of_range.s: Update test.
3810 * testsuite/thumb_bl_out_of_range.s: Ditto.
3811 * testsuite/thumb_blx_out_of_range.s: Ditto.
3812 * testsuite/arm_branch_out_of_range.sh: New file.
3813 * testsuite/arm_cortex_a8.sh: Ditto.
3814 * testsuite/arm_cortex_a8_b.s: Ditto.
3815 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3816 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3817 * testsuite/arm_cortex_a8_bl.s: Ditto.
3818 * testsuite/arm_cortex_a8_blx.s: Ditto.
3819 * testsuite/arm_cortex_a8_local.s: Ditto.
3820 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3821 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3823 2010-09-08 Rafael Espindola <espindola@google.com>
3825 * Makefile.am (memory_test.stdout): Run readelf with -W.
3826 * Makefile.in: Regenerate.
3827 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3830 2010-09-08 Rafael Espindola <espindola@google.com>
3832 * script-sections.cc (Script_sections::add_memory_region): Convert
3833 field precision to int.
3834 * script.cc (script_set_section_region, script_set_section_region):
3835 Convert field precision to int.
3837 2010-09-08 Rafael Espindola <espindola@google.com>
3839 * arm.cc (do_finalize_sections): Create the __exidx_start and
3840 __exdix_end symbols even when the section is missing.
3842 2010-09-08 Nick Clifton <nickc@redhat.com>
3844 * README: Remove claim that MEMORY is not supported.
3845 * expression.cc (script_exp_function_origin)
3846 (script_exp_function_length): Move from here to ...
3847 * script.cc: ... here.
3848 (script_set_section_region, script_add_memory)
3849 (script_parse_memory_attr, script_include_directive): New
3851 * script-sections.cc
3852 (class Memory_region): New class.
3853 (class Output_section_definition): Add set_memory_region,
3854 set_section_vma, set_section_lma and get_section_name methods.
3855 (class Script_Sections): Add add_memory_region,
3856 find_memory_region, find_memory_region_origin,
3857 find_memory_region_length and set_memory_region methods.
3858 Have set_section_addresses method walk the list of set memory
3860 Extend the print methos to display memory regions.
3861 * script-sections.h: Add prototypes for new methods.
3862 Add enum for MEMORY region attributes.
3863 * yyscript.y: Add support for parsing MEMORY regions.
3864 * script-c.h: Add prototypes for new functions.
3865 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3866 * testsuite/Makefile.in: Regenerate.
3867 * testsuite/memory_test.sh: New script.
3868 * testsuite/memory_test.s: New assembler source file.
3869 * testsuite/memory_test.t: New linker script.
3871 2010-08-27 Doug Kwan <dougkwan@google.com>
3873 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3874 reference override an existing dynamic weak reference.
3875 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3876 * testsuite/Makefile.in: Regenerate.
3877 * testsuite/dyn_weak_ref.sh: New file.
3878 * testsuite/dyn_weak_ref_1.c: Ditto.
3879 * testsuite/dyn_weak_ref_2.c: Ditto.
3881 2010-08-27 Ian Lance Taylor <iant@google.com>
3883 * incremental.h (class Incremental_input_entry): Add virtual
3886 2010-08-27 Ian Lance Taylor <iant@google.com>
3888 * testsuite/start_lib_test_3.c: Mark t3 as used.
3890 2010-08-27 Nick Clifton <nickc@redhat.com>
3892 * options.cc (version_script): Fix small typo in previous
3895 2010-08-25 Nick Clifton <nickc@redhat.com>
3897 * archive.cc: Formatting fixes: Remove whitespace between
3898 typename and following asterisk. Remove whitespace between
3899 function name and opening parenthesis.
3900 * archive.h: Likewise.
3902 * attributes.cc: Likewise.
3903 * attributes.h: Likewise.
3904 * common.cc: Likewise.
3905 * copy-relocs.cc: Likewise.
3906 * dirsearch.h: Likewise.
3907 * dynobj.cc: Likewise.
3908 * ehframe.cc: Likewise.
3909 * ehframe.h: Likewise.
3910 * expression.cc: Likewise.
3911 * fileread.cc: Likewise.
3912 * fileread.h: Likewise.
3914 * gold-threads.cc: Likewise.
3915 * gold.cc: Likewise.
3916 * i386.cc: Likewise.
3918 * incremental-dump.cc: Likewise.
3919 * incremental.cc: Likewise.
3920 * layout.cc: Likewise.
3921 * layout.h: Likewise.
3922 * main.cc: Likewise.
3923 * merge.cc: Likewise.
3924 * merge.h: Likewise.
3925 * object.cc: Likewise.
3926 * object.h: Likewise.
3927 * options.cc: Likewise.
3928 * options.h: Likewise.
3929 * output.cc: Likewise.
3930 * output.h: Likewise.
3931 * plugin.cc: Likewise.
3932 * plugin.h: Likewise.
3933 * powerpc.cc: Likewise.
3934 * reloc.cc: Likewise.
3935 * script-c.h: Likewise.
3936 * script-sections.cc: Likewise.
3937 * script.cc: Likewise.
3938 * stringpool.cc: Likewise.
3939 * symtab.cc: Likewise.
3940 * symtab.h: Likewise.
3941 * target.cc: Likewise.
3942 * timer.cc: Likewise.
3943 * timer.h: Likewise.
3944 * version.cc: Likewise.
3945 * x86_64.cc: Likewise.
3947 2010-08-24 Nick Clifton <nickc@redhat.com>
3950 * layout.cc (segment_precedes): Sort segments by their physical
3951 addresses, if they have been set.
3953 2010-08-23 Cary Coutant <ccoutant@google.com>
3955 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3957 (Lib_group::include_member): Unlock object after deleting its
3959 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3962 2010-08-19 Neil Vachharajani <nvachhar@google.com>
3963 Cary Coutant <ccoutant@google.com>
3965 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3966 constructor, and set_blocker.
3967 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3969 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3970 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3971 * testsuite/Makefile.am (start_lib_test): New test case.
3972 * testsuite/Makefile.in: Regenerate.
3973 * testsuite/start_lib_test_main.c: New file.
3974 * testsuite/start_lib_test_1.c: New file.
3975 * testsuite/start_lib_test_2.c: New file.
3976 * testsuite/start_lib_test_3.c: New file.
3978 2010-08-19 Ian Lance Taylor <iant@google.com>
3980 * Makefile.in: Rebuild with automake 1.11.1.
3981 * aclocal.m4: Likewise.
3982 * testsuite/Makefile.in: Likewise.
3984 2010-08-19 Ian Lance Taylor <iant@google.com>
3987 * i386.cc (class Output_data_plt_i386): Update declarations.
3988 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3989 local_ifuncs_ fields.
3990 (Target_i386::do_plt_section_for_global): New function.
3991 (Target_i386::do_plt_section_for_local): New function.
3992 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3993 parameter; change all callers. Initialize global_ifuncs_ and
3994 local_ifuncs_. If doing a static link define __rel_iplt_start and
3996 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3997 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3998 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4000 (Target_i386::make_plt_section): New function, broken out of
4001 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4002 (Target_i386::make_plt_entry): Call make_plt_section.
4003 (Target_i386::make_local_ifunc_plt_entry): New function.
4004 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4005 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4006 R_386_IRELATIVE to switch.
4007 (Target_i386::Scan::global): Likewise.
4008 (Target_i386::Relocate::relocate): Likewise.
4009 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4011 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4012 (Target_x86_64::do_plt_section_for_global): New function.
4013 (Target_x86_64::do_plt_section_for_local): New function.
4014 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4015 parameter; change all callers. If doing a static link define
4016 __rela_iplt_start and __rela_iplt_end.
4017 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4018 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4019 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4021 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4022 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4024 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4025 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4026 R_X86_64_IRELATIVE to switch.
4027 (Target_x86_64::Scan::global): Likewise.
4028 (Target_x86_64::Relocate::relocate): Likewise.
4029 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4031 * target.h (class Target): Add plt_section_for_global and
4032 plt_section_for_local functions. Add do_plt_section_for_global
4033 and do_plt_section_for_local virtual functions.
4034 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4035 clarifying comments.
4036 (Symbol::use_plt_offset): Handle IFUNC symbol.
4037 * object.cc (Sized_relobj::Sized_relobj): Initialize
4039 (Sized_relobj::local_has_plt_offset): New function.
4040 (Sized_relobj::local_plt_offset): New function.
4041 (Sized_relobj::set_local_plt_offset): New function.
4042 (Sized_relobj::do_count): Handle IFUNC symbol.
4043 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4044 a bit away from input_shndx_ field. Add set_is_func_symbol and
4045 is_ifunc_symbol functions.
4046 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4047 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4048 local_plt_offsets_ field.
4049 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4050 * output.h (class Output_section_data): Add non-const
4051 output_section function.
4052 (class Output_data_got): Update declarations.
4053 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4054 Add use_plt_offset parameter to global and local constructors.
4055 Change all callers. Change local_sym_index_ field to 31 bits.
4056 Change GSYM_CODE and CONSTANT_CODE accordingly.
4057 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4058 doing a static link don't set sh_link field.
4059 (Output_data_got::Got_entry::write): Use PLT offset if
4061 (Output_data_got::add_global_plt): New function.
4062 (Output_data_got::add_local_plt): New function.
4063 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4064 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4065 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4066 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4067 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4069 * testsuite/ifunc-sel.h: New file.
4070 * testsuite/ifuncmain1.c: New file.
4071 * testsuite/ifuncmain1vis.c: New file.
4072 * testsuite/ifuncmod1.c: New file.
4073 * testsuite/ifuncdep2.c: New file.
4074 * testsuite/ifuncmain2.c: New file.
4075 * testsuite/ifuncmain3.c: New file.
4076 * testsuite/ifuncmod3.c: New file.
4077 * testsuite/ifuncmain4.c: New file.
4078 * testsuite/ifuncmain5.c: New file.
4079 * testsuite/ifuncmod5.c: New file.
4080 * testsuite/ifuncmain6pie.c: New file.
4081 * testsuite/ifuncmod6.c: New file.
4082 * testsuite/ifuncmain7.c: New file.
4083 * configure, testsuite/Makefile.in: Rebuild.
4085 2010-08-18 Ian Lance Taylor <iant@google.com>
4088 (Output_section_incremental_inputs::write_input_files): Add cast
4089 to avoid signed/unsigned comparison warning.
4090 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4092 2010-08-12 Cary Coutant <ccoutant@google.com>
4094 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4096 2010-08-13 Ian Lance Taylor <iant@google.com>
4098 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4100 2010-08-12 Cary Coutant <ccoutant@google.com>
4101 Doug Kwan <dougkwan@google.com>
4103 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4104 defintion overrides non-weak undef, remember that the original undef
4106 * symtab.cc (Symbol_table::sized_write_global): For undef without
4107 an original weak binding, set binding to global in output.
4108 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4109 * testsuite/Makefile.in: Regenerate.
4110 * testsuite/strong_ref_weak_def.sh: New file.
4111 * testsuite/strong_ref_weak_def_1.c: Ditto.
4112 * testsuite/strong_ref_weak_def_2.c: Ditto.
4114 2010-08-12 Cary Coutant <ccoutant@google.com>
4116 * testsuite/incremental_test.sh: Rewrite.
4117 * testsuite/incremental_test_1.c: Rewrite.
4118 * testsuite/incremental_test_2.c: Rewrite.
4120 2010-08-12 Cary Coutant <ccoutant@google.com>
4122 * arm.cc (Target_arm::got_size): Add const.
4123 (Target_arm::got_entry_count): New function.
4124 (Target_arm::plt_entry_count): New function.
4125 (Target_arm::first_plt_entry_offset): New function.
4126 (Target_arm::plt_entry_size): New function.
4127 (Output_data_plt_arm::entry_count): New function.
4128 (Output_data_plt_arm::first_plt_entry_offset): New function.
4129 (Output_data_plt_arm::get_plt_entry_size): New function.
4130 * i386.cc (Target_i386::got_size): Add const.
4131 (Target_i386::got_entry_count): New function.
4132 (Target_i386::plt_entry_count): New function.
4133 (Target_i386::first_plt_entry_offset): New function.
4134 (Target_i386::plt_entry_size): New function.
4135 (Output_data_plt_i386::entry_count): New function.
4136 (Output_data_plt_i386::first_plt_entry_offset): New function.
4137 (Output_data_plt_i386::get_plt_entry_size): New function.
4138 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4139 find_incremental_inputs_sections. Dump incremental_got_plt section.
4140 * incremental.cc: Include target.h.
4141 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4142 parameter. Adjust all callers. Find incremental_got_plt section.
4143 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4145 (Output_section_incremental_inputs::set_final_data_size): Calculate
4146 size of incremental_got_plt section.
4147 (Output_section_incremental_inputs::do_write): Write the
4148 incremental_got_plt section.
4149 (Got_plt_view_info): New struct.
4150 (Local_got_offset_visitor): New class.
4151 (Global_got_offset_visitor): New class.
4152 (Global_symbol_visitor_got_plt): New class.
4153 (Output_section_incremental_inputs::write_got_plt): New function.
4154 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4155 Add parameter. Adjust all callers.
4156 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4157 (Incremental_inputs::got_plt_section): New function.
4158 (Incremental_inputs::got_plt_section_): New data member.
4159 (Incremental_got_plt_reader): New class.
4160 * layout.cc (Layout::create_incremental_info_sections): Add the
4161 incremental_got_plt section.
4162 * object.h (Got_offset_list::get_list): New function.
4163 (Got offset_list::for_all_got_offsets): New function.
4164 (Sized_relobj::local_got_offset_list): New function.
4165 * powerpc.cc (Target_powerpc::got_size): Add const.
4166 (Target_powerpc::got_entry_count): New function.
4167 (Target_powerpc::plt_entry_count): New function.
4168 (Target_powerpc::first_plt_entry_offset): New function.
4169 (Target_powerpc::plt_entry_size): New function.
4170 (Output_data_plt_powerpc::entry_count): New function.
4171 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4172 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4173 * sparc.cc (Target_sparc::got_size): Add const.
4174 (Target_sparc::got_entry_count): New function.
4175 (Target_sparc::plt_entry_count): New function.
4176 (Target_sparc::first_plt_entry_offset): New function.
4177 (Target_sparc::plt_entry_size): New function.
4178 (Output_data_plt_sparc::entry_count): New function.
4179 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4180 (Output_data_plt_sparc::get_plt_entry_size): New function.
4181 * symtab.h (Symbol::got_offset_list): New function.
4182 (Symbol_table::for_all_symbols): New function.
4183 * target.h (Sized_target::got_entry_count): New function.
4184 (Sized_target::plt_entry_count): New function.
4185 (Sized_target::plt_entry_size): New function.
4186 * x86_64.cc (Target_x86_64::got_size): Add const.
4187 (Target_x86_64::got_entry_count): New function.
4188 (Target_x86_64::plt_entry_count): New function.
4189 (Target_x86_64::first_plt_entry_offset): New function.
4190 (Target_x86_64::plt_entry_size): New function.
4191 (Output_data_plt_x86_64::entry_count): New function.
4192 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4193 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4195 2010-08-12 Cary Coutant <ccoutant@google.com>
4197 * archive.cc: Include incremental.h.
4198 (Archive::Archive): Initialize incremental_info_.
4199 (Archive::include_member): Record archive members in incremental info.
4200 (Add_archive_symbols::run): Record begin and end of an archive in
4202 (Lib_group::include_member): Record objects in incremental info.
4203 * archive.h (Incremental_archive_entry): Forward declaration.
4204 (Archive::set_incremental_info): New member function.
4205 (Archive::incremental_info): New member function.
4206 (Archive::Unused_symbol_iterator): New class.
4207 (Archive::unused_symbols_begin): New member function.
4208 (Archive::unused_symbols_end): New member function.
4209 (Archive::incremental_info_): New data member.
4210 * incremental-dump.cc (find_input_containing_global): New function.
4211 (dump_incremental_inputs): Dump new incremental info sections.
4212 * incremental.cc: Include symtab.h.
4213 (Output_section_incremental_inputs): New class.
4214 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4215 new incremental info sections.
4216 (Sized_incremental_binary::do_check_inputs): Likewise.
4217 (Incremental_inputs::report_archive): Remove.
4218 (Incremental_inputs::report_archive_begin): New function.
4219 (Incremental_inputs::report_archive_end): New function.
4220 (Incremental_inputs::report_object): New function.
4221 (Incremental_inputs::finalize_inputs): Remove.
4222 (Incremental_inputs::report_input_section): New function.
4223 (Incremental_inputs::report_script): Rewrite.
4224 (Incremental_inputs::finalize): Do nothing but finalize string table.
4225 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4226 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4227 (Incremental_inputs::create_data_sections): New function.
4228 (Incremental_inputs::relocs_entsize): New function.
4229 (Output_section_incremental_inputs::set_final_data_size): New function.
4230 (Output_section_incremental_inputs::do_write): New function.
4231 (Output_section_incremental_inputs::write_header): New function.
4232 (Output_section_incremental_inputs::write_input_files): New function.
4233 (Output_section_incremental_inputs::write_info_blocks): New function.
4234 (Output_section_incremental_inputs::write_symtab): New function.
4235 * incremental.h (Incremental_script_entry): Forward declaration.
4236 (Incremental_object_entry): Forward declaration.
4237 (Incremental_archive_entry): Forward declaration.
4238 (Incremental_inputs): Forward declaration.
4239 (Incremental_inputs_header_data): Remove.
4240 (Incremental_inputs_header): Remove.
4241 (Incremental_inputs_header_write): Remove.
4242 (Incremental_inputs_entry_data): Remove.
4243 (Incremental_inputs_entry): Remove.
4244 (Incremental_inputs_entry_write): Remove.
4245 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4246 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4247 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4248 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4250 (Incremental_input_entry): New class.
4251 (Incremental_script_entry): New class.
4252 (Incremental_object_entry): New class.
4253 (Incremental_archive_entry): New class.
4254 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4255 (Incremental_inputs::report_inputs): Remove.
4256 (Incremental_inputs::report_archive): Remove.
4257 (Incremental_inputs::report_archive_begin): New function.
4258 (Incremental_inputs::report_archive_end): New function.
4259 (Incremental_inputs::report_object): Change prototype.
4260 (Incremental_inputs::report_input_section): New function.
4261 (Incremental_inputs::report_script): Change prototype.
4262 (Incremental_inputs::get_reloc_count): New function.
4263 (Incremental_inputs::set_reloc_count): New function.
4264 (Incremental_inputs::create_data_sections): New function.
4265 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4266 (Incremental_inputs::inputs_section): New function.
4267 (Incremental_inputs::symtab_section): New function.
4268 (Incremental_inputs::relocs_section): New function.
4269 (Incremental_inputs::get_stringpool): Add const.
4270 (Incremental_inputs::command_line): Add const.
4271 (Incremental_inputs::inputs): Remove.
4272 (Incremental_inputs::command_line_key): New function.
4273 (Incremental_inputs::input_file_count): New function.
4274 (Incremental_inputs::input_files): New function.
4275 (Incremental_inputs::relocs_entsize): New function.
4276 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4277 (Incremental_inputs::finalize_inputs): Remove.
4278 (Incremental_inputs::Input_info): Remove.
4279 (Incremental_inputs::lock_): Remove.
4280 (Incremental_inputs::inputs_): Change type.
4281 (Incremental_inputs::inputs_map_): Remove.
4282 (Incremental_inputs::current_object_entry_): New data member.
4283 (Incremental_inputs::inputs_section_): New data member.
4284 (Incremental_inputs::symtab_section_): New data member.
4285 (Incremental_inputs::relocs_section_): New data member.
4286 (Incremental_inputs::reloc_count_): New data member.
4287 (Incremental_inputs_reader): New class.
4288 (Incremental_symtab_reader): New class.
4289 (Incremental_relocs_reader): New class.
4290 * layout.cc (Layout::finalize): Move finalization of incremental info
4291 and creation of incremental info sections to follow finalization of
4292 symbol table. Set offsets for postprocessing sections.
4293 (Layout::create_incremental_info_sections): Call
4294 Incremental_inputs::create_data_sections. Add incremental symtab
4295 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4296 sections to layout after input sections.
4297 * layout.h (struct Timespec): Forward declaration.
4298 (Layout::incremental_inputs): Add const.
4299 (Layout::create_incremental_info_sections): Add parameter.
4300 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4301 * object.cc: Include incremental.h.
4302 (Relobj::finalize_incremental_relocs): New function.
4303 (Sized_relobj::do_layout): Record input sections in incremental info.
4304 * object.h (Object::output_section): New function.
4305 (Object::output_section_offset): Moved from Relobj.
4306 (Object::get_incremental_reloc_base): New function.
4307 (Object::get_incremental_reloc_count): New function.
4308 (Object::do_output_section): New function.
4309 (Object::do_output_section_offset): Moved from Relobj.
4310 (Object::do_get_incremental_reloc_base): New function.
4311 (Object::do_get_incremental_reloc_count): New function.
4312 (Object::Object): Initialize new data members.
4313 (Relobj::output_section): Renamed do_output_section and moved to
4315 (Relobj::output_section_offset): Moved to Object.
4316 (Relobj::do_get_incremental_reloc_base): New function.
4317 (Relobj::do_get_incremental_reloc_count): New function.
4318 (Relobj::allocate_incremental_reloc_counts): New function.
4319 (Relobj::count_incremental_reloc): New function.
4320 (Relobj::finalize_incremental_relocs): New function.
4321 (Relobj::next_incremental_reloc_index): New function.
4322 (Relobj::reloc_counts_): New data member.
4323 (Relobj::reloc_bases_): New data member.
4324 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4325 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4326 (Sized_relobj::incremental_relocs_scan): New function.
4327 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4328 (Sized_relobj::incremental_relocs_write): New function.
4329 (Sized_relobj::incremental_relocs_write_reltype): New function.
4330 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4332 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4333 archives and object files elsewhere.
4334 (Add_symbols::run): Report object files here.
4335 (Finish_group::run): Report end of archive at end of group.
4336 * reloc.cc: Include layout.h, incremental.h.
4337 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4338 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4339 (Sized_relobj::incremental_relocs_scan): New function.
4340 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4341 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4342 (Sized_relobj::incremental_relocs_write): New function.
4343 (Sized_relobj::incremental_relocs_write_reltype): New function.
4344 * script.cc (read_input_script): Rewrite test for incremental link.
4345 Change call to Incremental_inputs::report_script.
4346 * symtab.h (Symbol_table::first_global_index): New function.
4347 (Symbol_table::output_count): New function.
4349 2010-08-12 Doug Kwan <dougkwan@google.com>
4351 * arm.cc (Target_arm::merge_object_attributes): Check command line
4352 options --no-wchar-size-warning and --no-enum-size-warning.
4353 * options.h (General_options): Add ld-compatible options
4354 --no-enum-size-warning and --no-wchar-size-warning.
4356 2010-08-04 Ian Lance Taylor <iant@google.com>
4358 * x86_64.cc (Target_x86_64::Scan::local): Use
4359 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4360 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4361 (Target_x86_64::Scan::global): Likewise.
4362 (Target_x86_64::Relocate::relocate): Likewise.
4363 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4366 2010-08-03 Cary Coutant <ccoutant@google.com>
4368 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4369 to reserve space in merged_strings vector. Keep total input size
4371 (Output_merge_string::do_print_merge_stats): Print total input size.
4372 * merge.h (Output_merge_string): Add input_size_ field.
4373 * stringpool.cc (Stringpool_template::string_length): Move
4374 implementations out of Stringpool_template class and place in
4376 * stringpool.h (string_length): Move out of Stringpool_template.
4378 2010-08-03 Ian Lance Taylor <iant@google.com>
4381 * layout.cc (relaxation_loop_body): If address of load segment is
4382 set, adjust address to include headers if possible.
4384 2010-08-03 Ian Lance Taylor <iant@google.com>
4386 * version.cc (version_string): Bump to 1.10.
4388 2010-08-03 Ian Lance Taylor <iant@google.com>
4391 * layout.h (enum Output_section_order): Define.
4392 (class Layout): Update declarations.
4393 * layout.cc (Layout::get_output_section): Add order parameter.
4394 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4395 is_first_non_relro parameters. Change all callers.
4396 (Layout::choose_output_section): Likewise.
4397 (Layout::add_output_section_data): Likewise.
4398 (Layout::make_output_section): Likewise. Set order.
4399 (Layout::default_section_order): New function.
4400 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4401 * output.cc (Output_section::Output_section): Initialize order_.
4402 Don't initialize deleted fields.
4403 (Output_segment::Output_segment): Don't initialize deleted
4405 (Output_segment::add_output_section_to_load): New function
4406 replacing add_output_section. Change all callers to call this or
4407 add_output_section_to_nonload.
4408 (Output_segment::add_output_section_to_nonload): New function.
4409 (Output_segment::remove_output_section): Rewrite.
4410 (Output_segment::add_initial_output_data): Likewise.
4411 (Output_segment::has_any_data_sections): Likewise.
4412 (Output_segment::is_first_section_relro): Likewise.
4413 (Output_segment::maximum_alignment): Likewise.
4414 (Output_segment::has_dynamic_reloc): New function replacing
4415 dynamic_reloc_count. Change all callers.
4416 (Output_segment::has_dynamic_reloc_list): New function replacing
4417 dynamic_reloc_count_list. Change all callers.
4418 (Output_segment::set_section_addresses): Rewrite.
4419 (Output_segment::set_offset): Rewrite.
4420 (Output_segment::find_first_and_last_list): Remove.
4421 (Output_segment::set_tls_offsets): Rewrite.
4422 (Output_segment::first_section_load_address): Likewise.
4423 (Output_segment::output_section_count): Likewise.
4424 (Output_segment::section_with_lowest_load_address): Likewise.
4425 (Output_segment::write_section_headers): Likewise.
4426 (Output_segment::print_sections_to_map): Likewise.
4427 * output.h (class Output_data): Remove dynamic_reloc_count_
4428 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4429 (Output_data::add_dynamic_reloc): Rewrite.
4430 (Output_data::has_dynamic_reloc): New function.
4431 (Output_data::dynamic_reloc_count): Remove.
4432 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4433 is_last_relro_, is_first_non_relro_, is_interp_,
4434 is_dynamic_linker_section_ fields. Add order and set_order
4435 functions. Remove is_relro_local, set_is_relro_local,
4436 is_last_relro, set_is_last_relro, is_first_non_relro,
4437 set_is_first_non_relro functions, is_interp, set_is_interp,
4438 is_dynamic_linker_section, and set_is_dynamic_linker_section
4440 (class Output_segment): Change Output_data_list from std::list to
4441 std:;vector. Add output_lists_ field. Remove output_data_ and
4442 output_bss_ fields. Update declarations.
4444 2010-08-02 Ian Lance Taylor <iant@google.com>
4446 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4447 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4448 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4450 2010-08-02 Ian Lance Taylor <iant@google.com>
4453 * script.cc (Script_options::Script_options): Initialize
4454 symbol_definitions_ and symbol_references_.
4455 (Script_options::add_symbol_assignment): Update
4456 symbol_definitions_ and symbol_references_.
4457 (Script_options::add_symbol_reference): New function.
4458 (script_symbol): New function.
4459 * script.h (class Script_options): Add symbol_definitions_ and
4460 symbol_references_ fields.
4461 (Script_options::referenced_const_iterator): New type.
4462 (Script_options::referenced_begin): New function.
4463 (Script_options::referenced_end): New function.
4464 (Script_options::is_referenced): New function.
4465 (Script_options::any_unreferenced): New function.
4466 * script-c.h (script_symbol): Declare.
4467 * yyscript.y (exp): Call script_symbol.
4468 * symtab.cc: Include "script.h".
4469 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4470 Change all callers. Check symbols referenced by scripts.
4471 (Symbol_table::add_undefined_symbols_from_command_line): Add
4472 layout parameter. Change all callers.
4473 (Symbol_table::do_add_undefined_symbols_from_command_line):
4474 Likewise. Break out loop body. Check symbols referenced by
4476 (Symbol_table::add_undefined_symbol_from_command_line): New
4477 function broken out of
4478 do_add_undefined_symbols_from_command_line.
4479 * symtab.h (class Symbol_table): Update declarations.
4480 * archive.cc: Include "layout.h".
4481 (Archive::should_include_member): Add layout parameter. Change
4482 all callers. Check for symbol mentioned in expression.
4483 * archive.h (class Archive): Update declaration.
4484 * object.cc (Sized_relobj::do_should_include_member): Add layout
4486 * object.h (Object::should_include_member): Add layout parameter.
4488 (Object::do_should_include_member): Add layout parameter.
4489 (class Sized_relobj): Update declaration.
4490 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4492 * dynobj.h (class Sized_dynobj): Update declaration.
4493 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4495 * plugin.h (class Sized_pluginobj): Update declaration.
4497 2010-08-02 Ian Lance Taylor <iant@google.com>
4500 * output.cc (Output_segment::set_offset): Search for the first and
4501 last sections rather than assuming that the list is in order.
4502 (Output_segment::find_first_and_last_list): New function.
4503 * output.h (class Output_segment): Update declarations.
4504 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4505 (relro_strip_test_SOURCES): New variable.
4506 (relro_strip_test_DEPENDENCIES): New variable.
4507 (relro_strip_test_LDFLAGS): New variable.
4508 (relro_strip_test_LDADD): New variable.
4509 (relro_strip_test.so): New target.
4511 2010-08-02 Ian Lance Taylor <iant@google.com>
4513 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4514 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4515 (Target_i386::got_tlsdesc_section): New function.
4516 (Target_i386::got_section): Create space for GOT entries for
4517 TLSDESC relocations.
4518 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4520 (Target_i386::Scan::global): Likewise.
4521 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4523 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4524 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4525 (Target_x86_64::got_tlsdesc_section): New function.
4526 (Target_x86_64::got_section): Create space for GOT entries for
4527 TLSDESC relocations.
4528 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4530 (Target_x86_64::Scan::global): Likewise.
4531 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4534 2010-08-02 Ian Lance Taylor <iant@google.com>
4536 * testsuite/final_layout.sh: Use dc to convert from hex to
4539 2010-07-29 Sriraman Tallam <tmsriram@google.com>
4541 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4542 paramter to the call to gold::gc_process_relocs.
4543 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4544 paramter to the call to gold::gc_process_relocs.
4545 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4546 parameter to the call to gold::gc_process_relocs.
4547 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4548 template parameter to the call to gold::gc_process_relocs.
4549 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4550 paramter to the call to gold::gc_process_relocs.
4551 * gc.h (get_embedded_addend_size): New function.
4552 (gc_process_relocs): Save the size of the reloc for use by ICF.
4553 * icf.cc (get_section_contents): Get the addend from the text section
4554 for SHT_REL relocation sections.
4555 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4556 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4557 * int_encoding.h (read_from_pointer): New overloaded function.
4558 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4559 * testsuite/icf_sht_rel_addend_test.sh: New file.
4560 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4561 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4563 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4565 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4566 * Makefile.in: Regenerate.
4567 * testsuite/Makefile.in: Regenerate.
4569 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4571 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4572 * gold/testsuite/debug_msg.cc: Likewise.
4573 * gold/testsuite/odr_violation1.cc
4574 * gold/testsuite/odr_violation2.cc
4576 2010-07-21 Cary Coutant <ccoutant@google.com>
4578 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4579 string, and length fields.
4580 (Output_merge_string::Merged_strings_list): New type.
4581 (Output_merge_string::Merged_strings_lists): New typedef.
4582 (Output_merge_string): Replace merged_strings_ with
4583 merged_strings_lists_.
4584 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4585 Merged_strings_list per input object and section. Don't store pointer
4586 to the string. Don't store length with each merged string entry.
4587 (Output_merge_string::finalize_merged_data): Loop over list of merged
4588 strings lists. Recompute length of each merged string.
4590 2010-07-15 Cary Coutant <ccoutant@google.com>
4592 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4595 2010-07-14 Ian Lance Taylor <iant@google.com>
4597 * descriptors.cc (Descriptors::open): Report correct name in error
4600 2010-07-13 Doug Kwan <dougkwan@google.com>
4602 * arm.cc (Arm_input_section::Arm_input_section): For a
4603 SHT_ARM_EXIDX section, always keeps the input sections.
4604 (Arm_input_section::set_exidx_section_link): New method.
4605 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4606 has_errors_ to false.
4607 (Arm_exidx_input_section::has_errors,
4608 Arm_exidx_input_section::set_has_errors): New methods.
4609 (Arm_exidx_input_section::has_errors_): New data member.
4610 (Arm_relobj::get_exidx_shndx_list): New method.
4611 (Arm_output_section::append_text_sections_to_list): Do not skip
4612 section without SHF_EXECINSTR.
4613 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4615 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4616 section header. Make error messages more verbose. Check for
4617 a non-executable section linked to an EXIDX section.
4618 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4619 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4620 check that there is no deferred EXIDX section if we exit early.
4621 Instead of not making an EXIDX section in case of an error, make one
4622 and set the has_errors flag of it.
4623 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4624 in a relocatable link.
4625 (Target_arm::do_relax): Look for the EXIDX output section instead of
4626 assuming that it is called .ARM.exidx.
4627 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4628 section list. Do not check for SHF_EXECINSTR section flags but
4629 skip any input section with errors.
4630 * output.cc (Output_section::Output_section): Initialize
4631 always_keeps_input_sections_ to false.
4632 (Output_section::add_input_section): Check for
4633 always_keeps_input_sections_.
4634 * output.h (Output_section::always_keeps_input_sections,
4635 Output_section::set_always_keeps_input_sections): New methods.
4636 (Output_section::always_keeps_input_sections): New data member.
4638 2010-07-13 Rafael Espindola <espindola@google.com>
4640 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4641 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4643 2010-07-13 Philip Herron <herron.philip@googlemail.com>
4644 Ian Lance Taylor <iant@google.com>
4646 * output.h (Output_section_lookup_maps::add_merge_section):
4647 Correct check of whether value was inserted.
4648 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4649 (Output_section_lookup_maps::add_relaxed_input_section):
4651 * arm.cc (Target_arm::got_section): Remove used local os.
4652 * i386.cc (Target_i386::got_section): Likewise.
4653 * x86_64.cc (Target_x86_64::got_section): Likewise.
4654 * sparc.cc (Target_sparc::got_section): Likewise.
4655 (Target_sparc::relocate): Remove unused local have_got_offset.
4656 * powerpc.cc (Target_powerpc::relocate): Likewise.
4658 2010-07-13 Ian Lance Taylor <iant@google.com>
4660 * compressed_output.cc (zlib_decompress): Fix signature in
4663 * archive.cc (Archive::include_member): Unlock an external member
4664 of a thin archive. Don't bother to delete an object we know is
4667 2010-07-12 Cary Coutant <ccoutant@google.com>
4669 * compressed_output.cc (zlib_decompress): New function.
4670 (get_uncompressed_size): New function.
4671 (decompress_input_section): New function.
4672 * compressed_output.h (get_uncompressed_size): New function.
4673 (decompress_input_section): New function.
4674 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4675 Handle compressed debug sections.
4676 * layout.cc (is_compressed_debug_section): New function.
4677 (Layout::output_section_name): Map compressed section names to
4679 * layout.h (is_compressed_debug_section): New function.
4680 (is_debug_info_section): Recognize compressed debug sections.
4681 * merge.cc: Include compressed_output.h.
4682 (Output_merge_data::do_add_input_section): Handle compressed
4684 (Output_merge_string::do_add_input_section): Handle compressed
4686 * object.cc: Include compressed_output.h.
4687 (Sized_relobj::Sized_relobj): Initialize new data members.
4688 (build_compressed_section_map): New function.
4689 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4690 * object.h (Object::section_is_compressed): New method.
4691 (Object::do_section_is_compressed): New method.
4692 (Sized_relobj::Compressed_section_map): New type.
4693 (Sized_relobj::do_section_is_compressed): New method.
4694 (Sized_relobj::compressed_sections_): New data member.
4695 * output.cc (Output_section::add_input_section): Handle compressed
4697 * reloc.cc: Include compressed_output.h.
4698 (Sized_relobj::write_sections): Handle compressed debug sections.
4700 2010-07-08 Cary Coutant <ccoutant@google.com>
4702 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4703 weak when resolving to a dynamic def.
4704 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4705 for weak undef/dynamic def cases. Adjust callers.
4706 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4707 undef_binding_weak_.
4708 (Symbol_table::sized_write_globals): Adjust symbol binding.
4709 (Symbol_table::sized_write_symbol): Add binding parameter.
4710 * symtab.h (Symbol::set_undef_binding): New method.
4711 (Symbol::is_undef_binding_weak): New method.
4712 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4713 (Symbol_table::should_override): Add new parameter.
4714 (Symbol_table::sized_write_symbol): Add new parameter.
4716 * testsuite/weak_undef_file1.cc: Add new test case.
4717 * testsuite/weak_undef_file2.cc: Fix header comment.
4718 * testsuite/weak_undef_test.cc: Add new test case.
4720 2010-06-29 Doug Kwan <dougkwan@google.com>
4722 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4723 Initialize USE_SYMBOL_.
4724 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4726 (Arm_reloc_property::uses_symbol_): New data member declaration.
4727 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4728 uses symbol value and symbol is undefined but not weakly undefined.
4730 2010-06-28 Rafael Espindola <espindola@google.com>
4732 * plugin.cc (Plugin::load): Use dlerror.
4734 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4736 * symtab.cc (detect_odr_violations): When reporting an ODR
4737 violation, report an object where the symbol is defined.
4739 2010-06-25 Doug Kwan <dougkwan@google.com>
4741 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4742 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4744 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4745 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4746 target hook to detect function points.
4747 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4748 * icf.h (Icf::check_section_for_function_pointers): Change type of
4749 parameter SECTION_NAME to const reference to std::string. Use
4750 target hook to determine if section may have unsafe pointers.
4751 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4754 2010-06-21 Rafael Espindola <espindola@google.com>
4756 * fileread.cc (Input_file::find_fie): New
4757 (Input_file::open): Use Input_file::find_fie.
4758 * fileread.h (Input_file::find_fie): New
4759 * plugin.cc (set_extra_library_path): New.
4760 (Plugin::load): Add set_extra_library_path to the transfer vector.
4761 (Plugin_manager::set_extra_library_path): New.
4762 (Plugin_manager::add_input_file): Use the extra search path if set.
4763 (set_extra_library_path(): New.
4764 * plugin.h (Plugin_manager): Add set_extra_library_path and
4767 2010-06-19 Cary Coutant <ccoutant@google.com>
4769 * layout.cc (gdb_sections): Add .debug_types.
4770 (lines_only_debug_sections): Likewise.
4772 2010-06-18 Rafael Espindola <espindola@google.com>
4774 * plugin.cc (add_input_file,add_input_library)
4775 (Plugin_manager::add_input_file): Make filename arguments const.
4776 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4779 2010-06-16 Doug Kwan <dougkwan@google.com>
4781 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4782 .ARM.attributes section if we have not merged any input
4783 attributes sections.
4785 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4787 * arm.cc: Allow combining objects with no EABI version
4790 2010-06-15 Rafael Espindola <espindola@google.com>
4792 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4794 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4796 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4797 (struct iovec): Correct !HAVE_READV definition.
4799 2010-06-10 Cary Coutant <ccoutant@google.com>
4801 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4802 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4804 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4807 * symtab.h (Symbol::is_placeholder): New member function.
4808 * target-reloc.h (relocate_section): Check for placeholder symbols.
4810 * testsuite/Makefile.am (plugin_test_8): New test.
4811 (plugin_test_9): New test.
4812 * testsuite/Makefile.in: Regenerate.
4814 2010-06-09 Nick Clifton <nickc@redhat.com>
4816 * yyscript.y (input_list_element): Allow strings prefixed with
4817 the '-' character. Treat these as libraries.
4818 * script.cc (script_add_library): New function. Adds a library
4819 specified by "-l<name>" found in an input script.
4820 * script-c.h: Add prototype for script_add_library.
4822 2010-06-07 Doug Kwan <dougkwan@google.com>
4824 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4825 Restrict stub-group size to be within long conditional branch
4826 range when working around cortex-A8 erratum.
4828 2010-06-07 Damien Diederen <dd@crosstwine.com>
4830 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4833 2010-06-03 Sriraman Tallam <tmsriram@google.com>
4837 (Output_section::Input_section_sort_entry::compare_section_ordering):
4838 Change to return non-zero correctly.
4839 (Output_section::Input_section_sort_section_order_index_compare
4840 ::operator()): Change to fix ambiguity in comparisons.
4842 2010-06-01 Sriraman Tallam <tmsriram@google.com>
4844 * gold.h (is_wildcard_string): New function.
4845 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4846 (Layout::layout_eh_frame): Ditto.
4847 (Layout::find_section_order_index): New method.
4848 (Layout::read_layout_from_file): New method.
4849 * layout.h (Layout::find_section_order_index): New method.
4850 (Layout::read_layout_from_file): New method.
4851 (Layout::input_section_position_): New private member.
4852 (Layout::input_section_glob_): New private member.
4853 * main.cc (main): Call read_layout_from_file here.
4854 * options.h (--section-ordering-file): New option.
4855 * output.cc (Output_section::input_section_order_specified_): New
4857 (Output_section::Output_section): Initialize new member.
4858 (Output_section::add_input_section): Add new parameter.
4859 Keep input sections when --section-ordering-file is used.
4860 (Output_section::set_final_data_size): Sort input sections when
4861 section ordering file is specified.
4862 (Output_section::Input_section_sort_entry): Add new parameter.
4864 (Output_section::Input_section_sort_entry::compare_section_ordering):
4866 (Output_section::Input_section_sort_compare::operator()): Change to
4867 consider section_order_index.
4868 (Output_section::Input_section_sort_init_fini_compare::operator()):
4869 Change to consider section_order_index.
4870 (Output_section::Input_section_sort_section_order_index_compare
4871 ::operator()): New method.
4872 (Output_section::sort_attached_input_sections): Change to sort
4873 according to section order when specified.
4874 (Output_section::add_input_section<32, true>): Add new parameter.
4875 (Output_section::add_input_section<64, true>): Add new parameter.
4876 (Output_section::add_input_section<32, false>): Add new parameter.
4877 (Output_section::add_input_section<64, false>): Add new parameter.
4878 * output.h (Output_section::add_input_section): Add new parameter.
4879 (Output_section::input_section_order_specified): New
4881 (Output_section::set_input_section_order_specified): New method.
4882 (Input_section::Input_section): Initialize section_order_index_.
4883 (Input_section::section_order_index): New method.
4884 (Input_section::set_section_order_index): New method.
4885 (Input_section::section_order_index_): New member.
4886 (Input_section::Input_section_sort_section_order_index_compare): New
4888 (Output_section::input_section_order_specified_): New member.
4889 * script-sections.cc (is_wildcard_string): Delete and move modified
4891 (Output_section_element_input::Output_section_element_input): Modify
4892 call to is_wildcard_string.
4893 (Output_section_element_input::Input_section_pattern
4894 ::Input_section_pattern): Ditto.
4895 (Output_section_element_input::Output_section_element_input): Ditto.
4896 * testsuite/Makefile.am (final_layout): New test case.
4897 * testsuite/Makefile.in: Regenerate.
4898 * testsuite/final_layout.cc: New file.
4899 * testsuite/final_layout.sh: New file.
4901 2010-06-01 Rafael Espindola <espindola@google.com>
4903 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4905 2010-06-01 Rafael Espindola <espindola@google.com>
4907 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4908 visibility of symbols.
4910 2010-05-27 Doug Kwan <dougkwan@google.com>
4912 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4913 from start of output section instead of address for a local symbol
4914 in a merged or relaxed section when doing a relocatable link.
4916 2010-05-26 Rafael Espindola <espindola@google.com>
4919 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4920 adding sections the garbage collector removed.
4921 * gold/testsuite/Makefile.am: Add test.
4922 * gold/testsuite/Makefile.in: Regenerate.
4923 * gold/testsuite/plugin_test_7.sh: New.
4924 * gold/testsuite/plugin_test_7_1.c: New.
4925 * gold/testsuite/plugin_test_7_2.c: New.
4927 2010-05-26 Rafael Espindola <espindola@google.com>
4929 * script-sections.cc (Output_section_definition::set_section_addresses):
4930 Check for --section-start.
4932 2010-05-26 Doug Kwan <dougkwan@google.com>
4934 * arm.cc (Arm_scan_relocatable_relocs): New class.
4935 (Target_arm::relocate_special_relocatable): New method.
4936 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4937 (Arm_relocate_functions::thumb_branch_common): Same.
4938 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4939 instead of Default_scan_relocatable_relocs.
4940 * target-reloc.h (relocate_for_relocatable): Let target handle
4941 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4942 * target.h (Sized_target::relocate_special_relocatable): New method.
4944 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4946 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4948 2010-05-23 Doug Kwan <dougkwan@google.com>
4950 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4952 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4953 with a direct branch, not a conditional branch, to a stub.
4954 * merge.cc (Output_merge_base::record_input_section): New method
4956 (Output_merge_data::do_add_input_section): Record input section if
4957 keeps-input-sections flag is set.
4958 (Output_merge_string::do_add_input_section): Ditto.
4959 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4960 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4962 (Output_merge_base::keeps_input_sections,
4963 Output_merge_base::set_keeps_input_sections,
4964 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4966 (Output_merge_base::Input_sections): New type declaration.
4967 (Output_merge_base::input_sections_begin,
4968 Output_merge_base::input_sections_end,
4969 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4970 (Output_merge_base::bool keeps_input_sections_,
4971 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4972 Output_merge_base::input_sections_): New data members.
4973 (Output_merge_data::do_set_keeps_input_sections): New method
4975 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4976 * output.cc (Output_section::Input_section::relobj): Move method
4977 defintion from class declaration to here and handle merge sections.
4978 (Output_section::Input_section::shndx): Ditto.
4979 (Output_section::Output_section): Remove initializations of removed
4980 data members and initialize new data member LOOKUP_MAPS_.
4981 (Output_section::add_input_section): Set keeps-input-sections flag
4982 for a newly created merge output section as appropriate. Adjust code
4983 to use Output_section_lookup_maps class.
4984 (Output_section::add_relaxed_input_section): Adjst code for lookup
4985 maps code refactoring.
4986 (Output_section::add_merge_input_section): Add a new parameter
4987 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4988 class. If adding input section to a newly created merge output
4989 section fails, remove the new merge section.
4990 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
4991 Adjust code for use of the Output_section_lookup_maps class.
4992 (Output_section::find_merge_section): Ditto.
4993 (Output_section::build_lookup_maps): New method defintion.
4994 (Output_section::find_relaxed_input_section): Adjust code to use
4995 Output_section_lookup_maps class.
4996 (Output_section::get_input_sections): Export merge sections. Adjust
4997 code to use Output_section_lookup_maps class.
4998 (Output_section:::add_script_input_section): Adjust code to use
4999 Output_section_lookup_maps class. Update lookup maps for merge
5001 (Output_section::discard_states): Use Output_section_lookup_maps.
5002 (Output_section::restore_states): Same.
5003 * output.h (Merge_section_properties): Move class defintion out of
5005 (Output_section_lookup_maps): New class.
5006 (Output_section::Input_section::is_merge_section): New method
5008 (Output_section::Input_section::relobj): Move defintion out of class
5009 defintion. Declare method only.
5010 (Output_section::Input_section::shndx): Ditto.
5011 (Output_section::Input_section::output_merge_base): New method defintion.
5012 (Output_section::Input_section::u2_.pomb): New union field.
5013 (Output_section::Merge_section_by_properties_map,
5014 Output_section::Output_section_data_by_input_section_map,
5015 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5017 (Output_section::add_merge_input_section): Add new parameter
5018 KEEPS_INPUT_SECTIONS.
5019 (Output_section::build_lookup_maps): New method declaration.
5020 (Output_section::merge_section_map_,
5021 Output_section::merge_section_by_properties_map_,
5022 Output_section::relaxed_input_section_map_,
5023 Output_section::is_relaxed_input_section_map_valid_): Remove data
5025 (Output_section::lookup_maps_): New data member.
5027 2010-05-21 Doug Kwan <dougkwan@google.com>
5030 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5031 avoid a compilation error.
5033 2010-05-19 Rafael Espindola <espindola@google.com>
5035 * script-sections.cc (Output_section_definition::allocate_to_segment):
5036 Update the phdrs_list even when the output section is NULL.
5037 * testsuite/Makefile.am: Add test.
5038 * testsuite/Makefile.in: Regenerate.
5039 * testsuite/script_test_9.cc: New.
5040 * testsuite/script_test_9.sh: New.
5041 * testsuite/script_test_9.t: New.
5043 2010-05-19 Doug Kwan <dougkwan@google.com>
5045 * arm.cc (Arm_input_section::original_size): New method.
5046 (Arm_input_section::do_addralign): Add a cast.
5047 (Arm_input_section::do_output_offset): Remove static cast.
5048 (Arm_input_section::original_addralign,
5049 Arm_input_section::original_size_): Change type to uint32_t.
5050 (Arm_input_section::init): Add safe casts for section alignment
5052 (Arm_input_section::set_final_data_size): Do not set address and
5053 offset of stub table.
5054 (Arm_output_section::fix_exidx_coverage): Change use of of
5055 Output_section::Simple_input_section to that of
5056 Output_section::Input_section.
5057 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5058 except for the first pass.
5059 * output.cc (Output_section::get_input_sections): Change type of
5060 input_sections to std::list<Input_section>.
5061 (Output_section::add_script_input_section): Rename from
5062 Output_section::add_simple_input_section. Change type of SIS
5063 parameter from Simple_input_section to Input_section.
5064 * output.h (Output_section::Simple_input_section): Remove class.
5065 (Output_section::Input_section): Change class visibility to public.
5066 (Output_section::Input_section::addralign): Use stored alignments
5067 for special input sections if set.
5068 (Output_section::Input_section::set_addralign): New method.
5069 (Output_section::get_input_sections): Change parameter type from
5070 list of Simple_input_section to list of Input_section.
5071 (Output_section::add_script_input_section): Rename from
5072 Output_section::add_simple_input_section. Change first parameter's
5073 type from Simple_input_section to Input_section and remove the
5074 second and third parameters.
5075 * script-sections.cc (Input_section::Input_section_list): Change
5076 type to list of Output_section::Input_section/
5077 (Input_section_info::Input_section_info): Change parameter type of
5078 INPUT_SECTION to Output_section::Input_section.
5079 (Input_section_info::input_section): Change return type.
5080 (Input_section_info::input_section_): Change type to
5081 Output_section::Input_section.
5082 (Output_section_element_input::set_section_addresses): Adjust code
5083 to use Output_section::Input_section instead of
5084 Output_section::Simple_input_section. Adjust code for renaming
5085 of Output_section::add_simple_input_section.
5086 (Orphan_output_section::set_section_addresses): Ditto.
5088 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5090 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5091 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5093 2010-05-18 Rafael Espindola <espindola@google.com>
5095 * options.cc (General_options::finalize): Handle -nostdlib.
5096 * options.h (nostdlib): New option.
5097 * script.cc (script_add_search_dir): Handle -nostdlib.
5099 2010-05-12 Doug Kwan <dougkwan@google.com>
5101 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5102 attributes section only if there no attributes section after merging.
5103 (Target_arm::merge_object_attributes): Move value of
5104 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5105 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5106 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5107 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5108 and arm_attr_merge_7.stdout.
5109 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5110 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5111 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5112 arm_attr_merge_7b.o): New rules.
5113 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5115 * testsuite/Makefile.in: Regenerate.
5116 * testsuite/arm_attr_merge.sh: New file.
5117 * testsuite/arm_attr_merge_[67][ab].s: Same.
5119 2010-05-05 Nick Clifton <nickc@redhat.com>
5121 * po/es.po: Updated Spanish translation.
5123 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5125 * Makefile.am (install-exec-local): Properly install gold as
5126 default cross linker.
5127 * Makefile.in: Regenerated.
5129 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5130 Nick Clifton <nickc@redhat.com>
5132 * configure.ac (install_as_default): Define and set to false
5133 unless --enable-gold or --enable-gold=both/gold has been
5135 * configure: Regenerate.
5137 * Makefile.am (install-exec-local): Install the executable as
5138 'ld.gold'. If install_as_default is true then also install it as
5140 * Makefile.in: Regenerated.
5142 2010-04-24 Ian Lance Taylor <iant@google.com>
5144 * layout.cc (Layout::layout_reloc): In relocatable link don't
5145 combine reloc sections for grouped sections.
5147 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5149 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5150 sections that are not ordinary to icf.
5151 * icf.cc (get_section_contents): Handle relocation pointing to section
5152 with no object or shndx information.
5153 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5154 * testsuite/Makefile.in: Regenerate.
5155 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5156 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5158 2010-04-22 Ian Lance Taylor <iant@google.com>
5160 * expression.cc (Expression::Expression_eval_info): Add
5161 result_alignment_pointer field.
5162 (Expression::eval_with_dot): Add result_alignment_pointer
5163 parameter. Change all callers.
5164 (Expression::eval_maybe_dot): Likewise.
5165 (class Binary_expression): Add alignment_pointer parameter to
5166 left_value and right_value. Change all callers.
5167 (BINARY_EXPRESSION): Set result alignment.
5168 (class Trinary_expression): Add alignment_pointer parameter to
5169 arg2_value and arg3_value. Change all callers.
5170 (Trinary_cond::value): Set result alignment.
5171 (Max_expression::value, Min_expression::value): Likewise.
5172 (Align_expression::value): Likewise.
5173 * script-sections.cc (class Sections_element): Add dot_alignment
5174 parameter to set_section_addresses virtual function. Update
5176 (class Output_section_element): Likewise.
5177 (Script_sections::create_segments): Add dot_alignment parameter.
5179 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5180 (Script_sections::set_phdrs_clause_addresses): Likewise.
5181 * script-sections.h: Update declarations.
5182 * script.h: Update declarations.
5183 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5185 * testsuite/script_test_3.t: Set large alignment.
5186 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5187 segment has expected alignment.
5189 2010-04-22 Nick Clifton <nickc@redhat.com>
5191 * po/gold.pot: Updated by the Translation project.
5192 * po/vi.po: Updated Vietnamese translation.
5194 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5196 * testsuite/Makefile.am (check_PROGRAMS): Add
5197 icf_virtual_function_folding_test.
5198 * testsuite/Makefile.in: Regenerated.
5200 2010-04-15 Andrew Haley <aph@redhat.com>
5202 * options.h (merge_exidx_entries): New option.
5203 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5204 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5205 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5206 (Target_arm::merge_exidx_entries): New function.
5207 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5208 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5209 to Arm_exidx_fixup constructor.
5210 Add new arg, merge_exidx_entries.
5211 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5212 Arm_output_section::fix_exidx_coverage.
5214 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5216 * icf.cc (get_section_contents): Check for preemptible functions.
5217 Ignore addend when appropriate.
5218 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5220 (add_from_relobj): Check for section folded.
5221 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5222 * symtab.h (should_add_dynsym_entry): Add new parameter.
5223 * target-reloc.h (scan_relocs): Check for section folded.
5224 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5225 Check reloc types for function pointers in shared objects.
5226 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5228 (icf_preemptible_functions_test): New test case.
5229 (icf_string_merge_test): New test case.
5230 * testsuite.Makefile.in: Regenerate.
5231 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5232 bar_glob. Refactor code.
5233 * testsuite/icf_preemptible_functions_test.cc: New file.
5234 * testsuite/icf_preemptible_functions_test.sh: New file.
5235 * testsuite/icf_string_merge_test.cc: New file.
5236 * testsuite/icf_string_merge_test.sh: New file.
5237 * testsuite/icf_virtual_function_folding_test.cc: New file.
5238 * testsuite/icf_virtual_function_folding_test.sh: New file.
5240 2010-04-14 Doug Kwan <dougkwan@google.com>
5242 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5243 for local symbol recounting if we remove a section due to ICF.
5244 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5245 there are no regular objects in input.
5247 2010-04-13 Doug Kwan <dougkwan@google.com>
5249 * arm.cc (Arm_input_section::set_final_data_size): Compute
5250 accurate final data size instead of using current data size.
5252 2010-04-09 Doug Kwan <dougkwan@google.com>
5254 * layout.cc (Layout::choose_output_section): Handle script section
5256 (Layout::make_output_section_for_script): Add section type parameter.
5257 Handle script section types.
5258 * layout.h (Layout::make_output_section_for_script): Add section
5260 * output.cc (Output_section::Output_section): Initialize data member
5262 (Output_section::do_reset_address_and_file_offset): Do not set address
5263 to 0 if section is a NOLOAD section.
5264 * output.h (Output_section::is_noload): New method.
5265 (Output_section::set_is_noload): Ditto.
5266 (Output_section::is_noload_): New data member.
5267 * script-c.h (Script_section_type): New enum type.
5268 (struct Parser_output_section_header): Add new file section_type.
5269 * script-sections.cc (Sections_element::output_section_name): Add
5270 parameter for returning script section type.
5271 (Output_section_definition::output_section_name): Ditto.
5272 (Output_section_definition::section_type)P; New method.
5273 (Output_section_definiton::script_section_type_name): Ditto.
5274 (Output_section_definition::script_section_type_): New data member.
5275 (Output_section_definition::Output_section_definition): Initialize
5276 data member Output_section_definition::script_section_type_.
5277 (Output_section_definition::create_sections): Pass script section type
5278 to Layout::make_output_section_for_script.
5279 (Output_section_definition::output_section_name): Return script
5280 section type to caller.
5281 (Output_section_definition::set_section_address): Do not advance
5282 dot value and load address if section type is NOLOAD. Set address
5283 of NOLOAD sections regardless of section flags.
5284 (Output_section_definition::print): Print section type if it is
5285 not SCRIPT_SECTION_TYPE_NONE.
5286 (Output_section_definition::section_type): New method.
5287 (Output_section_definition::script_section_type_name): Ditto.
5288 (Script_sections::output_section_name): Add new parameter
5289 PSECTION_TYPE for returning script section type. Pass it to
5290 section elements. Handle discard sections.
5291 (Sort_output_sections::operator()): Handle NOLOAD sections.
5292 * script-sections.h (Script_sections::Section_type): New enum type.
5293 (Script_sections::output_section_name): Add a new parameter for
5294 returning script section type.
5295 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5297 * yyscript.y (union): Add new field SECTION_TYPE.
5298 (COPY, DSECT, INFO, NOLOAD): New tokens.
5299 (opt_address_and_section_type): Change type to output_section_header.
5300 (section_type): New non-terminal
5301 (section_header): Handle section type.
5302 (opt_address_and_section_type): Return section type value.
5304 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5306 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5307 * testsuite/plugin_common_test_2.c (foo): Likewise.
5309 2010-04-08 Doug Kwan <dougkwan@google.com>
5311 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5313 * output.cc (Output_section::add_merge_input_section): Simplify
5314 code and return status of Output_merge_base::add_input_section.
5315 Update merge section map only if Output_merge_base::add_input_section
5318 2010-04-07 Doug Kwan <dougkwan@google.com>
5320 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5321 if section is marked as containing instructions but has no mapping
5323 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5324 correct section index.
5325 (Arm_relobj::find_linked_text_section): Ditto.
5327 2010-04-07 Cary Coutant <ccoutant@google.com>
5329 * archive.cc (include_member): Destroy Read_symbols_data object before
5331 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5332 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5333 (Read_symbols_data::~Read_symbols_data) New destructor.
5334 (Section_relocs::Section_relocs) New constructor.
5335 (Section_relocs::~Section_relocs) New destructor.
5336 (Read_relocs_data::Read_relocs_data) New constructor.
5337 (Read_relocs_data::~Read_relocs_data) New destructor.
5338 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5339 pointers to NULL after deleting.
5341 2010-04-07 Doug Kwan <dougkwan@google.com>
5343 * arm.cc: Replace "endianity" with "endianness" in comments.
5344 (Arm_exidx_cantunwind): Ditto.
5345 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5346 (Arm_relobj::merge_flags_and_attributes): New method.
5347 (Arm_relobj::merge_flags_and_attributes_): New data member.
5348 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5349 (Arm_relobj::scan_sections_for_stubs): Ditto.
5350 (Arm_relobj::do_read_symbols): Check to see if we really want to
5351 merge processor-specific flags and attributes. Exit early if
5352 an object is empty except for section names and the undefined symbol.
5353 (Target_arm::do_finalize_sections): Move check for ELF format to
5354 Arm_relobj::do_read_symbols. Merge processor specific flags and
5355 attributes from a regular object only when we have determined that
5356 it is aapropriate. Do not create an .ARM.attributes section in
5357 output if there is no regular input object.
5358 (Target_arm::merge_processor_specific_flags): Check
5359 --warn-mismatch before printing any error.
5360 (Target_arm::merge_object_attributes): Ditto.
5361 * gold.cc (queue_middle_tasks): Handle the case in which there is
5362 no regular object in input.
5363 * options.cc (General_options::parse_EB): New method.
5364 (General_options::parse_EL): Same.
5365 (General_options::General_options): Initialize endianness_.
5366 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5368 (General_options::Endianness): New enum.
5369 (General_options::endianness): New method.
5370 (General_options::endianness_): New data member.
5371 * parameters.cc (Parameters::set_options): Check target endianness.
5372 (Parameters::set_target_once): Ditto.
5373 (Parameters::check_target_endianness): New method.
5374 (parameters_force_valid_target): If either -EL or -EB is specified,
5375 use it to define endianness of default target.
5376 * parameters.h (Parameters::check_target_endianness): New method
5378 * target.h (class Target): Change "endianity" to "endianness"
5381 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5383 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5384 * configure: Regenerate.
5385 * Makefile.in: Regenerate.
5386 * testsuite/Makefile.in: Regenerate.
5388 2010-04-06 Cary Coutant <ccoutant@google.com>
5391 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5392 prevailing definitions of common symbols.
5393 * testsuite/plugin_test_6.sh: New test case.
5394 * testsuite/plugin_common_test_1.c: New test case.
5395 * testsuite/plugin_common_test_2.c: New test case.
5396 * testsuite/Makefile.am (plugin_test_6): New test case.
5397 * testsuite/Makefile.in: Regenerate.
5399 2010-04-06 Nick Clifton <nickc@redhat.com>
5401 * po/vi.po: New Vietnamese translation.
5403 2010-03-30 Doug Kwan <dougkwan@google.com>
5405 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5407 2010-03-25 Doug Kwan <dougkwan@google.com>
5409 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5410 to avoid a conversion warning on a 32-bit host.
5412 2010-03-24 Ian Lance Taylor <iant@google.com>
5414 * testsuite/script_test_3.t: Add a TLS segment.
5415 * testsuite/Makefile.am (check_PROGRAMS): Add
5416 tls_phdrs_script_test.
5417 (tls_phdrs_script_test_SOURCES): Define.
5418 (tls_phdrs_script_test_DEPENDENCIES): Define.
5419 (tls_phdrs_script_test_LDFLAGS): Define.
5420 (tls_phdrs_script_test_LDADD): Define.
5421 * testsuite/Makefile.in: Rebuild.
5423 2010-03-23 Cary Coutant <ccoutant@google.com>
5425 * fileread.cc (find_or_make_view): Fix comment.
5427 2010-03-23 Ian Lance Taylor <iant@google.com>
5429 * script-sections.cc (class Orphan_section_placement): Define
5430 PLACE_TLS and PLACE_TLS_BSS.
5431 (Orphan_section_placement::Orphan_section_placement): Initialize
5433 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5434 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5435 (tls_script_test_SOURCES): Define.
5436 (tls_script_test_DEPENDENCIES): Define.
5437 (tls_script_test_LDFLAGS): Define.
5438 (tls_script_test_LDADD): Define.
5439 * testsuite/Makefile.in: Rebuild.
5441 2010-03-22 Doug Kwan <dougkwan@google.com>
5443 * arm.cc (Arm_relocate_functions::abs8,
5444 Arm_relocate_functions::abs16): Use correct check for overflow
5445 specified in the ARM ELF specs.
5446 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5447 target of a BLX instruction specially.
5448 (Reloc_stub::stub_type_for_reloc): Ditto.
5449 (Relocate::relocate): Use symbolic names instead of numeric relocation
5450 codes to report error.
5451 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5453 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5454 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5455 thumb2_blx_out_of_range.stdout
5456 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5457 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5458 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5459 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5460 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5461 thumb2_blx_in_range, thumb2_blx_in_range.o,
5462 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5463 thumb2_blx_out_of_range.o): New rules.
5464 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5465 thumb2_blx_in_range and thumb2_blx_out_of_range.
5466 * testsuite/Makefile.in: Regenerate.
5467 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5468 * testsuite/thumb_blx_in_range.s: New file.
5469 * testsuite/thumb_blx_out_of_range.s: New file.
5471 2010-03-22 Rafael Espindola <espindola@google.com>
5473 * archive.cc (Should_include): Move to archive.h.
5474 (should_include_member): Make it a member of Archive.
5476 (Add_lib_group_symbols): New.
5477 * archive.h: Include options.h.
5478 (Archive_member): Moved from Archive.
5479 (Should_include): Moved from archive.cc.
5481 (Add_lib_group_symbols): New.
5482 * dynobj.cc (do_should_include_member): New.
5483 * dynobj.h (do_should_include_member): New.
5484 * gold.cc (queue_initial_tasks): Update call to queue.
5485 * main.cc (main): Print lib group stats.
5486 * object.cc (do_should_include_member): New.
5487 * object.h: Include archive.h.
5488 (Object::should_include_member): New.
5489 (Object::do_should_include_member): New.
5490 (Sized_relobj::do_should_include_member): New.
5491 * options.cc (General_options::parse_start_lib): New.
5492 (General_options::parse_end_lib): New.
5493 (Input_arguments::add_file): Handle lib groups.
5494 (Input_arguments::start_group): Check we are not in a lib.
5495 (Input_arguments::start_lib): New.
5496 (Input_arguments::end_lib): New.
5497 * options.h (General_options): Add start_lib and end_lib.
5498 (Input_argument::lib_): New.
5499 (Input_argument::lib): New.
5500 (Input_argument::is_lib): New.
5501 (Input_file_lib): New.
5502 (Input_arguments::in_lib_): New.
5503 (Input_arguments::in_lib): New.
5504 (Input_arguments::start_lib): New.
5505 (Input_arguments::end_lib_): New.
5506 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5507 in unused members as preempted.
5508 (Sized_pluginobj::do_should_include_member): New.
5509 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5510 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5512 (Read_symbols::do_whole_lib_group): New.
5513 (Read_symbols::do_lib_group): New.
5514 (Read_symbols::do_read_symbols): Handle lib groups.
5515 (Read_symbols::get_name): Handle lib groups.
5516 * readsyms.h (Read_symbols): Add an archive member pointer.
5517 (Read_symbols::do_whole_lib_group): New.
5518 (Read_symbols::do_lib_group): New.
5519 (Read_symbols::member_): New.
5520 * script.cc (read_input_script): Update call to queue_soon.
5522 2010-03-19 Doug Kwan <dougkwan@google.com>
5524 * arm.cc (Stub_table::Stub_table): Initialize new data members
5525 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5526 (Stub_table::add_reloc_stub): Assign stub offset and update
5527 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5528 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5530 (Stub_table::update_data_size_and_addralign): Use
5531 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5532 instead of going over all reloc stubs.
5533 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5534 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5535 Stringpool_template::offset_ to size of Stringpool_char.
5536 (Stringpool_template::new_key_offset): Remove code to initialize
5537 Stringpool_template::offset_.
5538 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5539 Stringpool_template::offset_ to zero.
5541 2010-03-15 Doug Kwan <dougkwan@google.com>
5543 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5545 (Stringpool_template::new_key_offset): New method.
5546 (Stringpool_template::add_string): Assign offsets when adding new
5548 (Stringpool_template::set_string_offsets): Do not set string offsets
5549 when not optimizing.
5550 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5552 (Chunked_vector::clear): Clear size_.
5553 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5554 (Chunked_vector::size): Return size_.
5555 (Chunked_vector::push_back): Use size_ to find insert position.
5556 (Chunked_vector::size_): New data member.
5557 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5558 (Stringpool_template::new_key_offset): New method declaration.
5559 (Stringpool_template::offset_): New data member.
5561 2010-03-15 Rafael Espindola <espindola@google.com>
5563 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5564 Add_symbols' constructor.
5565 * readsyms.h (Add_symbols): Remove the input_group member.
5567 2010-03-10 Ian Lance Taylor <iant@google.com>
5569 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5570 target to ask whether a reference to a symbol requires a stack
5572 * target.h (Target::is_call_to_non_split): New function.
5573 (Target::do_is_call_to_non_split): Declare virtual function.
5574 * target.cc: Include "symtab.h".
5575 (Target::do_is_call_to_non_split): New function.
5576 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5578 2010-03-10 Cary Coutant <ccoutant@google.com>
5580 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5581 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5582 (File_read::open[2]): Add whole_file_view_ to list of views.
5583 (File_read::make_view): Remove test of whole_file_view_.
5584 (File_read::find_or_make_view): Create whole_file_view_ if
5586 (File_read::clear_views): Replace bool parameter with enum;
5587 adjust all callers. Don't delete views with permanent data;
5588 do delete cached views and views from archives if
5589 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5590 if clearing the corresponding view.
5591 * fileread.h (File_read::Clear_views_mode): New enum.
5592 (File_read::View::is_permanent_view): New method.
5593 (File_read::clear_views): Replace bool parameter
5594 with enum; adjust all callers.
5595 * options.h (General_options): Change keep_files_mapped option;
5596 add map_whole_files.
5597 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5599 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5602 2010-03-10 David S. Miller <davem@davemloft.net>
5604 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5606 2010-03-09 Sriraman Tallam <tmsriram@google.com>
5608 * icf.cc (get_section_contents): Add '@' marker after processing the
5611 2010-03-08 Doug Kwan <dougkwan@google.com>
5613 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5614 due to a conversion warning.
5615 (Arm_relobj::update_output_local_symbol_count): Check for local
5616 symbol with unset output index.
5618 2010-03-05 Ian Lance Taylor <iant@google.com>
5620 * options.h (class General_options): Add --spare-dynamic-tags.
5621 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5622 --spare-dynamic-tags.
5624 2010-03-05 Ian Lance Taylor <iant@google.com>
5626 * incremental.cc: Include "libiberty.h".
5628 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5630 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5631 function, is_info_ member.
5632 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5633 (Versions::Versions): Update caller.
5634 (Versions::define_base_version): Likewise.
5635 (Versions::add_def): Likewise.
5637 2010-03-03 Sriraman Tallam <tmsriram@google.com>
5639 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5640 (Scan::possible_function_pointer_reloc): New function.
5641 (Scan::local_reloc_may_be_function_pointer): Change to call
5642 possible_function_pointer_reloc.
5643 (Scan::global_reloc_may_be_function_pointer): Ditto.
5644 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5645 relocations in ".data.rel.ro._ZTV" section.
5646 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5647 * testsuite/icf_safe_so_test.cc: Ditto.
5648 * testsuite/icf_safe_test.cc: Ditto.
5649 * testsuite/icf_safe_test.sh: Ditto.
5651 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5652 Ian Lance Taylor <iant@google.com>
5654 * target-reloc.h (relocate_section): Check the symbol table index
5655 for -1U before setting the local symbol index.
5656 (scan_relocatable_relocs): If copying the relocation, record that
5657 the local symbol is required.
5658 * object.h (Symbol_value::is_output_symtab_index_set): New
5660 (Symbol_value::may_be_discarded_from_output_symtab): New
5662 (Symbol_value::has_output_symtab_entry): New function.
5663 (Symbol_value::needs_output_symtab_entry): Remove.
5664 (Symbol_value::output_symtab_index): Make sure the symbol index is
5666 (Symbol_value::set_output_symtab_index): Make sure the symbol
5667 index is not set. Make sure the new index is valid.
5668 (Symbol_value::set_must_have_output_symtab_entry): New function.
5669 (Symbol_value::has_output_dynsym_entry): New function.
5670 (Symbol_value::set_output_dynsym_index): Make sure the new index
5672 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5673 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5674 local symbol if permitted.
5675 (Sized_relobj::do_finalize_local_symbols): Call
5676 is_output_symtab_index_set rather than needs_output_symtab_entry.
5677 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5678 rather than needs_output_symtab_entry. Call
5679 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5680 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5681 is_output_symtab_index_set rather than needs_output_symtab_entry.
5682 * testsuite/discard_locals_relocatable_test.c: New file.
5683 * testsuite/discard_locals_test.sh: Test -r.
5684 * testsuite/Makefile.am (check_DATA): Add
5685 discard_locals_relocatable_test1.syms,
5686 discard_local_relocatable_test2.syms.
5687 (MOSTLYCLEANFILES): Likewise. Also add
5688 discard_locals_relocatable_test1.lout and
5689 discard_locals_relocatable_test2.out.
5690 (discard_locals_relocatable_test1.syms): New target.
5691 (discard_locals_relocatable_test.o): New target.
5692 (discard_locals_relocatable_test1.out): New target.
5693 (discard_locals_relocatable_test2.syms): New target.
5694 (discard_locals_relocatable_test2.out): New target.
5695 (various): Add missing ../ld-new dependencies.
5696 * testsuite/Makefile.in: Rebuild.
5698 2010-03-03 Nick Clifton <nickc@redhat.com>
5700 * po/fi.po: New Finnish translation.
5702 2010-03-01 Doug Kwan <dougkwan@google.com>
5704 * layout.cc (Layout::Layout): Force section types of .init_array*,
5705 .preinit_array* and .fini_array* sections.
5706 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5707 Fix check of return value of std::string::find.().
5708 (Output_section::Input_section_sort_compare::operator()): Remove
5709 comment about .init_array.
5710 (Output_section::Input_section_sort_init_fini_compare::operator()):
5712 (Output_section::sort_attached_input_sections): Handle .init_array
5713 and .fini_array specially.
5714 * output.h (Output_section::Inut_section_sort_compare): Update
5716 (Output_section::Input_section_sort_init_fini_compare): New struct.
5718 2010-02-26 Doug Kwan <dougkwan@google.com>
5720 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5721 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5722 * testsuite/debug_msg.sh: Avoid matching source line number for
5723 use of global variable undef_int.
5725 2010-02-26 Doug Kwan <dougkwan@google.com>
5727 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5728 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5729 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5730 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5731 * options.cc (General_options::General_options): Initialize member
5733 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5734 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5735 and rm_no_fix_v4bx.stdout
5736 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5737 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5738 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5739 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5740 and arm_no_fix_v4bx.
5741 * Makefile.in: Regenerate.
5742 * testsuite/arm_fix_v4bx.s: New file.
5743 * testsuite/arm_fix_v4bx.sh: Ditto.
5745 2010-02-24 Doug Kwan <dougkwan@google.com>
5747 * arm.cc (Target_arm::got_section): Make the .got section the first
5748 non RELRO section in the data segment.
5749 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5750 suffixes of section names.
5752 2010-02-24 Doug Kwan <dougkwan@google.com>
5754 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5755 flags and attributes merging if an input file is a binary file.
5756 * fileread.cc (Input_file::open): Record format of original file.
5757 * fileread.h (Input_file::Format): New enum type.
5758 (Input_file::Input_file): Initialize data member format_.
5759 (Input_file::format): New method definition.
5760 (Input_file::format_):: New data member.
5762 2010-02-24 Doug Kwan <dougkwan@google.com>
5764 * arm.cc (Arm_output_data_got): New class.
5765 (ARM_TCB_SIZE): New constant
5766 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5767 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5768 If user uses a script with a SECTIONS clause, issue only a warning
5769 for a misplaced EXIDX input section. Otherwise, issue an error.
5770 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5772 (Target_arm::got_mode_index_entry): Handle static linking.
5773 (Target_arm::Scan::local): Ditto.
5774 (Target_arm::Scan::global): Ditto.
5775 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5776 all incorrectly implemented relocations.
5777 (Target_arm::fix_exidx_coverage): Pass layout to
5778 Arm_output_section::fix_exidx_coverage.
5779 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5780 from ".ARM.exidx." and ".ARM.extab.".
5782 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5784 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5785 section if it does not already exist.
5786 * attributes.cc (Attributes_section_data::Attributes_section_data):
5787 Don't crash if size is zero.
5789 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5790 Ian Lance Taylor <iant@google.com>
5792 * gold.cc (queue_middle_tasks): If no input files were opened,
5794 * workqueue.h (Task_function::Task_function): Assert that there is
5797 2010-02-22 Doug Kwan <dougkwan@google.com>
5799 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5800 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5801 types to avoid warnings due to different uint64_t implementations
5804 2010-02-21 Doug Kwan <dougkwan@google.com>
5806 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5807 handling of the maximum backward branch offset.
5808 (Arm_relocate_functions::thumb_branch_common): Ditto.
5809 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5810 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
5811 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
5812 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5813 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5814 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5815 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5816 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5817 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5818 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5819 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5820 thumb2_bl_out_of_range.o): New rules.
5821 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5822 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5823 thumb2_bl_out_of_range
5824 * testsuite/Makefile.in: Regenerate.
5825 * testsuite/arm_bl_in_range.s: New file.
5826 * testsuite/arm_bl_out_of_range.s: Ditto.
5827 * testsuite/arm_branch_in_range.sh: Ditto.
5828 * testsuite/arm_branch_range.t: Ditto.
5829 * testsuite/thumb2_branch_range.t: Ditto.
5830 * testsuite/thumb_bl_in_range.s: Ditto.
5831 * testsuite/thumb_bl_out_of_range.s: Ditto.
5832 * testsuite/thumb_branch_range.t: Ditto.
5834 2010-02-20 Sriraman Tallam <tmsriram@google.com>
5836 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5837 Add reloc offset information.
5838 * icf.cc (get_section_contents): Change iterators to point to the new
5839 vectors. Add reloc offset information to the contents.
5840 * icf.h (Icf::Sections_reachable_info): New typedef.
5841 (Icf::Sections_reachable_list): New typedef.
5842 (Icf::Offset_info): New typedef.
5843 (Icf::Reloc_info): New struct typedef.
5844 (Icf::Reloc_info_list): New typedef.
5845 (Icf::symbol_reloc_list): Delete method.
5846 (Icf::addend_reloc_list): Delete method.
5847 (Icf::section_reloc_list): Delete method.
5848 (Icf::reloc_info_list): New method.
5849 (Icf::reloc_info_list_): New member.
5851 2010-02-19 Doug Kwan <dougkwan@google.com>
5853 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5854 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5855 * arm.cc (Arm_relocation_functions): New forward declaration.
5856 (Target_arm::Target_arm): Initialize new data members
5857 got_mod_index_offset_ and tls_base_symbol_defined_.
5858 (Target_arm::Relocate::relocate_tls): New method.
5859 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5860 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5862 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5863 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5864 (Target_arm::got_mod_index_offset_,
5865 Target_arm::tls_base_symbol_defined_): New data members.
5866 (Target_arm::Scan::local, Target::Scan::global,
5867 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5870 2010-02-18 Doug Kwan <dougkwan@google.com>
5872 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5873 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5874 text section as a parameter becuase some broken tools may not set
5875 the link in section header.
5876 (Target_arm::has_got_section): New method.
5877 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5878 without any mapping symbol as data only. Remove warning.
5879 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5880 link in its section header, try to discover the link by inspecting the
5881 REL31 relocation at the beginning of the section.
5882 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5884 (Target_arm::Scan::global): Treat any reference to the symbol
5885 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5887 2010-02-12 Sriraman Tallam <tmsriram@google.com>
5889 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5890 (Scan::global_reloc_may_be_function_pointer): New function.
5891 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5892 (Scan::global_reloc_may_be_function_pointer): New function.
5893 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5894 (Scan::global_reloc_may_be_function_pointer): New function.
5895 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5896 (Scan::global_reloc_may_be_function_pointer): New function.
5897 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5898 (Scan::global_reloc_may_be_function_pointer): New function.
5899 (Scan::possible_function_pointer_reloc): New function.
5900 (Target_x86_64::can_check_for_function_pointers): New function.
5901 * gc.h (gc_process_relocs): Scan relocation types to determine if
5902 function pointers were taken for targets that support it.
5903 * icf.cc (Icf::find_identical_sections): Include functions for
5904 folding in safe ICF whose pointer is not taken.
5905 * icf.h (Secn_fptr_taken_set): New typedef.
5906 (fptr_section_id_): New member.
5907 (section_has_function_pointers): New function.
5908 (set_section_has_function_pointers): New function.
5909 (check_section_for_function_pointers): New function.
5910 * options.h: Fix comment for safe ICF option.
5911 * target.h (can_check_for_function_pointers): New function.
5912 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5913 Modify icf_safe_test for X86-64.
5914 * testsuite/Makefile.in: Regenerate.
5915 * testsuite/icf_safe_so_test.cc: New file.
5916 * testsuite/icf_safe_so_test.sh: New file.
5917 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5918 (main): Change to take pointer to function kept_func_3.
5919 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5920 folding is done correctly for X86-64.
5922 2010-02-12 David S. Miller <davem@davemloft.net>
5924 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5925 is_symbolless parameter.
5926 (Output_reloc<SHT_REL>::is_symbolless): New.
5927 (Output_reloc<SHT_REL>::is_symbolless_): New.
5928 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5929 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5930 (Output_reloc<SHT_RELA>::is_symbolless): New.
5931 (Output_data_reloc::add_global): Handle is_symbolless.
5932 (Output_data_reloc::add_global_relative): Likewise.
5933 (Output_data_reloc::add_local): Likewise.
5934 (Output_data_reloc::add_local_relative): Likewise.
5935 (Output_data_reloc::add_symbolless_global_addend): New.
5936 (Output_data_reloc::add_symbolless_local_addend): New.
5937 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5939 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5940 instead of ->is_relative_
5941 (Output_reloc::write): Likewise.
5942 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5943 (Output_reloc::write_rel): Simplify.
5945 * sparc.cc (Target_sparc::Scan::local): Use
5946 ->add_symbolless_local_addend as needed.
5947 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5948 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5949 based upon relocation offset.
5951 2010-02-11 Doug Kwan <dougkwan@google.com>
5953 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5954 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5955 beginning of function.
5956 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5957 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5958 parameter is_32bit in calls to should_apply_static_reloc.
5959 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5960 (check_DATA): Add arm_abs_global.stdout.
5961 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5962 arm_abs_global.stdout): New rules.
5963 (MOSTLLYCLEANFILES): Add arm_abs_global
5964 * Makefile.in: Regenerate.
5965 * testsuite/arm_abs_global.s: New file.
5966 * testsuite/arm_abs_global.sh: Ditto.
5967 * testsuite/arm_abs_lib.s: Ditto.
5969 2010-02-11 Ian Lance Taylor <iant@google.com>
5971 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5973 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5974 Allocate_commons_task first.
5975 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5976 task, rather than symtab_lock_.
5977 (Gc_process_relocs::~Gc_process_relocs): New function.
5978 (Gc_process_relocs::is_runnable): Check this_blocker_.
5979 (Gc_process_relocs::locks): Use next_blocker_ rather than
5981 (Scan_relocs::~Scan_relocs): New function.
5982 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5984 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5986 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5987 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5988 constructor accordingly.
5989 (class Gc_process_relocs): Likewise.
5990 (class Scan_relocs): Likewise.
5991 * common.h (class Allocate_commons_task): Remove symtab_lock_
5992 field, and corresponding constructor parameter.
5993 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5995 (Allocate_commons_task::locks): Likewise.
5997 2010-02-11 Ian Lance Taylor <iant@google.com>
5999 * gold-threads.h (class Once): Define.
6000 (class Initialize_lock): Rewrite as child of Once.
6001 * gold-threads.cc (class Once_initialize): Define.
6002 (once_pointer_control): New static variable.
6003 (once_pointer, once_arg): New static variables.
6004 (c_run_once): New static function.
6005 (Once::Once, Once::run_once, Once::internal_run): New functions.
6006 (class Initialize_lock_once): Remove.
6007 (initialize_lock_control): Remove.
6008 (initialize_lock_pointer): Remove.
6009 (initialize_lock_once): Remove.
6010 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6011 (Initialize_lock::initialize): Rewrite.
6012 (Initialize_lock::do_run_once): New function.
6013 * archive.cc (Archive::interpret_header): Only clear name if it is
6015 * fileread.cc: Include "gold-threads.h"
6016 (file_counts_lock): New static variable.
6017 (file_counts_initialize_lock): Likewise.
6018 (File_read::release): Only increment counts when using --stats.
6019 Use a lock around the increment.
6020 * parameters.cc (class Set_parameters_target_once): Define.
6021 (set_parameters_target_once): New static variable.
6022 (Parameters::Parameters): Move here from parameters.h.
6023 (Parameters::set_target): Rewrite.
6024 (Parameters::set_target_once): New function.
6025 (Parameters::clear_target): Move here and rewrite.
6026 * parameters.h (class Parameters): Update declarations. Add
6027 set_parameters_target_once_ field.
6028 (Parameters::Parameters): Move to parameters.cc.
6029 (Parameters::clear_target): Likewise.
6030 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6032 (Start_group::~Start_group): New function.
6033 (Start_group::is_runnable): New function.
6034 (Start_group::locks, Start_group::run): New functions.
6035 (Finish_group::run): Change saw_undefined to size_t.
6036 * readsyms.h (class Start_group): Define.
6037 (class Finish_group): Change saw_undefined_ field to size_t.
6038 (Finish_group::Finish_group): Remove saw_undefined and
6039 this_blocker parameters. Change all callers.
6040 (Finish_group::set_saw_undefined): New function.
6041 (Finish_group::set_blocker): New function.
6042 * symtab.h (class Symbol_table): Change saw_undefined to return
6043 size_t. Change saw_undefined_ field to size_t.
6044 * target-select.cc (Set_target_once::do_run_once): New function.
6045 (Target_selector::Target_selector): Initialize set_target_once_
6046 field. Don't initialize lock_ and initialize_lock_ fields.
6047 (Target_selector::instantiate_target): Rewrite.
6048 (Target_selector::set_target): New function.
6049 * target-select.h (class Set_target_once): Define.
6050 (class Target_selector): Update declarations. Make
6051 Set_target_once a friend. Remove lock_ and initialize_lock_
6052 fields. Add set_target_once_ field.
6054 2010-02-10 Ian Lance Taylor <iant@google.com>
6056 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6058 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6059 (queue_middle_tasks): Add all blockers before queueing any tasks.
6060 (queue_final_tasks): Likewise.
6061 * token.h (Task_token::add_blockers): New function.
6062 * object.h (Input_objects::number_of_relobjs): New function.
6064 2010-02-10 Ian Lance Taylor <iant@google.com>
6066 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6067 shared, not if not position independent.
6068 * x86_64.cc (Relocate::relocate_tls): Likewise.
6069 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6070 (tls_pie_pic_test): New target.
6071 * testsuite/Makefile.in: Rebuild.
6073 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6074 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6075 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6076 * testsuite/Makefile.in: Rebuild.
6078 2010-02-09 David S. Miller <davem@davemloft.net>
6080 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6081 R_SPARC_RELATIVE using ->add_local_relative().
6082 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6084 * output.h (Output_data_dynamic::add_section_size): New method
6085 that takes two Output_data objects.
6086 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6087 entry param. Handle it in initializers.
6088 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6089 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6090 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6092 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6093 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6094 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6095 for dynrel_includes_plt.
6096 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6097 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6098 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6100 (Target_sparc::do_finalize_sections): Update to pass true for
6101 dynrel_includes_plt.
6102 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6103 output before .rela.plt
6104 (Target_powerpc::do_finalize_sections): Update to pass true for
6105 dynrel_includes_plt when 32-bit.
6107 2010-02-08 Doug Kwan <dougkwan@google.com>
6109 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6111 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6112 Arm_relobj::scan_section_for_cortex_a8_stubs,
6113 Arm_relobj::do_relocation_section): Instead of calling
6114 Output_section::output_address, use faster
6115 Arm_relobj::simple_input_section_output_address.
6117 2010-02-08 David S. Miller <davem@davemloft.net>
6119 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6120 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6121 relocation helper function.
6123 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6124 just like R_SPARC_GOT{10,13,22}.
6125 (Target_sparc::Scan::local): Likewise.
6126 (Target_sparc::Relocate:relocate): Likewise.
6128 2010-02-06 Ian Lance Taylor <iant@google.com>
6130 * configure.ac: Rewrite targetobjs duplicate removal code to use
6131 only shell constructs.
6132 * configure: Rebuild.
6134 2010-02-05 Doug Kwan <dougkwan@google.com>
6137 * arm.cc (Arm_relobj::section_is_scannable): New method.
6138 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6139 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6141 2010-02-04 Doug Kwan <dougkwan@google.com>
6144 * arm-reloc-property.cc (cstdio): Include.
6145 * configure.ac (targetobjs): Remove duplicates.
6146 * configure: Regenerate.
6147 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6148 big and little endian version for a given address size.
6150 2010-02-03 Doug Kwan <dougkwan@google.com>
6152 * arm-reloc-property.cc
6153 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6155 * arm-reloc-property.h
6156 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6157 New method definition.
6158 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6160 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6162 (GOT_PREL): Change implemented to Y.
6163 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6164 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6165 (Arm_relocate_functions::movw_abs_nc): Remove method.
6166 (Arm_relocate_functions::movt_abs): Ditto.
6167 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6168 (Arm_relocate_functions::thm_movt_abs): Ditto.
6169 (Arm_relocate_functions::movw_rel_nc): Ditto.
6170 (Arm_relocate_functions::movw_rel): Ditto.
6171 (Arm_relocate_functions::movt_rel): Ditto.
6172 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6173 (Arm_relocate_functions:thm_movw_rel): Ditto.
6174 (Arm_relocate_functions:thm_movt_rel): Ditto.
6175 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6176 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6177 New method definitions.
6178 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6179 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6180 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6181 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6182 (Target_arm::Relocate::relocate): Check for non-static or
6183 unimplemented relocation code and exit early. Change calls to
6184 Target_arm::reloc_uses_thumb_bit and
6185 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6186 instead. Refactor code to handle similar relocations to increase
6187 code sharing. Remove check for unsupported relocation code in switch
6189 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6190 relocation property table to find out size. Change error message to
6191 print out the name of a relocation code instead of the numeric value.
6192 (Target_arm::scan_reloc_for_stub): Use relocation property table
6193 instead of calling Target_arm::reloc_uses_thumb_bit().
6195 2010-02-02 Doug Kwan <dougkwan@google.com>
6197 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6198 types of relaxed input section.
6200 2010-02-02 Doug Kwan <dougkwan@google.com>
6202 * Makefile.am (HFILES): Add arm-reloc-property.h.
6204 (TARGETSOURCES): Add arm-reloc-property.cc
6205 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6206 (libgold_a_SOURCES): $(DEFFILES)
6207 * Makefile.in: Regenerate.
6208 * arm-reloc-property.cc: New file.
6209 * arm-reloc-property.h: New file.
6210 * arm-reloc.def: New file.
6211 * arm.cc: Update comments.
6212 (arm-reloc-property.h): New included header.
6213 (arm_reloc_property_table): New global variable.
6214 (Target_arm::do_select_as_default_target): New method definition.
6215 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6216 arm-reloc-property to targ_extra_obj.
6217 * parameters.cc (set_parameters_target): Call
6218 Target::select_as_default_target().
6219 * target.h (Target::select_as_default_target): New method definition.
6220 (Target::do_select_as_default_target): Same.
6222 2010-02-01 Doug Kwan <dougkwan@google.com>
6224 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6225 first_output_text_section_.
6226 (Arm_exidx_fixup::first_output_text_section): New method definition.
6227 (Arm_exidx_fixup::first_output_text_section_): New data member.
6228 (Arm_exidx_fixup::process_exidx_section): Record the first text
6229 output section seen.
6230 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6231 and entsize in output section header.
6233 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6235 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6236 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6237 (Arm_relocate_functions::thm_alu11): New Method.
6238 (Arm_relocate_functions::thm_pc8): New Method.
6239 (Arm_relocate_functions::thm_pc12): New Method.
6240 (Target_arm::Scan::local): Handle the relocations.
6241 (Target_arm::Scan::global): Likewise.
6242 (Target_arm::Relocate::relocate): Likewise.
6243 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6245 2010-01-29 Doug Kwan <dougkwan@google.com>
6247 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6248 of relocation types as ld.
6250 2010-01-29 Doug Kwan <dougkwan@google.com>
6252 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6254 (Arm_relocate_functions::thumb_branch_common): Ditto.
6255 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6256 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6257 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6258 Arm_relocate_functions::jump24): Remove.
6259 (Target_arm::Relocate::relocate): Adjust code to call
6260 Arm_relocation_functions::arm_branch_common and
6261 Arm_relocation_functions::thumb_branch_common instead of their removed
6262 wrappers. Merge switch-cases together to reduce source code size.
6264 2010-01-29 Doug Kwan <dougkwan@google.com>
6266 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6267 output_local_symbol_count_needs_update_.
6268 (Arm_relobj::output_local_symbol_count_needs_update,
6269 Arm_relobj::set_output_local_symbol_count_needs_update,
6270 Arm_relobj::update_output_local_symbol_count): New methods.
6271 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6273 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6274 of pointed function as in a R_ARM_PREL31 relocation.
6275 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6276 for output local symbol count updating.
6277 (Target_arm::do_relax): Update output local symbol counts in objects
6279 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6281 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6283 * arm.cc: Added support for the ARM relocations:
6284 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6285 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6286 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6288 (Arm_relocate_functions::movw_rel): New method.
6289 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6290 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6292 (Arm_relocate_functions::thm_movw_rel): New method.
6293 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6295 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6297 (Target_arm::Scan::global): Likewise.
6298 (Target_arm::Relocate::relocate): Likewise.
6299 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6302 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6304 * arm.cc: Added support for ARM group relocations.
6305 (Target_arm::reloc_needs_sym_origin): New method.
6306 (Arm_relocate_functions::calc_grp_kn): New method.
6307 (Arm_relocate_functions::calc_grp_residual): New method.
6308 (Arm_relocate_functions::calc_grp_gn): New method.
6309 (Arm_relocate_functions::arm_grp_alu): New Method.
6310 (Arm_relocate_functions::arm_grp_ldr): New Method.
6311 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6312 (Arm_relocate_functions::arm_grp_ldc): New Method.
6313 (Target_arm::Scan::local): Handle the ARM group relocations.
6314 (Target_arm::Scan::global): Likewise.
6315 (Target_arm::Relocate::relocate): Likewise.
6316 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6319 2010-01-26 Doug Kwan <dougkwan@google.com>
6321 * arm.cc (set): Include.
6322 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6324 (Arm_output_section::Text_section_list): New type.
6325 (Arm_output_section::append_text_sections_to_list): New method.
6326 (Arm_output_section::fix_exidx_coverage): Ditto.
6327 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6328 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6329 Relobj::set_section_offset() instead of
6330 Sized_relobj::invalidate_section_offset().
6331 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6332 parameter for section headers. Ignore relocation sections for
6333 unallocated sections and EXIDX sections.
6334 (Target_arm::fix_exidx_coverage): New method.
6335 (Target_arm::output_section_address_less_than): New type.
6336 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6337 linked text section instead of the EXIDX section.
6338 (Arm_output_section::create_stub_group): Add an assertion to check
6339 that this is not an EXIDX output section.
6340 (Arm_output_section::append_text_sections_to_list): New method.
6341 (Arm_output_section::fix_exidx_coverage): Ditto.
6342 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6343 Arm_relobj::section_needs_reloc_stub_scanning.
6344 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6346 (Target_arm::fix_exidx_coverage): New method.
6347 * object.h (Relobj::set_output_section): New method.
6348 (Sized_relobj::invalidate_section_offset): Remove method.
6349 (Sized_relobj::do_invalidate_section_offset): Remove method.
6350 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6352 2010-01-25 Doug Kwan <dougkwan@google.com>
6354 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6355 Fix warning due to signed and unsigned comparison on a 32-bit host.
6357 2010-01-22 Doug Kwan <dougkwan@google.com>
6359 * arm.cc (Target_arm::do_relax): Record an output section for section
6360 offset adjustment it contains any stub table that has changed.
6361 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6362 offsets in an output section if necessary.
6363 * output.cc (Output_section::Output_section): Initialize
6364 section_offsets_need_adjustments_.
6365 (Output_section::add_input_section_for_script): Renamed to
6366 Output_section::add_simple_input_section.
6367 (Output_section::save_states): Add a comment.
6368 (Output_section::discard_states): New method defintion.
6369 (Output_section::adjust_section_offsets): Same.
6370 * output.h (Output_section::add_input_section_for_script): Renamed to
6371 Output_section::add_simple_input_section.
6372 (Output_section::discard_states): New method declaration.
6373 (Output_section::adjust_section_offsets): Same.
6374 (Output_section::section_offsets_need_adjustment,
6375 Output_section::set_section_offsets_need_adjustment): New method
6377 (Output_section::section_offsets_need_adjustment_): New data member.
6378 * script-sections.cc
6379 (Output_section_element_input::set_section_address): Adjust code for
6380 renaming of Output_section::add_input_section_for_script.
6381 (Orphan_output_section::set_section_address): Same.
6383 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6385 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6386 Fix_v4bx enum values .
6387 * gold/options.h (General_options): New option definitions.
6388 (General_options::fix_v4bx): New method.
6389 (General_options::Fix_v4bx): New enum.
6390 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6391 (General_options::parse_fix_v4bx_interworking): New method.
6393 2010-01-22 Doug Kwan <dougkwan@google.com>
6395 * arm.cc (Arm_exidx_fixup): New class.
6397 2010-01-21 Doug Kwan <dougkwan@google.com>
6399 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6401 (Arm_exidx_section_offset_map): New type.
6403 2010-01-21 Doug Kwan <dougkwan@google.com>
6405 * arm.cc (Arm_exidx_input_section): New class.
6406 (Arm_relobj::exidx_input_section_by_link,
6407 Arm_relobj::exidx_input_section_by_shndx,
6408 Arm_relobj::make_exidx_input_section): New methods.
6409 (read_arm_attributes_section): Remove.
6410 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6411 information about them.
6412 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6415 2010-01-20 Doug Kwan <dougkwan@google.com>
6417 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6418 Input_section_specifier to Section_id.
6419 (Target_arm::new_arm_input_section: Adjust code for change of key
6421 (Target_arm::find_arm_input_section): Ditto.
6422 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6423 (Section_id): Remove.
6424 (Garbage_collection::Section_id_hash): Remove.
6425 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6426 (Section_id): Remove.
6427 (Icf::Section_id_hash): Remove.
6428 * object.h (Section_id, Const_section_id, Section_id_hash,
6429 Const_section_id_hash): New type definitions.
6430 * output.cc (Output_section::add_relaxed_input_section): Change to
6431 use Const_section_id instead of Input_section_specifier as key type.
6432 (Output_section::add_merge_input_section): Ditto.
6433 (Output_section::build_relaxation_map): Change to use Section_id
6434 instead of Input_section_specifier as key type.
6435 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6437 (Output_section::convert_input_sections_to_relaxed_sections): Change
6438 to use Const_section_id instead of Input_section_specifier as key type.
6439 (Output_section::find_merge_section): Ditto.
6440 (Output_section::find_relaxed_input_section): Ditto.
6441 * output.h (Input_section_specifier): Remove class.
6442 (Output_section::Output_section_data_by_input_section_map): Change
6443 key type to Const_section_id.
6444 (Output_section::Output_relaxed_input_section_by_input_section_map):
6446 (Output_section::Relaxation_map): Change key type to Section_id.
6448 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6450 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6451 (class Arm_v4bx_stub): New class.
6452 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6453 (Stub_factory::make_arm_v4bx_stub): New method.
6454 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6455 (Stub_table::empty): Handle v4bx stubs.
6456 (Stub_table::add_arm_v4bx_stub): New method.
6457 (Stub_table::find_arm_v4bx_stub): New method.
6458 (Arm_relocate_functions::v4bx): New method.
6459 (Target_arm::fix_v4bx): New method.
6460 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6461 (Stub_table::relocate_stubs): Likewise.
6462 (Stub_table::do_write): Likewise.
6463 (Stub_table::update_data_size_and_addralign): Likewise.
6464 (Stub_table::finalize_stubs): Likewise.
6465 (Target_arm::Scan::local): Likewise.
6466 (Target_arm::Scan::global): Likewise.
6467 (Target_arm::do_finalize_sections): Likewise.
6468 (Target_arm::Relocate::relocate): Likewise.
6469 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6471 (Target_arm::scan_reloc_for_stub): Likewise.
6472 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6474 2010-01-19 Ian Lance Taylor <iant@google.com>
6476 * output.cc (Output_section_headers::do_sized_write): Write large
6477 segment count to sh_info field.
6478 (Output_file_header::do_sized_write): For large segment count,
6479 write PN_XNUM to e_phnum field.
6481 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6483 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6484 (Arm_relocate_functions::thm_jump8): New function.
6485 (Arm_relocate_functions::thm_jump11): New function.
6486 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6488 (Target_arm::Scan::global): Likewise.
6489 (Target_arm::Relocate::relocate): Likewise.
6490 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6493 2010-01-14 Doug Kwan <dougkwan@google.com>
6495 * arm.cc (map, utility): Include headers.
6496 (Target_arm::apply_cortex_a8_workaround): New method.
6497 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6498 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6499 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6500 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6501 the --[no-]fix-cortex-a8 command line options.
6502 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6503 (Target_arm::relocate_stub): Use addend in instruction template.
6504 * options.h (DEFINE_bool): Set the user-set flag.
6505 (General_options): Add --[no-]-fix-cortex options.
6506 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6507 : Update fast look-up map after conversion.
6509 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6511 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6512 in the first pass of do_layout.
6514 2010-01-13 Doug Kwan <dougkwan@google.com>
6516 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6517 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6518 apparent compiler problem of not folding static constant integral
6519 data members of elfcpp::Elf_sizes<32>.
6521 2010-01-13 Doug Kwan <dougkwan@google.com>
6523 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6524 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6525 Arm_relobj::scan_section_for_cortex_a8_erratum,
6526 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6527 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6528 sections to scan for relocation stubs into a new method
6529 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6530 relocation and Cortex-A8 stub scanning.
6531 (Target_arm::do_relax): Force stubs to be after stubbed sections
6532 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
6533 the beginning of a new relaxation pass. Update a comment.
6534 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6536 2010-01-12 Ian Lance Taylor <iant@google.com>
6538 * target-reloc.h (visibility_error): New inline function.
6539 (relocate_section): Call visibility_error.
6540 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6541 (MOSTLYCLEANFILES): Likewise.
6542 (protected_4_pic.o, protected_3.err): New targets.
6543 * testsuite/protected_4.cc: New file.
6545 2010-01-12 Doug Kwan <dougkwan@google.com>
6547 * arm.cc (Cortex_a8_reloc): New class.
6548 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6549 and cortex_a8_relocs_info_.
6550 (Target_arm::fix_cortex_a8): New method definition.
6551 (Target_arm::Cortex_a8_relocs_info): New type.
6552 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6553 New data member declarations.
6554 (Target_arm::scan_reloc_for_stub): Record information about
6555 relocations for THUMB branches that might be exempted from the
6556 Cortex-A8 workaround.
6557 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6558 at the beginning of a relaxation pass.
6560 2010-01-12 Doug Kwan <dougkwan@google.com>
6562 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6563 (Arm_relobj::Mapping_symbol_position,
6564 Arm_reloj::Mapping_symbol_position_less,
6565 Arm_relobj::Mapping_symbols_info): New types.
6566 (Target_arm::is_mapping_symbol_name): New method definition.
6567 (Arm_relobj::do_count_local_symbols): Save information about mapping
6570 2010-01-11 Doug Kwan <dougkwan@google.com>
6572 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6573 Arm_relocate_functions::thumb32_branch_upper,
6574 Arm_relocate_functions::thumb32_branch_lower,
6575 Arm_relocate_functions::thumb32_cond_branch_offset,
6576 Arm_relocate_functions::thumb32_cond_branch_upper,
6577 Arm_relocate_functions::thumb32_cond_branch_lower,
6578 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6579 branch offset encoding.
6580 (Arm_relocate_functions::thumb_branch_common): Use new branch
6581 offset encoding methods to avoid code duplication.
6582 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6583 (Stub_addend_reader::operator()): Use new branch encoding method
6584 to avoid code duplication.
6586 2010-01-11 Doug Kwan <dougkwan@google.com>
6588 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6589 (Target_arm::do_finalize_sections): Define special EXIDX section
6590 symbols only if referenced.
6591 * gc.h (Garbage_collection::add_reference): New method.
6592 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6595 2010-01-11 Ian Lance Taylor <iant@google.com>
6597 * script.cc (Version_script_info::build_expression_list_lookup):
6598 Change complaing about duplicate wildcard match from error to
6601 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6603 (Version_script_info::Version_script_info): Initialize globs_,
6604 default_version_, default_is_global_, and exact_. Don't
6605 initialize globals_ or locals_.
6606 (Version_script_info::build_lookup_tables): Build local symbols
6608 (Version_script_info::unquote): New function.
6609 (Version_script_info::add_exact_match): New function.
6610 (Version_script_info::build_expression_list_lookup): Remove lookup
6611 parameter. Add is_global parameter. Change all callers. Handle
6612 wildcard pattern specially. Unquote pattern. Call
6614 (Version_script_info::get_name_to_match): New function.
6615 (Version_script_info::get_symbol_version): New function.
6616 (Version_script_info::get_symbol_version_helper): Remove.
6617 (Version_script_info::check_unmatched_names): Call unquote.
6618 * script.h (class Version_script_info): Change get_symbol_version
6619 to be non-inline and add is_global parameter; change all callers.
6620 Rewrite symbol_is_local. Update declarations. Define struct
6621 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6622 Remove globals_ and locals_ members. Add exact_, globs_,
6623 default_version_, is_global_.
6624 (Version_script_info::Glob): Remove pattern, add expression and
6625 is_global. Update constructor. Change all callers.
6626 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6628 (Versions::symbol_section_contents): If a symbol is undefined, or
6629 defined in a dynamic object, set the version index to
6631 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6633 (Symbol_table::add_from_pluginobj): Likewise.
6634 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6636 2010-01-11 Doug Kwan <dougkwan@google.com>
6638 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6639 (incremental_dump_LDADD): Add linking option for libintl.
6640 * Makefile.in: Regenerate.
6642 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6645 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6647 * testsuite/Makefile.in: Regenerated.
6649 2010-01-10 Doug Kwan <dougkwan@google.com>
6651 * options.h (DEFINE_var): Use parentheses around argument varname__
6652 in macro body to avoid any unintended subsequent substitutions.
6654 2010-01-10 Ian Lance Taylor <iant@google.com>
6656 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6657 candidates before doing symbol resolution.
6659 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6660 ODR candidates if only one is weak.
6662 2010-01-08 Ian Lance Taylor <iant@google.com>
6664 * script.cc (Version_script_info::build_expression_list_lookup):
6665 Don't warn about ambiguous version, just record the ambiguity.
6666 (Version_script_info::get_symbol_version_helper): Give error if
6667 version is ambiguous.
6669 2010-01-08 Doug Kwan <dougkwan@google.com>
6671 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6672 prev_data_size_ and prev_addralign_. Remove initializer for
6673 deleted data member has_been_changed_.
6674 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6675 to determine if the table is empty.
6676 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6678 (Stub_table::add_reloc_stub): Define method in class definition
6679 instead of just declaring it there.
6680 (Stub_table::add_cortex_a8_stub): New method definition.
6681 (Stub_table::update_data_size_and_addralign): Ditto.
6682 (Stub_table::finalize_stubs): Ditto.
6683 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6684 (Stub_table::do_addralign_): Return address alignment in the
6685 (Stub_table::do_reset_address_and_file_offset): Define method in
6686 class definition instead of declaring it there. Set current data
6687 size to be the data size of the previous pass.
6688 (Stub_table::set_final_data_size): Use current data size as the
6690 (Stub_table::relocate_stub): Change parameter type of stub from
6691 Reloc_stub pointer to Stub pointer.
6692 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6693 (Stub_table::Cortex_a8_stub_list): New typedef.
6694 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6695 Stub_table::prev_addralign_): New data member.
6696 (Arm_relobj::Arm_relobj): Initialize data member
6697 section_has_cortex_a8_workaround_.
6698 (Arm_relobj::section_has_cortex_a8_workaround,
6699 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6701 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6703 (Target_arm::relocate_stub): Change parameter type of stub from
6704 Reloc_stub pointer to Stub pointer.
6705 (Insn_template::size, Insn_template::alignment): Handle
6706 THUMB16_SPECIAL_TYPE.
6707 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6708 Stub_table::update_data_size_and_addralign,
6709 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6711 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6712 (Stub_table::do_write): Ditto.
6713 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6715 2010-01-08 Ian Lance Taylor <iant@google.com>
6718 * symtab.h (class Symbol): Remove fields is_target_special_ and
6719 has_plt_offset_. Add field is_defined_in_discarded_section_.
6720 (Symbol::is_defined_in_discarded_section): New function.
6721 (Symbol::set_is_defined_in_discarded_section): New function.
6722 (Symbol::has_plt_offset): Rewrite.
6723 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6724 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6725 Don't initialize is_target_special_ or has_plt_offset_.
6726 Initialize is_defined_in_discarded_section_.
6727 (Symbol_table::add_from_relobj): If appropriate, set
6728 is_defined_in_discarded_section.
6729 * resolve.cc (Symbol::override_base_with_special): Don't test
6730 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6731 * target-reloc.h (relocate_section): Do special handling for
6732 symbols defined in discarded sections for global symbols as well
6735 2010-01-08 Ian Lance Taylor <iant@google.com>
6737 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6738 the SHT_SYMTAB case.
6740 2010-01-08 Ian Lance Taylor <iant@google.com>
6742 * object.cc (Sized_relobj::do_layout): Don't get confused if
6743 layout_eh_frame returns NULL.
6745 2010-01-08 Ian Lance Taylor <iant@google.com>
6748 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6749 dynamic symbol table, use the normal symbol table.
6750 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6753 2010-01-08 Ian Lance Taylor <iant@google.com>
6756 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6759 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6761 * version.cc (print_version): Change to "Copyright 2010".
6763 2010-01-08 Ian Lance Taylor <iant@google.com>
6767 * i386.cc (class Target_i386): Change return type of plt_section
6769 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6770 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6771 tls_desc_rel_ field.
6772 (Output_data_plt_i386::rel_tls_desc): New function.
6773 (Target_i386::rel_tls_desc_section): New function.
6774 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6775 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6776 R_386_TLS_DESC reloc in rel_tls_desc_section.
6777 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6778 Define struct Tlsdesc_info.
6779 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6780 (Target_x86_64::do_reloc_symbol_index): New function.
6781 (Target_x86_64::add_tlsdesc_info): New function.
6782 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6783 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6785 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6787 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6788 (Target_x86_64::rela_tlsdesc_section): New function.
6789 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6791 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6792 (Target_x86_64::do_reloc_addend): New function.
6793 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6794 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6795 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6796 (Output_reloc::type): New function.
6797 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6798 (Output_reloc::is_target_specific): New function.
6799 (Output_reloc::target_arg): New function.
6800 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6801 absolute relocs and target specific relocs.
6802 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6803 add_target_specific.
6804 (class Output_data_reloc) [SHT_RELA]: Likewise.
6805 * output.cc (Output_reloc::Output_reloc): Add four new versions
6806 for absolute relocs and target specific relocs.
6807 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6808 (Output_reloc::get_symbol_index): Likewise.
6809 (Output_reloc::local_section_offset): Check that local_sym_index_
6810 is not TARGET_CODE or 0.
6811 (Output_reloc::symbol_value): Likewise.
6812 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6814 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6815 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6817 * layout.cc (add_target_dynamic_tags): Use output section for
6818 DT_PLTRELSZ and DT_JMPREL.
6820 2010-01-07 Ian Lance Taylor <iant@google.com>
6823 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6825 (class Output_data_reloc_generic): Define.
6826 (class Output_data_reloc_base): Change base class to
6827 Output_data_reloc_generic. Change add() method to call
6828 bump_relative_reloc_count for a relative reloc. Remove
6830 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6832 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6833 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6835 * layout.h (class Layout): Update declaration.
6837 2010-01-07 Ian Lance Taylor <iant@google.com>
6839 * output.h (class Output_data): Add const version of
6840 output_section and do_output_section.
6841 (class Output_section_data): Add const version of
6843 (class Output_section): Likewise.
6844 * layout.cc (Layout::add_target_dynamic_tags): New function.
6845 * layout.h (class Layout): Update declarations.
6846 * arm.cc (Target_arm::do_finalize_sections): Use
6847 add_target_dynamic_tags.
6848 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6849 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6850 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6851 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6853 2010-01-07 Ian Lance Taylor <iant@google.com>
6856 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6859 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6860 Ian Lance Taylor <iant@google.com>
6863 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6864 Xindex::read_symtab_xindex.
6866 2010-01-07 Doug Kwan <dougkwan@google.com>
6868 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6869 (Insn_template::thumb16_bcond_insn): New method declaration.
6870 (Insn_template): Fix spelling.
6871 (Stub::thumb16_special): New method declaration.
6872 (Stub::do_write): Define virtual method which was previously pure
6874 (Stub::do_thumb16_special): New method declaration.
6875 (Stub::do_fixed_endian_write): New template member.
6876 (Reloc_stub::do_write): Remove.
6877 (Reloc_stub::do_fixed_endian_write): Remove.
6878 (Cortex_a8_stub): New class definition.
6879 (Stub_factory::make_cortex_a8_stub): New method definition.
6880 (Stub_factory::Stub_factory): Add missing static storage class
6881 qualifier for elf32_arm_stub_a8_veneer_blx.
6883 2010-01-07 Ian Lance Taylor <iant@google.com>
6886 * options.h (class General_options): Add --warn-unresolved-symbols
6887 and --error-unresolved-symbols.
6888 * errors.cc (Errors::undefined_symbol): Implement
6889 --warn-unresolved-symbols.
6891 * options.h (class General_options): Add -z text and -z textoff.
6892 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6894 2010-01-06 Sriraman Tallam <tmsriram@google.com>
6896 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6897 (Garbage_collection::cident_sections): New function.
6898 (Garbage_collection::add_cident_section): New function.
6899 (Garbage_collection::cident_sections_): New member.
6900 (gc_process_relocs): Add references to sections whose names are C
6902 * gold.h (cident_section_start_prefix): New constant.
6903 (cident_section_stop_prefix): New constant.
6904 (is_cident): New function.
6905 * layout.cc (Layout::define_section_symbols): Replace string constants
6906 with the newly defined constants.
6907 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6909 * testsuite/Makefile.am: Add gc_orphan_section_test.
6910 * testsuite/Makefile.in: Regenerate.
6911 * testsuite/gc_orphan_section_test.cc: New file.
6912 * testsuite/gc_orphan_section_test.sh: New file.
6914 2010-01-06 Ian Lance Taylor <iant@google.com>
6917 * options.h (class General_options): Add --warn-shared-textrel.
6918 * layout.cc (Layout::finish_dynamic_section): Implement
6919 --warn-shared-textrel.
6922 * options.h (class General_options): Add --warn-multiple-gp.
6924 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6926 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6927 $(THREADSLIB) and $(LIBDL).
6928 * Makefile.in: Rebuild.
6930 2010-01-06 Ian Lance Taylor <iant@google.com>
6933 * options.cc (General_options::parse_section_start): New function.
6934 (General_options::section_start): New function.
6935 (General_options::General_options): Initialize all members.
6936 * options.h: Include <map>
6937 (class General_options): Add --section-start. Add section_starts_
6939 * layout.cc (Layout::attach_allocated_section_to_segment): If
6940 --section-start was used, set the address of the segment. Remove
6941 local sort_sections.
6942 (Layout::relaxation_loop_body): If the address of the load segment
6943 has been set by --section-start, don't use it.
6944 * output.h (Output_segment::update_flags_for_output_section): New
6946 * output.cc (Output_segment::add_output_section): Call
6947 update_flags_for_output_section.
6949 2010-01-05 Ian Lance Taylor <iant@google.com>
6952 * options.h (class General_options): Add --undefined-version.
6953 * script.cc (struct Version_expression): Add was_matched_by_symbol
6955 (Version_script_info::matched_symbol): New function.
6956 (Version_script_info::get_symbol_version_helper): Call
6958 (Version_script_info::check_unmatched_names): New function.
6959 * script.h (class Version_script_info): Update declarations.
6960 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6962 * options.h (class General_options): Use DEFINE_bool_alias for
6963 allow_multiple_definition.
6964 * resolve.cc (Symbol_table::should_override): Don't test
6965 allow_multiple_definition.
6968 * options.h (class General_options): Add --cref.
6969 * main.cc (main): Print cref table if --cref. Don't close mapfile
6970 until after printing cref table.
6971 * cref.cc: Include "symtab.h".
6972 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6973 (Cref_table_compare::operator()): New function.
6974 (Cref_inputs::gather_cref): New function.
6975 (filecol): New static const.
6976 (Cref_inputs::print_cref): New function.
6977 (Cref::print_cref): New function.
6978 * cref.h: Include <cstdio>.
6979 (class Cref): Update declarations.
6980 * mapfile.h (Mapfile::file): New function.
6981 * object.h (class Object): Define Symbols. Declare virtual
6982 do_get_global_symbols.
6983 (Object::get_global_symbols): New function.
6984 * object.cc (Input_objects::add_object): Pass object to cref_ if
6986 (Input_objects::archive_start): Likewise.
6987 (Input_objects::archive_stop): Likewise.
6988 (Input_objects::print_cref): New function.
6989 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6990 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6992 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6994 * plugin.h (class Sized_pluginobj): Update declarations.
6996 2010-01-05 Ian Lance Taylor <iant@google.com>
6998 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6999 to is_default_version. Rename insdef to insdefault.
7000 (Symbol_table::add_from_relobj): Rename def to is_default_version
7001 and local to is_forced_local.
7002 (Symbol_table::add_from_pluginobj): Likewise.
7003 (Symbol_table::add_from_dynobj): Likewise.
7004 (Symbol_table::define_special_symbol): Rename insdef to
7007 2010-01-04 Ian Lance Taylor <iant@google.com>
7010 * options.h (class General_options): Add
7011 --allow-multiple-definition and -z muldefs.
7012 * resolve.cc (Symbol_table::should_override): Don't warn about a
7013 multiple symbol definition if --allow-multiple-definition or -z
7017 * options.h (class General_options): Add --add-needed and
7018 --copy-dt-needed-entries. Tweak --as-needed help entry.
7019 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7020 error if --copy-dt-needed-entries aka --add-needed is used and
7021 would cause a change in behaviour.
7024 * options.h (class General_options): Add -G as a short version of
7025 --shared. Add no-op options -assert, -g, and -i.
7027 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7029 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7030 check for .text or .gnu.linkonce.t sections.
7031 * icf.cc (Icf::find_identical_sections): Ditto.
7032 Change the detection for mangled function name within the section
7034 * icf.h (is_section_foldable_candidate): New function.
7036 2009-12-30 Ian Lance Taylor <iant@google.com>
7039 * options.h (class General_options): Permit two dashes with
7040 --retain-symbols-file.
7042 2009-12-30 Ian Lance Taylor <iant@google.com>
7045 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7046 don't put the file header and segment headers in the text
7050 * common.cc (Sort_commons::operator()): Stabilize sort when both
7052 (Symbol_table::do_allocate_commons_list): When allocating common
7053 symbols, skip a symbol which is no longer common.
7054 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7055 an object before checking its type.
7056 * testsuite/common_test_2.c: New file.
7057 * testsuite/common_test_3.c: New file.
7058 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7059 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7060 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7061 (common_test_2_pic.o, common_test_2.so): New targets.
7062 (common_test_3_pic.o, common_test_3.so): New targets.
7063 * testsuite/Makefile.in: Rebuild.
7066 * script.cc (read_input_script): If we see a new SECTIONS clause,
7067 and we have added an input section, give an error.
7068 * layout.h (class Layout): Add have_added_input_section function.
7069 Add have_added_input_section_ field.
7070 * layout.cc (Layout::Layout): Initialize
7071 have_added_input_section_.
7072 (Layout::layout): Set have_added_input_section_.
7073 (Layout::layout_eh_frame): Likewise.
7075 2009-12-30 Ian Lance Taylor <iant@google.com>
7078 * options.h (class General_options): Add --sort-common option.
7079 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7080 * common.cc (Sort_common): Add sort_order parameter to
7081 constructor. Add sort_order_ field.
7082 (Sort_commons::operator): Check sort_order_.
7083 (Symbol_table::allocate_commons): Determine the sort order.
7084 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7086 (Symbol_table::do_allocate_commons_list): Likewise.
7088 2009-12-30 Ian Lance Taylor <iant@google.com>
7091 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7092 symbols from this object, don't change the visibility of an
7094 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7096 2009-12-30 Ian Lance Taylor <iant@google.com>
7099 * script.h (class Version_script_info): Define Language enum.
7100 Update declarations. Define Glob, Exact, and Lookup types. Add
7101 new fields globals_, locals_, and is_finalized_.
7102 * script.cc: Various formatting fixes.
7103 (class Parser_closure): Change language_stack_ from a vector of
7104 std::string to one of Version_script_info::Language. Adjust all
7106 (class Lazy_demangler): Remove.
7107 (struct Version_expression): Change language from std::string to
7108 Version_script_info::Language.
7109 (Version_script_info::Version_script_info): New function.
7110 (Version_script_info::~Version_script_info): Don't call clear.
7111 (Version_script_info::finalize): New function.
7112 (Version_script_info::build_lookup_tables): New function.
7113 (Version_script_info::build_expression_list_lookup): New
7115 (Version_script_info::get_symbol_version_helper): Rewrite to use
7117 (Version_script_info::print_expression_list): Adjust to use
7118 Version_script_info::Language.
7119 (script_push_lex_into_version_mode): Check that the version script
7120 has not been finalized.
7121 (version_script_push_lang): Change language string to
7122 Version_script_info::Language.
7123 * options.cc (Command_line::version_script): New function.
7124 * options.h (class General_options): Add finalize_dynamic_list
7125 function. Change version_script from declaration to definition.
7126 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7127 * testsuite/version_script.map: Remove duplicate def of foo.
7128 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7130 * testsuite/Makefile.in: Rebuild.
7132 2009-12-30 Ian Lance Taylor <iant@google.com>
7135 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7136 if the input symbol index is 0, make the output symbol index 0.
7138 2009-12-30 Ian Lance Taylor <iant@google.com>
7141 * options.h (class General_options): Add -x/--discard-all.
7142 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7143 --discard-all. If the local symbol needs a dynamic entry, check
7144 that before handling --discard-locals.
7146 2009-12-30 Ian Lance Taylor <iant@google.com>
7149 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7151 (Output_segment::add_output_section): Don't change the flags if
7155 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7156 GNU hash table if they need a dynamic value. Otherwise, don't add
7157 them if they are defined in a dynamic object or are forced local.
7159 2009-12-29 Ian Lance Taylor <iant@google.com>
7162 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7163 .gnu.hash table for a 32-bit target.
7166 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7167 regular and a dynamic object only needs a dynamic symbol table
7168 entry if it is externally visible.
7171 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7172 constructor. Add global_offset_table_ field.
7173 (Target_i386::got_section): Set global_offset_table_.
7174 (Target_i386::do_finalize_sections): Set global_offset_table_
7176 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7177 in constructor. Add global_offset_table_ field.
7178 (Target_x86_64::got_section): Set global_offset_table_.
7179 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7182 * layout.cc (Layout::Layout): Initialize increase_relro_.
7183 (Layout::get_output_section): Add is_relro, is_last_relro, and
7184 is_first_non_relro parameters. Change all callers.
7185 (Layout::choose_output_section): Likewise.
7186 (Layout::add_output_section_data): Likewise.
7187 (Layout::make_output_section): Likewise.
7188 (Layout::set_segment_offsets): Clear increase_relro when using a
7190 * layout.h (class Layout): Add increase_relro method. Add
7191 increase_relro_ field. Update declarations.
7192 * output.cc (Output_section::Output_section): Initialize
7193 is_last_relro_ and is_first_non_relro_.
7194 (Output_segment::add_output_section): Group relro sections is
7195 do_sort is true. Handle is_last_relro and is_first_non_relro.
7196 (Output_segment::maximum_alignment): Remove relro handling.
7197 (Output_segment::set_section_addresses): Add increase_relro
7198 parameter. Change all callers. Add initial alignment to align
7199 relro sections on separate page. Remove old relro handling.
7200 (Output_segment::set_section_list_addresses): Remove in_relro
7201 parameter. Change all callers.
7202 (Output_segment::set_offset): Add increase parameter. Change all
7203 callers. Remove old relro handling.
7204 * output.h (class Output_section): Add new methods: is_last_relro,
7205 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7206 Add is_last_relro_ and is_first_non_relro_ fields.
7207 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7208 Create separate .got.plt section. Call increase_relro.
7209 * x86_64.cc (Target_x86_64::got_section): Likewise.
7210 * testsuite/relro_script_test.t: Add .got.plt.
7213 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7214 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7215 (Layout::finalize): Call set_dynamic_symbol_size.
7216 (Layout::set_dynamic_symbol_size): New function.
7217 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7218 set_dynamic_symbol_size.
7221 * output.h (class Output_section): Add is_entsize_zero_ field.
7222 * output.cc (Output_section::Output_section): Initialize
7224 (Output_section::set_entsize): If two different entsizes are
7225 requested, force it to zero.
7226 (Output_section::add_input_section): Set flags for .debug_str
7227 before updating section flags. Set entsize.
7228 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7229 and SHF_STRING if all input sections have those flags.
7231 2009-12-29 Rafael Espindola <espindola@google.com>
7233 * main.cc (main): Fix the sys time reporting.
7234 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7237 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7239 * options.cc (General_options::parse_version): Allow -v to exit
7240 without an error if there is nothing to link.
7242 2009-12-29 Ian Lance Taylor <iant@google.com>
7244 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7245 using a version of gcc before 4.1.
7246 * configure: Rebuild.
7248 2009-12-28 Chris Demetriou <cgd@google.com>
7250 * attributes.cc (Output_attributes_section_data::do_write): Use
7251 std::vector::front rather than std::vector::data.
7253 2009-12-28 Ian Lance Taylor <iant@google.com>
7255 * symtab.h (class Symbol_table): Add enum Defined.
7256 * resolve.cc (Symbol_table::should_override): Add defined
7257 parameter. Change all callers. Test whether object is NULL
7258 before calling a method on it.
7259 (Symbol_table::report_resolve_problem): Add defined parameter.
7261 (Symbol_table::should_override_with_special): Likewise.
7262 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7263 parameter. Change all callers.
7264 (Symbol_table::do_define_in_output_data): Likewise.
7265 (Symbol_table::define_in_output_segment): Likewise.
7266 (Symbol_table::do_define_in_output_segment): Likewise.
7267 (Symbol_table::define_as_constant): Likewise.
7268 (Symbol_table::do_define_as_constant): Likewise.
7269 * script.h (class Symbol_assignment): Add is_defsym parameter to
7270 constructor; change all callers.
7271 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7272 parameter. Change all callers. Add is_defsym_ field.
7273 (class Parser_closure): Add parsing_defsym parameter to
7274 constructor; change all callers. Add parsing_defsym accessor
7275 function. Add parsing_defsym_ field.
7277 2009-12-28 Ian Lance Taylor <iant@google.com>
7279 * gold.cc (queue_middle_tasks): Fix formatting.
7280 * object.cc (Relobj::is_section_name_included): Likewise.
7282 2009-12-23 Ian Lance Taylor <iant@google.com>
7284 * i386.cc (Target_i386::do_calls_non_split): Recognize
7285 -fsplit-stack prologue for a function with a static chain.
7286 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7287 -fsplit-stack prologue when using %r11.
7289 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7291 * options.cc (General_options::parse_version): Make -v continue and do
7292 the link like GNU ld does.
7294 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7296 * Makefile.am (CCFILES): Add timer.cc.
7297 (HFILES): Add timer.h.
7298 * configure.ac: Check for sysconf and times.
7299 * main.cc: include timer.h.
7300 (main): Use Timer instead of get_run_time.
7303 * workqueue.cc: include timer.h.
7304 (Workqueue::find_and_run_task):
7305 Report user, sys and wall time.
7306 * Makefile.in: Regenerate.
7307 * config.in: Regenerate.
7308 * configure: Regenerate.
7310 2009-12-16 Doug Kwan <dougkwan@google.com>
7312 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7314 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7315 relaxed input sections.
7316 * output.cc (Output_section::find_relaxed_input_section): Change
7317 return type to Output_relaxed_input_section pointer. Adjust code
7318 for new type of relaxed_input_section_map_.
7319 * output.h (Output_section::find_relaxed_input_section): Change
7320 return type to Output_relaxed_input_section pointer.
7321 (Output_section::Output_relaxed_input_section_by_input_section_map):
7323 (Output_section::relaxed_input_section_map_): Change type to
7324 Output_section::Output_relaxed_input_section_by_input_section_map.
7325 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7328 2009-12-15 Ian Lance Taylor <iant@google.com>
7330 * layout.cc (Layout::create_shstrtab): Only write out after input
7331 sections if we are compressing debug sections.
7333 2009-12-15 Ian Lance Taylor <iant@google.com>
7335 * archive.cc (Archive::add_symbols): Only look up a symbol without
7336 a version if there is, in fact, a version.
7338 2009-12-14 Ian Lance Taylor <iant@google.com>
7340 Revert -Wshadow changes, all changes from:
7341 2009-12-11 Doug Kwan <dougkwan@google.com>
7342 2009-12-11 Nick Clifton <nickc@redhat.com>
7343 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7345 2009-12-11 Doug Kwan <dougkwan@google.com>
7347 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7349 * attributes.cc (Object_attribute::size): Ditto.
7350 (Attributes_section_data::size): Ditto.
7351 (Attributes_section_data::Attributes_section_data): Ditto.
7352 (Output_attributes_section_data::do_write): Ditto.
7353 * attributes.h (Object_attribute::set_type): Ditto.
7354 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7356 2009-12-11 Nick Clifton <nickc@redhat.com>
7358 * archive.cc: Fix shadowed variable warnings.
7360 * compressed_output.cc: Likewise.
7361 * compressed_output.h: Likewise.
7362 * configure: Likewise.
7363 * dwarf_reader.cc: Likewise.
7364 * dynobj.cc: Likewise.
7365 * dynobj.h: Likewise.
7366 * ehframe.cc: Likewise.
7367 * ehframe.h: Likewise.
7368 * errors.cc: Likewise.
7369 * expression.cc: Likewise.
7370 * fileread.cc: Likewise.
7371 * fileread.h: Likewise.
7372 * freebsd.h: Likewise.
7373 * i386.cc: Likewise.
7375 * incremental.h: Likewise.
7376 * layout.cc: Likewise.
7377 * layout.h: Likewise.
7378 * mapfile.cc: Likewise.
7379 * merge.cc: Likewise.
7380 * merge.h: Likewise.
7381 * object.cc: Likewise.
7382 * object.h: Likewise.
7383 * options.h: Likewise.
7384 * output.cc: Likewise.
7385 * output.h: Likewise.
7386 * parameters.cc: Likewise.
7387 * plugin.cc: Likewise.
7388 * powerpc.cc: Likewise.
7389 * reduced_debug_output.cc: Likewise.
7390 * reduced_debug_output.h: Likewise.
7391 * reloc.cc: Likewise.
7392 * reloc.h: Likewise.
7393 * resolve.cc: Likewise.
7394 * script-sections.cc: Likewise.
7395 * script.cc: Likewise.
7396 * script.h: Likewise.
7397 * sparc.cc: Likewise.
7398 * symtab.cc: Likewise.
7399 * symtab.h: Likewise.
7400 * target-select.cc: Likewise.
7401 * target-select.h: Likewise.
7402 * token.h: Likewise.
7403 * workqueue.cc: Likewise.
7404 * workqueue.h: Likewise.
7405 * x86_64.cc: Likewise.
7407 2009-12-10 Doug Kwan <dougkwan@google.com>
7409 * arm.cc (attributes.h): New include.
7410 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7411 (Arm_relobj::~Arm_relobj): Delete object pointed by
7412 attributes_section_data_.
7413 (Arm_relobj::attributes_section_data): New method definition.
7414 (Arm_relobj::attributes_section_data_): New data member declaration.
7415 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7416 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7417 attributes_section_data_.
7418 (Arm_dynobj::attributes_section_data): New method definition.
7419 (Arm_dynobj::attributes_section_data_): New data member declaration.
7420 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7421 initialization value of may_use_blx_ to false.
7422 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7423 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7424 object attributes to compute results instead of hard-coding.
7425 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7426 Target_arm::get_secondary_compatible_arch,
7427 Target_arm::set_secondary_compatible_arch
7428 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7429 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7430 New method declarations.
7431 (Target_arm::get_aeabi_object_attribute): New method definition.
7432 (Target_arm::attributes_section_data_): New data member declaration.
7433 (read_arm_attributes_section): New template definition.
7434 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7435 (Arm_dynobj::do_read_symbols): Ditto.
7436 (Target_arm::do_finalize_sections): Merge attributes sections from
7437 input. Check for BLX use after attributes section merging.
7438 Fix __exidx_start and __exidx_end visibility. Create an
7439 .ARM.attributes section if necessary.
7440 (Target_arm::get_secondary_compatible_arch,
7441 Target_arm::set_secondary_compatible_arch,
7442 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7443 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7444 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7445 New method definitions.
7447 2009-12-09 Ian Lance Taylor <iant@google.com>
7449 * plugin.cc (Plugin::load): Don't cast from void* to a function
7452 2009-12-09 Ian Lance Taylor <iant@google.com>
7454 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7457 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7459 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7460 Replace two_file_shared_1.so with two_file_shared_2.so.
7461 * testsuite/Makefile.in: Regenerated.
7463 2009-12-08 Doug Kwan <dougkwan@google.com>
7465 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7466 (HFILES): Add attributes.h and int_encoding.h.
7467 * Makefile.in: Regenerate.
7468 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7469 function definitions to int_encoding.cc
7470 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7471 prototypes to int_encoding.h
7472 * reduced_debug_output.cc (int_encoding.h): New include.
7473 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7474 function definitions to int_encoding.cc
7475 (insert_into_vector, read_from_pointer): Move template definitions to
7477 * attributes.cc: New file.
7478 * attributes.h: New file.
7479 * int_encoding.cc: New file.
7480 * int_encoding.h: New file.
7482 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7485 * incremental-dump.cc (dump_incremental_inputs): New.
7486 (main): Use dump_incremental_inputs.
7488 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7491 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7492 checking elfcpp::STT_FUNC.
7493 (Target_i386::Relocate::relocate): Likewise.
7494 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7496 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7497 symbols from shared libraries into normal FUNC symbols.
7499 * symtab.h (Symbol): Add is_func and use it.
7501 2009-12-05 Doug Kwan <dougkwan@google.com>
7503 * arm.cc (Target_arm::arm_info): Initialize new fields
7504 attributes_section and attributes_vendor.
7505 * i386.cc (Target_i386::i386_info): Same.
7506 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7507 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7508 fields attributes_section and attributes_vendor.
7509 * sparc.cc (Target_sparc::sparc_info): Same.
7510 * target.h (Target::attributes_section, Target::attributes_vendor,
7511 Target::is_attributes_section, Target::attribute_arg_type,
7512 Target::attributes_order): New method definitions.
7513 (Target::Target_info::attributes_section,
7514 Target::Target_info::attributes_vendor): New fields.
7515 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7516 virtual method definitions.
7517 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7518 attributes_section and attributes_vendor.
7519 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7521 2009-12-05 Doug Kwan <dougkwan@google.com>
7523 * arm.cc: Update comments about interworking and stub generation.
7524 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7525 considered as non-PIC.
7526 (Arm_relocate_functions::base_abs): Fix formatting.
7527 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7528 of function to use GOT entry address instead of offset.
7529 (Target_arm::Scan::global): Issue an error if a symbol would need a
7530 PLT does not get one because it is untyped. Remove code to create
7531 dynamic symbols for relative branches.
7532 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7533 takes unsigned integer instead of boolean.
7535 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7537 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7538 (two_file_test_LDADD): Likewise.
7539 (common_test_1_LDADD): Likewise.
7540 (exception_test_LDADD) Likewise.
7541 (weak_test_LDADD): Likewise.
7542 (many_sections_test_LDADD): Likewise.
7543 (initpri1_LDADD): Likewise.
7544 (script_test_1_LDADD): Likewise.
7545 (script_test_2_LDADD): Likewise.
7546 (justsyms_LDADD): Likewise.
7547 (binary_test_LDADD): Likewise.
7548 (large_LDADD): Likewise.
7549 * testsuite/Makefile.in: Regenerated.
7551 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
7553 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7554 (Symbol_table::override_with_special): Likewise.
7555 (Symbol_table::add_from_object): Likewise.
7557 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7559 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7560 Don't set the data_offset twice.
7562 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7564 * testsuite/Makefile.in: Regenerate.
7566 2009-12-03 Doug Kwan <dougkwan@google.com>
7568 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7569 (Target_arm::do_finalize_sections): Add parameter for symbol table
7570 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7571 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7572 parameter for symbol table pointer.
7573 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7574 an additional parameter for a pointer to symbol table.
7575 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7576 parameter for a symbol table pointer.
7577 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7578 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7580 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7581 parameter for a symbol table pointer.
7583 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7585 * incremental.cc (Incremental_inputs_header)
7586 (Incremental_inputs_header_write, Incremental_inputs_entry)
7587 (Incremental_inputs_entry_write): Move ...
7588 * incremental.h (Incremental_inputs_header)
7589 (Incremental_inputs_header_write, Incremental_inputs_entry)
7590 (Incremental_inputs_entry_write): here.
7592 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7594 * incremental.cc (make_sized_incremental_binary): Set the target.
7595 Error if it is incompatible.
7596 * output.h (Output_file): Add filename method.
7598 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7600 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7601 from the get_* methods.
7603 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7605 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7606 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7607 Write 0 for the data_offset of scripts.
7609 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7611 * testsuite/Makefile.am: Add the incremental_test.sh test.
7612 * testsuite/incremental_test.sh: New.
7613 * testsuite/incremental_test_1.c: New.
7614 * testsuite/incremental_test_2.c: New.
7616 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
7618 * incremental-dump.cc (main): Fix typos.
7620 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
7623 * incremental-dump.cc (main): Use llu to print 64 bit values.
7625 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7626 H.J. Lu <hongjiu.lu@intel.com>
7628 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7630 (incremental_dump_LDADD): Likewise.
7631 * Makefile.in: Regenerated.
7633 2009-11-25 Doug Kwan <dougkwan@google.com>
7637 2009-11-25 Doug Kwan <dougkwan@google.com>
7639 * arm.cc (Target_arm::Target_arm): Move method definition
7640 outside of class definition. Add code to handle
7641 --target1-rel, --target1-abs and --target2= options.
7642 (Target_arm::get_reloc_reloc_type): Change method to be
7643 non-static and const.
7644 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7645 New data member declaration.
7646 (Target_arm::Scan::local, Target_arm::Scan::global,
7647 Target_arm::Relocate::relocate,
7648 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7649 Adjust call to Target_arm::get_real_reloc_type.
7650 (Target_arm::get_real_reloc_type): Use command line options
7651 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7652 * options.h (--target1-rel, --target1-abs, --target2): New
7655 2009-11-25 Doug Kwan <dougkwan@google.com>
7657 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7658 class definition. Add code to handle --target1-rel, --target1-abs
7659 and --target2= options.
7660 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7662 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7664 (Target_arm::Scan::local, Target_arm::Scan::global,
7665 Target_arm::Relocate::relocate,
7666 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7667 call to Target_arm::get_real_reloc_type.
7668 (Target_arm::get_real_reloc_type): Use command line options to
7669 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7670 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7673 2009-11-25 Doug Kwan <dougkwan@google.com>
7675 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7676 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7677 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7679 (Arm_relocate_functions::thm_call): Replace body with a call to
7680 Arm_relocate_functions::thumb_branch_common.
7681 (Arm_relocate_functions::thm_jump24,
7682 Arm_relocate_functions::thm_xpc22): New method definitions.
7683 (Arm_relocate_functions::thumb_branch_common): New method definition.
7684 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7686 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7687 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7689 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7691 * Makefile.am: Build incremental-dump
7692 * Makefile.in: Regenerate.
7693 * incremental-dump.cc: New.
7694 * incremental.cc (Incremental_inputs_header_data,
7695 Incremental_inputs_entry_data): Move to incremental.h
7696 * incremental.h: (Incremental_inputs_header_data,
7697 Incremental_inputs_entry_data): Move from incremental.cc
7699 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7701 * incremental.cc (Incremental_inputs_header,
7702 Incremental_inputs_header_write, Incremental_inputs_entry,
7703 Incremental_inputs_entry_write): Add a typedef with the data type.
7705 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7707 * incremental.cc (Incremental_inputs_header,
7708 Incremental_inputs_header_write, Incremental_inputs_entry,
7709 Incremental_inputs_entry_write): Update comment about which
7710 type has the filed descriptions.
7712 2009-11-15 Doug Kwan <dougkwan@google.com>
7714 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7715 (Arm_relocate_functions::arm_branch_common): Change method defintion
7716 in class definition to a method declaration and update list of formal
7718 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7719 Arm_relocation_functions::jump24): Adjust call to
7720 Arm_relocate_functions::arm_branch_common. Update list of formal
7722 (Arm_relocate_functions::xpc25): New method definition.
7723 (Arm_relocate_functions::arm_branch_common): Move method defintion
7724 out from class definition. Use stubs for mode-switching and extending
7726 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7727 specially. Change code to enable use of stubs in ARM branches.
7729 2009-11-10 Doug Kwan <dougkwan@google.com>
7731 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7732 in method declaration.
7733 (Target_arm::relocate_stub): New method declaration.
7734 (Target_arm::default_target): Change to return a pointer instead of
7736 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7737 Target_arm::default_target.
7738 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7740 (Target_arm::relocate_section): Adjust view.
7741 (Target_arm::relocate_stub): New method definition.
7743 2009-11-10 Doug Kwan <dougkwan@google.com>
7745 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7747 * incremental.cc (open_incremental_binary): Initialized local
7748 variables to avoid warnings.
7749 * object.cc (make_elf_object): Ditto.
7750 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7753 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7756 * testsuite/plugin_test.c: Include "config.h".
7758 2009-11-09 Doug Kwan <dougkwan@google.com>
7760 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7761 (arm_symbol_value): Remove.
7762 (Arm_relocate_functions::arm_branch_common,
7763 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7764 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7765 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7766 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7767 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7768 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7769 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7770 Arm_relocate_functions::thm_mobw_abs_nc,
7771 Arm_relocate_functions::thm_mov_abs,
7772 Arm_relocate_functions::movw_prel_nc,
7773 Arm_relocate_functions::thm_movt_abs,
7774 Arm_relocate_functions::movt_prel,
7775 Arm_relocate_functions::thm_movw_prel_nc,
7776 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7777 (Target_arm::Relocate::relocate): Only decompose address into two
7778 parts if relocation type uses the thumb-bit and pass the actual
7779 bit instead of a flag indicating that the thumb-bit is used. Adjust
7780 calls to methods in Arm_relocate_functions for this change.
7782 2009-11-08 Ian Lance Taylor <iant@google.com>
7785 * reloc.cc: Instantiate
7786 Sized_relobj::initialize_input_to_output_maps and
7787 Sized_relobj:free_input_to_output_maps.
7789 2009-11-06 Ian Lance Taylor <iant@google.com>
7792 * defstd.cc (in_segment): Set only_if_ref true for "end".
7794 2009-11-06 Doug Kwan <dougkwan@google.com>
7796 * arm.cc (class Reloc_stub): Correct a comment.
7797 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7798 (Target_arm::scan_section_for_stubs): New method declaration.
7799 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7800 Change methods from private to protected.
7801 (Target_arm::do_may_relax): New method definition.
7802 (Target_arm::do_relax, Target_arm::group_sections,
7803 Target_arm::scan_reloc_for_stub,
7804 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7805 (Target_arm::arm_input_section_map_): New data member declaration.
7806 (Target_arm::scan_reloc_for_stub,
7807 Target_arm::scan_reloc_section_for_stubs,
7808 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7809 Target_arm::do_relax): New method definitions.
7811 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7813 * configure.ac: Check for (struct stat)::st_mtim
7814 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7815 * config.in: Regenerate.
7816 * configure: Regenerate.
7818 2009-11-05 Ian Lance Taylor <iant@google.com>
7821 * output.cc (Output_segment::add_output_section): Add missing
7824 2009-11-04 Ian Lance Taylor <iant@google.com>
7827 * object.h (class Object): Add is_needed and set_is_needed
7828 methods. Add is_needed_ field. Make bool fields into bitfields.
7829 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7830 defined in a dynamic object and referenced by a regular object,
7831 set is_needed for the dynamic object.
7832 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7833 if the file is marked with as_needed and it is not needed.
7835 2009-11-04 Ian Lance Taylor <iant@google.com>
7838 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7839 tags if data is discarded by linker script.
7840 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7841 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7842 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7843 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7845 2009-11-04 Ian Lance Taylor <iant@google.com>
7847 * layout.cc (Layout::get_output_section): Add is_interp and
7848 is_dynamic_linker_section parameters. Change all callers.
7849 (Layout::choose_output_section): Likewise.
7850 (Layout::make_output_section): Likewise.
7851 (Layout::add_output_section_data): Add is_dynamic_linker_section
7852 parameter. Change all callers.
7853 * layout.h (class Layout): Update declarations.
7854 * output.h (class Output_section): Add is_interp, set_is_interp,
7855 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7856 Add is_interp_, is_dynamic_linker_section_ fields. Change
7857 generate_code_fills_at_write_ to a bitfield.
7858 * output.cc (Output_section::Output_sections): Initialize new
7860 (Output_segment::add_output_section): Add do_sort parameter.
7863 2009-11-03 Ian Lance Taylor <iant@google.com>
7866 * options.h (class General_options): Add --warn-common.
7867 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7868 merging two common symbols.
7869 (Symbol_table::should_override): Handle --warn-common when merging
7870 a common symbol with a defined symbol. Use report_resolve_problem
7871 for multiple definitions.
7872 (Symbol_table::report_resolve_problem): New function.
7873 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7875 2009-11-03 Doug Kwan <dougkwan@google.com>
7877 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7879 (Target_arm::stub_factory): New method definition.
7880 (Target_arm::new_arm_input_section,
7881 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7882 Target_arm::reloc_uses_thumb_bit): New method declarations.
7883 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
7884 New type definitions.
7885 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7886 member declarations.
7887 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7888 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7889 New method definitions.
7891 2009-11-03 Ian Lance Taylor <iant@google.com>
7893 * options.h (class General_options): Add --warn_constructors.
7895 2009-11-03 Ian Lance Taylor <iant@google.com>
7898 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7899 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7901 2009-11-03 Ian Lance Taylor <iant@google.com>
7904 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7905 --msgid-bugs-address.
7906 (install-pdf): New target.
7907 (install-data_yes): Look up one directory to find mkinstalldirs.
7909 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7911 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7914 2009-10-30 Doug Kwan <dougkwan@google.com>
7916 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7918 2009-10-30 Doug Kwan <dougkwan@google.com>
7920 * arm.cc (Stub_addend_reader): New struct template definition
7921 and partial specializations.
7922 (Stub_addend_reader::operator()): New method definition for a
7923 partially specialized template.
7925 2009-10-30 Doug Kwan <dougkwan@google.com>
7927 * arm.cc (Arm_relobj::processor_specific_flags): New method
7929 (Arm_relobj::do_read_symbols): New method declaration.
7930 (Arm_relobj::processor_specific_flags_): New data member declaration.
7931 (Arm_dynobj): New class definition.
7932 (Target_arm::do_finalize_sections): Add input_objects parameter.
7933 (Target_arm::do_adjust_elf_header): New method declaration.
7934 (Target_arm::are_eabi_versions_compatible,
7935 (Target_arm::merge_processor_specific_flags): New method declaration.
7936 (Target_arm::do_make_elf_object): New overloaded method definitions
7938 (Arm_relobj::do_read_symbols): New method definition.
7939 (Arm_dynobj::do_read_symbols): Ditto.
7940 (Target_arm::do_finalize_sections): Add input_objects parameters.
7941 Merge processor-specific flags from all input objects.
7942 (Target_arm::are_eabi_versions_compatible,
7943 Target_arm::merge_processor_specific_flags,
7944 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7945 New method definitions.
7946 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7947 Input_objects pointer type parameter.
7948 * layout.cc (Layout::finalize): Pass input objects to target's.
7949 finalize_sections function.
7950 * output.cc (Output_file_header::do_sized_write): Set ELF file
7951 header's processor-specific flags.
7952 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7953 Input_objects pointer type parameter.
7954 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7955 * target.h (Input_objects): New forward class declaration.
7956 (Target::processor_specific_flags,
7957 Target::are_processor_specific_flags_sect): New method definitions.
7958 (Target::finalize_sections): Add input_objects parameter.
7959 (Target::Target): Initialize processor_specific_flags_ and
7960 are_processor_specific_flags_set_.
7961 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7963 (Target::set_processor_specific_flags): New method definition.
7964 (Target::processor_specific_flags_,
7965 Target::are_processor_specific_flags_set_): New data member
7967 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7968 Input_objects pointer type parameter.
7970 2009-10-30 Doug Kwan <dougkwan@google.com>
7972 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7974 2009-10-28 Ian Lance Taylor <iant@google.com>
7976 * object.h (class Relobj): Drop options parameter from
7977 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7978 do_scan_relocs, do_relocate. Change all callers.
7979 (class Sized_relobj): Drop options parameters from
7980 do_gc_process_relocs, do_scan_relocs, do_relocate,
7981 do_relocate_sections, relocate_sections, emit_relocs_scan,
7982 emit_relocs_scan_reltype. Change all callers.
7983 (struct Relocate_info): Remove options field and all references to
7985 * reloc.h (class Read_relocs): Remove options constructor
7986 parameter and options_ field. Change all callers.
7987 (class Gc_process_relocs, class Scan_relocs): Likewise.
7988 (class Relocate_task): Likewise.
7989 * target-reloc.h (scan_relocs): Remove options parameter. Change
7991 (scan_relocatable_relocs): Likewise.
7992 * target.h (class Sized_target): Remove options parameter from
7993 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7995 * gc.h (gc_process_relocs): Remove options parameter. Change all
7997 * arm.cc: Update functions to remove options parameters.
7998 * i386.cc: Likewise.
7999 * powerpc.cc: Likewise.
8000 * sparc.cc: Likewise.
8001 * x86_64.cc: Likewise.
8002 * testsuite/testfile.cc: Likewise.
8004 2009-10-28 Doug Kwan <dougkwan@google.com>
8006 * arm.cc (Arm_relobj): New class definition.
8007 (Arm_relobj::scan_sections_for_stubs,
8008 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8009 New method definitions.
8011 2009-10-28 Cary Coutant <ccoutant@google.com>
8013 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8014 (Plugin::cleanup_done_): New member.
8015 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8016 (Plugin_manager::cleanup_done_): Remove.
8017 (Plugin_manager::add_input_file): Edit error message.
8018 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8019 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8021 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8023 * fileread.cc: (File_read::View::~View): Use the new
8024 data_ownership_ filed.
8025 (File_read::~File_read): Dispose the new whole_file_view_.
8026 (File_read::open): Mmap the whole file if needed.
8027 (File_read::open): Use whole_file_view_ instead of contents_.
8028 (File_read::find_view): Use whole_file_view_ if applicable.
8029 (File_read::do_read): Use whole_file_view_ instead of contents_.
8030 (File_read::make_view): Use whole_file_view_ instead of contents_,
8031 update File_read::View::View call.
8032 (File_read::find_or_make_view): Update File_read::View::View
8034 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8036 (File_read::View::Data_ownership): New enum.
8037 (File_read::View::View): Replace bool mapped_ with Data_ownership
8039 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8040 (File_read::View::data_ownership_): New field.
8041 (File_read::contents_): Remove (replaced by whole_file_view_).
8042 (File_read::whole_file_view_): New field.
8043 * options.h (class General_options): Add --keep-files-mapped.
8045 2009-10-27 Cary Coutant <ccoutant@google.com>
8047 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8048 * testsuite/Makefile.am (plugin_test_5): New test case.
8049 * testsuite/Makefile.in: Regenerate.
8051 2009-10-25 Doug Kwan <dougkwan@google.com>
8053 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8054 from private to protected to allow access by child class.
8055 (Sized_relobj::do_relocate_sections): New method declaration.
8056 (Sized_relobj::relocate_sections): Virtualize.
8057 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8058 Sized_relobj::relocate_sections. Instantiate template explicitly
8059 for different target sizes and endianity.
8061 2009-10-24 Doug Kwan <dougkwan@google.com>
8063 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8064 (Arm_input_section::as_arm_input_section): New method.
8065 (Arm_output_section): New class definition.
8066 (Arm_output_section::create_stub_group,
8067 Arm_output_section::group_sections): New method definitions.
8069 2009-10-22 Doug Kwan <dougkwan@google.com>
8071 * arm.cc (Arm_input_section): New class definition.
8072 (Arm_input_section::init, Arm_input_section:do_write,
8073 Arm_input_section::set_final_data_size,
8074 Arm_input_section::do_reset_address_and_file_offset): New method
8077 2009-10-21 Doug Kwan <dougkwan@google.com>
8079 * arm.cc (Stub_table, Arm_input_section): New forward class
8081 (Stub_table): New class defintion.
8082 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8083 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8084 New method definition.
8086 2009-10-21 Doug Kwan <dougkwan@google.com>
8088 * arm.cc: Update copyright comments.
8089 (Target_arm): New forward class template declaration.
8090 (Arm_address): New type.
8091 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8092 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8093 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8095 (Insn_template): Same.
8096 (DEF_STUBS): New macro.
8097 (Stub_type): New enum type.
8098 (Stub_template): New class definition.
8101 (Stub_factory): Same.
8102 (Target_arm::Target_arm): Initialize may_use_blx_ and
8103 should_force_pic_veneer_.
8104 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8105 Target_arm::should_force_pic_veneer,
8106 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8107 Target_arm::using_thumb_only, Target_arm:;default_target): New
8109 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8110 New data member declarations.
8111 (Insn_template::size, Insn_template::alignment): New method defintions.
8112 (Stub_template::Stub_template): New method definition.
8113 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8114 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8115 (Stub_factory::Stub_factory): New method definition.
8116 * gold.h (string_hash): New template.
8117 * output.h (Input_section_specifier::hash_value): Use
8119 (Input_section_specifier::string_hash): Remove.
8120 * stringpool.cc (Stringpool_template::string_hash): Use
8123 2009-10-20 Doug Kwan <dougkwan@google.com>
8125 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8126 symbols of relaxed input sections.
8127 * output.h (Output_section::find_relaxed_input_section): Make
8130 2009-10-16 Doug Kwan <dougkwan@google.com>
8132 * dynobj.cc (Versions::Versions): Initialize version_script_.
8133 Only insert base version symbol definition for a shared object
8134 if version script defines any version versions.
8135 (Versions::define_base_version): New method definition.
8136 (Versions::add_def): Check that base version is not needed.
8137 (Versions::add_need): Define base version lazily.
8138 * dynobj.h (Versions::define_base_version): New method declaration.
8139 (Versions::needs_base_version_): New data member declaration.
8140 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8141 (check_DATA): Add no_version_test.stdout.
8142 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8144 * testsuite/Makefile.in: Regenerate.
8145 * testsuite/no_version_test.c: New file.
8146 * testsuite/no_version_test.sh: Ditto.
8148 2009-10-16 Doug Kwan <dougkwan@google.com>
8150 * expression.cc (class Segment_start_expression): New class definition.
8151 (Segment_start_expression::value): New method definition.
8152 (script_exp_function_segment_start): Return a new
8153 Segment_start_expression.
8154 * gold/script-c.h (script_saw_segment_start_expression): New function
8156 * script-sections.cc (Script_sections::Script_sections): Initialize
8157 SAW_SEGMENT_START_EXPRESSION_ to false.
8158 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8159 and -Tbbs options to specify section addresses if given in
8160 command line and no SEGMENT_START expression is seen in a script.
8161 * script-sections.h (Script_sections::saw_segment_start_expression,
8162 Script_sections::set_saw_segment_start_expression): New method
8164 (Script_sections::saw_segment_start_expression_): New data member
8166 * script.cc (script_saw_segment_start_expression): New function.
8167 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8168 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8169 script_test_7.sh and script_test_8.sh.
8170 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8171 script_test_8.stdout.
8172 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8173 (script_test_6, script_test_6.stdout, script_test_7,
8174 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8175 * Makefile.in: Regenerate.
8176 * testsuite/script_test_6.sh: New file.
8177 * testsuite/script_test_6.t: Same.
8178 * testsuite/script_test_7.sh: Same.
8179 * testsuite/script_test_7.t: Same.
8180 * testsuite/script_test_8.sh: Same.
8182 2009-10-16 Doug Kwan <dougkwan@google.com>
8184 * output.cc (Output_segment::set_section_list_address): Cast
8185 expressions to unsigned long long type to avoid format warnings.
8187 2009-10-15 Ian Lance Taylor <iant@google.com>
8189 * script.cc (Script_options::add_symbol_assignment): Always add a
8190 dot assignment to script_sections_.
8191 * script-sections.cc (Script_sections::add_dot_assignment):
8192 Initialize if necessary.
8194 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8195 program headers with no load segment if there is a linker script.
8197 * layout.cc (Layout::set_segment_offsets): Align the file offset
8198 to the segment aligment for -N or -n with no load segment.
8199 * output.cc (Output_segment::add_output_section): Don't crash if
8200 the first section is a TLS section.
8201 (Output_segment::set_section_list_addresses): Print an error
8202 message if the address moves backward in a linker script.
8203 * script-sections.cc
8204 (Output_section_element_input::set_section_addresses): Don't
8205 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8206 (Orphan_output_section::set_section_addresses): Likewise.
8208 2009-10-15 Doug Kwan <dougkwan@google.com>
8210 * layout.cc (Layout::finish_dynamic_section): Generate tags
8211 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8212 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8213 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8215 2009-10-14 Ian Lance Taylor <iant@google.com>
8217 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8219 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8220 data_shdr fields of relinfo.
8221 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8222 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8223 R_386_TLS_LDO_32, adjust based on section flags.
8224 (Target_i386::Relocate::fix_up_ldo): Remove.
8226 2009-10-13 Ian Lance Taylor <iant@google.com>
8228 Add support for -pie.
8229 * options.h (class General_options): Add -pie and
8231 (General_options::output_is_position_independent): Test -pie.
8232 (General_options::output_is_executable): Return true if not shared
8233 and not relocatable.
8234 (General_options::output_is_pie): Remove.
8235 * options.cc (General_options::finalize): Reject incompatible uses
8237 * gold.cc (queue_middle_tasks): A -pie link is not static.
8238 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8239 * symtab.cc (Symbol::final_value_is_known): Return false if
8240 output_is_position_independent.
8241 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8242 output_is_position_independent.
8243 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8244 output_is_position_independent.
8245 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8246 output_is_position_independent.
8247 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8249 (basic_pie_test.o, basic_pie_test): New targets.
8250 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8251 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8252 (two_file_pie_test): New target.
8253 * testsuite/Makefile.in: Rebuild.
8254 * README: Remove note saying that -pie is not supported.
8256 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8258 * options.h (class General_options): Add -init and -fini.
8259 * layout.cc (Layout::finish_dynamic_section): Emit
8260 given init and fini functions.
8262 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8264 * gc.h (gc_process_relocs): Check if icf is enabled using new
8266 * gold.cc (queue_initial_tasks): Likewise.
8267 (queue_middle_tasks): Likewise.
8268 * object.cc (do_layout): Likewise.
8269 * symtab.cc (is_section_folded): Likewise.
8270 * main.cc (main): Likewise.
8271 * reloc.cc (Read_relocs::run): Likewise.
8272 (Sized_relobj::do_scan_relocs): Likewise.
8273 * icf.cc (is_function_ctor_or_dtor): New function.
8274 (Icf::find_identical_sections): Check if function is ctor or dtor when
8276 * options.h (General_options::icf): Change option to be an enum.
8277 (Icf_status): New enum.
8278 (icf_enabled): New method.
8279 (icf_safe_folding): New method.
8280 (set_icf_status): New method.
8281 (icf_status_): New variable.
8282 * (options.cc) (General_options::finalize): Set icf_status_.
8283 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8284 icf_test and icf_keep_unique_test to use the --icf enum flag.
8285 * testsuite/icf_safe_test.sh: New file.
8286 * testsuite/icf_safe_test.cc: New file.
8288 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8290 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8291 includes to gc.h and icf.h.
8292 * arm.cc: Include gc.h.
8293 * gold.cc: Likewise.
8294 * i386.cc: Likewise.
8295 * powerpc.cc: Likewise.
8296 * sparc.cc: Likewise.
8297 * x86_64.cc: Likewise.
8298 * gc.h: Include icf.h.
8300 2009-10-11 Ian Lance Taylor <iant@google.com>
8302 * plugin.cc: Include "gold.h" before other header files.
8304 2009-10-10 Chris Demetriou <cgd@google.com>
8306 * options.h (Input_file_argument::Input_file_type): New enum.
8307 (Input_file_argument::is_lib_): Replace with...
8308 (Input_file_argument::type_): New member.
8309 (Input_file_argument::Input_file_argument): Take Input_file_type
8310 'type' rather than boolean 'is_lib' as second argument.
8311 (Input_file_argument::is_lib): Use type_.
8312 (Input_file_argument::is_searched_file): New function.
8313 (Input_file_argument::may_need_search): Handle is_searched_file.
8314 * options.cc (General_options::parse_library): Support -l:filename.
8315 (General_options::parse_just_symbols): Update for Input_file_argument
8317 (Command_line::process): Likewise.
8318 * archive.cc (Archive::get_file_and_offset): Likewise.
8319 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8320 * script.cc (read_script_file, script_add_file): Likewise.
8321 * fileread.cc (Input_file::Input_file): Likewise.
8322 (Input_file::will_search_for): Handle is_searched_file.
8323 (Input_file::open): Likewise.
8324 * readsyms.cc (Read_symbols::get_name): Likewise.
8325 * testsuite/Makefile.am (searched_file_test): New test.
8326 * testsuite/Makefile.in: Regenerate.
8327 * testsuite/searched_file_test.cc: New file.
8328 * testsuite/searched_file_test_lib.cc: New file.
8330 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8331 Ian Lance Taylor <iant@google.com>
8333 * descriptor.cc: Include <cstdio> and "binary-io.h".
8334 (Descriptors::open): Open the files in binary mode always.
8335 * script.cc (Lex::get_token): Treat \r as whitespace.
8337 2009-10-09 Ian Lance Taylor <iant@google.com>
8339 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8341 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8342 Ian Lance Taylor <iant@google.com>
8344 * configure.ac: Check for readv function also.
8345 * fileread.cc (readv): Define if not HAVE_READV.
8346 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8348 * config.in: Regenerate.
8349 * configure: Regenerate.
8351 2009-10-09 Doug Kwan <dougkwan@google.com>
8353 * layout.cc (Layout::make_output_section): Call target hook to make
8354 ordinary output section.
8355 (Layout::finalize): Adjust parameter list of call the
8356 Target::may_relax().
8357 * layout.h (class Layout::section_list): New method.
8358 * merge.h (Output_merge_base::entsize): Change visibility to public.
8359 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8361 (Output_merge_string::do_is_string): New method.
8362 * object.cc (Sized_relobj::do_setup): renamed from
8363 Sized_relobj::set_up.
8364 * object.h (Sized_relobj::adjust_shndx,
8365 Sized_relobj::initializ_input_to_output_maps,
8366 Sized_relobj::free_input_to_output_maps): Change visibilities to
8368 (Sized_relobj::setup): Virtualize.
8369 (Sized_relobj::do_setup): New method declaration.
8370 (Sized_relobj::invalidate_section_offset,
8371 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8372 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8373 * options.cc (parse_int): New function.
8374 * options.h (parse_int): New declaration.
8375 (DEFINE_int): New macro.
8376 (stub_group_size): New option.
8377 * output.cc (Output_section::Output_section): Initialize memebers
8378 merge_section_map_, merge_section_by_properties_map_,
8379 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8380 (Output_section::add_input_section): Handled deferred code-fill
8381 generation and remove an old comment.
8382 (Output_section::add_relaxed_input_section): New method definition.
8383 (Output_section::add_merge_input_section): Use merge section by
8384 properties map to speed to search. Update merge section maps
8386 (Output_section::build_relaxation_map): New method definition.
8387 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8389 (Output_section::relax_input_section): Renamed to
8390 Output_section::convert_input_sections_to_relaxed_sections and change
8391 interface to take a vector of pointers to relaxed sections.
8392 (Output_section::find_merge_section,
8393 Output_section::find_relaxed_input_section): New method definitions.
8394 (Output_section::is_input_address_mapped,
8395 Output_section::output_offset, Output_section::output_address):
8396 Use output section data maps to speed up searching.
8397 (Output_section::find_starting_output_address): Add comments.
8398 (Output_section::do_write,
8399 Output_section::write_to_postprocessing_buffer): Do code-fill
8400 generation as appropriate.
8401 (Output_section::get_input_sections): Invalidate relaxed input section
8403 (Output_section::restore_states): Adjust type of checkpoint .
8404 Invalidate relaxed input section map.
8405 * output.h (Output_merge_base): New class declaration.
8406 (Input_section_specifier): New class defintion.
8407 (class Output_relaxed_input_section) Change base class to
8408 Output_section_data_build.
8409 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8410 base class initializer.
8411 (Output_section::add_relaxed_input_section): New method declaration.
8412 (Output_section::Input_section): Change visibility to protected.
8413 (Output_section::Input_section::relobj,
8414 Output_section::Input_section::shndx): Handle relaxed input sections.
8415 Output_section::input_sections) Change visibility to protected. Also
8416 define overload to return a non-const pointer.
8417 (Output_section::Merge_section_properties): New class defintion.
8418 (Output_section::Merge_section_by_properties_map,
8419 Output_section::Output_section_data_by_input_section_map,
8420 Output_section::Relaxation_map): New types.
8421 (Output_section::relax_input_section): Rename method to
8422 Output_section::convert_input_sections_to_relaxed_sections and change
8423 interface to take a vector of relaxed section pointers.
8424 (Output_section::find_merge_section,
8425 Output_section::find_relaxed_input_section,
8426 Output_section::build_relaxation_map,
8427 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8428 New method declarations.
8429 (Output_section::merge_section_map_
8430 Output_section::merge_section_by_properties_map_,
8431 Output_section::relaxed_input_section_map_,
8432 Output_section::is_relaxed_input_section_map_valid_,
8433 Output_section::generate_code_fills_at_write_): New data members.
8434 * script-sections.cc
8435 (Output_section_element_input::set_section_addresses): Call
8436 current_data_size and addralign methods of relaxed input sections.
8437 (Orphan_output_section::set_section_addresses): Call current_data_size
8438 and addralign methods of relaxed input sections.
8439 * symtab.cc (Symbol_table::compute_final_value): Extract template
8440 from the body of Symbol_table::sized_finalize_symbol.
8441 (Symbol_table::sized_finalized_symbol): Call
8442 Symbol_table::compute_final_value.
8443 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8444 (Symbol_table::compute_final_value): New templated method declaration.
8445 * target.cc (Target::do_make_output_section): New method defintion.
8446 * target.h (Target::make_output_section): New method declaration.
8447 (Target::relax): Add more parameters for input objects, symbol table
8448 and layout. Adjust call to do_relax.
8449 (Target::do_make_output_section): New method declaration.
8450 (Target::do_relax): Add parameters for input objects, symbol table
8453 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8455 * pread.c: Include stdio.h.
8457 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8459 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8462 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8464 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8465 Change read_shndx type to unsigned int.
8466 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8468 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8469 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8470 Change read_shndx type to unsigned int.
8471 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8473 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8474 * layout.cc (Layout::create_symtab_sections): Cast the result of
8475 local_symcount * symsize to off_t in the gold_assert.
8477 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8479 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8480 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8482 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8483 (Arm_relocate_functions::thm_abs5): New function.
8484 (Arm_relocate_functions::abs12): New function.
8485 (Arm_relocate_functions::abs16): New function.
8486 (Arm_relocate_functions::base_abs): New function.
8487 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8488 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8489 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8491 (Scan::global): Likewise.
8492 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8493 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8494 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8495 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8498 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8500 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8501 (Arm_relocate_functions::movt_prel): New function.
8502 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8503 (Arm_relocate_functions::thm_movt_prel): New function.
8504 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8505 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8506 (Scan::global, Relocate::relocate): Likewise.
8507 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8509 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8511 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8512 Incremental_checker.
8513 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8515 (class Incremental_inputs_header): New class.
8516 (Incremental_inputs_header_writer): Edit comment.
8517 (Incremental_inputs_entry): New class.
8518 (Incremental_inputs_entry_writer): Edit comment.
8519 (Sized_incremental_binary::do_find_incremental_inputs_section):
8520 Add *strtab_shndx parameter, fill it.
8521 (Sized_incremental_binary::do_check_inputs): New method.
8522 (Incremental_checker::can_incrementally_link_output_file): Use
8523 Sized_incremental_binary::check_inputs.
8524 (Incremental_inputs::report_command_line): Save command line in
8527 (Incremental_binary::find_incremental_inputs_section): New
8529 (Incremental_binary::do_find_incremental_inputs_section): Add
8530 strtab_shndx parameter.
8531 (Incremental_binary::do_check_inputs): New pure virtual method.
8532 (Sized_incremental_binary::do_check_inputs): Declare.
8533 (Incremental_checker::Incremental_checker): Add incremental_inputs
8534 parameter, use it to initialize incremental_inputs_.
8535 (Incremental_checker::incremental_inputs_): New field.
8536 (Incremental_checker::command_line): New method.
8537 (Incremental_checker::inputs): New method.
8538 (Incremental_checker::command_line_): New field.
8540 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8542 * incremental.cc: Include <cstdarg> and "target-select.h".
8543 (vexplain_no_incremental): New function.
8544 (explain_no_incremental): New function.
8545 (Incremental_binary::error): New method.
8546 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8548 (make_sized_incremental_binary): New function.
8549 (open_incremental_binary): New function.
8550 (can_incrementally_link_file): Add checks if output is ELF and has
8552 * incremental.h: Include "elfcpp_file.h" and "output.h".
8553 (Incremental_binary): New class.
8554 (Sized_incremental_binary): New class.
8555 (open_incremental_binary): Declare.
8556 * object.cc (is_elf_object): Use
8557 elfcpp::Elf_recognizer::is_elf_file.
8558 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8559 * output.h (Output_file::filesize): New method.
8561 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8563 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8565 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8566 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8568 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8570 (Arm_relocate_functions::movw_abs_nc): New function.
8571 (Arm_relocate_functions::movt_abs): New function.
8572 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8573 (Arm_relocate_functions::thm_movt_abs): New function.
8574 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8575 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8576 (Scan::global): Likewise.
8577 (Relocate::relocate): Likewise.
8578 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8580 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8582 * arm.cc (Arm_relocate_functions::got_prel) New function.
8583 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8584 (Relocate::relocate): Likewise.
8585 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8587 2009-10-06 Ian Lance Taylor <iant@google.com>
8589 * options.h (class General_options): Define
8590 split_stack_adjust_size parameter.
8591 * object.h (class Object): Add uses_split_stack_ and
8592 has_no_split_stack_ fields. Add uses_split_stack and
8593 has_no_split_stack accessor functions. Declare
8594 handle_split_stack_section.
8595 (class Reloc_symbol_changes): Define.
8596 (class Sized_relobj): Define Function_offsets. Declare
8597 split_stack_adjust, split_stack_adjust_reltype, and
8599 * object.cc (Object::handle_split_stack_section): New function.
8600 (Sized_relobj::do_layout): Call handle_split_stack_section.
8601 * dynobj.cc (Sized_dynobj::do_layout): Call
8602 handle_split_stack_section.
8603 * reloc.cc (Sized_relobj::relocate_sections): Call
8604 split_stack_adjust for executable sections in split_stack
8605 objects. Pass reloc_map to relocate_section.
8606 (Sized_relobj::split_stack_adjust): New function.
8607 (Sized_relobj::split_stack_adjust_reltype): New function.
8608 (Sized_relobj::find_functions): New function.
8609 * target-reloc.h: Include "object.h".
8610 (relocate_section): Add reloc_symbol_changes parameter. Change
8612 * target.h (class Target): Add calls_non_split method. Declare
8613 do_calls_non_split virtual method. Declare match_view and
8615 * target.cc: Include "elfcpp.h".
8616 (Target::do_calls_non_split): New function.
8617 (Target::match_view): New function.
8618 (Target::set_view_to_nop): New function.
8619 * gold.cc (queue_middle_tasks): Give an error if mixing
8620 split-stack and non-split-stack objects with -r.
8621 * i386.cc (Target_i386::relocate_section): Add
8622 reloc_symbol_changes parameter.
8623 (Target_i386::do_calls_non_split): New function.
8624 * x86_64.cc (Target_x86_64::relocate_section): Add
8625 reloc_symbol_changes parameter.
8626 (Target_x86_64::do_calls_non_split): New function.
8627 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8629 * powerpc.cc (Target_powerpc::relocate_section): Add
8630 reloc_symbol_changes parameter.
8631 * sparc.cc (Target_sparc::relocate_section): Add
8632 reloc_symbol_changes parameter.
8633 * configure.ac: Call AM_CONDITIONAL for the default target.
8634 * configure: Rebuild.
8635 * testsuite/Makefile.am (TEST_AS): New variable.
8636 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8637 (check_DATA): Add split_i386 and split_x86_64 files.
8638 (SPLIT_DEFSYMS): Define.
8639 (split_i386_[1234n].o): New targets.
8640 (split_i386_[124]): New targets.
8641 (split_i386_[1234r].stdout): New targets.
8642 (split_x86_64_[1234n].o): New targets.
8643 (split_x86_64_[124]): New targets.
8644 (split_x86_64_[1234r].stdout): New targets.
8645 (MOSTLYCLEANFILES): Add new executables.
8646 * testsuite/split_i386.sh: New file.
8647 * testsuite/split_x86_64.sh: New file.
8648 * testsuite/split_i386_1.s: New file.
8649 * testsuite/split_i386_2.s: New file.
8650 * testsuite/split_i386_3.s: New file.
8651 * testsuite/split_i386_4.s: New file.
8652 * testsuite/split_i386_n.s: New file.
8653 * testsuite/split_x86_64_1.s: New file.
8654 * testsuite/split_x86_64_2.s: New file.
8655 * testsuite/split_x86_64_3.s: New file.
8656 * testsuite/split_x86_64_4.s: New file.
8657 * testsuite/split_x86_64_n.s: New file.
8658 * testsuite/testfile.cc (Target_test): Update relocation_section
8660 * testsuite/Makefile.in: Rebuild.
8662 2009-10-06 Ian Lance Taylor <iant@google.com>
8664 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8665 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8666 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8667 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8668 the address on ldo_addrs_.
8669 (Target_i386::Relocate::fix_up_ldo): New function.
8671 2009-10-06 Rafael Espindola <espindola@google.com>
8673 * plugin.cc (add_input_library): New.
8674 (Plugin::load): Add add_input_library to tv.
8675 (Plugin_manager::add_input_file): Add the is_lib argument.
8676 (add_input_file): Update call to Plugin_manager::add_input_file.
8677 (add_input_library): New.
8678 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8680 2009-09-30 Doug Kwan <dougkwan@google.com>
8682 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8683 symbol and call Symbol::may_need_copy_reloc to determine if
8684 a copy reloc is needed.
8685 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8686 nocopyreloc is given in command line.
8687 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8688 given in command line.
8689 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8690 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8691 of the removed Target_i386::may_need_copy_reloc.
8692 * options.h (copyreloc): New option with default value false.
8693 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8694 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8695 instead of the removed Target_powerpc::may_need_copy_reloc.
8696 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8697 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8698 instead of the removed Target_sparc::may_need_copy_reloc.
8699 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8700 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8701 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8702 instead of the removed Target_x86_64::may_need_copy_reloc.
8704 2009-09-30 Ian Lance Taylor <iant@google.com>
8706 * object.h (class Object): Remove target_ field, and target,
8707 sized_target, and set_target methods.
8708 (Object::sized_target): Remove.
8709 (class Sized_relobj): Update declarations. Remove sized_target.
8710 * object.cc (Sized_relobj::setup): Remove target parameter.
8712 (Input_objects::add_object): Don't do anything with the target.
8713 (make_elf_sized_object): Add punconfigured parameter. Change all
8714 callers. Set or test parameter target.
8715 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8717 * parameters.cc (Parameters::set_target): Change parameter type to
8719 (Parameters::default_target): Remove.
8720 (set_parameters_target): Change parameter type to be non-const.
8721 (parameters_force_valid_target): New function.
8722 (parameters_clear_target): New function.
8723 * parameters.h (class Parameters): Update declarations. Remove
8724 default_target method. Add sized_target and clear_target
8725 methods. Change target_ to be non-const.
8726 (set_parameters_target): Update declaration.
8727 (parameters_force_valid_target): Declare.
8728 (parameters_clear_target): Declare.
8729 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8730 as NULL if we aren't searching.
8731 (Add_symbols::run): Don't check for compatible target.
8732 * fileread.cc (Input_file::open_binary): Call
8733 parameters_force_valid_target.
8734 * gold.cc (queue_middle_tasks): Likewise.
8735 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8736 set_target on object.
8737 * dynobj.h (class Sized_dynobj): Update declarations.
8738 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8739 make_elf_object returns NULL.
8740 (Archive::include_member): Don't check whether object target is
8742 * output.cc (Output_section::add_input_section): Get target from
8744 (Output_section::relax_input_section): Likewise.
8745 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8747 (Sized_relobj::do_scan_relocs): Likewise.
8748 (Sized_relobj::relocate_sections): Likewise.
8749 * resolve.cc (Symbol_table::resolve): Likewise.
8750 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8751 parameter. Change all callers.
8752 (Symbol_table::add_from_object): Get target from parameters.
8753 (Symbol_table::add_from_relobj): Don't check object target.
8754 (Symbol_table::add_from_dynobj): Likewise.
8755 (Symbol_table::define_special_symbol): Get target from
8757 * symtab.h (class Symbol_table): Update declaration.
8758 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8759 parameter. Change all callers. Clear parameter target.
8760 (Binary_test): Test target here.
8761 * testsuite/object_unittest.cc (gold_testsuite): Remove
8762 target_test_pointer parameter. Change all callers.
8763 (Object_test): Test target here.
8765 2009-09-26 Ian Lance Taylor <iant@google.com>
8767 * testsuite/initpri1.c: Don't try to use constructor priorities if
8768 compiling with gcc before 4.3.
8770 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8772 * testsuite/retain_symbols_file_test.sh (check_present): Change
8773 output file name to retain_symbols_file_test.stdout.
8774 (check_absent): Likewise.
8776 2009-09-18 Craig Silverstein <csilvers@google.com>
8778 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8779 * options.cc: Include <cerrno> and <fstream>.
8780 (General_options::finalize): Parse -retain-symbols-file tag.
8781 * options.h: New flag.
8782 (General_options): New method should_retain_symbol, new
8783 variable symbols_to_retain.
8784 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8785 should_retain_symbol map.
8786 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8787 * testsuite/Makefile.in: Regenerate.
8788 * testsuite/retain_symbols_file_test.sh: New file.
8790 2009-09-18 Nick Clifton <nickc@redhat.com>
8792 * po/es.po: Updated Spanish translation.
8794 2009-09-17 Doug Kwan <dougkwan@google.com>
8796 * debug.h (DEBUG_RELAXATION): New constant.
8797 (DEBUG_ALL): Add DEBUG_RELAXATION.
8798 (debug_string_to_enum): Add relaxation debug option.
8800 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8801 Layout::Relaxation_debug_check::read_sections,
8802 Layout::Relaxation_debug_check::read_sections): New method definitions.
8803 (Layout::Layout): Initialize data members
8804 record_output_section_data_from_scrips_,
8805 script_output_section_data_list_ and relaxation_debug_check_.
8806 (Layout::save_segments, Layout::restore_segments,
8807 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8808 Layout::relaxation_loop_body): New method definitions.
8809 (Layout::finalize): Support relaxation. Move section layout code to
8810 Layout::relaxation_loop_body.
8811 (Layout::set_asection_address_from_script): Move code for orphan
8812 section placement out.
8813 (Layout::place_orphan_sections_in_script): New method definition.
8814 * layout.h (Output_segment_headers, Output_file_header):
8815 New forward class declarations.
8816 (Layout::~Layout): Define.
8817 (Layout::new_output_section_data_from_script): New method definition.
8818 (Layout::place_orphan_sections_in_script): New method declaration.
8819 (Layout::Segment_states): New type declaration.
8820 (Layout::save_segments, Layout::restore_segments,
8821 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8822 Layout::relaxation_loop_body): New method declarations.
8823 (Layout::Output_section_data_list): New type declaration.
8824 (Layout::Relaxation_debug_check): New class definition.
8825 (Layout::record_output_section_data_from_script_,
8826 Layout::script_output_section_data_list_, Layout::segment_states_,
8827 Layout::relaxation_debug_check_): New data members.
8828 * output.cc: (Output_section_headers::do_size): New method definition.
8829 (Output_section_headers::Output_section_headers): Move size
8830 computation to Output_section_headers::do_size.
8831 (Output_segment_headers::do_size): New method definition.
8832 (Output_file_header::Output_file_header): Move size computation to
8833 Output_file_header::do_size and call it.
8834 (Output_file_header::do_size): New method definition.
8835 (Output_data_group::Output_data_group): Adjust call to
8836 Output_section_data.
8837 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8838 (Output_symtab_xindex::do_write): Add array bound check.
8839 (Output_section::Input_section::print_to_mapfile): Handle
8840 RELAXED_INPUT_SECTION_CODE.
8841 (Output_section::Output_section): Initialize data member checkpoint_.
8842 (Output_section::~Output_section): Delete checkpoint object pointed
8844 (Output_section::add_input_section): Always add an Input_section if
8846 (Output_section::add_merge_input_section): Add assert.
8847 (Output_section::relax_input_section): New method definition.
8848 (Output_section::set_final_data_size): Set load address to zero for
8849 an unallocated section.
8850 (Output_section::do_address_and_file_offset_have_reset_values):
8851 New method definition.
8852 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8853 Handle relaxed input section.
8854 (Output_section::sort_attached_input_sections): Checkpoint input
8855 section list lazily.
8856 (Output_section::get_input_sections): Change type of input_sections to
8857 list of Simple_input_section pointers. Checkpoint input section list
8858 lazily. Also handle relaxed input sections.
8859 (Output_section::add_input_section_for_script): Take a reference to
8860 a Simple_input_section object instead of Relobj pointer and section
8861 index as parameter. Handle relaxed input sections.
8862 (Output_section::save_states, Output_section::restore_states): New
8864 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8865 (Output_data::is_data_size_fixed): New method definition.
8866 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8868 (Output_data::address_and_file_offset_have_reset_values): New method
8870 (Output_data::do_address_and_file_offset_have_reset_values): New method
8872 (Output_data::set_data_size): Check that data size is not fixed.
8873 (Output_data::fix_data_size): New method definition.
8874 (Output_data::is_data_size_fixed_): New data member.
8875 (Output_section_headers::set_final_data_size): New method definition.
8876 (Output_section_headers::do_size): New method declaration.
8877 (Output_segment_headers::set_final_data_size): New method definition.
8878 (Output_segment_headers::do_size): New method declaration.
8879 (Output_file_header::set_final_data_size)::New method definition.
8880 (Output_file_header::do_size)::New method declaration.
8881 (Output_section_data::Output_section_data): Add new parameter
8882 is_data_size_fixed and use it to fix data size.
8883 (Output_data_const::Output_data_const): Adjust call to base class
8884 constructor and fix data size.
8885 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8886 base class constructor and fix data size.
8887 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8888 base class constructor and fix data size.
8889 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8890 class constructor and fix data size.
8891 (Output_data_group::set_final_data_size): New method definition.
8892 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8893 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8894 class constructor and fix data size.
8895 (Output_relaxed_input_section): New class definition.
8896 (Output_section::Simple_input_section): New class definition.
8897 (Output_section::get_input_sections): Adjust parameter list.
8898 (Output_section::add_input_section_for_script): Same.
8899 (Output_section::save_states, Output_section::restore_states,
8900 Output_section::do_address_and_file_offset_have_reset_values,
8901 (Output_section::Input_section::Input_section): Handle
8902 RELAXED_INPUT_SECTION_CODE. Add new overload for
8903 Output_relaxed_input_section.
8904 (Output_section::Input_section::is_input_section,
8905 Output_section::Input_section::set_output_section): Handle relaxed
8907 (Output_section::Input_section::is_relaxed_input_section,
8908 Output_section::Input_section::output_section_data,
8909 Output_section::Input_section::relaxed_input_section): New method
8911 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8913 (Output_section::Input_section::u1_): Update comments.
8914 (Output_section::Input_section::u2_): Add new union member poris.
8915 (Output_section::Checkpoint_output_section): New classs definition.
8916 (Output_section::relax_input_section): New method declaration.
8917 (Output_section::checkpoint_): New data member.
8918 (Output_segment): Update comments.
8919 (Output_segment::Output_segment): Un-privatize copy constructor.
8920 (Output_segment::operator=): Un-privatize.
8921 * script-sections.cc (Output_section_element::Input_section_list):
8922 Change element type to Output_section::Simple_input_section.
8923 (Output_section_element_dot_assignment::set_section_addresses):
8924 Register output section data for relaxation clean up.
8925 (Output_data_exression::Output_data_expression): Adjust call to base
8926 constructor to fix data size.
8927 (Output_section_element_data::set_section_addresses): Register
8928 Output_data_expression object for relaxation clean up.
8929 (struct Input_section_info): Replace Relobj pointer and section index
8930 pair with Output_section::Simple_input_section and Convert struct to a
8932 (Input_section_sorter::operator()): Adjust access to
8933 Input_section_info data member to use accessors.
8934 (Output_section_element_input::set_section_addresses): Use layout
8935 parameter. Adjust code to use Output_section::Simple_input_section
8936 and Input_secction_info classes. Register filler for relaxation
8938 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8939 and section index pair with Output_section::Simple_input_section
8940 class. Adjust code accordingly.
8941 (Phdrs_element::release_segment): New method definition.
8942 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8944 (Script_sections::release_segments): New method definition.
8945 * gold/script-sections.h (Script_sections::release_segments): New
8947 * gold/target.h (Target::may_relax, Target::relax,
8948 Target::do_may_relax, Target::do_relax): New method definitions.
8950 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8952 * arm.cc (has_signed_unsigned_overflow): New function.
8953 (Arm_relocate_functions::abs8): New function.
8954 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8955 (Target_arm::Scan::global): Likewise.
8956 (Target_arm::relocate::relocate): Likewise.
8957 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8960 2009-09-16 Cary Coutant <ccoutant@google.com>
8962 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8963 * testsuite/Makefile.in: Regenerate.
8965 2009-09-11 Nick Clifton <nickc@redhat.com>
8967 * po/gold.pot: Updated by the Translation project.
8969 2009-09-08 Cary Coutant <ccoutant@google.com>
8971 * output.cc (Output_file::open): Add execute permission to empty file.
8972 * testsuite/Makefile.am (permission_test): New test.
8973 * testsuite/Makefile.in: Regenerate.
8975 2009-09-02 Ian Lance Taylor <iant@google.com>
8977 * output.cc (Output_file::resize): Call map_no_anonymous rather
8980 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8982 * gold.cc: Include "incremental.h".
8983 (queue_initial_tasks): Call Incremental_checker methods.
8984 * incremental.cc: Include "output.h".
8985 (Incremental_checker::can_incrementally_link_output_file): New
8987 * incremental.h (Incremental_checker): New class.
8989 * output.cc (Output_file::open_for_modification): New method.
8990 (Output_file::map_anonymous): Changed return type to bool. Record
8992 (Output_file::map_no_anonymous): New method, broken out of map.
8993 (Output_file::map): Use map_no_anonymous and map_anonymous.
8994 * output.h (class Output_file): Update declarations.
8996 2009-08-24 Cary Coutant <ccoutant@google.com>
8998 * options.h (Command_line::Pre_options): New class.
8999 (Command_line::pre_options): New member.
9000 * options.cc (gold::options::ready_to_register): New variable.
9001 (One_option::register_option): Do nothing if not registering options.
9002 Assert if same short option registered twice.
9003 (General_options::General_options): Turn off option registration when
9005 (Command_line::Pre_options::Pre_options): New constructor.
9007 2009-08-24 Cary Coutant <ccoutant@google.com>
9009 * options.h (General_options::no_keep_memory): Remove incorrect
9012 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9014 * Makefile.am (am__skiplex, am__skipyacc): New.
9015 * Makefile.in: Regenerate.
9017 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9019 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9020 (INCLUDES): ... this.
9021 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9022 (AM_CPPFLAGS): Renamed from ...
9023 (INCLUDE): ... this.
9024 * Makefile.in, testsuite/Makefile.in: Regenerate.
9026 * Makefile.in: Regenerate.
9027 * aclocal.m4: Likewise.
9028 * config.in: Likewise.
9029 * configure: Likewise.
9030 * testsuite/Makefile.in: Likewise.
9032 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9033 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9034 * Makefile.in: Regenerate.
9035 * testsuite/Makefile.in: Regenerate.
9037 2009-08-19 Cary Coutant <ccoutant@google.com>
9039 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9040 symbols in shared libraries overridden by hidden or internal symbols
9041 in the main program.
9043 2009-08-19 Chris Demetriou <cgd@google.com>
9045 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9046 checking source file names in error messages.
9048 2009-08-18 Doug Kwan <dougkwan@google.com>
9050 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9051 an elcpp::Ehdr as parameter. Adjust call to set_target.
9052 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9053 an elfcpp::Ehdr as parameter.
9054 * object.cc (Object::set_target): Remove the version that looks up
9055 a target and sets it.
9056 (Sized_relobj::setup): Take a Target object instead of
9057 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9058 (make_elf_sized_object): Find target and ask target to
9060 * object.h: (Object::set_target): Remove the version that looks up
9061 a target and sets it.
9062 (Sized_relobj::setup): Take a Target object instead of
9063 an elfcpp:Ehdr as parameter.
9064 * target.cc: Include dynobj.h.
9065 (Target::do_make_elf_object_implementation): New.
9066 (Target::do_make_elf_object): New.
9067 * target.h (Target::make_elf_object): New template declaration.
9068 (Target::do_make_elf_object): New method declarations.
9069 (Target::do_make_elf_object_implementation): New template declaration.
9071 2009-08-14 Ian Lance Taylor <iant@google.com>
9073 * gold.h (FUNCTION_NAME): Define.
9074 (gold_unreachable): Use FUNCTION_NAME.
9076 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9078 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9079 symbol in the --keep-unique list is not found.
9081 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9083 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9084 been maked as --keep-unique.
9085 (Icf::unfold_section): New function.
9086 * icf.h (Icf::unfold_section): New function.
9087 * options.h (General_options::keep_unique): New option.
9088 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9089 * testsuite/Makefile.in: Regenerate.
9090 * testsuite/icf_keep_unique_test.sh: New file.
9091 * testsuite/icf_keep_unique_test.cc: New file.
9093 2009-08-12 Cary Coutant <ccoutant@google.com>
9096 * resolve.cc (Symbol_table::resolve): Check for references from
9097 dynamic objects to hidden and internal symbols.
9098 * testsuite/Makefile.am (hidden_test.sh): New test.
9099 * testsuite/Makefile.in: Regenerate.
9100 * testsuite/hidden_test.sh: New script.
9101 * testsuite/hidden_test_1.c: New test source.
9102 * testsuite/hidden_test_main.c: New test source.
9104 2009-08-11 Doug Kwan <dougkwan@google.com>
9106 * arm.cc: Update comments.
9107 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9108 segment to locate the .ARM.exidx section if present.
9110 2009-08-09 Doug Kwan <dougkwan@google.com>
9112 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9115 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9116 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9119 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9121 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9122 valid tls_segment only for non-debug-section relocations.
9123 * testsuite/Makefile.am: Add gc_tls_test.
9124 * testsuite/Makefile.in: Regenerate.
9125 * testsuite/gc_tls_test.cc: New file.
9126 * testsuite/gc_tls_test.sh: New file.
9128 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9132 * Makefile.am (CCFILES): Add icf.cc.
9134 * Makefile.in: Regenerate.
9135 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9136 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9137 section, symbol and addend information for the relocs.
9138 * gold.cc (queue_middle_tasks): Call identical code folding.
9139 * gold.h: Add defines for multimap.
9140 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9141 to the call of finalize_local_symbols.
9142 * main.cc (main): Create object of class Icf.
9143 * object.cc (Sized_relobj::do_layout): Allow this function to be
9144 called twice during icf.
9145 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9146 to sections marked as identical by icf.
9147 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9149 (Sized_relobj::do_section_entsize): New function.
9150 * object.h (Object::section_entsize): New function.
9151 (Object::do_section_entsize): New pure virtual function.
9152 (Relobj::finalize_local_symbols): Add new parameter.
9153 (Relobj::do_section_entsize): New function.
9154 * options.h (General_options::icf): New option.
9155 (General_options::icf_iterations): New option.
9156 (General_options::print_icf_sections): New option.
9157 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9158 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9159 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9161 * symtab.cc (Symbol_table::is_section_folded): New function.
9162 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9163 to sections marked as identical by icf.
9164 * symtab.h (Symbol_table::set_icf): New function.
9165 (Symbol_table::icf): New function.
9166 (Symbol_table::is_section_folded): New function.
9167 (Symbol_table::icf_): New data member.
9168 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9169 * testsuite/Makefile.am: Add commands to build icf_test.
9170 * testsuite/Makefile.in: Regenerate.
9171 * testsuite/icf_test.sh: New file.
9172 * testsuite/icf_test.cc: New file.
9174 2009-07-24 Chris Demetriou <cgd@google.com>
9176 * layout.cc (is_compressible_debug_section): Fix incorrect
9177 comment about compressed section names.
9179 2009-07-20 Ian Lance Taylor <ian@airs.com>
9182 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9184 2009-07-16 Ian Lance Taylor <iant@google.com>
9187 * layout.h: #include <map>.
9188 (class Kept_section): Change from struct to class. Add accessors
9189 and setters. Add section size to Comdat_group mapping. Change
9190 Comdat_group to std::map. Add is_comdat_ field. Add
9191 linkonce_size field in union.
9192 (class Layout): Update declaration of find_or_add_kept_section.
9193 Don't declare find_kept_object.
9194 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9195 parameter. Add object, shndx, is_comdat, and is_group_name
9196 parameters. Change all callers. Adjust for new Kept_section.
9197 (Layout::find_kept_object): Remove.
9198 * object.cc (Sized_relobj::include_section_group): Update use of
9199 Kept_section. Rename secnum to shndx. Only record
9200 Kept_comdat_section if sections are the same size.
9201 (Sized_relobj::include_linkonce_section): Update use of
9202 Kept_section. Only record Kept_comdat_section if sections are the
9203 same size. Set size of linkonce section.
9204 (Sized_relobj::map_to_kept_section): Update call to
9205 get_kept_comdat_section.
9206 * object.h (class Sized_relobj): Rename fields in
9207 Kept_comdat_section to drop trailing underscores; change object
9208 field to Relobj*. Change Kept_comdat_section_table to store
9209 struct rather than pointer.
9210 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9211 Add kept_object and kept_shndx parameters. Change all callers.
9212 (Sized_relobj::get_kept_comdat_section): Change return type to
9213 bool. Add kept_object and kept_shndx parameters. Change all
9215 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9216 Layout::find_or_add_kept_section.
9218 2009-07-09 Ian Lance Taylor <iant@google.com>
9220 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9221 Reserve space in the hash table.
9223 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9225 * fileread.cc (File_read::get_mtime): New method.
9226 * fileread.h (Timespec): New structure.
9227 (File_read::get_mtime): New method.
9228 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9229 Renamed from timestamp_nsec.
9230 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9232 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9234 (Incremental_inputs::report_archive): Save mtime; style fix.
9235 (Incremental_inputs::report_obejct): Save mtime; style fix.
9236 (Incremental_inputs::report_script): Save mtime; style fix.
9237 (Incremental_inputs::finalize_inputs): Style fix.
9238 (Incremental_inputs::finalize): Style fix.
9239 (Incremental_inputs::create_input_section_data): Store inputs
9241 * incremental.h (Incremental_inputs::report_script): Add mtime
9243 (Incremental_inputs::Input_info::Input_info): Intialize only one
9245 (Incremental_inputs::Input_info::archive): Move to nameless
9247 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9248 (Incremental_inputs::Input_info::script): Move to nameless union.
9249 (Incremental_inputs::mtime): New field.
9250 * script.cc (read_input_script): Pass file mtime to
9252 * script.h (Script_info::inputs): Style fix.
9254 2009-07-01 Ian Lance Taylor <ian@airs.com>
9256 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9259 2009-06-24 Ian Lance Taylor <iant@google.com>
9262 * layout.cc (Layout::choose_output_section): If we find an
9263 existing section, update the flags.
9264 (Layout::create_notes): New function, broken out of
9266 (Layout::finalize): Don't create note sections.
9267 (Layout::create_note): Don't crash if linker script discards
9269 (Layout::create_gold_note): Likewise.
9270 (Layout::create_build_id): Likewise. Don't set
9271 after_input_sections on the section.
9272 (Layout::create_executable_stack_info): Remove target parameter.
9274 * layout.h (class Layout): Declare create_notes. Update
9275 declaration of create_executable_stack_info.
9276 * gold.cc (queue_middle_tasks): Call create_notes.
9277 * output.cc (Output_section::update_flags_for_input_section): Move
9278 here from output.h. If SHF_ALLOC flag is newly set, mark address
9280 * output.h (Output_data::mark_address_invalid): New function.
9281 (class Output_section): Only declare, not define,
9282 update_flags_for_input_section. Remove set_flags.
9284 2009-06-24 Ian Lance Taylor <iant@google.com>
9286 * script-sections.cc (Output_section_definition::
9287 set_section_addresses): Rename shadowing local load_address to
9290 2009-06-24 Ian Lance Taylor <iant@google.com>
9293 * reloc.cc (relocate_sections): Skip empty relocation sections.
9295 2009-06-23 Ian Lance Taylor <iant@google.com>
9298 * layout.cc (Layout::create_note): Use choose_output_section
9299 rather than make_output_section.
9301 2009-06-23 Ian Lance Taylor <iant@google.com>
9304 * options.cc (General_options::parse_V): Set printed_version_.
9305 (General_options::General_options): Initialize printed_version_.
9306 * options.h (class General_options): Add printed_version_ field.
9307 * gold.cc (queue_initial_tasks): If there are no input files,
9308 don't give a fatal error if we printed the version information.
9309 (queue_middle_tasks): If using -r with a shared object, give a
9310 fatal error rather than an ordinary error.
9312 2009-06-23 Ian Lance Taylor <iant@google.com>
9315 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9316 (Layout::make_output_section): Set have_stabstr_section_ if we see
9317 a .stab*str section.
9318 (Layout::finalize): Call link_stabs_sections.
9319 (Layout::link_stabs_sections): New file.
9320 * layout.h (class Layout): Add have_stabstr_section_ field.
9321 Declare link_stabs_sections.
9323 2009-06-23 Doug Kwan <dougkwan@google.com>
9325 * Makefile.am (libgold_a_LIBADD): New.
9326 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9327 * Makefile.in: Regenerate.
9328 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9329 * configure: Regenerate.
9330 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9331 * fileread.cc: Include sys/state.h
9332 * gold.h: Declare memmem and strndup if found missing.
9333 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9335 2009-06-23 Ian Lance Taylor <iant@google.com>
9337 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9338 * configure: Rebuild.
9340 2009-06-23 Ian Lance Taylor <iant@google.com>
9343 * object.cc (Object::section_contents): Don't try to get a view if
9344 the section has length zero.
9345 (Object::handle_gnu_warning_section): If the section is empty, use
9346 the name of the section as the warning.
9348 2009-06-23 Ian Lance Taylor <iant@google.com>
9351 * stringpool.h (class Stringpool_template): Add optimize_ field.
9352 (Stringpool_template::set_optimize): New function.
9353 * stringpool.cc (Stringpool_template::Stringpool_template):
9354 Initialize optimize_ field.
9355 (Stringpool_template::set_string_offsets): Test local optimize
9356 fild rather than parameter.
9357 * layout.cc (Layout::Layout): Call set_optimize on the section
9360 2009-06-22 Ian Lance Taylor <iant@google.com>
9363 * yyscript.y: Parse TARGET.
9364 * script.cc (script_set_target): New function.
9365 * script-c.h (script_set_target): Declare.
9366 * options.cc (General_options::string_to_object_format): Rename
9367 from string_to_object_format in anonymous namespace. Change
9369 * options.h (class General_options): Declare
9370 string_to_object_format.
9372 2009-06-22 Ian Lance Taylor <iant@google.com>
9374 * script-sections.cc (Script_sections::create_segments): Don't put
9375 program headers in a PT_LOAD segment if -n or -N.
9377 2009-06-22 Ian Lance Taylor <iant@google.com>
9380 * options.h (class General_options): Add -z lazy and -z now. Sort
9381 -z options into alphabetical order.
9382 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9384 2009-06-21 Ian Lance Taylor <iant@google.com>
9386 * layout.cc (Layout::make_output_section): Call
9387 Target::new_output_section.
9388 (Layout::attach_allocated_section_to_segment): Put large section
9389 sections in a separate load segment with the large segment flag
9391 (Layout::segment_precedes): Sort large data segments after other
9393 (align_file_offset): New static function.
9394 (Layout::set_segment_offsets): Use align_file_offset.
9395 * output.h (class Output_section): Add is_small_section_ and
9396 is_large_section_ fields.
9397 (Output_section::is_small_section): New function.
9398 (Output_section::set_is_small_section): New function.
9399 (Output_section::is_large_section): New function.
9400 (Output_section::set_is_large_section): New function.
9401 (Output_section::is_large_data_section): New function.
9402 (class Output_segment): Add is_large_data_segment_ field.
9403 (Output_segment::is_large_data_segment): New function.
9404 (Output_segment::set_is_large_data_segment): New function.
9405 * output.cc (Output_section::Output_section): Initialize new
9407 (Output_segment::Output_segment): Likewise.
9408 (Output_segment::add_output_section): Add assertion that large
9409 data sections always go in large data segments. Force small data
9410 sections to the end of the list of data sections. Force small BSS
9411 sections to the start of the list of BSS sections. For large BSS
9412 sections to the end of the list of BSS sections.
9413 * symtab.h (class Symbol): Declare is_common_shndx.
9414 (Symbol::is_defined): Check Symbol::is_common_shndx.
9415 (Symbol::is_common): Likewise.
9416 (class Symbol_table): Define enum Commons_section_type. Update
9417 declarations. Add small_commons_ and large_commons_ fields.
9418 * symtab.cc (Symbol::is_common_shndx): New function.
9419 (Symbol_table::Symbol_table): Initialize new fields.
9420 (Symbol_table::add_from_object): Put small and large common
9421 symbols in the right list.
9422 (Symbol_table::sized_finalized_symbol): Check
9423 Symbol::is_common_shndx.
9424 (Symbol_table::sized_write_globals): Likewise.
9425 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9426 common symbol lists. Don't call do_allocate_commons_list if the
9428 (Symbol_table::do_allocate_commons_list): Remove is_tls
9429 parameter. Add comons_section_type parameter. Change all
9430 callers. Handle small and large common symbols.
9431 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9432 Symbol::is_common_shndx.
9433 * resolve.cc (symbol_to_bits): Likewise.
9434 * target.h (Target::small_common_shndx): New function.
9435 (Target::small_common_section_flags): New function.
9436 (Target::large_common_shndx): New function.
9437 (Target::large_common_section_flags): New function.
9438 (Target::new_output_section): New function.
9439 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9440 small_common_section_flags, and large_common_section_flags
9442 (Target::do_new_output_section): New virtual function.
9443 * arm.cc (Target_arm::arm_info): Initialize new fields.
9444 * i386.cc (Target_i386::i386_info): Likewise.
9445 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9447 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9448 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9449 (Target_x86_64::do_new_output_section): New function.
9450 * configure.ac: Define conditional MCMODEL_MEDIUM.
9451 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9452 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9453 (large_LDFLAGS): Define.
9454 * testsuite/large.c: New file.
9455 * testsuite/testfile.cc (Target_test::test_target_info):
9456 Initialize new fields.
9457 * configure, testsuite/Makefile.in: Rebuild.
9459 2009-06-05 Doug Kwan <dougkwan@google.com>
9461 * Makefile.am (CCFILES): Add target.cc.
9462 * Makefile.in: Regenerate.
9463 * i386.cc (class Target_i386): Define new virtual method to
9464 override do_is_local_label_name in parent.
9465 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9466 local symbols if --discard-locals or -X is given.
9467 * options.h (class General_options): Declare new options
9468 '--discard-locals' and '-X' for discarding locals.
9469 * target.h (class Target): Define new methods is_local_label_name.
9470 Declare new virtual method do_is_local_label_name.
9471 * target.cc: New file.
9472 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9473 (check_SCRIPTS): Add discard_locals_test.sh.
9474 (check_DATA): Add discard_local_tests.syms.
9475 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9476 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9477 * testsuite/Makefile.in: Regenerate.
9478 * testsuite/discard_locals_test.c: New file.
9479 * testsuite/discard_locals_test.sh: Same.
9481 2009-06-05 Doug Kwan <dougkwan@google.com>
9483 * object.cc (Sized_relobj::Sized_relobj): Initialize
9484 discarded_eh_frame_shndx_ to -1U.
9485 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9487 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9488 a discarded .eh_frame section.
9489 (Sized_relobj::do_finalize_local_symbols): Ditto.
9490 * object.h (class Sized_relobj): Declare new member
9491 discarded_eh_frame_shndx_.
9492 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9493 (local_labels_test.o, local_labels_test): New rules.
9494 * testsuite/Makefile.in: Regenerate.
9496 2009-06-04 Doug Kwan <dougkwan@google.com>
9498 * layout.cc (Layout::section_name_mapping): Add mapping for
9499 special ARM sections.
9501 2009-06-03 Doug Kwan <dougkwan@google.com>
9503 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9504 (utils::has_overflow): Same.
9506 2009-06-03 Ian Lance Taylor <iant@google.com>
9508 * layout.cc (Layout::section_name_mapping): New array, replacing
9509 Layout::linkonce_mapping.
9510 (Layout::section_name_mapping_count): New variable, replacing
9511 Layout::linkonce_mapping_count.
9512 (Layout::linkonce_output_name): Remove.
9513 (Layout::output_section_name): Rewrite.
9514 * layout.h (class Layout): Rename Linkonce_mapping to
9515 Section_name_mapping, linkonce_mapping to section_name_mapping,
9516 linkonce_mapping_count to section_name_mapping_count. Don't
9517 declare linkonce_output_name.
9519 2009-06-03 Doug Kwan <dougkwan@google.com>
9521 * gold/arm.cc (namespace utils): New.
9522 (Target_arm::reloc_is_non_pic): Define new method.
9523 (class Arm_relocate_functions): New.
9524 (Target_arm::Relocate::relocate): Handle relocation types used by
9527 2009-06-03 Ian Lance Taylor <iant@google.com>
9529 * arm.cc (Target_arm::scan::global): Use || instead of |.
9531 2009-06-02 Doug Kwan <dougkwan@google.com>
9533 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9534 issued_non_pic_error_.
9535 (class Target_arm::Scan): Declare new method check_non_pic.
9536 Define new method symbol_needs_plt_entry.
9537 Declare new data member issued_non_pic_error_.
9538 (class Target_arm::Relocate): Declare new method
9539 should_apply_static_reloc.
9540 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9541 (Target_arm::Scan::check_non_pic): Define new method.
9542 (Target_arm::Scan::local): Handle a small subset of reloc types used
9544 (Target_arm::Scan::local): Same.
9545 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9547 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9549 * incremental.cc (Incremental_inputs::report_command_line): Filter
9550 out --incremental-* options.
9552 2009-05-29 Doug Kwan <dougkwan@google.com>
9554 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9556 (class Target_arm): Update comment.
9557 (Target_arm::Target_arm): Initialize new data members GOT_,
9558 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9559 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9560 and Target_arm::rel_dyn_section.
9561 Declare new_enum Target_arm::Got_type.
9562 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9564 Update commments for member do_dynsym_value.
9565 (Target_arm::got_size, Target_arm::plt_section,
9566 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9567 new methods inside class defintion.
9568 (Target_arm::got_section): Define new method.
9569 (Target_arm::rel_dyn_section): Same.
9570 (Output_data_plt_arm): New template class.
9571 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9572 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9573 (Output_data_plt_arm::add_entry): Same.
9574 (Output_data_plt_arm::first_plt_entry): Define new
9575 static data member for PLT instruction template.
9576 (Output_data_plt_arm::plt_entry): Same.
9577 (Output_data_plt_arm::do_write): Define new method.
9578 (Target_arm::make_plt_entry): Same.
9579 (Target_arm::do_finalize_sections): Same.
9580 (Target_arm::do_dynsym_value): Same.
9582 2009-05-28 Doug Kwan <dougkwan@google.com>
9584 * Makefile.am (TARGETSOURCES): Add arm.cc.
9585 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9586 * Makefile.in: Regenerate.
9588 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9590 2009-05-26 Doug Kwan <dougkwan@google.com>
9592 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9593 (General_options::check_excluded_libs): Strip off directories in
9594 archive name before matching like GNU ld does.
9595 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9596 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9597 (exclude_libs_test_LDFLAGS): Add linker option
9598 -Wl,--exclude-libs,libexclude_libs_test_3
9599 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9600 an explicit archive without using -l.
9601 (alt/libexclude_libs_test_3.a): New make rule.
9602 * testsuite/Makefile.in: Regenerate.
9603 * testsuite/exclude_libs_test.c : Declare lib3_default().
9605 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9606 * exclude_libs_test_3.c: New file.
9608 2009-05-26 Nick Clifton <nickc@redhat.com>
9610 * po/id.po: New Indonesian translation.
9611 * po/gold.pot: Updated template file.
9613 2009-05-22 Sriraman Tallam <tmsriram@google.com>
9615 * testsuite/Makefile.am: Add -ffunction-sections to compile
9616 gc_comdat_test files. Add -Wl,--gc-sections to build
9618 * testsuite/Makefile.in: Regenerate.
9619 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9621 2009-05-21 Sriraman Tallam <tmsriram@google.com>
9623 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9624 kept comdat section was garbage collected.
9625 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9626 * testsuite/Makefile.in: Regenerate.
9627 * testsuite/gc_comdat_test.sh: New file.
9628 * testsuite/gc_comdat_test_1.cc: New file.
9629 * testsuite/gc_comdat_test_2.cc: New file.
9631 2009-05-19 Doug Kwan <dougkwan@google.com>
9633 * archive.cc (Archive::Archive): Move constructor from archive.h
9634 to here. Initialize no_export_.
9635 (Archive::get_elf_object_for_member): Set no_export flag of object.
9636 * archive.h (Archive::Archive): Move constructor body to
9638 (Archive::no_export): New method.
9639 (Archive::no_export_): New field.
9640 * object.h (Object::Object): Initialize no_export_ to false.
9641 (Object::no_export, Object::set_no_export): New methods.
9642 (Object::no_export_): New field.
9643 * options.cc (General_options::parse_exclude_libs): New method.
9644 (General_options::check_excluded_libs) Same.
9645 * options.h (exclude_libs): New option.
9646 (General_options::check_excluded_libs): New method declaration.
9647 (General_options::excluded_libs_): New field.
9648 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9649 default or protected visibility if an object has no-export flag set.
9650 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9651 (check_SCRIPTS): Add exclude_libs_test.sh.
9652 (check_DATA): Add exclude_libs_test.syms.
9653 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9654 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9655 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9656 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9657 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9658 libexclude_libs_test_2.a): New rules.
9659 * testsuite/Makefile.in: Regenerate.
9660 * testsuite/exclude_libs_test.c: New file.
9661 * testsuite/exclude_libs_test.sh: Ditto.
9662 * testsuite/exclude_libs_test_1.c: Ditto.
9663 * testsuite/exclude_libs_test_2.c: Ditto.
9665 2009-05-15 Ian Lance Taylor <iant@google.com>
9667 * configure.ac: Check for declarations for cases where libiberty.h
9668 checks HAVE_DECL_xxx.
9669 * configure, config.in: Rebuild.
9671 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9673 * gold.h (Incremental_argument_list): Remove (invalid) forward
9675 * incremental.cc (Incremental_inputs::report_achive): New method.
9676 (Incremental_inputs::report_object): New method.
9677 (Incremental_inputs::report_script): New method.
9678 (Incremental_inputs::finalize_inputs): New method.
9679 (Incremental_inputs::finalize): Call finalize_inputs().
9680 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9681 Create inputs entries.
9682 * incremental.h (Incremental_input_type): New enum.
9683 (Incremental_inputs::Incremental_input): Initialize new fields.
9684 (Incremental_inputs::report_inputs): New method.
9685 (Incremental_inputs::report_achive): New method.
9686 (Incremental_inputs::report_object): New method.
9687 (Incremental_inputs::report_script): New method.
9688 (Incremental_inputs::finalize_inputs): New method.
9689 (Incremental_inputs::Input_info): New struct.
9690 (Incremental_inputs::Input_info_map): New typedef.
9691 (Incremental_inputs::lock_): New field.
9692 (Incremental_inputs::Inputs_): New field.
9693 (Incremental_inputs::Inputs_map): New field.
9694 * main.cc (main): Call Incremental_input::report_inputs.
9695 * options.h (Input_argument_list): Typedef moved from
9697 (Input_file_group::Files): Remove, use ::Input_argument_list.
9698 (Input_file_group::Input_argument_list): Remove, use
9699 ::Input_argument_list.
9700 * plugin.cc (Plugin_manager::add_input_file): Add error in
9702 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9704 * script.cc (read_input_script): Call
9705 Incremental_input::report_script.
9706 * script.h (Script_info): New class.
9708 2009-04-27 Ian Lance Taylor <iant@google.com>
9710 * x86_64.cc (do_adjust_output_section): Set entsize to
9713 2009-04-23 Elliott Hughes <enh@google.com>
9715 * output.cc (Output_file::close): After short writes, continue
9716 writing from the correct offset in the buffer being written.
9718 2009-04-23 Chris Demetriou <cgd@google.com>
9720 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9721 * configure: Regenerate.
9722 * config.in: Regenerate.
9723 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9724 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9726 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9728 * incremental.cc (Incremental_inputs_header_data): Renamed from
9729 Incremental_input_header_data.
9730 (Incremental_inputs_header_data::data_size): New field.
9731 (Incremental_inputs_header_data::put_input_file_count): Renamed
9732 from input_file_count.
9733 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9734 from command_line_offset.
9735 (Incremental_inputs_header_data::put_reserved): Renamed from
9737 (Incremental_inputs_entry_data): Renamed from
9738 Incremental_input_entry_data.
9739 (Incremental_inputs_entry_data::data_size): New field.
9740 (Incremental_inputs::report_command_line): New method.
9741 (Incremental_inputs::finalize): New method.
9742 (Incremental_inputs::create_incremental_inputs_data): New method.
9743 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9744 * incremental.h: New file.
9745 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9746 (Layout::finalize): Create incremental inputs section in
9748 (Layout::create_incremental_info_sections): New method.
9749 * layout.h (Layout::incremental_inputs): New method.
9750 (Layout::create_incremental_info_sections): New method.
9751 (Layout::incremental_inputs_): New field.
9752 * main.cc (main): Notify Incremental_input of the command line.
9754 2009-04-01 Ian Lance Taylor <iant@google.com>
9755 Mikolaj Zalewski <mikolajz@google.com>
9757 * gold.h (reserve_unordered_map): Define, three versions, one for
9758 each version of Unordered_map.
9759 * layout.cc (Layout::Layout): Remove options parameter. Add
9760 number_of_input_files parameter. Don't initialize options_.
9761 Initialize number_of_input_files_ and resized_signatures_. Move
9762 sections_are_attached_.
9763 (Layout::layout_group): Reserve space for group_signatures_.
9764 (Layout::find_or_add_kept_section): Change name parameter to be a
9765 reference. Resize signatures_ map when it gets large enough.
9766 (Layout::layout_eh_frame): Use parameters->options() instead of
9768 (Layout::make_output_section): Likewise.
9769 (Layout::attach_allocated_section_to_segment): Likewise.
9770 (Layout::finalize, Layout::create_executable_stack): Likewise.
9771 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9772 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9773 * layout.h (class Layout): Update declarations. Remove options_
9774 field. Add number_of_input_files_ and resized_signatures_
9775 fields. Move sections_are_attached_ field.
9776 * main.cc (main): Pass number of input files to Layout
9777 constructor. Don't pass options.
9779 2009-03-30 Ian Lance Taylor <iant@google.com>
9781 * ffsll.c (ffsll): Correct implementation.
9783 2009-03-27 Ian Lance Taylor <iant@google.com>
9785 * ffsll.c: New file.
9786 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9787 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9788 * ftruncate.c (ftruncate): Declare before definition.
9789 * mremap.c (mremap): Likewise.
9790 * pread.c (pread): Likewise.
9791 * configure, Makefile.in, config.in: Rebuild.
9793 * mremap.c: New file.
9794 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9795 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9796 (mremap): Declare if HAVE_MREMAP is not defined.
9797 * configure, Makefile.in, config.in: Rebuild.
9799 2009-03-27 Cary Coutant <ccoutant@google.com>
9801 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9802 position independent.
9803 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9804 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9806 2009-03-24 Cary Coutant <ccoutant@google.com>
9808 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9810 (needs_dynamic_reloc): Likewise.
9812 2009-03-24 Ian Lance Taylor <iant@google.com>
9814 * yyscript.y (file_cmd): Recognize EXTERN.
9815 (extern_name_list, extern_name_list_body): New nonterminals.
9816 * script.cc (script_add_extern): Define.
9817 * script-c.h (script_add_extern): Declare.
9819 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
9821 * object.cc (is_elf_object): Define.
9822 * object.h (is_elf_object): Declare.
9823 * archive.cc (Archive::get_elf_object_for_member): Call
9825 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
9827 2009-03-24 Elliott Hughes <enh@google.com>
9829 * output.cc (Output_file::map_anonymous): Define.
9830 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9831 try an anonymous one. Report the size if the mmap fails.
9832 * output.h (class Output_file): Declare map_anonymous.
9834 2009-03-24 Ian Lance Taylor <iant@google.com>
9836 * target-select.cc (instantiate_target): Don't acquire the lock if
9837 the instantiated_target_ field has already been set.
9839 2009-03-23 Ian Lance Taylor <iant@google.com>
9841 * gold-threads.h (class Initialize_lock): Define.
9842 * gold-threads.cc (class Initialize_lock_once): Define.
9843 (initialize_lock_control): New static variable.
9844 (initialize_lock_pointer): New static variable.
9845 (initialize_lock_once): New static function.
9846 (Initialize_lock::Initialize_lock): Define.
9847 (Initialize_lock::initialize): Define.
9848 * target-select.h: Include "gold-threads.h".
9849 (class Target_selector): Add lock_ and initialize_lock_ fields.
9850 Don't define instantiate_target, just declare it.
9851 * target-select.cc (Target_selector::Target_selector): Initialize
9853 (Target_selector::instantiate_target): Define.
9854 * descriptors.h: Include "gold-threads.h".
9855 (class Descriptors): Add initialize_lock_ field.
9856 * descriptors.cc (Descriptors::Descriptors): Initialize new
9858 (Descriptors::open): Use initialize_lock_ field
9859 * errors.h (class Errors): Add initialize_lock_ field.
9860 * errors.cc (Errors::Errors): Initialize new field.
9861 (Errors::initialize_lock): Use initialize_lock_ field.
9862 * powerpc.cc (class Target_selector_powerpc): Remove
9863 instantiated_target_ field. In do_recognize call
9864 instantiate_target rather than do_instantiate_target. In
9865 do_instantiate_target just allocate a new target.
9866 * sparc.cc (class Target_selector_sparc): Likewise.
9868 * freebsd.h: New file.
9869 * i386.cc: Include "freebsd.h".
9870 (Target_i386): Derive from Target_freebsd rather than
9872 (Target_selector_i386): Derive from Target_selector_freebsd rather
9873 than Target_selector.
9874 * x86_64.cc: Include "freebsd.h".
9875 (Target_x86_64): Derive from Target_freebsd rather than
9877 (Target_selector_x86_64): Derive from Target_selector_freebsd
9878 rather than Target_selector.
9879 * target.h (class Target): Add adjust_elf_header and
9880 do_adjust_elf_header.
9881 * output.cc (Output_file_header:: do_sized_write): Call target
9882 adjust_elf_header routine.
9883 * configure.tgt: Set targ_osabi.
9884 * configure.ac: Define GOLD_DEFAULT_OSABI.
9885 * parameters.cc (Parameters::default_target): Pass
9886 GOLD_DEFAULT_OSABI to select_target.
9887 * target-select.h (class Target_selector): Make instantiate_target
9888 protected rather than private.
9889 * Makefile.am (HFILES): Add freebsd.h.
9890 * configure, Makefile.in, config.in: Rebuild.
9892 * merge.cc (do_add_input_section): Correct pend value. Change
9893 message about last entry not being null terminated from error to
9896 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9898 * incremental.cc: New file.
9899 * Makefile.am (CCFILES): Add incremental.cc.
9900 * Makefile.in: Rebuild.
9902 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9904 * layout.cc (Layout::output_section_name): Preserve names
9905 of '.note.' sections.
9907 2009-03-19 Ian Lance Taylor <iant@google.com>
9909 * descriptors.cc (Descriptors::open): Check that the options are
9910 valid before using them.
9912 2009-03-18 Ian Lance Taylor <iant@google.com>
9914 * script-sections.h: Include <list>.
9915 (class Script_sections): Change Sections_elements from std::vector
9916 to std::list. Typedef public Elements_iterator. Add
9917 orphan_section_placement_, data_segment_align_start_, and
9918 saw_data_segment_align_ fields. Remove data_segment_align_index_
9920 * script-sections.cc (class Orphan_section_placement): New class.
9921 (class Sections_element): Add virtual functions is_relro and
9922 orphan_section_init. Remove virtual function place_orphan_here.
9923 (class Output_section_definition): Add is_relro and
9924 orphan_section_init. Remove place_orphan_here.
9925 (class Orphan_output_section): Likewise.
9926 (Script_sections::Script_sections): Update for field changes.
9927 (Script_sections::data_segment_align): Set saw_data_segment_align_
9928 and data_segment_align_start_, not data_segment_align_index.
9929 (Script_sections::data_segment_relro_end): Check
9930 saw_data_segment_align_. Use data_segment_align_start_ rather
9931 than data_segment_align_index_.
9932 (Script_sections::place_orphan): Rewrite to use
9933 Orphan_section_placement.
9935 2009-03-17 Ian Lance Taylor <iant@google.com>
9937 * archive.cc (Archive::add_symbols): Check for a version attached
9938 to the symbol name in the archive map.
9939 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9940 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9941 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9942 (ver_test_11.a): New target.
9943 * testsuite/Makefile.in: Rebuild.
9945 * configure.ac: Check for chsize and posix_fallocate. Replace
9947 * ftruncate.c: New file, from gnulib.
9948 * output.cc (posix_fallocate): Define dummy version if not
9949 HAVE_POSIX_FALLOCATE.
9950 (Output_file::map): Call posix_fallocate rather than lseek and
9952 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9953 * configure, Makefile.in, config.in: Rebuild.
9955 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
9957 * layout.h (Layout::create_note): Add section_name parameter.
9958 * layout.cc (Layout::create_note): Likewise.
9959 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
9961 2009-03-17 Ian Lance Taylor <iant@google.com>
9963 * descriptors.cc: Include "options.h".
9964 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9965 (Descriptors::open): Always use O_CLOEXEC when opening a new
9966 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9967 then set FD_CLOEXEC.
9969 * sparc.cc (class Target_sparc): Add has_got_section.
9970 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9971 make sure we have a GOT section.
9973 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9974 (Target_sparc::Scan::local): Likewise.
9975 (Target_sparc::Scan::global): Likewise.
9976 (Target_sparc::Relocate::relocate): Likewise.
9977 (Target_sparc::Relocate::relocate_tls): Likewise.
9979 * symtab.cc (Symbol_table::define_default_version): New function,
9980 broken out of add_from_object.
9981 (Symbol_table::add_from_object): Call define_default_version.
9982 (Symbol_table::define_special_symbol): Add resolve_oldsym
9983 parameter. Change all callers. If the version for a symbol comes
9984 from a version script, resolve it with the symbol with the same
9985 name with no version. Also add the symbol without a version if
9987 (do_define_in_output_data): If resolving with oldsym, don't delete
9989 (do_define_in_output_segment): Likewise.
9990 (do_define_as_constant): Likewise.
9991 * symtab.h (class Symbol_table): Update declarations.
9993 2009-03-13 Ian Lance Taylor <iant@google.com>
9995 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9996 (Read_symbols::requeue): New function.
9997 (Read_symbols::do_read_symbols): If make_elf_object fails because
9998 the target type is not configured, and the file was searched for,
9999 issue a warning and retry with the next directory.
10000 (Add_symbols::run): If the file has an incompatible format, and
10001 it was searched for, requeue the Read_symbols task. On error,
10002 release the object.
10003 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10004 dirindex parameter to constructor. Change all callers. Declare
10005 incompatible_warning and requeue.
10006 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10007 input_argument_ and input_group_ fields. Add them to
10008 constructor. Change all callers.
10009 (class Read_script): Add dirindex_ field. Add it to constructor.
10010 Change all callers.
10011 * archive.cc (Archive::setup): Remove input_objects parameter.
10012 Change all callers.
10013 (Archive::get_file_and_offset): Likewise.
10014 (Archive::read_all_symbols): Likewise.
10015 (Archive::read_symbols): Likewise.
10016 (Archive::get_elf_object_for_member): Remove input_objects
10017 parameter. Add punconfigured parameter. Change all callers.
10018 (Archive::add_symbols): Change return type to bool. Check return
10019 value of include_member.
10020 (Archive::include_all_members): Likewise.
10021 (Archive::include_member): Change return type to bool. Return
10022 false if first included object has incompatible target. Set
10023 included_member_ field.
10024 (Add_archive_symbols::run): If add_symbols returns false, requeue
10026 * archive.h (class Archive): Add included_member_ field.
10027 Initialize it in constructor. Add input_file and searched_for
10028 methods. Update declarations.
10029 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10030 input_argument_ fields. Add them to constructor. Change all
10032 * script.cc: Include "target-select.h".
10033 (class Parser_closure): Add skip_on_incompatible_target_ and
10034 found_incompatible_target_ fields. Add
10035 skip_on_incompatible_target parameter to constructor. Change all
10036 callers. Add methods skip_on_incompatible_target,
10037 clear_skip_on_incompatible_target, found_incompatible_target, and
10038 set_found_incompatible_target.
10039 (read_input_script): Add dirindex parameter. Change all callers.
10040 If parser finds an incompatible target, requeue Read_symbols
10042 (script_set_symbol): Clear skip_on_incompatible_target in
10044 (script_add_assertion, script_parse_option): Likewise.
10045 (script_start_sections, script_add_phdr): Likewise.
10046 (script_check_output_format): New function.
10047 * script.h (read_input_script): Update declaration.
10048 * script-c.h (script_check_output_format): Declare.
10049 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10050 (ignore_cmd): Remove OUTPUT_FORMAT.
10051 * fileread.cc (Input_file::Input_file): Add explicit this.
10052 (Input_file::will_search_for): New function.
10053 (Input_file::open): Add pindex parameter. Change all callers.
10054 * fileread.h (class Input_file): Add input_file_argument method.
10055 Declare will_search_for. Update declarations.
10056 * object.cc (make_elf_object): Add punconfigured parameter.
10057 Change all callers.
10058 * object.h (class Object): Make input_file public. Add
10059 searched_for method.
10060 (make_elf_object): Update declaration.
10061 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10063 * dirsearch.h (class Dirsearch): Update declaration.
10064 * options.h (class General_options): Add --warn-search-mismatch.
10065 * parameters.cc (Parameters::is_compatible_target): New function.
10066 * parameters.h (class Parameters): Declare is_compatible_target.
10067 * workqueue.cc (Workqueue::add_blocker): New function.
10068 * workqueue.h (class Workqueue): Declare add_blocker.
10070 * fileread.cc (Input_file::open): Remove options parameter.
10071 Change all callers.
10072 (Input_file::open_binary): Likewise.
10073 * script.cc (read_input_script): Likewise.
10074 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10075 options parameter from constructor. Change all callers.
10076 (class Read_script): Likewise.
10077 * fileread.h (class Input_file): Update declarations.
10078 * script.h (read_input_script): Update declaration.
10080 2009-03-10 Nick Clifton <nickc@redhat.com>
10082 * po/es.po: New Spanish translation.
10084 2009-03-06 Cary Coutant <ccoutant@google.com>
10086 * options.cc (parse_short_option): Keep dash_z from registering itself.
10088 2009-03-03 Ian Lance Taylor <iant@google.com>
10091 * target-reloc.h (relocate_section): Pass output_section to
10093 * i386.cc (Target_i386::should_apply_static_reloc): Add
10094 output_section parameter. Change all callers.
10095 (Target_i386::Relocate::relocate): Add output_section parameter.
10096 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10097 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10098 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10099 * testsuite/two_file_shared.sh: New script.
10100 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10101 (check_DATA): Add two_file_shared.dbg.
10102 (two_file_shared.dbg): New target.
10103 * testsuite/Makefile.in: Rebuild.
10105 2009-03-01 Ian Lance Taylor <iant@google.com>
10107 * configure.ac: Check for byteswap.h.
10108 * configure: Rebuild.
10109 * config.in: Rebuild.
10111 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10113 * layout.cc (Layout::find_or_add_kept_section): New function.
10114 (Layout::add_comdat): Removed.
10115 * layout.h (struct Kept_section): Move out of class Layout.
10116 Remove trailing underscores from field names. Add group_sections
10117 field. Rename group_ field to is_group. Change all uses.
10118 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10119 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10120 comdat_groups_ field.
10121 (Sized_relobj::include_section_group): Use
10122 find_or_add_kept_section and Kept_section::group_sections.
10123 (Sized_relobj::include_linkonce_section): Likewise.
10124 * object.cc (class Sized_relobj): Don't define Comdat_group or
10125 Comdat_group_table. Remove find_comdat_group and
10126 add_comdat_group. Remove comdat_groups_ field.
10127 * plugin.cc (include_comdat_group): Use
10128 Layout::find_or_add_kept_section.
10130 2009-02-28 Ian Lance Taylor <iant@google.com>
10132 * README: --gc-sections and map files are now supported. Document
10133 some build requirements.
10136 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10137 relocatable link set the value of the section symbol to zero.
10138 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10139 relocatable link don't include the section address in the local
10142 2009-02-27 Ian Lance Taylor <iant@google.com>
10145 * options.h (class Search_directory): Add is_system_directory.
10146 (class General_options): Declare is_in_system_directory.
10147 * options.cc (get_relative_sysroot): Make static.
10148 (get_default_sysroot): Make static.
10149 (General_optoins::is_in_system_directory): New function.
10150 * fileread.cc (Input_file::is_in_system_directory): New function.
10151 * fileread.h (class Input_file): Declare is_in_system_directory.
10152 * object.h (class Object): Add is_in_system_directory.
10153 (class Input_objects): Remove system_library_directory_ field.
10154 * object.cc (Input_objects::add_object): Don't set
10155 system_library_directory_.
10156 (input_objects::found_in_system_library_directory): Remove.
10157 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10158 parameter. Change all callers.
10159 (Symbol_table::sized_write_globals): Likewise.
10160 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10161 Call Object::is_in_system_directory.
10162 * symtab.h (class Symbol_table): Update declarations.
10165 * descriptors.h (Open_descriptor): Add is_on_stack field.
10166 * descriptors.cc (Descriptors::open): If the descriptor is on the
10167 top of the stack, remove it. Initialize is_on_stack field.
10168 (Descriptors::release): Only add pod to stack if it is not on the
10170 (Descriptors::close_some_descriptor): Clear stack_next and
10171 is_on_stack fields.
10174 * output.cc (Output_section::find_starting_output_address): Rename
10175 from starting_output_address; add PADDR parameter; change return
10177 * output.h (class Output_section): Declare
10178 find_starting_output_address instead of starting_output_address.
10179 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10180 section symbol for which we can't find a merge section.
10183 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10184 hidden or internal, force the symbol to be local.
10185 * resolve.cc (Symbol::override_visibility): Define.
10186 (Symbol::override_base): Use override_visibility.
10187 (Symbol_table::resolve): Likewise.
10188 (Symbol::override_base_with_special): Likewise.
10189 (Symbol_table::override_with_special): If the visibility is hidden
10190 or internal, force the symbol to be local.
10191 * symtab.h (class Symbol): Add set_visibility and
10192 override_visibility.
10193 * testsuite/ver_test_1.sh: New file.
10194 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10195 (check_DATA): Add ver_test_1.syms.
10196 (ver_test_1.syms): New target.
10197 * testsuite/Makefile.in: Rebuild.
10199 2009-02-25 Cary Coutant <ccoutant@google.com>
10201 * layout.cc (Layout::choose_output_section): Don't rename sections
10202 when using a linker script that has a SECTIONS clause.
10203 * Makefile.in: Regenerate.
10205 * testsuite/Makefile.am (script_test_5.sh): New test case.
10206 * testsuite/Makefile.in: Regenerate.
10207 * testsuite/script_test_5.cc: New file.
10208 * testsuite/script_test_5.sh: New file.
10209 * testsuite/script_test_5.t: New file.
10211 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10213 * archive.cc (Archive::include_member): Update calls to add_symbols.
10214 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10215 the Layout argument.
10216 * dynobj.h (do_add_symbols): Add the Layout argument.
10217 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10219 * object.h (Object::add_symbols): Add the Layout argument.
10220 (Object::do_add_symbols): Add the Layout argument.
10221 (Sized_relobj::do_add_symbols): Add the Layout argument.
10222 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10223 Unify the two versions.
10224 (Add_plugin_symbols): Remove.
10225 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10226 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10227 (Add_plugin_symbols): Remove.
10228 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10229 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10230 (Add_symbols::run): Make it work with Pulginobj.
10232 2009-02-06 Ian Lance Taylor <iant@google.com>
10234 * object.cc (Sized_relobj::do_layout): Make info message start
10235 with lower case letter.
10237 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10239 * binary.cc: Fix file comment.
10241 * options.h (enum Incremental_disposition): Define.
10242 (class General_options): Add new options: --incremental,
10243 --incremental_changed, --incremental_unchanged,
10244 --incremental_unknown. Add incremental_disposition_ and
10245 implicit_incremental_ fields.
10246 (General_options::incremental_disposition): New function.
10247 (class Position_dependent_options): Add incremental_disposition
10249 (Position_dependent_options::copy_from_options): Set incremental
10251 * options.cc (General_options::parse_incremental_changed): New
10253 (General_options::parse_incremental_unchanged): New function.
10254 (General_options::parse_incremental_unknown): New function.
10255 (General_options::General_options): Initialize new fields
10256 incremental_disposition_ and implicit_incremental_.
10257 (General_options::finalize): Check for uasge of --incremental-*
10258 without --incremental.
10260 2009-02-06 Chris Demetriou <cgd@google.com>
10262 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10263 pointer and to report location as the file name associated with
10265 (gold_undefined_symbol_at_location): New function to replace the
10266 old gold_undefined_symbol functionality.
10267 * target-reloc.h (relocate_section): Update to use
10268 gold_undefined_symbol_at_location.
10269 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10270 Call gold_undefined_symbol function rather than gold_error.
10271 * errors.h (Errors::undefined_symbol): Take location as a
10272 string, rather than calculating it from a relocation.
10273 * errors.cc (Errors::fatal): Print "fatal error:" before the
10275 (Errors::error, Errors::error_at_location): Print "error: "
10276 before the formatted message.
10277 (Errors::undefined_symbol): Take location as a string, rather
10278 than calculating it from a relocation.
10279 (gold_undefined_symbol_at_location): New function akin to
10280 old gold_undefined_symbol, calculates location from relocation.
10281 (gold_undefined_symbol): Change to take only a Symbol pointer
10282 and to report location as the file name associated with the symbol.
10283 * testsuite/debug_msg.sh: Update for changed error messages.
10284 * testsuite/undef_symbol.sh: Likewise.
10286 2009-02-04 Duncan Sands <baldrick@free.fr>
10289 * reduced_debug_output.h
10290 (Output_reduced_debug_abbrev_section::failed): Use format for
10292 (Output_reduced_debug_info_section::faild): Likewise.
10294 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10296 * script.cc (Lazy_demangler): New class.
10297 (Version_script_info::get_symbol_version_helper): Demangle a
10300 2009-01-29 Cary Coutant <ccoutant@google.com>
10302 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10304 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10306 2009-01-28 Ian Lance Taylor <iant@google.com>
10308 * version.cc (version_string): Bump to 1.9.
10310 * gold.h: Include <cstring> and <stdint.h>.
10311 * version.cc: Include <cstdio>.
10312 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10314 * reduced_debug_output.cc (insert_into_vector): Rename from
10315 Insert_into_vector; change all callers. Use Swap_unaligned to
10316 avoid aliasing issue; remove union since it is unnecessary.
10318 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10320 * Makefile.am (CCFILES): Add gc.cc.
10321 (HFILES): Add gc.h.
10322 * Makefile.in: Regenerate.
10323 * gold.cc (Gc_runner): New class.
10324 (queue_initial_tasks): Call garbage collection related tasks
10325 when corresponding options are invoked.
10326 (queue_middle_gc_tasks): New function.
10327 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10328 processed early before laying out sections during garbage collection.
10329 * gold.h (queue_middle_gc_tasks): New function.
10330 (is_prefix_of): Move from "layout.cc".
10331 * i386.cc (Target_i386::gc_process_relocs): New function.
10332 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10333 * main.cc (main): Create object of class "Garbage_collection".
10334 * object.cc (Relobj::copy_symbols_data): New function.
10335 (Relobj::is_section_name_included): New function.
10336 (Sized_relobj::do_layout): Allow this function to be called twice
10337 during garbage collection and defer layout of section during the
10339 * object.h (Relobj::get_symbols_data): New function.
10340 (Relobj::is_section_name_included): New function.
10341 (Relobj::copy_symbols_data): New function.
10342 (Relobj::set_symbols_data): New function.
10343 (Relobj::get_relocs_data): New function.
10344 (Relobj::set_relocs_data): New function.
10345 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10346 (Relobj::gc_process_relocs): New function.
10347 (Relobj::do_gc_process_relocs): New pure virtual function.
10348 (Relobj::sd_): New data member.
10349 (Sized_relobj::is_output_section_offset_invalid): New function.
10350 (Sized_relobj::do_gc_process_relocs): New function.
10351 * options.h (General_options::gc_sections): Modify to not be a no-op.
10352 (General_options::print_gc_sections): New option.
10353 * plugin.cc (Plugin_finish::run): Remove function call to
10354 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10355 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10356 * reloc.cc (Read_relocs::run): Add task to process relocs and
10357 determine unreferenced sections when doing garbage collection.
10358 (Gc_process_relocs): New class.
10359 (Sized_relobj::do_gc_process_relocs): New function.
10360 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10361 sections that are garbage collected.
10362 * reloc.h (Gc_process_relocs): New class.
10363 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10364 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10365 symbols whose corresponding sections are garbage collected.
10366 (Symbol_table::Symbol_table): Add new parameter for the garbage
10368 (Symbol_table::gc_mark_undef_symbols): New function.
10369 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10370 (Symbol_table::gc_mark_dyn_syms): New function.
10371 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10373 (Symbol_table::add_from_object): Likewise.
10374 (Symbol_table::add_from_relobj): When building shared objects, do not
10375 treat externally visible symbols as garbage.
10376 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10377 table information for static and relocatable links.
10378 * symtab.h (Symbol_table::set_gc): New function.
10379 (Symbol_table::gc): New function.
10380 (Symbol_table::gc_mark_undef_symbols): New function.
10381 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10382 (Symbol_table::gc_mark_dyn_syms): New function.
10383 (Symbol_table::gc_): New data member.
10384 * target.h (Sized_target::gc_process_relocs): New pure virtual
10386 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10387 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10389 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10391 * options.h (General_options::gc_sections): Define as a no-op for now.
10392 (General_options::no_keep_memory): Ditto.
10393 (General_options::Bshareable): Define.
10394 * options.cc (General_options::finalize): Honor -Bshareable.
10396 2009-01-20 Andreas Schwab <schwab@suse.de>
10398 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10399 read the value in the contents, since we don't use it. Use the
10400 template endianness when writing.
10401 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10403 2009-01-19 Andreas Schwab <schwab@suse.de>
10405 * configure.tgt (powerpc64-*): Fix targ_obj.
10407 2009-01-15 Ian Lance Taylor <iant@google.com>
10409 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10410 local symbols when stripping all symbols.
10412 2009-01-14 Cary Coutant <ccoutant@google.com>
10414 * output.cc (Output_reloc): Add explicit instantiations.
10416 2009-01-14 Cary Coutant <ccoutant@google.com>
10418 * archive.cc (Archive::get_elf_object_for_member): Remove call
10419 to File_read::claim_for_plugin.
10420 * descriptors.cc (Descriptors::open): Remove reference to
10422 (Descriptors::claim_for_plugin): Remove.
10423 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10424 (Descriptors::is_claimed): Remove.
10425 (claim_descriptor_for_plugin): Remove.
10426 * fileread.cc (File_read::claim_for_plugin): Remove.
10427 * fileread.h (File_read::claim_for_plugin): Remove.
10428 (File_read::descriptor): Reopen descriptor if necessary.
10429 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10430 (Plugin_manager::all_symbols_read): Add task parameter. Change
10432 (Plugin_manager::get_input_file): New function.
10433 (Plugin_manager::release_input_file): New function.
10434 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10435 corresponding data member.
10436 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10437 and pass to base constructor. Change all callers.
10438 (get_input_file, release_input_file): New functions.
10439 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10440 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10441 (Plugin_manager::all_symbols_read): Add task parameter.
10442 (Plugin_manager::get_input_file): New function.
10443 (Plugin_manager::release_input_file): New function.
10444 (Plugin_manager::task_): New data member.
10445 (Pluginobj::Pluginobj): Add filesize parameter.
10446 (Pluginobj::filename): New function.
10447 (Pluginobj::descriptor): New function.
10448 (Pluginobj::filesize): New function.
10449 (Pluginobj::filesize_): New data member.
10450 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10451 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10452 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10454 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10455 with archive libraries.
10456 * testsuite/Makefile.in: Regenerate.
10457 * testsuite/plugin_test.c (struct sym_info): New type.
10458 (get_input_file, release_input_file): New static variables.
10459 (onload): Capture new transfer vector entries.
10460 (claim_file_hook): Stop reading at end of file according to filesize.
10461 Factor out parsing of readelf output into separate function.
10462 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10463 APIs and get the source file name from the symbol table. Convert
10464 source file name to corresponding object file name. Print info
10465 message when adding new input files.
10466 (parse_readelf_line): New function.
10467 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10468 * testsuite/plugin_test_2.sh: Likewise.
10469 * testsuite/plugin_test_3.sh: Likewise.
10470 * testsuite/plugin_test_4.sh: New test case.
10472 2009-01-07 Ian Lance Taylor <iant@google.com>
10474 * version.cc (version_string): Bump to 1.8.
10476 2008-12-23 Cary Coutant <ccoutant@google.com>
10478 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10479 * plugin.cc (Plugin_manager::finish): Rename as
10480 layout_deferred_objects. Move cleanup to separate function.
10481 (Plugin_manager::cleanup): New function.
10482 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10484 * plugin.h (Plugin_manager::finish): Rename as
10485 layout_deferred_objects.
10486 (Plugin_manager::cleanup): New function.
10487 (Plugin_manager::cleanup_done): New field.
10489 2008-12-23 Cary Coutant <ccoutant@google.com>
10491 * plugin.cc (is_visible_from_outside): New function.
10492 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10493 so we don't return "IR only" status for exported symbols or -r links.
10495 * testsuite/Makefile.am (plugin_test_3): New test case.
10496 * testsuite/Makefile.in: Regenerate.
10497 * testsuite/plugin_test_3.sh: New file.
10499 2008-12-22 Cary Coutant <ccoutant@google.com>
10501 * object.cc (Sized_relobj::layout_section): New function.
10502 (Sized_relobj::do_layout): Defer layout of input sections until after
10503 plugin has provided replacement files.
10504 (Sized_relobj::do_layout_deferred_sections): New function.
10505 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10506 (Relobj::layout_deferred_sections): New function.
10507 (Relobj::do_layout_deferred_sections): New function.
10508 (Sized_relobj::do_layout_deferred_sections): New function.
10509 (Sized_relobj::layout_section): New function.
10510 (Sized_relobj::Deferred_layout): New structure.
10511 (Sized_relobj::deferred_layout_): New field.
10512 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10513 Change all callers. Layout deferred sections.
10514 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10516 (Plugin_hook::run): Move code from do_plugin_hook inline.
10517 (Plugin_hook::do_plugin_hook): Remove.
10518 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10519 (Plugin_manager::finish): Renamed, was cleanup.
10520 (Plugin_manager::should_defer_layout): New function.
10521 (Plugin_manager::add_deferred_layout_object): New function.
10522 (Plugin_manager::Deferred_layout_list): New type.
10523 (Plugin_manager::deferred_layout_objects_): New field.
10524 (Plugin_hook::do_plugin_hook): Remove.
10526 2008-12-17 Ian Lance Taylor <iant@google.com>
10528 * options.h (class General_options): Add --no case for
10531 2008-12-16 Cary Coutant <ccoutant@google.com>
10533 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10535 (Plugin_manager::claim_file): Create plugin object even if
10536 plugin did not call the add_symbols callback.
10537 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10538 asking for more symbols than were added.
10539 * testsuite/Makefile.am (plugin_test_1): Add test case with
10541 (empty.syms): New target.
10542 * testsuite/Makefile.in: Regenerate.
10543 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10544 message. Don't call add_symbols if no globals.
10545 (all_symbols_read_hook): Don't provide replacement for empty
10548 2008-12-12 Ian Lance Taylor <iant@google.com>
10550 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10551 r_type == 0 for a local symbol with r_sym == 0.
10552 (scan_relocatable_relocs): Pass r_sym to
10553 local_non_section_strategy.
10554 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10557 * configure.ac: Update test for TLS descriptors: they are
10558 supported as of glibc 2.9.
10559 * configure: Rebuild.
10561 2008-12-11 Ian Lance Taylor <iant@google.com>
10564 * target-reloc.h (Default_scan_relocatable_relocs): For each
10565 function, map r_type == 0 to RELOC_DISCARD.
10567 2008-12-10 Cary Coutant <ccoutant@google.com>
10569 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10570 object to override a kept COMDAT group from a plugin object.
10572 2008-12-09 Ian Lance Taylor <iant@google.com>
10575 * yyscript.y (file_cmd): Handle INPUT.
10577 * testsuite/initpri1.c: Change all declarations to be full
10578 prototypes by adding void, to avoid compiler warnings.
10580 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10582 * options.cc (General_options::parse_plugin_opt): New.
10583 (General_options::add_plugin): The argument now is just the filename.
10584 (General_options::add_plugin_option): New.
10585 * options.h (plugin_opt): New.
10586 (add_plugin): Change argument name.
10587 (add_plugin_option): New.
10588 * plugin.cc (Plugin::load): Don't parse the plugin option.
10589 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10590 (Plugin::add_option): New.
10591 (Plugin::args_): Change type.
10592 (Plugin::filename_): New.
10593 (Plugin_manager::add_plugin_option): New.
10594 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10595 * testsuite/Makefile.in: Regenerate.
10597 2008-12-05 Cary Coutant <ccoutant@google.com>
10599 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10600 Handle --strip-lto-sections option.
10601 * options.h (strip_lto_sections): New option.
10603 2008-12-01 Cary Coutant <ccoutant@google.com>
10605 * plugin.cc (ld_plugin_message): Change format parameter to const.
10606 Fix mismatch between new[] and delete.
10608 2008-11-14 Cary Coutant <ccoutant@google.com>
10610 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10613 2008-11-05 Craig Silverstein <csilvers@google.com>
10615 * options.cc (General_options::parse_dynamic_list): New function.
10616 * options.h (General_options): New flags dynamic_list,
10617 dynamic_list_data, dynamic_list_cpp_new, and
10618 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10619 (General_options::in_dynamic_list): New function.
10620 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10621 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10622 (Lex::can_continue_name): Likewise.
10624 (read_script_file): New parameter script_options.
10625 (read_dynamic_list): New function.
10626 (Script_options::define_dynamic_list): New function.
10627 (dynamic_list_keyword_parsecodes): New variable.
10628 (dynamic_list_keywords): New variable.
10629 * script.h (Script_options::define_dynamic_list): New function
10631 (read_dynamic_list): New function prototype.
10632 * symtab.cc (strprefix): New macro.
10633 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10634 dynamic_list_data, dynamic_list_cpp_new, and
10635 dynamic_list_cpp_typeinfo.
10636 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10637 (dynamic_list_expr): New rule.
10638 (dynamic_list_nodes): Likewise.
10639 (dynamic_list_node): Likewise.
10640 * testsuite/Makefile.am (dynamic_list): New test.
10641 * testsuite/Makefile.in: Regenerated.
10642 * testsuite/dynamic_list.t: New file.
10643 * testsuite/dynamic_list.sh: New file.
10645 2008-11-05 Craig Silverstein <csilvers@google.com>
10647 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10648 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10649 (t11_last): Likewise.
10650 * testsuite/ver_test_6.c (main): Likewise.
10652 2008-10-07 Cary Coutant <ccoutant@google.com>
10654 * options.c (General_options::finalize): Add check for -static and
10656 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10659 2008-10-02 Cary Coutant <ccoutant@google.com>
10661 * plugin.cc (make_sized_plugin_object): Fix conditional
10662 compilation to work when not all targets are enabled.
10664 2008-09-29 Cary Coutant <ccoutant@google.com>
10666 * archive.cc (Archive::get_file_and_offset): Use filename instead
10667 of name to get library path.
10668 (Archive::include_member): Unlock external member of a thin archive.
10670 * testsuite/Makefile.am (TEST_AR): New variable.
10671 (thin_archive_test_1): New test.
10672 (thin_archive_test_2): New test.
10673 * testsuite/Makefile.in: Regenerate.
10674 * testsuite/thin_archive_main.cc: New file.
10675 * testsuite/thin_archive_test_1.cc: New file.
10676 * testsuite/thin_archive_test_2.cc: New file.
10677 * testsuite/thin_archive_test_3.cc: New file.
10678 * testsuite/thin_archive_test_4.cc: New file.
10680 2008-09-29 Cary Coutant <ccoutant@google.com>
10682 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10683 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10685 (Sized_relobj::do_finalize_local_symbols): Likewise.
10686 (Sized_relobj::map_to_kept_section): Likewise.
10687 * object.h (Sized_relobj::invalid_address): New constant.
10688 (Sized_relobj::do_output_section_offset): Check for invalid_address
10690 * output.cc (Output_reloc::local_section_offset): Use constant
10691 invalid_address instead of -1U.
10692 (Output_reloc::get_address): Likewise.
10693 (Output_section::output_address): Change -1U to -1ULL.
10694 * output.h (Output_reloc::invalid_address): New constant.
10695 * reloc.cc (Sized_relobj::write_sections): Use constant
10696 invalid_address instead of -1U.
10697 (Sized_relobj::relocate_sections): Likewise.
10698 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10699 values for merge sections.
10700 * target-reloc.h (relocate_for_relocatable): Use constant
10701 invalid_address instead of -1U.
10703 2008-09-19 Cary Coutant <ccoutant@google.com>
10705 Add plugin functionality for link-time optimization (LTO).
10706 * configure.ac (plugins): Add --enable-plugins option.
10707 * configure: Regenerate.
10708 * config.in: Regenerate.
10709 * Makefile.am (LIBDL): New variable.
10710 (CCFILES): Add plugin.cc.
10711 (HFILES): Add plugin.h.
10712 (ldadd_var): Add LIBDL.
10713 * Makefile.in: Regenerate.
10715 * archive.cc: Include "plugin.h".
10716 (Archive::setup): Don't preread archive symbols when using a plugin.
10717 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10718 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10720 (Archive::include_member): Add symbols from plugin objects.
10721 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10722 * descriptors.cc (Descriptors::open): Check for file descriptors
10723 abandoned by plugins.
10724 (Descriptors::claim_for_plugin): New function.
10725 * descriptors.h (Descriptors::claim_for_plugin): New function.
10726 (Open_descriptor::is_claimed): New field.
10727 (claim_descriptor_for_plugin): New function.
10728 * fileread.cc (File_read::claim_for_plugin): New function.
10729 * fileread.h (File_read::claim_for_plugin): New function.
10730 (File_read::descriptor): New function.
10731 * gold.cc: Include "plugin.h".
10732 (queue_initial_tasks): Add task to call plugin hooks for generating
10734 * main.cc: Include "plugin.h".
10735 (main): Load plugin libraries.
10736 * object.h (Pluginobj): Declare.
10737 (Object::pluginobj): New function.
10738 (Object::do_pluginobj): New function.
10739 (Object::set_target): New function.
10740 * options.cc: Include "plugin.h".
10741 (General_options::parse_plugin): New function.
10742 (General_options::General_options): Initialize plugins_ field.
10743 (General_options::add_plugin): New function.
10744 * options.h (Plugin_manager): Declare.
10745 (General_options): Add --plugin option.
10746 (General_options::has_plugins): New function.
10747 (General_options::plugins): New function.
10748 (General_options::add_plugin): New function.
10749 (General_options::plugins_): New field.
10750 * plugin.cc: New file.
10751 * plugin.h: New file.
10752 * readsyms.cc: Include "plugin.h".
10753 (Read_symbols::do_read_symbols): Check for archive before checking
10754 for ELF file. Call plugin hooks to claim files.
10755 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10756 from a real object file; force override when processing replacement
10758 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10759 (Symbol::init_base_object): Likewise.
10760 (Symbol::init_base_output_data): Likewise.
10761 (Symbol::init_base_output_segment): Likewise.
10762 (Symbol::init_base_constant): Likewise.
10763 (Symbol::init_base_undefined): Likewise.
10764 (Symbol::output_section): Assert that object is not a plugin.
10765 (Symbol_table::add_from_pluginobj): New function.
10766 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10768 (Symbol_table::sized_write_globals): Likewise.
10769 (Symbol_table::add_from_pluginobj): Instantiate template.
10770 * symtab.h (Sized_pluginobj): Declare.
10771 (Symbol::in_real_elf): New function.
10772 (Symbol::set_in_real_elf): New function.
10773 (Symbol::in_real_elf_): New field.
10774 (Symbol_table::add_from_pluginobj): New function.
10776 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10777 (LIBDL): New variable.
10778 (LDADD): Add LIBDL.
10779 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10780 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10781 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10782 (MOSTLYCLEANFILES): Likewise.
10783 * testsuite/Makefile.in: Regenerate.
10784 * testsuite/plugin_test.c: New file.
10785 * testsuite/plugin_test_1.sh: New file.
10786 * testsuite/plugin_test_2.sh: New file.
10788 2008-09-16 Ian Lance Taylor <iant@google.com>
10790 * target-reloc.h (relocate_section): Check whether a symbol is
10791 defined by the ABI before reporting an undefined symbol error.
10792 * target.h (Target::is_defined_by_abi): Make parameter const.
10793 (Target::do_is_defined_by_abi): Likewise.
10794 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10795 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10796 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10797 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10798 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10799 * testsuite/Makefile.in: Rebuild.
10801 * fileread.cc (make_view): Add casts to avoid warning.
10803 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10805 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10806 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10808 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10810 * options.h (General_options::output_is_executable): New.
10811 (General_options::output_is_pie): New.
10812 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10813 for shared libraries.
10814 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10816 2008-09-11 Chris Demetriou <cgd@google.com>
10818 * options.h (origin): New -z option.
10819 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10820 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10823 2008-09-05 Cary Coutant <ccoutant@google.com>
10825 * fileread.cc (File_read::make_view): Add check for attempt to map
10826 beyond end of file.
10828 2008-09-05 Cary Coutant <ccoutant@google.com>
10830 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10831 explicit instantiations.
10833 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10836 * options.cc (General_options::finalize): Allow undefined symbols
10837 in shlibs if linking -shared.
10840 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10841 symbols as not needing a dynsym entry.
10843 2008-08-20 Craig Silverstein <csilvers@google.com>
10845 * fileread.cc (File_read::open): Do not lock the file unless it
10846 was successfully opened.
10848 2008-08-14 Cary Coutant <ccoutant@google.com>
10850 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10851 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10852 * testsuite/tls_test.cc (struct int128): 128-bit struct
10853 for testing TLS relocs with non-zero addend.
10854 (v12): New TLS variable.
10856 (t_last): Add check for v12.
10857 * testsuite/tls_test.h (t12): New function.
10858 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10860 2008-08-13 Ian Lance Taylor <iant@google.com>
10862 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10863 set tls_segment_ or relro_segment_.
10864 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10866 * output.h (Output_section::clear_is_relro): New function.
10867 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10868 sections specially even when output_data_ is empty.
10869 (Output_segment::maximum_alignment): When first section is relro,
10870 only force alignment for PT_LOAD segments.
10871 * script.cc (script_data_segment_align): New function.
10872 (script_data_segment_relro_end): New function.
10873 * script-c.h (script_data_segment_align): Declare.
10874 (script_data_segment_relro_end): Declare.
10875 * script-sections.h (class Script_sections): Declare
10876 data_segment_align and data_segment_relro_end. Add fields
10877 segment_align_index_ and saw_relro_end_.
10878 * script-sections.cc (class Sections_element): Add set_is_relro
10879 virtual function. Add new bool* parameter to place_orphan_here.
10880 Add get_output_section virtual function.
10881 (class Output_section_definition): Add set_is_relro. Add new
10882 bool* parameter to place_orphan_here. Add get_output_section.
10883 Add is_relro_ field.
10884 (Output_section_definition::Output_section_definition): Initialize
10885 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10886 and is_relro_ fields.
10887 (Output_section_definition::place_orphan_here): Add is_relro
10889 (Output_section_definition::set_section_addresses): Set relro for
10891 (Output_section_definition::alternate_constraint): Likewise.
10892 (class Orphan_output_section): Add new bool* parameter to
10893 place_orphan_here. Add get_output_section.
10894 (Orphan_output_section::place_orphan_here): Add is_relro
10896 (Script_sections::Script_sections): Initialize
10897 data_segment_align_index_ and saw_relro_end_.
10898 (Script_sections::data_segment_align): New function.
10899 (Script_sections::data_segment_relro_end): New function.
10900 (Script_sections::place_orphan): Set or clear is_relro.
10901 (Script_sections::set_section_addresses): Force alignment of first
10903 * yyscript.y (exp): Call script_data_segment_align and
10904 script_data_segment_relro_end.
10905 * testsuite/relro_script_test.t: New file.
10906 * testsuite/relro_test.cc (using_script): Declare.
10907 (t1, t2): Test using_script.
10908 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10909 (relro_script_test_SOURCES): Define.
10910 (relro_script_test_DEPENDENCIES): Define.
10911 (relro_script_test_LDFLAGS): Define.
10912 (relro_script_test_LDADD): Define.
10913 (relro_script_test.so): New target.
10914 * testsuite/Makefile.in: Rebuild.
10916 2008-08-06 Cary Coutant <ccoutant@google.com>
10918 * archive.cc (Archive::total_archives, Archive::total_members)
10919 (Archive::total_members_loaded): New variables.
10920 (Archive::setup): Add parameter. Add option to preread
10922 (Archive::read_armap): Add counter.
10923 (Archive::get_file_and_offset): New function.
10924 (Archive::get_elf_object_for_member): New function.
10925 (Archive::read_all_symbols): New function.
10926 (Archive::read_symbols): New function.
10927 (Archive::add_symbols): Add counters.
10928 (Archive::include_all_members): Use armap to find members if it's
10930 (Archive::include_member): Skip reading symbols if already read.
10931 Factored code into Archive::get_file_and_offset and
10932 Archive::get_elf_object_for_member. Changed call to
10933 Mapfile::report_include_archive_member.
10934 (Archive::print_stats): New function.
10935 * archive.h: Declare Object and Read_symbols_data classes.
10936 (Archive::Archive): Add initializers for new members.
10937 (Archive::setup): Add parameter.
10938 (Archive::print_stats): New function.
10939 (Archive::total_archives, Archive::total_members)
10940 (Archive::total_members_loaded): New variables.
10941 (Archive::get_file_and_offset): New function.
10942 (Archive::get_elf_object_for_member): New function.
10943 (Archive::read_all_symbols): New function.
10944 (Archive::read_symbols): New function.
10945 (Archive::Archive_member): New class.
10946 (Archive::members_): New member.
10947 (Archive::num_members_): New member.
10948 * main.cc: Include archive.h.
10949 (main): Call Archive::print_stats.
10950 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10951 archive parameter; member_name is now the fully-decorated name.
10952 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10953 * options.h: (General_options): Add --preread-archive-symbols option.
10954 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10957 2008-08-04 Ian Lance Taylor <iant@google.com>
10959 * symtab.h (Symbol::use_plt_offset): New function.
10960 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10961 * powerpc.cc (Relocate::relocate): Likewise.
10962 * sparc.cc (Relocate::relocate): Likewise.
10963 * x86_64.cc (Relocate::relocate): Likewise.
10964 * testsuite/weak_plt.sh: New test.
10965 * testsuite/weak_plt_main.cc: New test.
10966 * testsuite/weak_plt_shared.cc: New test.
10967 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10968 (check_PROGRAMS): Add weak_plt.
10969 (check_DATA): Add weak_plt_shared.so.
10970 (weak_plt_main_pic.o, weak_plt): New targets.
10971 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10972 * testsuite/Makefile.in: Rebuild.
10974 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10976 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10977 * testsuite/Makefile.in: Rebuild.
10979 2008-08-04 Alan Modra <amodra@bigpond.net.au>
10981 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10982 * Makefile.in: Regenerate.
10983 * po/POTFILES.in: Regenerate.
10985 2008-07-29 Ian Lance Taylor <iant@google.com>
10987 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10988 symbols before other symbols.
10989 * testsuite/script_test_2.cc (test_addr): Declare.
10990 (test_addr_alias): Declare.
10991 (main): Check that test_addr and test_addr_alias have the right
10993 * testsuite/script_test_2.t: Define test_addr_alias and
10996 2008-07-24 Ian Lance Taylor <iant@google.com>
10999 * descriptors.cc: New file.
11000 * descriptors.h: New file.
11001 * gold-threads.h (class Hold_optional_lock): New class.
11002 * fileread.cc: Include "descriptors.h".
11003 (File_read::~File_read): Release descriptor rather than closing
11005 (File_read::open) [file]: Call open_descriptor rather than open.
11006 Set is_descriptor_opened_.
11007 (File_read::open) [memory]: Assert that descriptor is not open.
11008 (File_read::reopen_descriptor): New function.
11009 (File_read::release): Release descriptor.
11010 (File_read::do_read): Make non-const. Reopen descriptor.
11011 (File_read::read): Make non-const.
11012 (File_read::make_view): Reopen descriptor.
11013 (File_read::do_readv): Likewise.
11014 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11015 Update declarations.
11016 * layout.cc: Include "descriptors.h".
11017 (Layout::create_build_id): Use open_descriptor rather than open.
11018 * output.cc: Include "descriptors.h".
11019 (Output_file::open): Use open_descriptor rather than open.
11020 * archive.cc (Archive::const_iterator): Change Archive to be
11022 (Archive::begin, Archive::end): Make non-const.
11023 (Archive::count_members): Likewise.
11024 * archive.h (class Archive): Update declarations.
11025 * object.h (Object::read): Make non-const.
11026 * Makefile.am (CCFILES): Add descriptors.cc.
11027 (HFILES): Add descriptors.h.
11028 * Makefile.in: Rebuild.
11031 * gold.h: Always include <clocale>. Add Solaris workarounds
11032 following code in binutils/sysdep.h.
11035 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11036 this->eh_frame_hdr_ is NULL before using it.
11038 * dynobj.cc (Versions::Versions): Update comment.
11040 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11041 the base version name.
11043 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11044 array size plus one.
11045 (Stringpool_template::set_string_offsets): Subtract one from key
11046 before using it as an array index.
11047 (Stringpool_template::get_offset_with_length): Likewise.
11048 (Stringpool_template::write_to_buffer): Likewise.
11049 * stringpool.h (Stringpool_template::get_offset_from_key):
11052 2008-07-23 Ian Lance Taylor <iant@google.com>
11055 * object.h (Merged_symbol_value::value): Do our best to handle a
11059 * script.cc (Version_script_info::get_versions): Don't add empty
11060 version tag to return value.
11061 (Version_script_info::get_symbol_version_helper): Change return
11062 type to bool. Add pversion parameter. Change all callers.
11063 (script_register_vers_node): Don't require a non-NULL tag.
11064 * script.h (class Version_script_info): Update declarations.
11065 (Version_script_info::get_symbol_version): Change return type to
11066 bool. Add version parameter. Change all callers.
11067 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11068 handling. Handle an empty version from a version script.
11069 (Symbol_table::define_special_symbol): Likewise.
11070 * testsuite/ver_test_10.script: New file.
11071 * testsuite/ver_test_10.sh: New file.
11072 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11073 (check_DATA): Add ver_test_10.syms.
11074 (ver_test_10.syms, ver_test_10.so): New target.
11075 * testsuite/Makefile.in: Rebuild.
11077 2008-07-23 Simon Baldwin <simonb@google.com>
11079 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11080 to zero for undefined symbols from dynamic libraries.
11082 2008-07-23 Ian Lance Taylor <iant@google.com>
11084 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11085 Change all callers.
11086 * symtab.h (class Symbol_table): Update declaration.
11087 * testsuite/ver_test_9.cc: New file.
11088 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11089 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11090 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11091 (ver_test_9.so, ver_test_9.o): New targets.
11092 * testsuite/Makefile.in: Rebuild.
11094 2008-07-22 Ian Lance Taylor <iant@google.com>
11096 * options.h (class General_options): Define --check-sections.
11097 * layout.cc (Layout::set_segment_offsets): Handle
11100 * options.h (class General_options): Define -n/--nmagic and
11102 * options.cc (General_options::finalize): For -n/--nmagic or
11103 -N/--omagic, set -static.
11104 * layout.cc (Layout::attach_allocated_section_to_segment): If
11105 -N/--omagic, don't put read-only and read-write sections in
11106 different segments.
11107 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11108 finding a read-only segment.
11109 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11110 don't set the minimum segment alignment to the common page size,
11111 and don't set the file offset to the address modulo the page size.
11112 * script-sections.cc (Script_sections::create_segments): If
11113 -n/--omagic, don't put read-only and read-write sections in
11114 different segments.
11116 * cref.cc: New file.
11117 * cref.h: New file.
11118 * options.h (class General_options): Add --print-symbol-counts.
11119 * main.cc (main): Issue defined symbol report if requested.
11120 * archive.cc (Archive::interpret_header): Make into a const member
11122 (Archive::add_symbols): Call Input_objects::archive_start and
11124 (Archive::const_iterator): Define new class.
11125 (Archive::begin, Archive::end): New functions.
11126 (Archive::include_all_members): Rewrite to use iterator.
11127 (Archive::count_members): New function.
11128 * archive.h (class Archive): Update declarations.
11129 (Archive::filename): New function.
11130 * object.cc: Include "cref.h".
11131 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11132 (Sized_relobj::do_get_global_symbol_counts): New function.
11133 (Input_objects::add_object): Add object to cross-referencer.
11134 (Input_objects::archive_start): New function.
11135 (Input_objects::archive_stop): New function.
11136 (Input_objects::print_symbol_counts): New function.
11137 * object.h: Declare Cref and Archive.
11138 (Object::get_global_symbol_counts): New function.
11139 (Object::do_get_global_symbol_counts): New pure virtual function.
11140 (class Sized_relobj): Add defined_count_ field. Update
11142 (class Input_objects): Add cref_ field. Update constructor.
11143 Update declarations.
11144 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11146 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11148 (Sized_dynobj::do_get_global_symbol_counts): New function.
11149 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11150 defined_count_. Update declarations. Define Symbols typedef.
11151 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11152 parameter. Change all callers.
11153 (Symbol_table::add_from_dynobj): Add sympointers and defined
11154 parameters. Change all callers.
11155 * symtab.h (class Symbol_table): Update declarations.
11156 * Makefile.am (CCFILES): Add cref.cc.
11157 (HFILES): Add cref.h.
11158 * Makefile.in: Rebuild.
11160 2008-07-22 Simon Baldwin <simonb@google.com>
11162 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11163 to zero when writing undefined symbols.
11165 2008-07-22 Ian Lance Taylor <iant@google.com>
11167 * output.cc (Output_section::add_input_section): Don't try to
11168 merge empty merge sections.
11170 2008-07-21 Craig Silverstein <csilvers@google.com>
11172 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11173 Include symbol version in error message.
11175 2008-07-20 Chris Demetriou <cgd@google.com>
11177 * configure.ac (gold_cv_c_random_seed): New configured variable.
11178 (RANDOM_SEED_CFLAGS): New substituted variable.
11179 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11180 * configure: Rebuild.
11181 * Makefile.in: Likewise.
11182 * testsuite/Makefile.in: Likewise.
11184 2008-07-18 Ian Lance Taylor <iant@google.com>
11186 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11187 where we see NAME/NULL and NAME/VERSION as separate symbols.
11188 * testsuite/ver_test_main.cc (main): Call t4.
11189 (t4, t4_2a): Define.
11190 * testsuite/ver_test_2.cc (t4_2): Define.
11191 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11192 * testsuite/ver_test_4.cc (t4_2a): Define.
11193 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11194 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11196 2008-07-17 Ian Lance Taylor <iant@google.com>
11198 * dynobj.cc (Versions::add_def): If we give an error about a
11199 missing version, go ahead and create the version anyhow.
11201 2008-07-10 Ian Lance Taylor <iant@google.com>
11203 Handle output sections with more than 0x7fffffff bytes.
11204 * object.h (class Relobj): Change map_to_output_ to
11205 output_sections_, and just keep a section pointer. Change all
11206 uses. Move comdat group support to Sized_relobj.
11207 (Relobj::is_section_specially_mapped): Remove.
11208 (Relobj::output_section): Remove poff parameter. Change all
11210 (Relobj::output_section_offset): New function.
11211 (Relobj::set_section_offset): Rewrite.
11212 (Relobj::map_to_output): Remove.
11213 (Relobj::output_sections): New function.
11214 (Relobj::do_output_section_offset): New pure virtual function.
11215 (Relobj::do_set_section_offset): Likewise.
11216 (class Sized_relobj): Add section_offsets_ field. Add comdat
11217 group support from Relobj. Update declarations.
11218 (Sized_relobj::get_output_section_offset): New function.
11219 (Sized_relobj::do_output_section_offset): New function.
11220 (Sized_relobj::do_set_section_offset): New function.
11221 * object.cc (Relobj::output_section_address): Remove.
11222 (Sized_relobj::Sized_relobj): Initialize new fields.
11223 (Sized_relobj::include_section_group): Cast find_kept_object to
11225 (Sized_relobj::include_linkonce_section): Likewise.
11226 (Sized_relobj::do_layout): Use separate arrays for output section
11228 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11230 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11231 output_sections and section_offsets.
11232 (Sized_relobj::write_local_symbols): Likewise.
11233 (map_to_kept_section): Compute output address directly.
11234 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11235 output_sections and section_offsets.
11236 (Sized_relobj::write_sections): Likewise.
11237 (Sized_relobj::relocate_sections): Likewise.
11238 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11239 * output.h (class Output_reloc): Update declarations. Change
11240 u2_.relobj to Sized_relobj*.
11241 (class Output_data_reloc): Change add functions to use
11243 * output.cc (Output_reloc::Output_reloc): Change relobj to
11245 (Output_reloc::local_section_offset): Change return type to
11246 Elf_Addr. Use get_output_section_offset.
11247 (Output_reloc::get_address): Likewise.
11248 (Output_section::is_input_address_mapped): Don't call
11249 is_section_specially_mapped.
11250 (Output_section::output_offset): Likewise.
11251 (Output_section::output_address): Likewise.
11252 (Output_section::starting_output_address): Likewise.
11253 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11254 parameter to Sized_relobj*.
11255 (Copy_relocs::need_copy_reloc): Likewise.
11256 (Copy_relocs::save): Likewise.
11257 * copy-relocs.h (class Copy_relocs): Update declarations.
11258 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11259 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11260 * target-reloc.h (relocate_for_relocatable): Change
11261 offset_in_output_section type to Elf_Addr. Change code that uses
11263 * layout.cc (Layout::layout): Always set *off.
11264 * mapfile.cc (Mapfile::print_input_section): Use
11265 output_section_offset.
11266 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11268 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11269 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11270 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11272 2008-07-03 Ian Lance Taylor <iant@google.com>
11274 * layout.cc (Layout::include_section): Do not discard unrecognized
11275 SHT_STRTAB sections.
11277 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11279 * script.cc (Lex::can_continue_name): Make '?' allowable in
11280 version-script names.
11281 * testsuite/version_script.map: Change glob pattern to use '?'
11283 2008-06-30 Manish Singh <yosh@gimp.org>
11286 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11289 2008-06-30 Ian Lance Taylor <iant@google.com>
11293 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11294 versions]: Don't try to read the value in the contents, since we
11295 don't use it. Use the template endianness when writing.
11297 2008-06-25 Cary Coutant <ccoutant@google.com>
11299 * fileread.cc (File_read::make_view): Assert on zero-length view.
11300 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11301 symbol table when there are no symbols to read.
11303 2008-06-23 Craig Silverstein <csilvers@google.com>
11305 * version.cc (version_string): Bump to 1.7
11307 2008-06-18 Craig Silverstein <csilvers@google.com>
11309 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11310 constant 0xFFFF to type Valtype.
11311 (Powerpc_relocate_functions::rel16_ha): Likewise.
11313 2008-06-17 Ian Lance Taylor <iant@google.com>
11315 * output.h (Output_section::Input_section): Initialize p2align_ to
11316 zero for Output_section_data constructors.
11317 (Output_section::Input_section::addralign): If not an input
11318 section, return the alignment of the Output_section_data.
11319 * testsuite/copy_test.cc: New file.
11320 * testsuite/copy_test_1.cc: New file.
11321 * testsuite/copy_test_2.cc: New file.
11322 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11323 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11324 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11325 (copy_test_1_pic.o, copy_test_1.so): New targets.
11326 (copy_test_2_pic.o, copy_test_2.so): New targets.
11327 * testsuite/Makefile.in: Rebuild.
11329 * script-sections.cc (Script_sections::place_orphan): Initialize
11330 local variable exact.
11332 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11334 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11336 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11337 David S. Miller <davem@davemloft.net>
11339 * powerpc.cc: New file.
11340 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11341 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11342 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11343 * Makefile.in: Rebuild.
11345 2008-06-09 Ian Lance Taylor <iant@google.com>
11347 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11349 (throwing, orig_terminate): New static variables.
11350 (terminate_handler): New static function.
11351 (t2): Set terminate handler.
11353 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11356 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11359 2008-05-30 Cary Coutant <ccoutant@google.com>
11361 * archive.cc (Archive::include_all_members) Correct to step
11362 over symbol table and extended name table in thin archives.
11364 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11367 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11370 2008-05-28 Caleb Howe <cshowe@google.com>
11372 * reduced_debug_output.cc: New file.
11373 * reduced_debug_output.h: New file.
11374 * options.h (class General_options): Add --strip-debug-non-line.
11375 * options.cc (General_options::finalize): Add strip_debug_non_line
11376 to the strip heirarchy.
11377 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11379 * layout.cc: Include "reduced_debug_output.h".
11380 (Layout::Layout): Initialize new fields.
11381 (line_only_debug_sections): New static array.
11382 (is_lines_only_debug_sections): New static inline function.
11383 (Layout::include_section): Handle --strip-debug-non-line.
11384 (Layout::make_output_section): If --strip-debug-non-line, build
11385 new output sections for .debug_abbrev and .debug_info.
11386 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11387 gold. Warn about possible overflow.
11388 (read_signed_LEB_128): Likewise.
11389 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11390 (read_signed_LEB_128): Declare.
11391 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11392 (HFILES): Add reduced_debug_output.h.
11393 * Makefile.in: Rebuild.
11395 2008-05-21 Ian Lance Taylor <iant@google.com>
11397 * mapfile.cc: New file.
11398 * mapfile.h: New file.
11399 * options.h (class General_options): Add -M/--print-map and -Map.
11400 * options.cc (General_options::finalize): Make -M equivalent to
11402 * main.cc: Include <cstdio> and "mapfile.h".
11403 (main): Open mapfile if requested.
11404 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11405 constructor. Change caller.
11406 (queue_initial_tasks): Add mapfile parameter. Change caller.
11407 (queue_middle_tasks): Likewise.
11408 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11410 * archive.cc: Include "mapfile.h".
11411 (Archive::add_symbols): Add mapfile parameter. Change all
11412 callers. Pass mapfile, symbol, and reason to include_member.
11413 (Archive::include_all_members): Add mapfile parameter. Change all
11415 (Archive::include_member): Add mapfile, sym, and why parameters.
11416 Change all callers. Report inclusion to map file.
11417 * archive.h: Include "fileread.h".
11418 (class Archive): Update declarations.
11419 (Archive::file): New const method.
11420 (class Add_archive_symbols): Add mapfile_ field. Update
11421 constructor. Change all callers.
11422 * readsyms.h (class Read_symbols): Likewise.
11423 (class Finish_group): Likewise.
11424 (class Read_script): Likewise.
11425 * common.cc: Include "mapfile.h".
11426 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11428 (Symbol_table::do_allocate_commons): Likewise.
11429 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11430 symbol allocation to mapfile.
11431 * common.h (class Allocate_commons_task): Add mapfile_ field.
11432 Update constructor. Change all callers.
11433 * symtab.h (class Symbol_table): Update declarations.
11434 * layout.cc: Include "mapfile.h".
11435 (Layout_task_runner::run): Print information to mapfile.
11436 (Layout::create_gold_note): Change Output_data_fixed_space to
11437 Output_data_zero_fill.
11438 (Layout::create_build_id): Likewise.
11439 (Layout::print_to_mapfile): New function.
11440 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11441 constructor. Change caller.
11442 (class Layout): Declare print_to_mapfile.
11443 * output.cc (Output_section::Input_section::print_to_mapfile): New
11445 (Output_section::add_input_section): If producing a map, always
11446 add to input_sections_ list.
11447 (Output_section::do_print_to_mapfile): New function.
11448 (Output_segment::print_sections_to_mapfile): New function.
11449 (Output_segment::print_section_list_to_mapfile): New function.
11450 * output.h: Include "mapfile.h".
11451 (Output_data::print_to_mapfile): New function.
11452 (Output_data::do_print_to_mapfile): New virtual function.
11453 (Output_segment_headers::do_print_to_mapfile): New function.
11454 (Output_file_header::do_print_to_mapfile): New function.
11455 (Output_data_const::do_print_to_mapfile): New function.
11456 (class Output_data_const_buffer): Add map_name_ field. Update
11457 constructor. Change all callers. Add do_print_to_mapfile
11459 (class Output_data_fixed_space): Likewise.
11460 (class Output_data_space): Likewise.
11461 (class Output_data_zero_fill): New class.
11462 (Output_data_strtab::do_print_to_mapfile): New function.
11463 (Output_data_reloc_base::do_print_to_mapfile): New function.
11464 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11465 (Output_data_group::do_print_to_mapfile): New function.
11466 (Output_data_got::do_print_to_mapfile): New function.
11467 (Output_data_dynamic::do_print_to_mapfile): New function.
11468 (Output_symtab_xindex::do_print_to_mapfile): New function.
11469 (class Output_section): Declare do_print_to_mapflie. Declare
11470 print_to_mapfile in Input_section.
11471 (class Output_segment): Declare new functions.
11472 * object.h (Sized_relobj::symbol_count): New function.
11473 * script-sections.cc
11474 (Output_section_element_dot_assignment::set_section_addresses):
11475 Change Output_data_fixed_space to Output_data_zero_fill.
11476 (Output_data_expression::do_print_to_mapfile): New function.
11477 * script.cc (read_input_script): Add mapfile parameter. Change
11479 * script.h (read_input_script): Update declaration.
11480 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11481 (Eh_frame::do_print_to_mapfile): New function.
11482 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11483 (Output_merge_string::do_print_to_mapfile): New function.
11484 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11486 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11488 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11490 * Makefile.am (CCFILES): Add mapfile.cc.
11491 (HFILES): Add mapfile.h.
11492 * Makefile.in: Rebuild.
11494 2008-05-19 Ian Lance Taylor <iant@google.com>
11496 * options.h (class General_options): Add -z relro.
11497 * layout.cc (Layout::Layout): Initialize relro_segment_.
11498 (Layout::add_output_section_data): Return the output section.
11499 (Layout::make_output_section): Rcognize relro sections and mark
11500 them appropriately.
11501 (Layout::attach_allocated_section_to_segment): Put relro sections
11502 in a PT_GNU_RELRO segment.
11503 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11505 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11507 (Layout::linkonce_mapping): Map d.rel.ro.local to
11508 .data.rel.ro.local.
11509 (Layout::output_section_name): Us .data.rel.ro.local for any
11510 section which begins with that.
11511 * layout.h (class Layout): Update add_output_section_data
11512 declaration. Add relro_segment_ field.
11513 * output.cc (Output_section::Output_section): Initialize is_relro_
11514 and is_relro_local_ fields.
11515 (Output_segment::add_output_section): Group relro sections.
11516 (Output_segment::is_first_section_relro): New function.
11517 (Output_segment::maximum_alignment): If there is a relro section,
11518 align the segment to the common page size.
11519 (Output_segment::set_section_addresses): Track whether we are
11520 looking at relro sections. If the last section is a relro
11521 section, align to the common page size.
11522 (Output_segment::set_section_list_addresses): Add in_relro
11523 parameter. Change all callers. Align to the page size when
11524 moving from relro to non-relro section.
11525 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11527 * output.h (class Output_section): Add is_relro_ and
11528 is_relro_local_ fields.
11529 (Output_section::is_relro): New function.
11530 (Output_section::set_is_relro): New function.
11531 (Output_section::is_relro_local): New function.
11532 (Output_section::set_is_relro_local): New function.
11533 (class Output_segment): Update declarations.
11534 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11535 * sparc.cc (Target_sparc::got_section): Likewise.
11536 * x86_64.cc (Target_x86_64::got_section): Likewise.
11537 * testsuite/relro_test_main.cc: New file.
11538 * testsuite/relro_test.cc: New file.
11539 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11540 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11541 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11542 (relro_test.so, relro_test_pic.o): New targets.
11543 * testsuite/Makefile.in: Rebuild.
11545 2008-05-16 Ian Lance Taylor <iant@google.com>
11547 * output.cc (Output_segment::add_output_section): Remove front
11549 * output.h (class Output_segment): Remove
11550 add_initial_output_section and overloaded add_output_section.
11551 Update declaration of remaining add_output_section.
11552 * layout.cc (Layout::create_interp): Call add_output_section
11553 rather than add_initial_output_section.
11554 (Layout::finish_dynamic_section): Likewise.
11556 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11557 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11558 know the dynamic type.
11559 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11560 field. Initialize it in constructor.
11561 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11562 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11563 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11566 * output.cc (Output_reloc::get_address): Change return type to
11568 * output.h (class Output_reloc): Update get_address declaration.
11569 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11570 for section addresses.
11572 2008-05-09 Ian Lance Taylor <iant@google.com>
11575 * gold.cc (gold_nomem): Use return value of write.
11577 2008-05-08 Ian Lance Taylor <iant@google.com>
11579 * symtab.c (Symbol::init_base_output_data): Add version
11580 parameter. Change all callers.
11581 (Symbol::init_base_output_segment): Likewise.
11582 (Symbol::init_base_constant): Likewise.
11583 (Symbol::init_base_undefined): Likewise.
11584 (Sized_symbol::init_output_data): Likewise.
11585 (Sized_symbol::init_output_segment): Likewise.
11586 (Sized_symbol::init_constant): Likewise.
11587 (Sized_symbol::init_undefined): Likewise.
11588 (Symbol_table::do_define_in_output_data): If the new symbol has a
11589 version, mark it as the default.
11590 (Symbol_table::do_define_in_output_segment): Likewise.
11591 (Symbol_table::do_define_as_constant): Likewise.
11592 * symtab.h (class Symbol): Update declarations.
11593 (class Sized_symbol): Likewise.
11594 * resolve.cc (Symbol::override_version): New function.
11595 (Symbol::override_base): Call override_version.
11596 (Symbol::override_base_with_special): Likewise.
11597 * testsuite/ver_script_8.script: New file.
11598 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11599 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11600 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11601 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11603 2008-05-06 Ian Lance Taylor <iant@google.com>
11606 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11608 (class General_options): Remove existing --undefined, and add
11609 --no-undefined instead. Add new --undefined as synonym for -u.
11610 * archive.cc (Archive::add_symbols): Check whether symbol was
11612 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11613 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11614 all uses. Add IS_UNDEFINED. Update declarations to split
11615 different versions of init_base. Declare init_base_undefined.
11616 (Symbol::is_defined): Handle IS_UNDEFINED.
11617 (Symbol::is_undefined): Likewise.
11618 (Symbol::is_weak_undefined): Call is_undefined.
11619 (Symbol::is_absolute): Handle IS_CONSTANT.
11620 (class Sized_symbol): Update declarations to split different
11621 versions of init. Declare init_undefined.
11622 (class Symbol_table): Declare new functions.
11623 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11624 Change all callers.
11625 (Symbol::init_base_output_data): Likewise.
11626 (Symbol::init_base_output_segment): Likewise.
11627 (Symbol::init_base_constant): Likewise.
11628 (Symbol::init_base_undefined): New function.
11629 (Sized_symbol::init_object): Rename from init. Change all
11631 (Sized_symbol::init_output_data): Likewise.
11632 (Sized_symbol::init_output_segment): Likewise.
11633 (Sized_symbol::init_constant): Likewise.
11634 (Sized_symbol::init_undefined): New function.
11635 (Symbol_table::add_undefined_symbols_from_command_line): New
11637 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11639 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11640 (Symbol::output_section): Likewise.
11641 (Symbol::set_output_section): Likewise.
11642 (Symbol_table::sized_finalize_symbol): Likewise.
11643 (Symbol_table::sized_write_globals): Likewise.
11644 * resolve.cc (Symbol_table::should_override): Likewise.
11645 (Symbol::override_base_with_special): Likewise.
11647 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11648 symbol, change it to have default visibility.
11649 * testsuite/protected_1.cc: New file.
11650 * testsuite/protected_2.cc: New file.
11651 * testsuite/protected_3.cc: New file.
11652 * testsuite/protected_main_1.cc: New file.
11653 * testsuite/protected_main_2.cc: New file.
11654 * testsuite/protected_main_3.cc: New file.
11655 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11656 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11657 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11658 (protected_1.so): New target.
11659 (protected_1_pic.o, protected_2_pic.o): New targets.
11660 (protected_3_pic.o): New target.
11661 (check_PROGRAMS): Add protected_2.
11662 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11663 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11664 * testsuite/Makefile.in: Rebuild.
11666 * options.h (DEFINE_var): Add set_user_set_##varname__.
11667 (DEFINE_bool_alias): New macro.
11668 (class General_options): Define -Bstatic using DEFINE_bool_alias
11669 rather than DEFINE_special. Add --undefined as an alias for -z
11671 * options.cc (General_options::parse_Bstatic): Remove.
11673 * options.h (class General_options): Add --fatal-warnings.
11674 * main.cc (main): Implement --fatal-warnings.
11675 * errors.h (Errors::warning_count): New function.
11677 * options.h (class General_options): Add -Bsymbolic-functions.
11678 * symtab.h (Symbol::is_preemptible): Check for
11679 -Bsymbolic-functions.
11681 2008-05-05 Ian Lance Taylor <iant@google.com>
11683 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11684 as noVARNAME rather than no-VARNAME.
11685 (class General_options): Add option -z combreloc.
11686 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11688 (Output_reloc::sort_before) [SHT_REL]: New function.
11689 (Output_reloc::sort_before) [SHT_RELA]: New function.
11690 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11691 Sort_relocs_comparison.
11692 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11693 parameter. Change all callers.
11694 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11695 sort_relocs parameter. Change all callers.
11696 * output.cc (Output_reloc::get_address): New function, broken out
11698 (Output_reloc::write_rel): Call it.
11699 (Output_reloc::compare): New function.
11700 (Output_data_reloc_base::do_write): Optionally sort relocs.
11702 * configure.ac: If targ_extra_obj is set, link it in.
11703 * configure.tgt: Initialize all variables.
11704 (x86_64*): Set targ_extra_obj and targ_extra_size.
11705 * configure: Rebuild.
11707 * object.cc (Sized_relobj::include_section_group): Adjust section
11708 indexes read from group data. Build vector to pass to
11710 * layout.cc (Layout::layout_group): Add flags and shndxes
11711 parameters. Remove contents parameter. Change caller. Update
11712 explicit instantiations.
11713 * layout.h (class Layout): Update layout_group declaration.
11714 * output.cc (Output_data_group::Output_data_group): Add flags and
11715 input_shndxes parameters. Remove contents parameter. Change
11717 (Output_data_group::do_write): Change input_sections_ to
11719 * output.h (class Output_data_group): Update constructor
11720 declaration. Rename input_sections_ to input_shndxes_.
11721 * testsuite/many_sections_test.cc: Add template.
11723 2008-04-30 Cary Coutant <ccoutant@google.com>
11725 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11727 * layout.cc (Layout::include_section): Refactored check for debug
11729 (Layout::add_comdat): Add new parameters. Change type
11730 of signature parameter. Add object and shndx to signatures table.
11731 (Layout::find_kept_object): New function.
11732 * layout.h: Include <cstring>.
11733 (Layout::is_debug_info_section): New function.
11734 (Layout::add_comdat): Add new parameters.
11735 (Layout::find_kept_object): New function.
11736 (Layout::Kept_section): New struct.
11737 (Layout::Signatures): Change type of map range.
11738 * object.cc (Relobj::output_section_address): New function.
11739 (Sized_relobj::include_section_group): Add new parameters. Change
11740 calls to Layout::add_comdat. Change to build table of kept comdat
11741 groups and table mapping discarded sections to kept sections.
11742 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11743 (Sized_relobj::do_layout): Change calls to include_section_group and
11744 include_linkonce_section.
11745 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11746 value to zero when section is discarded.
11747 (Sized_relobj::map_to_kept_section): New function.
11748 * object.h (Relobj::output_section_address): New function.
11749 (Relobj::Comdat_group): New type.
11750 (Relobj::find_comdat_group): New function.
11751 (Relobj::Comdat_group_table): New type.
11752 (Relobj::Kept_comdat_section): New type.
11753 (Relobj::Kept_comdat_section_table): New type.
11754 (Relobj::add_comdat_group): New function.
11755 (Relobj::set_kept_comdat_section): New function.
11756 (Relobj::get_kept_comdat_section): New function.
11757 (Relobj::comdat_groups_): New field.
11758 (Relobj::kept_comdat_sections_): New field.
11759 (Symbol_value::input_value): Update comment.
11760 (Sized_relobj::map_to_kept_section) New function.
11761 (Sized_relobj::include_linkonce_section): Add new parameter.
11762 * target-reloc.h (Comdat_behavior): New type.
11763 (get_comdat_behavior): New function.
11764 (relocate_section): Add code to map a discarded section to the
11765 corresponding kept section when applying a relocation.
11767 2008-04-30 Craig Silverstein <csilvers@google.com>
11769 * dwarf_reader.cc (next_generation_count): New static var.
11770 (Addr2line_cache_entry): New struct.
11771 (addr2line_cache): New static var.
11772 (Dwarf_line_info::one_addr2line): Added caching.
11773 (Dwarf_line_info::clear_addr2line_cache): New function.
11774 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11775 cache-size parameter.
11776 (Dwarf_line_info::one_addr2line_cache): New function.
11777 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11778 new cache-size argument to one_addr2line(), and clear cache.
11780 2008-04-28 Cary Coutant <ccoutant@google.com>
11782 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11783 R_386_PC8 relocations.
11785 2008-04-23 Ian Lance Taylor <iant@google.com>
11787 * object.cc (Sized_relobj::include_section_group): Check for
11788 invalid section group.
11790 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11793 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11794 than read for file header.
11795 * archive.cc (Archive::include_member): Likewise.
11797 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
11799 * aclocal.m4: Regenerate.
11800 * configure: Regenerate.
11802 2008-04-19 Ian Lance Taylor <iant@google.com>
11804 * version.cc (version_string): Bump to 1.6.
11806 * testsuite/Makefile.am (many_sections_r_test): New target.
11807 (many_sections_r_test_SOURCES): Remove.
11808 (many_sections_r_test_DEPENDENCIES): Remove.
11809 (many_sections_r_test_LDFLAGS): Remove.
11810 (many_sections_r_test_LDADD): Remove.
11812 * object.cc (Sized_relobj::do_add_symbols): Always pass
11813 local_symbol_count_ to add_from_relobj.
11815 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11816 every thousand variables.
11817 * testsuite/Makefile.in: Rebuild.
11819 * object.cc (Xindex::initialize_symtab_xindex): New function.
11820 (Xindex::read_symtab_xindex): New function.
11821 (Xindex::sym_xindex_to_shndx): New function.
11822 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11824 (Sized_relobj::do_initialize_xindex): New function.
11825 (Sized_relobj::do_read_symbols): Adjust section links.
11826 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11827 parameter. Change all callers.
11828 (Sized_relobj::include_section_group): Adjust section links and
11829 symbol section indexes.
11830 (Sized_relobj::do_layout): Adjust section links.
11831 (Sized_relobj::do_count_local_symbols): Adjust section links and
11832 symbol section indexes.
11833 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11834 ordinary and special symbols.
11835 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11836 dynsym_xindex parameters. Change all callers. Adjust section
11837 links. Use SHN_XINDEX when needed.
11838 (Sized_relobj::get_symbol_location_info): Adjust section links.
11839 Don't get fooled by special symbols.
11840 * object.h (class Xindex): Define.
11841 (class Object): Add xindex_ parameter. Declare virtual functoin
11842 do_initialize_xindex.
11843 (Object::adjust_sym_shndx): New function.
11844 (Object::set_xindex): New protected function.
11845 (class Symbol_value): Add is_ordinary_shndx_ field.
11846 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11847 (Symbol_value::value): Assert ordinary section.
11848 (Symbol_value::initialize_input_to_output_map): Likewise.
11849 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11850 Change all callers.
11851 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11853 (class Sized_relobj): Update declarations.
11854 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11855 parameter. Change all callers.
11856 (Sized_relobj::adjust_shndx): New function.
11857 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11859 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11860 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11861 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11862 (Sized_dynobj::read_dynsym_section): Adjust section links.
11863 (Sized_dynobj::read_dynamic): Likewise.
11864 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11866 (Sized_dynobj::do_initialize_xindex): New function.
11867 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11868 do_initialize_xindex.
11869 (Sized_dynobj::adjust_shndx): New function.
11870 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11871 dynsym_xindex_ fields.
11872 (Layout::finalize): Add a call to set_section_indexes before
11873 creating the symtab sections.
11874 (Layout::set_section_indexes): Don't do anything if the section
11875 already has a section index.
11876 (Layout::create_symtab_sections): Add shnum parameter. Change
11877 caller. Create .symtab_shndx section if needed.
11878 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11880 (Layout::allocated_output_section_count): New function.
11881 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11883 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11884 fields. Update declarations.
11885 (Layout::symtab_xindex): New function.
11886 (Layout::dynsym_xindex): New function.
11887 (class Write_symbols_task): Add layout_ field.
11888 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11890 * output.cc (Output_section_headers::Output_section_headers): Add
11891 shstrtab_section parameter. Change all callers.
11892 (Output_section_headers::do_sized_write): Store overflow values
11893 for section count and section string table section index in
11894 section header zero.
11895 (Output_file_header::do_sized_write): Check for overflow of
11896 section count and section string table section index.
11897 (Output_symtab_xindex::do_write): New function.
11898 (Output_symtab_xindex::endian_do_write): New function.
11899 * output.h (class Output_section_headers): Add shstrtab_section_.
11900 Update declarations.
11901 (class Output_symtab_xindex): Define.
11902 (Output_section::has_out_shndx): New function.
11903 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11905 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11906 Change all callers.
11907 (Sized_symbol::init): Likewise.
11908 (Symbol::output_section): Check for ordinary symbol.
11909 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11910 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11912 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11913 Change all callers. Simplify handling of symbols from sections
11914 not included in the link.
11915 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11917 (Weak_alias_sorter::operator()): Assert that symbols are
11919 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11921 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11922 parameters. Change all callers.
11923 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11924 symbol distinction. Use SHN_XINDEX when needed.
11925 (Symbol_table::write_section_symbol): Add symtab_xindex
11926 parameter. Change all callers.
11927 (Symbol_table::sized_write_section_symbol): Likewise. Use
11928 SHN_XINDEX when needed.
11929 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11931 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11932 (Symbol::is_defined): Check is_ordinary.
11933 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11934 (Symbol::is_absolute, Symbol::is_common): Likewise.
11935 (class Sized_symbol): Update declarations.
11936 (class Symbol_table): Update declarations.
11937 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11938 parameters. Change all callers.
11939 (Sized_symbol::override): Likewise.
11940 (Symbol_table::override): Likewise.
11941 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11942 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11943 is_ordinary, and orig_st_shndx parameters. Change all callers.
11944 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11945 to be in an ordinary section.
11946 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11947 object and is_ordinary parameters. Change all callers.
11948 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11949 Change all callers. Don't add undefined or non-ordinary symbols
11951 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11952 Change all callers.
11953 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11955 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11956 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11957 (Sized_relobj::relocate_sections): Likewise.
11958 * target-reloc.h (scan_relocs): Adjust section symbol index.
11959 (scan_relocatable_relocs): Likewise.
11960 * i386.cc (Scan::local): Check for ordinary symbols.
11961 * sparc.cc (Scan::local): Likewise.
11962 * x86_64.cc (Scan::local): Likewise.
11963 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11964 to symbol_section_and_value.
11965 * testsuite/many_sections_test.cc: New file.
11966 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11967 (check_PROGRAMS): Add many_sections_test.
11968 (many_sections_test_SOURCES): Define.
11969 (many_sections_test_DEPENDENCIES): Define.
11970 (many_sections_test_LDFLAGS): Define.
11971 (BUILT_SOURCES): Add many_sections_define.h.
11972 (many_sections_define.h): New target.
11973 (BUILT_SOURCES): Add many_sections_check.h.
11974 (many_sections_check.h): New target.
11975 (check_PROGRAMS): Add many_sections_r_test.
11976 (many_sections_r_test_SOURCES): Define.
11977 (many_sections_r_test_DEPENDENCIES): Define.
11978 (many_sections_r_test_LDFLAGS): Define.
11979 (many_sections_r_test_LDADD): Define.
11980 (many_sections_r_test.o): New target.
11981 * testsuite/Makefile.in: Rebuild.
11983 2008-04-17 Cary Coutant <ccoutant@google.com>
11985 * errors.cc (Errors::info): New function.
11986 (gold_info): New function.
11987 * errors.h (Errors::info): New function.
11988 * gold.h (gold_info): New function.
11989 * object.cc (Input_objects::add_object): Print trace output.
11990 * options.cc (options::parse_set): New function.
11991 (General_options::parse_wrap): Deleted.
11992 (General_options::General_options): Deleted initializer.
11993 * options.h (options::String_set): New typedef.
11994 (options::parse_set): New function.
11995 (DEFINE_set): New macro.
11996 (General_options::wrap): Changed to use DEFINE_set. Changed
11997 callers of any_wrap_symbols and is_wrap_symbol.
11998 (General_options::trace, General_options::trace_symbol):
12000 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12001 (General_options::wrap_symbols_): Deleted.
12002 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12004 2008-04-17 David S. Miller <davem@davemloft.net>
12006 * options.cc (General_options::parse_V): New function.
12007 * options.h: Add entries for -V and -Qy.
12009 2008-04-17 Ian Lance Taylor <iant@google.com>
12011 * common.cc (Symbol_table::allocate_commons): Remove options
12012 parameter. Change caller.
12013 (Symbol_table::do_allocate_commons): Remove options parameter.
12014 Change caller. Just call do_allocate_commons_list twice.
12015 (Symbol_table::do_allocate_commons_list): New function, broken out
12016 of do_allocate_commons.
12017 * common.h (class Allocate_commons_task): Remove options_ field.
12018 Update constructor.
12019 * symtab.cc (Symbol_table::Symbol_table): Initialize
12021 (Symbol_table::add_from_object): Put TLS common symbols on
12023 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12024 which are IN_OUTPUT_DATA.
12025 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12026 allocate_commons and do_allocate_commons declarations. Declare
12027 do_allocate_commons_list.
12028 * gold.cc (queue_middle_tasks): Update creation of
12029 Allocate_commons_task to not pass options.
12030 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12031 (TLS_TEST_C_FLAGS): New variable.
12032 (tls_test_c_pic.o): New target.
12033 (tls_test_shared.so): Link in tls_test_c_pic.o.
12034 (tls_test_c_pic_ie.o): New target.
12035 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12036 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12037 (tls_test_c.o): New target.
12038 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12039 (tls_pic_test_LDADD): Likewise.
12040 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12041 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12042 (tls_test_c_gnu2.o): New target.
12043 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12045 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12046 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12047 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12048 * testsuite/tls_test.cc: Include "config.h".
12049 (t_last): Call t11_last.
12050 * testsuite/tls_test.h (t11, t11_last): Declare.
12051 * testsuite/tls_test_c.c: New file.
12052 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12053 * configure.ac: Check for OpenMP support.
12054 * configure, config.in, Makefile.in: Rebuild.
12055 * testsuite/Makefile.in: Rebuild.
12057 2008-04-16 Cary Coutant <ccoutant@google.com>
12059 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12060 (Target_i386::tls_base_symbol_defined_): New field.
12061 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12062 (Target_i386::Scan::global): Likewise.
12063 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12064 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12065 (Target_x86_64::tls_base_symbol_defined_): New field.
12066 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12067 (Target_x86_64::Scan::global): Likewise.
12069 2008-04-16 Cary Coutant <ccoutant@google.com>
12071 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12072 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12073 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12074 building shared libraries.
12075 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12076 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12077 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12078 * testsuite/Makefile.in: Rebuild.
12079 * testsuite/weak_undef.h: New file.
12080 * testsuite/weak_undef_file1.cc: Add extra test cases.
12081 * testsuite/weak_undef_file2.cc: Likewise.
12082 * testsuite/weak_undef_test.cc: Likewise.
12084 2008-04-16 David S. Miller <davem@davemloft.net>
12086 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12087 Add issued_non_pic_error_ field. Declare check_non_pic.
12088 (Target_sparc::Scan::check_non_pic): New function.
12089 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12090 (Target_sparc::Scan::global): Likewise.
12092 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12093 * configure: Rebuild.
12095 * options.h (DEFINE_enable): New macro.
12096 (new_dtags): New enable option.
12097 (initfirst, interpose, loadfltr, nodefaultlib,
12098 nodelete, nodlopen, nodump): New -z options.
12099 * layout.cc (Layout:finish_dynamic_section): If new
12100 dtags enabled, emit DT_RUNPATH. Also, emit a
12101 DT_FLAGS_1 containing any specified -z flags.
12103 2008-04-16 Ian Lance Taylor <iant@google.com>
12105 * copy-relocs.cc: New file.
12106 * copy-relocs.h: New file.
12107 * reloc.cc: Remove Copy_relocs code.
12108 * reloc.h: Likewise.
12109 * reloc-types.h (struct Reloc_types) [both versions]: Add
12110 get_reloc_addend_noerror.
12111 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12112 variants of add_global which take an addend which must be zero.
12113 * i386.cc: Include "copy-relocs.h".
12114 (class Target_i386): Change type of copy_relocs_ to variable,
12115 update initializer.
12116 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12117 Change all callers.
12118 (Target_i386::do_finalize_sections): Change handling of
12120 * sparc.cc: Include "copy-relocs.h".
12121 (class Target_sparc): Change type of copy_relocs_ to variable,
12122 update initializer.
12123 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12124 Change all callers.
12125 (Target_sparc::do_finalize_sections): Change handling of
12127 * x86_64.cc: Include "copy-relocs.h".
12128 (class Target_x86_64): Change type of copy_relocs_ to variable,
12129 update initializer.
12130 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12131 class. Change all callers.
12132 (Target_x86_64::do_finalize_sections): Change handling of
12134 * Makefile.am (CCFILES): Add copy-relocs.cc.
12135 (HFILES): Add copy-relocs.h.
12137 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12139 * testsuite/script_test_4.sh: Permit leading zeroes.
12141 2008-04-15 Ian Lance Taylor <iant@google.com>
12143 * script-sections.cc (Script_sections::create_segments): Use
12144 header_size_adjustment even when there is enough room for the
12146 * testsuite/script_test_4.sh: New file.
12147 * testsuite/script_test_4.t: New file.
12148 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12149 (check_DATA): Add script_test_4.stdout.
12150 (MOSTLYCLEANFILES): Likewise.
12151 (script_test_4): New target.
12152 (script_test_4.stdout): New target.
12153 * testsuite/Makefile.in: Rebuild.
12155 * sparc.cc: Add definitions for Output_data_plt_sparc class
12158 2008-04-14 David S. Miller <davem@davemloft.net>
12160 * sparc.cc: New file.
12161 * Makefile.am (TARGETSOURCES): Add sparc.cc
12162 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12163 * configure.tgt: Document targ_extra_size and
12164 targ_extra_big_endian. Add entries for sparc-* and
12166 * configure.ac: Handle targ_extra_size and
12167 targ_extra_big_endian.
12168 * Makefile.in: Rebuild.
12169 * configure: Likewise.
12170 * po/POTFILES.in: Likewise.
12171 * po/gold.pot: Likewise.
12173 2008-04-14 Ian Lance Taylor <iant@google.com>
12175 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12176 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12177 in the name/type/flags to section mapping. Don't call
12178 allocate_output_section.
12179 (Layout::choose_output_section): Change parameter from adjust_name
12180 to is_input_section. Don't permit input sections after sections
12181 are attached to segments. Don't call allocate_output_section.
12182 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12183 not write_enable_output_section.
12184 (Layout::make_output_section): Don't push to
12185 unattached_section_list_ nor call attach_to_segment. Call
12186 attach_section_to_segment if sections are attached.
12187 (Layout::attach_sections_to_segments): New function.
12188 (Layout::attach_section_to_segment): New function.
12189 (Layout::attach_allocated_section_to_segment): Rename from
12190 attach_to_segment. Remove flags parameter.
12191 (Layout::allocate_output_section): Remove function.
12192 (Layout::write_enable_output_section): Remove function.
12193 * layout.h (class Layout): Update for above changes. Add new
12194 field sections_are_attached_.
12195 * output.h (Output_section::update_flags_for_input_section): New
12197 * output.cc (Output_section::add_input_section): Call
12198 update_flags_for_input_section.
12199 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12201 2008-04-11 Cary Coutant <ccoutant@google.com>
12203 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12204 thought unnecessary.
12205 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12207 2008-04-11 Ian Lance Taylor <iant@google.com>
12209 * output.h (class Output_section_data): Remove inline definition
12211 * output.cc (Output_section_data::set_addralign): New function.
12213 2008-04-11 Cary Coutant <ccoutant@google.com>
12215 Add support for TLS descriptors for i386 and x86_64.
12216 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12217 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12218 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12220 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12221 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12222 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12224 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12225 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12226 Fix problem with initial-exec relocations.
12227 (Target_i386::Relocate::relocate_tls): Likewise.
12228 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12230 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12231 support for section-plus-offset dynamic table entries.
12232 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12233 (Output_data_dynamic::Dynamic_entry): Add support for
12234 section-plus-offset dynamic table entries.
12235 (Output_data_dynamic::Classification): Likewise.
12236 (Output_data_dynamic::classification_): Renamed offset_.
12237 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12238 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12239 (Target_x86_64::make_plt_section): New function.
12240 (Target_x86_64::reserve_tlsdesc_entries): New function.
12241 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12242 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12243 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12244 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12245 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12246 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12247 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12248 add extra PLT entry for TLS descriptors.
12249 (Output_data_plt_x86_64::got_): New field.
12250 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12251 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12253 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12255 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12256 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12257 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12258 R_386_TLS_DESC_CALL relocations.
12259 (Target_x86_64::Scan::global): Likewise.
12260 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12261 for TLS descriptors.
12262 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12263 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12264 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12265 GD-to-IE relaxation.
12266 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12267 and TLS_DESCRIPTORS.
12268 * Makefile.in: Rebuild.
12269 * configure: Rebuild.
12270 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12271 (tls_test_shared2.so): New target.
12272 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12273 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12274 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12275 (tls_shared_gd_to_ie_test_LDADD): New variable.
12276 (tls_shared_gnu2_gd_to_ie_test): New target.
12277 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12279 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12280 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12281 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12282 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12283 (tls_shared_gnu2_test): New target.
12284 (tls_test_gnu2_shared.so): New target.
12285 (tls_shared_gnu2_test_SOURCES): New variable.
12286 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12287 (tls_shared_gnu2_test_LDFLAGS): New variable.
12288 (tls_shared_gnu2_test_LDADD): New variable.
12289 * testsuite/Makefile.in: Rebuild.
12290 * testsuite/Makefile.
12292 2008-04-11 Ian Lance Taylor <iant@google.com>
12294 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12296 * testsuite/Makefile.in: Rebuild.
12298 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12300 * testsuite/script_test_2.cc (main): Adjust test.
12302 2008-04-11 David S. Miller <davem@davemloft.net>
12303 Ian Lance Taylor <iant@google.com>
12305 * options.h (General_options): Add entries for '-Y' and
12307 * options.cc (General_options:finalize): If -Y was used, add those
12308 entries to the library path instead of the default "/lib" and
12311 2008-04-11 David S. Miller <davem@davemloft.net>
12313 * testsuite/justsyms.t: Start at 0x100.
12314 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12315 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12317 * testsuite/script_test_2.cc: Adjust string and section length
12320 2008-04-09 Ian Lance Taylor <iant@google.com>
12323 * script-sections.cc (Sections_element::allocate_to_segment): Add
12325 (Output_section_definition::allocate_to_segment): Likewise.
12326 (Orphan_output_section::allocate_to_segment): Likewise.
12327 (Script_sections::attach_sections_using_phdrs_clause): Don't
12328 propagate non-PT_LOAD segments to orphan sections.
12329 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12330 readelf rather than objdump.
12331 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12332 .interp section and PT_INTERP segment are the same size.
12333 * testsuite/Makefile.in: Rebuild.
12335 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12336 aliases for symbols defined in the same object.
12337 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12338 (weak_alias_test_SOURCES): New variable.
12339 (weak_alias_test_DEPENDENCIES): New variable.
12340 (weak_alias_test_LDFLAGS): New variable.
12341 (weak_alias_test_LDADD): New variable.
12342 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12343 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12344 (weak_alias_test_3.o): New target.
12345 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12346 * testsuite/weak_alias_test_main.cc: New file.
12347 * testsuite/weak_alias_test_1.cc: New file.
12348 * testsuite/weak_alias_test_2.cc: New file.
12349 * testsuite/weak_alias_test_3.cc: New file.
12351 2008-04-08 Ian Lance Taylor <iant@google.com>
12353 * options.h (class General_options): Add --noinhibit-exec option.
12354 * main.cc (main): Check --noinhibit-exec.
12356 * options.h (class General_options): Define --wrap as a special
12357 option. Add wrap_symbols_ field.
12358 (General_options::any_wrap_symbols): New function.
12359 (General_options::is_wrap_symbol): New function.
12360 * options.cc (General_options::parse_wrap): New function.
12361 (General_options::General_options): Initialize wrap_symbols_.
12362 * symtab.cc (Symbol_table::wrap_symbol): New function.
12363 (Symbol_table::add_from_object): Handle --wrap.
12364 * symtab.h (class Symbol_table): Declare wrap_symbol.
12365 * target.h (Target::wrap_char): New function.
12366 (Target::Target_info): Add wrap_char field.
12367 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12368 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12369 * testsuite/testfile.cc (Target_test::test_target_info):
12372 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12375 * layout.h (class Layout): Add added_eh_frame_data_ field.
12376 * layout.cc (Layout::Layout): Initialize new field.
12377 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12378 output section until we find a section we merged successfully.
12379 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12380 that the size be non-zero.
12382 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12385 2008-04-08 Craig Silverstein <csilvers@google.com>
12387 * configure.ac: Export new conditional variable HAVE_ZLIB.
12388 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12390 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12391 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12393 2008-04-07 Ian Lance Taylor <iant@google.com>
12395 * version.cc (version_string): Set to "1.5".
12397 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12398 Add issued_non_pic_error_ field. Declare check_non_pic.
12399 (Target_x86_64::Scan::check_non_pic): New function.
12400 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12401 (Target_x86_64::Scan::global): Likewise.
12403 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12404 addend parameter. Change caller. Handle merge sections.
12405 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12406 Address to Addend. Don't add in the result of
12407 local_section_offset, pass down the addend and use the returned
12409 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12410 Update declarations of local_section_offset and symbol_value.
12411 * testsuite/two_file_test_1.cc (t18): New function.
12412 * testsuite/two_file_test_2.cc (f18): New function.
12413 * testsuite/two_file_test_main.cc (main): Call t18.
12414 * testsuite/two_file_test.h (t18, f18): Declare.
12416 * configure.ac: Don't test for objdump, c++filt, or readelf.
12417 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12419 (TEST_READELF): New variable.
12420 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12421 (check_PROGRAMS): Add two_file_strip_test.
12422 (two_file_strip_test): New target.
12423 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12424 (two_file_same_shared_strip_test_SOURCES): New variable.
12425 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12426 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12427 (two_file_same_shared_strip_test_LDADD): New variable.
12428 (two_file_shared_strip.so): New target.
12429 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12430 (ver_test_5.syms, ver_test_7.syms): Likewise.
12431 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12432 (strip_test_3.stdout): Use TEST_OBJDUMP.
12433 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12435 2008-04-04 Cary Coutant <ccoutant@google.com>
12437 * symtab.h (Symbol::is_weak_undefined): New function.
12438 (Symbol::is_strong_undefined): New function.
12439 (Symbol::is_absolute): New function.
12440 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12441 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12443 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12444 (weak_undef_test): New target.
12445 * testsuite/Makefile.in: Rebuild.
12446 * testsuite/weak_undef_file1.cc: New file.
12447 * testsuite/weak_undef_file2.cc: New file.
12448 * testsuite/weak_undef_test.cc: New file.
12450 2008-04-03 Craig Silverstein <csilvers@google.com>
12452 * compressed_output.h (class Output_compressed_section): Use
12454 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12456 (zlib_compressed_suffix): Removed.
12457 (Output_compressed_section::set_final_data_size): Use unsigned
12459 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12460 Fix linker invocation.
12461 (flagstest_o_specialfile_and_compress_debug_sections):
12463 * testsuite/Makefile.in: Regenerated.
12465 2008-04-02 David S. Miller <davem@davemloft.net>
12467 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12468 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12470 2008-04-02 Craig Silverstein <csilvers@google.com>
12474 2008-04-02 Ian Lance Taylor <iant@google.com>
12476 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12477 parameters. Update for new key type to views_. Change all
12479 (File_read::read): Adjust for byteshift in returned view.
12480 (File_read::add_view): New function, broken out of
12481 find_and_make_view.
12482 (File_read::make_view): New function, broken out of
12483 find_and_make_view.
12484 (File_read::find_or_make_view): Add offset and aligned
12485 parameters. Rewrite accordingly. Change all callers.
12486 (File_read::get_view): Add offset and aligned parameters. Adjust
12487 for byteshift in return value.
12488 (File_read::get_lasting_view): Likewise.
12489 * fileread.h (class File_read): Update declarations.
12490 (class File_read::View): Add byteshift_ field. Add byteshift to
12491 constructor. Add byteshift method.
12492 * archive.h (Archive::clear_uncached_views): New function.
12493 (Archive::get_view): Add aligned parameter. Change all callers.
12494 * object.h (Object::get_view): Add aligned parameter. Change all
12496 (Object::get_lasting_view): Likewise.
12498 * fileread.cc (File_read::release): Don't call clear_views if
12499 there are multiple objects.
12500 * fileread.h (File_read::clear_uncached_views): New function.
12501 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12504 2008-03-31 Cary Coutant <ccoutant@google.com>
12506 Add thin archive support.
12507 * archive.cc (Archive::armagt): New const.
12508 (Archive::setup): Remove task parameter and calls to unlock.
12509 (Archive::unlock_nested_archives): New function.
12510 (Archive::read_header): Add nested_off parameter. Change
12512 (Archive::interpret_header): Likewise.
12513 (Archive::include_all_members): Change to handle thin
12515 (Archive::include_member): Likewise.
12516 * archive.h (Archive::Archive): Add new parameters and
12518 (Archive::armagt): New const.
12519 (Archive::setup): Remove task parameter.
12520 (Archive::unlock_nested_archives): New function.
12521 (Archive::read_header): Add nested_off parameter.
12522 (Archive::interpret_header): Likewise.
12523 (Archive::Nested_archive_table): New typedef.
12524 (Archive::is_thin_archive_): New field.
12525 (Archive::nested_archives_): New field.
12526 (Archive::options_): New field.
12527 (Archive::dirpath_): New field.
12528 (Archive::task_): New field.
12529 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12530 for thin archives. Pass additional parameters to
12531 Archive::Archive. Unlock the archive file after calling
12534 2008-03-29 Ian Lance Taylor <iant@google.com>
12536 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12537 version symbol to be local.
12538 * testsuite/ver_test_4.sh: New file.
12539 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12540 (check_DATA): Add ver_test_4.syms.
12541 (ver_test_4.syms): New target.
12542 * testsuite/Makefile.in: Rebuild.
12545 (Output_section::Input_section_sort_entry::has_priority): New
12547 (Output_section::Input_section_sort_entry::match_file_name): New
12549 (Output_section::Input_section_sort_entry::match_section_name):
12551 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12553 (Output_section::Input_section_sort_entry::match_section_file):
12555 (Output_section::Input_section_sort_compare::operator()): Rewrite
12556 using new Input_section_sort_entry functions. Sort crtbegin and
12557 crtend first. Sort sections with no priority before sections with
12559 * testsuite/initpri1.c (d3): Check j != 4.
12560 (cd5): New constructor/destructor function.
12561 (main): Check j != 2.
12563 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12564 new symbol when resolving, don't call set_is_default.
12565 * testsuite/ver_test_7.cc: New file.
12566 * testsuite/ver_test_7.sh: New file.
12567 * testsuite/Makefile.am (ver_test_7.so): New target.
12568 (ver_test_7.o): New target.
12569 (check_SCRIPTS): Add ver_test_7.sh.
12570 (check_DATA): Add ver_test_7.syms.
12571 (ver_test_7.syms): New target.
12573 2008-03-28 Ian Lance Taylor <iant@google.com>
12575 * layout.cc (Layout::layout): If we see an input section with a
12576 name that needs sorting, set the must_sort flag for the output
12578 (Layout::make_output_section): If the name of the output section
12579 indicates that it might require sorting, set the may_sort flag.
12580 * output.h (Output_section::may_sort_attached_input_sections): New
12582 (Output_section::set_may_sort_attached_input_sections): New
12584 (Output_section::must_sort_attached_input_sections): New
12586 (Output_section::set_must_sort_attached_input_sections): New
12588 (class Output_section): Declare Input_section_sort_entry. Define
12589 Input_section_sort_compare. Declare
12590 sort_attached_input_sections. Add new fields:
12591 may_sort_attached_input_sections_,
12592 must_sort_attached_input_sections_,
12593 attached_input_sections_are_sorted_.
12594 * output.cc (Output_section::Output_section): Initialize new
12596 (Output_section::add_input_section): Add an entry to
12597 input_sections_ if may_sort or must_sort are true.
12598 (Output_section::set_final_data_size): Call
12599 sort_attached_input_sections if necessary.
12600 (Output_section::Input_section_sort_entry): Define new class.
12601 (Output_section::Input_section_sort_compare::operator()): New
12603 (Output_section::sort_attached_input_sections): New function.
12604 * configure.ac: Check whether the compiler supports constructor
12605 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12606 * testsuite/initpri1.c: New file.
12607 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12608 CONSTRUCTOR_PRIORITY.
12609 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12610 (initpri1_LDFLAGS): New variable.
12611 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12613 2008-03-27 Ian Lance Taylor <iant@google.com>
12615 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12616 * testsuite/common_test_1.c: New file.
12617 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12618 (common_test_1_SOURCES): New variable.
12619 (common_test_1_DEPENDENCIES): New variable.
12620 (common_test_1_LDFLAGS): New variable.
12622 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12623 and commons_ correctly when NAME/VERSION does not override
12625 * testsuite/ver_test_6.c: New file.
12626 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12627 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12628 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12630 2008-03-26 Ian Lance Taylor <iant@google.com>
12632 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12633 of an undefined symbol from a version script.
12634 * testsuite/Makefile.am (ver_test_5.so): New target.
12635 (ver_test_5.o): New target.
12636 (check_SCRIPTS): Add ver_test_5.sh.
12637 (check_DATA): Add ver_test_5.syms.
12638 (ver_test_5.syms): New target.
12639 * testsuite/ver_test_5.cc: New file.
12640 * testsuite/ver_test_5.script: New file.
12641 * testsuite/ver_test_5.sh: New file.
12642 * Makefile.in, testsuite/Makefile.in: Rebuild.
12645 Fix problems building gold with gcc 4.3.0.
12646 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12647 (gold_error_at_location, gold_warning_at_location): Use it.
12648 * configure.ac: Check whether we can compile and use a template
12649 function with a printf attribute.
12650 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12651 when jumping over bytes.
12652 * object.cc: Instantiate Object::read_section_data.
12653 * debug.h: Include <cstring>
12654 * dwarf_reader.cc: Include <algorithm>
12655 * main.cc: Include <cstring>.
12656 * options.cc: Include <cstring>.
12657 * output.cc: Include <cstring>.
12658 * script.cc: Include <cstring>.
12659 * script.h: Include <string>.
12660 * symtab.cc: Include <cstring> and <algorithm>.
12661 * target-select.cc: Include <cstring>.
12662 * version.cc: Include <string>.
12663 * testsuite/testmain.cc: Include <cstdlib>.
12664 * configure, config.in: Rebuild.
12666 2008-03-25 Ian Lance Taylor <iant@google.com>
12668 * options.cc: Include "../bfd/bfdver.h".
12669 (options::help): Print bug reporting address.
12671 * version.cc (print_version): Adjust output for current value of
12672 BFD_VERSION_STRING.
12676 * options.cc (options::help): Print list of supported targets.
12677 * target-select.h: Include <vector>.
12678 (class Target_selector): Make machine_, size_, and is_big_endian_
12679 fields const. Add bfd_name_ and instantiated_target_ fields.
12680 (Target_selector::Target_selector): Add bfd_name parameter.
12681 (Target_selector::recognize): Make non-virtual, call
12683 (Target_selector::recognize_by_name): Make non-virtual, call
12684 do_recognize_by_name.
12685 (Target_selector::supported_names): New function.
12686 (Target_selector::bfd_name): New function.
12687 (Target_selector::do_instantiate_target): New pure virtual
12689 (Target_selector::do_recognize): New virtual function.
12690 (Target_selector::do_recognize_by_name): New virtual function.
12691 (Target_selector::instantiate_target): New private function.
12692 (supported_target_names): Declare.
12693 * target-select.cc (Target_selector::Target_selector): Update for
12694 new parameter and fields.
12695 (select_target_by_name): Check that the name matches before
12696 calling recognize_by_name.
12697 (supported_target_names): New function.
12698 * i386.cc (class Target_selector_i386): Update Target_selector
12699 constructor call. Remove recognize and recognize_by_name. Add
12700 do_instantiate_target.
12701 * x86_64.cc (class Target_selector_x86_64): Likewise.
12702 * testsuite/testfile.cc (class Target_selector_test): Update for
12703 changes to Target_selector.
12705 * README: Rewrite, with some notes on unsupported features.
12707 2008-03-24 Cary Coutant <ccoutant@google.com>
12709 * i386.cc (Target_i386::Got_type): New enum declaration.
12710 (Target_i386::Scan::local): Updated callers of Output_data_got
12712 (Target_i386::Scan::global): Likewise.
12713 (Target_i386::Relocate::relocate): Likewise.
12714 (Target_i386::Relocate::relocate_tls): Likewise.
12715 * object.h (Got_offset_list): New class.
12716 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12717 (Sized_relobj::local_got_offset): Likewise.
12718 (Sized_relobj::set_local_got_offset): Likewise.
12719 (Sized_relobj::local_has_tls_got_offset): Removed.
12720 (Sized_relobj::local_tls_got_offset): Removed.
12721 (Sized_relobj::set_local_tls_got_offset): Removed.
12722 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12723 * output.cc (Output_data_got::add_global): Added got_type parameter.
12724 (Output_data_got::add_global_with_rel): Likewise.
12725 (Output_data_got::add_global_with_rela): Likewise.
12726 (Output_data_got::add_global_pair_with_rel): New function.
12727 (Output_data_got::add_global_pair_with_rela): New function.
12728 (Output_data_got::add_local): Added got_type parameter.
12729 (Output_data_got::add_local_with_rel): Likewise.
12730 (Output_data_got::add_local_with_rela): Likewise.
12731 (Output_data_got::add_local_pair_with_rel): New function.
12732 (Output_data_got::add_local_pair_with_rela): New function.
12733 (Output_data_got::add_global_tls): Removed.
12734 (Output_data_got::add_global_tls_with_rel): Removed.
12735 (Output_data_got::add_global_tls_with_rela): Removed.
12736 (Output_data_got::add_local_tls): Removed.
12737 (Output_data_got::add_local_tls_with_rel): Removed.
12738 (Output_data_got::add_local_tls_with_rela): Removed.
12739 * output.h (Output_data_got::add_global): Added got_type parameter.
12740 (Output_data_got::add_global_with_rel): Likewise.
12741 (Output_data_got::add_global_with_rela): Likewise.
12742 (Output_data_got::add_global_pair_with_rel): New function.
12743 (Output_data_got::add_global_pair_with_rela): New function.
12744 (Output_data_got::add_local): Added got_type parameter.
12745 (Output_data_got::add_local_with_rel): Likewise.
12746 (Output_data_got::add_local_with_rela): Likewise.
12747 (Output_data_got::add_local_pair_with_rel): New function.
12748 (Output_data_got::add_local_pair_with_rela): New function.
12749 (Output_data_got::add_global_tls): Removed.
12750 (Output_data_got::add_global_tls_with_rel): Removed.
12751 (Output_data_got::add_global_tls_with_rela): Removed.
12752 (Output_data_got::add_local_tls): Removed.
12753 (Output_data_got::add_local_tls_with_rel): Removed.
12754 (Output_data_got::add_local_tls_with_rela): Removed.
12755 * resolve.cc (Symbol::override_base_with_special): Removed
12756 reference to has_got_offset_ field.
12757 * symtab.cc (Symbol::init_fields): Replaced initialization
12758 of got_offset_ with got_offsets_. Removed initialization
12760 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
12761 (Symbol::got_offset): Likewise.
12762 (Symbol::set_got_offset): Likewise.
12763 (Symbol::has_tls_got_offset): Removed.
12764 (Symbol::tls_got_offset): Removed.
12765 (Symbol::set_tls_got_offset): Removed.
12766 (Symbol::got_offset_): Removed.
12767 (Symbol::tls_mod_got_offset_): Removed.
12768 (Symbol::tls_pair_got_offset_): Removed.
12769 (Symbol::got_offsets_): New field.
12770 (Symbol::has_got_offset): Removed.
12771 (Symbol::has_tls_mod_got_offset): Removed.
12772 (Symbol::has_tls_pair_got_offset): Removed.
12773 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12774 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12776 (Target_x86_64::Scan::global): Likewise.
12777 (Target_x86_64::Relocate::relocate): Likewise.
12778 (Target_x86_64::Relocate::relocate_tls): Likewise.
12780 2008-03-25 Ben Elliston <bje@au.ibm.com>
12782 * yyscript.y: Fix spelling error in comment.
12784 2008-03-24 Ian Lance Taylor <iant@google.com>
12786 * options.h (class General_options): Define build_id option.
12787 * layout.h (class Layout): Declare write_build_id, create_note,
12788 create_build_id. Add build_id_note_ member.
12789 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12790 "libiberty.h", "md5.h", "sha1.h".
12791 (Layout::Layout): Initialize eh_frame_data_,
12792 eh_frame_hdr_section_, and build_id_note_.
12793 (Layout::finalize): Call create_build_id.
12794 (Layout::create_note): New function, broken out of
12795 Layout::create_gold_note.
12796 (Layout::create_gold_note): Call create_note.
12797 (Layout::create_build_id): New function.
12798 (Layout::write_build_id): New function.
12799 (Close_task_runner::run): Call write_build_id.
12801 * x86_64.cc: Correct license to GPLv3.
12803 2008-03-23 Ian Lance Taylor <iant@google.com>
12805 * options.cc: Include "demangle.h".
12806 (parse_optional_string): New function.
12807 (parse_long_option): Handle takes_optional_argument.
12808 (parse_short_option): Update dash_z initializer. Handle
12809 takes_optional_argument.
12810 (General_options::General_options): Initialize do_demangle_.
12811 (General_options::finalize): Set do_demangle_. Handle demangling
12813 * options.h (parse_optional_string): Declare.
12814 (struct One_option): Add optional_arg field. Update constructor.
12815 Update call constructor calls. Add takes_optional_argument
12817 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12818 (DEFINE_optional_string): Define.
12819 (General_options::demangle): Change from DEFINE_bool to
12820 DEFINE_optional_string.
12821 (General_options::no_demangle): New function.
12822 (General_options::do_demangle): New function.
12823 (General_options::set_do_demangle): New function.
12824 (General_options::execstack_status_): Move definition to end of
12826 (General_options::static_): Likewise.
12827 (General_options::do_demangle_): New field.
12828 * object.cc (big_endian>::get_symbol_location_info): Call
12829 Options::do_demangle, not Options::demangle.
12830 * symtab.cc (demangle): Likewise.
12832 2008-03-22 Ian Lance Taylor <iant@google.com>
12834 * gold.h: Include <cstddef> and <sys/types.h>
12835 * options.h: Include <cstring>.
12837 2008-03-21 Ian Lance Taylor <iant@google.com>
12839 * Added source code to GNU binutils.