1 2012-08-14 Alan Modra <amodra@gmail.com>
3 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
5 for replace_constant call.
6 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
7 (Output_data_glink::do_print_to_mapfile): New function.
8 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
9 (Target_powerpc::Relocate::relocate): Likewise.
11 2012-08-14 Alan Modra <amodra@gmail.com>
13 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
14 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
15 (Output_data_glink::add_entry,find_entry): Remove shndx param.
16 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
17 all references to shndx_. Handle special case for R_PPC_PLTREL24
19 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
20 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
21 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
23 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
24 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
26 2012-08-12 Alan Modra <amodra@gmail.com>
28 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
29 (glink insn constants): Use uint32_t.
30 (Output_data_glink::add_entry): Use insert, not [] operator.
32 2012-08-11 Alan Modra <amodra@gmail.com>
34 * object.h (Sized_relobj_file::find_shdr): New function.
35 (Sized_relobj_file::find_special_sections): New function.
36 * object.cc (Sized_relobj_file::find_shdr): New function.
37 (Sized_relobj_file::find_eh_frame): Use find_shdr.
38 (Sized_relobj_file::find_special_sections): New function, split out..
39 (Sized_relobj_file::do_read_symbols): ..from here.
40 * output.h (Output_data_got::replace_constant): New function.
41 (Output_data_got::num_entries): New function.
42 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
43 (Output_data_got::got_offset): Protected rather than private.
44 (Output_data_got::replace_got_entry): New function.
45 * output.cc (Output_data_got::replace_got_entry): New function.
46 * powerpc.cc (class Powerpc_relobj): New.
47 (class Powerpc_relocate_functions): Delete all psymval variants or
48 convert to value,addend type. Delete pcrela, pcrela_unaligned.
49 Implement _ha functions using corresponding _hi function.
50 (Powerpc_relobj::find_special_sections): New function.
51 (Target_powerpc::do_make_elf_object): New function.
52 (class Output_data_got_powerpc): New.
53 (class Output_data_glink): New.
54 (class Powerpc_scan_relocatable_reloc): New.
55 Many more changes througout file.
57 2012-08-09 Nick Clifton <nickc@redhat.com>
59 * po/vi.po: Updated Vietnamese translation.
61 2012-08-07 Ian Lance Taylor <iant@google.com>
63 * layout.cc (Layout::add_target_dynamic_tags): If
64 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
67 2012-07-30 Nick Clifton <nickc@redhat.com>
69 * po/gold.pot: Updated template.
70 * po/es.po: Updated Spanish translation.
72 2012-07-18 Cary Coutant <ccoutant@google.com>
75 * configure.ac: Add check for -gpubnames support.
76 * configure: Regenerate.
77 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
78 support; force -gno-pubnames.
79 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
81 (gdb_index_test_4): New test.
82 * testsuite/Makefile.in: Regenerate.
83 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
84 * testsuite/gdb_index_test_2.sh: Likewise.
85 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
86 * testsuite/gdb_index_test_4.sh: New script.
87 * testsuite/gdb_index_test_comm.sh: New script with common code;
88 don't look for space after colon.
90 2012-07-16 Sriraman Tallam <tmsriram@google.com>
92 * gold.cc (queue_middle_tasks): Update function order only after
93 deferred objects due to plugins are processed.
95 2012-07-11 Ian Lance Taylor <iant@google.com>
97 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
98 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
99 (Target_arm::scan_reloc_for_stub): Likewise.
100 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
101 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
102 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
103 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
104 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
106 2012-07-10 Dodji Seketeli <dodji@redhat.com>
107 Ian Lance Taylor <iant@google.com>
110 * configure.ac: Test whether std::tr1::hash<off_t> works.
111 * gold.h: Add a specialization for std::tr1::hash<off_t> if
113 * output.h (class Output_fill): Add virtual destructor.
114 * configure, config.in: Rebuild.
116 2012-06-22 Roland McGrath <mcgrathr@google.com>
118 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
120 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
122 * plugin.cc (Plugin::load): Handle position independent executables.
124 2012-06-06 Cary Coutant <ccoutant@google.com>
126 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
128 (lines_only_debug_sections): Likewise.
129 (gdb_fast_lookup_sections): New static array.
130 (is_gdb_debug_section): Rename formal parameter.
131 (is_lines_only_debug_section): Likewise.
132 (is_gdb_fast_lookup_section): New function.
133 (Layout::include_section): Check for ".zdebug_" prefix; pass
134 section name suffix to is_gdb_debug_section, et al.; check for
135 fast-lookup sections when building .gdb_index.
136 * options.h (--strip-debug-gdb): Update GDB version number.
138 2012-06-06 Cary Coutant <ccoutant@google.com>
140 * configure.ac: Add check for fallocate.
141 * configure: Regenerate.
142 * config.in: Regenerate.
144 * options.h (class General_options): Add --mmap-output-file and
145 --posix-fallocate options.
146 * output.cc: (posix_fallocate): Remove; replace with...
147 (gold_fallocate): New function.
148 (Output_file::map_no_anonymous): Call gold_fallocate.
149 (Output_file::map): Check --mmap-output-file option.
151 2012-06-05 Jing Yu <jingyu@google.com>
153 * gold.h (textdomain): Add do {} to empty while(0).
154 (bindtextdomain): Likewise.
156 2012-06-04 Cary Coutant <ccoutant@google.com>
158 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
161 2012-05-25 Sriraman Tallam <tmsriram@google.com>
163 * symtab.cc (Symbol_table::define_special_symbol):
164 Initialize *poldsym to prevent uninitialized variable errors.
166 2012-05-23 Cary Coutant <ccoutant@google.com>
168 * layout.cc (Layout::section_name_mapping): Add rules to handle
169 exact match on .data.rel.ro.local or .data.rel.ro.
170 (Layout::output_section_name): Check for exact matches.
172 2012-05-23 Cary Coutant <ccoutant@google.com>
174 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
177 2012-05-22 Cary Coutant <ccoutant@google.com>
179 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
180 object before exporting symbol.
182 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
184 * testsuite/tls_test.cc: Include "config.h" first.
185 * testsuite/tls_test_c.c: Likewise.
187 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
188 Nick Clifton <nickc@redhat.com>
191 * configure.in: Add check that sysdep.h has been included before
192 any system header files.
193 * configure: Regenerate.
194 * config.in: Regenerate.
196 2012-05-14 Cary Coutant <ccoutant@google.com>
198 * layout.cc (Layout::make_output_section): Mark .tdata section
200 * testsuite/relro_test.cc: Add a TLS variable.
202 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
205 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
206 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
209 2012-05-08 Cary Coutant <ccoutant@google.com>
211 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
212 (lines_only_debug_sections): Likewise.
214 2012-05-02 Roland McGrath <mcgrathr@google.com>
218 * Makefile.am (CCFILES, HFILES): Add them.
219 * Makefile.in: Regenerate.
220 * i386.cc (Output_data_plt_i386_nacl): New class.
221 (Output_data_plt_i386_nacl_exec): New class.
222 (Output_data_plt_i386_nacl_dyn): New class.
223 (Target_i386_nacl): New class.
224 (Target_selector_i386_nacl): New class.
225 (target_selector_i386): Use it instead of Target_selector_i386.
226 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
227 (Target_x86_64_nacl): New class.
228 (Target_selector_x86_64_nacl): New class.
229 (target_selector_x86_64, target_selector_x32): Use it instead of
230 Target_selector_x86_64.
231 * arm.cc (Output_data_plt_arm_nacl): New class.
232 (Target_arm_nacl): New class.
233 (Target_selector_arm_nacl): New class.
234 (target_selector_arm, target_selector_armbe): Use it instead of
237 * target-select.cc (select_target): Take new Input_file* and off_t
238 arguments, pass them on to recognize method of selector.
239 * object.cc (make_elf_sized_object): Update caller.
240 * parameters.cc (parameters_force_valid_target): Likewise.
241 * incremental.cc (make_sized_incremental_binary): Likewise.
242 * target-select.h: Update decl.
243 (Target_selector::recognize): Take new Input_file* argument,
244 pass it on to do_recognize.
245 (Target_selector::do_recognize): Take new Input_file* argument.
246 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
247 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
248 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
249 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
251 * target.h (Target::Target_info): New members isolate_execinstr
253 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
254 * arm.cc (Target_arm::arm_info): Update initializer.
255 * i386.cc (Target_i386::i386_info): Likewise.
256 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
257 * sparc.cc (Target_sparc::sparc_info): Likewise.
258 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
259 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
260 * layout.cc (Layout::attach_allocated_section_to_segment):
261 Take new const Target* argument. If target->isolate_execinstr(), act
263 (Layout::find_first_load_seg): Take new const Target* argument;
264 if target->isolate_execinstr(), reject PF_X segments.
265 (Layout::relaxation_loop_body): Update caller.
266 (Layout::set_segment_offsets): If target->isolate_execinstr(),
267 reset file offset to zero when we hit LOAD_SEG, and then do a second
268 loop over the segments before LOAD_SEG to reassign offsets after
269 addresses have been determined. Handle target->rosegment_gap().
270 (Layout::attach_section_to_segment): Take new const Target* argument;
271 pass it to attach_allocated_section_to_segment.
272 (Layout::make_output_section): Update caller.
273 (Layout::attach_sections_to_segments): Take new const Target* argument;
274 pass it to attach_section_to_segment.
275 * gold.cc (queue_middle_tasks): Update caller.
276 * layout.h (Layout): Update method decls with new arguments.
278 * arm.cc (Target_arm::Target_arm): Take optional argument for the
279 Target_info pointer to use.
280 (Target_arm::do_make_data_plt): New virtual method.
281 (Target_arm::make_data_plt): New method that calls it.
282 (Target_arm::make_plt_entry): Use it.
283 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
284 for the section alignment.
285 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
287 (Output_data_plt_arm::first_plt_entry_offset): Call it.
288 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
290 (Output_data_plt_arm::get_plt_entry_size): Call it.
291 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
292 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
293 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
295 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
296 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
297 method instead of sizeof(plt_entry).
298 (Output_data_plt_arm::add_entry): Likewise.
299 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
300 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
302 (Target_arm::plt_entry_size): Likewise.
303 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
305 (Output_data_plt_arm_standard): ... here, new class.
306 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
307 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
308 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
310 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
311 Take additional argument for the PLT entry size.
312 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
313 Use get_plt_entry_size method rather than plt_entry_size variable.
314 (Output_data_plt_x86_64::reserve_slot): Likewise.
315 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
316 (Output_data_plt_x86_64::add_entry): Likewise.
317 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
318 (Output_data_plt_x86_64::address_for_global): Likewise.
319 (Output_data_plt_x86_64::address_for_local): Likewise.
320 (Output_data_plt_x86_64::set_final_data_size): Likewise.
321 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
322 Make method non-static.
323 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
325 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
326 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
327 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
328 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
330 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
331 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
333 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
334 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
336 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
337 (Output_data_plt_x86_64::plt_entry_size)
338 (Output_data_plt_x86_64::first_plt_entry)
339 (Output_data_plt_x86_64::plt_entry)
340 (Output_data_plt_x86_64::tlsdesc_plt_entry)
341 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
342 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
343 (Output_data_plt_x86_64_standard): ... here, new class.
344 (Target_x86_64::Target_x86_64): Take optional argument for the
345 Target_info pointer to use.
346 (Target_x86_64::do_make_data_plt): New virtual method.
347 (Target_x86_64::make_data_plt): New method to call it.
348 (Target_x86_64::init_got_plt_for_update): Use that.
349 Call this->plt_->add_eh_frame method here.
350 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
351 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
352 rather than static method.
353 (Target_x86_64::plt_entry_size): Likewise.
354 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
355 rather than plt_entry_size variable. Move guts of PLT filling to...
356 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
357 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
358 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
360 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
361 additional argument for the section alignment.
362 Don't do add_eh_frame_for_plt here.
363 (Output_data_plt_i386::first_plt_entry_offset): Make the method
364 non-static. Use get_plt_entry_size method rather than plt_entry_size
366 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
368 (Output_data_plt_i386::get_plt_entry_size): Call it.
369 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
370 (Output_data_plt_i386::add_eh_frame): New method to call it.
371 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
373 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
374 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
376 (Output_data_plt_i386::fill_plt_entry): New method to call it.
377 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
378 method instead of plt_entry_size.
379 (Output_data_plt_i386::plt_entry_size)
380 (Output_data_plt_i386::plt_eh_frame_fde_size)
381 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
382 (Output_data_plt_i386_standard): ... here, new class.
383 (Output_data_plt_i386_exec): New class.
384 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
385 (Output_data_plt_i386_exec::first_plt_entry): ... here.
386 (Output_data_plt_i386::exec_plt_entry): Move to ...
387 (Output_data_plt_i386_exec::plt_entry): ... here.
388 (Output_data_plt_i386_dyn): New class.
389 (Output_data_plt_i386::first_plt_entry): Move to ...
390 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
391 (Output_data_plt_i386::dyn_plt_entry): Move to ...
392 (Output_data_plt_i386_dyn::plt_entry): ... here.
393 (Target_i386::Target_i386): Take optional argument for the Target_info
395 (Target_i386::do_make_data_plt): New virtual method.
396 (Target_i386::make_data_plt): New method to call it.
397 (Target_i386::make_plt_section): Use that.
398 Call this->plt_->add_eh_frame method here.
399 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
400 rather than plt_entry_size variable.
401 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
402 (Output_data_plt_i386::address_for_local): Likewise.
403 (Output_data_plt_i386::do_write): Likewise.
404 Move guts of PLT filling to...
405 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
406 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
407 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
408 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
410 2012-05-01 Cary Coutant <ccoutant@google.com>
412 * dwarf_reader.cc (Dwarf_die::read_attributes)
413 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
414 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
415 * reduced_debug_output.cc
416 (Output_reduced_debug_info_section::get_die_end): Remove
417 DW_FORM_GNU_ref_index. Add default case.
419 2012-04-26 Mark Wielaard <mjw@redhat.com>
421 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
422 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
423 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
424 DW_AT_high_pc as offset from DW_AT_low_pc.
426 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
427 * testsuite/Makefile.in: Regenerate.
428 * testsuite/gdb_index_test_3.c: New test source file.
429 * testsuite/gdb_index_test_3.sh: New test source file.
431 2012-04-25 Ian Lance Taylor <iant@google.com>
433 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
435 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
436 as a class, not a struct.
437 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
438 (Target_arm::apply_cortex_a8_workaround): Likewise.
439 * gc.h: Declare Reloc_types as a struct, not a class.
440 * object.h: Declare Symbols_data as a struct.
441 * reloc.h: Declare Read_relocs_data as a struct.
442 * target.h: Declare Relocate_info as a struct.
444 2012-04-24 David S. Miller <davem@davemloft.net>
446 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
447 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
450 2012-04-24 Cary Coutant <ccoutant@google.com>
452 * incremental-dump.cc (find_input_containing_global): Replace
453 magic number with symbolic constant.
454 (dump_incremental_inputs): Update version number.
455 * incremental.cc (Output_section_incremental_inputs): Update version
456 number; import symbolic constants from Incremental_inputs_reader.
457 (Incremental_inputs::create_data_sections): Align relocations
458 section correctly for 64-bit targets.
459 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
460 constants; add padding.
461 (Output_section_incremental_inputs::write_header): Add assert for
463 (Output_section_incremental_inputs::write_input_files): Add assert
464 for input_entry_size.
465 (Output_section_incremental_inputs::write_info_blocks): Add padding;
466 add assert for object_info_size, input_section_entry_size,
467 global_sym_entry_size.
468 * incremental.h (Incremental_inputs_reader): Add symbolic constants
469 for data structure sizes; use them.
470 (Incremental_input_entry_reader): Import symbolic constants from
471 Incremental_inputs_reader; use them.
473 2012-04-23 David S. Miller <davem@davemloft.net>
475 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
477 (Target_sparc::Target_sparc): Initialize new fields.
478 (Target_sparc::do_make_elf_object): New function.
479 (Target_sparc::do_adjust_elf_header): New function.
481 2012-04-23 Cary Coutant <ccoutant@google.com>
483 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
484 CU range table of gdb index.
486 2012-04-20 David S. Miller <davem@davemloft.net>
488 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
491 2012-04-16 David S. Miller <davem@davemloft.net>
493 * sparc.cc (Target_sparc::got_address): New function.
494 (Sparc_relocate_functions::gdop_hix22): New function.
495 (Sparc_relocate_functions::gdop_lox10): New function.
496 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
498 (Target_sparc::Scan::local): Likewise if the global symbol is not
499 preemptible and is not IFUNC.
500 (Target_sparc::Relocate::relocate): Perform GOTDATA code
501 transformations for local and non-preemptible non-IFUNC global
504 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
505 writing out 64-bit part of ranges.
507 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
508 -fpic and -fpie respectively.
509 * Makefile.in: Regenerate.
511 * sparc.cc (class Target_sparc): Add rela_ifunc_.
512 (Target_sparc::Target_sparc): Initialize new field.
513 (Target_sparc::do_plt_section_for_global): New function.
514 (Target_sparc::do_plt_section_for_local): New function.
515 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
516 (Target_sparc::make_plt_section): New function, broken out of
517 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
518 (Target_sparc::make_plt_entry): Call make_plt_section.
519 (Target_sparc::make_local_ifunc_plt_entry): New function.
520 (Target_sparc::rela_ifunc_section): New function.
521 (Target_sparc::plt_section): Remove const.
522 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
523 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
524 and ifunc_count_ fields.
525 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
526 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
527 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
528 (Output_data_plt_sparc::rela_ifunc): New function.
529 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
530 (Output_data_plt_sparc::has_ifunc_section): New function.
531 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
532 (Output_data_plt_sparc::address_for_global): New function.
533 (Output_data_plt_sparc::address_for_local): New function.
534 (Output_data_plt_sparc::plt_index_to_offset): New function.
535 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
537 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
539 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
540 R_SPARC_JMP_IREL to switch.
541 (Target_sparc::Scan::check_non_pic): Likewise.
542 (Target_sparc::Scan::local): Handle IFUNC symbols.
543 (Target_sparc::Scan::local): Likewise.
544 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
545 and plt_address_for_local.
546 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
547 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
549 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
550 (class Output_data_reloc): Adjust calls to Output_reloc_type.
551 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
552 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
554 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
555 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
557 * sparc.cc (Target_sparc::Scan::global): Likewise.
558 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
560 2012-04-16 Cary Coutant <ccoutant@google.com>
562 * archive.cc (Library_base::should_include_member): Check for
563 --export-dynamic-symbol.
564 * options.h (class General_options): Add --export-dynamic-symbol.
565 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
566 --export-dynamic-symbol.
567 (Symbol_table::gc_mark_undef_symbols): Likewise.
568 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
570 2012-04-12 David S. Miller <davem@davemloft.net>
572 * sparc.cc (Reloc::wdisp10): New relocation method.
573 (Reloc::h34): Likewise.
574 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
575 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
577 (Target_sparc::Scan::local): Likewise.
578 (Target_sparc::Scan::global): Likewise.
579 (Target_sparc::Relocate::relocate): Likewise.
581 2012-04-09 Cary Coutant <ccoutant@google.com>
583 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
586 2012-04-06 Ian Lance Taylor <iant@google.com>
588 * timer.cc: #include <unistd.h>.
590 2012-04-06 Roland McGrath <mcgrathr@google.com>
592 * configure.in (AC_CHECK_HEADERS): Add locale.h.
593 * config.in: Regenerate.
594 * configure: Regenerate.
596 2012-04-05 Nick Clifton <nickc@redhat.com>
598 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
599 (AM_LC_MESSAGES): Add.
600 * aclocal.m4: Regenerate.
601 * config.in: Regenerate.
602 * configure: Regenerate.
604 2012-03-21 Cary Coutant <ccoutant@google.com>
606 * Makefile.am: Add gdb-index.cc, gdb-index.h.
607 * Makefile.in: Regenerate.
608 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
609 (Sized_elf_reloc_mapper::symbol_section): New function.
610 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
611 (make_elf_reloc_mapper): New function.
612 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
613 (Dwarf_abbrev_table::do_read_abbrevs): New function.
614 (Dwarf_abbrev_table::do_get_abbrev): New function.
615 (Dwarf_ranges_table::read_ranges_table): New function.
616 (Dwarf_ranges_table::read_range_list): New function.
617 (Dwarf_pubnames_table::read_section): New function.
618 (Dwarf_pubnames_table::read_header): New function.
619 (Dwarf_pubnames_table::next_name): New function.
620 (Dwarf_die::Dwarf_die): New function.
621 (Dwarf_die::read_attributes): New function.
622 (Dwarf_die::skip_attributes): New function.
623 (Dwarf_die::set_name): New function.
624 (Dwarf_die::set_linkage_name): New function.
625 (Dwarf_die::attribute): New function.
626 (Dwarf_die::string_attribute): New function.
627 (Dwarf_die::int_attribute): New function.
628 (Dwarf_die::uint_attribute): New function.
629 (Dwarf_die::ref_attribute): New function.
630 (Dwarf_die::child_offset): New function.
631 (Dwarf_die::sibling_offset): New function.
632 (Dwarf_info_reader::check_buffer): New function.
633 (Dwarf_info_reader::parse): New function.
634 (Dwarf_info_reader::do_parse): New function.
635 (Dwarf_info_reader::do_read_string_table): New function.
636 (Dwarf_info_reader::lookup_reloc): New function.
637 (Dwarf_info_reader::get_string): New function.
638 (Dwarf_info_reader::visit_compilation_unit): New function.
639 (Dwarf_info_reader::visit_type_unit): New function.
640 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
641 Sized_elf_reloc_mapper.
642 (Sized_dwarf_line_info::symbol_section): Remove function.
643 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
644 (Sized_dwarf_line_info::read_line_mappings): Remove object
645 parameter, adjust callers.
646 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
647 * dwarf_reader.h: Include <sys/types.h>.
648 (class Track_relocs): Remove forward declaration.
649 (class Elf_reloc_mapper): New class.
650 (class Sized_elf_reloc_mapper): New class.
651 (class Dwarf_abbrev_table): New class.
652 (class Dwarf_range_list): New class.
653 (class Dwarf_ranges_table): New class.
654 (class Dwarf_pubnames_table): New class.
655 (class Dwarf_die): New class.
656 (class Dwarf_info_reader): New class.
657 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
658 (Sized_dwarf_line_info::symbol_section): Remove member function.
659 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
661 * gdb-index.cc: New source file.
662 * gdb-index.h: New source file.
663 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
664 and .debug_types sections, call Layout::add_to_gdb_index.
665 (Sized_relobj_incr::do_section_name): Implement.
666 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
667 return type; Implement.
668 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
670 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
671 parameter list and return type.
672 (Sized_incr_dynobj::do_section_contents): Likewise.
673 * layout.cc: Include gdb-index.h.
674 (Layout::Layout): Initialize gdb_index_data_.
675 (Layout::init_fixed_output_section): Check for .gdb_index section.
676 (Layout::add_to_gdb_index): New function. Instantiate.
677 * layout.h: Add forward declaration for class Gdb_index.
678 (Layout::add_to_gdb_index): New member function.
679 (Layout::gdb_index_data_): New data member.
680 * main.cc: Include gdb-index.h.
681 (main): Print statistics for gdb index.
682 * object.cc (Object::section_contents): Move code into
684 (need_decompressed_section): Check for sections needed when building
686 (build_compressed_section_map): Likewise.
687 (Sized_relobj_file::do_read_symbols): Need local symbols when building
689 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
690 sections; call Layout::add_to_gdb_index.
691 (Sized_relobj_file::do_decompressed_section_contents): Call
692 do_section_contents directly.
693 * object.h (Object::do_section_contents): Adjust parameter list and
695 (Object::do_decompressed_section_contents): Call do_section_contents
697 (Sized_relobj_file::do_section_contents): Adjust parameter list and
699 * options.h (class General_options): Add --gdb-index option.
700 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
701 list and return type.
702 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
703 * reloc.h (Track_relocs::checkpoint): New function.
704 (Track_relocs::reset): New function.
706 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
708 * testsuite/Makefile.in: Regenerate.
709 * testsuite/gdb_index_test.cc: New test source file.
710 * testsuite/gdb_index_test_1.sh: New test source file.
711 * testsuite/gdb_index_test_2.sh: New test source file.
713 2012-03-19 Doug Kwan <dougkwan@google.com>
715 * arm.cc (Target_arm::do_define_standard_symbols): New method.
716 (Target_arm::do_finalize_sections): Remove code which defines
717 __exidx_start and __exidx_end. Make symbol table parameter
718 anonymous as it is not used.
719 * gold.cc (queue_middle_tasks): Call target hook to define any
720 target-specific symbols.
721 * target.h (Target::define_standard_symbols): New method.
722 (Target::do_define_standard_symbols): Same.
723 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
724 * testsuite/Makefile.in: Regenerate.
725 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
727 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
728 relocations are generated for __exidx_start and __exidx_end.
730 2012-03-16 Doug Kwan <dougkwan@google.com>
732 * testsuite/Makefile.am: Disable test initpri3b.
733 * testsuite/Makefile.in: Regenerate.
735 2012-03-15 Doug Kwan <dougkwan@google.com>
737 * arm.cc (Target_arm::got_section): Make .got section read-only
740 2012-03-15 Ian Lance Taylor <iant@google.com>
743 * layout.cc (Layout::make_output_section): Correctly mark
744 SHT_INIT_ARRAY, et. al., as relro.
746 2012-03-14 Doug Kwan <dougkwan@google.com>
748 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
749 dynamic relocations for protected symbols in shared objects.
751 2012-03-13 Ian Lance Taylor <iant@google.com>
753 * resolve.cc (Symbol_table::resolve): When merging common symbols,
754 keep the larger alignment.
756 2012-03-12 Cary Coutant <ccoutant@google.com>
758 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
759 handling of DW_LNE_define_file.
761 2012-03-12 Cary Coutant <ccoutant@google.com>
763 * reduced_debug_output.cc
764 (Output_reduced_debug_info_section::get_die_end): Add new FORM
767 2012-02-29 Cary Coutant <ccoutant@google.com>
769 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
771 2012-02-29 Cary Coutant <ccoutant@google.com>
773 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
774 Call Object::decompressed_section_contents.
775 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
777 (Sized_dwarf_line_info::buffer_start_): New data member.
778 * merge.cc (Output_merge_data::do_add_input_section): Call
779 Object::decompressed_section_contents.
780 (Output_merge_string::do_add_input_section): Likewise.
781 * object.cc (need_decompressed_section): New function.
782 (build_compressed_section_map): Decompress sections needed later.
783 (Sized_relobj_file::do_decompressed_section_contents): New function.
784 (Sized_relobj_file::do_discard_decompressed_sections): New function.
785 * object.h (Object::decompressed_section_contents): New function.
786 (Object::discard_decompressed_sections): New function.
787 (Object::do_decompressed_section_contents): New function.
788 (Object::do_discard_decompressed_sections): New function.
789 (Compressed_section_info): New type.
790 (Compressed_section_map): Include decompressed section contents.
791 (Sized_relobj_file::do_decompressed_section_contents): New function.
792 (Sized_relobj_file::do_discard_decompressed_sections): New function.
794 2012-02-16 Cary Coutant <ccoutant@google.com>
796 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
797 * testsuite/Makefile.in: Regenerate.
799 2012-02-14 Cary Coutant <ccoutant@google.com>
801 * options.cc (General_options::finalize): Disallow -pie and -static.
803 2012-02-03 Doug Kwan <dougkwan@google.com>
805 * arm.cc (Arm_relocate_functions::abs8,
806 Arm_relocate_functions::abs16): Use
807 Bits::has_signed_unsigned_overflow32.
808 (Arm_relocate_functions::thm_abs8): Correct range of
810 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
813 2012-02-02 Doug Kwan <dougkwan@google.com>
815 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
816 position independent outputs, not just shared objects.
818 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
820 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
821 * configure: Regenerated.
823 2012-01-27 Ian Lance Taylor <iant@google.com>
825 * reloc.h (Bits): New class with static functions, copied from
826 namespace utils in arm.cc.
827 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
830 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
832 * incremental.cc (write_info_blocks): Correct relocation offset.
834 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
836 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
837 (Relocate::tls_gd_to_le): Likewise.
839 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
841 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
843 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
845 * configure.ac: Check if -mcmodel=medium works.
846 * configure: Regenerated.
848 2012-01-24 Cary Coutant <ccoutant@google.com>
850 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
852 (read_unsigned_LEB_128_x): ... this new function.
853 (read_signed_LEB_128): Replaced with inline definition and ...
854 (read_signed_LEB_128_x): ... this new function.
855 * int_encoding.h (read_unsigned_LEB_128_x): New function.
856 (read_unsigned_LEB_128): Add inline definition.
857 (read_signed_LEB_128_x): New function.
858 (read_signed_LEB_128): Add inline definition.
859 * testsuite/Makefile.am (leb128_unittest): New unit test.
860 * testsuite/Makefile.in: Regenerate.
861 * testsuite/leb128_unittest.cc: New unit test.
863 2012-01-23 Ian Lance Taylor <iant@google.com>
866 * i386.cc (Target_i386::do_code_fill): When using a jmp
867 instruction, pad with nop instructions.
868 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
870 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
872 * x86_64.cc (gc_process_relocs): Add typename on types used in
874 (scan_relocs): Likewise.
875 (relocate_section): Likewise.
876 (apply_relocation): Likewise.
878 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
880 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
881 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
884 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
886 * x86_64.cc: Initial support for x32.
888 2012-01-03 Cary Coutant <ccoutant@google.com>
890 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
891 Use abstract base class for GOT.
892 * gold/output.h (class Output_data_got_base): New abstract base class.
893 (class Output_data_got): Derive from new base class, adjust ctors.
894 (Output_data_got::reserve_slot): Make virtual; rename to
895 do_reserve_slot; Adjust callers.
896 * gold/target.h (Sized_target::init_got_plt_for_update): Return
897 pointer to abstract base class.
898 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
900 2011-12-18 Ian Lance Taylor <iant@google.com>
902 * object.h (Relobj::local_symbol_value): New function.
903 (Relobj::local_plt_offset): New function.
904 (Relobj::local_has_got_offset): New function.
905 (Relobj::local_got_offset): New function.
906 (Relobj::set_local_got_offset): New function.
907 (Relobj::do_local_symbol_value): New pure virtual function.
908 (Relobj::do_local_plt_offset): Likewise.
909 (Relobj::do_local_has_got_offset): Likewise.
910 (Relobj::do_local_got_offset): Likewise.
911 (Relobj::do_set_local_got_offset): Likewise.
912 (Sized_relobj::do_local_has_got_offset): Rename from
913 local_has_got_offset.
914 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
915 (Sized_relobj::do_set_local_got_offset): Rename from
916 set_local_got_offset.
917 (Sized_relobj_file::do_local_plt_offset): Rename from
919 (Sized_relobj_file::do_local_symbol_value): New function.
920 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
922 * output.cc (Output_data_got::Got_entry::write): Change object to
923 Relobj. Use local_symbol_value.
924 (Output_data_got::add_global_with_rel): Change rel_dyn to
925 Output_data_reloc_generic*. Use add_global_generic.
926 (Output_data_got::add_global_with_rela): Remove. Change all
927 callers to use add_global_with_rel.
928 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
929 Output_data_reloc_generic*. Use add_global_generic.
930 (Output_data_got::add_global_pair_with_rela): Remove. Change all
931 callers to use add_global_pair_with_rel.
932 (Output_data_got::add_local): Change object to Relobj*.
933 (Output_data_got::add_local_plt): Likewise.
934 (Output_data_got::add_local_with_rel): Change object to Relobj*,
935 change rel_dyn to Output_data_reloc_generic*. Use
937 (Output_data_got::add_local_with_rela): Remove. Change all
938 callers to use all_local_with_rel.
939 (Output_data_got::add_local_pair_with_rel): Change object to
940 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
941 add_output_section_generic.
942 (Output_data_got::add_local_pair_with_rela): Remove. Change all
943 callers to use add_local_pair_with_rel.
944 (Output_data_got::reserve_local): Change object to Relobj*.
945 * output.h: (class Output_data_reloc_generic): Add pure virtual
946 declarations for add_global_generic, add_local_generic,
947 add_output_section_generic.
948 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
949 functions for Output_data_reloc_generic. Update declarations for
950 changes listed in output.cc.
951 (class Output_data_got): Change template parameter to got_size.
952 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
953 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
955 (Sized_relobj_incr::do_local_plt_offset): New function.
956 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
959 2011-12-17 Cary Coutant <ccoutant@google.com>
961 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
962 * resolve.cc (Symbol_table::resolve): Likewise.
963 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
965 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
967 2011-12-16 Ian Lance Taylor <iant@google.com>
969 * output.h (Output_data_reloc_generic::add): Only call
970 add_dynamic_reloc if this is a dynamic reloc section.
972 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
975 * target-reloc.h (apply_relocation): Replace <64, false> with
978 2011-11-25 Nick Clifton <nickc@redhat.com>
980 * po/it.po: New Italian translation.
982 2011-11-17 Sterling Augustine <saugustine@google.com>
984 * script.cc (script_include_directive): Implement.
985 (read_script_file): New local variables name and search_path. Update
986 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
987 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
988 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
990 2011-11-11 Sterling Augustine <saugustine@google.com>
992 * yyscript.y (section_cmd): Add support for INCLUDE directive.
993 (file_or_sections_cmd): Likewise.
995 2011-11-11 Doug Kwan <dougkwan@google.com>
997 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
998 if --just-symbols is given.
1000 2011-11-10 Doug Kwan <dougkwan@google.com>
1003 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1004 when processing data relocs.
1005 * reloc.h (Relocate_functions::rel_unaligned): New method.
1006 (Relocate_functions::pcrel_unaligned): Ditto.
1007 (Relocate_functions::rel32_unaligned): Ditto.
1008 (Relocate_functions::pcrel32_unaligned): Ditto.
1010 2011-11-09 Doug Kwan <dougkwan@google.com>
1013 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1014 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1015 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1016 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1017 (Relocate_functions::rel_unaligned): New.
1018 (Relocate_functions::rel32_unaligned): New.
1019 * target-reloc.h (relocate_for_relocatable): Add code to handle
1020 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1021 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1022 arm_unaligned_reloc_r): New targets.
1023 * testsuite/Makefile.in: Regenerate.
1024 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1027 2011-11-02 Ian Lance Taylor <iant@google.com>
1029 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1031 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1032 * options.cc (General_options::finalize): Use library search path
1033 from configure script if specified. If not native and no sysroot,
1034 only search TOOLLIBDIR.
1035 * options.h (Search_directory::Search_directory): Change name to
1037 (General_options::add_to_library_path_with_sysroot): Change arg to
1039 * configure, Makefile.in, config.in: Rebuild.
1041 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1043 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1044 we are working around the ARM1176 Erratum.
1045 * options.h (General_options::fix_arm1176): Add option.
1046 * testsuite/Makefile.am: Add testcases, and keep current ones
1048 * testsuite/Makefile.in: Regenerate.
1049 * testsuite/arm_fix_1176.s: New file.
1050 * testsuite/arm_fix_1176.sh: Likewise.
1052 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1054 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1056 (Target_arm::may_use_blx): Remove method.
1057 (Target_arm::set_may_use_blx): Likewise.
1058 (Target_arm::may_use_v4t_interworking): New method.
1059 (Target_arm::may_use_v5t_interworking): Likewise.
1060 (Target_arm::may_use_blx_): Remove member variable.
1061 (Arm_relocate_functions::arm_branch_common): Check for v5T
1063 (Arm_relocate_functions::thumb_branch_common): Likewise.
1064 (Reloc_stub::stub_type_for_reloc): Likewise.
1065 (Target_arm::do_finalize_sections): Correct interworking checks.
1066 * testsuite/Makefile.am: Add new tests.
1067 * testsuite/Makefile.in: Regenerate.
1068 * testsuite/arm_farcall_arm_arm.s: New test.
1069 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1070 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1071 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1072 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1073 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1074 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1075 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1077 2011-10-31 Cary Coutant <ccoutant@google.com>
1080 * expression.cc (Expression::eval_with_dot): Add
1081 is_section_dot_assignment parameter.
1082 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1083 absolute and assigning to dot within a section.
1084 * script-sections.cc
1085 (Output_section_element_assignment::set_section_addresses): Pass
1086 dot_section to set_if_absolute.
1087 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1088 as is_section_dot_assignment flag to eval_with_dot.
1089 (Output_section_element_dot_assignment::set_section_addresses):
1091 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1092 parameter. Also set value if relative to dot_section; set the
1093 symbol's output_section.
1094 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1095 parameter. Adjust all callers.
1096 (Expression::eval_maybe_dot): Likewise.
1097 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1099 * testsuite/script_test_2.t: Test assignment of an absolute value
1100 to dot within an output section element.
1102 2011-10-31 Cary Coutant <ccoutant@google.com>
1104 * options.h (class General_options): Add --[no-]gnu-unique options.
1105 * symtab.cc (Symbol_table::sized_write_globals): Convert
1106 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1108 2011-10-31 Cary Coutant <ccoutant@google.com>
1111 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1112 unnecessary assertion.
1113 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1115 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1117 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1119 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1121 Change to just keep the section associated with symbol.
1122 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1123 they are externally visible and --export-dynamic is turned on.
1124 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1126 2011-10-19 Ian Lance Taylor <iant@google.com>
1129 * script-sections.cc
1130 (Output_section_element_dot_assignment::needs_output_section): New
1133 2011-10-19 Ian Lance Taylor <iant@google.com>
1136 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1137 --section-start option was seen.
1138 * options.h (General_options::any_section_start): New function.
1140 2011-10-18 David S. Miller <davem@davemloft.net>
1143 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1144 member to track relocation locations that have moved during TLS
1145 reloc optimizations.
1146 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1147 (Target_sparc::Relocate::relocate): Adjust view down by 4
1148 bytes if it matches reloc_adjust_addr_.
1149 (Target_sparc::Relocate::relocate_tls): Always move the
1150 __tls_get_addr call delay slot instruction forward 4 bytes when
1151 performing relaxation.
1153 2011-10-18 Cary Coutant <ccoutant@google.com>
1155 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1156 (Output_file::map_no_anonymous): Check for non-zero
1157 return code from posix_fallocate.
1159 2011-10-17 Cary Coutant <ccoutant@google.com>
1162 * plugin.cc (is_visible_from_outside): Check for symbols
1163 referenced from dynamic objects.
1164 * resolve.cc (Symbol_table::resolve): Don't count references
1165 from dynamic objects as references from real ELF files.
1166 * testsuite/plugin_test_2.sh: Adjust expected result.
1168 2011-10-17 Cary Coutant <ccoutant@google.com>
1170 * gold.cc: Include timer.h.
1171 (queue_middle_tasks): Stamp time.
1172 (queue_final_tasks): Likewise.
1173 * main.cc (main): Store timer in parameters. Print timers
1175 * parameters.cc (Parameters::Parameters): Initialize timer_.
1176 (Parameters::set_timer): New function.
1177 (set_parameters_timer): New function.
1178 * parameters.h (Parameters::set_timer): New function.
1179 (Parameters::timer): New function.
1180 (Parameters::timer_): New data member.
1181 (set_parameters_timer): New function.
1182 * timer.cc (Timer::stamp): New function.
1183 (Timer::get_pass_time): New function.
1184 * timer.h (Timer::stamp): New function.
1185 (Timer::get_pass_time): New function.
1186 (Timer::pass_times_): New data member.
1188 2011-10-17 Cary Coutant <ccoutant@google.com>
1190 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1191 task for members of lib groups.
1193 2011-10-17 Cary Coutant <ccoutant@google.com>
1196 * fileread.cc (File_read::find_view): Add assert.
1197 (File_read::make_view): Move bounds check (replace with assert)...
1198 (File_read::find_or_make_view): ... to here.
1200 2011-10-12 Cary Coutant <ccoutant@google.com>
1202 * output.cc (Output_file::open_base_file): Handle case where
1203 ::read returns less than requested size.
1205 2011-10-10 Cary Coutant <ccoutant@google.com>
1207 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1208 Initialize defined_count_.
1209 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1210 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1211 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1212 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1213 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1214 * incremental.h (Sized_relobj_incr::defined_count_): New data
1216 (Sized_incr_dynobj::defined_count_): New data member.
1217 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1218 Return zeroes instead of internal error.
1220 2011-10-10 Cary Coutant <ccoutant@google.com>
1223 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1224 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1225 * output.h (class Output_reloc): Add use_plt_offset flag.
1226 (Output_reloc::type_): Adjust size of bit field.
1227 (Output_reloc::use_plt_offset_): New bit field.
1228 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1229 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1230 flag. Adjust all callers.
1231 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1232 creating RELATIVE relocations.
1234 2011-10-10 Nick Clifton <nickc@redhat.com>
1236 * po/es.po: Updated Spanish translation.
1237 * po/fi.po: Updated Finnish translation.
1239 2011-10-03 Diego Novillo <dnovillo@google.com>
1241 * options.cc (parse_uint): Fix dereference of RETVAL.
1243 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1245 * layout.h (section_order_map_): New member.
1246 (get_section_order_map): New member function.
1247 * output.cc (Output_section::add_input_section): Check for patterns
1248 only when --section-ordering-file is specified.
1249 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1250 output_sections have been formed.
1251 * layout.cc (Layout_Layout): Initialize section_order_map_.
1252 * plugin.cc (update_section_order): Store order in order_map. Do not
1254 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1255 * testsuite/Makefile.in: Regenerate.
1256 * testsuite/plugin_section_order.c: New file.
1257 * testsuite/plugin_final_layout.cc: New file.
1258 * testsuite/plugin_final_layout.sh: New file.
1260 2011-09-29 Cary Coutant <ccoutant@google.com>
1262 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1264 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1265 symbols during incremental update.
1266 (Symbol_table::add_from_dynobj): Likewise.
1268 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1269 Ian Lance Taylor <iant@google.com>
1271 * symtab.cc (Symbol_table::define_special_symbol): Always
1272 canonicalize version string.
1274 2011-09-26 Cary Coutant <ccoutant@google.com>
1276 * gold.cc (queue_initial_tasks): Move option checks ...
1277 * options.cc (General_options::finalize): ... to here. Disable
1278 some options; make others fatal.
1280 2011-09-26 Cary Coutant <ccoutant@google.com>
1283 * plugin.cc (get_symbols_v2): New function.
1284 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1285 (is_referenced_from_outside): New function.
1286 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1287 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1288 (get_symbols): Pass version parameter.
1289 (get_symbols_v2): New function.
1290 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1292 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1293 (onload): Add LDPT_GET_SYMBOLS_V2.
1294 (all_symbols_read_hook): Use get_symbols_v2; check for
1295 LDPR_PREVAILING_DEF_IRONLY_EXP.
1296 * testsuite/plugin_test_3.sh: Update expected results.
1298 2011-09-23 Simon Baldwin <simonb@google.com>
1300 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1301 configuration options.
1302 * configure: Regenerate.
1303 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1304 * Makefile.in: Regenerate.
1305 * testsuite/Makefile.in: Regenerate.
1307 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1309 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1311 2011-09-19 Cary Coutant <ccoutant@google.com>
1313 * incremental.cc (can_incremental_update): Fix typo in comment.
1314 * incremental.h (can_incremental_update): Likewise.
1316 2011-09-18 Cary Coutant <ccoutant@google.com>
1318 * incremental.cc (can_incremental_update): New function.
1319 * incremental.h (can_incremental_update): New function.
1320 * layout.cc (Layout::init_fixed_output_section): Call it.
1321 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1322 * object.cc (Sized_relobj_file::do_layout): Call
1323 can_incremental_update.
1325 2011-09-13 Cary Coutant <ccoutant@google.com>
1327 * configure.ac: Check for glibc support for gnu_indirect_function
1328 support with static linking, setting automake conditional
1330 * Makefile.in: Regenerate.
1331 * configure: Regenerate.
1333 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1334 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1336 * testsuite/Makefile.in: Regenerate.
1338 2011-09-13 Cary Coutant <ccoutant@google.com>
1340 * incremental.cc (Sized_relobj_incr::do_layout): Call
1341 report_comdat_group for kept comdat sections.
1342 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1343 * testsuite/Makefile.in: Regenerate.
1344 * testsuite/incr_comdat_test_1.cc: New source file.
1345 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1346 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1347 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1349 2011-09-13 Ian Lance Taylor <iant@google.com>
1351 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1352 variable external_symbols_offset.
1354 2011-09-12 Ian Lance Taylor <iant@google.com>
1356 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1357 triggered if object has no symbols.
1359 2011-09-09 David S. Miller <davem@davemloft.net>
1361 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1362 (Output_fill_debug_line::do_write): Likewise.
1364 2011-08-29 Cary Coutant <ccoutant@google.com>
1366 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1367 casts to match formatting specs.
1368 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1370 2011-08-26 Cary Coutant <ccoutant@google.com>
1372 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1373 remaining hole size when allocating.
1374 (Layout::make_output_section): Set fill methods for debug sections.
1375 * layout.h (Free_list::Free_list_node): Move from private to
1377 (Free_list::set_min_hole_size): New function.
1378 (Free_list::begin, Free_list::end): New functions.
1379 (Free_list::min_hole_): New data member.
1380 * output.cc: Include dwarf.h.
1381 (Output_fill_debug_info::do_minimum_hole_size): New function.
1382 (Output_fill_debug_info::do_write): New function.
1383 (Output_fill_debug_line::do_minimum_hole_size): New function.
1384 (Output_fill_debug_line::do_write): New function.
1385 (Output_section::Output_section): Initialize new data member.
1386 (Output_section::set_final_data_size): Ensure patch space is larger
1387 than minimum hole size.
1388 (Output_section::do_write): Fill holes in debug sections.
1389 * output.h (Output_fill): New class.
1390 (Output_fill_debug_info): New class.
1391 (Output_fill_debug_line): New class.
1392 (Output_section::set_free_space_fill): New function.
1393 (Output_section::free_space_fill_): New data member.
1394 * testsuite/Makefile.am (incremental_test_3): Add
1395 --incremental-patch option.
1396 (incremental_test_4): Likewise.
1397 (incremental_test_5): Likewise.
1398 (incremental_test_6): Likewise.
1399 (incremental_copy_test): Likewise.
1400 (incremental_common_test_1): Likewise.
1401 * testsuite/Makefile.in: Regenerate.
1403 2011-08-26 Nick Clifton <nickc@redhat.com>
1405 * po/es.po: Updated Spanish translation.
1407 2011-08-01 Cary Coutant <ccoutant@google.com>
1409 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1410 * gold/testsuite/Makefile.in: Regenerate.
1411 * gold/testsuite/justsyms_exec.c: New source file.
1412 * gold/testsuite/justsyms_lib.c: New source file.
1414 2011-08-01 Cary Coutant <ccoutant@google.com>
1416 * layout.cc (Layout::set_segment_offsets): Don't realign text
1417 segment if -Ttext was specified.
1418 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1420 * object.h (Sized_relobj_file::e_type): New function.
1421 (Sized_relobj_file::e_type_): New data member.
1422 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1423 base address for ET_EXEC files.
1424 * target.cc (Target::do_make_elf_object_implementation): Allow
1425 ET_EXEC files with --just-symbols option.
1427 2011-07-28 Cary Coutant <ccoutant@google.com>
1429 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1430 Add thread_number parameter.
1431 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1432 * workqueue-threads.cc
1433 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1434 current thread if its thread number is greater than desired thread
1436 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1437 Add thread_number parameter.
1438 (Workqueue::should_cancel_thread): Likewise.
1439 (Workqueue::find_runnable_or_wait): Pass thread_number to
1440 should_cancel_thread.
1441 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1444 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1446 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1447 only after checking if it cannot be forced local.
1448 * symtab.h (is_externally_visible): Check if the symbol is not forced
1451 2011-07-15 Ian Lance Taylor <iant@google.com>
1453 * options.h (class General_options): Add --print-output-format.
1454 Move -EL next to -EB, for better --help output.
1455 * target-select.cc: Include <cstdio>, "options.h", and
1457 (Target_selector::do_target_bfd_name): New function.
1458 (print_output_format): New function.
1459 * target-select.h (class Target_selector): Update declarations.
1460 (Target_selector::target_bfd_name): New function.
1461 (print_output_format): Declare.
1462 * main.cc: Include "target-select.h".
1463 (main): Handle --print-output-format.
1464 * gold.cc: Include "target-select.h".
1465 (queue_initial_tasks): Handle --print-output-format when there are
1467 * parameters.cc (parameters_force_valid_target): Give a better
1468 error message if -EB/-EL does not match target.
1469 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1472 2011-07-15 Ian Lance Taylor <iant@google.com>
1474 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1475 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1476 (Output_data_plt_i386::do_write): Write address of .dynamic
1477 section to first entry in .got.plt section.
1478 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1479 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1481 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1482 section to first entry in .got.plt section.
1483 * layout.h (Layout::dynamic_section): New function.
1485 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1487 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1489 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1490 input_section_position_, and input_section_glob_.
1491 (read_layout_from_file): Call function section_ordering_specified.
1492 * layout.h (is_section_ordering_specified): New function.
1493 (section_ordering_specified): New function.
1494 (section_ordering_specified_): New boolean member.
1495 * main.cc(main): Call load_plugins after layout object is defined.
1496 * output.cc (Output_section::add_input_section): Use
1497 function section_ordering_specified to check if section ordering is
1499 * output.cc (Output_section::add_relaxed_input_section): Use
1500 function section_ordering_specified to check if section ordering is
1502 (Output_section::update_section_layout): New function.
1503 (Output_section::sort_attached_input_sections): Check if input section
1505 * output.h (Output_section::update_section_layout): New function.
1506 * plugin.cc (get_section_count): New function.
1507 (get_section_type): New function.
1508 (get_section_name): New function.
1509 (get_section_contents): New function.
1510 (update_section_order): New function.
1511 (allow_section_ordering): New function.
1512 (Plugin::load): Add the new interfaces to the transfer vector.
1513 (Plugin_manager::load_plugins): New parameter.
1514 (Plugin_manager::all_symbols_read): New parameter.
1515 (Plugin_manager::claim_file): New parameter. Save the elf object for
1517 (Plugin_manager::get_elf_object): New function.
1518 (Plugin_manager::get_view): Change to directly use the bool to check
1519 if get_view is called from claim_file_hook.
1520 * plugin.h (input_objects): New function
1521 (Plugin__manager::load_plugins): New parameter.
1522 (Plugin_manager::claim_file): New parameter.
1523 (Plugin_manager::get_elf_object): New function.
1524 (Plugin_manager::in_claim_file_handler): New function.
1525 (Plugin_manager::in_claim_file_handler_): New member.
1526 (layout): New function.
1527 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1528 handler with an extra parameter. Make the elf object before calling
1530 * testsuite/plugin_test.c (get_section_count): New function pointer.
1531 (get_section_type): New function pointer.
1532 (get_section_name): New function pointer.
1533 (get_section_contents): New function pointer.
1534 (update_section_order): New function pointer.
1535 (allow_section_ordering): New function pointer.
1536 (onload): Check if the new interfaces exist.
1538 2011-07-13 Ian Lance Taylor <iant@google.com>
1540 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1542 * x86_64.cc (Target_x86_64::got_section): Likewise.
1543 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1544 (relro_now_test_SOURCES): New variable.
1545 (relro_now_test_DEPENDENCIES): New variable.
1546 (relro_now_test_LDFLAGS): New variable.
1547 (relro_now_test_LDADD): New variable.
1548 (relro_now_test.so): New target.
1549 * testsuite/Makefile.in: Rebuild.
1551 2011-07-12 Ian Lance Taylor <iant@google.com>
1554 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1555 GLOB_DAT relocation rather than a RELATIVE relocation for a
1556 protected symbol when creating a shared library.
1557 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1558 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1559 * testsuite/protected_main_1.cc (main): Test that protected
1560 function has same address.
1562 2011-07-11 Ian Lance Taylor <iant@google.com>
1565 * options.h (class General_options): Add -Bgroup.
1566 * options.cc (General_options::finalize): If -Bgroup is set,
1567 default to --unresolved-symbols=report-all.
1568 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1569 * target-reloc.h (issue_undefined_symbol_error): Handle
1570 --unresolved-symbols=report-all.
1572 2011-07-08 Ian Lance Taylor <iant@google.com>
1575 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1576 if linker script discards key sections.
1577 (Layout::create_dynamic_symtab): Likewise.
1578 (Layout::assign_local_dynsym_offsets): Likewise.
1579 (Layout::sized_create_version_sections): Likewise.
1580 (Layout::create_interp): Likewise.
1581 (Layout::finish_dynamic_section): Likewise.
1582 (Layout::set_dynamic_symbol_size): Likewise.
1584 2011-07-08 Ian Lance Taylor <iant@google.com>
1587 * options.h (class General_options): Add --unresolved-symbols.
1588 * target-reloc.h (issue_undefined_symbol_error): Check
1589 --unresolved-symbols. Add comments.
1591 2011-07-08 Ian Lance Taylor <iant@google.com>
1593 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1594 expression more complex.
1596 2011-07-08 Ian Lance Taylor <iant@google.com>
1599 * target-reloc.h (issue_undefined_symbol_error): New inline
1600 function, broken out of relocate_section.
1601 (relocate_section): Call issue_undefined_symbol_error.
1602 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1603 there is no TLS segment if we are about to issue an undefined
1605 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1607 2011-07-08 Ian Lance Taylor <iant@google.com>
1610 * resolve.cc (Symbol_table::should_override): Add fromtype
1611 parameter. Change all callers. Give error when linking together
1612 TLS and non-TLS symbol.
1613 (Symbol_table::should_override_with_special): Add fromtype
1614 parameter. Change all callers.
1615 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1616 there is no TLS segment if we have reported some errors.
1617 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1619 2011-07-08 Ian Lance Taylor <iant@google.com>
1622 * target.h (Target::plt_address_for_global): New function.
1623 (Target::plt_address_for_local): New function.
1624 (Target::plt_section_for_global): Remove.
1625 (Target::plt_section_for_local): Remove.
1626 (Target::do_plt_address_for_global): New virtual function.
1627 (Target::do_plt_address_for_local): New virtual function.
1628 (Target::do_plt_section_for_global): Remove.
1629 (Target::do_plt_section_for_local): Remove.
1630 (Target::register_global_plt_entry): Add Symbol_table and Layout
1632 * output.cc (Output_data_got::Got_entry::write): Use
1633 plt_address_for_global and plt_address_for_local.
1634 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1635 address of output section.
1636 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1637 got_irelative_, and irelative_count_ fields. Update
1639 (Output_data_plt_i386::has_irelative_section): New function.
1640 (Output_data_plt_i386::entry_count): Add irelative_count_.
1641 (Output_data_plt_i386::set_final_data_size): Likewise.
1642 (class Target_i386): Add got_irelative_ and rel_irelative_
1643 fields. Update declarations.
1644 (Target_i386::Target_i386): Initialize new fields.
1645 (Target_i386::do_plt_address_for_global): New function replacing
1646 do_plt_section_for_global.
1647 (Target_i386::do_plt_address_for_local): New function replacing
1648 do_plt_section_for_local.
1649 (Target_i386::got_section): Create got_irelative_.
1650 (Target_i386::rel_irelative_section): New function.
1651 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1652 fields. Don't define __rel_iplt_{start,end}.
1653 (Output_data_plt_i386::add_entry): Add symtab and layout
1654 parameters. Change all callers. Use different PLT and GOT for
1656 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1657 layout parameters. Change all callers. Use different PLT and
1659 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1660 (Output_data_plt_i386::rel_irelative): New function.
1661 (Output_data_plt_i386::address_for_global): New function.
1662 (Output_data_plt_i386::address_for_local): New function.
1663 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1664 IRELATIVE GOT when changing IFUNC GOT entries.
1665 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1667 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1668 if we didn't create an IRELATIVE GOT.
1669 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1670 plt_address_for_local.
1671 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1672 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1673 got_irelative_, and irelative_count_ fields. Update
1675 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1676 Initialize new fields. Remove symtab parameter. Change all
1678 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1680 (Output_data_plt_x86_64::has_irelative_section): New function.
1681 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1682 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1683 fields. Update declarations.
1684 (Target_x86_64::Target_x86_64): Initialize new fields.
1685 (Target_x86_64::do_plt_address_for_global): New function replacing
1686 do_plt_section_for_global.
1687 (Target_x86_64::do_plt_address_for_local): New function replacing
1688 do_plt_section_for_local.
1689 (Target_x86_64::got_section): Create got_irelative_.
1690 (Target_x86_64::rela_irelative_section): New function.
1691 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1692 all callers. Don't create __rel_iplt_{start,end}.
1693 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1694 parameters. Change all callers. Use different PLT and GOT for
1696 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1697 layout parameters. Change all callers. Use different PLT and
1699 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1700 parameters. Change all callers. Use different PLT and GOT for
1702 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1703 (Output_data_plt_x86_64::rela_irelative): New function.
1704 (Output_data_plt_x86_64::address_for_global): New function.
1705 (Output_data_plt_x86_64::address_for_local): New function.
1706 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1707 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1708 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1709 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1711 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1713 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1714 symbols if we didn't create an IRELATIVE GOT.
1715 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1716 plt_address_for_local.
1717 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1718 * testsuite/ifuncvar1.c: New test file.
1719 * testsuite/ifuncvar2.c: New test file.
1720 * testsuite/ifuncvar3.c: New test file.
1721 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1722 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1723 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1724 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1725 * testsuite/Makefile.in: Rebuild.
1727 2011-07-07 Cary Coutant <ccoutant@google.com>
1729 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1730 (two_file_test_1_ndebug.o): Likewise.
1731 (two_file_test_1b_ndebug.o): Likewise.
1732 (two_file_test_2_ndebug.o): Likewise.
1733 (two_file_test_main_ndebug.o): Likewise.
1734 (incremental_test_2): Link with no-debug versions.
1736 2011-07-06 Cary Coutant <ccoutant@google.com>
1738 * gold/incremental.cc
1739 (Output_section_incremental_inputs::write_info_blocks): Check for
1740 hidden and internal symbols.
1742 2011-07-06 Cary Coutant <ccoutant@google.com>
1744 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1745 Check disposition for startup file.
1746 (Incremental_inputs::report_command_line): Ignore
1747 --incremental-startup-unchanged option.
1748 * options.cc (General_options::parse_incremental_startup_unchanged):
1750 (General_options::General_options): Initialize new data member.
1751 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1752 (General_options): Add --incremental-startup-unchanged option.
1753 (General_options::incremental_startup_disposition): New function.
1754 (General_options::incremental_startup_disposition_): New data member.
1756 2011-07-06 Cary Coutant <ccoutant@google.com>
1758 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1759 input file index to Script_info ctor.
1760 (Sized_incremental_binary::do_file_has_changed): Find the
1761 command-line argument for files named in scripts.
1762 * incremental.h (Script_info::Script_info): New ctor
1763 with input file index.
1764 (Script_info::input_file_index): New function.
1765 (Script_info::input_file_index_): New data member.
1766 (Incremental_binary::get_library): Add const.
1767 (Incremental_binary::get_script_info): Add const.
1768 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1769 * testsuite/Makefile.am (incremental_test_5): New test case.
1770 (incremental_test_6): New test case.
1771 * testsuite/Makefile.in: Regenerate.
1773 2011-07-06 Cary Coutant <ccoutant@google.com>
1775 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1776 debug output when command lines differ.
1778 2011-07-06 Cary Coutant <ccoutant@google.com>
1780 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1781 --incremental-patch option.
1782 * layout.cc (Free_list::allocate): Extend allocation beyond original
1784 (Layout::make_output_section): Mark sections that should get
1786 * options.cc (parse_percent): New function.
1787 * options.h (parse_percent): New function.
1788 (DEFINE_percent): New macro.
1789 (General_options): Add --incremental-patch option.
1790 * output.cc (Output_section::Output_section): Initialize new data
1792 (Output_section::add_input_section): Print section name when out
1794 (Output_section::add_output_section_data): Likewise.
1795 (Output_section::set_final_data_size): Add patch space when
1796 doing --incremental-full.
1797 (Output_section::do_reset_address_and_file_offset): Remove patch
1799 (Output_segment::set_section_list_addresses): Print debug output
1800 only if --incremental-update.
1801 * output.h (Output_section::set_is_patch_space_allowed): New function.
1802 (Output_section::is_patch_space_allowed_): New data member.
1803 (Output_section::patch_space_): New data member.
1804 * parameters.cc (Parameters::incremental_full): New function.
1805 * parameters.h (Parameters::incremental_full): New function
1806 * testsuite/Makefile.am (incremental_test_2): Add test for
1807 --incremental-patch option.
1808 * testsuite/Makefile.in: Regenerate.
1809 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1810 (t18): Remove function body.
1812 2011-07-05 Doug Kwan <dougkwan@google.com>
1815 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1816 Arm_Address type for relocation result.
1817 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1819 (Arm_relocate_functions::abs32): Use unaligned access.
1820 (Arm_relocate_functions::rel32): Ditto.
1821 (Arm_relocate_functions::prel31): Ditto.
1822 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1823 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1824 static data relocations.
1825 * testsuite/Makefile.in: Regnerate.
1826 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1828 2011-07-05 Ian Lance Taylor <iant@google.com>
1831 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1832 symbols if necessary.
1833 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1835 2011-07-05 Ian Lance Taylor <iant@google.com>
1838 * resolve.cc (Symbol::override_base_with_special): Simply override
1839 version with special symbol version, ignoring previous version.
1841 2011-07-05 Ian Lance Taylor <iant@google.com>
1843 * object.cc (Sized_relobj_file::include_section_group): Add
1844 information to comment about signature location.
1846 2011-07-02 Ian Lance Taylor <iant@google.com>
1849 * options.h (class General_options): Add -f and -F.
1850 * options.cc (General_options::finalize): Fatal error if -f/-F
1851 are used without -shared.
1852 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1854 2011-07-02 Ian Lance Taylor <iant@google.com>
1856 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1858 2011-07-01 Ian Lance Taylor <iant@google.com>
1862 * resolve.cc (Symbol::override_base_with_special): Don't override
1863 the version if the overriding symbol has a different name.
1864 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1865 all callers. If we give an error about an undefined version,
1866 define the base version if necessary.
1867 * dynobj.h (class Versions): Update declaration.
1868 * testsuite/weak_alias_test_5.cc: New file.
1869 * testsuite/weak_alias_test.script: New file.
1870 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1871 and versioned_alias have the right value, and call t2.
1872 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1873 weak_alias_test_5.so.
1874 (weak_alias_test_LDADD): Likewise.
1875 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1876 * testsuite/Makefile.in: Rebuild.
1878 2011-07-01 Ian Lance Taylor <iant@google.com>
1881 * options.h (class General_options): Support -z notext.
1882 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1884 (two_file_shared_nonpic.so): Likewise.
1885 (two_file_shared_mixed.so): Likewise.
1886 (two_file_shared_mixed_1.so): Likewise.
1887 (weak_undef_lib_nonpic.so): Likewise.
1888 (alt/weak_undef_lib_nonpic.so): Likewise.
1889 (tls_test_shared_nonpic.so): Likewise.
1890 * testsuite/Makefile.in: Rebuild.
1892 2011-07-01 Ian Lance Taylor <iant@google.com>
1895 * configure.ac: Test whether static linking works, setting
1896 the automake conditional HAVE_STATIC.
1897 * testsuite/Makefile.am: Disable tests using -static if
1898 HAVE_STATIC is not true.
1899 * configure, testsuite/Makefile.in: Rebuild.
1901 2011-07-01 Ian Lance Taylor <iant@google.com>
1904 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1905 Assert if we see DW_EH_PE_indirect.
1906 * target.h (Target::ehframe_datarel_base): New function.
1907 (Target::do_ehframe_datarel_base): New target function.
1908 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1909 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1912 2011-07-01 Ian Lance Taylor <iant@google.com>
1915 * options.h (class General_options): Add
1916 --ld-generated-unwind-info.
1917 * ehframe.cc (Fde::write): Add address parameter. Change all
1918 callers. If associated with PLT, fill in address and size.
1919 (Cie::set_output_offset): Only add merge mapping if there is an
1921 (Cie::write): Add address parameter. Change all callers.
1922 (Eh_frame::add_ehframe_for_plt): New function.
1923 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1924 input_offset_ fields into union u_, with new plt field.
1925 (Fde::Fde): Adjust for new union field.
1926 (Fde::Fde) [Output_data version]: New constructor.
1927 (Fde::add_mapping): Only add merge mapping if there is an object.
1928 (class Cie): Update declarations.
1929 (class Eh_frame): Declare add_ehframe_for_plt.
1930 * layout.cc (Layout::layout_eh_frame): Break out code into
1931 make_eh_frame_section, and call it.
1932 (Layout::make_eh_frame_section): New function.
1933 (Layout::add_eh_frame_for_plt): New function.
1934 * layout.h (class Layout): Update declarations.
1935 * merge.cc (Merge_map::add_mapping): Add assertion.
1936 * i386.cc: Include "dwarf.h".
1937 (class Output_data_plt_i386): Make first_plt_entry,
1938 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1939 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1940 and plt_eh_frame_fde.
1941 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1942 boundary. Call add_eh_frame_for_plt if appropriate.
1943 * x86_64.cc: Include "dwarf.h".
1944 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1945 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1946 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1947 and plt_eh_frame_fde.
1948 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1951 2011-06-29 Ian Lance Taylor <iant@google.com>
1954 * object.cc (Sized_relobj_file::layout_section): Change shdr
1955 parameter to be const.
1956 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1958 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1959 appropriate. Call layout_eh_frame_section.
1960 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1962 * object.h (class Sized_relobj_file): Update declarations.
1964 2011-06-29 Ian Lance Taylor <iant@google.com>
1967 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1969 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1971 2011-06-29 Ian Lance Taylor <iant@google.com>
1974 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1976 * layout.cc (Layout::layout_eh_frame): Likewise.
1978 2011-06-29 Ian Lance Taylor <iant@google.com>
1981 * layout.cc (Layout::symtab_section_shndx): New function.
1982 * layout.h (class Layout): Declare symtab_section_shndx.
1983 * output.cc (Output_section::write_header): Call it.
1985 2011-06-29 Ian Lance Taylor <iant@google.com>
1988 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1989 symbols which are not used in a relocation.
1991 2011-06-28 Ian Lance Taylor <iant@google.com>
1994 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1995 script create indistinguishable segments.
1996 (Layout::set_segment_offsets): Use stable_sort when sorting
1997 segments. Pass this to Compare_segments constructor.
1998 * layout.h (class Layout): Make segment_precedes non-static.
1999 (class Compare_segments): Change from struct to class. Add
2000 layout_ field. Add constructor.
2001 * script-sections.cc
2002 (Script_sections::attach_sections_using_phdrs_clause): Rename
2003 local orphan to is_orphan. Don't report failure to put empty
2004 section in segment. On attachment failure, report name of
2005 section, and attach to first PT_LOAD segment.
2007 2011-06-28 Ian Lance Taylor <iant@google.com>
2010 * target-select.cc (Target_selector::Target_selector): Add
2011 emulation parameter. Change all callers.
2012 (select_target_by_bfd_name): Rename from select_target_by_name.
2014 (select_target_by_emulation): New function.
2015 (supported_emulation_names): New function.
2016 * target-select.h (class Target_selector): Add emulation_ field.
2017 Update declarations.
2018 (Target_selector::recognize_by_bfd_name): Rename from
2019 recognize_by_name. Change all callers.
2020 (Target_selector::supported_bfd_names): Rename from
2021 supported_names. Change all callers.
2022 (Target_selector::recognize_by_emulation): New function.
2023 (Target_selector::supported_emulations): New function.
2024 (Target_selector::emulation): New function.
2025 (Target_selector::do_recognize_by_bfd_name): Rename from
2026 do_recognize_by_name. Change all callers.
2027 (Target_selector::do_supported_bfd_names): Rename from
2028 do_supported_names. Change all callers.
2029 (Target_selector::do_recognize_by_emulation): New function.
2030 (Target_selector::do_supported_emulations): New function.
2031 (select_target_by_bfd_name): Change name in declaration.
2032 (select_target_by_emulation): Declare.
2033 (supported_emulation_names): Declare.
2034 * parameters.cc (parameters_force_valid_target): Try to find
2035 target based on emulation from -m option.
2036 * options.h (class General_options): Change doc string for -m.
2037 * options.cc (help): Print emulations.
2038 (General_options::parse_V): Likewise.
2039 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2040 Add emulation parameter. Change all callers.
2042 2011-06-28 Ian Lance Taylor <iant@google.com>
2044 * target.h (class Target): Add osabi_ field.
2045 (Target::osabi): New function.
2046 (Target::set_osabi): New function.
2047 (Target::Target): Initialize osabi_.
2048 (Target::do_adjust_elf_header): Make pure virtual.
2049 (Sized_target::do_adjust_elf_header): Declare.
2050 * target.cc (Sized_target::do_adjust_elf_header): New function.
2051 (class Sized_target): Instantiate all versions.
2052 * freebsd.h (class Target_freebsd): Remove.
2053 (Target_selector_freebsd::do_recognize): Call set_osabi on
2055 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2056 (Target_selector_freebsd::set_osabi): Remove.
2057 * i386.cc (class Target_i386): Inherit from Sized_target rather
2058 than Target_freebsd.
2059 * x86_64.cc (class Target_x86_64): Likewise.
2061 2011-06-28 Ian Lance Taylor <iant@google.com>
2063 * target.h (Target::can_check_for_function_pointers): Rewrite.
2065 (Target::can_icf_inline_merge_sections): Likewise.
2066 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2067 (Target::Target_info): Add can_icf_inline_merge_sections field.
2068 (Target::do_can_check_for_function_pointers): New virtual
2070 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2071 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2072 from can_check_for_function_pointers, move in file.
2073 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2074 section_may_have_icf_unsafe_poineters, move in file.
2075 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2076 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2077 Rename from can_check_for_function_pointers, move in file.
2078 (Target_i386::can_icf_inline_merge_sections): Remove.
2079 (Target_i386::i386_info): Initialize
2080 can_icf_inline_merge_sections.
2081 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2082 Initialize can_icf_inline_merge_sections.
2083 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2084 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2085 Rename from can_check_for_function_pointers, move in file.
2086 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2087 (Target_x86_64::x86_64_info): Initialize
2088 can_icf_inline_merge_sections.
2089 * testsuite/testfile.cc (Target_test::test_target_info):
2091 * icf.cc (get_section_contents): Correct formatting.
2093 2011-06-27 Ian Lance Taylor <iant@google.com>
2095 * symtab.cc (Symbol::versioned_name): New function.
2096 (Symbol_table::add_to_final_symtab): Use versioned_name when
2098 (Symbol_table::sized_write_symbol): Likewise.
2099 * symtab.h (class Symbol): Declare versioned_name.
2100 * stringpool.h (class Stringpool_template): Add variant of add
2101 which takes a std::basic_string.
2102 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2103 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2104 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2105 (ver_test_12.o): New target.
2106 * testsuite/Makefile.in: Rebuild.
2108 2011-06-27 Doug Kwan <dougkwan@google.com>
2110 * arm.cc (Arm_relocate_functions::thm_jump8,
2111 Arm_relocate_functions::thm_jump11): Use a wider signed
2112 type to compute offset.
2113 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2115 * testsuite/Makefile.in: Regenerate.
2116 * testsuite/arm_branch_in_range.sh: Check test results of
2117 arm_thm_jump11 and arm_thm_jump8.
2118 * testsuite/arm_thm_jump11.s: New test source file.
2119 * testsuite/arm_thm_jump11.t: New linker script.
2120 * testsuite/arm_thm_jump8.s: New test source file.
2121 * testsuite/arm_thm_jump8.t: New linker script.
2123 2011-06-24 Ian Lance Taylor <iant@google.com>
2125 * layout.cc: Include "object.h".
2126 (ctors_sections_in_init_array): New static variable.
2127 (Layout::is_ctors_in_init_array): New function.
2128 (Layout::layout): Add entry to ctors_sections_in_init_array if
2130 * layout.h (class Layout): Declare is_ctors_in_init_array.
2131 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2132 is_ctors_reverse_view is set.
2133 (Sized_relobj_file::write_sections): Add layout parameter. Change
2134 all callers. Set is_ctors_reverse_view field of View_size.
2135 (Sized_relobj_file::reverse_words): New function.
2136 * object.h (Sized_relobj_file::View_size): Add
2137 is_ctors_reverse_view field.
2138 (class Sized_relobj_file): Update declarations.
2139 * testsuite/initpri3.c: New test.
2140 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2142 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2143 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2144 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2145 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2146 * testsuite/Makefile.in: Rebuild.
2148 2011-06-24 Cary Coutant <ccoutant@google.com>
2150 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2151 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2152 (debug_msg_cdebug.err): New targets.
2153 * testsuite/Makefile.in: Regenerate.
2154 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2155 Fix checks for link with shared library.
2157 2011-06-24 Doug Kwan <dougkwan@google.com>
2159 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2160 skip empty text sections.
2161 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2163 2011-06-22 Ian Lance Taylor <iant@google.com>
2166 * options.h (class General_options): Add --ctors-in-init-array.
2167 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2168 friends as SHT_PROGBITS for merging sections.
2169 (Layout::layout): Remove special handling of .init_array and
2170 friends. Don't sort if doing relocatable link. Sort for .ctors
2171 and .dtors if ctors_in_init_array.
2172 (Layout::make_output_section): Force correct section types for
2173 .init_array and friends. Don't sort if doing relocatable link,
2174 Don't sort .ctors and .dtors if ctors_in_init_array.
2175 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2176 (Layout::output_section_name): Add relobj parameter. Change all
2177 callers. Handle .ctors. and .dtors. in code rather than table.
2178 Handle .ctors and .dtors if ctors_in_init_array.
2179 (Layout::match_file_name): New function, moved from output.cc.
2180 * layout.h (class Layout): Update declarations.
2181 * output.cc: Include "layout.h".
2182 (Input_section_sort_entry::get_priority): New function.
2183 (Input_section_sort_entry::match_file_name): Just call
2184 Layout::match_file_name.
2185 (Output_section::Input_section_sort_init_fini_compare::operator()):
2186 Handle .ctors and .dtors. Sort by explicit priority rather than
2188 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2189 * testsuite/initpri2.c: New test.
2190 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2191 (check_PROGRAMS): Add initpri2.
2192 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2193 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2194 * configure, testsuite/Makefile.in: Rebuild.
2196 2011-06-19 Ian Lance Taylor <iant@google.com>
2199 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2200 .interp section to a PT_INTERP segment even if we have seen a
2201 --dynamic-linker option. Don't do it if we have seen a PHDRS
2202 clause in a linker script.
2203 (Layout::finalize): Don't create a .interp section if we've
2204 already create a PT_INTERP segment.
2205 (Layout::create_interp): Always call choose_output_section (revert
2206 patch of 2011-06-17). Don't create PT_INTERP segment.
2207 * script-sections.cc
2208 (Script_sections::create_note_and_tls_segments): Add a .interp
2209 section to a PT_INTERP segment even if we have seen a
2210 --dynamic-linker option.
2212 2011-06-18 Ian Lance Taylor <iant@google.com>
2214 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2215 merely because a non-PT_LOAD segment has a dynamic reloc.
2217 2011-06-18 Ian Lance Taylor <iant@google.com>
2219 * layout.cc (Layout::finish_dynamic_section): Don't create
2220 DT_FLAGS entry if not needed.
2222 2011-06-18 Ian Lance Taylor <iant@google.com>
2225 * layout.cc (Layout::layout_eh_frame): Correct handling of
2226 writable .eh_frame section.
2228 2011-06-17 Ian Lance Taylor <iant@google.com>
2231 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2232 symbol is redefined with the exact same object and value.
2234 2011-06-17 Ian Lance Taylor <iant@google.com>
2237 * layout.h (class Layout): Add interp_segment_ field.
2238 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2239 (Layout::attach_allocated_section_to_segment): If making shared
2240 library, put .interp section in PT_INTERP segment.
2241 (Layout::finalize): Also call create_interp if -dynamic-linker
2243 (Layout::create_interp): Assert that there is no PT_INTERP
2244 segment. If not using a SECTIONS clause, use make_output_section.
2245 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2246 * script-sections.cc
2247 (Script_sections::create_note_and_tls_segments): If making shared
2248 library, put .interp section in PT_INTERP segment.
2250 2011-06-17 Ian Lance Taylor <iant@google.com>
2252 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2253 when making a shared library.
2255 2011-06-17 Ian Lance Taylor <iant@google.com>
2257 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2258 parameter. Change all callers. Don't issue warning about PC32
2259 against locally defined symbol.
2261 2011-06-16 Ian Lance Taylor <iant@google.com>
2263 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2264 occurs in same object.
2266 2011-06-14 Alan Modra <amodra@gmail.com>
2268 * po/POTFILES.in: Regenerate.
2270 2011-06-09 Ian Lance Taylor <iant@google.com>
2272 * script-sections.cc
2273 (Orphan_output_section::set_section_addresses): For a relocatable
2274 link set address to 0.
2276 2011-06-09 Cary Coutant <ccoutant@google.com>
2279 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2280 used with --compress-debug-sections.
2281 * gold/object.cc (Sized_relobj_file::do_layout): Report
2282 uncompressed size of compressed input sections.
2284 2011-06-08 Cary Coutant <ccoutant@google.com>
2287 * testsuite/two_file_test_2_v1.cc: Change initialization of
2288 v2 to keep it in .data.
2290 2011-06-07 Cary Coutant <ccoutant@google.com>
2292 * common.cc (Symbol_table::do_allocate_commons_list): Call
2294 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2295 (Errors::fallback): New function.
2296 (gold_fallback): New function.
2297 * errors.h (Errors::fallback): New function.
2298 * gold.cc (gold_exit): Change status parameter to enum; adjust
2300 (queue_initial_tasks): Call gold_fallback.
2301 * gold.h: Include cstdlib.
2302 (Exit_status): New enum type.
2303 (gold_exit): Change status parameter to enum.
2304 (gold_fallback): New function.
2305 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2306 (Layout::create_symtab_sections): Likewise.
2307 (Layout::create_shdrs): Likewise.
2308 * main.cc (main): Adjust call to gold_exit.
2309 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2310 (Output_data_got::add_got_entry_pair): Likewise.
2311 (Output_section::add_input_section): Likewise.
2312 (Output_section::add_output_section_data): Likewise.
2313 (Output_segment::set_section_list_addresses): Likewise.
2314 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2316 2011-06-07 Cary Coutant <ccoutant@google.com>
2318 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2319 for incremental links.
2320 * output.cc (Output_segment::set_section_list_addresses): Remove
2321 FIXME and test for TLS or BSS.
2323 2011-06-07 Cary Coutant <ccoutant@google.com>
2325 * testsuite/Makefile.am: Add incremental_copy_test,
2326 incremental_common_test_1.
2327 * testsuite/Makefile.in: Regenerate.
2328 * testsuite/common_test_1_v1.c: New source file.
2329 * testsuite/common_test_1_v2.c: New source file.
2330 * testsuite/copy_test_v1.cc: New source file.
2332 2011-06-07 Cary Coutant <ccoutant@google.com>
2334 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2335 update, allocate common from bss section's free list.
2336 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2337 linker-defined symbols.
2338 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2339 Skip GOT and PLT entries that are no longer referenced.
2340 (Output_section_incremental_inputs::write_info_blocks): Mark
2341 linker-defined symbols.
2342 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2343 * output.cc (Output_section::allocate): New function.
2344 * output.h (Output_section::allocate): New function.
2345 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2346 linker-defined symbols.
2347 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2348 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2349 (Symbol::init_base_output_data): Likewise.
2350 (Symbol::init_base_output_segment): Likewise.
2351 (Symbol::init_base_constant): Likewise.
2352 (Sized_symbol::init_output_data): Likewise.
2353 (Sized_symbol::init_output_segment): Likewise.
2354 (Sized_symbol::init_constant): Likewise.
2355 (Symbol_table::do_define_in_output_data): Likewise.
2356 (Symbol_table::do_define_in_output_segment): Likewise.
2357 (Symbol_table::do_define_as_constant): Likewise.
2358 * symtab.h (Symbol::is_predefined): New function.
2359 (Symbol::init_base_output_data): Add is_predefined parameter.
2360 (Symbol::init_base_output_segment): Likewise.
2361 (Symbol::init_base_constant): Likewise.
2362 (Symbol::is_predefined_): New data member.
2363 (Sized_symbol::init_output_data): Add is_predefined parameter.
2364 (Sized_symbol::init_output_segment): Likewise.
2365 (Sized_symbol::init_constant): Likewise.
2366 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2368 2011-06-07 Cary Coutant <ccoutant@google.com>
2370 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2371 instead of emit_copy_reloc.
2372 (Copy_relocs::emit_copy_reloc): Refactor.
2373 (Copy_relocs::make_copy_reloc): New function.
2374 (Copy_relocs::add_copy_reloc): Remove.
2375 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2377 (Copy_relocs::make_copy_reloc): New function.
2378 (Copy_relocs::add_copy_reloc): Remove.
2379 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2380 unchanged input files.
2381 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2382 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2383 Reserve BSS space for COPY relocations.
2384 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2385 (Output_section_incremental_inputs::write_info_blocks): Record
2386 whether a symbol is copied from a shared object.
2387 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2388 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2389 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2390 (Incremental_input_entry_reader::get_output_symbol_index): Add
2392 (Incremental_binary::emit_copy_relocs): New function.
2393 (Incremental_binary::do_emit_copy_relocs): New function.
2394 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2396 (Sized_incremental_binary::add_copy_reloc): New function.
2397 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2398 (Sized_incremental_binary::Copy_reloc): New struct.
2399 (Sized_incremental_binary::Copy_relocs): New typedef.
2400 (Sized_incremental_binary::copy_relocs_): New data member.
2401 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2402 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2403 * target.h (Sized_target::emit_copy_reloc): New function.
2404 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2406 2011-06-02 Cary Coutant <ccoutant@google.com>
2409 * gold/archive.cc (Archive::Archive): Initialize new data member.
2410 (Archive::include_all_members): Return if archive has already been
2412 * gold/archive.h (Archive::include_all_members_): New data member.
2414 2011-06-02 Nick Clifton <nickc@redhat.com>
2416 * dynobj.h: Fix spelling mistake in comment.
2417 * output.cc: Likewise.
2419 2011-05-31 Doug Kwan <dougkwan@google.com>
2423 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2424 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2425 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2426 redundant arm_exidx_test.so.
2427 * testsuite/Makefile.in: Regenerate.
2428 (check_SCRIPTS): Add pr12826.sh
2429 (check_DATA): Add pr12826.stdout
2430 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2431 * testsuite/pr12826.sh: New file.
2432 * testsuite/pr12826_1.s: Ditto.
2433 * testsuite/pr12826_1.s: Ditto.
2435 2011-05-30 Ian Lance Taylor <iant@google.com>
2437 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2440 2011-05-29 Ian Lance Taylor <iant@google.com>
2443 * testsuite/Makefile.am: Use different file name for two_file_test
2444 temporary file for each incremental test.
2445 * testsuite/Makefile.in: Rebuild.
2447 2011-05-29 Ian Lance Taylor <iant@google.com>
2449 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2450 binary input file is empty.
2452 2011-05-27 Ian Lance Taylor <iant@google.com>
2454 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2455 (ver_test_9.so): Likewise.
2456 * testsuite/Makefile.in: Rebuild.
2458 2011-05-26 Cary Coutant <ccoutant@google.com>
2460 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2461 * incremental.cc (Incremental_inputs::report_input_section): Fix
2462 comment, indentation.
2463 (Incremental_inputs::report_comdat_group): New function.
2464 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2465 of data for incremental input file entry.
2466 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2467 group count, COMDAT group signatures.
2468 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2469 an unchanged input file.
2470 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2471 Initialize new data member.
2472 (Incremental_object_entry::add_comdat_group): New function.
2473 (Incremental_object_entry::get_comdat_group_count): New function.
2474 (Incremental_object_entry::get_comdat_signature_key): New function.
2475 (Incremental_object_entry::groups_): New data member.
2476 (Incremental_inputs::report_comdat_group): New function.
2477 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2478 data for incremental input file entry.
2479 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2480 (Incremental_input_entry_reader::get_input_section): Adjust size of
2481 data for incremental input file entry.
2482 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2483 (Incremental_input_entry_reader::get_comdat_group_signature): New
2485 * object.cc (Sized_relobj::include_section_group): Report kept
2486 COMDAT groups for incremental links.
2488 2011-05-24 David Meyer <pdox@google.com>
2490 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2491 with name parameter. Add found_name parameter.
2492 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2493 * dirsearch.h (class Dirsearch): Update declaration.
2495 2011-05-24 Ian Lance Taylor <iant@google.com>
2497 * archive.cc (Library_base::should_include_member): Pull in object
2498 from archive if it defines the entry symbol.
2499 * parameters.cc (Parameters::entry): New function.
2500 * parameters.h (class Parameters): Declare entry.
2501 * output.h (class Output_file_header): Remove entry_ field.
2502 * output.cc (Output_file_header::Output_file_header): Remove entry
2503 parameter. Change all callers.
2504 (Output_file_header::entry): Use parameters->entry.
2505 * gold.cc (queue_middle_tasks): Likewise.
2506 * plugin.cc (Plugin_hook::run): Likewise.
2508 2011-05-24 Cary Coutant <ccoutant@google.com>
2510 * gold.cc (queue_initial_tasks): Pass incremental base filename
2511 to Output_file::open_base_file; don't print error message.
2512 * incremental-dump.cc (main): Adjust call to
2513 Output_file::open_for_modification.
2514 * incremental-dump.cc (main): Likewise.
2515 * incremental.cc (Incremental_inputs::report_command_line):
2516 Ignore --incremental-base option when comparing command lines.
2517 Ignore parameter when given as separate argument.
2518 * options.h (class General_options): Add --incremental-base.
2519 * output.cc (Output_file::Output_file):
2520 (Output_file::open_base_file): Add base_name and writable parameters;
2521 read base file into new file; print error message here.
2522 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2524 * output.h (Output_file::open_for_modification): Rename to...
2525 (Output_file::open_base_file): ...this; add base_name and
2526 writable parameters; adjust all callers.
2527 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2529 * testsuite/Makefile.am (incremental_test_4): Test
2531 * testsuite/Makefile.in: Regenerate.
2533 2011-05-24 Cary Coutant <ccoutant@google.com>
2535 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2537 * testsuite/Makefile.in: Regenerate.
2538 * testsuite/two_file_test_1_v1.cc: New test source file.
2539 * testsuite/two_file_test_1b_v1.cc: New test source file.
2540 * testsuite/two_file_test_2_v1.cc: New test source file.
2542 2011-05-24 Cary Coutant <ccoutant@google.com>
2544 * dynobj.h (Dynobj::do_dynobj): New function.
2545 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2546 flag and soname for shared objects.
2547 * incremental.cc (Incremental_inputs::report_object): Make
2548 either Incremental_object_entry or Incremental_dynobj_entry; add
2549 soname to string table.
2550 (Incremental_inputs::report_input_section): Add assertion.
2551 (Output_section_incremental_inputs::set_final_data_size): Adjust
2552 type of input file entry for shared libraries; adjust size of
2553 shared library info entry.
2554 (Output_section_incremental_inputs::write_input_files): Write
2555 as_needed flag for shared libraries.
2556 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2557 of input file entry for shared libraries; write soname.
2558 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2559 soname from incremental info.
2560 * incremental.h (enum Incremental_input_flags): Add
2561 INCREMENTAL_INPUT_AS_NEEDED.
2562 (Incremental_input_entry::Incremental_input_entry): Initialize new
2564 (Incremental_input_entry::set_as_needed): New function.
2565 (Incremental_input_entry::as_needed): New function.
2566 (Incremental_input_entry::do_dynobj_entry): New function.
2567 (Incremental_input_entry::as_needed_): New data member.
2568 (Incremental_object_entry::Incremental_object_entry): Don't check
2570 (Incremental_object_entry::do_type): Likewise.
2571 (class Incremental_dynobj_entry): New class.
2572 (Incremental_input_entry_reader::as_needed): New function.
2573 (Incremental_input_entry_reader::get_soname): New function.
2574 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2575 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2576 size of shared library info entry.
2577 * layout.cc (Layout::finish_dynamic_section): Don't test for
2578 incremental link when adding DT_NEEDED entries.
2579 * object.h (Object::Object): Initialize new data member.
2580 (Object::dynobj): New function.
2581 (Object::set_as_needed): New function.
2582 (Object::as_needed): New function.
2583 (Object::do_dynobj): New function.
2584 (Object::as_needed_): New data member.
2586 2011-05-24 Cary Coutant <ccoutant@google.com>
2588 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2589 info; adjust display of GOT entries.
2590 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2591 vector of input objects; remove file_status_.
2592 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2593 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2594 got_plt reader; call target hooks to reserve GOT entries.
2595 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2596 of input file info header and GOT info entry.
2597 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2599 (Got_plt_view_info::got_descriptor): Remove.
2600 (Got_plt_view_info::sym_index): New data member.
2601 (Got_plt_view_info::input_index): New data member.
2602 (Local_got_offset_visitor::visit): Write input file index.
2603 (Global_got_offset_visitor::visit): Write 0 for input file index.
2604 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2605 with sym_index and input_index.
2606 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2607 incremental info GOT entry; replace got_descriptor with input_index.
2608 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2609 map from input file index to object.
2610 (Sized_relobj_incr::do_layout): Replace direct data member reference
2611 with accessor function.
2612 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2613 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2614 Adjust size of input file info header.
2615 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2616 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2617 (Incremental_input_entry_reader::get_input_section): Adjust size of
2618 input file info header.
2619 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2620 of incremental info GOT entry.
2621 (Incremental_got_plt_reader::get_got_desc): Remove.
2622 (Incremental_got_plt_reader::get_got_symndx): New function.
2623 (Incremental_got_plt_reader::get_got_input_index): New function.
2624 (Sized_incremental_binary::Sized_incremental_binary): Remove
2625 file_status_; add input_objects_.
2626 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2627 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2628 (Sized_incremental_binary::file_is_unchanged): Remove.
2629 (Sized_incremental_binary::set_input_object): New function.
2630 (Sized_incremental_binary::input_object): New function.
2631 (Sized_incremental_binary::file_status_): Remove.
2632 (Sized_incremental_binary::input_objects_): New data member.
2633 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2635 (Sized_relobj_incr::invalid_address): Move to base class.
2636 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2638 (Sized_relobj_incr::do_output_section_offset): Likewise.
2639 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2640 (Sized_relobj_incr::section_offsets_): Likewise.
2641 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2643 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2644 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2645 with accessor function.
2646 (Sized_relobj_file::do_layout): Likewise.
2647 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2648 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2649 (Sized_relobj_file::compute_final_local_value): Replace refs to
2650 section_offsets_ with accessor function.
2651 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2652 * object.h (Relobj::Relobj): Initialize new data members.
2653 (Relobj::add_dyn_reloc): New function.
2654 (Relobj::first_dyn_reloc): New function.
2655 (Relobj::dyn_reloc_count): New function.
2656 (Relobj::first_dyn_reloc_): New data member.
2657 (Relobj::dyn_reloc_count_): New data member.
2658 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2660 (Sized_relobj::Address): New typedef.
2661 (Sized_relobj::invalid_address): Move here from child class.
2662 (Sized_relobj::Sized_relobj): Initialize new data members.
2663 (Sized_relobj::sized_relobj): New function.
2664 (Sized_relobj::is_output_section_offset_invalid): Move here from
2666 (Sized_relobj::get_output_section_offset): Likewise.
2667 (Sized_relobj::local_has_got_offset): Likewise.
2668 (Sized_relobj::local_got_offset): Likewise.
2669 (Sized_relobj::set_local_got_offset): Likewise.
2670 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2671 (Sized_relobj::clear_got_offsets): New function.
2672 (Sized_relobj::section_offsets): Move here from child class.
2673 (Sized_relobj::do_output_section_offset): Likewise.
2674 (Sized_relobj::do_set_section_offset): Likewise.
2675 (Sized_relobj::Local_got_offsets): Likewise.
2676 (Sized_relobj::local_got_offsets_): Likewise.
2677 (Sized_relobj::section_offsets_): Likewise.
2678 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2680 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2682 (Sized_relobj_file::sized_relobj): New function
2683 (Sized_relobj_file::local_has_got_offset): Move to base class.
2684 (Sized_relobj_file::local_got_offset): Likewise.
2685 (Sized_relobj_file::set_local_got_offset): Likewise.
2686 (Sized_relobj_file::get_output_section_offset): Likewise.
2687 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2688 (Sized_relobj_file::do_output_section_offset): Likewise.
2689 (Sized_relobj_file::do_set_section_offset): Likewise.
2690 (Sized_relobj_file::Local_got_offsets): Likewise.
2691 (Sized_relobj_file::local_got_offsets_): Likewise.
2692 (Sized_relobj_file::section_offsets_): Likewise.
2693 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2695 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2696 (Output_reloc::get_symbol_index): Likewise.
2697 (Output_reloc::local_section_offset): Likewise.
2698 (Output_reloc::get_address): Likewise.
2699 (Output_reloc::symbol_value): Likewise.
2700 (Output_data_got::reserve_slot): Move to class definition.
2701 (Output_data_got::reserve_local): New function.
2702 (Output_data_got::reserve_slot_for_global): Remove.
2703 (Output_data_got::reserve_global): New function.
2704 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2705 (all constructors, two instantiations).
2706 (Output_reloc::get_relobj): New function (two instantiations).
2707 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2708 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2709 (Output_data_reloc::add_global): Adjust type of relobj.
2710 (Output_data_reloc::add_global_relative): Likewise.
2711 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2712 (Output_data_reloc::add_local): Likewise.
2713 (Output_data_reloc::add_local_relative): Likewise.
2714 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2715 (Output_data_reloc::add_local_section): Likewise.
2716 (Output_data_reloc::add_output_section): Likewise.
2717 (Output_data_reloc::add_absolute): Likewise.
2718 (Output_data_reloc::add_target_specific): Likewise.
2719 (Output_data_got::reserve_slot): Move definition here.
2720 (Output_data_got::reserve_local): New function.
2721 (Output_data_got::reserve_global): New function.
2722 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2723 section_offsets_ with accessor function.
2724 (Sized_relobj_file::write_sections): Likewise.
2725 (Sized_relobj_file::do_relocate_sections): Likewise.
2726 * target.h (Sized_target::reserve_local_got_entry): New function.
2727 (Sized_target::reserve_global_got_entry): New function.
2728 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2729 (Target_x86_64::reserve_global_got_entry): New function.
2730 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2732 2011-05-23 Cary Coutant <ccoutant@google.com>
2734 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2735 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2736 bit when checking got_type.
2737 * incremental.cc (Sized_incremental_binary::setup_readers):
2738 Store symbol table and string table locations; initialize bit vector
2739 of file status flags.
2740 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2742 (Sized_incremental_binary::do_process_got_plt): New function.
2743 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2744 (Output_section_incremental_inputs::set_final_data_size): Record
2745 file index for each input file.
2746 (Output_section_incremental_inputs::write_got_plt): Store file index
2747 instead of input entry offset for each GOT entry.
2749 (Incremental_input_entry::Incremental_input_entry): Initialize new
2751 (Incremental_input_entry::set_offset): Store file index.
2752 (Incremental_input_entry::get_file_index): New function.
2753 (Incremental_input_entry::file_index_): New data member.
2754 (Incremental_binary::process_got_plt): New function.
2755 (Incremental_binary::do_process_got_plt): New function.
2756 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2758 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2759 (Sized_incremental_binary::set_file_is_unchanged): New function.
2760 (Sized_incremental_binary::file_is_unchanged): New function.
2761 (Sized_incremental_binary::do_process_got_plt): New function.
2762 (Sized_incremental_binary::file_status_): New data member.
2763 (Sized_incremental_binary::main_symtab_loc_): New data member.
2764 (Sized_incremental_binary::main_strtab_loc_): New data member.
2765 * output.cc (Output_data_got::Got_entry::write): Add case
2767 (Output_data_got::add_global): Call add_got_entry.
2768 (Output_data_got::add_global_plt): Likewise.
2769 (Output_data_got::add_global_with_rel): Likewise.
2770 (Output_data_got::add_global_with_rela): Likewise.
2771 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2772 (Output_data_got::add_global_pair_with_rela): Likewise.
2773 (Output_data_got::add_local): Call add_got_entry.
2774 (Output_data_got::add_local_plt): Likewise.
2775 (Output_data_got::add_local_with_rel): Likewise.
2776 (Output_data_got::add_local_with_rela): Likewise.
2777 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2778 (Output_data_got::add_local_pair_with_rela): Likewise.
2779 (Output_data_got::reserve_slot): New function.
2780 (Output_data_got::reserve_slot_for_global): New function.
2781 (Output_data_got::add_got_entry): New function.
2782 (Output_data_got::add_got_entry_pair): New function.
2783 (Output_section::add_output_section_data): Edit FIXME.
2785 (Output_section_data_build::Output_section_data_build): New
2786 constructor with size parameter.
2787 (Output_data_space::Output_data_space): Likewise.
2788 (Output_data_got::Output_data_got): Initialize new data member; new
2789 constructor with size parameter.
2790 (Output_data_got::add_constant): Call add_got_entry.
2791 (Output_data_got::reserve_slot): New function.
2792 (Output_data_got::reserve_slot_for_global): New function.
2793 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2794 (Output_data_got::add_got_entry): New function.
2795 (Output_data_got::add_got_entry_pair): New function.
2796 (Output_data_got::free_list_): New data member.
2797 * target.h (Sized_target::init_got_plt_for_update): New function.
2798 (Sized_target::register_global_plt_entry): New function.
2799 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2800 Initialize new data member; call init; add constructor with PLT count.
2801 (Output_data_plt_x86_64::init): New function.
2802 (Output_data_plt_x86_64::add_relocation): New function.
2803 (Output_data_plt_x86_64::reserve_slot): New function.
2804 (Output_data_plt_x86_64::free_list_): New data member.
2805 (Target_x86_64::init_got_plt_for_update): New function.
2806 (Target_x86_64::register_global_plt_entry): New function.
2807 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2808 incremental updates.
2809 (Output_data_plt_x86_64::add_relocation): New function.
2810 * testsuite/object_unittest.cc (Object_test): Set default options.
2812 2011-05-16 Ian Lance Taylor <iant@google.com>
2814 * options.h (class General_options): Make -i a synonym for -r.
2816 2011-05-16 Ian Lance Taylor <iant@google.com>
2818 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2820 2011-05-10 Cary Coutant <ccoutant@google.com>
2822 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2825 2011-05-06 Ian Lance Taylor <iant@google.com>
2827 * layout.cc (Layout::layout): If the output section flags change,
2828 update the ordering.
2830 2011-04-25 Cary Coutant <ccoutant@google.com>
2832 * incremental-dump.cc (dump_incremental_inputs): Print local
2833 symbol info for each input file.
2835 (Output_section_incremental_inputs::set_final_data_size): Add local
2836 symbol info to input file entries in incremental info.
2837 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2838 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2839 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2840 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2842 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2843 (Sized_incr_relobj::do_relocate): Write the local symbols.
2844 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2845 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2846 Adjust size of input file header.
2847 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2848 (Incremental_inputs_reader::get_local_symbol_count): New function.
2849 (Incremental_inputs_reader::get_input_section): Adjust size of input
2851 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2852 (Sized_incr_relobj::This): New typedef.
2853 (Sized_incr_relobj::sym_size): New const data member.
2854 (Sized_incr_relobj::Local_symbol): New struct.
2855 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2856 (Sized_incr_relobj::do_local_symbol_offset): New function.
2857 (Sized_incr_relobj::local_symbol_count_): New data member.
2858 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2859 (Sized_incr_relobj::local_symbol_index_): New data member.
2860 (Sized_incr_relobj::local_symbol_offset_): New data member.
2861 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2862 (Sized_incr_relobj::local_symbols_): New data member.
2863 * object.h (Relobj::output_local_symbol_count): New function.
2864 (Relobj::local_symbol_offset): New function.
2865 (Relobj::do_output_local_symbol_count): New function.
2866 (Relobj::do_local_symbol_offset): New function.
2867 (Sized_relobj::do_output_local_symbol_count): New function.
2868 (Sized_relobj::do_local_symbol_offset): New function.
2870 2011-04-22 Vladimir Simonov <sv@sw.ru>
2872 * descriptors.cc (set_close_on_exec): New function.
2873 (Descriptors::open): Use set_close_on_exec.
2874 * output.cc (S_ISLNK): Define if not defined.
2876 2011-04-22 Cary Coutant <ccoutant@google.com>
2878 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2880 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2881 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2882 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2884 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2885 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2886 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2888 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2890 (Incremental_binary::apply_incremental_relocs): New function.
2891 (Incremental_binary::do_apply_incremental_relocs): New function.
2892 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2894 (Sized_incremental_binary::add_global_symbol): New function.
2895 (Sized_incremental_binary::global_symbol): New function.
2896 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2897 (Sized_incremental_binary::symbol_map_): New data member.
2898 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2899 * target.h (Sized_target::apply_relocation): New function.
2900 * target-reloc.h (apply_relocation): New function.
2901 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2903 2011-04-22 Doug Kwan <dougkwan@google.com>
2905 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2906 flag of a SHT_ARM_EXIDX section.
2907 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2908 * testsuite/Makefile.in: Regenerate.
2909 * testsuite/arm_exidx_test.s: New file.
2910 * testsuite/arm_exidx_test.sh: Same.
2912 2011-04-20 Cary Coutant <ccoutant@google.com>
2915 * archive.h (Incremental_archive_entry::Archive_member):
2916 Initialize arg_serial_ (second constructor).
2918 2011-04-17 Ian Lance Taylor <iant@google.com>
2920 * object.cc (Relocate_info::location): Simplify location string.
2921 * errors.cc (Errors::error_at_location): Don't print program
2923 (Errors::warning_at_location): Likewise.
2924 (Errors::undefined_symbol): Likewise.
2925 * testsuite/debug_msg.sh: Update accordingly.
2927 2011-04-14 Cary Coutant <ccoutant@google.com>
2929 * gold/layout.cc (Layout::symtab_section_offset): New function.
2930 * gold/layout.h (Layout::symtab_section_offset): New function.
2931 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2933 2011-04-12 Ian Lance Taylor <iant@google.com>
2935 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2936 with MREMAP_MAYMOVE.
2937 * output.h (class Output_file): Add map_is_allocated_ field.
2938 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2939 not available, provide stubs. If mremap is not available, #define
2941 (MREMAP_MAYMOVE): Define if not defined.
2942 (Output_file::Output_file): Initialize map_is_allocated_.
2943 (Output_file::resize): Check map_is_allocated_.
2944 (Output_file::map_anonymous): If mmap fails, use malloc.
2945 (Output_file::unmap): Don't do anything for an anonymous map.
2946 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2947 is not available, provide stubs.
2948 (File_read::View::~View): Use free rather than delete[].
2949 (File_read::make_view): Use malloc rather than new[]. If mmap
2951 (File_read::find_or_make_view): Use malloc rather than new[].
2952 * gold.h: Remove HAVE_REMAP code.
2953 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2954 exists. Rename mremap to gold_mremap. If mmap is not available
2956 * configure, config.in: Rebuild.
2958 2011-04-11 Ian Lance Taylor <iant@google.com>
2960 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2961 initialize local variable v.
2963 2011-04-11 Cary Coutant <ccoutant@google.com>
2965 * archive.cc (Archive::include_member): Adjust call to
2967 (Add_archive_symbols::run): Track argument serial numbers.
2968 (Lib_group::include_member): Likewise.
2969 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2970 * archive.h (Incremental_archive_entry::Archive_member):
2971 Initialize arg_serial_.
2972 (Archive_member::arg_serial_): New data member.
2973 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2974 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2976 (Sized_dynobj::do_for_all_local_got_entries): New function.
2977 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2979 * fileread.cc (get_mtime): New function.
2980 * fileread.h (get_mtime): New function.
2981 * gold.cc (queue_initial_tasks): Check for incremental update.
2982 (process_incremental_input): New function.
2983 (queue_middle_tasks): Don't force valid target for incremental
2985 * incremental-dump.cc (find_input_containing_global): Adjust
2986 size of symbol info entry.
2987 (dump_incremental_inputs): Dump argument serial number and
2988 in_system_directory flag; bias shndx by 1; print symbol names
2989 when dumping per-file symbol lists; use new symbol info readers.
2991 (Output_section_incremental_inputs:update_data_size): New function.
2992 (Sized_incremental_binary::setup_readers): Setup input readers
2993 for each input file; build maps for files added from libraries
2995 (Sized_incremental_binary::check_input_args): New function.
2996 (Sized_incremental_binary::do_check_inputs): Build map of argument
2997 serial numbers to input arguments.
2998 (Sized_incremental_binary::do_file_has_changed): Rename
2999 do_file_is_unchanged to this; compare file modification times.
3000 (Sized_incremental_binary::do_init_layout): New function.
3001 (Sized_incremental_binary::do_reserve_layout): New function.
3002 (Sized_incremental_binary::do_get_input_reader): Remove.
3003 (Sized_incremental_binary::get_symtab_view): New function.
3004 (Incremental_checker::can_incrementally_link_output_file): Remove.
3005 (Incremental_inputs::report_command_line): Exclude --debug options.
3006 (Incremental_inputs::report_archive_begin): Add parameter; track
3007 argument serial numbers; don't put input file entry for archive
3008 before archive members.
3009 (Incremental_inputs::report_archive_end): Put input file entry
3010 for archive after archive members.
3011 (Incremental_inputs::report_object): Add parameter; track argument
3012 serial numbers and in_system_directory flag.
3013 (Incremental_inputs::report_script): Add parameter; track argument
3015 (Output_section_incremental_inputs::set_final_data_size): Adjust
3016 size of symbol info entry; check for forwarding symbols.
3017 (Output_section_incremental_inputs::write_input_files): Write
3018 in_system_directory flag and argument serial number.
3019 (Output_section_incremental_inputs::write_info_blocks): Map section
3020 indices between incremental info and original input file; store
3021 input section index for each symbol.
3022 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3023 change operator() to visit().
3024 (class Global_got_offset_visitor): Likewise.
3025 (class Global_symbol_visitor_got_plt):
3026 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3028 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3029 (Sized_incr_relobj::do_read_symbols): New function.
3030 (Sized_incr_relobj::do_layout): New function.
3031 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3032 (Sized_incr_relobj::do_add_symbols): New function.
3033 (Sized_incr_relobj::do_should_include_member): New function.
3034 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3035 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3036 (Sized_incr_relobj::do_section_size): New function.
3037 (Sized_incr_relobj::do_section_name): New function.
3038 (Sized_incr_relobj::do_section_contents): New function.
3039 (Sized_incr_relobj::do_section_flags): New function.
3040 (Sized_incr_relobj::do_section_entsize): New function.
3041 (Sized_incr_relobj::do_section_address): New function.
3042 (Sized_incr_relobj::do_section_type): New function.
3043 (Sized_incr_relobj::do_section_link): New function.
3044 (Sized_incr_relobj::do_section_info): New function.
3045 (Sized_incr_relobj::do_section_addralign): New function.
3046 (Sized_incr_relobj::do_initialize_xindex): New function.
3047 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3048 (Sized_incr_relobj::do_read_relocs): New function.
3049 (Sized_incr_relobj::do_gc_process_relocs): New function.
3050 (Sized_incr_relobj::do_scan_relocs): New function.
3051 (Sized_incr_relobj::do_count_local_symbols): New function.
3052 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3053 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3054 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3055 (Sized_incr_relobj::do_relocate): New function.
3056 (Sized_incr_relobj::do_set_section_offset): New function.
3057 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3058 (Sized_incr_dynobj::do_read_symbols): New function.
3059 (Sized_incr_dynobj::do_layout): New function.
3060 (Sized_incr_dynobj::do_add_symbols): New function.
3061 (Sized_incr_dynobj::do_should_include_member): New function.
3062 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3063 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3064 (Sized_incr_dynobj::do_section_size): New function.
3065 (Sized_incr_dynobj::do_section_name): New function.
3066 (Sized_incr_dynobj::do_section_contents): New function.
3067 (Sized_incr_dynobj::do_section_flags): New function.
3068 (Sized_incr_dynobj::do_section_entsize): New function.
3069 (Sized_incr_dynobj::do_section_address): New function.
3070 (Sized_incr_dynobj::do_section_type): New function.
3071 (Sized_incr_dynobj::do_section_link): New function.
3072 (Sized_incr_dynobj::do_section_info): New function.
3073 (Sized_incr_dynobj::do_section_addralign): New function.
3074 (Sized_incr_dynobj::do_initialize_xindex): New function.
3075 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3076 (make_sized_incremental_object): New function.
3077 (Incremental_library::copy_unused_symbols): New function.
3078 (Incremental_library::do_for_all_unused_symbols): New function.
3079 * incremental.h (enum Incremental_input_flags): New type.
3080 (class Incremental_checker): Remove.
3081 (Incremental_input_entry::Incremental_input_entry): Add argument
3083 (Incremental_input_entry::arg_serial): New function.
3084 (Incremental_input_entry::set_is_in_system_directory): New function.
3085 (Incremental_input_entry::is_in_system_directory): New function.
3086 (Incremental_input_entry::arg_serial_): New data member.
3087 (Incremental_input_entry::is_in_system_directory_): New data member.
3088 (class Script_info): Move here from script.h.
3089 (Script_info::Script_info): Add filename parameter.
3090 (Script_info::filename): New function.
3091 (Script_info::filename_): New data member.
3092 (Incremental_script_entry::Incremental_script_entry): Add argument
3094 (Incremental_object_entry::Incremental_object_entry): Likewise.
3095 (Incremental_object_entry::add_input_section): Build list of input
3096 sections with map to original shndx.
3097 (Incremental_object_entry::get_input_section_index): New function.
3098 (Incremental_object_entry::shndx_): New data member.
3099 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3100 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3101 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3103 (Incremental_inputs::report_archive_begin): Likewise.
3104 (Incremental_inputs::report_object): Likewise.
3105 (Incremental_inputs::report_script): Likewise.
3106 (class Incremental_global_symbol_reader): New class.
3107 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3108 and store flags and input file type.
3109 (Incremental_input_entry_reader::arg_serial): New function.
3110 (Incremental_input_entry_reader::type): Extract type from flags.
3111 (Incremental_input_entry_reader::is_in_system_directory): New function.
3112 (Incremental_input_entry_reader::get_input_section_count): Call
3113 accessor function for type.
3114 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3115 function for type; adjust size of global symbol entry.
3116 (Incremental_input_entry_reader::get_global_symbol_count): Call
3117 accessor function for type.
3118 (Incremental_input_entry_reader::get_object_count): Likewise.
3119 (Incremental_input_entry_reader::get_object_offset): Likewise.
3120 (Incremental_input_entry_reader::get_member_count): Likewise.
3121 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3122 (Incremental_input_entry_reader::get_member_offset): Likewise.
3123 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3124 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3125 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3126 (Incremental_input_entry_reader::get_global_symbol_reader): New
3128 (Incremental_input_entry_reader::get_output_symbol_index): New
3130 (Incremental_input_entry_reader::type_): Remove.
3131 (Incremental_input_entry_reader::flags_): New data member.
3132 (Incremental_inputs_reader::input_file_offset): New function.
3133 (Incremental_inputs_reader::input_file_index): New function.
3134 (Incremental_inputs_reader::input_file): Call input_file_offset.
3135 (Incremental_inputs_reader::input_file_at_offset): New function.
3136 (Incremental_relocs_reader::get_r_type): Reformat.
3137 (Incremental_relocs_reader::get_r_shndx): Reformat.
3138 (Incremental_relocs_reader::get_r_offset): Reformat.
3139 (Incremental_relocs_reader::data): New function.
3140 (Incremental_binary::Incremental_binary): Initialize new data members.
3141 (Incremental_binary::check_inputs): Add cmdline parameter.
3142 (Incremental_binary::file_is_unchanged): Remove.
3143 (Input_reader::arg_serial): New function.
3144 (Input_reader::get_unused_symbol_count): New function.
3145 (Input_reader::get_unused_symbol): New function.
3146 (Input_reader::do_arg_serial): New function.
3147 (Input_reader::do_get_unused_symbol_count): New function.
3148 (Input_reader::do_get_unused_symbol): New function.
3149 (Incremental_binary::input_file_count): New function.
3150 (Incremental_binary::get_input_reader): Change signature to use
3151 index instead of filename.
3152 (Incremental_binary::file_has_changed): New function.
3153 (Incremental_binary::get_input_argument): New function.
3154 (Incremental_binary::get_library): New function.
3155 (Incremental_binary::get_script_info): New function.
3156 (Incremental_binary::init_layout): New function.
3157 (Incremental_binary::reserve_layout): New function.
3158 (Incremental_binary::output_file): New function.
3159 (Incremental_binary::do_check_inputs): New function.
3160 (Incremental_binary::do_file_is_unchanged): Remove.
3161 (Incremental_binary::do_file_has_changed): New function.
3162 (Incremental_binary::do_init_layout): New function.
3163 (Incremental_binary::do_reserve_layout): New function.
3164 (Incremental_binary::do_input_file_count): New function.
3165 (Incremental_binary::do_get_input_reader): Change signature.
3166 (Incremental_binary::input_args_map_): New data member.
3167 (Incremental_binary::library_map_): New data member.
3168 (Incremental_binary::script_map_): New data member.
3169 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3171 (Sized_incremental_binary::output_section): New function.
3172 (Sized_incremental_binary::inputs_reader): Add const.
3173 (Sized_incremental_binary::symtab_reader): Add const.
3174 (Sized_incremental_binary::relocs_reader): Add const.
3175 (Sized_incremental_binary::got_plt_reader): Add const.
3176 (Sized_incremental_binary::get_symtab_view): New function.
3177 (Sized_incremental_binary::Inputs_reader): New typedef.
3178 (Sized_incremental_binary::Input_entry_reader): New typedef.
3179 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3180 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3181 (Sized_incremental_binary::do_file_has_changed): New function.
3182 (Sized_incremental_binary::do_init_layout): New function.
3183 (Sized_incremental_binary::do_reserve_layout): New function.
3184 (Sized_input_reader::Inputs_reader): Remove.
3185 (Sized_input_reader::Input_entry_reader): Remove.
3186 (Sized_input_reader::do_arg_serial): New function.
3187 (Sized_input_reader::do_get_unused_symbol_count): New function.
3188 (Sized_input_reader::do_get_unused_symbol): New function.
3189 (Sized_incremental_binary::do_input_file_count): New function.
3190 (Sized_incremental_binary::do_get_input_reader): Change signature;
3191 use index instead of filename.
3192 (Sized_incremental_binary::section_map_): New data member.
3193 (Sized_incremental_binary::input_entry_readers_): New data member.
3194 (class Sized_incr_relobj): New class.
3195 (class Sized_incr_dynobj): New class.
3196 (make_sized_incremental_object): New function.
3197 (class Incremental_library): New class.
3198 * layout.cc (Free_list::num_lists): New static data member.
3199 (Free_list::num_nodes): New static data member.
3200 (Free_list::num_removes): New static data member.
3201 (Free_list::num_remove_visits): New static data member.
3202 (Free_list::num_allocates): New static data member.
3203 (Free_list::num_allocate_visits): New static data member.
3204 (Free_list::init): New function.
3205 (Free_list::remove): New function.
3206 (Free_list::allocate): New function.
3207 (Free_list::dump): New function.
3208 (Free_list::print_stats): New function.
3209 (Layout_task_runner::run): Resize output file for incremental updates.
3210 (Layout::Layout): Initialize new data members.
3211 (Layout::set_incremental_base): New function.
3212 (Layout::init_fixed_output_section): New function.
3213 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3214 incremental updates.
3215 (Layout::create_gold_note): Do not create gold note section for
3216 incremental updates.
3217 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3218 for incremental updates.
3219 (Layout::set_section_offsets): For incremental updates, allocate space
3221 (Layout::create_symtab_sections): Layout with offsets relative to
3222 start of section; for incremental updates, allocate space from free
3224 (Layout::create_shdrs): For incremental updates, allocate space from
3226 (Layout::finish_dynamic_section): For incremental updates, do not
3227 check --as-needed (fixed in subsequent patch).
3228 * layout.h (class Free_list): New class.
3229 (Layout::set_incremental_base): New function.
3230 (Layout::incremental_base): New function.
3231 (Layout::init_fixed_output_section): New function.
3232 (Layout::allocate): New function.
3233 (Layout::incremental_base_): New data member.
3234 (Layout::free_list_): New data member.
3235 * main.cc (main): Print Free_list statistics.
3236 * object.cc (Relobj::finalize_incremental_relocs): Add
3237 clear_counts parameter; clear counts only when clear_counts is set.
3238 (Sized_relobj::Sized_relobj): Initialize new base class.
3239 (Sized_relobj::do_layout): Don't report special sections.
3240 (Sized_relobj::do_for_all_local_got_entries): New function.
3241 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3242 symtab_off to all symbol table offsets.
3243 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3244 * object.h (class Got_offset_list): Move to top of file.
3245 (Object::Object): Allow case where input_file == NULL.
3246 (Object::~Object): Likewise.
3247 (Object::input_file): Assert that input_file != NULL.
3248 (Object::lock): Allow case where input_file == NULL.
3249 (Object::unlock): Likewise.
3250 (Object::is_locked): Likewise.
3251 (Object::token): Likewise.
3252 (Object::release): Likewise.
3253 (Object::is_incremental): New function.
3254 (Object::get_mtime): New function.
3255 (Object::for_all_local_got_entries): New function.
3256 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3257 (Object::set_is_in_system_directory): New function.
3258 (Object::is_in_system_directory): New function.
3259 (Object::do_is_incremental): New function.
3260 (Object::do_get_mtime): New function.
3261 (Object::do_for_all_local_got_entries): New function.
3262 (Object::is_in_system_directory_): New data member.
3263 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3264 (class Sized_relobj_base): New class.
3265 (class Sized_relobj): Derive from Sized_relobj_base.
3266 (class Sized_relobj::Symbols): Redeclare from base class.
3267 (class Sized_relobj::local_got_offset_list): Remove.
3268 (class Sized_relobj::Output_sections): Redeclare from base class.
3269 (class Sized_relobj::do_for_all_local_got_entries): New function.
3270 (class Sized_relobj::write_local_symbols): Add offset parameter.
3271 (class Sized_relobj::local_symbol_offset_): Update comment.
3272 (class Sized_relobj::local_dynsym_offset_): Update comment.
3273 * options.cc (Input_arguments::add_file): Remove const.
3274 * options.h (Input_file_argument::Input_file_argument):
3275 Initialize arg_serial_ (all constructors).
3276 (Input_file_argument::set_arg_serial): New function.
3277 (Input_file_argument::arg_serial): New function.
3278 (Input_file_argument::arg_serial_): New data member.
3279 (Input_arguments::Input_arguments): Initialize file_count_.
3280 (Input_arguments::add_file): Remove const.
3281 (Input_arguments::number_of_input_files): New function.
3282 (Input_arguments::file_count_): New data member.
3283 (Command_line::number_of_input_files): Call
3284 Input_arguments::number_of_input_files.
3285 * output.cc (Output_segment_headers::Output_segment_headers):
3287 (Output_section::Input_section::current_data_size): New function.
3288 (Output_section::Output_section): Initialize new data members.
3289 (Output_section::add_input_section): Don't do merge sections for
3290 an incremental link; allocate space from free list for an
3292 (Output_section::add_output_section_data): Allocate space from
3293 free list for an incremental update.
3294 (Output_section::update_data_size): New function.
3295 (Output_section::set_fixed_layout): New function.
3296 (Output_section::reserve): New function.
3297 (Output_segment::set_section_addresses): Remove const.
3298 (Output_segment::set_section_list_addresses): Remove const; allocate
3299 space from free list for an incremental update.
3300 (Output_segment::set_offset): Adjust size of RELRO segment for an
3302 * output.h (Output_data::current_data_size): Move here from
3304 (Output_data::pre_finalize_data_size): New function.
3305 (Output_data::update_data_size): New function.
3306 (Output_section_headers::update_data_size): new function.
3307 (Output_section_data_build::current_data_size): Move to Output_data.
3308 (Output_data_strtab::update_data_size): New function.
3309 (Output_section::current_data_size): Move to Output_data.
3310 (Output_section::set_fixed_layout): New function.
3311 (Output_section::has_fixed_layout): New function.
3312 (Output_section::reserve): New function.
3313 (Output_section::update_data_size): New function.
3314 (Output_section::has_fixed_layout_): New data member.
3315 (Output_section::free_list_): New data member.
3316 (Output_segment::set_section_addresses): Remove const.
3317 (Output_segment::set_section_list_addresses): Remove const.
3318 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3320 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3322 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3323 parameter when calling Add_symbols constructor; store argument
3324 serial number for members of a lib group.
3325 (Add_symbols::locks): Allow case where token == NULL.
3326 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3327 (Read_member::~Read_member): New function.
3328 (Read_member::is_runnable): New function.
3329 (Read_member::locks): New function.
3330 (Read_member::run): New function.
3331 (Check_script::~Check_script): New function.
3332 (Check_script::is_runnable): New function.
3333 (Check_script::locks): New function.
3334 (Check_script::run): New function.
3335 (Check_library::~Check_library): New function.
3336 (Check_library::is_runnable): New function.
3337 (Check_library::locks): New function.
3338 (Check_library::run): New function.
3339 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3340 (Add_symbols::library_): New data member.
3341 (class Read_member): New class.
3342 (class Check_script): New class.
3343 (class Check_library): New class.
3344 * reloc.cc (Read_relocs::is_runnable): Allow case where
3346 (Read_relocs::locks): Likewise.
3347 (Scan_relocs::locks): Likewise.
3348 (Relocate_task::locks): Likewise.
3349 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3351 (Sized_relobj::incremental_relocs_scan): Fix comment.
3352 (Sized_relobj::do_relocate): Pass output file offset to
3353 write_local_symbols.
3354 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3355 from class declaration.
3356 * script.cc (read_input_script): Allocate Script_info; pass
3357 argument serial number to report_script.
3358 * script.h (class Script_info): Move to incremental.h.
3359 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3360 * symtab.h (Symbol_table::add_from_incrobj): New function.
3361 (Symbol_table::set_file_offset): New function.
3363 2011-04-05 Cary Coutant <ccoutant@google.com>
3365 * incremental-dump.cc (dump_incremental_inputs): Change signature
3366 to take a Sized_incremental_binary; change caller. Use readers
3367 in Sized_incremental_binary.
3369 (Sized_incremental_binary::find_incremental_inputs_sections):
3370 Rename do_find_incremental_inputs_sections to this.
3371 (Sized_incremental_binary::setup_readers): New function.
3372 (Sized_incremental_binary::do_check_inputs): Check
3373 has_incremental_info_ flag; move setup code to setup_readers;
3375 (Sized_incremental_binary::do_file_is_unchanged): New function.
3376 (Sized_incremental_binary::do_get_input_reader): New function.
3377 * incremental.h (class Incremental_binary): Move to end of file.
3378 (Incremental_binary::file_is_unchanged): New function.
3379 (Incremental_binary::do_file_is_unchanged): New function.
3380 (Incremental_binary::Input_reader): New class.
3381 (Incremental_binary::get_input_reader): New function.
3382 (class Sized_incremental_binary): Move to end of file.
3383 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3384 input section reader classes.
3385 (Sized_incremental_binary::has_incremental_info): New function.
3386 (Sized_incremental_binary::inputs_reader): New function.
3387 (Sized_incremental_binary::symtab_reader): New function.
3388 (Sized_incremental_binary::relocs_reader): New function.
3389 (Sized_incremental_binary::got_plt_reader): New function.
3390 (Sized_incremental_binary::do_file_is_unchanged): New function.
3391 (Sized_incremental_binary::Sized_input_reader): New class.
3392 (Sized_incremental_binary::get_input_reader): New function.
3393 (Sized_incremental_binary::find_incremental_inputs_sections):
3394 Rename do_find_incremental_inputs_sections to this.
3395 (Sized_incremental_binary::setup_readers): New function.
3396 (Sized_incremental_binary::has_incremental_info_): New data member.
3397 (Sized_incremental_binary::inputs_reader_): New data member.
3398 (Sized_incremental_binary::symtab_reader_): New data member.
3399 (Sized_incremental_binary::relocs_reader_): New data member.
3400 (Sized_incremental_binary::got_plt_reader_): New data member.
3401 (Sized_incremental_binary::current_input_file_): New data member.
3403 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3406 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3409 2011-03-30 Cary Coutant <ccoutant@google.com>
3411 * archive.cc (Archive::include_member): Adjust call to report_object.
3412 (Add_archive_symbols::run): Add script_info to call to
3413 report_archive_begin.
3414 (Lib_group::include_member): Adjust call to report_object.
3415 (Add_lib_group_symbols::run): Adjust call to report_object.
3416 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3417 blocks. Add object count for script input files.
3418 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3419 script_info parameter; change all callers.
3420 (Incremental_inputs::report_object): Add script_info parameter;
3422 (Incremental_inputs::report_script): Store backpointer to
3423 incremental info entry.
3424 (Output_section_incremental_inputs::set_final_data_size): Record
3425 additional information for scripts.
3426 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3427 * incremental.h (Incremental_script_entry::add_object): New function.
3428 (Incremental_script_entry::get_object_count): New function.
3429 (Incremental_script_entry::get_object): New function.
3430 (Incremental_script_entry::objects_): New data member; adjust
3432 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3433 (Incremental_inputs::report_object): Add script_info parameter.
3434 (Incremental_inputs_reader::get_object_count): New function.
3435 (Incremental_inputs_reader::get_object_offset): New function.
3436 * options.cc (Input_arguments::add_file): Return reference to
3438 * options.h (Input_argument::set_script_info): New function.
3439 (Input_argument::script_info): New function.
3440 (Input_argument::script_info_): New data member; adjust all
3442 (Input_file_group::add_file): Return reference to new input argument.
3443 (Input_file_lib::add_file): Likewise.
3444 (Input_arguments::add_file): Likewise.
3445 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3446 * script.cc (Parser_closure::Parser_closure): Add script_info
3447 parameter; adjust all callers.
3448 (Parser_closure::script_info): New function.
3449 (Parser_closure::script_info_): New data member.
3450 (read_input_script): Report scripts earlier to incremental info.
3451 (script_add_file): Set script_info in Input_argument.
3452 (script_add_library): Likewise.
3453 * script.h (Script_options::Script_info): Rewrite class.
3455 2011-03-29 Cary Coutant <ccoutant@google.com>
3457 * archive.cc (Library_base::should_include_member): Move
3458 method here from class Archive.
3459 (Archive::Archive): Initialize base class.
3460 (Archive::should_include_member): Move to base class.
3461 (Archive::do_for_all_unused_symbols): New function.
3462 (Add_archive_symbols::run): Remove redundant access to
3464 (Lib_group::Lib_group): Initialize base class.
3465 (Lib_group::do_filename): New function.
3466 (Lib_group::include_member): Pass pointer to Lib_group to
3468 (Lib_group::do_for_all_unused_symbols): New function.
3469 (Add_lib_group_symbols::run): Report archive information for
3471 * archive.h (class Library_base): New base class.
3472 (class Archive): Derive from Library_base.
3473 (Archive::filename): Move to base class.
3474 (Archive::set_incremental_info): Likewise.
3475 (Archive::incremental_info): Likewise.
3476 (Archive::Should_include): Likewise.
3477 (Archive::should_include_member): Likewise.
3478 (Archive::Armap_entry): Remove.
3479 (Archive::Unused_symbol_iterator): Remove.
3480 (Archive::unused_symbols_begin): Remove.
3481 (Archive::unused_symbols_end): Remove.
3482 (Archive::do_filename): New function.
3483 (Archive::do_get_mtime): New function.
3484 (Archive::do_for_all_unused_symbols): New function.
3485 (Archive::task_): Move to base class.
3486 (Archive::incremental_info_): Likewise.
3487 (class Lib_group): Derive from Library_base.
3488 (Lib_group::do_filename): New function.
3489 (Lib_group::do_get_mtime): New function.
3490 (Lib_group::do_for_all_unused_symbols): New function.
3491 (Lib_group::task_): Move to base class.
3492 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3494 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3496 * incremental.cc (Incremental_inputs::report_archive_begin):
3497 Use Library_base; call library's get_mtime; add incremental inputs
3498 entry before members.
3499 (class Unused_symbol_visitor): New class.
3500 (Incremental_inputs::report_archive_end): Use Library_base; use
3501 visitor class to record unused symbols; don't add incremental inputs
3502 entry after members.
3503 (Incremental_inputs::report_object): Use Library_base.
3505 (Incremental_archive_entry::Incremental_archive_entry): Remove
3506 unused Archive parameter.
3507 (Incremental_inputs::report_archive_begin): Use Library_base.
3508 (Incremental_inputs::report_archive_end): Likewise.
3509 (Incremental_inputs::report_object): Likewise.
3510 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3512 * object.h (Object::for_all_global_symbols): New function.
3513 (Object::do_for_all_global_symbols): New function.
3514 (Sized_relobj::do_for_all_global_symbols): New function.
3515 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3517 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3520 2011-03-27 Ian Lance Taylor <iant@google.com>
3522 * archive.cc (Archive::interpret_header): Return -1 if something
3523 goes wrong. Change callers accordingly.
3525 2011-03-25 Cary Coutant <ccoutant@google.com>
3527 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3528 * testsuite/Makefile.in: Regenerate.
3530 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3532 * plugin.cc (get_view): New.
3533 (Plugin::load): Pass get_view to the plugin.
3534 (Plugin_manager::get_view): New.
3536 2011-03-21 Ian Lance Taylor <iant@google.com>
3538 * testsuite/final_layout.sh: Rewrite to not use dc.
3539 * testsuite/relro_test.sh: Fail if dc is not present.
3541 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3543 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3545 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3546 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3548 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3549 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3551 2011-03-14 Ian Lance Taylor <iant@google.com>
3553 * script-sections.cc (Sort_output_sections::script_compare):
3554 Rename from is_before, change return type.
3555 (Sort_output_sections::operator()): Adjust accordingly.
3557 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3560 * testsuite/odr_violation2.cc: Add comment to make all error line
3561 numbers double digits.
3562 * testsuite/debug_msg.sh: Adjust expected errors.
3564 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3566 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3567 but mark earlier ones as non-canonical
3568 (offset_to_iterator): Update search target and example
3569 (do_addr2line): Return extra lines in a vector*
3570 (format_file_lineno): Extract from do_addr2line
3571 (one_addr2line): Add vector* out-param
3572 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3573 when a lineno entry appeared last for its instruction
3574 (Dwarf_line_info): Add vector* out-param
3575 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3576 * symtab.cc (Odr_violation_compare): Include the lineno in the
3578 (linenos_from_loc): New. Combine the canonical line for an
3579 address with its other lines.
3580 (True_if_intersect): New. Helper functor to make
3581 std::set_intersection a query.
3582 (detect_odr_violations): Compare sets of lines instead of just
3583 one line for each function. This became less deterministic, but
3584 has fewer false positives.
3585 * symtab.h: Declarations.
3586 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3587 mix an optimized and non-optimized object in the same binary
3588 (odr_violation2.so): Same.
3589 * testsuite/Makefile.in: Regenerate from Makefile.am.
3590 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3591 * testsuite/debug_msg.sh: Update line numbers and add
3593 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3594 non-optimized context.
3595 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3596 isn't inlined, and use OdrDerived in an optimized context.
3597 * testsuite/odr_header1.h: Defines OdrDerived, where
3598 optimization will change the
3599 first-instruction-in-the-destructor's file and line number.
3600 * testsuite/odr_header2.h: Defines OdrBase.
3602 2011-03-09 Ian Lance Taylor <iant@google.com>
3604 * fileread.cc (File_read::clear_views): Don't delete the whole
3607 2011-03-08 Ian Lance Taylor <iant@google.com>
3610 * fileread.cc: #include <climits>.
3611 (GOLD_IOV_MAX): Define.
3612 (File_read::read_multiple): Limit number of entries by iov_max.
3613 * fileread.h (class File_read): Always set max_readv_entries to
3616 2011-03-07 Ian Lance Taylor <iant@google.com>
3619 * options.h (class General_options): Add -dy and -dn.
3621 2011-03-02 Cary Coutant <ccoutant@google.com>
3623 * testsuite/script_test_9.t: Add TLS segment.
3625 2011-03-02 Simon Baldwin <simonb@google.com>
3627 * configure.ac: Add check for gnu_indirect_function support in
3628 the toolchain building binutils.
3629 * configure: Rebuild.
3631 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3633 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3634 plugin only symbols.
3635 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3636 in plugin files as not needed in the symbol table.
3638 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3640 * output.cc (Output_section::add_input_section): Delay fill
3641 generation for section ordering.
3643 2011-02-09 Ian Lance Taylor <iant@google.com>
3646 * object.h (class Sized_relobj): Remove clear_local_symbols.
3647 * reloc.cc (Sized_relobj::do_relocate): Don't call
3648 clear_local_symbols.
3650 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3652 * plugin.cc (is_visible_from_outside): Return true for symbols
3655 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3657 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3660 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3662 * icf.h (is_section_foldable_candidate): Change type of parameter
3664 * icf.cc (Icf::find_identical_sections): Change type of local variable
3665 section_name to be std::string.
3666 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3668 2011-01-25 Ian Lance Taylor <iant@google.com>
3670 * script.cc (script_add_extern): Rewrite to use
3671 add_symbol_reference.
3673 2011-01-25 Doug Kwan <dougkwan@google.com>
3675 * icf.cc (get_section_contents): Always lock section's object.
3677 2011-01-24 Ian Lance Taylor <iant@google.com>
3679 * options.h (class General_options): Accept
3680 --no-detect-odr-violations.
3682 2011-01-24 Ian Lance Taylor <iant@google.com>
3684 * version.cc (version_string): Bump to 1.11.
3686 2011-01-24 Ian Lance Taylor <iant@google.com>
3688 * plugin.cc (class Plugin_rescan): Define new class.
3689 (Plugin_manager::claim_file): Set any_claimed_.
3690 (Plugin_manager::save_archive): New function.
3691 (Plugin_manager::save_input_group): New function.
3692 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3694 (Plugin_manager::new_undefined_symbol): New function.
3695 (Plugin_manager::rescan): New function.
3696 (Plugin_manager::rescannable_defines): New function.
3697 (Plugin_manager::add_input_file): Set any_added_.
3698 * plugin.h (class Plugin_manager): define new fields rescannable_,
3699 undefined_symbols_, any_claimed_, and any_added_. Declare
3700 Plugin_rescan as friend. Declare new functions.
3701 (Plugin_manager::Rescannable): Define type.
3702 (Plugin_manager::Rescannable_list): Define type.
3703 (Plugin_manager::Undefined_symbol_list): Define type.
3704 (Plugin_manager::Plugin_manager): Initialize new fields.
3705 * archive.cc (Archive::defines_symbol): New function.
3706 (Add_archive_symbols::run): Pass archive to plugins if any.
3707 * archive.h (class Archive): Declare defines_symbol.
3708 * readsyms.cc (Input_group::~Input_group): New function.
3709 (Finish_group::run): Pass input_group to plugins if any.
3710 * readsyms.h (class Input_group): Declare destructor.
3711 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3714 2011-01-10 Ian Lance Taylor <iant@google.com>
3716 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3718 (Layout::set_segment_offsets): Reset increase_relro before calling
3719 set_section_addresses a second time.
3721 2011-01-04 Cary Coutant <ccoutant@google.com>
3723 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3724 sections before NOBITS sections.
3726 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3728 * version.cc (print_version): Update copyright to 2011.
3730 2010-12-23 Cary Coutant <ccoutant@google.com>
3732 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3733 of OS to this->add. Add OD parameter to second form of the function.
3735 2010-12-20 Ian Lance Taylor <iant@google.com>
3737 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3738 second of two consecutive entries with same offset.
3740 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3742 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3743 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3744 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3745 to avoid unneeded links against $(LDADD).
3746 * testsuite/Makefile.in: Regenerate.
3748 2010-12-15 Ian Lance Taylor <iant@google.com>
3751 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3752 for R_X86_64_32 and R_X86_64_PC32.
3753 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3754 ver_matching_def_pic.o.
3755 (ver_matching_def_pic.o): New target.
3757 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3759 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3760 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3761 Move definition before File_read::View member definitions.
3762 (File_read::View::~View): Initialize and hold lock before
3763 updating current_mapped_bytes.
3765 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3767 * dwarf_reader.cc: Remove outdated comment.
3768 * gold-threads.cc: Fix typo in error message.
3769 * archive.cc: Fix typos in comments.
3770 * archive.h: Likewise.
3771 * arm-reloc-property.cc: Likewise.
3772 * arm-reloc-property.h: Likewise.
3773 * arm-reloc.def: Likewise.
3775 * attributes.h: Likewise.
3776 * cref.cc: Likewise.
3777 * ehframe.cc: Likewise.
3778 * fileread.h: Likewise.
3780 * i386.cc: Likewise.
3782 * incremental.h: Likewise.
3783 * int_encoding.cc: Likewise.
3784 * layout.h: Likewise.
3785 * main.cc: Likewise.
3786 * merge.h: Likewise.
3787 * object.cc: Likewise.
3788 * object.h: Likewise.
3789 * options.cc: Likewise.
3790 * readsyms.cc: Likewise.
3791 * reduced_debug_output.cc: Likewise.
3792 * reloc.cc: Likewise.
3793 * script-sections.cc: Likewise.
3794 * sparc.cc: Likewise.
3795 * symtab.h: Likewise.
3796 * target-reloc.h: Likewise.
3797 * target.cc: Likewise.
3798 * target.h: Likewise.
3799 * timer.cc: Likewise.
3800 * timer.h: Likewise.
3801 * x86_64.cc: Likewise.
3803 2010-12-09 Cary Coutant <ccoutant@google.com>
3805 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3807 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3808 parameter; change all callers.
3809 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3810 * options.h (warn_execstack): New option.
3812 2010-12-07 Doug Kwan <dougkwan@google.com>
3814 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3815 like function call relocations.
3817 2010-12-07 Ian Lance Taylor <iant@google.com>
3819 * archive.cc (Archive::get_elf_object_for_member): Permit
3820 punconfigured to be NULL.
3821 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3822 (Archive::include_member): Pass NULL to get_elf_object_for_member
3823 if we searched for the archive and this is the first included
3826 2010-12-01 Ian Lance Taylor <iant@google.com>
3828 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3829 track_relocs_type_ field.
3830 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3831 Set track_relocs_type_.
3832 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3833 contents when using RELA relocs.
3834 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3836 * reloc.cc (Track_relocs::next_addend): New function.
3837 * reloc.h (class Track_relocs): Declare next_addend.
3839 2010-12-01 Ian Lance Taylor <iant@google.com>
3841 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3844 2010-12-01 Ian Lance Taylor <iant@google.com>
3846 * README: Update compilers known to work and fail.
3848 2010-11-23 Matthias Klose <doko@ubuntu.com>
3850 * configure.in: For --enable-gold, handle value `default' instead of
3851 `both*'. Always install ld as ld.bfd, install as ld if gold is
3853 * configure: Regenerate.
3855 2010-11-18 Doug Kwan <dougkwan@google.com>
3857 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3858 and right_alignment to be zero. Store result alignment only if it is
3859 greater than existing alignment.
3861 2010-11-16 Cary Coutant <ccoutant@google.com>
3864 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3865 Check for ".zdebug_line".
3867 2010-11-16 Doug Kwan <dougkwan@google.com>
3868 Cary Coutant <ccoutant@google.com>
3870 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3871 by reference; adjust all callers.
3872 * output.cc (Output_segment::set_section_addresses): Adjust references
3873 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3875 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3876 end at page boundary.
3878 2010-11-16 Cary Coutant <ccoutant@google.com>
3881 * layout.cc (Layout::choose_output_section): Transform names of
3882 compressed sections even when using a script with a SECTIONS clause.
3883 (Layout::output_section_name): Remove code to transform
3884 compressed debug section names.
3885 * output.cc (Output_section::add_input_section): Use uncompressed
3886 section size when tracking input sections.
3888 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3890 * symtab.h (Symbol::NON_PIC_REF): Remove.
3891 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3892 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3893 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3894 (Symbol::use_plt_offset): Take a flags argument and pass it
3895 directly to needs_dynamic_reloc. Restrict check for undefined
3896 weak symbols to function calls.
3897 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3898 (Target_arm::Scan::global): Use it.
3899 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3900 (Target_arm::Relocate::relocate): Likewise.
3901 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3902 parameter with an r_type parameter. Use get_reference_flags
3904 (Target_arm::Relocate::relocate): Update accordingly.
3905 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3906 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3907 (Target_i386::Scan::global): Likewise.
3908 (Target_i386::Relocate::relocate): Likewise.
3909 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3910 parameter with an r_type parameter. Use get_reference_flags
3912 (Target_i386::Relocate::relocate): Update accordingly.
3913 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3914 (Target_powerpc::Scan::global): Use it.
3915 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3916 (Target_powerpc::Relocate::relocate): Likewise.
3917 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3918 (Target_sparc::Scan::global): Use it.
3919 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3920 (Target_sparc::Relocate::relocate): Likewise.
3921 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3922 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3923 (Target_x86_64::Scan::global): Likewise.
3924 (Target_x86_64::Relocate::relocate): Likewise.
3926 2010-11-08 Doug Kwan <dougkwan@google.com>
3927 Cary Coutant <ccoutant@google.com>
3929 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3930 (Arm_exidx_merge_section::section_contents_): New data member.
3931 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3932 (Arm_input_section::~Arm_input_section): De-allocate memory.
3933 (Arm_input_section::original_contents_): New data member.
3934 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3935 in parameters instead of calling Object::section_contents without
3937 (Arm_output_section::group_section): New parameter TASK. Pass it
3938 to callees that need locking objects.
3939 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3940 to lock EXIDX input sections. Fix a formatting issue. Call
3941 Arm_exidx_merged_section::build_contents to create merged section
3943 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3944 to lock object of stub table owner.
3945 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3946 TEXT_SIZE to initialize data member TEXT_SIZE_.
3947 (Arm_exidx_input_section::addralign): Fix typo in comment.
3948 (Arm_exidx_input_section::text_size): New method.
3949 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3950 that require locking objects. Lock objects before scanning for stubs
3951 and updating local symbols.
3952 (Arm_input_section<big_endian>::init): Copy contents of original
3954 (Arm_input_section<big_endian>::do_write): Use saved contents of
3955 original input section instead of calling Object::section_contents
3957 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3958 size without calling Object::section_size().
3959 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3960 for size. Allocate a buffer for merged EXIDX entries.
3961 (Arm_exidx_merged_section::build_contents): New method.
3962 (Arm_exidx_merged_section::do_write): Move merge section contents
3963 building code to Arm_exidx_merged_section::build_contetns. Write
3964 out contetns in buffer instead of building it on the fly.
3965 (Arm_relobj::make_exidx_input_section): Also pass text section size
3966 to Arm_exidx_input_section constructor.
3967 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3968 (Arm_dynobj::do_read_symbols): Fix memory leak.
3969 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3970 * target.h: (class Task): Add forward declaration.
3971 (Target::relax): Add new parameter TASK and pass it to
3973 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3975 2010-11-05 Cary Coutant <ccoutant@google.com>
3978 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3979 object when reading from the file.
3980 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3982 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3983 when reading section contents.
3984 (get_section_contents): Likewise.
3985 (icf::find_identical_sections): Likewise.
3986 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3987 object when reading from the file.
3988 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3989 the object when doing deferred section layout.
3991 2010-11-03 Nick Clifton <nickc@redhat.com>
3994 * script.h (class Symbol_assignment: name): New member. Returns
3995 the name of the symbol.
3996 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3997 Returns true if the given symbol name is on the list of
3998 assignments wating to be processed.
3999 * archive.cc (should_incldue_member): If the symbol is undefined,
4000 check to see if it is on the list of symbols pending assignment.
4002 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4004 * script-sections.cc (Script_sections::find_memory_region): Check
4005 for a NULL output section pointer.
4007 2010-10-29 Doug Kwan <dougkwan@google.com>
4009 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4010 Output_section::add_relaxed_input_section.
4011 * output.cc (Output_section::add_relaxed_input_section): Add new
4012 arguments LAYOUT and NAME. Set section order index.
4013 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4014 Copy section order index.
4015 * output.h (Output_section::add_relaxed_input_section): Add new
4016 arguments LAYOUT and NAME.
4018 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4020 * testsuite/Makefile.am: Move gcctestdir/ld rule to
4021 NATIVE_OR_CROSS_LINKER.
4022 * testsuite/Makefile.in: Regenerate.
4024 2010-10-20 Doug Kwan <dougkwan@google.com>
4026 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4027 without SHF_LINK_ORDER flags.
4028 * layout.cc (Layout::choose_output_section): Do not filter
4029 SHF_LINK_ORDER flag in a relocatable link.
4031 2010-10-17 Cary Coutant <ccoutant@google.com>
4033 * output.h (Output_segment::set_section_addresses): Change function
4034 signature. Update all callers.
4035 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4037 (Output_segment::set_section_addresses): Align after last TLS
4038 section. Add padding before last relro section instead of after.
4040 2010-10-17 Doug Kwan <dougkwan@google.com>
4042 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4043 GOT output section to be writable.
4045 2010-10-14 Cary Coutant <ccoutant@google.com>
4047 * debug.h (DEBUG_INCREMENTAL): New flag.
4048 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4049 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4051 * incremental.cc (report_command_line): Ignore all forms of
4053 * layout.cc (Layout::Layout): Check parameters for incremental link
4055 * options.cc (General_options::parse_incremental): New function.
4056 (General_options::parse_no_incremental): New function.
4057 (General_options::parse_incremental_full): New function.
4058 (General_options::parse_incremental_update): New function.
4059 (General_options::incremental_mode_): New data member.
4060 (General_options::finalize): Check incremental_mode_.
4061 * options.h (General_options): Update help text for --incremental.
4062 Add --no-incremental, --incremental-full, --incremental-update.
4063 (General_options::Incremental_mode): New enum type.
4064 (General_options::incremental_mode): New function.
4065 (General_options::incremental_mode_): New data member.
4066 * parameters.cc (Parameters::incremental_mode_): New data member.
4067 (Parameters::set_options): Set incremental_mode_.
4068 (Parameters::set_incremental_full): New function.
4069 (Parameters::incremental): New function.
4070 (Parameters::incremental_update): New function.
4071 (set_parameters_incremental_full): New function.
4072 * parameters.h (Parameters::set_incremental_full): New function.
4073 (Parameters::incremental): New function.
4074 (Parameters::incremental_update): New function.
4075 (Parameters::incremental_mode_): New data member.
4076 (set_parameters_incremental_full): New function.
4077 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4078 incremental link mode.
4079 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4080 (Sized_relobj::do_relocate_sections): Likewise.
4081 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4083 * testsuite/Makefile.in: Regenerate.
4084 * testsuite/incremental_test.sh: Filter all forms of --incremental.
4086 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4088 * script-sections.h (class Script_sections): Make
4089 Sections_elements typedef public.
4090 * script-sections.cc (class Sort_output_sections): Add elements_
4091 field. Add constructor which sets it; change all callers.
4092 (Sort_output_sections::is_before): New function.
4093 (Sort_output_sections::operator()): Call is_before.
4094 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4096 * testsuite/script_test_10.sh: New test. Test script section
4098 * testsuite/script_test_10.t: Likewise.
4099 * testsuite/script_test_10.s: Likewise.
4100 * testsuite/Makefile.am: Wrap the cross linker tests and the
4101 common tests into NATIVE_OR_CROSS_LINKER.
4102 (check_SCRIPTS): Add script_test_10.sh.
4103 (check_DATA): Add script_test_10.stdout.
4104 (script_test_10.o, script_test_10): New targets.
4105 (script_test_10.stdout): New target.
4106 * configure, testsuite/Makefile.in: Regenerate.
4108 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4110 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4111 error for the deprecated relocations.
4112 (Target_arm::Scan::global): Likewise.
4113 (Target_arm::Relocate::relocate): Likewise.
4115 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4117 * fileread.cc (Input_file::find_file): Initialize *found_name
4118 and *namep when using the fallback search for case 4.
4120 2010-10-11 Cary Coutant <ccoutant@google.com>
4122 * options.h (class General_options): Redefine -z lazy as an alias for
4123 the negation of -z now.
4125 2010-10-11 Ian Lance Taylor <iant@google.com>
4127 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4130 2010-10-06 Nick Clifton <nickc@redhat.com>
4132 * script-sections.cc(class Memory_region): Remove
4133 current_lma_offset_ field. Rename current_vma_offset_ to
4134 current_offset_. Add last_section_ field.
4135 (Memory_region::get_current_vma_address): Rename to
4136 get_current_address.
4137 (Memory_region::get_current_lma_address): Delete.
4138 (Memory_region::increment_vma_offset): Rename to
4140 (Memory_region::increment_lma_offset): Delete.
4141 (Memory_region::attributes_compatible): New method. Returns
4142 true if the provided section is compatible with the region.
4143 (Memory_region::get_last_section): New method. Returns the last
4144 section to use the region.
4145 (Memory_region::set_last_section): New method. Stores the last
4146 section to use the region.
4147 (Script_sections::block_in_region): New method. Returns true if
4148 a block of memory is contained within a region.
4149 (Script_sections::find_memory_region): New method. Locates a
4150 memory region to be used to set a VMA or LMA address.
4151 (Output_section_definition::set_section_addresses): Add code to
4152 check for addresses set by memory regions.
4153 (Output_segment::set_section_addresses): Remove memory region
4155 (Script_sections::create_segment): Add a warning if a header
4156 segment is created outside of any region.
4157 * script-sections.h (class Script_sections): Add prototypes for
4158 find_memory_region and block_in_region methods.
4159 * testsuite/memory_test.s: Use .long instead of .word.
4160 * testsuite/memory_test.t: Add some more output sections.
4161 * testsuite/memory_test.sh: Update expected output.
4163 2010-10-02 Doug Kwan <dougkwan@google.com>
4165 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4166 defintion to symtab.h
4167 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4168 declaration to defintion.
4170 2010-10-01 Nick Clifton <nickc@redhat.com>
4172 * expression.cc (eval): Replace dummy argument with NULL.
4173 (eval_maybe_dot): Check for a NULL result section pointer.
4174 (Symbol_expression::value): Likewise.
4175 (Dot_expression::value): Likewise.
4176 (BINARY_EXPRESSION): Likewise.
4177 (Max_expression::value): Likewise.
4178 (Min_expression::value): Likewise.
4179 (Absolute_expression::value): Likewise.
4180 (Addr_expression::value_from_output_section): Likewise.
4181 (Loaddddr_expression::value_from_output_section): Likewise.
4182 (Segment_start_expression::value): Likewise.
4183 * script-sections.cc
4184 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4186 (Sections_elememt_dot_assignment::set_section_addresses):
4188 (Output_data_expression::do_write_to_buffer): Likewise.
4189 (Output_section_definition::finalize_symbols): Likewise.
4190 (Output_section_definition::set_section_addresses): Likewise.
4192 2010-09-30 Doug Kwan <dougkwan@google.com>
4194 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4196 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4198 * target.h (Target::can_icf_inline_merge_sections): New virtual
4200 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4202 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4204 * icf.cc (get_section_contents): Inline merge sections only when
4207 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4209 * configure: Regenerate.
4211 2010-09-17 Ian Lance Taylor <iant@google.com>
4213 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4214 * testsuite/Makefile.am (memory_test.o): New target.
4215 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4217 * testsuite/Makefile.in: Rebuild.
4219 2010-09-17 Doug Kwan <dougkwan@google.com>
4221 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4222 defintion if relocation uses GOT entries of the symbol.
4223 * testsuite/icf_safe_test.sh: Fix test.
4224 * testsuite/icf_safe_so_test.sh: Fix test.
4226 2010-09-16 Cary Coutant <ccoutant@google.com>
4228 * script_sections.cc (class Memory_region): Remove "NULL" from
4229 vector initializations.
4231 2010-09-15 Cary Coutant <ccoutant@google.com>
4233 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4234 Resolve forwarding symbols.
4236 2010-09-15 Doug Kwan <dougkwan@google.com>
4238 * gold/testsuite/script_test_3.t: Add ARM special sections.
4239 * gold/testsuite/script_test_4.t: Same.
4240 * gold/testsuite/script_test_5.t: Same.
4241 * gold/testsuite/script_test_6.t: Same.
4242 * gold/testsuite/script_test_7.t: Same.
4243 * gold/testsuite/script_test_7.t: Same.
4244 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4246 2010-09-14 Cary Coutant <ccoutant@google.com>
4248 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4249 (Target_x86_64::Relocate::relocate_tls): Replace check for
4250 saw_tls_block_reloc_ with test for executable section.
4252 2010-09-12 Cary Coutant <ccoutant@google.com>
4254 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4255 position-independent executables to shared libraries need dynamic
4257 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4258 position-independent executables.
4259 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4260 * testsuite/Makefile.in: Regenerate.
4262 2010-09-10 Nick Clifton <nickc@redhat.com>
4265 * testsuite/memory_test.t: Discard any sections that are not
4268 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4271 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4272 "This::" to work around a bug in gcc 4.2.
4274 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4276 2010-09-09 Rafael Espindola <espindola@google.com>
4278 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4279 sections with different PF_X flags in the same segment.
4280 (Layout::find_first_load_seg): Search all segments to find the first
4282 * options.h (rosegment): New.
4284 2010-09-08 Rafael Espindola <espindola@google.com>
4286 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4288 2010-09-08 Doug Kwan <dougkwan@google.com>
4290 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4291 (Arm_relobj::do_relocate_sections): Add new parameter for output
4292 file to match the parent.
4293 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4294 of local symbols instead of input values. Update code to track
4295 changes in gold::relocate_section.
4296 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4297 (Sized_relobj::compute_final_local_value_internal): New methods.
4298 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4299 body into private version of Sized_relobj::compute_final_local_value.
4300 Call the inline method.
4301 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4302 merged symbol value if there is one.
4303 (Symbol_value::has_output_value): New method defintiion.
4304 (Sized_relobj::Compute_final_local_value_status): New enum type.
4305 (Sized_relobj::compute_final_local_value): New methods.
4306 (Sized_relobj::compute_final_local_value_internal): New methods.
4307 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4308 and arm_cortex_a8.sh.
4309 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4310 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4312 * Makefile.in: Regenerate.
4313 * testsuite/arm_bl_out_of_range.s: Update test.
4314 * testsuite/thumb_bl_out_of_range.s: Ditto.
4315 * testsuite/thumb_blx_out_of_range.s: Ditto.
4316 * testsuite/arm_branch_out_of_range.sh: New file.
4317 * testsuite/arm_cortex_a8.sh: Ditto.
4318 * testsuite/arm_cortex_a8_b.s: Ditto.
4319 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4320 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4321 * testsuite/arm_cortex_a8_bl.s: Ditto.
4322 * testsuite/arm_cortex_a8_blx.s: Ditto.
4323 * testsuite/arm_cortex_a8_local.s: Ditto.
4324 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4325 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4327 2010-09-08 Rafael Espindola <espindola@google.com>
4329 * Makefile.am (memory_test.stdout): Run readelf with -W.
4330 * Makefile.in: Regenerate.
4331 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4334 2010-09-08 Rafael Espindola <espindola@google.com>
4336 * script-sections.cc (Script_sections::add_memory_region): Convert
4337 field precision to int.
4338 * script.cc (script_set_section_region, script_set_section_region):
4339 Convert field precision to int.
4341 2010-09-08 Rafael Espindola <espindola@google.com>
4343 * arm.cc (do_finalize_sections): Create the __exidx_start and
4344 __exdix_end symbols even when the section is missing.
4346 2010-09-08 Nick Clifton <nickc@redhat.com>
4348 * README: Remove claim that MEMORY is not supported.
4349 * expression.cc (script_exp_function_origin)
4350 (script_exp_function_length): Move from here to ...
4351 * script.cc: ... here.
4352 (script_set_section_region, script_add_memory)
4353 (script_parse_memory_attr, script_include_directive): New
4355 * script-sections.cc
4356 (class Memory_region): New class.
4357 (class Output_section_definition): Add set_memory_region,
4358 set_section_vma, set_section_lma and get_section_name methods.
4359 (class Script_Sections): Add add_memory_region,
4360 find_memory_region, find_memory_region_origin,
4361 find_memory_region_length and set_memory_region methods.
4362 Have set_section_addresses method walk the list of set memory
4364 Extend the print methos to display memory regions.
4365 * script-sections.h: Add prototypes for new methods.
4366 Add enum for MEMORY region attributes.
4367 * yyscript.y: Add support for parsing MEMORY regions.
4368 * script-c.h: Add prototypes for new functions.
4369 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4370 * testsuite/Makefile.in: Regenerate.
4371 * testsuite/memory_test.sh: New script.
4372 * testsuite/memory_test.s: New assembler source file.
4373 * testsuite/memory_test.t: New linker script.
4375 2010-08-27 Doug Kwan <dougkwan@google.com>
4377 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4378 reference override an existing dynamic weak reference.
4379 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4380 * testsuite/Makefile.in: Regenerate.
4381 * testsuite/dyn_weak_ref.sh: New file.
4382 * testsuite/dyn_weak_ref_1.c: Ditto.
4383 * testsuite/dyn_weak_ref_2.c: Ditto.
4385 2010-08-27 Ian Lance Taylor <iant@google.com>
4387 * incremental.h (class Incremental_input_entry): Add virtual
4390 2010-08-27 Ian Lance Taylor <iant@google.com>
4392 * testsuite/start_lib_test_3.c: Mark t3 as used.
4394 2010-08-27 Nick Clifton <nickc@redhat.com>
4396 * options.cc (version_script): Fix small typo in previous
4399 2010-08-25 Nick Clifton <nickc@redhat.com>
4401 * archive.cc: Formatting fixes: Remove whitespace between
4402 typename and following asterisk. Remove whitespace between
4403 function name and opening parenthesis.
4404 * archive.h: Likewise.
4406 * attributes.cc: Likewise.
4407 * attributes.h: Likewise.
4408 * common.cc: Likewise.
4409 * copy-relocs.cc: Likewise.
4410 * dirsearch.h: Likewise.
4411 * dynobj.cc: Likewise.
4412 * ehframe.cc: Likewise.
4413 * ehframe.h: Likewise.
4414 * expression.cc: Likewise.
4415 * fileread.cc: Likewise.
4416 * fileread.h: Likewise.
4418 * gold-threads.cc: Likewise.
4419 * gold.cc: Likewise.
4420 * i386.cc: Likewise.
4422 * incremental-dump.cc: Likewise.
4423 * incremental.cc: Likewise.
4424 * layout.cc: Likewise.
4425 * layout.h: Likewise.
4426 * main.cc: Likewise.
4427 * merge.cc: Likewise.
4428 * merge.h: Likewise.
4429 * object.cc: Likewise.
4430 * object.h: Likewise.
4431 * options.cc: Likewise.
4432 * options.h: Likewise.
4433 * output.cc: Likewise.
4434 * output.h: Likewise.
4435 * plugin.cc: Likewise.
4436 * plugin.h: Likewise.
4437 * powerpc.cc: Likewise.
4438 * reloc.cc: Likewise.
4439 * script-c.h: Likewise.
4440 * script-sections.cc: Likewise.
4441 * script.cc: Likewise.
4442 * stringpool.cc: Likewise.
4443 * symtab.cc: Likewise.
4444 * symtab.h: Likewise.
4445 * target.cc: Likewise.
4446 * timer.cc: Likewise.
4447 * timer.h: Likewise.
4448 * version.cc: Likewise.
4449 * x86_64.cc: Likewise.
4451 2010-08-24 Nick Clifton <nickc@redhat.com>
4454 * layout.cc (segment_precedes): Sort segments by their physical
4455 addresses, if they have been set.
4457 2010-08-23 Cary Coutant <ccoutant@google.com>
4459 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4461 (Lib_group::include_member): Unlock object after deleting its
4463 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4466 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4467 Cary Coutant <ccoutant@google.com>
4469 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4470 constructor, and set_blocker.
4471 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4473 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4474 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4475 * testsuite/Makefile.am (start_lib_test): New test case.
4476 * testsuite/Makefile.in: Regenerate.
4477 * testsuite/start_lib_test_main.c: New file.
4478 * testsuite/start_lib_test_1.c: New file.
4479 * testsuite/start_lib_test_2.c: New file.
4480 * testsuite/start_lib_test_3.c: New file.
4482 2010-08-19 Ian Lance Taylor <iant@google.com>
4484 * Makefile.in: Rebuild with automake 1.11.1.
4485 * aclocal.m4: Likewise.
4486 * testsuite/Makefile.in: Likewise.
4488 2010-08-19 Ian Lance Taylor <iant@google.com>
4491 * i386.cc (class Output_data_plt_i386): Update declarations.
4492 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4493 local_ifuncs_ fields.
4494 (Target_i386::do_plt_section_for_global): New function.
4495 (Target_i386::do_plt_section_for_local): New function.
4496 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4497 parameter; change all callers. Initialize global_ifuncs_ and
4498 local_ifuncs_. If doing a static link define __rel_iplt_start and
4500 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4501 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4502 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4504 (Target_i386::make_plt_section): New function, broken out of
4505 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4506 (Target_i386::make_plt_entry): Call make_plt_section.
4507 (Target_i386::make_local_ifunc_plt_entry): New function.
4508 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4509 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4510 R_386_IRELATIVE to switch.
4511 (Target_i386::Scan::global): Likewise.
4512 (Target_i386::Relocate::relocate): Likewise.
4513 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4515 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4516 (Target_x86_64::do_plt_section_for_global): New function.
4517 (Target_x86_64::do_plt_section_for_local): New function.
4518 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4519 parameter; change all callers. If doing a static link define
4520 __rela_iplt_start and __rela_iplt_end.
4521 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4522 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4523 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4525 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4526 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4528 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4529 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4530 R_X86_64_IRELATIVE to switch.
4531 (Target_x86_64::Scan::global): Likewise.
4532 (Target_x86_64::Relocate::relocate): Likewise.
4533 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4535 * target.h (class Target): Add plt_section_for_global and
4536 plt_section_for_local functions. Add do_plt_section_for_global
4537 and do_plt_section_for_local virtual functions.
4538 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4539 clarifying comments.
4540 (Symbol::use_plt_offset): Handle IFUNC symbol.
4541 * object.cc (Sized_relobj::Sized_relobj): Initialize
4543 (Sized_relobj::local_has_plt_offset): New function.
4544 (Sized_relobj::local_plt_offset): New function.
4545 (Sized_relobj::set_local_plt_offset): New function.
4546 (Sized_relobj::do_count): Handle IFUNC symbol.
4547 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4548 a bit away from input_shndx_ field. Add set_is_func_symbol and
4549 is_ifunc_symbol functions.
4550 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4551 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4552 local_plt_offsets_ field.
4553 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4554 * output.h (class Output_section_data): Add non-const
4555 output_section function.
4556 (class Output_data_got): Update declarations.
4557 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4558 Add use_plt_offset parameter to global and local constructors.
4559 Change all callers. Change local_sym_index_ field to 31 bits.
4560 Change GSYM_CODE and CONSTANT_CODE accordingly.
4561 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4562 doing a static link don't set sh_link field.
4563 (Output_data_got::Got_entry::write): Use PLT offset if
4565 (Output_data_got::add_global_plt): New function.
4566 (Output_data_got::add_local_plt): New function.
4567 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4568 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4569 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4570 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4571 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4573 * testsuite/ifunc-sel.h: New file.
4574 * testsuite/ifuncmain1.c: New file.
4575 * testsuite/ifuncmain1vis.c: New file.
4576 * testsuite/ifuncmod1.c: New file.
4577 * testsuite/ifuncdep2.c: New file.
4578 * testsuite/ifuncmain2.c: New file.
4579 * testsuite/ifuncmain3.c: New file.
4580 * testsuite/ifuncmod3.c: New file.
4581 * testsuite/ifuncmain4.c: New file.
4582 * testsuite/ifuncmain5.c: New file.
4583 * testsuite/ifuncmod5.c: New file.
4584 * testsuite/ifuncmain6pie.c: New file.
4585 * testsuite/ifuncmod6.c: New file.
4586 * testsuite/ifuncmain7.c: New file.
4587 * configure, testsuite/Makefile.in: Rebuild.
4589 2010-08-18 Ian Lance Taylor <iant@google.com>
4592 (Output_section_incremental_inputs::write_input_files): Add cast
4593 to avoid signed/unsigned comparison warning.
4594 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4596 2010-08-12 Cary Coutant <ccoutant@google.com>
4598 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4600 2010-08-13 Ian Lance Taylor <iant@google.com>
4602 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4604 2010-08-12 Cary Coutant <ccoutant@google.com>
4605 Doug Kwan <dougkwan@google.com>
4607 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4608 defintion overrides non-weak undef, remember that the original undef
4610 * symtab.cc (Symbol_table::sized_write_global): For undef without
4611 an original weak binding, set binding to global in output.
4612 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4613 * testsuite/Makefile.in: Regenerate.
4614 * testsuite/strong_ref_weak_def.sh: New file.
4615 * testsuite/strong_ref_weak_def_1.c: Ditto.
4616 * testsuite/strong_ref_weak_def_2.c: Ditto.
4618 2010-08-12 Cary Coutant <ccoutant@google.com>
4620 * testsuite/incremental_test.sh: Rewrite.
4621 * testsuite/incremental_test_1.c: Rewrite.
4622 * testsuite/incremental_test_2.c: Rewrite.
4624 2010-08-12 Cary Coutant <ccoutant@google.com>
4626 * arm.cc (Target_arm::got_size): Add const.
4627 (Target_arm::got_entry_count): New function.
4628 (Target_arm::plt_entry_count): New function.
4629 (Target_arm::first_plt_entry_offset): New function.
4630 (Target_arm::plt_entry_size): New function.
4631 (Output_data_plt_arm::entry_count): New function.
4632 (Output_data_plt_arm::first_plt_entry_offset): New function.
4633 (Output_data_plt_arm::get_plt_entry_size): New function.
4634 * i386.cc (Target_i386::got_size): Add const.
4635 (Target_i386::got_entry_count): New function.
4636 (Target_i386::plt_entry_count): New function.
4637 (Target_i386::first_plt_entry_offset): New function.
4638 (Target_i386::plt_entry_size): New function.
4639 (Output_data_plt_i386::entry_count): New function.
4640 (Output_data_plt_i386::first_plt_entry_offset): New function.
4641 (Output_data_plt_i386::get_plt_entry_size): New function.
4642 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4643 find_incremental_inputs_sections. Dump incremental_got_plt section.
4644 * incremental.cc: Include target.h.
4645 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4646 parameter. Adjust all callers. Find incremental_got_plt section.
4647 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4649 (Output_section_incremental_inputs::set_final_data_size): Calculate
4650 size of incremental_got_plt section.
4651 (Output_section_incremental_inputs::do_write): Write the
4652 incremental_got_plt section.
4653 (Got_plt_view_info): New struct.
4654 (Local_got_offset_visitor): New class.
4655 (Global_got_offset_visitor): New class.
4656 (Global_symbol_visitor_got_plt): New class.
4657 (Output_section_incremental_inputs::write_got_plt): New function.
4658 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4659 Add parameter. Adjust all callers.
4660 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4661 (Incremental_inputs::got_plt_section): New function.
4662 (Incremental_inputs::got_plt_section_): New data member.
4663 (Incremental_got_plt_reader): New class.
4664 * layout.cc (Layout::create_incremental_info_sections): Add the
4665 incremental_got_plt section.
4666 * object.h (Got_offset_list::get_list): New function.
4667 (Got offset_list::for_all_got_offsets): New function.
4668 (Sized_relobj::local_got_offset_list): New function.
4669 * powerpc.cc (Target_powerpc::got_size): Add const.
4670 (Target_powerpc::got_entry_count): New function.
4671 (Target_powerpc::plt_entry_count): New function.
4672 (Target_powerpc::first_plt_entry_offset): New function.
4673 (Target_powerpc::plt_entry_size): New function.
4674 (Output_data_plt_powerpc::entry_count): New function.
4675 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4676 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4677 * sparc.cc (Target_sparc::got_size): Add const.
4678 (Target_sparc::got_entry_count): New function.
4679 (Target_sparc::plt_entry_count): New function.
4680 (Target_sparc::first_plt_entry_offset): New function.
4681 (Target_sparc::plt_entry_size): New function.
4682 (Output_data_plt_sparc::entry_count): New function.
4683 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4684 (Output_data_plt_sparc::get_plt_entry_size): New function.
4685 * symtab.h (Symbol::got_offset_list): New function.
4686 (Symbol_table::for_all_symbols): New function.
4687 * target.h (Sized_target::got_entry_count): New function.
4688 (Sized_target::plt_entry_count): New function.
4689 (Sized_target::plt_entry_size): New function.
4690 * x86_64.cc (Target_x86_64::got_size): Add const.
4691 (Target_x86_64::got_entry_count): New function.
4692 (Target_x86_64::plt_entry_count): New function.
4693 (Target_x86_64::first_plt_entry_offset): New function.
4694 (Target_x86_64::plt_entry_size): New function.
4695 (Output_data_plt_x86_64::entry_count): New function.
4696 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4697 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4699 2010-08-12 Cary Coutant <ccoutant@google.com>
4701 * archive.cc: Include incremental.h.
4702 (Archive::Archive): Initialize incremental_info_.
4703 (Archive::include_member): Record archive members in incremental info.
4704 (Add_archive_symbols::run): Record begin and end of an archive in
4706 (Lib_group::include_member): Record objects in incremental info.
4707 * archive.h (Incremental_archive_entry): Forward declaration.
4708 (Archive::set_incremental_info): New member function.
4709 (Archive::incremental_info): New member function.
4710 (Archive::Unused_symbol_iterator): New class.
4711 (Archive::unused_symbols_begin): New member function.
4712 (Archive::unused_symbols_end): New member function.
4713 (Archive::incremental_info_): New data member.
4714 * incremental-dump.cc (find_input_containing_global): New function.
4715 (dump_incremental_inputs): Dump new incremental info sections.
4716 * incremental.cc: Include symtab.h.
4717 (Output_section_incremental_inputs): New class.
4718 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4719 new incremental info sections.
4720 (Sized_incremental_binary::do_check_inputs): Likewise.
4721 (Incremental_inputs::report_archive): Remove.
4722 (Incremental_inputs::report_archive_begin): New function.
4723 (Incremental_inputs::report_archive_end): New function.
4724 (Incremental_inputs::report_object): New function.
4725 (Incremental_inputs::finalize_inputs): Remove.
4726 (Incremental_inputs::report_input_section): New function.
4727 (Incremental_inputs::report_script): Rewrite.
4728 (Incremental_inputs::finalize): Do nothing but finalize string table.
4729 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4730 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4731 (Incremental_inputs::create_data_sections): New function.
4732 (Incremental_inputs::relocs_entsize): New function.
4733 (Output_section_incremental_inputs::set_final_data_size): New function.
4734 (Output_section_incremental_inputs::do_write): New function.
4735 (Output_section_incremental_inputs::write_header): New function.
4736 (Output_section_incremental_inputs::write_input_files): New function.
4737 (Output_section_incremental_inputs::write_info_blocks): New function.
4738 (Output_section_incremental_inputs::write_symtab): New function.
4739 * incremental.h (Incremental_script_entry): Forward declaration.
4740 (Incremental_object_entry): Forward declaration.
4741 (Incremental_archive_entry): Forward declaration.
4742 (Incremental_inputs): Forward declaration.
4743 (Incremental_inputs_header_data): Remove.
4744 (Incremental_inputs_header): Remove.
4745 (Incremental_inputs_header_write): Remove.
4746 (Incremental_inputs_entry_data): Remove.
4747 (Incremental_inputs_entry): Remove.
4748 (Incremental_inputs_entry_write): Remove.
4749 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4750 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4751 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4752 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4754 (Incremental_input_entry): New class.
4755 (Incremental_script_entry): New class.
4756 (Incremental_object_entry): New class.
4757 (Incremental_archive_entry): New class.
4758 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4759 (Incremental_inputs::report_inputs): Remove.
4760 (Incremental_inputs::report_archive): Remove.
4761 (Incremental_inputs::report_archive_begin): New function.
4762 (Incremental_inputs::report_archive_end): New function.
4763 (Incremental_inputs::report_object): Change prototype.
4764 (Incremental_inputs::report_input_section): New function.
4765 (Incremental_inputs::report_script): Change prototype.
4766 (Incremental_inputs::get_reloc_count): New function.
4767 (Incremental_inputs::set_reloc_count): New function.
4768 (Incremental_inputs::create_data_sections): New function.
4769 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4770 (Incremental_inputs::inputs_section): New function.
4771 (Incremental_inputs::symtab_section): New function.
4772 (Incremental_inputs::relocs_section): New function.
4773 (Incremental_inputs::get_stringpool): Add const.
4774 (Incremental_inputs::command_line): Add const.
4775 (Incremental_inputs::inputs): Remove.
4776 (Incremental_inputs::command_line_key): New function.
4777 (Incremental_inputs::input_file_count): New function.
4778 (Incremental_inputs::input_files): New function.
4779 (Incremental_inputs::relocs_entsize): New function.
4780 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4781 (Incremental_inputs::finalize_inputs): Remove.
4782 (Incremental_inputs::Input_info): Remove.
4783 (Incremental_inputs::lock_): Remove.
4784 (Incremental_inputs::inputs_): Change type.
4785 (Incremental_inputs::inputs_map_): Remove.
4786 (Incremental_inputs::current_object_entry_): New data member.
4787 (Incremental_inputs::inputs_section_): New data member.
4788 (Incremental_inputs::symtab_section_): New data member.
4789 (Incremental_inputs::relocs_section_): New data member.
4790 (Incremental_inputs::reloc_count_): New data member.
4791 (Incremental_inputs_reader): New class.
4792 (Incremental_symtab_reader): New class.
4793 (Incremental_relocs_reader): New class.
4794 * layout.cc (Layout::finalize): Move finalization of incremental info
4795 and creation of incremental info sections to follow finalization of
4796 symbol table. Set offsets for postprocessing sections.
4797 (Layout::create_incremental_info_sections): Call
4798 Incremental_inputs::create_data_sections. Add incremental symtab
4799 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4800 sections to layout after input sections.
4801 * layout.h (struct Timespec): Forward declaration.
4802 (Layout::incremental_inputs): Add const.
4803 (Layout::create_incremental_info_sections): Add parameter.
4804 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4805 * object.cc: Include incremental.h.
4806 (Relobj::finalize_incremental_relocs): New function.
4807 (Sized_relobj::do_layout): Record input sections in incremental info.
4808 * object.h (Object::output_section): New function.
4809 (Object::output_section_offset): Moved from Relobj.
4810 (Object::get_incremental_reloc_base): New function.
4811 (Object::get_incremental_reloc_count): New function.
4812 (Object::do_output_section): New function.
4813 (Object::do_output_section_offset): Moved from Relobj.
4814 (Object::do_get_incremental_reloc_base): New function.
4815 (Object::do_get_incremental_reloc_count): New function.
4816 (Object::Object): Initialize new data members.
4817 (Relobj::output_section): Renamed do_output_section and moved to
4819 (Relobj::output_section_offset): Moved to Object.
4820 (Relobj::do_get_incremental_reloc_base): New function.
4821 (Relobj::do_get_incremental_reloc_count): New function.
4822 (Relobj::allocate_incremental_reloc_counts): New function.
4823 (Relobj::count_incremental_reloc): New function.
4824 (Relobj::finalize_incremental_relocs): New function.
4825 (Relobj::next_incremental_reloc_index): New function.
4826 (Relobj::reloc_counts_): New data member.
4827 (Relobj::reloc_bases_): New data member.
4828 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4829 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4830 (Sized_relobj::incremental_relocs_scan): New function.
4831 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4832 (Sized_relobj::incremental_relocs_write): New function.
4833 (Sized_relobj::incremental_relocs_write_reltype): New function.
4834 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4836 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4837 archives and object files elsewhere.
4838 (Add_symbols::run): Report object files here.
4839 (Finish_group::run): Report end of archive at end of group.
4840 * reloc.cc: Include layout.h, incremental.h.
4841 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4842 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4843 (Sized_relobj::incremental_relocs_scan): New function.
4844 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4845 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4846 (Sized_relobj::incremental_relocs_write): New function.
4847 (Sized_relobj::incremental_relocs_write_reltype): New function.
4848 * script.cc (read_input_script): Rewrite test for incremental link.
4849 Change call to Incremental_inputs::report_script.
4850 * symtab.h (Symbol_table::first_global_index): New function.
4851 (Symbol_table::output_count): New function.
4853 2010-08-12 Doug Kwan <dougkwan@google.com>
4855 * arm.cc (Target_arm::merge_object_attributes): Check command line
4856 options --no-wchar-size-warning and --no-enum-size-warning.
4857 * options.h (General_options): Add ld-compatible options
4858 --no-enum-size-warning and --no-wchar-size-warning.
4860 2010-08-04 Ian Lance Taylor <iant@google.com>
4862 * x86_64.cc (Target_x86_64::Scan::local): Use
4863 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4864 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4865 (Target_x86_64::Scan::global): Likewise.
4866 (Target_x86_64::Relocate::relocate): Likewise.
4867 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4870 2010-08-03 Cary Coutant <ccoutant@google.com>
4872 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4873 to reserve space in merged_strings vector. Keep total input size
4875 (Output_merge_string::do_print_merge_stats): Print total input size.
4876 * merge.h (Output_merge_string): Add input_size_ field.
4877 * stringpool.cc (Stringpool_template::string_length): Move
4878 implementations out of Stringpool_template class and place in
4880 * stringpool.h (string_length): Move out of Stringpool_template.
4882 2010-08-03 Ian Lance Taylor <iant@google.com>
4885 * layout.cc (relaxation_loop_body): If address of load segment is
4886 set, adjust address to include headers if possible.
4888 2010-08-03 Ian Lance Taylor <iant@google.com>
4890 * version.cc (version_string): Bump to 1.10.
4892 2010-08-03 Ian Lance Taylor <iant@google.com>
4895 * layout.h (enum Output_section_order): Define.
4896 (class Layout): Update declarations.
4897 * layout.cc (Layout::get_output_section): Add order parameter.
4898 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4899 is_first_non_relro parameters. Change all callers.
4900 (Layout::choose_output_section): Likewise.
4901 (Layout::add_output_section_data): Likewise.
4902 (Layout::make_output_section): Likewise. Set order.
4903 (Layout::default_section_order): New function.
4904 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4905 * output.cc (Output_section::Output_section): Initialize order_.
4906 Don't initialize deleted fields.
4907 (Output_segment::Output_segment): Don't initialize deleted
4909 (Output_segment::add_output_section_to_load): New function
4910 replacing add_output_section. Change all callers to call this or
4911 add_output_section_to_nonload.
4912 (Output_segment::add_output_section_to_nonload): New function.
4913 (Output_segment::remove_output_section): Rewrite.
4914 (Output_segment::add_initial_output_data): Likewise.
4915 (Output_segment::has_any_data_sections): Likewise.
4916 (Output_segment::is_first_section_relro): Likewise.
4917 (Output_segment::maximum_alignment): Likewise.
4918 (Output_segment::has_dynamic_reloc): New function replacing
4919 dynamic_reloc_count. Change all callers.
4920 (Output_segment::has_dynamic_reloc_list): New function replacing
4921 dynamic_reloc_count_list. Change all callers.
4922 (Output_segment::set_section_addresses): Rewrite.
4923 (Output_segment::set_offset): Rewrite.
4924 (Output_segment::find_first_and_last_list): Remove.
4925 (Output_segment::set_tls_offsets): Rewrite.
4926 (Output_segment::first_section_load_address): Likewise.
4927 (Output_segment::output_section_count): Likewise.
4928 (Output_segment::section_with_lowest_load_address): Likewise.
4929 (Output_segment::write_section_headers): Likewise.
4930 (Output_segment::print_sections_to_map): Likewise.
4931 * output.h (class Output_data): Remove dynamic_reloc_count_
4932 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4933 (Output_data::add_dynamic_reloc): Rewrite.
4934 (Output_data::has_dynamic_reloc): New function.
4935 (Output_data::dynamic_reloc_count): Remove.
4936 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4937 is_last_relro_, is_first_non_relro_, is_interp_,
4938 is_dynamic_linker_section_ fields. Add order and set_order
4939 functions. Remove is_relro_local, set_is_relro_local,
4940 is_last_relro, set_is_last_relro, is_first_non_relro,
4941 set_is_first_non_relro functions, is_interp, set_is_interp,
4942 is_dynamic_linker_section, and set_is_dynamic_linker_section
4944 (class Output_segment): Change Output_data_list from std::list to
4945 std:;vector. Add output_lists_ field. Remove output_data_ and
4946 output_bss_ fields. Update declarations.
4948 2010-08-02 Ian Lance Taylor <iant@google.com>
4950 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4951 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4952 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4954 2010-08-02 Ian Lance Taylor <iant@google.com>
4957 * script.cc (Script_options::Script_options): Initialize
4958 symbol_definitions_ and symbol_references_.
4959 (Script_options::add_symbol_assignment): Update
4960 symbol_definitions_ and symbol_references_.
4961 (Script_options::add_symbol_reference): New function.
4962 (script_symbol): New function.
4963 * script.h (class Script_options): Add symbol_definitions_ and
4964 symbol_references_ fields.
4965 (Script_options::referenced_const_iterator): New type.
4966 (Script_options::referenced_begin): New function.
4967 (Script_options::referenced_end): New function.
4968 (Script_options::is_referenced): New function.
4969 (Script_options::any_unreferenced): New function.
4970 * script-c.h (script_symbol): Declare.
4971 * yyscript.y (exp): Call script_symbol.
4972 * symtab.cc: Include "script.h".
4973 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4974 Change all callers. Check symbols referenced by scripts.
4975 (Symbol_table::add_undefined_symbols_from_command_line): Add
4976 layout parameter. Change all callers.
4977 (Symbol_table::do_add_undefined_symbols_from_command_line):
4978 Likewise. Break out loop body. Check symbols referenced by
4980 (Symbol_table::add_undefined_symbol_from_command_line): New
4981 function broken out of
4982 do_add_undefined_symbols_from_command_line.
4983 * symtab.h (class Symbol_table): Update declarations.
4984 * archive.cc: Include "layout.h".
4985 (Archive::should_include_member): Add layout parameter. Change
4986 all callers. Check for symbol mentioned in expression.
4987 * archive.h (class Archive): Update declaration.
4988 * object.cc (Sized_relobj::do_should_include_member): Add layout
4990 * object.h (Object::should_include_member): Add layout parameter.
4992 (Object::do_should_include_member): Add layout parameter.
4993 (class Sized_relobj): Update declaration.
4994 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4996 * dynobj.h (class Sized_dynobj): Update declaration.
4997 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4999 * plugin.h (class Sized_pluginobj): Update declaration.
5001 2010-08-02 Ian Lance Taylor <iant@google.com>
5004 * output.cc (Output_segment::set_offset): Search for the first and
5005 last sections rather than assuming that the list is in order.
5006 (Output_segment::find_first_and_last_list): New function.
5007 * output.h (class Output_segment): Update declarations.
5008 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5009 (relro_strip_test_SOURCES): New variable.
5010 (relro_strip_test_DEPENDENCIES): New variable.
5011 (relro_strip_test_LDFLAGS): New variable.
5012 (relro_strip_test_LDADD): New variable.
5013 (relro_strip_test.so): New target.
5015 2010-08-02 Ian Lance Taylor <iant@google.com>
5017 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5018 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5019 (Target_i386::got_tlsdesc_section): New function.
5020 (Target_i386::got_section): Create space for GOT entries for
5021 TLSDESC relocations.
5022 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5024 (Target_i386::Scan::global): Likewise.
5025 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5027 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5028 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5029 (Target_x86_64::got_tlsdesc_section): New function.
5030 (Target_x86_64::got_section): Create space for GOT entries for
5031 TLSDESC relocations.
5032 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5034 (Target_x86_64::Scan::global): Likewise.
5035 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5038 2010-08-02 Ian Lance Taylor <iant@google.com>
5040 * testsuite/final_layout.sh: Use dc to convert from hex to
5043 2010-07-29 Sriraman Tallam <tmsriram@google.com>
5045 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5046 paramter to the call to gold::gc_process_relocs.
5047 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5048 paramter to the call to gold::gc_process_relocs.
5049 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5050 parameter to the call to gold::gc_process_relocs.
5051 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5052 template parameter to the call to gold::gc_process_relocs.
5053 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5054 paramter to the call to gold::gc_process_relocs.
5055 * gc.h (get_embedded_addend_size): New function.
5056 (gc_process_relocs): Save the size of the reloc for use by ICF.
5057 * icf.cc (get_section_contents): Get the addend from the text section
5058 for SHT_REL relocation sections.
5059 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5060 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5061 * int_encoding.h (read_from_pointer): New overloaded function.
5062 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5063 * testsuite/icf_sht_rel_addend_test.sh: New file.
5064 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5065 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5067 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5069 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5070 * Makefile.in: Regenerate.
5071 * testsuite/Makefile.in: Regenerate.
5073 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5075 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5076 * gold/testsuite/debug_msg.cc: Likewise.
5077 * gold/testsuite/odr_violation1.cc
5078 * gold/testsuite/odr_violation2.cc
5080 2010-07-21 Cary Coutant <ccoutant@google.com>
5082 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5083 string, and length fields.
5084 (Output_merge_string::Merged_strings_list): New type.
5085 (Output_merge_string::Merged_strings_lists): New typedef.
5086 (Output_merge_string): Replace merged_strings_ with
5087 merged_strings_lists_.
5088 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5089 Merged_strings_list per input object and section. Don't store pointer
5090 to the string. Don't store length with each merged string entry.
5091 (Output_merge_string::finalize_merged_data): Loop over list of merged
5092 strings lists. Recompute length of each merged string.
5094 2010-07-15 Cary Coutant <ccoutant@google.com>
5096 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5099 2010-07-14 Ian Lance Taylor <iant@google.com>
5101 * descriptors.cc (Descriptors::open): Report correct name in error
5104 2010-07-13 Doug Kwan <dougkwan@google.com>
5106 * arm.cc (Arm_input_section::Arm_input_section): For a
5107 SHT_ARM_EXIDX section, always keeps the input sections.
5108 (Arm_input_section::set_exidx_section_link): New method.
5109 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5110 has_errors_ to false.
5111 (Arm_exidx_input_section::has_errors,
5112 Arm_exidx_input_section::set_has_errors): New methods.
5113 (Arm_exidx_input_section::has_errors_): New data member.
5114 (Arm_relobj::get_exidx_shndx_list): New method.
5115 (Arm_output_section::append_text_sections_to_list): Do not skip
5116 section without SHF_EXECINSTR.
5117 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5119 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5120 section header. Make error messages more verbose. Check for
5121 a non-executable section linked to an EXIDX section.
5122 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5123 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5124 check that there is no deferred EXIDX section if we exit early.
5125 Instead of not making an EXIDX section in case of an error, make one
5126 and set the has_errors flag of it.
5127 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5128 in a relocatable link.
5129 (Target_arm::do_relax): Look for the EXIDX output section instead of
5130 assuming that it is called .ARM.exidx.
5131 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5132 section list. Do not check for SHF_EXECINSTR section flags but
5133 skip any input section with errors.
5134 * output.cc (Output_section::Output_section): Initialize
5135 always_keeps_input_sections_ to false.
5136 (Output_section::add_input_section): Check for
5137 always_keeps_input_sections_.
5138 * output.h (Output_section::always_keeps_input_sections,
5139 Output_section::set_always_keeps_input_sections): New methods.
5140 (Output_section::always_keeps_input_sections): New data member.
5142 2010-07-13 Rafael Espindola <espindola@google.com>
5144 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5145 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5147 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5148 Ian Lance Taylor <iant@google.com>
5150 * output.h (Output_section_lookup_maps::add_merge_section):
5151 Correct check of whether value was inserted.
5152 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5153 (Output_section_lookup_maps::add_relaxed_input_section):
5155 * arm.cc (Target_arm::got_section): Remove used local os.
5156 * i386.cc (Target_i386::got_section): Likewise.
5157 * x86_64.cc (Target_x86_64::got_section): Likewise.
5158 * sparc.cc (Target_sparc::got_section): Likewise.
5159 (Target_sparc::relocate): Remove unused local have_got_offset.
5160 * powerpc.cc (Target_powerpc::relocate): Likewise.
5162 2010-07-13 Ian Lance Taylor <iant@google.com>
5164 * compressed_output.cc (zlib_decompress): Fix signature in
5167 * archive.cc (Archive::include_member): Unlock an external member
5168 of a thin archive. Don't bother to delete an object we know is
5171 2010-07-12 Cary Coutant <ccoutant@google.com>
5173 * compressed_output.cc (zlib_decompress): New function.
5174 (get_uncompressed_size): New function.
5175 (decompress_input_section): New function.
5176 * compressed_output.h (get_uncompressed_size): New function.
5177 (decompress_input_section): New function.
5178 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5179 Handle compressed debug sections.
5180 * layout.cc (is_compressed_debug_section): New function.
5181 (Layout::output_section_name): Map compressed section names to
5183 * layout.h (is_compressed_debug_section): New function.
5184 (is_debug_info_section): Recognize compressed debug sections.
5185 * merge.cc: Include compressed_output.h.
5186 (Output_merge_data::do_add_input_section): Handle compressed
5188 (Output_merge_string::do_add_input_section): Handle compressed
5190 * object.cc: Include compressed_output.h.
5191 (Sized_relobj::Sized_relobj): Initialize new data members.
5192 (build_compressed_section_map): New function.
5193 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5194 * object.h (Object::section_is_compressed): New method.
5195 (Object::do_section_is_compressed): New method.
5196 (Sized_relobj::Compressed_section_map): New type.
5197 (Sized_relobj::do_section_is_compressed): New method.
5198 (Sized_relobj::compressed_sections_): New data member.
5199 * output.cc (Output_section::add_input_section): Handle compressed
5201 * reloc.cc: Include compressed_output.h.
5202 (Sized_relobj::write_sections): Handle compressed debug sections.
5204 2010-07-08 Cary Coutant <ccoutant@google.com>
5206 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5207 weak when resolving to a dynamic def.
5208 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5209 for weak undef/dynamic def cases. Adjust callers.
5210 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5211 undef_binding_weak_.
5212 (Symbol_table::sized_write_globals): Adjust symbol binding.
5213 (Symbol_table::sized_write_symbol): Add binding parameter.
5214 * symtab.h (Symbol::set_undef_binding): New method.
5215 (Symbol::is_undef_binding_weak): New method.
5216 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5217 (Symbol_table::should_override): Add new parameter.
5218 (Symbol_table::sized_write_symbol): Add new parameter.
5220 * testsuite/weak_undef_file1.cc: Add new test case.
5221 * testsuite/weak_undef_file2.cc: Fix header comment.
5222 * testsuite/weak_undef_test.cc: Add new test case.
5224 2010-06-29 Doug Kwan <dougkwan@google.com>
5226 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5227 Initialize USE_SYMBOL_.
5228 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5230 (Arm_reloc_property::uses_symbol_): New data member declaration.
5231 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5232 uses symbol value and symbol is undefined but not weakly undefined.
5234 2010-06-28 Rafael Espindola <espindola@google.com>
5236 * plugin.cc (Plugin::load): Use dlerror.
5238 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5240 * symtab.cc (detect_odr_violations): When reporting an ODR
5241 violation, report an object where the symbol is defined.
5243 2010-06-25 Doug Kwan <dougkwan@google.com>
5245 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5246 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5248 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5249 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5250 target hook to detect function points.
5251 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5252 * icf.h (Icf::check_section_for_function_pointers): Change type of
5253 parameter SECTION_NAME to const reference to std::string. Use
5254 target hook to determine if section may have unsafe pointers.
5255 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5258 2010-06-21 Rafael Espindola <espindola@google.com>
5260 * fileread.cc (Input_file::find_fie): New
5261 (Input_file::open): Use Input_file::find_fie.
5262 * fileread.h (Input_file::find_fie): New
5263 * plugin.cc (set_extra_library_path): New.
5264 (Plugin::load): Add set_extra_library_path to the transfer vector.
5265 (Plugin_manager::set_extra_library_path): New.
5266 (Plugin_manager::add_input_file): Use the extra search path if set.
5267 (set_extra_library_path(): New.
5268 * plugin.h (Plugin_manager): Add set_extra_library_path and
5271 2010-06-19 Cary Coutant <ccoutant@google.com>
5273 * layout.cc (gdb_sections): Add .debug_types.
5274 (lines_only_debug_sections): Likewise.
5276 2010-06-18 Rafael Espindola <espindola@google.com>
5278 * plugin.cc (add_input_file,add_input_library)
5279 (Plugin_manager::add_input_file): Make filename arguments const.
5280 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5283 2010-06-16 Doug Kwan <dougkwan@google.com>
5285 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5286 .ARM.attributes section if we have not merged any input
5287 attributes sections.
5289 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5291 * arm.cc: Allow combining objects with no EABI version
5294 2010-06-15 Rafael Espindola <espindola@google.com>
5296 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5298 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5300 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5301 (struct iovec): Correct !HAVE_READV definition.
5303 2010-06-10 Cary Coutant <ccoutant@google.com>
5305 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5306 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5308 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5311 * symtab.h (Symbol::is_placeholder): New member function.
5312 * target-reloc.h (relocate_section): Check for placeholder symbols.
5314 * testsuite/Makefile.am (plugin_test_8): New test.
5315 (plugin_test_9): New test.
5316 * testsuite/Makefile.in: Regenerate.
5318 2010-06-09 Nick Clifton <nickc@redhat.com>
5320 * yyscript.y (input_list_element): Allow strings prefixed with
5321 the '-' character. Treat these as libraries.
5322 * script.cc (script_add_library): New function. Adds a library
5323 specified by "-l<name>" found in an input script.
5324 * script-c.h: Add prototype for script_add_library.
5326 2010-06-07 Doug Kwan <dougkwan@google.com>
5328 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5329 Restrict stub-group size to be within long conditional branch
5330 range when working around cortex-A8 erratum.
5332 2010-06-07 Damien Diederen <dd@crosstwine.com>
5334 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5337 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5341 (Output_section::Input_section_sort_entry::compare_section_ordering):
5342 Change to return non-zero correctly.
5343 (Output_section::Input_section_sort_section_order_index_compare
5344 ::operator()): Change to fix ambiguity in comparisons.
5346 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5348 * gold.h (is_wildcard_string): New function.
5349 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5350 (Layout::layout_eh_frame): Ditto.
5351 (Layout::find_section_order_index): New method.
5352 (Layout::read_layout_from_file): New method.
5353 * layout.h (Layout::find_section_order_index): New method.
5354 (Layout::read_layout_from_file): New method.
5355 (Layout::input_section_position_): New private member.
5356 (Layout::input_section_glob_): New private member.
5357 * main.cc (main): Call read_layout_from_file here.
5358 * options.h (--section-ordering-file): New option.
5359 * output.cc (Output_section::input_section_order_specified_): New
5361 (Output_section::Output_section): Initialize new member.
5362 (Output_section::add_input_section): Add new parameter.
5363 Keep input sections when --section-ordering-file is used.
5364 (Output_section::set_final_data_size): Sort input sections when
5365 section ordering file is specified.
5366 (Output_section::Input_section_sort_entry): Add new parameter.
5368 (Output_section::Input_section_sort_entry::compare_section_ordering):
5370 (Output_section::Input_section_sort_compare::operator()): Change to
5371 consider section_order_index.
5372 (Output_section::Input_section_sort_init_fini_compare::operator()):
5373 Change to consider section_order_index.
5374 (Output_section::Input_section_sort_section_order_index_compare
5375 ::operator()): New method.
5376 (Output_section::sort_attached_input_sections): Change to sort
5377 according to section order when specified.
5378 (Output_section::add_input_section<32, true>): Add new parameter.
5379 (Output_section::add_input_section<64, true>): Add new parameter.
5380 (Output_section::add_input_section<32, false>): Add new parameter.
5381 (Output_section::add_input_section<64, false>): Add new parameter.
5382 * output.h (Output_section::add_input_section): Add new parameter.
5383 (Output_section::input_section_order_specified): New
5385 (Output_section::set_input_section_order_specified): New method.
5386 (Input_section::Input_section): Initialize section_order_index_.
5387 (Input_section::section_order_index): New method.
5388 (Input_section::set_section_order_index): New method.
5389 (Input_section::section_order_index_): New member.
5390 (Input_section::Input_section_sort_section_order_index_compare): New
5392 (Output_section::input_section_order_specified_): New member.
5393 * script-sections.cc (is_wildcard_string): Delete and move modified
5395 (Output_section_element_input::Output_section_element_input): Modify
5396 call to is_wildcard_string.
5397 (Output_section_element_input::Input_section_pattern
5398 ::Input_section_pattern): Ditto.
5399 (Output_section_element_input::Output_section_element_input): Ditto.
5400 * testsuite/Makefile.am (final_layout): New test case.
5401 * testsuite/Makefile.in: Regenerate.
5402 * testsuite/final_layout.cc: New file.
5403 * testsuite/final_layout.sh: New file.
5405 2010-06-01 Rafael Espindola <espindola@google.com>
5407 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5409 2010-06-01 Rafael Espindola <espindola@google.com>
5411 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5412 visibility of symbols.
5414 2010-05-27 Doug Kwan <dougkwan@google.com>
5416 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5417 from start of output section instead of address for a local symbol
5418 in a merged or relaxed section when doing a relocatable link.
5420 2010-05-26 Rafael Espindola <espindola@google.com>
5423 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5424 adding sections the garbage collector removed.
5425 * gold/testsuite/Makefile.am: Add test.
5426 * gold/testsuite/Makefile.in: Regenerate.
5427 * gold/testsuite/plugin_test_7.sh: New.
5428 * gold/testsuite/plugin_test_7_1.c: New.
5429 * gold/testsuite/plugin_test_7_2.c: New.
5431 2010-05-26 Rafael Espindola <espindola@google.com>
5433 * script-sections.cc (Output_section_definition::set_section_addresses):
5434 Check for --section-start.
5436 2010-05-26 Doug Kwan <dougkwan@google.com>
5438 * arm.cc (Arm_scan_relocatable_relocs): New class.
5439 (Target_arm::relocate_special_relocatable): New method.
5440 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5441 (Arm_relocate_functions::thumb_branch_common): Same.
5442 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5443 instead of Default_scan_relocatable_relocs.
5444 * target-reloc.h (relocate_for_relocatable): Let target handle
5445 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5446 * target.h (Sized_target::relocate_special_relocatable): New method.
5448 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5450 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5452 2010-05-23 Doug Kwan <dougkwan@google.com>
5454 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5456 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5457 with a direct branch, not a conditional branch, to a stub.
5458 * merge.cc (Output_merge_base::record_input_section): New method
5460 (Output_merge_data::do_add_input_section): Record input section if
5461 keeps-input-sections flag is set.
5462 (Output_merge_string::do_add_input_section): Ditto.
5463 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5464 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5466 (Output_merge_base::keeps_input_sections,
5467 Output_merge_base::set_keeps_input_sections,
5468 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5470 (Output_merge_base::Input_sections): New type declaration.
5471 (Output_merge_base::input_sections_begin,
5472 Output_merge_base::input_sections_end,
5473 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5474 (Output_merge_base::bool keeps_input_sections_,
5475 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5476 Output_merge_base::input_sections_): New data members.
5477 (Output_merge_data::do_set_keeps_input_sections): New method
5479 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5480 * output.cc (Output_section::Input_section::relobj): Move method
5481 defintion from class declaration to here and handle merge sections.
5482 (Output_section::Input_section::shndx): Ditto.
5483 (Output_section::Output_section): Remove initializations of removed
5484 data members and initialize new data member LOOKUP_MAPS_.
5485 (Output_section::add_input_section): Set keeps-input-sections flag
5486 for a newly created merge output section as appropriate. Adjust code
5487 to use Output_section_lookup_maps class.
5488 (Output_section::add_relaxed_input_section): Adjst code for lookup
5489 maps code refactoring.
5490 (Output_section::add_merge_input_section): Add a new parameter
5491 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5492 class. If adding input section to a newly created merge output
5493 section fails, remove the new merge section.
5494 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5495 Adjust code for use of the Output_section_lookup_maps class.
5496 (Output_section::find_merge_section): Ditto.
5497 (Output_section::build_lookup_maps): New method defintion.
5498 (Output_section::find_relaxed_input_section): Adjust code to use
5499 Output_section_lookup_maps class.
5500 (Output_section::get_input_sections): Export merge sections. Adjust
5501 code to use Output_section_lookup_maps class.
5502 (Output_section:::add_script_input_section): Adjust code to use
5503 Output_section_lookup_maps class. Update lookup maps for merge
5505 (Output_section::discard_states): Use Output_section_lookup_maps.
5506 (Output_section::restore_states): Same.
5507 * output.h (Merge_section_properties): Move class defintion out of
5509 (Output_section_lookup_maps): New class.
5510 (Output_section::Input_section::is_merge_section): New method
5512 (Output_section::Input_section::relobj): Move defintion out of class
5513 defintion. Declare method only.
5514 (Output_section::Input_section::shndx): Ditto.
5515 (Output_section::Input_section::output_merge_base): New method defintion.
5516 (Output_section::Input_section::u2_.pomb): New union field.
5517 (Output_section::Merge_section_by_properties_map,
5518 Output_section::Output_section_data_by_input_section_map,
5519 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5521 (Output_section::add_merge_input_section): Add new parameter
5522 KEEPS_INPUT_SECTIONS.
5523 (Output_section::build_lookup_maps): New method declaration.
5524 (Output_section::merge_section_map_,
5525 Output_section::merge_section_by_properties_map_,
5526 Output_section::relaxed_input_section_map_,
5527 Output_section::is_relaxed_input_section_map_valid_): Remove data
5529 (Output_section::lookup_maps_): New data member.
5531 2010-05-21 Doug Kwan <dougkwan@google.com>
5534 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5535 avoid a compilation error.
5537 2010-05-19 Rafael Espindola <espindola@google.com>
5539 * script-sections.cc (Output_section_definition::allocate_to_segment):
5540 Update the phdrs_list even when the output section is NULL.
5541 * testsuite/Makefile.am: Add test.
5542 * testsuite/Makefile.in: Regenerate.
5543 * testsuite/script_test_9.cc: New.
5544 * testsuite/script_test_9.sh: New.
5545 * testsuite/script_test_9.t: New.
5547 2010-05-19 Doug Kwan <dougkwan@google.com>
5549 * arm.cc (Arm_input_section::original_size): New method.
5550 (Arm_input_section::do_addralign): Add a cast.
5551 (Arm_input_section::do_output_offset): Remove static cast.
5552 (Arm_input_section::original_addralign,
5553 Arm_input_section::original_size_): Change type to uint32_t.
5554 (Arm_input_section::init): Add safe casts for section alignment
5556 (Arm_input_section::set_final_data_size): Do not set address and
5557 offset of stub table.
5558 (Arm_output_section::fix_exidx_coverage): Change use of of
5559 Output_section::Simple_input_section to that of
5560 Output_section::Input_section.
5561 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5562 except for the first pass.
5563 * output.cc (Output_section::get_input_sections): Change type of
5564 input_sections to std::list<Input_section>.
5565 (Output_section::add_script_input_section): Rename from
5566 Output_section::add_simple_input_section. Change type of SIS
5567 parameter from Simple_input_section to Input_section.
5568 * output.h (Output_section::Simple_input_section): Remove class.
5569 (Output_section::Input_section): Change class visibility to public.
5570 (Output_section::Input_section::addralign): Use stored alignments
5571 for special input sections if set.
5572 (Output_section::Input_section::set_addralign): New method.
5573 (Output_section::get_input_sections): Change parameter type from
5574 list of Simple_input_section to list of Input_section.
5575 (Output_section::add_script_input_section): Rename from
5576 Output_section::add_simple_input_section. Change first parameter's
5577 type from Simple_input_section to Input_section and remove the
5578 second and third parameters.
5579 * script-sections.cc (Input_section::Input_section_list): Change
5580 type to list of Output_section::Input_section/
5581 (Input_section_info::Input_section_info): Change parameter type of
5582 INPUT_SECTION to Output_section::Input_section.
5583 (Input_section_info::input_section): Change return type.
5584 (Input_section_info::input_section_): Change type to
5585 Output_section::Input_section.
5586 (Output_section_element_input::set_section_addresses): Adjust code
5587 to use Output_section::Input_section instead of
5588 Output_section::Simple_input_section. Adjust code for renaming
5589 of Output_section::add_simple_input_section.
5590 (Orphan_output_section::set_section_addresses): Ditto.
5592 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5594 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5595 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5597 2010-05-18 Rafael Espindola <espindola@google.com>
5599 * options.cc (General_options::finalize): Handle -nostdlib.
5600 * options.h (nostdlib): New option.
5601 * script.cc (script_add_search_dir): Handle -nostdlib.
5603 2010-05-12 Doug Kwan <dougkwan@google.com>
5605 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5606 attributes section only if there no attributes section after merging.
5607 (Target_arm::merge_object_attributes): Move value of
5608 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5609 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5610 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5611 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5612 and arm_attr_merge_7.stdout.
5613 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5614 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5615 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5616 arm_attr_merge_7b.o): New rules.
5617 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5619 * testsuite/Makefile.in: Regenerate.
5620 * testsuite/arm_attr_merge.sh: New file.
5621 * testsuite/arm_attr_merge_[67][ab].s: Same.
5623 2010-05-05 Nick Clifton <nickc@redhat.com>
5625 * po/es.po: Updated Spanish translation.
5627 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5629 * Makefile.am (install-exec-local): Properly install gold as
5630 default cross linker.
5631 * Makefile.in: Regenerated.
5633 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5634 Nick Clifton <nickc@redhat.com>
5636 * configure.ac (install_as_default): Define and set to false
5637 unless --enable-gold or --enable-gold=both/gold has been
5639 * configure: Regenerate.
5641 * Makefile.am (install-exec-local): Install the executable as
5642 'ld.gold'. If install_as_default is true then also install it as
5644 * Makefile.in: Regenerated.
5646 2010-04-24 Ian Lance Taylor <iant@google.com>
5648 * layout.cc (Layout::layout_reloc): In relocatable link don't
5649 combine reloc sections for grouped sections.
5651 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5653 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5654 sections that are not ordinary to icf.
5655 * icf.cc (get_section_contents): Handle relocation pointing to section
5656 with no object or shndx information.
5657 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5658 * testsuite/Makefile.in: Regenerate.
5659 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5660 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5662 2010-04-22 Ian Lance Taylor <iant@google.com>
5664 * expression.cc (Expression::Expression_eval_info): Add
5665 result_alignment_pointer field.
5666 (Expression::eval_with_dot): Add result_alignment_pointer
5667 parameter. Change all callers.
5668 (Expression::eval_maybe_dot): Likewise.
5669 (class Binary_expression): Add alignment_pointer parameter to
5670 left_value and right_value. Change all callers.
5671 (BINARY_EXPRESSION): Set result alignment.
5672 (class Trinary_expression): Add alignment_pointer parameter to
5673 arg2_value and arg3_value. Change all callers.
5674 (Trinary_cond::value): Set result alignment.
5675 (Max_expression::value, Min_expression::value): Likewise.
5676 (Align_expression::value): Likewise.
5677 * script-sections.cc (class Sections_element): Add dot_alignment
5678 parameter to set_section_addresses virtual function. Update
5680 (class Output_section_element): Likewise.
5681 (Script_sections::create_segments): Add dot_alignment parameter.
5683 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5684 (Script_sections::set_phdrs_clause_addresses): Likewise.
5685 * script-sections.h: Update declarations.
5686 * script.h: Update declarations.
5687 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5689 * testsuite/script_test_3.t: Set large alignment.
5690 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5691 segment has expected alignment.
5693 2010-04-22 Nick Clifton <nickc@redhat.com>
5695 * po/gold.pot: Updated by the Translation project.
5696 * po/vi.po: Updated Vietnamese translation.
5698 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5700 * testsuite/Makefile.am (check_PROGRAMS): Add
5701 icf_virtual_function_folding_test.
5702 * testsuite/Makefile.in: Regenerated.
5704 2010-04-15 Andrew Haley <aph@redhat.com>
5706 * options.h (merge_exidx_entries): New option.
5707 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5708 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5709 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5710 (Target_arm::merge_exidx_entries): New function.
5711 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5712 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5713 to Arm_exidx_fixup constructor.
5714 Add new arg, merge_exidx_entries.
5715 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5716 Arm_output_section::fix_exidx_coverage.
5718 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5720 * icf.cc (get_section_contents): Check for preemptible functions.
5721 Ignore addend when appropriate.
5722 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5724 (add_from_relobj): Check for section folded.
5725 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5726 * symtab.h (should_add_dynsym_entry): Add new parameter.
5727 * target-reloc.h (scan_relocs): Check for section folded.
5728 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5729 Check reloc types for function pointers in shared objects.
5730 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5732 (icf_preemptible_functions_test): New test case.
5733 (icf_string_merge_test): New test case.
5734 * testsuite.Makefile.in: Regenerate.
5735 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5736 bar_glob. Refactor code.
5737 * testsuite/icf_preemptible_functions_test.cc: New file.
5738 * testsuite/icf_preemptible_functions_test.sh: New file.
5739 * testsuite/icf_string_merge_test.cc: New file.
5740 * testsuite/icf_string_merge_test.sh: New file.
5741 * testsuite/icf_virtual_function_folding_test.cc: New file.
5742 * testsuite/icf_virtual_function_folding_test.sh: New file.
5744 2010-04-14 Doug Kwan <dougkwan@google.com>
5746 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5747 for local symbol recounting if we remove a section due to ICF.
5748 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5749 there are no regular objects in input.
5751 2010-04-13 Doug Kwan <dougkwan@google.com>
5753 * arm.cc (Arm_input_section::set_final_data_size): Compute
5754 accurate final data size instead of using current data size.
5756 2010-04-09 Doug Kwan <dougkwan@google.com>
5758 * layout.cc (Layout::choose_output_section): Handle script section
5760 (Layout::make_output_section_for_script): Add section type parameter.
5761 Handle script section types.
5762 * layout.h (Layout::make_output_section_for_script): Add section
5764 * output.cc (Output_section::Output_section): Initialize data member
5766 (Output_section::do_reset_address_and_file_offset): Do not set address
5767 to 0 if section is a NOLOAD section.
5768 * output.h (Output_section::is_noload): New method.
5769 (Output_section::set_is_noload): Ditto.
5770 (Output_section::is_noload_): New data member.
5771 * script-c.h (Script_section_type): New enum type.
5772 (struct Parser_output_section_header): Add new file section_type.
5773 * script-sections.cc (Sections_element::output_section_name): Add
5774 parameter for returning script section type.
5775 (Output_section_definition::output_section_name): Ditto.
5776 (Output_section_definition::section_type)P; New method.
5777 (Output_section_definiton::script_section_type_name): Ditto.
5778 (Output_section_definition::script_section_type_): New data member.
5779 (Output_section_definition::Output_section_definition): Initialize
5780 data member Output_section_definition::script_section_type_.
5781 (Output_section_definition::create_sections): Pass script section type
5782 to Layout::make_output_section_for_script.
5783 (Output_section_definition::output_section_name): Return script
5784 section type to caller.
5785 (Output_section_definition::set_section_address): Do not advance
5786 dot value and load address if section type is NOLOAD. Set address
5787 of NOLOAD sections regardless of section flags.
5788 (Output_section_definition::print): Print section type if it is
5789 not SCRIPT_SECTION_TYPE_NONE.
5790 (Output_section_definition::section_type): New method.
5791 (Output_section_definition::script_section_type_name): Ditto.
5792 (Script_sections::output_section_name): Add new parameter
5793 PSECTION_TYPE for returning script section type. Pass it to
5794 section elements. Handle discard sections.
5795 (Sort_output_sections::operator()): Handle NOLOAD sections.
5796 * script-sections.h (Script_sections::Section_type): New enum type.
5797 (Script_sections::output_section_name): Add a new parameter for
5798 returning script section type.
5799 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5801 * yyscript.y (union): Add new field SECTION_TYPE.
5802 (COPY, DSECT, INFO, NOLOAD): New tokens.
5803 (opt_address_and_section_type): Change type to output_section_header.
5804 (section_type): New non-terminal
5805 (section_header): Handle section type.
5806 (opt_address_and_section_type): Return section type value.
5808 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5810 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5811 * testsuite/plugin_common_test_2.c (foo): Likewise.
5813 2010-04-08 Doug Kwan <dougkwan@google.com>
5815 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5817 * output.cc (Output_section::add_merge_input_section): Simplify
5818 code and return status of Output_merge_base::add_input_section.
5819 Update merge section map only if Output_merge_base::add_input_section
5822 2010-04-07 Doug Kwan <dougkwan@google.com>
5824 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5825 if section is marked as containing instructions but has no mapping
5827 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5828 correct section index.
5829 (Arm_relobj::find_linked_text_section): Ditto.
5831 2010-04-07 Cary Coutant <ccoutant@google.com>
5833 * archive.cc (include_member): Destroy Read_symbols_data object before
5835 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5836 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5837 (Read_symbols_data::~Read_symbols_data) New destructor.
5838 (Section_relocs::Section_relocs) New constructor.
5839 (Section_relocs::~Section_relocs) New destructor.
5840 (Read_relocs_data::Read_relocs_data) New constructor.
5841 (Read_relocs_data::~Read_relocs_data) New destructor.
5842 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5843 pointers to NULL after deleting.
5845 2010-04-07 Doug Kwan <dougkwan@google.com>
5847 * arm.cc: Replace "endianity" with "endianness" in comments.
5848 (Arm_exidx_cantunwind): Ditto.
5849 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5850 (Arm_relobj::merge_flags_and_attributes): New method.
5851 (Arm_relobj::merge_flags_and_attributes_): New data member.
5852 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5853 (Arm_relobj::scan_sections_for_stubs): Ditto.
5854 (Arm_relobj::do_read_symbols): Check to see if we really want to
5855 merge processor-specific flags and attributes. Exit early if
5856 an object is empty except for section names and the undefined symbol.
5857 (Target_arm::do_finalize_sections): Move check for ELF format to
5858 Arm_relobj::do_read_symbols. Merge processor specific flags and
5859 attributes from a regular object only when we have determined that
5860 it is aapropriate. Do not create an .ARM.attributes section in
5861 output if there is no regular input object.
5862 (Target_arm::merge_processor_specific_flags): Check
5863 --warn-mismatch before printing any error.
5864 (Target_arm::merge_object_attributes): Ditto.
5865 * gold.cc (queue_middle_tasks): Handle the case in which there is
5866 no regular object in input.
5867 * options.cc (General_options::parse_EB): New method.
5868 (General_options::parse_EL): Same.
5869 (General_options::General_options): Initialize endianness_.
5870 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5872 (General_options::Endianness): New enum.
5873 (General_options::endianness): New method.
5874 (General_options::endianness_): New data member.
5875 * parameters.cc (Parameters::set_options): Check target endianness.
5876 (Parameters::set_target_once): Ditto.
5877 (Parameters::check_target_endianness): New method.
5878 (parameters_force_valid_target): If either -EL or -EB is specified,
5879 use it to define endianness of default target.
5880 * parameters.h (Parameters::check_target_endianness): New method
5882 * target.h (class Target): Change "endianity" to "endianness"
5885 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5887 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5888 * configure: Regenerate.
5889 * Makefile.in: Regenerate.
5890 * testsuite/Makefile.in: Regenerate.
5892 2010-04-06 Cary Coutant <ccoutant@google.com>
5895 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5896 prevailing definitions of common symbols.
5897 * testsuite/plugin_test_6.sh: New test case.
5898 * testsuite/plugin_common_test_1.c: New test case.
5899 * testsuite/plugin_common_test_2.c: New test case.
5900 * testsuite/Makefile.am (plugin_test_6): New test case.
5901 * testsuite/Makefile.in: Regenerate.
5903 2010-04-06 Nick Clifton <nickc@redhat.com>
5905 * po/vi.po: New Vietnamese translation.
5907 2010-03-30 Doug Kwan <dougkwan@google.com>
5909 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5911 2010-03-25 Doug Kwan <dougkwan@google.com>
5913 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5914 to avoid a conversion warning on a 32-bit host.
5916 2010-03-24 Ian Lance Taylor <iant@google.com>
5918 * testsuite/script_test_3.t: Add a TLS segment.
5919 * testsuite/Makefile.am (check_PROGRAMS): Add
5920 tls_phdrs_script_test.
5921 (tls_phdrs_script_test_SOURCES): Define.
5922 (tls_phdrs_script_test_DEPENDENCIES): Define.
5923 (tls_phdrs_script_test_LDFLAGS): Define.
5924 (tls_phdrs_script_test_LDADD): Define.
5925 * testsuite/Makefile.in: Rebuild.
5927 2010-03-23 Cary Coutant <ccoutant@google.com>
5929 * fileread.cc (find_or_make_view): Fix comment.
5931 2010-03-23 Ian Lance Taylor <iant@google.com>
5933 * script-sections.cc (class Orphan_section_placement): Define
5934 PLACE_TLS and PLACE_TLS_BSS.
5935 (Orphan_section_placement::Orphan_section_placement): Initialize
5937 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5938 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5939 (tls_script_test_SOURCES): Define.
5940 (tls_script_test_DEPENDENCIES): Define.
5941 (tls_script_test_LDFLAGS): Define.
5942 (tls_script_test_LDADD): Define.
5943 * testsuite/Makefile.in: Rebuild.
5945 2010-03-22 Doug Kwan <dougkwan@google.com>
5947 * arm.cc (Arm_relocate_functions::abs8,
5948 Arm_relocate_functions::abs16): Use correct check for overflow
5949 specified in the ARM ELF specs.
5950 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5951 target of a BLX instruction specially.
5952 (Reloc_stub::stub_type_for_reloc): Ditto.
5953 (Relocate::relocate): Use symbolic names instead of numeric relocation
5954 codes to report error.
5955 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5957 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5958 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5959 thumb2_blx_out_of_range.stdout
5960 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5961 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5962 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5963 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5964 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5965 thumb2_blx_in_range, thumb2_blx_in_range.o,
5966 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5967 thumb2_blx_out_of_range.o): New rules.
5968 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5969 thumb2_blx_in_range and thumb2_blx_out_of_range.
5970 * testsuite/Makefile.in: Regenerate.
5971 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5972 * testsuite/thumb_blx_in_range.s: New file.
5973 * testsuite/thumb_blx_out_of_range.s: New file.
5975 2010-03-22 Rafael Espindola <espindola@google.com>
5977 * archive.cc (Should_include): Move to archive.h.
5978 (should_include_member): Make it a member of Archive.
5980 (Add_lib_group_symbols): New.
5981 * archive.h: Include options.h.
5982 (Archive_member): Moved from Archive.
5983 (Should_include): Moved from archive.cc.
5985 (Add_lib_group_symbols): New.
5986 * dynobj.cc (do_should_include_member): New.
5987 * dynobj.h (do_should_include_member): New.
5988 * gold.cc (queue_initial_tasks): Update call to queue.
5989 * main.cc (main): Print lib group stats.
5990 * object.cc (do_should_include_member): New.
5991 * object.h: Include archive.h.
5992 (Object::should_include_member): New.
5993 (Object::do_should_include_member): New.
5994 (Sized_relobj::do_should_include_member): New.
5995 * options.cc (General_options::parse_start_lib): New.
5996 (General_options::parse_end_lib): New.
5997 (Input_arguments::add_file): Handle lib groups.
5998 (Input_arguments::start_group): Check we are not in a lib.
5999 (Input_arguments::start_lib): New.
6000 (Input_arguments::end_lib): New.
6001 * options.h (General_options): Add start_lib and end_lib.
6002 (Input_argument::lib_): New.
6003 (Input_argument::lib): New.
6004 (Input_argument::is_lib): New.
6005 (Input_file_lib): New.
6006 (Input_arguments::in_lib_): New.
6007 (Input_arguments::in_lib): New.
6008 (Input_arguments::start_lib): New.
6009 (Input_arguments::end_lib_): New.
6010 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6011 in unused members as preempted.
6012 (Sized_pluginobj::do_should_include_member): New.
6013 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6014 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6016 (Read_symbols::do_whole_lib_group): New.
6017 (Read_symbols::do_lib_group): New.
6018 (Read_symbols::do_read_symbols): Handle lib groups.
6019 (Read_symbols::get_name): Handle lib groups.
6020 * readsyms.h (Read_symbols): Add an archive member pointer.
6021 (Read_symbols::do_whole_lib_group): New.
6022 (Read_symbols::do_lib_group): New.
6023 (Read_symbols::member_): New.
6024 * script.cc (read_input_script): Update call to queue_soon.
6026 2010-03-19 Doug Kwan <dougkwan@google.com>
6028 * arm.cc (Stub_table::Stub_table): Initialize new data members
6029 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6030 (Stub_table::add_reloc_stub): Assign stub offset and update
6031 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6032 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6034 (Stub_table::update_data_size_and_addralign): Use
6035 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6036 instead of going over all reloc stubs.
6037 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
6038 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6039 Stringpool_template::offset_ to size of Stringpool_char.
6040 (Stringpool_template::new_key_offset): Remove code to initialize
6041 Stringpool_template::offset_.
6042 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6043 Stringpool_template::offset_ to zero.
6045 2010-03-15 Doug Kwan <dougkwan@google.com>
6047 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6049 (Stringpool_template::new_key_offset): New method.
6050 (Stringpool_template::add_string): Assign offsets when adding new
6052 (Stringpool_template::set_string_offsets): Do not set string offsets
6053 when not optimizing.
6054 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6056 (Chunked_vector::clear): Clear size_.
6057 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6058 (Chunked_vector::size): Return size_.
6059 (Chunked_vector::push_back): Use size_ to find insert position.
6060 (Chunked_vector::size_): New data member.
6061 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6062 (Stringpool_template::new_key_offset): New method declaration.
6063 (Stringpool_template::offset_): New data member.
6065 2010-03-15 Rafael Espindola <espindola@google.com>
6067 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6068 Add_symbols' constructor.
6069 * readsyms.h (Add_symbols): Remove the input_group member.
6071 2010-03-10 Ian Lance Taylor <iant@google.com>
6073 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6074 target to ask whether a reference to a symbol requires a stack
6076 * target.h (Target::is_call_to_non_split): New function.
6077 (Target::do_is_call_to_non_split): Declare virtual function.
6078 * target.cc: Include "symtab.h".
6079 (Target::do_is_call_to_non_split): New function.
6080 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6082 2010-03-10 Cary Coutant <ccoutant@google.com>
6084 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6085 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6086 (File_read::open[2]): Add whole_file_view_ to list of views.
6087 (File_read::make_view): Remove test of whole_file_view_.
6088 (File_read::find_or_make_view): Create whole_file_view_ if
6090 (File_read::clear_views): Replace bool parameter with enum;
6091 adjust all callers. Don't delete views with permanent data;
6092 do delete cached views and views from archives if
6093 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6094 if clearing the corresponding view.
6095 * fileread.h (File_read::Clear_views_mode): New enum.
6096 (File_read::View::is_permanent_view): New method.
6097 (File_read::clear_views): Replace bool parameter
6098 with enum; adjust all callers.
6099 * options.h (General_options): Change keep_files_mapped option;
6100 add map_whole_files.
6101 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6103 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6106 2010-03-10 David S. Miller <davem@davemloft.net>
6108 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6110 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6112 * icf.cc (get_section_contents): Add '@' marker after processing the
6115 2010-03-08 Doug Kwan <dougkwan@google.com>
6117 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6118 due to a conversion warning.
6119 (Arm_relobj::update_output_local_symbol_count): Check for local
6120 symbol with unset output index.
6122 2010-03-05 Ian Lance Taylor <iant@google.com>
6124 * options.h (class General_options): Add --spare-dynamic-tags.
6125 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6126 --spare-dynamic-tags.
6128 2010-03-05 Ian Lance Taylor <iant@google.com>
6130 * incremental.cc: Include "libiberty.h".
6132 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6134 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6135 function, is_info_ member.
6136 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6137 (Versions::Versions): Update caller.
6138 (Versions::define_base_version): Likewise.
6139 (Versions::add_def): Likewise.
6141 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6143 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6144 (Scan::possible_function_pointer_reloc): New function.
6145 (Scan::local_reloc_may_be_function_pointer): Change to call
6146 possible_function_pointer_reloc.
6147 (Scan::global_reloc_may_be_function_pointer): Ditto.
6148 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6149 relocations in ".data.rel.ro._ZTV" section.
6150 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6151 * testsuite/icf_safe_so_test.cc: Ditto.
6152 * testsuite/icf_safe_test.cc: Ditto.
6153 * testsuite/icf_safe_test.sh: Ditto.
6155 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6156 Ian Lance Taylor <iant@google.com>
6158 * target-reloc.h (relocate_section): Check the symbol table index
6159 for -1U before setting the local symbol index.
6160 (scan_relocatable_relocs): If copying the relocation, record that
6161 the local symbol is required.
6162 * object.h (Symbol_value::is_output_symtab_index_set): New
6164 (Symbol_value::may_be_discarded_from_output_symtab): New
6166 (Symbol_value::has_output_symtab_entry): New function.
6167 (Symbol_value::needs_output_symtab_entry): Remove.
6168 (Symbol_value::output_symtab_index): Make sure the symbol index is
6170 (Symbol_value::set_output_symtab_index): Make sure the symbol
6171 index is not set. Make sure the new index is valid.
6172 (Symbol_value::set_must_have_output_symtab_entry): New function.
6173 (Symbol_value::has_output_dynsym_entry): New function.
6174 (Symbol_value::set_output_dynsym_index): Make sure the new index
6176 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6177 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6178 local symbol if permitted.
6179 (Sized_relobj::do_finalize_local_symbols): Call
6180 is_output_symtab_index_set rather than needs_output_symtab_entry.
6181 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6182 rather than needs_output_symtab_entry. Call
6183 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6184 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6185 is_output_symtab_index_set rather than needs_output_symtab_entry.
6186 * testsuite/discard_locals_relocatable_test.c: New file.
6187 * testsuite/discard_locals_test.sh: Test -r.
6188 * testsuite/Makefile.am (check_DATA): Add
6189 discard_locals_relocatable_test1.syms,
6190 discard_local_relocatable_test2.syms.
6191 (MOSTLYCLEANFILES): Likewise. Also add
6192 discard_locals_relocatable_test1.lout and
6193 discard_locals_relocatable_test2.out.
6194 (discard_locals_relocatable_test1.syms): New target.
6195 (discard_locals_relocatable_test.o): New target.
6196 (discard_locals_relocatable_test1.out): New target.
6197 (discard_locals_relocatable_test2.syms): New target.
6198 (discard_locals_relocatable_test2.out): New target.
6199 (various): Add missing ../ld-new dependencies.
6200 * testsuite/Makefile.in: Rebuild.
6202 2010-03-03 Nick Clifton <nickc@redhat.com>
6204 * po/fi.po: New Finnish translation.
6206 2010-03-01 Doug Kwan <dougkwan@google.com>
6208 * layout.cc (Layout::Layout): Force section types of .init_array*,
6209 .preinit_array* and .fini_array* sections.
6210 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6211 Fix check of return value of std::string::find.().
6212 (Output_section::Input_section_sort_compare::operator()): Remove
6213 comment about .init_array.
6214 (Output_section::Input_section_sort_init_fini_compare::operator()):
6216 (Output_section::sort_attached_input_sections): Handle .init_array
6217 and .fini_array specially.
6218 * output.h (Output_section::Inut_section_sort_compare): Update
6220 (Output_section::Input_section_sort_init_fini_compare): New struct.
6222 2010-02-26 Doug Kwan <dougkwan@google.com>
6224 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6225 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6226 * testsuite/debug_msg.sh: Avoid matching source line number for
6227 use of global variable undef_int.
6229 2010-02-26 Doug Kwan <dougkwan@google.com>
6231 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6232 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6233 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6234 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6235 * options.cc (General_options::General_options): Initialize member
6237 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6238 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6239 and rm_no_fix_v4bx.stdout
6240 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6241 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6242 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6243 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6244 and arm_no_fix_v4bx.
6245 * Makefile.in: Regenerate.
6246 * testsuite/arm_fix_v4bx.s: New file.
6247 * testsuite/arm_fix_v4bx.sh: Ditto.
6249 2010-02-24 Doug Kwan <dougkwan@google.com>
6251 * arm.cc (Target_arm::got_section): Make the .got section the first
6252 non RELRO section in the data segment.
6253 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6254 suffixes of section names.
6256 2010-02-24 Doug Kwan <dougkwan@google.com>
6258 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6259 flags and attributes merging if an input file is a binary file.
6260 * fileread.cc (Input_file::open): Record format of original file.
6261 * fileread.h (Input_file::Format): New enum type.
6262 (Input_file::Input_file): Initialize data member format_.
6263 (Input_file::format): New method definition.
6264 (Input_file::format_):: New data member.
6266 2010-02-24 Doug Kwan <dougkwan@google.com>
6268 * arm.cc (Arm_output_data_got): New class.
6269 (ARM_TCB_SIZE): New constant
6270 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6271 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6272 If user uses a script with a SECTIONS clause, issue only a warning
6273 for a misplaced EXIDX input section. Otherwise, issue an error.
6274 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6276 (Target_arm::got_mode_index_entry): Handle static linking.
6277 (Target_arm::Scan::local): Ditto.
6278 (Target_arm::Scan::global): Ditto.
6279 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6280 all incorrectly implemented relocations.
6281 (Target_arm::fix_exidx_coverage): Pass layout to
6282 Arm_output_section::fix_exidx_coverage.
6283 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6284 from ".ARM.exidx." and ".ARM.extab.".
6286 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6288 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6289 section if it does not already exist.
6290 * attributes.cc (Attributes_section_data::Attributes_section_data):
6291 Don't crash if size is zero.
6293 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6294 Ian Lance Taylor <iant@google.com>
6296 * gold.cc (queue_middle_tasks): If no input files were opened,
6298 * workqueue.h (Task_function::Task_function): Assert that there is
6301 2010-02-22 Doug Kwan <dougkwan@google.com>
6303 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6304 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6305 types to avoid warnings due to different uint64_t implementations
6308 2010-02-21 Doug Kwan <dougkwan@google.com>
6310 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6311 handling of the maximum backward branch offset.
6312 (Arm_relocate_functions::thumb_branch_common): Ditto.
6313 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6314 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6315 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6316 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6317 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6318 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6319 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6320 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6321 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6322 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6323 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6324 thumb2_bl_out_of_range.o): New rules.
6325 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6326 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6327 thumb2_bl_out_of_range
6328 * testsuite/Makefile.in: Regenerate.
6329 * testsuite/arm_bl_in_range.s: New file.
6330 * testsuite/arm_bl_out_of_range.s: Ditto.
6331 * testsuite/arm_branch_in_range.sh: Ditto.
6332 * testsuite/arm_branch_range.t: Ditto.
6333 * testsuite/thumb2_branch_range.t: Ditto.
6334 * testsuite/thumb_bl_in_range.s: Ditto.
6335 * testsuite/thumb_bl_out_of_range.s: Ditto.
6336 * testsuite/thumb_branch_range.t: Ditto.
6338 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6340 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6341 Add reloc offset information.
6342 * icf.cc (get_section_contents): Change iterators to point to the new
6343 vectors. Add reloc offset information to the contents.
6344 * icf.h (Icf::Sections_reachable_info): New typedef.
6345 (Icf::Sections_reachable_list): New typedef.
6346 (Icf::Offset_info): New typedef.
6347 (Icf::Reloc_info): New struct typedef.
6348 (Icf::Reloc_info_list): New typedef.
6349 (Icf::symbol_reloc_list): Delete method.
6350 (Icf::addend_reloc_list): Delete method.
6351 (Icf::section_reloc_list): Delete method.
6352 (Icf::reloc_info_list): New method.
6353 (Icf::reloc_info_list_): New member.
6355 2010-02-19 Doug Kwan <dougkwan@google.com>
6357 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6358 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6359 * arm.cc (Arm_relocation_functions): New forward declaration.
6360 (Target_arm::Target_arm): Initialize new data members
6361 got_mod_index_offset_ and tls_base_symbol_defined_.
6362 (Target_arm::Relocate::relocate_tls): New method.
6363 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6364 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6366 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6367 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6368 (Target_arm::got_mod_index_offset_,
6369 Target_arm::tls_base_symbol_defined_): New data members.
6370 (Target_arm::Scan::local, Target::Scan::global,
6371 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6374 2010-02-18 Doug Kwan <dougkwan@google.com>
6376 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6377 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6378 text section as a parameter becuase some broken tools may not set
6379 the link in section header.
6380 (Target_arm::has_got_section): New method.
6381 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6382 without any mapping symbol as data only. Remove warning.
6383 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6384 link in its section header, try to discover the link by inspecting the
6385 REL31 relocation at the beginning of the section.
6386 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6388 (Target_arm::Scan::global): Treat any reference to the symbol
6389 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6391 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6393 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6394 (Scan::global_reloc_may_be_function_pointer): New function.
6395 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6396 (Scan::global_reloc_may_be_function_pointer): New function.
6397 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6398 (Scan::global_reloc_may_be_function_pointer): New function.
6399 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6400 (Scan::global_reloc_may_be_function_pointer): New function.
6401 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6402 (Scan::global_reloc_may_be_function_pointer): New function.
6403 (Scan::possible_function_pointer_reloc): New function.
6404 (Target_x86_64::can_check_for_function_pointers): New function.
6405 * gc.h (gc_process_relocs): Scan relocation types to determine if
6406 function pointers were taken for targets that support it.
6407 * icf.cc (Icf::find_identical_sections): Include functions for
6408 folding in safe ICF whose pointer is not taken.
6409 * icf.h (Secn_fptr_taken_set): New typedef.
6410 (fptr_section_id_): New member.
6411 (section_has_function_pointers): New function.
6412 (set_section_has_function_pointers): New function.
6413 (check_section_for_function_pointers): New function.
6414 * options.h: Fix comment for safe ICF option.
6415 * target.h (can_check_for_function_pointers): New function.
6416 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6417 Modify icf_safe_test for X86-64.
6418 * testsuite/Makefile.in: Regenerate.
6419 * testsuite/icf_safe_so_test.cc: New file.
6420 * testsuite/icf_safe_so_test.sh: New file.
6421 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6422 (main): Change to take pointer to function kept_func_3.
6423 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6424 folding is done correctly for X86-64.
6426 2010-02-12 David S. Miller <davem@davemloft.net>
6428 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6429 is_symbolless parameter.
6430 (Output_reloc<SHT_REL>::is_symbolless): New.
6431 (Output_reloc<SHT_REL>::is_symbolless_): New.
6432 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6433 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6434 (Output_reloc<SHT_RELA>::is_symbolless): New.
6435 (Output_data_reloc::add_global): Handle is_symbolless.
6436 (Output_data_reloc::add_global_relative): Likewise.
6437 (Output_data_reloc::add_local): Likewise.
6438 (Output_data_reloc::add_local_relative): Likewise.
6439 (Output_data_reloc::add_symbolless_global_addend): New.
6440 (Output_data_reloc::add_symbolless_local_addend): New.
6441 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6443 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6444 instead of ->is_relative_
6445 (Output_reloc::write): Likewise.
6446 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6447 (Output_reloc::write_rel): Simplify.
6449 * sparc.cc (Target_sparc::Scan::local): Use
6450 ->add_symbolless_local_addend as needed.
6451 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6452 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6453 based upon relocation offset.
6455 2010-02-11 Doug Kwan <dougkwan@google.com>
6457 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6458 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6459 beginning of function.
6460 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6461 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6462 parameter is_32bit in calls to should_apply_static_reloc.
6463 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6464 (check_DATA): Add arm_abs_global.stdout.
6465 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6466 arm_abs_global.stdout): New rules.
6467 (MOSTLLYCLEANFILES): Add arm_abs_global
6468 * Makefile.in: Regenerate.
6469 * testsuite/arm_abs_global.s: New file.
6470 * testsuite/arm_abs_global.sh: Ditto.
6471 * testsuite/arm_abs_lib.s: Ditto.
6473 2010-02-11 Ian Lance Taylor <iant@google.com>
6475 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6477 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6478 Allocate_commons_task first.
6479 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6480 task, rather than symtab_lock_.
6481 (Gc_process_relocs::~Gc_process_relocs): New function.
6482 (Gc_process_relocs::is_runnable): Check this_blocker_.
6483 (Gc_process_relocs::locks): Use next_blocker_ rather than
6485 (Scan_relocs::~Scan_relocs): New function.
6486 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6488 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6490 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6491 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6492 constructor accordingly.
6493 (class Gc_process_relocs): Likewise.
6494 (class Scan_relocs): Likewise.
6495 * common.h (class Allocate_commons_task): Remove symtab_lock_
6496 field, and corresponding constructor parameter.
6497 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6499 (Allocate_commons_task::locks): Likewise.
6501 2010-02-11 Ian Lance Taylor <iant@google.com>
6503 * gold-threads.h (class Once): Define.
6504 (class Initialize_lock): Rewrite as child of Once.
6505 * gold-threads.cc (class Once_initialize): Define.
6506 (once_pointer_control): New static variable.
6507 (once_pointer, once_arg): New static variables.
6508 (c_run_once): New static function.
6509 (Once::Once, Once::run_once, Once::internal_run): New functions.
6510 (class Initialize_lock_once): Remove.
6511 (initialize_lock_control): Remove.
6512 (initialize_lock_pointer): Remove.
6513 (initialize_lock_once): Remove.
6514 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6515 (Initialize_lock::initialize): Rewrite.
6516 (Initialize_lock::do_run_once): New function.
6517 * archive.cc (Archive::interpret_header): Only clear name if it is
6519 * fileread.cc: Include "gold-threads.h"
6520 (file_counts_lock): New static variable.
6521 (file_counts_initialize_lock): Likewise.
6522 (File_read::release): Only increment counts when using --stats.
6523 Use a lock around the increment.
6524 * parameters.cc (class Set_parameters_target_once): Define.
6525 (set_parameters_target_once): New static variable.
6526 (Parameters::Parameters): Move here from parameters.h.
6527 (Parameters::set_target): Rewrite.
6528 (Parameters::set_target_once): New function.
6529 (Parameters::clear_target): Move here and rewrite.
6530 * parameters.h (class Parameters): Update declarations. Add
6531 set_parameters_target_once_ field.
6532 (Parameters::Parameters): Move to parameters.cc.
6533 (Parameters::clear_target): Likewise.
6534 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6536 (Start_group::~Start_group): New function.
6537 (Start_group::is_runnable): New function.
6538 (Start_group::locks, Start_group::run): New functions.
6539 (Finish_group::run): Change saw_undefined to size_t.
6540 * readsyms.h (class Start_group): Define.
6541 (class Finish_group): Change saw_undefined_ field to size_t.
6542 (Finish_group::Finish_group): Remove saw_undefined and
6543 this_blocker parameters. Change all callers.
6544 (Finish_group::set_saw_undefined): New function.
6545 (Finish_group::set_blocker): New function.
6546 * symtab.h (class Symbol_table): Change saw_undefined to return
6547 size_t. Change saw_undefined_ field to size_t.
6548 * target-select.cc (Set_target_once::do_run_once): New function.
6549 (Target_selector::Target_selector): Initialize set_target_once_
6550 field. Don't initialize lock_ and initialize_lock_ fields.
6551 (Target_selector::instantiate_target): Rewrite.
6552 (Target_selector::set_target): New function.
6553 * target-select.h (class Set_target_once): Define.
6554 (class Target_selector): Update declarations. Make
6555 Set_target_once a friend. Remove lock_ and initialize_lock_
6556 fields. Add set_target_once_ field.
6558 2010-02-10 Ian Lance Taylor <iant@google.com>
6560 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6562 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6563 (queue_middle_tasks): Add all blockers before queueing any tasks.
6564 (queue_final_tasks): Likewise.
6565 * token.h (Task_token::add_blockers): New function.
6566 * object.h (Input_objects::number_of_relobjs): New function.
6568 2010-02-10 Ian Lance Taylor <iant@google.com>
6570 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6571 shared, not if not position independent.
6572 * x86_64.cc (Relocate::relocate_tls): Likewise.
6573 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6574 (tls_pie_pic_test): New target.
6575 * testsuite/Makefile.in: Rebuild.
6577 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6578 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6579 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6580 * testsuite/Makefile.in: Rebuild.
6582 2010-02-09 David S. Miller <davem@davemloft.net>
6584 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6585 R_SPARC_RELATIVE using ->add_local_relative().
6586 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6588 * output.h (Output_data_dynamic::add_section_size): New method
6589 that takes two Output_data objects.
6590 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6591 entry param. Handle it in initializers.
6592 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6593 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6594 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6596 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6597 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6598 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6599 for dynrel_includes_plt.
6600 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6601 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6602 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6604 (Target_sparc::do_finalize_sections): Update to pass true for
6605 dynrel_includes_plt.
6606 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6607 output before .rela.plt
6608 (Target_powerpc::do_finalize_sections): Update to pass true for
6609 dynrel_includes_plt when 32-bit.
6611 2010-02-08 Doug Kwan <dougkwan@google.com>
6613 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6615 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6616 Arm_relobj::scan_section_for_cortex_a8_stubs,
6617 Arm_relobj::do_relocation_section): Instead of calling
6618 Output_section::output_address, use faster
6619 Arm_relobj::simple_input_section_output_address.
6621 2010-02-08 David S. Miller <davem@davemloft.net>
6623 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6624 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6625 relocation helper function.
6627 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6628 just like R_SPARC_GOT{10,13,22}.
6629 (Target_sparc::Scan::local): Likewise.
6630 (Target_sparc::Relocate:relocate): Likewise.
6632 2010-02-06 Ian Lance Taylor <iant@google.com>
6634 * configure.ac: Rewrite targetobjs duplicate removal code to use
6635 only shell constructs.
6636 * configure: Rebuild.
6638 2010-02-05 Doug Kwan <dougkwan@google.com>
6641 * arm.cc (Arm_relobj::section_is_scannable): New method.
6642 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6643 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6645 2010-02-04 Doug Kwan <dougkwan@google.com>
6648 * arm-reloc-property.cc (cstdio): Include.
6649 * configure.ac (targetobjs): Remove duplicates.
6650 * configure: Regenerate.
6651 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6652 big and little endian version for a given address size.
6654 2010-02-03 Doug Kwan <dougkwan@google.com>
6656 * arm-reloc-property.cc
6657 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6659 * arm-reloc-property.h
6660 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6661 New method definition.
6662 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6664 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6666 (GOT_PREL): Change implemented to Y.
6667 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6668 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6669 (Arm_relocate_functions::movw_abs_nc): Remove method.
6670 (Arm_relocate_functions::movt_abs): Ditto.
6671 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6672 (Arm_relocate_functions::thm_movt_abs): Ditto.
6673 (Arm_relocate_functions::movw_rel_nc): Ditto.
6674 (Arm_relocate_functions::movw_rel): Ditto.
6675 (Arm_relocate_functions::movt_rel): Ditto.
6676 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6677 (Arm_relocate_functions:thm_movw_rel): Ditto.
6678 (Arm_relocate_functions:thm_movt_rel): Ditto.
6679 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6680 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6681 New method definitions.
6682 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6683 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6684 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6685 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6686 (Target_arm::Relocate::relocate): Check for non-static or
6687 unimplemented relocation code and exit early. Change calls to
6688 Target_arm::reloc_uses_thumb_bit and
6689 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6690 instead. Refactor code to handle similar relocations to increase
6691 code sharing. Remove check for unsupported relocation code in switch
6693 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6694 relocation property table to find out size. Change error message to
6695 print out the name of a relocation code instead of the numeric value.
6696 (Target_arm::scan_reloc_for_stub): Use relocation property table
6697 instead of calling Target_arm::reloc_uses_thumb_bit().
6699 2010-02-02 Doug Kwan <dougkwan@google.com>
6701 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6702 types of relaxed input section.
6704 2010-02-02 Doug Kwan <dougkwan@google.com>
6706 * Makefile.am (HFILES): Add arm-reloc-property.h.
6708 (TARGETSOURCES): Add arm-reloc-property.cc
6709 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6710 (libgold_a_SOURCES): $(DEFFILES)
6711 * Makefile.in: Regenerate.
6712 * arm-reloc-property.cc: New file.
6713 * arm-reloc-property.h: New file.
6714 * arm-reloc.def: New file.
6715 * arm.cc: Update comments.
6716 (arm-reloc-property.h): New included header.
6717 (arm_reloc_property_table): New global variable.
6718 (Target_arm::do_select_as_default_target): New method definition.
6719 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6720 arm-reloc-property to targ_extra_obj.
6721 * parameters.cc (set_parameters_target): Call
6722 Target::select_as_default_target().
6723 * target.h (Target::select_as_default_target): New method definition.
6724 (Target::do_select_as_default_target): Same.
6726 2010-02-01 Doug Kwan <dougkwan@google.com>
6728 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6729 first_output_text_section_.
6730 (Arm_exidx_fixup::first_output_text_section): New method definition.
6731 (Arm_exidx_fixup::first_output_text_section_): New data member.
6732 (Arm_exidx_fixup::process_exidx_section): Record the first text
6733 output section seen.
6734 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6735 and entsize in output section header.
6737 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6739 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6740 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6741 (Arm_relocate_functions::thm_alu11): New Method.
6742 (Arm_relocate_functions::thm_pc8): New Method.
6743 (Arm_relocate_functions::thm_pc12): New Method.
6744 (Target_arm::Scan::local): Handle the relocations.
6745 (Target_arm::Scan::global): Likewise.
6746 (Target_arm::Relocate::relocate): Likewise.
6747 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6749 2010-01-29 Doug Kwan <dougkwan@google.com>
6751 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6752 of relocation types as ld.
6754 2010-01-29 Doug Kwan <dougkwan@google.com>
6756 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6758 (Arm_relocate_functions::thumb_branch_common): Ditto.
6759 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6760 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6761 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6762 Arm_relocate_functions::jump24): Remove.
6763 (Target_arm::Relocate::relocate): Adjust code to call
6764 Arm_relocation_functions::arm_branch_common and
6765 Arm_relocation_functions::thumb_branch_common instead of their removed
6766 wrappers. Merge switch-cases together to reduce source code size.
6768 2010-01-29 Doug Kwan <dougkwan@google.com>
6770 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6771 output_local_symbol_count_needs_update_.
6772 (Arm_relobj::output_local_symbol_count_needs_update,
6773 Arm_relobj::set_output_local_symbol_count_needs_update,
6774 Arm_relobj::update_output_local_symbol_count): New methods.
6775 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6777 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6778 of pointed function as in a R_ARM_PREL31 relocation.
6779 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6780 for output local symbol count updating.
6781 (Target_arm::do_relax): Update output local symbol counts in objects
6783 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6785 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6787 * arm.cc: Added support for the ARM relocations:
6788 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6789 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6790 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6792 (Arm_relocate_functions::movw_rel): New method.
6793 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6794 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6796 (Arm_relocate_functions::thm_movw_rel): New method.
6797 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6799 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6801 (Target_arm::Scan::global): Likewise.
6802 (Target_arm::Relocate::relocate): Likewise.
6803 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6806 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6808 * arm.cc: Added support for ARM group relocations.
6809 (Target_arm::reloc_needs_sym_origin): New method.
6810 (Arm_relocate_functions::calc_grp_kn): New method.
6811 (Arm_relocate_functions::calc_grp_residual): New method.
6812 (Arm_relocate_functions::calc_grp_gn): New method.
6813 (Arm_relocate_functions::arm_grp_alu): New Method.
6814 (Arm_relocate_functions::arm_grp_ldr): New Method.
6815 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6816 (Arm_relocate_functions::arm_grp_ldc): New Method.
6817 (Target_arm::Scan::local): Handle the ARM group relocations.
6818 (Target_arm::Scan::global): Likewise.
6819 (Target_arm::Relocate::relocate): Likewise.
6820 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6823 2010-01-26 Doug Kwan <dougkwan@google.com>
6825 * arm.cc (set): Include.
6826 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6828 (Arm_output_section::Text_section_list): New type.
6829 (Arm_output_section::append_text_sections_to_list): New method.
6830 (Arm_output_section::fix_exidx_coverage): Ditto.
6831 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6832 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6833 Relobj::set_section_offset() instead of
6834 Sized_relobj::invalidate_section_offset().
6835 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6836 parameter for section headers. Ignore relocation sections for
6837 unallocated sections and EXIDX sections.
6838 (Target_arm::fix_exidx_coverage): New method.
6839 (Target_arm::output_section_address_less_than): New type.
6840 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6841 linked text section instead of the EXIDX section.
6842 (Arm_output_section::create_stub_group): Add an assertion to check
6843 that this is not an EXIDX output section.
6844 (Arm_output_section::append_text_sections_to_list): New method.
6845 (Arm_output_section::fix_exidx_coverage): Ditto.
6846 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6847 Arm_relobj::section_needs_reloc_stub_scanning.
6848 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6850 (Target_arm::fix_exidx_coverage): New method.
6851 * object.h (Relobj::set_output_section): New method.
6852 (Sized_relobj::invalidate_section_offset): Remove method.
6853 (Sized_relobj::do_invalidate_section_offset): Remove method.
6854 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6856 2010-01-25 Doug Kwan <dougkwan@google.com>
6858 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6859 Fix warning due to signed and unsigned comparison on a 32-bit host.
6861 2010-01-22 Doug Kwan <dougkwan@google.com>
6863 * arm.cc (Target_arm::do_relax): Record an output section for section
6864 offset adjustment it contains any stub table that has changed.
6865 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6866 offsets in an output section if necessary.
6867 * output.cc (Output_section::Output_section): Initialize
6868 section_offsets_need_adjustments_.
6869 (Output_section::add_input_section_for_script): Renamed to
6870 Output_section::add_simple_input_section.
6871 (Output_section::save_states): Add a comment.
6872 (Output_section::discard_states): New method defintion.
6873 (Output_section::adjust_section_offsets): Same.
6874 * output.h (Output_section::add_input_section_for_script): Renamed to
6875 Output_section::add_simple_input_section.
6876 (Output_section::discard_states): New method declaration.
6877 (Output_section::adjust_section_offsets): Same.
6878 (Output_section::section_offsets_need_adjustment,
6879 Output_section::set_section_offsets_need_adjustment): New method
6881 (Output_section::section_offsets_need_adjustment_): New data member.
6882 * script-sections.cc
6883 (Output_section_element_input::set_section_address): Adjust code for
6884 renaming of Output_section::add_input_section_for_script.
6885 (Orphan_output_section::set_section_address): Same.
6887 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6889 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6890 Fix_v4bx enum values .
6891 * gold/options.h (General_options): New option definitions.
6892 (General_options::fix_v4bx): New method.
6893 (General_options::Fix_v4bx): New enum.
6894 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6895 (General_options::parse_fix_v4bx_interworking): New method.
6897 2010-01-22 Doug Kwan <dougkwan@google.com>
6899 * arm.cc (Arm_exidx_fixup): New class.
6901 2010-01-21 Doug Kwan <dougkwan@google.com>
6903 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6905 (Arm_exidx_section_offset_map): New type.
6907 2010-01-21 Doug Kwan <dougkwan@google.com>
6909 * arm.cc (Arm_exidx_input_section): New class.
6910 (Arm_relobj::exidx_input_section_by_link,
6911 Arm_relobj::exidx_input_section_by_shndx,
6912 Arm_relobj::make_exidx_input_section): New methods.
6913 (read_arm_attributes_section): Remove.
6914 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6915 information about them.
6916 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6919 2010-01-20 Doug Kwan <dougkwan@google.com>
6921 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6922 Input_section_specifier to Section_id.
6923 (Target_arm::new_arm_input_section: Adjust code for change of key
6925 (Target_arm::find_arm_input_section): Ditto.
6926 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6927 (Section_id): Remove.
6928 (Garbage_collection::Section_id_hash): Remove.
6929 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6930 (Section_id): Remove.
6931 (Icf::Section_id_hash): Remove.
6932 * object.h (Section_id, Const_section_id, Section_id_hash,
6933 Const_section_id_hash): New type definitions.
6934 * output.cc (Output_section::add_relaxed_input_section): Change to
6935 use Const_section_id instead of Input_section_specifier as key type.
6936 (Output_section::add_merge_input_section): Ditto.
6937 (Output_section::build_relaxation_map): Change to use Section_id
6938 instead of Input_section_specifier as key type.
6939 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6941 (Output_section::convert_input_sections_to_relaxed_sections): Change
6942 to use Const_section_id instead of Input_section_specifier as key type.
6943 (Output_section::find_merge_section): Ditto.
6944 (Output_section::find_relaxed_input_section): Ditto.
6945 * output.h (Input_section_specifier): Remove class.
6946 (Output_section::Output_section_data_by_input_section_map): Change
6947 key type to Const_section_id.
6948 (Output_section::Output_relaxed_input_section_by_input_section_map):
6950 (Output_section::Relaxation_map): Change key type to Section_id.
6952 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6954 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6955 (class Arm_v4bx_stub): New class.
6956 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6957 (Stub_factory::make_arm_v4bx_stub): New method.
6958 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6959 (Stub_table::empty): Handle v4bx stubs.
6960 (Stub_table::add_arm_v4bx_stub): New method.
6961 (Stub_table::find_arm_v4bx_stub): New method.
6962 (Arm_relocate_functions::v4bx): New method.
6963 (Target_arm::fix_v4bx): New method.
6964 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6965 (Stub_table::relocate_stubs): Likewise.
6966 (Stub_table::do_write): Likewise.
6967 (Stub_table::update_data_size_and_addralign): Likewise.
6968 (Stub_table::finalize_stubs): Likewise.
6969 (Target_arm::Scan::local): Likewise.
6970 (Target_arm::Scan::global): Likewise.
6971 (Target_arm::do_finalize_sections): Likewise.
6972 (Target_arm::Relocate::relocate): Likewise.
6973 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6975 (Target_arm::scan_reloc_for_stub): Likewise.
6976 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6978 2010-01-19 Ian Lance Taylor <iant@google.com>
6980 * output.cc (Output_section_headers::do_sized_write): Write large
6981 segment count to sh_info field.
6982 (Output_file_header::do_sized_write): For large segment count,
6983 write PN_XNUM to e_phnum field.
6985 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6987 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6988 (Arm_relocate_functions::thm_jump8): New function.
6989 (Arm_relocate_functions::thm_jump11): New function.
6990 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6992 (Target_arm::Scan::global): Likewise.
6993 (Target_arm::Relocate::relocate): Likewise.
6994 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6997 2010-01-14 Doug Kwan <dougkwan@google.com>
6999 * arm.cc (map, utility): Include headers.
7000 (Target_arm::apply_cortex_a8_workaround): New method.
7001 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7002 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7003 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7004 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7005 the --[no-]fix-cortex-a8 command line options.
7006 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7007 (Target_arm::relocate_stub): Use addend in instruction template.
7008 * options.h (DEFINE_bool): Set the user-set flag.
7009 (General_options): Add --[no-]-fix-cortex options.
7010 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
7011 : Update fast look-up map after conversion.
7013 2010-01-14 Sriraman Tallam <tmsriram@google.com>
7015 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7016 in the first pass of do_layout.
7018 2010-01-13 Doug Kwan <dougkwan@google.com>
7020 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7021 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7022 apparent compiler problem of not folding static constant integral
7023 data members of elfcpp::Elf_sizes<32>.
7025 2010-01-13 Doug Kwan <dougkwan@google.com>
7027 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7028 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7029 Arm_relobj::scan_section_for_cortex_a8_erratum,
7030 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7031 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7032 sections to scan for relocation stubs into a new method
7033 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7034 relocation and Cortex-A8 stub scanning.
7035 (Target_arm::do_relax): Force stubs to be after stubbed sections
7036 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
7037 the beginning of a new relaxation pass. Update a comment.
7038 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7040 2010-01-12 Ian Lance Taylor <iant@google.com>
7042 * target-reloc.h (visibility_error): New inline function.
7043 (relocate_section): Call visibility_error.
7044 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7045 (MOSTLYCLEANFILES): Likewise.
7046 (protected_4_pic.o, protected_3.err): New targets.
7047 * testsuite/protected_4.cc: New file.
7049 2010-01-12 Doug Kwan <dougkwan@google.com>
7051 * arm.cc (Cortex_a8_reloc): New class.
7052 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7053 and cortex_a8_relocs_info_.
7054 (Target_arm::fix_cortex_a8): New method definition.
7055 (Target_arm::Cortex_a8_relocs_info): New type.
7056 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7057 New data member declarations.
7058 (Target_arm::scan_reloc_for_stub): Record information about
7059 relocations for THUMB branches that might be exempted from the
7060 Cortex-A8 workaround.
7061 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7062 at the beginning of a relaxation pass.
7064 2010-01-12 Doug Kwan <dougkwan@google.com>
7066 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7067 (Arm_relobj::Mapping_symbol_position,
7068 Arm_reloj::Mapping_symbol_position_less,
7069 Arm_relobj::Mapping_symbols_info): New types.
7070 (Target_arm::is_mapping_symbol_name): New method definition.
7071 (Arm_relobj::do_count_local_symbols): Save information about mapping
7074 2010-01-11 Doug Kwan <dougkwan@google.com>
7076 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7077 Arm_relocate_functions::thumb32_branch_upper,
7078 Arm_relocate_functions::thumb32_branch_lower,
7079 Arm_relocate_functions::thumb32_cond_branch_offset,
7080 Arm_relocate_functions::thumb32_cond_branch_upper,
7081 Arm_relocate_functions::thumb32_cond_branch_lower,
7082 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7083 branch offset encoding.
7084 (Arm_relocate_functions::thumb_branch_common): Use new branch
7085 offset encoding methods to avoid code duplication.
7086 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7087 (Stub_addend_reader::operator()): Use new branch encoding method
7088 to avoid code duplication.
7090 2010-01-11 Doug Kwan <dougkwan@google.com>
7092 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7093 (Target_arm::do_finalize_sections): Define special EXIDX section
7094 symbols only if referenced.
7095 * gc.h (Garbage_collection::add_reference): New method.
7096 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7099 2010-01-11 Ian Lance Taylor <iant@google.com>
7101 * script.cc (Version_script_info::build_expression_list_lookup):
7102 Change complaing about duplicate wildcard match from error to
7105 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7107 (Version_script_info::Version_script_info): Initialize globs_,
7108 default_version_, default_is_global_, and exact_. Don't
7109 initialize globals_ or locals_.
7110 (Version_script_info::build_lookup_tables): Build local symbols
7112 (Version_script_info::unquote): New function.
7113 (Version_script_info::add_exact_match): New function.
7114 (Version_script_info::build_expression_list_lookup): Remove lookup
7115 parameter. Add is_global parameter. Change all callers. Handle
7116 wildcard pattern specially. Unquote pattern. Call
7118 (Version_script_info::get_name_to_match): New function.
7119 (Version_script_info::get_symbol_version): New function.
7120 (Version_script_info::get_symbol_version_helper): Remove.
7121 (Version_script_info::check_unmatched_names): Call unquote.
7122 * script.h (class Version_script_info): Change get_symbol_version
7123 to be non-inline and add is_global parameter; change all callers.
7124 Rewrite symbol_is_local. Update declarations. Define struct
7125 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7126 Remove globals_ and locals_ members. Add exact_, globs_,
7127 default_version_, is_global_.
7128 (Version_script_info::Glob): Remove pattern, add expression and
7129 is_global. Update constructor. Change all callers.
7130 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7132 (Versions::symbol_section_contents): If a symbol is undefined, or
7133 defined in a dynamic object, set the version index to
7135 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7137 (Symbol_table::add_from_pluginobj): Likewise.
7138 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7140 2010-01-11 Doug Kwan <dougkwan@google.com>
7142 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7143 (incremental_dump_LDADD): Add linking option for libintl.
7144 * Makefile.in: Regenerate.
7146 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7149 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7151 * testsuite/Makefile.in: Regenerated.
7153 2010-01-10 Doug Kwan <dougkwan@google.com>
7155 * options.h (DEFINE_var): Use parentheses around argument varname__
7156 in macro body to avoid any unintended subsequent substitutions.
7158 2010-01-10 Ian Lance Taylor <iant@google.com>
7160 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7161 candidates before doing symbol resolution.
7163 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7164 ODR candidates if only one is weak.
7166 2010-01-08 Ian Lance Taylor <iant@google.com>
7168 * script.cc (Version_script_info::build_expression_list_lookup):
7169 Don't warn about ambiguous version, just record the ambiguity.
7170 (Version_script_info::get_symbol_version_helper): Give error if
7171 version is ambiguous.
7173 2010-01-08 Doug Kwan <dougkwan@google.com>
7175 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7176 prev_data_size_ and prev_addralign_. Remove initializer for
7177 deleted data member has_been_changed_.
7178 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7179 to determine if the table is empty.
7180 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7182 (Stub_table::add_reloc_stub): Define method in class definition
7183 instead of just declaring it there.
7184 (Stub_table::add_cortex_a8_stub): New method definition.
7185 (Stub_table::update_data_size_and_addralign): Ditto.
7186 (Stub_table::finalize_stubs): Ditto.
7187 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7188 (Stub_table::do_addralign_): Return address alignment in the
7189 (Stub_table::do_reset_address_and_file_offset): Define method in
7190 class definition instead of declaring it there. Set current data
7191 size to be the data size of the previous pass.
7192 (Stub_table::set_final_data_size): Use current data size as the
7194 (Stub_table::relocate_stub): Change parameter type of stub from
7195 Reloc_stub pointer to Stub pointer.
7196 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7197 (Stub_table::Cortex_a8_stub_list): New typedef.
7198 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7199 Stub_table::prev_addralign_): New data member.
7200 (Arm_relobj::Arm_relobj): Initialize data member
7201 section_has_cortex_a8_workaround_.
7202 (Arm_relobj::section_has_cortex_a8_workaround,
7203 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7205 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7207 (Target_arm::relocate_stub): Change parameter type of stub from
7208 Reloc_stub pointer to Stub pointer.
7209 (Insn_template::size, Insn_template::alignment): Handle
7210 THUMB16_SPECIAL_TYPE.
7211 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7212 Stub_table::update_data_size_and_addralign,
7213 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7215 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7216 (Stub_table::do_write): Ditto.
7217 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7219 2010-01-08 Ian Lance Taylor <iant@google.com>
7222 * symtab.h (class Symbol): Remove fields is_target_special_ and
7223 has_plt_offset_. Add field is_defined_in_discarded_section_.
7224 (Symbol::is_defined_in_discarded_section): New function.
7225 (Symbol::set_is_defined_in_discarded_section): New function.
7226 (Symbol::has_plt_offset): Rewrite.
7227 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7228 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7229 Don't initialize is_target_special_ or has_plt_offset_.
7230 Initialize is_defined_in_discarded_section_.
7231 (Symbol_table::add_from_relobj): If appropriate, set
7232 is_defined_in_discarded_section.
7233 * resolve.cc (Symbol::override_base_with_special): Don't test
7234 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7235 * target-reloc.h (relocate_section): Do special handling for
7236 symbols defined in discarded sections for global symbols as well
7239 2010-01-08 Ian Lance Taylor <iant@google.com>
7241 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7242 the SHT_SYMTAB case.
7244 2010-01-08 Ian Lance Taylor <iant@google.com>
7246 * object.cc (Sized_relobj::do_layout): Don't get confused if
7247 layout_eh_frame returns NULL.
7249 2010-01-08 Ian Lance Taylor <iant@google.com>
7252 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7253 dynamic symbol table, use the normal symbol table.
7254 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7257 2010-01-08 Ian Lance Taylor <iant@google.com>
7260 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7263 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7265 * version.cc (print_version): Change to "Copyright 2010".
7267 2010-01-08 Ian Lance Taylor <iant@google.com>
7271 * i386.cc (class Target_i386): Change return type of plt_section
7273 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7274 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7275 tls_desc_rel_ field.
7276 (Output_data_plt_i386::rel_tls_desc): New function.
7277 (Target_i386::rel_tls_desc_section): New function.
7278 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7279 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7280 R_386_TLS_DESC reloc in rel_tls_desc_section.
7281 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7282 Define struct Tlsdesc_info.
7283 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7284 (Target_x86_64::do_reloc_symbol_index): New function.
7285 (Target_x86_64::add_tlsdesc_info): New function.
7286 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7287 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7289 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7291 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7292 (Target_x86_64::rela_tlsdesc_section): New function.
7293 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7295 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7296 (Target_x86_64::do_reloc_addend): New function.
7297 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7298 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7299 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7300 (Output_reloc::type): New function.
7301 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7302 (Output_reloc::is_target_specific): New function.
7303 (Output_reloc::target_arg): New function.
7304 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7305 absolute relocs and target specific relocs.
7306 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7307 add_target_specific.
7308 (class Output_data_reloc) [SHT_RELA]: Likewise.
7309 * output.cc (Output_reloc::Output_reloc): Add four new versions
7310 for absolute relocs and target specific relocs.
7311 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7312 (Output_reloc::get_symbol_index): Likewise.
7313 (Output_reloc::local_section_offset): Check that local_sym_index_
7314 is not TARGET_CODE or 0.
7315 (Output_reloc::symbol_value): Likewise.
7316 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7318 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7319 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7321 * layout.cc (add_target_dynamic_tags): Use output section for
7322 DT_PLTRELSZ and DT_JMPREL.
7324 2010-01-07 Ian Lance Taylor <iant@google.com>
7327 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7329 (class Output_data_reloc_generic): Define.
7330 (class Output_data_reloc_base): Change base class to
7331 Output_data_reloc_generic. Change add() method to call
7332 bump_relative_reloc_count for a relative reloc. Remove
7334 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7336 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7337 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7339 * layout.h (class Layout): Update declaration.
7341 2010-01-07 Ian Lance Taylor <iant@google.com>
7343 * output.h (class Output_data): Add const version of
7344 output_section and do_output_section.
7345 (class Output_section_data): Add const version of
7347 (class Output_section): Likewise.
7348 * layout.cc (Layout::add_target_dynamic_tags): New function.
7349 * layout.h (class Layout): Update declarations.
7350 * arm.cc (Target_arm::do_finalize_sections): Use
7351 add_target_dynamic_tags.
7352 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7353 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7354 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7355 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7357 2010-01-07 Ian Lance Taylor <iant@google.com>
7360 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7363 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7364 Ian Lance Taylor <iant@google.com>
7367 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7368 Xindex::read_symtab_xindex.
7370 2010-01-07 Doug Kwan <dougkwan@google.com>
7372 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7373 (Insn_template::thumb16_bcond_insn): New method declaration.
7374 (Insn_template): Fix spelling.
7375 (Stub::thumb16_special): New method declaration.
7376 (Stub::do_write): Define virtual method which was previously pure
7378 (Stub::do_thumb16_special): New method declaration.
7379 (Stub::do_fixed_endian_write): New template member.
7380 (Reloc_stub::do_write): Remove.
7381 (Reloc_stub::do_fixed_endian_write): Remove.
7382 (Cortex_a8_stub): New class definition.
7383 (Stub_factory::make_cortex_a8_stub): New method definition.
7384 (Stub_factory::Stub_factory): Add missing static storage class
7385 qualifier for elf32_arm_stub_a8_veneer_blx.
7387 2010-01-07 Ian Lance Taylor <iant@google.com>
7390 * options.h (class General_options): Add --warn-unresolved-symbols
7391 and --error-unresolved-symbols.
7392 * errors.cc (Errors::undefined_symbol): Implement
7393 --warn-unresolved-symbols.
7395 * options.h (class General_options): Add -z text and -z textoff.
7396 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7398 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7400 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7401 (Garbage_collection::cident_sections): New function.
7402 (Garbage_collection::add_cident_section): New function.
7403 (Garbage_collection::cident_sections_): New member.
7404 (gc_process_relocs): Add references to sections whose names are C
7406 * gold.h (cident_section_start_prefix): New constant.
7407 (cident_section_stop_prefix): New constant.
7408 (is_cident): New function.
7409 * layout.cc (Layout::define_section_symbols): Replace string constants
7410 with the newly defined constants.
7411 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7413 * testsuite/Makefile.am: Add gc_orphan_section_test.
7414 * testsuite/Makefile.in: Regenerate.
7415 * testsuite/gc_orphan_section_test.cc: New file.
7416 * testsuite/gc_orphan_section_test.sh: New file.
7418 2010-01-06 Ian Lance Taylor <iant@google.com>
7421 * options.h (class General_options): Add --warn-shared-textrel.
7422 * layout.cc (Layout::finish_dynamic_section): Implement
7423 --warn-shared-textrel.
7426 * options.h (class General_options): Add --warn-multiple-gp.
7428 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7430 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7431 $(THREADSLIB) and $(LIBDL).
7432 * Makefile.in: Rebuild.
7434 2010-01-06 Ian Lance Taylor <iant@google.com>
7437 * options.cc (General_options::parse_section_start): New function.
7438 (General_options::section_start): New function.
7439 (General_options::General_options): Initialize all members.
7440 * options.h: Include <map>
7441 (class General_options): Add --section-start. Add section_starts_
7443 * layout.cc (Layout::attach_allocated_section_to_segment): If
7444 --section-start was used, set the address of the segment. Remove
7445 local sort_sections.
7446 (Layout::relaxation_loop_body): If the address of the load segment
7447 has been set by --section-start, don't use it.
7448 * output.h (Output_segment::update_flags_for_output_section): New
7450 * output.cc (Output_segment::add_output_section): Call
7451 update_flags_for_output_section.
7453 2010-01-05 Ian Lance Taylor <iant@google.com>
7456 * options.h (class General_options): Add --undefined-version.
7457 * script.cc (struct Version_expression): Add was_matched_by_symbol
7459 (Version_script_info::matched_symbol): New function.
7460 (Version_script_info::get_symbol_version_helper): Call
7462 (Version_script_info::check_unmatched_names): New function.
7463 * script.h (class Version_script_info): Update declarations.
7464 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7466 * options.h (class General_options): Use DEFINE_bool_alias for
7467 allow_multiple_definition.
7468 * resolve.cc (Symbol_table::should_override): Don't test
7469 allow_multiple_definition.
7472 * options.h (class General_options): Add --cref.
7473 * main.cc (main): Print cref table if --cref. Don't close mapfile
7474 until after printing cref table.
7475 * cref.cc: Include "symtab.h".
7476 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7477 (Cref_table_compare::operator()): New function.
7478 (Cref_inputs::gather_cref): New function.
7479 (filecol): New static const.
7480 (Cref_inputs::print_cref): New function.
7481 (Cref::print_cref): New function.
7482 * cref.h: Include <cstdio>.
7483 (class Cref): Update declarations.
7484 * mapfile.h (Mapfile::file): New function.
7485 * object.h (class Object): Define Symbols. Declare virtual
7486 do_get_global_symbols.
7487 (Object::get_global_symbols): New function.
7488 * object.cc (Input_objects::add_object): Pass object to cref_ if
7490 (Input_objects::archive_start): Likewise.
7491 (Input_objects::archive_stop): Likewise.
7492 (Input_objects::print_cref): New function.
7493 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7494 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7496 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7498 * plugin.h (class Sized_pluginobj): Update declarations.
7500 2010-01-05 Ian Lance Taylor <iant@google.com>
7502 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7503 to is_default_version. Rename insdef to insdefault.
7504 (Symbol_table::add_from_relobj): Rename def to is_default_version
7505 and local to is_forced_local.
7506 (Symbol_table::add_from_pluginobj): Likewise.
7507 (Symbol_table::add_from_dynobj): Likewise.
7508 (Symbol_table::define_special_symbol): Rename insdef to
7511 2010-01-04 Ian Lance Taylor <iant@google.com>
7514 * options.h (class General_options): Add
7515 --allow-multiple-definition and -z muldefs.
7516 * resolve.cc (Symbol_table::should_override): Don't warn about a
7517 multiple symbol definition if --allow-multiple-definition or -z
7521 * options.h (class General_options): Add --add-needed and
7522 --copy-dt-needed-entries. Tweak --as-needed help entry.
7523 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7524 error if --copy-dt-needed-entries aka --add-needed is used and
7525 would cause a change in behaviour.
7528 * options.h (class General_options): Add -G as a short version of
7529 --shared. Add no-op options -assert, -g, and -i.
7531 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7533 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7534 check for .text or .gnu.linkonce.t sections.
7535 * icf.cc (Icf::find_identical_sections): Ditto.
7536 Change the detection for mangled function name within the section
7538 * icf.h (is_section_foldable_candidate): New function.
7540 2009-12-30 Ian Lance Taylor <iant@google.com>
7543 * options.h (class General_options): Permit two dashes with
7544 --retain-symbols-file.
7546 2009-12-30 Ian Lance Taylor <iant@google.com>
7549 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7550 don't put the file header and segment headers in the text
7554 * common.cc (Sort_commons::operator()): Stabilize sort when both
7556 (Symbol_table::do_allocate_commons_list): When allocating common
7557 symbols, skip a symbol which is no longer common.
7558 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7559 an object before checking its type.
7560 * testsuite/common_test_2.c: New file.
7561 * testsuite/common_test_3.c: New file.
7562 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7563 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7564 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7565 (common_test_2_pic.o, common_test_2.so): New targets.
7566 (common_test_3_pic.o, common_test_3.so): New targets.
7567 * testsuite/Makefile.in: Rebuild.
7570 * script.cc (read_input_script): If we see a new SECTIONS clause,
7571 and we have added an input section, give an error.
7572 * layout.h (class Layout): Add have_added_input_section function.
7573 Add have_added_input_section_ field.
7574 * layout.cc (Layout::Layout): Initialize
7575 have_added_input_section_.
7576 (Layout::layout): Set have_added_input_section_.
7577 (Layout::layout_eh_frame): Likewise.
7579 2009-12-30 Ian Lance Taylor <iant@google.com>
7582 * options.h (class General_options): Add --sort-common option.
7583 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7584 * common.cc (Sort_common): Add sort_order parameter to
7585 constructor. Add sort_order_ field.
7586 (Sort_commons::operator): Check sort_order_.
7587 (Symbol_table::allocate_commons): Determine the sort order.
7588 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7590 (Symbol_table::do_allocate_commons_list): Likewise.
7592 2009-12-30 Ian Lance Taylor <iant@google.com>
7595 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7596 symbols from this object, don't change the visibility of an
7598 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7600 2009-12-30 Ian Lance Taylor <iant@google.com>
7603 * script.h (class Version_script_info): Define Language enum.
7604 Update declarations. Define Glob, Exact, and Lookup types. Add
7605 new fields globals_, locals_, and is_finalized_.
7606 * script.cc: Various formatting fixes.
7607 (class Parser_closure): Change language_stack_ from a vector of
7608 std::string to one of Version_script_info::Language. Adjust all
7610 (class Lazy_demangler): Remove.
7611 (struct Version_expression): Change language from std::string to
7612 Version_script_info::Language.
7613 (Version_script_info::Version_script_info): New function.
7614 (Version_script_info::~Version_script_info): Don't call clear.
7615 (Version_script_info::finalize): New function.
7616 (Version_script_info::build_lookup_tables): New function.
7617 (Version_script_info::build_expression_list_lookup): New
7619 (Version_script_info::get_symbol_version_helper): Rewrite to use
7621 (Version_script_info::print_expression_list): Adjust to use
7622 Version_script_info::Language.
7623 (script_push_lex_into_version_mode): Check that the version script
7624 has not been finalized.
7625 (version_script_push_lang): Change language string to
7626 Version_script_info::Language.
7627 * options.cc (Command_line::version_script): New function.
7628 * options.h (class General_options): Add finalize_dynamic_list
7629 function. Change version_script from declaration to definition.
7630 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7631 * testsuite/version_script.map: Remove duplicate def of foo.
7632 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7634 * testsuite/Makefile.in: Rebuild.
7636 2009-12-30 Ian Lance Taylor <iant@google.com>
7639 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7640 if the input symbol index is 0, make the output symbol index 0.
7642 2009-12-30 Ian Lance Taylor <iant@google.com>
7645 * options.h (class General_options): Add -x/--discard-all.
7646 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7647 --discard-all. If the local symbol needs a dynamic entry, check
7648 that before handling --discard-locals.
7650 2009-12-30 Ian Lance Taylor <iant@google.com>
7653 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7655 (Output_segment::add_output_section): Don't change the flags if
7659 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7660 GNU hash table if they need a dynamic value. Otherwise, don't add
7661 them if they are defined in a dynamic object or are forced local.
7663 2009-12-29 Ian Lance Taylor <iant@google.com>
7666 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7667 .gnu.hash table for a 32-bit target.
7670 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7671 regular and a dynamic object only needs a dynamic symbol table
7672 entry if it is externally visible.
7675 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7676 constructor. Add global_offset_table_ field.
7677 (Target_i386::got_section): Set global_offset_table_.
7678 (Target_i386::do_finalize_sections): Set global_offset_table_
7680 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7681 in constructor. Add global_offset_table_ field.
7682 (Target_x86_64::got_section): Set global_offset_table_.
7683 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7686 * layout.cc (Layout::Layout): Initialize increase_relro_.
7687 (Layout::get_output_section): Add is_relro, is_last_relro, and
7688 is_first_non_relro parameters. Change all callers.
7689 (Layout::choose_output_section): Likewise.
7690 (Layout::add_output_section_data): Likewise.
7691 (Layout::make_output_section): Likewise.
7692 (Layout::set_segment_offsets): Clear increase_relro when using a
7694 * layout.h (class Layout): Add increase_relro method. Add
7695 increase_relro_ field. Update declarations.
7696 * output.cc (Output_section::Output_section): Initialize
7697 is_last_relro_ and is_first_non_relro_.
7698 (Output_segment::add_output_section): Group relro sections is
7699 do_sort is true. Handle is_last_relro and is_first_non_relro.
7700 (Output_segment::maximum_alignment): Remove relro handling.
7701 (Output_segment::set_section_addresses): Add increase_relro
7702 parameter. Change all callers. Add initial alignment to align
7703 relro sections on separate page. Remove old relro handling.
7704 (Output_segment::set_section_list_addresses): Remove in_relro
7705 parameter. Change all callers.
7706 (Output_segment::set_offset): Add increase parameter. Change all
7707 callers. Remove old relro handling.
7708 * output.h (class Output_section): Add new methods: is_last_relro,
7709 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7710 Add is_last_relro_ and is_first_non_relro_ fields.
7711 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7712 Create separate .got.plt section. Call increase_relro.
7713 * x86_64.cc (Target_x86_64::got_section): Likewise.
7714 * testsuite/relro_script_test.t: Add .got.plt.
7717 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7718 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7719 (Layout::finalize): Call set_dynamic_symbol_size.
7720 (Layout::set_dynamic_symbol_size): New function.
7721 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7722 set_dynamic_symbol_size.
7725 * output.h (class Output_section): Add is_entsize_zero_ field.
7726 * output.cc (Output_section::Output_section): Initialize
7728 (Output_section::set_entsize): If two different entsizes are
7729 requested, force it to zero.
7730 (Output_section::add_input_section): Set flags for .debug_str
7731 before updating section flags. Set entsize.
7732 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7733 and SHF_STRING if all input sections have those flags.
7735 2009-12-29 Rafael Espindola <espindola@google.com>
7737 * main.cc (main): Fix the sys time reporting.
7738 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7741 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7743 * options.cc (General_options::parse_version): Allow -v to exit
7744 without an error if there is nothing to link.
7746 2009-12-29 Ian Lance Taylor <iant@google.com>
7748 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7749 using a version of gcc before 4.1.
7750 * configure: Rebuild.
7752 2009-12-28 Chris Demetriou <cgd@google.com>
7754 * attributes.cc (Output_attributes_section_data::do_write): Use
7755 std::vector::front rather than std::vector::data.
7757 2009-12-28 Ian Lance Taylor <iant@google.com>
7759 * symtab.h (class Symbol_table): Add enum Defined.
7760 * resolve.cc (Symbol_table::should_override): Add defined
7761 parameter. Change all callers. Test whether object is NULL
7762 before calling a method on it.
7763 (Symbol_table::report_resolve_problem): Add defined parameter.
7765 (Symbol_table::should_override_with_special): Likewise.
7766 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7767 parameter. Change all callers.
7768 (Symbol_table::do_define_in_output_data): Likewise.
7769 (Symbol_table::define_in_output_segment): Likewise.
7770 (Symbol_table::do_define_in_output_segment): Likewise.
7771 (Symbol_table::define_as_constant): Likewise.
7772 (Symbol_table::do_define_as_constant): Likewise.
7773 * script.h (class Symbol_assignment): Add is_defsym parameter to
7774 constructor; change all callers.
7775 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7776 parameter. Change all callers. Add is_defsym_ field.
7777 (class Parser_closure): Add parsing_defsym parameter to
7778 constructor; change all callers. Add parsing_defsym accessor
7779 function. Add parsing_defsym_ field.
7781 2009-12-28 Ian Lance Taylor <iant@google.com>
7783 * gold.cc (queue_middle_tasks): Fix formatting.
7784 * object.cc (Relobj::is_section_name_included): Likewise.
7786 2009-12-23 Ian Lance Taylor <iant@google.com>
7788 * i386.cc (Target_i386::do_calls_non_split): Recognize
7789 -fsplit-stack prologue for a function with a static chain.
7790 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7791 -fsplit-stack prologue when using %r11.
7793 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7795 * options.cc (General_options::parse_version): Make -v continue and do
7796 the link like GNU ld does.
7798 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7800 * Makefile.am (CCFILES): Add timer.cc.
7801 (HFILES): Add timer.h.
7802 * configure.ac: Check for sysconf and times.
7803 * main.cc: include timer.h.
7804 (main): Use Timer instead of get_run_time.
7807 * workqueue.cc: include timer.h.
7808 (Workqueue::find_and_run_task):
7809 Report user, sys and wall time.
7810 * Makefile.in: Regenerate.
7811 * config.in: Regenerate.
7812 * configure: Regenerate.
7814 2009-12-16 Doug Kwan <dougkwan@google.com>
7816 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7818 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7819 relaxed input sections.
7820 * output.cc (Output_section::find_relaxed_input_section): Change
7821 return type to Output_relaxed_input_section pointer. Adjust code
7822 for new type of relaxed_input_section_map_.
7823 * output.h (Output_section::find_relaxed_input_section): Change
7824 return type to Output_relaxed_input_section pointer.
7825 (Output_section::Output_relaxed_input_section_by_input_section_map):
7827 (Output_section::relaxed_input_section_map_): Change type to
7828 Output_section::Output_relaxed_input_section_by_input_section_map.
7829 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7832 2009-12-15 Ian Lance Taylor <iant@google.com>
7834 * layout.cc (Layout::create_shstrtab): Only write out after input
7835 sections if we are compressing debug sections.
7837 2009-12-15 Ian Lance Taylor <iant@google.com>
7839 * archive.cc (Archive::add_symbols): Only look up a symbol without
7840 a version if there is, in fact, a version.
7842 2009-12-14 Ian Lance Taylor <iant@google.com>
7844 Revert -Wshadow changes, all changes from:
7845 2009-12-11 Doug Kwan <dougkwan@google.com>
7846 2009-12-11 Nick Clifton <nickc@redhat.com>
7847 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7849 2009-12-11 Doug Kwan <dougkwan@google.com>
7851 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7853 * attributes.cc (Object_attribute::size): Ditto.
7854 (Attributes_section_data::size): Ditto.
7855 (Attributes_section_data::Attributes_section_data): Ditto.
7856 (Output_attributes_section_data::do_write): Ditto.
7857 * attributes.h (Object_attribute::set_type): Ditto.
7858 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7860 2009-12-11 Nick Clifton <nickc@redhat.com>
7862 * archive.cc: Fix shadowed variable warnings.
7864 * compressed_output.cc: Likewise.
7865 * compressed_output.h: Likewise.
7866 * configure: Likewise.
7867 * dwarf_reader.cc: Likewise.
7868 * dynobj.cc: Likewise.
7869 * dynobj.h: Likewise.
7870 * ehframe.cc: Likewise.
7871 * ehframe.h: Likewise.
7872 * errors.cc: Likewise.
7873 * expression.cc: Likewise.
7874 * fileread.cc: Likewise.
7875 * fileread.h: Likewise.
7876 * freebsd.h: Likewise.
7877 * i386.cc: Likewise.
7879 * incremental.h: Likewise.
7880 * layout.cc: Likewise.
7881 * layout.h: Likewise.
7882 * mapfile.cc: Likewise.
7883 * merge.cc: Likewise.
7884 * merge.h: Likewise.
7885 * object.cc: Likewise.
7886 * object.h: Likewise.
7887 * options.h: Likewise.
7888 * output.cc: Likewise.
7889 * output.h: Likewise.
7890 * parameters.cc: Likewise.
7891 * plugin.cc: Likewise.
7892 * powerpc.cc: Likewise.
7893 * reduced_debug_output.cc: Likewise.
7894 * reduced_debug_output.h: Likewise.
7895 * reloc.cc: Likewise.
7896 * reloc.h: Likewise.
7897 * resolve.cc: Likewise.
7898 * script-sections.cc: Likewise.
7899 * script.cc: Likewise.
7900 * script.h: Likewise.
7901 * sparc.cc: Likewise.
7902 * symtab.cc: Likewise.
7903 * symtab.h: Likewise.
7904 * target-select.cc: Likewise.
7905 * target-select.h: Likewise.
7906 * token.h: Likewise.
7907 * workqueue.cc: Likewise.
7908 * workqueue.h: Likewise.
7909 * x86_64.cc: Likewise.
7911 2009-12-10 Doug Kwan <dougkwan@google.com>
7913 * arm.cc (attributes.h): New include.
7914 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7915 (Arm_relobj::~Arm_relobj): Delete object pointed by
7916 attributes_section_data_.
7917 (Arm_relobj::attributes_section_data): New method definition.
7918 (Arm_relobj::attributes_section_data_): New data member declaration.
7919 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7920 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7921 attributes_section_data_.
7922 (Arm_dynobj::attributes_section_data): New method definition.
7923 (Arm_dynobj::attributes_section_data_): New data member declaration.
7924 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7925 initialization value of may_use_blx_ to false.
7926 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7927 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7928 object attributes to compute results instead of hard-coding.
7929 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7930 Target_arm::get_secondary_compatible_arch,
7931 Target_arm::set_secondary_compatible_arch
7932 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7933 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7934 New method declarations.
7935 (Target_arm::get_aeabi_object_attribute): New method definition.
7936 (Target_arm::attributes_section_data_): New data member declaration.
7937 (read_arm_attributes_section): New template definition.
7938 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7939 (Arm_dynobj::do_read_symbols): Ditto.
7940 (Target_arm::do_finalize_sections): Merge attributes sections from
7941 input. Check for BLX use after attributes section merging.
7942 Fix __exidx_start and __exidx_end visibility. Create an
7943 .ARM.attributes section if necessary.
7944 (Target_arm::get_secondary_compatible_arch,
7945 Target_arm::set_secondary_compatible_arch,
7946 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7947 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7948 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7949 New method definitions.
7951 2009-12-09 Ian Lance Taylor <iant@google.com>
7953 * plugin.cc (Plugin::load): Don't cast from void* to a function
7956 2009-12-09 Ian Lance Taylor <iant@google.com>
7958 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7961 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7963 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7964 Replace two_file_shared_1.so with two_file_shared_2.so.
7965 * testsuite/Makefile.in: Regenerated.
7967 2009-12-08 Doug Kwan <dougkwan@google.com>
7969 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7970 (HFILES): Add attributes.h and int_encoding.h.
7971 * Makefile.in: Regenerate.
7972 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7973 function definitions to int_encoding.cc
7974 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7975 prototypes to int_encoding.h
7976 * reduced_debug_output.cc (int_encoding.h): New include.
7977 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7978 function definitions to int_encoding.cc
7979 (insert_into_vector, read_from_pointer): Move template definitions to
7981 * attributes.cc: New file.
7982 * attributes.h: New file.
7983 * int_encoding.cc: New file.
7984 * int_encoding.h: New file.
7986 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7989 * incremental-dump.cc (dump_incremental_inputs): New.
7990 (main): Use dump_incremental_inputs.
7992 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7995 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7996 checking elfcpp::STT_FUNC.
7997 (Target_i386::Relocate::relocate): Likewise.
7998 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8000 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8001 symbols from shared libraries into normal FUNC symbols.
8003 * symtab.h (Symbol): Add is_func and use it.
8005 2009-12-05 Doug Kwan <dougkwan@google.com>
8007 * arm.cc (Target_arm::arm_info): Initialize new fields
8008 attributes_section and attributes_vendor.
8009 * i386.cc (Target_i386::i386_info): Same.
8010 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8011 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8012 fields attributes_section and attributes_vendor.
8013 * sparc.cc (Target_sparc::sparc_info): Same.
8014 * target.h (Target::attributes_section, Target::attributes_vendor,
8015 Target::is_attributes_section, Target::attribute_arg_type,
8016 Target::attributes_order): New method definitions.
8017 (Target::Target_info::attributes_section,
8018 Target::Target_info::attributes_vendor): New fields.
8019 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8020 virtual method definitions.
8021 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8022 attributes_section and attributes_vendor.
8023 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8025 2009-12-05 Doug Kwan <dougkwan@google.com>
8027 * arm.cc: Update comments about interworking and stub generation.
8028 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8029 considered as non-PIC.
8030 (Arm_relocate_functions::base_abs): Fix formatting.
8031 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8032 of function to use GOT entry address instead of offset.
8033 (Target_arm::Scan::global): Issue an error if a symbol would need a
8034 PLT does not get one because it is untyped. Remove code to create
8035 dynamic symbols for relative branches.
8036 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8037 takes unsigned integer instead of boolean.
8039 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8041 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8042 (two_file_test_LDADD): Likewise.
8043 (common_test_1_LDADD): Likewise.
8044 (exception_test_LDADD) Likewise.
8045 (weak_test_LDADD): Likewise.
8046 (many_sections_test_LDADD): Likewise.
8047 (initpri1_LDADD): Likewise.
8048 (script_test_1_LDADD): Likewise.
8049 (script_test_2_LDADD): Likewise.
8050 (justsyms_LDADD): Likewise.
8051 (binary_test_LDADD): Likewise.
8052 (large_LDADD): Likewise.
8053 * testsuite/Makefile.in: Regenerated.
8055 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
8057 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8058 (Symbol_table::override_with_special): Likewise.
8059 (Symbol_table::add_from_object): Likewise.
8061 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8063 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8064 Don't set the data_offset twice.
8066 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8068 * testsuite/Makefile.in: Regenerate.
8070 2009-12-03 Doug Kwan <dougkwan@google.com>
8072 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8073 (Target_arm::do_finalize_sections): Add parameter for symbol table
8074 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8075 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8076 parameter for symbol table pointer.
8077 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8078 an additional parameter for a pointer to symbol table.
8079 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8080 parameter for a symbol table pointer.
8081 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8082 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8084 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8085 parameter for a symbol table pointer.
8087 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
8089 * incremental.cc (Incremental_inputs_header)
8090 (Incremental_inputs_header_write, Incremental_inputs_entry)
8091 (Incremental_inputs_entry_write): Move ...
8092 * incremental.h (Incremental_inputs_header)
8093 (Incremental_inputs_header_write, Incremental_inputs_entry)
8094 (Incremental_inputs_entry_write): here.
8096 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8098 * incremental.cc (make_sized_incremental_binary): Set the target.
8099 Error if it is incompatible.
8100 * output.h (Output_file): Add filename method.
8102 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8104 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8105 from the get_* methods.
8107 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8109 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8110 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8111 Write 0 for the data_offset of scripts.
8113 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8115 * testsuite/Makefile.am: Add the incremental_test.sh test.
8116 * testsuite/incremental_test.sh: New.
8117 * testsuite/incremental_test_1.c: New.
8118 * testsuite/incremental_test_2.c: New.
8120 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8122 * incremental-dump.cc (main): Fix typos.
8124 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8127 * incremental-dump.cc (main): Use llu to print 64 bit values.
8129 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8130 H.J. Lu <hongjiu.lu@intel.com>
8132 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8134 (incremental_dump_LDADD): Likewise.
8135 * Makefile.in: Regenerated.
8137 2009-11-25 Doug Kwan <dougkwan@google.com>
8141 2009-11-25 Doug Kwan <dougkwan@google.com>
8143 * arm.cc (Target_arm::Target_arm): Move method definition
8144 outside of class definition. Add code to handle
8145 --target1-rel, --target1-abs and --target2= options.
8146 (Target_arm::get_reloc_reloc_type): Change method to be
8147 non-static and const.
8148 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8149 New data member declaration.
8150 (Target_arm::Scan::local, Target_arm::Scan::global,
8151 Target_arm::Relocate::relocate,
8152 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8153 Adjust call to Target_arm::get_real_reloc_type.
8154 (Target_arm::get_real_reloc_type): Use command line options
8155 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8156 * options.h (--target1-rel, --target1-abs, --target2): New
8159 2009-11-25 Doug Kwan <dougkwan@google.com>
8161 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8162 class definition. Add code to handle --target1-rel, --target1-abs
8163 and --target2= options.
8164 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8166 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8168 (Target_arm::Scan::local, Target_arm::Scan::global,
8169 Target_arm::Relocate::relocate,
8170 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8171 call to Target_arm::get_real_reloc_type.
8172 (Target_arm::get_real_reloc_type): Use command line options to
8173 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8174 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8177 2009-11-25 Doug Kwan <dougkwan@google.com>
8179 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8180 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8181 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8183 (Arm_relocate_functions::thm_call): Replace body with a call to
8184 Arm_relocate_functions::thumb_branch_common.
8185 (Arm_relocate_functions::thm_jump24,
8186 Arm_relocate_functions::thm_xpc22): New method definitions.
8187 (Arm_relocate_functions::thumb_branch_common): New method definition.
8188 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8190 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8191 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8193 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8195 * Makefile.am: Build incremental-dump
8196 * Makefile.in: Regenerate.
8197 * incremental-dump.cc: New.
8198 * incremental.cc (Incremental_inputs_header_data,
8199 Incremental_inputs_entry_data): Move to incremental.h
8200 * incremental.h: (Incremental_inputs_header_data,
8201 Incremental_inputs_entry_data): Move from incremental.cc
8203 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8205 * incremental.cc (Incremental_inputs_header,
8206 Incremental_inputs_header_write, Incremental_inputs_entry,
8207 Incremental_inputs_entry_write): Add a typedef with the data type.
8209 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8211 * incremental.cc (Incremental_inputs_header,
8212 Incremental_inputs_header_write, Incremental_inputs_entry,
8213 Incremental_inputs_entry_write): Update comment about which
8214 type has the filed descriptions.
8216 2009-11-15 Doug Kwan <dougkwan@google.com>
8218 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8219 (Arm_relocate_functions::arm_branch_common): Change method defintion
8220 in class definition to a method declaration and update list of formal
8222 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8223 Arm_relocation_functions::jump24): Adjust call to
8224 Arm_relocate_functions::arm_branch_common. Update list of formal
8226 (Arm_relocate_functions::xpc25): New method definition.
8227 (Arm_relocate_functions::arm_branch_common): Move method defintion
8228 out from class definition. Use stubs for mode-switching and extending
8230 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8231 specially. Change code to enable use of stubs in ARM branches.
8233 2009-11-10 Doug Kwan <dougkwan@google.com>
8235 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8236 in method declaration.
8237 (Target_arm::relocate_stub): New method declaration.
8238 (Target_arm::default_target): Change to return a pointer instead of
8240 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8241 Target_arm::default_target.
8242 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8244 (Target_arm::relocate_section): Adjust view.
8245 (Target_arm::relocate_stub): New method definition.
8247 2009-11-10 Doug Kwan <dougkwan@google.com>
8249 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8251 * incremental.cc (open_incremental_binary): Initialized local
8252 variables to avoid warnings.
8253 * object.cc (make_elf_object): Ditto.
8254 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8257 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8260 * testsuite/plugin_test.c: Include "config.h".
8262 2009-11-09 Doug Kwan <dougkwan@google.com>
8264 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8265 (arm_symbol_value): Remove.
8266 (Arm_relocate_functions::arm_branch_common,
8267 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8268 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8269 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8270 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8271 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8272 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8273 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8274 Arm_relocate_functions::thm_mobw_abs_nc,
8275 Arm_relocate_functions::thm_mov_abs,
8276 Arm_relocate_functions::movw_prel_nc,
8277 Arm_relocate_functions::thm_movt_abs,
8278 Arm_relocate_functions::movt_prel,
8279 Arm_relocate_functions::thm_movw_prel_nc,
8280 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8281 (Target_arm::Relocate::relocate): Only decompose address into two
8282 parts if relocation type uses the thumb-bit and pass the actual
8283 bit instead of a flag indicating that the thumb-bit is used. Adjust
8284 calls to methods in Arm_relocate_functions for this change.
8286 2009-11-08 Ian Lance Taylor <iant@google.com>
8289 * reloc.cc: Instantiate
8290 Sized_relobj::initialize_input_to_output_maps and
8291 Sized_relobj:free_input_to_output_maps.
8293 2009-11-06 Ian Lance Taylor <iant@google.com>
8296 * defstd.cc (in_segment): Set only_if_ref true for "end".
8298 2009-11-06 Doug Kwan <dougkwan@google.com>
8300 * arm.cc (class Reloc_stub): Correct a comment.
8301 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8302 (Target_arm::scan_section_for_stubs): New method declaration.
8303 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8304 Change methods from private to protected.
8305 (Target_arm::do_may_relax): New method definition.
8306 (Target_arm::do_relax, Target_arm::group_sections,
8307 Target_arm::scan_reloc_for_stub,
8308 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8309 (Target_arm::arm_input_section_map_): New data member declaration.
8310 (Target_arm::scan_reloc_for_stub,
8311 Target_arm::scan_reloc_section_for_stubs,
8312 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8313 Target_arm::do_relax): New method definitions.
8315 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8317 * configure.ac: Check for (struct stat)::st_mtim
8318 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8319 * config.in: Regenerate.
8320 * configure: Regenerate.
8322 2009-11-05 Ian Lance Taylor <iant@google.com>
8325 * output.cc (Output_segment::add_output_section): Add missing
8328 2009-11-04 Ian Lance Taylor <iant@google.com>
8331 * object.h (class Object): Add is_needed and set_is_needed
8332 methods. Add is_needed_ field. Make bool fields into bitfields.
8333 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8334 defined in a dynamic object and referenced by a regular object,
8335 set is_needed for the dynamic object.
8336 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8337 if the file is marked with as_needed and it is not needed.
8339 2009-11-04 Ian Lance Taylor <iant@google.com>
8342 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8343 tags if data is discarded by linker script.
8344 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8345 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8346 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8347 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8349 2009-11-04 Ian Lance Taylor <iant@google.com>
8351 * layout.cc (Layout::get_output_section): Add is_interp and
8352 is_dynamic_linker_section parameters. Change all callers.
8353 (Layout::choose_output_section): Likewise.
8354 (Layout::make_output_section): Likewise.
8355 (Layout::add_output_section_data): Add is_dynamic_linker_section
8356 parameter. Change all callers.
8357 * layout.h (class Layout): Update declarations.
8358 * output.h (class Output_section): Add is_interp, set_is_interp,
8359 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8360 Add is_interp_, is_dynamic_linker_section_ fields. Change
8361 generate_code_fills_at_write_ to a bitfield.
8362 * output.cc (Output_section::Output_sections): Initialize new
8364 (Output_segment::add_output_section): Add do_sort parameter.
8367 2009-11-03 Ian Lance Taylor <iant@google.com>
8370 * options.h (class General_options): Add --warn-common.
8371 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8372 merging two common symbols.
8373 (Symbol_table::should_override): Handle --warn-common when merging
8374 a common symbol with a defined symbol. Use report_resolve_problem
8375 for multiple definitions.
8376 (Symbol_table::report_resolve_problem): New function.
8377 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8379 2009-11-03 Doug Kwan <dougkwan@google.com>
8381 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8383 (Target_arm::stub_factory): New method definition.
8384 (Target_arm::new_arm_input_section,
8385 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8386 Target_arm::reloc_uses_thumb_bit): New method declarations.
8387 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8388 New type definitions.
8389 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8390 member declarations.
8391 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8392 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8393 New method definitions.
8395 2009-11-03 Ian Lance Taylor <iant@google.com>
8397 * options.h (class General_options): Add --warn_constructors.
8399 2009-11-03 Ian Lance Taylor <iant@google.com>
8402 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8403 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8405 2009-11-03 Ian Lance Taylor <iant@google.com>
8408 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8409 --msgid-bugs-address.
8410 (install-pdf): New target.
8411 (install-data_yes): Look up one directory to find mkinstalldirs.
8413 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8415 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8418 2009-10-30 Doug Kwan <dougkwan@google.com>
8420 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8422 2009-10-30 Doug Kwan <dougkwan@google.com>
8424 * arm.cc (Stub_addend_reader): New struct template definition
8425 and partial specializations.
8426 (Stub_addend_reader::operator()): New method definition for a
8427 partially specialized template.
8429 2009-10-30 Doug Kwan <dougkwan@google.com>
8431 * arm.cc (Arm_relobj::processor_specific_flags): New method
8433 (Arm_relobj::do_read_symbols): New method declaration.
8434 (Arm_relobj::processor_specific_flags_): New data member declaration.
8435 (Arm_dynobj): New class definition.
8436 (Target_arm::do_finalize_sections): Add input_objects parameter.
8437 (Target_arm::do_adjust_elf_header): New method declaration.
8438 (Target_arm::are_eabi_versions_compatible,
8439 (Target_arm::merge_processor_specific_flags): New method declaration.
8440 (Target_arm::do_make_elf_object): New overloaded method definitions
8442 (Arm_relobj::do_read_symbols): New method definition.
8443 (Arm_dynobj::do_read_symbols): Ditto.
8444 (Target_arm::do_finalize_sections): Add input_objects parameters.
8445 Merge processor-specific flags from all input objects.
8446 (Target_arm::are_eabi_versions_compatible,
8447 Target_arm::merge_processor_specific_flags,
8448 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8449 New method definitions.
8450 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8451 Input_objects pointer type parameter.
8452 * layout.cc (Layout::finalize): Pass input objects to target's.
8453 finalize_sections function.
8454 * output.cc (Output_file_header::do_sized_write): Set ELF file
8455 header's processor-specific flags.
8456 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8457 Input_objects pointer type parameter.
8458 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8459 * target.h (Input_objects): New forward class declaration.
8460 (Target::processor_specific_flags,
8461 Target::are_processor_specific_flags_sect): New method definitions.
8462 (Target::finalize_sections): Add input_objects parameter.
8463 (Target::Target): Initialize processor_specific_flags_ and
8464 are_processor_specific_flags_set_.
8465 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8467 (Target::set_processor_specific_flags): New method definition.
8468 (Target::processor_specific_flags_,
8469 Target::are_processor_specific_flags_set_): New data member
8471 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8472 Input_objects pointer type parameter.
8474 2009-10-30 Doug Kwan <dougkwan@google.com>
8476 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8478 2009-10-28 Ian Lance Taylor <iant@google.com>
8480 * object.h (class Relobj): Drop options parameter from
8481 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8482 do_scan_relocs, do_relocate. Change all callers.
8483 (class Sized_relobj): Drop options parameters from
8484 do_gc_process_relocs, do_scan_relocs, do_relocate,
8485 do_relocate_sections, relocate_sections, emit_relocs_scan,
8486 emit_relocs_scan_reltype. Change all callers.
8487 (struct Relocate_info): Remove options field and all references to
8489 * reloc.h (class Read_relocs): Remove options constructor
8490 parameter and options_ field. Change all callers.
8491 (class Gc_process_relocs, class Scan_relocs): Likewise.
8492 (class Relocate_task): Likewise.
8493 * target-reloc.h (scan_relocs): Remove options parameter. Change
8495 (scan_relocatable_relocs): Likewise.
8496 * target.h (class Sized_target): Remove options parameter from
8497 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8499 * gc.h (gc_process_relocs): Remove options parameter. Change all
8501 * arm.cc: Update functions to remove options parameters.
8502 * i386.cc: Likewise.
8503 * powerpc.cc: Likewise.
8504 * sparc.cc: Likewise.
8505 * x86_64.cc: Likewise.
8506 * testsuite/testfile.cc: Likewise.
8508 2009-10-28 Doug Kwan <dougkwan@google.com>
8510 * arm.cc (Arm_relobj): New class definition.
8511 (Arm_relobj::scan_sections_for_stubs,
8512 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8513 New method definitions.
8515 2009-10-28 Cary Coutant <ccoutant@google.com>
8517 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8518 (Plugin::cleanup_done_): New member.
8519 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8520 (Plugin_manager::cleanup_done_): Remove.
8521 (Plugin_manager::add_input_file): Edit error message.
8522 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8523 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8525 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8527 * fileread.cc: (File_read::View::~View): Use the new
8528 data_ownership_ filed.
8529 (File_read::~File_read): Dispose the new whole_file_view_.
8530 (File_read::open): Mmap the whole file if needed.
8531 (File_read::open): Use whole_file_view_ instead of contents_.
8532 (File_read::find_view): Use whole_file_view_ if applicable.
8533 (File_read::do_read): Use whole_file_view_ instead of contents_.
8534 (File_read::make_view): Use whole_file_view_ instead of contents_,
8535 update File_read::View::View call.
8536 (File_read::find_or_make_view): Update File_read::View::View
8538 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8540 (File_read::View::Data_ownership): New enum.
8541 (File_read::View::View): Replace bool mapped_ with Data_ownership
8543 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8544 (File_read::View::data_ownership_): New field.
8545 (File_read::contents_): Remove (replaced by whole_file_view_).
8546 (File_read::whole_file_view_): New field.
8547 * options.h (class General_options): Add --keep-files-mapped.
8549 2009-10-27 Cary Coutant <ccoutant@google.com>
8551 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8552 * testsuite/Makefile.am (plugin_test_5): New test case.
8553 * testsuite/Makefile.in: Regenerate.
8555 2009-10-25 Doug Kwan <dougkwan@google.com>
8557 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8558 from private to protected to allow access by child class.
8559 (Sized_relobj::do_relocate_sections): New method declaration.
8560 (Sized_relobj::relocate_sections): Virtualize.
8561 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8562 Sized_relobj::relocate_sections. Instantiate template explicitly
8563 for different target sizes and endianity.
8565 2009-10-24 Doug Kwan <dougkwan@google.com>
8567 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8568 (Arm_input_section::as_arm_input_section): New method.
8569 (Arm_output_section): New class definition.
8570 (Arm_output_section::create_stub_group,
8571 Arm_output_section::group_sections): New method definitions.
8573 2009-10-22 Doug Kwan <dougkwan@google.com>
8575 * arm.cc (Arm_input_section): New class definition.
8576 (Arm_input_section::init, Arm_input_section:do_write,
8577 Arm_input_section::set_final_data_size,
8578 Arm_input_section::do_reset_address_and_file_offset): New method
8581 2009-10-21 Doug Kwan <dougkwan@google.com>
8583 * arm.cc (Stub_table, Arm_input_section): New forward class
8585 (Stub_table): New class defintion.
8586 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8587 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8588 New method definition.
8590 2009-10-21 Doug Kwan <dougkwan@google.com>
8592 * arm.cc: Update copyright comments.
8593 (Target_arm): New forward class template declaration.
8594 (Arm_address): New type.
8595 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8596 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8597 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8599 (Insn_template): Same.
8600 (DEF_STUBS): New macro.
8601 (Stub_type): New enum type.
8602 (Stub_template): New class definition.
8605 (Stub_factory): Same.
8606 (Target_arm::Target_arm): Initialize may_use_blx_ and
8607 should_force_pic_veneer_.
8608 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8609 Target_arm::should_force_pic_veneer,
8610 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8611 Target_arm::using_thumb_only, Target_arm:;default_target): New
8613 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8614 New data member declarations.
8615 (Insn_template::size, Insn_template::alignment): New method defintions.
8616 (Stub_template::Stub_template): New method definition.
8617 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8618 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8619 (Stub_factory::Stub_factory): New method definition.
8620 * gold.h (string_hash): New template.
8621 * output.h (Input_section_specifier::hash_value): Use
8623 (Input_section_specifier::string_hash): Remove.
8624 * stringpool.cc (Stringpool_template::string_hash): Use
8627 2009-10-20 Doug Kwan <dougkwan@google.com>
8629 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8630 symbols of relaxed input sections.
8631 * output.h (Output_section::find_relaxed_input_section): Make
8634 2009-10-16 Doug Kwan <dougkwan@google.com>
8636 * dynobj.cc (Versions::Versions): Initialize version_script_.
8637 Only insert base version symbol definition for a shared object
8638 if version script defines any version versions.
8639 (Versions::define_base_version): New method definition.
8640 (Versions::add_def): Check that base version is not needed.
8641 (Versions::add_need): Define base version lazily.
8642 * dynobj.h (Versions::define_base_version): New method declaration.
8643 (Versions::needs_base_version_): New data member declaration.
8644 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8645 (check_DATA): Add no_version_test.stdout.
8646 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8648 * testsuite/Makefile.in: Regenerate.
8649 * testsuite/no_version_test.c: New file.
8650 * testsuite/no_version_test.sh: Ditto.
8652 2009-10-16 Doug Kwan <dougkwan@google.com>
8654 * expression.cc (class Segment_start_expression): New class definition.
8655 (Segment_start_expression::value): New method definition.
8656 (script_exp_function_segment_start): Return a new
8657 Segment_start_expression.
8658 * gold/script-c.h (script_saw_segment_start_expression): New function
8660 * script-sections.cc (Script_sections::Script_sections): Initialize
8661 SAW_SEGMENT_START_EXPRESSION_ to false.
8662 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8663 and -Tbbs options to specify section addresses if given in
8664 command line and no SEGMENT_START expression is seen in a script.
8665 * script-sections.h (Script_sections::saw_segment_start_expression,
8666 Script_sections::set_saw_segment_start_expression): New method
8668 (Script_sections::saw_segment_start_expression_): New data member
8670 * script.cc (script_saw_segment_start_expression): New function.
8671 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8672 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8673 script_test_7.sh and script_test_8.sh.
8674 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8675 script_test_8.stdout.
8676 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8677 (script_test_6, script_test_6.stdout, script_test_7,
8678 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8679 * Makefile.in: Regenerate.
8680 * testsuite/script_test_6.sh: New file.
8681 * testsuite/script_test_6.t: Same.
8682 * testsuite/script_test_7.sh: Same.
8683 * testsuite/script_test_7.t: Same.
8684 * testsuite/script_test_8.sh: Same.
8686 2009-10-16 Doug Kwan <dougkwan@google.com>
8688 * output.cc (Output_segment::set_section_list_address): Cast
8689 expressions to unsigned long long type to avoid format warnings.
8691 2009-10-15 Ian Lance Taylor <iant@google.com>
8693 * script.cc (Script_options::add_symbol_assignment): Always add a
8694 dot assignment to script_sections_.
8695 * script-sections.cc (Script_sections::add_dot_assignment):
8696 Initialize if necessary.
8698 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8699 program headers with no load segment if there is a linker script.
8701 * layout.cc (Layout::set_segment_offsets): Align the file offset
8702 to the segment aligment for -N or -n with no load segment.
8703 * output.cc (Output_segment::add_output_section): Don't crash if
8704 the first section is a TLS section.
8705 (Output_segment::set_section_list_addresses): Print an error
8706 message if the address moves backward in a linker script.
8707 * script-sections.cc
8708 (Output_section_element_input::set_section_addresses): Don't
8709 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8710 (Orphan_output_section::set_section_addresses): Likewise.
8712 2009-10-15 Doug Kwan <dougkwan@google.com>
8714 * layout.cc (Layout::finish_dynamic_section): Generate tags
8715 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8716 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8717 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8719 2009-10-14 Ian Lance Taylor <iant@google.com>
8721 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8723 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8724 data_shdr fields of relinfo.
8725 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8726 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8727 R_386_TLS_LDO_32, adjust based on section flags.
8728 (Target_i386::Relocate::fix_up_ldo): Remove.
8730 2009-10-13 Ian Lance Taylor <iant@google.com>
8732 Add support for -pie.
8733 * options.h (class General_options): Add -pie and
8735 (General_options::output_is_position_independent): Test -pie.
8736 (General_options::output_is_executable): Return true if not shared
8737 and not relocatable.
8738 (General_options::output_is_pie): Remove.
8739 * options.cc (General_options::finalize): Reject incompatible uses
8741 * gold.cc (queue_middle_tasks): A -pie link is not static.
8742 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8743 * symtab.cc (Symbol::final_value_is_known): Return false if
8744 output_is_position_independent.
8745 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8746 output_is_position_independent.
8747 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8748 output_is_position_independent.
8749 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8750 output_is_position_independent.
8751 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8753 (basic_pie_test.o, basic_pie_test): New targets.
8754 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8755 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8756 (two_file_pie_test): New target.
8757 * testsuite/Makefile.in: Rebuild.
8758 * README: Remove note saying that -pie is not supported.
8760 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8762 * options.h (class General_options): Add -init and -fini.
8763 * layout.cc (Layout::finish_dynamic_section): Emit
8764 given init and fini functions.
8766 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8768 * gc.h (gc_process_relocs): Check if icf is enabled using new
8770 * gold.cc (queue_initial_tasks): Likewise.
8771 (queue_middle_tasks): Likewise.
8772 * object.cc (do_layout): Likewise.
8773 * symtab.cc (is_section_folded): Likewise.
8774 * main.cc (main): Likewise.
8775 * reloc.cc (Read_relocs::run): Likewise.
8776 (Sized_relobj::do_scan_relocs): Likewise.
8777 * icf.cc (is_function_ctor_or_dtor): New function.
8778 (Icf::find_identical_sections): Check if function is ctor or dtor when
8780 * options.h (General_options::icf): Change option to be an enum.
8781 (Icf_status): New enum.
8782 (icf_enabled): New method.
8783 (icf_safe_folding): New method.
8784 (set_icf_status): New method.
8785 (icf_status_): New variable.
8786 * (options.cc) (General_options::finalize): Set icf_status_.
8787 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8788 icf_test and icf_keep_unique_test to use the --icf enum flag.
8789 * testsuite/icf_safe_test.sh: New file.
8790 * testsuite/icf_safe_test.cc: New file.
8792 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8794 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8795 includes to gc.h and icf.h.
8796 * arm.cc: Include gc.h.
8797 * gold.cc: Likewise.
8798 * i386.cc: Likewise.
8799 * powerpc.cc: Likewise.
8800 * sparc.cc: Likewise.
8801 * x86_64.cc: Likewise.
8802 * gc.h: Include icf.h.
8804 2009-10-11 Ian Lance Taylor <iant@google.com>
8806 * plugin.cc: Include "gold.h" before other header files.
8808 2009-10-10 Chris Demetriou <cgd@google.com>
8810 * options.h (Input_file_argument::Input_file_type): New enum.
8811 (Input_file_argument::is_lib_): Replace with...
8812 (Input_file_argument::type_): New member.
8813 (Input_file_argument::Input_file_argument): Take Input_file_type
8814 'type' rather than boolean 'is_lib' as second argument.
8815 (Input_file_argument::is_lib): Use type_.
8816 (Input_file_argument::is_searched_file): New function.
8817 (Input_file_argument::may_need_search): Handle is_searched_file.
8818 * options.cc (General_options::parse_library): Support -l:filename.
8819 (General_options::parse_just_symbols): Update for Input_file_argument
8821 (Command_line::process): Likewise.
8822 * archive.cc (Archive::get_file_and_offset): Likewise.
8823 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8824 * script.cc (read_script_file, script_add_file): Likewise.
8825 * fileread.cc (Input_file::Input_file): Likewise.
8826 (Input_file::will_search_for): Handle is_searched_file.
8827 (Input_file::open): Likewise.
8828 * readsyms.cc (Read_symbols::get_name): Likewise.
8829 * testsuite/Makefile.am (searched_file_test): New test.
8830 * testsuite/Makefile.in: Regenerate.
8831 * testsuite/searched_file_test.cc: New file.
8832 * testsuite/searched_file_test_lib.cc: New file.
8834 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8835 Ian Lance Taylor <iant@google.com>
8837 * descriptor.cc: Include <cstdio> and "binary-io.h".
8838 (Descriptors::open): Open the files in binary mode always.
8839 * script.cc (Lex::get_token): Treat \r as whitespace.
8841 2009-10-09 Ian Lance Taylor <iant@google.com>
8843 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8845 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8846 Ian Lance Taylor <iant@google.com>
8848 * configure.ac: Check for readv function also.
8849 * fileread.cc (readv): Define if not HAVE_READV.
8850 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8852 * config.in: Regenerate.
8853 * configure: Regenerate.
8855 2009-10-09 Doug Kwan <dougkwan@google.com>
8857 * layout.cc (Layout::make_output_section): Call target hook to make
8858 ordinary output section.
8859 (Layout::finalize): Adjust parameter list of call the
8860 Target::may_relax().
8861 * layout.h (class Layout::section_list): New method.
8862 * merge.h (Output_merge_base::entsize): Change visibility to public.
8863 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8865 (Output_merge_string::do_is_string): New method.
8866 * object.cc (Sized_relobj::do_setup): renamed from
8867 Sized_relobj::set_up.
8868 * object.h (Sized_relobj::adjust_shndx,
8869 Sized_relobj::initializ_input_to_output_maps,
8870 Sized_relobj::free_input_to_output_maps): Change visibilities to
8872 (Sized_relobj::setup): Virtualize.
8873 (Sized_relobj::do_setup): New method declaration.
8874 (Sized_relobj::invalidate_section_offset,
8875 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8876 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8877 * options.cc (parse_int): New function.
8878 * options.h (parse_int): New declaration.
8879 (DEFINE_int): New macro.
8880 (stub_group_size): New option.
8881 * output.cc (Output_section::Output_section): Initialize memebers
8882 merge_section_map_, merge_section_by_properties_map_,
8883 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8884 (Output_section::add_input_section): Handled deferred code-fill
8885 generation and remove an old comment.
8886 (Output_section::add_relaxed_input_section): New method definition.
8887 (Output_section::add_merge_input_section): Use merge section by
8888 properties map to speed to search. Update merge section maps
8890 (Output_section::build_relaxation_map): New method definition.
8891 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8893 (Output_section::relax_input_section): Renamed to
8894 Output_section::convert_input_sections_to_relaxed_sections and change
8895 interface to take a vector of pointers to relaxed sections.
8896 (Output_section::find_merge_section,
8897 Output_section::find_relaxed_input_section): New method definitions.
8898 (Output_section::is_input_address_mapped,
8899 Output_section::output_offset, Output_section::output_address):
8900 Use output section data maps to speed up searching.
8901 (Output_section::find_starting_output_address): Add comments.
8902 (Output_section::do_write,
8903 Output_section::write_to_postprocessing_buffer): Do code-fill
8904 generation as appropriate.
8905 (Output_section::get_input_sections): Invalidate relaxed input section
8907 (Output_section::restore_states): Adjust type of checkpoint .
8908 Invalidate relaxed input section map.
8909 * output.h (Output_merge_base): New class declaration.
8910 (Input_section_specifier): New class defintion.
8911 (class Output_relaxed_input_section) Change base class to
8912 Output_section_data_build.
8913 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8914 base class initializer.
8915 (Output_section::add_relaxed_input_section): New method declaration.
8916 (Output_section::Input_section): Change visibility to protected.
8917 (Output_section::Input_section::relobj,
8918 Output_section::Input_section::shndx): Handle relaxed input sections.
8919 Output_section::input_sections) Change visibility to protected. Also
8920 define overload to return a non-const pointer.
8921 (Output_section::Merge_section_properties): New class defintion.
8922 (Output_section::Merge_section_by_properties_map,
8923 Output_section::Output_section_data_by_input_section_map,
8924 Output_section::Relaxation_map): New types.
8925 (Output_section::relax_input_section): Rename method to
8926 Output_section::convert_input_sections_to_relaxed_sections and change
8927 interface to take a vector of relaxed section pointers.
8928 (Output_section::find_merge_section,
8929 Output_section::find_relaxed_input_section,
8930 Output_section::build_relaxation_map,
8931 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8932 New method declarations.
8933 (Output_section::merge_section_map_
8934 Output_section::merge_section_by_properties_map_,
8935 Output_section::relaxed_input_section_map_,
8936 Output_section::is_relaxed_input_section_map_valid_,
8937 Output_section::generate_code_fills_at_write_): New data members.
8938 * script-sections.cc
8939 (Output_section_element_input::set_section_addresses): Call
8940 current_data_size and addralign methods of relaxed input sections.
8941 (Orphan_output_section::set_section_addresses): Call current_data_size
8942 and addralign methods of relaxed input sections.
8943 * symtab.cc (Symbol_table::compute_final_value): Extract template
8944 from the body of Symbol_table::sized_finalize_symbol.
8945 (Symbol_table::sized_finalized_symbol): Call
8946 Symbol_table::compute_final_value.
8947 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8948 (Symbol_table::compute_final_value): New templated method declaration.
8949 * target.cc (Target::do_make_output_section): New method defintion.
8950 * target.h (Target::make_output_section): New method declaration.
8951 (Target::relax): Add more parameters for input objects, symbol table
8952 and layout. Adjust call to do_relax.
8953 (Target::do_make_output_section): New method declaration.
8954 (Target::do_relax): Add parameters for input objects, symbol table
8957 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8959 * pread.c: Include stdio.h.
8961 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8963 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8966 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8968 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8969 Change read_shndx type to unsigned int.
8970 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8972 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8973 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8974 Change read_shndx type to unsigned int.
8975 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8977 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8978 * layout.cc (Layout::create_symtab_sections): Cast the result of
8979 local_symcount * symsize to off_t in the gold_assert.
8981 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8983 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8984 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8986 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8987 (Arm_relocate_functions::thm_abs5): New function.
8988 (Arm_relocate_functions::abs12): New function.
8989 (Arm_relocate_functions::abs16): New function.
8990 (Arm_relocate_functions::base_abs): New function.
8991 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8992 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8993 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8995 (Scan::global): Likewise.
8996 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8997 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8998 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8999 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9002 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9004 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9005 (Arm_relocate_functions::movt_prel): New function.
9006 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9007 (Arm_relocate_functions::thm_movt_prel): New function.
9008 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9009 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9010 (Scan::global, Relocate::relocate): Likewise.
9011 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9013 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9015 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9016 Incremental_checker.
9017 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9019 (class Incremental_inputs_header): New class.
9020 (Incremental_inputs_header_writer): Edit comment.
9021 (Incremental_inputs_entry): New class.
9022 (Incremental_inputs_entry_writer): Edit comment.
9023 (Sized_incremental_binary::do_find_incremental_inputs_section):
9024 Add *strtab_shndx parameter, fill it.
9025 (Sized_incremental_binary::do_check_inputs): New method.
9026 (Incremental_checker::can_incrementally_link_output_file): Use
9027 Sized_incremental_binary::check_inputs.
9028 (Incremental_inputs::report_command_line): Save command line in
9031 (Incremental_binary::find_incremental_inputs_section): New
9033 (Incremental_binary::do_find_incremental_inputs_section): Add
9034 strtab_shndx parameter.
9035 (Incremental_binary::do_check_inputs): New pure virtual method.
9036 (Sized_incremental_binary::do_check_inputs): Declare.
9037 (Incremental_checker::Incremental_checker): Add incremental_inputs
9038 parameter, use it to initialize incremental_inputs_.
9039 (Incremental_checker::incremental_inputs_): New field.
9040 (Incremental_checker::command_line): New method.
9041 (Incremental_checker::inputs): New method.
9042 (Incremental_checker::command_line_): New field.
9044 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9046 * incremental.cc: Include <cstdarg> and "target-select.h".
9047 (vexplain_no_incremental): New function.
9048 (explain_no_incremental): New function.
9049 (Incremental_binary::error): New method.
9050 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9052 (make_sized_incremental_binary): New function.
9053 (open_incremental_binary): New function.
9054 (can_incrementally_link_file): Add checks if output is ELF and has
9056 * incremental.h: Include "elfcpp_file.h" and "output.h".
9057 (Incremental_binary): New class.
9058 (Sized_incremental_binary): New class.
9059 (open_incremental_binary): Declare.
9060 * object.cc (is_elf_object): Use
9061 elfcpp::Elf_recognizer::is_elf_file.
9062 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9063 * output.h (Output_file::filesize): New method.
9065 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9067 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9069 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9070 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9072 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9074 (Arm_relocate_functions::movw_abs_nc): New function.
9075 (Arm_relocate_functions::movt_abs): New function.
9076 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9077 (Arm_relocate_functions::thm_movt_abs): New function.
9078 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9079 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9080 (Scan::global): Likewise.
9081 (Relocate::relocate): Likewise.
9082 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9084 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9086 * arm.cc (Arm_relocate_functions::got_prel) New function.
9087 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9088 (Relocate::relocate): Likewise.
9089 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9091 2009-10-06 Ian Lance Taylor <iant@google.com>
9093 * options.h (class General_options): Define
9094 split_stack_adjust_size parameter.
9095 * object.h (class Object): Add uses_split_stack_ and
9096 has_no_split_stack_ fields. Add uses_split_stack and
9097 has_no_split_stack accessor functions. Declare
9098 handle_split_stack_section.
9099 (class Reloc_symbol_changes): Define.
9100 (class Sized_relobj): Define Function_offsets. Declare
9101 split_stack_adjust, split_stack_adjust_reltype, and
9103 * object.cc (Object::handle_split_stack_section): New function.
9104 (Sized_relobj::do_layout): Call handle_split_stack_section.
9105 * dynobj.cc (Sized_dynobj::do_layout): Call
9106 handle_split_stack_section.
9107 * reloc.cc (Sized_relobj::relocate_sections): Call
9108 split_stack_adjust for executable sections in split_stack
9109 objects. Pass reloc_map to relocate_section.
9110 (Sized_relobj::split_stack_adjust): New function.
9111 (Sized_relobj::split_stack_adjust_reltype): New function.
9112 (Sized_relobj::find_functions): New function.
9113 * target-reloc.h: Include "object.h".
9114 (relocate_section): Add reloc_symbol_changes parameter. Change
9116 * target.h (class Target): Add calls_non_split method. Declare
9117 do_calls_non_split virtual method. Declare match_view and
9119 * target.cc: Include "elfcpp.h".
9120 (Target::do_calls_non_split): New function.
9121 (Target::match_view): New function.
9122 (Target::set_view_to_nop): New function.
9123 * gold.cc (queue_middle_tasks): Give an error if mixing
9124 split-stack and non-split-stack objects with -r.
9125 * i386.cc (Target_i386::relocate_section): Add
9126 reloc_symbol_changes parameter.
9127 (Target_i386::do_calls_non_split): New function.
9128 * x86_64.cc (Target_x86_64::relocate_section): Add
9129 reloc_symbol_changes parameter.
9130 (Target_x86_64::do_calls_non_split): New function.
9131 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9133 * powerpc.cc (Target_powerpc::relocate_section): Add
9134 reloc_symbol_changes parameter.
9135 * sparc.cc (Target_sparc::relocate_section): Add
9136 reloc_symbol_changes parameter.
9137 * configure.ac: Call AM_CONDITIONAL for the default target.
9138 * configure: Rebuild.
9139 * testsuite/Makefile.am (TEST_AS): New variable.
9140 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9141 (check_DATA): Add split_i386 and split_x86_64 files.
9142 (SPLIT_DEFSYMS): Define.
9143 (split_i386_[1234n].o): New targets.
9144 (split_i386_[124]): New targets.
9145 (split_i386_[1234r].stdout): New targets.
9146 (split_x86_64_[1234n].o): New targets.
9147 (split_x86_64_[124]): New targets.
9148 (split_x86_64_[1234r].stdout): New targets.
9149 (MOSTLYCLEANFILES): Add new executables.
9150 * testsuite/split_i386.sh: New file.
9151 * testsuite/split_x86_64.sh: New file.
9152 * testsuite/split_i386_1.s: New file.
9153 * testsuite/split_i386_2.s: New file.
9154 * testsuite/split_i386_3.s: New file.
9155 * testsuite/split_i386_4.s: New file.
9156 * testsuite/split_i386_n.s: New file.
9157 * testsuite/split_x86_64_1.s: New file.
9158 * testsuite/split_x86_64_2.s: New file.
9159 * testsuite/split_x86_64_3.s: New file.
9160 * testsuite/split_x86_64_4.s: New file.
9161 * testsuite/split_x86_64_n.s: New file.
9162 * testsuite/testfile.cc (Target_test): Update relocation_section
9164 * testsuite/Makefile.in: Rebuild.
9166 2009-10-06 Ian Lance Taylor <iant@google.com>
9168 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9169 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9170 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9171 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9172 the address on ldo_addrs_.
9173 (Target_i386::Relocate::fix_up_ldo): New function.
9175 2009-10-06 Rafael Espindola <espindola@google.com>
9177 * plugin.cc (add_input_library): New.
9178 (Plugin::load): Add add_input_library to tv.
9179 (Plugin_manager::add_input_file): Add the is_lib argument.
9180 (add_input_file): Update call to Plugin_manager::add_input_file.
9181 (add_input_library): New.
9182 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9184 2009-09-30 Doug Kwan <dougkwan@google.com>
9186 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9187 symbol and call Symbol::may_need_copy_reloc to determine if
9188 a copy reloc is needed.
9189 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9190 nocopyreloc is given in command line.
9191 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9192 given in command line.
9193 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9194 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9195 of the removed Target_i386::may_need_copy_reloc.
9196 * options.h (copyreloc): New option with default value false.
9197 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9198 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9199 instead of the removed Target_powerpc::may_need_copy_reloc.
9200 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9201 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9202 instead of the removed Target_sparc::may_need_copy_reloc.
9203 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9204 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9205 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9206 instead of the removed Target_x86_64::may_need_copy_reloc.
9208 2009-09-30 Ian Lance Taylor <iant@google.com>
9210 * object.h (class Object): Remove target_ field, and target,
9211 sized_target, and set_target methods.
9212 (Object::sized_target): Remove.
9213 (class Sized_relobj): Update declarations. Remove sized_target.
9214 * object.cc (Sized_relobj::setup): Remove target parameter.
9216 (Input_objects::add_object): Don't do anything with the target.
9217 (make_elf_sized_object): Add punconfigured parameter. Change all
9218 callers. Set or test parameter target.
9219 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9221 * parameters.cc (Parameters::set_target): Change parameter type to
9223 (Parameters::default_target): Remove.
9224 (set_parameters_target): Change parameter type to be non-const.
9225 (parameters_force_valid_target): New function.
9226 (parameters_clear_target): New function.
9227 * parameters.h (class Parameters): Update declarations. Remove
9228 default_target method. Add sized_target and clear_target
9229 methods. Change target_ to be non-const.
9230 (set_parameters_target): Update declaration.
9231 (parameters_force_valid_target): Declare.
9232 (parameters_clear_target): Declare.
9233 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9234 as NULL if we aren't searching.
9235 (Add_symbols::run): Don't check for compatible target.
9236 * fileread.cc (Input_file::open_binary): Call
9237 parameters_force_valid_target.
9238 * gold.cc (queue_middle_tasks): Likewise.
9239 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9240 set_target on object.
9241 * dynobj.h (class Sized_dynobj): Update declarations.
9242 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9243 make_elf_object returns NULL.
9244 (Archive::include_member): Don't check whether object target is
9246 * output.cc (Output_section::add_input_section): Get target from
9248 (Output_section::relax_input_section): Likewise.
9249 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9251 (Sized_relobj::do_scan_relocs): Likewise.
9252 (Sized_relobj::relocate_sections): Likewise.
9253 * resolve.cc (Symbol_table::resolve): Likewise.
9254 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9255 parameter. Change all callers.
9256 (Symbol_table::add_from_object): Get target from parameters.
9257 (Symbol_table::add_from_relobj): Don't check object target.
9258 (Symbol_table::add_from_dynobj): Likewise.
9259 (Symbol_table::define_special_symbol): Get target from
9261 * symtab.h (class Symbol_table): Update declaration.
9262 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9263 parameter. Change all callers. Clear parameter target.
9264 (Binary_test): Test target here.
9265 * testsuite/object_unittest.cc (gold_testsuite): Remove
9266 target_test_pointer parameter. Change all callers.
9267 (Object_test): Test target here.
9269 2009-09-26 Ian Lance Taylor <iant@google.com>
9271 * testsuite/initpri1.c: Don't try to use constructor priorities if
9272 compiling with gcc before 4.3.
9274 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9276 * testsuite/retain_symbols_file_test.sh (check_present): Change
9277 output file name to retain_symbols_file_test.stdout.
9278 (check_absent): Likewise.
9280 2009-09-18 Craig Silverstein <csilvers@google.com>
9282 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9283 * options.cc: Include <cerrno> and <fstream>.
9284 (General_options::finalize): Parse -retain-symbols-file tag.
9285 * options.h: New flag.
9286 (General_options): New method should_retain_symbol, new
9287 variable symbols_to_retain.
9288 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9289 should_retain_symbol map.
9290 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9291 * testsuite/Makefile.in: Regenerate.
9292 * testsuite/retain_symbols_file_test.sh: New file.
9294 2009-09-18 Nick Clifton <nickc@redhat.com>
9296 * po/es.po: Updated Spanish translation.
9298 2009-09-17 Doug Kwan <dougkwan@google.com>
9300 * debug.h (DEBUG_RELAXATION): New constant.
9301 (DEBUG_ALL): Add DEBUG_RELAXATION.
9302 (debug_string_to_enum): Add relaxation debug option.
9304 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9305 Layout::Relaxation_debug_check::read_sections,
9306 Layout::Relaxation_debug_check::read_sections): New method definitions.
9307 (Layout::Layout): Initialize data members
9308 record_output_section_data_from_scrips_,
9309 script_output_section_data_list_ and relaxation_debug_check_.
9310 (Layout::save_segments, Layout::restore_segments,
9311 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9312 Layout::relaxation_loop_body): New method definitions.
9313 (Layout::finalize): Support relaxation. Move section layout code to
9314 Layout::relaxation_loop_body.
9315 (Layout::set_asection_address_from_script): Move code for orphan
9316 section placement out.
9317 (Layout::place_orphan_sections_in_script): New method definition.
9318 * layout.h (Output_segment_headers, Output_file_header):
9319 New forward class declarations.
9320 (Layout::~Layout): Define.
9321 (Layout::new_output_section_data_from_script): New method definition.
9322 (Layout::place_orphan_sections_in_script): New method declaration.
9323 (Layout::Segment_states): New type declaration.
9324 (Layout::save_segments, Layout::restore_segments,
9325 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9326 Layout::relaxation_loop_body): New method declarations.
9327 (Layout::Output_section_data_list): New type declaration.
9328 (Layout::Relaxation_debug_check): New class definition.
9329 (Layout::record_output_section_data_from_script_,
9330 Layout::script_output_section_data_list_, Layout::segment_states_,
9331 Layout::relaxation_debug_check_): New data members.
9332 * output.cc: (Output_section_headers::do_size): New method definition.
9333 (Output_section_headers::Output_section_headers): Move size
9334 computation to Output_section_headers::do_size.
9335 (Output_segment_headers::do_size): New method definition.
9336 (Output_file_header::Output_file_header): Move size computation to
9337 Output_file_header::do_size and call it.
9338 (Output_file_header::do_size): New method definition.
9339 (Output_data_group::Output_data_group): Adjust call to
9340 Output_section_data.
9341 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9342 (Output_symtab_xindex::do_write): Add array bound check.
9343 (Output_section::Input_section::print_to_mapfile): Handle
9344 RELAXED_INPUT_SECTION_CODE.
9345 (Output_section::Output_section): Initialize data member checkpoint_.
9346 (Output_section::~Output_section): Delete checkpoint object pointed
9348 (Output_section::add_input_section): Always add an Input_section if
9350 (Output_section::add_merge_input_section): Add assert.
9351 (Output_section::relax_input_section): New method definition.
9352 (Output_section::set_final_data_size): Set load address to zero for
9353 an unallocated section.
9354 (Output_section::do_address_and_file_offset_have_reset_values):
9355 New method definition.
9356 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9357 Handle relaxed input section.
9358 (Output_section::sort_attached_input_sections): Checkpoint input
9359 section list lazily.
9360 (Output_section::get_input_sections): Change type of input_sections to
9361 list of Simple_input_section pointers. Checkpoint input section list
9362 lazily. Also handle relaxed input sections.
9363 (Output_section::add_input_section_for_script): Take a reference to
9364 a Simple_input_section object instead of Relobj pointer and section
9365 index as parameter. Handle relaxed input sections.
9366 (Output_section::save_states, Output_section::restore_states): New
9368 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9369 (Output_data::is_data_size_fixed): New method definition.
9370 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9372 (Output_data::address_and_file_offset_have_reset_values): New method
9374 (Output_data::do_address_and_file_offset_have_reset_values): New method
9376 (Output_data::set_data_size): Check that data size is not fixed.
9377 (Output_data::fix_data_size): New method definition.
9378 (Output_data::is_data_size_fixed_): New data member.
9379 (Output_section_headers::set_final_data_size): New method definition.
9380 (Output_section_headers::do_size): New method declaration.
9381 (Output_segment_headers::set_final_data_size): New method definition.
9382 (Output_segment_headers::do_size): New method declaration.
9383 (Output_file_header::set_final_data_size)::New method definition.
9384 (Output_file_header::do_size)::New method declaration.
9385 (Output_section_data::Output_section_data): Add new parameter
9386 is_data_size_fixed and use it to fix data size.
9387 (Output_data_const::Output_data_const): Adjust call to base class
9388 constructor and fix data size.
9389 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9390 base class constructor and fix data size.
9391 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9392 base class constructor and fix data size.
9393 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9394 class constructor and fix data size.
9395 (Output_data_group::set_final_data_size): New method definition.
9396 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9397 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9398 class constructor and fix data size.
9399 (Output_relaxed_input_section): New class definition.
9400 (Output_section::Simple_input_section): New class definition.
9401 (Output_section::get_input_sections): Adjust parameter list.
9402 (Output_section::add_input_section_for_script): Same.
9403 (Output_section::save_states, Output_section::restore_states,
9404 Output_section::do_address_and_file_offset_have_reset_values,
9405 (Output_section::Input_section::Input_section): Handle
9406 RELAXED_INPUT_SECTION_CODE. Add new overload for
9407 Output_relaxed_input_section.
9408 (Output_section::Input_section::is_input_section,
9409 Output_section::Input_section::set_output_section): Handle relaxed
9411 (Output_section::Input_section::is_relaxed_input_section,
9412 Output_section::Input_section::output_section_data,
9413 Output_section::Input_section::relaxed_input_section): New method
9415 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9417 (Output_section::Input_section::u1_): Update comments.
9418 (Output_section::Input_section::u2_): Add new union member poris.
9419 (Output_section::Checkpoint_output_section): New classs definition.
9420 (Output_section::relax_input_section): New method declaration.
9421 (Output_section::checkpoint_): New data member.
9422 (Output_segment): Update comments.
9423 (Output_segment::Output_segment): Un-privatize copy constructor.
9424 (Output_segment::operator=): Un-privatize.
9425 * script-sections.cc (Output_section_element::Input_section_list):
9426 Change element type to Output_section::Simple_input_section.
9427 (Output_section_element_dot_assignment::set_section_addresses):
9428 Register output section data for relaxation clean up.
9429 (Output_data_exression::Output_data_expression): Adjust call to base
9430 constructor to fix data size.
9431 (Output_section_element_data::set_section_addresses): Register
9432 Output_data_expression object for relaxation clean up.
9433 (struct Input_section_info): Replace Relobj pointer and section index
9434 pair with Output_section::Simple_input_section and Convert struct to a
9436 (Input_section_sorter::operator()): Adjust access to
9437 Input_section_info data member to use accessors.
9438 (Output_section_element_input::set_section_addresses): Use layout
9439 parameter. Adjust code to use Output_section::Simple_input_section
9440 and Input_secction_info classes. Register filler for relaxation
9442 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9443 and section index pair with Output_section::Simple_input_section
9444 class. Adjust code accordingly.
9445 (Phdrs_element::release_segment): New method definition.
9446 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9448 (Script_sections::release_segments): New method definition.
9449 * gold/script-sections.h (Script_sections::release_segments): New
9451 * gold/target.h (Target::may_relax, Target::relax,
9452 Target::do_may_relax, Target::do_relax): New method definitions.
9454 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9456 * arm.cc (has_signed_unsigned_overflow): New function.
9457 (Arm_relocate_functions::abs8): New function.
9458 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9459 (Target_arm::Scan::global): Likewise.
9460 (Target_arm::relocate::relocate): Likewise.
9461 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9464 2009-09-16 Cary Coutant <ccoutant@google.com>
9466 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9467 * testsuite/Makefile.in: Regenerate.
9469 2009-09-11 Nick Clifton <nickc@redhat.com>
9471 * po/gold.pot: Updated by the Translation project.
9473 2009-09-08 Cary Coutant <ccoutant@google.com>
9475 * output.cc (Output_file::open): Add execute permission to empty file.
9476 * testsuite/Makefile.am (permission_test): New test.
9477 * testsuite/Makefile.in: Regenerate.
9479 2009-09-02 Ian Lance Taylor <iant@google.com>
9481 * output.cc (Output_file::resize): Call map_no_anonymous rather
9484 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9486 * gold.cc: Include "incremental.h".
9487 (queue_initial_tasks): Call Incremental_checker methods.
9488 * incremental.cc: Include "output.h".
9489 (Incremental_checker::can_incrementally_link_output_file): New
9491 * incremental.h (Incremental_checker): New class.
9493 * output.cc (Output_file::open_for_modification): New method.
9494 (Output_file::map_anonymous): Changed return type to bool. Record
9496 (Output_file::map_no_anonymous): New method, broken out of map.
9497 (Output_file::map): Use map_no_anonymous and map_anonymous.
9498 * output.h (class Output_file): Update declarations.
9500 2009-08-24 Cary Coutant <ccoutant@google.com>
9502 * options.h (Command_line::Pre_options): New class.
9503 (Command_line::pre_options): New member.
9504 * options.cc (gold::options::ready_to_register): New variable.
9505 (One_option::register_option): Do nothing if not registering options.
9506 Assert if same short option registered twice.
9507 (General_options::General_options): Turn off option registration when
9509 (Command_line::Pre_options::Pre_options): New constructor.
9511 2009-08-24 Cary Coutant <ccoutant@google.com>
9513 * options.h (General_options::no_keep_memory): Remove incorrect
9516 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9518 * Makefile.am (am__skiplex, am__skipyacc): New.
9519 * Makefile.in: Regenerate.
9521 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9523 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9524 (INCLUDES): ... this.
9525 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9526 (AM_CPPFLAGS): Renamed from ...
9527 (INCLUDE): ... this.
9528 * Makefile.in, testsuite/Makefile.in: Regenerate.
9530 * Makefile.in: Regenerate.
9531 * aclocal.m4: Likewise.
9532 * config.in: Likewise.
9533 * configure: Likewise.
9534 * testsuite/Makefile.in: Likewise.
9536 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9537 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9538 * Makefile.in: Regenerate.
9539 * testsuite/Makefile.in: Regenerate.
9541 2009-08-19 Cary Coutant <ccoutant@google.com>
9543 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9544 symbols in shared libraries overridden by hidden or internal symbols
9545 in the main program.
9547 2009-08-19 Chris Demetriou <cgd@google.com>
9549 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9550 checking source file names in error messages.
9552 2009-08-18 Doug Kwan <dougkwan@google.com>
9554 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9555 an elcpp::Ehdr as parameter. Adjust call to set_target.
9556 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9557 an elfcpp::Ehdr as parameter.
9558 * object.cc (Object::set_target): Remove the version that looks up
9559 a target and sets it.
9560 (Sized_relobj::setup): Take a Target object instead of
9561 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9562 (make_elf_sized_object): Find target and ask target to
9564 * object.h: (Object::set_target): Remove the version that looks up
9565 a target and sets it.
9566 (Sized_relobj::setup): Take a Target object instead of
9567 an elfcpp:Ehdr as parameter.
9568 * target.cc: Include dynobj.h.
9569 (Target::do_make_elf_object_implementation): New.
9570 (Target::do_make_elf_object): New.
9571 * target.h (Target::make_elf_object): New template declaration.
9572 (Target::do_make_elf_object): New method declarations.
9573 (Target::do_make_elf_object_implementation): New template declaration.
9575 2009-08-14 Ian Lance Taylor <iant@google.com>
9577 * gold.h (FUNCTION_NAME): Define.
9578 (gold_unreachable): Use FUNCTION_NAME.
9580 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9582 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9583 symbol in the --keep-unique list is not found.
9585 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9587 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9588 been maked as --keep-unique.
9589 (Icf::unfold_section): New function.
9590 * icf.h (Icf::unfold_section): New function.
9591 * options.h (General_options::keep_unique): New option.
9592 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9593 * testsuite/Makefile.in: Regenerate.
9594 * testsuite/icf_keep_unique_test.sh: New file.
9595 * testsuite/icf_keep_unique_test.cc: New file.
9597 2009-08-12 Cary Coutant <ccoutant@google.com>
9600 * resolve.cc (Symbol_table::resolve): Check for references from
9601 dynamic objects to hidden and internal symbols.
9602 * testsuite/Makefile.am (hidden_test.sh): New test.
9603 * testsuite/Makefile.in: Regenerate.
9604 * testsuite/hidden_test.sh: New script.
9605 * testsuite/hidden_test_1.c: New test source.
9606 * testsuite/hidden_test_main.c: New test source.
9608 2009-08-11 Doug Kwan <dougkwan@google.com>
9610 * arm.cc: Update comments.
9611 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9612 segment to locate the .ARM.exidx section if present.
9614 2009-08-09 Doug Kwan <dougkwan@google.com>
9616 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9619 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9620 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9623 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9625 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9626 valid tls_segment only for non-debug-section relocations.
9627 * testsuite/Makefile.am: Add gc_tls_test.
9628 * testsuite/Makefile.in: Regenerate.
9629 * testsuite/gc_tls_test.cc: New file.
9630 * testsuite/gc_tls_test.sh: New file.
9632 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9636 * Makefile.am (CCFILES): Add icf.cc.
9638 * Makefile.in: Regenerate.
9639 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9640 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9641 section, symbol and addend information for the relocs.
9642 * gold.cc (queue_middle_tasks): Call identical code folding.
9643 * gold.h: Add defines for multimap.
9644 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9645 to the call of finalize_local_symbols.
9646 * main.cc (main): Create object of class Icf.
9647 * object.cc (Sized_relobj::do_layout): Allow this function to be
9648 called twice during icf.
9649 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9650 to sections marked as identical by icf.
9651 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9653 (Sized_relobj::do_section_entsize): New function.
9654 * object.h (Object::section_entsize): New function.
9655 (Object::do_section_entsize): New pure virtual function.
9656 (Relobj::finalize_local_symbols): Add new parameter.
9657 (Relobj::do_section_entsize): New function.
9658 * options.h (General_options::icf): New option.
9659 (General_options::icf_iterations): New option.
9660 (General_options::print_icf_sections): New option.
9661 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9662 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9663 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9665 * symtab.cc (Symbol_table::is_section_folded): New function.
9666 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9667 to sections marked as identical by icf.
9668 * symtab.h (Symbol_table::set_icf): New function.
9669 (Symbol_table::icf): New function.
9670 (Symbol_table::is_section_folded): New function.
9671 (Symbol_table::icf_): New data member.
9672 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9673 * testsuite/Makefile.am: Add commands to build icf_test.
9674 * testsuite/Makefile.in: Regenerate.
9675 * testsuite/icf_test.sh: New file.
9676 * testsuite/icf_test.cc: New file.
9678 2009-07-24 Chris Demetriou <cgd@google.com>
9680 * layout.cc (is_compressible_debug_section): Fix incorrect
9681 comment about compressed section names.
9683 2009-07-20 Ian Lance Taylor <ian@airs.com>
9686 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9688 2009-07-16 Ian Lance Taylor <iant@google.com>
9691 * layout.h: #include <map>.
9692 (class Kept_section): Change from struct to class. Add accessors
9693 and setters. Add section size to Comdat_group mapping. Change
9694 Comdat_group to std::map. Add is_comdat_ field. Add
9695 linkonce_size field in union.
9696 (class Layout): Update declaration of find_or_add_kept_section.
9697 Don't declare find_kept_object.
9698 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9699 parameter. Add object, shndx, is_comdat, and is_group_name
9700 parameters. Change all callers. Adjust for new Kept_section.
9701 (Layout::find_kept_object): Remove.
9702 * object.cc (Sized_relobj::include_section_group): Update use of
9703 Kept_section. Rename secnum to shndx. Only record
9704 Kept_comdat_section if sections are the same size.
9705 (Sized_relobj::include_linkonce_section): Update use of
9706 Kept_section. Only record Kept_comdat_section if sections are the
9707 same size. Set size of linkonce section.
9708 (Sized_relobj::map_to_kept_section): Update call to
9709 get_kept_comdat_section.
9710 * object.h (class Sized_relobj): Rename fields in
9711 Kept_comdat_section to drop trailing underscores; change object
9712 field to Relobj*. Change Kept_comdat_section_table to store
9713 struct rather than pointer.
9714 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9715 Add kept_object and kept_shndx parameters. Change all callers.
9716 (Sized_relobj::get_kept_comdat_section): Change return type to
9717 bool. Add kept_object and kept_shndx parameters. Change all
9719 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9720 Layout::find_or_add_kept_section.
9722 2009-07-09 Ian Lance Taylor <iant@google.com>
9724 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9725 Reserve space in the hash table.
9727 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9729 * fileread.cc (File_read::get_mtime): New method.
9730 * fileread.h (Timespec): New structure.
9731 (File_read::get_mtime): New method.
9732 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9733 Renamed from timestamp_nsec.
9734 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9736 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9738 (Incremental_inputs::report_archive): Save mtime; style fix.
9739 (Incremental_inputs::report_obejct): Save mtime; style fix.
9740 (Incremental_inputs::report_script): Save mtime; style fix.
9741 (Incremental_inputs::finalize_inputs): Style fix.
9742 (Incremental_inputs::finalize): Style fix.
9743 (Incremental_inputs::create_input_section_data): Store inputs
9745 * incremental.h (Incremental_inputs::report_script): Add mtime
9747 (Incremental_inputs::Input_info::Input_info): Intialize only one
9749 (Incremental_inputs::Input_info::archive): Move to nameless
9751 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9752 (Incremental_inputs::Input_info::script): Move to nameless union.
9753 (Incremental_inputs::mtime): New field.
9754 * script.cc (read_input_script): Pass file mtime to
9756 * script.h (Script_info::inputs): Style fix.
9758 2009-07-01 Ian Lance Taylor <ian@airs.com>
9760 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9763 2009-06-24 Ian Lance Taylor <iant@google.com>
9766 * layout.cc (Layout::choose_output_section): If we find an
9767 existing section, update the flags.
9768 (Layout::create_notes): New function, broken out of
9770 (Layout::finalize): Don't create note sections.
9771 (Layout::create_note): Don't crash if linker script discards
9773 (Layout::create_gold_note): Likewise.
9774 (Layout::create_build_id): Likewise. Don't set
9775 after_input_sections on the section.
9776 (Layout::create_executable_stack_info): Remove target parameter.
9778 * layout.h (class Layout): Declare create_notes. Update
9779 declaration of create_executable_stack_info.
9780 * gold.cc (queue_middle_tasks): Call create_notes.
9781 * output.cc (Output_section::update_flags_for_input_section): Move
9782 here from output.h. If SHF_ALLOC flag is newly set, mark address
9784 * output.h (Output_data::mark_address_invalid): New function.
9785 (class Output_section): Only declare, not define,
9786 update_flags_for_input_section. Remove set_flags.
9788 2009-06-24 Ian Lance Taylor <iant@google.com>
9790 * script-sections.cc (Output_section_definition::
9791 set_section_addresses): Rename shadowing local load_address to
9794 2009-06-24 Ian Lance Taylor <iant@google.com>
9797 * reloc.cc (relocate_sections): Skip empty relocation sections.
9799 2009-06-23 Ian Lance Taylor <iant@google.com>
9802 * layout.cc (Layout::create_note): Use choose_output_section
9803 rather than make_output_section.
9805 2009-06-23 Ian Lance Taylor <iant@google.com>
9808 * options.cc (General_options::parse_V): Set printed_version_.
9809 (General_options::General_options): Initialize printed_version_.
9810 * options.h (class General_options): Add printed_version_ field.
9811 * gold.cc (queue_initial_tasks): If there are no input files,
9812 don't give a fatal error if we printed the version information.
9813 (queue_middle_tasks): If using -r with a shared object, give a
9814 fatal error rather than an ordinary error.
9816 2009-06-23 Ian Lance Taylor <iant@google.com>
9819 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9820 (Layout::make_output_section): Set have_stabstr_section_ if we see
9821 a .stab*str section.
9822 (Layout::finalize): Call link_stabs_sections.
9823 (Layout::link_stabs_sections): New file.
9824 * layout.h (class Layout): Add have_stabstr_section_ field.
9825 Declare link_stabs_sections.
9827 2009-06-23 Doug Kwan <dougkwan@google.com>
9829 * Makefile.am (libgold_a_LIBADD): New.
9830 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9831 * Makefile.in: Regenerate.
9832 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9833 * configure: Regenerate.
9834 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9835 * fileread.cc: Include sys/state.h
9836 * gold.h: Declare memmem and strndup if found missing.
9837 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9839 2009-06-23 Ian Lance Taylor <iant@google.com>
9841 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9842 * configure: Rebuild.
9844 2009-06-23 Ian Lance Taylor <iant@google.com>
9847 * object.cc (Object::section_contents): Don't try to get a view if
9848 the section has length zero.
9849 (Object::handle_gnu_warning_section): If the section is empty, use
9850 the name of the section as the warning.
9852 2009-06-23 Ian Lance Taylor <iant@google.com>
9855 * stringpool.h (class Stringpool_template): Add optimize_ field.
9856 (Stringpool_template::set_optimize): New function.
9857 * stringpool.cc (Stringpool_template::Stringpool_template):
9858 Initialize optimize_ field.
9859 (Stringpool_template::set_string_offsets): Test local optimize
9860 fild rather than parameter.
9861 * layout.cc (Layout::Layout): Call set_optimize on the section
9864 2009-06-22 Ian Lance Taylor <iant@google.com>
9867 * yyscript.y: Parse TARGET.
9868 * script.cc (script_set_target): New function.
9869 * script-c.h (script_set_target): Declare.
9870 * options.cc (General_options::string_to_object_format): Rename
9871 from string_to_object_format in anonymous namespace. Change
9873 * options.h (class General_options): Declare
9874 string_to_object_format.
9876 2009-06-22 Ian Lance Taylor <iant@google.com>
9878 * script-sections.cc (Script_sections::create_segments): Don't put
9879 program headers in a PT_LOAD segment if -n or -N.
9881 2009-06-22 Ian Lance Taylor <iant@google.com>
9884 * options.h (class General_options): Add -z lazy and -z now. Sort
9885 -z options into alphabetical order.
9886 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9888 2009-06-21 Ian Lance Taylor <iant@google.com>
9890 * layout.cc (Layout::make_output_section): Call
9891 Target::new_output_section.
9892 (Layout::attach_allocated_section_to_segment): Put large section
9893 sections in a separate load segment with the large segment flag
9895 (Layout::segment_precedes): Sort large data segments after other
9897 (align_file_offset): New static function.
9898 (Layout::set_segment_offsets): Use align_file_offset.
9899 * output.h (class Output_section): Add is_small_section_ and
9900 is_large_section_ fields.
9901 (Output_section::is_small_section): New function.
9902 (Output_section::set_is_small_section): New function.
9903 (Output_section::is_large_section): New function.
9904 (Output_section::set_is_large_section): New function.
9905 (Output_section::is_large_data_section): New function.
9906 (class Output_segment): Add is_large_data_segment_ field.
9907 (Output_segment::is_large_data_segment): New function.
9908 (Output_segment::set_is_large_data_segment): New function.
9909 * output.cc (Output_section::Output_section): Initialize new
9911 (Output_segment::Output_segment): Likewise.
9912 (Output_segment::add_output_section): Add assertion that large
9913 data sections always go in large data segments. Force small data
9914 sections to the end of the list of data sections. Force small BSS
9915 sections to the start of the list of BSS sections. For large BSS
9916 sections to the end of the list of BSS sections.
9917 * symtab.h (class Symbol): Declare is_common_shndx.
9918 (Symbol::is_defined): Check Symbol::is_common_shndx.
9919 (Symbol::is_common): Likewise.
9920 (class Symbol_table): Define enum Commons_section_type. Update
9921 declarations. Add small_commons_ and large_commons_ fields.
9922 * symtab.cc (Symbol::is_common_shndx): New function.
9923 (Symbol_table::Symbol_table): Initialize new fields.
9924 (Symbol_table::add_from_object): Put small and large common
9925 symbols in the right list.
9926 (Symbol_table::sized_finalized_symbol): Check
9927 Symbol::is_common_shndx.
9928 (Symbol_table::sized_write_globals): Likewise.
9929 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9930 common symbol lists. Don't call do_allocate_commons_list if the
9932 (Symbol_table::do_allocate_commons_list): Remove is_tls
9933 parameter. Add comons_section_type parameter. Change all
9934 callers. Handle small and large common symbols.
9935 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9936 Symbol::is_common_shndx.
9937 * resolve.cc (symbol_to_bits): Likewise.
9938 * target.h (Target::small_common_shndx): New function.
9939 (Target::small_common_section_flags): New function.
9940 (Target::large_common_shndx): New function.
9941 (Target::large_common_section_flags): New function.
9942 (Target::new_output_section): New function.
9943 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9944 small_common_section_flags, and large_common_section_flags
9946 (Target::do_new_output_section): New virtual function.
9947 * arm.cc (Target_arm::arm_info): Initialize new fields.
9948 * i386.cc (Target_i386::i386_info): Likewise.
9949 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9951 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9952 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9953 (Target_x86_64::do_new_output_section): New function.
9954 * configure.ac: Define conditional MCMODEL_MEDIUM.
9955 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9956 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9957 (large_LDFLAGS): Define.
9958 * testsuite/large.c: New file.
9959 * testsuite/testfile.cc (Target_test::test_target_info):
9960 Initialize new fields.
9961 * configure, testsuite/Makefile.in: Rebuild.
9963 2009-06-05 Doug Kwan <dougkwan@google.com>
9965 * Makefile.am (CCFILES): Add target.cc.
9966 * Makefile.in: Regenerate.
9967 * i386.cc (class Target_i386): Define new virtual method to
9968 override do_is_local_label_name in parent.
9969 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9970 local symbols if --discard-locals or -X is given.
9971 * options.h (class General_options): Declare new options
9972 '--discard-locals' and '-X' for discarding locals.
9973 * target.h (class Target): Define new methods is_local_label_name.
9974 Declare new virtual method do_is_local_label_name.
9975 * target.cc: New file.
9976 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9977 (check_SCRIPTS): Add discard_locals_test.sh.
9978 (check_DATA): Add discard_local_tests.syms.
9979 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9980 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9981 * testsuite/Makefile.in: Regenerate.
9982 * testsuite/discard_locals_test.c: New file.
9983 * testsuite/discard_locals_test.sh: Same.
9985 2009-06-05 Doug Kwan <dougkwan@google.com>
9987 * object.cc (Sized_relobj::Sized_relobj): Initialize
9988 discarded_eh_frame_shndx_ to -1U.
9989 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9991 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9992 a discarded .eh_frame section.
9993 (Sized_relobj::do_finalize_local_symbols): Ditto.
9994 * object.h (class Sized_relobj): Declare new member
9995 discarded_eh_frame_shndx_.
9996 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9997 (local_labels_test.o, local_labels_test): New rules.
9998 * testsuite/Makefile.in: Regenerate.
10000 2009-06-04 Doug Kwan <dougkwan@google.com>
10002 * layout.cc (Layout::section_name_mapping): Add mapping for
10003 special ARM sections.
10005 2009-06-03 Doug Kwan <dougkwan@google.com>
10007 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10008 (utils::has_overflow): Same.
10010 2009-06-03 Ian Lance Taylor <iant@google.com>
10012 * layout.cc (Layout::section_name_mapping): New array, replacing
10013 Layout::linkonce_mapping.
10014 (Layout::section_name_mapping_count): New variable, replacing
10015 Layout::linkonce_mapping_count.
10016 (Layout::linkonce_output_name): Remove.
10017 (Layout::output_section_name): Rewrite.
10018 * layout.h (class Layout): Rename Linkonce_mapping to
10019 Section_name_mapping, linkonce_mapping to section_name_mapping,
10020 linkonce_mapping_count to section_name_mapping_count. Don't
10021 declare linkonce_output_name.
10023 2009-06-03 Doug Kwan <dougkwan@google.com>
10025 * gold/arm.cc (namespace utils): New.
10026 (Target_arm::reloc_is_non_pic): Define new method.
10027 (class Arm_relocate_functions): New.
10028 (Target_arm::Relocate::relocate): Handle relocation types used by
10031 2009-06-03 Ian Lance Taylor <iant@google.com>
10033 * arm.cc (Target_arm::scan::global): Use || instead of |.
10035 2009-06-02 Doug Kwan <dougkwan@google.com>
10037 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10038 issued_non_pic_error_.
10039 (class Target_arm::Scan): Declare new method check_non_pic.
10040 Define new method symbol_needs_plt_entry.
10041 Declare new data member issued_non_pic_error_.
10042 (class Target_arm::Relocate): Declare new method
10043 should_apply_static_reloc.
10044 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10045 (Target_arm::Scan::check_non_pic): Define new method.
10046 (Target_arm::Scan::local): Handle a small subset of reloc types used
10048 (Target_arm::Scan::local): Same.
10049 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10051 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10053 * incremental.cc (Incremental_inputs::report_command_line): Filter
10054 out --incremental-* options.
10056 2009-05-29 Doug Kwan <dougkwan@google.com>
10058 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10060 (class Target_arm): Update comment.
10061 (Target_arm::Target_arm): Initialize new data members GOT_,
10062 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10063 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10064 and Target_arm::rel_dyn_section.
10065 Declare new_enum Target_arm::Got_type.
10066 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10068 Update commments for member do_dynsym_value.
10069 (Target_arm::got_size, Target_arm::plt_section,
10070 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10071 new methods inside class defintion.
10072 (Target_arm::got_section): Define new method.
10073 (Target_arm::rel_dyn_section): Same.
10074 (Output_data_plt_arm): New template class.
10075 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10076 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10077 (Output_data_plt_arm::add_entry): Same.
10078 (Output_data_plt_arm::first_plt_entry): Define new
10079 static data member for PLT instruction template.
10080 (Output_data_plt_arm::plt_entry): Same.
10081 (Output_data_plt_arm::do_write): Define new method.
10082 (Target_arm::make_plt_entry): Same.
10083 (Target_arm::do_finalize_sections): Same.
10084 (Target_arm::do_dynsym_value): Same.
10086 2009-05-28 Doug Kwan <dougkwan@google.com>
10088 * Makefile.am (TARGETSOURCES): Add arm.cc.
10089 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10090 * Makefile.in: Regenerate.
10091 * arm.cc: New file.
10092 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10094 2009-05-26 Doug Kwan <dougkwan@google.com>
10096 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10097 (General_options::check_excluded_libs): Strip off directories in
10098 archive name before matching like GNU ld does.
10099 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10100 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10101 (exclude_libs_test_LDFLAGS): Add linker option
10102 -Wl,--exclude-libs,libexclude_libs_test_3
10103 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10104 an explicit archive without using -l.
10105 (alt/libexclude_libs_test_3.a): New make rule.
10106 * testsuite/Makefile.in: Regenerate.
10107 * testsuite/exclude_libs_test.c : Declare lib3_default().
10109 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10110 * exclude_libs_test_3.c: New file.
10112 2009-05-26 Nick Clifton <nickc@redhat.com>
10114 * po/id.po: New Indonesian translation.
10115 * po/gold.pot: Updated template file.
10117 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10119 * testsuite/Makefile.am: Add -ffunction-sections to compile
10120 gc_comdat_test files. Add -Wl,--gc-sections to build
10122 * testsuite/Makefile.in: Regenerate.
10123 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10125 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10127 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10128 kept comdat section was garbage collected.
10129 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10130 * testsuite/Makefile.in: Regenerate.
10131 * testsuite/gc_comdat_test.sh: New file.
10132 * testsuite/gc_comdat_test_1.cc: New file.
10133 * testsuite/gc_comdat_test_2.cc: New file.
10135 2009-05-19 Doug Kwan <dougkwan@google.com>
10137 * archive.cc (Archive::Archive): Move constructor from archive.h
10138 to here. Initialize no_export_.
10139 (Archive::get_elf_object_for_member): Set no_export flag of object.
10140 * archive.h (Archive::Archive): Move constructor body to
10142 (Archive::no_export): New method.
10143 (Archive::no_export_): New field.
10144 * object.h (Object::Object): Initialize no_export_ to false.
10145 (Object::no_export, Object::set_no_export): New methods.
10146 (Object::no_export_): New field.
10147 * options.cc (General_options::parse_exclude_libs): New method.
10148 (General_options::check_excluded_libs) Same.
10149 * options.h (exclude_libs): New option.
10150 (General_options::check_excluded_libs): New method declaration.
10151 (General_options::excluded_libs_): New field.
10152 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10153 default or protected visibility if an object has no-export flag set.
10154 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10155 (check_SCRIPTS): Add exclude_libs_test.sh.
10156 (check_DATA): Add exclude_libs_test.syms.
10157 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10158 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10159 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10160 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10161 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10162 libexclude_libs_test_2.a): New rules.
10163 * testsuite/Makefile.in: Regenerate.
10164 * testsuite/exclude_libs_test.c: New file.
10165 * testsuite/exclude_libs_test.sh: Ditto.
10166 * testsuite/exclude_libs_test_1.c: Ditto.
10167 * testsuite/exclude_libs_test_2.c: Ditto.
10169 2009-05-15 Ian Lance Taylor <iant@google.com>
10171 * configure.ac: Check for declarations for cases where libiberty.h
10172 checks HAVE_DECL_xxx.
10173 * configure, config.in: Rebuild.
10175 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10177 * gold.h (Incremental_argument_list): Remove (invalid) forward
10179 * incremental.cc (Incremental_inputs::report_achive): New method.
10180 (Incremental_inputs::report_object): New method.
10181 (Incremental_inputs::report_script): New method.
10182 (Incremental_inputs::finalize_inputs): New method.
10183 (Incremental_inputs::finalize): Call finalize_inputs().
10184 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10185 Create inputs entries.
10186 * incremental.h (Incremental_input_type): New enum.
10187 (Incremental_inputs::Incremental_input): Initialize new fields.
10188 (Incremental_inputs::report_inputs): New method.
10189 (Incremental_inputs::report_achive): New method.
10190 (Incremental_inputs::report_object): New method.
10191 (Incremental_inputs::report_script): New method.
10192 (Incremental_inputs::finalize_inputs): New method.
10193 (Incremental_inputs::Input_info): New struct.
10194 (Incremental_inputs::Input_info_map): New typedef.
10195 (Incremental_inputs::lock_): New field.
10196 (Incremental_inputs::Inputs_): New field.
10197 (Incremental_inputs::Inputs_map): New field.
10198 * main.cc (main): Call Incremental_input::report_inputs.
10199 * options.h (Input_argument_list): Typedef moved from
10201 (Input_file_group::Files): Remove, use ::Input_argument_list.
10202 (Input_file_group::Input_argument_list): Remove, use
10203 ::Input_argument_list.
10204 * plugin.cc (Plugin_manager::add_input_file): Add error in
10206 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10208 * script.cc (read_input_script): Call
10209 Incremental_input::report_script.
10210 * script.h (Script_info): New class.
10212 2009-04-27 Ian Lance Taylor <iant@google.com>
10214 * x86_64.cc (do_adjust_output_section): Set entsize to
10217 2009-04-23 Elliott Hughes <enh@google.com>
10219 * output.cc (Output_file::close): After short writes, continue
10220 writing from the correct offset in the buffer being written.
10222 2009-04-23 Chris Demetriou <cgd@google.com>
10224 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10225 * configure: Regenerate.
10226 * config.in: Regenerate.
10227 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10228 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10230 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10232 * incremental.cc (Incremental_inputs_header_data): Renamed from
10233 Incremental_input_header_data.
10234 (Incremental_inputs_header_data::data_size): New field.
10235 (Incremental_inputs_header_data::put_input_file_count): Renamed
10236 from input_file_count.
10237 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10238 from command_line_offset.
10239 (Incremental_inputs_header_data::put_reserved): Renamed from
10241 (Incremental_inputs_entry_data): Renamed from
10242 Incremental_input_entry_data.
10243 (Incremental_inputs_entry_data::data_size): New field.
10244 (Incremental_inputs::report_command_line): New method.
10245 (Incremental_inputs::finalize): New method.
10246 (Incremental_inputs::create_incremental_inputs_data): New method.
10247 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10248 * incremental.h: New file.
10249 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10250 (Layout::finalize): Create incremental inputs section in
10251 incremental builds.
10252 (Layout::create_incremental_info_sections): New method.
10253 * layout.h (Layout::incremental_inputs): New method.
10254 (Layout::create_incremental_info_sections): New method.
10255 (Layout::incremental_inputs_): New field.
10256 * main.cc (main): Notify Incremental_input of the command line.
10258 2009-04-01 Ian Lance Taylor <iant@google.com>
10259 Mikolaj Zalewski <mikolajz@google.com>
10261 * gold.h (reserve_unordered_map): Define, three versions, one for
10262 each version of Unordered_map.
10263 * layout.cc (Layout::Layout): Remove options parameter. Add
10264 number_of_input_files parameter. Don't initialize options_.
10265 Initialize number_of_input_files_ and resized_signatures_. Move
10266 sections_are_attached_.
10267 (Layout::layout_group): Reserve space for group_signatures_.
10268 (Layout::find_or_add_kept_section): Change name parameter to be a
10269 reference. Resize signatures_ map when it gets large enough.
10270 (Layout::layout_eh_frame): Use parameters->options() instead of
10272 (Layout::make_output_section): Likewise.
10273 (Layout::attach_allocated_section_to_segment): Likewise.
10274 (Layout::finalize, Layout::create_executable_stack): Likewise.
10275 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10276 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10277 * layout.h (class Layout): Update declarations. Remove options_
10278 field. Add number_of_input_files_ and resized_signatures_
10279 fields. Move sections_are_attached_ field.
10280 * main.cc (main): Pass number of input files to Layout
10281 constructor. Don't pass options.
10283 2009-03-30 Ian Lance Taylor <iant@google.com>
10285 * ffsll.c (ffsll): Correct implementation.
10287 2009-03-27 Ian Lance Taylor <iant@google.com>
10289 * ffsll.c: New file.
10290 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10291 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10292 * ftruncate.c (ftruncate): Declare before definition.
10293 * mremap.c (mremap): Likewise.
10294 * pread.c (pread): Likewise.
10295 * configure, Makefile.in, config.in: Rebuild.
10297 * mremap.c: New file.
10298 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10299 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10300 (mremap): Declare if HAVE_MREMAP is not defined.
10301 * configure, Makefile.in, config.in: Rebuild.
10303 2009-03-27 Cary Coutant <ccoutant@google.com>
10305 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10306 position independent.
10307 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10308 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10310 2009-03-24 Cary Coutant <ccoutant@google.com>
10312 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10314 (needs_dynamic_reloc): Likewise.
10316 2009-03-24 Ian Lance Taylor <iant@google.com>
10318 * yyscript.y (file_cmd): Recognize EXTERN.
10319 (extern_name_list, extern_name_list_body): New nonterminals.
10320 * script.cc (script_add_extern): Define.
10321 * script-c.h (script_add_extern): Declare.
10323 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10325 * object.cc (is_elf_object): Define.
10326 * object.h (is_elf_object): Declare.
10327 * archive.cc (Archive::get_elf_object_for_member): Call
10329 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10331 2009-03-24 Elliott Hughes <enh@google.com>
10333 * output.cc (Output_file::map_anonymous): Define.
10334 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10335 try an anonymous one. Report the size if the mmap fails.
10336 * output.h (class Output_file): Declare map_anonymous.
10338 2009-03-24 Ian Lance Taylor <iant@google.com>
10340 * target-select.cc (instantiate_target): Don't acquire the lock if
10341 the instantiated_target_ field has already been set.
10343 2009-03-23 Ian Lance Taylor <iant@google.com>
10345 * gold-threads.h (class Initialize_lock): Define.
10346 * gold-threads.cc (class Initialize_lock_once): Define.
10347 (initialize_lock_control): New static variable.
10348 (initialize_lock_pointer): New static variable.
10349 (initialize_lock_once): New static function.
10350 (Initialize_lock::Initialize_lock): Define.
10351 (Initialize_lock::initialize): Define.
10352 * target-select.h: Include "gold-threads.h".
10353 (class Target_selector): Add lock_ and initialize_lock_ fields.
10354 Don't define instantiate_target, just declare it.
10355 * target-select.cc (Target_selector::Target_selector): Initialize
10357 (Target_selector::instantiate_target): Define.
10358 * descriptors.h: Include "gold-threads.h".
10359 (class Descriptors): Add initialize_lock_ field.
10360 * descriptors.cc (Descriptors::Descriptors): Initialize new
10362 (Descriptors::open): Use initialize_lock_ field
10363 * errors.h (class Errors): Add initialize_lock_ field.
10364 * errors.cc (Errors::Errors): Initialize new field.
10365 (Errors::initialize_lock): Use initialize_lock_ field.
10366 * powerpc.cc (class Target_selector_powerpc): Remove
10367 instantiated_target_ field. In do_recognize call
10368 instantiate_target rather than do_instantiate_target. In
10369 do_instantiate_target just allocate a new target.
10370 * sparc.cc (class Target_selector_sparc): Likewise.
10372 * freebsd.h: New file.
10373 * i386.cc: Include "freebsd.h".
10374 (Target_i386): Derive from Target_freebsd rather than
10376 (Target_selector_i386): Derive from Target_selector_freebsd rather
10377 than Target_selector.
10378 * x86_64.cc: Include "freebsd.h".
10379 (Target_x86_64): Derive from Target_freebsd rather than
10381 (Target_selector_x86_64): Derive from Target_selector_freebsd
10382 rather than Target_selector.
10383 * target.h (class Target): Add adjust_elf_header and
10384 do_adjust_elf_header.
10385 * output.cc (Output_file_header:: do_sized_write): Call target
10386 adjust_elf_header routine.
10387 * configure.tgt: Set targ_osabi.
10388 * configure.ac: Define GOLD_DEFAULT_OSABI.
10389 * parameters.cc (Parameters::default_target): Pass
10390 GOLD_DEFAULT_OSABI to select_target.
10391 * target-select.h (class Target_selector): Make instantiate_target
10392 protected rather than private.
10393 * Makefile.am (HFILES): Add freebsd.h.
10394 * configure, Makefile.in, config.in: Rebuild.
10396 * merge.cc (do_add_input_section): Correct pend value. Change
10397 message about last entry not being null terminated from error to
10400 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10402 * incremental.cc: New file.
10403 * Makefile.am (CCFILES): Add incremental.cc.
10404 * Makefile.in: Rebuild.
10406 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10408 * layout.cc (Layout::output_section_name): Preserve names
10409 of '.note.' sections.
10411 2009-03-19 Ian Lance Taylor <iant@google.com>
10413 * descriptors.cc (Descriptors::open): Check that the options are
10414 valid before using them.
10416 2009-03-18 Ian Lance Taylor <iant@google.com>
10418 * script-sections.h: Include <list>.
10419 (class Script_sections): Change Sections_elements from std::vector
10420 to std::list. Typedef public Elements_iterator. Add
10421 orphan_section_placement_, data_segment_align_start_, and
10422 saw_data_segment_align_ fields. Remove data_segment_align_index_
10424 * script-sections.cc (class Orphan_section_placement): New class.
10425 (class Sections_element): Add virtual functions is_relro and
10426 orphan_section_init. Remove virtual function place_orphan_here.
10427 (class Output_section_definition): Add is_relro and
10428 orphan_section_init. Remove place_orphan_here.
10429 (class Orphan_output_section): Likewise.
10430 (Script_sections::Script_sections): Update for field changes.
10431 (Script_sections::data_segment_align): Set saw_data_segment_align_
10432 and data_segment_align_start_, not data_segment_align_index.
10433 (Script_sections::data_segment_relro_end): Check
10434 saw_data_segment_align_. Use data_segment_align_start_ rather
10435 than data_segment_align_index_.
10436 (Script_sections::place_orphan): Rewrite to use
10437 Orphan_section_placement.
10439 2009-03-17 Ian Lance Taylor <iant@google.com>
10441 * archive.cc (Archive::add_symbols): Check for a version attached
10442 to the symbol name in the archive map.
10443 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10444 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10445 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10446 (ver_test_11.a): New target.
10447 * testsuite/Makefile.in: Rebuild.
10449 * configure.ac: Check for chsize and posix_fallocate. Replace
10451 * ftruncate.c: New file, from gnulib.
10452 * output.cc (posix_fallocate): Define dummy version if not
10453 HAVE_POSIX_FALLOCATE.
10454 (Output_file::map): Call posix_fallocate rather than lseek and
10456 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10457 * configure, Makefile.in, config.in: Rebuild.
10459 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10461 * layout.h (Layout::create_note): Add section_name parameter.
10462 * layout.cc (Layout::create_note): Likewise.
10463 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10465 2009-03-17 Ian Lance Taylor <iant@google.com>
10467 * descriptors.cc: Include "options.h".
10468 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10469 (Descriptors::open): Always use O_CLOEXEC when opening a new
10470 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10471 then set FD_CLOEXEC.
10473 * sparc.cc (class Target_sparc): Add has_got_section.
10474 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10475 make sure we have a GOT section.
10477 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10478 (Target_sparc::Scan::local): Likewise.
10479 (Target_sparc::Scan::global): Likewise.
10480 (Target_sparc::Relocate::relocate): Likewise.
10481 (Target_sparc::Relocate::relocate_tls): Likewise.
10483 * symtab.cc (Symbol_table::define_default_version): New function,
10484 broken out of add_from_object.
10485 (Symbol_table::add_from_object): Call define_default_version.
10486 (Symbol_table::define_special_symbol): Add resolve_oldsym
10487 parameter. Change all callers. If the version for a symbol comes
10488 from a version script, resolve it with the symbol with the same
10489 name with no version. Also add the symbol without a version if
10491 (do_define_in_output_data): If resolving with oldsym, don't delete
10493 (do_define_in_output_segment): Likewise.
10494 (do_define_as_constant): Likewise.
10495 * symtab.h (class Symbol_table): Update declarations.
10497 2009-03-13 Ian Lance Taylor <iant@google.com>
10499 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10500 (Read_symbols::requeue): New function.
10501 (Read_symbols::do_read_symbols): If make_elf_object fails because
10502 the target type is not configured, and the file was searched for,
10503 issue a warning and retry with the next directory.
10504 (Add_symbols::run): If the file has an incompatible format, and
10505 it was searched for, requeue the Read_symbols task. On error,
10506 release the object.
10507 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10508 dirindex parameter to constructor. Change all callers. Declare
10509 incompatible_warning and requeue.
10510 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10511 input_argument_ and input_group_ fields. Add them to
10512 constructor. Change all callers.
10513 (class Read_script): Add dirindex_ field. Add it to constructor.
10514 Change all callers.
10515 * archive.cc (Archive::setup): Remove input_objects parameter.
10516 Change all callers.
10517 (Archive::get_file_and_offset): Likewise.
10518 (Archive::read_all_symbols): Likewise.
10519 (Archive::read_symbols): Likewise.
10520 (Archive::get_elf_object_for_member): Remove input_objects
10521 parameter. Add punconfigured parameter. Change all callers.
10522 (Archive::add_symbols): Change return type to bool. Check return
10523 value of include_member.
10524 (Archive::include_all_members): Likewise.
10525 (Archive::include_member): Change return type to bool. Return
10526 false if first included object has incompatible target. Set
10527 included_member_ field.
10528 (Add_archive_symbols::run): If add_symbols returns false, requeue
10530 * archive.h (class Archive): Add included_member_ field.
10531 Initialize it in constructor. Add input_file and searched_for
10532 methods. Update declarations.
10533 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10534 input_argument_ fields. Add them to constructor. Change all
10536 * script.cc: Include "target-select.h".
10537 (class Parser_closure): Add skip_on_incompatible_target_ and
10538 found_incompatible_target_ fields. Add
10539 skip_on_incompatible_target parameter to constructor. Change all
10540 callers. Add methods skip_on_incompatible_target,
10541 clear_skip_on_incompatible_target, found_incompatible_target, and
10542 set_found_incompatible_target.
10543 (read_input_script): Add dirindex parameter. Change all callers.
10544 If parser finds an incompatible target, requeue Read_symbols
10546 (script_set_symbol): Clear skip_on_incompatible_target in
10548 (script_add_assertion, script_parse_option): Likewise.
10549 (script_start_sections, script_add_phdr): Likewise.
10550 (script_check_output_format): New function.
10551 * script.h (read_input_script): Update declaration.
10552 * script-c.h (script_check_output_format): Declare.
10553 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10554 (ignore_cmd): Remove OUTPUT_FORMAT.
10555 * fileread.cc (Input_file::Input_file): Add explicit this.
10556 (Input_file::will_search_for): New function.
10557 (Input_file::open): Add pindex parameter. Change all callers.
10558 * fileread.h (class Input_file): Add input_file_argument method.
10559 Declare will_search_for. Update declarations.
10560 * object.cc (make_elf_object): Add punconfigured parameter.
10561 Change all callers.
10562 * object.h (class Object): Make input_file public. Add
10563 searched_for method.
10564 (make_elf_object): Update declaration.
10565 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10567 * dirsearch.h (class Dirsearch): Update declaration.
10568 * options.h (class General_options): Add --warn-search-mismatch.
10569 * parameters.cc (Parameters::is_compatible_target): New function.
10570 * parameters.h (class Parameters): Declare is_compatible_target.
10571 * workqueue.cc (Workqueue::add_blocker): New function.
10572 * workqueue.h (class Workqueue): Declare add_blocker.
10574 * fileread.cc (Input_file::open): Remove options parameter.
10575 Change all callers.
10576 (Input_file::open_binary): Likewise.
10577 * script.cc (read_input_script): Likewise.
10578 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10579 options parameter from constructor. Change all callers.
10580 (class Read_script): Likewise.
10581 * fileread.h (class Input_file): Update declarations.
10582 * script.h (read_input_script): Update declaration.
10584 2009-03-10 Nick Clifton <nickc@redhat.com>
10586 * po/es.po: New Spanish translation.
10588 2009-03-06 Cary Coutant <ccoutant@google.com>
10590 * options.cc (parse_short_option): Keep dash_z from registering itself.
10592 2009-03-03 Ian Lance Taylor <iant@google.com>
10595 * target-reloc.h (relocate_section): Pass output_section to
10597 * i386.cc (Target_i386::should_apply_static_reloc): Add
10598 output_section parameter. Change all callers.
10599 (Target_i386::Relocate::relocate): Add output_section parameter.
10600 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10601 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10602 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10603 * testsuite/two_file_shared.sh: New script.
10604 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10605 (check_DATA): Add two_file_shared.dbg.
10606 (two_file_shared.dbg): New target.
10607 * testsuite/Makefile.in: Rebuild.
10609 2009-03-01 Ian Lance Taylor <iant@google.com>
10611 * configure.ac: Check for byteswap.h.
10612 * configure: Rebuild.
10613 * config.in: Rebuild.
10615 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10617 * layout.cc (Layout::find_or_add_kept_section): New function.
10618 (Layout::add_comdat): Removed.
10619 * layout.h (struct Kept_section): Move out of class Layout.
10620 Remove trailing underscores from field names. Add group_sections
10621 field. Rename group_ field to is_group. Change all uses.
10622 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10623 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10624 comdat_groups_ field.
10625 (Sized_relobj::include_section_group): Use
10626 find_or_add_kept_section and Kept_section::group_sections.
10627 (Sized_relobj::include_linkonce_section): Likewise.
10628 * object.cc (class Sized_relobj): Don't define Comdat_group or
10629 Comdat_group_table. Remove find_comdat_group and
10630 add_comdat_group. Remove comdat_groups_ field.
10631 * plugin.cc (include_comdat_group): Use
10632 Layout::find_or_add_kept_section.
10634 2009-02-28 Ian Lance Taylor <iant@google.com>
10636 * README: --gc-sections and map files are now supported. Document
10637 some build requirements.
10640 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10641 relocatable link set the value of the section symbol to zero.
10642 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10643 relocatable link don't include the section address in the local
10646 2009-02-27 Ian Lance Taylor <iant@google.com>
10649 * options.h (class Search_directory): Add is_system_directory.
10650 (class General_options): Declare is_in_system_directory.
10651 * options.cc (get_relative_sysroot): Make static.
10652 (get_default_sysroot): Make static.
10653 (General_optoins::is_in_system_directory): New function.
10654 * fileread.cc (Input_file::is_in_system_directory): New function.
10655 * fileread.h (class Input_file): Declare is_in_system_directory.
10656 * object.h (class Object): Add is_in_system_directory.
10657 (class Input_objects): Remove system_library_directory_ field.
10658 * object.cc (Input_objects::add_object): Don't set
10659 system_library_directory_.
10660 (input_objects::found_in_system_library_directory): Remove.
10661 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10662 parameter. Change all callers.
10663 (Symbol_table::sized_write_globals): Likewise.
10664 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10665 Call Object::is_in_system_directory.
10666 * symtab.h (class Symbol_table): Update declarations.
10669 * descriptors.h (Open_descriptor): Add is_on_stack field.
10670 * descriptors.cc (Descriptors::open): If the descriptor is on the
10671 top of the stack, remove it. Initialize is_on_stack field.
10672 (Descriptors::release): Only add pod to stack if it is not on the
10674 (Descriptors::close_some_descriptor): Clear stack_next and
10675 is_on_stack fields.
10678 * output.cc (Output_section::find_starting_output_address): Rename
10679 from starting_output_address; add PADDR parameter; change return
10681 * output.h (class Output_section): Declare
10682 find_starting_output_address instead of starting_output_address.
10683 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10684 section symbol for which we can't find a merge section.
10687 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10688 hidden or internal, force the symbol to be local.
10689 * resolve.cc (Symbol::override_visibility): Define.
10690 (Symbol::override_base): Use override_visibility.
10691 (Symbol_table::resolve): Likewise.
10692 (Symbol::override_base_with_special): Likewise.
10693 (Symbol_table::override_with_special): If the visibility is hidden
10694 or internal, force the symbol to be local.
10695 * symtab.h (class Symbol): Add set_visibility and
10696 override_visibility.
10697 * testsuite/ver_test_1.sh: New file.
10698 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10699 (check_DATA): Add ver_test_1.syms.
10700 (ver_test_1.syms): New target.
10701 * testsuite/Makefile.in: Rebuild.
10703 2009-02-25 Cary Coutant <ccoutant@google.com>
10705 * layout.cc (Layout::choose_output_section): Don't rename sections
10706 when using a linker script that has a SECTIONS clause.
10707 * Makefile.in: Regenerate.
10709 * testsuite/Makefile.am (script_test_5.sh): New test case.
10710 * testsuite/Makefile.in: Regenerate.
10711 * testsuite/script_test_5.cc: New file.
10712 * testsuite/script_test_5.sh: New file.
10713 * testsuite/script_test_5.t: New file.
10715 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10717 * archive.cc (Archive::include_member): Update calls to add_symbols.
10718 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10719 the Layout argument.
10720 * dynobj.h (do_add_symbols): Add the Layout argument.
10721 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10723 * object.h (Object::add_symbols): Add the Layout argument.
10724 (Object::do_add_symbols): Add the Layout argument.
10725 (Sized_relobj::do_add_symbols): Add the Layout argument.
10726 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10727 Unify the two versions.
10728 (Add_plugin_symbols): Remove.
10729 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10730 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10731 (Add_plugin_symbols): Remove.
10732 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10733 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10734 (Add_symbols::run): Make it work with Pulginobj.
10736 2009-02-06 Ian Lance Taylor <iant@google.com>
10738 * object.cc (Sized_relobj::do_layout): Make info message start
10739 with lower case letter.
10741 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10743 * binary.cc: Fix file comment.
10745 * options.h (enum Incremental_disposition): Define.
10746 (class General_options): Add new options: --incremental,
10747 --incremental_changed, --incremental_unchanged,
10748 --incremental_unknown. Add incremental_disposition_ and
10749 implicit_incremental_ fields.
10750 (General_options::incremental_disposition): New function.
10751 (class Position_dependent_options): Add incremental_disposition
10753 (Position_dependent_options::copy_from_options): Set incremental
10755 * options.cc (General_options::parse_incremental_changed): New
10757 (General_options::parse_incremental_unchanged): New function.
10758 (General_options::parse_incremental_unknown): New function.
10759 (General_options::General_options): Initialize new fields
10760 incremental_disposition_ and implicit_incremental_.
10761 (General_options::finalize): Check for uasge of --incremental-*
10762 without --incremental.
10764 2009-02-06 Chris Demetriou <cgd@google.com>
10766 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10767 pointer and to report location as the file name associated with
10769 (gold_undefined_symbol_at_location): New function to replace the
10770 old gold_undefined_symbol functionality.
10771 * target-reloc.h (relocate_section): Update to use
10772 gold_undefined_symbol_at_location.
10773 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10774 Call gold_undefined_symbol function rather than gold_error.
10775 * errors.h (Errors::undefined_symbol): Take location as a
10776 string, rather than calculating it from a relocation.
10777 * errors.cc (Errors::fatal): Print "fatal error:" before the
10779 (Errors::error, Errors::error_at_location): Print "error: "
10780 before the formatted message.
10781 (Errors::undefined_symbol): Take location as a string, rather
10782 than calculating it from a relocation.
10783 (gold_undefined_symbol_at_location): New function akin to
10784 old gold_undefined_symbol, calculates location from relocation.
10785 (gold_undefined_symbol): Change to take only a Symbol pointer
10786 and to report location as the file name associated with the symbol.
10787 * testsuite/debug_msg.sh: Update for changed error messages.
10788 * testsuite/undef_symbol.sh: Likewise.
10790 2009-02-04 Duncan Sands <baldrick@free.fr>
10793 * reduced_debug_output.h
10794 (Output_reduced_debug_abbrev_section::failed): Use format for
10796 (Output_reduced_debug_info_section::faild): Likewise.
10798 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10800 * script.cc (Lazy_demangler): New class.
10801 (Version_script_info::get_symbol_version_helper): Demangle a
10804 2009-01-29 Cary Coutant <ccoutant@google.com>
10806 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10808 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10810 2009-01-28 Ian Lance Taylor <iant@google.com>
10812 * version.cc (version_string): Bump to 1.9.
10814 * gold.h: Include <cstring> and <stdint.h>.
10815 * version.cc: Include <cstdio>.
10816 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10818 * reduced_debug_output.cc (insert_into_vector): Rename from
10819 Insert_into_vector; change all callers. Use Swap_unaligned to
10820 avoid aliasing issue; remove union since it is unnecessary.
10822 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10824 * Makefile.am (CCFILES): Add gc.cc.
10825 (HFILES): Add gc.h.
10826 * Makefile.in: Regenerate.
10827 * gold.cc (Gc_runner): New class.
10828 (queue_initial_tasks): Call garbage collection related tasks
10829 when corresponding options are invoked.
10830 (queue_middle_gc_tasks): New function.
10831 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10832 processed early before laying out sections during garbage collection.
10833 * gold.h (queue_middle_gc_tasks): New function.
10834 (is_prefix_of): Move from "layout.cc".
10835 * i386.cc (Target_i386::gc_process_relocs): New function.
10836 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10837 * main.cc (main): Create object of class "Garbage_collection".
10838 * object.cc (Relobj::copy_symbols_data): New function.
10839 (Relobj::is_section_name_included): New function.
10840 (Sized_relobj::do_layout): Allow this function to be called twice
10841 during garbage collection and defer layout of section during the
10843 * object.h (Relobj::get_symbols_data): New function.
10844 (Relobj::is_section_name_included): New function.
10845 (Relobj::copy_symbols_data): New function.
10846 (Relobj::set_symbols_data): New function.
10847 (Relobj::get_relocs_data): New function.
10848 (Relobj::set_relocs_data): New function.
10849 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10850 (Relobj::gc_process_relocs): New function.
10851 (Relobj::do_gc_process_relocs): New pure virtual function.
10852 (Relobj::sd_): New data member.
10853 (Sized_relobj::is_output_section_offset_invalid): New function.
10854 (Sized_relobj::do_gc_process_relocs): New function.
10855 * options.h (General_options::gc_sections): Modify to not be a no-op.
10856 (General_options::print_gc_sections): New option.
10857 * plugin.cc (Plugin_finish::run): Remove function call to
10858 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10859 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10860 * reloc.cc (Read_relocs::run): Add task to process relocs and
10861 determine unreferenced sections when doing garbage collection.
10862 (Gc_process_relocs): New class.
10863 (Sized_relobj::do_gc_process_relocs): New function.
10864 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10865 sections that are garbage collected.
10866 * reloc.h (Gc_process_relocs): New class.
10867 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10868 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10869 symbols whose corresponding sections are garbage collected.
10870 (Symbol_table::Symbol_table): Add new parameter for the garbage
10872 (Symbol_table::gc_mark_undef_symbols): New function.
10873 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10874 (Symbol_table::gc_mark_dyn_syms): New function.
10875 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10877 (Symbol_table::add_from_object): Likewise.
10878 (Symbol_table::add_from_relobj): When building shared objects, do not
10879 treat externally visible symbols as garbage.
10880 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10881 table information for static and relocatable links.
10882 * symtab.h (Symbol_table::set_gc): New function.
10883 (Symbol_table::gc): New function.
10884 (Symbol_table::gc_mark_undef_symbols): New function.
10885 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10886 (Symbol_table::gc_mark_dyn_syms): New function.
10887 (Symbol_table::gc_): New data member.
10888 * target.h (Sized_target::gc_process_relocs): New pure virtual
10890 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10891 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10893 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10895 * options.h (General_options::gc_sections): Define as a no-op for now.
10896 (General_options::no_keep_memory): Ditto.
10897 (General_options::Bshareable): Define.
10898 * options.cc (General_options::finalize): Honor -Bshareable.
10900 2009-01-20 Andreas Schwab <schwab@suse.de>
10902 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10903 read the value in the contents, since we don't use it. Use the
10904 template endianness when writing.
10905 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10907 2009-01-19 Andreas Schwab <schwab@suse.de>
10909 * configure.tgt (powerpc64-*): Fix targ_obj.
10911 2009-01-15 Ian Lance Taylor <iant@google.com>
10913 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10914 local symbols when stripping all symbols.
10916 2009-01-14 Cary Coutant <ccoutant@google.com>
10918 * output.cc (Output_reloc): Add explicit instantiations.
10920 2009-01-14 Cary Coutant <ccoutant@google.com>
10922 * archive.cc (Archive::get_elf_object_for_member): Remove call
10923 to File_read::claim_for_plugin.
10924 * descriptors.cc (Descriptors::open): Remove reference to
10926 (Descriptors::claim_for_plugin): Remove.
10927 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10928 (Descriptors::is_claimed): Remove.
10929 (claim_descriptor_for_plugin): Remove.
10930 * fileread.cc (File_read::claim_for_plugin): Remove.
10931 * fileread.h (File_read::claim_for_plugin): Remove.
10932 (File_read::descriptor): Reopen descriptor if necessary.
10933 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10934 (Plugin_manager::all_symbols_read): Add task parameter. Change
10936 (Plugin_manager::get_input_file): New function.
10937 (Plugin_manager::release_input_file): New function.
10938 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10939 corresponding data member.
10940 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10941 and pass to base constructor. Change all callers.
10942 (get_input_file, release_input_file): New functions.
10943 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10944 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10945 (Plugin_manager::all_symbols_read): Add task parameter.
10946 (Plugin_manager::get_input_file): New function.
10947 (Plugin_manager::release_input_file): New function.
10948 (Plugin_manager::task_): New data member.
10949 (Pluginobj::Pluginobj): Add filesize parameter.
10950 (Pluginobj::filename): New function.
10951 (Pluginobj::descriptor): New function.
10952 (Pluginobj::filesize): New function.
10953 (Pluginobj::filesize_): New data member.
10954 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10955 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10956 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10958 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10959 with archive libraries.
10960 * testsuite/Makefile.in: Regenerate.
10961 * testsuite/plugin_test.c (struct sym_info): New type.
10962 (get_input_file, release_input_file): New static variables.
10963 (onload): Capture new transfer vector entries.
10964 (claim_file_hook): Stop reading at end of file according to filesize.
10965 Factor out parsing of readelf output into separate function.
10966 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10967 APIs and get the source file name from the symbol table. Convert
10968 source file name to corresponding object file name. Print info
10969 message when adding new input files.
10970 (parse_readelf_line): New function.
10971 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10972 * testsuite/plugin_test_2.sh: Likewise.
10973 * testsuite/plugin_test_3.sh: Likewise.
10974 * testsuite/plugin_test_4.sh: New test case.
10976 2009-01-07 Ian Lance Taylor <iant@google.com>
10978 * version.cc (version_string): Bump to 1.8.
10980 2008-12-23 Cary Coutant <ccoutant@google.com>
10982 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10983 * plugin.cc (Plugin_manager::finish): Rename as
10984 layout_deferred_objects. Move cleanup to separate function.
10985 (Plugin_manager::cleanup): New function.
10986 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10988 * plugin.h (Plugin_manager::finish): Rename as
10989 layout_deferred_objects.
10990 (Plugin_manager::cleanup): New function.
10991 (Plugin_manager::cleanup_done): New field.
10993 2008-12-23 Cary Coutant <ccoutant@google.com>
10995 * plugin.cc (is_visible_from_outside): New function.
10996 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10997 so we don't return "IR only" status for exported symbols or -r links.
10999 * testsuite/Makefile.am (plugin_test_3): New test case.
11000 * testsuite/Makefile.in: Regenerate.
11001 * testsuite/plugin_test_3.sh: New file.
11003 2008-12-22 Cary Coutant <ccoutant@google.com>
11005 * object.cc (Sized_relobj::layout_section): New function.
11006 (Sized_relobj::do_layout): Defer layout of input sections until after
11007 plugin has provided replacement files.
11008 (Sized_relobj::do_layout_deferred_sections): New function.
11009 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11010 (Relobj::layout_deferred_sections): New function.
11011 (Relobj::do_layout_deferred_sections): New function.
11012 (Sized_relobj::do_layout_deferred_sections): New function.
11013 (Sized_relobj::layout_section): New function.
11014 (Sized_relobj::Deferred_layout): New structure.
11015 (Sized_relobj::deferred_layout_): New field.
11016 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11017 Change all callers. Layout deferred sections.
11018 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11020 (Plugin_hook::run): Move code from do_plugin_hook inline.
11021 (Plugin_hook::do_plugin_hook): Remove.
11022 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11023 (Plugin_manager::finish): Renamed, was cleanup.
11024 (Plugin_manager::should_defer_layout): New function.
11025 (Plugin_manager::add_deferred_layout_object): New function.
11026 (Plugin_manager::Deferred_layout_list): New type.
11027 (Plugin_manager::deferred_layout_objects_): New field.
11028 (Plugin_hook::do_plugin_hook): Remove.
11030 2008-12-17 Ian Lance Taylor <iant@google.com>
11032 * options.h (class General_options): Add --no case for
11035 2008-12-16 Cary Coutant <ccoutant@google.com>
11037 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11039 (Plugin_manager::claim_file): Create plugin object even if
11040 plugin did not call the add_symbols callback.
11041 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11042 asking for more symbols than were added.
11043 * testsuite/Makefile.am (plugin_test_1): Add test case with
11045 (empty.syms): New target.
11046 * testsuite/Makefile.in: Regenerate.
11047 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11048 message. Don't call add_symbols if no globals.
11049 (all_symbols_read_hook): Don't provide replacement for empty
11052 2008-12-12 Ian Lance Taylor <iant@google.com>
11054 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11055 r_type == 0 for a local symbol with r_sym == 0.
11056 (scan_relocatable_relocs): Pass r_sym to
11057 local_non_section_strategy.
11058 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11061 * configure.ac: Update test for TLS descriptors: they are
11062 supported as of glibc 2.9.
11063 * configure: Rebuild.
11065 2008-12-11 Ian Lance Taylor <iant@google.com>
11068 * target-reloc.h (Default_scan_relocatable_relocs): For each
11069 function, map r_type == 0 to RELOC_DISCARD.
11071 2008-12-10 Cary Coutant <ccoutant@google.com>
11073 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11074 object to override a kept COMDAT group from a plugin object.
11076 2008-12-09 Ian Lance Taylor <iant@google.com>
11079 * yyscript.y (file_cmd): Handle INPUT.
11081 * testsuite/initpri1.c: Change all declarations to be full
11082 prototypes by adding void, to avoid compiler warnings.
11084 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
11086 * options.cc (General_options::parse_plugin_opt): New.
11087 (General_options::add_plugin): The argument now is just the filename.
11088 (General_options::add_plugin_option): New.
11089 * options.h (plugin_opt): New.
11090 (add_plugin): Change argument name.
11091 (add_plugin_option): New.
11092 * plugin.cc (Plugin::load): Don't parse the plugin option.
11093 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11094 (Plugin::add_option): New.
11095 (Plugin::args_): Change type.
11096 (Plugin::filename_): New.
11097 (Plugin_manager::add_plugin_option): New.
11098 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11099 * testsuite/Makefile.in: Regenerate.
11101 2008-12-05 Cary Coutant <ccoutant@google.com>
11103 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11104 Handle --strip-lto-sections option.
11105 * options.h (strip_lto_sections): New option.
11107 2008-12-01 Cary Coutant <ccoutant@google.com>
11109 * plugin.cc (ld_plugin_message): Change format parameter to const.
11110 Fix mismatch between new[] and delete.
11112 2008-11-14 Cary Coutant <ccoutant@google.com>
11114 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11117 2008-11-05 Craig Silverstein <csilvers@google.com>
11119 * options.cc (General_options::parse_dynamic_list): New function.
11120 * options.h (General_options): New flags dynamic_list,
11121 dynamic_list_data, dynamic_list_cpp_new, and
11122 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11123 (General_options::in_dynamic_list): New function.
11124 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11125 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11126 (Lex::can_continue_name): Likewise.
11128 (read_script_file): New parameter script_options.
11129 (read_dynamic_list): New function.
11130 (Script_options::define_dynamic_list): New function.
11131 (dynamic_list_keyword_parsecodes): New variable.
11132 (dynamic_list_keywords): New variable.
11133 * script.h (Script_options::define_dynamic_list): New function
11135 (read_dynamic_list): New function prototype.
11136 * symtab.cc (strprefix): New macro.
11137 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11138 dynamic_list_data, dynamic_list_cpp_new, and
11139 dynamic_list_cpp_typeinfo.
11140 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11141 (dynamic_list_expr): New rule.
11142 (dynamic_list_nodes): Likewise.
11143 (dynamic_list_node): Likewise.
11144 * testsuite/Makefile.am (dynamic_list): New test.
11145 * testsuite/Makefile.in: Regenerated.
11146 * testsuite/dynamic_list.t: New file.
11147 * testsuite/dynamic_list.sh: New file.
11149 2008-11-05 Craig Silverstein <csilvers@google.com>
11151 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11152 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11153 (t11_last): Likewise.
11154 * testsuite/ver_test_6.c (main): Likewise.
11156 2008-10-07 Cary Coutant <ccoutant@google.com>
11158 * options.c (General_options::finalize): Add check for -static and
11160 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11163 2008-10-02 Cary Coutant <ccoutant@google.com>
11165 * plugin.cc (make_sized_plugin_object): Fix conditional
11166 compilation to work when not all targets are enabled.
11168 2008-09-29 Cary Coutant <ccoutant@google.com>
11170 * archive.cc (Archive::get_file_and_offset): Use filename instead
11171 of name to get library path.
11172 (Archive::include_member): Unlock external member of a thin archive.
11174 * testsuite/Makefile.am (TEST_AR): New variable.
11175 (thin_archive_test_1): New test.
11176 (thin_archive_test_2): New test.
11177 * testsuite/Makefile.in: Regenerate.
11178 * testsuite/thin_archive_main.cc: New file.
11179 * testsuite/thin_archive_test_1.cc: New file.
11180 * testsuite/thin_archive_test_2.cc: New file.
11181 * testsuite/thin_archive_test_3.cc: New file.
11182 * testsuite/thin_archive_test_4.cc: New file.
11184 2008-09-29 Cary Coutant <ccoutant@google.com>
11186 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11187 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11189 (Sized_relobj::do_finalize_local_symbols): Likewise.
11190 (Sized_relobj::map_to_kept_section): Likewise.
11191 * object.h (Sized_relobj::invalid_address): New constant.
11192 (Sized_relobj::do_output_section_offset): Check for invalid_address
11194 * output.cc (Output_reloc::local_section_offset): Use constant
11195 invalid_address instead of -1U.
11196 (Output_reloc::get_address): Likewise.
11197 (Output_section::output_address): Change -1U to -1ULL.
11198 * output.h (Output_reloc::invalid_address): New constant.
11199 * reloc.cc (Sized_relobj::write_sections): Use constant
11200 invalid_address instead of -1U.
11201 (Sized_relobj::relocate_sections): Likewise.
11202 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11203 values for merge sections.
11204 * target-reloc.h (relocate_for_relocatable): Use constant
11205 invalid_address instead of -1U.
11207 2008-09-19 Cary Coutant <ccoutant@google.com>
11209 Add plugin functionality for link-time optimization (LTO).
11210 * configure.ac (plugins): Add --enable-plugins option.
11211 * configure: Regenerate.
11212 * config.in: Regenerate.
11213 * Makefile.am (LIBDL): New variable.
11214 (CCFILES): Add plugin.cc.
11215 (HFILES): Add plugin.h.
11216 (ldadd_var): Add LIBDL.
11217 * Makefile.in: Regenerate.
11219 * archive.cc: Include "plugin.h".
11220 (Archive::setup): Don't preread archive symbols when using a plugin.
11221 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11222 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11224 (Archive::include_member): Add symbols from plugin objects.
11225 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11226 * descriptors.cc (Descriptors::open): Check for file descriptors
11227 abandoned by plugins.
11228 (Descriptors::claim_for_plugin): New function.
11229 * descriptors.h (Descriptors::claim_for_plugin): New function.
11230 (Open_descriptor::is_claimed): New field.
11231 (claim_descriptor_for_plugin): New function.
11232 * fileread.cc (File_read::claim_for_plugin): New function.
11233 * fileread.h (File_read::claim_for_plugin): New function.
11234 (File_read::descriptor): New function.
11235 * gold.cc: Include "plugin.h".
11236 (queue_initial_tasks): Add task to call plugin hooks for generating
11238 * main.cc: Include "plugin.h".
11239 (main): Load plugin libraries.
11240 * object.h (Pluginobj): Declare.
11241 (Object::pluginobj): New function.
11242 (Object::do_pluginobj): New function.
11243 (Object::set_target): New function.
11244 * options.cc: Include "plugin.h".
11245 (General_options::parse_plugin): New function.
11246 (General_options::General_options): Initialize plugins_ field.
11247 (General_options::add_plugin): New function.
11248 * options.h (Plugin_manager): Declare.
11249 (General_options): Add --plugin option.
11250 (General_options::has_plugins): New function.
11251 (General_options::plugins): New function.
11252 (General_options::add_plugin): New function.
11253 (General_options::plugins_): New field.
11254 * plugin.cc: New file.
11255 * plugin.h: New file.
11256 * readsyms.cc: Include "plugin.h".
11257 (Read_symbols::do_read_symbols): Check for archive before checking
11258 for ELF file. Call plugin hooks to claim files.
11259 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11260 from a real object file; force override when processing replacement
11262 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11263 (Symbol::init_base_object): Likewise.
11264 (Symbol::init_base_output_data): Likewise.
11265 (Symbol::init_base_output_segment): Likewise.
11266 (Symbol::init_base_constant): Likewise.
11267 (Symbol::init_base_undefined): Likewise.
11268 (Symbol::output_section): Assert that object is not a plugin.
11269 (Symbol_table::add_from_pluginobj): New function.
11270 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11272 (Symbol_table::sized_write_globals): Likewise.
11273 (Symbol_table::add_from_pluginobj): Instantiate template.
11274 * symtab.h (Sized_pluginobj): Declare.
11275 (Symbol::in_real_elf): New function.
11276 (Symbol::set_in_real_elf): New function.
11277 (Symbol::in_real_elf_): New field.
11278 (Symbol_table::add_from_pluginobj): New function.
11280 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11281 (LIBDL): New variable.
11282 (LDADD): Add LIBDL.
11283 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11284 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11285 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11286 (MOSTLYCLEANFILES): Likewise.
11287 * testsuite/Makefile.in: Regenerate.
11288 * testsuite/plugin_test.c: New file.
11289 * testsuite/plugin_test_1.sh: New file.
11290 * testsuite/plugin_test_2.sh: New file.
11292 2008-09-16 Ian Lance Taylor <iant@google.com>
11294 * target-reloc.h (relocate_section): Check whether a symbol is
11295 defined by the ABI before reporting an undefined symbol error.
11296 * target.h (Target::is_defined_by_abi): Make parameter const.
11297 (Target::do_is_defined_by_abi): Likewise.
11298 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11299 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11300 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11301 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11302 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11303 * testsuite/Makefile.in: Rebuild.
11305 * fileread.cc (make_view): Add casts to avoid warning.
11307 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11309 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11310 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11312 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11314 * options.h (General_options::output_is_executable): New.
11315 (General_options::output_is_pie): New.
11316 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11317 for shared libraries.
11318 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11320 2008-09-11 Chris Demetriou <cgd@google.com>
11322 * options.h (origin): New -z option.
11323 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11324 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11327 2008-09-05 Cary Coutant <ccoutant@google.com>
11329 * fileread.cc (File_read::make_view): Add check for attempt to map
11330 beyond end of file.
11332 2008-09-05 Cary Coutant <ccoutant@google.com>
11334 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11335 explicit instantiations.
11337 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11340 * options.cc (General_options::finalize): Allow undefined symbols
11341 in shlibs if linking -shared.
11344 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11345 symbols as not needing a dynsym entry.
11347 2008-08-20 Craig Silverstein <csilvers@google.com>
11349 * fileread.cc (File_read::open): Do not lock the file unless it
11350 was successfully opened.
11352 2008-08-14 Cary Coutant <ccoutant@google.com>
11354 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11355 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11356 * testsuite/tls_test.cc (struct int128): 128-bit struct
11357 for testing TLS relocs with non-zero addend.
11358 (v12): New TLS variable.
11360 (t_last): Add check for v12.
11361 * testsuite/tls_test.h (t12): New function.
11362 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11364 2008-08-13 Ian Lance Taylor <iant@google.com>
11366 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11367 set tls_segment_ or relro_segment_.
11368 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11370 * output.h (Output_section::clear_is_relro): New function.
11371 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11372 sections specially even when output_data_ is empty.
11373 (Output_segment::maximum_alignment): When first section is relro,
11374 only force alignment for PT_LOAD segments.
11375 * script.cc (script_data_segment_align): New function.
11376 (script_data_segment_relro_end): New function.
11377 * script-c.h (script_data_segment_align): Declare.
11378 (script_data_segment_relro_end): Declare.
11379 * script-sections.h (class Script_sections): Declare
11380 data_segment_align and data_segment_relro_end. Add fields
11381 segment_align_index_ and saw_relro_end_.
11382 * script-sections.cc (class Sections_element): Add set_is_relro
11383 virtual function. Add new bool* parameter to place_orphan_here.
11384 Add get_output_section virtual function.
11385 (class Output_section_definition): Add set_is_relro. Add new
11386 bool* parameter to place_orphan_here. Add get_output_section.
11387 Add is_relro_ field.
11388 (Output_section_definition::Output_section_definition): Initialize
11389 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11390 and is_relro_ fields.
11391 (Output_section_definition::place_orphan_here): Add is_relro
11393 (Output_section_definition::set_section_addresses): Set relro for
11395 (Output_section_definition::alternate_constraint): Likewise.
11396 (class Orphan_output_section): Add new bool* parameter to
11397 place_orphan_here. Add get_output_section.
11398 (Orphan_output_section::place_orphan_here): Add is_relro
11400 (Script_sections::Script_sections): Initialize
11401 data_segment_align_index_ and saw_relro_end_.
11402 (Script_sections::data_segment_align): New function.
11403 (Script_sections::data_segment_relro_end): New function.
11404 (Script_sections::place_orphan): Set or clear is_relro.
11405 (Script_sections::set_section_addresses): Force alignment of first
11407 * yyscript.y (exp): Call script_data_segment_align and
11408 script_data_segment_relro_end.
11409 * testsuite/relro_script_test.t: New file.
11410 * testsuite/relro_test.cc (using_script): Declare.
11411 (t1, t2): Test using_script.
11412 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11413 (relro_script_test_SOURCES): Define.
11414 (relro_script_test_DEPENDENCIES): Define.
11415 (relro_script_test_LDFLAGS): Define.
11416 (relro_script_test_LDADD): Define.
11417 (relro_script_test.so): New target.
11418 * testsuite/Makefile.in: Rebuild.
11420 2008-08-06 Cary Coutant <ccoutant@google.com>
11422 * archive.cc (Archive::total_archives, Archive::total_members)
11423 (Archive::total_members_loaded): New variables.
11424 (Archive::setup): Add parameter. Add option to preread
11426 (Archive::read_armap): Add counter.
11427 (Archive::get_file_and_offset): New function.
11428 (Archive::get_elf_object_for_member): New function.
11429 (Archive::read_all_symbols): New function.
11430 (Archive::read_symbols): New function.
11431 (Archive::add_symbols): Add counters.
11432 (Archive::include_all_members): Use armap to find members if it's
11434 (Archive::include_member): Skip reading symbols if already read.
11435 Factored code into Archive::get_file_and_offset and
11436 Archive::get_elf_object_for_member. Changed call to
11437 Mapfile::report_include_archive_member.
11438 (Archive::print_stats): New function.
11439 * archive.h: Declare Object and Read_symbols_data classes.
11440 (Archive::Archive): Add initializers for new members.
11441 (Archive::setup): Add parameter.
11442 (Archive::print_stats): New function.
11443 (Archive::total_archives, Archive::total_members)
11444 (Archive::total_members_loaded): New variables.
11445 (Archive::get_file_and_offset): New function.
11446 (Archive::get_elf_object_for_member): New function.
11447 (Archive::read_all_symbols): New function.
11448 (Archive::read_symbols): New function.
11449 (Archive::Archive_member): New class.
11450 (Archive::members_): New member.
11451 (Archive::num_members_): New member.
11452 * main.cc: Include archive.h.
11453 (main): Call Archive::print_stats.
11454 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11455 archive parameter; member_name is now the fully-decorated name.
11456 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11457 * options.h: (General_options): Add --preread-archive-symbols option.
11458 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11461 2008-08-04 Ian Lance Taylor <iant@google.com>
11463 * symtab.h (Symbol::use_plt_offset): New function.
11464 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11465 * powerpc.cc (Relocate::relocate): Likewise.
11466 * sparc.cc (Relocate::relocate): Likewise.
11467 * x86_64.cc (Relocate::relocate): Likewise.
11468 * testsuite/weak_plt.sh: New test.
11469 * testsuite/weak_plt_main.cc: New test.
11470 * testsuite/weak_plt_shared.cc: New test.
11471 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11472 (check_PROGRAMS): Add weak_plt.
11473 (check_DATA): Add weak_plt_shared.so.
11474 (weak_plt_main_pic.o, weak_plt): New targets.
11475 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11476 * testsuite/Makefile.in: Rebuild.
11478 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11480 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11481 * testsuite/Makefile.in: Rebuild.
11483 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11485 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11486 * Makefile.in: Regenerate.
11487 * po/POTFILES.in: Regenerate.
11489 2008-07-29 Ian Lance Taylor <iant@google.com>
11491 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11492 symbols before other symbols.
11493 * testsuite/script_test_2.cc (test_addr): Declare.
11494 (test_addr_alias): Declare.
11495 (main): Check that test_addr and test_addr_alias have the right
11497 * testsuite/script_test_2.t: Define test_addr_alias and
11500 2008-07-24 Ian Lance Taylor <iant@google.com>
11503 * descriptors.cc: New file.
11504 * descriptors.h: New file.
11505 * gold-threads.h (class Hold_optional_lock): New class.
11506 * fileread.cc: Include "descriptors.h".
11507 (File_read::~File_read): Release descriptor rather than closing
11509 (File_read::open) [file]: Call open_descriptor rather than open.
11510 Set is_descriptor_opened_.
11511 (File_read::open) [memory]: Assert that descriptor is not open.
11512 (File_read::reopen_descriptor): New function.
11513 (File_read::release): Release descriptor.
11514 (File_read::do_read): Make non-const. Reopen descriptor.
11515 (File_read::read): Make non-const.
11516 (File_read::make_view): Reopen descriptor.
11517 (File_read::do_readv): Likewise.
11518 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11519 Update declarations.
11520 * layout.cc: Include "descriptors.h".
11521 (Layout::create_build_id): Use open_descriptor rather than open.
11522 * output.cc: Include "descriptors.h".
11523 (Output_file::open): Use open_descriptor rather than open.
11524 * archive.cc (Archive::const_iterator): Change Archive to be
11526 (Archive::begin, Archive::end): Make non-const.
11527 (Archive::count_members): Likewise.
11528 * archive.h (class Archive): Update declarations.
11529 * object.h (Object::read): Make non-const.
11530 * Makefile.am (CCFILES): Add descriptors.cc.
11531 (HFILES): Add descriptors.h.
11532 * Makefile.in: Rebuild.
11535 * gold.h: Always include <clocale>. Add Solaris workarounds
11536 following code in binutils/sysdep.h.
11539 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11540 this->eh_frame_hdr_ is NULL before using it.
11542 * dynobj.cc (Versions::Versions): Update comment.
11544 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11545 the base version name.
11547 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11548 array size plus one.
11549 (Stringpool_template::set_string_offsets): Subtract one from key
11550 before using it as an array index.
11551 (Stringpool_template::get_offset_with_length): Likewise.
11552 (Stringpool_template::write_to_buffer): Likewise.
11553 * stringpool.h (Stringpool_template::get_offset_from_key):
11556 2008-07-23 Ian Lance Taylor <iant@google.com>
11559 * object.h (Merged_symbol_value::value): Do our best to handle a
11563 * script.cc (Version_script_info::get_versions): Don't add empty
11564 version tag to return value.
11565 (Version_script_info::get_symbol_version_helper): Change return
11566 type to bool. Add pversion parameter. Change all callers.
11567 (script_register_vers_node): Don't require a non-NULL tag.
11568 * script.h (class Version_script_info): Update declarations.
11569 (Version_script_info::get_symbol_version): Change return type to
11570 bool. Add version parameter. Change all callers.
11571 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11572 handling. Handle an empty version from a version script.
11573 (Symbol_table::define_special_symbol): Likewise.
11574 * testsuite/ver_test_10.script: New file.
11575 * testsuite/ver_test_10.sh: New file.
11576 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11577 (check_DATA): Add ver_test_10.syms.
11578 (ver_test_10.syms, ver_test_10.so): New target.
11579 * testsuite/Makefile.in: Rebuild.
11581 2008-07-23 Simon Baldwin <simonb@google.com>
11583 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11584 to zero for undefined symbols from dynamic libraries.
11586 2008-07-23 Ian Lance Taylor <iant@google.com>
11588 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11589 Change all callers.
11590 * symtab.h (class Symbol_table): Update declaration.
11591 * testsuite/ver_test_9.cc: New file.
11592 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11593 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11594 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11595 (ver_test_9.so, ver_test_9.o): New targets.
11596 * testsuite/Makefile.in: Rebuild.
11598 2008-07-22 Ian Lance Taylor <iant@google.com>
11600 * options.h (class General_options): Define --check-sections.
11601 * layout.cc (Layout::set_segment_offsets): Handle
11604 * options.h (class General_options): Define -n/--nmagic and
11606 * options.cc (General_options::finalize): For -n/--nmagic or
11607 -N/--omagic, set -static.
11608 * layout.cc (Layout::attach_allocated_section_to_segment): If
11609 -N/--omagic, don't put read-only and read-write sections in
11610 different segments.
11611 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11612 finding a read-only segment.
11613 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11614 don't set the minimum segment alignment to the common page size,
11615 and don't set the file offset to the address modulo the page size.
11616 * script-sections.cc (Script_sections::create_segments): If
11617 -n/--omagic, don't put read-only and read-write sections in
11618 different segments.
11620 * cref.cc: New file.
11621 * cref.h: New file.
11622 * options.h (class General_options): Add --print-symbol-counts.
11623 * main.cc (main): Issue defined symbol report if requested.
11624 * archive.cc (Archive::interpret_header): Make into a const member
11626 (Archive::add_symbols): Call Input_objects::archive_start and
11628 (Archive::const_iterator): Define new class.
11629 (Archive::begin, Archive::end): New functions.
11630 (Archive::include_all_members): Rewrite to use iterator.
11631 (Archive::count_members): New function.
11632 * archive.h (class Archive): Update declarations.
11633 (Archive::filename): New function.
11634 * object.cc: Include "cref.h".
11635 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11636 (Sized_relobj::do_get_global_symbol_counts): New function.
11637 (Input_objects::add_object): Add object to cross-referencer.
11638 (Input_objects::archive_start): New function.
11639 (Input_objects::archive_stop): New function.
11640 (Input_objects::print_symbol_counts): New function.
11641 * object.h: Declare Cref and Archive.
11642 (Object::get_global_symbol_counts): New function.
11643 (Object::do_get_global_symbol_counts): New pure virtual function.
11644 (class Sized_relobj): Add defined_count_ field. Update
11646 (class Input_objects): Add cref_ field. Update constructor.
11647 Update declarations.
11648 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11650 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11652 (Sized_dynobj::do_get_global_symbol_counts): New function.
11653 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11654 defined_count_. Update declarations. Define Symbols typedef.
11655 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11656 parameter. Change all callers.
11657 (Symbol_table::add_from_dynobj): Add sympointers and defined
11658 parameters. Change all callers.
11659 * symtab.h (class Symbol_table): Update declarations.
11660 * Makefile.am (CCFILES): Add cref.cc.
11661 (HFILES): Add cref.h.
11662 * Makefile.in: Rebuild.
11664 2008-07-22 Simon Baldwin <simonb@google.com>
11666 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11667 to zero when writing undefined symbols.
11669 2008-07-22 Ian Lance Taylor <iant@google.com>
11671 * output.cc (Output_section::add_input_section): Don't try to
11672 merge empty merge sections.
11674 2008-07-21 Craig Silverstein <csilvers@google.com>
11676 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11677 Include symbol version in error message.
11679 2008-07-20 Chris Demetriou <cgd@google.com>
11681 * configure.ac (gold_cv_c_random_seed): New configured variable.
11682 (RANDOM_SEED_CFLAGS): New substituted variable.
11683 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11684 * configure: Rebuild.
11685 * Makefile.in: Likewise.
11686 * testsuite/Makefile.in: Likewise.
11688 2008-07-18 Ian Lance Taylor <iant@google.com>
11690 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11691 where we see NAME/NULL and NAME/VERSION as separate symbols.
11692 * testsuite/ver_test_main.cc (main): Call t4.
11693 (t4, t4_2a): Define.
11694 * testsuite/ver_test_2.cc (t4_2): Define.
11695 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11696 * testsuite/ver_test_4.cc (t4_2a): Define.
11697 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11698 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11700 2008-07-17 Ian Lance Taylor <iant@google.com>
11702 * dynobj.cc (Versions::add_def): If we give an error about a
11703 missing version, go ahead and create the version anyhow.
11705 2008-07-10 Ian Lance Taylor <iant@google.com>
11707 Handle output sections with more than 0x7fffffff bytes.
11708 * object.h (class Relobj): Change map_to_output_ to
11709 output_sections_, and just keep a section pointer. Change all
11710 uses. Move comdat group support to Sized_relobj.
11711 (Relobj::is_section_specially_mapped): Remove.
11712 (Relobj::output_section): Remove poff parameter. Change all
11714 (Relobj::output_section_offset): New function.
11715 (Relobj::set_section_offset): Rewrite.
11716 (Relobj::map_to_output): Remove.
11717 (Relobj::output_sections): New function.
11718 (Relobj::do_output_section_offset): New pure virtual function.
11719 (Relobj::do_set_section_offset): Likewise.
11720 (class Sized_relobj): Add section_offsets_ field. Add comdat
11721 group support from Relobj. Update declarations.
11722 (Sized_relobj::get_output_section_offset): New function.
11723 (Sized_relobj::do_output_section_offset): New function.
11724 (Sized_relobj::do_set_section_offset): New function.
11725 * object.cc (Relobj::output_section_address): Remove.
11726 (Sized_relobj::Sized_relobj): Initialize new fields.
11727 (Sized_relobj::include_section_group): Cast find_kept_object to
11729 (Sized_relobj::include_linkonce_section): Likewise.
11730 (Sized_relobj::do_layout): Use separate arrays for output section
11732 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11734 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11735 output_sections and section_offsets.
11736 (Sized_relobj::write_local_symbols): Likewise.
11737 (map_to_kept_section): Compute output address directly.
11738 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11739 output_sections and section_offsets.
11740 (Sized_relobj::write_sections): Likewise.
11741 (Sized_relobj::relocate_sections): Likewise.
11742 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11743 * output.h (class Output_reloc): Update declarations. Change
11744 u2_.relobj to Sized_relobj*.
11745 (class Output_data_reloc): Change add functions to use
11747 * output.cc (Output_reloc::Output_reloc): Change relobj to
11749 (Output_reloc::local_section_offset): Change return type to
11750 Elf_Addr. Use get_output_section_offset.
11751 (Output_reloc::get_address): Likewise.
11752 (Output_section::is_input_address_mapped): Don't call
11753 is_section_specially_mapped.
11754 (Output_section::output_offset): Likewise.
11755 (Output_section::output_address): Likewise.
11756 (Output_section::starting_output_address): Likewise.
11757 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11758 parameter to Sized_relobj*.
11759 (Copy_relocs::need_copy_reloc): Likewise.
11760 (Copy_relocs::save): Likewise.
11761 * copy-relocs.h (class Copy_relocs): Update declarations.
11762 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11763 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11764 * target-reloc.h (relocate_for_relocatable): Change
11765 offset_in_output_section type to Elf_Addr. Change code that uses
11767 * layout.cc (Layout::layout): Always set *off.
11768 * mapfile.cc (Mapfile::print_input_section): Use
11769 output_section_offset.
11770 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11772 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11773 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11774 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11776 2008-07-03 Ian Lance Taylor <iant@google.com>
11778 * layout.cc (Layout::include_section): Do not discard unrecognized
11779 SHT_STRTAB sections.
11781 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11783 * script.cc (Lex::can_continue_name): Make '?' allowable in
11784 version-script names.
11785 * testsuite/version_script.map: Change glob pattern to use '?'
11787 2008-06-30 Manish Singh <yosh@gimp.org>
11790 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11793 2008-06-30 Ian Lance Taylor <iant@google.com>
11797 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11798 versions]: Don't try to read the value in the contents, since we
11799 don't use it. Use the template endianness when writing.
11801 2008-06-25 Cary Coutant <ccoutant@google.com>
11803 * fileread.cc (File_read::make_view): Assert on zero-length view.
11804 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11805 symbol table when there are no symbols to read.
11807 2008-06-23 Craig Silverstein <csilvers@google.com>
11809 * version.cc (version_string): Bump to 1.7
11811 2008-06-18 Craig Silverstein <csilvers@google.com>
11813 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11814 constant 0xFFFF to type Valtype.
11815 (Powerpc_relocate_functions::rel16_ha): Likewise.
11817 2008-06-17 Ian Lance Taylor <iant@google.com>
11819 * output.h (Output_section::Input_section): Initialize p2align_ to
11820 zero for Output_section_data constructors.
11821 (Output_section::Input_section::addralign): If not an input
11822 section, return the alignment of the Output_section_data.
11823 * testsuite/copy_test.cc: New file.
11824 * testsuite/copy_test_1.cc: New file.
11825 * testsuite/copy_test_2.cc: New file.
11826 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11827 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11828 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11829 (copy_test_1_pic.o, copy_test_1.so): New targets.
11830 (copy_test_2_pic.o, copy_test_2.so): New targets.
11831 * testsuite/Makefile.in: Rebuild.
11833 * script-sections.cc (Script_sections::place_orphan): Initialize
11834 local variable exact.
11836 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11838 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11840 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11841 David S. Miller <davem@davemloft.net>
11843 * powerpc.cc: New file.
11844 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11845 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11846 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11847 * Makefile.in: Rebuild.
11849 2008-06-09 Ian Lance Taylor <iant@google.com>
11851 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11853 (throwing, orig_terminate): New static variables.
11854 (terminate_handler): New static function.
11855 (t2): Set terminate handler.
11857 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11860 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11863 2008-05-30 Cary Coutant <ccoutant@google.com>
11865 * archive.cc (Archive::include_all_members) Correct to step
11866 over symbol table and extended name table in thin archives.
11868 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11871 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11874 2008-05-28 Caleb Howe <cshowe@google.com>
11876 * reduced_debug_output.cc: New file.
11877 * reduced_debug_output.h: New file.
11878 * options.h (class General_options): Add --strip-debug-non-line.
11879 * options.cc (General_options::finalize): Add strip_debug_non_line
11880 to the strip heirarchy.
11881 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11883 * layout.cc: Include "reduced_debug_output.h".
11884 (Layout::Layout): Initialize new fields.
11885 (line_only_debug_sections): New static array.
11886 (is_lines_only_debug_sections): New static inline function.
11887 (Layout::include_section): Handle --strip-debug-non-line.
11888 (Layout::make_output_section): If --strip-debug-non-line, build
11889 new output sections for .debug_abbrev and .debug_info.
11890 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11891 gold. Warn about possible overflow.
11892 (read_signed_LEB_128): Likewise.
11893 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11894 (read_signed_LEB_128): Declare.
11895 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11896 (HFILES): Add reduced_debug_output.h.
11897 * Makefile.in: Rebuild.
11899 2008-05-21 Ian Lance Taylor <iant@google.com>
11901 * mapfile.cc: New file.
11902 * mapfile.h: New file.
11903 * options.h (class General_options): Add -M/--print-map and -Map.
11904 * options.cc (General_options::finalize): Make -M equivalent to
11906 * main.cc: Include <cstdio> and "mapfile.h".
11907 (main): Open mapfile if requested.
11908 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11909 constructor. Change caller.
11910 (queue_initial_tasks): Add mapfile parameter. Change caller.
11911 (queue_middle_tasks): Likewise.
11912 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11914 * archive.cc: Include "mapfile.h".
11915 (Archive::add_symbols): Add mapfile parameter. Change all
11916 callers. Pass mapfile, symbol, and reason to include_member.
11917 (Archive::include_all_members): Add mapfile parameter. Change all
11919 (Archive::include_member): Add mapfile, sym, and why parameters.
11920 Change all callers. Report inclusion to map file.
11921 * archive.h: Include "fileread.h".
11922 (class Archive): Update declarations.
11923 (Archive::file): New const method.
11924 (class Add_archive_symbols): Add mapfile_ field. Update
11925 constructor. Change all callers.
11926 * readsyms.h (class Read_symbols): Likewise.
11927 (class Finish_group): Likewise.
11928 (class Read_script): Likewise.
11929 * common.cc: Include "mapfile.h".
11930 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11932 (Symbol_table::do_allocate_commons): Likewise.
11933 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11934 symbol allocation to mapfile.
11935 * common.h (class Allocate_commons_task): Add mapfile_ field.
11936 Update constructor. Change all callers.
11937 * symtab.h (class Symbol_table): Update declarations.
11938 * layout.cc: Include "mapfile.h".
11939 (Layout_task_runner::run): Print information to mapfile.
11940 (Layout::create_gold_note): Change Output_data_fixed_space to
11941 Output_data_zero_fill.
11942 (Layout::create_build_id): Likewise.
11943 (Layout::print_to_mapfile): New function.
11944 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11945 constructor. Change caller.
11946 (class Layout): Declare print_to_mapfile.
11947 * output.cc (Output_section::Input_section::print_to_mapfile): New
11949 (Output_section::add_input_section): If producing a map, always
11950 add to input_sections_ list.
11951 (Output_section::do_print_to_mapfile): New function.
11952 (Output_segment::print_sections_to_mapfile): New function.
11953 (Output_segment::print_section_list_to_mapfile): New function.
11954 * output.h: Include "mapfile.h".
11955 (Output_data::print_to_mapfile): New function.
11956 (Output_data::do_print_to_mapfile): New virtual function.
11957 (Output_segment_headers::do_print_to_mapfile): New function.
11958 (Output_file_header::do_print_to_mapfile): New function.
11959 (Output_data_const::do_print_to_mapfile): New function.
11960 (class Output_data_const_buffer): Add map_name_ field. Update
11961 constructor. Change all callers. Add do_print_to_mapfile
11963 (class Output_data_fixed_space): Likewise.
11964 (class Output_data_space): Likewise.
11965 (class Output_data_zero_fill): New class.
11966 (Output_data_strtab::do_print_to_mapfile): New function.
11967 (Output_data_reloc_base::do_print_to_mapfile): New function.
11968 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11969 (Output_data_group::do_print_to_mapfile): New function.
11970 (Output_data_got::do_print_to_mapfile): New function.
11971 (Output_data_dynamic::do_print_to_mapfile): New function.
11972 (Output_symtab_xindex::do_print_to_mapfile): New function.
11973 (class Output_section): Declare do_print_to_mapflie. Declare
11974 print_to_mapfile in Input_section.
11975 (class Output_segment): Declare new functions.
11976 * object.h (Sized_relobj::symbol_count): New function.
11977 * script-sections.cc
11978 (Output_section_element_dot_assignment::set_section_addresses):
11979 Change Output_data_fixed_space to Output_data_zero_fill.
11980 (Output_data_expression::do_print_to_mapfile): New function.
11981 * script.cc (read_input_script): Add mapfile parameter. Change
11983 * script.h (read_input_script): Update declaration.
11984 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11985 (Eh_frame::do_print_to_mapfile): New function.
11986 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11987 (Output_merge_string::do_print_to_mapfile): New function.
11988 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11990 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11992 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11994 * Makefile.am (CCFILES): Add mapfile.cc.
11995 (HFILES): Add mapfile.h.
11996 * Makefile.in: Rebuild.
11998 2008-05-19 Ian Lance Taylor <iant@google.com>
12000 * options.h (class General_options): Add -z relro.
12001 * layout.cc (Layout::Layout): Initialize relro_segment_.
12002 (Layout::add_output_section_data): Return the output section.
12003 (Layout::make_output_section): Rcognize relro sections and mark
12004 them appropriately.
12005 (Layout::attach_allocated_section_to_segment): Put relro sections
12006 in a PT_GNU_RELRO segment.
12007 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12009 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12011 (Layout::linkonce_mapping): Map d.rel.ro.local to
12012 .data.rel.ro.local.
12013 (Layout::output_section_name): Us .data.rel.ro.local for any
12014 section which begins with that.
12015 * layout.h (class Layout): Update add_output_section_data
12016 declaration. Add relro_segment_ field.
12017 * output.cc (Output_section::Output_section): Initialize is_relro_
12018 and is_relro_local_ fields.
12019 (Output_segment::add_output_section): Group relro sections.
12020 (Output_segment::is_first_section_relro): New function.
12021 (Output_segment::maximum_alignment): If there is a relro section,
12022 align the segment to the common page size.
12023 (Output_segment::set_section_addresses): Track whether we are
12024 looking at relro sections. If the last section is a relro
12025 section, align to the common page size.
12026 (Output_segment::set_section_list_addresses): Add in_relro
12027 parameter. Change all callers. Align to the page size when
12028 moving from relro to non-relro section.
12029 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12031 * output.h (class Output_section): Add is_relro_ and
12032 is_relro_local_ fields.
12033 (Output_section::is_relro): New function.
12034 (Output_section::set_is_relro): New function.
12035 (Output_section::is_relro_local): New function.
12036 (Output_section::set_is_relro_local): New function.
12037 (class Output_segment): Update declarations.
12038 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12039 * sparc.cc (Target_sparc::got_section): Likewise.
12040 * x86_64.cc (Target_x86_64::got_section): Likewise.
12041 * testsuite/relro_test_main.cc: New file.
12042 * testsuite/relro_test.cc: New file.
12043 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12044 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12045 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12046 (relro_test.so, relro_test_pic.o): New targets.
12047 * testsuite/Makefile.in: Rebuild.
12049 2008-05-16 Ian Lance Taylor <iant@google.com>
12051 * output.cc (Output_segment::add_output_section): Remove front
12053 * output.h (class Output_segment): Remove
12054 add_initial_output_section and overloaded add_output_section.
12055 Update declaration of remaining add_output_section.
12056 * layout.cc (Layout::create_interp): Call add_output_section
12057 rather than add_initial_output_section.
12058 (Layout::finish_dynamic_section): Likewise.
12060 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12061 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12062 know the dynamic type.
12063 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12064 field. Initialize it in constructor.
12065 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12066 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12067 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12070 * output.cc (Output_reloc::get_address): Change return type to
12072 * output.h (class Output_reloc): Update get_address declaration.
12073 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12074 for section addresses.
12076 2008-05-09 Ian Lance Taylor <iant@google.com>
12079 * gold.cc (gold_nomem): Use return value of write.
12081 2008-05-08 Ian Lance Taylor <iant@google.com>
12083 * symtab.c (Symbol::init_base_output_data): Add version
12084 parameter. Change all callers.
12085 (Symbol::init_base_output_segment): Likewise.
12086 (Symbol::init_base_constant): Likewise.
12087 (Symbol::init_base_undefined): Likewise.
12088 (Sized_symbol::init_output_data): Likewise.
12089 (Sized_symbol::init_output_segment): Likewise.
12090 (Sized_symbol::init_constant): Likewise.
12091 (Sized_symbol::init_undefined): Likewise.
12092 (Symbol_table::do_define_in_output_data): If the new symbol has a
12093 version, mark it as the default.
12094 (Symbol_table::do_define_in_output_segment): Likewise.
12095 (Symbol_table::do_define_as_constant): Likewise.
12096 * symtab.h (class Symbol): Update declarations.
12097 (class Sized_symbol): Likewise.
12098 * resolve.cc (Symbol::override_version): New function.
12099 (Symbol::override_base): Call override_version.
12100 (Symbol::override_base_with_special): Likewise.
12101 * testsuite/ver_script_8.script: New file.
12102 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12103 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12104 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12105 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12107 2008-05-06 Ian Lance Taylor <iant@google.com>
12110 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12112 (class General_options): Remove existing --undefined, and add
12113 --no-undefined instead. Add new --undefined as synonym for -u.
12114 * archive.cc (Archive::add_symbols): Check whether symbol was
12116 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12117 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12118 all uses. Add IS_UNDEFINED. Update declarations to split
12119 different versions of init_base. Declare init_base_undefined.
12120 (Symbol::is_defined): Handle IS_UNDEFINED.
12121 (Symbol::is_undefined): Likewise.
12122 (Symbol::is_weak_undefined): Call is_undefined.
12123 (Symbol::is_absolute): Handle IS_CONSTANT.
12124 (class Sized_symbol): Update declarations to split different
12125 versions of init. Declare init_undefined.
12126 (class Symbol_table): Declare new functions.
12127 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12128 Change all callers.
12129 (Symbol::init_base_output_data): Likewise.
12130 (Symbol::init_base_output_segment): Likewise.
12131 (Symbol::init_base_constant): Likewise.
12132 (Symbol::init_base_undefined): New function.
12133 (Sized_symbol::init_object): Rename from init. Change all
12135 (Sized_symbol::init_output_data): Likewise.
12136 (Sized_symbol::init_output_segment): Likewise.
12137 (Sized_symbol::init_constant): Likewise.
12138 (Sized_symbol::init_undefined): New function.
12139 (Symbol_table::add_undefined_symbols_from_command_line): New
12141 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12143 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12144 (Symbol::output_section): Likewise.
12145 (Symbol::set_output_section): Likewise.
12146 (Symbol_table::sized_finalize_symbol): Likewise.
12147 (Symbol_table::sized_write_globals): Likewise.
12148 * resolve.cc (Symbol_table::should_override): Likewise.
12149 (Symbol::override_base_with_special): Likewise.
12151 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12152 symbol, change it to have default visibility.
12153 * testsuite/protected_1.cc: New file.
12154 * testsuite/protected_2.cc: New file.
12155 * testsuite/protected_3.cc: New file.
12156 * testsuite/protected_main_1.cc: New file.
12157 * testsuite/protected_main_2.cc: New file.
12158 * testsuite/protected_main_3.cc: New file.
12159 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12160 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12161 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12162 (protected_1.so): New target.
12163 (protected_1_pic.o, protected_2_pic.o): New targets.
12164 (protected_3_pic.o): New target.
12165 (check_PROGRAMS): Add protected_2.
12166 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12167 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12168 * testsuite/Makefile.in: Rebuild.
12170 * options.h (DEFINE_var): Add set_user_set_##varname__.
12171 (DEFINE_bool_alias): New macro.
12172 (class General_options): Define -Bstatic using DEFINE_bool_alias
12173 rather than DEFINE_special. Add --undefined as an alias for -z
12175 * options.cc (General_options::parse_Bstatic): Remove.
12177 * options.h (class General_options): Add --fatal-warnings.
12178 * main.cc (main): Implement --fatal-warnings.
12179 * errors.h (Errors::warning_count): New function.
12181 * options.h (class General_options): Add -Bsymbolic-functions.
12182 * symtab.h (Symbol::is_preemptible): Check for
12183 -Bsymbolic-functions.
12185 2008-05-05 Ian Lance Taylor <iant@google.com>
12187 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12188 as noVARNAME rather than no-VARNAME.
12189 (class General_options): Add option -z combreloc.
12190 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12192 (Output_reloc::sort_before) [SHT_REL]: New function.
12193 (Output_reloc::sort_before) [SHT_RELA]: New function.
12194 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12195 Sort_relocs_comparison.
12196 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12197 parameter. Change all callers.
12198 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12199 sort_relocs parameter. Change all callers.
12200 * output.cc (Output_reloc::get_address): New function, broken out
12202 (Output_reloc::write_rel): Call it.
12203 (Output_reloc::compare): New function.
12204 (Output_data_reloc_base::do_write): Optionally sort relocs.
12206 * configure.ac: If targ_extra_obj is set, link it in.
12207 * configure.tgt: Initialize all variables.
12208 (x86_64*): Set targ_extra_obj and targ_extra_size.
12209 * configure: Rebuild.
12211 * object.cc (Sized_relobj::include_section_group): Adjust section
12212 indexes read from group data. Build vector to pass to
12214 * layout.cc (Layout::layout_group): Add flags and shndxes
12215 parameters. Remove contents parameter. Change caller. Update
12216 explicit instantiations.
12217 * layout.h (class Layout): Update layout_group declaration.
12218 * output.cc (Output_data_group::Output_data_group): Add flags and
12219 input_shndxes parameters. Remove contents parameter. Change
12221 (Output_data_group::do_write): Change input_sections_ to
12223 * output.h (class Output_data_group): Update constructor
12224 declaration. Rename input_sections_ to input_shndxes_.
12225 * testsuite/many_sections_test.cc: Add template.
12227 2008-04-30 Cary Coutant <ccoutant@google.com>
12229 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12231 * layout.cc (Layout::include_section): Refactored check for debug
12233 (Layout::add_comdat): Add new parameters. Change type
12234 of signature parameter. Add object and shndx to signatures table.
12235 (Layout::find_kept_object): New function.
12236 * layout.h: Include <cstring>.
12237 (Layout::is_debug_info_section): New function.
12238 (Layout::add_comdat): Add new parameters.
12239 (Layout::find_kept_object): New function.
12240 (Layout::Kept_section): New struct.
12241 (Layout::Signatures): Change type of map range.
12242 * object.cc (Relobj::output_section_address): New function.
12243 (Sized_relobj::include_section_group): Add new parameters. Change
12244 calls to Layout::add_comdat. Change to build table of kept comdat
12245 groups and table mapping discarded sections to kept sections.
12246 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12247 (Sized_relobj::do_layout): Change calls to include_section_group and
12248 include_linkonce_section.
12249 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12250 value to zero when section is discarded.
12251 (Sized_relobj::map_to_kept_section): New function.
12252 * object.h (Relobj::output_section_address): New function.
12253 (Relobj::Comdat_group): New type.
12254 (Relobj::find_comdat_group): New function.
12255 (Relobj::Comdat_group_table): New type.
12256 (Relobj::Kept_comdat_section): New type.
12257 (Relobj::Kept_comdat_section_table): New type.
12258 (Relobj::add_comdat_group): New function.
12259 (Relobj::set_kept_comdat_section): New function.
12260 (Relobj::get_kept_comdat_section): New function.
12261 (Relobj::comdat_groups_): New field.
12262 (Relobj::kept_comdat_sections_): New field.
12263 (Symbol_value::input_value): Update comment.
12264 (Sized_relobj::map_to_kept_section) New function.
12265 (Sized_relobj::include_linkonce_section): Add new parameter.
12266 * target-reloc.h (Comdat_behavior): New type.
12267 (get_comdat_behavior): New function.
12268 (relocate_section): Add code to map a discarded section to the
12269 corresponding kept section when applying a relocation.
12271 2008-04-30 Craig Silverstein <csilvers@google.com>
12273 * dwarf_reader.cc (next_generation_count): New static var.
12274 (Addr2line_cache_entry): New struct.
12275 (addr2line_cache): New static var.
12276 (Dwarf_line_info::one_addr2line): Added caching.
12277 (Dwarf_line_info::clear_addr2line_cache): New function.
12278 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12279 cache-size parameter.
12280 (Dwarf_line_info::one_addr2line_cache): New function.
12281 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12282 new cache-size argument to one_addr2line(), and clear cache.
12284 2008-04-28 Cary Coutant <ccoutant@google.com>
12286 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12287 R_386_PC8 relocations.
12289 2008-04-23 Ian Lance Taylor <iant@google.com>
12291 * object.cc (Sized_relobj::include_section_group): Check for
12292 invalid section group.
12294 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12297 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12298 than read for file header.
12299 * archive.cc (Archive::include_member): Likewise.
12301 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12303 * aclocal.m4: Regenerate.
12304 * configure: Regenerate.
12306 2008-04-19 Ian Lance Taylor <iant@google.com>
12308 * version.cc (version_string): Bump to 1.6.
12310 * testsuite/Makefile.am (many_sections_r_test): New target.
12311 (many_sections_r_test_SOURCES): Remove.
12312 (many_sections_r_test_DEPENDENCIES): Remove.
12313 (many_sections_r_test_LDFLAGS): Remove.
12314 (many_sections_r_test_LDADD): Remove.
12316 * object.cc (Sized_relobj::do_add_symbols): Always pass
12317 local_symbol_count_ to add_from_relobj.
12319 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12320 every thousand variables.
12321 * testsuite/Makefile.in: Rebuild.
12323 * object.cc (Xindex::initialize_symtab_xindex): New function.
12324 (Xindex::read_symtab_xindex): New function.
12325 (Xindex::sym_xindex_to_shndx): New function.
12326 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12328 (Sized_relobj::do_initialize_xindex): New function.
12329 (Sized_relobj::do_read_symbols): Adjust section links.
12330 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12331 parameter. Change all callers.
12332 (Sized_relobj::include_section_group): Adjust section links and
12333 symbol section indexes.
12334 (Sized_relobj::do_layout): Adjust section links.
12335 (Sized_relobj::do_count_local_symbols): Adjust section links and
12336 symbol section indexes.
12337 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12338 ordinary and special symbols.
12339 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12340 dynsym_xindex parameters. Change all callers. Adjust section
12341 links. Use SHN_XINDEX when needed.
12342 (Sized_relobj::get_symbol_location_info): Adjust section links.
12343 Don't get fooled by special symbols.
12344 * object.h (class Xindex): Define.
12345 (class Object): Add xindex_ parameter. Declare virtual functoin
12346 do_initialize_xindex.
12347 (Object::adjust_sym_shndx): New function.
12348 (Object::set_xindex): New protected function.
12349 (class Symbol_value): Add is_ordinary_shndx_ field.
12350 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12351 (Symbol_value::value): Assert ordinary section.
12352 (Symbol_value::initialize_input_to_output_map): Likewise.
12353 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12354 Change all callers.
12355 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12357 (class Sized_relobj): Update declarations.
12358 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12359 parameter. Change all callers.
12360 (Sized_relobj::adjust_shndx): New function.
12361 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12363 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12364 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12365 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12366 (Sized_dynobj::read_dynsym_section): Adjust section links.
12367 (Sized_dynobj::read_dynamic): Likewise.
12368 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12370 (Sized_dynobj::do_initialize_xindex): New function.
12371 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12372 do_initialize_xindex.
12373 (Sized_dynobj::adjust_shndx): New function.
12374 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12375 dynsym_xindex_ fields.
12376 (Layout::finalize): Add a call to set_section_indexes before
12377 creating the symtab sections.
12378 (Layout::set_section_indexes): Don't do anything if the section
12379 already has a section index.
12380 (Layout::create_symtab_sections): Add shnum parameter. Change
12381 caller. Create .symtab_shndx section if needed.
12382 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12384 (Layout::allocated_output_section_count): New function.
12385 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12387 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12388 fields. Update declarations.
12389 (Layout::symtab_xindex): New function.
12390 (Layout::dynsym_xindex): New function.
12391 (class Write_symbols_task): Add layout_ field.
12392 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12394 * output.cc (Output_section_headers::Output_section_headers): Add
12395 shstrtab_section parameter. Change all callers.
12396 (Output_section_headers::do_sized_write): Store overflow values
12397 for section count and section string table section index in
12398 section header zero.
12399 (Output_file_header::do_sized_write): Check for overflow of
12400 section count and section string table section index.
12401 (Output_symtab_xindex::do_write): New function.
12402 (Output_symtab_xindex::endian_do_write): New function.
12403 * output.h (class Output_section_headers): Add shstrtab_section_.
12404 Update declarations.
12405 (class Output_symtab_xindex): Define.
12406 (Output_section::has_out_shndx): New function.
12407 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12409 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12410 Change all callers.
12411 (Sized_symbol::init): Likewise.
12412 (Symbol::output_section): Check for ordinary symbol.
12413 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12414 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12416 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12417 Change all callers. Simplify handling of symbols from sections
12418 not included in the link.
12419 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12421 (Weak_alias_sorter::operator()): Assert that symbols are
12423 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12425 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12426 parameters. Change all callers.
12427 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12428 symbol distinction. Use SHN_XINDEX when needed.
12429 (Symbol_table::write_section_symbol): Add symtab_xindex
12430 parameter. Change all callers.
12431 (Symbol_table::sized_write_section_symbol): Likewise. Use
12432 SHN_XINDEX when needed.
12433 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12435 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12436 (Symbol::is_defined): Check is_ordinary.
12437 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12438 (Symbol::is_absolute, Symbol::is_common): Likewise.
12439 (class Sized_symbol): Update declarations.
12440 (class Symbol_table): Update declarations.
12441 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12442 parameters. Change all callers.
12443 (Sized_symbol::override): Likewise.
12444 (Symbol_table::override): Likewise.
12445 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12446 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12447 is_ordinary, and orig_st_shndx parameters. Change all callers.
12448 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12449 to be in an ordinary section.
12450 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12451 object and is_ordinary parameters. Change all callers.
12452 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12453 Change all callers. Don't add undefined or non-ordinary symbols
12455 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12456 Change all callers.
12457 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12459 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12460 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12461 (Sized_relobj::relocate_sections): Likewise.
12462 * target-reloc.h (scan_relocs): Adjust section symbol index.
12463 (scan_relocatable_relocs): Likewise.
12464 * i386.cc (Scan::local): Check for ordinary symbols.
12465 * sparc.cc (Scan::local): Likewise.
12466 * x86_64.cc (Scan::local): Likewise.
12467 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12468 to symbol_section_and_value.
12469 * testsuite/many_sections_test.cc: New file.
12470 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12471 (check_PROGRAMS): Add many_sections_test.
12472 (many_sections_test_SOURCES): Define.
12473 (many_sections_test_DEPENDENCIES): Define.
12474 (many_sections_test_LDFLAGS): Define.
12475 (BUILT_SOURCES): Add many_sections_define.h.
12476 (many_sections_define.h): New target.
12477 (BUILT_SOURCES): Add many_sections_check.h.
12478 (many_sections_check.h): New target.
12479 (check_PROGRAMS): Add many_sections_r_test.
12480 (many_sections_r_test_SOURCES): Define.
12481 (many_sections_r_test_DEPENDENCIES): Define.
12482 (many_sections_r_test_LDFLAGS): Define.
12483 (many_sections_r_test_LDADD): Define.
12484 (many_sections_r_test.o): New target.
12485 * testsuite/Makefile.in: Rebuild.
12487 2008-04-17 Cary Coutant <ccoutant@google.com>
12489 * errors.cc (Errors::info): New function.
12490 (gold_info): New function.
12491 * errors.h (Errors::info): New function.
12492 * gold.h (gold_info): New function.
12493 * object.cc (Input_objects::add_object): Print trace output.
12494 * options.cc (options::parse_set): New function.
12495 (General_options::parse_wrap): Deleted.
12496 (General_options::General_options): Deleted initializer.
12497 * options.h (options::String_set): New typedef.
12498 (options::parse_set): New function.
12499 (DEFINE_set): New macro.
12500 (General_options::wrap): Changed to use DEFINE_set. Changed
12501 callers of any_wrap_symbols and is_wrap_symbol.
12502 (General_options::trace, General_options::trace_symbol):
12504 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12505 (General_options::wrap_symbols_): Deleted.
12506 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12508 2008-04-17 David S. Miller <davem@davemloft.net>
12510 * options.cc (General_options::parse_V): New function.
12511 * options.h: Add entries for -V and -Qy.
12513 2008-04-17 Ian Lance Taylor <iant@google.com>
12515 * common.cc (Symbol_table::allocate_commons): Remove options
12516 parameter. Change caller.
12517 (Symbol_table::do_allocate_commons): Remove options parameter.
12518 Change caller. Just call do_allocate_commons_list twice.
12519 (Symbol_table::do_allocate_commons_list): New function, broken out
12520 of do_allocate_commons.
12521 * common.h (class Allocate_commons_task): Remove options_ field.
12522 Update constructor.
12523 * symtab.cc (Symbol_table::Symbol_table): Initialize
12525 (Symbol_table::add_from_object): Put TLS common symbols on
12527 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12528 which are IN_OUTPUT_DATA.
12529 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12530 allocate_commons and do_allocate_commons declarations. Declare
12531 do_allocate_commons_list.
12532 * gold.cc (queue_middle_tasks): Update creation of
12533 Allocate_commons_task to not pass options.
12534 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12535 (TLS_TEST_C_FLAGS): New variable.
12536 (tls_test_c_pic.o): New target.
12537 (tls_test_shared.so): Link in tls_test_c_pic.o.
12538 (tls_test_c_pic_ie.o): New target.
12539 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12540 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12541 (tls_test_c.o): New target.
12542 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12543 (tls_pic_test_LDADD): Likewise.
12544 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12545 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12546 (tls_test_c_gnu2.o): New target.
12547 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12549 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12550 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12551 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12552 * testsuite/tls_test.cc: Include "config.h".
12553 (t_last): Call t11_last.
12554 * testsuite/tls_test.h (t11, t11_last): Declare.
12555 * testsuite/tls_test_c.c: New file.
12556 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12557 * configure.ac: Check for OpenMP support.
12558 * configure, config.in, Makefile.in: Rebuild.
12559 * testsuite/Makefile.in: Rebuild.
12561 2008-04-16 Cary Coutant <ccoutant@google.com>
12563 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12564 (Target_i386::tls_base_symbol_defined_): New field.
12565 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12566 (Target_i386::Scan::global): Likewise.
12567 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12568 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12569 (Target_x86_64::tls_base_symbol_defined_): New field.
12570 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12571 (Target_x86_64::Scan::global): Likewise.
12573 2008-04-16 Cary Coutant <ccoutant@google.com>
12575 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12576 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12577 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12578 building shared libraries.
12579 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12580 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12581 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12582 * testsuite/Makefile.in: Rebuild.
12583 * testsuite/weak_undef.h: New file.
12584 * testsuite/weak_undef_file1.cc: Add extra test cases.
12585 * testsuite/weak_undef_file2.cc: Likewise.
12586 * testsuite/weak_undef_test.cc: Likewise.
12588 2008-04-16 David S. Miller <davem@davemloft.net>
12590 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12591 Add issued_non_pic_error_ field. Declare check_non_pic.
12592 (Target_sparc::Scan::check_non_pic): New function.
12593 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12594 (Target_sparc::Scan::global): Likewise.
12596 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12597 * configure: Rebuild.
12599 * options.h (DEFINE_enable): New macro.
12600 (new_dtags): New enable option.
12601 (initfirst, interpose, loadfltr, nodefaultlib,
12602 nodelete, nodlopen, nodump): New -z options.
12603 * layout.cc (Layout:finish_dynamic_section): If new
12604 dtags enabled, emit DT_RUNPATH. Also, emit a
12605 DT_FLAGS_1 containing any specified -z flags.
12607 2008-04-16 Ian Lance Taylor <iant@google.com>
12609 * copy-relocs.cc: New file.
12610 * copy-relocs.h: New file.
12611 * reloc.cc: Remove Copy_relocs code.
12612 * reloc.h: Likewise.
12613 * reloc-types.h (struct Reloc_types) [both versions]: Add
12614 get_reloc_addend_noerror.
12615 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12616 variants of add_global which take an addend which must be zero.
12617 * i386.cc: Include "copy-relocs.h".
12618 (class Target_i386): Change type of copy_relocs_ to variable,
12619 update initializer.
12620 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12621 Change all callers.
12622 (Target_i386::do_finalize_sections): Change handling of
12624 * sparc.cc: Include "copy-relocs.h".
12625 (class Target_sparc): Change type of copy_relocs_ to variable,
12626 update initializer.
12627 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12628 Change all callers.
12629 (Target_sparc::do_finalize_sections): Change handling of
12631 * x86_64.cc: Include "copy-relocs.h".
12632 (class Target_x86_64): Change type of copy_relocs_ to variable,
12633 update initializer.
12634 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12635 class. Change all callers.
12636 (Target_x86_64::do_finalize_sections): Change handling of
12638 * Makefile.am (CCFILES): Add copy-relocs.cc.
12639 (HFILES): Add copy-relocs.h.
12641 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12643 * testsuite/script_test_4.sh: Permit leading zeroes.
12645 2008-04-15 Ian Lance Taylor <iant@google.com>
12647 * script-sections.cc (Script_sections::create_segments): Use
12648 header_size_adjustment even when there is enough room for the
12650 * testsuite/script_test_4.sh: New file.
12651 * testsuite/script_test_4.t: New file.
12652 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12653 (check_DATA): Add script_test_4.stdout.
12654 (MOSTLYCLEANFILES): Likewise.
12655 (script_test_4): New target.
12656 (script_test_4.stdout): New target.
12657 * testsuite/Makefile.in: Rebuild.
12659 * sparc.cc: Add definitions for Output_data_plt_sparc class
12662 2008-04-14 David S. Miller <davem@davemloft.net>
12664 * sparc.cc: New file.
12665 * Makefile.am (TARGETSOURCES): Add sparc.cc
12666 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12667 * configure.tgt: Document targ_extra_size and
12668 targ_extra_big_endian. Add entries for sparc-* and
12670 * configure.ac: Handle targ_extra_size and
12671 targ_extra_big_endian.
12672 * Makefile.in: Rebuild.
12673 * configure: Likewise.
12674 * po/POTFILES.in: Likewise.
12675 * po/gold.pot: Likewise.
12677 2008-04-14 Ian Lance Taylor <iant@google.com>
12679 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12680 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12681 in the name/type/flags to section mapping. Don't call
12682 allocate_output_section.
12683 (Layout::choose_output_section): Change parameter from adjust_name
12684 to is_input_section. Don't permit input sections after sections
12685 are attached to segments. Don't call allocate_output_section.
12686 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12687 not write_enable_output_section.
12688 (Layout::make_output_section): Don't push to
12689 unattached_section_list_ nor call attach_to_segment. Call
12690 attach_section_to_segment if sections are attached.
12691 (Layout::attach_sections_to_segments): New function.
12692 (Layout::attach_section_to_segment): New function.
12693 (Layout::attach_allocated_section_to_segment): Rename from
12694 attach_to_segment. Remove flags parameter.
12695 (Layout::allocate_output_section): Remove function.
12696 (Layout::write_enable_output_section): Remove function.
12697 * layout.h (class Layout): Update for above changes. Add new
12698 field sections_are_attached_.
12699 * output.h (Output_section::update_flags_for_input_section): New
12701 * output.cc (Output_section::add_input_section): Call
12702 update_flags_for_input_section.
12703 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12705 2008-04-11 Cary Coutant <ccoutant@google.com>
12707 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12708 thought unnecessary.
12709 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12711 2008-04-11 Ian Lance Taylor <iant@google.com>
12713 * output.h (class Output_section_data): Remove inline definition
12715 * output.cc (Output_section_data::set_addralign): New function.
12717 2008-04-11 Cary Coutant <ccoutant@google.com>
12719 Add support for TLS descriptors for i386 and x86_64.
12720 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12721 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12722 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12724 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12725 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12726 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12728 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12729 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12730 Fix problem with initial-exec relocations.
12731 (Target_i386::Relocate::relocate_tls): Likewise.
12732 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12734 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12735 support for section-plus-offset dynamic table entries.
12736 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12737 (Output_data_dynamic::Dynamic_entry): Add support for
12738 section-plus-offset dynamic table entries.
12739 (Output_data_dynamic::Classification): Likewise.
12740 (Output_data_dynamic::classification_): Renamed offset_.
12741 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12742 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12743 (Target_x86_64::make_plt_section): New function.
12744 (Target_x86_64::reserve_tlsdesc_entries): New function.
12745 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12746 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12747 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12748 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12749 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12750 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12751 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12752 add extra PLT entry for TLS descriptors.
12753 (Output_data_plt_x86_64::got_): New field.
12754 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12755 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12757 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12759 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12760 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12761 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12762 R_386_TLS_DESC_CALL relocations.
12763 (Target_x86_64::Scan::global): Likewise.
12764 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12765 for TLS descriptors.
12766 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12767 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12768 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12769 GD-to-IE relaxation.
12770 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12771 and TLS_DESCRIPTORS.
12772 * Makefile.in: Rebuild.
12773 * configure: Rebuild.
12774 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12775 (tls_test_shared2.so): New target.
12776 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12777 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12778 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12779 (tls_shared_gd_to_ie_test_LDADD): New variable.
12780 (tls_shared_gnu2_gd_to_ie_test): New target.
12781 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12783 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12784 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12785 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12786 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12787 (tls_shared_gnu2_test): New target.
12788 (tls_test_gnu2_shared.so): New target.
12789 (tls_shared_gnu2_test_SOURCES): New variable.
12790 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12791 (tls_shared_gnu2_test_LDFLAGS): New variable.
12792 (tls_shared_gnu2_test_LDADD): New variable.
12793 * testsuite/Makefile.in: Rebuild.
12794 * testsuite/Makefile.
12796 2008-04-11 Ian Lance Taylor <iant@google.com>
12798 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12800 * testsuite/Makefile.in: Rebuild.
12802 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12804 * testsuite/script_test_2.cc (main): Adjust test.
12806 2008-04-11 David S. Miller <davem@davemloft.net>
12807 Ian Lance Taylor <iant@google.com>
12809 * options.h (General_options): Add entries for '-Y' and
12811 * options.cc (General_options:finalize): If -Y was used, add those
12812 entries to the library path instead of the default "/lib" and
12815 2008-04-11 David S. Miller <davem@davemloft.net>
12817 * testsuite/justsyms.t: Start at 0x100.
12818 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12819 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12821 * testsuite/script_test_2.cc: Adjust string and section length
12824 2008-04-09 Ian Lance Taylor <iant@google.com>
12827 * script-sections.cc (Sections_element::allocate_to_segment): Add
12829 (Output_section_definition::allocate_to_segment): Likewise.
12830 (Orphan_output_section::allocate_to_segment): Likewise.
12831 (Script_sections::attach_sections_using_phdrs_clause): Don't
12832 propagate non-PT_LOAD segments to orphan sections.
12833 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12834 readelf rather than objdump.
12835 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12836 .interp section and PT_INTERP segment are the same size.
12837 * testsuite/Makefile.in: Rebuild.
12839 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12840 aliases for symbols defined in the same object.
12841 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12842 (weak_alias_test_SOURCES): New variable.
12843 (weak_alias_test_DEPENDENCIES): New variable.
12844 (weak_alias_test_LDFLAGS): New variable.
12845 (weak_alias_test_LDADD): New variable.
12846 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12847 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12848 (weak_alias_test_3.o): New target.
12849 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12850 * testsuite/weak_alias_test_main.cc: New file.
12851 * testsuite/weak_alias_test_1.cc: New file.
12852 * testsuite/weak_alias_test_2.cc: New file.
12853 * testsuite/weak_alias_test_3.cc: New file.
12855 2008-04-08 Ian Lance Taylor <iant@google.com>
12857 * options.h (class General_options): Add --noinhibit-exec option.
12858 * main.cc (main): Check --noinhibit-exec.
12860 * options.h (class General_options): Define --wrap as a special
12861 option. Add wrap_symbols_ field.
12862 (General_options::any_wrap_symbols): New function.
12863 (General_options::is_wrap_symbol): New function.
12864 * options.cc (General_options::parse_wrap): New function.
12865 (General_options::General_options): Initialize wrap_symbols_.
12866 * symtab.cc (Symbol_table::wrap_symbol): New function.
12867 (Symbol_table::add_from_object): Handle --wrap.
12868 * symtab.h (class Symbol_table): Declare wrap_symbol.
12869 * target.h (Target::wrap_char): New function.
12870 (Target::Target_info): Add wrap_char field.
12871 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12872 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12873 * testsuite/testfile.cc (Target_test::test_target_info):
12876 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12879 * layout.h (class Layout): Add added_eh_frame_data_ field.
12880 * layout.cc (Layout::Layout): Initialize new field.
12881 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12882 output section until we find a section we merged successfully.
12883 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12884 that the size be non-zero.
12886 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12889 2008-04-08 Craig Silverstein <csilvers@google.com>
12891 * configure.ac: Export new conditional variable HAVE_ZLIB.
12892 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12894 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12895 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12897 2008-04-07 Ian Lance Taylor <iant@google.com>
12899 * version.cc (version_string): Set to "1.5".
12901 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12902 Add issued_non_pic_error_ field. Declare check_non_pic.
12903 (Target_x86_64::Scan::check_non_pic): New function.
12904 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12905 (Target_x86_64::Scan::global): Likewise.
12907 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12908 addend parameter. Change caller. Handle merge sections.
12909 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12910 Address to Addend. Don't add in the result of
12911 local_section_offset, pass down the addend and use the returned
12913 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12914 Update declarations of local_section_offset and symbol_value.
12915 * testsuite/two_file_test_1.cc (t18): New function.
12916 * testsuite/two_file_test_2.cc (f18): New function.
12917 * testsuite/two_file_test_main.cc (main): Call t18.
12918 * testsuite/two_file_test.h (t18, f18): Declare.
12920 * configure.ac: Don't test for objdump, c++filt, or readelf.
12921 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12923 (TEST_READELF): New variable.
12924 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12925 (check_PROGRAMS): Add two_file_strip_test.
12926 (two_file_strip_test): New target.
12927 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12928 (two_file_same_shared_strip_test_SOURCES): New variable.
12929 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12930 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12931 (two_file_same_shared_strip_test_LDADD): New variable.
12932 (two_file_shared_strip.so): New target.
12933 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12934 (ver_test_5.syms, ver_test_7.syms): Likewise.
12935 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12936 (strip_test_3.stdout): Use TEST_OBJDUMP.
12937 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12939 2008-04-04 Cary Coutant <ccoutant@google.com>
12941 * symtab.h (Symbol::is_weak_undefined): New function.
12942 (Symbol::is_strong_undefined): New function.
12943 (Symbol::is_absolute): New function.
12944 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12945 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12947 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12948 (weak_undef_test): New target.
12949 * testsuite/Makefile.in: Rebuild.
12950 * testsuite/weak_undef_file1.cc: New file.
12951 * testsuite/weak_undef_file2.cc: New file.
12952 * testsuite/weak_undef_test.cc: New file.
12954 2008-04-03 Craig Silverstein <csilvers@google.com>
12956 * compressed_output.h (class Output_compressed_section): Use
12958 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12960 (zlib_compressed_suffix): Removed.
12961 (Output_compressed_section::set_final_data_size): Use unsigned
12963 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12964 Fix linker invocation.
12965 (flagstest_o_specialfile_and_compress_debug_sections):
12967 * testsuite/Makefile.in: Regenerated.
12969 2008-04-02 David S. Miller <davem@davemloft.net>
12971 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12972 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12974 2008-04-02 Craig Silverstein <csilvers@google.com>
12978 2008-04-02 Ian Lance Taylor <iant@google.com>
12980 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12981 parameters. Update for new key type to views_. Change all
12983 (File_read::read): Adjust for byteshift in returned view.
12984 (File_read::add_view): New function, broken out of
12985 find_and_make_view.
12986 (File_read::make_view): New function, broken out of
12987 find_and_make_view.
12988 (File_read::find_or_make_view): Add offset and aligned
12989 parameters. Rewrite accordingly. Change all callers.
12990 (File_read::get_view): Add offset and aligned parameters. Adjust
12991 for byteshift in return value.
12992 (File_read::get_lasting_view): Likewise.
12993 * fileread.h (class File_read): Update declarations.
12994 (class File_read::View): Add byteshift_ field. Add byteshift to
12995 constructor. Add byteshift method.
12996 * archive.h (Archive::clear_uncached_views): New function.
12997 (Archive::get_view): Add aligned parameter. Change all callers.
12998 * object.h (Object::get_view): Add aligned parameter. Change all
13000 (Object::get_lasting_view): Likewise.
13002 * fileread.cc (File_read::release): Don't call clear_views if
13003 there are multiple objects.
13004 * fileread.h (File_read::clear_uncached_views): New function.
13005 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13008 2008-03-31 Cary Coutant <ccoutant@google.com>
13010 Add thin archive support.
13011 * archive.cc (Archive::armagt): New const.
13012 (Archive::setup): Remove task parameter and calls to unlock.
13013 (Archive::unlock_nested_archives): New function.
13014 (Archive::read_header): Add nested_off parameter. Change
13016 (Archive::interpret_header): Likewise.
13017 (Archive::include_all_members): Change to handle thin
13019 (Archive::include_member): Likewise.
13020 * archive.h (Archive::Archive): Add new parameters and
13022 (Archive::armagt): New const.
13023 (Archive::setup): Remove task parameter.
13024 (Archive::unlock_nested_archives): New function.
13025 (Archive::read_header): Add nested_off parameter.
13026 (Archive::interpret_header): Likewise.
13027 (Archive::Nested_archive_table): New typedef.
13028 (Archive::is_thin_archive_): New field.
13029 (Archive::nested_archives_): New field.
13030 (Archive::options_): New field.
13031 (Archive::dirpath_): New field.
13032 (Archive::task_): New field.
13033 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13034 for thin archives. Pass additional parameters to
13035 Archive::Archive. Unlock the archive file after calling
13038 2008-03-29 Ian Lance Taylor <iant@google.com>
13040 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13041 version symbol to be local.
13042 * testsuite/ver_test_4.sh: New file.
13043 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13044 (check_DATA): Add ver_test_4.syms.
13045 (ver_test_4.syms): New target.
13046 * testsuite/Makefile.in: Rebuild.
13049 (Output_section::Input_section_sort_entry::has_priority): New
13051 (Output_section::Input_section_sort_entry::match_file_name): New
13053 (Output_section::Input_section_sort_entry::match_section_name):
13055 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13057 (Output_section::Input_section_sort_entry::match_section_file):
13059 (Output_section::Input_section_sort_compare::operator()): Rewrite
13060 using new Input_section_sort_entry functions. Sort crtbegin and
13061 crtend first. Sort sections with no priority before sections with
13063 * testsuite/initpri1.c (d3): Check j != 4.
13064 (cd5): New constructor/destructor function.
13065 (main): Check j != 2.
13067 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13068 new symbol when resolving, don't call set_is_default.
13069 * testsuite/ver_test_7.cc: New file.
13070 * testsuite/ver_test_7.sh: New file.
13071 * testsuite/Makefile.am (ver_test_7.so): New target.
13072 (ver_test_7.o): New target.
13073 (check_SCRIPTS): Add ver_test_7.sh.
13074 (check_DATA): Add ver_test_7.syms.
13075 (ver_test_7.syms): New target.
13077 2008-03-28 Ian Lance Taylor <iant@google.com>
13079 * layout.cc (Layout::layout): If we see an input section with a
13080 name that needs sorting, set the must_sort flag for the output
13082 (Layout::make_output_section): If the name of the output section
13083 indicates that it might require sorting, set the may_sort flag.
13084 * output.h (Output_section::may_sort_attached_input_sections): New
13086 (Output_section::set_may_sort_attached_input_sections): New
13088 (Output_section::must_sort_attached_input_sections): New
13090 (Output_section::set_must_sort_attached_input_sections): New
13092 (class Output_section): Declare Input_section_sort_entry. Define
13093 Input_section_sort_compare. Declare
13094 sort_attached_input_sections. Add new fields:
13095 may_sort_attached_input_sections_,
13096 must_sort_attached_input_sections_,
13097 attached_input_sections_are_sorted_.
13098 * output.cc (Output_section::Output_section): Initialize new
13100 (Output_section::add_input_section): Add an entry to
13101 input_sections_ if may_sort or must_sort are true.
13102 (Output_section::set_final_data_size): Call
13103 sort_attached_input_sections if necessary.
13104 (Output_section::Input_section_sort_entry): Define new class.
13105 (Output_section::Input_section_sort_compare::operator()): New
13107 (Output_section::sort_attached_input_sections): New function.
13108 * configure.ac: Check whether the compiler supports constructor
13109 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13110 * testsuite/initpri1.c: New file.
13111 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13112 CONSTRUCTOR_PRIORITY.
13113 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13114 (initpri1_LDFLAGS): New variable.
13115 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13117 2008-03-27 Ian Lance Taylor <iant@google.com>
13119 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13120 * testsuite/common_test_1.c: New file.
13121 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13122 (common_test_1_SOURCES): New variable.
13123 (common_test_1_DEPENDENCIES): New variable.
13124 (common_test_1_LDFLAGS): New variable.
13126 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13127 and commons_ correctly when NAME/VERSION does not override
13129 * testsuite/ver_test_6.c: New file.
13130 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13131 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13132 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13134 2008-03-26 Ian Lance Taylor <iant@google.com>
13136 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13137 of an undefined symbol from a version script.
13138 * testsuite/Makefile.am (ver_test_5.so): New target.
13139 (ver_test_5.o): New target.
13140 (check_SCRIPTS): Add ver_test_5.sh.
13141 (check_DATA): Add ver_test_5.syms.
13142 (ver_test_5.syms): New target.
13143 * testsuite/ver_test_5.cc: New file.
13144 * testsuite/ver_test_5.script: New file.
13145 * testsuite/ver_test_5.sh: New file.
13146 * Makefile.in, testsuite/Makefile.in: Rebuild.
13149 Fix problems building gold with gcc 4.3.0.
13150 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13151 (gold_error_at_location, gold_warning_at_location): Use it.
13152 * configure.ac: Check whether we can compile and use a template
13153 function with a printf attribute.
13154 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13155 when jumping over bytes.
13156 * object.cc: Instantiate Object::read_section_data.
13157 * debug.h: Include <cstring>
13158 * dwarf_reader.cc: Include <algorithm>
13159 * main.cc: Include <cstring>.
13160 * options.cc: Include <cstring>.
13161 * output.cc: Include <cstring>.
13162 * script.cc: Include <cstring>.
13163 * script.h: Include <string>.
13164 * symtab.cc: Include <cstring> and <algorithm>.
13165 * target-select.cc: Include <cstring>.
13166 * version.cc: Include <string>.
13167 * testsuite/testmain.cc: Include <cstdlib>.
13168 * configure, config.in: Rebuild.
13170 2008-03-25 Ian Lance Taylor <iant@google.com>
13172 * options.cc: Include "../bfd/bfdver.h".
13173 (options::help): Print bug reporting address.
13175 * version.cc (print_version): Adjust output for current value of
13176 BFD_VERSION_STRING.
13180 * options.cc (options::help): Print list of supported targets.
13181 * target-select.h: Include <vector>.
13182 (class Target_selector): Make machine_, size_, and is_big_endian_
13183 fields const. Add bfd_name_ and instantiated_target_ fields.
13184 (Target_selector::Target_selector): Add bfd_name parameter.
13185 (Target_selector::recognize): Make non-virtual, call
13187 (Target_selector::recognize_by_name): Make non-virtual, call
13188 do_recognize_by_name.
13189 (Target_selector::supported_names): New function.
13190 (Target_selector::bfd_name): New function.
13191 (Target_selector::do_instantiate_target): New pure virtual
13193 (Target_selector::do_recognize): New virtual function.
13194 (Target_selector::do_recognize_by_name): New virtual function.
13195 (Target_selector::instantiate_target): New private function.
13196 (supported_target_names): Declare.
13197 * target-select.cc (Target_selector::Target_selector): Update for
13198 new parameter and fields.
13199 (select_target_by_name): Check that the name matches before
13200 calling recognize_by_name.
13201 (supported_target_names): New function.
13202 * i386.cc (class Target_selector_i386): Update Target_selector
13203 constructor call. Remove recognize and recognize_by_name. Add
13204 do_instantiate_target.
13205 * x86_64.cc (class Target_selector_x86_64): Likewise.
13206 * testsuite/testfile.cc (class Target_selector_test): Update for
13207 changes to Target_selector.
13209 * README: Rewrite, with some notes on unsupported features.
13211 2008-03-24 Cary Coutant <ccoutant@google.com>
13213 * i386.cc (Target_i386::Got_type): New enum declaration.
13214 (Target_i386::Scan::local): Updated callers of Output_data_got
13216 (Target_i386::Scan::global): Likewise.
13217 (Target_i386::Relocate::relocate): Likewise.
13218 (Target_i386::Relocate::relocate_tls): Likewise.
13219 * object.h (Got_offset_list): New class.
13220 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13221 (Sized_relobj::local_got_offset): Likewise.
13222 (Sized_relobj::set_local_got_offset): Likewise.
13223 (Sized_relobj::local_has_tls_got_offset): Removed.
13224 (Sized_relobj::local_tls_got_offset): Removed.
13225 (Sized_relobj::set_local_tls_got_offset): Removed.
13226 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13227 * output.cc (Output_data_got::add_global): Added got_type parameter.
13228 (Output_data_got::add_global_with_rel): Likewise.
13229 (Output_data_got::add_global_with_rela): Likewise.
13230 (Output_data_got::add_global_pair_with_rel): New function.
13231 (Output_data_got::add_global_pair_with_rela): New function.
13232 (Output_data_got::add_local): Added got_type parameter.
13233 (Output_data_got::add_local_with_rel): Likewise.
13234 (Output_data_got::add_local_with_rela): Likewise.
13235 (Output_data_got::add_local_pair_with_rel): New function.
13236 (Output_data_got::add_local_pair_with_rela): New function.
13237 (Output_data_got::add_global_tls): Removed.
13238 (Output_data_got::add_global_tls_with_rel): Removed.
13239 (Output_data_got::add_global_tls_with_rela): Removed.
13240 (Output_data_got::add_local_tls): Removed.
13241 (Output_data_got::add_local_tls_with_rel): Removed.
13242 (Output_data_got::add_local_tls_with_rela): Removed.
13243 * output.h (Output_data_got::add_global): Added got_type parameter.
13244 (Output_data_got::add_global_with_rel): Likewise.
13245 (Output_data_got::add_global_with_rela): Likewise.
13246 (Output_data_got::add_global_pair_with_rel): New function.
13247 (Output_data_got::add_global_pair_with_rela): New function.
13248 (Output_data_got::add_local): Added got_type parameter.
13249 (Output_data_got::add_local_with_rel): Likewise.
13250 (Output_data_got::add_local_with_rela): Likewise.
13251 (Output_data_got::add_local_pair_with_rel): New function.
13252 (Output_data_got::add_local_pair_with_rela): New function.
13253 (Output_data_got::add_global_tls): Removed.
13254 (Output_data_got::add_global_tls_with_rel): Removed.
13255 (Output_data_got::add_global_tls_with_rela): Removed.
13256 (Output_data_got::add_local_tls): Removed.
13257 (Output_data_got::add_local_tls_with_rel): Removed.
13258 (Output_data_got::add_local_tls_with_rela): Removed.
13259 * resolve.cc (Symbol::override_base_with_special): Removed
13260 reference to has_got_offset_ field.
13261 * symtab.cc (Symbol::init_fields): Replaced initialization
13262 of got_offset_ with got_offsets_. Removed initialization
13264 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13265 (Symbol::got_offset): Likewise.
13266 (Symbol::set_got_offset): Likewise.
13267 (Symbol::has_tls_got_offset): Removed.
13268 (Symbol::tls_got_offset): Removed.
13269 (Symbol::set_tls_got_offset): Removed.
13270 (Symbol::got_offset_): Removed.
13271 (Symbol::tls_mod_got_offset_): Removed.
13272 (Symbol::tls_pair_got_offset_): Removed.
13273 (Symbol::got_offsets_): New field.
13274 (Symbol::has_got_offset): Removed.
13275 (Symbol::has_tls_mod_got_offset): Removed.
13276 (Symbol::has_tls_pair_got_offset): Removed.
13277 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13278 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13280 (Target_x86_64::Scan::global): Likewise.
13281 (Target_x86_64::Relocate::relocate): Likewise.
13282 (Target_x86_64::Relocate::relocate_tls): Likewise.
13284 2008-03-25 Ben Elliston <bje@au.ibm.com>
13286 * yyscript.y: Fix spelling error in comment.
13288 2008-03-24 Ian Lance Taylor <iant@google.com>
13290 * options.h (class General_options): Define build_id option.
13291 * layout.h (class Layout): Declare write_build_id, create_note,
13292 create_build_id. Add build_id_note_ member.
13293 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13294 "libiberty.h", "md5.h", "sha1.h".
13295 (Layout::Layout): Initialize eh_frame_data_,
13296 eh_frame_hdr_section_, and build_id_note_.
13297 (Layout::finalize): Call create_build_id.
13298 (Layout::create_note): New function, broken out of
13299 Layout::create_gold_note.
13300 (Layout::create_gold_note): Call create_note.
13301 (Layout::create_build_id): New function.
13302 (Layout::write_build_id): New function.
13303 (Close_task_runner::run): Call write_build_id.
13305 * x86_64.cc: Correct license to GPLv3.
13307 2008-03-23 Ian Lance Taylor <iant@google.com>
13309 * options.cc: Include "demangle.h".
13310 (parse_optional_string): New function.
13311 (parse_long_option): Handle takes_optional_argument.
13312 (parse_short_option): Update dash_z initializer. Handle
13313 takes_optional_argument.
13314 (General_options::General_options): Initialize do_demangle_.
13315 (General_options::finalize): Set do_demangle_. Handle demangling
13317 * options.h (parse_optional_string): Declare.
13318 (struct One_option): Add optional_arg field. Update constructor.
13319 Update call constructor calls. Add takes_optional_argument
13321 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13322 (DEFINE_optional_string): Define.
13323 (General_options::demangle): Change from DEFINE_bool to
13324 DEFINE_optional_string.
13325 (General_options::no_demangle): New function.
13326 (General_options::do_demangle): New function.
13327 (General_options::set_do_demangle): New function.
13328 (General_options::execstack_status_): Move definition to end of
13330 (General_options::static_): Likewise.
13331 (General_options::do_demangle_): New field.
13332 * object.cc (big_endian>::get_symbol_location_info): Call
13333 Options::do_demangle, not Options::demangle.
13334 * symtab.cc (demangle): Likewise.
13336 2008-03-22 Ian Lance Taylor <iant@google.com>
13338 * gold.h: Include <cstddef> and <sys/types.h>
13339 * options.h: Include <cstring>.
13341 2008-03-21 Ian Lance Taylor <iant@google.com>
13343 * Added source code to GNU binutils.