1 2012-12-10 Alan Modra <amodra@gmail.com>
3 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
5 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
7 2012-12-07 Roland McGrath <mcgrathr@google.com>
9 * testsuite/binary_unittest.cc (Sized_binary_test):
10 Use open_descriptor rather than ::open.
12 2012-12-07 Alan Modra <amodra@gmail.com>
14 * powerpc.cc (Stub_table::do_write): Delete redundant Address
15 typedef and invalid_address constant.
16 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
17 instantiate constants.
19 2012-12-06 Roland McGrath <mcgrathr@google.com>
21 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
22 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
23 * aclocal.m4: Regenerate.
24 * configure: Regenerate.
25 * Makefile.in: Regenerate.
26 * testsuite/Makefile.in: Regenerate.
28 2012-12-07 Alan Modra <amodra@gmail.com>
30 * options.h (General_options): Add no_toc_optimize.
31 * powerpc.cc (ok_lo_toc_insn): New function.
32 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
34 2012-12-06 Alan Modra <amodra@gmail.com>
36 * options.h (General_options): Add plt_align, plt_static_chain,
37 plt_thread_safe. Update stub_group_size help text.
38 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
39 for new plt_thread_safe_ var.
40 (use_plt_offset): Correct comments.
41 (Target_powerpc::do_relax): Look for thread creation symbols to
42 determine default plt_thread_safe value. Clear plt call stubs
43 as well as branch stubs each iteration.
44 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
46 (l, hi, ha, write_insn): Move earlier.
47 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
48 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
50 (Stub_table::update_size): Adjust.
51 (Stub_table::prev_size, set_prev_size): Delete.
52 (Stub_table::stub_align): Let --plt-align affect result.
53 (Stub_table::plt_call_size): Calculate sizes for various stubs.
54 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
55 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
56 (Stub_table::do_write): Support more stub variants.
58 2012-12-04 Alan Modra <amodra@gmail.com>
60 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
61 (Target_powerpc::do_define_standard_symbols): New function.
63 2012-12-03 Alan Modra <amodra@gmail.com>
65 * output.h: Formatting, whitespace.
67 2012-12-03 Alan Modra <amodra@gmail.com>
69 * layout.h (Layout::get_executable_sections): Declare.
70 * layout.cc (Layout::get_executable_sections): New function.
71 * arm.cc (Target_arm::group_sections): Use it.
72 (Arm_output_section::group_sections): Delete now redundant test.
73 * output.cc (Output_reloc::Output_reloc): Add is_relative.
74 param to handle relative relocs.
75 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
76 (Output_data_reloc::add_absolute): Adjust.
77 (Output_data_reloc::add_relative): New function.
78 (Output_data::reset_data_size): New function.
79 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
80 (Output_section::set_addralign): New function.
81 (Output_section::checkpoint_set_addralign): New function.
82 (Output_section::clear_section_offsets_need_adjustment): New function.
83 (Output_section::input_sections): Make public.
84 * powerpc.cc (class Output_data_brlt_powerpc): New.
85 (class Stub_table, class Stub_control): New.
86 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
87 stub_table_, set_stub_table, stub_table): New vectors and accessor
89 (Target_powerpc::do_may_relax, do_relax, push_branch,
90 new_stub_table, stub_tables, brlt_section, group_sections,
91 add_branch_lookup_table, find_branch_lookup_table,
92 write_branch_lookup_table, make_brlt_section): New functions.
93 (Target_powerpc::struct Sort_sections, class Branch_info): New.
94 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
95 branch_info_): New vars.
96 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
98 (Output_data_glink): Remove all call stub handling from this class.
99 (Target_powerpc::Scan::local, global): Save interesting branch
100 relocs and relocs for ifunc. Adjust calls to plt entry functions.
101 (Target_powerpc::do_finalize_sections): Only make reg save/restore
102 functions on final link.
103 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
104 Handle long branch destinations too.
105 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
106 do_plt_address_for_local): Adjust lookup of plt call stubs.
108 2012-11-30 Alan Modra <amodra@gmail.com>
110 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
111 relocs against protected symbols when building 32-bit shared libs.
113 2012-11-30 Alan Modra <amodra@gmail.com>
115 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
116 param. Call got_section() to make .got. Update all callers
117 and their callers and so on.
119 2012-11-30 Alan Modra <amodra@gmail.com>
121 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
122 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
123 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
124 value if it already exists.
126 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
129 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
131 2012-11-14 Roland McGrath <mcgrathr@google.com>
133 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
134 than bfc instruction for data sandboxing.
136 2012-11-08 Alan Modra <amodra@gmail.com>
138 * po/POTFILES.in: Regenerate.
140 2012-11-05 Alan Modra <amodra@gmail.com>
142 * configure.ac: Apply 2012-09-10 change to config.in here.
143 * configure: Regenerate.
145 2012-11-05 Alan Modra <amodra@gmail.com>
147 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
148 (struct Opd_ent): Use "Address" rather than "Offset".
149 (Output_data_got_powerpc::got_base_offset): Return Valtype.
150 (Target_powerpc::got_section): Make public.
151 (Target_powerpc::scan_relocs): Move code setting symbols..
152 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
153 Create _SDA_BASE_ only when referenced.
155 2012-11-02 Roland McGrath <mcgrathr@google.com>
157 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
160 2012-11-01 Roland McGrath <mcgrathr@google.com>
162 * target.h (Sized_target::relocate_relocs): Use Elf_Off
163 for offset_in_output_section parameter.
164 (Sized_target::relocate_special_relocatable): Likewise.
165 * arm.cc (Target_arm::relocate_relocs): Likewise.
166 (Target_arm::relocate_special_relocatable): Likewise.
167 * i386.cc (Target_i386::relocate_relocs): Likewise.
168 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
169 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
170 * target-reloc.h (relocate_relocs): Likewise.
171 * testsuite/testfile.cc (Target_test): Likewise.
172 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
173 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
175 * system.h: Move inclusion of <clocale> to after <libintl.h> in
176 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
178 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
179 parameter, which is unused in the [!F_SETFD] case.
181 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
182 SYMNDX to off_t before comparing it to this->data_size().
183 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
184 * incremental.cc (Output_section_incremental_inputs::do_write):
185 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
187 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
189 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
191 * gold.cc (Target_arm::do_adjust_elf_header): Add the
192 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
195 2012-10-29 Cary Coutant <ccoutant@google.com>
197 * dwp.cc (usage): Add file and exit status parameters;
198 add --help and --version options.
199 (print_version): New function.
200 (main): Add --help and --version options.
202 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
204 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
205 final_layout_sequence.txt.
206 * testsuite/Makefile.in: Regenerated.
208 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
210 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
211 COMPILE generated by automake.
213 (CXXCOMPILE1): Likewise.
214 (CXXLINK1): Likewise.
215 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
217 (CXXCOMPILE): Likewise.
219 * testsuite/Makefile.in: Regenerated.
221 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
223 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
224 on bad fwrite return.
226 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
228 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
231 2012-10-23 Cary Coutant <ccoutant@google.com>
233 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
234 * testsuite/Makefile.in: Regenerate.
235 * testsuite/dwp_test.h: New source file.
236 * testsuite/dwp_test_1.cc: New source file.
237 * testsuite/dwp_test_1.s: New source file.
238 * testsuite/dwp_test_1.sh: New source file.
239 * testsuite/dwp_test_1b.cc: New source file.
240 * testsuite/dwp_test_1b.s: New source file.
241 * testsuite/dwp_test_2.cc: New source file.
242 * testsuite/dwp_test_2.s: New source file.
243 * testsuite/dwp_test_2.sh: New source file.
244 * testsuite/dwp_test_main.cc: New source file.
245 * testsuite/dwp_test_main.s: New source file.
247 2012-10-23 Cary Coutant <ccoutant@google.com>
249 * dwp.h: New header file.
250 * dwp.cc: New source file.
251 * gold.h: Move shared declarations to system.h.
252 * system.h: New header file.
253 * Makefile.am: Add dwp.
254 * Makefile.in: Regenerate.
256 2012-10-23 Cary Coutant <ccoutant@google.com>
258 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
259 Dwarf_info_reader::read_from_pointer.
260 (Dwarf_pubnames_table::read_header): Likewise.
261 (Dwarf_pubnames_table::next_name): Likewise.
262 (Dwarf_die::read_attributes): Likewise.
263 (Dwarf_die::skip_attributes): Likewise.
264 (Dwarf_info_reader::read_from_pointer): New function template.
265 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
266 (Dwarf_pubnames_table): Likewise.
267 (Dwarf_info_reader::read_from_pointer): New function template.
268 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
269 Dwarf_pubnames_table ctor.
271 2012-10-23 Cary Coutant <ccoutant@google.com>
273 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
275 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
277 (Dwarf_info_reader::set_abbrev_shndx): New method.
278 (Dwarf_info_reader::abbrev_shndx_): New data member.
280 2012-10-23 Cary Coutant <ccoutant@google.com>
282 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
283 from object, not parameters.
284 (Dwarf_info_reader::parse): Likewise.
285 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
286 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
287 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
290 2012-10-23 Cary Coutant <ccoutant@google.com>
292 * fileread.cc (Input_file::Input_file): New constructor.
293 * fileread.h (class Input_file): Add new constructor.
295 2012-10-18 Alan Modra <amodra@gmail.com>
298 * object.cc (Relobj::is_section_name_included): Also match
299 .sdata personality section.
301 2012-10-18 Alan Modra <amodra@gmail.com>
303 * target-reloc.h (class Default_comdat_behavior): New, package up..
304 (get_comdat_behaviour): ..this.
305 (relocate_section): Add Relocate_comdat_behavior template arg,
307 * arm.cc (Target_arm::relocate_section): Adjust to suit.
308 (Target_arm::scan_reloc_section): Likewise.
309 * i386.cc (Target_i386::relocate_section): Likewise.
310 * sparc.cc (Target_sparc::relocate_section): Likewise.
311 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
312 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
313 * powerpc.cc (class Relocate_comdat_behavior): New.
314 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
315 gold::relocate_section with new template arg.
317 2012-10-18 Alan Modra <amodra@gmail.com>
319 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
320 dynamic relocs for GOT_TPREL got entries, without symbol if
322 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
323 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
324 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
326 2012-10-17 Alan Modra <amodra@gmail.com>
329 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
331 2012-10-16 Sriraman Tallam <tmsriram@google.com>
333 * layout.cc (Layout::include_section): Keep sections marked
334 SHF_EXCLUDE when doing relocatable links.
336 2012-10-16 Alan Modra <amodra@gmail.com>
338 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
339 (Target_powerpc::do_finalize_sections): Call it.
340 (Output_data_save_res): New class and supporting functions.
341 (Target_powerpc::symval_for_branch): Only look up .opd entry for
342 normal symbols defined in object files.
344 2012-10-12 Alan Modra <amodra@gmail.com>
346 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
347 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
348 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
349 section if scan_opd_relocs not yet called.
350 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
352 2012-10-12 Alan Modra <amodra@gmail.com>
354 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
355 add_local_ifunc_entry): Revert last change.
356 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
358 2012-10-05 Alan Modra <amodra@gmail.com>
360 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
361 do_plt_address_for_global): New functions.
362 (Output_data_got_powerpc::do_write): Don't segfault when linking
364 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
365 add_local_ifunc_entry): Return true on adding entry..
366 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
367 glink->add_entry call. Remove unused symtab param. Adjust calls.
368 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
369 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
371 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
372 syms here. Do so even when no .iplt. Don't segfault when linking
374 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
375 new variants without reloc param.
376 (Glink_sym_ent::Glink_sym_ent): Likewise.
377 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
378 reloc when refs will resolve to plt call stub.
379 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
380 R_PPC_PLTREL24 to resolve locally.
381 (Target_powerpc::Scan::global): Correct ifunc handling.
382 (Target_powerpc::Relocate::relocate): Correct local sym glink
383 lookup. Don't destroy "value" when we have a plt call stub,
384 and when checking plt call validity.
385 (Target_powerpc::do_dynsym_value): Simplify.
387 2012-10-05 Alan Modra <amodra@gmail.com>
389 * i386.cc (Output_data_plt_i386::address_for_global,
390 address_for_local): Add plt offset to returned value. Adjust uses.
391 * sparc.cc (Output_data_plt_sparc::address_for_global,
392 address_for_local): Likewise.
393 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
394 address_for_local): Likewise.
395 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
396 address_for_local): Likewise.
397 * target.h (Target::plt_address_for_global, plt_address_for_local):
399 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
400 (Output_data_got::Got_entry::write): Nor here.
401 * output.h: Comment fix.
403 2012-10-02 Jiong Wang <jiwang@tilera.com>
405 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
406 global_offset_table_ value for larget got.
407 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
409 2012-09-29 Alan Modra <amodra@gmail.com>
411 * powerpc.cc (Target_powerpc::iplt_): New output section.
412 (Target_powerpc::iplt_section, make_iplt_section,
413 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
414 (Target_powerpc::make_plt_entry): Handle ifunc syms.
415 Target_powerpc::plt_entry_count): Count iplt entries too.
416 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
417 reloc section in constructor. New params.
418 (Target_powerpc::make_plt_section): Create reloc section here instead.
419 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
421 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
422 (Output_data_glink::add_entry, find_entry): New functions to
423 deal with local syms.
424 (Glink_sym_ent): Add support for local syms.
425 (Output_data_glink::do_write): Handle ifunc plt entries.
426 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
427 (Target_powerpc::Scan::local, global): Handle ifunc syms.
428 (Target_powerpc::Relocate::relocate): Likewise.
429 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
431 2012-09-25 Alan Modra <amodra@gmail.com>
433 * object.h (Sized_relobj_file::adjust_local_symbol,
434 do_adjust_local_symbol): New functions.
435 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
436 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
437 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
438 and irregular opd entry spacing.
439 (Powerpc_relobj::do_read_relocs): Add opd size checks.
440 (Global_symbol_visitor_opd): New functor.
441 (Target_powerpc::do_finalize_sections): Omit global symbols defined
442 on deleted opd entries.
444 2012-09-15 Jiong Wang <jiwang@tilera.com>
446 * tilegx.cc: New file.
447 * Makefile.am (TARGETSOURCES): Add tilegx.cc
448 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
449 * configure.tgt: Add entries for tilegx*.
450 * configure.ac: Likewise.
451 * Makefile.in: Rebuild.
452 * configure: Likewise.
453 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
456 2012-09-13 Alan Modra <amodra@gmail.com>
458 * target-reloc.h (scan_relocs): Call scan.local for relocs
459 against symbols in discarded sections. Pass is_discarded
461 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
462 Add is_discarded param.
463 * powerpc (Target_powerpc::Scan::local): Likewise. Use
464 is_discarded to flag opd entry as discarded. Don't emit dyn
465 relocs on such entries.
466 (Target_powerpc::Scan::global): Similarly detect and handle
468 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
469 opd_ent_. Update all uses.
470 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
471 (Target_powerpc::relocate_section): Zero out discarded opd
474 2012-09-12 Ian Lance Taylor <iant@google.com>
477 * output.cc: Rename Output_data_got template parameter from size
478 to got_size for all functions. Compile all variants of
480 (Output_data_got::Got_entry::write): Correct use of size for
481 symbol value. Use local_is_tls rather than casting to
483 * object.h (class Object): Add local_is_tls and do_local_is_tls.
484 (class Sized_relobj_file): Add do_local_is_tls.
485 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
487 2012-09-11 Alan Modra <amodra@gmail.com>
490 * layout.cc (Layout::set_segment_offsets): When using
491 common-page-size alignment, ensure we are on a new max-page-size
493 * output.cc (Output_segment::set_section_addresses): Use
494 abi_pagesize, not common_pagesize for relro boundary.
495 (Output_segment::set_offset): Likewise.
497 2012-09-11 Alan Modra <amodra@gmail.com>
499 * output.h (Output_data_got::add_global_tls, add_local_tls,
500 add_local_tls_pair): New functions.
501 (Output_data_got::add_local_pair_with_rel): Remove second
502 reloc param. Expand comment.
503 (Output_data_got::Got_entry): Rename use_plt_offset_ to
504 use_plt_or_tls_offset_, similarly for constructor param.
505 (Output_data_got::Got_entry::write): Add got_index param.
506 * output.cc (Output_data_got::add_global_tls, add_local_tls,
507 add_local_tls_pair): New functions.
508 (Output_data_got::Got_entry::write): Handle tls symbols
509 with use_plt_or_tls_offset_ set specially.
510 (Output_data_got::add_local_pair_with_rel): Only one reloc.
511 (Output_data_got::do_write): Replace iterator with index, pass
512 index to entry write function.
513 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
514 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
515 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
517 * i386.cc (Target_i386::Scan::local): Likewise.
518 * sparc.cc (Target_sparc::Scan::local): Likewise.
519 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
520 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
521 do_tls_offset_for_global): New functions.
522 (Target_powerpc::Scan::local): Correct TLS relocations and got
524 (Target_powerpc::Scan::global): Don't emit unnecessary
525 dynamic relocations on TLS GOT entries.
527 2012-09-10 Matthias Klose <doko@ubuntu.com>
529 * config.in: Disable sanity check for kfreebsd.
531 2012-09-10 Sterling Augustine <saugustine@google.com>
533 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
534 (Gdb_index::pubtypes_read): New parameter.
535 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
537 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
540 2012-09-09 Alan Modra <amodra@gmail.com>
542 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
543 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
544 * gc.h (gc_process_relocs): Call target gc_add_reference.
545 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
546 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
547 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
549 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
550 to cater for when we don't need code offset. Update use.
551 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
552 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
553 set_opd_valid): New functions.
554 (Target_powerpc::do_gc_add_reference): New function.
555 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
557 (Target_powerpc::do_gc_mark_symbol): New function.
559 2012-09-06 Cary Coutant <ccoutant@google.com>
561 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
562 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
563 (Dwarf_die::skip_attributes): Likewise.
564 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
565 * testsuite/gdb_index_test.cc (inline_func_1): New function.
567 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
569 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
571 * testsuite/script_test_3.t: Add .got.plt output section
573 * testsuite/script_test_4.t: Likewise.
575 2012-09-05 Alan Modra <amodra@gmail.com>
577 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
578 update all uses and lose "enum" when using type.
580 2012-09-05 Alan Modra <amodra@gmail.com>
582 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
583 * configure: Regenerate.
584 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
585 (plugin_final_layout.stdout): Likewise.
586 (memory_test): Set page sizes to 0x1000.
587 * testsuite/Makefile.in: Regenerate.
588 * testsuite/discard_locals_test.sh: Add FIXME comment.
589 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
590 * testsuite/pr14265.t: Add .got output section statement.
591 * testsuite/script_test_2.t: Likewise.
592 * testsuite/script_test_3.t: Likewise.
593 * testsuite/script_test_4.t: Likewise.
594 * testsuite/script_test_5.t: Likewise.
595 * testsuite/script_test_6.t: Likewise.
596 * testsuite/script_test_7.t: Likewise.
597 * testsuite/script_test_9.t: Likewise.
599 2012-09-05 Alan Modra <amodra@gmail.com>
601 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
602 (Powerpc_relocate_functions::Status): New typedef.
603 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
604 (Target_powerpc::Scan::local): Handle REL64.
605 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
607 (Target_powerpc::symval_for_branch): New function, extracted from..
608 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
609 checks. Report overflow errors.
611 2012-09-05 Alan Modra <amodra@gmail.com>
613 * object.h (Sized_relobj_file::emit_relocs): Delete.
614 (Sized_relobj_file::emit_relocs_reltype): Delete.
615 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
616 relocate_relocs for --emit-relocs.
617 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
618 * output.h: Update comment.
619 (Output_segment::first_section): New function.
620 (Output_segment::first_section_load_address): Use first_section.
621 * output.cc (Output_segment::first_section): New function extracted..
622 (Output_segment::first_section_load_address): ..from here. Delete.
623 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
624 * target.h (Sized_target::relocate_for_relocatable): Likewise.
625 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
626 adjust call to target.h function.
627 * i386.cc (Target_i386): Likewise.
628 * sparc.cc (Target_sparc): Likewise.
629 * x86_64.cc (Target_x86_64): Likewise.
630 * powerpc.cc (Target_powerpc): Likewise.
631 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
632 first tls section has section symbol for optimised local dynamic
634 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
635 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
637 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
638 Rename to relocate_relocs. Update error message.
640 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
642 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
645 2012-08-31 Alan Modra <amodra@gmail.com>
647 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
648 (Powerpc_relobj::toc_base_offset): New stub function.
649 (Target_powerpc): Add tp_offset, dtp_offset. Rename
650 got_mod_index_offset to tlsld_got_offset. Update all refs.
651 (Target_powerpc::Relocate::enum skip_tls): New.
652 (Target_powerpc::call_tls_get_addr_): New var.
653 (Target_powerpc::is_branch_reloc): Move to file scope.
654 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
655 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
657 (Target_powerpc::enum Got_type): Delete old values, add new ones.
658 (powerpc_info): Correct common_pagesize for ppc64.
659 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
660 (Powerpc_relocate_functions): Add overflow check enums and functions.
661 Add non-shift version of rela, rela_ua. Delete all rel public
662 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
663 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
664 addr16_ha3, addr14 functions.
665 (Output_data_got_powerpc::add_constant_pair): New function.
666 (Output_data_got_powerpc::got_base_offset): Likewise.
667 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
668 (instruction constants): Sort, add some more.
669 (Output_data_glink::do_write): Add and use Address typedef. Use
670 object->toc_base_offset() stub for 64-bit.
671 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
672 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
673 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
674 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
675 Always treat .opd relocs as against locally defined symbol.
676 Correct condition for RELATIVE relocs.
677 (Target_powerpc::do_finalize_sections): Test for NULL sections.
678 (Target_powerpc::Relocate::relocate): Use plt call stub as value
679 for 32-bit syms with a plt entry. Correct ppc64 toc base
680 calculations. Handle TLS relocs, and more. Add overflow
681 checking and adjust for Powerpc_relocate_functions changes.
682 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
683 Reinstate --emit-relocs code with FIXME.
685 2012-08-30 Alan Modra <amodra@gmail.com>
687 * layout.cc (Layout::set_segment_offsets): Set p_align to
688 abi_pagesize, not common_pagesize.
689 (Layout::relaxation_loop_body): Similarly use abi_pagesize
690 to determine whether file header can go in segment.
692 2012-08-30 Alan Modra <amodra@gmail.com>
694 * output.h (Output_reloc::Output_reloc <output section>): Add
695 is_relative param. Adjust calls.
696 (Output_reloc::add_output_section_relative): New functions.
697 * output.cc (Output_reloc::Output_reloc <output section>): Handle
699 (Output_reloc::symbol_value): Handle SECTION_CODE.
701 2012-08-24 Sriraman Tallam <tmsriram@google.com>
703 * gold.cc (queue_middle_tasks): Call layout again when unique
704 segments for sections is desired.
705 * layout.cc (Layout::Layout): Initialize new members.
706 (Layout::get_output_section_flags): New function.
707 (Layout::choose_output_section): Call get_output_section_flags.
708 (Layout::layout): Make output section for mapping to a unique segment.
709 (Layout::insert_section_segment_map): New function.
710 (Layout::attach_allocated_section_to_segment): Make unique segment for
711 output sections marked so.
712 (Layout::segment_precedes): Check for unique segments when sorting.
713 * layout.h (Layout::Unique_segment_info): New struct.
714 (Layout::Section_segment_map): New typedef.
715 (Layout::insert_section_segment_map): New function.
716 (Layout::get_output_section_flags): New function.
717 (Layout::is_unique_segment_for_sections_specified): New function.
718 (Layout::set_unique_segment_for_sections_specified): New function.
719 (Layout::unique_segment_for_sections_specified_): New member.
720 (Layout::section_segment_map_): New member.
721 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
722 Rename is_gc_pass_one to is_pass_one.
723 Rename is_gc_pass_two to is_pass_two.
724 Rename is_gc_or_icf to is_two_pass.
725 Check for which pass based on whether symbols data is present.
726 Make it two pass when unique segments for sections is desired.
727 * output.cc (Output_section::Output_section): Initialize new
729 * output.h (Output_section::is_unique_segment): New function.
730 (Output_section::set_is_unique_segment): New function.
731 (Output_section::is_unique_segment_): New member.
732 (Output_section::extra_segment_flags): New function.
733 (Output_section::set_extra_segment_flags): New function.
734 (Output_section::extra_segment_flags_): New member.
735 (Output_section::segment_alignment): New function.
736 (Output_section::set_segment_alignment): New function.
737 (Output_section::segment_alignment_): New member.
738 (Output_segment::Output_segment): Initialize is_unique_segment_.
739 (Output_segment::is_unique_segment): New function.
740 (Output_segment::set_is_unique_segment): New function.
741 (Output_segment::is_unique_segment_): New member.
742 * plugin.cc (allow_unique_segment_for_sections): New function.
743 (unique_segment_for_sections): New function.
744 (Plugin::load): Add new functions to transfer vector.
745 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
746 * Makefile.in: Regenerate.
747 * testsuite/plugin_final_layout.sh: Check if unique segment
749 * testsuite/plugin_section_order.c (onload): Check if new interfaces
751 (allow_unique_segment_for_sections): New global.
752 (unique_segment_for_sections): New global.
753 (claim_file_hook): Call allow_unique_segment_for_sections.
754 (all_symbols_read_hook): Call unique_segment_for_sections.
756 2012-08-22 Cary Coutant <ccoutant@google.com>
758 * layout.cc (Layout::include_section): Don't assert on GROUP
759 sections with --emit-relocs.
761 2012-08-21 Cary Coutant <ccoutant@google.com>
763 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
764 if --export-dynamic-symbol names an undef symbol.
766 2012-08-18 Alan Modra <amodra@gmail.com>
768 * powerpc.cc: Formatting and white space.
769 (Powerpc_relobj): Rename got2_section_ to special_.
770 Add opd_ent_shndx_ and opd_ent_off_ vectors.
771 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
772 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
773 (Target_powerpc): Add Address typedef and invalid_address. Use
775 (Target_powerpc::is_branch_reloc): New function.
776 (Powerpc_relocate_functions): Add Address typedef, use throughout.
777 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
778 for dst_mask, value and addend.
779 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
780 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
781 (Output_data_glink::do_write): Correct toc base. Don't try to use
782 uint16_t for 24-bit offset. Use get_output_section_offset and
784 (Target_powerpc::Scan::local): Handle more relocs.
785 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
786 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
787 Plug in toc restoring insn after plt calls. Translate branches
788 to function descriptor symbols to corresponding entry point.
789 (Target_powerpc::relocate_for_relocatable): Check return from
790 get_output_section_offset.
791 * symtab.h: Comment typo.
793 2012-08-14 Ian Lance Taylor <iant@google.com>
795 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
796 unsupported_relocal_local to call unsupported_reloc_global.
798 2012-08-14 Nick Clifton <nickc@redhat.com>
801 * script-sections.cc (Sections_element::output_section_name): Add
802 keep return parameter.
803 (Output_section_element::match_name): Add keep return parameter.
804 Return the value of the keep_ member.
805 * script-sections.h (class Output_section): Update
806 output_section_name prototype.
807 * layout.cc (Layout::keep_input_section): New public member
809 (Layout::choose_output_section): Pass keep parameter to
811 * layout.h (class Layout): Add keep_input_section.
812 * object.cc (Sized_relobj_file::do_layout): Check for kept input
814 * testsuite/Makefile.am: Add a test.
815 * testsuite/Makefile.in: Regenerate.
816 * testsuite/pr14265.c: Source file for the test.
817 * testsuite/pr14265.t: Linker script for the test.
818 * testsuite/pr14265.sh: Shell script for the test.
820 2012-08-14 Alan Modra <amodra@gmail.com>
822 * target.h (Target::output_section_name): New function.
823 (Target::do_output_section_name): New function.
824 * layout.cc (Layout::choose_output_section): Call the above.
825 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
827 2012-08-14 Alan Modra <amodra@gmail.com>
829 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
830 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
831 for replace_constant call.
832 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
833 (Output_data_glink::do_print_to_mapfile): New function.
834 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
835 (Target_powerpc::Relocate::relocate): Likewise.
837 2012-08-14 Alan Modra <amodra@gmail.com>
839 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
840 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
841 (Output_data_glink::add_entry,find_entry): Remove shndx param.
842 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
843 all references to shndx_. Handle special case for R_PPC_PLTREL24
845 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
846 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
847 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
849 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
850 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
852 2012-08-12 Alan Modra <amodra@gmail.com>
854 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
855 (glink insn constants): Use uint32_t.
856 (Output_data_glink::add_entry): Use insert, not [] operator.
858 2012-08-11 Alan Modra <amodra@gmail.com>
860 * object.h (Sized_relobj_file::find_shdr): New function.
861 (Sized_relobj_file::find_special_sections): New function.
862 * object.cc (Sized_relobj_file::find_shdr): New function.
863 (Sized_relobj_file::find_eh_frame): Use find_shdr.
864 (Sized_relobj_file::find_special_sections): New function, split out..
865 (Sized_relobj_file::do_read_symbols): ..from here.
866 * output.h (Output_data_got::replace_constant): New function.
867 (Output_data_got::num_entries): New function.
868 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
869 (Output_data_got::got_offset): Protected rather than private.
870 (Output_data_got::replace_got_entry): New function.
871 * output.cc (Output_data_got::replace_got_entry): New function.
872 * powerpc.cc (class Powerpc_relobj): New.
873 (class Powerpc_relocate_functions): Delete all psymval variants or
874 convert to value,addend type. Delete pcrela, pcrela_unaligned.
875 Implement _ha functions using corresponding _hi function.
876 (Powerpc_relobj::find_special_sections): New function.
877 (Target_powerpc::do_make_elf_object): New function.
878 (class Output_data_got_powerpc): New.
879 (class Output_data_glink): New.
880 (class Powerpc_scan_relocatable_reloc): New.
881 Many more changes througout file.
883 2012-08-09 Nick Clifton <nickc@redhat.com>
885 * po/vi.po: Updated Vietnamese translation.
887 2012-08-07 Ian Lance Taylor <iant@google.com>
889 * layout.cc (Layout::add_target_dynamic_tags): If
890 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
893 2012-07-30 Nick Clifton <nickc@redhat.com>
895 * po/gold.pot: Updated template.
896 * po/es.po: Updated Spanish translation.
898 2012-07-18 Cary Coutant <ccoutant@google.com>
901 * configure.ac: Add check for -gpubnames support.
902 * configure: Regenerate.
903 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
904 support; force -gno-pubnames.
905 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
907 (gdb_index_test_4): New test.
908 * testsuite/Makefile.in: Regenerate.
909 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
910 * testsuite/gdb_index_test_2.sh: Likewise.
911 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
912 * testsuite/gdb_index_test_4.sh: New script.
913 * testsuite/gdb_index_test_comm.sh: New script with common code;
914 don't look for space after colon.
916 2012-07-16 Sriraman Tallam <tmsriram@google.com>
918 * gold.cc (queue_middle_tasks): Update function order only after
919 deferred objects due to plugins are processed.
921 2012-07-11 Ian Lance Taylor <iant@google.com>
923 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
924 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
925 (Target_arm::scan_reloc_for_stub): Likewise.
926 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
927 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
928 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
929 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
930 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
932 2012-07-10 Dodji Seketeli <dodji@redhat.com>
933 Ian Lance Taylor <iant@google.com>
936 * configure.ac: Test whether std::tr1::hash<off_t> works.
937 * gold.h: Add a specialization for std::tr1::hash<off_t> if
939 * output.h (class Output_fill): Add virtual destructor.
940 * configure, config.in: Rebuild.
942 2012-06-22 Roland McGrath <mcgrathr@google.com>
944 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
946 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
948 * plugin.cc (Plugin::load): Handle position independent executables.
950 2012-06-06 Cary Coutant <ccoutant@google.com>
952 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
954 (lines_only_debug_sections): Likewise.
955 (gdb_fast_lookup_sections): New static array.
956 (is_gdb_debug_section): Rename formal parameter.
957 (is_lines_only_debug_section): Likewise.
958 (is_gdb_fast_lookup_section): New function.
959 (Layout::include_section): Check for ".zdebug_" prefix; pass
960 section name suffix to is_gdb_debug_section, et al.; check for
961 fast-lookup sections when building .gdb_index.
962 * options.h (--strip-debug-gdb): Update GDB version number.
964 2012-06-06 Cary Coutant <ccoutant@google.com>
966 * configure.ac: Add check for fallocate.
967 * configure: Regenerate.
968 * config.in: Regenerate.
970 * options.h (class General_options): Add --mmap-output-file and
971 --posix-fallocate options.
972 * output.cc: (posix_fallocate): Remove; replace with...
973 (gold_fallocate): New function.
974 (Output_file::map_no_anonymous): Call gold_fallocate.
975 (Output_file::map): Check --mmap-output-file option.
977 2012-06-05 Jing Yu <jingyu@google.com>
979 * gold.h (textdomain): Add do {} to empty while(0).
980 (bindtextdomain): Likewise.
982 2012-06-04 Cary Coutant <ccoutant@google.com>
984 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
987 2012-05-25 Sriraman Tallam <tmsriram@google.com>
989 * symtab.cc (Symbol_table::define_special_symbol):
990 Initialize *poldsym to prevent uninitialized variable errors.
992 2012-05-23 Cary Coutant <ccoutant@google.com>
994 * layout.cc (Layout::section_name_mapping): Add rules to handle
995 exact match on .data.rel.ro.local or .data.rel.ro.
996 (Layout::output_section_name): Check for exact matches.
998 2012-05-23 Cary Coutant <ccoutant@google.com>
1000 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1003 2012-05-22 Cary Coutant <ccoutant@google.com>
1005 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1006 object before exporting symbol.
1008 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1010 * testsuite/tls_test.cc: Include "config.h" first.
1011 * testsuite/tls_test_c.c: Likewise.
1013 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
1014 Nick Clifton <nickc@redhat.com>
1017 * configure.in: Add check that sysdep.h has been included before
1018 any system header files.
1019 * configure: Regenerate.
1020 * config.in: Regenerate.
1022 2012-05-14 Cary Coutant <ccoutant@google.com>
1024 * layout.cc (Layout::make_output_section): Mark .tdata section
1026 * testsuite/relro_test.cc: Add a TLS variable.
1028 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1031 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1032 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1035 2012-05-08 Cary Coutant <ccoutant@google.com>
1037 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1038 (lines_only_debug_sections): Likewise.
1040 2012-05-02 Roland McGrath <mcgrathr@google.com>
1042 * nacl.cc: New file.
1044 * Makefile.am (CCFILES, HFILES): Add them.
1045 * Makefile.in: Regenerate.
1046 * i386.cc (Output_data_plt_i386_nacl): New class.
1047 (Output_data_plt_i386_nacl_exec): New class.
1048 (Output_data_plt_i386_nacl_dyn): New class.
1049 (Target_i386_nacl): New class.
1050 (Target_selector_i386_nacl): New class.
1051 (target_selector_i386): Use it instead of Target_selector_i386.
1052 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1053 (Target_x86_64_nacl): New class.
1054 (Target_selector_x86_64_nacl): New class.
1055 (target_selector_x86_64, target_selector_x32): Use it instead of
1056 Target_selector_x86_64.
1057 * arm.cc (Output_data_plt_arm_nacl): New class.
1058 (Target_arm_nacl): New class.
1059 (Target_selector_arm_nacl): New class.
1060 (target_selector_arm, target_selector_armbe): Use it instead of
1061 Target_selector_arm.
1063 * target-select.cc (select_target): Take new Input_file* and off_t
1064 arguments, pass them on to recognize method of selector.
1065 * object.cc (make_elf_sized_object): Update caller.
1066 * parameters.cc (parameters_force_valid_target): Likewise.
1067 * incremental.cc (make_sized_incremental_binary): Likewise.
1068 * target-select.h: Update decl.
1069 (Target_selector::recognize): Take new Input_file* argument,
1070 pass it on to do_recognize.
1071 (Target_selector::do_recognize): Take new Input_file* argument.
1072 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1073 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1074 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1075 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1077 * target.h (Target::Target_info): New members isolate_execinstr
1079 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1080 * arm.cc (Target_arm::arm_info): Update initializer.
1081 * i386.cc (Target_i386::i386_info): Likewise.
1082 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1083 * sparc.cc (Target_sparc::sparc_info): Likewise.
1084 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1085 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1086 * layout.cc (Layout::attach_allocated_section_to_segment):
1087 Take new const Target* argument. If target->isolate_execinstr(), act
1089 (Layout::find_first_load_seg): Take new const Target* argument;
1090 if target->isolate_execinstr(), reject PF_X segments.
1091 (Layout::relaxation_loop_body): Update caller.
1092 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1093 reset file offset to zero when we hit LOAD_SEG, and then do a second
1094 loop over the segments before LOAD_SEG to reassign offsets after
1095 addresses have been determined. Handle target->rosegment_gap().
1096 (Layout::attach_section_to_segment): Take new const Target* argument;
1097 pass it to attach_allocated_section_to_segment.
1098 (Layout::make_output_section): Update caller.
1099 (Layout::attach_sections_to_segments): Take new const Target* argument;
1100 pass it to attach_section_to_segment.
1101 * gold.cc (queue_middle_tasks): Update caller.
1102 * layout.h (Layout): Update method decls with new arguments.
1104 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1105 Target_info pointer to use.
1106 (Target_arm::do_make_data_plt): New virtual method.
1107 (Target_arm::make_data_plt): New method that calls it.
1108 (Target_arm::make_plt_entry): Use it.
1109 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1110 for the section alignment.
1111 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1113 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1114 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1116 (Output_data_plt_arm::get_plt_entry_size): Call it.
1117 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1118 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1119 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1121 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1122 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1123 method instead of sizeof(plt_entry).
1124 (Output_data_plt_arm::add_entry): Likewise.
1125 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1126 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1128 (Target_arm::plt_entry_size): Likewise.
1129 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1131 (Output_data_plt_arm_standard): ... here, new class.
1132 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1133 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1134 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1136 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1137 Take additional argument for the PLT entry size.
1138 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1139 Use get_plt_entry_size method rather than plt_entry_size variable.
1140 (Output_data_plt_x86_64::reserve_slot): Likewise.
1141 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1142 (Output_data_plt_x86_64::add_entry): Likewise.
1143 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1144 (Output_data_plt_x86_64::address_for_global): Likewise.
1145 (Output_data_plt_x86_64::address_for_local): Likewise.
1146 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1147 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1148 Make method non-static.
1149 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1151 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1152 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1153 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1154 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1156 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1157 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1159 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1160 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1162 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1163 (Output_data_plt_x86_64::plt_entry_size)
1164 (Output_data_plt_x86_64::first_plt_entry)
1165 (Output_data_plt_x86_64::plt_entry)
1166 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1167 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1168 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1169 (Output_data_plt_x86_64_standard): ... here, new class.
1170 (Target_x86_64::Target_x86_64): Take optional argument for the
1171 Target_info pointer to use.
1172 (Target_x86_64::do_make_data_plt): New virtual method.
1173 (Target_x86_64::make_data_plt): New method to call it.
1174 (Target_x86_64::init_got_plt_for_update): Use that.
1175 Call this->plt_->add_eh_frame method here.
1176 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1177 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1178 rather than static method.
1179 (Target_x86_64::plt_entry_size): Likewise.
1180 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1181 rather than plt_entry_size variable. Move guts of PLT filling to...
1182 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1183 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1184 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1186 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1187 additional argument for the section alignment.
1188 Don't do add_eh_frame_for_plt here.
1189 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1190 non-static. Use get_plt_entry_size method rather than plt_entry_size
1192 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1194 (Output_data_plt_i386::get_plt_entry_size): Call it.
1195 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1196 (Output_data_plt_i386::add_eh_frame): New method to call it.
1197 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1199 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1200 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1202 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1203 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1204 method instead of plt_entry_size.
1205 (Output_data_plt_i386::plt_entry_size)
1206 (Output_data_plt_i386::plt_eh_frame_fde_size)
1207 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1208 (Output_data_plt_i386_standard): ... here, new class.
1209 (Output_data_plt_i386_exec): New class.
1210 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1211 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1212 (Output_data_plt_i386::exec_plt_entry): Move to ...
1213 (Output_data_plt_i386_exec::plt_entry): ... here.
1214 (Output_data_plt_i386_dyn): New class.
1215 (Output_data_plt_i386::first_plt_entry): Move to ...
1216 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1217 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1218 (Output_data_plt_i386_dyn::plt_entry): ... here.
1219 (Target_i386::Target_i386): Take optional argument for the Target_info
1221 (Target_i386::do_make_data_plt): New virtual method.
1222 (Target_i386::make_data_plt): New method to call it.
1223 (Target_i386::make_plt_section): Use that.
1224 Call this->plt_->add_eh_frame method here.
1225 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1226 rather than plt_entry_size variable.
1227 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1228 (Output_data_plt_i386::address_for_local): Likewise.
1229 (Output_data_plt_i386::do_write): Likewise.
1230 Move guts of PLT filling to...
1231 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1232 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1233 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1234 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1236 2012-05-01 Cary Coutant <ccoutant@google.com>
1238 * dwarf_reader.cc (Dwarf_die::read_attributes)
1239 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1240 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1241 * reduced_debug_output.cc
1242 (Output_reduced_debug_info_section::get_die_end): Remove
1243 DW_FORM_GNU_ref_index. Add default case.
1245 2012-04-26 Mark Wielaard <mjw@redhat.com>
1247 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1248 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1249 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1250 DW_AT_high_pc as offset from DW_AT_low_pc.
1252 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1253 * testsuite/Makefile.in: Regenerate.
1254 * testsuite/gdb_index_test_3.c: New test source file.
1255 * testsuite/gdb_index_test_3.sh: New test source file.
1257 2012-04-25 Ian Lance Taylor <iant@google.com>
1259 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1261 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1262 as a class, not a struct.
1263 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1264 (Target_arm::apply_cortex_a8_workaround): Likewise.
1265 * gc.h: Declare Reloc_types as a struct, not a class.
1266 * object.h: Declare Symbols_data as a struct.
1267 * reloc.h: Declare Read_relocs_data as a struct.
1268 * target.h: Declare Relocate_info as a struct.
1270 2012-04-24 David S. Miller <davem@davemloft.net>
1272 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1273 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1276 2012-04-24 Cary Coutant <ccoutant@google.com>
1278 * incremental-dump.cc (find_input_containing_global): Replace
1279 magic number with symbolic constant.
1280 (dump_incremental_inputs): Update version number.
1281 * incremental.cc (Output_section_incremental_inputs): Update version
1282 number; import symbolic constants from Incremental_inputs_reader.
1283 (Incremental_inputs::create_data_sections): Align relocations
1284 section correctly for 64-bit targets.
1285 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1286 constants; add padding.
1287 (Output_section_incremental_inputs::write_header): Add assert for
1289 (Output_section_incremental_inputs::write_input_files): Add assert
1290 for input_entry_size.
1291 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1292 add assert for object_info_size, input_section_entry_size,
1293 global_sym_entry_size.
1294 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1295 for data structure sizes; use them.
1296 (Incremental_input_entry_reader): Import symbolic constants from
1297 Incremental_inputs_reader; use them.
1299 2012-04-23 David S. Miller <davem@davemloft.net>
1301 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1303 (Target_sparc::Target_sparc): Initialize new fields.
1304 (Target_sparc::do_make_elf_object): New function.
1305 (Target_sparc::do_adjust_elf_header): New function.
1307 2012-04-23 Cary Coutant <ccoutant@google.com>
1309 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1310 CU range table of gdb index.
1312 2012-04-20 David S. Miller <davem@davemloft.net>
1314 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1317 2012-04-16 David S. Miller <davem@davemloft.net>
1319 * sparc.cc (Target_sparc::got_address): New function.
1320 (Sparc_relocate_functions::gdop_hix22): New function.
1321 (Sparc_relocate_functions::gdop_lox10): New function.
1322 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1324 (Target_sparc::Scan::local): Likewise if the global symbol is not
1325 preemptible and is not IFUNC.
1326 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1327 transformations for local and non-preemptible non-IFUNC global
1330 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1331 writing out 64-bit part of ranges.
1333 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1334 -fpic and -fpie respectively.
1335 * Makefile.in: Regenerate.
1337 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1338 (Target_sparc::Target_sparc): Initialize new field.
1339 (Target_sparc::do_plt_section_for_global): New function.
1340 (Target_sparc::do_plt_section_for_local): New function.
1341 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1342 (Target_sparc::make_plt_section): New function, broken out of
1343 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1344 (Target_sparc::make_plt_entry): Call make_plt_section.
1345 (Target_sparc::make_local_ifunc_plt_entry): New function.
1346 (Target_sparc::rela_ifunc_section): New function.
1347 (Target_sparc::plt_section): Remove const.
1348 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1349 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1350 and ifunc_count_ fields.
1351 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1352 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1353 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1354 (Output_data_plt_sparc::rela_ifunc): New function.
1355 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1356 (Output_data_plt_sparc::has_ifunc_section): New function.
1357 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1358 (Output_data_plt_sparc::address_for_global): New function.
1359 (Output_data_plt_sparc::address_for_local): New function.
1360 (Output_data_plt_sparc::plt_index_to_offset): New function.
1361 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1363 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1365 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1366 R_SPARC_JMP_IREL to switch.
1367 (Target_sparc::Scan::check_non_pic): Likewise.
1368 (Target_sparc::Scan::local): Handle IFUNC symbols.
1369 (Target_sparc::Scan::local): Likewise.
1370 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1371 and plt_address_for_local.
1372 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1373 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1375 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1376 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1377 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1378 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1380 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1381 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1383 * sparc.cc (Target_sparc::Scan::global): Likewise.
1384 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1386 2012-04-16 Cary Coutant <ccoutant@google.com>
1388 * archive.cc (Library_base::should_include_member): Check for
1389 --export-dynamic-symbol.
1390 * options.h (class General_options): Add --export-dynamic-symbol.
1391 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1392 --export-dynamic-symbol.
1393 (Symbol_table::gc_mark_undef_symbols): Likewise.
1394 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1396 2012-04-12 David S. Miller <davem@davemloft.net>
1398 * sparc.cc (Reloc::wdisp10): New relocation method.
1399 (Reloc::h34): Likewise.
1400 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1401 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1403 (Target_sparc::Scan::local): Likewise.
1404 (Target_sparc::Scan::global): Likewise.
1405 (Target_sparc::Relocate::relocate): Likewise.
1407 2012-04-09 Cary Coutant <ccoutant@google.com>
1409 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1412 2012-04-06 Ian Lance Taylor <iant@google.com>
1414 * timer.cc: #include <unistd.h>.
1416 2012-04-06 Roland McGrath <mcgrathr@google.com>
1418 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1419 * config.in: Regenerate.
1420 * configure: Regenerate.
1422 2012-04-05 Nick Clifton <nickc@redhat.com>
1424 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1425 (AM_LC_MESSAGES): Add.
1426 * aclocal.m4: Regenerate.
1427 * config.in: Regenerate.
1428 * configure: Regenerate.
1430 2012-03-21 Cary Coutant <ccoutant@google.com>
1432 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1433 * Makefile.in: Regenerate.
1434 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1435 (Sized_elf_reloc_mapper::symbol_section): New function.
1436 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1437 (make_elf_reloc_mapper): New function.
1438 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1439 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1440 (Dwarf_abbrev_table::do_get_abbrev): New function.
1441 (Dwarf_ranges_table::read_ranges_table): New function.
1442 (Dwarf_ranges_table::read_range_list): New function.
1443 (Dwarf_pubnames_table::read_section): New function.
1444 (Dwarf_pubnames_table::read_header): New function.
1445 (Dwarf_pubnames_table::next_name): New function.
1446 (Dwarf_die::Dwarf_die): New function.
1447 (Dwarf_die::read_attributes): New function.
1448 (Dwarf_die::skip_attributes): New function.
1449 (Dwarf_die::set_name): New function.
1450 (Dwarf_die::set_linkage_name): New function.
1451 (Dwarf_die::attribute): New function.
1452 (Dwarf_die::string_attribute): New function.
1453 (Dwarf_die::int_attribute): New function.
1454 (Dwarf_die::uint_attribute): New function.
1455 (Dwarf_die::ref_attribute): New function.
1456 (Dwarf_die::child_offset): New function.
1457 (Dwarf_die::sibling_offset): New function.
1458 (Dwarf_info_reader::check_buffer): New function.
1459 (Dwarf_info_reader::parse): New function.
1460 (Dwarf_info_reader::do_parse): New function.
1461 (Dwarf_info_reader::do_read_string_table): New function.
1462 (Dwarf_info_reader::lookup_reloc): New function.
1463 (Dwarf_info_reader::get_string): New function.
1464 (Dwarf_info_reader::visit_compilation_unit): New function.
1465 (Dwarf_info_reader::visit_type_unit): New function.
1466 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1467 Sized_elf_reloc_mapper.
1468 (Sized_dwarf_line_info::symbol_section): Remove function.
1469 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1470 (Sized_dwarf_line_info::read_line_mappings): Remove object
1471 parameter, adjust callers.
1472 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1473 * dwarf_reader.h: Include <sys/types.h>.
1474 (class Track_relocs): Remove forward declaration.
1475 (class Elf_reloc_mapper): New class.
1476 (class Sized_elf_reloc_mapper): New class.
1477 (class Dwarf_abbrev_table): New class.
1478 (class Dwarf_range_list): New class.
1479 (class Dwarf_ranges_table): New class.
1480 (class Dwarf_pubnames_table): New class.
1481 (class Dwarf_die): New class.
1482 (class Dwarf_info_reader): New class.
1483 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1484 (Sized_dwarf_line_info::symbol_section): Remove member function.
1485 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1487 * gdb-index.cc: New source file.
1488 * gdb-index.h: New source file.
1489 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1490 and .debug_types sections, call Layout::add_to_gdb_index.
1491 (Sized_relobj_incr::do_section_name): Implement.
1492 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1493 return type; Implement.
1494 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1496 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1497 parameter list and return type.
1498 (Sized_incr_dynobj::do_section_contents): Likewise.
1499 * layout.cc: Include gdb-index.h.
1500 (Layout::Layout): Initialize gdb_index_data_.
1501 (Layout::init_fixed_output_section): Check for .gdb_index section.
1502 (Layout::add_to_gdb_index): New function. Instantiate.
1503 * layout.h: Add forward declaration for class Gdb_index.
1504 (Layout::add_to_gdb_index): New member function.
1505 (Layout::gdb_index_data_): New data member.
1506 * main.cc: Include gdb-index.h.
1507 (main): Print statistics for gdb index.
1508 * object.cc (Object::section_contents): Move code into
1509 do_section_contents.
1510 (need_decompressed_section): Check for sections needed when building
1512 (build_compressed_section_map): Likewise.
1513 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1515 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1516 sections; call Layout::add_to_gdb_index.
1517 (Sized_relobj_file::do_decompressed_section_contents): Call
1518 do_section_contents directly.
1519 * object.h (Object::do_section_contents): Adjust parameter list and
1521 (Object::do_decompressed_section_contents): Call do_section_contents
1523 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1525 * options.h (class General_options): Add --gdb-index option.
1526 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1527 list and return type.
1528 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1529 * reloc.h (Track_relocs::checkpoint): New function.
1530 (Track_relocs::reset): New function.
1532 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1534 * testsuite/Makefile.in: Regenerate.
1535 * testsuite/gdb_index_test.cc: New test source file.
1536 * testsuite/gdb_index_test_1.sh: New test source file.
1537 * testsuite/gdb_index_test_2.sh: New test source file.
1539 2012-03-19 Doug Kwan <dougkwan@google.com>
1541 * arm.cc (Target_arm::do_define_standard_symbols): New method.
1542 (Target_arm::do_finalize_sections): Remove code which defines
1543 __exidx_start and __exidx_end. Make symbol table parameter
1544 anonymous as it is not used.
1545 * gold.cc (queue_middle_tasks): Call target hook to define any
1546 target-specific symbols.
1547 * target.h (Target::define_standard_symbols): New method.
1548 (Target::do_define_standard_symbols): Same.
1549 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1550 * testsuite/Makefile.in: Regenerate.
1551 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1553 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1554 relocations are generated for __exidx_start and __exidx_end.
1556 2012-03-16 Doug Kwan <dougkwan@google.com>
1558 * testsuite/Makefile.am: Disable test initpri3b.
1559 * testsuite/Makefile.in: Regenerate.
1561 2012-03-15 Doug Kwan <dougkwan@google.com>
1563 * arm.cc (Target_arm::got_section): Make .got section read-only
1566 2012-03-15 Ian Lance Taylor <iant@google.com>
1569 * layout.cc (Layout::make_output_section): Correctly mark
1570 SHT_INIT_ARRAY, et. al., as relro.
1572 2012-03-14 Doug Kwan <dougkwan@google.com>
1574 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1575 dynamic relocations for protected symbols in shared objects.
1577 2012-03-13 Ian Lance Taylor <iant@google.com>
1579 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1580 keep the larger alignment.
1582 2012-03-12 Cary Coutant <ccoutant@google.com>
1584 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1585 handling of DW_LNE_define_file.
1587 2012-03-12 Cary Coutant <ccoutant@google.com>
1589 * reduced_debug_output.cc
1590 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1593 2012-02-29 Cary Coutant <ccoutant@google.com>
1595 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1597 2012-02-29 Cary Coutant <ccoutant@google.com>
1599 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1600 Call Object::decompressed_section_contents.
1601 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1603 (Sized_dwarf_line_info::buffer_start_): New data member.
1604 * merge.cc (Output_merge_data::do_add_input_section): Call
1605 Object::decompressed_section_contents.
1606 (Output_merge_string::do_add_input_section): Likewise.
1607 * object.cc (need_decompressed_section): New function.
1608 (build_compressed_section_map): Decompress sections needed later.
1609 (Sized_relobj_file::do_decompressed_section_contents): New function.
1610 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1611 * object.h (Object::decompressed_section_contents): New function.
1612 (Object::discard_decompressed_sections): New function.
1613 (Object::do_decompressed_section_contents): New function.
1614 (Object::do_discard_decompressed_sections): New function.
1615 (Compressed_section_info): New type.
1616 (Compressed_section_map): Include decompressed section contents.
1617 (Sized_relobj_file::do_decompressed_section_contents): New function.
1618 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1620 2012-02-16 Cary Coutant <ccoutant@google.com>
1622 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1623 * testsuite/Makefile.in: Regenerate.
1625 2012-02-14 Cary Coutant <ccoutant@google.com>
1627 * options.cc (General_options::finalize): Disallow -pie and -static.
1629 2012-02-03 Doug Kwan <dougkwan@google.com>
1631 * arm.cc (Arm_relocate_functions::abs8,
1632 Arm_relocate_functions::abs16): Use
1633 Bits::has_signed_unsigned_overflow32.
1634 (Arm_relocate_functions::thm_abs8): Correct range of
1636 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1639 2012-02-02 Doug Kwan <dougkwan@google.com>
1641 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1642 position independent outputs, not just shared objects.
1644 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1646 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1647 * configure: Regenerated.
1649 2012-01-27 Ian Lance Taylor <iant@google.com>
1651 * reloc.h (Bits): New class with static functions, copied from
1652 namespace utils in arm.cc.
1653 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1656 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1658 * incremental.cc (write_info_blocks): Correct relocation offset.
1660 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1662 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1663 (Relocate::tls_gd_to_le): Likewise.
1665 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1667 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1669 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1671 * configure.ac: Check if -mcmodel=medium works.
1672 * configure: Regenerated.
1674 2012-01-24 Cary Coutant <ccoutant@google.com>
1676 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1678 (read_unsigned_LEB_128_x): ... this new function.
1679 (read_signed_LEB_128): Replaced with inline definition and ...
1680 (read_signed_LEB_128_x): ... this new function.
1681 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1682 (read_unsigned_LEB_128): Add inline definition.
1683 (read_signed_LEB_128_x): New function.
1684 (read_signed_LEB_128): Add inline definition.
1685 * testsuite/Makefile.am (leb128_unittest): New unit test.
1686 * testsuite/Makefile.in: Regenerate.
1687 * testsuite/leb128_unittest.cc: New unit test.
1689 2012-01-23 Ian Lance Taylor <iant@google.com>
1692 * i386.cc (Target_i386::do_code_fill): When using a jmp
1693 instruction, pad with nop instructions.
1694 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1696 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1698 * x86_64.cc (gc_process_relocs): Add typename on types used in
1700 (scan_relocs): Likewise.
1701 (relocate_section): Likewise.
1702 (apply_relocation): Likewise.
1704 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1706 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1707 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1710 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1712 * x86_64.cc: Initial support for x32.
1714 2012-01-03 Cary Coutant <ccoutant@google.com>
1716 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1717 Use abstract base class for GOT.
1718 * gold/output.h (class Output_data_got_base): New abstract base class.
1719 (class Output_data_got): Derive from new base class, adjust ctors.
1720 (Output_data_got::reserve_slot): Make virtual; rename to
1721 do_reserve_slot; Adjust callers.
1722 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1723 pointer to abstract base class.
1724 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1726 2011-12-18 Ian Lance Taylor <iant@google.com>
1728 * object.h (Relobj::local_symbol_value): New function.
1729 (Relobj::local_plt_offset): New function.
1730 (Relobj::local_has_got_offset): New function.
1731 (Relobj::local_got_offset): New function.
1732 (Relobj::set_local_got_offset): New function.
1733 (Relobj::do_local_symbol_value): New pure virtual function.
1734 (Relobj::do_local_plt_offset): Likewise.
1735 (Relobj::do_local_has_got_offset): Likewise.
1736 (Relobj::do_local_got_offset): Likewise.
1737 (Relobj::do_set_local_got_offset): Likewise.
1738 (Sized_relobj::do_local_has_got_offset): Rename from
1739 local_has_got_offset.
1740 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1741 (Sized_relobj::do_set_local_got_offset): Rename from
1742 set_local_got_offset.
1743 (Sized_relobj_file::do_local_plt_offset): Rename from
1745 (Sized_relobj_file::do_local_symbol_value): New function.
1746 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1748 * output.cc (Output_data_got::Got_entry::write): Change object to
1749 Relobj. Use local_symbol_value.
1750 (Output_data_got::add_global_with_rel): Change rel_dyn to
1751 Output_data_reloc_generic*. Use add_global_generic.
1752 (Output_data_got::add_global_with_rela): Remove. Change all
1753 callers to use add_global_with_rel.
1754 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1755 Output_data_reloc_generic*. Use add_global_generic.
1756 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1757 callers to use add_global_pair_with_rel.
1758 (Output_data_got::add_local): Change object to Relobj*.
1759 (Output_data_got::add_local_plt): Likewise.
1760 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1761 change rel_dyn to Output_data_reloc_generic*. Use
1763 (Output_data_got::add_local_with_rela): Remove. Change all
1764 callers to use all_local_with_rel.
1765 (Output_data_got::add_local_pair_with_rel): Change object to
1766 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1767 add_output_section_generic.
1768 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1769 callers to use add_local_pair_with_rel.
1770 (Output_data_got::reserve_local): Change object to Relobj*.
1771 * output.h: (class Output_data_reloc_generic): Add pure virtual
1772 declarations for add_global_generic, add_local_generic,
1773 add_output_section_generic.
1774 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1775 functions for Output_data_reloc_generic. Update declarations for
1776 changes listed in output.cc.
1777 (class Output_data_got): Change template parameter to got_size.
1778 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1779 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1781 (Sized_relobj_incr::do_local_plt_offset): New function.
1782 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1785 2011-12-17 Cary Coutant <ccoutant@google.com>
1787 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1788 * resolve.cc (Symbol_table::resolve): Likewise.
1789 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1791 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1793 2011-12-16 Ian Lance Taylor <iant@google.com>
1795 * output.h (Output_data_reloc_generic::add): Only call
1796 add_dynamic_reloc if this is a dynamic reloc section.
1798 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1801 * target-reloc.h (apply_relocation): Replace <64, false> with
1804 2011-11-25 Nick Clifton <nickc@redhat.com>
1806 * po/it.po: New Italian translation.
1808 2011-11-17 Sterling Augustine <saugustine@google.com>
1810 * script.cc (script_include_directive): Implement.
1811 (read_script_file): New local variables name and search_path. Update
1812 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1813 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1814 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1816 2011-11-11 Sterling Augustine <saugustine@google.com>
1818 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1819 (file_or_sections_cmd): Likewise.
1821 2011-11-11 Doug Kwan <dougkwan@google.com>
1823 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1824 if --just-symbols is given.
1826 2011-11-10 Doug Kwan <dougkwan@google.com>
1829 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1830 when processing data relocs.
1831 * reloc.h (Relocate_functions::rel_unaligned): New method.
1832 (Relocate_functions::pcrel_unaligned): Ditto.
1833 (Relocate_functions::rel32_unaligned): Ditto.
1834 (Relocate_functions::pcrel32_unaligned): Ditto.
1836 2011-11-09 Doug Kwan <dougkwan@google.com>
1839 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1840 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1841 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1842 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1843 (Relocate_functions::rel_unaligned): New.
1844 (Relocate_functions::rel32_unaligned): New.
1845 * target-reloc.h (relocate_for_relocatable): Add code to handle
1846 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1847 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1848 arm_unaligned_reloc_r): New targets.
1849 * testsuite/Makefile.in: Regenerate.
1850 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1853 2011-11-02 Ian Lance Taylor <iant@google.com>
1855 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1857 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1858 * options.cc (General_options::finalize): Use library search path
1859 from configure script if specified. If not native and no sysroot,
1860 only search TOOLLIBDIR.
1861 * options.h (Search_directory::Search_directory): Change name to
1863 (General_options::add_to_library_path_with_sysroot): Change arg to
1865 * configure, Makefile.in, config.in: Rebuild.
1867 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1869 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1870 we are working around the ARM1176 Erratum.
1871 * options.h (General_options::fix_arm1176): Add option.
1872 * testsuite/Makefile.am: Add testcases, and keep current ones
1874 * testsuite/Makefile.in: Regenerate.
1875 * testsuite/arm_fix_1176.s: New file.
1876 * testsuite/arm_fix_1176.sh: Likewise.
1878 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1880 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1882 (Target_arm::may_use_blx): Remove method.
1883 (Target_arm::set_may_use_blx): Likewise.
1884 (Target_arm::may_use_v4t_interworking): New method.
1885 (Target_arm::may_use_v5t_interworking): Likewise.
1886 (Target_arm::may_use_blx_): Remove member variable.
1887 (Arm_relocate_functions::arm_branch_common): Check for v5T
1889 (Arm_relocate_functions::thumb_branch_common): Likewise.
1890 (Reloc_stub::stub_type_for_reloc): Likewise.
1891 (Target_arm::do_finalize_sections): Correct interworking checks.
1892 * testsuite/Makefile.am: Add new tests.
1893 * testsuite/Makefile.in: Regenerate.
1894 * testsuite/arm_farcall_arm_arm.s: New test.
1895 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1896 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1897 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1898 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1899 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1900 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1901 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1903 2011-10-31 Cary Coutant <ccoutant@google.com>
1906 * expression.cc (Expression::eval_with_dot): Add
1907 is_section_dot_assignment parameter.
1908 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1909 absolute and assigning to dot within a section.
1910 * script-sections.cc
1911 (Output_section_element_assignment::set_section_addresses): Pass
1912 dot_section to set_if_absolute.
1913 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1914 as is_section_dot_assignment flag to eval_with_dot.
1915 (Output_section_element_dot_assignment::set_section_addresses):
1917 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1918 parameter. Also set value if relative to dot_section; set the
1919 symbol's output_section.
1920 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1921 parameter. Adjust all callers.
1922 (Expression::eval_maybe_dot): Likewise.
1923 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1925 * testsuite/script_test_2.t: Test assignment of an absolute value
1926 to dot within an output section element.
1928 2011-10-31 Cary Coutant <ccoutant@google.com>
1930 * options.h (class General_options): Add --[no-]gnu-unique options.
1931 * symtab.cc (Symbol_table::sized_write_globals): Convert
1932 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1934 2011-10-31 Cary Coutant <ccoutant@google.com>
1937 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1938 unnecessary assertion.
1939 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1941 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1943 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1945 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1947 Change to just keep the section associated with symbol.
1948 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1949 they are externally visible and --export-dynamic is turned on.
1950 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1952 2011-10-19 Ian Lance Taylor <iant@google.com>
1955 * script-sections.cc
1956 (Output_section_element_dot_assignment::needs_output_section): New
1959 2011-10-19 Ian Lance Taylor <iant@google.com>
1962 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1963 --section-start option was seen.
1964 * options.h (General_options::any_section_start): New function.
1966 2011-10-18 David S. Miller <davem@davemloft.net>
1969 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1970 member to track relocation locations that have moved during TLS
1971 reloc optimizations.
1972 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1973 (Target_sparc::Relocate::relocate): Adjust view down by 4
1974 bytes if it matches reloc_adjust_addr_.
1975 (Target_sparc::Relocate::relocate_tls): Always move the
1976 __tls_get_addr call delay slot instruction forward 4 bytes when
1977 performing relaxation.
1979 2011-10-18 Cary Coutant <ccoutant@google.com>
1981 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1982 (Output_file::map_no_anonymous): Check for non-zero
1983 return code from posix_fallocate.
1985 2011-10-17 Cary Coutant <ccoutant@google.com>
1988 * plugin.cc (is_visible_from_outside): Check for symbols
1989 referenced from dynamic objects.
1990 * resolve.cc (Symbol_table::resolve): Don't count references
1991 from dynamic objects as references from real ELF files.
1992 * testsuite/plugin_test_2.sh: Adjust expected result.
1994 2011-10-17 Cary Coutant <ccoutant@google.com>
1996 * gold.cc: Include timer.h.
1997 (queue_middle_tasks): Stamp time.
1998 (queue_final_tasks): Likewise.
1999 * main.cc (main): Store timer in parameters. Print timers
2001 * parameters.cc (Parameters::Parameters): Initialize timer_.
2002 (Parameters::set_timer): New function.
2003 (set_parameters_timer): New function.
2004 * parameters.h (Parameters::set_timer): New function.
2005 (Parameters::timer): New function.
2006 (Parameters::timer_): New data member.
2007 (set_parameters_timer): New function.
2008 * timer.cc (Timer::stamp): New function.
2009 (Timer::get_pass_time): New function.
2010 * timer.h (Timer::stamp): New function.
2011 (Timer::get_pass_time): New function.
2012 (Timer::pass_times_): New data member.
2014 2011-10-17 Cary Coutant <ccoutant@google.com>
2016 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2017 task for members of lib groups.
2019 2011-10-17 Cary Coutant <ccoutant@google.com>
2022 * fileread.cc (File_read::find_view): Add assert.
2023 (File_read::make_view): Move bounds check (replace with assert)...
2024 (File_read::find_or_make_view): ... to here.
2026 2011-10-12 Cary Coutant <ccoutant@google.com>
2028 * output.cc (Output_file::open_base_file): Handle case where
2029 ::read returns less than requested size.
2031 2011-10-10 Cary Coutant <ccoutant@google.com>
2033 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
2034 Initialize defined_count_.
2035 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2036 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2037 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2038 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2039 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
2040 * incremental.h (Sized_relobj_incr::defined_count_): New data
2042 (Sized_incr_dynobj::defined_count_): New data member.
2043 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
2044 Return zeroes instead of internal error.
2046 2011-10-10 Cary Coutant <ccoutant@google.com>
2049 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
2050 (Output_reloc::symbol_value): Return PLT offset if flag is set.
2051 * output.h (class Output_reloc): Add use_plt_offset flag.
2052 (Output_reloc::type_): Adjust size of bit field.
2053 (Output_reloc::use_plt_offset_): New bit field.
2054 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2055 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2056 flag. Adjust all callers.
2057 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
2058 creating RELATIVE relocations.
2060 2011-10-10 Nick Clifton <nickc@redhat.com>
2062 * po/es.po: Updated Spanish translation.
2063 * po/fi.po: Updated Finnish translation.
2065 2011-10-03 Diego Novillo <dnovillo@google.com>
2067 * options.cc (parse_uint): Fix dereference of RETVAL.
2069 2011-09-29 Sriraman Tallam <tmsriram@google.com>
2071 * layout.h (section_order_map_): New member.
2072 (get_section_order_map): New member function.
2073 * output.cc (Output_section::add_input_section): Check for patterns
2074 only when --section-ordering-file is specified.
2075 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2076 output_sections have been formed.
2077 * layout.cc (Layout_Layout): Initialize section_order_map_.
2078 * plugin.cc (update_section_order): Store order in order_map. Do not
2080 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2081 * testsuite/Makefile.in: Regenerate.
2082 * testsuite/plugin_section_order.c: New file.
2083 * testsuite/plugin_final_layout.cc: New file.
2084 * testsuite/plugin_final_layout.sh: New file.
2086 2011-09-29 Cary Coutant <ccoutant@google.com>
2088 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2090 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
2091 symbols during incremental update.
2092 (Symbol_table::add_from_dynobj): Likewise.
2094 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2095 Ian Lance Taylor <iant@google.com>
2097 * symtab.cc (Symbol_table::define_special_symbol): Always
2098 canonicalize version string.
2100 2011-09-26 Cary Coutant <ccoutant@google.com>
2102 * gold.cc (queue_initial_tasks): Move option checks ...
2103 * options.cc (General_options::finalize): ... to here. Disable
2104 some options; make others fatal.
2106 2011-09-26 Cary Coutant <ccoutant@google.com>
2109 * plugin.cc (get_symbols_v2): New function.
2110 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2111 (is_referenced_from_outside): New function.
2112 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2113 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2114 (get_symbols): Pass version parameter.
2115 (get_symbols_v2): New function.
2116 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2118 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2119 (onload): Add LDPT_GET_SYMBOLS_V2.
2120 (all_symbols_read_hook): Use get_symbols_v2; check for
2121 LDPR_PREVAILING_DEF_IRONLY_EXP.
2122 * testsuite/plugin_test_3.sh: Update expected results.
2124 2011-09-23 Simon Baldwin <simonb@google.com>
2126 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2127 configuration options.
2128 * configure: Regenerate.
2129 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2130 * Makefile.in: Regenerate.
2131 * testsuite/Makefile.in: Regenerate.
2133 2011-09-19 Sriraman Tallam <tmsriram@google.com>
2135 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2137 2011-09-19 Cary Coutant <ccoutant@google.com>
2139 * incremental.cc (can_incremental_update): Fix typo in comment.
2140 * incremental.h (can_incremental_update): Likewise.
2142 2011-09-18 Cary Coutant <ccoutant@google.com>
2144 * incremental.cc (can_incremental_update): New function.
2145 * incremental.h (can_incremental_update): New function.
2146 * layout.cc (Layout::init_fixed_output_section): Call it.
2147 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2148 * object.cc (Sized_relobj_file::do_layout): Call
2149 can_incremental_update.
2151 2011-09-13 Cary Coutant <ccoutant@google.com>
2153 * configure.ac: Check for glibc support for gnu_indirect_function
2154 support with static linking, setting automake conditional
2156 * Makefile.in: Regenerate.
2157 * configure: Regenerate.
2159 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2160 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2162 * testsuite/Makefile.in: Regenerate.
2164 2011-09-13 Cary Coutant <ccoutant@google.com>
2166 * incremental.cc (Sized_relobj_incr::do_layout): Call
2167 report_comdat_group for kept comdat sections.
2168 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2169 * testsuite/Makefile.in: Regenerate.
2170 * testsuite/incr_comdat_test_1.cc: New source file.
2171 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2172 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2173 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2175 2011-09-13 Ian Lance Taylor <iant@google.com>
2177 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2178 variable external_symbols_offset.
2180 2011-09-12 Ian Lance Taylor <iant@google.com>
2182 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2183 triggered if object has no symbols.
2185 2011-09-09 David S. Miller <davem@davemloft.net>
2187 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2188 (Output_fill_debug_line::do_write): Likewise.
2190 2011-08-29 Cary Coutant <ccoutant@google.com>
2192 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2193 casts to match formatting specs.
2194 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2196 2011-08-26 Cary Coutant <ccoutant@google.com>
2198 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2199 remaining hole size when allocating.
2200 (Layout::make_output_section): Set fill methods for debug sections.
2201 * layout.h (Free_list::Free_list_node): Move from private to
2203 (Free_list::set_min_hole_size): New function.
2204 (Free_list::begin, Free_list::end): New functions.
2205 (Free_list::min_hole_): New data member.
2206 * output.cc: Include dwarf.h.
2207 (Output_fill_debug_info::do_minimum_hole_size): New function.
2208 (Output_fill_debug_info::do_write): New function.
2209 (Output_fill_debug_line::do_minimum_hole_size): New function.
2210 (Output_fill_debug_line::do_write): New function.
2211 (Output_section::Output_section): Initialize new data member.
2212 (Output_section::set_final_data_size): Ensure patch space is larger
2213 than minimum hole size.
2214 (Output_section::do_write): Fill holes in debug sections.
2215 * output.h (Output_fill): New class.
2216 (Output_fill_debug_info): New class.
2217 (Output_fill_debug_line): New class.
2218 (Output_section::set_free_space_fill): New function.
2219 (Output_section::free_space_fill_): New data member.
2220 * testsuite/Makefile.am (incremental_test_3): Add
2221 --incremental-patch option.
2222 (incremental_test_4): Likewise.
2223 (incremental_test_5): Likewise.
2224 (incremental_test_6): Likewise.
2225 (incremental_copy_test): Likewise.
2226 (incremental_common_test_1): Likewise.
2227 * testsuite/Makefile.in: Regenerate.
2229 2011-08-26 Nick Clifton <nickc@redhat.com>
2231 * po/es.po: Updated Spanish translation.
2233 2011-08-01 Cary Coutant <ccoutant@google.com>
2235 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2236 * gold/testsuite/Makefile.in: Regenerate.
2237 * gold/testsuite/justsyms_exec.c: New source file.
2238 * gold/testsuite/justsyms_lib.c: New source file.
2240 2011-08-01 Cary Coutant <ccoutant@google.com>
2242 * layout.cc (Layout::set_segment_offsets): Don't realign text
2243 segment if -Ttext was specified.
2244 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2246 * object.h (Sized_relobj_file::e_type): New function.
2247 (Sized_relobj_file::e_type_): New data member.
2248 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2249 base address for ET_EXEC files.
2250 * target.cc (Target::do_make_elf_object_implementation): Allow
2251 ET_EXEC files with --just-symbols option.
2253 2011-07-28 Cary Coutant <ccoutant@google.com>
2255 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2256 Add thread_number parameter.
2257 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2258 * workqueue-threads.cc
2259 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2260 current thread if its thread number is greater than desired thread
2262 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2263 Add thread_number parameter.
2264 (Workqueue::should_cancel_thread): Likewise.
2265 (Workqueue::find_runnable_or_wait): Pass thread_number to
2266 should_cancel_thread.
2267 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2270 2011-07-22 Sriraman Tallam <tmsriram@google.com>
2272 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2273 only after checking if it cannot be forced local.
2274 * symtab.h (is_externally_visible): Check if the symbol is not forced
2277 2011-07-15 Ian Lance Taylor <iant@google.com>
2279 * options.h (class General_options): Add --print-output-format.
2280 Move -EL next to -EB, for better --help output.
2281 * target-select.cc: Include <cstdio>, "options.h", and
2283 (Target_selector::do_target_bfd_name): New function.
2284 (print_output_format): New function.
2285 * target-select.h (class Target_selector): Update declarations.
2286 (Target_selector::target_bfd_name): New function.
2287 (print_output_format): Declare.
2288 * main.cc: Include "target-select.h".
2289 (main): Handle --print-output-format.
2290 * gold.cc: Include "target-select.h".
2291 (queue_initial_tasks): Handle --print-output-format when there are
2293 * parameters.cc (parameters_force_valid_target): Give a better
2294 error message if -EB/-EL does not match target.
2295 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2298 2011-07-15 Ian Lance Taylor <iant@google.com>
2300 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2301 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2302 (Output_data_plt_i386::do_write): Write address of .dynamic
2303 section to first entry in .got.plt section.
2304 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2305 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2307 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2308 section to first entry in .got.plt section.
2309 * layout.h (Layout::dynamic_section): New function.
2311 2011-07-13 Sriraman Tallam <tmsriram@google.com>
2313 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2315 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2316 input_section_position_, and input_section_glob_.
2317 (read_layout_from_file): Call function section_ordering_specified.
2318 * layout.h (is_section_ordering_specified): New function.
2319 (section_ordering_specified): New function.
2320 (section_ordering_specified_): New boolean member.
2321 * main.cc(main): Call load_plugins after layout object is defined.
2322 * output.cc (Output_section::add_input_section): Use
2323 function section_ordering_specified to check if section ordering is
2325 * output.cc (Output_section::add_relaxed_input_section): Use
2326 function section_ordering_specified to check if section ordering is
2328 (Output_section::update_section_layout): New function.
2329 (Output_section::sort_attached_input_sections): Check if input section
2331 * output.h (Output_section::update_section_layout): New function.
2332 * plugin.cc (get_section_count): New function.
2333 (get_section_type): New function.
2334 (get_section_name): New function.
2335 (get_section_contents): New function.
2336 (update_section_order): New function.
2337 (allow_section_ordering): New function.
2338 (Plugin::load): Add the new interfaces to the transfer vector.
2339 (Plugin_manager::load_plugins): New parameter.
2340 (Plugin_manager::all_symbols_read): New parameter.
2341 (Plugin_manager::claim_file): New parameter. Save the elf object for
2343 (Plugin_manager::get_elf_object): New function.
2344 (Plugin_manager::get_view): Change to directly use the bool to check
2345 if get_view is called from claim_file_hook.
2346 * plugin.h (input_objects): New function
2347 (Plugin__manager::load_plugins): New parameter.
2348 (Plugin_manager::claim_file): New parameter.
2349 (Plugin_manager::get_elf_object): New function.
2350 (Plugin_manager::in_claim_file_handler): New function.
2351 (Plugin_manager::in_claim_file_handler_): New member.
2352 (layout): New function.
2353 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2354 handler with an extra parameter. Make the elf object before calling
2356 * testsuite/plugin_test.c (get_section_count): New function pointer.
2357 (get_section_type): New function pointer.
2358 (get_section_name): New function pointer.
2359 (get_section_contents): New function pointer.
2360 (update_section_order): New function pointer.
2361 (allow_section_ordering): New function pointer.
2362 (onload): Check if the new interfaces exist.
2364 2011-07-13 Ian Lance Taylor <iant@google.com>
2366 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2368 * x86_64.cc (Target_x86_64::got_section): Likewise.
2369 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2370 (relro_now_test_SOURCES): New variable.
2371 (relro_now_test_DEPENDENCIES): New variable.
2372 (relro_now_test_LDFLAGS): New variable.
2373 (relro_now_test_LDADD): New variable.
2374 (relro_now_test.so): New target.
2375 * testsuite/Makefile.in: Rebuild.
2377 2011-07-12 Ian Lance Taylor <iant@google.com>
2380 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2381 GLOB_DAT relocation rather than a RELATIVE relocation for a
2382 protected symbol when creating a shared library.
2383 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2384 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2385 * testsuite/protected_main_1.cc (main): Test that protected
2386 function has same address.
2388 2011-07-11 Ian Lance Taylor <iant@google.com>
2391 * options.h (class General_options): Add -Bgroup.
2392 * options.cc (General_options::finalize): If -Bgroup is set,
2393 default to --unresolved-symbols=report-all.
2394 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2395 * target-reloc.h (issue_undefined_symbol_error): Handle
2396 --unresolved-symbols=report-all.
2398 2011-07-08 Ian Lance Taylor <iant@google.com>
2401 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2402 if linker script discards key sections.
2403 (Layout::create_dynamic_symtab): Likewise.
2404 (Layout::assign_local_dynsym_offsets): Likewise.
2405 (Layout::sized_create_version_sections): Likewise.
2406 (Layout::create_interp): Likewise.
2407 (Layout::finish_dynamic_section): Likewise.
2408 (Layout::set_dynamic_symbol_size): Likewise.
2410 2011-07-08 Ian Lance Taylor <iant@google.com>
2413 * options.h (class General_options): Add --unresolved-symbols.
2414 * target-reloc.h (issue_undefined_symbol_error): Check
2415 --unresolved-symbols. Add comments.
2417 2011-07-08 Ian Lance Taylor <iant@google.com>
2419 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2420 expression more complex.
2422 2011-07-08 Ian Lance Taylor <iant@google.com>
2425 * target-reloc.h (issue_undefined_symbol_error): New inline
2426 function, broken out of relocate_section.
2427 (relocate_section): Call issue_undefined_symbol_error.
2428 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2429 there is no TLS segment if we are about to issue an undefined
2431 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2433 2011-07-08 Ian Lance Taylor <iant@google.com>
2436 * resolve.cc (Symbol_table::should_override): Add fromtype
2437 parameter. Change all callers. Give error when linking together
2438 TLS and non-TLS symbol.
2439 (Symbol_table::should_override_with_special): Add fromtype
2440 parameter. Change all callers.
2441 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2442 there is no TLS segment if we have reported some errors.
2443 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2445 2011-07-08 Ian Lance Taylor <iant@google.com>
2448 * target.h (Target::plt_address_for_global): New function.
2449 (Target::plt_address_for_local): New function.
2450 (Target::plt_section_for_global): Remove.
2451 (Target::plt_section_for_local): Remove.
2452 (Target::do_plt_address_for_global): New virtual function.
2453 (Target::do_plt_address_for_local): New virtual function.
2454 (Target::do_plt_section_for_global): Remove.
2455 (Target::do_plt_section_for_local): Remove.
2456 (Target::register_global_plt_entry): Add Symbol_table and Layout
2458 * output.cc (Output_data_got::Got_entry::write): Use
2459 plt_address_for_global and plt_address_for_local.
2460 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2461 address of output section.
2462 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2463 got_irelative_, and irelative_count_ fields. Update
2465 (Output_data_plt_i386::has_irelative_section): New function.
2466 (Output_data_plt_i386::entry_count): Add irelative_count_.
2467 (Output_data_plt_i386::set_final_data_size): Likewise.
2468 (class Target_i386): Add got_irelative_ and rel_irelative_
2469 fields. Update declarations.
2470 (Target_i386::Target_i386): Initialize new fields.
2471 (Target_i386::do_plt_address_for_global): New function replacing
2472 do_plt_section_for_global.
2473 (Target_i386::do_plt_address_for_local): New function replacing
2474 do_plt_section_for_local.
2475 (Target_i386::got_section): Create got_irelative_.
2476 (Target_i386::rel_irelative_section): New function.
2477 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2478 fields. Don't define __rel_iplt_{start,end}.
2479 (Output_data_plt_i386::add_entry): Add symtab and layout
2480 parameters. Change all callers. Use different PLT and GOT for
2482 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2483 layout parameters. Change all callers. Use different PLT and
2485 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2486 (Output_data_plt_i386::rel_irelative): New function.
2487 (Output_data_plt_i386::address_for_global): New function.
2488 (Output_data_plt_i386::address_for_local): New function.
2489 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2490 IRELATIVE GOT when changing IFUNC GOT entries.
2491 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2493 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2494 if we didn't create an IRELATIVE GOT.
2495 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2496 plt_address_for_local.
2497 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2498 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2499 got_irelative_, and irelative_count_ fields. Update
2501 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2502 Initialize new fields. Remove symtab parameter. Change all
2504 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2506 (Output_data_plt_x86_64::has_irelative_section): New function.
2507 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2508 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2509 fields. Update declarations.
2510 (Target_x86_64::Target_x86_64): Initialize new fields.
2511 (Target_x86_64::do_plt_address_for_global): New function replacing
2512 do_plt_section_for_global.
2513 (Target_x86_64::do_plt_address_for_local): New function replacing
2514 do_plt_section_for_local.
2515 (Target_x86_64::got_section): Create got_irelative_.
2516 (Target_x86_64::rela_irelative_section): New function.
2517 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2518 all callers. Don't create __rel_iplt_{start,end}.
2519 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2520 parameters. Change all callers. Use different PLT and GOT for
2522 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2523 layout parameters. Change all callers. Use different PLT and
2525 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2526 parameters. Change all callers. Use different PLT and GOT for
2528 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2529 (Output_data_plt_x86_64::rela_irelative): New function.
2530 (Output_data_plt_x86_64::address_for_global): New function.
2531 (Output_data_plt_x86_64::address_for_local): New function.
2532 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2533 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2534 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2535 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2537 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2539 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2540 symbols if we didn't create an IRELATIVE GOT.
2541 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2542 plt_address_for_local.
2543 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2544 * testsuite/ifuncvar1.c: New test file.
2545 * testsuite/ifuncvar2.c: New test file.
2546 * testsuite/ifuncvar3.c: New test file.
2547 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2548 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2549 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2550 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2551 * testsuite/Makefile.in: Rebuild.
2553 2011-07-07 Cary Coutant <ccoutant@google.com>
2555 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2556 (two_file_test_1_ndebug.o): Likewise.
2557 (two_file_test_1b_ndebug.o): Likewise.
2558 (two_file_test_2_ndebug.o): Likewise.
2559 (two_file_test_main_ndebug.o): Likewise.
2560 (incremental_test_2): Link with no-debug versions.
2562 2011-07-06 Cary Coutant <ccoutant@google.com>
2564 * gold/incremental.cc
2565 (Output_section_incremental_inputs::write_info_blocks): Check for
2566 hidden and internal symbols.
2568 2011-07-06 Cary Coutant <ccoutant@google.com>
2570 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2571 Check disposition for startup file.
2572 (Incremental_inputs::report_command_line): Ignore
2573 --incremental-startup-unchanged option.
2574 * options.cc (General_options::parse_incremental_startup_unchanged):
2576 (General_options::General_options): Initialize new data member.
2577 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2578 (General_options): Add --incremental-startup-unchanged option.
2579 (General_options::incremental_startup_disposition): New function.
2580 (General_options::incremental_startup_disposition_): New data member.
2582 2011-07-06 Cary Coutant <ccoutant@google.com>
2584 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2585 input file index to Script_info ctor.
2586 (Sized_incremental_binary::do_file_has_changed): Find the
2587 command-line argument for files named in scripts.
2588 * incremental.h (Script_info::Script_info): New ctor
2589 with input file index.
2590 (Script_info::input_file_index): New function.
2591 (Script_info::input_file_index_): New data member.
2592 (Incremental_binary::get_library): Add const.
2593 (Incremental_binary::get_script_info): Add const.
2594 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2595 * testsuite/Makefile.am (incremental_test_5): New test case.
2596 (incremental_test_6): New test case.
2597 * testsuite/Makefile.in: Regenerate.
2599 2011-07-06 Cary Coutant <ccoutant@google.com>
2601 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2602 debug output when command lines differ.
2604 2011-07-06 Cary Coutant <ccoutant@google.com>
2606 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2607 --incremental-patch option.
2608 * layout.cc (Free_list::allocate): Extend allocation beyond original
2610 (Layout::make_output_section): Mark sections that should get
2612 * options.cc (parse_percent): New function.
2613 * options.h (parse_percent): New function.
2614 (DEFINE_percent): New macro.
2615 (General_options): Add --incremental-patch option.
2616 * output.cc (Output_section::Output_section): Initialize new data
2618 (Output_section::add_input_section): Print section name when out
2620 (Output_section::add_output_section_data): Likewise.
2621 (Output_section::set_final_data_size): Add patch space when
2622 doing --incremental-full.
2623 (Output_section::do_reset_address_and_file_offset): Remove patch
2625 (Output_segment::set_section_list_addresses): Print debug output
2626 only if --incremental-update.
2627 * output.h (Output_section::set_is_patch_space_allowed): New function.
2628 (Output_section::is_patch_space_allowed_): New data member.
2629 (Output_section::patch_space_): New data member.
2630 * parameters.cc (Parameters::incremental_full): New function.
2631 * parameters.h (Parameters::incremental_full): New function
2632 * testsuite/Makefile.am (incremental_test_2): Add test for
2633 --incremental-patch option.
2634 * testsuite/Makefile.in: Regenerate.
2635 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2636 (t18): Remove function body.
2638 2011-07-05 Doug Kwan <dougkwan@google.com>
2641 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2642 Arm_Address type for relocation result.
2643 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2645 (Arm_relocate_functions::abs32): Use unaligned access.
2646 (Arm_relocate_functions::rel32): Ditto.
2647 (Arm_relocate_functions::prel31): Ditto.
2648 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2649 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2650 static data relocations.
2651 * testsuite/Makefile.in: Regnerate.
2652 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2654 2011-07-05 Ian Lance Taylor <iant@google.com>
2657 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2658 symbols if necessary.
2659 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2661 2011-07-05 Ian Lance Taylor <iant@google.com>
2664 * resolve.cc (Symbol::override_base_with_special): Simply override
2665 version with special symbol version, ignoring previous version.
2667 2011-07-05 Ian Lance Taylor <iant@google.com>
2669 * object.cc (Sized_relobj_file::include_section_group): Add
2670 information to comment about signature location.
2672 2011-07-02 Ian Lance Taylor <iant@google.com>
2675 * options.h (class General_options): Add -f and -F.
2676 * options.cc (General_options::finalize): Fatal error if -f/-F
2677 are used without -shared.
2678 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2680 2011-07-02 Ian Lance Taylor <iant@google.com>
2682 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2684 2011-07-01 Ian Lance Taylor <iant@google.com>
2688 * resolve.cc (Symbol::override_base_with_special): Don't override
2689 the version if the overriding symbol has a different name.
2690 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2691 all callers. If we give an error about an undefined version,
2692 define the base version if necessary.
2693 * dynobj.h (class Versions): Update declaration.
2694 * testsuite/weak_alias_test_5.cc: New file.
2695 * testsuite/weak_alias_test.script: New file.
2696 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2697 and versioned_alias have the right value, and call t2.
2698 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2699 weak_alias_test_5.so.
2700 (weak_alias_test_LDADD): Likewise.
2701 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2702 * testsuite/Makefile.in: Rebuild.
2704 2011-07-01 Ian Lance Taylor <iant@google.com>
2707 * options.h (class General_options): Support -z notext.
2708 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2710 (two_file_shared_nonpic.so): Likewise.
2711 (two_file_shared_mixed.so): Likewise.
2712 (two_file_shared_mixed_1.so): Likewise.
2713 (weak_undef_lib_nonpic.so): Likewise.
2714 (alt/weak_undef_lib_nonpic.so): Likewise.
2715 (tls_test_shared_nonpic.so): Likewise.
2716 * testsuite/Makefile.in: Rebuild.
2718 2011-07-01 Ian Lance Taylor <iant@google.com>
2721 * configure.ac: Test whether static linking works, setting
2722 the automake conditional HAVE_STATIC.
2723 * testsuite/Makefile.am: Disable tests using -static if
2724 HAVE_STATIC is not true.
2725 * configure, testsuite/Makefile.in: Rebuild.
2727 2011-07-01 Ian Lance Taylor <iant@google.com>
2730 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2731 Assert if we see DW_EH_PE_indirect.
2732 * target.h (Target::ehframe_datarel_base): New function.
2733 (Target::do_ehframe_datarel_base): New target function.
2734 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2735 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2738 2011-07-01 Ian Lance Taylor <iant@google.com>
2741 * options.h (class General_options): Add
2742 --ld-generated-unwind-info.
2743 * ehframe.cc (Fde::write): Add address parameter. Change all
2744 callers. If associated with PLT, fill in address and size.
2745 (Cie::set_output_offset): Only add merge mapping if there is an
2747 (Cie::write): Add address parameter. Change all callers.
2748 (Eh_frame::add_ehframe_for_plt): New function.
2749 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2750 input_offset_ fields into union u_, with new plt field.
2751 (Fde::Fde): Adjust for new union field.
2752 (Fde::Fde) [Output_data version]: New constructor.
2753 (Fde::add_mapping): Only add merge mapping if there is an object.
2754 (class Cie): Update declarations.
2755 (class Eh_frame): Declare add_ehframe_for_plt.
2756 * layout.cc (Layout::layout_eh_frame): Break out code into
2757 make_eh_frame_section, and call it.
2758 (Layout::make_eh_frame_section): New function.
2759 (Layout::add_eh_frame_for_plt): New function.
2760 * layout.h (class Layout): Update declarations.
2761 * merge.cc (Merge_map::add_mapping): Add assertion.
2762 * i386.cc: Include "dwarf.h".
2763 (class Output_data_plt_i386): Make first_plt_entry,
2764 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2765 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2766 and plt_eh_frame_fde.
2767 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2768 boundary. Call add_eh_frame_for_plt if appropriate.
2769 * x86_64.cc: Include "dwarf.h".
2770 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2771 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2772 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2773 and plt_eh_frame_fde.
2774 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2777 2011-06-29 Ian Lance Taylor <iant@google.com>
2780 * object.cc (Sized_relobj_file::layout_section): Change shdr
2781 parameter to be const.
2782 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2784 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2785 appropriate. Call layout_eh_frame_section.
2786 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2788 * object.h (class Sized_relobj_file): Update declarations.
2790 2011-06-29 Ian Lance Taylor <iant@google.com>
2793 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2795 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2797 2011-06-29 Ian Lance Taylor <iant@google.com>
2800 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2802 * layout.cc (Layout::layout_eh_frame): Likewise.
2804 2011-06-29 Ian Lance Taylor <iant@google.com>
2807 * layout.cc (Layout::symtab_section_shndx): New function.
2808 * layout.h (class Layout): Declare symtab_section_shndx.
2809 * output.cc (Output_section::write_header): Call it.
2811 2011-06-29 Ian Lance Taylor <iant@google.com>
2814 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2815 symbols which are not used in a relocation.
2817 2011-06-28 Ian Lance Taylor <iant@google.com>
2820 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2821 script create indistinguishable segments.
2822 (Layout::set_segment_offsets): Use stable_sort when sorting
2823 segments. Pass this to Compare_segments constructor.
2824 * layout.h (class Layout): Make segment_precedes non-static.
2825 (class Compare_segments): Change from struct to class. Add
2826 layout_ field. Add constructor.
2827 * script-sections.cc
2828 (Script_sections::attach_sections_using_phdrs_clause): Rename
2829 local orphan to is_orphan. Don't report failure to put empty
2830 section in segment. On attachment failure, report name of
2831 section, and attach to first PT_LOAD segment.
2833 2011-06-28 Ian Lance Taylor <iant@google.com>
2836 * target-select.cc (Target_selector::Target_selector): Add
2837 emulation parameter. Change all callers.
2838 (select_target_by_bfd_name): Rename from select_target_by_name.
2840 (select_target_by_emulation): New function.
2841 (supported_emulation_names): New function.
2842 * target-select.h (class Target_selector): Add emulation_ field.
2843 Update declarations.
2844 (Target_selector::recognize_by_bfd_name): Rename from
2845 recognize_by_name. Change all callers.
2846 (Target_selector::supported_bfd_names): Rename from
2847 supported_names. Change all callers.
2848 (Target_selector::recognize_by_emulation): New function.
2849 (Target_selector::supported_emulations): New function.
2850 (Target_selector::emulation): New function.
2851 (Target_selector::do_recognize_by_bfd_name): Rename from
2852 do_recognize_by_name. Change all callers.
2853 (Target_selector::do_supported_bfd_names): Rename from
2854 do_supported_names. Change all callers.
2855 (Target_selector::do_recognize_by_emulation): New function.
2856 (Target_selector::do_supported_emulations): New function.
2857 (select_target_by_bfd_name): Change name in declaration.
2858 (select_target_by_emulation): Declare.
2859 (supported_emulation_names): Declare.
2860 * parameters.cc (parameters_force_valid_target): Try to find
2861 target based on emulation from -m option.
2862 * options.h (class General_options): Change doc string for -m.
2863 * options.cc (help): Print emulations.
2864 (General_options::parse_V): Likewise.
2865 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2866 Add emulation parameter. Change all callers.
2868 2011-06-28 Ian Lance Taylor <iant@google.com>
2870 * target.h (class Target): Add osabi_ field.
2871 (Target::osabi): New function.
2872 (Target::set_osabi): New function.
2873 (Target::Target): Initialize osabi_.
2874 (Target::do_adjust_elf_header): Make pure virtual.
2875 (Sized_target::do_adjust_elf_header): Declare.
2876 * target.cc (Sized_target::do_adjust_elf_header): New function.
2877 (class Sized_target): Instantiate all versions.
2878 * freebsd.h (class Target_freebsd): Remove.
2879 (Target_selector_freebsd::do_recognize): Call set_osabi on
2881 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2882 (Target_selector_freebsd::set_osabi): Remove.
2883 * i386.cc (class Target_i386): Inherit from Sized_target rather
2884 than Target_freebsd.
2885 * x86_64.cc (class Target_x86_64): Likewise.
2887 2011-06-28 Ian Lance Taylor <iant@google.com>
2889 * target.h (Target::can_check_for_function_pointers): Rewrite.
2891 (Target::can_icf_inline_merge_sections): Likewise.
2892 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2893 (Target::Target_info): Add can_icf_inline_merge_sections field.
2894 (Target::do_can_check_for_function_pointers): New virtual
2896 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2897 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2898 from can_check_for_function_pointers, move in file.
2899 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2900 section_may_have_icf_unsafe_poineters, move in file.
2901 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2902 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2903 Rename from can_check_for_function_pointers, move in file.
2904 (Target_i386::can_icf_inline_merge_sections): Remove.
2905 (Target_i386::i386_info): Initialize
2906 can_icf_inline_merge_sections.
2907 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2908 Initialize can_icf_inline_merge_sections.
2909 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2910 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2911 Rename from can_check_for_function_pointers, move in file.
2912 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2913 (Target_x86_64::x86_64_info): Initialize
2914 can_icf_inline_merge_sections.
2915 * testsuite/testfile.cc (Target_test::test_target_info):
2917 * icf.cc (get_section_contents): Correct formatting.
2919 2011-06-27 Ian Lance Taylor <iant@google.com>
2921 * symtab.cc (Symbol::versioned_name): New function.
2922 (Symbol_table::add_to_final_symtab): Use versioned_name when
2924 (Symbol_table::sized_write_symbol): Likewise.
2925 * symtab.h (class Symbol): Declare versioned_name.
2926 * stringpool.h (class Stringpool_template): Add variant of add
2927 which takes a std::basic_string.
2928 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2929 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2930 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2931 (ver_test_12.o): New target.
2932 * testsuite/Makefile.in: Rebuild.
2934 2011-06-27 Doug Kwan <dougkwan@google.com>
2936 * arm.cc (Arm_relocate_functions::thm_jump8,
2937 Arm_relocate_functions::thm_jump11): Use a wider signed
2938 type to compute offset.
2939 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2941 * testsuite/Makefile.in: Regenerate.
2942 * testsuite/arm_branch_in_range.sh: Check test results of
2943 arm_thm_jump11 and arm_thm_jump8.
2944 * testsuite/arm_thm_jump11.s: New test source file.
2945 * testsuite/arm_thm_jump11.t: New linker script.
2946 * testsuite/arm_thm_jump8.s: New test source file.
2947 * testsuite/arm_thm_jump8.t: New linker script.
2949 2011-06-24 Ian Lance Taylor <iant@google.com>
2951 * layout.cc: Include "object.h".
2952 (ctors_sections_in_init_array): New static variable.
2953 (Layout::is_ctors_in_init_array): New function.
2954 (Layout::layout): Add entry to ctors_sections_in_init_array if
2956 * layout.h (class Layout): Declare is_ctors_in_init_array.
2957 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2958 is_ctors_reverse_view is set.
2959 (Sized_relobj_file::write_sections): Add layout parameter. Change
2960 all callers. Set is_ctors_reverse_view field of View_size.
2961 (Sized_relobj_file::reverse_words): New function.
2962 * object.h (Sized_relobj_file::View_size): Add
2963 is_ctors_reverse_view field.
2964 (class Sized_relobj_file): Update declarations.
2965 * testsuite/initpri3.c: New test.
2966 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2968 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2969 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2970 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2971 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2972 * testsuite/Makefile.in: Rebuild.
2974 2011-06-24 Cary Coutant <ccoutant@google.com>
2976 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2977 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2978 (debug_msg_cdebug.err): New targets.
2979 * testsuite/Makefile.in: Regenerate.
2980 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2981 Fix checks for link with shared library.
2983 2011-06-24 Doug Kwan <dougkwan@google.com>
2985 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2986 skip empty text sections.
2987 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2989 2011-06-22 Ian Lance Taylor <iant@google.com>
2992 * options.h (class General_options): Add --ctors-in-init-array.
2993 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2994 friends as SHT_PROGBITS for merging sections.
2995 (Layout::layout): Remove special handling of .init_array and
2996 friends. Don't sort if doing relocatable link. Sort for .ctors
2997 and .dtors if ctors_in_init_array.
2998 (Layout::make_output_section): Force correct section types for
2999 .init_array and friends. Don't sort if doing relocatable link,
3000 Don't sort .ctors and .dtors if ctors_in_init_array.
3001 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3002 (Layout::output_section_name): Add relobj parameter. Change all
3003 callers. Handle .ctors. and .dtors. in code rather than table.
3004 Handle .ctors and .dtors if ctors_in_init_array.
3005 (Layout::match_file_name): New function, moved from output.cc.
3006 * layout.h (class Layout): Update declarations.
3007 * output.cc: Include "layout.h".
3008 (Input_section_sort_entry::get_priority): New function.
3009 (Input_section_sort_entry::match_file_name): Just call
3010 Layout::match_file_name.
3011 (Output_section::Input_section_sort_init_fini_compare::operator()):
3012 Handle .ctors and .dtors. Sort by explicit priority rather than
3014 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3015 * testsuite/initpri2.c: New test.
3016 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3017 (check_PROGRAMS): Add initpri2.
3018 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3019 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3020 * configure, testsuite/Makefile.in: Rebuild.
3022 2011-06-19 Ian Lance Taylor <iant@google.com>
3025 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3026 .interp section to a PT_INTERP segment even if we have seen a
3027 --dynamic-linker option. Don't do it if we have seen a PHDRS
3028 clause in a linker script.
3029 (Layout::finalize): Don't create a .interp section if we've
3030 already create a PT_INTERP segment.
3031 (Layout::create_interp): Always call choose_output_section (revert
3032 patch of 2011-06-17). Don't create PT_INTERP segment.
3033 * script-sections.cc
3034 (Script_sections::create_note_and_tls_segments): Add a .interp
3035 section to a PT_INTERP segment even if we have seen a
3036 --dynamic-linker option.
3038 2011-06-18 Ian Lance Taylor <iant@google.com>
3040 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3041 merely because a non-PT_LOAD segment has a dynamic reloc.
3043 2011-06-18 Ian Lance Taylor <iant@google.com>
3045 * layout.cc (Layout::finish_dynamic_section): Don't create
3046 DT_FLAGS entry if not needed.
3048 2011-06-18 Ian Lance Taylor <iant@google.com>
3051 * layout.cc (Layout::layout_eh_frame): Correct handling of
3052 writable .eh_frame section.
3054 2011-06-17 Ian Lance Taylor <iant@google.com>
3057 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3058 symbol is redefined with the exact same object and value.
3060 2011-06-17 Ian Lance Taylor <iant@google.com>
3063 * layout.h (class Layout): Add interp_segment_ field.
3064 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3065 (Layout::attach_allocated_section_to_segment): If making shared
3066 library, put .interp section in PT_INTERP segment.
3067 (Layout::finalize): Also call create_interp if -dynamic-linker
3069 (Layout::create_interp): Assert that there is no PT_INTERP
3070 segment. If not using a SECTIONS clause, use make_output_section.
3071 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3072 * script-sections.cc
3073 (Script_sections::create_note_and_tls_segments): If making shared
3074 library, put .interp section in PT_INTERP segment.
3076 2011-06-17 Ian Lance Taylor <iant@google.com>
3078 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3079 when making a shared library.
3081 2011-06-17 Ian Lance Taylor <iant@google.com>
3083 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3084 parameter. Change all callers. Don't issue warning about PC32
3085 against locally defined symbol.
3087 2011-06-16 Ian Lance Taylor <iant@google.com>
3089 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3090 occurs in same object.
3092 2011-06-14 Alan Modra <amodra@gmail.com>
3094 * po/POTFILES.in: Regenerate.
3096 2011-06-09 Ian Lance Taylor <iant@google.com>
3098 * script-sections.cc
3099 (Orphan_output_section::set_section_addresses): For a relocatable
3100 link set address to 0.
3102 2011-06-09 Cary Coutant <ccoutant@google.com>
3105 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3106 used with --compress-debug-sections.
3107 * gold/object.cc (Sized_relobj_file::do_layout): Report
3108 uncompressed size of compressed input sections.
3110 2011-06-08 Cary Coutant <ccoutant@google.com>
3113 * testsuite/two_file_test_2_v1.cc: Change initialization of
3114 v2 to keep it in .data.
3116 2011-06-07 Cary Coutant <ccoutant@google.com>
3118 * common.cc (Symbol_table::do_allocate_commons_list): Call
3120 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3121 (Errors::fallback): New function.
3122 (gold_fallback): New function.
3123 * errors.h (Errors::fallback): New function.
3124 * gold.cc (gold_exit): Change status parameter to enum; adjust
3126 (queue_initial_tasks): Call gold_fallback.
3127 * gold.h: Include cstdlib.
3128 (Exit_status): New enum type.
3129 (gold_exit): Change status parameter to enum.
3130 (gold_fallback): New function.
3131 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3132 (Layout::create_symtab_sections): Likewise.
3133 (Layout::create_shdrs): Likewise.
3134 * main.cc (main): Adjust call to gold_exit.
3135 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3136 (Output_data_got::add_got_entry_pair): Likewise.
3137 (Output_section::add_input_section): Likewise.
3138 (Output_section::add_output_section_data): Likewise.
3139 (Output_segment::set_section_list_addresses): Likewise.
3140 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3142 2011-06-07 Cary Coutant <ccoutant@google.com>
3144 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3145 for incremental links.
3146 * output.cc (Output_segment::set_section_list_addresses): Remove
3147 FIXME and test for TLS or BSS.
3149 2011-06-07 Cary Coutant <ccoutant@google.com>
3151 * testsuite/Makefile.am: Add incremental_copy_test,
3152 incremental_common_test_1.
3153 * testsuite/Makefile.in: Regenerate.
3154 * testsuite/common_test_1_v1.c: New source file.
3155 * testsuite/common_test_1_v2.c: New source file.
3156 * testsuite/copy_test_v1.cc: New source file.
3158 2011-06-07 Cary Coutant <ccoutant@google.com>
3160 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3161 update, allocate common from bss section's free list.
3162 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3163 linker-defined symbols.
3164 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3165 Skip GOT and PLT entries that are no longer referenced.
3166 (Output_section_incremental_inputs::write_info_blocks): Mark
3167 linker-defined symbols.
3168 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3169 * output.cc (Output_section::allocate): New function.
3170 * output.h (Output_section::allocate): New function.
3171 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3172 linker-defined symbols.
3173 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3174 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3175 (Symbol::init_base_output_data): Likewise.
3176 (Symbol::init_base_output_segment): Likewise.
3177 (Symbol::init_base_constant): Likewise.
3178 (Sized_symbol::init_output_data): Likewise.
3179 (Sized_symbol::init_output_segment): Likewise.
3180 (Sized_symbol::init_constant): Likewise.
3181 (Symbol_table::do_define_in_output_data): Likewise.
3182 (Symbol_table::do_define_in_output_segment): Likewise.
3183 (Symbol_table::do_define_as_constant): Likewise.
3184 * symtab.h (Symbol::is_predefined): New function.
3185 (Symbol::init_base_output_data): Add is_predefined parameter.
3186 (Symbol::init_base_output_segment): Likewise.
3187 (Symbol::init_base_constant): Likewise.
3188 (Symbol::is_predefined_): New data member.
3189 (Sized_symbol::init_output_data): Add is_predefined parameter.
3190 (Sized_symbol::init_output_segment): Likewise.
3191 (Sized_symbol::init_constant): Likewise.
3192 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3194 2011-06-07 Cary Coutant <ccoutant@google.com>
3196 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3197 instead of emit_copy_reloc.
3198 (Copy_relocs::emit_copy_reloc): Refactor.
3199 (Copy_relocs::make_copy_reloc): New function.
3200 (Copy_relocs::add_copy_reloc): Remove.
3201 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3203 (Copy_relocs::make_copy_reloc): New function.
3204 (Copy_relocs::add_copy_reloc): Remove.
3205 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3206 unchanged input files.
3207 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3208 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3209 Reserve BSS space for COPY relocations.
3210 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3211 (Output_section_incremental_inputs::write_info_blocks): Record
3212 whether a symbol is copied from a shared object.
3213 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3214 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3215 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3216 (Incremental_input_entry_reader::get_output_symbol_index): Add
3218 (Incremental_binary::emit_copy_relocs): New function.
3219 (Incremental_binary::do_emit_copy_relocs): New function.
3220 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3222 (Sized_incremental_binary::add_copy_reloc): New function.
3223 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3224 (Sized_incremental_binary::Copy_reloc): New struct.
3225 (Sized_incremental_binary::Copy_relocs): New typedef.
3226 (Sized_incremental_binary::copy_relocs_): New data member.
3227 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3228 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3229 * target.h (Sized_target::emit_copy_reloc): New function.
3230 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3232 2011-06-02 Cary Coutant <ccoutant@google.com>
3235 * gold/archive.cc (Archive::Archive): Initialize new data member.
3236 (Archive::include_all_members): Return if archive has already been
3238 * gold/archive.h (Archive::include_all_members_): New data member.
3240 2011-06-02 Nick Clifton <nickc@redhat.com>
3242 * dynobj.h: Fix spelling mistake in comment.
3243 * output.cc: Likewise.
3245 2011-05-31 Doug Kwan <dougkwan@google.com>
3249 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
3250 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3251 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3252 redundant arm_exidx_test.so.
3253 * testsuite/Makefile.in: Regenerate.
3254 (check_SCRIPTS): Add pr12826.sh
3255 (check_DATA): Add pr12826.stdout
3256 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3257 * testsuite/pr12826.sh: New file.
3258 * testsuite/pr12826_1.s: Ditto.
3259 * testsuite/pr12826_1.s: Ditto.
3261 2011-05-30 Ian Lance Taylor <iant@google.com>
3263 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3266 2011-05-29 Ian Lance Taylor <iant@google.com>
3269 * testsuite/Makefile.am: Use different file name for two_file_test
3270 temporary file for each incremental test.
3271 * testsuite/Makefile.in: Rebuild.
3273 2011-05-29 Ian Lance Taylor <iant@google.com>
3275 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3276 binary input file is empty.
3278 2011-05-27 Ian Lance Taylor <iant@google.com>
3280 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3281 (ver_test_9.so): Likewise.
3282 * testsuite/Makefile.in: Rebuild.
3284 2011-05-26 Cary Coutant <ccoutant@google.com>
3286 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3287 * incremental.cc (Incremental_inputs::report_input_section): Fix
3288 comment, indentation.
3289 (Incremental_inputs::report_comdat_group): New function.
3290 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3291 of data for incremental input file entry.
3292 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3293 group count, COMDAT group signatures.
3294 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3295 an unchanged input file.
3296 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3297 Initialize new data member.
3298 (Incremental_object_entry::add_comdat_group): New function.
3299 (Incremental_object_entry::get_comdat_group_count): New function.
3300 (Incremental_object_entry::get_comdat_signature_key): New function.
3301 (Incremental_object_entry::groups_): New data member.
3302 (Incremental_inputs::report_comdat_group): New function.
3303 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3304 data for incremental input file entry.
3305 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3306 (Incremental_input_entry_reader::get_input_section): Adjust size of
3307 data for incremental input file entry.
3308 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3309 (Incremental_input_entry_reader::get_comdat_group_signature): New
3311 * object.cc (Sized_relobj::include_section_group): Report kept
3312 COMDAT groups for incremental links.
3314 2011-05-24 David Meyer <pdox@google.com>
3316 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3317 with name parameter. Add found_name parameter.
3318 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3319 * dirsearch.h (class Dirsearch): Update declaration.
3321 2011-05-24 Ian Lance Taylor <iant@google.com>
3323 * archive.cc (Library_base::should_include_member): Pull in object
3324 from archive if it defines the entry symbol.
3325 * parameters.cc (Parameters::entry): New function.
3326 * parameters.h (class Parameters): Declare entry.
3327 * output.h (class Output_file_header): Remove entry_ field.
3328 * output.cc (Output_file_header::Output_file_header): Remove entry
3329 parameter. Change all callers.
3330 (Output_file_header::entry): Use parameters->entry.
3331 * gold.cc (queue_middle_tasks): Likewise.
3332 * plugin.cc (Plugin_hook::run): Likewise.
3334 2011-05-24 Cary Coutant <ccoutant@google.com>
3336 * gold.cc (queue_initial_tasks): Pass incremental base filename
3337 to Output_file::open_base_file; don't print error message.
3338 * incremental-dump.cc (main): Adjust call to
3339 Output_file::open_for_modification.
3340 * incremental-dump.cc (main): Likewise.
3341 * incremental.cc (Incremental_inputs::report_command_line):
3342 Ignore --incremental-base option when comparing command lines.
3343 Ignore parameter when given as separate argument.
3344 * options.h (class General_options): Add --incremental-base.
3345 * output.cc (Output_file::Output_file):
3346 (Output_file::open_base_file): Add base_name and writable parameters;
3347 read base file into new file; print error message here.
3348 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3350 * output.h (Output_file::open_for_modification): Rename to...
3351 (Output_file::open_base_file): ...this; add base_name and
3352 writable parameters; adjust all callers.
3353 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3355 * testsuite/Makefile.am (incremental_test_4): Test
3357 * testsuite/Makefile.in: Regenerate.
3359 2011-05-24 Cary Coutant <ccoutant@google.com>
3361 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3363 * testsuite/Makefile.in: Regenerate.
3364 * testsuite/two_file_test_1_v1.cc: New test source file.
3365 * testsuite/two_file_test_1b_v1.cc: New test source file.
3366 * testsuite/two_file_test_2_v1.cc: New test source file.
3368 2011-05-24 Cary Coutant <ccoutant@google.com>
3370 * dynobj.h (Dynobj::do_dynobj): New function.
3371 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3372 flag and soname for shared objects.
3373 * incremental.cc (Incremental_inputs::report_object): Make
3374 either Incremental_object_entry or Incremental_dynobj_entry; add
3375 soname to string table.
3376 (Incremental_inputs::report_input_section): Add assertion.
3377 (Output_section_incremental_inputs::set_final_data_size): Adjust
3378 type of input file entry for shared libraries; adjust size of
3379 shared library info entry.
3380 (Output_section_incremental_inputs::write_input_files): Write
3381 as_needed flag for shared libraries.
3382 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3383 of input file entry for shared libraries; write soname.
3384 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3385 soname from incremental info.
3386 * incremental.h (enum Incremental_input_flags): Add
3387 INCREMENTAL_INPUT_AS_NEEDED.
3388 (Incremental_input_entry::Incremental_input_entry): Initialize new
3390 (Incremental_input_entry::set_as_needed): New function.
3391 (Incremental_input_entry::as_needed): New function.
3392 (Incremental_input_entry::do_dynobj_entry): New function.
3393 (Incremental_input_entry::as_needed_): New data member.
3394 (Incremental_object_entry::Incremental_object_entry): Don't check
3396 (Incremental_object_entry::do_type): Likewise.
3397 (class Incremental_dynobj_entry): New class.
3398 (Incremental_input_entry_reader::as_needed): New function.
3399 (Incremental_input_entry_reader::get_soname): New function.
3400 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3401 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3402 size of shared library info entry.
3403 * layout.cc (Layout::finish_dynamic_section): Don't test for
3404 incremental link when adding DT_NEEDED entries.
3405 * object.h (Object::Object): Initialize new data member.
3406 (Object::dynobj): New function.
3407 (Object::set_as_needed): New function.
3408 (Object::as_needed): New function.
3409 (Object::do_dynobj): New function.
3410 (Object::as_needed_): New data member.
3412 2011-05-24 Cary Coutant <ccoutant@google.com>
3414 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3415 info; adjust display of GOT entries.
3416 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3417 vector of input objects; remove file_status_.
3418 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3419 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3420 got_plt reader; call target hooks to reserve GOT entries.
3421 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3422 of input file info header and GOT info entry.
3423 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3425 (Got_plt_view_info::got_descriptor): Remove.
3426 (Got_plt_view_info::sym_index): New data member.
3427 (Got_plt_view_info::input_index): New data member.
3428 (Local_got_offset_visitor::visit): Write input file index.
3429 (Global_got_offset_visitor::visit): Write 0 for input file index.
3430 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3431 with sym_index and input_index.
3432 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3433 incremental info GOT entry; replace got_descriptor with input_index.
3434 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3435 map from input file index to object.
3436 (Sized_relobj_incr::do_layout): Replace direct data member reference
3437 with accessor function.
3438 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3439 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3440 Adjust size of input file info header.
3441 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3442 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3443 (Incremental_input_entry_reader::get_input_section): Adjust size of
3444 input file info header.
3445 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3446 of incremental info GOT entry.
3447 (Incremental_got_plt_reader::get_got_desc): Remove.
3448 (Incremental_got_plt_reader::get_got_symndx): New function.
3449 (Incremental_got_plt_reader::get_got_input_index): New function.
3450 (Sized_incremental_binary::Sized_incremental_binary): Remove
3451 file_status_; add input_objects_.
3452 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3453 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3454 (Sized_incremental_binary::file_is_unchanged): Remove.
3455 (Sized_incremental_binary::set_input_object): New function.
3456 (Sized_incremental_binary::input_object): New function.
3457 (Sized_incremental_binary::file_status_): Remove.
3458 (Sized_incremental_binary::input_objects_): New data member.
3459 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3461 (Sized_relobj_incr::invalid_address): Move to base class.
3462 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3464 (Sized_relobj_incr::do_output_section_offset): Likewise.
3465 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3466 (Sized_relobj_incr::section_offsets_): Likewise.
3467 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3469 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3470 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3471 with accessor function.
3472 (Sized_relobj_file::do_layout): Likewise.
3473 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3474 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3475 (Sized_relobj_file::compute_final_local_value): Replace refs to
3476 section_offsets_ with accessor function.
3477 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3478 * object.h (Relobj::Relobj): Initialize new data members.
3479 (Relobj::add_dyn_reloc): New function.
3480 (Relobj::first_dyn_reloc): New function.
3481 (Relobj::dyn_reloc_count): New function.
3482 (Relobj::first_dyn_reloc_): New data member.
3483 (Relobj::dyn_reloc_count_): New data member.
3484 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3486 (Sized_relobj::Address): New typedef.
3487 (Sized_relobj::invalid_address): Move here from child class.
3488 (Sized_relobj::Sized_relobj): Initialize new data members.
3489 (Sized_relobj::sized_relobj): New function.
3490 (Sized_relobj::is_output_section_offset_invalid): Move here from
3492 (Sized_relobj::get_output_section_offset): Likewise.
3493 (Sized_relobj::local_has_got_offset): Likewise.
3494 (Sized_relobj::local_got_offset): Likewise.
3495 (Sized_relobj::set_local_got_offset): Likewise.
3496 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3497 (Sized_relobj::clear_got_offsets): New function.
3498 (Sized_relobj::section_offsets): Move here from child class.
3499 (Sized_relobj::do_output_section_offset): Likewise.
3500 (Sized_relobj::do_set_section_offset): Likewise.
3501 (Sized_relobj::Local_got_offsets): Likewise.
3502 (Sized_relobj::local_got_offsets_): Likewise.
3503 (Sized_relobj::section_offsets_): Likewise.
3504 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3506 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3508 (Sized_relobj_file::sized_relobj): New function
3509 (Sized_relobj_file::local_has_got_offset): Move to base class.
3510 (Sized_relobj_file::local_got_offset): Likewise.
3511 (Sized_relobj_file::set_local_got_offset): Likewise.
3512 (Sized_relobj_file::get_output_section_offset): Likewise.
3513 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3514 (Sized_relobj_file::do_output_section_offset): Likewise.
3515 (Sized_relobj_file::do_set_section_offset): Likewise.
3516 (Sized_relobj_file::Local_got_offsets): Likewise.
3517 (Sized_relobj_file::local_got_offsets_): Likewise.
3518 (Sized_relobj_file::section_offsets_): Likewise.
3519 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3521 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3522 (Output_reloc::get_symbol_index): Likewise.
3523 (Output_reloc::local_section_offset): Likewise.
3524 (Output_reloc::get_address): Likewise.
3525 (Output_reloc::symbol_value): Likewise.
3526 (Output_data_got::reserve_slot): Move to class definition.
3527 (Output_data_got::reserve_local): New function.
3528 (Output_data_got::reserve_slot_for_global): Remove.
3529 (Output_data_got::reserve_global): New function.
3530 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3531 (all constructors, two instantiations).
3532 (Output_reloc::get_relobj): New function (two instantiations).
3533 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3534 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3535 (Output_data_reloc::add_global): Adjust type of relobj.
3536 (Output_data_reloc::add_global_relative): Likewise.
3537 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3538 (Output_data_reloc::add_local): Likewise.
3539 (Output_data_reloc::add_local_relative): Likewise.
3540 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3541 (Output_data_reloc::add_local_section): Likewise.
3542 (Output_data_reloc::add_output_section): Likewise.
3543 (Output_data_reloc::add_absolute): Likewise.
3544 (Output_data_reloc::add_target_specific): Likewise.
3545 (Output_data_got::reserve_slot): Move definition here.
3546 (Output_data_got::reserve_local): New function.
3547 (Output_data_got::reserve_global): New function.
3548 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3549 section_offsets_ with accessor function.
3550 (Sized_relobj_file::write_sections): Likewise.
3551 (Sized_relobj_file::do_relocate_sections): Likewise.
3552 * target.h (Sized_target::reserve_local_got_entry): New function.
3553 (Sized_target::reserve_global_got_entry): New function.
3554 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3555 (Target_x86_64::reserve_global_got_entry): New function.
3556 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3558 2011-05-23 Cary Coutant <ccoutant@google.com>
3560 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3561 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3562 bit when checking got_type.
3563 * incremental.cc (Sized_incremental_binary::setup_readers):
3564 Store symbol table and string table locations; initialize bit vector
3565 of file status flags.
3566 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3568 (Sized_incremental_binary::do_process_got_plt): New function.
3569 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3570 (Output_section_incremental_inputs::set_final_data_size): Record
3571 file index for each input file.
3572 (Output_section_incremental_inputs::write_got_plt): Store file index
3573 instead of input entry offset for each GOT entry.
3575 (Incremental_input_entry::Incremental_input_entry): Initialize new
3577 (Incremental_input_entry::set_offset): Store file index.
3578 (Incremental_input_entry::get_file_index): New function.
3579 (Incremental_input_entry::file_index_): New data member.
3580 (Incremental_binary::process_got_plt): New function.
3581 (Incremental_binary::do_process_got_plt): New function.
3582 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3584 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3585 (Sized_incremental_binary::set_file_is_unchanged): New function.
3586 (Sized_incremental_binary::file_is_unchanged): New function.
3587 (Sized_incremental_binary::do_process_got_plt): New function.
3588 (Sized_incremental_binary::file_status_): New data member.
3589 (Sized_incremental_binary::main_symtab_loc_): New data member.
3590 (Sized_incremental_binary::main_strtab_loc_): New data member.
3591 * output.cc (Output_data_got::Got_entry::write): Add case
3593 (Output_data_got::add_global): Call add_got_entry.
3594 (Output_data_got::add_global_plt): Likewise.
3595 (Output_data_got::add_global_with_rel): Likewise.
3596 (Output_data_got::add_global_with_rela): Likewise.
3597 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3598 (Output_data_got::add_global_pair_with_rela): Likewise.
3599 (Output_data_got::add_local): Call add_got_entry.
3600 (Output_data_got::add_local_plt): Likewise.
3601 (Output_data_got::add_local_with_rel): Likewise.
3602 (Output_data_got::add_local_with_rela): Likewise.
3603 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3604 (Output_data_got::add_local_pair_with_rela): Likewise.
3605 (Output_data_got::reserve_slot): New function.
3606 (Output_data_got::reserve_slot_for_global): New function.
3607 (Output_data_got::add_got_entry): New function.
3608 (Output_data_got::add_got_entry_pair): New function.
3609 (Output_section::add_output_section_data): Edit FIXME.
3611 (Output_section_data_build::Output_section_data_build): New
3612 constructor with size parameter.
3613 (Output_data_space::Output_data_space): Likewise.
3614 (Output_data_got::Output_data_got): Initialize new data member; new
3615 constructor with size parameter.
3616 (Output_data_got::add_constant): Call add_got_entry.
3617 (Output_data_got::reserve_slot): New function.
3618 (Output_data_got::reserve_slot_for_global): New function.
3619 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3620 (Output_data_got::add_got_entry): New function.
3621 (Output_data_got::add_got_entry_pair): New function.
3622 (Output_data_got::free_list_): New data member.
3623 * target.h (Sized_target::init_got_plt_for_update): New function.
3624 (Sized_target::register_global_plt_entry): New function.
3625 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3626 Initialize new data member; call init; add constructor with PLT count.
3627 (Output_data_plt_x86_64::init): New function.
3628 (Output_data_plt_x86_64::add_relocation): New function.
3629 (Output_data_plt_x86_64::reserve_slot): New function.
3630 (Output_data_plt_x86_64::free_list_): New data member.
3631 (Target_x86_64::init_got_plt_for_update): New function.
3632 (Target_x86_64::register_global_plt_entry): New function.
3633 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3634 incremental updates.
3635 (Output_data_plt_x86_64::add_relocation): New function.
3636 * testsuite/object_unittest.cc (Object_test): Set default options.
3638 2011-05-16 Ian Lance Taylor <iant@google.com>
3640 * options.h (class General_options): Make -i a synonym for -r.
3642 2011-05-16 Ian Lance Taylor <iant@google.com>
3644 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3646 2011-05-10 Cary Coutant <ccoutant@google.com>
3648 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3651 2011-05-06 Ian Lance Taylor <iant@google.com>
3653 * layout.cc (Layout::layout): If the output section flags change,
3654 update the ordering.
3656 2011-04-25 Cary Coutant <ccoutant@google.com>
3658 * incremental-dump.cc (dump_incremental_inputs): Print local
3659 symbol info for each input file.
3661 (Output_section_incremental_inputs::set_final_data_size): Add local
3662 symbol info to input file entries in incremental info.
3663 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3664 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3665 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3666 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3668 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3669 (Sized_incr_relobj::do_relocate): Write the local symbols.
3670 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3671 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3672 Adjust size of input file header.
3673 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3674 (Incremental_inputs_reader::get_local_symbol_count): New function.
3675 (Incremental_inputs_reader::get_input_section): Adjust size of input
3677 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3678 (Sized_incr_relobj::This): New typedef.
3679 (Sized_incr_relobj::sym_size): New const data member.
3680 (Sized_incr_relobj::Local_symbol): New struct.
3681 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3682 (Sized_incr_relobj::do_local_symbol_offset): New function.
3683 (Sized_incr_relobj::local_symbol_count_): New data member.
3684 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3685 (Sized_incr_relobj::local_symbol_index_): New data member.
3686 (Sized_incr_relobj::local_symbol_offset_): New data member.
3687 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3688 (Sized_incr_relobj::local_symbols_): New data member.
3689 * object.h (Relobj::output_local_symbol_count): New function.
3690 (Relobj::local_symbol_offset): New function.
3691 (Relobj::do_output_local_symbol_count): New function.
3692 (Relobj::do_local_symbol_offset): New function.
3693 (Sized_relobj::do_output_local_symbol_count): New function.
3694 (Sized_relobj::do_local_symbol_offset): New function.
3696 2011-04-22 Vladimir Simonov <sv@sw.ru>
3698 * descriptors.cc (set_close_on_exec): New function.
3699 (Descriptors::open): Use set_close_on_exec.
3700 * output.cc (S_ISLNK): Define if not defined.
3702 2011-04-22 Cary Coutant <ccoutant@google.com>
3704 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3706 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3707 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3708 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3710 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3711 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3712 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3714 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3716 (Incremental_binary::apply_incremental_relocs): New function.
3717 (Incremental_binary::do_apply_incremental_relocs): New function.
3718 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3720 (Sized_incremental_binary::add_global_symbol): New function.
3721 (Sized_incremental_binary::global_symbol): New function.
3722 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3723 (Sized_incremental_binary::symbol_map_): New data member.
3724 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3725 * target.h (Sized_target::apply_relocation): New function.
3726 * target-reloc.h (apply_relocation): New function.
3727 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3729 2011-04-22 Doug Kwan <dougkwan@google.com>
3731 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3732 flag of a SHT_ARM_EXIDX section.
3733 * testsuite/Makefile.am (arm_exidx_test): New test rules.
3734 * testsuite/Makefile.in: Regenerate.
3735 * testsuite/arm_exidx_test.s: New file.
3736 * testsuite/arm_exidx_test.sh: Same.
3738 2011-04-20 Cary Coutant <ccoutant@google.com>
3741 * archive.h (Incremental_archive_entry::Archive_member):
3742 Initialize arg_serial_ (second constructor).
3744 2011-04-17 Ian Lance Taylor <iant@google.com>
3746 * object.cc (Relocate_info::location): Simplify location string.
3747 * errors.cc (Errors::error_at_location): Don't print program
3749 (Errors::warning_at_location): Likewise.
3750 (Errors::undefined_symbol): Likewise.
3751 * testsuite/debug_msg.sh: Update accordingly.
3753 2011-04-14 Cary Coutant <ccoutant@google.com>
3755 * gold/layout.cc (Layout::symtab_section_offset): New function.
3756 * gold/layout.h (Layout::symtab_section_offset): New function.
3757 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3759 2011-04-12 Ian Lance Taylor <iant@google.com>
3761 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3762 with MREMAP_MAYMOVE.
3763 * output.h (class Output_file): Add map_is_allocated_ field.
3764 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3765 not available, provide stubs. If mremap is not available, #define
3767 (MREMAP_MAYMOVE): Define if not defined.
3768 (Output_file::Output_file): Initialize map_is_allocated_.
3769 (Output_file::resize): Check map_is_allocated_.
3770 (Output_file::map_anonymous): If mmap fails, use malloc.
3771 (Output_file::unmap): Don't do anything for an anonymous map.
3772 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3773 is not available, provide stubs.
3774 (File_read::View::~View): Use free rather than delete[].
3775 (File_read::make_view): Use malloc rather than new[]. If mmap
3777 (File_read::find_or_make_view): Use malloc rather than new[].
3778 * gold.h: Remove HAVE_REMAP code.
3779 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3780 exists. Rename mremap to gold_mremap. If mmap is not available
3782 * configure, config.in: Rebuild.
3784 2011-04-11 Ian Lance Taylor <iant@google.com>
3786 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3787 initialize local variable v.
3789 2011-04-11 Cary Coutant <ccoutant@google.com>
3791 * archive.cc (Archive::include_member): Adjust call to
3793 (Add_archive_symbols::run): Track argument serial numbers.
3794 (Lib_group::include_member): Likewise.
3795 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3796 * archive.h (Incremental_archive_entry::Archive_member):
3797 Initialize arg_serial_.
3798 (Archive_member::arg_serial_): New data member.
3799 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3800 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3802 (Sized_dynobj::do_for_all_local_got_entries): New function.
3803 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3805 * fileread.cc (get_mtime): New function.
3806 * fileread.h (get_mtime): New function.
3807 * gold.cc (queue_initial_tasks): Check for incremental update.
3808 (process_incremental_input): New function.
3809 (queue_middle_tasks): Don't force valid target for incremental
3811 * incremental-dump.cc (find_input_containing_global): Adjust
3812 size of symbol info entry.
3813 (dump_incremental_inputs): Dump argument serial number and
3814 in_system_directory flag; bias shndx by 1; print symbol names
3815 when dumping per-file symbol lists; use new symbol info readers.
3817 (Output_section_incremental_inputs:update_data_size): New function.
3818 (Sized_incremental_binary::setup_readers): Setup input readers
3819 for each input file; build maps for files added from libraries
3821 (Sized_incremental_binary::check_input_args): New function.
3822 (Sized_incremental_binary::do_check_inputs): Build map of argument
3823 serial numbers to input arguments.
3824 (Sized_incremental_binary::do_file_has_changed): Rename
3825 do_file_is_unchanged to this; compare file modification times.
3826 (Sized_incremental_binary::do_init_layout): New function.
3827 (Sized_incremental_binary::do_reserve_layout): New function.
3828 (Sized_incremental_binary::do_get_input_reader): Remove.
3829 (Sized_incremental_binary::get_symtab_view): New function.
3830 (Incremental_checker::can_incrementally_link_output_file): Remove.
3831 (Incremental_inputs::report_command_line): Exclude --debug options.
3832 (Incremental_inputs::report_archive_begin): Add parameter; track
3833 argument serial numbers; don't put input file entry for archive
3834 before archive members.
3835 (Incremental_inputs::report_archive_end): Put input file entry
3836 for archive after archive members.
3837 (Incremental_inputs::report_object): Add parameter; track argument
3838 serial numbers and in_system_directory flag.
3839 (Incremental_inputs::report_script): Add parameter; track argument
3841 (Output_section_incremental_inputs::set_final_data_size): Adjust
3842 size of symbol info entry; check for forwarding symbols.
3843 (Output_section_incremental_inputs::write_input_files): Write
3844 in_system_directory flag and argument serial number.
3845 (Output_section_incremental_inputs::write_info_blocks): Map section
3846 indices between incremental info and original input file; store
3847 input section index for each symbol.
3848 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3849 change operator() to visit().
3850 (class Global_got_offset_visitor): Likewise.
3851 (class Global_symbol_visitor_got_plt):
3852 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3854 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3855 (Sized_incr_relobj::do_read_symbols): New function.
3856 (Sized_incr_relobj::do_layout): New function.
3857 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3858 (Sized_incr_relobj::do_add_symbols): New function.
3859 (Sized_incr_relobj::do_should_include_member): New function.
3860 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3861 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3862 (Sized_incr_relobj::do_section_size): New function.
3863 (Sized_incr_relobj::do_section_name): New function.
3864 (Sized_incr_relobj::do_section_contents): New function.
3865 (Sized_incr_relobj::do_section_flags): New function.
3866 (Sized_incr_relobj::do_section_entsize): New function.
3867 (Sized_incr_relobj::do_section_address): New function.
3868 (Sized_incr_relobj::do_section_type): New function.
3869 (Sized_incr_relobj::do_section_link): New function.
3870 (Sized_incr_relobj::do_section_info): New function.
3871 (Sized_incr_relobj::do_section_addralign): New function.
3872 (Sized_incr_relobj::do_initialize_xindex): New function.
3873 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3874 (Sized_incr_relobj::do_read_relocs): New function.
3875 (Sized_incr_relobj::do_gc_process_relocs): New function.
3876 (Sized_incr_relobj::do_scan_relocs): New function.
3877 (Sized_incr_relobj::do_count_local_symbols): New function.
3878 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3879 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3880 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3881 (Sized_incr_relobj::do_relocate): New function.
3882 (Sized_incr_relobj::do_set_section_offset): New function.
3883 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3884 (Sized_incr_dynobj::do_read_symbols): New function.
3885 (Sized_incr_dynobj::do_layout): New function.
3886 (Sized_incr_dynobj::do_add_symbols): New function.
3887 (Sized_incr_dynobj::do_should_include_member): New function.
3888 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3889 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3890 (Sized_incr_dynobj::do_section_size): New function.
3891 (Sized_incr_dynobj::do_section_name): New function.
3892 (Sized_incr_dynobj::do_section_contents): New function.
3893 (Sized_incr_dynobj::do_section_flags): New function.
3894 (Sized_incr_dynobj::do_section_entsize): New function.
3895 (Sized_incr_dynobj::do_section_address): New function.
3896 (Sized_incr_dynobj::do_section_type): New function.
3897 (Sized_incr_dynobj::do_section_link): New function.
3898 (Sized_incr_dynobj::do_section_info): New function.
3899 (Sized_incr_dynobj::do_section_addralign): New function.
3900 (Sized_incr_dynobj::do_initialize_xindex): New function.
3901 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3902 (make_sized_incremental_object): New function.
3903 (Incremental_library::copy_unused_symbols): New function.
3904 (Incremental_library::do_for_all_unused_symbols): New function.
3905 * incremental.h (enum Incremental_input_flags): New type.
3906 (class Incremental_checker): Remove.
3907 (Incremental_input_entry::Incremental_input_entry): Add argument
3909 (Incremental_input_entry::arg_serial): New function.
3910 (Incremental_input_entry::set_is_in_system_directory): New function.
3911 (Incremental_input_entry::is_in_system_directory): New function.
3912 (Incremental_input_entry::arg_serial_): New data member.
3913 (Incremental_input_entry::is_in_system_directory_): New data member.
3914 (class Script_info): Move here from script.h.
3915 (Script_info::Script_info): Add filename parameter.
3916 (Script_info::filename): New function.
3917 (Script_info::filename_): New data member.
3918 (Incremental_script_entry::Incremental_script_entry): Add argument
3920 (Incremental_object_entry::Incremental_object_entry): Likewise.
3921 (Incremental_object_entry::add_input_section): Build list of input
3922 sections with map to original shndx.
3923 (Incremental_object_entry::get_input_section_index): New function.
3924 (Incremental_object_entry::shndx_): New data member.
3925 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3926 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3927 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3929 (Incremental_inputs::report_archive_begin): Likewise.
3930 (Incremental_inputs::report_object): Likewise.
3931 (Incremental_inputs::report_script): Likewise.
3932 (class Incremental_global_symbol_reader): New class.
3933 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3934 and store flags and input file type.
3935 (Incremental_input_entry_reader::arg_serial): New function.
3936 (Incremental_input_entry_reader::type): Extract type from flags.
3937 (Incremental_input_entry_reader::is_in_system_directory): New function.
3938 (Incremental_input_entry_reader::get_input_section_count): Call
3939 accessor function for type.
3940 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3941 function for type; adjust size of global symbol entry.
3942 (Incremental_input_entry_reader::get_global_symbol_count): Call
3943 accessor function for type.
3944 (Incremental_input_entry_reader::get_object_count): Likewise.
3945 (Incremental_input_entry_reader::get_object_offset): Likewise.
3946 (Incremental_input_entry_reader::get_member_count): Likewise.
3947 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3948 (Incremental_input_entry_reader::get_member_offset): Likewise.
3949 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3950 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3951 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3952 (Incremental_input_entry_reader::get_global_symbol_reader): New
3954 (Incremental_input_entry_reader::get_output_symbol_index): New
3956 (Incremental_input_entry_reader::type_): Remove.
3957 (Incremental_input_entry_reader::flags_): New data member.
3958 (Incremental_inputs_reader::input_file_offset): New function.
3959 (Incremental_inputs_reader::input_file_index): New function.
3960 (Incremental_inputs_reader::input_file): Call input_file_offset.
3961 (Incremental_inputs_reader::input_file_at_offset): New function.
3962 (Incremental_relocs_reader::get_r_type): Reformat.
3963 (Incremental_relocs_reader::get_r_shndx): Reformat.
3964 (Incremental_relocs_reader::get_r_offset): Reformat.
3965 (Incremental_relocs_reader::data): New function.
3966 (Incremental_binary::Incremental_binary): Initialize new data members.
3967 (Incremental_binary::check_inputs): Add cmdline parameter.
3968 (Incremental_binary::file_is_unchanged): Remove.
3969 (Input_reader::arg_serial): New function.
3970 (Input_reader::get_unused_symbol_count): New function.
3971 (Input_reader::get_unused_symbol): New function.
3972 (Input_reader::do_arg_serial): New function.
3973 (Input_reader::do_get_unused_symbol_count): New function.
3974 (Input_reader::do_get_unused_symbol): New function.
3975 (Incremental_binary::input_file_count): New function.
3976 (Incremental_binary::get_input_reader): Change signature to use
3977 index instead of filename.
3978 (Incremental_binary::file_has_changed): New function.
3979 (Incremental_binary::get_input_argument): New function.
3980 (Incremental_binary::get_library): New function.
3981 (Incremental_binary::get_script_info): New function.
3982 (Incremental_binary::init_layout): New function.
3983 (Incremental_binary::reserve_layout): New function.
3984 (Incremental_binary::output_file): New function.
3985 (Incremental_binary::do_check_inputs): New function.
3986 (Incremental_binary::do_file_is_unchanged): Remove.
3987 (Incremental_binary::do_file_has_changed): New function.
3988 (Incremental_binary::do_init_layout): New function.
3989 (Incremental_binary::do_reserve_layout): New function.
3990 (Incremental_binary::do_input_file_count): New function.
3991 (Incremental_binary::do_get_input_reader): Change signature.
3992 (Incremental_binary::input_args_map_): New data member.
3993 (Incremental_binary::library_map_): New data member.
3994 (Incremental_binary::script_map_): New data member.
3995 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3997 (Sized_incremental_binary::output_section): New function.
3998 (Sized_incremental_binary::inputs_reader): Add const.
3999 (Sized_incremental_binary::symtab_reader): Add const.
4000 (Sized_incremental_binary::relocs_reader): Add const.
4001 (Sized_incremental_binary::got_plt_reader): Add const.
4002 (Sized_incremental_binary::get_symtab_view): New function.
4003 (Sized_incremental_binary::Inputs_reader): New typedef.
4004 (Sized_incremental_binary::Input_entry_reader): New typedef.
4005 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4006 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4007 (Sized_incremental_binary::do_file_has_changed): New function.
4008 (Sized_incremental_binary::do_init_layout): New function.
4009 (Sized_incremental_binary::do_reserve_layout): New function.
4010 (Sized_input_reader::Inputs_reader): Remove.
4011 (Sized_input_reader::Input_entry_reader): Remove.
4012 (Sized_input_reader::do_arg_serial): New function.
4013 (Sized_input_reader::do_get_unused_symbol_count): New function.
4014 (Sized_input_reader::do_get_unused_symbol): New function.
4015 (Sized_incremental_binary::do_input_file_count): New function.
4016 (Sized_incremental_binary::do_get_input_reader): Change signature;
4017 use index instead of filename.
4018 (Sized_incremental_binary::section_map_): New data member.
4019 (Sized_incremental_binary::input_entry_readers_): New data member.
4020 (class Sized_incr_relobj): New class.
4021 (class Sized_incr_dynobj): New class.
4022 (make_sized_incremental_object): New function.
4023 (class Incremental_library): New class.
4024 * layout.cc (Free_list::num_lists): New static data member.
4025 (Free_list::num_nodes): New static data member.
4026 (Free_list::num_removes): New static data member.
4027 (Free_list::num_remove_visits): New static data member.
4028 (Free_list::num_allocates): New static data member.
4029 (Free_list::num_allocate_visits): New static data member.
4030 (Free_list::init): New function.
4031 (Free_list::remove): New function.
4032 (Free_list::allocate): New function.
4033 (Free_list::dump): New function.
4034 (Free_list::print_stats): New function.
4035 (Layout_task_runner::run): Resize output file for incremental updates.
4036 (Layout::Layout): Initialize new data members.
4037 (Layout::set_incremental_base): New function.
4038 (Layout::init_fixed_output_section): New function.
4039 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4040 incremental updates.
4041 (Layout::create_gold_note): Do not create gold note section for
4042 incremental updates.
4043 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4044 for incremental updates.
4045 (Layout::set_section_offsets): For incremental updates, allocate space
4047 (Layout::create_symtab_sections): Layout with offsets relative to
4048 start of section; for incremental updates, allocate space from free
4050 (Layout::create_shdrs): For incremental updates, allocate space from
4052 (Layout::finish_dynamic_section): For incremental updates, do not
4053 check --as-needed (fixed in subsequent patch).
4054 * layout.h (class Free_list): New class.
4055 (Layout::set_incremental_base): New function.
4056 (Layout::incremental_base): New function.
4057 (Layout::init_fixed_output_section): New function.
4058 (Layout::allocate): New function.
4059 (Layout::incremental_base_): New data member.
4060 (Layout::free_list_): New data member.
4061 * main.cc (main): Print Free_list statistics.
4062 * object.cc (Relobj::finalize_incremental_relocs): Add
4063 clear_counts parameter; clear counts only when clear_counts is set.
4064 (Sized_relobj::Sized_relobj): Initialize new base class.
4065 (Sized_relobj::do_layout): Don't report special sections.
4066 (Sized_relobj::do_for_all_local_got_entries): New function.
4067 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4068 symtab_off to all symbol table offsets.
4069 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4070 * object.h (class Got_offset_list): Move to top of file.
4071 (Object::Object): Allow case where input_file == NULL.
4072 (Object::~Object): Likewise.
4073 (Object::input_file): Assert that input_file != NULL.
4074 (Object::lock): Allow case where input_file == NULL.
4075 (Object::unlock): Likewise.
4076 (Object::is_locked): Likewise.
4077 (Object::token): Likewise.
4078 (Object::release): Likewise.
4079 (Object::is_incremental): New function.
4080 (Object::get_mtime): New function.
4081 (Object::for_all_local_got_entries): New function.
4082 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4083 (Object::set_is_in_system_directory): New function.
4084 (Object::is_in_system_directory): New function.
4085 (Object::do_is_incremental): New function.
4086 (Object::do_get_mtime): New function.
4087 (Object::do_for_all_local_got_entries): New function.
4088 (Object::is_in_system_directory_): New data member.
4089 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4090 (class Sized_relobj_base): New class.
4091 (class Sized_relobj): Derive from Sized_relobj_base.
4092 (class Sized_relobj::Symbols): Redeclare from base class.
4093 (class Sized_relobj::local_got_offset_list): Remove.
4094 (class Sized_relobj::Output_sections): Redeclare from base class.
4095 (class Sized_relobj::do_for_all_local_got_entries): New function.
4096 (class Sized_relobj::write_local_symbols): Add offset parameter.
4097 (class Sized_relobj::local_symbol_offset_): Update comment.
4098 (class Sized_relobj::local_dynsym_offset_): Update comment.
4099 * options.cc (Input_arguments::add_file): Remove const.
4100 * options.h (Input_file_argument::Input_file_argument):
4101 Initialize arg_serial_ (all constructors).
4102 (Input_file_argument::set_arg_serial): New function.
4103 (Input_file_argument::arg_serial): New function.
4104 (Input_file_argument::arg_serial_): New data member.
4105 (Input_arguments::Input_arguments): Initialize file_count_.
4106 (Input_arguments::add_file): Remove const.
4107 (Input_arguments::number_of_input_files): New function.
4108 (Input_arguments::file_count_): New data member.
4109 (Command_line::number_of_input_files): Call
4110 Input_arguments::number_of_input_files.
4111 * output.cc (Output_segment_headers::Output_segment_headers):
4113 (Output_section::Input_section::current_data_size): New function.
4114 (Output_section::Output_section): Initialize new data members.
4115 (Output_section::add_input_section): Don't do merge sections for
4116 an incremental link; allocate space from free list for an
4118 (Output_section::add_output_section_data): Allocate space from
4119 free list for an incremental update.
4120 (Output_section::update_data_size): New function.
4121 (Output_section::set_fixed_layout): New function.
4122 (Output_section::reserve): New function.
4123 (Output_segment::set_section_addresses): Remove const.
4124 (Output_segment::set_section_list_addresses): Remove const; allocate
4125 space from free list for an incremental update.
4126 (Output_segment::set_offset): Adjust size of RELRO segment for an
4128 * output.h (Output_data::current_data_size): Move here from
4130 (Output_data::pre_finalize_data_size): New function.
4131 (Output_data::update_data_size): New function.
4132 (Output_section_headers::update_data_size): new function.
4133 (Output_section_data_build::current_data_size): Move to Output_data.
4134 (Output_data_strtab::update_data_size): New function.
4135 (Output_section::current_data_size): Move to Output_data.
4136 (Output_section::set_fixed_layout): New function.
4137 (Output_section::has_fixed_layout): New function.
4138 (Output_section::reserve): New function.
4139 (Output_section::update_data_size): New function.
4140 (Output_section::has_fixed_layout_): New data member.
4141 (Output_section::free_list_): New data member.
4142 (Output_segment::set_section_addresses): Remove const.
4143 (Output_segment::set_section_list_addresses): Remove const.
4144 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4146 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4148 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4149 parameter when calling Add_symbols constructor; store argument
4150 serial number for members of a lib group.
4151 (Add_symbols::locks): Allow case where token == NULL.
4152 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4153 (Read_member::~Read_member): New function.
4154 (Read_member::is_runnable): New function.
4155 (Read_member::locks): New function.
4156 (Read_member::run): New function.
4157 (Check_script::~Check_script): New function.
4158 (Check_script::is_runnable): New function.
4159 (Check_script::locks): New function.
4160 (Check_script::run): New function.
4161 (Check_library::~Check_library): New function.
4162 (Check_library::is_runnable): New function.
4163 (Check_library::locks): New function.
4164 (Check_library::run): New function.
4165 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4166 (Add_symbols::library_): New data member.
4167 (class Read_member): New class.
4168 (class Check_script): New class.
4169 (class Check_library): New class.
4170 * reloc.cc (Read_relocs::is_runnable): Allow case where
4172 (Read_relocs::locks): Likewise.
4173 (Scan_relocs::locks): Likewise.
4174 (Relocate_task::locks): Likewise.
4175 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4177 (Sized_relobj::incremental_relocs_scan): Fix comment.
4178 (Sized_relobj::do_relocate): Pass output file offset to
4179 write_local_symbols.
4180 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4181 from class declaration.
4182 * script.cc (read_input_script): Allocate Script_info; pass
4183 argument serial number to report_script.
4184 * script.h (class Script_info): Move to incremental.h.
4185 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4186 * symtab.h (Symbol_table::add_from_incrobj): New function.
4187 (Symbol_table::set_file_offset): New function.
4189 2011-04-05 Cary Coutant <ccoutant@google.com>
4191 * incremental-dump.cc (dump_incremental_inputs): Change signature
4192 to take a Sized_incremental_binary; change caller. Use readers
4193 in Sized_incremental_binary.
4195 (Sized_incremental_binary::find_incremental_inputs_sections):
4196 Rename do_find_incremental_inputs_sections to this.
4197 (Sized_incremental_binary::setup_readers): New function.
4198 (Sized_incremental_binary::do_check_inputs): Check
4199 has_incremental_info_ flag; move setup code to setup_readers;
4201 (Sized_incremental_binary::do_file_is_unchanged): New function.
4202 (Sized_incremental_binary::do_get_input_reader): New function.
4203 * incremental.h (class Incremental_binary): Move to end of file.
4204 (Incremental_binary::file_is_unchanged): New function.
4205 (Incremental_binary::do_file_is_unchanged): New function.
4206 (Incremental_binary::Input_reader): New class.
4207 (Incremental_binary::get_input_reader): New function.
4208 (class Sized_incremental_binary): Move to end of file.
4209 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4210 input section reader classes.
4211 (Sized_incremental_binary::has_incremental_info): New function.
4212 (Sized_incremental_binary::inputs_reader): New function.
4213 (Sized_incremental_binary::symtab_reader): New function.
4214 (Sized_incremental_binary::relocs_reader): New function.
4215 (Sized_incremental_binary::got_plt_reader): New function.
4216 (Sized_incremental_binary::do_file_is_unchanged): New function.
4217 (Sized_incremental_binary::Sized_input_reader): New class.
4218 (Sized_incremental_binary::get_input_reader): New function.
4219 (Sized_incremental_binary::find_incremental_inputs_sections):
4220 Rename do_find_incremental_inputs_sections to this.
4221 (Sized_incremental_binary::setup_readers): New function.
4222 (Sized_incremental_binary::has_incremental_info_): New data member.
4223 (Sized_incremental_binary::inputs_reader_): New data member.
4224 (Sized_incremental_binary::symtab_reader_): New data member.
4225 (Sized_incremental_binary::relocs_reader_): New data member.
4226 (Sized_incremental_binary::got_plt_reader_): New data member.
4227 (Sized_incremental_binary::current_input_file_): New data member.
4229 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4232 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4235 2011-03-30 Cary Coutant <ccoutant@google.com>
4237 * archive.cc (Archive::include_member): Adjust call to report_object.
4238 (Add_archive_symbols::run): Add script_info to call to
4239 report_archive_begin.
4240 (Lib_group::include_member): Adjust call to report_object.
4241 (Add_lib_group_symbols::run): Adjust call to report_object.
4242 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4243 blocks. Add object count for script input files.
4244 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4245 script_info parameter; change all callers.
4246 (Incremental_inputs::report_object): Add script_info parameter;
4248 (Incremental_inputs::report_script): Store backpointer to
4249 incremental info entry.
4250 (Output_section_incremental_inputs::set_final_data_size): Record
4251 additional information for scripts.
4252 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4253 * incremental.h (Incremental_script_entry::add_object): New function.
4254 (Incremental_script_entry::get_object_count): New function.
4255 (Incremental_script_entry::get_object): New function.
4256 (Incremental_script_entry::objects_): New data member; adjust
4258 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4259 (Incremental_inputs::report_object): Add script_info parameter.
4260 (Incremental_inputs_reader::get_object_count): New function.
4261 (Incremental_inputs_reader::get_object_offset): New function.
4262 * options.cc (Input_arguments::add_file): Return reference to
4264 * options.h (Input_argument::set_script_info): New function.
4265 (Input_argument::script_info): New function.
4266 (Input_argument::script_info_): New data member; adjust all
4268 (Input_file_group::add_file): Return reference to new input argument.
4269 (Input_file_lib::add_file): Likewise.
4270 (Input_arguments::add_file): Likewise.
4271 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4272 * script.cc (Parser_closure::Parser_closure): Add script_info
4273 parameter; adjust all callers.
4274 (Parser_closure::script_info): New function.
4275 (Parser_closure::script_info_): New data member.
4276 (read_input_script): Report scripts earlier to incremental info.
4277 (script_add_file): Set script_info in Input_argument.
4278 (script_add_library): Likewise.
4279 * script.h (Script_options::Script_info): Rewrite class.
4281 2011-03-29 Cary Coutant <ccoutant@google.com>
4283 * archive.cc (Library_base::should_include_member): Move
4284 method here from class Archive.
4285 (Archive::Archive): Initialize base class.
4286 (Archive::should_include_member): Move to base class.
4287 (Archive::do_for_all_unused_symbols): New function.
4288 (Add_archive_symbols::run): Remove redundant access to
4290 (Lib_group::Lib_group): Initialize base class.
4291 (Lib_group::do_filename): New function.
4292 (Lib_group::include_member): Pass pointer to Lib_group to
4294 (Lib_group::do_for_all_unused_symbols): New function.
4295 (Add_lib_group_symbols::run): Report archive information for
4297 * archive.h (class Library_base): New base class.
4298 (class Archive): Derive from Library_base.
4299 (Archive::filename): Move to base class.
4300 (Archive::set_incremental_info): Likewise.
4301 (Archive::incremental_info): Likewise.
4302 (Archive::Should_include): Likewise.
4303 (Archive::should_include_member): Likewise.
4304 (Archive::Armap_entry): Remove.
4305 (Archive::Unused_symbol_iterator): Remove.
4306 (Archive::unused_symbols_begin): Remove.
4307 (Archive::unused_symbols_end): Remove.
4308 (Archive::do_filename): New function.
4309 (Archive::do_get_mtime): New function.
4310 (Archive::do_for_all_unused_symbols): New function.
4311 (Archive::task_): Move to base class.
4312 (Archive::incremental_info_): Likewise.
4313 (class Lib_group): Derive from Library_base.
4314 (Lib_group::do_filename): New function.
4315 (Lib_group::do_get_mtime): New function.
4316 (Lib_group::do_for_all_unused_symbols): New function.
4317 (Lib_group::task_): Move to base class.
4318 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4320 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4322 * incremental.cc (Incremental_inputs::report_archive_begin):
4323 Use Library_base; call library's get_mtime; add incremental inputs
4324 entry before members.
4325 (class Unused_symbol_visitor): New class.
4326 (Incremental_inputs::report_archive_end): Use Library_base; use
4327 visitor class to record unused symbols; don't add incremental inputs
4328 entry after members.
4329 (Incremental_inputs::report_object): Use Library_base.
4331 (Incremental_archive_entry::Incremental_archive_entry): Remove
4332 unused Archive parameter.
4333 (Incremental_inputs::report_archive_begin): Use Library_base.
4334 (Incremental_inputs::report_archive_end): Likewise.
4335 (Incremental_inputs::report_object): Likewise.
4336 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4338 * object.h (Object::for_all_global_symbols): New function.
4339 (Object::do_for_all_global_symbols): New function.
4340 (Sized_relobj::do_for_all_global_symbols): New function.
4341 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4343 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4346 2011-03-27 Ian Lance Taylor <iant@google.com>
4348 * archive.cc (Archive::interpret_header): Return -1 if something
4349 goes wrong. Change callers accordingly.
4351 2011-03-25 Cary Coutant <ccoutant@google.com>
4353 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4354 * testsuite/Makefile.in: Regenerate.
4356 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
4358 * plugin.cc (get_view): New.
4359 (Plugin::load): Pass get_view to the plugin.
4360 (Plugin_manager::get_view): New.
4362 2011-03-21 Ian Lance Taylor <iant@google.com>
4364 * testsuite/final_layout.sh: Rewrite to not use dc.
4365 * testsuite/relro_test.sh: Fail if dc is not present.
4367 2011-03-21 Sriraman Tallam <tmsriram@google.com>
4369 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4371 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4372 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4374 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4375 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4377 2011-03-14 Ian Lance Taylor <iant@google.com>
4379 * script-sections.cc (Sort_output_sections::script_compare):
4380 Rename from is_before, change return type.
4381 (Sort_output_sections::operator()): Adjust accordingly.
4383 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4386 * testsuite/odr_violation2.cc: Add comment to make all error line
4387 numbers double digits.
4388 * testsuite/debug_msg.sh: Adjust expected errors.
4390 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4392 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4393 but mark earlier ones as non-canonical
4394 (offset_to_iterator): Update search target and example
4395 (do_addr2line): Return extra lines in a vector*
4396 (format_file_lineno): Extract from do_addr2line
4397 (one_addr2line): Add vector* out-param
4398 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4399 when a lineno entry appeared last for its instruction
4400 (Dwarf_line_info): Add vector* out-param
4401 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4402 * symtab.cc (Odr_violation_compare): Include the lineno in the
4404 (linenos_from_loc): New. Combine the canonical line for an
4405 address with its other lines.
4406 (True_if_intersect): New. Helper functor to make
4407 std::set_intersection a query.
4408 (detect_odr_violations): Compare sets of lines instead of just
4409 one line for each function. This became less deterministic, but
4410 has fewer false positives.
4411 * symtab.h: Declarations.
4412 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4413 mix an optimized and non-optimized object in the same binary
4414 (odr_violation2.so): Same.
4415 * testsuite/Makefile.in: Regenerate from Makefile.am.
4416 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4417 * testsuite/debug_msg.sh: Update line numbers and add
4419 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4420 non-optimized context.
4421 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4422 isn't inlined, and use OdrDerived in an optimized context.
4423 * testsuite/odr_header1.h: Defines OdrDerived, where
4424 optimization will change the
4425 first-instruction-in-the-destructor's file and line number.
4426 * testsuite/odr_header2.h: Defines OdrBase.
4428 2011-03-09 Ian Lance Taylor <iant@google.com>
4430 * fileread.cc (File_read::clear_views): Don't delete the whole
4433 2011-03-08 Ian Lance Taylor <iant@google.com>
4436 * fileread.cc: #include <climits>.
4437 (GOLD_IOV_MAX): Define.
4438 (File_read::read_multiple): Limit number of entries by iov_max.
4439 * fileread.h (class File_read): Always set max_readv_entries to
4442 2011-03-07 Ian Lance Taylor <iant@google.com>
4445 * options.h (class General_options): Add -dy and -dn.
4447 2011-03-02 Cary Coutant <ccoutant@google.com>
4449 * testsuite/script_test_9.t: Add TLS segment.
4451 2011-03-02 Simon Baldwin <simonb@google.com>
4453 * configure.ac: Add check for gnu_indirect_function support in
4454 the toolchain building binutils.
4455 * configure: Rebuild.
4457 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
4459 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4460 plugin only symbols.
4461 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4462 in plugin files as not needed in the symbol table.
4464 2011-02-11 Sriraman Tallam <tmsriram@google.com>
4466 * output.cc (Output_section::add_input_section): Delay fill
4467 generation for section ordering.
4469 2011-02-09 Ian Lance Taylor <iant@google.com>
4472 * object.h (class Sized_relobj): Remove clear_local_symbols.
4473 * reloc.cc (Sized_relobj::do_relocate): Don't call
4474 clear_local_symbols.
4476 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
4478 * plugin.cc (is_visible_from_outside): Return true for symbols
4481 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4483 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4486 2011-02-02 Sriraman Tallam <tmsriram@google.com>
4488 * icf.h (is_section_foldable_candidate): Change type of parameter
4490 * icf.cc (Icf::find_identical_sections): Change type of local variable
4491 section_name to be std::string.
4492 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4494 2011-01-25 Ian Lance Taylor <iant@google.com>
4496 * script.cc (script_add_extern): Rewrite to use
4497 add_symbol_reference.
4499 2011-01-25 Doug Kwan <dougkwan@google.com>
4501 * icf.cc (get_section_contents): Always lock section's object.
4503 2011-01-24 Ian Lance Taylor <iant@google.com>
4505 * options.h (class General_options): Accept
4506 --no-detect-odr-violations.
4508 2011-01-24 Ian Lance Taylor <iant@google.com>
4510 * version.cc (version_string): Bump to 1.11.
4512 2011-01-24 Ian Lance Taylor <iant@google.com>
4514 * plugin.cc (class Plugin_rescan): Define new class.
4515 (Plugin_manager::claim_file): Set any_claimed_.
4516 (Plugin_manager::save_archive): New function.
4517 (Plugin_manager::save_input_group): New function.
4518 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4520 (Plugin_manager::new_undefined_symbol): New function.
4521 (Plugin_manager::rescan): New function.
4522 (Plugin_manager::rescannable_defines): New function.
4523 (Plugin_manager::add_input_file): Set any_added_.
4524 * plugin.h (class Plugin_manager): define new fields rescannable_,
4525 undefined_symbols_, any_claimed_, and any_added_. Declare
4526 Plugin_rescan as friend. Declare new functions.
4527 (Plugin_manager::Rescannable): Define type.
4528 (Plugin_manager::Rescannable_list): Define type.
4529 (Plugin_manager::Undefined_symbol_list): Define type.
4530 (Plugin_manager::Plugin_manager): Initialize new fields.
4531 * archive.cc (Archive::defines_symbol): New function.
4532 (Add_archive_symbols::run): Pass archive to plugins if any.
4533 * archive.h (class Archive): Declare defines_symbol.
4534 * readsyms.cc (Input_group::~Input_group): New function.
4535 (Finish_group::run): Pass input_group to plugins if any.
4536 * readsyms.h (class Input_group): Declare destructor.
4537 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4540 2011-01-10 Ian Lance Taylor <iant@google.com>
4542 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4544 (Layout::set_segment_offsets): Reset increase_relro before calling
4545 set_section_addresses a second time.
4547 2011-01-04 Cary Coutant <ccoutant@google.com>
4549 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4550 sections before NOBITS sections.
4552 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4554 * version.cc (print_version): Update copyright to 2011.
4556 2010-12-23 Cary Coutant <ccoutant@google.com>
4558 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4559 of OS to this->add. Add OD parameter to second form of the function.
4561 2010-12-20 Ian Lance Taylor <iant@google.com>
4563 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4564 second of two consecutive entries with same offset.
4566 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4568 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4569 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4570 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4571 to avoid unneeded links against $(LDADD).
4572 * testsuite/Makefile.in: Regenerate.
4574 2010-12-15 Ian Lance Taylor <iant@google.com>
4577 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4578 for R_X86_64_32 and R_X86_64_PC32.
4579 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4580 ver_matching_def_pic.o.
4581 (ver_matching_def_pic.o): New target.
4583 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4585 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4586 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4587 Move definition before File_read::View member definitions.
4588 (File_read::View::~View): Initialize and hold lock before
4589 updating current_mapped_bytes.
4591 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4593 * dwarf_reader.cc: Remove outdated comment.
4594 * gold-threads.cc: Fix typo in error message.
4595 * archive.cc: Fix typos in comments.
4596 * archive.h: Likewise.
4597 * arm-reloc-property.cc: Likewise.
4598 * arm-reloc-property.h: Likewise.
4599 * arm-reloc.def: Likewise.
4601 * attributes.h: Likewise.
4602 * cref.cc: Likewise.
4603 * ehframe.cc: Likewise.
4604 * fileread.h: Likewise.
4606 * i386.cc: Likewise.
4608 * incremental.h: Likewise.
4609 * int_encoding.cc: Likewise.
4610 * layout.h: Likewise.
4611 * main.cc: Likewise.
4612 * merge.h: Likewise.
4613 * object.cc: Likewise.
4614 * object.h: Likewise.
4615 * options.cc: Likewise.
4616 * readsyms.cc: Likewise.
4617 * reduced_debug_output.cc: Likewise.
4618 * reloc.cc: Likewise.
4619 * script-sections.cc: Likewise.
4620 * sparc.cc: Likewise.
4621 * symtab.h: Likewise.
4622 * target-reloc.h: Likewise.
4623 * target.cc: Likewise.
4624 * target.h: Likewise.
4625 * timer.cc: Likewise.
4626 * timer.h: Likewise.
4627 * x86_64.cc: Likewise.
4629 2010-12-09 Cary Coutant <ccoutant@google.com>
4631 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4633 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4634 parameter; change all callers.
4635 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4636 * options.h (warn_execstack): New option.
4638 2010-12-07 Doug Kwan <dougkwan@google.com>
4640 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4641 like function call relocations.
4643 2010-12-07 Ian Lance Taylor <iant@google.com>
4645 * archive.cc (Archive::get_elf_object_for_member): Permit
4646 punconfigured to be NULL.
4647 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4648 (Archive::include_member): Pass NULL to get_elf_object_for_member
4649 if we searched for the archive and this is the first included
4652 2010-12-01 Ian Lance Taylor <iant@google.com>
4654 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4655 track_relocs_type_ field.
4656 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4657 Set track_relocs_type_.
4658 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4659 contents when using RELA relocs.
4660 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4662 * reloc.cc (Track_relocs::next_addend): New function.
4663 * reloc.h (class Track_relocs): Declare next_addend.
4665 2010-12-01 Ian Lance Taylor <iant@google.com>
4667 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4670 2010-12-01 Ian Lance Taylor <iant@google.com>
4672 * README: Update compilers known to work and fail.
4674 2010-11-23 Matthias Klose <doko@ubuntu.com>
4676 * configure.in: For --enable-gold, handle value `default' instead of
4677 `both*'. Always install ld as ld.bfd, install as ld if gold is
4679 * configure: Regenerate.
4681 2010-11-18 Doug Kwan <dougkwan@google.com>
4683 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4684 and right_alignment to be zero. Store result alignment only if it is
4685 greater than existing alignment.
4687 2010-11-16 Cary Coutant <ccoutant@google.com>
4690 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4691 Check for ".zdebug_line".
4693 2010-11-16 Doug Kwan <dougkwan@google.com>
4694 Cary Coutant <ccoutant@google.com>
4696 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4697 by reference; adjust all callers.
4698 * output.cc (Output_segment::set_section_addresses): Adjust references
4699 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4701 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4702 end at page boundary.
4704 2010-11-16 Cary Coutant <ccoutant@google.com>
4707 * layout.cc (Layout::choose_output_section): Transform names of
4708 compressed sections even when using a script with a SECTIONS clause.
4709 (Layout::output_section_name): Remove code to transform
4710 compressed debug section names.
4711 * output.cc (Output_section::add_input_section): Use uncompressed
4712 section size when tracking input sections.
4714 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4716 * symtab.h (Symbol::NON_PIC_REF): Remove.
4717 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4718 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4719 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4720 (Symbol::use_plt_offset): Take a flags argument and pass it
4721 directly to needs_dynamic_reloc. Restrict check for undefined
4722 weak symbols to function calls.
4723 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4724 (Target_arm::Scan::global): Use it.
4725 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4726 (Target_arm::Relocate::relocate): Likewise.
4727 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4728 parameter with an r_type parameter. Use get_reference_flags
4730 (Target_arm::Relocate::relocate): Update accordingly.
4731 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4732 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4733 (Target_i386::Scan::global): Likewise.
4734 (Target_i386::Relocate::relocate): Likewise.
4735 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4736 parameter with an r_type parameter. Use get_reference_flags
4738 (Target_i386::Relocate::relocate): Update accordingly.
4739 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4740 (Target_powerpc::Scan::global): Use it.
4741 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4742 (Target_powerpc::Relocate::relocate): Likewise.
4743 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4744 (Target_sparc::Scan::global): Use it.
4745 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4746 (Target_sparc::Relocate::relocate): Likewise.
4747 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4748 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4749 (Target_x86_64::Scan::global): Likewise.
4750 (Target_x86_64::Relocate::relocate): Likewise.
4752 2010-11-08 Doug Kwan <dougkwan@google.com>
4753 Cary Coutant <ccoutant@google.com>
4755 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4756 (Arm_exidx_merge_section::section_contents_): New data member.
4757 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4758 (Arm_input_section::~Arm_input_section): De-allocate memory.
4759 (Arm_input_section::original_contents_): New data member.
4760 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4761 in parameters instead of calling Object::section_contents without
4763 (Arm_output_section::group_section): New parameter TASK. Pass it
4764 to callees that need locking objects.
4765 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4766 to lock EXIDX input sections. Fix a formatting issue. Call
4767 Arm_exidx_merged_section::build_contents to create merged section
4769 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4770 to lock object of stub table owner.
4771 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4772 TEXT_SIZE to initialize data member TEXT_SIZE_.
4773 (Arm_exidx_input_section::addralign): Fix typo in comment.
4774 (Arm_exidx_input_section::text_size): New method.
4775 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4776 that require locking objects. Lock objects before scanning for stubs
4777 and updating local symbols.
4778 (Arm_input_section<big_endian>::init): Copy contents of original
4780 (Arm_input_section<big_endian>::do_write): Use saved contents of
4781 original input section instead of calling Object::section_contents
4783 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4784 size without calling Object::section_size().
4785 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4786 for size. Allocate a buffer for merged EXIDX entries.
4787 (Arm_exidx_merged_section::build_contents): New method.
4788 (Arm_exidx_merged_section::do_write): Move merge section contents
4789 building code to Arm_exidx_merged_section::build_contetns. Write
4790 out contetns in buffer instead of building it on the fly.
4791 (Arm_relobj::make_exidx_input_section): Also pass text section size
4792 to Arm_exidx_input_section constructor.
4793 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4794 (Arm_dynobj::do_read_symbols): Fix memory leak.
4795 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4796 * target.h: (class Task): Add forward declaration.
4797 (Target::relax): Add new parameter TASK and pass it to
4799 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4801 2010-11-05 Cary Coutant <ccoutant@google.com>
4804 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4805 object when reading from the file.
4806 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4808 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4809 when reading section contents.
4810 (get_section_contents): Likewise.
4811 (icf::find_identical_sections): Likewise.
4812 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4813 object when reading from the file.
4814 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4815 the object when doing deferred section layout.
4817 2010-11-03 Nick Clifton <nickc@redhat.com>
4820 * script.h (class Symbol_assignment: name): New member. Returns
4821 the name of the symbol.
4822 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4823 Returns true if the given symbol name is on the list of
4824 assignments wating to be processed.
4825 * archive.cc (should_incldue_member): If the symbol is undefined,
4826 check to see if it is on the list of symbols pending assignment.
4828 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4830 * script-sections.cc (Script_sections::find_memory_region): Check
4831 for a NULL output section pointer.
4833 2010-10-29 Doug Kwan <dougkwan@google.com>
4835 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4836 Output_section::add_relaxed_input_section.
4837 * output.cc (Output_section::add_relaxed_input_section): Add new
4838 arguments LAYOUT and NAME. Set section order index.
4839 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4840 Copy section order index.
4841 * output.h (Output_section::add_relaxed_input_section): Add new
4842 arguments LAYOUT and NAME.
4844 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4846 * testsuite/Makefile.am: Move gcctestdir/ld rule to
4847 NATIVE_OR_CROSS_LINKER.
4848 * testsuite/Makefile.in: Regenerate.
4850 2010-10-20 Doug Kwan <dougkwan@google.com>
4852 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4853 without SHF_LINK_ORDER flags.
4854 * layout.cc (Layout::choose_output_section): Do not filter
4855 SHF_LINK_ORDER flag in a relocatable link.
4857 2010-10-17 Cary Coutant <ccoutant@google.com>
4859 * output.h (Output_segment::set_section_addresses): Change function
4860 signature. Update all callers.
4861 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4863 (Output_segment::set_section_addresses): Align after last TLS
4864 section. Add padding before last relro section instead of after.
4866 2010-10-17 Doug Kwan <dougkwan@google.com>
4868 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4869 GOT output section to be writable.
4871 2010-10-14 Cary Coutant <ccoutant@google.com>
4873 * debug.h (DEBUG_INCREMENTAL): New flag.
4874 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4875 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4877 * incremental.cc (report_command_line): Ignore all forms of
4879 * layout.cc (Layout::Layout): Check parameters for incremental link
4881 * options.cc (General_options::parse_incremental): New function.
4882 (General_options::parse_no_incremental): New function.
4883 (General_options::parse_incremental_full): New function.
4884 (General_options::parse_incremental_update): New function.
4885 (General_options::incremental_mode_): New data member.
4886 (General_options::finalize): Check incremental_mode_.
4887 * options.h (General_options): Update help text for --incremental.
4888 Add --no-incremental, --incremental-full, --incremental-update.
4889 (General_options::Incremental_mode): New enum type.
4890 (General_options::incremental_mode): New function.
4891 (General_options::incremental_mode_): New data member.
4892 * parameters.cc (Parameters::incremental_mode_): New data member.
4893 (Parameters::set_options): Set incremental_mode_.
4894 (Parameters::set_incremental_full): New function.
4895 (Parameters::incremental): New function.
4896 (Parameters::incremental_update): New function.
4897 (set_parameters_incremental_full): New function.
4898 * parameters.h (Parameters::set_incremental_full): New function.
4899 (Parameters::incremental): New function.
4900 (Parameters::incremental_update): New function.
4901 (Parameters::incremental_mode_): New data member.
4902 (set_parameters_incremental_full): New function.
4903 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4904 incremental link mode.
4905 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4906 (Sized_relobj::do_relocate_sections): Likewise.
4907 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4909 * testsuite/Makefile.in: Regenerate.
4910 * testsuite/incremental_test.sh: Filter all forms of --incremental.
4912 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4914 * script-sections.h (class Script_sections): Make
4915 Sections_elements typedef public.
4916 * script-sections.cc (class Sort_output_sections): Add elements_
4917 field. Add constructor which sets it; change all callers.
4918 (Sort_output_sections::is_before): New function.
4919 (Sort_output_sections::operator()): Call is_before.
4920 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4922 * testsuite/script_test_10.sh: New test. Test script section
4924 * testsuite/script_test_10.t: Likewise.
4925 * testsuite/script_test_10.s: Likewise.
4926 * testsuite/Makefile.am: Wrap the cross linker tests and the
4927 common tests into NATIVE_OR_CROSS_LINKER.
4928 (check_SCRIPTS): Add script_test_10.sh.
4929 (check_DATA): Add script_test_10.stdout.
4930 (script_test_10.o, script_test_10): New targets.
4931 (script_test_10.stdout): New target.
4932 * configure, testsuite/Makefile.in: Regenerate.
4934 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4936 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4937 error for the deprecated relocations.
4938 (Target_arm::Scan::global): Likewise.
4939 (Target_arm::Relocate::relocate): Likewise.
4941 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4943 * fileread.cc (Input_file::find_file): Initialize *found_name
4944 and *namep when using the fallback search for case 4.
4946 2010-10-11 Cary Coutant <ccoutant@google.com>
4948 * options.h (class General_options): Redefine -z lazy as an alias for
4949 the negation of -z now.
4951 2010-10-11 Ian Lance Taylor <iant@google.com>
4953 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4956 2010-10-06 Nick Clifton <nickc@redhat.com>
4958 * script-sections.cc(class Memory_region): Remove
4959 current_lma_offset_ field. Rename current_vma_offset_ to
4960 current_offset_. Add last_section_ field.
4961 (Memory_region::get_current_vma_address): Rename to
4962 get_current_address.
4963 (Memory_region::get_current_lma_address): Delete.
4964 (Memory_region::increment_vma_offset): Rename to
4966 (Memory_region::increment_lma_offset): Delete.
4967 (Memory_region::attributes_compatible): New method. Returns
4968 true if the provided section is compatible with the region.
4969 (Memory_region::get_last_section): New method. Returns the last
4970 section to use the region.
4971 (Memory_region::set_last_section): New method. Stores the last
4972 section to use the region.
4973 (Script_sections::block_in_region): New method. Returns true if
4974 a block of memory is contained within a region.
4975 (Script_sections::find_memory_region): New method. Locates a
4976 memory region to be used to set a VMA or LMA address.
4977 (Output_section_definition::set_section_addresses): Add code to
4978 check for addresses set by memory regions.
4979 (Output_segment::set_section_addresses): Remove memory region
4981 (Script_sections::create_segment): Add a warning if a header
4982 segment is created outside of any region.
4983 * script-sections.h (class Script_sections): Add prototypes for
4984 find_memory_region and block_in_region methods.
4985 * testsuite/memory_test.s: Use .long instead of .word.
4986 * testsuite/memory_test.t: Add some more output sections.
4987 * testsuite/memory_test.sh: Update expected output.
4989 2010-10-02 Doug Kwan <dougkwan@google.com>
4991 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4992 defintion to symtab.h
4993 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4994 declaration to defintion.
4996 2010-10-01 Nick Clifton <nickc@redhat.com>
4998 * expression.cc (eval): Replace dummy argument with NULL.
4999 (eval_maybe_dot): Check for a NULL result section pointer.
5000 (Symbol_expression::value): Likewise.
5001 (Dot_expression::value): Likewise.
5002 (BINARY_EXPRESSION): Likewise.
5003 (Max_expression::value): Likewise.
5004 (Min_expression::value): Likewise.
5005 (Absolute_expression::value): Likewise.
5006 (Addr_expression::value_from_output_section): Likewise.
5007 (Loaddddr_expression::value_from_output_section): Likewise.
5008 (Segment_start_expression::value): Likewise.
5009 * script-sections.cc
5010 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5012 (Sections_elememt_dot_assignment::set_section_addresses):
5014 (Output_data_expression::do_write_to_buffer): Likewise.
5015 (Output_section_definition::finalize_symbols): Likewise.
5016 (Output_section_definition::set_section_addresses): Likewise.
5018 2010-09-30 Doug Kwan <dougkwan@google.com>
5020 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5022 2010-09-28 Sriraman Tallam <tmsriram@google.com>
5024 * target.h (Target::can_icf_inline_merge_sections): New virtual
5026 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5028 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5030 * icf.cc (get_section_contents): Inline merge sections only when
5033 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5035 * configure: Regenerate.
5037 2010-09-17 Ian Lance Taylor <iant@google.com>
5039 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
5040 * testsuite/Makefile.am (memory_test.o): New target.
5041 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5043 * testsuite/Makefile.in: Rebuild.
5045 2010-09-17 Doug Kwan <dougkwan@google.com>
5047 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5048 defintion if relocation uses GOT entries of the symbol.
5049 * testsuite/icf_safe_test.sh: Fix test.
5050 * testsuite/icf_safe_so_test.sh: Fix test.
5052 2010-09-16 Cary Coutant <ccoutant@google.com>
5054 * script_sections.cc (class Memory_region): Remove "NULL" from
5055 vector initializations.
5057 2010-09-15 Cary Coutant <ccoutant@google.com>
5059 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5060 Resolve forwarding symbols.
5062 2010-09-15 Doug Kwan <dougkwan@google.com>
5064 * gold/testsuite/script_test_3.t: Add ARM special sections.
5065 * gold/testsuite/script_test_4.t: Same.
5066 * gold/testsuite/script_test_5.t: Same.
5067 * gold/testsuite/script_test_6.t: Same.
5068 * gold/testsuite/script_test_7.t: Same.
5069 * gold/testsuite/script_test_7.t: Same.
5070 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5072 2010-09-14 Cary Coutant <ccoutant@google.com>
5074 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5075 (Target_x86_64::Relocate::relocate_tls): Replace check for
5076 saw_tls_block_reloc_ with test for executable section.
5078 2010-09-12 Cary Coutant <ccoutant@google.com>
5080 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5081 position-independent executables to shared libraries need dynamic
5083 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5084 position-independent executables.
5085 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5086 * testsuite/Makefile.in: Regenerate.
5088 2010-09-10 Nick Clifton <nickc@redhat.com>
5091 * testsuite/memory_test.t: Discard any sections that are not
5094 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5097 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5098 "This::" to work around a bug in gcc 4.2.
5100 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5102 2010-09-09 Rafael Espindola <espindola@google.com>
5104 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5105 sections with different PF_X flags in the same segment.
5106 (Layout::find_first_load_seg): Search all segments to find the first
5108 * options.h (rosegment): New.
5110 2010-09-08 Rafael Espindola <espindola@google.com>
5112 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
5114 2010-09-08 Doug Kwan <dougkwan@google.com>
5116 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5117 (Arm_relobj::do_relocate_sections): Add new parameter for output
5118 file to match the parent.
5119 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5120 of local symbols instead of input values. Update code to track
5121 changes in gold::relocate_section.
5122 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5123 (Sized_relobj::compute_final_local_value_internal): New methods.
5124 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5125 body into private version of Sized_relobj::compute_final_local_value.
5126 Call the inline method.
5127 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5128 merged symbol value if there is one.
5129 (Symbol_value::has_output_value): New method defintiion.
5130 (Sized_relobj::Compute_final_local_value_status): New enum type.
5131 (Sized_relobj::compute_final_local_value): New methods.
5132 (Sized_relobj::compute_final_local_value_internal): New methods.
5133 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5134 and arm_cortex_a8.sh.
5135 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5136 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5138 * Makefile.in: Regenerate.
5139 * testsuite/arm_bl_out_of_range.s: Update test.
5140 * testsuite/thumb_bl_out_of_range.s: Ditto.
5141 * testsuite/thumb_blx_out_of_range.s: Ditto.
5142 * testsuite/arm_branch_out_of_range.sh: New file.
5143 * testsuite/arm_cortex_a8.sh: Ditto.
5144 * testsuite/arm_cortex_a8_b.s: Ditto.
5145 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5146 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5147 * testsuite/arm_cortex_a8_bl.s: Ditto.
5148 * testsuite/arm_cortex_a8_blx.s: Ditto.
5149 * testsuite/arm_cortex_a8_local.s: Ditto.
5150 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5151 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5153 2010-09-08 Rafael Espindola <espindola@google.com>
5155 * Makefile.am (memory_test.stdout): Run readelf with -W.
5156 * Makefile.in: Regenerate.
5157 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5160 2010-09-08 Rafael Espindola <espindola@google.com>
5162 * script-sections.cc (Script_sections::add_memory_region): Convert
5163 field precision to int.
5164 * script.cc (script_set_section_region, script_set_section_region):
5165 Convert field precision to int.
5167 2010-09-08 Rafael Espindola <espindola@google.com>
5169 * arm.cc (do_finalize_sections): Create the __exidx_start and
5170 __exdix_end symbols even when the section is missing.
5172 2010-09-08 Nick Clifton <nickc@redhat.com>
5174 * README: Remove claim that MEMORY is not supported.
5175 * expression.cc (script_exp_function_origin)
5176 (script_exp_function_length): Move from here to ...
5177 * script.cc: ... here.
5178 (script_set_section_region, script_add_memory)
5179 (script_parse_memory_attr, script_include_directive): New
5181 * script-sections.cc
5182 (class Memory_region): New class.
5183 (class Output_section_definition): Add set_memory_region,
5184 set_section_vma, set_section_lma and get_section_name methods.
5185 (class Script_Sections): Add add_memory_region,
5186 find_memory_region, find_memory_region_origin,
5187 find_memory_region_length and set_memory_region methods.
5188 Have set_section_addresses method walk the list of set memory
5190 Extend the print methos to display memory regions.
5191 * script-sections.h: Add prototypes for new methods.
5192 Add enum for MEMORY region attributes.
5193 * yyscript.y: Add support for parsing MEMORY regions.
5194 * script-c.h: Add prototypes for new functions.
5195 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5196 * testsuite/Makefile.in: Regenerate.
5197 * testsuite/memory_test.sh: New script.
5198 * testsuite/memory_test.s: New assembler source file.
5199 * testsuite/memory_test.t: New linker script.
5201 2010-08-27 Doug Kwan <dougkwan@google.com>
5203 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5204 reference override an existing dynamic weak reference.
5205 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5206 * testsuite/Makefile.in: Regenerate.
5207 * testsuite/dyn_weak_ref.sh: New file.
5208 * testsuite/dyn_weak_ref_1.c: Ditto.
5209 * testsuite/dyn_weak_ref_2.c: Ditto.
5211 2010-08-27 Ian Lance Taylor <iant@google.com>
5213 * incremental.h (class Incremental_input_entry): Add virtual
5216 2010-08-27 Ian Lance Taylor <iant@google.com>
5218 * testsuite/start_lib_test_3.c: Mark t3 as used.
5220 2010-08-27 Nick Clifton <nickc@redhat.com>
5222 * options.cc (version_script): Fix small typo in previous
5225 2010-08-25 Nick Clifton <nickc@redhat.com>
5227 * archive.cc: Formatting fixes: Remove whitespace between
5228 typename and following asterisk. Remove whitespace between
5229 function name and opening parenthesis.
5230 * archive.h: Likewise.
5232 * attributes.cc: Likewise.
5233 * attributes.h: Likewise.
5234 * common.cc: Likewise.
5235 * copy-relocs.cc: Likewise.
5236 * dirsearch.h: Likewise.
5237 * dynobj.cc: Likewise.
5238 * ehframe.cc: Likewise.
5239 * ehframe.h: Likewise.
5240 * expression.cc: Likewise.
5241 * fileread.cc: Likewise.
5242 * fileread.h: Likewise.
5244 * gold-threads.cc: Likewise.
5245 * gold.cc: Likewise.
5246 * i386.cc: Likewise.
5248 * incremental-dump.cc: Likewise.
5249 * incremental.cc: Likewise.
5250 * layout.cc: Likewise.
5251 * layout.h: Likewise.
5252 * main.cc: Likewise.
5253 * merge.cc: Likewise.
5254 * merge.h: Likewise.
5255 * object.cc: Likewise.
5256 * object.h: Likewise.
5257 * options.cc: Likewise.
5258 * options.h: Likewise.
5259 * output.cc: Likewise.
5260 * output.h: Likewise.
5261 * plugin.cc: Likewise.
5262 * plugin.h: Likewise.
5263 * powerpc.cc: Likewise.
5264 * reloc.cc: Likewise.
5265 * script-c.h: Likewise.
5266 * script-sections.cc: Likewise.
5267 * script.cc: Likewise.
5268 * stringpool.cc: Likewise.
5269 * symtab.cc: Likewise.
5270 * symtab.h: Likewise.
5271 * target.cc: Likewise.
5272 * timer.cc: Likewise.
5273 * timer.h: Likewise.
5274 * version.cc: Likewise.
5275 * x86_64.cc: Likewise.
5277 2010-08-24 Nick Clifton <nickc@redhat.com>
5280 * layout.cc (segment_precedes): Sort segments by their physical
5281 addresses, if they have been set.
5283 2010-08-23 Cary Coutant <ccoutant@google.com>
5285 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5287 (Lib_group::include_member): Unlock object after deleting its
5289 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5292 2010-08-19 Neil Vachharajani <nvachhar@google.com>
5293 Cary Coutant <ccoutant@google.com>
5295 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5296 constructor, and set_blocker.
5297 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5299 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5300 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5301 * testsuite/Makefile.am (start_lib_test): New test case.
5302 * testsuite/Makefile.in: Regenerate.
5303 * testsuite/start_lib_test_main.c: New file.
5304 * testsuite/start_lib_test_1.c: New file.
5305 * testsuite/start_lib_test_2.c: New file.
5306 * testsuite/start_lib_test_3.c: New file.
5308 2010-08-19 Ian Lance Taylor <iant@google.com>
5310 * Makefile.in: Rebuild with automake 1.11.1.
5311 * aclocal.m4: Likewise.
5312 * testsuite/Makefile.in: Likewise.
5314 2010-08-19 Ian Lance Taylor <iant@google.com>
5317 * i386.cc (class Output_data_plt_i386): Update declarations.
5318 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5319 local_ifuncs_ fields.
5320 (Target_i386::do_plt_section_for_global): New function.
5321 (Target_i386::do_plt_section_for_local): New function.
5322 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5323 parameter; change all callers. Initialize global_ifuncs_ and
5324 local_ifuncs_. If doing a static link define __rel_iplt_start and
5326 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5327 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5328 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5330 (Target_i386::make_plt_section): New function, broken out of
5331 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5332 (Target_i386::make_plt_entry): Call make_plt_section.
5333 (Target_i386::make_local_ifunc_plt_entry): New function.
5334 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5335 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5336 R_386_IRELATIVE to switch.
5337 (Target_i386::Scan::global): Likewise.
5338 (Target_i386::Relocate::relocate): Likewise.
5339 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5341 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5342 (Target_x86_64::do_plt_section_for_global): New function.
5343 (Target_x86_64::do_plt_section_for_local): New function.
5344 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5345 parameter; change all callers. If doing a static link define
5346 __rela_iplt_start and __rela_iplt_end.
5347 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5348 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5349 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5351 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5352 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5354 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5355 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5356 R_X86_64_IRELATIVE to switch.
5357 (Target_x86_64::Scan::global): Likewise.
5358 (Target_x86_64::Relocate::relocate): Likewise.
5359 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5361 * target.h (class Target): Add plt_section_for_global and
5362 plt_section_for_local functions. Add do_plt_section_for_global
5363 and do_plt_section_for_local virtual functions.
5364 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5365 clarifying comments.
5366 (Symbol::use_plt_offset): Handle IFUNC symbol.
5367 * object.cc (Sized_relobj::Sized_relobj): Initialize
5369 (Sized_relobj::local_has_plt_offset): New function.
5370 (Sized_relobj::local_plt_offset): New function.
5371 (Sized_relobj::set_local_plt_offset): New function.
5372 (Sized_relobj::do_count): Handle IFUNC symbol.
5373 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5374 a bit away from input_shndx_ field. Add set_is_func_symbol and
5375 is_ifunc_symbol functions.
5376 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5377 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5378 local_plt_offsets_ field.
5379 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5380 * output.h (class Output_section_data): Add non-const
5381 output_section function.
5382 (class Output_data_got): Update declarations.
5383 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5384 Add use_plt_offset parameter to global and local constructors.
5385 Change all callers. Change local_sym_index_ field to 31 bits.
5386 Change GSYM_CODE and CONSTANT_CODE accordingly.
5387 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5388 doing a static link don't set sh_link field.
5389 (Output_data_got::Got_entry::write): Use PLT offset if
5391 (Output_data_got::add_global_plt): New function.
5392 (Output_data_got::add_local_plt): New function.
5393 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5394 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5395 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5396 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5397 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5399 * testsuite/ifunc-sel.h: New file.
5400 * testsuite/ifuncmain1.c: New file.
5401 * testsuite/ifuncmain1vis.c: New file.
5402 * testsuite/ifuncmod1.c: New file.
5403 * testsuite/ifuncdep2.c: New file.
5404 * testsuite/ifuncmain2.c: New file.
5405 * testsuite/ifuncmain3.c: New file.
5406 * testsuite/ifuncmod3.c: New file.
5407 * testsuite/ifuncmain4.c: New file.
5408 * testsuite/ifuncmain5.c: New file.
5409 * testsuite/ifuncmod5.c: New file.
5410 * testsuite/ifuncmain6pie.c: New file.
5411 * testsuite/ifuncmod6.c: New file.
5412 * testsuite/ifuncmain7.c: New file.
5413 * configure, testsuite/Makefile.in: Rebuild.
5415 2010-08-18 Ian Lance Taylor <iant@google.com>
5418 (Output_section_incremental_inputs::write_input_files): Add cast
5419 to avoid signed/unsigned comparison warning.
5420 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5422 2010-08-12 Cary Coutant <ccoutant@google.com>
5424 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5426 2010-08-13 Ian Lance Taylor <iant@google.com>
5428 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5430 2010-08-12 Cary Coutant <ccoutant@google.com>
5431 Doug Kwan <dougkwan@google.com>
5433 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5434 defintion overrides non-weak undef, remember that the original undef
5436 * symtab.cc (Symbol_table::sized_write_global): For undef without
5437 an original weak binding, set binding to global in output.
5438 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5439 * testsuite/Makefile.in: Regenerate.
5440 * testsuite/strong_ref_weak_def.sh: New file.
5441 * testsuite/strong_ref_weak_def_1.c: Ditto.
5442 * testsuite/strong_ref_weak_def_2.c: Ditto.
5444 2010-08-12 Cary Coutant <ccoutant@google.com>
5446 * testsuite/incremental_test.sh: Rewrite.
5447 * testsuite/incremental_test_1.c: Rewrite.
5448 * testsuite/incremental_test_2.c: Rewrite.
5450 2010-08-12 Cary Coutant <ccoutant@google.com>
5452 * arm.cc (Target_arm::got_size): Add const.
5453 (Target_arm::got_entry_count): New function.
5454 (Target_arm::plt_entry_count): New function.
5455 (Target_arm::first_plt_entry_offset): New function.
5456 (Target_arm::plt_entry_size): New function.
5457 (Output_data_plt_arm::entry_count): New function.
5458 (Output_data_plt_arm::first_plt_entry_offset): New function.
5459 (Output_data_plt_arm::get_plt_entry_size): New function.
5460 * i386.cc (Target_i386::got_size): Add const.
5461 (Target_i386::got_entry_count): New function.
5462 (Target_i386::plt_entry_count): New function.
5463 (Target_i386::first_plt_entry_offset): New function.
5464 (Target_i386::plt_entry_size): New function.
5465 (Output_data_plt_i386::entry_count): New function.
5466 (Output_data_plt_i386::first_plt_entry_offset): New function.
5467 (Output_data_plt_i386::get_plt_entry_size): New function.
5468 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5469 find_incremental_inputs_sections. Dump incremental_got_plt section.
5470 * incremental.cc: Include target.h.
5471 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5472 parameter. Adjust all callers. Find incremental_got_plt section.
5473 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5475 (Output_section_incremental_inputs::set_final_data_size): Calculate
5476 size of incremental_got_plt section.
5477 (Output_section_incremental_inputs::do_write): Write the
5478 incremental_got_plt section.
5479 (Got_plt_view_info): New struct.
5480 (Local_got_offset_visitor): New class.
5481 (Global_got_offset_visitor): New class.
5482 (Global_symbol_visitor_got_plt): New class.
5483 (Output_section_incremental_inputs::write_got_plt): New function.
5484 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5485 Add parameter. Adjust all callers.
5486 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5487 (Incremental_inputs::got_plt_section): New function.
5488 (Incremental_inputs::got_plt_section_): New data member.
5489 (Incremental_got_plt_reader): New class.
5490 * layout.cc (Layout::create_incremental_info_sections): Add the
5491 incremental_got_plt section.
5492 * object.h (Got_offset_list::get_list): New function.
5493 (Got offset_list::for_all_got_offsets): New function.
5494 (Sized_relobj::local_got_offset_list): New function.
5495 * powerpc.cc (Target_powerpc::got_size): Add const.
5496 (Target_powerpc::got_entry_count): New function.
5497 (Target_powerpc::plt_entry_count): New function.
5498 (Target_powerpc::first_plt_entry_offset): New function.
5499 (Target_powerpc::plt_entry_size): New function.
5500 (Output_data_plt_powerpc::entry_count): New function.
5501 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5502 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5503 * sparc.cc (Target_sparc::got_size): Add const.
5504 (Target_sparc::got_entry_count): New function.
5505 (Target_sparc::plt_entry_count): New function.
5506 (Target_sparc::first_plt_entry_offset): New function.
5507 (Target_sparc::plt_entry_size): New function.
5508 (Output_data_plt_sparc::entry_count): New function.
5509 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5510 (Output_data_plt_sparc::get_plt_entry_size): New function.
5511 * symtab.h (Symbol::got_offset_list): New function.
5512 (Symbol_table::for_all_symbols): New function.
5513 * target.h (Sized_target::got_entry_count): New function.
5514 (Sized_target::plt_entry_count): New function.
5515 (Sized_target::plt_entry_size): New function.
5516 * x86_64.cc (Target_x86_64::got_size): Add const.
5517 (Target_x86_64::got_entry_count): New function.
5518 (Target_x86_64::plt_entry_count): New function.
5519 (Target_x86_64::first_plt_entry_offset): New function.
5520 (Target_x86_64::plt_entry_size): New function.
5521 (Output_data_plt_x86_64::entry_count): New function.
5522 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5523 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5525 2010-08-12 Cary Coutant <ccoutant@google.com>
5527 * archive.cc: Include incremental.h.
5528 (Archive::Archive): Initialize incremental_info_.
5529 (Archive::include_member): Record archive members in incremental info.
5530 (Add_archive_symbols::run): Record begin and end of an archive in
5532 (Lib_group::include_member): Record objects in incremental info.
5533 * archive.h (Incremental_archive_entry): Forward declaration.
5534 (Archive::set_incremental_info): New member function.
5535 (Archive::incremental_info): New member function.
5536 (Archive::Unused_symbol_iterator): New class.
5537 (Archive::unused_symbols_begin): New member function.
5538 (Archive::unused_symbols_end): New member function.
5539 (Archive::incremental_info_): New data member.
5540 * incremental-dump.cc (find_input_containing_global): New function.
5541 (dump_incremental_inputs): Dump new incremental info sections.
5542 * incremental.cc: Include symtab.h.
5543 (Output_section_incremental_inputs): New class.
5544 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5545 new incremental info sections.
5546 (Sized_incremental_binary::do_check_inputs): Likewise.
5547 (Incremental_inputs::report_archive): Remove.
5548 (Incremental_inputs::report_archive_begin): New function.
5549 (Incremental_inputs::report_archive_end): New function.
5550 (Incremental_inputs::report_object): New function.
5551 (Incremental_inputs::finalize_inputs): Remove.
5552 (Incremental_inputs::report_input_section): New function.
5553 (Incremental_inputs::report_script): Rewrite.
5554 (Incremental_inputs::finalize): Do nothing but finalize string table.
5555 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5556 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5557 (Incremental_inputs::create_data_sections): New function.
5558 (Incremental_inputs::relocs_entsize): New function.
5559 (Output_section_incremental_inputs::set_final_data_size): New function.
5560 (Output_section_incremental_inputs::do_write): New function.
5561 (Output_section_incremental_inputs::write_header): New function.
5562 (Output_section_incremental_inputs::write_input_files): New function.
5563 (Output_section_incremental_inputs::write_info_blocks): New function.
5564 (Output_section_incremental_inputs::write_symtab): New function.
5565 * incremental.h (Incremental_script_entry): Forward declaration.
5566 (Incremental_object_entry): Forward declaration.
5567 (Incremental_archive_entry): Forward declaration.
5568 (Incremental_inputs): Forward declaration.
5569 (Incremental_inputs_header_data): Remove.
5570 (Incremental_inputs_header): Remove.
5571 (Incremental_inputs_header_write): Remove.
5572 (Incremental_inputs_entry_data): Remove.
5573 (Incremental_inputs_entry): Remove.
5574 (Incremental_inputs_entry_write): Remove.
5575 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5576 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5577 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5578 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5580 (Incremental_input_entry): New class.
5581 (Incremental_script_entry): New class.
5582 (Incremental_object_entry): New class.
5583 (Incremental_archive_entry): New class.
5584 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5585 (Incremental_inputs::report_inputs): Remove.
5586 (Incremental_inputs::report_archive): Remove.
5587 (Incremental_inputs::report_archive_begin): New function.
5588 (Incremental_inputs::report_archive_end): New function.
5589 (Incremental_inputs::report_object): Change prototype.
5590 (Incremental_inputs::report_input_section): New function.
5591 (Incremental_inputs::report_script): Change prototype.
5592 (Incremental_inputs::get_reloc_count): New function.
5593 (Incremental_inputs::set_reloc_count): New function.
5594 (Incremental_inputs::create_data_sections): New function.
5595 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5596 (Incremental_inputs::inputs_section): New function.
5597 (Incremental_inputs::symtab_section): New function.
5598 (Incremental_inputs::relocs_section): New function.
5599 (Incremental_inputs::get_stringpool): Add const.
5600 (Incremental_inputs::command_line): Add const.
5601 (Incremental_inputs::inputs): Remove.
5602 (Incremental_inputs::command_line_key): New function.
5603 (Incremental_inputs::input_file_count): New function.
5604 (Incremental_inputs::input_files): New function.
5605 (Incremental_inputs::relocs_entsize): New function.
5606 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5607 (Incremental_inputs::finalize_inputs): Remove.
5608 (Incremental_inputs::Input_info): Remove.
5609 (Incremental_inputs::lock_): Remove.
5610 (Incremental_inputs::inputs_): Change type.
5611 (Incremental_inputs::inputs_map_): Remove.
5612 (Incremental_inputs::current_object_entry_): New data member.
5613 (Incremental_inputs::inputs_section_): New data member.
5614 (Incremental_inputs::symtab_section_): New data member.
5615 (Incremental_inputs::relocs_section_): New data member.
5616 (Incremental_inputs::reloc_count_): New data member.
5617 (Incremental_inputs_reader): New class.
5618 (Incremental_symtab_reader): New class.
5619 (Incremental_relocs_reader): New class.
5620 * layout.cc (Layout::finalize): Move finalization of incremental info
5621 and creation of incremental info sections to follow finalization of
5622 symbol table. Set offsets for postprocessing sections.
5623 (Layout::create_incremental_info_sections): Call
5624 Incremental_inputs::create_data_sections. Add incremental symtab
5625 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5626 sections to layout after input sections.
5627 * layout.h (struct Timespec): Forward declaration.
5628 (Layout::incremental_inputs): Add const.
5629 (Layout::create_incremental_info_sections): Add parameter.
5630 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5631 * object.cc: Include incremental.h.
5632 (Relobj::finalize_incremental_relocs): New function.
5633 (Sized_relobj::do_layout): Record input sections in incremental info.
5634 * object.h (Object::output_section): New function.
5635 (Object::output_section_offset): Moved from Relobj.
5636 (Object::get_incremental_reloc_base): New function.
5637 (Object::get_incremental_reloc_count): New function.
5638 (Object::do_output_section): New function.
5639 (Object::do_output_section_offset): Moved from Relobj.
5640 (Object::do_get_incremental_reloc_base): New function.
5641 (Object::do_get_incremental_reloc_count): New function.
5642 (Object::Object): Initialize new data members.
5643 (Relobj::output_section): Renamed do_output_section and moved to
5645 (Relobj::output_section_offset): Moved to Object.
5646 (Relobj::do_get_incremental_reloc_base): New function.
5647 (Relobj::do_get_incremental_reloc_count): New function.
5648 (Relobj::allocate_incremental_reloc_counts): New function.
5649 (Relobj::count_incremental_reloc): New function.
5650 (Relobj::finalize_incremental_relocs): New function.
5651 (Relobj::next_incremental_reloc_index): New function.
5652 (Relobj::reloc_counts_): New data member.
5653 (Relobj::reloc_bases_): New data member.
5654 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5655 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5656 (Sized_relobj::incremental_relocs_scan): New function.
5657 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5658 (Sized_relobj::incremental_relocs_write): New function.
5659 (Sized_relobj::incremental_relocs_write_reltype): New function.
5660 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5662 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5663 archives and object files elsewhere.
5664 (Add_symbols::run): Report object files here.
5665 (Finish_group::run): Report end of archive at end of group.
5666 * reloc.cc: Include layout.h, incremental.h.
5667 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5668 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5669 (Sized_relobj::incremental_relocs_scan): New function.
5670 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5671 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5672 (Sized_relobj::incremental_relocs_write): New function.
5673 (Sized_relobj::incremental_relocs_write_reltype): New function.
5674 * script.cc (read_input_script): Rewrite test for incremental link.
5675 Change call to Incremental_inputs::report_script.
5676 * symtab.h (Symbol_table::first_global_index): New function.
5677 (Symbol_table::output_count): New function.
5679 2010-08-12 Doug Kwan <dougkwan@google.com>
5681 * arm.cc (Target_arm::merge_object_attributes): Check command line
5682 options --no-wchar-size-warning and --no-enum-size-warning.
5683 * options.h (General_options): Add ld-compatible options
5684 --no-enum-size-warning and --no-wchar-size-warning.
5686 2010-08-04 Ian Lance Taylor <iant@google.com>
5688 * x86_64.cc (Target_x86_64::Scan::local): Use
5689 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5690 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5691 (Target_x86_64::Scan::global): Likewise.
5692 (Target_x86_64::Relocate::relocate): Likewise.
5693 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5696 2010-08-03 Cary Coutant <ccoutant@google.com>
5698 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5699 to reserve space in merged_strings vector. Keep total input size
5701 (Output_merge_string::do_print_merge_stats): Print total input size.
5702 * merge.h (Output_merge_string): Add input_size_ field.
5703 * stringpool.cc (Stringpool_template::string_length): Move
5704 implementations out of Stringpool_template class and place in
5706 * stringpool.h (string_length): Move out of Stringpool_template.
5708 2010-08-03 Ian Lance Taylor <iant@google.com>
5711 * layout.cc (relaxation_loop_body): If address of load segment is
5712 set, adjust address to include headers if possible.
5714 2010-08-03 Ian Lance Taylor <iant@google.com>
5716 * version.cc (version_string): Bump to 1.10.
5718 2010-08-03 Ian Lance Taylor <iant@google.com>
5721 * layout.h (enum Output_section_order): Define.
5722 (class Layout): Update declarations.
5723 * layout.cc (Layout::get_output_section): Add order parameter.
5724 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5725 is_first_non_relro parameters. Change all callers.
5726 (Layout::choose_output_section): Likewise.
5727 (Layout::add_output_section_data): Likewise.
5728 (Layout::make_output_section): Likewise. Set order.
5729 (Layout::default_section_order): New function.
5730 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5731 * output.cc (Output_section::Output_section): Initialize order_.
5732 Don't initialize deleted fields.
5733 (Output_segment::Output_segment): Don't initialize deleted
5735 (Output_segment::add_output_section_to_load): New function
5736 replacing add_output_section. Change all callers to call this or
5737 add_output_section_to_nonload.
5738 (Output_segment::add_output_section_to_nonload): New function.
5739 (Output_segment::remove_output_section): Rewrite.
5740 (Output_segment::add_initial_output_data): Likewise.
5741 (Output_segment::has_any_data_sections): Likewise.
5742 (Output_segment::is_first_section_relro): Likewise.
5743 (Output_segment::maximum_alignment): Likewise.
5744 (Output_segment::has_dynamic_reloc): New function replacing
5745 dynamic_reloc_count. Change all callers.
5746 (Output_segment::has_dynamic_reloc_list): New function replacing
5747 dynamic_reloc_count_list. Change all callers.
5748 (Output_segment::set_section_addresses): Rewrite.
5749 (Output_segment::set_offset): Rewrite.
5750 (Output_segment::find_first_and_last_list): Remove.
5751 (Output_segment::set_tls_offsets): Rewrite.
5752 (Output_segment::first_section_load_address): Likewise.
5753 (Output_segment::output_section_count): Likewise.
5754 (Output_segment::section_with_lowest_load_address): Likewise.
5755 (Output_segment::write_section_headers): Likewise.
5756 (Output_segment::print_sections_to_map): Likewise.
5757 * output.h (class Output_data): Remove dynamic_reloc_count_
5758 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5759 (Output_data::add_dynamic_reloc): Rewrite.
5760 (Output_data::has_dynamic_reloc): New function.
5761 (Output_data::dynamic_reloc_count): Remove.
5762 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5763 is_last_relro_, is_first_non_relro_, is_interp_,
5764 is_dynamic_linker_section_ fields. Add order and set_order
5765 functions. Remove is_relro_local, set_is_relro_local,
5766 is_last_relro, set_is_last_relro, is_first_non_relro,
5767 set_is_first_non_relro functions, is_interp, set_is_interp,
5768 is_dynamic_linker_section, and set_is_dynamic_linker_section
5770 (class Output_segment): Change Output_data_list from std::list to
5771 std:;vector. Add output_lists_ field. Remove output_data_ and
5772 output_bss_ fields. Update declarations.
5774 2010-08-02 Ian Lance Taylor <iant@google.com>
5776 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5777 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5778 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5780 2010-08-02 Ian Lance Taylor <iant@google.com>
5783 * script.cc (Script_options::Script_options): Initialize
5784 symbol_definitions_ and symbol_references_.
5785 (Script_options::add_symbol_assignment): Update
5786 symbol_definitions_ and symbol_references_.
5787 (Script_options::add_symbol_reference): New function.
5788 (script_symbol): New function.
5789 * script.h (class Script_options): Add symbol_definitions_ and
5790 symbol_references_ fields.
5791 (Script_options::referenced_const_iterator): New type.
5792 (Script_options::referenced_begin): New function.
5793 (Script_options::referenced_end): New function.
5794 (Script_options::is_referenced): New function.
5795 (Script_options::any_unreferenced): New function.
5796 * script-c.h (script_symbol): Declare.
5797 * yyscript.y (exp): Call script_symbol.
5798 * symtab.cc: Include "script.h".
5799 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5800 Change all callers. Check symbols referenced by scripts.
5801 (Symbol_table::add_undefined_symbols_from_command_line): Add
5802 layout parameter. Change all callers.
5803 (Symbol_table::do_add_undefined_symbols_from_command_line):
5804 Likewise. Break out loop body. Check symbols referenced by
5806 (Symbol_table::add_undefined_symbol_from_command_line): New
5807 function broken out of
5808 do_add_undefined_symbols_from_command_line.
5809 * symtab.h (class Symbol_table): Update declarations.
5810 * archive.cc: Include "layout.h".
5811 (Archive::should_include_member): Add layout parameter. Change
5812 all callers. Check for symbol mentioned in expression.
5813 * archive.h (class Archive): Update declaration.
5814 * object.cc (Sized_relobj::do_should_include_member): Add layout
5816 * object.h (Object::should_include_member): Add layout parameter.
5818 (Object::do_should_include_member): Add layout parameter.
5819 (class Sized_relobj): Update declaration.
5820 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5822 * dynobj.h (class Sized_dynobj): Update declaration.
5823 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5825 * plugin.h (class Sized_pluginobj): Update declaration.
5827 2010-08-02 Ian Lance Taylor <iant@google.com>
5830 * output.cc (Output_segment::set_offset): Search for the first and
5831 last sections rather than assuming that the list is in order.
5832 (Output_segment::find_first_and_last_list): New function.
5833 * output.h (class Output_segment): Update declarations.
5834 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5835 (relro_strip_test_SOURCES): New variable.
5836 (relro_strip_test_DEPENDENCIES): New variable.
5837 (relro_strip_test_LDFLAGS): New variable.
5838 (relro_strip_test_LDADD): New variable.
5839 (relro_strip_test.so): New target.
5841 2010-08-02 Ian Lance Taylor <iant@google.com>
5843 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5844 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5845 (Target_i386::got_tlsdesc_section): New function.
5846 (Target_i386::got_section): Create space for GOT entries for
5847 TLSDESC relocations.
5848 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5850 (Target_i386::Scan::global): Likewise.
5851 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5853 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5854 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5855 (Target_x86_64::got_tlsdesc_section): New function.
5856 (Target_x86_64::got_section): Create space for GOT entries for
5857 TLSDESC relocations.
5858 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5860 (Target_x86_64::Scan::global): Likewise.
5861 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5864 2010-08-02 Ian Lance Taylor <iant@google.com>
5866 * testsuite/final_layout.sh: Use dc to convert from hex to
5869 2010-07-29 Sriraman Tallam <tmsriram@google.com>
5871 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5872 paramter to the call to gold::gc_process_relocs.
5873 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5874 paramter to the call to gold::gc_process_relocs.
5875 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5876 parameter to the call to gold::gc_process_relocs.
5877 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5878 template parameter to the call to gold::gc_process_relocs.
5879 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5880 paramter to the call to gold::gc_process_relocs.
5881 * gc.h (get_embedded_addend_size): New function.
5882 (gc_process_relocs): Save the size of the reloc for use by ICF.
5883 * icf.cc (get_section_contents): Get the addend from the text section
5884 for SHT_REL relocation sections.
5885 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5886 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5887 * int_encoding.h (read_from_pointer): New overloaded function.
5888 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5889 * testsuite/icf_sht_rel_addend_test.sh: New file.
5890 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5891 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5893 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5895 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5896 * Makefile.in: Regenerate.
5897 * testsuite/Makefile.in: Regenerate.
5899 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5901 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5902 * gold/testsuite/debug_msg.cc: Likewise.
5903 * gold/testsuite/odr_violation1.cc
5904 * gold/testsuite/odr_violation2.cc
5906 2010-07-21 Cary Coutant <ccoutant@google.com>
5908 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5909 string, and length fields.
5910 (Output_merge_string::Merged_strings_list): New type.
5911 (Output_merge_string::Merged_strings_lists): New typedef.
5912 (Output_merge_string): Replace merged_strings_ with
5913 merged_strings_lists_.
5914 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5915 Merged_strings_list per input object and section. Don't store pointer
5916 to the string. Don't store length with each merged string entry.
5917 (Output_merge_string::finalize_merged_data): Loop over list of merged
5918 strings lists. Recompute length of each merged string.
5920 2010-07-15 Cary Coutant <ccoutant@google.com>
5922 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5925 2010-07-14 Ian Lance Taylor <iant@google.com>
5927 * descriptors.cc (Descriptors::open): Report correct name in error
5930 2010-07-13 Doug Kwan <dougkwan@google.com>
5932 * arm.cc (Arm_input_section::Arm_input_section): For a
5933 SHT_ARM_EXIDX section, always keeps the input sections.
5934 (Arm_input_section::set_exidx_section_link): New method.
5935 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5936 has_errors_ to false.
5937 (Arm_exidx_input_section::has_errors,
5938 Arm_exidx_input_section::set_has_errors): New methods.
5939 (Arm_exidx_input_section::has_errors_): New data member.
5940 (Arm_relobj::get_exidx_shndx_list): New method.
5941 (Arm_output_section::append_text_sections_to_list): Do not skip
5942 section without SHF_EXECINSTR.
5943 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5945 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5946 section header. Make error messages more verbose. Check for
5947 a non-executable section linked to an EXIDX section.
5948 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5949 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5950 check that there is no deferred EXIDX section if we exit early.
5951 Instead of not making an EXIDX section in case of an error, make one
5952 and set the has_errors flag of it.
5953 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5954 in a relocatable link.
5955 (Target_arm::do_relax): Look for the EXIDX output section instead of
5956 assuming that it is called .ARM.exidx.
5957 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5958 section list. Do not check for SHF_EXECINSTR section flags but
5959 skip any input section with errors.
5960 * output.cc (Output_section::Output_section): Initialize
5961 always_keeps_input_sections_ to false.
5962 (Output_section::add_input_section): Check for
5963 always_keeps_input_sections_.
5964 * output.h (Output_section::always_keeps_input_sections,
5965 Output_section::set_always_keeps_input_sections): New methods.
5966 (Output_section::always_keeps_input_sections): New data member.
5968 2010-07-13 Rafael Espindola <espindola@google.com>
5970 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5971 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5973 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5974 Ian Lance Taylor <iant@google.com>
5976 * output.h (Output_section_lookup_maps::add_merge_section):
5977 Correct check of whether value was inserted.
5978 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5979 (Output_section_lookup_maps::add_relaxed_input_section):
5981 * arm.cc (Target_arm::got_section): Remove used local os.
5982 * i386.cc (Target_i386::got_section): Likewise.
5983 * x86_64.cc (Target_x86_64::got_section): Likewise.
5984 * sparc.cc (Target_sparc::got_section): Likewise.
5985 (Target_sparc::relocate): Remove unused local have_got_offset.
5986 * powerpc.cc (Target_powerpc::relocate): Likewise.
5988 2010-07-13 Ian Lance Taylor <iant@google.com>
5990 * compressed_output.cc (zlib_decompress): Fix signature in
5993 * archive.cc (Archive::include_member): Unlock an external member
5994 of a thin archive. Don't bother to delete an object we know is
5997 2010-07-12 Cary Coutant <ccoutant@google.com>
5999 * compressed_output.cc (zlib_decompress): New function.
6000 (get_uncompressed_size): New function.
6001 (decompress_input_section): New function.
6002 * compressed_output.h (get_uncompressed_size): New function.
6003 (decompress_input_section): New function.
6004 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6005 Handle compressed debug sections.
6006 * layout.cc (is_compressed_debug_section): New function.
6007 (Layout::output_section_name): Map compressed section names to
6009 * layout.h (is_compressed_debug_section): New function.
6010 (is_debug_info_section): Recognize compressed debug sections.
6011 * merge.cc: Include compressed_output.h.
6012 (Output_merge_data::do_add_input_section): Handle compressed
6014 (Output_merge_string::do_add_input_section): Handle compressed
6016 * object.cc: Include compressed_output.h.
6017 (Sized_relobj::Sized_relobj): Initialize new data members.
6018 (build_compressed_section_map): New function.
6019 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6020 * object.h (Object::section_is_compressed): New method.
6021 (Object::do_section_is_compressed): New method.
6022 (Sized_relobj::Compressed_section_map): New type.
6023 (Sized_relobj::do_section_is_compressed): New method.
6024 (Sized_relobj::compressed_sections_): New data member.
6025 * output.cc (Output_section::add_input_section): Handle compressed
6027 * reloc.cc: Include compressed_output.h.
6028 (Sized_relobj::write_sections): Handle compressed debug sections.
6030 2010-07-08 Cary Coutant <ccoutant@google.com>
6032 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6033 weak when resolving to a dynamic def.
6034 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6035 for weak undef/dynamic def cases. Adjust callers.
6036 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6037 undef_binding_weak_.
6038 (Symbol_table::sized_write_globals): Adjust symbol binding.
6039 (Symbol_table::sized_write_symbol): Add binding parameter.
6040 * symtab.h (Symbol::set_undef_binding): New method.
6041 (Symbol::is_undef_binding_weak): New method.
6042 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6043 (Symbol_table::should_override): Add new parameter.
6044 (Symbol_table::sized_write_symbol): Add new parameter.
6046 * testsuite/weak_undef_file1.cc: Add new test case.
6047 * testsuite/weak_undef_file2.cc: Fix header comment.
6048 * testsuite/weak_undef_test.cc: Add new test case.
6050 2010-06-29 Doug Kwan <dougkwan@google.com>
6052 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6053 Initialize USE_SYMBOL_.
6054 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6056 (Arm_reloc_property::uses_symbol_): New data member declaration.
6057 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6058 uses symbol value and symbol is undefined but not weakly undefined.
6060 2010-06-28 Rafael Espindola <espindola@google.com>
6062 * plugin.cc (Plugin::load): Use dlerror.
6064 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6066 * symtab.cc (detect_odr_violations): When reporting an ODR
6067 violation, report an object where the symbol is defined.
6069 2010-06-25 Doug Kwan <dougkwan@google.com>
6071 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6072 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6074 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6075 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6076 target hook to detect function points.
6077 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6078 * icf.h (Icf::check_section_for_function_pointers): Change type of
6079 parameter SECTION_NAME to const reference to std::string. Use
6080 target hook to determine if section may have unsafe pointers.
6081 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6084 2010-06-21 Rafael Espindola <espindola@google.com>
6086 * fileread.cc (Input_file::find_fie): New
6087 (Input_file::open): Use Input_file::find_fie.
6088 * fileread.h (Input_file::find_fie): New
6089 * plugin.cc (set_extra_library_path): New.
6090 (Plugin::load): Add set_extra_library_path to the transfer vector.
6091 (Plugin_manager::set_extra_library_path): New.
6092 (Plugin_manager::add_input_file): Use the extra search path if set.
6093 (set_extra_library_path(): New.
6094 * plugin.h (Plugin_manager): Add set_extra_library_path and
6097 2010-06-19 Cary Coutant <ccoutant@google.com>
6099 * layout.cc (gdb_sections): Add .debug_types.
6100 (lines_only_debug_sections): Likewise.
6102 2010-06-18 Rafael Espindola <espindola@google.com>
6104 * plugin.cc (add_input_file,add_input_library)
6105 (Plugin_manager::add_input_file): Make filename arguments const.
6106 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6109 2010-06-16 Doug Kwan <dougkwan@google.com>
6111 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6112 .ARM.attributes section if we have not merged any input
6113 attributes sections.
6115 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6117 * arm.cc: Allow combining objects with no EABI version
6120 2010-06-15 Rafael Espindola <espindola@google.com>
6122 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6124 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6126 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6127 (struct iovec): Correct !HAVE_READV definition.
6129 2010-06-10 Cary Coutant <ccoutant@google.com>
6131 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6132 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6134 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6137 * symtab.h (Symbol::is_placeholder): New member function.
6138 * target-reloc.h (relocate_section): Check for placeholder symbols.
6140 * testsuite/Makefile.am (plugin_test_8): New test.
6141 (plugin_test_9): New test.
6142 * testsuite/Makefile.in: Regenerate.
6144 2010-06-09 Nick Clifton <nickc@redhat.com>
6146 * yyscript.y (input_list_element): Allow strings prefixed with
6147 the '-' character. Treat these as libraries.
6148 * script.cc (script_add_library): New function. Adds a library
6149 specified by "-l<name>" found in an input script.
6150 * script-c.h: Add prototype for script_add_library.
6152 2010-06-07 Doug Kwan <dougkwan@google.com>
6154 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6155 Restrict stub-group size to be within long conditional branch
6156 range when working around cortex-A8 erratum.
6158 2010-06-07 Damien Diederen <dd@crosstwine.com>
6160 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6163 2010-06-03 Sriraman Tallam <tmsriram@google.com>
6167 (Output_section::Input_section_sort_entry::compare_section_ordering):
6168 Change to return non-zero correctly.
6169 (Output_section::Input_section_sort_section_order_index_compare
6170 ::operator()): Change to fix ambiguity in comparisons.
6172 2010-06-01 Sriraman Tallam <tmsriram@google.com>
6174 * gold.h (is_wildcard_string): New function.
6175 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6176 (Layout::layout_eh_frame): Ditto.
6177 (Layout::find_section_order_index): New method.
6178 (Layout::read_layout_from_file): New method.
6179 * layout.h (Layout::find_section_order_index): New method.
6180 (Layout::read_layout_from_file): New method.
6181 (Layout::input_section_position_): New private member.
6182 (Layout::input_section_glob_): New private member.
6183 * main.cc (main): Call read_layout_from_file here.
6184 * options.h (--section-ordering-file): New option.
6185 * output.cc (Output_section::input_section_order_specified_): New
6187 (Output_section::Output_section): Initialize new member.
6188 (Output_section::add_input_section): Add new parameter.
6189 Keep input sections when --section-ordering-file is used.
6190 (Output_section::set_final_data_size): Sort input sections when
6191 section ordering file is specified.
6192 (Output_section::Input_section_sort_entry): Add new parameter.
6194 (Output_section::Input_section_sort_entry::compare_section_ordering):
6196 (Output_section::Input_section_sort_compare::operator()): Change to
6197 consider section_order_index.
6198 (Output_section::Input_section_sort_init_fini_compare::operator()):
6199 Change to consider section_order_index.
6200 (Output_section::Input_section_sort_section_order_index_compare
6201 ::operator()): New method.
6202 (Output_section::sort_attached_input_sections): Change to sort
6203 according to section order when specified.
6204 (Output_section::add_input_section<32, true>): Add new parameter.
6205 (Output_section::add_input_section<64, true>): Add new parameter.
6206 (Output_section::add_input_section<32, false>): Add new parameter.
6207 (Output_section::add_input_section<64, false>): Add new parameter.
6208 * output.h (Output_section::add_input_section): Add new parameter.
6209 (Output_section::input_section_order_specified): New
6211 (Output_section::set_input_section_order_specified): New method.
6212 (Input_section::Input_section): Initialize section_order_index_.
6213 (Input_section::section_order_index): New method.
6214 (Input_section::set_section_order_index): New method.
6215 (Input_section::section_order_index_): New member.
6216 (Input_section::Input_section_sort_section_order_index_compare): New
6218 (Output_section::input_section_order_specified_): New member.
6219 * script-sections.cc (is_wildcard_string): Delete and move modified
6221 (Output_section_element_input::Output_section_element_input): Modify
6222 call to is_wildcard_string.
6223 (Output_section_element_input::Input_section_pattern
6224 ::Input_section_pattern): Ditto.
6225 (Output_section_element_input::Output_section_element_input): Ditto.
6226 * testsuite/Makefile.am (final_layout): New test case.
6227 * testsuite/Makefile.in: Regenerate.
6228 * testsuite/final_layout.cc: New file.
6229 * testsuite/final_layout.sh: New file.
6231 2010-06-01 Rafael Espindola <espindola@google.com>
6233 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6235 2010-06-01 Rafael Espindola <espindola@google.com>
6237 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6238 visibility of symbols.
6240 2010-05-27 Doug Kwan <dougkwan@google.com>
6242 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6243 from start of output section instead of address for a local symbol
6244 in a merged or relaxed section when doing a relocatable link.
6246 2010-05-26 Rafael Espindola <espindola@google.com>
6249 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6250 adding sections the garbage collector removed.
6251 * gold/testsuite/Makefile.am: Add test.
6252 * gold/testsuite/Makefile.in: Regenerate.
6253 * gold/testsuite/plugin_test_7.sh: New.
6254 * gold/testsuite/plugin_test_7_1.c: New.
6255 * gold/testsuite/plugin_test_7_2.c: New.
6257 2010-05-26 Rafael Espindola <espindola@google.com>
6259 * script-sections.cc (Output_section_definition::set_section_addresses):
6260 Check for --section-start.
6262 2010-05-26 Doug Kwan <dougkwan@google.com>
6264 * arm.cc (Arm_scan_relocatable_relocs): New class.
6265 (Target_arm::relocate_special_relocatable): New method.
6266 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6267 (Arm_relocate_functions::thumb_branch_common): Same.
6268 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6269 instead of Default_scan_relocatable_relocs.
6270 * target-reloc.h (relocate_for_relocatable): Let target handle
6271 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6272 * target.h (Sized_target::relocate_special_relocatable): New method.
6274 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6276 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6278 2010-05-23 Doug Kwan <dougkwan@google.com>
6280 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6282 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6283 with a direct branch, not a conditional branch, to a stub.
6284 * merge.cc (Output_merge_base::record_input_section): New method
6286 (Output_merge_data::do_add_input_section): Record input section if
6287 keeps-input-sections flag is set.
6288 (Output_merge_string::do_add_input_section): Ditto.
6289 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6290 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6292 (Output_merge_base::keeps_input_sections,
6293 Output_merge_base::set_keeps_input_sections,
6294 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6296 (Output_merge_base::Input_sections): New type declaration.
6297 (Output_merge_base::input_sections_begin,
6298 Output_merge_base::input_sections_end,
6299 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6300 (Output_merge_base::bool keeps_input_sections_,
6301 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6302 Output_merge_base::input_sections_): New data members.
6303 (Output_merge_data::do_set_keeps_input_sections): New method
6305 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6306 * output.cc (Output_section::Input_section::relobj): Move method
6307 defintion from class declaration to here and handle merge sections.
6308 (Output_section::Input_section::shndx): Ditto.
6309 (Output_section::Output_section): Remove initializations of removed
6310 data members and initialize new data member LOOKUP_MAPS_.
6311 (Output_section::add_input_section): Set keeps-input-sections flag
6312 for a newly created merge output section as appropriate. Adjust code
6313 to use Output_section_lookup_maps class.
6314 (Output_section::add_relaxed_input_section): Adjst code for lookup
6315 maps code refactoring.
6316 (Output_section::add_merge_input_section): Add a new parameter
6317 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6318 class. If adding input section to a newly created merge output
6319 section fails, remove the new merge section.
6320 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
6321 Adjust code for use of the Output_section_lookup_maps class.
6322 (Output_section::find_merge_section): Ditto.
6323 (Output_section::build_lookup_maps): New method defintion.
6324 (Output_section::find_relaxed_input_section): Adjust code to use
6325 Output_section_lookup_maps class.
6326 (Output_section::get_input_sections): Export merge sections. Adjust
6327 code to use Output_section_lookup_maps class.
6328 (Output_section:::add_script_input_section): Adjust code to use
6329 Output_section_lookup_maps class. Update lookup maps for merge
6331 (Output_section::discard_states): Use Output_section_lookup_maps.
6332 (Output_section::restore_states): Same.
6333 * output.h (Merge_section_properties): Move class defintion out of
6335 (Output_section_lookup_maps): New class.
6336 (Output_section::Input_section::is_merge_section): New method
6338 (Output_section::Input_section::relobj): Move defintion out of class
6339 defintion. Declare method only.
6340 (Output_section::Input_section::shndx): Ditto.
6341 (Output_section::Input_section::output_merge_base): New method defintion.
6342 (Output_section::Input_section::u2_.pomb): New union field.
6343 (Output_section::Merge_section_by_properties_map,
6344 Output_section::Output_section_data_by_input_section_map,
6345 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6347 (Output_section::add_merge_input_section): Add new parameter
6348 KEEPS_INPUT_SECTIONS.
6349 (Output_section::build_lookup_maps): New method declaration.
6350 (Output_section::merge_section_map_,
6351 Output_section::merge_section_by_properties_map_,
6352 Output_section::relaxed_input_section_map_,
6353 Output_section::is_relaxed_input_section_map_valid_): Remove data
6355 (Output_section::lookup_maps_): New data member.
6357 2010-05-21 Doug Kwan <dougkwan@google.com>
6360 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6361 avoid a compilation error.
6363 2010-05-19 Rafael Espindola <espindola@google.com>
6365 * script-sections.cc (Output_section_definition::allocate_to_segment):
6366 Update the phdrs_list even when the output section is NULL.
6367 * testsuite/Makefile.am: Add test.
6368 * testsuite/Makefile.in: Regenerate.
6369 * testsuite/script_test_9.cc: New.
6370 * testsuite/script_test_9.sh: New.
6371 * testsuite/script_test_9.t: New.
6373 2010-05-19 Doug Kwan <dougkwan@google.com>
6375 * arm.cc (Arm_input_section::original_size): New method.
6376 (Arm_input_section::do_addralign): Add a cast.
6377 (Arm_input_section::do_output_offset): Remove static cast.
6378 (Arm_input_section::original_addralign,
6379 Arm_input_section::original_size_): Change type to uint32_t.
6380 (Arm_input_section::init): Add safe casts for section alignment
6382 (Arm_input_section::set_final_data_size): Do not set address and
6383 offset of stub table.
6384 (Arm_output_section::fix_exidx_coverage): Change use of of
6385 Output_section::Simple_input_section to that of
6386 Output_section::Input_section.
6387 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6388 except for the first pass.
6389 * output.cc (Output_section::get_input_sections): Change type of
6390 input_sections to std::list<Input_section>.
6391 (Output_section::add_script_input_section): Rename from
6392 Output_section::add_simple_input_section. Change type of SIS
6393 parameter from Simple_input_section to Input_section.
6394 * output.h (Output_section::Simple_input_section): Remove class.
6395 (Output_section::Input_section): Change class visibility to public.
6396 (Output_section::Input_section::addralign): Use stored alignments
6397 for special input sections if set.
6398 (Output_section::Input_section::set_addralign): New method.
6399 (Output_section::get_input_sections): Change parameter type from
6400 list of Simple_input_section to list of Input_section.
6401 (Output_section::add_script_input_section): Rename from
6402 Output_section::add_simple_input_section. Change first parameter's
6403 type from Simple_input_section to Input_section and remove the
6404 second and third parameters.
6405 * script-sections.cc (Input_section::Input_section_list): Change
6406 type to list of Output_section::Input_section/
6407 (Input_section_info::Input_section_info): Change parameter type of
6408 INPUT_SECTION to Output_section::Input_section.
6409 (Input_section_info::input_section): Change return type.
6410 (Input_section_info::input_section_): Change type to
6411 Output_section::Input_section.
6412 (Output_section_element_input::set_section_addresses): Adjust code
6413 to use Output_section::Input_section instead of
6414 Output_section::Simple_input_section. Adjust code for renaming
6415 of Output_section::add_simple_input_section.
6416 (Orphan_output_section::set_section_addresses): Ditto.
6418 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6420 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6421 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6423 2010-05-18 Rafael Espindola <espindola@google.com>
6425 * options.cc (General_options::finalize): Handle -nostdlib.
6426 * options.h (nostdlib): New option.
6427 * script.cc (script_add_search_dir): Handle -nostdlib.
6429 2010-05-12 Doug Kwan <dougkwan@google.com>
6431 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6432 attributes section only if there no attributes section after merging.
6433 (Target_arm::merge_object_attributes): Move value of
6434 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
6435 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6436 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6437 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6438 and arm_attr_merge_7.stdout.
6439 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6440 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6441 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6442 arm_attr_merge_7b.o): New rules.
6443 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6445 * testsuite/Makefile.in: Regenerate.
6446 * testsuite/arm_attr_merge.sh: New file.
6447 * testsuite/arm_attr_merge_[67][ab].s: Same.
6449 2010-05-05 Nick Clifton <nickc@redhat.com>
6451 * po/es.po: Updated Spanish translation.
6453 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6455 * Makefile.am (install-exec-local): Properly install gold as
6456 default cross linker.
6457 * Makefile.in: Regenerated.
6459 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6460 Nick Clifton <nickc@redhat.com>
6462 * configure.ac (install_as_default): Define and set to false
6463 unless --enable-gold or --enable-gold=both/gold has been
6465 * configure: Regenerate.
6467 * Makefile.am (install-exec-local): Install the executable as
6468 'ld.gold'. If install_as_default is true then also install it as
6470 * Makefile.in: Regenerated.
6472 2010-04-24 Ian Lance Taylor <iant@google.com>
6474 * layout.cc (Layout::layout_reloc): In relocatable link don't
6475 combine reloc sections for grouped sections.
6477 2010-04-23 Sriraman Tallam <tmsriram@google.com>
6479 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6480 sections that are not ordinary to icf.
6481 * icf.cc (get_section_contents): Handle relocation pointing to section
6482 with no object or shndx information.
6483 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6484 * testsuite/Makefile.in: Regenerate.
6485 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6486 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6488 2010-04-22 Ian Lance Taylor <iant@google.com>
6490 * expression.cc (Expression::Expression_eval_info): Add
6491 result_alignment_pointer field.
6492 (Expression::eval_with_dot): Add result_alignment_pointer
6493 parameter. Change all callers.
6494 (Expression::eval_maybe_dot): Likewise.
6495 (class Binary_expression): Add alignment_pointer parameter to
6496 left_value and right_value. Change all callers.
6497 (BINARY_EXPRESSION): Set result alignment.
6498 (class Trinary_expression): Add alignment_pointer parameter to
6499 arg2_value and arg3_value. Change all callers.
6500 (Trinary_cond::value): Set result alignment.
6501 (Max_expression::value, Min_expression::value): Likewise.
6502 (Align_expression::value): Likewise.
6503 * script-sections.cc (class Sections_element): Add dot_alignment
6504 parameter to set_section_addresses virtual function. Update
6506 (class Output_section_element): Likewise.
6507 (Script_sections::create_segments): Add dot_alignment parameter.
6509 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6510 (Script_sections::set_phdrs_clause_addresses): Likewise.
6511 * script-sections.h: Update declarations.
6512 * script.h: Update declarations.
6513 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6515 * testsuite/script_test_3.t: Set large alignment.
6516 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6517 segment has expected alignment.
6519 2010-04-22 Nick Clifton <nickc@redhat.com>
6521 * po/gold.pot: Updated by the Translation project.
6522 * po/vi.po: Updated Vietnamese translation.
6524 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6526 * testsuite/Makefile.am (check_PROGRAMS): Add
6527 icf_virtual_function_folding_test.
6528 * testsuite/Makefile.in: Regenerated.
6530 2010-04-15 Andrew Haley <aph@redhat.com>
6532 * options.h (merge_exidx_entries): New option.
6533 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6534 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6535 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6536 (Target_arm::merge_exidx_entries): New function.
6537 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6538 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6539 to Arm_exidx_fixup constructor.
6540 Add new arg, merge_exidx_entries.
6541 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6542 Arm_output_section::fix_exidx_coverage.
6544 2010-04-18 Sriraman Tallam <tmsriram@google.com>
6546 * icf.cc (get_section_contents): Check for preemptible functions.
6547 Ignore addend when appropriate.
6548 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6550 (add_from_relobj): Check for section folded.
6551 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6552 * symtab.h (should_add_dynsym_entry): Add new parameter.
6553 * target-reloc.h (scan_relocs): Check for section folded.
6554 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6555 Check reloc types for function pointers in shared objects.
6556 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6558 (icf_preemptible_functions_test): New test case.
6559 (icf_string_merge_test): New test case.
6560 * testsuite.Makefile.in: Regenerate.
6561 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6562 bar_glob. Refactor code.
6563 * testsuite/icf_preemptible_functions_test.cc: New file.
6564 * testsuite/icf_preemptible_functions_test.sh: New file.
6565 * testsuite/icf_string_merge_test.cc: New file.
6566 * testsuite/icf_string_merge_test.sh: New file.
6567 * testsuite/icf_virtual_function_folding_test.cc: New file.
6568 * testsuite/icf_virtual_function_folding_test.sh: New file.
6570 2010-04-14 Doug Kwan <dougkwan@google.com>
6572 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6573 for local symbol recounting if we remove a section due to ICF.
6574 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6575 there are no regular objects in input.
6577 2010-04-13 Doug Kwan <dougkwan@google.com>
6579 * arm.cc (Arm_input_section::set_final_data_size): Compute
6580 accurate final data size instead of using current data size.
6582 2010-04-09 Doug Kwan <dougkwan@google.com>
6584 * layout.cc (Layout::choose_output_section): Handle script section
6586 (Layout::make_output_section_for_script): Add section type parameter.
6587 Handle script section types.
6588 * layout.h (Layout::make_output_section_for_script): Add section
6590 * output.cc (Output_section::Output_section): Initialize data member
6592 (Output_section::do_reset_address_and_file_offset): Do not set address
6593 to 0 if section is a NOLOAD section.
6594 * output.h (Output_section::is_noload): New method.
6595 (Output_section::set_is_noload): Ditto.
6596 (Output_section::is_noload_): New data member.
6597 * script-c.h (Script_section_type): New enum type.
6598 (struct Parser_output_section_header): Add new file section_type.
6599 * script-sections.cc (Sections_element::output_section_name): Add
6600 parameter for returning script section type.
6601 (Output_section_definition::output_section_name): Ditto.
6602 (Output_section_definition::section_type)P; New method.
6603 (Output_section_definiton::script_section_type_name): Ditto.
6604 (Output_section_definition::script_section_type_): New data member.
6605 (Output_section_definition::Output_section_definition): Initialize
6606 data member Output_section_definition::script_section_type_.
6607 (Output_section_definition::create_sections): Pass script section type
6608 to Layout::make_output_section_for_script.
6609 (Output_section_definition::output_section_name): Return script
6610 section type to caller.
6611 (Output_section_definition::set_section_address): Do not advance
6612 dot value and load address if section type is NOLOAD. Set address
6613 of NOLOAD sections regardless of section flags.
6614 (Output_section_definition::print): Print section type if it is
6615 not SCRIPT_SECTION_TYPE_NONE.
6616 (Output_section_definition::section_type): New method.
6617 (Output_section_definition::script_section_type_name): Ditto.
6618 (Script_sections::output_section_name): Add new parameter
6619 PSECTION_TYPE for returning script section type. Pass it to
6620 section elements. Handle discard sections.
6621 (Sort_output_sections::operator()): Handle NOLOAD sections.
6622 * script-sections.h (Script_sections::Section_type): New enum type.
6623 (Script_sections::output_section_name): Add a new parameter for
6624 returning script section type.
6625 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6627 * yyscript.y (union): Add new field SECTION_TYPE.
6628 (COPY, DSECT, INFO, NOLOAD): New tokens.
6629 (opt_address_and_section_type): Change type to output_section_header.
6630 (section_type): New non-terminal
6631 (section_header): Handle section type.
6632 (opt_address_and_section_type): Return section type value.
6634 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6636 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6637 * testsuite/plugin_common_test_2.c (foo): Likewise.
6639 2010-04-08 Doug Kwan <dougkwan@google.com>
6641 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6643 * output.cc (Output_section::add_merge_input_section): Simplify
6644 code and return status of Output_merge_base::add_input_section.
6645 Update merge section map only if Output_merge_base::add_input_section
6648 2010-04-07 Doug Kwan <dougkwan@google.com>
6650 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6651 if section is marked as containing instructions but has no mapping
6653 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6654 correct section index.
6655 (Arm_relobj::find_linked_text_section): Ditto.
6657 2010-04-07 Cary Coutant <ccoutant@google.com>
6659 * archive.cc (include_member): Destroy Read_symbols_data object before
6661 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6662 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6663 (Read_symbols_data::~Read_symbols_data) New destructor.
6664 (Section_relocs::Section_relocs) New constructor.
6665 (Section_relocs::~Section_relocs) New destructor.
6666 (Read_relocs_data::Read_relocs_data) New constructor.
6667 (Read_relocs_data::~Read_relocs_data) New destructor.
6668 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6669 pointers to NULL after deleting.
6671 2010-04-07 Doug Kwan <dougkwan@google.com>
6673 * arm.cc: Replace "endianity" with "endianness" in comments.
6674 (Arm_exidx_cantunwind): Ditto.
6675 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6676 (Arm_relobj::merge_flags_and_attributes): New method.
6677 (Arm_relobj::merge_flags_and_attributes_): New data member.
6678 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6679 (Arm_relobj::scan_sections_for_stubs): Ditto.
6680 (Arm_relobj::do_read_symbols): Check to see if we really want to
6681 merge processor-specific flags and attributes. Exit early if
6682 an object is empty except for section names and the undefined symbol.
6683 (Target_arm::do_finalize_sections): Move check for ELF format to
6684 Arm_relobj::do_read_symbols. Merge processor specific flags and
6685 attributes from a regular object only when we have determined that
6686 it is aapropriate. Do not create an .ARM.attributes section in
6687 output if there is no regular input object.
6688 (Target_arm::merge_processor_specific_flags): Check
6689 --warn-mismatch before printing any error.
6690 (Target_arm::merge_object_attributes): Ditto.
6691 * gold.cc (queue_middle_tasks): Handle the case in which there is
6692 no regular object in input.
6693 * options.cc (General_options::parse_EB): New method.
6694 (General_options::parse_EL): Same.
6695 (General_options::General_options): Initialize endianness_.
6696 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6698 (General_options::Endianness): New enum.
6699 (General_options::endianness): New method.
6700 (General_options::endianness_): New data member.
6701 * parameters.cc (Parameters::set_options): Check target endianness.
6702 (Parameters::set_target_once): Ditto.
6703 (Parameters::check_target_endianness): New method.
6704 (parameters_force_valid_target): If either -EL or -EB is specified,
6705 use it to define endianness of default target.
6706 * parameters.h (Parameters::check_target_endianness): New method
6708 * target.h (class Target): Change "endianity" to "endianness"
6711 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6713 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6714 * configure: Regenerate.
6715 * Makefile.in: Regenerate.
6716 * testsuite/Makefile.in: Regenerate.
6718 2010-04-06 Cary Coutant <ccoutant@google.com>
6721 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6722 prevailing definitions of common symbols.
6723 * testsuite/plugin_test_6.sh: New test case.
6724 * testsuite/plugin_common_test_1.c: New test case.
6725 * testsuite/plugin_common_test_2.c: New test case.
6726 * testsuite/Makefile.am (plugin_test_6): New test case.
6727 * testsuite/Makefile.in: Regenerate.
6729 2010-04-06 Nick Clifton <nickc@redhat.com>
6731 * po/vi.po: New Vietnamese translation.
6733 2010-03-30 Doug Kwan <dougkwan@google.com>
6735 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6737 2010-03-25 Doug Kwan <dougkwan@google.com>
6739 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6740 to avoid a conversion warning on a 32-bit host.
6742 2010-03-24 Ian Lance Taylor <iant@google.com>
6744 * testsuite/script_test_3.t: Add a TLS segment.
6745 * testsuite/Makefile.am (check_PROGRAMS): Add
6746 tls_phdrs_script_test.
6747 (tls_phdrs_script_test_SOURCES): Define.
6748 (tls_phdrs_script_test_DEPENDENCIES): Define.
6749 (tls_phdrs_script_test_LDFLAGS): Define.
6750 (tls_phdrs_script_test_LDADD): Define.
6751 * testsuite/Makefile.in: Rebuild.
6753 2010-03-23 Cary Coutant <ccoutant@google.com>
6755 * fileread.cc (find_or_make_view): Fix comment.
6757 2010-03-23 Ian Lance Taylor <iant@google.com>
6759 * script-sections.cc (class Orphan_section_placement): Define
6760 PLACE_TLS and PLACE_TLS_BSS.
6761 (Orphan_section_placement::Orphan_section_placement): Initialize
6763 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6764 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6765 (tls_script_test_SOURCES): Define.
6766 (tls_script_test_DEPENDENCIES): Define.
6767 (tls_script_test_LDFLAGS): Define.
6768 (tls_script_test_LDADD): Define.
6769 * testsuite/Makefile.in: Rebuild.
6771 2010-03-22 Doug Kwan <dougkwan@google.com>
6773 * arm.cc (Arm_relocate_functions::abs8,
6774 Arm_relocate_functions::abs16): Use correct check for overflow
6775 specified in the ARM ELF specs.
6776 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6777 target of a BLX instruction specially.
6778 (Reloc_stub::stub_type_for_reloc): Ditto.
6779 (Relocate::relocate): Use symbolic names instead of numeric relocation
6780 codes to report error.
6781 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6783 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6784 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6785 thumb2_blx_out_of_range.stdout
6786 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6787 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6788 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6789 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6790 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6791 thumb2_blx_in_range, thumb2_blx_in_range.o,
6792 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6793 thumb2_blx_out_of_range.o): New rules.
6794 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
6795 thumb2_blx_in_range and thumb2_blx_out_of_range.
6796 * testsuite/Makefile.in: Regenerate.
6797 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6798 * testsuite/thumb_blx_in_range.s: New file.
6799 * testsuite/thumb_blx_out_of_range.s: New file.
6801 2010-03-22 Rafael Espindola <espindola@google.com>
6803 * archive.cc (Should_include): Move to archive.h.
6804 (should_include_member): Make it a member of Archive.
6806 (Add_lib_group_symbols): New.
6807 * archive.h: Include options.h.
6808 (Archive_member): Moved from Archive.
6809 (Should_include): Moved from archive.cc.
6811 (Add_lib_group_symbols): New.
6812 * dynobj.cc (do_should_include_member): New.
6813 * dynobj.h (do_should_include_member): New.
6814 * gold.cc (queue_initial_tasks): Update call to queue.
6815 * main.cc (main): Print lib group stats.
6816 * object.cc (do_should_include_member): New.
6817 * object.h: Include archive.h.
6818 (Object::should_include_member): New.
6819 (Object::do_should_include_member): New.
6820 (Sized_relobj::do_should_include_member): New.
6821 * options.cc (General_options::parse_start_lib): New.
6822 (General_options::parse_end_lib): New.
6823 (Input_arguments::add_file): Handle lib groups.
6824 (Input_arguments::start_group): Check we are not in a lib.
6825 (Input_arguments::start_lib): New.
6826 (Input_arguments::end_lib): New.
6827 * options.h (General_options): Add start_lib and end_lib.
6828 (Input_argument::lib_): New.
6829 (Input_argument::lib): New.
6830 (Input_argument::is_lib): New.
6831 (Input_file_lib): New.
6832 (Input_arguments::in_lib_): New.
6833 (Input_arguments::in_lib): New.
6834 (Input_arguments::start_lib): New.
6835 (Input_arguments::end_lib_): New.
6836 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6837 in unused members as preempted.
6838 (Sized_pluginobj::do_should_include_member): New.
6839 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6840 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6842 (Read_symbols::do_whole_lib_group): New.
6843 (Read_symbols::do_lib_group): New.
6844 (Read_symbols::do_read_symbols): Handle lib groups.
6845 (Read_symbols::get_name): Handle lib groups.
6846 * readsyms.h (Read_symbols): Add an archive member pointer.
6847 (Read_symbols::do_whole_lib_group): New.
6848 (Read_symbols::do_lib_group): New.
6849 (Read_symbols::member_): New.
6850 * script.cc (read_input_script): Update call to queue_soon.
6852 2010-03-19 Doug Kwan <dougkwan@google.com>
6854 * arm.cc (Stub_table::Stub_table): Initialize new data members
6855 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6856 (Stub_table::add_reloc_stub): Assign stub offset and update
6857 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6858 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6860 (Stub_table::update_data_size_and_addralign): Use
6861 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6862 instead of going over all reloc stubs.
6863 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
6864 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6865 Stringpool_template::offset_ to size of Stringpool_char.
6866 (Stringpool_template::new_key_offset): Remove code to initialize
6867 Stringpool_template::offset_.
6868 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6869 Stringpool_template::offset_ to zero.
6871 2010-03-15 Doug Kwan <dougkwan@google.com>
6873 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6875 (Stringpool_template::new_key_offset): New method.
6876 (Stringpool_template::add_string): Assign offsets when adding new
6878 (Stringpool_template::set_string_offsets): Do not set string offsets
6879 when not optimizing.
6880 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6882 (Chunked_vector::clear): Clear size_.
6883 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6884 (Chunked_vector::size): Return size_.
6885 (Chunked_vector::push_back): Use size_ to find insert position.
6886 (Chunked_vector::size_): New data member.
6887 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6888 (Stringpool_template::new_key_offset): New method declaration.
6889 (Stringpool_template::offset_): New data member.
6891 2010-03-15 Rafael Espindola <espindola@google.com>
6893 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6894 Add_symbols' constructor.
6895 * readsyms.h (Add_symbols): Remove the input_group member.
6897 2010-03-10 Ian Lance Taylor <iant@google.com>
6899 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6900 target to ask whether a reference to a symbol requires a stack
6902 * target.h (Target::is_call_to_non_split): New function.
6903 (Target::do_is_call_to_non_split): Declare virtual function.
6904 * target.cc: Include "symtab.h".
6905 (Target::do_is_call_to_non_split): New function.
6906 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6908 2010-03-10 Cary Coutant <ccoutant@google.com>
6910 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6911 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6912 (File_read::open[2]): Add whole_file_view_ to list of views.
6913 (File_read::make_view): Remove test of whole_file_view_.
6914 (File_read::find_or_make_view): Create whole_file_view_ if
6916 (File_read::clear_views): Replace bool parameter with enum;
6917 adjust all callers. Don't delete views with permanent data;
6918 do delete cached views and views from archives if
6919 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6920 if clearing the corresponding view.
6921 * fileread.h (File_read::Clear_views_mode): New enum.
6922 (File_read::View::is_permanent_view): New method.
6923 (File_read::clear_views): Replace bool parameter
6924 with enum; adjust all callers.
6925 * options.h (General_options): Change keep_files_mapped option;
6926 add map_whole_files.
6927 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6929 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6932 2010-03-10 David S. Miller <davem@davemloft.net>
6934 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6936 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6938 * icf.cc (get_section_contents): Add '@' marker after processing the
6941 2010-03-08 Doug Kwan <dougkwan@google.com>
6943 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6944 due to a conversion warning.
6945 (Arm_relobj::update_output_local_symbol_count): Check for local
6946 symbol with unset output index.
6948 2010-03-05 Ian Lance Taylor <iant@google.com>
6950 * options.h (class General_options): Add --spare-dynamic-tags.
6951 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6952 --spare-dynamic-tags.
6954 2010-03-05 Ian Lance Taylor <iant@google.com>
6956 * incremental.cc: Include "libiberty.h".
6958 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6960 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6961 function, is_info_ member.
6962 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6963 (Versions::Versions): Update caller.
6964 (Versions::define_base_version): Likewise.
6965 (Versions::add_def): Likewise.
6967 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6969 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6970 (Scan::possible_function_pointer_reloc): New function.
6971 (Scan::local_reloc_may_be_function_pointer): Change to call
6972 possible_function_pointer_reloc.
6973 (Scan::global_reloc_may_be_function_pointer): Ditto.
6974 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6975 relocations in ".data.rel.ro._ZTV" section.
6976 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6977 * testsuite/icf_safe_so_test.cc: Ditto.
6978 * testsuite/icf_safe_test.cc: Ditto.
6979 * testsuite/icf_safe_test.sh: Ditto.
6981 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6982 Ian Lance Taylor <iant@google.com>
6984 * target-reloc.h (relocate_section): Check the symbol table index
6985 for -1U before setting the local symbol index.
6986 (scan_relocatable_relocs): If copying the relocation, record that
6987 the local symbol is required.
6988 * object.h (Symbol_value::is_output_symtab_index_set): New
6990 (Symbol_value::may_be_discarded_from_output_symtab): New
6992 (Symbol_value::has_output_symtab_entry): New function.
6993 (Symbol_value::needs_output_symtab_entry): Remove.
6994 (Symbol_value::output_symtab_index): Make sure the symbol index is
6996 (Symbol_value::set_output_symtab_index): Make sure the symbol
6997 index is not set. Make sure the new index is valid.
6998 (Symbol_value::set_must_have_output_symtab_entry): New function.
6999 (Symbol_value::has_output_dynsym_entry): New function.
7000 (Symbol_value::set_output_dynsym_index): Make sure the new index
7002 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7003 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7004 local symbol if permitted.
7005 (Sized_relobj::do_finalize_local_symbols): Call
7006 is_output_symtab_index_set rather than needs_output_symtab_entry.
7007 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7008 rather than needs_output_symtab_entry. Call
7009 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7010 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7011 is_output_symtab_index_set rather than needs_output_symtab_entry.
7012 * testsuite/discard_locals_relocatable_test.c: New file.
7013 * testsuite/discard_locals_test.sh: Test -r.
7014 * testsuite/Makefile.am (check_DATA): Add
7015 discard_locals_relocatable_test1.syms,
7016 discard_local_relocatable_test2.syms.
7017 (MOSTLYCLEANFILES): Likewise. Also add
7018 discard_locals_relocatable_test1.lout and
7019 discard_locals_relocatable_test2.out.
7020 (discard_locals_relocatable_test1.syms): New target.
7021 (discard_locals_relocatable_test.o): New target.
7022 (discard_locals_relocatable_test1.out): New target.
7023 (discard_locals_relocatable_test2.syms): New target.
7024 (discard_locals_relocatable_test2.out): New target.
7025 (various): Add missing ../ld-new dependencies.
7026 * testsuite/Makefile.in: Rebuild.
7028 2010-03-03 Nick Clifton <nickc@redhat.com>
7030 * po/fi.po: New Finnish translation.
7032 2010-03-01 Doug Kwan <dougkwan@google.com>
7034 * layout.cc (Layout::Layout): Force section types of .init_array*,
7035 .preinit_array* and .fini_array* sections.
7036 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7037 Fix check of return value of std::string::find.().
7038 (Output_section::Input_section_sort_compare::operator()): Remove
7039 comment about .init_array.
7040 (Output_section::Input_section_sort_init_fini_compare::operator()):
7042 (Output_section::sort_attached_input_sections): Handle .init_array
7043 and .fini_array specially.
7044 * output.h (Output_section::Inut_section_sort_compare): Update
7046 (Output_section::Input_section_sort_init_fini_compare): New struct.
7048 2010-02-26 Doug Kwan <dougkwan@google.com>
7050 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7051 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7052 * testsuite/debug_msg.sh: Avoid matching source line number for
7053 use of global variable undef_int.
7055 2010-02-26 Doug Kwan <dougkwan@google.com>
7057 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7058 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7059 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7060 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7061 * options.cc (General_options::General_options): Initialize member
7063 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7064 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7065 and rm_no_fix_v4bx.stdout
7066 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7067 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7068 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7069 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7070 and arm_no_fix_v4bx.
7071 * Makefile.in: Regenerate.
7072 * testsuite/arm_fix_v4bx.s: New file.
7073 * testsuite/arm_fix_v4bx.sh: Ditto.
7075 2010-02-24 Doug Kwan <dougkwan@google.com>
7077 * arm.cc (Target_arm::got_section): Make the .got section the first
7078 non RELRO section in the data segment.
7079 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7080 suffixes of section names.
7082 2010-02-24 Doug Kwan <dougkwan@google.com>
7084 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7085 flags and attributes merging if an input file is a binary file.
7086 * fileread.cc (Input_file::open): Record format of original file.
7087 * fileread.h (Input_file::Format): New enum type.
7088 (Input_file::Input_file): Initialize data member format_.
7089 (Input_file::format): New method definition.
7090 (Input_file::format_):: New data member.
7092 2010-02-24 Doug Kwan <dougkwan@google.com>
7094 * arm.cc (Arm_output_data_got): New class.
7095 (ARM_TCB_SIZE): New constant
7096 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7097 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7098 If user uses a script with a SECTIONS clause, issue only a warning
7099 for a misplaced EXIDX input section. Otherwise, issue an error.
7100 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
7102 (Target_arm::got_mode_index_entry): Handle static linking.
7103 (Target_arm::Scan::local): Ditto.
7104 (Target_arm::Scan::global): Ditto.
7105 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7106 all incorrectly implemented relocations.
7107 (Target_arm::fix_exidx_coverage): Pass layout to
7108 Arm_output_section::fix_exidx_coverage.
7109 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7110 from ".ARM.exidx." and ".ARM.extab.".
7112 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7114 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7115 section if it does not already exist.
7116 * attributes.cc (Attributes_section_data::Attributes_section_data):
7117 Don't crash if size is zero.
7119 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7120 Ian Lance Taylor <iant@google.com>
7122 * gold.cc (queue_middle_tasks): If no input files were opened,
7124 * workqueue.h (Task_function::Task_function): Assert that there is
7127 2010-02-22 Doug Kwan <dougkwan@google.com>
7129 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7130 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7131 types to avoid warnings due to different uint64_t implementations
7134 2010-02-21 Doug Kwan <dougkwan@google.com>
7136 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7137 handling of the maximum backward branch offset.
7138 (Arm_relocate_functions::thumb_branch_common): Ditto.
7139 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7140 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
7141 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
7142 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7143 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7144 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7145 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7146 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7147 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7148 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7149 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7150 thumb2_bl_out_of_range.o): New rules.
7151 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7152 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7153 thumb2_bl_out_of_range
7154 * testsuite/Makefile.in: Regenerate.
7155 * testsuite/arm_bl_in_range.s: New file.
7156 * testsuite/arm_bl_out_of_range.s: Ditto.
7157 * testsuite/arm_branch_in_range.sh: Ditto.
7158 * testsuite/arm_branch_range.t: Ditto.
7159 * testsuite/thumb2_branch_range.t: Ditto.
7160 * testsuite/thumb_bl_in_range.s: Ditto.
7161 * testsuite/thumb_bl_out_of_range.s: Ditto.
7162 * testsuite/thumb_branch_range.t: Ditto.
7164 2010-02-20 Sriraman Tallam <tmsriram@google.com>
7166 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7167 Add reloc offset information.
7168 * icf.cc (get_section_contents): Change iterators to point to the new
7169 vectors. Add reloc offset information to the contents.
7170 * icf.h (Icf::Sections_reachable_info): New typedef.
7171 (Icf::Sections_reachable_list): New typedef.
7172 (Icf::Offset_info): New typedef.
7173 (Icf::Reloc_info): New struct typedef.
7174 (Icf::Reloc_info_list): New typedef.
7175 (Icf::symbol_reloc_list): Delete method.
7176 (Icf::addend_reloc_list): Delete method.
7177 (Icf::section_reloc_list): Delete method.
7178 (Icf::reloc_info_list): New method.
7179 (Icf::reloc_info_list_): New member.
7181 2010-02-19 Doug Kwan <dougkwan@google.com>
7183 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7184 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7185 * arm.cc (Arm_relocation_functions): New forward declaration.
7186 (Target_arm::Target_arm): Initialize new data members
7187 got_mod_index_offset_ and tls_base_symbol_defined_.
7188 (Target_arm::Relocate::relocate_tls): New method.
7189 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7190 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7192 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
7193 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7194 (Target_arm::got_mod_index_offset_,
7195 Target_arm::tls_base_symbol_defined_): New data members.
7196 (Target_arm::Scan::local, Target::Scan::global,
7197 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7200 2010-02-18 Doug Kwan <dougkwan@google.com>
7202 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7203 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7204 text section as a parameter becuase some broken tools may not set
7205 the link in section header.
7206 (Target_arm::has_got_section): New method.
7207 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7208 without any mapping symbol as data only. Remove warning.
7209 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7210 link in its section header, try to discover the link by inspecting the
7211 REL31 relocation at the beginning of the section.
7212 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7214 (Target_arm::Scan::global): Treat any reference to the symbol
7215 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7217 2010-02-12 Sriraman Tallam <tmsriram@google.com>
7219 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7220 (Scan::global_reloc_may_be_function_pointer): New function.
7221 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7222 (Scan::global_reloc_may_be_function_pointer): New function.
7223 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7224 (Scan::global_reloc_may_be_function_pointer): New function.
7225 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7226 (Scan::global_reloc_may_be_function_pointer): New function.
7227 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7228 (Scan::global_reloc_may_be_function_pointer): New function.
7229 (Scan::possible_function_pointer_reloc): New function.
7230 (Target_x86_64::can_check_for_function_pointers): New function.
7231 * gc.h (gc_process_relocs): Scan relocation types to determine if
7232 function pointers were taken for targets that support it.
7233 * icf.cc (Icf::find_identical_sections): Include functions for
7234 folding in safe ICF whose pointer is not taken.
7235 * icf.h (Secn_fptr_taken_set): New typedef.
7236 (fptr_section_id_): New member.
7237 (section_has_function_pointers): New function.
7238 (set_section_has_function_pointers): New function.
7239 (check_section_for_function_pointers): New function.
7240 * options.h: Fix comment for safe ICF option.
7241 * target.h (can_check_for_function_pointers): New function.
7242 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7243 Modify icf_safe_test for X86-64.
7244 * testsuite/Makefile.in: Regenerate.
7245 * testsuite/icf_safe_so_test.cc: New file.
7246 * testsuite/icf_safe_so_test.sh: New file.
7247 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7248 (main): Change to take pointer to function kept_func_3.
7249 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7250 folding is done correctly for X86-64.
7252 2010-02-12 David S. Miller <davem@davemloft.net>
7254 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7255 is_symbolless parameter.
7256 (Output_reloc<SHT_REL>::is_symbolless): New.
7257 (Output_reloc<SHT_REL>::is_symbolless_): New.
7258 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7259 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7260 (Output_reloc<SHT_RELA>::is_symbolless): New.
7261 (Output_data_reloc::add_global): Handle is_symbolless.
7262 (Output_data_reloc::add_global_relative): Likewise.
7263 (Output_data_reloc::add_local): Likewise.
7264 (Output_data_reloc::add_local_relative): Likewise.
7265 (Output_data_reloc::add_symbolless_global_addend): New.
7266 (Output_data_reloc::add_symbolless_local_addend): New.
7267 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7269 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7270 instead of ->is_relative_
7271 (Output_reloc::write): Likewise.
7272 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7273 (Output_reloc::write_rel): Simplify.
7275 * sparc.cc (Target_sparc::Scan::local): Use
7276 ->add_symbolless_local_addend as needed.
7277 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7278 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7279 based upon relocation offset.
7281 2010-02-11 Doug Kwan <dougkwan@google.com>
7283 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7284 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7285 beginning of function.
7286 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7287 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7288 parameter is_32bit in calls to should_apply_static_reloc.
7289 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7290 (check_DATA): Add arm_abs_global.stdout.
7291 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7292 arm_abs_global.stdout): New rules.
7293 (MOSTLLYCLEANFILES): Add arm_abs_global
7294 * Makefile.in: Regenerate.
7295 * testsuite/arm_abs_global.s: New file.
7296 * testsuite/arm_abs_global.sh: Ditto.
7297 * testsuite/arm_abs_lib.s: Ditto.
7299 2010-02-11 Ian Lance Taylor <iant@google.com>
7301 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7303 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7304 Allocate_commons_task first.
7305 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7306 task, rather than symtab_lock_.
7307 (Gc_process_relocs::~Gc_process_relocs): New function.
7308 (Gc_process_relocs::is_runnable): Check this_blocker_.
7309 (Gc_process_relocs::locks): Use next_blocker_ rather than
7311 (Scan_relocs::~Scan_relocs): New function.
7312 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7314 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7316 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7317 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7318 constructor accordingly.
7319 (class Gc_process_relocs): Likewise.
7320 (class Scan_relocs): Likewise.
7321 * common.h (class Allocate_commons_task): Remove symtab_lock_
7322 field, and corresponding constructor parameter.
7323 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7325 (Allocate_commons_task::locks): Likewise.
7327 2010-02-11 Ian Lance Taylor <iant@google.com>
7329 * gold-threads.h (class Once): Define.
7330 (class Initialize_lock): Rewrite as child of Once.
7331 * gold-threads.cc (class Once_initialize): Define.
7332 (once_pointer_control): New static variable.
7333 (once_pointer, once_arg): New static variables.
7334 (c_run_once): New static function.
7335 (Once::Once, Once::run_once, Once::internal_run): New functions.
7336 (class Initialize_lock_once): Remove.
7337 (initialize_lock_control): Remove.
7338 (initialize_lock_pointer): Remove.
7339 (initialize_lock_once): Remove.
7340 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7341 (Initialize_lock::initialize): Rewrite.
7342 (Initialize_lock::do_run_once): New function.
7343 * archive.cc (Archive::interpret_header): Only clear name if it is
7345 * fileread.cc: Include "gold-threads.h"
7346 (file_counts_lock): New static variable.
7347 (file_counts_initialize_lock): Likewise.
7348 (File_read::release): Only increment counts when using --stats.
7349 Use a lock around the increment.
7350 * parameters.cc (class Set_parameters_target_once): Define.
7351 (set_parameters_target_once): New static variable.
7352 (Parameters::Parameters): Move here from parameters.h.
7353 (Parameters::set_target): Rewrite.
7354 (Parameters::set_target_once): New function.
7355 (Parameters::clear_target): Move here and rewrite.
7356 * parameters.h (class Parameters): Update declarations. Add
7357 set_parameters_target_once_ field.
7358 (Parameters::Parameters): Move to parameters.cc.
7359 (Parameters::clear_target): Likewise.
7360 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7362 (Start_group::~Start_group): New function.
7363 (Start_group::is_runnable): New function.
7364 (Start_group::locks, Start_group::run): New functions.
7365 (Finish_group::run): Change saw_undefined to size_t.
7366 * readsyms.h (class Start_group): Define.
7367 (class Finish_group): Change saw_undefined_ field to size_t.
7368 (Finish_group::Finish_group): Remove saw_undefined and
7369 this_blocker parameters. Change all callers.
7370 (Finish_group::set_saw_undefined): New function.
7371 (Finish_group::set_blocker): New function.
7372 * symtab.h (class Symbol_table): Change saw_undefined to return
7373 size_t. Change saw_undefined_ field to size_t.
7374 * target-select.cc (Set_target_once::do_run_once): New function.
7375 (Target_selector::Target_selector): Initialize set_target_once_
7376 field. Don't initialize lock_ and initialize_lock_ fields.
7377 (Target_selector::instantiate_target): Rewrite.
7378 (Target_selector::set_target): New function.
7379 * target-select.h (class Set_target_once): Define.
7380 (class Target_selector): Update declarations. Make
7381 Set_target_once a friend. Remove lock_ and initialize_lock_
7382 fields. Add set_target_once_ field.
7384 2010-02-10 Ian Lance Taylor <iant@google.com>
7386 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7388 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7389 (queue_middle_tasks): Add all blockers before queueing any tasks.
7390 (queue_final_tasks): Likewise.
7391 * token.h (Task_token::add_blockers): New function.
7392 * object.h (Input_objects::number_of_relobjs): New function.
7394 2010-02-10 Ian Lance Taylor <iant@google.com>
7396 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7397 shared, not if not position independent.
7398 * x86_64.cc (Relocate::relocate_tls): Likewise.
7399 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7400 (tls_pie_pic_test): New target.
7401 * testsuite/Makefile.in: Rebuild.
7403 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7404 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7405 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7406 * testsuite/Makefile.in: Rebuild.
7408 2010-02-09 David S. Miller <davem@davemloft.net>
7410 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7411 R_SPARC_RELATIVE using ->add_local_relative().
7412 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7414 * output.h (Output_data_dynamic::add_section_size): New method
7415 that takes two Output_data objects.
7416 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7417 entry param. Handle it in initializers.
7418 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7419 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7420 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7422 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7423 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7424 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7425 for dynrel_includes_plt.
7426 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7427 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7428 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7430 (Target_sparc::do_finalize_sections): Update to pass true for
7431 dynrel_includes_plt.
7432 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7433 output before .rela.plt
7434 (Target_powerpc::do_finalize_sections): Update to pass true for
7435 dynrel_includes_plt when 32-bit.
7437 2010-02-08 Doug Kwan <dougkwan@google.com>
7439 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7441 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7442 Arm_relobj::scan_section_for_cortex_a8_stubs,
7443 Arm_relobj::do_relocation_section): Instead of calling
7444 Output_section::output_address, use faster
7445 Arm_relobj::simple_input_section_output_address.
7447 2010-02-08 David S. Miller <davem@davemloft.net>
7449 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7450 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7451 relocation helper function.
7453 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7454 just like R_SPARC_GOT{10,13,22}.
7455 (Target_sparc::Scan::local): Likewise.
7456 (Target_sparc::Relocate:relocate): Likewise.
7458 2010-02-06 Ian Lance Taylor <iant@google.com>
7460 * configure.ac: Rewrite targetobjs duplicate removal code to use
7461 only shell constructs.
7462 * configure: Rebuild.
7464 2010-02-05 Doug Kwan <dougkwan@google.com>
7467 * arm.cc (Arm_relobj::section_is_scannable): New method.
7468 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7469 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7471 2010-02-04 Doug Kwan <dougkwan@google.com>
7474 * arm-reloc-property.cc (cstdio): Include.
7475 * configure.ac (targetobjs): Remove duplicates.
7476 * configure: Regenerate.
7477 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7478 big and little endian version for a given address size.
7480 2010-02-03 Doug Kwan <dougkwan@google.com>
7482 * arm-reloc-property.cc
7483 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7485 * arm-reloc-property.h
7486 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7487 New method definition.
7488 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7490 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7492 (GOT_PREL): Change implemented to Y.
7493 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7494 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7495 (Arm_relocate_functions::movw_abs_nc): Remove method.
7496 (Arm_relocate_functions::movt_abs): Ditto.
7497 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7498 (Arm_relocate_functions::thm_movt_abs): Ditto.
7499 (Arm_relocate_functions::movw_rel_nc): Ditto.
7500 (Arm_relocate_functions::movw_rel): Ditto.
7501 (Arm_relocate_functions::movt_rel): Ditto.
7502 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7503 (Arm_relocate_functions:thm_movw_rel): Ditto.
7504 (Arm_relocate_functions:thm_movt_rel): Ditto.
7505 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7506 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7507 New method definitions.
7508 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7509 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7510 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7511 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7512 (Target_arm::Relocate::relocate): Check for non-static or
7513 unimplemented relocation code and exit early. Change calls to
7514 Target_arm::reloc_uses_thumb_bit and
7515 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7516 instead. Refactor code to handle similar relocations to increase
7517 code sharing. Remove check for unsupported relocation code in switch
7519 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7520 relocation property table to find out size. Change error message to
7521 print out the name of a relocation code instead of the numeric value.
7522 (Target_arm::scan_reloc_for_stub): Use relocation property table
7523 instead of calling Target_arm::reloc_uses_thumb_bit().
7525 2010-02-02 Doug Kwan <dougkwan@google.com>
7527 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7528 types of relaxed input section.
7530 2010-02-02 Doug Kwan <dougkwan@google.com>
7532 * Makefile.am (HFILES): Add arm-reloc-property.h.
7534 (TARGETSOURCES): Add arm-reloc-property.cc
7535 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
7536 (libgold_a_SOURCES): $(DEFFILES)
7537 * Makefile.in: Regenerate.
7538 * arm-reloc-property.cc: New file.
7539 * arm-reloc-property.h: New file.
7540 * arm-reloc.def: New file.
7541 * arm.cc: Update comments.
7542 (arm-reloc-property.h): New included header.
7543 (arm_reloc_property_table): New global variable.
7544 (Target_arm::do_select_as_default_target): New method definition.
7545 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7546 arm-reloc-property to targ_extra_obj.
7547 * parameters.cc (set_parameters_target): Call
7548 Target::select_as_default_target().
7549 * target.h (Target::select_as_default_target): New method definition.
7550 (Target::do_select_as_default_target): Same.
7552 2010-02-01 Doug Kwan <dougkwan@google.com>
7554 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7555 first_output_text_section_.
7556 (Arm_exidx_fixup::first_output_text_section): New method definition.
7557 (Arm_exidx_fixup::first_output_text_section_): New data member.
7558 (Arm_exidx_fixup::process_exidx_section): Record the first text
7559 output section seen.
7560 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7561 and entsize in output section header.
7563 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7565 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7566 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7567 (Arm_relocate_functions::thm_alu11): New Method.
7568 (Arm_relocate_functions::thm_pc8): New Method.
7569 (Arm_relocate_functions::thm_pc12): New Method.
7570 (Target_arm::Scan::local): Handle the relocations.
7571 (Target_arm::Scan::global): Likewise.
7572 (Target_arm::Relocate::relocate): Likewise.
7573 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7575 2010-01-29 Doug Kwan <dougkwan@google.com>
7577 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7578 of relocation types as ld.
7580 2010-01-29 Doug Kwan <dougkwan@google.com>
7582 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7584 (Arm_relocate_functions::thumb_branch_common): Ditto.
7585 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7586 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7587 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7588 Arm_relocate_functions::jump24): Remove.
7589 (Target_arm::Relocate::relocate): Adjust code to call
7590 Arm_relocation_functions::arm_branch_common and
7591 Arm_relocation_functions::thumb_branch_common instead of their removed
7592 wrappers. Merge switch-cases together to reduce source code size.
7594 2010-01-29 Doug Kwan <dougkwan@google.com>
7596 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7597 output_local_symbol_count_needs_update_.
7598 (Arm_relobj::output_local_symbol_count_needs_update,
7599 Arm_relobj::set_output_local_symbol_count_needs_update,
7600 Arm_relobj::update_output_local_symbol_count): New methods.
7601 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7603 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7604 of pointed function as in a R_ARM_PREL31 relocation.
7605 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7606 for output local symbol count updating.
7607 (Target_arm::do_relax): Update output local symbol counts in objects
7609 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7611 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7613 * arm.cc: Added support for the ARM relocations:
7614 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7615 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7616 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7618 (Arm_relocate_functions::movw_rel): New method.
7619 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7620 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7622 (Arm_relocate_functions::thm_movw_rel): New method.
7623 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7625 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7627 (Target_arm::Scan::global): Likewise.
7628 (Target_arm::Relocate::relocate): Likewise.
7629 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7632 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7634 * arm.cc: Added support for ARM group relocations.
7635 (Target_arm::reloc_needs_sym_origin): New method.
7636 (Arm_relocate_functions::calc_grp_kn): New method.
7637 (Arm_relocate_functions::calc_grp_residual): New method.
7638 (Arm_relocate_functions::calc_grp_gn): New method.
7639 (Arm_relocate_functions::arm_grp_alu): New Method.
7640 (Arm_relocate_functions::arm_grp_ldr): New Method.
7641 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7642 (Arm_relocate_functions::arm_grp_ldc): New Method.
7643 (Target_arm::Scan::local): Handle the ARM group relocations.
7644 (Target_arm::Scan::global): Likewise.
7645 (Target_arm::Relocate::relocate): Likewise.
7646 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7649 2010-01-26 Doug Kwan <dougkwan@google.com>
7651 * arm.cc (set): Include.
7652 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7654 (Arm_output_section::Text_section_list): New type.
7655 (Arm_output_section::append_text_sections_to_list): New method.
7656 (Arm_output_section::fix_exidx_coverage): Ditto.
7657 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
7658 (Arm_relobj::convert_input_section_to_relaxed_section): Use
7659 Relobj::set_section_offset() instead of
7660 Sized_relobj::invalidate_section_offset().
7661 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
7662 parameter for section headers. Ignore relocation sections for
7663 unallocated sections and EXIDX sections.
7664 (Target_arm::fix_exidx_coverage): New method.
7665 (Target_arm::output_section_address_less_than): New type.
7666 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7667 linked text section instead of the EXIDX section.
7668 (Arm_output_section::create_stub_group): Add an assertion to check
7669 that this is not an EXIDX output section.
7670 (Arm_output_section::append_text_sections_to_list): New method.
7671 (Arm_output_section::fix_exidx_coverage): Ditto.
7672 (Arm_relobj::scan_sections_for_stubs): Adjust call to
7673 Arm_relobj::section_needs_reloc_stub_scanning.
7674 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7676 (Target_arm::fix_exidx_coverage): New method.
7677 * object.h (Relobj::set_output_section): New method.
7678 (Sized_relobj::invalidate_section_offset): Remove method.
7679 (Sized_relobj::do_invalidate_section_offset): Remove method.
7680 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7682 2010-01-25 Doug Kwan <dougkwan@google.com>
7684 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7685 Fix warning due to signed and unsigned comparison on a 32-bit host.
7687 2010-01-22 Doug Kwan <dougkwan@google.com>
7689 * arm.cc (Target_arm::do_relax): Record an output section for section
7690 offset adjustment it contains any stub table that has changed.
7691 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7692 offsets in an output section if necessary.
7693 * output.cc (Output_section::Output_section): Initialize
7694 section_offsets_need_adjustments_.
7695 (Output_section::add_input_section_for_script): Renamed to
7696 Output_section::add_simple_input_section.
7697 (Output_section::save_states): Add a comment.
7698 (Output_section::discard_states): New method defintion.
7699 (Output_section::adjust_section_offsets): Same.
7700 * output.h (Output_section::add_input_section_for_script): Renamed to
7701 Output_section::add_simple_input_section.
7702 (Output_section::discard_states): New method declaration.
7703 (Output_section::adjust_section_offsets): Same.
7704 (Output_section::section_offsets_need_adjustment,
7705 Output_section::set_section_offsets_need_adjustment): New method
7707 (Output_section::section_offsets_need_adjustment_): New data member.
7708 * script-sections.cc
7709 (Output_section_element_input::set_section_address): Adjust code for
7710 renaming of Output_section::add_input_section_for_script.
7711 (Orphan_output_section::set_section_address): Same.
7713 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7715 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7716 Fix_v4bx enum values .
7717 * gold/options.h (General_options): New option definitions.
7718 (General_options::fix_v4bx): New method.
7719 (General_options::Fix_v4bx): New enum.
7720 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7721 (General_options::parse_fix_v4bx_interworking): New method.
7723 2010-01-22 Doug Kwan <dougkwan@google.com>
7725 * arm.cc (Arm_exidx_fixup): New class.
7727 2010-01-21 Doug Kwan <dougkwan@google.com>
7729 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7731 (Arm_exidx_section_offset_map): New type.
7733 2010-01-21 Doug Kwan <dougkwan@google.com>
7735 * arm.cc (Arm_exidx_input_section): New class.
7736 (Arm_relobj::exidx_input_section_by_link,
7737 Arm_relobj::exidx_input_section_by_shndx,
7738 Arm_relobj::make_exidx_input_section): New methods.
7739 (read_arm_attributes_section): Remove.
7740 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7741 information about them.
7742 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7745 2010-01-20 Doug Kwan <dougkwan@google.com>
7747 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7748 Input_section_specifier to Section_id.
7749 (Target_arm::new_arm_input_section: Adjust code for change of key
7751 (Target_arm::find_arm_input_section): Ditto.
7752 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7753 (Section_id): Remove.
7754 (Garbage_collection::Section_id_hash): Remove.
7755 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7756 (Section_id): Remove.
7757 (Icf::Section_id_hash): Remove.
7758 * object.h (Section_id, Const_section_id, Section_id_hash,
7759 Const_section_id_hash): New type definitions.
7760 * output.cc (Output_section::add_relaxed_input_section): Change to
7761 use Const_section_id instead of Input_section_specifier as key type.
7762 (Output_section::add_merge_input_section): Ditto.
7763 (Output_section::build_relaxation_map): Change to use Section_id
7764 instead of Input_section_specifier as key type.
7765 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7767 (Output_section::convert_input_sections_to_relaxed_sections): Change
7768 to use Const_section_id instead of Input_section_specifier as key type.
7769 (Output_section::find_merge_section): Ditto.
7770 (Output_section::find_relaxed_input_section): Ditto.
7771 * output.h (Input_section_specifier): Remove class.
7772 (Output_section::Output_section_data_by_input_section_map): Change
7773 key type to Const_section_id.
7774 (Output_section::Output_relaxed_input_section_by_input_section_map):
7776 (Output_section::Relaxation_map): Change key type to Section_id.
7778 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7780 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7781 (class Arm_v4bx_stub): New class.
7782 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7783 (Stub_factory::make_arm_v4bx_stub): New method.
7784 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7785 (Stub_table::empty): Handle v4bx stubs.
7786 (Stub_table::add_arm_v4bx_stub): New method.
7787 (Stub_table::find_arm_v4bx_stub): New method.
7788 (Arm_relocate_functions::v4bx): New method.
7789 (Target_arm::fix_v4bx): New method.
7790 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7791 (Stub_table::relocate_stubs): Likewise.
7792 (Stub_table::do_write): Likewise.
7793 (Stub_table::update_data_size_and_addralign): Likewise.
7794 (Stub_table::finalize_stubs): Likewise.
7795 (Target_arm::Scan::local): Likewise.
7796 (Target_arm::Scan::global): Likewise.
7797 (Target_arm::do_finalize_sections): Likewise.
7798 (Target_arm::Relocate::relocate): Likewise.
7799 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7801 (Target_arm::scan_reloc_for_stub): Likewise.
7802 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7804 2010-01-19 Ian Lance Taylor <iant@google.com>
7806 * output.cc (Output_section_headers::do_sized_write): Write large
7807 segment count to sh_info field.
7808 (Output_file_header::do_sized_write): For large segment count,
7809 write PN_XNUM to e_phnum field.
7811 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7813 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7814 (Arm_relocate_functions::thm_jump8): New function.
7815 (Arm_relocate_functions::thm_jump11): New function.
7816 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7818 (Target_arm::Scan::global): Likewise.
7819 (Target_arm::Relocate::relocate): Likewise.
7820 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7823 2010-01-14 Doug Kwan <dougkwan@google.com>
7825 * arm.cc (map, utility): Include headers.
7826 (Target_arm::apply_cortex_a8_workaround): New method.
7827 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7828 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7829 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7830 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7831 the --[no-]fix-cortex-a8 command line options.
7832 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7833 (Target_arm::relocate_stub): Use addend in instruction template.
7834 * options.h (DEFINE_bool): Set the user-set flag.
7835 (General_options): Add --[no-]-fix-cortex options.
7836 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
7837 : Update fast look-up map after conversion.
7839 2010-01-14 Sriraman Tallam <tmsriram@google.com>
7841 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7842 in the first pass of do_layout.
7844 2010-01-13 Doug Kwan <dougkwan@google.com>
7846 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7847 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7848 apparent compiler problem of not folding static constant integral
7849 data members of elfcpp::Elf_sizes<32>.
7851 2010-01-13 Doug Kwan <dougkwan@google.com>
7853 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7854 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7855 Arm_relobj::scan_section_for_cortex_a8_erratum,
7856 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7857 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7858 sections to scan for relocation stubs into a new method
7859 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7860 relocation and Cortex-A8 stub scanning.
7861 (Target_arm::do_relax): Force stubs to be after stubbed sections
7862 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
7863 the beginning of a new relaxation pass. Update a comment.
7864 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7866 2010-01-12 Ian Lance Taylor <iant@google.com>
7868 * target-reloc.h (visibility_error): New inline function.
7869 (relocate_section): Call visibility_error.
7870 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7871 (MOSTLYCLEANFILES): Likewise.
7872 (protected_4_pic.o, protected_3.err): New targets.
7873 * testsuite/protected_4.cc: New file.
7875 2010-01-12 Doug Kwan <dougkwan@google.com>
7877 * arm.cc (Cortex_a8_reloc): New class.
7878 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7879 and cortex_a8_relocs_info_.
7880 (Target_arm::fix_cortex_a8): New method definition.
7881 (Target_arm::Cortex_a8_relocs_info): New type.
7882 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7883 New data member declarations.
7884 (Target_arm::scan_reloc_for_stub): Record information about
7885 relocations for THUMB branches that might be exempted from the
7886 Cortex-A8 workaround.
7887 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7888 at the beginning of a relaxation pass.
7890 2010-01-12 Doug Kwan <dougkwan@google.com>
7892 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7893 (Arm_relobj::Mapping_symbol_position,
7894 Arm_reloj::Mapping_symbol_position_less,
7895 Arm_relobj::Mapping_symbols_info): New types.
7896 (Target_arm::is_mapping_symbol_name): New method definition.
7897 (Arm_relobj::do_count_local_symbols): Save information about mapping
7900 2010-01-11 Doug Kwan <dougkwan@google.com>
7902 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7903 Arm_relocate_functions::thumb32_branch_upper,
7904 Arm_relocate_functions::thumb32_branch_lower,
7905 Arm_relocate_functions::thumb32_cond_branch_offset,
7906 Arm_relocate_functions::thumb32_cond_branch_upper,
7907 Arm_relocate_functions::thumb32_cond_branch_lower,
7908 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7909 branch offset encoding.
7910 (Arm_relocate_functions::thumb_branch_common): Use new branch
7911 offset encoding methods to avoid code duplication.
7912 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7913 (Stub_addend_reader::operator()): Use new branch encoding method
7914 to avoid code duplication.
7916 2010-01-11 Doug Kwan <dougkwan@google.com>
7918 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7919 (Target_arm::do_finalize_sections): Define special EXIDX section
7920 symbols only if referenced.
7921 * gc.h (Garbage_collection::add_reference): New method.
7922 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7925 2010-01-11 Ian Lance Taylor <iant@google.com>
7927 * script.cc (Version_script_info::build_expression_list_lookup):
7928 Change complaing about duplicate wildcard match from error to
7931 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7933 (Version_script_info::Version_script_info): Initialize globs_,
7934 default_version_, default_is_global_, and exact_. Don't
7935 initialize globals_ or locals_.
7936 (Version_script_info::build_lookup_tables): Build local symbols
7938 (Version_script_info::unquote): New function.
7939 (Version_script_info::add_exact_match): New function.
7940 (Version_script_info::build_expression_list_lookup): Remove lookup
7941 parameter. Add is_global parameter. Change all callers. Handle
7942 wildcard pattern specially. Unquote pattern. Call
7944 (Version_script_info::get_name_to_match): New function.
7945 (Version_script_info::get_symbol_version): New function.
7946 (Version_script_info::get_symbol_version_helper): Remove.
7947 (Version_script_info::check_unmatched_names): Call unquote.
7948 * script.h (class Version_script_info): Change get_symbol_version
7949 to be non-inline and add is_global parameter; change all callers.
7950 Rewrite symbol_is_local. Update declarations. Define struct
7951 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7952 Remove globals_ and locals_ members. Add exact_, globs_,
7953 default_version_, is_global_.
7954 (Version_script_info::Glob): Remove pattern, add expression and
7955 is_global. Update constructor. Change all callers.
7956 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7958 (Versions::symbol_section_contents): If a symbol is undefined, or
7959 defined in a dynamic object, set the version index to
7961 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7963 (Symbol_table::add_from_pluginobj): Likewise.
7964 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7966 2010-01-11 Doug Kwan <dougkwan@google.com>
7968 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7969 (incremental_dump_LDADD): Add linking option for libintl.
7970 * Makefile.in: Regenerate.
7972 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7975 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7977 * testsuite/Makefile.in: Regenerated.
7979 2010-01-10 Doug Kwan <dougkwan@google.com>
7981 * options.h (DEFINE_var): Use parentheses around argument varname__
7982 in macro body to avoid any unintended subsequent substitutions.
7984 2010-01-10 Ian Lance Taylor <iant@google.com>
7986 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7987 candidates before doing symbol resolution.
7989 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7990 ODR candidates if only one is weak.
7992 2010-01-08 Ian Lance Taylor <iant@google.com>
7994 * script.cc (Version_script_info::build_expression_list_lookup):
7995 Don't warn about ambiguous version, just record the ambiguity.
7996 (Version_script_info::get_symbol_version_helper): Give error if
7997 version is ambiguous.
7999 2010-01-08 Doug Kwan <dougkwan@google.com>
8001 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
8002 prev_data_size_ and prev_addralign_. Remove initializer for
8003 deleted data member has_been_changed_.
8004 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8005 to determine if the table is empty.
8006 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8008 (Stub_table::add_reloc_stub): Define method in class definition
8009 instead of just declaring it there.
8010 (Stub_table::add_cortex_a8_stub): New method definition.
8011 (Stub_table::update_data_size_and_addralign): Ditto.
8012 (Stub_table::finalize_stubs): Ditto.
8013 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8014 (Stub_table::do_addralign_): Return address alignment in the
8015 (Stub_table::do_reset_address_and_file_offset): Define method in
8016 class definition instead of declaring it there. Set current data
8017 size to be the data size of the previous pass.
8018 (Stub_table::set_final_data_size): Use current data size as the
8020 (Stub_table::relocate_stub): Change parameter type of stub from
8021 Reloc_stub pointer to Stub pointer.
8022 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8023 (Stub_table::Cortex_a8_stub_list): New typedef.
8024 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8025 Stub_table::prev_addralign_): New data member.
8026 (Arm_relobj::Arm_relobj): Initialize data member
8027 section_has_cortex_a8_workaround_.
8028 (Arm_relobj::section_has_cortex_a8_workaround,
8029 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8031 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8033 (Target_arm::relocate_stub): Change parameter type of stub from
8034 Reloc_stub pointer to Stub pointer.
8035 (Insn_template::size, Insn_template::alignment): Handle
8036 THUMB16_SPECIAL_TYPE.
8037 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8038 Stub_table::update_data_size_and_addralign,
8039 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8041 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8042 (Stub_table::do_write): Ditto.
8043 (Target_arm::do_relax): Adjust code for changes in Stub_table.
8045 2010-01-08 Ian Lance Taylor <iant@google.com>
8048 * symtab.h (class Symbol): Remove fields is_target_special_ and
8049 has_plt_offset_. Add field is_defined_in_discarded_section_.
8050 (Symbol::is_defined_in_discarded_section): New function.
8051 (Symbol::set_is_defined_in_discarded_section): New function.
8052 (Symbol::has_plt_offset): Rewrite.
8053 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8054 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8055 Don't initialize is_target_special_ or has_plt_offset_.
8056 Initialize is_defined_in_discarded_section_.
8057 (Symbol_table::add_from_relobj): If appropriate, set
8058 is_defined_in_discarded_section.
8059 * resolve.cc (Symbol::override_base_with_special): Don't test
8060 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8061 * target-reloc.h (relocate_section): Do special handling for
8062 symbols defined in discarded sections for global symbols as well
8065 2010-01-08 Ian Lance Taylor <iant@google.com>
8067 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8068 the SHT_SYMTAB case.
8070 2010-01-08 Ian Lance Taylor <iant@google.com>
8072 * object.cc (Sized_relobj::do_layout): Don't get confused if
8073 layout_eh_frame returns NULL.
8075 2010-01-08 Ian Lance Taylor <iant@google.com>
8078 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8079 dynamic symbol table, use the normal symbol table.
8080 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8083 2010-01-08 Ian Lance Taylor <iant@google.com>
8086 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8089 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8091 * version.cc (print_version): Change to "Copyright 2010".
8093 2010-01-08 Ian Lance Taylor <iant@google.com>
8097 * i386.cc (class Target_i386): Change return type of plt_section
8099 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8100 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8101 tls_desc_rel_ field.
8102 (Output_data_plt_i386::rel_tls_desc): New function.
8103 (Target_i386::rel_tls_desc_section): New function.
8104 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8105 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8106 R_386_TLS_DESC reloc in rel_tls_desc_section.
8107 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8108 Define struct Tlsdesc_info.
8109 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8110 (Target_x86_64::do_reloc_symbol_index): New function.
8111 (Target_x86_64::add_tlsdesc_info): New function.
8112 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8113 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8115 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8117 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8118 (Target_x86_64::rela_tlsdesc_section): New function.
8119 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8121 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8122 (Target_x86_64::do_reloc_addend): New function.
8123 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8124 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8125 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8126 (Output_reloc::type): New function.
8127 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8128 (Output_reloc::is_target_specific): New function.
8129 (Output_reloc::target_arg): New function.
8130 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8131 absolute relocs and target specific relocs.
8132 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8133 add_target_specific.
8134 (class Output_data_reloc) [SHT_RELA]: Likewise.
8135 * output.cc (Output_reloc::Output_reloc): Add four new versions
8136 for absolute relocs and target specific relocs.
8137 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8138 (Output_reloc::get_symbol_index): Likewise.
8139 (Output_reloc::local_section_offset): Check that local_sym_index_
8140 is not TARGET_CODE or 0.
8141 (Output_reloc::symbol_value): Likewise.
8142 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8144 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8145 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8147 * layout.cc (add_target_dynamic_tags): Use output section for
8148 DT_PLTRELSZ and DT_JMPREL.
8150 2010-01-07 Ian Lance Taylor <iant@google.com>
8153 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8155 (class Output_data_reloc_generic): Define.
8156 (class Output_data_reloc_base): Change base class to
8157 Output_data_reloc_generic. Change add() method to call
8158 bump_relative_reloc_count for a relative reloc. Remove
8160 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8162 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8163 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8165 * layout.h (class Layout): Update declaration.
8167 2010-01-07 Ian Lance Taylor <iant@google.com>
8169 * output.h (class Output_data): Add const version of
8170 output_section and do_output_section.
8171 (class Output_section_data): Add const version of
8173 (class Output_section): Likewise.
8174 * layout.cc (Layout::add_target_dynamic_tags): New function.
8175 * layout.h (class Layout): Update declarations.
8176 * arm.cc (Target_arm::do_finalize_sections): Use
8177 add_target_dynamic_tags.
8178 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8179 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8180 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8181 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8183 2010-01-07 Ian Lance Taylor <iant@google.com>
8186 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8189 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8190 Ian Lance Taylor <iant@google.com>
8193 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8194 Xindex::read_symtab_xindex.
8196 2010-01-07 Doug Kwan <dougkwan@google.com>
8198 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8199 (Insn_template::thumb16_bcond_insn): New method declaration.
8200 (Insn_template): Fix spelling.
8201 (Stub::thumb16_special): New method declaration.
8202 (Stub::do_write): Define virtual method which was previously pure
8204 (Stub::do_thumb16_special): New method declaration.
8205 (Stub::do_fixed_endian_write): New template member.
8206 (Reloc_stub::do_write): Remove.
8207 (Reloc_stub::do_fixed_endian_write): Remove.
8208 (Cortex_a8_stub): New class definition.
8209 (Stub_factory::make_cortex_a8_stub): New method definition.
8210 (Stub_factory::Stub_factory): Add missing static storage class
8211 qualifier for elf32_arm_stub_a8_veneer_blx.
8213 2010-01-07 Ian Lance Taylor <iant@google.com>
8216 * options.h (class General_options): Add --warn-unresolved-symbols
8217 and --error-unresolved-symbols.
8218 * errors.cc (Errors::undefined_symbol): Implement
8219 --warn-unresolved-symbols.
8221 * options.h (class General_options): Add -z text and -z textoff.
8222 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8224 2010-01-06 Sriraman Tallam <tmsriram@google.com>
8226 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8227 (Garbage_collection::cident_sections): New function.
8228 (Garbage_collection::add_cident_section): New function.
8229 (Garbage_collection::cident_sections_): New member.
8230 (gc_process_relocs): Add references to sections whose names are C
8232 * gold.h (cident_section_start_prefix): New constant.
8233 (cident_section_stop_prefix): New constant.
8234 (is_cident): New function.
8235 * layout.cc (Layout::define_section_symbols): Replace string constants
8236 with the newly defined constants.
8237 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8239 * testsuite/Makefile.am: Add gc_orphan_section_test.
8240 * testsuite/Makefile.in: Regenerate.
8241 * testsuite/gc_orphan_section_test.cc: New file.
8242 * testsuite/gc_orphan_section_test.sh: New file.
8244 2010-01-06 Ian Lance Taylor <iant@google.com>
8247 * options.h (class General_options): Add --warn-shared-textrel.
8248 * layout.cc (Layout::finish_dynamic_section): Implement
8249 --warn-shared-textrel.
8252 * options.h (class General_options): Add --warn-multiple-gp.
8254 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8256 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8257 $(THREADSLIB) and $(LIBDL).
8258 * Makefile.in: Rebuild.
8260 2010-01-06 Ian Lance Taylor <iant@google.com>
8263 * options.cc (General_options::parse_section_start): New function.
8264 (General_options::section_start): New function.
8265 (General_options::General_options): Initialize all members.
8266 * options.h: Include <map>
8267 (class General_options): Add --section-start. Add section_starts_
8269 * layout.cc (Layout::attach_allocated_section_to_segment): If
8270 --section-start was used, set the address of the segment. Remove
8271 local sort_sections.
8272 (Layout::relaxation_loop_body): If the address of the load segment
8273 has been set by --section-start, don't use it.
8274 * output.h (Output_segment::update_flags_for_output_section): New
8276 * output.cc (Output_segment::add_output_section): Call
8277 update_flags_for_output_section.
8279 2010-01-05 Ian Lance Taylor <iant@google.com>
8282 * options.h (class General_options): Add --undefined-version.
8283 * script.cc (struct Version_expression): Add was_matched_by_symbol
8285 (Version_script_info::matched_symbol): New function.
8286 (Version_script_info::get_symbol_version_helper): Call
8288 (Version_script_info::check_unmatched_names): New function.
8289 * script.h (class Version_script_info): Update declarations.
8290 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8292 * options.h (class General_options): Use DEFINE_bool_alias for
8293 allow_multiple_definition.
8294 * resolve.cc (Symbol_table::should_override): Don't test
8295 allow_multiple_definition.
8298 * options.h (class General_options): Add --cref.
8299 * main.cc (main): Print cref table if --cref. Don't close mapfile
8300 until after printing cref table.
8301 * cref.cc: Include "symtab.h".
8302 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8303 (Cref_table_compare::operator()): New function.
8304 (Cref_inputs::gather_cref): New function.
8305 (filecol): New static const.
8306 (Cref_inputs::print_cref): New function.
8307 (Cref::print_cref): New function.
8308 * cref.h: Include <cstdio>.
8309 (class Cref): Update declarations.
8310 * mapfile.h (Mapfile::file): New function.
8311 * object.h (class Object): Define Symbols. Declare virtual
8312 do_get_global_symbols.
8313 (Object::get_global_symbols): New function.
8314 * object.cc (Input_objects::add_object): Pass object to cref_ if
8316 (Input_objects::archive_start): Likewise.
8317 (Input_objects::archive_stop): Likewise.
8318 (Input_objects::print_cref): New function.
8319 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8320 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8322 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8324 * plugin.h (class Sized_pluginobj): Update declarations.
8326 2010-01-05 Ian Lance Taylor <iant@google.com>
8328 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8329 to is_default_version. Rename insdef to insdefault.
8330 (Symbol_table::add_from_relobj): Rename def to is_default_version
8331 and local to is_forced_local.
8332 (Symbol_table::add_from_pluginobj): Likewise.
8333 (Symbol_table::add_from_dynobj): Likewise.
8334 (Symbol_table::define_special_symbol): Rename insdef to
8337 2010-01-04 Ian Lance Taylor <iant@google.com>
8340 * options.h (class General_options): Add
8341 --allow-multiple-definition and -z muldefs.
8342 * resolve.cc (Symbol_table::should_override): Don't warn about a
8343 multiple symbol definition if --allow-multiple-definition or -z
8347 * options.h (class General_options): Add --add-needed and
8348 --copy-dt-needed-entries. Tweak --as-needed help entry.
8349 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8350 error if --copy-dt-needed-entries aka --add-needed is used and
8351 would cause a change in behaviour.
8354 * options.h (class General_options): Add -G as a short version of
8355 --shared. Add no-op options -assert, -g, and -i.
8357 2010-01-04 Sriraman Tallam <tmsriram@google.com>
8359 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8360 check for .text or .gnu.linkonce.t sections.
8361 * icf.cc (Icf::find_identical_sections): Ditto.
8362 Change the detection for mangled function name within the section
8364 * icf.h (is_section_foldable_candidate): New function.
8366 2009-12-30 Ian Lance Taylor <iant@google.com>
8369 * options.h (class General_options): Permit two dashes with
8370 --retain-symbols-file.
8372 2009-12-30 Ian Lance Taylor <iant@google.com>
8375 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8376 don't put the file header and segment headers in the text
8380 * common.cc (Sort_commons::operator()): Stabilize sort when both
8382 (Symbol_table::do_allocate_commons_list): When allocating common
8383 symbols, skip a symbol which is no longer common.
8384 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8385 an object before checking its type.
8386 * testsuite/common_test_2.c: New file.
8387 * testsuite/common_test_3.c: New file.
8388 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8389 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8390 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8391 (common_test_2_pic.o, common_test_2.so): New targets.
8392 (common_test_3_pic.o, common_test_3.so): New targets.
8393 * testsuite/Makefile.in: Rebuild.
8396 * script.cc (read_input_script): If we see a new SECTIONS clause,
8397 and we have added an input section, give an error.
8398 * layout.h (class Layout): Add have_added_input_section function.
8399 Add have_added_input_section_ field.
8400 * layout.cc (Layout::Layout): Initialize
8401 have_added_input_section_.
8402 (Layout::layout): Set have_added_input_section_.
8403 (Layout::layout_eh_frame): Likewise.
8405 2009-12-30 Ian Lance Taylor <iant@google.com>
8408 * options.h (class General_options): Add --sort-common option.
8409 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8410 * common.cc (Sort_common): Add sort_order parameter to
8411 constructor. Add sort_order_ field.
8412 (Sort_commons::operator): Check sort_order_.
8413 (Symbol_table::allocate_commons): Determine the sort order.
8414 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8416 (Symbol_table::do_allocate_commons_list): Likewise.
8418 2009-12-30 Ian Lance Taylor <iant@google.com>
8421 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8422 symbols from this object, don't change the visibility of an
8424 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8426 2009-12-30 Ian Lance Taylor <iant@google.com>
8429 * script.h (class Version_script_info): Define Language enum.
8430 Update declarations. Define Glob, Exact, and Lookup types. Add
8431 new fields globals_, locals_, and is_finalized_.
8432 * script.cc: Various formatting fixes.
8433 (class Parser_closure): Change language_stack_ from a vector of
8434 std::string to one of Version_script_info::Language. Adjust all
8436 (class Lazy_demangler): Remove.
8437 (struct Version_expression): Change language from std::string to
8438 Version_script_info::Language.
8439 (Version_script_info::Version_script_info): New function.
8440 (Version_script_info::~Version_script_info): Don't call clear.
8441 (Version_script_info::finalize): New function.
8442 (Version_script_info::build_lookup_tables): New function.
8443 (Version_script_info::build_expression_list_lookup): New
8445 (Version_script_info::get_symbol_version_helper): Rewrite to use
8447 (Version_script_info::print_expression_list): Adjust to use
8448 Version_script_info::Language.
8449 (script_push_lex_into_version_mode): Check that the version script
8450 has not been finalized.
8451 (version_script_push_lang): Change language string to
8452 Version_script_info::Language.
8453 * options.cc (Command_line::version_script): New function.
8454 * options.h (class General_options): Add finalize_dynamic_list
8455 function. Change version_script from declaration to definition.
8456 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8457 * testsuite/version_script.map: Remove duplicate def of foo.
8458 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8460 * testsuite/Makefile.in: Rebuild.
8462 2009-12-30 Ian Lance Taylor <iant@google.com>
8465 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8466 if the input symbol index is 0, make the output symbol index 0.
8468 2009-12-30 Ian Lance Taylor <iant@google.com>
8471 * options.h (class General_options): Add -x/--discard-all.
8472 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8473 --discard-all. If the local symbol needs a dynamic entry, check
8474 that before handling --discard-locals.
8476 2009-12-30 Ian Lance Taylor <iant@google.com>
8479 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8481 (Output_segment::add_output_section): Don't change the flags if
8485 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8486 GNU hash table if they need a dynamic value. Otherwise, don't add
8487 them if they are defined in a dynamic object or are forced local.
8489 2009-12-29 Ian Lance Taylor <iant@google.com>
8492 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8493 .gnu.hash table for a 32-bit target.
8496 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8497 regular and a dynamic object only needs a dynamic symbol table
8498 entry if it is externally visible.
8501 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8502 constructor. Add global_offset_table_ field.
8503 (Target_i386::got_section): Set global_offset_table_.
8504 (Target_i386::do_finalize_sections): Set global_offset_table_
8506 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8507 in constructor. Add global_offset_table_ field.
8508 (Target_x86_64::got_section): Set global_offset_table_.
8509 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8512 * layout.cc (Layout::Layout): Initialize increase_relro_.
8513 (Layout::get_output_section): Add is_relro, is_last_relro, and
8514 is_first_non_relro parameters. Change all callers.
8515 (Layout::choose_output_section): Likewise.
8516 (Layout::add_output_section_data): Likewise.
8517 (Layout::make_output_section): Likewise.
8518 (Layout::set_segment_offsets): Clear increase_relro when using a
8520 * layout.h (class Layout): Add increase_relro method. Add
8521 increase_relro_ field. Update declarations.
8522 * output.cc (Output_section::Output_section): Initialize
8523 is_last_relro_ and is_first_non_relro_.
8524 (Output_segment::add_output_section): Group relro sections is
8525 do_sort is true. Handle is_last_relro and is_first_non_relro.
8526 (Output_segment::maximum_alignment): Remove relro handling.
8527 (Output_segment::set_section_addresses): Add increase_relro
8528 parameter. Change all callers. Add initial alignment to align
8529 relro sections on separate page. Remove old relro handling.
8530 (Output_segment::set_section_list_addresses): Remove in_relro
8531 parameter. Change all callers.
8532 (Output_segment::set_offset): Add increase parameter. Change all
8533 callers. Remove old relro handling.
8534 * output.h (class Output_section): Add new methods: is_last_relro,
8535 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8536 Add is_last_relro_ and is_first_non_relro_ fields.
8537 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8538 Create separate .got.plt section. Call increase_relro.
8539 * x86_64.cc (Target_x86_64::got_section): Likewise.
8540 * testsuite/relro_script_test.t: Add .got.plt.
8543 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8544 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8545 (Layout::finalize): Call set_dynamic_symbol_size.
8546 (Layout::set_dynamic_symbol_size): New function.
8547 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8548 set_dynamic_symbol_size.
8551 * output.h (class Output_section): Add is_entsize_zero_ field.
8552 * output.cc (Output_section::Output_section): Initialize
8554 (Output_section::set_entsize): If two different entsizes are
8555 requested, force it to zero.
8556 (Output_section::add_input_section): Set flags for .debug_str
8557 before updating section flags. Set entsize.
8558 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8559 and SHF_STRING if all input sections have those flags.
8561 2009-12-29 Rafael Espindola <espindola@google.com>
8563 * main.cc (main): Fix the sys time reporting.
8564 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8567 2009-12-29 Sriraman Tallam <tmsriram@google.com>
8569 * options.cc (General_options::parse_version): Allow -v to exit
8570 without an error if there is nothing to link.
8572 2009-12-29 Ian Lance Taylor <iant@google.com>
8574 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8575 using a version of gcc before 4.1.
8576 * configure: Rebuild.
8578 2009-12-28 Chris Demetriou <cgd@google.com>
8580 * attributes.cc (Output_attributes_section_data::do_write): Use
8581 std::vector::front rather than std::vector::data.
8583 2009-12-28 Ian Lance Taylor <iant@google.com>
8585 * symtab.h (class Symbol_table): Add enum Defined.
8586 * resolve.cc (Symbol_table::should_override): Add defined
8587 parameter. Change all callers. Test whether object is NULL
8588 before calling a method on it.
8589 (Symbol_table::report_resolve_problem): Add defined parameter.
8591 (Symbol_table::should_override_with_special): Likewise.
8592 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8593 parameter. Change all callers.
8594 (Symbol_table::do_define_in_output_data): Likewise.
8595 (Symbol_table::define_in_output_segment): Likewise.
8596 (Symbol_table::do_define_in_output_segment): Likewise.
8597 (Symbol_table::define_as_constant): Likewise.
8598 (Symbol_table::do_define_as_constant): Likewise.
8599 * script.h (class Symbol_assignment): Add is_defsym parameter to
8600 constructor; change all callers.
8601 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8602 parameter. Change all callers. Add is_defsym_ field.
8603 (class Parser_closure): Add parsing_defsym parameter to
8604 constructor; change all callers. Add parsing_defsym accessor
8605 function. Add parsing_defsym_ field.
8607 2009-12-28 Ian Lance Taylor <iant@google.com>
8609 * gold.cc (queue_middle_tasks): Fix formatting.
8610 * object.cc (Relobj::is_section_name_included): Likewise.
8612 2009-12-23 Ian Lance Taylor <iant@google.com>
8614 * i386.cc (Target_i386::do_calls_non_split): Recognize
8615 -fsplit-stack prologue for a function with a static chain.
8616 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8617 -fsplit-stack prologue when using %r11.
8619 2009-12-21 Sriraman Tallam <tmsriram@google.com>
8621 * options.cc (General_options::parse_version): Make -v continue and do
8622 the link like GNU ld does.
8624 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
8626 * Makefile.am (CCFILES): Add timer.cc.
8627 (HFILES): Add timer.h.
8628 * configure.ac: Check for sysconf and times.
8629 * main.cc: include timer.h.
8630 (main): Use Timer instead of get_run_time.
8633 * workqueue.cc: include timer.h.
8634 (Workqueue::find_and_run_task):
8635 Report user, sys and wall time.
8636 * Makefile.in: Regenerate.
8637 * config.in: Regenerate.
8638 * configure: Regenerate.
8640 2009-12-16 Doug Kwan <dougkwan@google.com>
8642 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8644 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8645 relaxed input sections.
8646 * output.cc (Output_section::find_relaxed_input_section): Change
8647 return type to Output_relaxed_input_section pointer. Adjust code
8648 for new type of relaxed_input_section_map_.
8649 * output.h (Output_section::find_relaxed_input_section): Change
8650 return type to Output_relaxed_input_section pointer.
8651 (Output_section::Output_relaxed_input_section_by_input_section_map):
8653 (Output_section::relaxed_input_section_map_): Change type to
8654 Output_section::Output_relaxed_input_section_by_input_section_map.
8655 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8658 2009-12-15 Ian Lance Taylor <iant@google.com>
8660 * layout.cc (Layout::create_shstrtab): Only write out after input
8661 sections if we are compressing debug sections.
8663 2009-12-15 Ian Lance Taylor <iant@google.com>
8665 * archive.cc (Archive::add_symbols): Only look up a symbol without
8666 a version if there is, in fact, a version.
8668 2009-12-14 Ian Lance Taylor <iant@google.com>
8670 Revert -Wshadow changes, all changes from:
8671 2009-12-11 Doug Kwan <dougkwan@google.com>
8672 2009-12-11 Nick Clifton <nickc@redhat.com>
8673 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8675 2009-12-11 Doug Kwan <dougkwan@google.com>
8677 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8679 * attributes.cc (Object_attribute::size): Ditto.
8680 (Attributes_section_data::size): Ditto.
8681 (Attributes_section_data::Attributes_section_data): Ditto.
8682 (Output_attributes_section_data::do_write): Ditto.
8683 * attributes.h (Object_attribute::set_type): Ditto.
8684 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8686 2009-12-11 Nick Clifton <nickc@redhat.com>
8688 * archive.cc: Fix shadowed variable warnings.
8690 * compressed_output.cc: Likewise.
8691 * compressed_output.h: Likewise.
8692 * configure: Likewise.
8693 * dwarf_reader.cc: Likewise.
8694 * dynobj.cc: Likewise.
8695 * dynobj.h: Likewise.
8696 * ehframe.cc: Likewise.
8697 * ehframe.h: Likewise.
8698 * errors.cc: Likewise.
8699 * expression.cc: Likewise.
8700 * fileread.cc: Likewise.
8701 * fileread.h: Likewise.
8702 * freebsd.h: Likewise.
8703 * i386.cc: Likewise.
8705 * incremental.h: Likewise.
8706 * layout.cc: Likewise.
8707 * layout.h: Likewise.
8708 * mapfile.cc: Likewise.
8709 * merge.cc: Likewise.
8710 * merge.h: Likewise.
8711 * object.cc: Likewise.
8712 * object.h: Likewise.
8713 * options.h: Likewise.
8714 * output.cc: Likewise.
8715 * output.h: Likewise.
8716 * parameters.cc: Likewise.
8717 * plugin.cc: Likewise.
8718 * powerpc.cc: Likewise.
8719 * reduced_debug_output.cc: Likewise.
8720 * reduced_debug_output.h: Likewise.
8721 * reloc.cc: Likewise.
8722 * reloc.h: Likewise.
8723 * resolve.cc: Likewise.
8724 * script-sections.cc: Likewise.
8725 * script.cc: Likewise.
8726 * script.h: Likewise.
8727 * sparc.cc: Likewise.
8728 * symtab.cc: Likewise.
8729 * symtab.h: Likewise.
8730 * target-select.cc: Likewise.
8731 * target-select.h: Likewise.
8732 * token.h: Likewise.
8733 * workqueue.cc: Likewise.
8734 * workqueue.h: Likewise.
8735 * x86_64.cc: Likewise.
8737 2009-12-10 Doug Kwan <dougkwan@google.com>
8739 * arm.cc (attributes.h): New include.
8740 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8741 (Arm_relobj::~Arm_relobj): Delete object pointed by
8742 attributes_section_data_.
8743 (Arm_relobj::attributes_section_data): New method definition.
8744 (Arm_relobj::attributes_section_data_): New data member declaration.
8745 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8746 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8747 attributes_section_data_.
8748 (Arm_dynobj::attributes_section_data): New method definition.
8749 (Arm_dynobj::attributes_section_data_): New data member declaration.
8750 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8751 initialization value of may_use_blx_ to false.
8752 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
8753 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8754 object attributes to compute results instead of hard-coding.
8755 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8756 Target_arm::get_secondary_compatible_arch,
8757 Target_arm::set_secondary_compatible_arch
8758 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8759 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8760 New method declarations.
8761 (Target_arm::get_aeabi_object_attribute): New method definition.
8762 (Target_arm::attributes_section_data_): New data member declaration.
8763 (read_arm_attributes_section): New template definition.
8764 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8765 (Arm_dynobj::do_read_symbols): Ditto.
8766 (Target_arm::do_finalize_sections): Merge attributes sections from
8767 input. Check for BLX use after attributes section merging.
8768 Fix __exidx_start and __exidx_end visibility. Create an
8769 .ARM.attributes section if necessary.
8770 (Target_arm::get_secondary_compatible_arch,
8771 Target_arm::set_secondary_compatible_arch,
8772 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8773 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
8774 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
8775 New method definitions.
8777 2009-12-09 Ian Lance Taylor <iant@google.com>
8779 * plugin.cc (Plugin::load): Don't cast from void* to a function
8782 2009-12-09 Ian Lance Taylor <iant@google.com>
8784 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8787 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8789 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8790 Replace two_file_shared_1.so with two_file_shared_2.so.
8791 * testsuite/Makefile.in: Regenerated.
8793 2009-12-08 Doug Kwan <dougkwan@google.com>
8795 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8796 (HFILES): Add attributes.h and int_encoding.h.
8797 * Makefile.in: Regenerate.
8798 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8799 function definitions to int_encoding.cc
8800 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8801 prototypes to int_encoding.h
8802 * reduced_debug_output.cc (int_encoding.h): New include.
8803 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8804 function definitions to int_encoding.cc
8805 (insert_into_vector, read_from_pointer): Move template definitions to
8807 * attributes.cc: New file.
8808 * attributes.h: New file.
8809 * int_encoding.cc: New file.
8810 * int_encoding.h: New file.
8812 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
8815 * incremental-dump.cc (dump_incremental_inputs): New.
8816 (main): Use dump_incremental_inputs.
8818 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8821 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8822 checking elfcpp::STT_FUNC.
8823 (Target_i386::Relocate::relocate): Likewise.
8824 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8826 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8827 symbols from shared libraries into normal FUNC symbols.
8829 * symtab.h (Symbol): Add is_func and use it.
8831 2009-12-05 Doug Kwan <dougkwan@google.com>
8833 * arm.cc (Target_arm::arm_info): Initialize new fields
8834 attributes_section and attributes_vendor.
8835 * i386.cc (Target_i386::i386_info): Same.
8836 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8837 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8838 fields attributes_section and attributes_vendor.
8839 * sparc.cc (Target_sparc::sparc_info): Same.
8840 * target.h (Target::attributes_section, Target::attributes_vendor,
8841 Target::is_attributes_section, Target::attribute_arg_type,
8842 Target::attributes_order): New method definitions.
8843 (Target::Target_info::attributes_section,
8844 Target::Target_info::attributes_vendor): New fields.
8845 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8846 virtual method definitions.
8847 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8848 attributes_section and attributes_vendor.
8849 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8851 2009-12-05 Doug Kwan <dougkwan@google.com>
8853 * arm.cc: Update comments about interworking and stub generation.
8854 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8855 considered as non-PIC.
8856 (Arm_relocate_functions::base_abs): Fix formatting.
8857 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8858 of function to use GOT entry address instead of offset.
8859 (Target_arm::Scan::global): Issue an error if a symbol would need a
8860 PLT does not get one because it is untyped. Remove code to create
8861 dynamic symbols for relative branches.
8862 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8863 takes unsigned integer instead of boolean.
8865 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8867 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8868 (two_file_test_LDADD): Likewise.
8869 (common_test_1_LDADD): Likewise.
8870 (exception_test_LDADD) Likewise.
8871 (weak_test_LDADD): Likewise.
8872 (many_sections_test_LDADD): Likewise.
8873 (initpri1_LDADD): Likewise.
8874 (script_test_1_LDADD): Likewise.
8875 (script_test_2_LDADD): Likewise.
8876 (justsyms_LDADD): Likewise.
8877 (binary_test_LDADD): Likewise.
8878 (large_LDADD): Likewise.
8879 * testsuite/Makefile.in: Regenerated.
8881 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
8883 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8884 (Symbol_table::override_with_special): Likewise.
8885 (Symbol_table::add_from_object): Likewise.
8887 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8889 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8890 Don't set the data_offset twice.
8892 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8894 * testsuite/Makefile.in: Regenerate.
8896 2009-12-03 Doug Kwan <dougkwan@google.com>
8898 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8899 (Target_arm::do_finalize_sections): Add parameter for symbol table
8900 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8901 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8902 parameter for symbol table pointer.
8903 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8904 an additional parameter for a pointer to symbol table.
8905 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8906 parameter for a symbol table pointer.
8907 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8908 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8910 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8911 parameter for a symbol table pointer.
8913 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
8915 * incremental.cc (Incremental_inputs_header)
8916 (Incremental_inputs_header_write, Incremental_inputs_entry)
8917 (Incremental_inputs_entry_write): Move ...
8918 * incremental.h (Incremental_inputs_header)
8919 (Incremental_inputs_header_write, Incremental_inputs_entry)
8920 (Incremental_inputs_entry_write): here.
8922 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8924 * incremental.cc (make_sized_incremental_binary): Set the target.
8925 Error if it is incompatible.
8926 * output.h (Output_file): Add filename method.
8928 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8930 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8931 from the get_* methods.
8933 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8935 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8936 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8937 Write 0 for the data_offset of scripts.
8939 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8941 * testsuite/Makefile.am: Add the incremental_test.sh test.
8942 * testsuite/incremental_test.sh: New.
8943 * testsuite/incremental_test_1.c: New.
8944 * testsuite/incremental_test_2.c: New.
8946 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8948 * incremental-dump.cc (main): Fix typos.
8950 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8953 * incremental-dump.cc (main): Use llu to print 64 bit values.
8955 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8956 H.J. Lu <hongjiu.lu@intel.com>
8958 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8960 (incremental_dump_LDADD): Likewise.
8961 * Makefile.in: Regenerated.
8963 2009-11-25 Doug Kwan <dougkwan@google.com>
8967 2009-11-25 Doug Kwan <dougkwan@google.com>
8969 * arm.cc (Target_arm::Target_arm): Move method definition
8970 outside of class definition. Add code to handle
8971 --target1-rel, --target1-abs and --target2= options.
8972 (Target_arm::get_reloc_reloc_type): Change method to be
8973 non-static and const.
8974 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8975 New data member declaration.
8976 (Target_arm::Scan::local, Target_arm::Scan::global,
8977 Target_arm::Relocate::relocate,
8978 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8979 Adjust call to Target_arm::get_real_reloc_type.
8980 (Target_arm::get_real_reloc_type): Use command line options
8981 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8982 * options.h (--target1-rel, --target1-abs, --target2): New
8985 2009-11-25 Doug Kwan <dougkwan@google.com>
8987 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8988 class definition. Add code to handle --target1-rel, --target1-abs
8989 and --target2= options.
8990 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8992 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8994 (Target_arm::Scan::local, Target_arm::Scan::global,
8995 Target_arm::Relocate::relocate,
8996 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8997 call to Target_arm::get_real_reloc_type.
8998 (Target_arm::get_real_reloc_type): Use command line options to
8999 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9000 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9003 2009-11-25 Doug Kwan <dougkwan@google.com>
9005 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9006 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9007 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9009 (Arm_relocate_functions::thm_call): Replace body with a call to
9010 Arm_relocate_functions::thumb_branch_common.
9011 (Arm_relocate_functions::thm_jump24,
9012 Arm_relocate_functions::thm_xpc22): New method definitions.
9013 (Arm_relocate_functions::thumb_branch_common): New method definition.
9014 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9016 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9017 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9019 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9021 * Makefile.am: Build incremental-dump
9022 * Makefile.in: Regenerate.
9023 * incremental-dump.cc: New.
9024 * incremental.cc (Incremental_inputs_header_data,
9025 Incremental_inputs_entry_data): Move to incremental.h
9026 * incremental.h: (Incremental_inputs_header_data,
9027 Incremental_inputs_entry_data): Move from incremental.cc
9029 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9031 * incremental.cc (Incremental_inputs_header,
9032 Incremental_inputs_header_write, Incremental_inputs_entry,
9033 Incremental_inputs_entry_write): Add a typedef with the data type.
9035 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9037 * incremental.cc (Incremental_inputs_header,
9038 Incremental_inputs_header_write, Incremental_inputs_entry,
9039 Incremental_inputs_entry_write): Update comment about which
9040 type has the filed descriptions.
9042 2009-11-15 Doug Kwan <dougkwan@google.com>
9044 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9045 (Arm_relocate_functions::arm_branch_common): Change method defintion
9046 in class definition to a method declaration and update list of formal
9048 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9049 Arm_relocation_functions::jump24): Adjust call to
9050 Arm_relocate_functions::arm_branch_common. Update list of formal
9052 (Arm_relocate_functions::xpc25): New method definition.
9053 (Arm_relocate_functions::arm_branch_common): Move method defintion
9054 out from class definition. Use stubs for mode-switching and extending
9056 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9057 specially. Change code to enable use of stubs in ARM branches.
9059 2009-11-10 Doug Kwan <dougkwan@google.com>
9061 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9062 in method declaration.
9063 (Target_arm::relocate_stub): New method declaration.
9064 (Target_arm::default_target): Change to return a pointer instead of
9066 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9067 Target_arm::default_target.
9068 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9070 (Target_arm::relocate_section): Adjust view.
9071 (Target_arm::relocate_stub): New method definition.
9073 2009-11-10 Doug Kwan <dougkwan@google.com>
9075 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9077 * incremental.cc (open_incremental_binary): Initialized local
9078 variables to avoid warnings.
9079 * object.cc (make_elf_object): Ditto.
9080 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9083 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9086 * testsuite/plugin_test.c: Include "config.h".
9088 2009-11-09 Doug Kwan <dougkwan@google.com>
9090 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9091 (arm_symbol_value): Remove.
9092 (Arm_relocate_functions::arm_branch_common,
9093 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9094 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9095 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9096 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9097 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9098 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9099 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9100 Arm_relocate_functions::thm_mobw_abs_nc,
9101 Arm_relocate_functions::thm_mov_abs,
9102 Arm_relocate_functions::movw_prel_nc,
9103 Arm_relocate_functions::thm_movt_abs,
9104 Arm_relocate_functions::movt_prel,
9105 Arm_relocate_functions::thm_movw_prel_nc,
9106 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9107 (Target_arm::Relocate::relocate): Only decompose address into two
9108 parts if relocation type uses the thumb-bit and pass the actual
9109 bit instead of a flag indicating that the thumb-bit is used. Adjust
9110 calls to methods in Arm_relocate_functions for this change.
9112 2009-11-08 Ian Lance Taylor <iant@google.com>
9115 * reloc.cc: Instantiate
9116 Sized_relobj::initialize_input_to_output_maps and
9117 Sized_relobj:free_input_to_output_maps.
9119 2009-11-06 Ian Lance Taylor <iant@google.com>
9122 * defstd.cc (in_segment): Set only_if_ref true for "end".
9124 2009-11-06 Doug Kwan <dougkwan@google.com>
9126 * arm.cc (class Reloc_stub): Correct a comment.
9127 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9128 (Target_arm::scan_section_for_stubs): New method declaration.
9129 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9130 Change methods from private to protected.
9131 (Target_arm::do_may_relax): New method definition.
9132 (Target_arm::do_relax, Target_arm::group_sections,
9133 Target_arm::scan_reloc_for_stub,
9134 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9135 (Target_arm::arm_input_section_map_): New data member declaration.
9136 (Target_arm::scan_reloc_for_stub,
9137 Target_arm::scan_reloc_section_for_stubs,
9138 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9139 Target_arm::do_relax): New method definitions.
9141 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9143 * configure.ac: Check for (struct stat)::st_mtim
9144 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9145 * config.in: Regenerate.
9146 * configure: Regenerate.
9148 2009-11-05 Ian Lance Taylor <iant@google.com>
9151 * output.cc (Output_segment::add_output_section): Add missing
9154 2009-11-04 Ian Lance Taylor <iant@google.com>
9157 * object.h (class Object): Add is_needed and set_is_needed
9158 methods. Add is_needed_ field. Make bool fields into bitfields.
9159 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9160 defined in a dynamic object and referenced by a regular object,
9161 set is_needed for the dynamic object.
9162 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9163 if the file is marked with as_needed and it is not needed.
9165 2009-11-04 Ian Lance Taylor <iant@google.com>
9168 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9169 tags if data is discarded by linker script.
9170 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9171 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9172 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9173 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9175 2009-11-04 Ian Lance Taylor <iant@google.com>
9177 * layout.cc (Layout::get_output_section): Add is_interp and
9178 is_dynamic_linker_section parameters. Change all callers.
9179 (Layout::choose_output_section): Likewise.
9180 (Layout::make_output_section): Likewise.
9181 (Layout::add_output_section_data): Add is_dynamic_linker_section
9182 parameter. Change all callers.
9183 * layout.h (class Layout): Update declarations.
9184 * output.h (class Output_section): Add is_interp, set_is_interp,
9185 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9186 Add is_interp_, is_dynamic_linker_section_ fields. Change
9187 generate_code_fills_at_write_ to a bitfield.
9188 * output.cc (Output_section::Output_sections): Initialize new
9190 (Output_segment::add_output_section): Add do_sort parameter.
9193 2009-11-03 Ian Lance Taylor <iant@google.com>
9196 * options.h (class General_options): Add --warn-common.
9197 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9198 merging two common symbols.
9199 (Symbol_table::should_override): Handle --warn-common when merging
9200 a common symbol with a defined symbol. Use report_resolve_problem
9201 for multiple definitions.
9202 (Symbol_table::report_resolve_problem): New function.
9203 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9205 2009-11-03 Doug Kwan <dougkwan@google.com>
9207 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9209 (Target_arm::stub_factory): New method definition.
9210 (Target_arm::new_arm_input_section,
9211 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9212 Target_arm::reloc_uses_thumb_bit): New method declarations.
9213 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
9214 New type definitions.
9215 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9216 member declarations.
9217 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9218 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9219 New method definitions.
9221 2009-11-03 Ian Lance Taylor <iant@google.com>
9223 * options.h (class General_options): Add --warn_constructors.
9225 2009-11-03 Ian Lance Taylor <iant@google.com>
9228 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9229 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9231 2009-11-03 Ian Lance Taylor <iant@google.com>
9234 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9235 --msgid-bugs-address.
9236 (install-pdf): New target.
9237 (install-data_yes): Look up one directory to find mkinstalldirs.
9239 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9241 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9244 2009-10-30 Doug Kwan <dougkwan@google.com>
9246 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9248 2009-10-30 Doug Kwan <dougkwan@google.com>
9250 * arm.cc (Stub_addend_reader): New struct template definition
9251 and partial specializations.
9252 (Stub_addend_reader::operator()): New method definition for a
9253 partially specialized template.
9255 2009-10-30 Doug Kwan <dougkwan@google.com>
9257 * arm.cc (Arm_relobj::processor_specific_flags): New method
9259 (Arm_relobj::do_read_symbols): New method declaration.
9260 (Arm_relobj::processor_specific_flags_): New data member declaration.
9261 (Arm_dynobj): New class definition.
9262 (Target_arm::do_finalize_sections): Add input_objects parameter.
9263 (Target_arm::do_adjust_elf_header): New method declaration.
9264 (Target_arm::are_eabi_versions_compatible,
9265 (Target_arm::merge_processor_specific_flags): New method declaration.
9266 (Target_arm::do_make_elf_object): New overloaded method definitions
9268 (Arm_relobj::do_read_symbols): New method definition.
9269 (Arm_dynobj::do_read_symbols): Ditto.
9270 (Target_arm::do_finalize_sections): Add input_objects parameters.
9271 Merge processor-specific flags from all input objects.
9272 (Target_arm::are_eabi_versions_compatible,
9273 Target_arm::merge_processor_specific_flags,
9274 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9275 New method definitions.
9276 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9277 Input_objects pointer type parameter.
9278 * layout.cc (Layout::finalize): Pass input objects to target's.
9279 finalize_sections function.
9280 * output.cc (Output_file_header::do_sized_write): Set ELF file
9281 header's processor-specific flags.
9282 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9283 Input_objects pointer type parameter.
9284 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9285 * target.h (Input_objects): New forward class declaration.
9286 (Target::processor_specific_flags,
9287 Target::are_processor_specific_flags_sect): New method definitions.
9288 (Target::finalize_sections): Add input_objects parameter.
9289 (Target::Target): Initialize processor_specific_flags_ and
9290 are_processor_specific_flags_set_.
9291 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9293 (Target::set_processor_specific_flags): New method definition.
9294 (Target::processor_specific_flags_,
9295 Target::are_processor_specific_flags_set_): New data member
9297 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9298 Input_objects pointer type parameter.
9300 2009-10-30 Doug Kwan <dougkwan@google.com>
9302 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9304 2009-10-28 Ian Lance Taylor <iant@google.com>
9306 * object.h (class Relobj): Drop options parameter from
9307 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9308 do_scan_relocs, do_relocate. Change all callers.
9309 (class Sized_relobj): Drop options parameters from
9310 do_gc_process_relocs, do_scan_relocs, do_relocate,
9311 do_relocate_sections, relocate_sections, emit_relocs_scan,
9312 emit_relocs_scan_reltype. Change all callers.
9313 (struct Relocate_info): Remove options field and all references to
9315 * reloc.h (class Read_relocs): Remove options constructor
9316 parameter and options_ field. Change all callers.
9317 (class Gc_process_relocs, class Scan_relocs): Likewise.
9318 (class Relocate_task): Likewise.
9319 * target-reloc.h (scan_relocs): Remove options parameter. Change
9321 (scan_relocatable_relocs): Likewise.
9322 * target.h (class Sized_target): Remove options parameter from
9323 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9325 * gc.h (gc_process_relocs): Remove options parameter. Change all
9327 * arm.cc: Update functions to remove options parameters.
9328 * i386.cc: Likewise.
9329 * powerpc.cc: Likewise.
9330 * sparc.cc: Likewise.
9331 * x86_64.cc: Likewise.
9332 * testsuite/testfile.cc: Likewise.
9334 2009-10-28 Doug Kwan <dougkwan@google.com>
9336 * arm.cc (Arm_relobj): New class definition.
9337 (Arm_relobj::scan_sections_for_stubs,
9338 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9339 New method definitions.
9341 2009-10-28 Cary Coutant <ccoutant@google.com>
9343 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9344 (Plugin::cleanup_done_): New member.
9345 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9346 (Plugin_manager::cleanup_done_): Remove.
9347 (Plugin_manager::add_input_file): Edit error message.
9348 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9349 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9351 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9353 * fileread.cc: (File_read::View::~View): Use the new
9354 data_ownership_ filed.
9355 (File_read::~File_read): Dispose the new whole_file_view_.
9356 (File_read::open): Mmap the whole file if needed.
9357 (File_read::open): Use whole_file_view_ instead of contents_.
9358 (File_read::find_view): Use whole_file_view_ if applicable.
9359 (File_read::do_read): Use whole_file_view_ instead of contents_.
9360 (File_read::make_view): Use whole_file_view_ instead of contents_,
9361 update File_read::View::View call.
9362 (File_read::find_or_make_view): Update File_read::View::View
9364 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9366 (File_read::View::Data_ownership): New enum.
9367 (File_read::View::View): Replace bool mapped_ with Data_ownership
9369 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9370 (File_read::View::data_ownership_): New field.
9371 (File_read::contents_): Remove (replaced by whole_file_view_).
9372 (File_read::whole_file_view_): New field.
9373 * options.h (class General_options): Add --keep-files-mapped.
9375 2009-10-27 Cary Coutant <ccoutant@google.com>
9377 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9378 * testsuite/Makefile.am (plugin_test_5): New test case.
9379 * testsuite/Makefile.in: Regenerate.
9381 2009-10-25 Doug Kwan <dougkwan@google.com>
9383 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9384 from private to protected to allow access by child class.
9385 (Sized_relobj::do_relocate_sections): New method declaration.
9386 (Sized_relobj::relocate_sections): Virtualize.
9387 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
9388 Sized_relobj::relocate_sections. Instantiate template explicitly
9389 for different target sizes and endianity.
9391 2009-10-24 Doug Kwan <dougkwan@google.com>
9393 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9394 (Arm_input_section::as_arm_input_section): New method.
9395 (Arm_output_section): New class definition.
9396 (Arm_output_section::create_stub_group,
9397 Arm_output_section::group_sections): New method definitions.
9399 2009-10-22 Doug Kwan <dougkwan@google.com>
9401 * arm.cc (Arm_input_section): New class definition.
9402 (Arm_input_section::init, Arm_input_section:do_write,
9403 Arm_input_section::set_final_data_size,
9404 Arm_input_section::do_reset_address_and_file_offset): New method
9407 2009-10-21 Doug Kwan <dougkwan@google.com>
9409 * arm.cc (Stub_table, Arm_input_section): New forward class
9411 (Stub_table): New class defintion.
9412 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9413 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9414 New method definition.
9416 2009-10-21 Doug Kwan <dougkwan@google.com>
9418 * arm.cc: Update copyright comments.
9419 (Target_arm): New forward class template declaration.
9420 (Arm_address): New type.
9421 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9422 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9423 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9425 (Insn_template): Same.
9426 (DEF_STUBS): New macro.
9427 (Stub_type): New enum type.
9428 (Stub_template): New class definition.
9431 (Stub_factory): Same.
9432 (Target_arm::Target_arm): Initialize may_use_blx_ and
9433 should_force_pic_veneer_.
9434 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9435 Target_arm::should_force_pic_veneer,
9436 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9437 Target_arm::using_thumb_only, Target_arm:;default_target): New
9439 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9440 New data member declarations.
9441 (Insn_template::size, Insn_template::alignment): New method defintions.
9442 (Stub_template::Stub_template): New method definition.
9443 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9444 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9445 (Stub_factory::Stub_factory): New method definition.
9446 * gold.h (string_hash): New template.
9447 * output.h (Input_section_specifier::hash_value): Use
9449 (Input_section_specifier::string_hash): Remove.
9450 * stringpool.cc (Stringpool_template::string_hash): Use
9453 2009-10-20 Doug Kwan <dougkwan@google.com>
9455 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9456 symbols of relaxed input sections.
9457 * output.h (Output_section::find_relaxed_input_section): Make
9460 2009-10-16 Doug Kwan <dougkwan@google.com>
9462 * dynobj.cc (Versions::Versions): Initialize version_script_.
9463 Only insert base version symbol definition for a shared object
9464 if version script defines any version versions.
9465 (Versions::define_base_version): New method definition.
9466 (Versions::add_def): Check that base version is not needed.
9467 (Versions::add_need): Define base version lazily.
9468 * dynobj.h (Versions::define_base_version): New method declaration.
9469 (Versions::needs_base_version_): New data member declaration.
9470 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9471 (check_DATA): Add no_version_test.stdout.
9472 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9474 * testsuite/Makefile.in: Regenerate.
9475 * testsuite/no_version_test.c: New file.
9476 * testsuite/no_version_test.sh: Ditto.
9478 2009-10-16 Doug Kwan <dougkwan@google.com>
9480 * expression.cc (class Segment_start_expression): New class definition.
9481 (Segment_start_expression::value): New method definition.
9482 (script_exp_function_segment_start): Return a new
9483 Segment_start_expression.
9484 * gold/script-c.h (script_saw_segment_start_expression): New function
9486 * script-sections.cc (Script_sections::Script_sections): Initialize
9487 SAW_SEGMENT_START_EXPRESSION_ to false.
9488 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9489 and -Tbbs options to specify section addresses if given in
9490 command line and no SEGMENT_START expression is seen in a script.
9491 * script-sections.h (Script_sections::saw_segment_start_expression,
9492 Script_sections::set_saw_segment_start_expression): New method
9494 (Script_sections::saw_segment_start_expression_): New data member
9496 * script.cc (script_saw_segment_start_expression): New function.
9497 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9498 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9499 script_test_7.sh and script_test_8.sh.
9500 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9501 script_test_8.stdout.
9502 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9503 (script_test_6, script_test_6.stdout, script_test_7,
9504 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9505 * Makefile.in: Regenerate.
9506 * testsuite/script_test_6.sh: New file.
9507 * testsuite/script_test_6.t: Same.
9508 * testsuite/script_test_7.sh: Same.
9509 * testsuite/script_test_7.t: Same.
9510 * testsuite/script_test_8.sh: Same.
9512 2009-10-16 Doug Kwan <dougkwan@google.com>
9514 * output.cc (Output_segment::set_section_list_address): Cast
9515 expressions to unsigned long long type to avoid format warnings.
9517 2009-10-15 Ian Lance Taylor <iant@google.com>
9519 * script.cc (Script_options::add_symbol_assignment): Always add a
9520 dot assignment to script_sections_.
9521 * script-sections.cc (Script_sections::add_dot_assignment):
9522 Initialize if necessary.
9524 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9525 program headers with no load segment if there is a linker script.
9527 * layout.cc (Layout::set_segment_offsets): Align the file offset
9528 to the segment aligment for -N or -n with no load segment.
9529 * output.cc (Output_segment::add_output_section): Don't crash if
9530 the first section is a TLS section.
9531 (Output_segment::set_section_list_addresses): Print an error
9532 message if the address moves backward in a linker script.
9533 * script-sections.cc
9534 (Output_section_element_input::set_section_addresses): Don't
9535 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9536 (Orphan_output_section::set_section_addresses): Likewise.
9538 2009-10-15 Doug Kwan <dougkwan@google.com>
9540 * layout.cc (Layout::finish_dynamic_section): Generate tags
9541 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9542 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9543 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9545 2009-10-14 Ian Lance Taylor <iant@google.com>
9547 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9549 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9550 data_shdr fields of relinfo.
9551 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9552 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9553 R_386_TLS_LDO_32, adjust based on section flags.
9554 (Target_i386::Relocate::fix_up_ldo): Remove.
9556 2009-10-13 Ian Lance Taylor <iant@google.com>
9558 Add support for -pie.
9559 * options.h (class General_options): Add -pie and
9561 (General_options::output_is_position_independent): Test -pie.
9562 (General_options::output_is_executable): Return true if not shared
9563 and not relocatable.
9564 (General_options::output_is_pie): Remove.
9565 * options.cc (General_options::finalize): Reject incompatible uses
9567 * gold.cc (queue_middle_tasks): A -pie link is not static.
9568 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9569 * symtab.cc (Symbol::final_value_is_known): Return false if
9570 output_is_position_independent.
9571 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9572 output_is_position_independent.
9573 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9574 output_is_position_independent.
9575 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9576 output_is_position_independent.
9577 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9579 (basic_pie_test.o, basic_pie_test): New targets.
9580 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9581 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9582 (two_file_pie_test): New target.
9583 * testsuite/Makefile.in: Rebuild.
9584 * README: Remove note saying that -pie is not supported.
9586 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9588 * options.h (class General_options): Add -init and -fini.
9589 * layout.cc (Layout::finish_dynamic_section): Emit
9590 given init and fini functions.
9592 2009-10-13 Sriraman Tallam <tmsriram@google.com>
9594 * gc.h (gc_process_relocs): Check if icf is enabled using new
9596 * gold.cc (queue_initial_tasks): Likewise.
9597 (queue_middle_tasks): Likewise.
9598 * object.cc (do_layout): Likewise.
9599 * symtab.cc (is_section_folded): Likewise.
9600 * main.cc (main): Likewise.
9601 * reloc.cc (Read_relocs::run): Likewise.
9602 (Sized_relobj::do_scan_relocs): Likewise.
9603 * icf.cc (is_function_ctor_or_dtor): New function.
9604 (Icf::find_identical_sections): Check if function is ctor or dtor when
9606 * options.h (General_options::icf): Change option to be an enum.
9607 (Icf_status): New enum.
9608 (icf_enabled): New method.
9609 (icf_safe_folding): New method.
9610 (set_icf_status): New method.
9611 (icf_status_): New variable.
9612 * (options.cc) (General_options::finalize): Set icf_status_.
9613 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9614 icf_test and icf_keep_unique_test to use the --icf enum flag.
9615 * testsuite/icf_safe_test.sh: New file.
9616 * testsuite/icf_safe_test.cc: New file.
9618 2009-10-12 Sriraman Tallam <tmsriram@google.com>
9620 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9621 includes to gc.h and icf.h.
9622 * arm.cc: Include gc.h.
9623 * gold.cc: Likewise.
9624 * i386.cc: Likewise.
9625 * powerpc.cc: Likewise.
9626 * sparc.cc: Likewise.
9627 * x86_64.cc: Likewise.
9628 * gc.h: Include icf.h.
9630 2009-10-11 Ian Lance Taylor <iant@google.com>
9632 * plugin.cc: Include "gold.h" before other header files.
9634 2009-10-10 Chris Demetriou <cgd@google.com>
9636 * options.h (Input_file_argument::Input_file_type): New enum.
9637 (Input_file_argument::is_lib_): Replace with...
9638 (Input_file_argument::type_): New member.
9639 (Input_file_argument::Input_file_argument): Take Input_file_type
9640 'type' rather than boolean 'is_lib' as second argument.
9641 (Input_file_argument::is_lib): Use type_.
9642 (Input_file_argument::is_searched_file): New function.
9643 (Input_file_argument::may_need_search): Handle is_searched_file.
9644 * options.cc (General_options::parse_library): Support -l:filename.
9645 (General_options::parse_just_symbols): Update for Input_file_argument
9647 (Command_line::process): Likewise.
9648 * archive.cc (Archive::get_file_and_offset): Likewise.
9649 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9650 * script.cc (read_script_file, script_add_file): Likewise.
9651 * fileread.cc (Input_file::Input_file): Likewise.
9652 (Input_file::will_search_for): Handle is_searched_file.
9653 (Input_file::open): Likewise.
9654 * readsyms.cc (Read_symbols::get_name): Likewise.
9655 * testsuite/Makefile.am (searched_file_test): New test.
9656 * testsuite/Makefile.in: Regenerate.
9657 * testsuite/searched_file_test.cc: New file.
9658 * testsuite/searched_file_test_lib.cc: New file.
9660 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9661 Ian Lance Taylor <iant@google.com>
9663 * descriptor.cc: Include <cstdio> and "binary-io.h".
9664 (Descriptors::open): Open the files in binary mode always.
9665 * script.cc (Lex::get_token): Treat \r as whitespace.
9667 2009-10-09 Ian Lance Taylor <iant@google.com>
9669 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9671 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9672 Ian Lance Taylor <iant@google.com>
9674 * configure.ac: Check for readv function also.
9675 * fileread.cc (readv): Define if not HAVE_READV.
9676 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9678 * config.in: Regenerate.
9679 * configure: Regenerate.
9681 2009-10-09 Doug Kwan <dougkwan@google.com>
9683 * layout.cc (Layout::make_output_section): Call target hook to make
9684 ordinary output section.
9685 (Layout::finalize): Adjust parameter list of call the
9686 Target::may_relax().
9687 * layout.h (class Layout::section_list): New method.
9688 * merge.h (Output_merge_base::entsize): Change visibility to public.
9689 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9691 (Output_merge_string::do_is_string): New method.
9692 * object.cc (Sized_relobj::do_setup): renamed from
9693 Sized_relobj::set_up.
9694 * object.h (Sized_relobj::adjust_shndx,
9695 Sized_relobj::initializ_input_to_output_maps,
9696 Sized_relobj::free_input_to_output_maps): Change visibilities to
9698 (Sized_relobj::setup): Virtualize.
9699 (Sized_relobj::do_setup): New method declaration.
9700 (Sized_relobj::invalidate_section_offset,
9701 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9702 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9703 * options.cc (parse_int): New function.
9704 * options.h (parse_int): New declaration.
9705 (DEFINE_int): New macro.
9706 (stub_group_size): New option.
9707 * output.cc (Output_section::Output_section): Initialize memebers
9708 merge_section_map_, merge_section_by_properties_map_,
9709 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9710 (Output_section::add_input_section): Handled deferred code-fill
9711 generation and remove an old comment.
9712 (Output_section::add_relaxed_input_section): New method definition.
9713 (Output_section::add_merge_input_section): Use merge section by
9714 properties map to speed to search. Update merge section maps
9716 (Output_section::build_relaxation_map): New method definition.
9717 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9719 (Output_section::relax_input_section): Renamed to
9720 Output_section::convert_input_sections_to_relaxed_sections and change
9721 interface to take a vector of pointers to relaxed sections.
9722 (Output_section::find_merge_section,
9723 Output_section::find_relaxed_input_section): New method definitions.
9724 (Output_section::is_input_address_mapped,
9725 Output_section::output_offset, Output_section::output_address):
9726 Use output section data maps to speed up searching.
9727 (Output_section::find_starting_output_address): Add comments.
9728 (Output_section::do_write,
9729 Output_section::write_to_postprocessing_buffer): Do code-fill
9730 generation as appropriate.
9731 (Output_section::get_input_sections): Invalidate relaxed input section
9733 (Output_section::restore_states): Adjust type of checkpoint .
9734 Invalidate relaxed input section map.
9735 * output.h (Output_merge_base): New class declaration.
9736 (Input_section_specifier): New class defintion.
9737 (class Output_relaxed_input_section) Change base class to
9738 Output_section_data_build.
9739 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9740 base class initializer.
9741 (Output_section::add_relaxed_input_section): New method declaration.
9742 (Output_section::Input_section): Change visibility to protected.
9743 (Output_section::Input_section::relobj,
9744 Output_section::Input_section::shndx): Handle relaxed input sections.
9745 Output_section::input_sections) Change visibility to protected. Also
9746 define overload to return a non-const pointer.
9747 (Output_section::Merge_section_properties): New class defintion.
9748 (Output_section::Merge_section_by_properties_map,
9749 Output_section::Output_section_data_by_input_section_map,
9750 Output_section::Relaxation_map): New types.
9751 (Output_section::relax_input_section): Rename method to
9752 Output_section::convert_input_sections_to_relaxed_sections and change
9753 interface to take a vector of relaxed section pointers.
9754 (Output_section::find_merge_section,
9755 Output_section::find_relaxed_input_section,
9756 Output_section::build_relaxation_map,
9757 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9758 New method declarations.
9759 (Output_section::merge_section_map_
9760 Output_section::merge_section_by_properties_map_,
9761 Output_section::relaxed_input_section_map_,
9762 Output_section::is_relaxed_input_section_map_valid_,
9763 Output_section::generate_code_fills_at_write_): New data members.
9764 * script-sections.cc
9765 (Output_section_element_input::set_section_addresses): Call
9766 current_data_size and addralign methods of relaxed input sections.
9767 (Orphan_output_section::set_section_addresses): Call current_data_size
9768 and addralign methods of relaxed input sections.
9769 * symtab.cc (Symbol_table::compute_final_value): Extract template
9770 from the body of Symbol_table::sized_finalize_symbol.
9771 (Symbol_table::sized_finalized_symbol): Call
9772 Symbol_table::compute_final_value.
9773 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9774 (Symbol_table::compute_final_value): New templated method declaration.
9775 * target.cc (Target::do_make_output_section): New method defintion.
9776 * target.h (Target::make_output_section): New method declaration.
9777 (Target::relax): Add more parameters for input objects, symbol table
9778 and layout. Adjust call to do_relax.
9779 (Target::do_make_output_section): New method declaration.
9780 (Target::do_relax): Add parameters for input objects, symbol table
9783 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9785 * pread.c: Include stdio.h.
9787 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9789 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9792 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9794 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9795 Change read_shndx type to unsigned int.
9796 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9798 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9799 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9800 Change read_shndx type to unsigned int.
9801 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9803 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9804 * layout.cc (Layout::create_symtab_sections): Cast the result of
9805 local_symcount * symsize to off_t in the gold_assert.
9807 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9809 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9810 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9812 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9813 (Arm_relocate_functions::thm_abs5): New function.
9814 (Arm_relocate_functions::abs12): New function.
9815 (Arm_relocate_functions::abs16): New function.
9816 (Arm_relocate_functions::base_abs): New function.
9817 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9818 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9819 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9821 (Scan::global): Likewise.
9822 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9823 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9824 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9825 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9828 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9830 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9831 (Arm_relocate_functions::movt_prel): New function.
9832 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9833 (Arm_relocate_functions::thm_movt_prel): New function.
9834 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9835 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9836 (Scan::global, Relocate::relocate): Likewise.
9837 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9839 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9841 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9842 Incremental_checker.
9843 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9845 (class Incremental_inputs_header): New class.
9846 (Incremental_inputs_header_writer): Edit comment.
9847 (Incremental_inputs_entry): New class.
9848 (Incremental_inputs_entry_writer): Edit comment.
9849 (Sized_incremental_binary::do_find_incremental_inputs_section):
9850 Add *strtab_shndx parameter, fill it.
9851 (Sized_incremental_binary::do_check_inputs): New method.
9852 (Incremental_checker::can_incrementally_link_output_file): Use
9853 Sized_incremental_binary::check_inputs.
9854 (Incremental_inputs::report_command_line): Save command line in
9857 (Incremental_binary::find_incremental_inputs_section): New
9859 (Incremental_binary::do_find_incremental_inputs_section): Add
9860 strtab_shndx parameter.
9861 (Incremental_binary::do_check_inputs): New pure virtual method.
9862 (Sized_incremental_binary::do_check_inputs): Declare.
9863 (Incremental_checker::Incremental_checker): Add incremental_inputs
9864 parameter, use it to initialize incremental_inputs_.
9865 (Incremental_checker::incremental_inputs_): New field.
9866 (Incremental_checker::command_line): New method.
9867 (Incremental_checker::inputs): New method.
9868 (Incremental_checker::command_line_): New field.
9870 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9872 * incremental.cc: Include <cstdarg> and "target-select.h".
9873 (vexplain_no_incremental): New function.
9874 (explain_no_incremental): New function.
9875 (Incremental_binary::error): New method.
9876 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9878 (make_sized_incremental_binary): New function.
9879 (open_incremental_binary): New function.
9880 (can_incrementally_link_file): Add checks if output is ELF and has
9882 * incremental.h: Include "elfcpp_file.h" and "output.h".
9883 (Incremental_binary): New class.
9884 (Sized_incremental_binary): New class.
9885 (open_incremental_binary): Declare.
9886 * object.cc (is_elf_object): Use
9887 elfcpp::Elf_recognizer::is_elf_file.
9888 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9889 * output.h (Output_file::filesize): New method.
9891 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9893 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9895 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9896 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9898 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9900 (Arm_relocate_functions::movw_abs_nc): New function.
9901 (Arm_relocate_functions::movt_abs): New function.
9902 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9903 (Arm_relocate_functions::thm_movt_abs): New function.
9904 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9905 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9906 (Scan::global): Likewise.
9907 (Relocate::relocate): Likewise.
9908 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9910 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9912 * arm.cc (Arm_relocate_functions::got_prel) New function.
9913 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9914 (Relocate::relocate): Likewise.
9915 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9917 2009-10-06 Ian Lance Taylor <iant@google.com>
9919 * options.h (class General_options): Define
9920 split_stack_adjust_size parameter.
9921 * object.h (class Object): Add uses_split_stack_ and
9922 has_no_split_stack_ fields. Add uses_split_stack and
9923 has_no_split_stack accessor functions. Declare
9924 handle_split_stack_section.
9925 (class Reloc_symbol_changes): Define.
9926 (class Sized_relobj): Define Function_offsets. Declare
9927 split_stack_adjust, split_stack_adjust_reltype, and
9929 * object.cc (Object::handle_split_stack_section): New function.
9930 (Sized_relobj::do_layout): Call handle_split_stack_section.
9931 * dynobj.cc (Sized_dynobj::do_layout): Call
9932 handle_split_stack_section.
9933 * reloc.cc (Sized_relobj::relocate_sections): Call
9934 split_stack_adjust for executable sections in split_stack
9935 objects. Pass reloc_map to relocate_section.
9936 (Sized_relobj::split_stack_adjust): New function.
9937 (Sized_relobj::split_stack_adjust_reltype): New function.
9938 (Sized_relobj::find_functions): New function.
9939 * target-reloc.h: Include "object.h".
9940 (relocate_section): Add reloc_symbol_changes parameter. Change
9942 * target.h (class Target): Add calls_non_split method. Declare
9943 do_calls_non_split virtual method. Declare match_view and
9945 * target.cc: Include "elfcpp.h".
9946 (Target::do_calls_non_split): New function.
9947 (Target::match_view): New function.
9948 (Target::set_view_to_nop): New function.
9949 * gold.cc (queue_middle_tasks): Give an error if mixing
9950 split-stack and non-split-stack objects with -r.
9951 * i386.cc (Target_i386::relocate_section): Add
9952 reloc_symbol_changes parameter.
9953 (Target_i386::do_calls_non_split): New function.
9954 * x86_64.cc (Target_x86_64::relocate_section): Add
9955 reloc_symbol_changes parameter.
9956 (Target_x86_64::do_calls_non_split): New function.
9957 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9959 * powerpc.cc (Target_powerpc::relocate_section): Add
9960 reloc_symbol_changes parameter.
9961 * sparc.cc (Target_sparc::relocate_section): Add
9962 reloc_symbol_changes parameter.
9963 * configure.ac: Call AM_CONDITIONAL for the default target.
9964 * configure: Rebuild.
9965 * testsuite/Makefile.am (TEST_AS): New variable.
9966 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9967 (check_DATA): Add split_i386 and split_x86_64 files.
9968 (SPLIT_DEFSYMS): Define.
9969 (split_i386_[1234n].o): New targets.
9970 (split_i386_[124]): New targets.
9971 (split_i386_[1234r].stdout): New targets.
9972 (split_x86_64_[1234n].o): New targets.
9973 (split_x86_64_[124]): New targets.
9974 (split_x86_64_[1234r].stdout): New targets.
9975 (MOSTLYCLEANFILES): Add new executables.
9976 * testsuite/split_i386.sh: New file.
9977 * testsuite/split_x86_64.sh: New file.
9978 * testsuite/split_i386_1.s: New file.
9979 * testsuite/split_i386_2.s: New file.
9980 * testsuite/split_i386_3.s: New file.
9981 * testsuite/split_i386_4.s: New file.
9982 * testsuite/split_i386_n.s: New file.
9983 * testsuite/split_x86_64_1.s: New file.
9984 * testsuite/split_x86_64_2.s: New file.
9985 * testsuite/split_x86_64_3.s: New file.
9986 * testsuite/split_x86_64_4.s: New file.
9987 * testsuite/split_x86_64_n.s: New file.
9988 * testsuite/testfile.cc (Target_test): Update relocation_section
9990 * testsuite/Makefile.in: Rebuild.
9992 2009-10-06 Ian Lance Taylor <iant@google.com>
9994 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9995 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9996 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9997 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9998 the address on ldo_addrs_.
9999 (Target_i386::Relocate::fix_up_ldo): New function.
10001 2009-10-06 Rafael Espindola <espindola@google.com>
10003 * plugin.cc (add_input_library): New.
10004 (Plugin::load): Add add_input_library to tv.
10005 (Plugin_manager::add_input_file): Add the is_lib argument.
10006 (add_input_file): Update call to Plugin_manager::add_input_file.
10007 (add_input_library): New.
10008 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10010 2009-09-30 Doug Kwan <dougkwan@google.com>
10012 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10013 symbol and call Symbol::may_need_copy_reloc to determine if
10014 a copy reloc is needed.
10015 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10016 nocopyreloc is given in command line.
10017 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10018 given in command line.
10019 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10020 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10021 of the removed Target_i386::may_need_copy_reloc.
10022 * options.h (copyreloc): New option with default value false.
10023 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10024 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10025 instead of the removed Target_powerpc::may_need_copy_reloc.
10026 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10027 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10028 instead of the removed Target_sparc::may_need_copy_reloc.
10029 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10030 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10031 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10032 instead of the removed Target_x86_64::may_need_copy_reloc.
10034 2009-09-30 Ian Lance Taylor <iant@google.com>
10036 * object.h (class Object): Remove target_ field, and target,
10037 sized_target, and set_target methods.
10038 (Object::sized_target): Remove.
10039 (class Sized_relobj): Update declarations. Remove sized_target.
10040 * object.cc (Sized_relobj::setup): Remove target parameter.
10041 Change all callers.
10042 (Input_objects::add_object): Don't do anything with the target.
10043 (make_elf_sized_object): Add punconfigured parameter. Change all
10044 callers. Set or test parameter target.
10045 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10046 Change all callers.
10047 * parameters.cc (Parameters::set_target): Change parameter type to
10049 (Parameters::default_target): Remove.
10050 (set_parameters_target): Change parameter type to be non-const.
10051 (parameters_force_valid_target): New function.
10052 (parameters_clear_target): New function.
10053 * parameters.h (class Parameters): Update declarations. Remove
10054 default_target method. Add sized_target and clear_target
10055 methods. Change target_ to be non-const.
10056 (set_parameters_target): Update declaration.
10057 (parameters_force_valid_target): Declare.
10058 (parameters_clear_target): Declare.
10059 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10060 as NULL if we aren't searching.
10061 (Add_symbols::run): Don't check for compatible target.
10062 * fileread.cc (Input_file::open_binary): Call
10063 parameters_force_valid_target.
10064 * gold.cc (queue_middle_tasks): Likewise.
10065 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10066 set_target on object.
10067 * dynobj.h (class Sized_dynobj): Update declarations.
10068 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10069 make_elf_object returns NULL.
10070 (Archive::include_member): Don't check whether object target is
10072 * output.cc (Output_section::add_input_section): Get target from
10074 (Output_section::relax_input_section): Likewise.
10075 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10077 (Sized_relobj::do_scan_relocs): Likewise.
10078 (Sized_relobj::relocate_sections): Likewise.
10079 * resolve.cc (Symbol_table::resolve): Likewise.
10080 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10081 parameter. Change all callers.
10082 (Symbol_table::add_from_object): Get target from parameters.
10083 (Symbol_table::add_from_relobj): Don't check object target.
10084 (Symbol_table::add_from_dynobj): Likewise.
10085 (Symbol_table::define_special_symbol): Get target from
10087 * symtab.h (class Symbol_table): Update declaration.
10088 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10089 parameter. Change all callers. Clear parameter target.
10090 (Binary_test): Test target here.
10091 * testsuite/object_unittest.cc (gold_testsuite): Remove
10092 target_test_pointer parameter. Change all callers.
10093 (Object_test): Test target here.
10095 2009-09-26 Ian Lance Taylor <iant@google.com>
10097 * testsuite/initpri1.c: Don't try to use constructor priorities if
10098 compiling with gcc before 4.3.
10100 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10102 * testsuite/retain_symbols_file_test.sh (check_present): Change
10103 output file name to retain_symbols_file_test.stdout.
10104 (check_absent): Likewise.
10106 2009-09-18 Craig Silverstein <csilvers@google.com>
10108 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10109 * options.cc: Include <cerrno> and <fstream>.
10110 (General_options::finalize): Parse -retain-symbols-file tag.
10111 * options.h: New flag.
10112 (General_options): New method should_retain_symbol, new
10113 variable symbols_to_retain.
10114 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10115 should_retain_symbol map.
10116 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10117 * testsuite/Makefile.in: Regenerate.
10118 * testsuite/retain_symbols_file_test.sh: New file.
10120 2009-09-18 Nick Clifton <nickc@redhat.com>
10122 * po/es.po: Updated Spanish translation.
10124 2009-09-17 Doug Kwan <dougkwan@google.com>
10126 * debug.h (DEBUG_RELAXATION): New constant.
10127 (DEBUG_ALL): Add DEBUG_RELAXATION.
10128 (debug_string_to_enum): Add relaxation debug option.
10130 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10131 Layout::Relaxation_debug_check::read_sections,
10132 Layout::Relaxation_debug_check::read_sections): New method definitions.
10133 (Layout::Layout): Initialize data members
10134 record_output_section_data_from_scrips_,
10135 script_output_section_data_list_ and relaxation_debug_check_.
10136 (Layout::save_segments, Layout::restore_segments,
10137 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10138 Layout::relaxation_loop_body): New method definitions.
10139 (Layout::finalize): Support relaxation. Move section layout code to
10140 Layout::relaxation_loop_body.
10141 (Layout::set_asection_address_from_script): Move code for orphan
10142 section placement out.
10143 (Layout::place_orphan_sections_in_script): New method definition.
10144 * layout.h (Output_segment_headers, Output_file_header):
10145 New forward class declarations.
10146 (Layout::~Layout): Define.
10147 (Layout::new_output_section_data_from_script): New method definition.
10148 (Layout::place_orphan_sections_in_script): New method declaration.
10149 (Layout::Segment_states): New type declaration.
10150 (Layout::save_segments, Layout::restore_segments,
10151 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10152 Layout::relaxation_loop_body): New method declarations.
10153 (Layout::Output_section_data_list): New type declaration.
10154 (Layout::Relaxation_debug_check): New class definition.
10155 (Layout::record_output_section_data_from_script_,
10156 Layout::script_output_section_data_list_, Layout::segment_states_,
10157 Layout::relaxation_debug_check_): New data members.
10158 * output.cc: (Output_section_headers::do_size): New method definition.
10159 (Output_section_headers::Output_section_headers): Move size
10160 computation to Output_section_headers::do_size.
10161 (Output_segment_headers::do_size): New method definition.
10162 (Output_file_header::Output_file_header): Move size computation to
10163 Output_file_header::do_size and call it.
10164 (Output_file_header::do_size): New method definition.
10165 (Output_data_group::Output_data_group): Adjust call to
10166 Output_section_data.
10167 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10168 (Output_symtab_xindex::do_write): Add array bound check.
10169 (Output_section::Input_section::print_to_mapfile): Handle
10170 RELAXED_INPUT_SECTION_CODE.
10171 (Output_section::Output_section): Initialize data member checkpoint_.
10172 (Output_section::~Output_section): Delete checkpoint object pointed
10174 (Output_section::add_input_section): Always add an Input_section if
10176 (Output_section::add_merge_input_section): Add assert.
10177 (Output_section::relax_input_section): New method definition.
10178 (Output_section::set_final_data_size): Set load address to zero for
10179 an unallocated section.
10180 (Output_section::do_address_and_file_offset_have_reset_values):
10181 New method definition.
10182 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10183 Handle relaxed input section.
10184 (Output_section::sort_attached_input_sections): Checkpoint input
10185 section list lazily.
10186 (Output_section::get_input_sections): Change type of input_sections to
10187 list of Simple_input_section pointers. Checkpoint input section list
10188 lazily. Also handle relaxed input sections.
10189 (Output_section::add_input_section_for_script): Take a reference to
10190 a Simple_input_section object instead of Relobj pointer and section
10191 index as parameter. Handle relaxed input sections.
10192 (Output_section::save_states, Output_section::restore_states): New
10193 method definitions.
10194 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10195 (Output_data::is_data_size_fixed): New method definition.
10196 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10198 (Output_data::address_and_file_offset_have_reset_values): New method
10200 (Output_data::do_address_and_file_offset_have_reset_values): New method
10202 (Output_data::set_data_size): Check that data size is not fixed.
10203 (Output_data::fix_data_size): New method definition.
10204 (Output_data::is_data_size_fixed_): New data member.
10205 (Output_section_headers::set_final_data_size): New method definition.
10206 (Output_section_headers::do_size): New method declaration.
10207 (Output_segment_headers::set_final_data_size): New method definition.
10208 (Output_segment_headers::do_size): New method declaration.
10209 (Output_file_header::set_final_data_size)::New method definition.
10210 (Output_file_header::do_size)::New method declaration.
10211 (Output_section_data::Output_section_data): Add new parameter
10212 is_data_size_fixed and use it to fix data size.
10213 (Output_data_const::Output_data_const): Adjust call to base class
10214 constructor and fix data size.
10215 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10216 base class constructor and fix data size.
10217 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10218 base class constructor and fix data size.
10219 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10220 class constructor and fix data size.
10221 (Output_data_group::set_final_data_size): New method definition.
10222 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10223 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10224 class constructor and fix data size.
10225 (Output_relaxed_input_section): New class definition.
10226 (Output_section::Simple_input_section): New class definition.
10227 (Output_section::get_input_sections): Adjust parameter list.
10228 (Output_section::add_input_section_for_script): Same.
10229 (Output_section::save_states, Output_section::restore_states,
10230 Output_section::do_address_and_file_offset_have_reset_values,
10231 (Output_section::Input_section::Input_section): Handle
10232 RELAXED_INPUT_SECTION_CODE. Add new overload for
10233 Output_relaxed_input_section.
10234 (Output_section::Input_section::is_input_section,
10235 Output_section::Input_section::set_output_section): Handle relaxed
10237 (Output_section::Input_section::is_relaxed_input_section,
10238 Output_section::Input_section::output_section_data,
10239 Output_section::Input_section::relaxed_input_section): New method
10241 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10243 (Output_section::Input_section::u1_): Update comments.
10244 (Output_section::Input_section::u2_): Add new union member poris.
10245 (Output_section::Checkpoint_output_section): New classs definition.
10246 (Output_section::relax_input_section): New method declaration.
10247 (Output_section::checkpoint_): New data member.
10248 (Output_segment): Update comments.
10249 (Output_segment::Output_segment): Un-privatize copy constructor.
10250 (Output_segment::operator=): Un-privatize.
10251 * script-sections.cc (Output_section_element::Input_section_list):
10252 Change element type to Output_section::Simple_input_section.
10253 (Output_section_element_dot_assignment::set_section_addresses):
10254 Register output section data for relaxation clean up.
10255 (Output_data_exression::Output_data_expression): Adjust call to base
10256 constructor to fix data size.
10257 (Output_section_element_data::set_section_addresses): Register
10258 Output_data_expression object for relaxation clean up.
10259 (struct Input_section_info): Replace Relobj pointer and section index
10260 pair with Output_section::Simple_input_section and Convert struct to a
10262 (Input_section_sorter::operator()): Adjust access to
10263 Input_section_info data member to use accessors.
10264 (Output_section_element_input::set_section_addresses): Use layout
10265 parameter. Adjust code to use Output_section::Simple_input_section
10266 and Input_secction_info classes. Register filler for relaxation
10268 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10269 and section index pair with Output_section::Simple_input_section
10270 class. Adjust code accordingly.
10271 (Phdrs_element::release_segment): New method definition.
10272 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10274 (Script_sections::release_segments): New method definition.
10275 * gold/script-sections.h (Script_sections::release_segments): New
10276 method declaration.
10277 * gold/target.h (Target::may_relax, Target::relax,
10278 Target::do_may_relax, Target::do_relax): New method definitions.
10280 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10282 * arm.cc (has_signed_unsigned_overflow): New function.
10283 (Arm_relocate_functions::abs8): New function.
10284 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10285 (Target_arm::Scan::global): Likewise.
10286 (Target_arm::relocate::relocate): Likewise.
10287 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10290 2009-09-16 Cary Coutant <ccoutant@google.com>
10292 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10293 * testsuite/Makefile.in: Regenerate.
10295 2009-09-11 Nick Clifton <nickc@redhat.com>
10297 * po/gold.pot: Updated by the Translation project.
10299 2009-09-08 Cary Coutant <ccoutant@google.com>
10301 * output.cc (Output_file::open): Add execute permission to empty file.
10302 * testsuite/Makefile.am (permission_test): New test.
10303 * testsuite/Makefile.in: Regenerate.
10305 2009-09-02 Ian Lance Taylor <iant@google.com>
10307 * output.cc (Output_file::resize): Call map_no_anonymous rather
10310 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10312 * gold.cc: Include "incremental.h".
10313 (queue_initial_tasks): Call Incremental_checker methods.
10314 * incremental.cc: Include "output.h".
10315 (Incremental_checker::can_incrementally_link_output_file): New
10317 * incremental.h (Incremental_checker): New class.
10319 * output.cc (Output_file::open_for_modification): New method.
10320 (Output_file::map_anonymous): Changed return type to bool. Record
10321 map in base_ field.
10322 (Output_file::map_no_anonymous): New method, broken out of map.
10323 (Output_file::map): Use map_no_anonymous and map_anonymous.
10324 * output.h (class Output_file): Update declarations.
10326 2009-08-24 Cary Coutant <ccoutant@google.com>
10328 * options.h (Command_line::Pre_options): New class.
10329 (Command_line::pre_options): New member.
10330 * options.cc (gold::options::ready_to_register): New variable.
10331 (One_option::register_option): Do nothing if not registering options.
10332 Assert if same short option registered twice.
10333 (General_options::General_options): Turn off option registration when
10335 (Command_line::Pre_options::Pre_options): New constructor.
10337 2009-08-24 Cary Coutant <ccoutant@google.com>
10339 * options.h (General_options::no_keep_memory): Remove incorrect
10342 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10344 * Makefile.am (am__skiplex, am__skipyacc): New.
10345 * Makefile.in: Regenerate.
10347 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10349 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10350 (INCLUDES): ... this.
10351 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10352 (AM_CPPFLAGS): Renamed from ...
10353 (INCLUDE): ... this.
10354 * Makefile.in, testsuite/Makefile.in: Regenerate.
10356 * Makefile.in: Regenerate.
10357 * aclocal.m4: Likewise.
10358 * config.in: Likewise.
10359 * configure: Likewise.
10360 * testsuite/Makefile.in: Likewise.
10362 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10363 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10364 * Makefile.in: Regenerate.
10365 * testsuite/Makefile.in: Regenerate.
10367 2009-08-19 Cary Coutant <ccoutant@google.com>
10369 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10370 symbols in shared libraries overridden by hidden or internal symbols
10371 in the main program.
10373 2009-08-19 Chris Demetriou <cgd@google.com>
10375 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10376 checking source file names in error messages.
10378 2009-08-18 Doug Kwan <dougkwan@google.com>
10380 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10381 an elcpp::Ehdr as parameter. Adjust call to set_target.
10382 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10383 an elfcpp::Ehdr as parameter.
10384 * object.cc (Object::set_target): Remove the version that looks up
10385 a target and sets it.
10386 (Sized_relobj::setup): Take a Target object instead of
10387 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10388 (make_elf_sized_object): Find target and ask target to
10389 make an ELF object.
10390 * object.h: (Object::set_target): Remove the version that looks up
10391 a target and sets it.
10392 (Sized_relobj::setup): Take a Target object instead of
10393 an elfcpp:Ehdr as parameter.
10394 * target.cc: Include dynobj.h.
10395 (Target::do_make_elf_object_implementation): New.
10396 (Target::do_make_elf_object): New.
10397 * target.h (Target::make_elf_object): New template declaration.
10398 (Target::do_make_elf_object): New method declarations.
10399 (Target::do_make_elf_object_implementation): New template declaration.
10401 2009-08-14 Ian Lance Taylor <iant@google.com>
10403 * gold.h (FUNCTION_NAME): Define.
10404 (gold_unreachable): Use FUNCTION_NAME.
10406 2009-08-12 Sriraman Tallam <tmsriram@google.com>
10408 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10409 symbol in the --keep-unique list is not found.
10411 2009-08-12 Sriraman Tallam <tmsriram@google.com>
10413 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10414 been maked as --keep-unique.
10415 (Icf::unfold_section): New function.
10416 * icf.h (Icf::unfold_section): New function.
10417 * options.h (General_options::keep_unique): New option.
10418 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10419 * testsuite/Makefile.in: Regenerate.
10420 * testsuite/icf_keep_unique_test.sh: New file.
10421 * testsuite/icf_keep_unique_test.cc: New file.
10423 2009-08-12 Cary Coutant <ccoutant@google.com>
10426 * resolve.cc (Symbol_table::resolve): Check for references from
10427 dynamic objects to hidden and internal symbols.
10428 * testsuite/Makefile.am (hidden_test.sh): New test.
10429 * testsuite/Makefile.in: Regenerate.
10430 * testsuite/hidden_test.sh: New script.
10431 * testsuite/hidden_test_1.c: New test source.
10432 * testsuite/hidden_test_main.c: New test source.
10434 2009-08-11 Doug Kwan <dougkwan@google.com>
10436 * arm.cc: Update comments.
10437 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10438 segment to locate the .ARM.exidx section if present.
10440 2009-08-09 Doug Kwan <dougkwan@google.com>
10442 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10445 2009-08-07 Sriraman Tallam <tmsriram@google.com>
10446 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10449 2009-08-06 Sriraman Tallam <tmsriram@google.com>
10451 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10452 valid tls_segment only for non-debug-section relocations.
10453 * testsuite/Makefile.am: Add gc_tls_test.
10454 * testsuite/Makefile.in: Regenerate.
10455 * testsuite/gc_tls_test.cc: New file.
10456 * testsuite/gc_tls_test.sh: New file.
10458 2009-08-05 Sriraman Tallam <tmsriram@google.com>
10460 * icf.cc: New file.
10462 * Makefile.am (CCFILES): Add icf.cc.
10463 (HFILES): Add icf.h
10464 * Makefile.in: Regenerate.
10465 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10466 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10467 section, symbol and addend information for the relocs.
10468 * gold.cc (queue_middle_tasks): Call identical code folding.
10469 * gold.h: Add defines for multimap.
10470 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10471 to the call of finalize_local_symbols.
10472 * main.cc (main): Create object of class Icf.
10473 * object.cc (Sized_relobj::do_layout): Allow this function to be
10474 called twice during icf.
10475 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10476 to sections marked as identical by icf.
10477 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10479 (Sized_relobj::do_section_entsize): New function.
10480 * object.h (Object::section_entsize): New function.
10481 (Object::do_section_entsize): New pure virtual function.
10482 (Relobj::finalize_local_symbols): Add new parameter.
10483 (Relobj::do_section_entsize): New function.
10484 * options.h (General_options::icf): New option.
10485 (General_options::icf_iterations): New option.
10486 (General_options::print_icf_sections): New option.
10487 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10488 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10489 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10491 * symtab.cc (Symbol_table::is_section_folded): New function.
10492 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10493 to sections marked as identical by icf.
10494 * symtab.h (Symbol_table::set_icf): New function.
10495 (Symbol_table::icf): New function.
10496 (Symbol_table::is_section_folded): New function.
10497 (Symbol_table::icf_): New data member.
10498 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10499 * testsuite/Makefile.am: Add commands to build icf_test.
10500 * testsuite/Makefile.in: Regenerate.
10501 * testsuite/icf_test.sh: New file.
10502 * testsuite/icf_test.cc: New file.
10504 2009-07-24 Chris Demetriou <cgd@google.com>
10506 * layout.cc (is_compressible_debug_section): Fix incorrect
10507 comment about compressed section names.
10509 2009-07-20 Ian Lance Taylor <ian@airs.com>
10512 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10514 2009-07-16 Ian Lance Taylor <iant@google.com>
10517 * layout.h: #include <map>.
10518 (class Kept_section): Change from struct to class. Add accessors
10519 and setters. Add section size to Comdat_group mapping. Change
10520 Comdat_group to std::map. Add is_comdat_ field. Add
10521 linkonce_size field in union.
10522 (class Layout): Update declaration of find_or_add_kept_section.
10523 Don't declare find_kept_object.
10524 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10525 parameter. Add object, shndx, is_comdat, and is_group_name
10526 parameters. Change all callers. Adjust for new Kept_section.
10527 (Layout::find_kept_object): Remove.
10528 * object.cc (Sized_relobj::include_section_group): Update use of
10529 Kept_section. Rename secnum to shndx. Only record
10530 Kept_comdat_section if sections are the same size.
10531 (Sized_relobj::include_linkonce_section): Update use of
10532 Kept_section. Only record Kept_comdat_section if sections are the
10533 same size. Set size of linkonce section.
10534 (Sized_relobj::map_to_kept_section): Update call to
10535 get_kept_comdat_section.
10536 * object.h (class Sized_relobj): Rename fields in
10537 Kept_comdat_section to drop trailing underscores; change object
10538 field to Relobj*. Change Kept_comdat_section_table to store
10539 struct rather than pointer.
10540 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10541 Add kept_object and kept_shndx parameters. Change all callers.
10542 (Sized_relobj::get_kept_comdat_section): Change return type to
10543 bool. Add kept_object and kept_shndx parameters. Change all
10545 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10546 Layout::find_or_add_kept_section.
10548 2009-07-09 Ian Lance Taylor <iant@google.com>
10550 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10551 Reserve space in the hash table.
10553 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10555 * fileread.cc (File_read::get_mtime): New method.
10556 * fileread.h (Timespec): New structure.
10557 (File_read::get_mtime): New method.
10558 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10559 Renamed from timestamp_nsec.
10560 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10562 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
10564 (Incremental_inputs::report_archive): Save mtime; style fix.
10565 (Incremental_inputs::report_obejct): Save mtime; style fix.
10566 (Incremental_inputs::report_script): Save mtime; style fix.
10567 (Incremental_inputs::finalize_inputs): Style fix.
10568 (Incremental_inputs::finalize): Style fix.
10569 (Incremental_inputs::create_input_section_data): Store inputs
10571 * incremental.h (Incremental_inputs::report_script): Add mtime
10573 (Incremental_inputs::Input_info::Input_info): Intialize only one
10575 (Incremental_inputs::Input_info::archive): Move to nameless
10577 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10578 (Incremental_inputs::Input_info::script): Move to nameless union.
10579 (Incremental_inputs::mtime): New field.
10580 * script.cc (read_input_script): Pass file mtime to
10582 * script.h (Script_info::inputs): Style fix.
10584 2009-07-01 Ian Lance Taylor <ian@airs.com>
10586 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10589 2009-06-24 Ian Lance Taylor <iant@google.com>
10592 * layout.cc (Layout::choose_output_section): If we find an
10593 existing section, update the flags.
10594 (Layout::create_notes): New function, broken out of
10596 (Layout::finalize): Don't create note sections.
10597 (Layout::create_note): Don't crash if linker script discards
10599 (Layout::create_gold_note): Likewise.
10600 (Layout::create_build_id): Likewise. Don't set
10601 after_input_sections on the section.
10602 (Layout::create_executable_stack_info): Remove target parameter.
10604 * layout.h (class Layout): Declare create_notes. Update
10605 declaration of create_executable_stack_info.
10606 * gold.cc (queue_middle_tasks): Call create_notes.
10607 * output.cc (Output_section::update_flags_for_input_section): Move
10608 here from output.h. If SHF_ALLOC flag is newly set, mark address
10610 * output.h (Output_data::mark_address_invalid): New function.
10611 (class Output_section): Only declare, not define,
10612 update_flags_for_input_section. Remove set_flags.
10614 2009-06-24 Ian Lance Taylor <iant@google.com>
10616 * script-sections.cc (Output_section_definition::
10617 set_section_addresses): Rename shadowing local load_address to
10620 2009-06-24 Ian Lance Taylor <iant@google.com>
10623 * reloc.cc (relocate_sections): Skip empty relocation sections.
10625 2009-06-23 Ian Lance Taylor <iant@google.com>
10628 * layout.cc (Layout::create_note): Use choose_output_section
10629 rather than make_output_section.
10631 2009-06-23 Ian Lance Taylor <iant@google.com>
10634 * options.cc (General_options::parse_V): Set printed_version_.
10635 (General_options::General_options): Initialize printed_version_.
10636 * options.h (class General_options): Add printed_version_ field.
10637 * gold.cc (queue_initial_tasks): If there are no input files,
10638 don't give a fatal error if we printed the version information.
10639 (queue_middle_tasks): If using -r with a shared object, give a
10640 fatal error rather than an ordinary error.
10642 2009-06-23 Ian Lance Taylor <iant@google.com>
10645 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10646 (Layout::make_output_section): Set have_stabstr_section_ if we see
10647 a .stab*str section.
10648 (Layout::finalize): Call link_stabs_sections.
10649 (Layout::link_stabs_sections): New file.
10650 * layout.h (class Layout): Add have_stabstr_section_ field.
10651 Declare link_stabs_sections.
10653 2009-06-23 Doug Kwan <dougkwan@google.com>
10655 * Makefile.am (libgold_a_LIBADD): New.
10656 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
10657 * Makefile.in: Regenerate.
10658 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10659 * configure: Regenerate.
10660 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10661 * fileread.cc: Include sys/state.h
10662 * gold.h: Declare memmem and strndup if found missing.
10663 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10665 2009-06-23 Ian Lance Taylor <iant@google.com>
10667 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10668 * configure: Rebuild.
10670 2009-06-23 Ian Lance Taylor <iant@google.com>
10673 * object.cc (Object::section_contents): Don't try to get a view if
10674 the section has length zero.
10675 (Object::handle_gnu_warning_section): If the section is empty, use
10676 the name of the section as the warning.
10678 2009-06-23 Ian Lance Taylor <iant@google.com>
10681 * stringpool.h (class Stringpool_template): Add optimize_ field.
10682 (Stringpool_template::set_optimize): New function.
10683 * stringpool.cc (Stringpool_template::Stringpool_template):
10684 Initialize optimize_ field.
10685 (Stringpool_template::set_string_offsets): Test local optimize
10686 fild rather than parameter.
10687 * layout.cc (Layout::Layout): Call set_optimize on the section
10690 2009-06-22 Ian Lance Taylor <iant@google.com>
10693 * yyscript.y: Parse TARGET.
10694 * script.cc (script_set_target): New function.
10695 * script-c.h (script_set_target): Declare.
10696 * options.cc (General_options::string_to_object_format): Rename
10697 from string_to_object_format in anonymous namespace. Change
10699 * options.h (class General_options): Declare
10700 string_to_object_format.
10702 2009-06-22 Ian Lance Taylor <iant@google.com>
10704 * script-sections.cc (Script_sections::create_segments): Don't put
10705 program headers in a PT_LOAD segment if -n or -N.
10707 2009-06-22 Ian Lance Taylor <iant@google.com>
10710 * options.h (class General_options): Add -z lazy and -z now. Sort
10711 -z options into alphabetical order.
10712 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10714 2009-06-21 Ian Lance Taylor <iant@google.com>
10716 * layout.cc (Layout::make_output_section): Call
10717 Target::new_output_section.
10718 (Layout::attach_allocated_section_to_segment): Put large section
10719 sections in a separate load segment with the large segment flag
10721 (Layout::segment_precedes): Sort large data segments after other
10723 (align_file_offset): New static function.
10724 (Layout::set_segment_offsets): Use align_file_offset.
10725 * output.h (class Output_section): Add is_small_section_ and
10726 is_large_section_ fields.
10727 (Output_section::is_small_section): New function.
10728 (Output_section::set_is_small_section): New function.
10729 (Output_section::is_large_section): New function.
10730 (Output_section::set_is_large_section): New function.
10731 (Output_section::is_large_data_section): New function.
10732 (class Output_segment): Add is_large_data_segment_ field.
10733 (Output_segment::is_large_data_segment): New function.
10734 (Output_segment::set_is_large_data_segment): New function.
10735 * output.cc (Output_section::Output_section): Initialize new
10737 (Output_segment::Output_segment): Likewise.
10738 (Output_segment::add_output_section): Add assertion that large
10739 data sections always go in large data segments. Force small data
10740 sections to the end of the list of data sections. Force small BSS
10741 sections to the start of the list of BSS sections. For large BSS
10742 sections to the end of the list of BSS sections.
10743 * symtab.h (class Symbol): Declare is_common_shndx.
10744 (Symbol::is_defined): Check Symbol::is_common_shndx.
10745 (Symbol::is_common): Likewise.
10746 (class Symbol_table): Define enum Commons_section_type. Update
10747 declarations. Add small_commons_ and large_commons_ fields.
10748 * symtab.cc (Symbol::is_common_shndx): New function.
10749 (Symbol_table::Symbol_table): Initialize new fields.
10750 (Symbol_table::add_from_object): Put small and large common
10751 symbols in the right list.
10752 (Symbol_table::sized_finalized_symbol): Check
10753 Symbol::is_common_shndx.
10754 (Symbol_table::sized_write_globals): Likewise.
10755 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10756 common symbol lists. Don't call do_allocate_commons_list if the
10758 (Symbol_table::do_allocate_commons_list): Remove is_tls
10759 parameter. Add comons_section_type parameter. Change all
10760 callers. Handle small and large common symbols.
10761 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10762 Symbol::is_common_shndx.
10763 * resolve.cc (symbol_to_bits): Likewise.
10764 * target.h (Target::small_common_shndx): New function.
10765 (Target::small_common_section_flags): New function.
10766 (Target::large_common_shndx): New function.
10767 (Target::large_common_section_flags): New function.
10768 (Target::new_output_section): New function.
10769 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10770 small_common_section_flags, and large_common_section_flags
10772 (Target::do_new_output_section): New virtual function.
10773 * arm.cc (Target_arm::arm_info): Initialize new fields.
10774 * i386.cc (Target_i386::i386_info): Likewise.
10775 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10777 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10778 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10779 (Target_x86_64::do_new_output_section): New function.
10780 * configure.ac: Define conditional MCMODEL_MEDIUM.
10781 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10782 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10783 (large_LDFLAGS): Define.
10784 * testsuite/large.c: New file.
10785 * testsuite/testfile.cc (Target_test::test_target_info):
10786 Initialize new fields.
10787 * configure, testsuite/Makefile.in: Rebuild.
10789 2009-06-05 Doug Kwan <dougkwan@google.com>
10791 * Makefile.am (CCFILES): Add target.cc.
10792 * Makefile.in: Regenerate.
10793 * i386.cc (class Target_i386): Define new virtual method to
10794 override do_is_local_label_name in parent.
10795 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10796 local symbols if --discard-locals or -X is given.
10797 * options.h (class General_options): Declare new options
10798 '--discard-locals' and '-X' for discarding locals.
10799 * target.h (class Target): Define new methods is_local_label_name.
10800 Declare new virtual method do_is_local_label_name.
10801 * target.cc: New file.
10802 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10803 (check_SCRIPTS): Add discard_locals_test.sh.
10804 (check_DATA): Add discard_local_tests.syms.
10805 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10806 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10807 * testsuite/Makefile.in: Regenerate.
10808 * testsuite/discard_locals_test.c: New file.
10809 * testsuite/discard_locals_test.sh: Same.
10811 2009-06-05 Doug Kwan <dougkwan@google.com>
10813 * object.cc (Sized_relobj::Sized_relobj): Initialize
10814 discarded_eh_frame_shndx_ to -1U.
10815 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10817 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10818 a discarded .eh_frame section.
10819 (Sized_relobj::do_finalize_local_symbols): Ditto.
10820 * object.h (class Sized_relobj): Declare new member
10821 discarded_eh_frame_shndx_.
10822 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10823 (local_labels_test.o, local_labels_test): New rules.
10824 * testsuite/Makefile.in: Regenerate.
10826 2009-06-04 Doug Kwan <dougkwan@google.com>
10828 * layout.cc (Layout::section_name_mapping): Add mapping for
10829 special ARM sections.
10831 2009-06-03 Doug Kwan <dougkwan@google.com>
10833 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10834 (utils::has_overflow): Same.
10836 2009-06-03 Ian Lance Taylor <iant@google.com>
10838 * layout.cc (Layout::section_name_mapping): New array, replacing
10839 Layout::linkonce_mapping.
10840 (Layout::section_name_mapping_count): New variable, replacing
10841 Layout::linkonce_mapping_count.
10842 (Layout::linkonce_output_name): Remove.
10843 (Layout::output_section_name): Rewrite.
10844 * layout.h (class Layout): Rename Linkonce_mapping to
10845 Section_name_mapping, linkonce_mapping to section_name_mapping,
10846 linkonce_mapping_count to section_name_mapping_count. Don't
10847 declare linkonce_output_name.
10849 2009-06-03 Doug Kwan <dougkwan@google.com>
10851 * gold/arm.cc (namespace utils): New.
10852 (Target_arm::reloc_is_non_pic): Define new method.
10853 (class Arm_relocate_functions): New.
10854 (Target_arm::Relocate::relocate): Handle relocation types used by
10857 2009-06-03 Ian Lance Taylor <iant@google.com>
10859 * arm.cc (Target_arm::scan::global): Use || instead of |.
10861 2009-06-02 Doug Kwan <dougkwan@google.com>
10863 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10864 issued_non_pic_error_.
10865 (class Target_arm::Scan): Declare new method check_non_pic.
10866 Define new method symbol_needs_plt_entry.
10867 Declare new data member issued_non_pic_error_.
10868 (class Target_arm::Relocate): Declare new method
10869 should_apply_static_reloc.
10870 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10871 (Target_arm::Scan::check_non_pic): Define new method.
10872 (Target_arm::Scan::local): Handle a small subset of reloc types used
10874 (Target_arm::Scan::local): Same.
10875 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10877 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10879 * incremental.cc (Incremental_inputs::report_command_line): Filter
10880 out --incremental-* options.
10882 2009-05-29 Doug Kwan <dougkwan@google.com>
10884 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10886 (class Target_arm): Update comment.
10887 (Target_arm::Target_arm): Initialize new data members GOT_,
10888 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10889 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10890 and Target_arm::rel_dyn_section.
10891 Declare new_enum Target_arm::Got_type.
10892 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10894 Update commments for member do_dynsym_value.
10895 (Target_arm::got_size, Target_arm::plt_section,
10896 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10897 new methods inside class defintion.
10898 (Target_arm::got_section): Define new method.
10899 (Target_arm::rel_dyn_section): Same.
10900 (Output_data_plt_arm): New template class.
10901 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10902 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10903 (Output_data_plt_arm::add_entry): Same.
10904 (Output_data_plt_arm::first_plt_entry): Define new
10905 static data member for PLT instruction template.
10906 (Output_data_plt_arm::plt_entry): Same.
10907 (Output_data_plt_arm::do_write): Define new method.
10908 (Target_arm::make_plt_entry): Same.
10909 (Target_arm::do_finalize_sections): Same.
10910 (Target_arm::do_dynsym_value): Same.
10912 2009-05-28 Doug Kwan <dougkwan@google.com>
10914 * Makefile.am (TARGETSOURCES): Add arm.cc.
10915 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10916 * Makefile.in: Regenerate.
10917 * arm.cc: New file.
10918 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10920 2009-05-26 Doug Kwan <dougkwan@google.com>
10922 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10923 (General_options::check_excluded_libs): Strip off directories in
10924 archive name before matching like GNU ld does.
10925 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10926 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10927 (exclude_libs_test_LDFLAGS): Add linker option
10928 -Wl,--exclude-libs,libexclude_libs_test_3
10929 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10930 an explicit archive without using -l.
10931 (alt/libexclude_libs_test_3.a): New make rule.
10932 * testsuite/Makefile.in: Regenerate.
10933 * testsuite/exclude_libs_test.c : Declare lib3_default().
10935 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10936 * exclude_libs_test_3.c: New file.
10938 2009-05-26 Nick Clifton <nickc@redhat.com>
10940 * po/id.po: New Indonesian translation.
10941 * po/gold.pot: Updated template file.
10943 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10945 * testsuite/Makefile.am: Add -ffunction-sections to compile
10946 gc_comdat_test files. Add -Wl,--gc-sections to build
10948 * testsuite/Makefile.in: Regenerate.
10949 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10951 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10953 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10954 kept comdat section was garbage collected.
10955 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10956 * testsuite/Makefile.in: Regenerate.
10957 * testsuite/gc_comdat_test.sh: New file.
10958 * testsuite/gc_comdat_test_1.cc: New file.
10959 * testsuite/gc_comdat_test_2.cc: New file.
10961 2009-05-19 Doug Kwan <dougkwan@google.com>
10963 * archive.cc (Archive::Archive): Move constructor from archive.h
10964 to here. Initialize no_export_.
10965 (Archive::get_elf_object_for_member): Set no_export flag of object.
10966 * archive.h (Archive::Archive): Move constructor body to
10968 (Archive::no_export): New method.
10969 (Archive::no_export_): New field.
10970 * object.h (Object::Object): Initialize no_export_ to false.
10971 (Object::no_export, Object::set_no_export): New methods.
10972 (Object::no_export_): New field.
10973 * options.cc (General_options::parse_exclude_libs): New method.
10974 (General_options::check_excluded_libs) Same.
10975 * options.h (exclude_libs): New option.
10976 (General_options::check_excluded_libs): New method declaration.
10977 (General_options::excluded_libs_): New field.
10978 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10979 default or protected visibility if an object has no-export flag set.
10980 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10981 (check_SCRIPTS): Add exclude_libs_test.sh.
10982 (check_DATA): Add exclude_libs_test.syms.
10983 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10984 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10985 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10986 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10987 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10988 libexclude_libs_test_2.a): New rules.
10989 * testsuite/Makefile.in: Regenerate.
10990 * testsuite/exclude_libs_test.c: New file.
10991 * testsuite/exclude_libs_test.sh: Ditto.
10992 * testsuite/exclude_libs_test_1.c: Ditto.
10993 * testsuite/exclude_libs_test_2.c: Ditto.
10995 2009-05-15 Ian Lance Taylor <iant@google.com>
10997 * configure.ac: Check for declarations for cases where libiberty.h
10998 checks HAVE_DECL_xxx.
10999 * configure, config.in: Rebuild.
11001 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11003 * gold.h (Incremental_argument_list): Remove (invalid) forward
11005 * incremental.cc (Incremental_inputs::report_achive): New method.
11006 (Incremental_inputs::report_object): New method.
11007 (Incremental_inputs::report_script): New method.
11008 (Incremental_inputs::finalize_inputs): New method.
11009 (Incremental_inputs::finalize): Call finalize_inputs().
11010 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11011 Create inputs entries.
11012 * incremental.h (Incremental_input_type): New enum.
11013 (Incremental_inputs::Incremental_input): Initialize new fields.
11014 (Incremental_inputs::report_inputs): New method.
11015 (Incremental_inputs::report_achive): New method.
11016 (Incremental_inputs::report_object): New method.
11017 (Incremental_inputs::report_script): New method.
11018 (Incremental_inputs::finalize_inputs): New method.
11019 (Incremental_inputs::Input_info): New struct.
11020 (Incremental_inputs::Input_info_map): New typedef.
11021 (Incremental_inputs::lock_): New field.
11022 (Incremental_inputs::Inputs_): New field.
11023 (Incremental_inputs::Inputs_map): New field.
11024 * main.cc (main): Call Incremental_input::report_inputs.
11025 * options.h (Input_argument_list): Typedef moved from
11027 (Input_file_group::Files): Remove, use ::Input_argument_list.
11028 (Input_file_group::Input_argument_list): Remove, use
11029 ::Input_argument_list.
11030 * plugin.cc (Plugin_manager::add_input_file): Add error in
11032 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11034 * script.cc (read_input_script): Call
11035 Incremental_input::report_script.
11036 * script.h (Script_info): New class.
11038 2009-04-27 Ian Lance Taylor <iant@google.com>
11040 * x86_64.cc (do_adjust_output_section): Set entsize to
11043 2009-04-23 Elliott Hughes <enh@google.com>
11045 * output.cc (Output_file::close): After short writes, continue
11046 writing from the correct offset in the buffer being written.
11048 2009-04-23 Chris Demetriou <cgd@google.com>
11050 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11051 * configure: Regenerate.
11052 * config.in: Regenerate.
11053 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11054 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11056 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11058 * incremental.cc (Incremental_inputs_header_data): Renamed from
11059 Incremental_input_header_data.
11060 (Incremental_inputs_header_data::data_size): New field.
11061 (Incremental_inputs_header_data::put_input_file_count): Renamed
11062 from input_file_count.
11063 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11064 from command_line_offset.
11065 (Incremental_inputs_header_data::put_reserved): Renamed from
11067 (Incremental_inputs_entry_data): Renamed from
11068 Incremental_input_entry_data.
11069 (Incremental_inputs_entry_data::data_size): New field.
11070 (Incremental_inputs::report_command_line): New method.
11071 (Incremental_inputs::finalize): New method.
11072 (Incremental_inputs::create_incremental_inputs_data): New method.
11073 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11074 * incremental.h: New file.
11075 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
11076 (Layout::finalize): Create incremental inputs section in
11077 incremental builds.
11078 (Layout::create_incremental_info_sections): New method.
11079 * layout.h (Layout::incremental_inputs): New method.
11080 (Layout::create_incremental_info_sections): New method.
11081 (Layout::incremental_inputs_): New field.
11082 * main.cc (main): Notify Incremental_input of the command line.
11084 2009-04-01 Ian Lance Taylor <iant@google.com>
11085 Mikolaj Zalewski <mikolajz@google.com>
11087 * gold.h (reserve_unordered_map): Define, three versions, one for
11088 each version of Unordered_map.
11089 * layout.cc (Layout::Layout): Remove options parameter. Add
11090 number_of_input_files parameter. Don't initialize options_.
11091 Initialize number_of_input_files_ and resized_signatures_. Move
11092 sections_are_attached_.
11093 (Layout::layout_group): Reserve space for group_signatures_.
11094 (Layout::find_or_add_kept_section): Change name parameter to be a
11095 reference. Resize signatures_ map when it gets large enough.
11096 (Layout::layout_eh_frame): Use parameters->options() instead of
11098 (Layout::make_output_section): Likewise.
11099 (Layout::attach_allocated_section_to_segment): Likewise.
11100 (Layout::finalize, Layout::create_executable_stack): Likewise.
11101 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11102 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11103 * layout.h (class Layout): Update declarations. Remove options_
11104 field. Add number_of_input_files_ and resized_signatures_
11105 fields. Move sections_are_attached_ field.
11106 * main.cc (main): Pass number of input files to Layout
11107 constructor. Don't pass options.
11109 2009-03-30 Ian Lance Taylor <iant@google.com>
11111 * ffsll.c (ffsll): Correct implementation.
11113 2009-03-27 Ian Lance Taylor <iant@google.com>
11115 * ffsll.c: New file.
11116 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11117 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11118 * ftruncate.c (ftruncate): Declare before definition.
11119 * mremap.c (mremap): Likewise.
11120 * pread.c (pread): Likewise.
11121 * configure, Makefile.in, config.in: Rebuild.
11123 * mremap.c: New file.
11124 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11125 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11126 (mremap): Declare if HAVE_MREMAP is not defined.
11127 * configure, Makefile.in, config.in: Rebuild.
11129 2009-03-27 Cary Coutant <ccoutant@google.com>
11131 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11132 position independent.
11133 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11134 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11136 2009-03-24 Cary Coutant <ccoutant@google.com>
11138 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11140 (needs_dynamic_reloc): Likewise.
11142 2009-03-24 Ian Lance Taylor <iant@google.com>
11144 * yyscript.y (file_cmd): Recognize EXTERN.
11145 (extern_name_list, extern_name_list_body): New nonterminals.
11146 * script.cc (script_add_extern): Define.
11147 * script-c.h (script_add_extern): Declare.
11149 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
11151 * object.cc (is_elf_object): Define.
11152 * object.h (is_elf_object): Declare.
11153 * archive.cc (Archive::get_elf_object_for_member): Call
11155 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
11157 2009-03-24 Elliott Hughes <enh@google.com>
11159 * output.cc (Output_file::map_anonymous): Define.
11160 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11161 try an anonymous one. Report the size if the mmap fails.
11162 * output.h (class Output_file): Declare map_anonymous.
11164 2009-03-24 Ian Lance Taylor <iant@google.com>
11166 * target-select.cc (instantiate_target): Don't acquire the lock if
11167 the instantiated_target_ field has already been set.
11169 2009-03-23 Ian Lance Taylor <iant@google.com>
11171 * gold-threads.h (class Initialize_lock): Define.
11172 * gold-threads.cc (class Initialize_lock_once): Define.
11173 (initialize_lock_control): New static variable.
11174 (initialize_lock_pointer): New static variable.
11175 (initialize_lock_once): New static function.
11176 (Initialize_lock::Initialize_lock): Define.
11177 (Initialize_lock::initialize): Define.
11178 * target-select.h: Include "gold-threads.h".
11179 (class Target_selector): Add lock_ and initialize_lock_ fields.
11180 Don't define instantiate_target, just declare it.
11181 * target-select.cc (Target_selector::Target_selector): Initialize
11183 (Target_selector::instantiate_target): Define.
11184 * descriptors.h: Include "gold-threads.h".
11185 (class Descriptors): Add initialize_lock_ field.
11186 * descriptors.cc (Descriptors::Descriptors): Initialize new
11188 (Descriptors::open): Use initialize_lock_ field
11189 * errors.h (class Errors): Add initialize_lock_ field.
11190 * errors.cc (Errors::Errors): Initialize new field.
11191 (Errors::initialize_lock): Use initialize_lock_ field.
11192 * powerpc.cc (class Target_selector_powerpc): Remove
11193 instantiated_target_ field. In do_recognize call
11194 instantiate_target rather than do_instantiate_target. In
11195 do_instantiate_target just allocate a new target.
11196 * sparc.cc (class Target_selector_sparc): Likewise.
11198 * freebsd.h: New file.
11199 * i386.cc: Include "freebsd.h".
11200 (Target_i386): Derive from Target_freebsd rather than
11202 (Target_selector_i386): Derive from Target_selector_freebsd rather
11203 than Target_selector.
11204 * x86_64.cc: Include "freebsd.h".
11205 (Target_x86_64): Derive from Target_freebsd rather than
11207 (Target_selector_x86_64): Derive from Target_selector_freebsd
11208 rather than Target_selector.
11209 * target.h (class Target): Add adjust_elf_header and
11210 do_adjust_elf_header.
11211 * output.cc (Output_file_header:: do_sized_write): Call target
11212 adjust_elf_header routine.
11213 * configure.tgt: Set targ_osabi.
11214 * configure.ac: Define GOLD_DEFAULT_OSABI.
11215 * parameters.cc (Parameters::default_target): Pass
11216 GOLD_DEFAULT_OSABI to select_target.
11217 * target-select.h (class Target_selector): Make instantiate_target
11218 protected rather than private.
11219 * Makefile.am (HFILES): Add freebsd.h.
11220 * configure, Makefile.in, config.in: Rebuild.
11222 * merge.cc (do_add_input_section): Correct pend value. Change
11223 message about last entry not being null terminated from error to
11226 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11228 * incremental.cc: New file.
11229 * Makefile.am (CCFILES): Add incremental.cc.
11230 * Makefile.in: Rebuild.
11232 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11234 * layout.cc (Layout::output_section_name): Preserve names
11235 of '.note.' sections.
11237 2009-03-19 Ian Lance Taylor <iant@google.com>
11239 * descriptors.cc (Descriptors::open): Check that the options are
11240 valid before using them.
11242 2009-03-18 Ian Lance Taylor <iant@google.com>
11244 * script-sections.h: Include <list>.
11245 (class Script_sections): Change Sections_elements from std::vector
11246 to std::list. Typedef public Elements_iterator. Add
11247 orphan_section_placement_, data_segment_align_start_, and
11248 saw_data_segment_align_ fields. Remove data_segment_align_index_
11250 * script-sections.cc (class Orphan_section_placement): New class.
11251 (class Sections_element): Add virtual functions is_relro and
11252 orphan_section_init. Remove virtual function place_orphan_here.
11253 (class Output_section_definition): Add is_relro and
11254 orphan_section_init. Remove place_orphan_here.
11255 (class Orphan_output_section): Likewise.
11256 (Script_sections::Script_sections): Update for field changes.
11257 (Script_sections::data_segment_align): Set saw_data_segment_align_
11258 and data_segment_align_start_, not data_segment_align_index.
11259 (Script_sections::data_segment_relro_end): Check
11260 saw_data_segment_align_. Use data_segment_align_start_ rather
11261 than data_segment_align_index_.
11262 (Script_sections::place_orphan): Rewrite to use
11263 Orphan_section_placement.
11265 2009-03-17 Ian Lance Taylor <iant@google.com>
11267 * archive.cc (Archive::add_symbols): Check for a version attached
11268 to the symbol name in the archive map.
11269 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11270 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11271 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11272 (ver_test_11.a): New target.
11273 * testsuite/Makefile.in: Rebuild.
11275 * configure.ac: Check for chsize and posix_fallocate. Replace
11277 * ftruncate.c: New file, from gnulib.
11278 * output.cc (posix_fallocate): Define dummy version if not
11279 HAVE_POSIX_FALLOCATE.
11280 (Output_file::map): Call posix_fallocate rather than lseek and
11282 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11283 * configure, Makefile.in, config.in: Rebuild.
11285 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
11287 * layout.h (Layout::create_note): Add section_name parameter.
11288 * layout.cc (Layout::create_note): Likewise.
11289 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
11291 2009-03-17 Ian Lance Taylor <iant@google.com>
11293 * descriptors.cc: Include "options.h".
11294 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11295 (Descriptors::open): Always use O_CLOEXEC when opening a new
11296 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11297 then set FD_CLOEXEC.
11299 * sparc.cc (class Target_sparc): Add has_got_section.
11300 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11301 make sure we have a GOT section.
11303 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11304 (Target_sparc::Scan::local): Likewise.
11305 (Target_sparc::Scan::global): Likewise.
11306 (Target_sparc::Relocate::relocate): Likewise.
11307 (Target_sparc::Relocate::relocate_tls): Likewise.
11309 * symtab.cc (Symbol_table::define_default_version): New function,
11310 broken out of add_from_object.
11311 (Symbol_table::add_from_object): Call define_default_version.
11312 (Symbol_table::define_special_symbol): Add resolve_oldsym
11313 parameter. Change all callers. If the version for a symbol comes
11314 from a version script, resolve it with the symbol with the same
11315 name with no version. Also add the symbol without a version if
11317 (do_define_in_output_data): If resolving with oldsym, don't delete
11319 (do_define_in_output_segment): Likewise.
11320 (do_define_as_constant): Likewise.
11321 * symtab.h (class Symbol_table): Update declarations.
11323 2009-03-13 Ian Lance Taylor <iant@google.com>
11325 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11326 (Read_symbols::requeue): New function.
11327 (Read_symbols::do_read_symbols): If make_elf_object fails because
11328 the target type is not configured, and the file was searched for,
11329 issue a warning and retry with the next directory.
11330 (Add_symbols::run): If the file has an incompatible format, and
11331 it was searched for, requeue the Read_symbols task. On error,
11332 release the object.
11333 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11334 dirindex parameter to constructor. Change all callers. Declare
11335 incompatible_warning and requeue.
11336 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11337 input_argument_ and input_group_ fields. Add them to
11338 constructor. Change all callers.
11339 (class Read_script): Add dirindex_ field. Add it to constructor.
11340 Change all callers.
11341 * archive.cc (Archive::setup): Remove input_objects parameter.
11342 Change all callers.
11343 (Archive::get_file_and_offset): Likewise.
11344 (Archive::read_all_symbols): Likewise.
11345 (Archive::read_symbols): Likewise.
11346 (Archive::get_elf_object_for_member): Remove input_objects
11347 parameter. Add punconfigured parameter. Change all callers.
11348 (Archive::add_symbols): Change return type to bool. Check return
11349 value of include_member.
11350 (Archive::include_all_members): Likewise.
11351 (Archive::include_member): Change return type to bool. Return
11352 false if first included object has incompatible target. Set
11353 included_member_ field.
11354 (Add_archive_symbols::run): If add_symbols returns false, requeue
11356 * archive.h (class Archive): Add included_member_ field.
11357 Initialize it in constructor. Add input_file and searched_for
11358 methods. Update declarations.
11359 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11360 input_argument_ fields. Add them to constructor. Change all
11362 * script.cc: Include "target-select.h".
11363 (class Parser_closure): Add skip_on_incompatible_target_ and
11364 found_incompatible_target_ fields. Add
11365 skip_on_incompatible_target parameter to constructor. Change all
11366 callers. Add methods skip_on_incompatible_target,
11367 clear_skip_on_incompatible_target, found_incompatible_target, and
11368 set_found_incompatible_target.
11369 (read_input_script): Add dirindex parameter. Change all callers.
11370 If parser finds an incompatible target, requeue Read_symbols
11372 (script_set_symbol): Clear skip_on_incompatible_target in
11374 (script_add_assertion, script_parse_option): Likewise.
11375 (script_start_sections, script_add_phdr): Likewise.
11376 (script_check_output_format): New function.
11377 * script.h (read_input_script): Update declaration.
11378 * script-c.h (script_check_output_format): Declare.
11379 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11380 (ignore_cmd): Remove OUTPUT_FORMAT.
11381 * fileread.cc (Input_file::Input_file): Add explicit this.
11382 (Input_file::will_search_for): New function.
11383 (Input_file::open): Add pindex parameter. Change all callers.
11384 * fileread.h (class Input_file): Add input_file_argument method.
11385 Declare will_search_for. Update declarations.
11386 * object.cc (make_elf_object): Add punconfigured parameter.
11387 Change all callers.
11388 * object.h (class Object): Make input_file public. Add
11389 searched_for method.
11390 (make_elf_object): Update declaration.
11391 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11393 * dirsearch.h (class Dirsearch): Update declaration.
11394 * options.h (class General_options): Add --warn-search-mismatch.
11395 * parameters.cc (Parameters::is_compatible_target): New function.
11396 * parameters.h (class Parameters): Declare is_compatible_target.
11397 * workqueue.cc (Workqueue::add_blocker): New function.
11398 * workqueue.h (class Workqueue): Declare add_blocker.
11400 * fileread.cc (Input_file::open): Remove options parameter.
11401 Change all callers.
11402 (Input_file::open_binary): Likewise.
11403 * script.cc (read_input_script): Likewise.
11404 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11405 options parameter from constructor. Change all callers.
11406 (class Read_script): Likewise.
11407 * fileread.h (class Input_file): Update declarations.
11408 * script.h (read_input_script): Update declaration.
11410 2009-03-10 Nick Clifton <nickc@redhat.com>
11412 * po/es.po: New Spanish translation.
11414 2009-03-06 Cary Coutant <ccoutant@google.com>
11416 * options.cc (parse_short_option): Keep dash_z from registering itself.
11418 2009-03-03 Ian Lance Taylor <iant@google.com>
11421 * target-reloc.h (relocate_section): Pass output_section to
11423 * i386.cc (Target_i386::should_apply_static_reloc): Add
11424 output_section parameter. Change all callers.
11425 (Target_i386::Relocate::relocate): Add output_section parameter.
11426 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11427 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11428 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11429 * testsuite/two_file_shared.sh: New script.
11430 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11431 (check_DATA): Add two_file_shared.dbg.
11432 (two_file_shared.dbg): New target.
11433 * testsuite/Makefile.in: Rebuild.
11435 2009-03-01 Ian Lance Taylor <iant@google.com>
11437 * configure.ac: Check for byteswap.h.
11438 * configure: Rebuild.
11439 * config.in: Rebuild.
11441 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11443 * layout.cc (Layout::find_or_add_kept_section): New function.
11444 (Layout::add_comdat): Removed.
11445 * layout.h (struct Kept_section): Move out of class Layout.
11446 Remove trailing underscores from field names. Add group_sections
11447 field. Rename group_ field to is_group. Change all uses.
11448 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11449 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11450 comdat_groups_ field.
11451 (Sized_relobj::include_section_group): Use
11452 find_or_add_kept_section and Kept_section::group_sections.
11453 (Sized_relobj::include_linkonce_section): Likewise.
11454 * object.cc (class Sized_relobj): Don't define Comdat_group or
11455 Comdat_group_table. Remove find_comdat_group and
11456 add_comdat_group. Remove comdat_groups_ field.
11457 * plugin.cc (include_comdat_group): Use
11458 Layout::find_or_add_kept_section.
11460 2009-02-28 Ian Lance Taylor <iant@google.com>
11462 * README: --gc-sections and map files are now supported. Document
11463 some build requirements.
11466 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11467 relocatable link set the value of the section symbol to zero.
11468 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11469 relocatable link don't include the section address in the local
11472 2009-02-27 Ian Lance Taylor <iant@google.com>
11475 * options.h (class Search_directory): Add is_system_directory.
11476 (class General_options): Declare is_in_system_directory.
11477 * options.cc (get_relative_sysroot): Make static.
11478 (get_default_sysroot): Make static.
11479 (General_optoins::is_in_system_directory): New function.
11480 * fileread.cc (Input_file::is_in_system_directory): New function.
11481 * fileread.h (class Input_file): Declare is_in_system_directory.
11482 * object.h (class Object): Add is_in_system_directory.
11483 (class Input_objects): Remove system_library_directory_ field.
11484 * object.cc (Input_objects::add_object): Don't set
11485 system_library_directory_.
11486 (input_objects::found_in_system_library_directory): Remove.
11487 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11488 parameter. Change all callers.
11489 (Symbol_table::sized_write_globals): Likewise.
11490 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11491 Call Object::is_in_system_directory.
11492 * symtab.h (class Symbol_table): Update declarations.
11495 * descriptors.h (Open_descriptor): Add is_on_stack field.
11496 * descriptors.cc (Descriptors::open): If the descriptor is on the
11497 top of the stack, remove it. Initialize is_on_stack field.
11498 (Descriptors::release): Only add pod to stack if it is not on the
11500 (Descriptors::close_some_descriptor): Clear stack_next and
11501 is_on_stack fields.
11504 * output.cc (Output_section::find_starting_output_address): Rename
11505 from starting_output_address; add PADDR parameter; change return
11507 * output.h (class Output_section): Declare
11508 find_starting_output_address instead of starting_output_address.
11509 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11510 section symbol for which we can't find a merge section.
11513 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11514 hidden or internal, force the symbol to be local.
11515 * resolve.cc (Symbol::override_visibility): Define.
11516 (Symbol::override_base): Use override_visibility.
11517 (Symbol_table::resolve): Likewise.
11518 (Symbol::override_base_with_special): Likewise.
11519 (Symbol_table::override_with_special): If the visibility is hidden
11520 or internal, force the symbol to be local.
11521 * symtab.h (class Symbol): Add set_visibility and
11522 override_visibility.
11523 * testsuite/ver_test_1.sh: New file.
11524 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11525 (check_DATA): Add ver_test_1.syms.
11526 (ver_test_1.syms): New target.
11527 * testsuite/Makefile.in: Rebuild.
11529 2009-02-25 Cary Coutant <ccoutant@google.com>
11531 * layout.cc (Layout::choose_output_section): Don't rename sections
11532 when using a linker script that has a SECTIONS clause.
11533 * Makefile.in: Regenerate.
11535 * testsuite/Makefile.am (script_test_5.sh): New test case.
11536 * testsuite/Makefile.in: Regenerate.
11537 * testsuite/script_test_5.cc: New file.
11538 * testsuite/script_test_5.sh: New file.
11539 * testsuite/script_test_5.t: New file.
11541 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
11543 * archive.cc (Archive::include_member): Update calls to add_symbols.
11544 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11545 the Layout argument.
11546 * dynobj.h (do_add_symbols): Add the Layout argument.
11547 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11549 * object.h (Object::add_symbols): Add the Layout argument.
11550 (Object::do_add_symbols): Add the Layout argument.
11551 (Sized_relobj::do_add_symbols): Add the Layout argument.
11552 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11553 Unify the two versions.
11554 (Add_plugin_symbols): Remove.
11555 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11556 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11557 (Add_plugin_symbols): Remove.
11558 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11559 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11560 (Add_symbols::run): Make it work with Pulginobj.
11562 2009-02-06 Ian Lance Taylor <iant@google.com>
11564 * object.cc (Sized_relobj::do_layout): Make info message start
11565 with lower case letter.
11567 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11569 * binary.cc: Fix file comment.
11571 * options.h (enum Incremental_disposition): Define.
11572 (class General_options): Add new options: --incremental,
11573 --incremental_changed, --incremental_unchanged,
11574 --incremental_unknown. Add incremental_disposition_ and
11575 implicit_incremental_ fields.
11576 (General_options::incremental_disposition): New function.
11577 (class Position_dependent_options): Add incremental_disposition
11579 (Position_dependent_options::copy_from_options): Set incremental
11581 * options.cc (General_options::parse_incremental_changed): New
11583 (General_options::parse_incremental_unchanged): New function.
11584 (General_options::parse_incremental_unknown): New function.
11585 (General_options::General_options): Initialize new fields
11586 incremental_disposition_ and implicit_incremental_.
11587 (General_options::finalize): Check for uasge of --incremental-*
11588 without --incremental.
11590 2009-02-06 Chris Demetriou <cgd@google.com>
11592 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11593 pointer and to report location as the file name associated with
11595 (gold_undefined_symbol_at_location): New function to replace the
11596 old gold_undefined_symbol functionality.
11597 * target-reloc.h (relocate_section): Update to use
11598 gold_undefined_symbol_at_location.
11599 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11600 Call gold_undefined_symbol function rather than gold_error.
11601 * errors.h (Errors::undefined_symbol): Take location as a
11602 string, rather than calculating it from a relocation.
11603 * errors.cc (Errors::fatal): Print "fatal error:" before the
11605 (Errors::error, Errors::error_at_location): Print "error: "
11606 before the formatted message.
11607 (Errors::undefined_symbol): Take location as a string, rather
11608 than calculating it from a relocation.
11609 (gold_undefined_symbol_at_location): New function akin to
11610 old gold_undefined_symbol, calculates location from relocation.
11611 (gold_undefined_symbol): Change to take only a Symbol pointer
11612 and to report location as the file name associated with the symbol.
11613 * testsuite/debug_msg.sh: Update for changed error messages.
11614 * testsuite/undef_symbol.sh: Likewise.
11616 2009-02-04 Duncan Sands <baldrick@free.fr>
11619 * reduced_debug_output.h
11620 (Output_reduced_debug_abbrev_section::failed): Use format for
11622 (Output_reduced_debug_info_section::faild): Likewise.
11624 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11626 * script.cc (Lazy_demangler): New class.
11627 (Version_script_info::get_symbol_version_helper): Demangle a
11630 2009-01-29 Cary Coutant <ccoutant@google.com>
11632 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11634 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11636 2009-01-28 Ian Lance Taylor <iant@google.com>
11638 * version.cc (version_string): Bump to 1.9.
11640 * gold.h: Include <cstring> and <stdint.h>.
11641 * version.cc: Include <cstdio>.
11642 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11644 * reduced_debug_output.cc (insert_into_vector): Rename from
11645 Insert_into_vector; change all callers. Use Swap_unaligned to
11646 avoid aliasing issue; remove union since it is unnecessary.
11648 2009-01-27 Sriraman Tallam <tmsriram@google.com>
11650 * Makefile.am (CCFILES): Add gc.cc.
11651 (HFILES): Add gc.h.
11652 * Makefile.in: Regenerate.
11653 * gold.cc (Gc_runner): New class.
11654 (queue_initial_tasks): Call garbage collection related tasks
11655 when corresponding options are invoked.
11656 (queue_middle_gc_tasks): New function.
11657 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11658 processed early before laying out sections during garbage collection.
11659 * gold.h (queue_middle_gc_tasks): New function.
11660 (is_prefix_of): Move from "layout.cc".
11661 * i386.cc (Target_i386::gc_process_relocs): New function.
11662 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11663 * main.cc (main): Create object of class "Garbage_collection".
11664 * object.cc (Relobj::copy_symbols_data): New function.
11665 (Relobj::is_section_name_included): New function.
11666 (Sized_relobj::do_layout): Allow this function to be called twice
11667 during garbage collection and defer layout of section during the
11669 * object.h (Relobj::get_symbols_data): New function.
11670 (Relobj::is_section_name_included): New function.
11671 (Relobj::copy_symbols_data): New function.
11672 (Relobj::set_symbols_data): New function.
11673 (Relobj::get_relocs_data): New function.
11674 (Relobj::set_relocs_data): New function.
11675 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11676 (Relobj::gc_process_relocs): New function.
11677 (Relobj::do_gc_process_relocs): New pure virtual function.
11678 (Relobj::sd_): New data member.
11679 (Sized_relobj::is_output_section_offset_invalid): New function.
11680 (Sized_relobj::do_gc_process_relocs): New function.
11681 * options.h (General_options::gc_sections): Modify to not be a no-op.
11682 (General_options::print_gc_sections): New option.
11683 * plugin.cc (Plugin_finish::run): Remove function call to
11684 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11685 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11686 * reloc.cc (Read_relocs::run): Add task to process relocs and
11687 determine unreferenced sections when doing garbage collection.
11688 (Gc_process_relocs): New class.
11689 (Sized_relobj::do_gc_process_relocs): New function.
11690 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11691 sections that are garbage collected.
11692 * reloc.h (Gc_process_relocs): New class.
11693 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11694 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11695 symbols whose corresponding sections are garbage collected.
11696 (Symbol_table::Symbol_table): Add new parameter for the garbage
11698 (Symbol_table::gc_mark_undef_symbols): New function.
11699 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11700 (Symbol_table::gc_mark_dyn_syms): New function.
11701 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11703 (Symbol_table::add_from_object): Likewise.
11704 (Symbol_table::add_from_relobj): When building shared objects, do not
11705 treat externally visible symbols as garbage.
11706 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11707 table information for static and relocatable links.
11708 * symtab.h (Symbol_table::set_gc): New function.
11709 (Symbol_table::gc): New function.
11710 (Symbol_table::gc_mark_undef_symbols): New function.
11711 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11712 (Symbol_table::gc_mark_dyn_syms): New function.
11713 (Symbol_table::gc_): New data member.
11714 * target.h (Sized_target::gc_process_relocs): New pure virtual
11716 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11717 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11719 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11721 * options.h (General_options::gc_sections): Define as a no-op for now.
11722 (General_options::no_keep_memory): Ditto.
11723 (General_options::Bshareable): Define.
11724 * options.cc (General_options::finalize): Honor -Bshareable.
11726 2009-01-20 Andreas Schwab <schwab@suse.de>
11728 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11729 read the value in the contents, since we don't use it. Use the
11730 template endianness when writing.
11731 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11733 2009-01-19 Andreas Schwab <schwab@suse.de>
11735 * configure.tgt (powerpc64-*): Fix targ_obj.
11737 2009-01-15 Ian Lance Taylor <iant@google.com>
11739 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11740 local symbols when stripping all symbols.
11742 2009-01-14 Cary Coutant <ccoutant@google.com>
11744 * output.cc (Output_reloc): Add explicit instantiations.
11746 2009-01-14 Cary Coutant <ccoutant@google.com>
11748 * archive.cc (Archive::get_elf_object_for_member): Remove call
11749 to File_read::claim_for_plugin.
11750 * descriptors.cc (Descriptors::open): Remove reference to
11752 (Descriptors::claim_for_plugin): Remove.
11753 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11754 (Descriptors::is_claimed): Remove.
11755 (claim_descriptor_for_plugin): Remove.
11756 * fileread.cc (File_read::claim_for_plugin): Remove.
11757 * fileread.h (File_read::claim_for_plugin): Remove.
11758 (File_read::descriptor): Reopen descriptor if necessary.
11759 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11760 (Plugin_manager::all_symbols_read): Add task parameter. Change
11762 (Plugin_manager::get_input_file): New function.
11763 (Plugin_manager::release_input_file): New function.
11764 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11765 corresponding data member.
11766 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11767 and pass to base constructor. Change all callers.
11768 (get_input_file, release_input_file): New functions.
11769 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11770 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11771 (Plugin_manager::all_symbols_read): Add task parameter.
11772 (Plugin_manager::get_input_file): New function.
11773 (Plugin_manager::release_input_file): New function.
11774 (Plugin_manager::task_): New data member.
11775 (Pluginobj::Pluginobj): Add filesize parameter.
11776 (Pluginobj::filename): New function.
11777 (Pluginobj::descriptor): New function.
11778 (Pluginobj::filesize): New function.
11779 (Pluginobj::filesize_): New data member.
11780 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11781 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11782 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11784 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11785 with archive libraries.
11786 * testsuite/Makefile.in: Regenerate.
11787 * testsuite/plugin_test.c (struct sym_info): New type.
11788 (get_input_file, release_input_file): New static variables.
11789 (onload): Capture new transfer vector entries.
11790 (claim_file_hook): Stop reading at end of file according to filesize.
11791 Factor out parsing of readelf output into separate function.
11792 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11793 APIs and get the source file name from the symbol table. Convert
11794 source file name to corresponding object file name. Print info
11795 message when adding new input files.
11796 (parse_readelf_line): New function.
11797 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11798 * testsuite/plugin_test_2.sh: Likewise.
11799 * testsuite/plugin_test_3.sh: Likewise.
11800 * testsuite/plugin_test_4.sh: New test case.
11802 2009-01-07 Ian Lance Taylor <iant@google.com>
11804 * version.cc (version_string): Bump to 1.8.
11806 2008-12-23 Cary Coutant <ccoutant@google.com>
11808 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11809 * plugin.cc (Plugin_manager::finish): Rename as
11810 layout_deferred_objects. Move cleanup to separate function.
11811 (Plugin_manager::cleanup): New function.
11812 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11814 * plugin.h (Plugin_manager::finish): Rename as
11815 layout_deferred_objects.
11816 (Plugin_manager::cleanup): New function.
11817 (Plugin_manager::cleanup_done): New field.
11819 2008-12-23 Cary Coutant <ccoutant@google.com>
11821 * plugin.cc (is_visible_from_outside): New function.
11822 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11823 so we don't return "IR only" status for exported symbols or -r links.
11825 * testsuite/Makefile.am (plugin_test_3): New test case.
11826 * testsuite/Makefile.in: Regenerate.
11827 * testsuite/plugin_test_3.sh: New file.
11829 2008-12-22 Cary Coutant <ccoutant@google.com>
11831 * object.cc (Sized_relobj::layout_section): New function.
11832 (Sized_relobj::do_layout): Defer layout of input sections until after
11833 plugin has provided replacement files.
11834 (Sized_relobj::do_layout_deferred_sections): New function.
11835 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11836 (Relobj::layout_deferred_sections): New function.
11837 (Relobj::do_layout_deferred_sections): New function.
11838 (Sized_relobj::do_layout_deferred_sections): New function.
11839 (Sized_relobj::layout_section): New function.
11840 (Sized_relobj::Deferred_layout): New structure.
11841 (Sized_relobj::deferred_layout_): New field.
11842 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11843 Change all callers. Layout deferred sections.
11844 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11846 (Plugin_hook::run): Move code from do_plugin_hook inline.
11847 (Plugin_hook::do_plugin_hook): Remove.
11848 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11849 (Plugin_manager::finish): Renamed, was cleanup.
11850 (Plugin_manager::should_defer_layout): New function.
11851 (Plugin_manager::add_deferred_layout_object): New function.
11852 (Plugin_manager::Deferred_layout_list): New type.
11853 (Plugin_manager::deferred_layout_objects_): New field.
11854 (Plugin_hook::do_plugin_hook): Remove.
11856 2008-12-17 Ian Lance Taylor <iant@google.com>
11858 * options.h (class General_options): Add --no case for
11861 2008-12-16 Cary Coutant <ccoutant@google.com>
11863 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11865 (Plugin_manager::claim_file): Create plugin object even if
11866 plugin did not call the add_symbols callback.
11867 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11868 asking for more symbols than were added.
11869 * testsuite/Makefile.am (plugin_test_1): Add test case with
11871 (empty.syms): New target.
11872 * testsuite/Makefile.in: Regenerate.
11873 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11874 message. Don't call add_symbols if no globals.
11875 (all_symbols_read_hook): Don't provide replacement for empty
11878 2008-12-12 Ian Lance Taylor <iant@google.com>
11880 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11881 r_type == 0 for a local symbol with r_sym == 0.
11882 (scan_relocatable_relocs): Pass r_sym to
11883 local_non_section_strategy.
11884 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11887 * configure.ac: Update test for TLS descriptors: they are
11888 supported as of glibc 2.9.
11889 * configure: Rebuild.
11891 2008-12-11 Ian Lance Taylor <iant@google.com>
11894 * target-reloc.h (Default_scan_relocatable_relocs): For each
11895 function, map r_type == 0 to RELOC_DISCARD.
11897 2008-12-10 Cary Coutant <ccoutant@google.com>
11899 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11900 object to override a kept COMDAT group from a plugin object.
11902 2008-12-09 Ian Lance Taylor <iant@google.com>
11905 * yyscript.y (file_cmd): Handle INPUT.
11907 * testsuite/initpri1.c: Change all declarations to be full
11908 prototypes by adding void, to avoid compiler warnings.
11910 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
11912 * options.cc (General_options::parse_plugin_opt): New.
11913 (General_options::add_plugin): The argument now is just the filename.
11914 (General_options::add_plugin_option): New.
11915 * options.h (plugin_opt): New.
11916 (add_plugin): Change argument name.
11917 (add_plugin_option): New.
11918 * plugin.cc (Plugin::load): Don't parse the plugin option.
11919 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11920 (Plugin::add_option): New.
11921 (Plugin::args_): Change type.
11922 (Plugin::filename_): New.
11923 (Plugin_manager::add_plugin_option): New.
11924 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11925 * testsuite/Makefile.in: Regenerate.
11927 2008-12-05 Cary Coutant <ccoutant@google.com>
11929 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11930 Handle --strip-lto-sections option.
11931 * options.h (strip_lto_sections): New option.
11933 2008-12-01 Cary Coutant <ccoutant@google.com>
11935 * plugin.cc (ld_plugin_message): Change format parameter to const.
11936 Fix mismatch between new[] and delete.
11938 2008-11-14 Cary Coutant <ccoutant@google.com>
11940 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11943 2008-11-05 Craig Silverstein <csilvers@google.com>
11945 * options.cc (General_options::parse_dynamic_list): New function.
11946 * options.h (General_options): New flags dynamic_list,
11947 dynamic_list_data, dynamic_list_cpp_new, and
11948 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11949 (General_options::in_dynamic_list): New function.
11950 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11951 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11952 (Lex::can_continue_name): Likewise.
11954 (read_script_file): New parameter script_options.
11955 (read_dynamic_list): New function.
11956 (Script_options::define_dynamic_list): New function.
11957 (dynamic_list_keyword_parsecodes): New variable.
11958 (dynamic_list_keywords): New variable.
11959 * script.h (Script_options::define_dynamic_list): New function
11961 (read_dynamic_list): New function prototype.
11962 * symtab.cc (strprefix): New macro.
11963 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11964 dynamic_list_data, dynamic_list_cpp_new, and
11965 dynamic_list_cpp_typeinfo.
11966 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11967 (dynamic_list_expr): New rule.
11968 (dynamic_list_nodes): Likewise.
11969 (dynamic_list_node): Likewise.
11970 * testsuite/Makefile.am (dynamic_list): New test.
11971 * testsuite/Makefile.in: Regenerated.
11972 * testsuite/dynamic_list.t: New file.
11973 * testsuite/dynamic_list.sh: New file.
11975 2008-11-05 Craig Silverstein <csilvers@google.com>
11977 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11978 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11979 (t11_last): Likewise.
11980 * testsuite/ver_test_6.c (main): Likewise.
11982 2008-10-07 Cary Coutant <ccoutant@google.com>
11984 * options.c (General_options::finalize): Add check for -static and
11986 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11989 2008-10-02 Cary Coutant <ccoutant@google.com>
11991 * plugin.cc (make_sized_plugin_object): Fix conditional
11992 compilation to work when not all targets are enabled.
11994 2008-09-29 Cary Coutant <ccoutant@google.com>
11996 * archive.cc (Archive::get_file_and_offset): Use filename instead
11997 of name to get library path.
11998 (Archive::include_member): Unlock external member of a thin archive.
12000 * testsuite/Makefile.am (TEST_AR): New variable.
12001 (thin_archive_test_1): New test.
12002 (thin_archive_test_2): New test.
12003 * testsuite/Makefile.in: Regenerate.
12004 * testsuite/thin_archive_main.cc: New file.
12005 * testsuite/thin_archive_test_1.cc: New file.
12006 * testsuite/thin_archive_test_2.cc: New file.
12007 * testsuite/thin_archive_test_3.cc: New file.
12008 * testsuite/thin_archive_test_4.cc: New file.
12010 2008-09-29 Cary Coutant <ccoutant@google.com>
12012 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12013 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12015 (Sized_relobj::do_finalize_local_symbols): Likewise.
12016 (Sized_relobj::map_to_kept_section): Likewise.
12017 * object.h (Sized_relobj::invalid_address): New constant.
12018 (Sized_relobj::do_output_section_offset): Check for invalid_address
12020 * output.cc (Output_reloc::local_section_offset): Use constant
12021 invalid_address instead of -1U.
12022 (Output_reloc::get_address): Likewise.
12023 (Output_section::output_address): Change -1U to -1ULL.
12024 * output.h (Output_reloc::invalid_address): New constant.
12025 * reloc.cc (Sized_relobj::write_sections): Use constant
12026 invalid_address instead of -1U.
12027 (Sized_relobj::relocate_sections): Likewise.
12028 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12029 values for merge sections.
12030 * target-reloc.h (relocate_for_relocatable): Use constant
12031 invalid_address instead of -1U.
12033 2008-09-19 Cary Coutant <ccoutant@google.com>
12035 Add plugin functionality for link-time optimization (LTO).
12036 * configure.ac (plugins): Add --enable-plugins option.
12037 * configure: Regenerate.
12038 * config.in: Regenerate.
12039 * Makefile.am (LIBDL): New variable.
12040 (CCFILES): Add plugin.cc.
12041 (HFILES): Add plugin.h.
12042 (ldadd_var): Add LIBDL.
12043 * Makefile.in: Regenerate.
12045 * archive.cc: Include "plugin.h".
12046 (Archive::setup): Don't preread archive symbols when using a plugin.
12047 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12048 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12050 (Archive::include_member): Add symbols from plugin objects.
12051 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12052 * descriptors.cc (Descriptors::open): Check for file descriptors
12053 abandoned by plugins.
12054 (Descriptors::claim_for_plugin): New function.
12055 * descriptors.h (Descriptors::claim_for_plugin): New function.
12056 (Open_descriptor::is_claimed): New field.
12057 (claim_descriptor_for_plugin): New function.
12058 * fileread.cc (File_read::claim_for_plugin): New function.
12059 * fileread.h (File_read::claim_for_plugin): New function.
12060 (File_read::descriptor): New function.
12061 * gold.cc: Include "plugin.h".
12062 (queue_initial_tasks): Add task to call plugin hooks for generating
12064 * main.cc: Include "plugin.h".
12065 (main): Load plugin libraries.
12066 * object.h (Pluginobj): Declare.
12067 (Object::pluginobj): New function.
12068 (Object::do_pluginobj): New function.
12069 (Object::set_target): New function.
12070 * options.cc: Include "plugin.h".
12071 (General_options::parse_plugin): New function.
12072 (General_options::General_options): Initialize plugins_ field.
12073 (General_options::add_plugin): New function.
12074 * options.h (Plugin_manager): Declare.
12075 (General_options): Add --plugin option.
12076 (General_options::has_plugins): New function.
12077 (General_options::plugins): New function.
12078 (General_options::add_plugin): New function.
12079 (General_options::plugins_): New field.
12080 * plugin.cc: New file.
12081 * plugin.h: New file.
12082 * readsyms.cc: Include "plugin.h".
12083 (Read_symbols::do_read_symbols): Check for archive before checking
12084 for ELF file. Call plugin hooks to claim files.
12085 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12086 from a real object file; force override when processing replacement
12088 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12089 (Symbol::init_base_object): Likewise.
12090 (Symbol::init_base_output_data): Likewise.
12091 (Symbol::init_base_output_segment): Likewise.
12092 (Symbol::init_base_constant): Likewise.
12093 (Symbol::init_base_undefined): Likewise.
12094 (Symbol::output_section): Assert that object is not a plugin.
12095 (Symbol_table::add_from_pluginobj): New function.
12096 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12098 (Symbol_table::sized_write_globals): Likewise.
12099 (Symbol_table::add_from_pluginobj): Instantiate template.
12100 * symtab.h (Sized_pluginobj): Declare.
12101 (Symbol::in_real_elf): New function.
12102 (Symbol::set_in_real_elf): New function.
12103 (Symbol::in_real_elf_): New field.
12104 (Symbol_table::add_from_pluginobj): New function.
12106 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12107 (LIBDL): New variable.
12108 (LDADD): Add LIBDL.
12109 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12110 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12111 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12112 (MOSTLYCLEANFILES): Likewise.
12113 * testsuite/Makefile.in: Regenerate.
12114 * testsuite/plugin_test.c: New file.
12115 * testsuite/plugin_test_1.sh: New file.
12116 * testsuite/plugin_test_2.sh: New file.
12118 2008-09-16 Ian Lance Taylor <iant@google.com>
12120 * target-reloc.h (relocate_section): Check whether a symbol is
12121 defined by the ABI before reporting an undefined symbol error.
12122 * target.h (Target::is_defined_by_abi): Make parameter const.
12123 (Target::do_is_defined_by_abi): Likewise.
12124 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12125 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12126 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12127 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12128 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12129 * testsuite/Makefile.in: Rebuild.
12131 * fileread.cc (make_view): Add casts to avoid warning.
12133 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12135 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12136 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12138 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12140 * options.h (General_options::output_is_executable): New.
12141 (General_options::output_is_pie): New.
12142 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12143 for shared libraries.
12144 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12146 2008-09-11 Chris Demetriou <cgd@google.com>
12148 * options.h (origin): New -z option.
12149 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12150 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12153 2008-09-05 Cary Coutant <ccoutant@google.com>
12155 * fileread.cc (File_read::make_view): Add check for attempt to map
12156 beyond end of file.
12158 2008-09-05 Cary Coutant <ccoutant@google.com>
12160 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12161 explicit instantiations.
12163 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12166 * options.cc (General_options::finalize): Allow undefined symbols
12167 in shlibs if linking -shared.
12170 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12171 symbols as not needing a dynsym entry.
12173 2008-08-20 Craig Silverstein <csilvers@google.com>
12175 * fileread.cc (File_read::open): Do not lock the file unless it
12176 was successfully opened.
12178 2008-08-14 Cary Coutant <ccoutant@google.com>
12180 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12181 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12182 * testsuite/tls_test.cc (struct int128): 128-bit struct
12183 for testing TLS relocs with non-zero addend.
12184 (v12): New TLS variable.
12186 (t_last): Add check for v12.
12187 * testsuite/tls_test.h (t12): New function.
12188 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12190 2008-08-13 Ian Lance Taylor <iant@google.com>
12192 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12193 set tls_segment_ or relro_segment_.
12194 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12196 * output.h (Output_section::clear_is_relro): New function.
12197 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12198 sections specially even when output_data_ is empty.
12199 (Output_segment::maximum_alignment): When first section is relro,
12200 only force alignment for PT_LOAD segments.
12201 * script.cc (script_data_segment_align): New function.
12202 (script_data_segment_relro_end): New function.
12203 * script-c.h (script_data_segment_align): Declare.
12204 (script_data_segment_relro_end): Declare.
12205 * script-sections.h (class Script_sections): Declare
12206 data_segment_align and data_segment_relro_end. Add fields
12207 segment_align_index_ and saw_relro_end_.
12208 * script-sections.cc (class Sections_element): Add set_is_relro
12209 virtual function. Add new bool* parameter to place_orphan_here.
12210 Add get_output_section virtual function.
12211 (class Output_section_definition): Add set_is_relro. Add new
12212 bool* parameter to place_orphan_here. Add get_output_section.
12213 Add is_relro_ field.
12214 (Output_section_definition::Output_section_definition): Initialize
12215 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12216 and is_relro_ fields.
12217 (Output_section_definition::place_orphan_here): Add is_relro
12219 (Output_section_definition::set_section_addresses): Set relro for
12221 (Output_section_definition::alternate_constraint): Likewise.
12222 (class Orphan_output_section): Add new bool* parameter to
12223 place_orphan_here. Add get_output_section.
12224 (Orphan_output_section::place_orphan_here): Add is_relro
12226 (Script_sections::Script_sections): Initialize
12227 data_segment_align_index_ and saw_relro_end_.
12228 (Script_sections::data_segment_align): New function.
12229 (Script_sections::data_segment_relro_end): New function.
12230 (Script_sections::place_orphan): Set or clear is_relro.
12231 (Script_sections::set_section_addresses): Force alignment of first
12233 * yyscript.y (exp): Call script_data_segment_align and
12234 script_data_segment_relro_end.
12235 * testsuite/relro_script_test.t: New file.
12236 * testsuite/relro_test.cc (using_script): Declare.
12237 (t1, t2): Test using_script.
12238 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12239 (relro_script_test_SOURCES): Define.
12240 (relro_script_test_DEPENDENCIES): Define.
12241 (relro_script_test_LDFLAGS): Define.
12242 (relro_script_test_LDADD): Define.
12243 (relro_script_test.so): New target.
12244 * testsuite/Makefile.in: Rebuild.
12246 2008-08-06 Cary Coutant <ccoutant@google.com>
12248 * archive.cc (Archive::total_archives, Archive::total_members)
12249 (Archive::total_members_loaded): New variables.
12250 (Archive::setup): Add parameter. Add option to preread
12252 (Archive::read_armap): Add counter.
12253 (Archive::get_file_and_offset): New function.
12254 (Archive::get_elf_object_for_member): New function.
12255 (Archive::read_all_symbols): New function.
12256 (Archive::read_symbols): New function.
12257 (Archive::add_symbols): Add counters.
12258 (Archive::include_all_members): Use armap to find members if it's
12260 (Archive::include_member): Skip reading symbols if already read.
12261 Factored code into Archive::get_file_and_offset and
12262 Archive::get_elf_object_for_member. Changed call to
12263 Mapfile::report_include_archive_member.
12264 (Archive::print_stats): New function.
12265 * archive.h: Declare Object and Read_symbols_data classes.
12266 (Archive::Archive): Add initializers for new members.
12267 (Archive::setup): Add parameter.
12268 (Archive::print_stats): New function.
12269 (Archive::total_archives, Archive::total_members)
12270 (Archive::total_members_loaded): New variables.
12271 (Archive::get_file_and_offset): New function.
12272 (Archive::get_elf_object_for_member): New function.
12273 (Archive::read_all_symbols): New function.
12274 (Archive::read_symbols): New function.
12275 (Archive::Archive_member): New class.
12276 (Archive::members_): New member.
12277 (Archive::num_members_): New member.
12278 * main.cc: Include archive.h.
12279 (main): Call Archive::print_stats.
12280 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12281 archive parameter; member_name is now the fully-decorated name.
12282 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12283 * options.h: (General_options): Add --preread-archive-symbols option.
12284 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12287 2008-08-04 Ian Lance Taylor <iant@google.com>
12289 * symtab.h (Symbol::use_plt_offset): New function.
12290 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12291 * powerpc.cc (Relocate::relocate): Likewise.
12292 * sparc.cc (Relocate::relocate): Likewise.
12293 * x86_64.cc (Relocate::relocate): Likewise.
12294 * testsuite/weak_plt.sh: New test.
12295 * testsuite/weak_plt_main.cc: New test.
12296 * testsuite/weak_plt_shared.cc: New test.
12297 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12298 (check_PROGRAMS): Add weak_plt.
12299 (check_DATA): Add weak_plt_shared.so.
12300 (weak_plt_main_pic.o, weak_plt): New targets.
12301 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12302 * testsuite/Makefile.in: Rebuild.
12304 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12306 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12307 * testsuite/Makefile.in: Rebuild.
12309 2008-08-04 Alan Modra <amodra@bigpond.net.au>
12311 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12312 * Makefile.in: Regenerate.
12313 * po/POTFILES.in: Regenerate.
12315 2008-07-29 Ian Lance Taylor <iant@google.com>
12317 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12318 symbols before other symbols.
12319 * testsuite/script_test_2.cc (test_addr): Declare.
12320 (test_addr_alias): Declare.
12321 (main): Check that test_addr and test_addr_alias have the right
12323 * testsuite/script_test_2.t: Define test_addr_alias and
12326 2008-07-24 Ian Lance Taylor <iant@google.com>
12329 * descriptors.cc: New file.
12330 * descriptors.h: New file.
12331 * gold-threads.h (class Hold_optional_lock): New class.
12332 * fileread.cc: Include "descriptors.h".
12333 (File_read::~File_read): Release descriptor rather than closing
12335 (File_read::open) [file]: Call open_descriptor rather than open.
12336 Set is_descriptor_opened_.
12337 (File_read::open) [memory]: Assert that descriptor is not open.
12338 (File_read::reopen_descriptor): New function.
12339 (File_read::release): Release descriptor.
12340 (File_read::do_read): Make non-const. Reopen descriptor.
12341 (File_read::read): Make non-const.
12342 (File_read::make_view): Reopen descriptor.
12343 (File_read::do_readv): Likewise.
12344 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12345 Update declarations.
12346 * layout.cc: Include "descriptors.h".
12347 (Layout::create_build_id): Use open_descriptor rather than open.
12348 * output.cc: Include "descriptors.h".
12349 (Output_file::open): Use open_descriptor rather than open.
12350 * archive.cc (Archive::const_iterator): Change Archive to be
12352 (Archive::begin, Archive::end): Make non-const.
12353 (Archive::count_members): Likewise.
12354 * archive.h (class Archive): Update declarations.
12355 * object.h (Object::read): Make non-const.
12356 * Makefile.am (CCFILES): Add descriptors.cc.
12357 (HFILES): Add descriptors.h.
12358 * Makefile.in: Rebuild.
12361 * gold.h: Always include <clocale>. Add Solaris workarounds
12362 following code in binutils/sysdep.h.
12365 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12366 this->eh_frame_hdr_ is NULL before using it.
12368 * dynobj.cc (Versions::Versions): Update comment.
12370 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12371 the base version name.
12373 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12374 array size plus one.
12375 (Stringpool_template::set_string_offsets): Subtract one from key
12376 before using it as an array index.
12377 (Stringpool_template::get_offset_with_length): Likewise.
12378 (Stringpool_template::write_to_buffer): Likewise.
12379 * stringpool.h (Stringpool_template::get_offset_from_key):
12382 2008-07-23 Ian Lance Taylor <iant@google.com>
12385 * object.h (Merged_symbol_value::value): Do our best to handle a
12389 * script.cc (Version_script_info::get_versions): Don't add empty
12390 version tag to return value.
12391 (Version_script_info::get_symbol_version_helper): Change return
12392 type to bool. Add pversion parameter. Change all callers.
12393 (script_register_vers_node): Don't require a non-NULL tag.
12394 * script.h (class Version_script_info): Update declarations.
12395 (Version_script_info::get_symbol_version): Change return type to
12396 bool. Add version parameter. Change all callers.
12397 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12398 handling. Handle an empty version from a version script.
12399 (Symbol_table::define_special_symbol): Likewise.
12400 * testsuite/ver_test_10.script: New file.
12401 * testsuite/ver_test_10.sh: New file.
12402 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12403 (check_DATA): Add ver_test_10.syms.
12404 (ver_test_10.syms, ver_test_10.so): New target.
12405 * testsuite/Makefile.in: Rebuild.
12407 2008-07-23 Simon Baldwin <simonb@google.com>
12409 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12410 to zero for undefined symbols from dynamic libraries.
12412 2008-07-23 Ian Lance Taylor <iant@google.com>
12414 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12415 Change all callers.
12416 * symtab.h (class Symbol_table): Update declaration.
12417 * testsuite/ver_test_9.cc: New file.
12418 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12419 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12420 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12421 (ver_test_9.so, ver_test_9.o): New targets.
12422 * testsuite/Makefile.in: Rebuild.
12424 2008-07-22 Ian Lance Taylor <iant@google.com>
12426 * options.h (class General_options): Define --check-sections.
12427 * layout.cc (Layout::set_segment_offsets): Handle
12430 * options.h (class General_options): Define -n/--nmagic and
12432 * options.cc (General_options::finalize): For -n/--nmagic or
12433 -N/--omagic, set -static.
12434 * layout.cc (Layout::attach_allocated_section_to_segment): If
12435 -N/--omagic, don't put read-only and read-write sections in
12436 different segments.
12437 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12438 finding a read-only segment.
12439 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12440 don't set the minimum segment alignment to the common page size,
12441 and don't set the file offset to the address modulo the page size.
12442 * script-sections.cc (Script_sections::create_segments): If
12443 -n/--omagic, don't put read-only and read-write sections in
12444 different segments.
12446 * cref.cc: New file.
12447 * cref.h: New file.
12448 * options.h (class General_options): Add --print-symbol-counts.
12449 * main.cc (main): Issue defined symbol report if requested.
12450 * archive.cc (Archive::interpret_header): Make into a const member
12452 (Archive::add_symbols): Call Input_objects::archive_start and
12454 (Archive::const_iterator): Define new class.
12455 (Archive::begin, Archive::end): New functions.
12456 (Archive::include_all_members): Rewrite to use iterator.
12457 (Archive::count_members): New function.
12458 * archive.h (class Archive): Update declarations.
12459 (Archive::filename): New function.
12460 * object.cc: Include "cref.h".
12461 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12462 (Sized_relobj::do_get_global_symbol_counts): New function.
12463 (Input_objects::add_object): Add object to cross-referencer.
12464 (Input_objects::archive_start): New function.
12465 (Input_objects::archive_stop): New function.
12466 (Input_objects::print_symbol_counts): New function.
12467 * object.h: Declare Cref and Archive.
12468 (Object::get_global_symbol_counts): New function.
12469 (Object::do_get_global_symbol_counts): New pure virtual function.
12470 (class Sized_relobj): Add defined_count_ field. Update
12472 (class Input_objects): Add cref_ field. Update constructor.
12473 Update declarations.
12474 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12476 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12478 (Sized_dynobj::do_get_global_symbol_counts): New function.
12479 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12480 defined_count_. Update declarations. Define Symbols typedef.
12481 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12482 parameter. Change all callers.
12483 (Symbol_table::add_from_dynobj): Add sympointers and defined
12484 parameters. Change all callers.
12485 * symtab.h (class Symbol_table): Update declarations.
12486 * Makefile.am (CCFILES): Add cref.cc.
12487 (HFILES): Add cref.h.
12488 * Makefile.in: Rebuild.
12490 2008-07-22 Simon Baldwin <simonb@google.com>
12492 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12493 to zero when writing undefined symbols.
12495 2008-07-22 Ian Lance Taylor <iant@google.com>
12497 * output.cc (Output_section::add_input_section): Don't try to
12498 merge empty merge sections.
12500 2008-07-21 Craig Silverstein <csilvers@google.com>
12502 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12503 Include symbol version in error message.
12505 2008-07-20 Chris Demetriou <cgd@google.com>
12507 * configure.ac (gold_cv_c_random_seed): New configured variable.
12508 (RANDOM_SEED_CFLAGS): New substituted variable.
12509 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12510 * configure: Rebuild.
12511 * Makefile.in: Likewise.
12512 * testsuite/Makefile.in: Likewise.
12514 2008-07-18 Ian Lance Taylor <iant@google.com>
12516 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12517 where we see NAME/NULL and NAME/VERSION as separate symbols.
12518 * testsuite/ver_test_main.cc (main): Call t4.
12519 (t4, t4_2a): Define.
12520 * testsuite/ver_test_2.cc (t4_2): Define.
12521 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12522 * testsuite/ver_test_4.cc (t4_2a): Define.
12523 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12524 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12526 2008-07-17 Ian Lance Taylor <iant@google.com>
12528 * dynobj.cc (Versions::add_def): If we give an error about a
12529 missing version, go ahead and create the version anyhow.
12531 2008-07-10 Ian Lance Taylor <iant@google.com>
12533 Handle output sections with more than 0x7fffffff bytes.
12534 * object.h (class Relobj): Change map_to_output_ to
12535 output_sections_, and just keep a section pointer. Change all
12536 uses. Move comdat group support to Sized_relobj.
12537 (Relobj::is_section_specially_mapped): Remove.
12538 (Relobj::output_section): Remove poff parameter. Change all
12540 (Relobj::output_section_offset): New function.
12541 (Relobj::set_section_offset): Rewrite.
12542 (Relobj::map_to_output): Remove.
12543 (Relobj::output_sections): New function.
12544 (Relobj::do_output_section_offset): New pure virtual function.
12545 (Relobj::do_set_section_offset): Likewise.
12546 (class Sized_relobj): Add section_offsets_ field. Add comdat
12547 group support from Relobj. Update declarations.
12548 (Sized_relobj::get_output_section_offset): New function.
12549 (Sized_relobj::do_output_section_offset): New function.
12550 (Sized_relobj::do_set_section_offset): New function.
12551 * object.cc (Relobj::output_section_address): Remove.
12552 (Sized_relobj::Sized_relobj): Initialize new fields.
12553 (Sized_relobj::include_section_group): Cast find_kept_object to
12555 (Sized_relobj::include_linkonce_section): Likewise.
12556 (Sized_relobj::do_layout): Use separate arrays for output section
12558 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12560 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12561 output_sections and section_offsets.
12562 (Sized_relobj::write_local_symbols): Likewise.
12563 (map_to_kept_section): Compute output address directly.
12564 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12565 output_sections and section_offsets.
12566 (Sized_relobj::write_sections): Likewise.
12567 (Sized_relobj::relocate_sections): Likewise.
12568 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12569 * output.h (class Output_reloc): Update declarations. Change
12570 u2_.relobj to Sized_relobj*.
12571 (class Output_data_reloc): Change add functions to use
12573 * output.cc (Output_reloc::Output_reloc): Change relobj to
12575 (Output_reloc::local_section_offset): Change return type to
12576 Elf_Addr. Use get_output_section_offset.
12577 (Output_reloc::get_address): Likewise.
12578 (Output_section::is_input_address_mapped): Don't call
12579 is_section_specially_mapped.
12580 (Output_section::output_offset): Likewise.
12581 (Output_section::output_address): Likewise.
12582 (Output_section::starting_output_address): Likewise.
12583 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12584 parameter to Sized_relobj*.
12585 (Copy_relocs::need_copy_reloc): Likewise.
12586 (Copy_relocs::save): Likewise.
12587 * copy-relocs.h (class Copy_relocs): Update declarations.
12588 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12589 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12590 * target-reloc.h (relocate_for_relocatable): Change
12591 offset_in_output_section type to Elf_Addr. Change code that uses
12593 * layout.cc (Layout::layout): Always set *off.
12594 * mapfile.cc (Mapfile::print_input_section): Use
12595 output_section_offset.
12596 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12598 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12599 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12600 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12602 2008-07-03 Ian Lance Taylor <iant@google.com>
12604 * layout.cc (Layout::include_section): Do not discard unrecognized
12605 SHT_STRTAB sections.
12607 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12609 * script.cc (Lex::can_continue_name): Make '?' allowable in
12610 version-script names.
12611 * testsuite/version_script.map: Change glob pattern to use '?'
12613 2008-06-30 Manish Singh <yosh@gimp.org>
12616 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12619 2008-06-30 Ian Lance Taylor <iant@google.com>
12623 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12624 versions]: Don't try to read the value in the contents, since we
12625 don't use it. Use the template endianness when writing.
12627 2008-06-25 Cary Coutant <ccoutant@google.com>
12629 * fileread.cc (File_read::make_view): Assert on zero-length view.
12630 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12631 symbol table when there are no symbols to read.
12633 2008-06-23 Craig Silverstein <csilvers@google.com>
12635 * version.cc (version_string): Bump to 1.7
12637 2008-06-18 Craig Silverstein <csilvers@google.com>
12639 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12640 constant 0xFFFF to type Valtype.
12641 (Powerpc_relocate_functions::rel16_ha): Likewise.
12643 2008-06-17 Ian Lance Taylor <iant@google.com>
12645 * output.h (Output_section::Input_section): Initialize p2align_ to
12646 zero for Output_section_data constructors.
12647 (Output_section::Input_section::addralign): If not an input
12648 section, return the alignment of the Output_section_data.
12649 * testsuite/copy_test.cc: New file.
12650 * testsuite/copy_test_1.cc: New file.
12651 * testsuite/copy_test_2.cc: New file.
12652 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12653 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12654 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12655 (copy_test_1_pic.o, copy_test_1.so): New targets.
12656 (copy_test_2_pic.o, copy_test_2.so): New targets.
12657 * testsuite/Makefile.in: Rebuild.
12659 * script-sections.cc (Script_sections::place_orphan): Initialize
12660 local variable exact.
12662 2008-06-13 David Edelsohn <edelsohn@gnu.org>
12664 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12666 2008-06-12 David Edelsohn <edelsohn@gnu.org>
12667 David S. Miller <davem@davemloft.net>
12669 * powerpc.cc: New file.
12670 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12671 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12672 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12673 * Makefile.in: Rebuild.
12675 2008-06-09 Ian Lance Taylor <iant@google.com>
12677 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12679 (throwing, orig_terminate): New static variables.
12680 (terminate_handler): New static function.
12681 (t2): Set terminate handler.
12683 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12686 * binary.cc (Binary_to_elf::sized_convert): Fix .data
12689 2008-05-30 Cary Coutant <ccoutant@google.com>
12691 * archive.cc (Archive::include_all_members) Correct to step
12692 over symbol table and extended name table in thin archives.
12694 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12697 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12700 2008-05-28 Caleb Howe <cshowe@google.com>
12702 * reduced_debug_output.cc: New file.
12703 * reduced_debug_output.h: New file.
12704 * options.h (class General_options): Add --strip-debug-non-line.
12705 * options.cc (General_options::finalize): Add strip_debug_non_line
12706 to the strip heirarchy.
12707 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12709 * layout.cc: Include "reduced_debug_output.h".
12710 (Layout::Layout): Initialize new fields.
12711 (line_only_debug_sections): New static array.
12712 (is_lines_only_debug_sections): New static inline function.
12713 (Layout::include_section): Handle --strip-debug-non-line.
12714 (Layout::make_output_section): If --strip-debug-non-line, build
12715 new output sections for .debug_abbrev and .debug_info.
12716 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12717 gold. Warn about possible overflow.
12718 (read_signed_LEB_128): Likewise.
12719 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12720 (read_signed_LEB_128): Declare.
12721 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12722 (HFILES): Add reduced_debug_output.h.
12723 * Makefile.in: Rebuild.
12725 2008-05-21 Ian Lance Taylor <iant@google.com>
12727 * mapfile.cc: New file.
12728 * mapfile.h: New file.
12729 * options.h (class General_options): Add -M/--print-map and -Map.
12730 * options.cc (General_options::finalize): Make -M equivalent to
12732 * main.cc: Include <cstdio> and "mapfile.h".
12733 (main): Open mapfile if requested.
12734 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12735 constructor. Change caller.
12736 (queue_initial_tasks): Add mapfile parameter. Change caller.
12737 (queue_middle_tasks): Likewise.
12738 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12740 * archive.cc: Include "mapfile.h".
12741 (Archive::add_symbols): Add mapfile parameter. Change all
12742 callers. Pass mapfile, symbol, and reason to include_member.
12743 (Archive::include_all_members): Add mapfile parameter. Change all
12745 (Archive::include_member): Add mapfile, sym, and why parameters.
12746 Change all callers. Report inclusion to map file.
12747 * archive.h: Include "fileread.h".
12748 (class Archive): Update declarations.
12749 (Archive::file): New const method.
12750 (class Add_archive_symbols): Add mapfile_ field. Update
12751 constructor. Change all callers.
12752 * readsyms.h (class Read_symbols): Likewise.
12753 (class Finish_group): Likewise.
12754 (class Read_script): Likewise.
12755 * common.cc: Include "mapfile.h".
12756 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12758 (Symbol_table::do_allocate_commons): Likewise.
12759 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12760 symbol allocation to mapfile.
12761 * common.h (class Allocate_commons_task): Add mapfile_ field.
12762 Update constructor. Change all callers.
12763 * symtab.h (class Symbol_table): Update declarations.
12764 * layout.cc: Include "mapfile.h".
12765 (Layout_task_runner::run): Print information to mapfile.
12766 (Layout::create_gold_note): Change Output_data_fixed_space to
12767 Output_data_zero_fill.
12768 (Layout::create_build_id): Likewise.
12769 (Layout::print_to_mapfile): New function.
12770 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12771 constructor. Change caller.
12772 (class Layout): Declare print_to_mapfile.
12773 * output.cc (Output_section::Input_section::print_to_mapfile): New
12775 (Output_section::add_input_section): If producing a map, always
12776 add to input_sections_ list.
12777 (Output_section::do_print_to_mapfile): New function.
12778 (Output_segment::print_sections_to_mapfile): New function.
12779 (Output_segment::print_section_list_to_mapfile): New function.
12780 * output.h: Include "mapfile.h".
12781 (Output_data::print_to_mapfile): New function.
12782 (Output_data::do_print_to_mapfile): New virtual function.
12783 (Output_segment_headers::do_print_to_mapfile): New function.
12784 (Output_file_header::do_print_to_mapfile): New function.
12785 (Output_data_const::do_print_to_mapfile): New function.
12786 (class Output_data_const_buffer): Add map_name_ field. Update
12787 constructor. Change all callers. Add do_print_to_mapfile
12789 (class Output_data_fixed_space): Likewise.
12790 (class Output_data_space): Likewise.
12791 (class Output_data_zero_fill): New class.
12792 (Output_data_strtab::do_print_to_mapfile): New function.
12793 (Output_data_reloc_base::do_print_to_mapfile): New function.
12794 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12795 (Output_data_group::do_print_to_mapfile): New function.
12796 (Output_data_got::do_print_to_mapfile): New function.
12797 (Output_data_dynamic::do_print_to_mapfile): New function.
12798 (Output_symtab_xindex::do_print_to_mapfile): New function.
12799 (class Output_section): Declare do_print_to_mapflie. Declare
12800 print_to_mapfile in Input_section.
12801 (class Output_segment): Declare new functions.
12802 * object.h (Sized_relobj::symbol_count): New function.
12803 * script-sections.cc
12804 (Output_section_element_dot_assignment::set_section_addresses):
12805 Change Output_data_fixed_space to Output_data_zero_fill.
12806 (Output_data_expression::do_print_to_mapfile): New function.
12807 * script.cc (read_input_script): Add mapfile parameter. Change
12809 * script.h (read_input_script): Update declaration.
12810 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12811 (Eh_frame::do_print_to_mapfile): New function.
12812 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12813 (Output_merge_string::do_print_to_mapfile): New function.
12814 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12816 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12818 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12820 * Makefile.am (CCFILES): Add mapfile.cc.
12821 (HFILES): Add mapfile.h.
12822 * Makefile.in: Rebuild.
12824 2008-05-19 Ian Lance Taylor <iant@google.com>
12826 * options.h (class General_options): Add -z relro.
12827 * layout.cc (Layout::Layout): Initialize relro_segment_.
12828 (Layout::add_output_section_data): Return the output section.
12829 (Layout::make_output_section): Rcognize relro sections and mark
12830 them appropriately.
12831 (Layout::attach_allocated_section_to_segment): Put relro sections
12832 in a PT_GNU_RELRO segment.
12833 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12835 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12837 (Layout::linkonce_mapping): Map d.rel.ro.local to
12838 .data.rel.ro.local.
12839 (Layout::output_section_name): Us .data.rel.ro.local for any
12840 section which begins with that.
12841 * layout.h (class Layout): Update add_output_section_data
12842 declaration. Add relro_segment_ field.
12843 * output.cc (Output_section::Output_section): Initialize is_relro_
12844 and is_relro_local_ fields.
12845 (Output_segment::add_output_section): Group relro sections.
12846 (Output_segment::is_first_section_relro): New function.
12847 (Output_segment::maximum_alignment): If there is a relro section,
12848 align the segment to the common page size.
12849 (Output_segment::set_section_addresses): Track whether we are
12850 looking at relro sections. If the last section is a relro
12851 section, align to the common page size.
12852 (Output_segment::set_section_list_addresses): Add in_relro
12853 parameter. Change all callers. Align to the page size when
12854 moving from relro to non-relro section.
12855 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12857 * output.h (class Output_section): Add is_relro_ and
12858 is_relro_local_ fields.
12859 (Output_section::is_relro): New function.
12860 (Output_section::set_is_relro): New function.
12861 (Output_section::is_relro_local): New function.
12862 (Output_section::set_is_relro_local): New function.
12863 (class Output_segment): Update declarations.
12864 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12865 * sparc.cc (Target_sparc::got_section): Likewise.
12866 * x86_64.cc (Target_x86_64::got_section): Likewise.
12867 * testsuite/relro_test_main.cc: New file.
12868 * testsuite/relro_test.cc: New file.
12869 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12870 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12871 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12872 (relro_test.so, relro_test_pic.o): New targets.
12873 * testsuite/Makefile.in: Rebuild.
12875 2008-05-16 Ian Lance Taylor <iant@google.com>
12877 * output.cc (Output_segment::add_output_section): Remove front
12879 * output.h (class Output_segment): Remove
12880 add_initial_output_section and overloaded add_output_section.
12881 Update declaration of remaining add_output_section.
12882 * layout.cc (Layout::create_interp): Call add_output_section
12883 rather than add_initial_output_section.
12884 (Layout::finish_dynamic_section): Likewise.
12886 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12887 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12888 know the dynamic type.
12889 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12890 field. Initialize it in constructor.
12891 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12892 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12893 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12896 * output.cc (Output_reloc::get_address): Change return type to
12898 * output.h (class Output_reloc): Update get_address declaration.
12899 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12900 for section addresses.
12902 2008-05-09 Ian Lance Taylor <iant@google.com>
12905 * gold.cc (gold_nomem): Use return value of write.
12907 2008-05-08 Ian Lance Taylor <iant@google.com>
12909 * symtab.c (Symbol::init_base_output_data): Add version
12910 parameter. Change all callers.
12911 (Symbol::init_base_output_segment): Likewise.
12912 (Symbol::init_base_constant): Likewise.
12913 (Symbol::init_base_undefined): Likewise.
12914 (Sized_symbol::init_output_data): Likewise.
12915 (Sized_symbol::init_output_segment): Likewise.
12916 (Sized_symbol::init_constant): Likewise.
12917 (Sized_symbol::init_undefined): Likewise.
12918 (Symbol_table::do_define_in_output_data): If the new symbol has a
12919 version, mark it as the default.
12920 (Symbol_table::do_define_in_output_segment): Likewise.
12921 (Symbol_table::do_define_as_constant): Likewise.
12922 * symtab.h (class Symbol): Update declarations.
12923 (class Sized_symbol): Likewise.
12924 * resolve.cc (Symbol::override_version): New function.
12925 (Symbol::override_base): Call override_version.
12926 (Symbol::override_base_with_special): Likewise.
12927 * testsuite/ver_script_8.script: New file.
12928 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12929 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12930 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12931 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12933 2008-05-06 Ian Lance Taylor <iant@google.com>
12936 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12938 (class General_options): Remove existing --undefined, and add
12939 --no-undefined instead. Add new --undefined as synonym for -u.
12940 * archive.cc (Archive::add_symbols): Check whether symbol was
12942 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12943 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12944 all uses. Add IS_UNDEFINED. Update declarations to split
12945 different versions of init_base. Declare init_base_undefined.
12946 (Symbol::is_defined): Handle IS_UNDEFINED.
12947 (Symbol::is_undefined): Likewise.
12948 (Symbol::is_weak_undefined): Call is_undefined.
12949 (Symbol::is_absolute): Handle IS_CONSTANT.
12950 (class Sized_symbol): Update declarations to split different
12951 versions of init. Declare init_undefined.
12952 (class Symbol_table): Declare new functions.
12953 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12954 Change all callers.
12955 (Symbol::init_base_output_data): Likewise.
12956 (Symbol::init_base_output_segment): Likewise.
12957 (Symbol::init_base_constant): Likewise.
12958 (Symbol::init_base_undefined): New function.
12959 (Sized_symbol::init_object): Rename from init. Change all
12961 (Sized_symbol::init_output_data): Likewise.
12962 (Sized_symbol::init_output_segment): Likewise.
12963 (Sized_symbol::init_constant): Likewise.
12964 (Sized_symbol::init_undefined): New function.
12965 (Symbol_table::add_undefined_symbols_from_command_line): New
12967 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12969 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12970 (Symbol::output_section): Likewise.
12971 (Symbol::set_output_section): Likewise.
12972 (Symbol_table::sized_finalize_symbol): Likewise.
12973 (Symbol_table::sized_write_globals): Likewise.
12974 * resolve.cc (Symbol_table::should_override): Likewise.
12975 (Symbol::override_base_with_special): Likewise.
12977 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12978 symbol, change it to have default visibility.
12979 * testsuite/protected_1.cc: New file.
12980 * testsuite/protected_2.cc: New file.
12981 * testsuite/protected_3.cc: New file.
12982 * testsuite/protected_main_1.cc: New file.
12983 * testsuite/protected_main_2.cc: New file.
12984 * testsuite/protected_main_3.cc: New file.
12985 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12986 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12987 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12988 (protected_1.so): New target.
12989 (protected_1_pic.o, protected_2_pic.o): New targets.
12990 (protected_3_pic.o): New target.
12991 (check_PROGRAMS): Add protected_2.
12992 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12993 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12994 * testsuite/Makefile.in: Rebuild.
12996 * options.h (DEFINE_var): Add set_user_set_##varname__.
12997 (DEFINE_bool_alias): New macro.
12998 (class General_options): Define -Bstatic using DEFINE_bool_alias
12999 rather than DEFINE_special. Add --undefined as an alias for -z
13001 * options.cc (General_options::parse_Bstatic): Remove.
13003 * options.h (class General_options): Add --fatal-warnings.
13004 * main.cc (main): Implement --fatal-warnings.
13005 * errors.h (Errors::warning_count): New function.
13007 * options.h (class General_options): Add -Bsymbolic-functions.
13008 * symtab.h (Symbol::is_preemptible): Check for
13009 -Bsymbolic-functions.
13011 2008-05-05 Ian Lance Taylor <iant@google.com>
13013 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13014 as noVARNAME rather than no-VARNAME.
13015 (class General_options): Add option -z combreloc.
13016 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13018 (Output_reloc::sort_before) [SHT_REL]: New function.
13019 (Output_reloc::sort_before) [SHT_RELA]: New function.
13020 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13021 Sort_relocs_comparison.
13022 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13023 parameter. Change all callers.
13024 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13025 sort_relocs parameter. Change all callers.
13026 * output.cc (Output_reloc::get_address): New function, broken out
13028 (Output_reloc::write_rel): Call it.
13029 (Output_reloc::compare): New function.
13030 (Output_data_reloc_base::do_write): Optionally sort relocs.
13032 * configure.ac: If targ_extra_obj is set, link it in.
13033 * configure.tgt: Initialize all variables.
13034 (x86_64*): Set targ_extra_obj and targ_extra_size.
13035 * configure: Rebuild.
13037 * object.cc (Sized_relobj::include_section_group): Adjust section
13038 indexes read from group data. Build vector to pass to
13040 * layout.cc (Layout::layout_group): Add flags and shndxes
13041 parameters. Remove contents parameter. Change caller. Update
13042 explicit instantiations.
13043 * layout.h (class Layout): Update layout_group declaration.
13044 * output.cc (Output_data_group::Output_data_group): Add flags and
13045 input_shndxes parameters. Remove contents parameter. Change
13047 (Output_data_group::do_write): Change input_sections_ to
13049 * output.h (class Output_data_group): Update constructor
13050 declaration. Rename input_sections_ to input_shndxes_.
13051 * testsuite/many_sections_test.cc: Add template.
13053 2008-04-30 Cary Coutant <ccoutant@google.com>
13055 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13057 * layout.cc (Layout::include_section): Refactored check for debug
13059 (Layout::add_comdat): Add new parameters. Change type
13060 of signature parameter. Add object and shndx to signatures table.
13061 (Layout::find_kept_object): New function.
13062 * layout.h: Include <cstring>.
13063 (Layout::is_debug_info_section): New function.
13064 (Layout::add_comdat): Add new parameters.
13065 (Layout::find_kept_object): New function.
13066 (Layout::Kept_section): New struct.
13067 (Layout::Signatures): Change type of map range.
13068 * object.cc (Relobj::output_section_address): New function.
13069 (Sized_relobj::include_section_group): Add new parameters. Change
13070 calls to Layout::add_comdat. Change to build table of kept comdat
13071 groups and table mapping discarded sections to kept sections.
13072 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13073 (Sized_relobj::do_layout): Change calls to include_section_group and
13074 include_linkonce_section.
13075 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13076 value to zero when section is discarded.
13077 (Sized_relobj::map_to_kept_section): New function.
13078 * object.h (Relobj::output_section_address): New function.
13079 (Relobj::Comdat_group): New type.
13080 (Relobj::find_comdat_group): New function.
13081 (Relobj::Comdat_group_table): New type.
13082 (Relobj::Kept_comdat_section): New type.
13083 (Relobj::Kept_comdat_section_table): New type.
13084 (Relobj::add_comdat_group): New function.
13085 (Relobj::set_kept_comdat_section): New function.
13086 (Relobj::get_kept_comdat_section): New function.
13087 (Relobj::comdat_groups_): New field.
13088 (Relobj::kept_comdat_sections_): New field.
13089 (Symbol_value::input_value): Update comment.
13090 (Sized_relobj::map_to_kept_section) New function.
13091 (Sized_relobj::include_linkonce_section): Add new parameter.
13092 * target-reloc.h (Comdat_behavior): New type.
13093 (get_comdat_behavior): New function.
13094 (relocate_section): Add code to map a discarded section to the
13095 corresponding kept section when applying a relocation.
13097 2008-04-30 Craig Silverstein <csilvers@google.com>
13099 * dwarf_reader.cc (next_generation_count): New static var.
13100 (Addr2line_cache_entry): New struct.
13101 (addr2line_cache): New static var.
13102 (Dwarf_line_info::one_addr2line): Added caching.
13103 (Dwarf_line_info::clear_addr2line_cache): New function.
13104 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13105 cache-size parameter.
13106 (Dwarf_line_info::one_addr2line_cache): New function.
13107 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13108 new cache-size argument to one_addr2line(), and clear cache.
13110 2008-04-28 Cary Coutant <ccoutant@google.com>
13112 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13113 R_386_PC8 relocations.
13115 2008-04-23 Ian Lance Taylor <iant@google.com>
13117 * object.cc (Sized_relobj::include_section_group): Check for
13118 invalid section group.
13120 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13123 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13124 than read for file header.
13125 * archive.cc (Archive::include_member): Likewise.
13127 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
13129 * aclocal.m4: Regenerate.
13130 * configure: Regenerate.
13132 2008-04-19 Ian Lance Taylor <iant@google.com>
13134 * version.cc (version_string): Bump to 1.6.
13136 * testsuite/Makefile.am (many_sections_r_test): New target.
13137 (many_sections_r_test_SOURCES): Remove.
13138 (many_sections_r_test_DEPENDENCIES): Remove.
13139 (many_sections_r_test_LDFLAGS): Remove.
13140 (many_sections_r_test_LDADD): Remove.
13142 * object.cc (Sized_relobj::do_add_symbols): Always pass
13143 local_symbol_count_ to add_from_relobj.
13145 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13146 every thousand variables.
13147 * testsuite/Makefile.in: Rebuild.
13149 * object.cc (Xindex::initialize_symtab_xindex): New function.
13150 (Xindex::read_symtab_xindex): New function.
13151 (Xindex::sym_xindex_to_shndx): New function.
13152 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13154 (Sized_relobj::do_initialize_xindex): New function.
13155 (Sized_relobj::do_read_symbols): Adjust section links.
13156 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13157 parameter. Change all callers.
13158 (Sized_relobj::include_section_group): Adjust section links and
13159 symbol section indexes.
13160 (Sized_relobj::do_layout): Adjust section links.
13161 (Sized_relobj::do_count_local_symbols): Adjust section links and
13162 symbol section indexes.
13163 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13164 ordinary and special symbols.
13165 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13166 dynsym_xindex parameters. Change all callers. Adjust section
13167 links. Use SHN_XINDEX when needed.
13168 (Sized_relobj::get_symbol_location_info): Adjust section links.
13169 Don't get fooled by special symbols.
13170 * object.h (class Xindex): Define.
13171 (class Object): Add xindex_ parameter. Declare virtual functoin
13172 do_initialize_xindex.
13173 (Object::adjust_sym_shndx): New function.
13174 (Object::set_xindex): New protected function.
13175 (class Symbol_value): Add is_ordinary_shndx_ field.
13176 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13177 (Symbol_value::value): Assert ordinary section.
13178 (Symbol_value::initialize_input_to_output_map): Likewise.
13179 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13180 Change all callers.
13181 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13183 (class Sized_relobj): Update declarations.
13184 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13185 parameter. Change all callers.
13186 (Sized_relobj::adjust_shndx): New function.
13187 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13189 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13190 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13191 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13192 (Sized_dynobj::read_dynsym_section): Adjust section links.
13193 (Sized_dynobj::read_dynamic): Likewise.
13194 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13196 (Sized_dynobj::do_initialize_xindex): New function.
13197 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13198 do_initialize_xindex.
13199 (Sized_dynobj::adjust_shndx): New function.
13200 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13201 dynsym_xindex_ fields.
13202 (Layout::finalize): Add a call to set_section_indexes before
13203 creating the symtab sections.
13204 (Layout::set_section_indexes): Don't do anything if the section
13205 already has a section index.
13206 (Layout::create_symtab_sections): Add shnum parameter. Change
13207 caller. Create .symtab_shndx section if needed.
13208 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13210 (Layout::allocated_output_section_count): New function.
13211 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13213 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13214 fields. Update declarations.
13215 (Layout::symtab_xindex): New function.
13216 (Layout::dynsym_xindex): New function.
13217 (class Write_symbols_task): Add layout_ field.
13218 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13220 * output.cc (Output_section_headers::Output_section_headers): Add
13221 shstrtab_section parameter. Change all callers.
13222 (Output_section_headers::do_sized_write): Store overflow values
13223 for section count and section string table section index in
13224 section header zero.
13225 (Output_file_header::do_sized_write): Check for overflow of
13226 section count and section string table section index.
13227 (Output_symtab_xindex::do_write): New function.
13228 (Output_symtab_xindex::endian_do_write): New function.
13229 * output.h (class Output_section_headers): Add shstrtab_section_.
13230 Update declarations.
13231 (class Output_symtab_xindex): Define.
13232 (Output_section::has_out_shndx): New function.
13233 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13235 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13236 Change all callers.
13237 (Sized_symbol::init): Likewise.
13238 (Symbol::output_section): Check for ordinary symbol.
13239 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13240 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13242 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13243 Change all callers. Simplify handling of symbols from sections
13244 not included in the link.
13245 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13247 (Weak_alias_sorter::operator()): Assert that symbols are
13249 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13251 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13252 parameters. Change all callers.
13253 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13254 symbol distinction. Use SHN_XINDEX when needed.
13255 (Symbol_table::write_section_symbol): Add symtab_xindex
13256 parameter. Change all callers.
13257 (Symbol_table::sized_write_section_symbol): Likewise. Use
13258 SHN_XINDEX when needed.
13259 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13261 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13262 (Symbol::is_defined): Check is_ordinary.
13263 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13264 (Symbol::is_absolute, Symbol::is_common): Likewise.
13265 (class Sized_symbol): Update declarations.
13266 (class Symbol_table): Update declarations.
13267 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13268 parameters. Change all callers.
13269 (Sized_symbol::override): Likewise.
13270 (Symbol_table::override): Likewise.
13271 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13272 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13273 is_ordinary, and orig_st_shndx parameters. Change all callers.
13274 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13275 to be in an ordinary section.
13276 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13277 object and is_ordinary parameters. Change all callers.
13278 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13279 Change all callers. Don't add undefined or non-ordinary symbols
13281 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13282 Change all callers.
13283 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13285 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13286 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13287 (Sized_relobj::relocate_sections): Likewise.
13288 * target-reloc.h (scan_relocs): Adjust section symbol index.
13289 (scan_relocatable_relocs): Likewise.
13290 * i386.cc (Scan::local): Check for ordinary symbols.
13291 * sparc.cc (Scan::local): Likewise.
13292 * x86_64.cc (Scan::local): Likewise.
13293 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13294 to symbol_section_and_value.
13295 * testsuite/many_sections_test.cc: New file.
13296 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13297 (check_PROGRAMS): Add many_sections_test.
13298 (many_sections_test_SOURCES): Define.
13299 (many_sections_test_DEPENDENCIES): Define.
13300 (many_sections_test_LDFLAGS): Define.
13301 (BUILT_SOURCES): Add many_sections_define.h.
13302 (many_sections_define.h): New target.
13303 (BUILT_SOURCES): Add many_sections_check.h.
13304 (many_sections_check.h): New target.
13305 (check_PROGRAMS): Add many_sections_r_test.
13306 (many_sections_r_test_SOURCES): Define.
13307 (many_sections_r_test_DEPENDENCIES): Define.
13308 (many_sections_r_test_LDFLAGS): Define.
13309 (many_sections_r_test_LDADD): Define.
13310 (many_sections_r_test.o): New target.
13311 * testsuite/Makefile.in: Rebuild.
13313 2008-04-17 Cary Coutant <ccoutant@google.com>
13315 * errors.cc (Errors::info): New function.
13316 (gold_info): New function.
13317 * errors.h (Errors::info): New function.
13318 * gold.h (gold_info): New function.
13319 * object.cc (Input_objects::add_object): Print trace output.
13320 * options.cc (options::parse_set): New function.
13321 (General_options::parse_wrap): Deleted.
13322 (General_options::General_options): Deleted initializer.
13323 * options.h (options::String_set): New typedef.
13324 (options::parse_set): New function.
13325 (DEFINE_set): New macro.
13326 (General_options::wrap): Changed to use DEFINE_set. Changed
13327 callers of any_wrap_symbols and is_wrap_symbol.
13328 (General_options::trace, General_options::trace_symbol):
13330 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13331 (General_options::wrap_symbols_): Deleted.
13332 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13334 2008-04-17 David S. Miller <davem@davemloft.net>
13336 * options.cc (General_options::parse_V): New function.
13337 * options.h: Add entries for -V and -Qy.
13339 2008-04-17 Ian Lance Taylor <iant@google.com>
13341 * common.cc (Symbol_table::allocate_commons): Remove options
13342 parameter. Change caller.
13343 (Symbol_table::do_allocate_commons): Remove options parameter.
13344 Change caller. Just call do_allocate_commons_list twice.
13345 (Symbol_table::do_allocate_commons_list): New function, broken out
13346 of do_allocate_commons.
13347 * common.h (class Allocate_commons_task): Remove options_ field.
13348 Update constructor.
13349 * symtab.cc (Symbol_table::Symbol_table): Initialize
13351 (Symbol_table::add_from_object): Put TLS common symbols on
13353 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13354 which are IN_OUTPUT_DATA.
13355 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13356 allocate_commons and do_allocate_commons declarations. Declare
13357 do_allocate_commons_list.
13358 * gold.cc (queue_middle_tasks): Update creation of
13359 Allocate_commons_task to not pass options.
13360 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13361 (TLS_TEST_C_FLAGS): New variable.
13362 (tls_test_c_pic.o): New target.
13363 (tls_test_shared.so): Link in tls_test_c_pic.o.
13364 (tls_test_c_pic_ie.o): New target.
13365 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13366 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13367 (tls_test_c.o): New target.
13368 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13369 (tls_pic_test_LDADD): Likewise.
13370 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13371 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13372 (tls_test_c_gnu2.o): New target.
13373 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13375 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13376 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13377 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13378 * testsuite/tls_test.cc: Include "config.h".
13379 (t_last): Call t11_last.
13380 * testsuite/tls_test.h (t11, t11_last): Declare.
13381 * testsuite/tls_test_c.c: New file.
13382 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13383 * configure.ac: Check for OpenMP support.
13384 * configure, config.in, Makefile.in: Rebuild.
13385 * testsuite/Makefile.in: Rebuild.
13387 2008-04-16 Cary Coutant <ccoutant@google.com>
13389 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13390 (Target_i386::tls_base_symbol_defined_): New field.
13391 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13392 (Target_i386::Scan::global): Likewise.
13393 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13394 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13395 (Target_x86_64::tls_base_symbol_defined_): New field.
13396 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13397 (Target_x86_64::Scan::global): Likewise.
13399 2008-04-16 Cary Coutant <ccoutant@google.com>
13401 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13402 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13403 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13404 building shared libraries.
13405 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13406 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13407 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13408 * testsuite/Makefile.in: Rebuild.
13409 * testsuite/weak_undef.h: New file.
13410 * testsuite/weak_undef_file1.cc: Add extra test cases.
13411 * testsuite/weak_undef_file2.cc: Likewise.
13412 * testsuite/weak_undef_test.cc: Likewise.
13414 2008-04-16 David S. Miller <davem@davemloft.net>
13416 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13417 Add issued_non_pic_error_ field. Declare check_non_pic.
13418 (Target_sparc::Scan::check_non_pic): New function.
13419 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13420 (Target_sparc::Scan::global): Likewise.
13422 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13423 * configure: Rebuild.
13425 * options.h (DEFINE_enable): New macro.
13426 (new_dtags): New enable option.
13427 (initfirst, interpose, loadfltr, nodefaultlib,
13428 nodelete, nodlopen, nodump): New -z options.
13429 * layout.cc (Layout:finish_dynamic_section): If new
13430 dtags enabled, emit DT_RUNPATH. Also, emit a
13431 DT_FLAGS_1 containing any specified -z flags.
13433 2008-04-16 Ian Lance Taylor <iant@google.com>
13435 * copy-relocs.cc: New file.
13436 * copy-relocs.h: New file.
13437 * reloc.cc: Remove Copy_relocs code.
13438 * reloc.h: Likewise.
13439 * reloc-types.h (struct Reloc_types) [both versions]: Add
13440 get_reloc_addend_noerror.
13441 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13442 variants of add_global which take an addend which must be zero.
13443 * i386.cc: Include "copy-relocs.h".
13444 (class Target_i386): Change type of copy_relocs_ to variable,
13445 update initializer.
13446 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13447 Change all callers.
13448 (Target_i386::do_finalize_sections): Change handling of
13450 * sparc.cc: Include "copy-relocs.h".
13451 (class Target_sparc): Change type of copy_relocs_ to variable,
13452 update initializer.
13453 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13454 Change all callers.
13455 (Target_sparc::do_finalize_sections): Change handling of
13457 * x86_64.cc: Include "copy-relocs.h".
13458 (class Target_x86_64): Change type of copy_relocs_ to variable,
13459 update initializer.
13460 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13461 class. Change all callers.
13462 (Target_x86_64::do_finalize_sections): Change handling of
13464 * Makefile.am (CCFILES): Add copy-relocs.cc.
13465 (HFILES): Add copy-relocs.h.
13467 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13469 * testsuite/script_test_4.sh: Permit leading zeroes.
13471 2008-04-15 Ian Lance Taylor <iant@google.com>
13473 * script-sections.cc (Script_sections::create_segments): Use
13474 header_size_adjustment even when there is enough room for the
13476 * testsuite/script_test_4.sh: New file.
13477 * testsuite/script_test_4.t: New file.
13478 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13479 (check_DATA): Add script_test_4.stdout.
13480 (MOSTLYCLEANFILES): Likewise.
13481 (script_test_4): New target.
13482 (script_test_4.stdout): New target.
13483 * testsuite/Makefile.in: Rebuild.
13485 * sparc.cc: Add definitions for Output_data_plt_sparc class
13488 2008-04-14 David S. Miller <davem@davemloft.net>
13490 * sparc.cc: New file.
13491 * Makefile.am (TARGETSOURCES): Add sparc.cc
13492 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13493 * configure.tgt: Document targ_extra_size and
13494 targ_extra_big_endian. Add entries for sparc-* and
13496 * configure.ac: Handle targ_extra_size and
13497 targ_extra_big_endian.
13498 * Makefile.in: Rebuild.
13499 * configure: Likewise.
13500 * po/POTFILES.in: Likewise.
13501 * po/gold.pot: Likewise.
13503 2008-04-14 Ian Lance Taylor <iant@google.com>
13505 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13506 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13507 in the name/type/flags to section mapping. Don't call
13508 allocate_output_section.
13509 (Layout::choose_output_section): Change parameter from adjust_name
13510 to is_input_section. Don't permit input sections after sections
13511 are attached to segments. Don't call allocate_output_section.
13512 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13513 not write_enable_output_section.
13514 (Layout::make_output_section): Don't push to
13515 unattached_section_list_ nor call attach_to_segment. Call
13516 attach_section_to_segment if sections are attached.
13517 (Layout::attach_sections_to_segments): New function.
13518 (Layout::attach_section_to_segment): New function.
13519 (Layout::attach_allocated_section_to_segment): Rename from
13520 attach_to_segment. Remove flags parameter.
13521 (Layout::allocate_output_section): Remove function.
13522 (Layout::write_enable_output_section): Remove function.
13523 * layout.h (class Layout): Update for above changes. Add new
13524 field sections_are_attached_.
13525 * output.h (Output_section::update_flags_for_input_section): New
13527 * output.cc (Output_section::add_input_section): Call
13528 update_flags_for_input_section.
13529 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13531 2008-04-11 Cary Coutant <ccoutant@google.com>
13533 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13534 thought unnecessary.
13535 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13537 2008-04-11 Ian Lance Taylor <iant@google.com>
13539 * output.h (class Output_section_data): Remove inline definition
13541 * output.cc (Output_section_data::set_addralign): New function.
13543 2008-04-11 Cary Coutant <ccoutant@google.com>
13545 Add support for TLS descriptors for i386 and x86_64.
13546 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13547 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13548 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13550 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13551 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13552 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13554 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13555 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13556 Fix problem with initial-exec relocations.
13557 (Target_i386::Relocate::relocate_tls): Likewise.
13558 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13560 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13561 support for section-plus-offset dynamic table entries.
13562 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13563 (Output_data_dynamic::Dynamic_entry): Add support for
13564 section-plus-offset dynamic table entries.
13565 (Output_data_dynamic::Classification): Likewise.
13566 (Output_data_dynamic::classification_): Renamed offset_.
13567 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13568 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13569 (Target_x86_64::make_plt_section): New function.
13570 (Target_x86_64::reserve_tlsdesc_entries): New function.
13571 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13572 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13573 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13574 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13575 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13576 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13577 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13578 add extra PLT entry for TLS descriptors.
13579 (Output_data_plt_x86_64::got_): New field.
13580 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13581 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13583 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13585 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13586 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13587 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13588 R_386_TLS_DESC_CALL relocations.
13589 (Target_x86_64::Scan::global): Likewise.
13590 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13591 for TLS descriptors.
13592 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13593 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13594 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13595 GD-to-IE relaxation.
13596 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13597 and TLS_DESCRIPTORS.
13598 * Makefile.in: Rebuild.
13599 * configure: Rebuild.
13600 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13601 (tls_test_shared2.so): New target.
13602 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13603 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13604 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13605 (tls_shared_gd_to_ie_test_LDADD): New variable.
13606 (tls_shared_gnu2_gd_to_ie_test): New target.
13607 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13609 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13610 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13611 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13612 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13613 (tls_shared_gnu2_test): New target.
13614 (tls_test_gnu2_shared.so): New target.
13615 (tls_shared_gnu2_test_SOURCES): New variable.
13616 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13617 (tls_shared_gnu2_test_LDFLAGS): New variable.
13618 (tls_shared_gnu2_test_LDADD): New variable.
13619 * testsuite/Makefile.in: Rebuild.
13620 * testsuite/Makefile.
13622 2008-04-11 Ian Lance Taylor <iant@google.com>
13624 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13626 * testsuite/Makefile.in: Rebuild.
13628 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13630 * testsuite/script_test_2.cc (main): Adjust test.
13632 2008-04-11 David S. Miller <davem@davemloft.net>
13633 Ian Lance Taylor <iant@google.com>
13635 * options.h (General_options): Add entries for '-Y' and
13637 * options.cc (General_options:finalize): If -Y was used, add those
13638 entries to the library path instead of the default "/lib" and
13641 2008-04-11 David S. Miller <davem@davemloft.net>
13643 * testsuite/justsyms.t: Start at 0x100.
13644 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
13645 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13647 * testsuite/script_test_2.cc: Adjust string and section length
13650 2008-04-09 Ian Lance Taylor <iant@google.com>
13653 * script-sections.cc (Sections_element::allocate_to_segment): Add
13655 (Output_section_definition::allocate_to_segment): Likewise.
13656 (Orphan_output_section::allocate_to_segment): Likewise.
13657 (Script_sections::attach_sections_using_phdrs_clause): Don't
13658 propagate non-PT_LOAD segments to orphan sections.
13659 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13660 readelf rather than objdump.
13661 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13662 .interp section and PT_INTERP segment are the same size.
13663 * testsuite/Makefile.in: Rebuild.
13665 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13666 aliases for symbols defined in the same object.
13667 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13668 (weak_alias_test_SOURCES): New variable.
13669 (weak_alias_test_DEPENDENCIES): New variable.
13670 (weak_alias_test_LDFLAGS): New variable.
13671 (weak_alias_test_LDADD): New variable.
13672 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13673 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13674 (weak_alias_test_3.o): New target.
13675 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13676 * testsuite/weak_alias_test_main.cc: New file.
13677 * testsuite/weak_alias_test_1.cc: New file.
13678 * testsuite/weak_alias_test_2.cc: New file.
13679 * testsuite/weak_alias_test_3.cc: New file.
13681 2008-04-08 Ian Lance Taylor <iant@google.com>
13683 * options.h (class General_options): Add --noinhibit-exec option.
13684 * main.cc (main): Check --noinhibit-exec.
13686 * options.h (class General_options): Define --wrap as a special
13687 option. Add wrap_symbols_ field.
13688 (General_options::any_wrap_symbols): New function.
13689 (General_options::is_wrap_symbol): New function.
13690 * options.cc (General_options::parse_wrap): New function.
13691 (General_options::General_options): Initialize wrap_symbols_.
13692 * symtab.cc (Symbol_table::wrap_symbol): New function.
13693 (Symbol_table::add_from_object): Handle --wrap.
13694 * symtab.h (class Symbol_table): Declare wrap_symbol.
13695 * target.h (Target::wrap_char): New function.
13696 (Target::Target_info): Add wrap_char field.
13697 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13698 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13699 * testsuite/testfile.cc (Target_test::test_target_info):
13702 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13705 * layout.h (class Layout): Add added_eh_frame_data_ field.
13706 * layout.cc (Layout::Layout): Initialize new field.
13707 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13708 output section until we find a section we merged successfully.
13709 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13710 that the size be non-zero.
13712 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13715 2008-04-08 Craig Silverstein <csilvers@google.com>
13717 * configure.ac: Export new conditional variable HAVE_ZLIB.
13718 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13720 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13721 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13723 2008-04-07 Ian Lance Taylor <iant@google.com>
13725 * version.cc (version_string): Set to "1.5".
13727 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13728 Add issued_non_pic_error_ field. Declare check_non_pic.
13729 (Target_x86_64::Scan::check_non_pic): New function.
13730 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13731 (Target_x86_64::Scan::global): Likewise.
13733 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13734 addend parameter. Change caller. Handle merge sections.
13735 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13736 Address to Addend. Don't add in the result of
13737 local_section_offset, pass down the addend and use the returned
13739 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13740 Update declarations of local_section_offset and symbol_value.
13741 * testsuite/two_file_test_1.cc (t18): New function.
13742 * testsuite/two_file_test_2.cc (f18): New function.
13743 * testsuite/two_file_test_main.cc (main): Call t18.
13744 * testsuite/two_file_test.h (t18, f18): Declare.
13746 * configure.ac: Don't test for objdump, c++filt, or readelf.
13747 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13749 (TEST_READELF): New variable.
13750 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13751 (check_PROGRAMS): Add two_file_strip_test.
13752 (two_file_strip_test): New target.
13753 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13754 (two_file_same_shared_strip_test_SOURCES): New variable.
13755 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13756 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13757 (two_file_same_shared_strip_test_LDADD): New variable.
13758 (two_file_shared_strip.so): New target.
13759 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13760 (ver_test_5.syms, ver_test_7.syms): Likewise.
13761 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13762 (strip_test_3.stdout): Use TEST_OBJDUMP.
13763 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13765 2008-04-04 Cary Coutant <ccoutant@google.com>
13767 * symtab.h (Symbol::is_weak_undefined): New function.
13768 (Symbol::is_strong_undefined): New function.
13769 (Symbol::is_absolute): New function.
13770 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13771 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13773 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13774 (weak_undef_test): New target.
13775 * testsuite/Makefile.in: Rebuild.
13776 * testsuite/weak_undef_file1.cc: New file.
13777 * testsuite/weak_undef_file2.cc: New file.
13778 * testsuite/weak_undef_test.cc: New file.
13780 2008-04-03 Craig Silverstein <csilvers@google.com>
13782 * compressed_output.h (class Output_compressed_section): Use
13784 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13786 (zlib_compressed_suffix): Removed.
13787 (Output_compressed_section::set_final_data_size): Use unsigned
13789 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13790 Fix linker invocation.
13791 (flagstest_o_specialfile_and_compress_debug_sections):
13793 * testsuite/Makefile.in: Regenerated.
13795 2008-04-02 David S. Miller <davem@davemloft.net>
13797 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13798 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13800 2008-04-02 Craig Silverstein <csilvers@google.com>
13804 2008-04-02 Ian Lance Taylor <iant@google.com>
13806 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13807 parameters. Update for new key type to views_. Change all
13809 (File_read::read): Adjust for byteshift in returned view.
13810 (File_read::add_view): New function, broken out of
13811 find_and_make_view.
13812 (File_read::make_view): New function, broken out of
13813 find_and_make_view.
13814 (File_read::find_or_make_view): Add offset and aligned
13815 parameters. Rewrite accordingly. Change all callers.
13816 (File_read::get_view): Add offset and aligned parameters. Adjust
13817 for byteshift in return value.
13818 (File_read::get_lasting_view): Likewise.
13819 * fileread.h (class File_read): Update declarations.
13820 (class File_read::View): Add byteshift_ field. Add byteshift to
13821 constructor. Add byteshift method.
13822 * archive.h (Archive::clear_uncached_views): New function.
13823 (Archive::get_view): Add aligned parameter. Change all callers.
13824 * object.h (Object::get_view): Add aligned parameter. Change all
13826 (Object::get_lasting_view): Likewise.
13828 * fileread.cc (File_read::release): Don't call clear_views if
13829 there are multiple objects.
13830 * fileread.h (File_read::clear_uncached_views): New function.
13831 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13834 2008-03-31 Cary Coutant <ccoutant@google.com>
13836 Add thin archive support.
13837 * archive.cc (Archive::armagt): New const.
13838 (Archive::setup): Remove task parameter and calls to unlock.
13839 (Archive::unlock_nested_archives): New function.
13840 (Archive::read_header): Add nested_off parameter. Change
13842 (Archive::interpret_header): Likewise.
13843 (Archive::include_all_members): Change to handle thin
13845 (Archive::include_member): Likewise.
13846 * archive.h (Archive::Archive): Add new parameters and
13848 (Archive::armagt): New const.
13849 (Archive::setup): Remove task parameter.
13850 (Archive::unlock_nested_archives): New function.
13851 (Archive::read_header): Add nested_off parameter.
13852 (Archive::interpret_header): Likewise.
13853 (Archive::Nested_archive_table): New typedef.
13854 (Archive::is_thin_archive_): New field.
13855 (Archive::nested_archives_): New field.
13856 (Archive::options_): New field.
13857 (Archive::dirpath_): New field.
13858 (Archive::task_): New field.
13859 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13860 for thin archives. Pass additional parameters to
13861 Archive::Archive. Unlock the archive file after calling
13864 2008-03-29 Ian Lance Taylor <iant@google.com>
13866 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13867 version symbol to be local.
13868 * testsuite/ver_test_4.sh: New file.
13869 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13870 (check_DATA): Add ver_test_4.syms.
13871 (ver_test_4.syms): New target.
13872 * testsuite/Makefile.in: Rebuild.
13875 (Output_section::Input_section_sort_entry::has_priority): New
13877 (Output_section::Input_section_sort_entry::match_file_name): New
13879 (Output_section::Input_section_sort_entry::match_section_name):
13881 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13883 (Output_section::Input_section_sort_entry::match_section_file):
13885 (Output_section::Input_section_sort_compare::operator()): Rewrite
13886 using new Input_section_sort_entry functions. Sort crtbegin and
13887 crtend first. Sort sections with no priority before sections with
13889 * testsuite/initpri1.c (d3): Check j != 4.
13890 (cd5): New constructor/destructor function.
13891 (main): Check j != 2.
13893 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13894 new symbol when resolving, don't call set_is_default.
13895 * testsuite/ver_test_7.cc: New file.
13896 * testsuite/ver_test_7.sh: New file.
13897 * testsuite/Makefile.am (ver_test_7.so): New target.
13898 (ver_test_7.o): New target.
13899 (check_SCRIPTS): Add ver_test_7.sh.
13900 (check_DATA): Add ver_test_7.syms.
13901 (ver_test_7.syms): New target.
13903 2008-03-28 Ian Lance Taylor <iant@google.com>
13905 * layout.cc (Layout::layout): If we see an input section with a
13906 name that needs sorting, set the must_sort flag for the output
13908 (Layout::make_output_section): If the name of the output section
13909 indicates that it might require sorting, set the may_sort flag.
13910 * output.h (Output_section::may_sort_attached_input_sections): New
13912 (Output_section::set_may_sort_attached_input_sections): New
13914 (Output_section::must_sort_attached_input_sections): New
13916 (Output_section::set_must_sort_attached_input_sections): New
13918 (class Output_section): Declare Input_section_sort_entry. Define
13919 Input_section_sort_compare. Declare
13920 sort_attached_input_sections. Add new fields:
13921 may_sort_attached_input_sections_,
13922 must_sort_attached_input_sections_,
13923 attached_input_sections_are_sorted_.
13924 * output.cc (Output_section::Output_section): Initialize new
13926 (Output_section::add_input_section): Add an entry to
13927 input_sections_ if may_sort or must_sort are true.
13928 (Output_section::set_final_data_size): Call
13929 sort_attached_input_sections if necessary.
13930 (Output_section::Input_section_sort_entry): Define new class.
13931 (Output_section::Input_section_sort_compare::operator()): New
13933 (Output_section::sort_attached_input_sections): New function.
13934 * configure.ac: Check whether the compiler supports constructor
13935 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13936 * testsuite/initpri1.c: New file.
13937 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13938 CONSTRUCTOR_PRIORITY.
13939 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13940 (initpri1_LDFLAGS): New variable.
13941 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13943 2008-03-27 Ian Lance Taylor <iant@google.com>
13945 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13946 * testsuite/common_test_1.c: New file.
13947 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13948 (common_test_1_SOURCES): New variable.
13949 (common_test_1_DEPENDENCIES): New variable.
13950 (common_test_1_LDFLAGS): New variable.
13952 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13953 and commons_ correctly when NAME/VERSION does not override
13955 * testsuite/ver_test_6.c: New file.
13956 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13957 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13958 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13960 2008-03-26 Ian Lance Taylor <iant@google.com>
13962 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13963 of an undefined symbol from a version script.
13964 * testsuite/Makefile.am (ver_test_5.so): New target.
13965 (ver_test_5.o): New target.
13966 (check_SCRIPTS): Add ver_test_5.sh.
13967 (check_DATA): Add ver_test_5.syms.
13968 (ver_test_5.syms): New target.
13969 * testsuite/ver_test_5.cc: New file.
13970 * testsuite/ver_test_5.script: New file.
13971 * testsuite/ver_test_5.sh: New file.
13972 * Makefile.in, testsuite/Makefile.in: Rebuild.
13975 Fix problems building gold with gcc 4.3.0.
13976 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13977 (gold_error_at_location, gold_warning_at_location): Use it.
13978 * configure.ac: Check whether we can compile and use a template
13979 function with a printf attribute.
13980 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13981 when jumping over bytes.
13982 * object.cc: Instantiate Object::read_section_data.
13983 * debug.h: Include <cstring>
13984 * dwarf_reader.cc: Include <algorithm>
13985 * main.cc: Include <cstring>.
13986 * options.cc: Include <cstring>.
13987 * output.cc: Include <cstring>.
13988 * script.cc: Include <cstring>.
13989 * script.h: Include <string>.
13990 * symtab.cc: Include <cstring> and <algorithm>.
13991 * target-select.cc: Include <cstring>.
13992 * version.cc: Include <string>.
13993 * testsuite/testmain.cc: Include <cstdlib>.
13994 * configure, config.in: Rebuild.
13996 2008-03-25 Ian Lance Taylor <iant@google.com>
13998 * options.cc: Include "../bfd/bfdver.h".
13999 (options::help): Print bug reporting address.
14001 * version.cc (print_version): Adjust output for current value of
14002 BFD_VERSION_STRING.
14006 * options.cc (options::help): Print list of supported targets.
14007 * target-select.h: Include <vector>.
14008 (class Target_selector): Make machine_, size_, and is_big_endian_
14009 fields const. Add bfd_name_ and instantiated_target_ fields.
14010 (Target_selector::Target_selector): Add bfd_name parameter.
14011 (Target_selector::recognize): Make non-virtual, call
14013 (Target_selector::recognize_by_name): Make non-virtual, call
14014 do_recognize_by_name.
14015 (Target_selector::supported_names): New function.
14016 (Target_selector::bfd_name): New function.
14017 (Target_selector::do_instantiate_target): New pure virtual
14019 (Target_selector::do_recognize): New virtual function.
14020 (Target_selector::do_recognize_by_name): New virtual function.
14021 (Target_selector::instantiate_target): New private function.
14022 (supported_target_names): Declare.
14023 * target-select.cc (Target_selector::Target_selector): Update for
14024 new parameter and fields.
14025 (select_target_by_name): Check that the name matches before
14026 calling recognize_by_name.
14027 (supported_target_names): New function.
14028 * i386.cc (class Target_selector_i386): Update Target_selector
14029 constructor call. Remove recognize and recognize_by_name. Add
14030 do_instantiate_target.
14031 * x86_64.cc (class Target_selector_x86_64): Likewise.
14032 * testsuite/testfile.cc (class Target_selector_test): Update for
14033 changes to Target_selector.
14035 * README: Rewrite, with some notes on unsupported features.
14037 2008-03-24 Cary Coutant <ccoutant@google.com>
14039 * i386.cc (Target_i386::Got_type): New enum declaration.
14040 (Target_i386::Scan::local): Updated callers of Output_data_got
14042 (Target_i386::Scan::global): Likewise.
14043 (Target_i386::Relocate::relocate): Likewise.
14044 (Target_i386::Relocate::relocate_tls): Likewise.
14045 * object.h (Got_offset_list): New class.
14046 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14047 (Sized_relobj::local_got_offset): Likewise.
14048 (Sized_relobj::set_local_got_offset): Likewise.
14049 (Sized_relobj::local_has_tls_got_offset): Removed.
14050 (Sized_relobj::local_tls_got_offset): Removed.
14051 (Sized_relobj::set_local_tls_got_offset): Removed.
14052 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14053 * output.cc (Output_data_got::add_global): Added got_type parameter.
14054 (Output_data_got::add_global_with_rel): Likewise.
14055 (Output_data_got::add_global_with_rela): Likewise.
14056 (Output_data_got::add_global_pair_with_rel): New function.
14057 (Output_data_got::add_global_pair_with_rela): New function.
14058 (Output_data_got::add_local): Added got_type parameter.
14059 (Output_data_got::add_local_with_rel): Likewise.
14060 (Output_data_got::add_local_with_rela): Likewise.
14061 (Output_data_got::add_local_pair_with_rel): New function.
14062 (Output_data_got::add_local_pair_with_rela): New function.
14063 (Output_data_got::add_global_tls): Removed.
14064 (Output_data_got::add_global_tls_with_rel): Removed.
14065 (Output_data_got::add_global_tls_with_rela): Removed.
14066 (Output_data_got::add_local_tls): Removed.
14067 (Output_data_got::add_local_tls_with_rel): Removed.
14068 (Output_data_got::add_local_tls_with_rela): Removed.
14069 * output.h (Output_data_got::add_global): Added got_type parameter.
14070 (Output_data_got::add_global_with_rel): Likewise.
14071 (Output_data_got::add_global_with_rela): Likewise.
14072 (Output_data_got::add_global_pair_with_rel): New function.
14073 (Output_data_got::add_global_pair_with_rela): New function.
14074 (Output_data_got::add_local): Added got_type parameter.
14075 (Output_data_got::add_local_with_rel): Likewise.
14076 (Output_data_got::add_local_with_rela): Likewise.
14077 (Output_data_got::add_local_pair_with_rel): New function.
14078 (Output_data_got::add_local_pair_with_rela): New function.
14079 (Output_data_got::add_global_tls): Removed.
14080 (Output_data_got::add_global_tls_with_rel): Removed.
14081 (Output_data_got::add_global_tls_with_rela): Removed.
14082 (Output_data_got::add_local_tls): Removed.
14083 (Output_data_got::add_local_tls_with_rel): Removed.
14084 (Output_data_got::add_local_tls_with_rela): Removed.
14085 * resolve.cc (Symbol::override_base_with_special): Removed
14086 reference to has_got_offset_ field.
14087 * symtab.cc (Symbol::init_fields): Replaced initialization
14088 of got_offset_ with got_offsets_. Removed initialization
14090 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
14091 (Symbol::got_offset): Likewise.
14092 (Symbol::set_got_offset): Likewise.
14093 (Symbol::has_tls_got_offset): Removed.
14094 (Symbol::tls_got_offset): Removed.
14095 (Symbol::set_tls_got_offset): Removed.
14096 (Symbol::got_offset_): Removed.
14097 (Symbol::tls_mod_got_offset_): Removed.
14098 (Symbol::tls_pair_got_offset_): Removed.
14099 (Symbol::got_offsets_): New field.
14100 (Symbol::has_got_offset): Removed.
14101 (Symbol::has_tls_mod_got_offset): Removed.
14102 (Symbol::has_tls_pair_got_offset): Removed.
14103 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14104 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14106 (Target_x86_64::Scan::global): Likewise.
14107 (Target_x86_64::Relocate::relocate): Likewise.
14108 (Target_x86_64::Relocate::relocate_tls): Likewise.
14110 2008-03-25 Ben Elliston <bje@au.ibm.com>
14112 * yyscript.y: Fix spelling error in comment.
14114 2008-03-24 Ian Lance Taylor <iant@google.com>
14116 * options.h (class General_options): Define build_id option.
14117 * layout.h (class Layout): Declare write_build_id, create_note,
14118 create_build_id. Add build_id_note_ member.
14119 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14120 "libiberty.h", "md5.h", "sha1.h".
14121 (Layout::Layout): Initialize eh_frame_data_,
14122 eh_frame_hdr_section_, and build_id_note_.
14123 (Layout::finalize): Call create_build_id.
14124 (Layout::create_note): New function, broken out of
14125 Layout::create_gold_note.
14126 (Layout::create_gold_note): Call create_note.
14127 (Layout::create_build_id): New function.
14128 (Layout::write_build_id): New function.
14129 (Close_task_runner::run): Call write_build_id.
14131 * x86_64.cc: Correct license to GPLv3.
14133 2008-03-23 Ian Lance Taylor <iant@google.com>
14135 * options.cc: Include "demangle.h".
14136 (parse_optional_string): New function.
14137 (parse_long_option): Handle takes_optional_argument.
14138 (parse_short_option): Update dash_z initializer. Handle
14139 takes_optional_argument.
14140 (General_options::General_options): Initialize do_demangle_.
14141 (General_options::finalize): Set do_demangle_. Handle demangling
14143 * options.h (parse_optional_string): Declare.
14144 (struct One_option): Add optional_arg field. Update constructor.
14145 Update call constructor calls. Add takes_optional_argument
14147 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14148 (DEFINE_optional_string): Define.
14149 (General_options::demangle): Change from DEFINE_bool to
14150 DEFINE_optional_string.
14151 (General_options::no_demangle): New function.
14152 (General_options::do_demangle): New function.
14153 (General_options::set_do_demangle): New function.
14154 (General_options::execstack_status_): Move definition to end of
14156 (General_options::static_): Likewise.
14157 (General_options::do_demangle_): New field.
14158 * object.cc (big_endian>::get_symbol_location_info): Call
14159 Options::do_demangle, not Options::demangle.
14160 * symtab.cc (demangle): Likewise.
14162 2008-03-22 Ian Lance Taylor <iant@google.com>
14164 * gold.h: Include <cstddef> and <sys/types.h>
14165 * options.h: Include <cstring>.
14167 2008-03-21 Ian Lance Taylor <iant@google.com>
14169 * Added source code to GNU binutils.