1 2012-07-11 Ian Lance Taylor <iant@google.com>
3 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
5 (Target_arm::scan_reloc_for_stub): Likewise.
6 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
7 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
8 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
9 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
10 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
12 2012-07-10 Dodji Seketeli <dodji@redhat.com>
13 Ian Lance Taylor <iant@google.com>
16 * configure.ac: Test whether std::tr1::hash<off_t> works.
17 * gold.h: Add a specialization for std::tr1::hash<off_t> if
19 * output.h (class Output_fill): Add virtual destructor.
20 * configure, config.in: Rebuild.
22 2012-06-22 Roland McGrath <mcgrathr@google.com>
24 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
26 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
28 * plugin.cc (Plugin::load): Handle position independent executables.
30 2012-06-06 Cary Coutant <ccoutant@google.com>
32 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
34 (lines_only_debug_sections): Likewise.
35 (gdb_fast_lookup_sections): New static array.
36 (is_gdb_debug_section): Rename formal parameter.
37 (is_lines_only_debug_section): Likewise.
38 (is_gdb_fast_lookup_section): New function.
39 (Layout::include_section): Check for ".zdebug_" prefix; pass
40 section name suffix to is_gdb_debug_section, et al.; check for
41 fast-lookup sections when building .gdb_index.
42 * options.h (--strip-debug-gdb): Update GDB version number.
44 2012-06-06 Cary Coutant <ccoutant@google.com>
46 * configure.ac: Add check for fallocate.
47 * configure: Regenerate.
48 * config.in: Regenerate.
50 * options.h (class General_options): Add --mmap-output-file and
51 --posix-fallocate options.
52 * output.cc: (posix_fallocate): Remove; replace with...
53 (gold_fallocate): New function.
54 (Output_file::map_no_anonymous): Call gold_fallocate.
55 (Output_file::map): Check --mmap-output-file option.
57 2012-06-05 Jing Yu <jingyu@google.com>
59 * gold.h (textdomain): Add do {} to empty while(0).
60 (bindtextdomain): Likewise.
62 2012-06-04 Cary Coutant <ccoutant@google.com>
64 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
67 2012-05-25 Sriraman Tallam <tmsriram@google.com>
69 * symtab.cc (Symbol_table::define_special_symbol):
70 Initialize *poldsym to prevent uninitialized variable errors.
72 2012-05-23 Cary Coutant <ccoutant@google.com>
74 * layout.cc (Layout::section_name_mapping): Add rules to handle
75 exact match on .data.rel.ro.local or .data.rel.ro.
76 (Layout::output_section_name): Check for exact matches.
78 2012-05-23 Cary Coutant <ccoutant@google.com>
80 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
83 2012-05-22 Cary Coutant <ccoutant@google.com>
85 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
86 object before exporting symbol.
88 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
90 * testsuite/tls_test.cc: Include "config.h" first.
91 * testsuite/tls_test_c.c: Likewise.
93 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
94 Nick Clifton <nickc@redhat.com>
97 * configure.in: Add check that sysdep.h has been included before
98 any system header files.
99 * configure: Regenerate.
100 * config.in: Regenerate.
102 2012-05-14 Cary Coutant <ccoutant@google.com>
104 * layout.cc (Layout::make_output_section): Mark .tdata section
106 * testsuite/relro_test.cc: Add a TLS variable.
108 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
111 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
112 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
115 2012-05-08 Cary Coutant <ccoutant@google.com>
117 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
118 (lines_only_debug_sections): Likewise.
120 2012-05-02 Roland McGrath <mcgrathr@google.com>
124 * Makefile.am (CCFILES, HFILES): Add them.
125 * Makefile.in: Regenerate.
126 * i386.cc (Output_data_plt_i386_nacl): New class.
127 (Output_data_plt_i386_nacl_exec): New class.
128 (Output_data_plt_i386_nacl_dyn): New class.
129 (Target_i386_nacl): New class.
130 (Target_selector_i386_nacl): New class.
131 (target_selector_i386): Use it instead of Target_selector_i386.
132 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
133 (Target_x86_64_nacl): New class.
134 (Target_selector_x86_64_nacl): New class.
135 (target_selector_x86_64, target_selector_x32): Use it instead of
136 Target_selector_x86_64.
137 * arm.cc (Output_data_plt_arm_nacl): New class.
138 (Target_arm_nacl): New class.
139 (Target_selector_arm_nacl): New class.
140 (target_selector_arm, target_selector_armbe): Use it instead of
143 * target-select.cc (select_target): Take new Input_file* and off_t
144 arguments, pass them on to recognize method of selector.
145 * object.cc (make_elf_sized_object): Update caller.
146 * parameters.cc (parameters_force_valid_target): Likewise.
147 * incremental.cc (make_sized_incremental_binary): Likewise.
148 * target-select.h: Update decl.
149 (Target_selector::recognize): Take new Input_file* argument,
150 pass it on to do_recognize.
151 (Target_selector::do_recognize): Take new Input_file* argument.
152 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
153 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
154 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
155 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
157 * target.h (Target::Target_info): New members isolate_execinstr
159 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
160 * arm.cc (Target_arm::arm_info): Update initializer.
161 * i386.cc (Target_i386::i386_info): Likewise.
162 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
163 * sparc.cc (Target_sparc::sparc_info): Likewise.
164 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
165 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
166 * layout.cc (Layout::attach_allocated_section_to_segment):
167 Take new const Target* argument. If target->isolate_execinstr(), act
169 (Layout::find_first_load_seg): Take new const Target* argument;
170 if target->isolate_execinstr(), reject PF_X segments.
171 (Layout::relaxation_loop_body): Update caller.
172 (Layout::set_segment_offsets): If target->isolate_execinstr(),
173 reset file offset to zero when we hit LOAD_SEG, and then do a second
174 loop over the segments before LOAD_SEG to reassign offsets after
175 addresses have been determined. Handle target->rosegment_gap().
176 (Layout::attach_section_to_segment): Take new const Target* argument;
177 pass it to attach_allocated_section_to_segment.
178 (Layout::make_output_section): Update caller.
179 (Layout::attach_sections_to_segments): Take new const Target* argument;
180 pass it to attach_section_to_segment.
181 * gold.cc (queue_middle_tasks): Update caller.
182 * layout.h (Layout): Update method decls with new arguments.
184 * arm.cc (Target_arm::Target_arm): Take optional argument for the
185 Target_info pointer to use.
186 (Target_arm::do_make_data_plt): New virtual method.
187 (Target_arm::make_data_plt): New method that calls it.
188 (Target_arm::make_plt_entry): Use it.
189 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
190 for the section alignment.
191 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
193 (Output_data_plt_arm::first_plt_entry_offset): Call it.
194 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
196 (Output_data_plt_arm::get_plt_entry_size): Call it.
197 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
198 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
199 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
201 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
202 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
203 method instead of sizeof(plt_entry).
204 (Output_data_plt_arm::add_entry): Likewise.
205 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
206 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
208 (Target_arm::plt_entry_size): Likewise.
209 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
211 (Output_data_plt_arm_standard): ... here, new class.
212 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
213 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
214 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
216 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
217 Take additional argument for the PLT entry size.
218 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
219 Use get_plt_entry_size method rather than plt_entry_size variable.
220 (Output_data_plt_x86_64::reserve_slot): Likewise.
221 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
222 (Output_data_plt_x86_64::add_entry): Likewise.
223 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
224 (Output_data_plt_x86_64::address_for_global): Likewise.
225 (Output_data_plt_x86_64::address_for_local): Likewise.
226 (Output_data_plt_x86_64::set_final_data_size): Likewise.
227 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
228 Make method non-static.
229 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
231 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
232 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
233 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
234 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
236 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
237 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
239 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
240 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
242 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
243 (Output_data_plt_x86_64::plt_entry_size)
244 (Output_data_plt_x86_64::first_plt_entry)
245 (Output_data_plt_x86_64::plt_entry)
246 (Output_data_plt_x86_64::tlsdesc_plt_entry)
247 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
248 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
249 (Output_data_plt_x86_64_standard): ... here, new class.
250 (Target_x86_64::Target_x86_64): Take optional argument for the
251 Target_info pointer to use.
252 (Target_x86_64::do_make_data_plt): New virtual method.
253 (Target_x86_64::make_data_plt): New method to call it.
254 (Target_x86_64::init_got_plt_for_update): Use that.
255 Call this->plt_->add_eh_frame method here.
256 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
257 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
258 rather than static method.
259 (Target_x86_64::plt_entry_size): Likewise.
260 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
261 rather than plt_entry_size variable. Move guts of PLT filling to...
262 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
263 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
264 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
266 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
267 additional argument for the section alignment.
268 Don't do add_eh_frame_for_plt here.
269 (Output_data_plt_i386::first_plt_entry_offset): Make the method
270 non-static. Use get_plt_entry_size method rather than plt_entry_size
272 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
274 (Output_data_plt_i386::get_plt_entry_size): Call it.
275 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
276 (Output_data_plt_i386::add_eh_frame): New method to call it.
277 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
279 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
280 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
282 (Output_data_plt_i386::fill_plt_entry): New method to call it.
283 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
284 method instead of plt_entry_size.
285 (Output_data_plt_i386::plt_entry_size)
286 (Output_data_plt_i386::plt_eh_frame_fde_size)
287 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
288 (Output_data_plt_i386_standard): ... here, new class.
289 (Output_data_plt_i386_exec): New class.
290 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
291 (Output_data_plt_i386_exec::first_plt_entry): ... here.
292 (Output_data_plt_i386::exec_plt_entry): Move to ...
293 (Output_data_plt_i386_exec::plt_entry): ... here.
294 (Output_data_plt_i386_dyn): New class.
295 (Output_data_plt_i386::first_plt_entry): Move to ...
296 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
297 (Output_data_plt_i386::dyn_plt_entry): Move to ...
298 (Output_data_plt_i386_dyn::plt_entry): ... here.
299 (Target_i386::Target_i386): Take optional argument for the Target_info
301 (Target_i386::do_make_data_plt): New virtual method.
302 (Target_i386::make_data_plt): New method to call it.
303 (Target_i386::make_plt_section): Use that.
304 Call this->plt_->add_eh_frame method here.
305 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
306 rather than plt_entry_size variable.
307 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
308 (Output_data_plt_i386::address_for_local): Likewise.
309 (Output_data_plt_i386::do_write): Likewise.
310 Move guts of PLT filling to...
311 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
312 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
313 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
314 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
316 2012-05-01 Cary Coutant <ccoutant@google.com>
318 * dwarf_reader.cc (Dwarf_die::read_attributes)
319 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
320 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
321 * reduced_debug_output.cc
322 (Output_reduced_debug_info_section::get_die_end): Remove
323 DW_FORM_GNU_ref_index. Add default case.
325 2012-04-26 Mark Wielaard <mjw@redhat.com>
327 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
328 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
329 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
330 DW_AT_high_pc as offset from DW_AT_low_pc.
332 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
333 * testsuite/Makefile.in: Regenerate.
334 * testsuite/gdb_index_test_3.c: New test source file.
335 * testsuite/gdb_index_test_3.sh: New test source file.
337 2012-04-25 Ian Lance Taylor <iant@google.com>
339 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
341 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
342 as a class, not a struct.
343 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
344 (Target_arm::apply_cortex_a8_workaround): Likewise.
345 * gc.h: Declare Reloc_types as a struct, not a class.
346 * object.h: Declare Symbols_data as a struct.
347 * reloc.h: Declare Read_relocs_data as a struct.
348 * target.h: Declare Relocate_info as a struct.
350 2012-04-24 David S. Miller <davem@davemloft.net>
352 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
353 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
356 2012-04-24 Cary Coutant <ccoutant@google.com>
358 * incremental-dump.cc (find_input_containing_global): Replace
359 magic number with symbolic constant.
360 (dump_incremental_inputs): Update version number.
361 * incremental.cc (Output_section_incremental_inputs): Update version
362 number; import symbolic constants from Incremental_inputs_reader.
363 (Incremental_inputs::create_data_sections): Align relocations
364 section correctly for 64-bit targets.
365 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
366 constants; add padding.
367 (Output_section_incremental_inputs::write_header): Add assert for
369 (Output_section_incremental_inputs::write_input_files): Add assert
370 for input_entry_size.
371 (Output_section_incremental_inputs::write_info_blocks): Add padding;
372 add assert for object_info_size, input_section_entry_size,
373 global_sym_entry_size.
374 * incremental.h (Incremental_inputs_reader): Add symbolic constants
375 for data structure sizes; use them.
376 (Incremental_input_entry_reader): Import symbolic constants from
377 Incremental_inputs_reader; use them.
379 2012-04-23 David S. Miller <davem@davemloft.net>
381 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
383 (Target_sparc::Target_sparc): Initialize new fields.
384 (Target_sparc::do_make_elf_object): New function.
385 (Target_sparc::do_adjust_elf_header): New function.
387 2012-04-23 Cary Coutant <ccoutant@google.com>
389 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
390 CU range table of gdb index.
392 2012-04-20 David S. Miller <davem@davemloft.net>
394 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
397 2012-04-16 David S. Miller <davem@davemloft.net>
399 * sparc.cc (Target_sparc::got_address): New function.
400 (Sparc_relocate_functions::gdop_hix22): New function.
401 (Sparc_relocate_functions::gdop_lox10): New function.
402 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
404 (Target_sparc::Scan::local): Likewise if the global symbol is not
405 preemptible and is not IFUNC.
406 (Target_sparc::Relocate::relocate): Perform GOTDATA code
407 transformations for local and non-preemptible non-IFUNC global
410 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
411 writing out 64-bit part of ranges.
413 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
414 -fpic and -fpie respectively.
415 * Makefile.in: Regenerate.
417 * sparc.cc (class Target_sparc): Add rela_ifunc_.
418 (Target_sparc::Target_sparc): Initialize new field.
419 (Target_sparc::do_plt_section_for_global): New function.
420 (Target_sparc::do_plt_section_for_local): New function.
421 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
422 (Target_sparc::make_plt_section): New function, broken out of
423 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
424 (Target_sparc::make_plt_entry): Call make_plt_section.
425 (Target_sparc::make_local_ifunc_plt_entry): New function.
426 (Target_sparc::rela_ifunc_section): New function.
427 (Target_sparc::plt_section): Remove const.
428 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
429 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
430 and ifunc_count_ fields.
431 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
432 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
433 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
434 (Output_data_plt_sparc::rela_ifunc): New function.
435 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
436 (Output_data_plt_sparc::has_ifunc_section): New function.
437 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
438 (Output_data_plt_sparc::address_for_global): New function.
439 (Output_data_plt_sparc::address_for_local): New function.
440 (Output_data_plt_sparc::plt_index_to_offset): New function.
441 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
443 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
445 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
446 R_SPARC_JMP_IREL to switch.
447 (Target_sparc::Scan::check_non_pic): Likewise.
448 (Target_sparc::Scan::local): Handle IFUNC symbols.
449 (Target_sparc::Scan::local): Likewise.
450 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
451 and plt_address_for_local.
452 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
453 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
455 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
456 (class Output_data_reloc): Adjust calls to Output_reloc_type.
457 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
458 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
460 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
461 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
463 * sparc.cc (Target_sparc::Scan::global): Likewise.
464 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
466 2012-04-16 Cary Coutant <ccoutant@google.com>
468 * archive.cc (Library_base::should_include_member): Check for
469 --export-dynamic-symbol.
470 * options.h (class General_options): Add --export-dynamic-symbol.
471 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
472 --export-dynamic-symbol.
473 (Symbol_table::gc_mark_undef_symbols): Likewise.
474 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
476 2012-04-12 David S. Miller <davem@davemloft.net>
478 * sparc.cc (Reloc::wdisp10): New relocation method.
479 (Reloc::h34): Likewise.
480 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
481 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
483 (Target_sparc::Scan::local): Likewise.
484 (Target_sparc::Scan::global): Likewise.
485 (Target_sparc::Relocate::relocate): Likewise.
487 2012-04-09 Cary Coutant <ccoutant@google.com>
489 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
492 2012-04-06 Ian Lance Taylor <iant@google.com>
494 * timer.cc: #include <unistd.h>.
496 2012-04-06 Roland McGrath <mcgrathr@google.com>
498 * configure.in (AC_CHECK_HEADERS): Add locale.h.
499 * config.in: Regenerate.
500 * configure: Regenerate.
502 2012-04-05 Nick Clifton <nickc@redhat.com>
504 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
505 (AM_LC_MESSAGES): Add.
506 * aclocal.m4: Regenerate.
507 * config.in: Regenerate.
508 * configure: Regenerate.
510 2012-03-21 Cary Coutant <ccoutant@google.com>
512 * Makefile.am: Add gdb-index.cc, gdb-index.h.
513 * Makefile.in: Regenerate.
514 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
515 (Sized_elf_reloc_mapper::symbol_section): New function.
516 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
517 (make_elf_reloc_mapper): New function.
518 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
519 (Dwarf_abbrev_table::do_read_abbrevs): New function.
520 (Dwarf_abbrev_table::do_get_abbrev): New function.
521 (Dwarf_ranges_table::read_ranges_table): New function.
522 (Dwarf_ranges_table::read_range_list): New function.
523 (Dwarf_pubnames_table::read_section): New function.
524 (Dwarf_pubnames_table::read_header): New function.
525 (Dwarf_pubnames_table::next_name): New function.
526 (Dwarf_die::Dwarf_die): New function.
527 (Dwarf_die::read_attributes): New function.
528 (Dwarf_die::skip_attributes): New function.
529 (Dwarf_die::set_name): New function.
530 (Dwarf_die::set_linkage_name): New function.
531 (Dwarf_die::attribute): New function.
532 (Dwarf_die::string_attribute): New function.
533 (Dwarf_die::int_attribute): New function.
534 (Dwarf_die::uint_attribute): New function.
535 (Dwarf_die::ref_attribute): New function.
536 (Dwarf_die::child_offset): New function.
537 (Dwarf_die::sibling_offset): New function.
538 (Dwarf_info_reader::check_buffer): New function.
539 (Dwarf_info_reader::parse): New function.
540 (Dwarf_info_reader::do_parse): New function.
541 (Dwarf_info_reader::do_read_string_table): New function.
542 (Dwarf_info_reader::lookup_reloc): New function.
543 (Dwarf_info_reader::get_string): New function.
544 (Dwarf_info_reader::visit_compilation_unit): New function.
545 (Dwarf_info_reader::visit_type_unit): New function.
546 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
547 Sized_elf_reloc_mapper.
548 (Sized_dwarf_line_info::symbol_section): Remove function.
549 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
550 (Sized_dwarf_line_info::read_line_mappings): Remove object
551 parameter, adjust callers.
552 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
553 * dwarf_reader.h: Include <sys/types.h>.
554 (class Track_relocs): Remove forward declaration.
555 (class Elf_reloc_mapper): New class.
556 (class Sized_elf_reloc_mapper): New class.
557 (class Dwarf_abbrev_table): New class.
558 (class Dwarf_range_list): New class.
559 (class Dwarf_ranges_table): New class.
560 (class Dwarf_pubnames_table): New class.
561 (class Dwarf_die): New class.
562 (class Dwarf_info_reader): New class.
563 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
564 (Sized_dwarf_line_info::symbol_section): Remove member function.
565 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
567 * gdb-index.cc: New source file.
568 * gdb-index.h: New source file.
569 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
570 and .debug_types sections, call Layout::add_to_gdb_index.
571 (Sized_relobj_incr::do_section_name): Implement.
572 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
573 return type; Implement.
574 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
576 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
577 parameter list and return type.
578 (Sized_incr_dynobj::do_section_contents): Likewise.
579 * layout.cc: Include gdb-index.h.
580 (Layout::Layout): Initialize gdb_index_data_.
581 (Layout::init_fixed_output_section): Check for .gdb_index section.
582 (Layout::add_to_gdb_index): New function. Instantiate.
583 * layout.h: Add forward declaration for class Gdb_index.
584 (Layout::add_to_gdb_index): New member function.
585 (Layout::gdb_index_data_): New data member.
586 * main.cc: Include gdb-index.h.
587 (main): Print statistics for gdb index.
588 * object.cc (Object::section_contents): Move code into
590 (need_decompressed_section): Check for sections needed when building
592 (build_compressed_section_map): Likewise.
593 (Sized_relobj_file::do_read_symbols): Need local symbols when building
595 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
596 sections; call Layout::add_to_gdb_index.
597 (Sized_relobj_file::do_decompressed_section_contents): Call
598 do_section_contents directly.
599 * object.h (Object::do_section_contents): Adjust parameter list and
601 (Object::do_decompressed_section_contents): Call do_section_contents
603 (Sized_relobj_file::do_section_contents): Adjust parameter list and
605 * options.h (class General_options): Add --gdb-index option.
606 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
607 list and return type.
608 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
609 * reloc.h (Track_relocs::checkpoint): New function.
610 (Track_relocs::reset): New function.
612 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
614 * testsuite/Makefile.in: Regenerate.
615 * testsuite/gdb_index_test.cc: New test source file.
616 * testsuite/gdb_index_test_1.sh: New test source file.
617 * testsuite/gdb_index_test_2.sh: New test source file.
619 2012-03-19 Doug Kwan <dougkwan@google.com>
621 * arm.cc (Target_arm::do_define_standard_symbols): New method.
622 (Target_arm::do_finalize_sections): Remove code which defines
623 __exidx_start and __exidx_end. Make symbol table parameter
624 anonymous as it is not used.
625 * gold.cc (queue_middle_tasks): Call target hook to define any
626 target-specific symbols.
627 * target.h (Target::define_standard_symbols): New method.
628 (Target::do_define_standard_symbols): Same.
629 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
630 * testsuite/Makefile.in: Regenerate.
631 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
633 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
634 relocations are generated for __exidx_start and __exidx_end.
636 2012-03-16 Doug Kwan <dougkwan@google.com>
638 * testsuite/Makefile.am: Disable test initpri3b.
639 * testsuite/Makefile.in: Regenerate.
641 2012-03-15 Doug Kwan <dougkwan@google.com>
643 * arm.cc (Target_arm::got_section): Make .got section read-only
646 2012-03-15 Ian Lance Taylor <iant@google.com>
649 * layout.cc (Layout::make_output_section): Correctly mark
650 SHT_INIT_ARRAY, et. al., as relro.
652 2012-03-14 Doug Kwan <dougkwan@google.com>
654 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
655 dynamic relocations for protected symbols in shared objects.
657 2012-03-13 Ian Lance Taylor <iant@google.com>
659 * resolve.cc (Symbol_table::resolve): When merging common symbols,
660 keep the larger alignment.
662 2012-03-12 Cary Coutant <ccoutant@google.com>
664 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
665 handling of DW_LNE_define_file.
667 2012-03-12 Cary Coutant <ccoutant@google.com>
669 * reduced_debug_output.cc
670 (Output_reduced_debug_info_section::get_die_end): Add new FORM
673 2012-02-29 Cary Coutant <ccoutant@google.com>
675 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
677 2012-02-29 Cary Coutant <ccoutant@google.com>
679 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
680 Call Object::decompressed_section_contents.
681 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
683 (Sized_dwarf_line_info::buffer_start_): New data member.
684 * merge.cc (Output_merge_data::do_add_input_section): Call
685 Object::decompressed_section_contents.
686 (Output_merge_string::do_add_input_section): Likewise.
687 * object.cc (need_decompressed_section): New function.
688 (build_compressed_section_map): Decompress sections needed later.
689 (Sized_relobj_file::do_decompressed_section_contents): New function.
690 (Sized_relobj_file::do_discard_decompressed_sections): New function.
691 * object.h (Object::decompressed_section_contents): New function.
692 (Object::discard_decompressed_sections): New function.
693 (Object::do_decompressed_section_contents): New function.
694 (Object::do_discard_decompressed_sections): New function.
695 (Compressed_section_info): New type.
696 (Compressed_section_map): Include decompressed section contents.
697 (Sized_relobj_file::do_decompressed_section_contents): New function.
698 (Sized_relobj_file::do_discard_decompressed_sections): New function.
700 2012-02-16 Cary Coutant <ccoutant@google.com>
702 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
703 * testsuite/Makefile.in: Regenerate.
705 2012-02-14 Cary Coutant <ccoutant@google.com>
707 * options.cc (General_options::finalize): Disallow -pie and -static.
709 2012-02-03 Doug Kwan <dougkwan@google.com>
711 * arm.cc (Arm_relocate_functions::abs8,
712 Arm_relocate_functions::abs16): Use
713 Bits::has_signed_unsigned_overflow32.
714 (Arm_relocate_functions::thm_abs8): Correct range of
716 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
719 2012-02-02 Doug Kwan <dougkwan@google.com>
721 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
722 position independent outputs, not just shared objects.
724 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
726 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
727 * configure: Regenerated.
729 2012-01-27 Ian Lance Taylor <iant@google.com>
731 * reloc.h (Bits): New class with static functions, copied from
732 namespace utils in arm.cc.
733 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
736 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
738 * incremental.cc (write_info_blocks): Correct relocation offset.
740 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
742 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
743 (Relocate::tls_gd_to_le): Likewise.
745 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
747 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
749 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
751 * configure.ac: Check if -mcmodel=medium works.
752 * configure: Regenerated.
754 2012-01-24 Cary Coutant <ccoutant@google.com>
756 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
758 (read_unsigned_LEB_128_x): ... this new function.
759 (read_signed_LEB_128): Replaced with inline definition and ...
760 (read_signed_LEB_128_x): ... this new function.
761 * int_encoding.h (read_unsigned_LEB_128_x): New function.
762 (read_unsigned_LEB_128): Add inline definition.
763 (read_signed_LEB_128_x): New function.
764 (read_signed_LEB_128): Add inline definition.
765 * testsuite/Makefile.am (leb128_unittest): New unit test.
766 * testsuite/Makefile.in: Regenerate.
767 * testsuite/leb128_unittest.cc: New unit test.
769 2012-01-23 Ian Lance Taylor <iant@google.com>
772 * i386.cc (Target_i386::do_code_fill): When using a jmp
773 instruction, pad with nop instructions.
774 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
776 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
778 * x86_64.cc (gc_process_relocs): Add typename on types used in
780 (scan_relocs): Likewise.
781 (relocate_section): Likewise.
782 (apply_relocation): Likewise.
784 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
786 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
787 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
790 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
792 * x86_64.cc: Initial support for x32.
794 2012-01-03 Cary Coutant <ccoutant@google.com>
796 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
797 Use abstract base class for GOT.
798 * gold/output.h (class Output_data_got_base): New abstract base class.
799 (class Output_data_got): Derive from new base class, adjust ctors.
800 (Output_data_got::reserve_slot): Make virtual; rename to
801 do_reserve_slot; Adjust callers.
802 * gold/target.h (Sized_target::init_got_plt_for_update): Return
803 pointer to abstract base class.
804 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
806 2011-12-18 Ian Lance Taylor <iant@google.com>
808 * object.h (Relobj::local_symbol_value): New function.
809 (Relobj::local_plt_offset): New function.
810 (Relobj::local_has_got_offset): New function.
811 (Relobj::local_got_offset): New function.
812 (Relobj::set_local_got_offset): New function.
813 (Relobj::do_local_symbol_value): New pure virtual function.
814 (Relobj::do_local_plt_offset): Likewise.
815 (Relobj::do_local_has_got_offset): Likewise.
816 (Relobj::do_local_got_offset): Likewise.
817 (Relobj::do_set_local_got_offset): Likewise.
818 (Sized_relobj::do_local_has_got_offset): Rename from
819 local_has_got_offset.
820 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
821 (Sized_relobj::do_set_local_got_offset): Rename from
822 set_local_got_offset.
823 (Sized_relobj_file::do_local_plt_offset): Rename from
825 (Sized_relobj_file::do_local_symbol_value): New function.
826 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
828 * output.cc (Output_data_got::Got_entry::write): Change object to
829 Relobj. Use local_symbol_value.
830 (Output_data_got::add_global_with_rel): Change rel_dyn to
831 Output_data_reloc_generic*. Use add_global_generic.
832 (Output_data_got::add_global_with_rela): Remove. Change all
833 callers to use add_global_with_rel.
834 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
835 Output_data_reloc_generic*. Use add_global_generic.
836 (Output_data_got::add_global_pair_with_rela): Remove. Change all
837 callers to use add_global_pair_with_rel.
838 (Output_data_got::add_local): Change object to Relobj*.
839 (Output_data_got::add_local_plt): Likewise.
840 (Output_data_got::add_local_with_rel): Change object to Relobj*,
841 change rel_dyn to Output_data_reloc_generic*. Use
843 (Output_data_got::add_local_with_rela): Remove. Change all
844 callers to use all_local_with_rel.
845 (Output_data_got::add_local_pair_with_rel): Change object to
846 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
847 add_output_section_generic.
848 (Output_data_got::add_local_pair_with_rela): Remove. Change all
849 callers to use add_local_pair_with_rel.
850 (Output_data_got::reserve_local): Change object to Relobj*.
851 * output.h: (class Output_data_reloc_generic): Add pure virtual
852 declarations for add_global_generic, add_local_generic,
853 add_output_section_generic.
854 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
855 functions for Output_data_reloc_generic. Update declarations for
856 changes listed in output.cc.
857 (class Output_data_got): Change template parameter to got_size.
858 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
859 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
861 (Sized_relobj_incr::do_local_plt_offset): New function.
862 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
865 2011-12-17 Cary Coutant <ccoutant@google.com>
867 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
868 * resolve.cc (Symbol_table::resolve): Likewise.
869 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
871 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
873 2011-12-16 Ian Lance Taylor <iant@google.com>
875 * output.h (Output_data_reloc_generic::add): Only call
876 add_dynamic_reloc if this is a dynamic reloc section.
878 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
881 * target-reloc.h (apply_relocation): Replace <64, false> with
884 2011-11-25 Nick Clifton <nickc@redhat.com>
886 * po/it.po: New Italian translation.
888 2011-11-17 Sterling Augustine <saugustine@google.com>
890 * script.cc (script_include_directive): Implement.
891 (read_script_file): New local variables name and search_path. Update
892 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
893 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
894 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
896 2011-11-11 Sterling Augustine <saugustine@google.com>
898 * yyscript.y (section_cmd): Add support for INCLUDE directive.
899 (file_or_sections_cmd): Likewise.
901 2011-11-11 Doug Kwan <dougkwan@google.com>
903 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
904 if --just-symbols is given.
906 2011-11-10 Doug Kwan <dougkwan@google.com>
909 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
910 when processing data relocs.
911 * reloc.h (Relocate_functions::rel_unaligned): New method.
912 (Relocate_functions::pcrel_unaligned): Ditto.
913 (Relocate_functions::rel32_unaligned): Ditto.
914 (Relocate_functions::pcrel32_unaligned): Ditto.
916 2011-11-09 Doug Kwan <dougkwan@google.com>
919 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
920 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
921 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
922 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
923 (Relocate_functions::rel_unaligned): New.
924 (Relocate_functions::rel32_unaligned): New.
925 * target-reloc.h (relocate_for_relocatable): Add code to handle
926 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
927 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
928 arm_unaligned_reloc_r): New targets.
929 * testsuite/Makefile.in: Regenerate.
930 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
933 2011-11-02 Ian Lance Taylor <iant@google.com>
935 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
937 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
938 * options.cc (General_options::finalize): Use library search path
939 from configure script if specified. If not native and no sysroot,
940 only search TOOLLIBDIR.
941 * options.h (Search_directory::Search_directory): Change name to
943 (General_options::add_to_library_path_with_sysroot): Change arg to
945 * configure, Makefile.in, config.in: Rebuild.
947 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
949 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
950 we are working around the ARM1176 Erratum.
951 * options.h (General_options::fix_arm1176): Add option.
952 * testsuite/Makefile.am: Add testcases, and keep current ones
954 * testsuite/Makefile.in: Regenerate.
955 * testsuite/arm_fix_1176.s: New file.
956 * testsuite/arm_fix_1176.sh: Likewise.
958 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
960 * arm.cc (Target_arm::Target_arm): Remove initialisation of
962 (Target_arm::may_use_blx): Remove method.
963 (Target_arm::set_may_use_blx): Likewise.
964 (Target_arm::may_use_v4t_interworking): New method.
965 (Target_arm::may_use_v5t_interworking): Likewise.
966 (Target_arm::may_use_blx_): Remove member variable.
967 (Arm_relocate_functions::arm_branch_common): Check for v5T
969 (Arm_relocate_functions::thumb_branch_common): Likewise.
970 (Reloc_stub::stub_type_for_reloc): Likewise.
971 (Target_arm::do_finalize_sections): Correct interworking checks.
972 * testsuite/Makefile.am: Add new tests.
973 * testsuite/Makefile.in: Regenerate.
974 * testsuite/arm_farcall_arm_arm.s: New test.
975 * testsuite/arm_farcall_arm_arm.sh: Likewise.
976 * testsuite/arm_farcall_arm_thumb.s: Likewise.
977 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
978 * testsuite/arm_farcall_thumb_arm.s: Likewise.
979 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
980 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
981 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
983 2011-10-31 Cary Coutant <ccoutant@google.com>
986 * expression.cc (Expression::eval_with_dot): Add
987 is_section_dot_assignment parameter.
988 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
989 absolute and assigning to dot within a section.
991 (Output_section_element_assignment::set_section_addresses): Pass
992 dot_section to set_if_absolute.
993 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
994 as is_section_dot_assignment flag to eval_with_dot.
995 (Output_section_element_dot_assignment::set_section_addresses):
997 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
998 parameter. Also set value if relative to dot_section; set the
999 symbol's output_section.
1000 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1001 parameter. Adjust all callers.
1002 (Expression::eval_maybe_dot): Likewise.
1003 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1005 * testsuite/script_test_2.t: Test assignment of an absolute value
1006 to dot within an output section element.
1008 2011-10-31 Cary Coutant <ccoutant@google.com>
1010 * options.h (class General_options): Add --[no-]gnu-unique options.
1011 * symtab.cc (Symbol_table::sized_write_globals): Convert
1012 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1014 2011-10-31 Cary Coutant <ccoutant@google.com>
1017 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1018 unnecessary assertion.
1019 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1021 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1023 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1025 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1027 Change to just keep the section associated with symbol.
1028 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1029 they are externally visible and --export-dynamic is turned on.
1030 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1032 2011-10-19 Ian Lance Taylor <iant@google.com>
1035 * script-sections.cc
1036 (Output_section_element_dot_assignment::needs_output_section): New
1039 2011-10-19 Ian Lance Taylor <iant@google.com>
1042 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1043 --section-start option was seen.
1044 * options.h (General_options::any_section_start): New function.
1046 2011-10-18 David S. Miller <davem@davemloft.net>
1049 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1050 member to track relocation locations that have moved during TLS
1051 reloc optimizations.
1052 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1053 (Target_sparc::Relocate::relocate): Adjust view down by 4
1054 bytes if it matches reloc_adjust_addr_.
1055 (Target_sparc::Relocate::relocate_tls): Always move the
1056 __tls_get_addr call delay slot instruction forward 4 bytes when
1057 performing relaxation.
1059 2011-10-18 Cary Coutant <ccoutant@google.com>
1061 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1062 (Output_file::map_no_anonymous): Check for non-zero
1063 return code from posix_fallocate.
1065 2011-10-17 Cary Coutant <ccoutant@google.com>
1068 * plugin.cc (is_visible_from_outside): Check for symbols
1069 referenced from dynamic objects.
1070 * resolve.cc (Symbol_table::resolve): Don't count references
1071 from dynamic objects as references from real ELF files.
1072 * testsuite/plugin_test_2.sh: Adjust expected result.
1074 2011-10-17 Cary Coutant <ccoutant@google.com>
1076 * gold.cc: Include timer.h.
1077 (queue_middle_tasks): Stamp time.
1078 (queue_final_tasks): Likewise.
1079 * main.cc (main): Store timer in parameters. Print timers
1081 * parameters.cc (Parameters::Parameters): Initialize timer_.
1082 (Parameters::set_timer): New function.
1083 (set_parameters_timer): New function.
1084 * parameters.h (Parameters::set_timer): New function.
1085 (Parameters::timer): New function.
1086 (Parameters::timer_): New data member.
1087 (set_parameters_timer): New function.
1088 * timer.cc (Timer::stamp): New function.
1089 (Timer::get_pass_time): New function.
1090 * timer.h (Timer::stamp): New function.
1091 (Timer::get_pass_time): New function.
1092 (Timer::pass_times_): New data member.
1094 2011-10-17 Cary Coutant <ccoutant@google.com>
1096 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1097 task for members of lib groups.
1099 2011-10-17 Cary Coutant <ccoutant@google.com>
1102 * fileread.cc (File_read::find_view): Add assert.
1103 (File_read::make_view): Move bounds check (replace with assert)...
1104 (File_read::find_or_make_view): ... to here.
1106 2011-10-12 Cary Coutant <ccoutant@google.com>
1108 * output.cc (Output_file::open_base_file): Handle case where
1109 ::read returns less than requested size.
1111 2011-10-10 Cary Coutant <ccoutant@google.com>
1113 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1114 Initialize defined_count_.
1115 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1116 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1117 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1118 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1119 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1120 * incremental.h (Sized_relobj_incr::defined_count_): New data
1122 (Sized_incr_dynobj::defined_count_): New data member.
1123 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1124 Return zeroes instead of internal error.
1126 2011-10-10 Cary Coutant <ccoutant@google.com>
1129 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1130 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1131 * output.h (class Output_reloc): Add use_plt_offset flag.
1132 (Output_reloc::type_): Adjust size of bit field.
1133 (Output_reloc::use_plt_offset_): New bit field.
1134 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1135 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1136 flag. Adjust all callers.
1137 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1138 creating RELATIVE relocations.
1140 2011-10-10 Nick Clifton <nickc@redhat.com>
1142 * po/es.po: Updated Spanish translation.
1143 * po/fi.po: Updated Finnish translation.
1145 2011-10-03 Diego Novillo <dnovillo@google.com>
1147 * options.cc (parse_uint): Fix dereference of RETVAL.
1149 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1151 * layout.h (section_order_map_): New member.
1152 (get_section_order_map): New member function.
1153 * output.cc (Output_section::add_input_section): Check for patterns
1154 only when --section-ordering-file is specified.
1155 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1156 output_sections have been formed.
1157 * layout.cc (Layout_Layout): Initialize section_order_map_.
1158 * plugin.cc (update_section_order): Store order in order_map. Do not
1160 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1161 * testsuite/Makefile.in: Regenerate.
1162 * testsuite/plugin_section_order.c: New file.
1163 * testsuite/plugin_final_layout.cc: New file.
1164 * testsuite/plugin_final_layout.sh: New file.
1166 2011-09-29 Cary Coutant <ccoutant@google.com>
1168 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1170 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1171 symbols during incremental update.
1172 (Symbol_table::add_from_dynobj): Likewise.
1174 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1175 Ian Lance Taylor <iant@google.com>
1177 * symtab.cc (Symbol_table::define_special_symbol): Always
1178 canonicalize version string.
1180 2011-09-26 Cary Coutant <ccoutant@google.com>
1182 * gold.cc (queue_initial_tasks): Move option checks ...
1183 * options.cc (General_options::finalize): ... to here. Disable
1184 some options; make others fatal.
1186 2011-09-26 Cary Coutant <ccoutant@google.com>
1189 * plugin.cc (get_symbols_v2): New function.
1190 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1191 (is_referenced_from_outside): New function.
1192 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1193 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1194 (get_symbols): Pass version parameter.
1195 (get_symbols_v2): New function.
1196 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1198 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1199 (onload): Add LDPT_GET_SYMBOLS_V2.
1200 (all_symbols_read_hook): Use get_symbols_v2; check for
1201 LDPR_PREVAILING_DEF_IRONLY_EXP.
1202 * testsuite/plugin_test_3.sh: Update expected results.
1204 2011-09-23 Simon Baldwin <simonb@google.com>
1206 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1207 configuration options.
1208 * configure: Regenerate.
1209 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1210 * Makefile.in: Regenerate.
1211 * testsuite/Makefile.in: Regenerate.
1213 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1215 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1217 2011-09-19 Cary Coutant <ccoutant@google.com>
1219 * incremental.cc (can_incremental_update): Fix typo in comment.
1220 * incremental.h (can_incremental_update): Likewise.
1222 2011-09-18 Cary Coutant <ccoutant@google.com>
1224 * incremental.cc (can_incremental_update): New function.
1225 * incremental.h (can_incremental_update): New function.
1226 * layout.cc (Layout::init_fixed_output_section): Call it.
1227 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1228 * object.cc (Sized_relobj_file::do_layout): Call
1229 can_incremental_update.
1231 2011-09-13 Cary Coutant <ccoutant@google.com>
1233 * configure.ac: Check for glibc support for gnu_indirect_function
1234 support with static linking, setting automake conditional
1236 * Makefile.in: Regenerate.
1237 * configure: Regenerate.
1239 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1240 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1242 * testsuite/Makefile.in: Regenerate.
1244 2011-09-13 Cary Coutant <ccoutant@google.com>
1246 * incremental.cc (Sized_relobj_incr::do_layout): Call
1247 report_comdat_group for kept comdat sections.
1248 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1249 * testsuite/Makefile.in: Regenerate.
1250 * testsuite/incr_comdat_test_1.cc: New source file.
1251 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1252 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1253 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1255 2011-09-13 Ian Lance Taylor <iant@google.com>
1257 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1258 variable external_symbols_offset.
1260 2011-09-12 Ian Lance Taylor <iant@google.com>
1262 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1263 triggered if object has no symbols.
1265 2011-09-09 David S. Miller <davem@davemloft.net>
1267 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1268 (Output_fill_debug_line::do_write): Likewise.
1270 2011-08-29 Cary Coutant <ccoutant@google.com>
1272 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1273 casts to match formatting specs.
1274 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1276 2011-08-26 Cary Coutant <ccoutant@google.com>
1278 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1279 remaining hole size when allocating.
1280 (Layout::make_output_section): Set fill methods for debug sections.
1281 * layout.h (Free_list::Free_list_node): Move from private to
1283 (Free_list::set_min_hole_size): New function.
1284 (Free_list::begin, Free_list::end): New functions.
1285 (Free_list::min_hole_): New data member.
1286 * output.cc: Include dwarf.h.
1287 (Output_fill_debug_info::do_minimum_hole_size): New function.
1288 (Output_fill_debug_info::do_write): New function.
1289 (Output_fill_debug_line::do_minimum_hole_size): New function.
1290 (Output_fill_debug_line::do_write): New function.
1291 (Output_section::Output_section): Initialize new data member.
1292 (Output_section::set_final_data_size): Ensure patch space is larger
1293 than minimum hole size.
1294 (Output_section::do_write): Fill holes in debug sections.
1295 * output.h (Output_fill): New class.
1296 (Output_fill_debug_info): New class.
1297 (Output_fill_debug_line): New class.
1298 (Output_section::set_free_space_fill): New function.
1299 (Output_section::free_space_fill_): New data member.
1300 * testsuite/Makefile.am (incremental_test_3): Add
1301 --incremental-patch option.
1302 (incremental_test_4): Likewise.
1303 (incremental_test_5): Likewise.
1304 (incremental_test_6): Likewise.
1305 (incremental_copy_test): Likewise.
1306 (incremental_common_test_1): Likewise.
1307 * testsuite/Makefile.in: Regenerate.
1309 2011-08-26 Nick Clifton <nickc@redhat.com>
1311 * po/es.po: Updated Spanish translation.
1313 2011-08-01 Cary Coutant <ccoutant@google.com>
1315 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1316 * gold/testsuite/Makefile.in: Regenerate.
1317 * gold/testsuite/justsyms_exec.c: New source file.
1318 * gold/testsuite/justsyms_lib.c: New source file.
1320 2011-08-01 Cary Coutant <ccoutant@google.com>
1322 * layout.cc (Layout::set_segment_offsets): Don't realign text
1323 segment if -Ttext was specified.
1324 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1326 * object.h (Sized_relobj_file::e_type): New function.
1327 (Sized_relobj_file::e_type_): New data member.
1328 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1329 base address for ET_EXEC files.
1330 * target.cc (Target::do_make_elf_object_implementation): Allow
1331 ET_EXEC files with --just-symbols option.
1333 2011-07-28 Cary Coutant <ccoutant@google.com>
1335 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1336 Add thread_number parameter.
1337 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1338 * workqueue-threads.cc
1339 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1340 current thread if its thread number is greater than desired thread
1342 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1343 Add thread_number parameter.
1344 (Workqueue::should_cancel_thread): Likewise.
1345 (Workqueue::find_runnable_or_wait): Pass thread_number to
1346 should_cancel_thread.
1347 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1350 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1352 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1353 only after checking if it cannot be forced local.
1354 * symtab.h (is_externally_visible): Check if the symbol is not forced
1357 2011-07-15 Ian Lance Taylor <iant@google.com>
1359 * options.h (class General_options): Add --print-output-format.
1360 Move -EL next to -EB, for better --help output.
1361 * target-select.cc: Include <cstdio>, "options.h", and
1363 (Target_selector::do_target_bfd_name): New function.
1364 (print_output_format): New function.
1365 * target-select.h (class Target_selector): Update declarations.
1366 (Target_selector::target_bfd_name): New function.
1367 (print_output_format): Declare.
1368 * main.cc: Include "target-select.h".
1369 (main): Handle --print-output-format.
1370 * gold.cc: Include "target-select.h".
1371 (queue_initial_tasks): Handle --print-output-format when there are
1373 * parameters.cc (parameters_force_valid_target): Give a better
1374 error message if -EB/-EL does not match target.
1375 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1378 2011-07-15 Ian Lance Taylor <iant@google.com>
1380 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1381 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1382 (Output_data_plt_i386::do_write): Write address of .dynamic
1383 section to first entry in .got.plt section.
1384 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1385 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1387 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1388 section to first entry in .got.plt section.
1389 * layout.h (Layout::dynamic_section): New function.
1391 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1393 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1395 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1396 input_section_position_, and input_section_glob_.
1397 (read_layout_from_file): Call function section_ordering_specified.
1398 * layout.h (is_section_ordering_specified): New function.
1399 (section_ordering_specified): New function.
1400 (section_ordering_specified_): New boolean member.
1401 * main.cc(main): Call load_plugins after layout object is defined.
1402 * output.cc (Output_section::add_input_section): Use
1403 function section_ordering_specified to check if section ordering is
1405 * output.cc (Output_section::add_relaxed_input_section): Use
1406 function section_ordering_specified to check if section ordering is
1408 (Output_section::update_section_layout): New function.
1409 (Output_section::sort_attached_input_sections): Check if input section
1411 * output.h (Output_section::update_section_layout): New function.
1412 * plugin.cc (get_section_count): New function.
1413 (get_section_type): New function.
1414 (get_section_name): New function.
1415 (get_section_contents): New function.
1416 (update_section_order): New function.
1417 (allow_section_ordering): New function.
1418 (Plugin::load): Add the new interfaces to the transfer vector.
1419 (Plugin_manager::load_plugins): New parameter.
1420 (Plugin_manager::all_symbols_read): New parameter.
1421 (Plugin_manager::claim_file): New parameter. Save the elf object for
1423 (Plugin_manager::get_elf_object): New function.
1424 (Plugin_manager::get_view): Change to directly use the bool to check
1425 if get_view is called from claim_file_hook.
1426 * plugin.h (input_objects): New function
1427 (Plugin__manager::load_plugins): New parameter.
1428 (Plugin_manager::claim_file): New parameter.
1429 (Plugin_manager::get_elf_object): New function.
1430 (Plugin_manager::in_claim_file_handler): New function.
1431 (Plugin_manager::in_claim_file_handler_): New member.
1432 (layout): New function.
1433 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1434 handler with an extra parameter. Make the elf object before calling
1436 * testsuite/plugin_test.c (get_section_count): New function pointer.
1437 (get_section_type): New function pointer.
1438 (get_section_name): New function pointer.
1439 (get_section_contents): New function pointer.
1440 (update_section_order): New function pointer.
1441 (allow_section_ordering): New function pointer.
1442 (onload): Check if the new interfaces exist.
1444 2011-07-13 Ian Lance Taylor <iant@google.com>
1446 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1448 * x86_64.cc (Target_x86_64::got_section): Likewise.
1449 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1450 (relro_now_test_SOURCES): New variable.
1451 (relro_now_test_DEPENDENCIES): New variable.
1452 (relro_now_test_LDFLAGS): New variable.
1453 (relro_now_test_LDADD): New variable.
1454 (relro_now_test.so): New target.
1455 * testsuite/Makefile.in: Rebuild.
1457 2011-07-12 Ian Lance Taylor <iant@google.com>
1460 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1461 GLOB_DAT relocation rather than a RELATIVE relocation for a
1462 protected symbol when creating a shared library.
1463 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1464 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1465 * testsuite/protected_main_1.cc (main): Test that protected
1466 function has same address.
1468 2011-07-11 Ian Lance Taylor <iant@google.com>
1471 * options.h (class General_options): Add -Bgroup.
1472 * options.cc (General_options::finalize): If -Bgroup is set,
1473 default to --unresolved-symbols=report-all.
1474 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1475 * target-reloc.h (issue_undefined_symbol_error): Handle
1476 --unresolved-symbols=report-all.
1478 2011-07-08 Ian Lance Taylor <iant@google.com>
1481 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1482 if linker script discards key sections.
1483 (Layout::create_dynamic_symtab): Likewise.
1484 (Layout::assign_local_dynsym_offsets): Likewise.
1485 (Layout::sized_create_version_sections): Likewise.
1486 (Layout::create_interp): Likewise.
1487 (Layout::finish_dynamic_section): Likewise.
1488 (Layout::set_dynamic_symbol_size): Likewise.
1490 2011-07-08 Ian Lance Taylor <iant@google.com>
1493 * options.h (class General_options): Add --unresolved-symbols.
1494 * target-reloc.h (issue_undefined_symbol_error): Check
1495 --unresolved-symbols. Add comments.
1497 2011-07-08 Ian Lance Taylor <iant@google.com>
1499 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1500 expression more complex.
1502 2011-07-08 Ian Lance Taylor <iant@google.com>
1505 * target-reloc.h (issue_undefined_symbol_error): New inline
1506 function, broken out of relocate_section.
1507 (relocate_section): Call issue_undefined_symbol_error.
1508 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1509 there is no TLS segment if we are about to issue an undefined
1511 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1513 2011-07-08 Ian Lance Taylor <iant@google.com>
1516 * resolve.cc (Symbol_table::should_override): Add fromtype
1517 parameter. Change all callers. Give error when linking together
1518 TLS and non-TLS symbol.
1519 (Symbol_table::should_override_with_special): Add fromtype
1520 parameter. Change all callers.
1521 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1522 there is no TLS segment if we have reported some errors.
1523 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1525 2011-07-08 Ian Lance Taylor <iant@google.com>
1528 * target.h (Target::plt_address_for_global): New function.
1529 (Target::plt_address_for_local): New function.
1530 (Target::plt_section_for_global): Remove.
1531 (Target::plt_section_for_local): Remove.
1532 (Target::do_plt_address_for_global): New virtual function.
1533 (Target::do_plt_address_for_local): New virtual function.
1534 (Target::do_plt_section_for_global): Remove.
1535 (Target::do_plt_section_for_local): Remove.
1536 (Target::register_global_plt_entry): Add Symbol_table and Layout
1538 * output.cc (Output_data_got::Got_entry::write): Use
1539 plt_address_for_global and plt_address_for_local.
1540 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1541 address of output section.
1542 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1543 got_irelative_, and irelative_count_ fields. Update
1545 (Output_data_plt_i386::has_irelative_section): New function.
1546 (Output_data_plt_i386::entry_count): Add irelative_count_.
1547 (Output_data_plt_i386::set_final_data_size): Likewise.
1548 (class Target_i386): Add got_irelative_ and rel_irelative_
1549 fields. Update declarations.
1550 (Target_i386::Target_i386): Initialize new fields.
1551 (Target_i386::do_plt_address_for_global): New function replacing
1552 do_plt_section_for_global.
1553 (Target_i386::do_plt_address_for_local): New function replacing
1554 do_plt_section_for_local.
1555 (Target_i386::got_section): Create got_irelative_.
1556 (Target_i386::rel_irelative_section): New function.
1557 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1558 fields. Don't define __rel_iplt_{start,end}.
1559 (Output_data_plt_i386::add_entry): Add symtab and layout
1560 parameters. Change all callers. Use different PLT and GOT for
1562 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1563 layout parameters. Change all callers. Use different PLT and
1565 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1566 (Output_data_plt_i386::rel_irelative): New function.
1567 (Output_data_plt_i386::address_for_global): New function.
1568 (Output_data_plt_i386::address_for_local): New function.
1569 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1570 IRELATIVE GOT when changing IFUNC GOT entries.
1571 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1573 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1574 if we didn't create an IRELATIVE GOT.
1575 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1576 plt_address_for_local.
1577 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1578 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1579 got_irelative_, and irelative_count_ fields. Update
1581 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1582 Initialize new fields. Remove symtab parameter. Change all
1584 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1586 (Output_data_plt_x86_64::has_irelative_section): New function.
1587 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1588 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1589 fields. Update declarations.
1590 (Target_x86_64::Target_x86_64): Initialize new fields.
1591 (Target_x86_64::do_plt_address_for_global): New function replacing
1592 do_plt_section_for_global.
1593 (Target_x86_64::do_plt_address_for_local): New function replacing
1594 do_plt_section_for_local.
1595 (Target_x86_64::got_section): Create got_irelative_.
1596 (Target_x86_64::rela_irelative_section): New function.
1597 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1598 all callers. Don't create __rel_iplt_{start,end}.
1599 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1600 parameters. Change all callers. Use different PLT and GOT for
1602 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1603 layout parameters. Change all callers. Use different PLT and
1605 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1606 parameters. Change all callers. Use different PLT and GOT for
1608 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1609 (Output_data_plt_x86_64::rela_irelative): New function.
1610 (Output_data_plt_x86_64::address_for_global): New function.
1611 (Output_data_plt_x86_64::address_for_local): New function.
1612 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1613 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1614 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1615 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1617 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1619 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1620 symbols if we didn't create an IRELATIVE GOT.
1621 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1622 plt_address_for_local.
1623 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1624 * testsuite/ifuncvar1.c: New test file.
1625 * testsuite/ifuncvar2.c: New test file.
1626 * testsuite/ifuncvar3.c: New test file.
1627 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1628 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1629 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1630 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1631 * testsuite/Makefile.in: Rebuild.
1633 2011-07-07 Cary Coutant <ccoutant@google.com>
1635 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1636 (two_file_test_1_ndebug.o): Likewise.
1637 (two_file_test_1b_ndebug.o): Likewise.
1638 (two_file_test_2_ndebug.o): Likewise.
1639 (two_file_test_main_ndebug.o): Likewise.
1640 (incremental_test_2): Link with no-debug versions.
1642 2011-07-06 Cary Coutant <ccoutant@google.com>
1644 * gold/incremental.cc
1645 (Output_section_incremental_inputs::write_info_blocks): Check for
1646 hidden and internal symbols.
1648 2011-07-06 Cary Coutant <ccoutant@google.com>
1650 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1651 Check disposition for startup file.
1652 (Incremental_inputs::report_command_line): Ignore
1653 --incremental-startup-unchanged option.
1654 * options.cc (General_options::parse_incremental_startup_unchanged):
1656 (General_options::General_options): Initialize new data member.
1657 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1658 (General_options): Add --incremental-startup-unchanged option.
1659 (General_options::incremental_startup_disposition): New function.
1660 (General_options::incremental_startup_disposition_): New data member.
1662 2011-07-06 Cary Coutant <ccoutant@google.com>
1664 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1665 input file index to Script_info ctor.
1666 (Sized_incremental_binary::do_file_has_changed): Find the
1667 command-line argument for files named in scripts.
1668 * incremental.h (Script_info::Script_info): New ctor
1669 with input file index.
1670 (Script_info::input_file_index): New function.
1671 (Script_info::input_file_index_): New data member.
1672 (Incremental_binary::get_library): Add const.
1673 (Incremental_binary::get_script_info): Add const.
1674 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1675 * testsuite/Makefile.am (incremental_test_5): New test case.
1676 (incremental_test_6): New test case.
1677 * testsuite/Makefile.in: Regenerate.
1679 2011-07-06 Cary Coutant <ccoutant@google.com>
1681 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1682 debug output when command lines differ.
1684 2011-07-06 Cary Coutant <ccoutant@google.com>
1686 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1687 --incremental-patch option.
1688 * layout.cc (Free_list::allocate): Extend allocation beyond original
1690 (Layout::make_output_section): Mark sections that should get
1692 * options.cc (parse_percent): New function.
1693 * options.h (parse_percent): New function.
1694 (DEFINE_percent): New macro.
1695 (General_options): Add --incremental-patch option.
1696 * output.cc (Output_section::Output_section): Initialize new data
1698 (Output_section::add_input_section): Print section name when out
1700 (Output_section::add_output_section_data): Likewise.
1701 (Output_section::set_final_data_size): Add patch space when
1702 doing --incremental-full.
1703 (Output_section::do_reset_address_and_file_offset): Remove patch
1705 (Output_segment::set_section_list_addresses): Print debug output
1706 only if --incremental-update.
1707 * output.h (Output_section::set_is_patch_space_allowed): New function.
1708 (Output_section::is_patch_space_allowed_): New data member.
1709 (Output_section::patch_space_): New data member.
1710 * parameters.cc (Parameters::incremental_full): New function.
1711 * parameters.h (Parameters::incremental_full): New function
1712 * testsuite/Makefile.am (incremental_test_2): Add test for
1713 --incremental-patch option.
1714 * testsuite/Makefile.in: Regenerate.
1715 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1716 (t18): Remove function body.
1718 2011-07-05 Doug Kwan <dougkwan@google.com>
1721 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1722 Arm_Address type for relocation result.
1723 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1725 (Arm_relocate_functions::abs32): Use unaligned access.
1726 (Arm_relocate_functions::rel32): Ditto.
1727 (Arm_relocate_functions::prel31): Ditto.
1728 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1729 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1730 static data relocations.
1731 * testsuite/Makefile.in: Regnerate.
1732 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1734 2011-07-05 Ian Lance Taylor <iant@google.com>
1737 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1738 symbols if necessary.
1739 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1741 2011-07-05 Ian Lance Taylor <iant@google.com>
1744 * resolve.cc (Symbol::override_base_with_special): Simply override
1745 version with special symbol version, ignoring previous version.
1747 2011-07-05 Ian Lance Taylor <iant@google.com>
1749 * object.cc (Sized_relobj_file::include_section_group): Add
1750 information to comment about signature location.
1752 2011-07-02 Ian Lance Taylor <iant@google.com>
1755 * options.h (class General_options): Add -f and -F.
1756 * options.cc (General_options::finalize): Fatal error if -f/-F
1757 are used without -shared.
1758 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1760 2011-07-02 Ian Lance Taylor <iant@google.com>
1762 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1764 2011-07-01 Ian Lance Taylor <iant@google.com>
1768 * resolve.cc (Symbol::override_base_with_special): Don't override
1769 the version if the overriding symbol has a different name.
1770 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1771 all callers. If we give an error about an undefined version,
1772 define the base version if necessary.
1773 * dynobj.h (class Versions): Update declaration.
1774 * testsuite/weak_alias_test_5.cc: New file.
1775 * testsuite/weak_alias_test.script: New file.
1776 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1777 and versioned_alias have the right value, and call t2.
1778 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1779 weak_alias_test_5.so.
1780 (weak_alias_test_LDADD): Likewise.
1781 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1782 * testsuite/Makefile.in: Rebuild.
1784 2011-07-01 Ian Lance Taylor <iant@google.com>
1787 * options.h (class General_options): Support -z notext.
1788 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1790 (two_file_shared_nonpic.so): Likewise.
1791 (two_file_shared_mixed.so): Likewise.
1792 (two_file_shared_mixed_1.so): Likewise.
1793 (weak_undef_lib_nonpic.so): Likewise.
1794 (alt/weak_undef_lib_nonpic.so): Likewise.
1795 (tls_test_shared_nonpic.so): Likewise.
1796 * testsuite/Makefile.in: Rebuild.
1798 2011-07-01 Ian Lance Taylor <iant@google.com>
1801 * configure.ac: Test whether static linking works, setting
1802 the automake conditional HAVE_STATIC.
1803 * testsuite/Makefile.am: Disable tests using -static if
1804 HAVE_STATIC is not true.
1805 * configure, testsuite/Makefile.in: Rebuild.
1807 2011-07-01 Ian Lance Taylor <iant@google.com>
1810 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1811 Assert if we see DW_EH_PE_indirect.
1812 * target.h (Target::ehframe_datarel_base): New function.
1813 (Target::do_ehframe_datarel_base): New target function.
1814 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1815 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1818 2011-07-01 Ian Lance Taylor <iant@google.com>
1821 * options.h (class General_options): Add
1822 --ld-generated-unwind-info.
1823 * ehframe.cc (Fde::write): Add address parameter. Change all
1824 callers. If associated with PLT, fill in address and size.
1825 (Cie::set_output_offset): Only add merge mapping if there is an
1827 (Cie::write): Add address parameter. Change all callers.
1828 (Eh_frame::add_ehframe_for_plt): New function.
1829 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1830 input_offset_ fields into union u_, with new plt field.
1831 (Fde::Fde): Adjust for new union field.
1832 (Fde::Fde) [Output_data version]: New constructor.
1833 (Fde::add_mapping): Only add merge mapping if there is an object.
1834 (class Cie): Update declarations.
1835 (class Eh_frame): Declare add_ehframe_for_plt.
1836 * layout.cc (Layout::layout_eh_frame): Break out code into
1837 make_eh_frame_section, and call it.
1838 (Layout::make_eh_frame_section): New function.
1839 (Layout::add_eh_frame_for_plt): New function.
1840 * layout.h (class Layout): Update declarations.
1841 * merge.cc (Merge_map::add_mapping): Add assertion.
1842 * i386.cc: Include "dwarf.h".
1843 (class Output_data_plt_i386): Make first_plt_entry,
1844 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1845 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1846 and plt_eh_frame_fde.
1847 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1848 boundary. Call add_eh_frame_for_plt if appropriate.
1849 * x86_64.cc: Include "dwarf.h".
1850 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1851 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1852 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1853 and plt_eh_frame_fde.
1854 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1857 2011-06-29 Ian Lance Taylor <iant@google.com>
1860 * object.cc (Sized_relobj_file::layout_section): Change shdr
1861 parameter to be const.
1862 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1864 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1865 appropriate. Call layout_eh_frame_section.
1866 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1868 * object.h (class Sized_relobj_file): Update declarations.
1870 2011-06-29 Ian Lance Taylor <iant@google.com>
1873 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1875 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1877 2011-06-29 Ian Lance Taylor <iant@google.com>
1880 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1882 * layout.cc (Layout::layout_eh_frame): Likewise.
1884 2011-06-29 Ian Lance Taylor <iant@google.com>
1887 * layout.cc (Layout::symtab_section_shndx): New function.
1888 * layout.h (class Layout): Declare symtab_section_shndx.
1889 * output.cc (Output_section::write_header): Call it.
1891 2011-06-29 Ian Lance Taylor <iant@google.com>
1894 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1895 symbols which are not used in a relocation.
1897 2011-06-28 Ian Lance Taylor <iant@google.com>
1900 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1901 script create indistinguishable segments.
1902 (Layout::set_segment_offsets): Use stable_sort when sorting
1903 segments. Pass this to Compare_segments constructor.
1904 * layout.h (class Layout): Make segment_precedes non-static.
1905 (class Compare_segments): Change from struct to class. Add
1906 layout_ field. Add constructor.
1907 * script-sections.cc
1908 (Script_sections::attach_sections_using_phdrs_clause): Rename
1909 local orphan to is_orphan. Don't report failure to put empty
1910 section in segment. On attachment failure, report name of
1911 section, and attach to first PT_LOAD segment.
1913 2011-06-28 Ian Lance Taylor <iant@google.com>
1916 * target-select.cc (Target_selector::Target_selector): Add
1917 emulation parameter. Change all callers.
1918 (select_target_by_bfd_name): Rename from select_target_by_name.
1920 (select_target_by_emulation): New function.
1921 (supported_emulation_names): New function.
1922 * target-select.h (class Target_selector): Add emulation_ field.
1923 Update declarations.
1924 (Target_selector::recognize_by_bfd_name): Rename from
1925 recognize_by_name. Change all callers.
1926 (Target_selector::supported_bfd_names): Rename from
1927 supported_names. Change all callers.
1928 (Target_selector::recognize_by_emulation): New function.
1929 (Target_selector::supported_emulations): New function.
1930 (Target_selector::emulation): New function.
1931 (Target_selector::do_recognize_by_bfd_name): Rename from
1932 do_recognize_by_name. Change all callers.
1933 (Target_selector::do_supported_bfd_names): Rename from
1934 do_supported_names. Change all callers.
1935 (Target_selector::do_recognize_by_emulation): New function.
1936 (Target_selector::do_supported_emulations): New function.
1937 (select_target_by_bfd_name): Change name in declaration.
1938 (select_target_by_emulation): Declare.
1939 (supported_emulation_names): Declare.
1940 * parameters.cc (parameters_force_valid_target): Try to find
1941 target based on emulation from -m option.
1942 * options.h (class General_options): Change doc string for -m.
1943 * options.cc (help): Print emulations.
1944 (General_options::parse_V): Likewise.
1945 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1946 Add emulation parameter. Change all callers.
1948 2011-06-28 Ian Lance Taylor <iant@google.com>
1950 * target.h (class Target): Add osabi_ field.
1951 (Target::osabi): New function.
1952 (Target::set_osabi): New function.
1953 (Target::Target): Initialize osabi_.
1954 (Target::do_adjust_elf_header): Make pure virtual.
1955 (Sized_target::do_adjust_elf_header): Declare.
1956 * target.cc (Sized_target::do_adjust_elf_header): New function.
1957 (class Sized_target): Instantiate all versions.
1958 * freebsd.h (class Target_freebsd): Remove.
1959 (Target_selector_freebsd::do_recognize): Call set_osabi on
1961 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1962 (Target_selector_freebsd::set_osabi): Remove.
1963 * i386.cc (class Target_i386): Inherit from Sized_target rather
1964 than Target_freebsd.
1965 * x86_64.cc (class Target_x86_64): Likewise.
1967 2011-06-28 Ian Lance Taylor <iant@google.com>
1969 * target.h (Target::can_check_for_function_pointers): Rewrite.
1971 (Target::can_icf_inline_merge_sections): Likewise.
1972 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1973 (Target::Target_info): Add can_icf_inline_merge_sections field.
1974 (Target::do_can_check_for_function_pointers): New virtual
1976 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1977 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1978 from can_check_for_function_pointers, move in file.
1979 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1980 section_may_have_icf_unsafe_poineters, move in file.
1981 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1982 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1983 Rename from can_check_for_function_pointers, move in file.
1984 (Target_i386::can_icf_inline_merge_sections): Remove.
1985 (Target_i386::i386_info): Initialize
1986 can_icf_inline_merge_sections.
1987 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1988 Initialize can_icf_inline_merge_sections.
1989 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1990 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1991 Rename from can_check_for_function_pointers, move in file.
1992 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1993 (Target_x86_64::x86_64_info): Initialize
1994 can_icf_inline_merge_sections.
1995 * testsuite/testfile.cc (Target_test::test_target_info):
1997 * icf.cc (get_section_contents): Correct formatting.
1999 2011-06-27 Ian Lance Taylor <iant@google.com>
2001 * symtab.cc (Symbol::versioned_name): New function.
2002 (Symbol_table::add_to_final_symtab): Use versioned_name when
2004 (Symbol_table::sized_write_symbol): Likewise.
2005 * symtab.h (class Symbol): Declare versioned_name.
2006 * stringpool.h (class Stringpool_template): Add variant of add
2007 which takes a std::basic_string.
2008 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2009 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2010 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2011 (ver_test_12.o): New target.
2012 * testsuite/Makefile.in: Rebuild.
2014 2011-06-27 Doug Kwan <dougkwan@google.com>
2016 * arm.cc (Arm_relocate_functions::thm_jump8,
2017 Arm_relocate_functions::thm_jump11): Use a wider signed
2018 type to compute offset.
2019 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2021 * testsuite/Makefile.in: Regenerate.
2022 * testsuite/arm_branch_in_range.sh: Check test results of
2023 arm_thm_jump11 and arm_thm_jump8.
2024 * testsuite/arm_thm_jump11.s: New test source file.
2025 * testsuite/arm_thm_jump11.t: New linker script.
2026 * testsuite/arm_thm_jump8.s: New test source file.
2027 * testsuite/arm_thm_jump8.t: New linker script.
2029 2011-06-24 Ian Lance Taylor <iant@google.com>
2031 * layout.cc: Include "object.h".
2032 (ctors_sections_in_init_array): New static variable.
2033 (Layout::is_ctors_in_init_array): New function.
2034 (Layout::layout): Add entry to ctors_sections_in_init_array if
2036 * layout.h (class Layout): Declare is_ctors_in_init_array.
2037 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2038 is_ctors_reverse_view is set.
2039 (Sized_relobj_file::write_sections): Add layout parameter. Change
2040 all callers. Set is_ctors_reverse_view field of View_size.
2041 (Sized_relobj_file::reverse_words): New function.
2042 * object.h (Sized_relobj_file::View_size): Add
2043 is_ctors_reverse_view field.
2044 (class Sized_relobj_file): Update declarations.
2045 * testsuite/initpri3.c: New test.
2046 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2048 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2049 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2050 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2051 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2052 * testsuite/Makefile.in: Rebuild.
2054 2011-06-24 Cary Coutant <ccoutant@google.com>
2056 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2057 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2058 (debug_msg_cdebug.err): New targets.
2059 * testsuite/Makefile.in: Regenerate.
2060 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2061 Fix checks for link with shared library.
2063 2011-06-24 Doug Kwan <dougkwan@google.com>
2065 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2066 skip empty text sections.
2067 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2069 2011-06-22 Ian Lance Taylor <iant@google.com>
2072 * options.h (class General_options): Add --ctors-in-init-array.
2073 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2074 friends as SHT_PROGBITS for merging sections.
2075 (Layout::layout): Remove special handling of .init_array and
2076 friends. Don't sort if doing relocatable link. Sort for .ctors
2077 and .dtors if ctors_in_init_array.
2078 (Layout::make_output_section): Force correct section types for
2079 .init_array and friends. Don't sort if doing relocatable link,
2080 Don't sort .ctors and .dtors if ctors_in_init_array.
2081 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2082 (Layout::output_section_name): Add relobj parameter. Change all
2083 callers. Handle .ctors. and .dtors. in code rather than table.
2084 Handle .ctors and .dtors if ctors_in_init_array.
2085 (Layout::match_file_name): New function, moved from output.cc.
2086 * layout.h (class Layout): Update declarations.
2087 * output.cc: Include "layout.h".
2088 (Input_section_sort_entry::get_priority): New function.
2089 (Input_section_sort_entry::match_file_name): Just call
2090 Layout::match_file_name.
2091 (Output_section::Input_section_sort_init_fini_compare::operator()):
2092 Handle .ctors and .dtors. Sort by explicit priority rather than
2094 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2095 * testsuite/initpri2.c: New test.
2096 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2097 (check_PROGRAMS): Add initpri2.
2098 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2099 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2100 * configure, testsuite/Makefile.in: Rebuild.
2102 2011-06-19 Ian Lance Taylor <iant@google.com>
2105 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2106 .interp section to a PT_INTERP segment even if we have seen a
2107 --dynamic-linker option. Don't do it if we have seen a PHDRS
2108 clause in a linker script.
2109 (Layout::finalize): Don't create a .interp section if we've
2110 already create a PT_INTERP segment.
2111 (Layout::create_interp): Always call choose_output_section (revert
2112 patch of 2011-06-17). Don't create PT_INTERP segment.
2113 * script-sections.cc
2114 (Script_sections::create_note_and_tls_segments): Add a .interp
2115 section to a PT_INTERP segment even if we have seen a
2116 --dynamic-linker option.
2118 2011-06-18 Ian Lance Taylor <iant@google.com>
2120 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2121 merely because a non-PT_LOAD segment has a dynamic reloc.
2123 2011-06-18 Ian Lance Taylor <iant@google.com>
2125 * layout.cc (Layout::finish_dynamic_section): Don't create
2126 DT_FLAGS entry if not needed.
2128 2011-06-18 Ian Lance Taylor <iant@google.com>
2131 * layout.cc (Layout::layout_eh_frame): Correct handling of
2132 writable .eh_frame section.
2134 2011-06-17 Ian Lance Taylor <iant@google.com>
2137 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2138 symbol is redefined with the exact same object and value.
2140 2011-06-17 Ian Lance Taylor <iant@google.com>
2143 * layout.h (class Layout): Add interp_segment_ field.
2144 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2145 (Layout::attach_allocated_section_to_segment): If making shared
2146 library, put .interp section in PT_INTERP segment.
2147 (Layout::finalize): Also call create_interp if -dynamic-linker
2149 (Layout::create_interp): Assert that there is no PT_INTERP
2150 segment. If not using a SECTIONS clause, use make_output_section.
2151 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2152 * script-sections.cc
2153 (Script_sections::create_note_and_tls_segments): If making shared
2154 library, put .interp section in PT_INTERP segment.
2156 2011-06-17 Ian Lance Taylor <iant@google.com>
2158 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2159 when making a shared library.
2161 2011-06-17 Ian Lance Taylor <iant@google.com>
2163 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2164 parameter. Change all callers. Don't issue warning about PC32
2165 against locally defined symbol.
2167 2011-06-16 Ian Lance Taylor <iant@google.com>
2169 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2170 occurs in same object.
2172 2011-06-14 Alan Modra <amodra@gmail.com>
2174 * po/POTFILES.in: Regenerate.
2176 2011-06-09 Ian Lance Taylor <iant@google.com>
2178 * script-sections.cc
2179 (Orphan_output_section::set_section_addresses): For a relocatable
2180 link set address to 0.
2182 2011-06-09 Cary Coutant <ccoutant@google.com>
2185 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2186 used with --compress-debug-sections.
2187 * gold/object.cc (Sized_relobj_file::do_layout): Report
2188 uncompressed size of compressed input sections.
2190 2011-06-08 Cary Coutant <ccoutant@google.com>
2193 * testsuite/two_file_test_2_v1.cc: Change initialization of
2194 v2 to keep it in .data.
2196 2011-06-07 Cary Coutant <ccoutant@google.com>
2198 * common.cc (Symbol_table::do_allocate_commons_list): Call
2200 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2201 (Errors::fallback): New function.
2202 (gold_fallback): New function.
2203 * errors.h (Errors::fallback): New function.
2204 * gold.cc (gold_exit): Change status parameter to enum; adjust
2206 (queue_initial_tasks): Call gold_fallback.
2207 * gold.h: Include cstdlib.
2208 (Exit_status): New enum type.
2209 (gold_exit): Change status parameter to enum.
2210 (gold_fallback): New function.
2211 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2212 (Layout::create_symtab_sections): Likewise.
2213 (Layout::create_shdrs): Likewise.
2214 * main.cc (main): Adjust call to gold_exit.
2215 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2216 (Output_data_got::add_got_entry_pair): Likewise.
2217 (Output_section::add_input_section): Likewise.
2218 (Output_section::add_output_section_data): Likewise.
2219 (Output_segment::set_section_list_addresses): Likewise.
2220 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2222 2011-06-07 Cary Coutant <ccoutant@google.com>
2224 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2225 for incremental links.
2226 * output.cc (Output_segment::set_section_list_addresses): Remove
2227 FIXME and test for TLS or BSS.
2229 2011-06-07 Cary Coutant <ccoutant@google.com>
2231 * testsuite/Makefile.am: Add incremental_copy_test,
2232 incremental_common_test_1.
2233 * testsuite/Makefile.in: Regenerate.
2234 * testsuite/common_test_1_v1.c: New source file.
2235 * testsuite/common_test_1_v2.c: New source file.
2236 * testsuite/copy_test_v1.cc: New source file.
2238 2011-06-07 Cary Coutant <ccoutant@google.com>
2240 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2241 update, allocate common from bss section's free list.
2242 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2243 linker-defined symbols.
2244 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2245 Skip GOT and PLT entries that are no longer referenced.
2246 (Output_section_incremental_inputs::write_info_blocks): Mark
2247 linker-defined symbols.
2248 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2249 * output.cc (Output_section::allocate): New function.
2250 * output.h (Output_section::allocate): New function.
2251 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2252 linker-defined symbols.
2253 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2254 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2255 (Symbol::init_base_output_data): Likewise.
2256 (Symbol::init_base_output_segment): Likewise.
2257 (Symbol::init_base_constant): Likewise.
2258 (Sized_symbol::init_output_data): Likewise.
2259 (Sized_symbol::init_output_segment): Likewise.
2260 (Sized_symbol::init_constant): Likewise.
2261 (Symbol_table::do_define_in_output_data): Likewise.
2262 (Symbol_table::do_define_in_output_segment): Likewise.
2263 (Symbol_table::do_define_as_constant): Likewise.
2264 * symtab.h (Symbol::is_predefined): New function.
2265 (Symbol::init_base_output_data): Add is_predefined parameter.
2266 (Symbol::init_base_output_segment): Likewise.
2267 (Symbol::init_base_constant): Likewise.
2268 (Symbol::is_predefined_): New data member.
2269 (Sized_symbol::init_output_data): Add is_predefined parameter.
2270 (Sized_symbol::init_output_segment): Likewise.
2271 (Sized_symbol::init_constant): Likewise.
2272 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2274 2011-06-07 Cary Coutant <ccoutant@google.com>
2276 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2277 instead of emit_copy_reloc.
2278 (Copy_relocs::emit_copy_reloc): Refactor.
2279 (Copy_relocs::make_copy_reloc): New function.
2280 (Copy_relocs::add_copy_reloc): Remove.
2281 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2283 (Copy_relocs::make_copy_reloc): New function.
2284 (Copy_relocs::add_copy_reloc): Remove.
2285 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2286 unchanged input files.
2287 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2288 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2289 Reserve BSS space for COPY relocations.
2290 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2291 (Output_section_incremental_inputs::write_info_blocks): Record
2292 whether a symbol is copied from a shared object.
2293 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2294 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2295 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2296 (Incremental_input_entry_reader::get_output_symbol_index): Add
2298 (Incremental_binary::emit_copy_relocs): New function.
2299 (Incremental_binary::do_emit_copy_relocs): New function.
2300 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2302 (Sized_incremental_binary::add_copy_reloc): New function.
2303 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2304 (Sized_incremental_binary::Copy_reloc): New struct.
2305 (Sized_incremental_binary::Copy_relocs): New typedef.
2306 (Sized_incremental_binary::copy_relocs_): New data member.
2307 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2308 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2309 * target.h (Sized_target::emit_copy_reloc): New function.
2310 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2312 2011-06-02 Cary Coutant <ccoutant@google.com>
2315 * gold/archive.cc (Archive::Archive): Initialize new data member.
2316 (Archive::include_all_members): Return if archive has already been
2318 * gold/archive.h (Archive::include_all_members_): New data member.
2320 2011-06-02 Nick Clifton <nickc@redhat.com>
2322 * dynobj.h: Fix spelling mistake in comment.
2323 * output.cc: Likewise.
2325 2011-05-31 Doug Kwan <dougkwan@google.com>
2329 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2330 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2331 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2332 redundant arm_exidx_test.so.
2333 * testsuite/Makefile.in: Regenerate.
2334 (check_SCRIPTS): Add pr12826.sh
2335 (check_DATA): Add pr12826.stdout
2336 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2337 * testsuite/pr12826.sh: New file.
2338 * testsuite/pr12826_1.s: Ditto.
2339 * testsuite/pr12826_1.s: Ditto.
2341 2011-05-30 Ian Lance Taylor <iant@google.com>
2343 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2346 2011-05-29 Ian Lance Taylor <iant@google.com>
2349 * testsuite/Makefile.am: Use different file name for two_file_test
2350 temporary file for each incremental test.
2351 * testsuite/Makefile.in: Rebuild.
2353 2011-05-29 Ian Lance Taylor <iant@google.com>
2355 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2356 binary input file is empty.
2358 2011-05-27 Ian Lance Taylor <iant@google.com>
2360 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2361 (ver_test_9.so): Likewise.
2362 * testsuite/Makefile.in: Rebuild.
2364 2011-05-26 Cary Coutant <ccoutant@google.com>
2366 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2367 * incremental.cc (Incremental_inputs::report_input_section): Fix
2368 comment, indentation.
2369 (Incremental_inputs::report_comdat_group): New function.
2370 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2371 of data for incremental input file entry.
2372 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2373 group count, COMDAT group signatures.
2374 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2375 an unchanged input file.
2376 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2377 Initialize new data member.
2378 (Incremental_object_entry::add_comdat_group): New function.
2379 (Incremental_object_entry::get_comdat_group_count): New function.
2380 (Incremental_object_entry::get_comdat_signature_key): New function.
2381 (Incremental_object_entry::groups_): New data member.
2382 (Incremental_inputs::report_comdat_group): New function.
2383 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2384 data for incremental input file entry.
2385 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2386 (Incremental_input_entry_reader::get_input_section): Adjust size of
2387 data for incremental input file entry.
2388 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2389 (Incremental_input_entry_reader::get_comdat_group_signature): New
2391 * object.cc (Sized_relobj::include_section_group): Report kept
2392 COMDAT groups for incremental links.
2394 2011-05-24 David Meyer <pdox@google.com>
2396 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2397 with name parameter. Add found_name parameter.
2398 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2399 * dirsearch.h (class Dirsearch): Update declaration.
2401 2011-05-24 Ian Lance Taylor <iant@google.com>
2403 * archive.cc (Library_base::should_include_member): Pull in object
2404 from archive if it defines the entry symbol.
2405 * parameters.cc (Parameters::entry): New function.
2406 * parameters.h (class Parameters): Declare entry.
2407 * output.h (class Output_file_header): Remove entry_ field.
2408 * output.cc (Output_file_header::Output_file_header): Remove entry
2409 parameter. Change all callers.
2410 (Output_file_header::entry): Use parameters->entry.
2411 * gold.cc (queue_middle_tasks): Likewise.
2412 * plugin.cc (Plugin_hook::run): Likewise.
2414 2011-05-24 Cary Coutant <ccoutant@google.com>
2416 * gold.cc (queue_initial_tasks): Pass incremental base filename
2417 to Output_file::open_base_file; don't print error message.
2418 * incremental-dump.cc (main): Adjust call to
2419 Output_file::open_for_modification.
2420 * incremental-dump.cc (main): Likewise.
2421 * incremental.cc (Incremental_inputs::report_command_line):
2422 Ignore --incremental-base option when comparing command lines.
2423 Ignore parameter when given as separate argument.
2424 * options.h (class General_options): Add --incremental-base.
2425 * output.cc (Output_file::Output_file):
2426 (Output_file::open_base_file): Add base_name and writable parameters;
2427 read base file into new file; print error message here.
2428 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2430 * output.h (Output_file::open_for_modification): Rename to...
2431 (Output_file::open_base_file): ...this; add base_name and
2432 writable parameters; adjust all callers.
2433 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2435 * testsuite/Makefile.am (incremental_test_4): Test
2437 * testsuite/Makefile.in: Regenerate.
2439 2011-05-24 Cary Coutant <ccoutant@google.com>
2441 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2443 * testsuite/Makefile.in: Regenerate.
2444 * testsuite/two_file_test_1_v1.cc: New test source file.
2445 * testsuite/two_file_test_1b_v1.cc: New test source file.
2446 * testsuite/two_file_test_2_v1.cc: New test source file.
2448 2011-05-24 Cary Coutant <ccoutant@google.com>
2450 * dynobj.h (Dynobj::do_dynobj): New function.
2451 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2452 flag and soname for shared objects.
2453 * incremental.cc (Incremental_inputs::report_object): Make
2454 either Incremental_object_entry or Incremental_dynobj_entry; add
2455 soname to string table.
2456 (Incremental_inputs::report_input_section): Add assertion.
2457 (Output_section_incremental_inputs::set_final_data_size): Adjust
2458 type of input file entry for shared libraries; adjust size of
2459 shared library info entry.
2460 (Output_section_incremental_inputs::write_input_files): Write
2461 as_needed flag for shared libraries.
2462 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2463 of input file entry for shared libraries; write soname.
2464 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2465 soname from incremental info.
2466 * incremental.h (enum Incremental_input_flags): Add
2467 INCREMENTAL_INPUT_AS_NEEDED.
2468 (Incremental_input_entry::Incremental_input_entry): Initialize new
2470 (Incremental_input_entry::set_as_needed): New function.
2471 (Incremental_input_entry::as_needed): New function.
2472 (Incremental_input_entry::do_dynobj_entry): New function.
2473 (Incremental_input_entry::as_needed_): New data member.
2474 (Incremental_object_entry::Incremental_object_entry): Don't check
2476 (Incremental_object_entry::do_type): Likewise.
2477 (class Incremental_dynobj_entry): New class.
2478 (Incremental_input_entry_reader::as_needed): New function.
2479 (Incremental_input_entry_reader::get_soname): New function.
2480 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2481 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2482 size of shared library info entry.
2483 * layout.cc (Layout::finish_dynamic_section): Don't test for
2484 incremental link when adding DT_NEEDED entries.
2485 * object.h (Object::Object): Initialize new data member.
2486 (Object::dynobj): New function.
2487 (Object::set_as_needed): New function.
2488 (Object::as_needed): New function.
2489 (Object::do_dynobj): New function.
2490 (Object::as_needed_): New data member.
2492 2011-05-24 Cary Coutant <ccoutant@google.com>
2494 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2495 info; adjust display of GOT entries.
2496 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2497 vector of input objects; remove file_status_.
2498 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2499 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2500 got_plt reader; call target hooks to reserve GOT entries.
2501 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2502 of input file info header and GOT info entry.
2503 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2505 (Got_plt_view_info::got_descriptor): Remove.
2506 (Got_plt_view_info::sym_index): New data member.
2507 (Got_plt_view_info::input_index): New data member.
2508 (Local_got_offset_visitor::visit): Write input file index.
2509 (Global_got_offset_visitor::visit): Write 0 for input file index.
2510 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2511 with sym_index and input_index.
2512 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2513 incremental info GOT entry; replace got_descriptor with input_index.
2514 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2515 map from input file index to object.
2516 (Sized_relobj_incr::do_layout): Replace direct data member reference
2517 with accessor function.
2518 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2519 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2520 Adjust size of input file info header.
2521 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2522 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2523 (Incremental_input_entry_reader::get_input_section): Adjust size of
2524 input file info header.
2525 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2526 of incremental info GOT entry.
2527 (Incremental_got_plt_reader::get_got_desc): Remove.
2528 (Incremental_got_plt_reader::get_got_symndx): New function.
2529 (Incremental_got_plt_reader::get_got_input_index): New function.
2530 (Sized_incremental_binary::Sized_incremental_binary): Remove
2531 file_status_; add input_objects_.
2532 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2533 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2534 (Sized_incremental_binary::file_is_unchanged): Remove.
2535 (Sized_incremental_binary::set_input_object): New function.
2536 (Sized_incremental_binary::input_object): New function.
2537 (Sized_incremental_binary::file_status_): Remove.
2538 (Sized_incremental_binary::input_objects_): New data member.
2539 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2541 (Sized_relobj_incr::invalid_address): Move to base class.
2542 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2544 (Sized_relobj_incr::do_output_section_offset): Likewise.
2545 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2546 (Sized_relobj_incr::section_offsets_): Likewise.
2547 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2549 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2550 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2551 with accessor function.
2552 (Sized_relobj_file::do_layout): Likewise.
2553 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2554 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2555 (Sized_relobj_file::compute_final_local_value): Replace refs to
2556 section_offsets_ with accessor function.
2557 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2558 * object.h (Relobj::Relobj): Initialize new data members.
2559 (Relobj::add_dyn_reloc): New function.
2560 (Relobj::first_dyn_reloc): New function.
2561 (Relobj::dyn_reloc_count): New function.
2562 (Relobj::first_dyn_reloc_): New data member.
2563 (Relobj::dyn_reloc_count_): New data member.
2564 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2566 (Sized_relobj::Address): New typedef.
2567 (Sized_relobj::invalid_address): Move here from child class.
2568 (Sized_relobj::Sized_relobj): Initialize new data members.
2569 (Sized_relobj::sized_relobj): New function.
2570 (Sized_relobj::is_output_section_offset_invalid): Move here from
2572 (Sized_relobj::get_output_section_offset): Likewise.
2573 (Sized_relobj::local_has_got_offset): Likewise.
2574 (Sized_relobj::local_got_offset): Likewise.
2575 (Sized_relobj::set_local_got_offset): Likewise.
2576 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2577 (Sized_relobj::clear_got_offsets): New function.
2578 (Sized_relobj::section_offsets): Move here from child class.
2579 (Sized_relobj::do_output_section_offset): Likewise.
2580 (Sized_relobj::do_set_section_offset): Likewise.
2581 (Sized_relobj::Local_got_offsets): Likewise.
2582 (Sized_relobj::local_got_offsets_): Likewise.
2583 (Sized_relobj::section_offsets_): Likewise.
2584 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2586 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2588 (Sized_relobj_file::sized_relobj): New function
2589 (Sized_relobj_file::local_has_got_offset): Move to base class.
2590 (Sized_relobj_file::local_got_offset): Likewise.
2591 (Sized_relobj_file::set_local_got_offset): Likewise.
2592 (Sized_relobj_file::get_output_section_offset): Likewise.
2593 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2594 (Sized_relobj_file::do_output_section_offset): Likewise.
2595 (Sized_relobj_file::do_set_section_offset): Likewise.
2596 (Sized_relobj_file::Local_got_offsets): Likewise.
2597 (Sized_relobj_file::local_got_offsets_): Likewise.
2598 (Sized_relobj_file::section_offsets_): Likewise.
2599 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2601 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2602 (Output_reloc::get_symbol_index): Likewise.
2603 (Output_reloc::local_section_offset): Likewise.
2604 (Output_reloc::get_address): Likewise.
2605 (Output_reloc::symbol_value): Likewise.
2606 (Output_data_got::reserve_slot): Move to class definition.
2607 (Output_data_got::reserve_local): New function.
2608 (Output_data_got::reserve_slot_for_global): Remove.
2609 (Output_data_got::reserve_global): New function.
2610 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2611 (all constructors, two instantiations).
2612 (Output_reloc::get_relobj): New function (two instantiations).
2613 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2614 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2615 (Output_data_reloc::add_global): Adjust type of relobj.
2616 (Output_data_reloc::add_global_relative): Likewise.
2617 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2618 (Output_data_reloc::add_local): Likewise.
2619 (Output_data_reloc::add_local_relative): Likewise.
2620 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2621 (Output_data_reloc::add_local_section): Likewise.
2622 (Output_data_reloc::add_output_section): Likewise.
2623 (Output_data_reloc::add_absolute): Likewise.
2624 (Output_data_reloc::add_target_specific): Likewise.
2625 (Output_data_got::reserve_slot): Move definition here.
2626 (Output_data_got::reserve_local): New function.
2627 (Output_data_got::reserve_global): New function.
2628 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2629 section_offsets_ with accessor function.
2630 (Sized_relobj_file::write_sections): Likewise.
2631 (Sized_relobj_file::do_relocate_sections): Likewise.
2632 * target.h (Sized_target::reserve_local_got_entry): New function.
2633 (Sized_target::reserve_global_got_entry): New function.
2634 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2635 (Target_x86_64::reserve_global_got_entry): New function.
2636 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2638 2011-05-23 Cary Coutant <ccoutant@google.com>
2640 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2641 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2642 bit when checking got_type.
2643 * incremental.cc (Sized_incremental_binary::setup_readers):
2644 Store symbol table and string table locations; initialize bit vector
2645 of file status flags.
2646 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2648 (Sized_incremental_binary::do_process_got_plt): New function.
2649 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2650 (Output_section_incremental_inputs::set_final_data_size): Record
2651 file index for each input file.
2652 (Output_section_incremental_inputs::write_got_plt): Store file index
2653 instead of input entry offset for each GOT entry.
2655 (Incremental_input_entry::Incremental_input_entry): Initialize new
2657 (Incremental_input_entry::set_offset): Store file index.
2658 (Incremental_input_entry::get_file_index): New function.
2659 (Incremental_input_entry::file_index_): New data member.
2660 (Incremental_binary::process_got_plt): New function.
2661 (Incremental_binary::do_process_got_plt): New function.
2662 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2664 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2665 (Sized_incremental_binary::set_file_is_unchanged): New function.
2666 (Sized_incremental_binary::file_is_unchanged): New function.
2667 (Sized_incremental_binary::do_process_got_plt): New function.
2668 (Sized_incremental_binary::file_status_): New data member.
2669 (Sized_incremental_binary::main_symtab_loc_): New data member.
2670 (Sized_incremental_binary::main_strtab_loc_): New data member.
2671 * output.cc (Output_data_got::Got_entry::write): Add case
2673 (Output_data_got::add_global): Call add_got_entry.
2674 (Output_data_got::add_global_plt): Likewise.
2675 (Output_data_got::add_global_with_rel): Likewise.
2676 (Output_data_got::add_global_with_rela): Likewise.
2677 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2678 (Output_data_got::add_global_pair_with_rela): Likewise.
2679 (Output_data_got::add_local): Call add_got_entry.
2680 (Output_data_got::add_local_plt): Likewise.
2681 (Output_data_got::add_local_with_rel): Likewise.
2682 (Output_data_got::add_local_with_rela): Likewise.
2683 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2684 (Output_data_got::add_local_pair_with_rela): Likewise.
2685 (Output_data_got::reserve_slot): New function.
2686 (Output_data_got::reserve_slot_for_global): New function.
2687 (Output_data_got::add_got_entry): New function.
2688 (Output_data_got::add_got_entry_pair): New function.
2689 (Output_section::add_output_section_data): Edit FIXME.
2691 (Output_section_data_build::Output_section_data_build): New
2692 constructor with size parameter.
2693 (Output_data_space::Output_data_space): Likewise.
2694 (Output_data_got::Output_data_got): Initialize new data member; new
2695 constructor with size parameter.
2696 (Output_data_got::add_constant): Call add_got_entry.
2697 (Output_data_got::reserve_slot): New function.
2698 (Output_data_got::reserve_slot_for_global): New function.
2699 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2700 (Output_data_got::add_got_entry): New function.
2701 (Output_data_got::add_got_entry_pair): New function.
2702 (Output_data_got::free_list_): New data member.
2703 * target.h (Sized_target::init_got_plt_for_update): New function.
2704 (Sized_target::register_global_plt_entry): New function.
2705 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2706 Initialize new data member; call init; add constructor with PLT count.
2707 (Output_data_plt_x86_64::init): New function.
2708 (Output_data_plt_x86_64::add_relocation): New function.
2709 (Output_data_plt_x86_64::reserve_slot): New function.
2710 (Output_data_plt_x86_64::free_list_): New data member.
2711 (Target_x86_64::init_got_plt_for_update): New function.
2712 (Target_x86_64::register_global_plt_entry): New function.
2713 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2714 incremental updates.
2715 (Output_data_plt_x86_64::add_relocation): New function.
2716 * testsuite/object_unittest.cc (Object_test): Set default options.
2718 2011-05-16 Ian Lance Taylor <iant@google.com>
2720 * options.h (class General_options): Make -i a synonym for -r.
2722 2011-05-16 Ian Lance Taylor <iant@google.com>
2724 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2726 2011-05-10 Cary Coutant <ccoutant@google.com>
2728 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2731 2011-05-06 Ian Lance Taylor <iant@google.com>
2733 * layout.cc (Layout::layout): If the output section flags change,
2734 update the ordering.
2736 2011-04-25 Cary Coutant <ccoutant@google.com>
2738 * incremental-dump.cc (dump_incremental_inputs): Print local
2739 symbol info for each input file.
2741 (Output_section_incremental_inputs::set_final_data_size): Add local
2742 symbol info to input file entries in incremental info.
2743 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2744 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2745 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2746 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2748 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2749 (Sized_incr_relobj::do_relocate): Write the local symbols.
2750 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2751 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2752 Adjust size of input file header.
2753 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2754 (Incremental_inputs_reader::get_local_symbol_count): New function.
2755 (Incremental_inputs_reader::get_input_section): Adjust size of input
2757 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2758 (Sized_incr_relobj::This): New typedef.
2759 (Sized_incr_relobj::sym_size): New const data member.
2760 (Sized_incr_relobj::Local_symbol): New struct.
2761 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2762 (Sized_incr_relobj::do_local_symbol_offset): New function.
2763 (Sized_incr_relobj::local_symbol_count_): New data member.
2764 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2765 (Sized_incr_relobj::local_symbol_index_): New data member.
2766 (Sized_incr_relobj::local_symbol_offset_): New data member.
2767 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2768 (Sized_incr_relobj::local_symbols_): New data member.
2769 * object.h (Relobj::output_local_symbol_count): New function.
2770 (Relobj::local_symbol_offset): New function.
2771 (Relobj::do_output_local_symbol_count): New function.
2772 (Relobj::do_local_symbol_offset): New function.
2773 (Sized_relobj::do_output_local_symbol_count): New function.
2774 (Sized_relobj::do_local_symbol_offset): New function.
2776 2011-04-22 Vladimir Simonov <sv@sw.ru>
2778 * descriptors.cc (set_close_on_exec): New function.
2779 (Descriptors::open): Use set_close_on_exec.
2780 * output.cc (S_ISLNK): Define if not defined.
2782 2011-04-22 Cary Coutant <ccoutant@google.com>
2784 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2786 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2787 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2788 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2790 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2791 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2792 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2794 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2796 (Incremental_binary::apply_incremental_relocs): New function.
2797 (Incremental_binary::do_apply_incremental_relocs): New function.
2798 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2800 (Sized_incremental_binary::add_global_symbol): New function.
2801 (Sized_incremental_binary::global_symbol): New function.
2802 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2803 (Sized_incremental_binary::symbol_map_): New data member.
2804 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2805 * target.h (Sized_target::apply_relocation): New function.
2806 * target-reloc.h (apply_relocation): New function.
2807 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2809 2011-04-22 Doug Kwan <dougkwan@google.com>
2811 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2812 flag of a SHT_ARM_EXIDX section.
2813 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2814 * testsuite/Makefile.in: Regenerate.
2815 * testsuite/arm_exidx_test.s: New file.
2816 * testsuite/arm_exidx_test.sh: Same.
2818 2011-04-20 Cary Coutant <ccoutant@google.com>
2821 * archive.h (Incremental_archive_entry::Archive_member):
2822 Initialize arg_serial_ (second constructor).
2824 2011-04-17 Ian Lance Taylor <iant@google.com>
2826 * object.cc (Relocate_info::location): Simplify location string.
2827 * errors.cc (Errors::error_at_location): Don't print program
2829 (Errors::warning_at_location): Likewise.
2830 (Errors::undefined_symbol): Likewise.
2831 * testsuite/debug_msg.sh: Update accordingly.
2833 2011-04-14 Cary Coutant <ccoutant@google.com>
2835 * gold/layout.cc (Layout::symtab_section_offset): New function.
2836 * gold/layout.h (Layout::symtab_section_offset): New function.
2837 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2839 2011-04-12 Ian Lance Taylor <iant@google.com>
2841 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2842 with MREMAP_MAYMOVE.
2843 * output.h (class Output_file): Add map_is_allocated_ field.
2844 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2845 not available, provide stubs. If mremap is not available, #define
2847 (MREMAP_MAYMOVE): Define if not defined.
2848 (Output_file::Output_file): Initialize map_is_allocated_.
2849 (Output_file::resize): Check map_is_allocated_.
2850 (Output_file::map_anonymous): If mmap fails, use malloc.
2851 (Output_file::unmap): Don't do anything for an anonymous map.
2852 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2853 is not available, provide stubs.
2854 (File_read::View::~View): Use free rather than delete[].
2855 (File_read::make_view): Use malloc rather than new[]. If mmap
2857 (File_read::find_or_make_view): Use malloc rather than new[].
2858 * gold.h: Remove HAVE_REMAP code.
2859 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2860 exists. Rename mremap to gold_mremap. If mmap is not available
2862 * configure, config.in: Rebuild.
2864 2011-04-11 Ian Lance Taylor <iant@google.com>
2866 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2867 initialize local variable v.
2869 2011-04-11 Cary Coutant <ccoutant@google.com>
2871 * archive.cc (Archive::include_member): Adjust call to
2873 (Add_archive_symbols::run): Track argument serial numbers.
2874 (Lib_group::include_member): Likewise.
2875 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2876 * archive.h (Incremental_archive_entry::Archive_member):
2877 Initialize arg_serial_.
2878 (Archive_member::arg_serial_): New data member.
2879 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2880 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2882 (Sized_dynobj::do_for_all_local_got_entries): New function.
2883 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2885 * fileread.cc (get_mtime): New function.
2886 * fileread.h (get_mtime): New function.
2887 * gold.cc (queue_initial_tasks): Check for incremental update.
2888 (process_incremental_input): New function.
2889 (queue_middle_tasks): Don't force valid target for incremental
2891 * incremental-dump.cc (find_input_containing_global): Adjust
2892 size of symbol info entry.
2893 (dump_incremental_inputs): Dump argument serial number and
2894 in_system_directory flag; bias shndx by 1; print symbol names
2895 when dumping per-file symbol lists; use new symbol info readers.
2897 (Output_section_incremental_inputs:update_data_size): New function.
2898 (Sized_incremental_binary::setup_readers): Setup input readers
2899 for each input file; build maps for files added from libraries
2901 (Sized_incremental_binary::check_input_args): New function.
2902 (Sized_incremental_binary::do_check_inputs): Build map of argument
2903 serial numbers to input arguments.
2904 (Sized_incremental_binary::do_file_has_changed): Rename
2905 do_file_is_unchanged to this; compare file modification times.
2906 (Sized_incremental_binary::do_init_layout): New function.
2907 (Sized_incremental_binary::do_reserve_layout): New function.
2908 (Sized_incremental_binary::do_get_input_reader): Remove.
2909 (Sized_incremental_binary::get_symtab_view): New function.
2910 (Incremental_checker::can_incrementally_link_output_file): Remove.
2911 (Incremental_inputs::report_command_line): Exclude --debug options.
2912 (Incremental_inputs::report_archive_begin): Add parameter; track
2913 argument serial numbers; don't put input file entry for archive
2914 before archive members.
2915 (Incremental_inputs::report_archive_end): Put input file entry
2916 for archive after archive members.
2917 (Incremental_inputs::report_object): Add parameter; track argument
2918 serial numbers and in_system_directory flag.
2919 (Incremental_inputs::report_script): Add parameter; track argument
2921 (Output_section_incremental_inputs::set_final_data_size): Adjust
2922 size of symbol info entry; check for forwarding symbols.
2923 (Output_section_incremental_inputs::write_input_files): Write
2924 in_system_directory flag and argument serial number.
2925 (Output_section_incremental_inputs::write_info_blocks): Map section
2926 indices between incremental info and original input file; store
2927 input section index for each symbol.
2928 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2929 change operator() to visit().
2930 (class Global_got_offset_visitor): Likewise.
2931 (class Global_symbol_visitor_got_plt):
2932 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2934 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2935 (Sized_incr_relobj::do_read_symbols): New function.
2936 (Sized_incr_relobj::do_layout): New function.
2937 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2938 (Sized_incr_relobj::do_add_symbols): New function.
2939 (Sized_incr_relobj::do_should_include_member): New function.
2940 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2941 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2942 (Sized_incr_relobj::do_section_size): New function.
2943 (Sized_incr_relobj::do_section_name): New function.
2944 (Sized_incr_relobj::do_section_contents): New function.
2945 (Sized_incr_relobj::do_section_flags): New function.
2946 (Sized_incr_relobj::do_section_entsize): New function.
2947 (Sized_incr_relobj::do_section_address): New function.
2948 (Sized_incr_relobj::do_section_type): New function.
2949 (Sized_incr_relobj::do_section_link): New function.
2950 (Sized_incr_relobj::do_section_info): New function.
2951 (Sized_incr_relobj::do_section_addralign): New function.
2952 (Sized_incr_relobj::do_initialize_xindex): New function.
2953 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2954 (Sized_incr_relobj::do_read_relocs): New function.
2955 (Sized_incr_relobj::do_gc_process_relocs): New function.
2956 (Sized_incr_relobj::do_scan_relocs): New function.
2957 (Sized_incr_relobj::do_count_local_symbols): New function.
2958 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2959 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2960 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2961 (Sized_incr_relobj::do_relocate): New function.
2962 (Sized_incr_relobj::do_set_section_offset): New function.
2963 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2964 (Sized_incr_dynobj::do_read_symbols): New function.
2965 (Sized_incr_dynobj::do_layout): New function.
2966 (Sized_incr_dynobj::do_add_symbols): New function.
2967 (Sized_incr_dynobj::do_should_include_member): New function.
2968 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2969 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2970 (Sized_incr_dynobj::do_section_size): New function.
2971 (Sized_incr_dynobj::do_section_name): New function.
2972 (Sized_incr_dynobj::do_section_contents): New function.
2973 (Sized_incr_dynobj::do_section_flags): New function.
2974 (Sized_incr_dynobj::do_section_entsize): New function.
2975 (Sized_incr_dynobj::do_section_address): New function.
2976 (Sized_incr_dynobj::do_section_type): New function.
2977 (Sized_incr_dynobj::do_section_link): New function.
2978 (Sized_incr_dynobj::do_section_info): New function.
2979 (Sized_incr_dynobj::do_section_addralign): New function.
2980 (Sized_incr_dynobj::do_initialize_xindex): New function.
2981 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2982 (make_sized_incremental_object): New function.
2983 (Incremental_library::copy_unused_symbols): New function.
2984 (Incremental_library::do_for_all_unused_symbols): New function.
2985 * incremental.h (enum Incremental_input_flags): New type.
2986 (class Incremental_checker): Remove.
2987 (Incremental_input_entry::Incremental_input_entry): Add argument
2989 (Incremental_input_entry::arg_serial): New function.
2990 (Incremental_input_entry::set_is_in_system_directory): New function.
2991 (Incremental_input_entry::is_in_system_directory): New function.
2992 (Incremental_input_entry::arg_serial_): New data member.
2993 (Incremental_input_entry::is_in_system_directory_): New data member.
2994 (class Script_info): Move here from script.h.
2995 (Script_info::Script_info): Add filename parameter.
2996 (Script_info::filename): New function.
2997 (Script_info::filename_): New data member.
2998 (Incremental_script_entry::Incremental_script_entry): Add argument
3000 (Incremental_object_entry::Incremental_object_entry): Likewise.
3001 (Incremental_object_entry::add_input_section): Build list of input
3002 sections with map to original shndx.
3003 (Incremental_object_entry::get_input_section_index): New function.
3004 (Incremental_object_entry::shndx_): New data member.
3005 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3006 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3007 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3009 (Incremental_inputs::report_archive_begin): Likewise.
3010 (Incremental_inputs::report_object): Likewise.
3011 (Incremental_inputs::report_script): Likewise.
3012 (class Incremental_global_symbol_reader): New class.
3013 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3014 and store flags and input file type.
3015 (Incremental_input_entry_reader::arg_serial): New function.
3016 (Incremental_input_entry_reader::type): Extract type from flags.
3017 (Incremental_input_entry_reader::is_in_system_directory): New function.
3018 (Incremental_input_entry_reader::get_input_section_count): Call
3019 accessor function for type.
3020 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3021 function for type; adjust size of global symbol entry.
3022 (Incremental_input_entry_reader::get_global_symbol_count): Call
3023 accessor function for type.
3024 (Incremental_input_entry_reader::get_object_count): Likewise.
3025 (Incremental_input_entry_reader::get_object_offset): Likewise.
3026 (Incremental_input_entry_reader::get_member_count): Likewise.
3027 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3028 (Incremental_input_entry_reader::get_member_offset): Likewise.
3029 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3030 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3031 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3032 (Incremental_input_entry_reader::get_global_symbol_reader): New
3034 (Incremental_input_entry_reader::get_output_symbol_index): New
3036 (Incremental_input_entry_reader::type_): Remove.
3037 (Incremental_input_entry_reader::flags_): New data member.
3038 (Incremental_inputs_reader::input_file_offset): New function.
3039 (Incremental_inputs_reader::input_file_index): New function.
3040 (Incremental_inputs_reader::input_file): Call input_file_offset.
3041 (Incremental_inputs_reader::input_file_at_offset): New function.
3042 (Incremental_relocs_reader::get_r_type): Reformat.
3043 (Incremental_relocs_reader::get_r_shndx): Reformat.
3044 (Incremental_relocs_reader::get_r_offset): Reformat.
3045 (Incremental_relocs_reader::data): New function.
3046 (Incremental_binary::Incremental_binary): Initialize new data members.
3047 (Incremental_binary::check_inputs): Add cmdline parameter.
3048 (Incremental_binary::file_is_unchanged): Remove.
3049 (Input_reader::arg_serial): New function.
3050 (Input_reader::get_unused_symbol_count): New function.
3051 (Input_reader::get_unused_symbol): New function.
3052 (Input_reader::do_arg_serial): New function.
3053 (Input_reader::do_get_unused_symbol_count): New function.
3054 (Input_reader::do_get_unused_symbol): New function.
3055 (Incremental_binary::input_file_count): New function.
3056 (Incremental_binary::get_input_reader): Change signature to use
3057 index instead of filename.
3058 (Incremental_binary::file_has_changed): New function.
3059 (Incremental_binary::get_input_argument): New function.
3060 (Incremental_binary::get_library): New function.
3061 (Incremental_binary::get_script_info): New function.
3062 (Incremental_binary::init_layout): New function.
3063 (Incremental_binary::reserve_layout): New function.
3064 (Incremental_binary::output_file): New function.
3065 (Incremental_binary::do_check_inputs): New function.
3066 (Incremental_binary::do_file_is_unchanged): Remove.
3067 (Incremental_binary::do_file_has_changed): New function.
3068 (Incremental_binary::do_init_layout): New function.
3069 (Incremental_binary::do_reserve_layout): New function.
3070 (Incremental_binary::do_input_file_count): New function.
3071 (Incremental_binary::do_get_input_reader): Change signature.
3072 (Incremental_binary::input_args_map_): New data member.
3073 (Incremental_binary::library_map_): New data member.
3074 (Incremental_binary::script_map_): New data member.
3075 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3077 (Sized_incremental_binary::output_section): New function.
3078 (Sized_incremental_binary::inputs_reader): Add const.
3079 (Sized_incremental_binary::symtab_reader): Add const.
3080 (Sized_incremental_binary::relocs_reader): Add const.
3081 (Sized_incremental_binary::got_plt_reader): Add const.
3082 (Sized_incremental_binary::get_symtab_view): New function.
3083 (Sized_incremental_binary::Inputs_reader): New typedef.
3084 (Sized_incremental_binary::Input_entry_reader): New typedef.
3085 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3086 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3087 (Sized_incremental_binary::do_file_has_changed): New function.
3088 (Sized_incremental_binary::do_init_layout): New function.
3089 (Sized_incremental_binary::do_reserve_layout): New function.
3090 (Sized_input_reader::Inputs_reader): Remove.
3091 (Sized_input_reader::Input_entry_reader): Remove.
3092 (Sized_input_reader::do_arg_serial): New function.
3093 (Sized_input_reader::do_get_unused_symbol_count): New function.
3094 (Sized_input_reader::do_get_unused_symbol): New function.
3095 (Sized_incremental_binary::do_input_file_count): New function.
3096 (Sized_incremental_binary::do_get_input_reader): Change signature;
3097 use index instead of filename.
3098 (Sized_incremental_binary::section_map_): New data member.
3099 (Sized_incremental_binary::input_entry_readers_): New data member.
3100 (class Sized_incr_relobj): New class.
3101 (class Sized_incr_dynobj): New class.
3102 (make_sized_incremental_object): New function.
3103 (class Incremental_library): New class.
3104 * layout.cc (Free_list::num_lists): New static data member.
3105 (Free_list::num_nodes): New static data member.
3106 (Free_list::num_removes): New static data member.
3107 (Free_list::num_remove_visits): New static data member.
3108 (Free_list::num_allocates): New static data member.
3109 (Free_list::num_allocate_visits): New static data member.
3110 (Free_list::init): New function.
3111 (Free_list::remove): New function.
3112 (Free_list::allocate): New function.
3113 (Free_list::dump): New function.
3114 (Free_list::print_stats): New function.
3115 (Layout_task_runner::run): Resize output file for incremental updates.
3116 (Layout::Layout): Initialize new data members.
3117 (Layout::set_incremental_base): New function.
3118 (Layout::init_fixed_output_section): New function.
3119 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3120 incremental updates.
3121 (Layout::create_gold_note): Do not create gold note section for
3122 incremental updates.
3123 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3124 for incremental updates.
3125 (Layout::set_section_offsets): For incremental updates, allocate space
3127 (Layout::create_symtab_sections): Layout with offsets relative to
3128 start of section; for incremental updates, allocate space from free
3130 (Layout::create_shdrs): For incremental updates, allocate space from
3132 (Layout::finish_dynamic_section): For incremental updates, do not
3133 check --as-needed (fixed in subsequent patch).
3134 * layout.h (class Free_list): New class.
3135 (Layout::set_incremental_base): New function.
3136 (Layout::incremental_base): New function.
3137 (Layout::init_fixed_output_section): New function.
3138 (Layout::allocate): New function.
3139 (Layout::incremental_base_): New data member.
3140 (Layout::free_list_): New data member.
3141 * main.cc (main): Print Free_list statistics.
3142 * object.cc (Relobj::finalize_incremental_relocs): Add
3143 clear_counts parameter; clear counts only when clear_counts is set.
3144 (Sized_relobj::Sized_relobj): Initialize new base class.
3145 (Sized_relobj::do_layout): Don't report special sections.
3146 (Sized_relobj::do_for_all_local_got_entries): New function.
3147 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3148 symtab_off to all symbol table offsets.
3149 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3150 * object.h (class Got_offset_list): Move to top of file.
3151 (Object::Object): Allow case where input_file == NULL.
3152 (Object::~Object): Likewise.
3153 (Object::input_file): Assert that input_file != NULL.
3154 (Object::lock): Allow case where input_file == NULL.
3155 (Object::unlock): Likewise.
3156 (Object::is_locked): Likewise.
3157 (Object::token): Likewise.
3158 (Object::release): Likewise.
3159 (Object::is_incremental): New function.
3160 (Object::get_mtime): New function.
3161 (Object::for_all_local_got_entries): New function.
3162 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3163 (Object::set_is_in_system_directory): New function.
3164 (Object::is_in_system_directory): New function.
3165 (Object::do_is_incremental): New function.
3166 (Object::do_get_mtime): New function.
3167 (Object::do_for_all_local_got_entries): New function.
3168 (Object::is_in_system_directory_): New data member.
3169 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3170 (class Sized_relobj_base): New class.
3171 (class Sized_relobj): Derive from Sized_relobj_base.
3172 (class Sized_relobj::Symbols): Redeclare from base class.
3173 (class Sized_relobj::local_got_offset_list): Remove.
3174 (class Sized_relobj::Output_sections): Redeclare from base class.
3175 (class Sized_relobj::do_for_all_local_got_entries): New function.
3176 (class Sized_relobj::write_local_symbols): Add offset parameter.
3177 (class Sized_relobj::local_symbol_offset_): Update comment.
3178 (class Sized_relobj::local_dynsym_offset_): Update comment.
3179 * options.cc (Input_arguments::add_file): Remove const.
3180 * options.h (Input_file_argument::Input_file_argument):
3181 Initialize arg_serial_ (all constructors).
3182 (Input_file_argument::set_arg_serial): New function.
3183 (Input_file_argument::arg_serial): New function.
3184 (Input_file_argument::arg_serial_): New data member.
3185 (Input_arguments::Input_arguments): Initialize file_count_.
3186 (Input_arguments::add_file): Remove const.
3187 (Input_arguments::number_of_input_files): New function.
3188 (Input_arguments::file_count_): New data member.
3189 (Command_line::number_of_input_files): Call
3190 Input_arguments::number_of_input_files.
3191 * output.cc (Output_segment_headers::Output_segment_headers):
3193 (Output_section::Input_section::current_data_size): New function.
3194 (Output_section::Output_section): Initialize new data members.
3195 (Output_section::add_input_section): Don't do merge sections for
3196 an incremental link; allocate space from free list for an
3198 (Output_section::add_output_section_data): Allocate space from
3199 free list for an incremental update.
3200 (Output_section::update_data_size): New function.
3201 (Output_section::set_fixed_layout): New function.
3202 (Output_section::reserve): New function.
3203 (Output_segment::set_section_addresses): Remove const.
3204 (Output_segment::set_section_list_addresses): Remove const; allocate
3205 space from free list for an incremental update.
3206 (Output_segment::set_offset): Adjust size of RELRO segment for an
3208 * output.h (Output_data::current_data_size): Move here from
3210 (Output_data::pre_finalize_data_size): New function.
3211 (Output_data::update_data_size): New function.
3212 (Output_section_headers::update_data_size): new function.
3213 (Output_section_data_build::current_data_size): Move to Output_data.
3214 (Output_data_strtab::update_data_size): New function.
3215 (Output_section::current_data_size): Move to Output_data.
3216 (Output_section::set_fixed_layout): New function.
3217 (Output_section::has_fixed_layout): New function.
3218 (Output_section::reserve): New function.
3219 (Output_section::update_data_size): New function.
3220 (Output_section::has_fixed_layout_): New data member.
3221 (Output_section::free_list_): New data member.
3222 (Output_segment::set_section_addresses): Remove const.
3223 (Output_segment::set_section_list_addresses): Remove const.
3224 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3226 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3228 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3229 parameter when calling Add_symbols constructor; store argument
3230 serial number for members of a lib group.
3231 (Add_symbols::locks): Allow case where token == NULL.
3232 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3233 (Read_member::~Read_member): New function.
3234 (Read_member::is_runnable): New function.
3235 (Read_member::locks): New function.
3236 (Read_member::run): New function.
3237 (Check_script::~Check_script): New function.
3238 (Check_script::is_runnable): New function.
3239 (Check_script::locks): New function.
3240 (Check_script::run): New function.
3241 (Check_library::~Check_library): New function.
3242 (Check_library::is_runnable): New function.
3243 (Check_library::locks): New function.
3244 (Check_library::run): New function.
3245 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3246 (Add_symbols::library_): New data member.
3247 (class Read_member): New class.
3248 (class Check_script): New class.
3249 (class Check_library): New class.
3250 * reloc.cc (Read_relocs::is_runnable): Allow case where
3252 (Read_relocs::locks): Likewise.
3253 (Scan_relocs::locks): Likewise.
3254 (Relocate_task::locks): Likewise.
3255 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3257 (Sized_relobj::incremental_relocs_scan): Fix comment.
3258 (Sized_relobj::do_relocate): Pass output file offset to
3259 write_local_symbols.
3260 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3261 from class declaration.
3262 * script.cc (read_input_script): Allocate Script_info; pass
3263 argument serial number to report_script.
3264 * script.h (class Script_info): Move to incremental.h.
3265 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3266 * symtab.h (Symbol_table::add_from_incrobj): New function.
3267 (Symbol_table::set_file_offset): New function.
3269 2011-04-05 Cary Coutant <ccoutant@google.com>
3271 * incremental-dump.cc (dump_incremental_inputs): Change signature
3272 to take a Sized_incremental_binary; change caller. Use readers
3273 in Sized_incremental_binary.
3275 (Sized_incremental_binary::find_incremental_inputs_sections):
3276 Rename do_find_incremental_inputs_sections to this.
3277 (Sized_incremental_binary::setup_readers): New function.
3278 (Sized_incremental_binary::do_check_inputs): Check
3279 has_incremental_info_ flag; move setup code to setup_readers;
3281 (Sized_incremental_binary::do_file_is_unchanged): New function.
3282 (Sized_incremental_binary::do_get_input_reader): New function.
3283 * incremental.h (class Incremental_binary): Move to end of file.
3284 (Incremental_binary::file_is_unchanged): New function.
3285 (Incremental_binary::do_file_is_unchanged): New function.
3286 (Incremental_binary::Input_reader): New class.
3287 (Incremental_binary::get_input_reader): New function.
3288 (class Sized_incremental_binary): Move to end of file.
3289 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3290 input section reader classes.
3291 (Sized_incremental_binary::has_incremental_info): New function.
3292 (Sized_incremental_binary::inputs_reader): New function.
3293 (Sized_incremental_binary::symtab_reader): New function.
3294 (Sized_incremental_binary::relocs_reader): New function.
3295 (Sized_incremental_binary::got_plt_reader): New function.
3296 (Sized_incremental_binary::do_file_is_unchanged): New function.
3297 (Sized_incremental_binary::Sized_input_reader): New class.
3298 (Sized_incremental_binary::get_input_reader): New function.
3299 (Sized_incremental_binary::find_incremental_inputs_sections):
3300 Rename do_find_incremental_inputs_sections to this.
3301 (Sized_incremental_binary::setup_readers): New function.
3302 (Sized_incremental_binary::has_incremental_info_): New data member.
3303 (Sized_incremental_binary::inputs_reader_): New data member.
3304 (Sized_incremental_binary::symtab_reader_): New data member.
3305 (Sized_incremental_binary::relocs_reader_): New data member.
3306 (Sized_incremental_binary::got_plt_reader_): New data member.
3307 (Sized_incremental_binary::current_input_file_): New data member.
3309 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3312 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3315 2011-03-30 Cary Coutant <ccoutant@google.com>
3317 * archive.cc (Archive::include_member): Adjust call to report_object.
3318 (Add_archive_symbols::run): Add script_info to call to
3319 report_archive_begin.
3320 (Lib_group::include_member): Adjust call to report_object.
3321 (Add_lib_group_symbols::run): Adjust call to report_object.
3322 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3323 blocks. Add object count for script input files.
3324 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3325 script_info parameter; change all callers.
3326 (Incremental_inputs::report_object): Add script_info parameter;
3328 (Incremental_inputs::report_script): Store backpointer to
3329 incremental info entry.
3330 (Output_section_incremental_inputs::set_final_data_size): Record
3331 additional information for scripts.
3332 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3333 * incremental.h (Incremental_script_entry::add_object): New function.
3334 (Incremental_script_entry::get_object_count): New function.
3335 (Incremental_script_entry::get_object): New function.
3336 (Incremental_script_entry::objects_): New data member; adjust
3338 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3339 (Incremental_inputs::report_object): Add script_info parameter.
3340 (Incremental_inputs_reader::get_object_count): New function.
3341 (Incremental_inputs_reader::get_object_offset): New function.
3342 * options.cc (Input_arguments::add_file): Return reference to
3344 * options.h (Input_argument::set_script_info): New function.
3345 (Input_argument::script_info): New function.
3346 (Input_argument::script_info_): New data member; adjust all
3348 (Input_file_group::add_file): Return reference to new input argument.
3349 (Input_file_lib::add_file): Likewise.
3350 (Input_arguments::add_file): Likewise.
3351 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3352 * script.cc (Parser_closure::Parser_closure): Add script_info
3353 parameter; adjust all callers.
3354 (Parser_closure::script_info): New function.
3355 (Parser_closure::script_info_): New data member.
3356 (read_input_script): Report scripts earlier to incremental info.
3357 (script_add_file): Set script_info in Input_argument.
3358 (script_add_library): Likewise.
3359 * script.h (Script_options::Script_info): Rewrite class.
3361 2011-03-29 Cary Coutant <ccoutant@google.com>
3363 * archive.cc (Library_base::should_include_member): Move
3364 method here from class Archive.
3365 (Archive::Archive): Initialize base class.
3366 (Archive::should_include_member): Move to base class.
3367 (Archive::do_for_all_unused_symbols): New function.
3368 (Add_archive_symbols::run): Remove redundant access to
3370 (Lib_group::Lib_group): Initialize base class.
3371 (Lib_group::do_filename): New function.
3372 (Lib_group::include_member): Pass pointer to Lib_group to
3374 (Lib_group::do_for_all_unused_symbols): New function.
3375 (Add_lib_group_symbols::run): Report archive information for
3377 * archive.h (class Library_base): New base class.
3378 (class Archive): Derive from Library_base.
3379 (Archive::filename): Move to base class.
3380 (Archive::set_incremental_info): Likewise.
3381 (Archive::incremental_info): Likewise.
3382 (Archive::Should_include): Likewise.
3383 (Archive::should_include_member): Likewise.
3384 (Archive::Armap_entry): Remove.
3385 (Archive::Unused_symbol_iterator): Remove.
3386 (Archive::unused_symbols_begin): Remove.
3387 (Archive::unused_symbols_end): Remove.
3388 (Archive::do_filename): New function.
3389 (Archive::do_get_mtime): New function.
3390 (Archive::do_for_all_unused_symbols): New function.
3391 (Archive::task_): Move to base class.
3392 (Archive::incremental_info_): Likewise.
3393 (class Lib_group): Derive from Library_base.
3394 (Lib_group::do_filename): New function.
3395 (Lib_group::do_get_mtime): New function.
3396 (Lib_group::do_for_all_unused_symbols): New function.
3397 (Lib_group::task_): Move to base class.
3398 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3400 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3402 * incremental.cc (Incremental_inputs::report_archive_begin):
3403 Use Library_base; call library's get_mtime; add incremental inputs
3404 entry before members.
3405 (class Unused_symbol_visitor): New class.
3406 (Incremental_inputs::report_archive_end): Use Library_base; use
3407 visitor class to record unused symbols; don't add incremental inputs
3408 entry after members.
3409 (Incremental_inputs::report_object): Use Library_base.
3411 (Incremental_archive_entry::Incremental_archive_entry): Remove
3412 unused Archive parameter.
3413 (Incremental_inputs::report_archive_begin): Use Library_base.
3414 (Incremental_inputs::report_archive_end): Likewise.
3415 (Incremental_inputs::report_object): Likewise.
3416 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3418 * object.h (Object::for_all_global_symbols): New function.
3419 (Object::do_for_all_global_symbols): New function.
3420 (Sized_relobj::do_for_all_global_symbols): New function.
3421 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3423 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3426 2011-03-27 Ian Lance Taylor <iant@google.com>
3428 * archive.cc (Archive::interpret_header): Return -1 if something
3429 goes wrong. Change callers accordingly.
3431 2011-03-25 Cary Coutant <ccoutant@google.com>
3433 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3434 * testsuite/Makefile.in: Regenerate.
3436 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3438 * plugin.cc (get_view): New.
3439 (Plugin::load): Pass get_view to the plugin.
3440 (Plugin_manager::get_view): New.
3442 2011-03-21 Ian Lance Taylor <iant@google.com>
3444 * testsuite/final_layout.sh: Rewrite to not use dc.
3445 * testsuite/relro_test.sh: Fail if dc is not present.
3447 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3449 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3451 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3452 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3454 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3455 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3457 2011-03-14 Ian Lance Taylor <iant@google.com>
3459 * script-sections.cc (Sort_output_sections::script_compare):
3460 Rename from is_before, change return type.
3461 (Sort_output_sections::operator()): Adjust accordingly.
3463 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3466 * testsuite/odr_violation2.cc: Add comment to make all error line
3467 numbers double digits.
3468 * testsuite/debug_msg.sh: Adjust expected errors.
3470 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3472 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3473 but mark earlier ones as non-canonical
3474 (offset_to_iterator): Update search target and example
3475 (do_addr2line): Return extra lines in a vector*
3476 (format_file_lineno): Extract from do_addr2line
3477 (one_addr2line): Add vector* out-param
3478 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3479 when a lineno entry appeared last for its instruction
3480 (Dwarf_line_info): Add vector* out-param
3481 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3482 * symtab.cc (Odr_violation_compare): Include the lineno in the
3484 (linenos_from_loc): New. Combine the canonical line for an
3485 address with its other lines.
3486 (True_if_intersect): New. Helper functor to make
3487 std::set_intersection a query.
3488 (detect_odr_violations): Compare sets of lines instead of just
3489 one line for each function. This became less deterministic, but
3490 has fewer false positives.
3491 * symtab.h: Declarations.
3492 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3493 mix an optimized and non-optimized object in the same binary
3494 (odr_violation2.so): Same.
3495 * testsuite/Makefile.in: Regenerate from Makefile.am.
3496 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3497 * testsuite/debug_msg.sh: Update line numbers and add
3499 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3500 non-optimized context.
3501 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3502 isn't inlined, and use OdrDerived in an optimized context.
3503 * testsuite/odr_header1.h: Defines OdrDerived, where
3504 optimization will change the
3505 first-instruction-in-the-destructor's file and line number.
3506 * testsuite/odr_header2.h: Defines OdrBase.
3508 2011-03-09 Ian Lance Taylor <iant@google.com>
3510 * fileread.cc (File_read::clear_views): Don't delete the whole
3513 2011-03-08 Ian Lance Taylor <iant@google.com>
3516 * fileread.cc: #include <climits>.
3517 (GOLD_IOV_MAX): Define.
3518 (File_read::read_multiple): Limit number of entries by iov_max.
3519 * fileread.h (class File_read): Always set max_readv_entries to
3522 2011-03-07 Ian Lance Taylor <iant@google.com>
3525 * options.h (class General_options): Add -dy and -dn.
3527 2011-03-02 Cary Coutant <ccoutant@google.com>
3529 * testsuite/script_test_9.t: Add TLS segment.
3531 2011-03-02 Simon Baldwin <simonb@google.com>
3533 * configure.ac: Add check for gnu_indirect_function support in
3534 the toolchain building binutils.
3535 * configure: Rebuild.
3537 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3539 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3540 plugin only symbols.
3541 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3542 in plugin files as not needed in the symbol table.
3544 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3546 * output.cc (Output_section::add_input_section): Delay fill
3547 generation for section ordering.
3549 2011-02-09 Ian Lance Taylor <iant@google.com>
3552 * object.h (class Sized_relobj): Remove clear_local_symbols.
3553 * reloc.cc (Sized_relobj::do_relocate): Don't call
3554 clear_local_symbols.
3556 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3558 * plugin.cc (is_visible_from_outside): Return true for symbols
3561 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3563 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3566 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3568 * icf.h (is_section_foldable_candidate): Change type of parameter
3570 * icf.cc (Icf::find_identical_sections): Change type of local variable
3571 section_name to be std::string.
3572 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3574 2011-01-25 Ian Lance Taylor <iant@google.com>
3576 * script.cc (script_add_extern): Rewrite to use
3577 add_symbol_reference.
3579 2011-01-25 Doug Kwan <dougkwan@google.com>
3581 * icf.cc (get_section_contents): Always lock section's object.
3583 2011-01-24 Ian Lance Taylor <iant@google.com>
3585 * options.h (class General_options): Accept
3586 --no-detect-odr-violations.
3588 2011-01-24 Ian Lance Taylor <iant@google.com>
3590 * version.cc (version_string): Bump to 1.11.
3592 2011-01-24 Ian Lance Taylor <iant@google.com>
3594 * plugin.cc (class Plugin_rescan): Define new class.
3595 (Plugin_manager::claim_file): Set any_claimed_.
3596 (Plugin_manager::save_archive): New function.
3597 (Plugin_manager::save_input_group): New function.
3598 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3600 (Plugin_manager::new_undefined_symbol): New function.
3601 (Plugin_manager::rescan): New function.
3602 (Plugin_manager::rescannable_defines): New function.
3603 (Plugin_manager::add_input_file): Set any_added_.
3604 * plugin.h (class Plugin_manager): define new fields rescannable_,
3605 undefined_symbols_, any_claimed_, and any_added_. Declare
3606 Plugin_rescan as friend. Declare new functions.
3607 (Plugin_manager::Rescannable): Define type.
3608 (Plugin_manager::Rescannable_list): Define type.
3609 (Plugin_manager::Undefined_symbol_list): Define type.
3610 (Plugin_manager::Plugin_manager): Initialize new fields.
3611 * archive.cc (Archive::defines_symbol): New function.
3612 (Add_archive_symbols::run): Pass archive to plugins if any.
3613 * archive.h (class Archive): Declare defines_symbol.
3614 * readsyms.cc (Input_group::~Input_group): New function.
3615 (Finish_group::run): Pass input_group to plugins if any.
3616 * readsyms.h (class Input_group): Declare destructor.
3617 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3620 2011-01-10 Ian Lance Taylor <iant@google.com>
3622 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3624 (Layout::set_segment_offsets): Reset increase_relro before calling
3625 set_section_addresses a second time.
3627 2011-01-04 Cary Coutant <ccoutant@google.com>
3629 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3630 sections before NOBITS sections.
3632 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3634 * version.cc (print_version): Update copyright to 2011.
3636 2010-12-23 Cary Coutant <ccoutant@google.com>
3638 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3639 of OS to this->add. Add OD parameter to second form of the function.
3641 2010-12-20 Ian Lance Taylor <iant@google.com>
3643 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3644 second of two consecutive entries with same offset.
3646 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3648 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3649 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3650 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3651 to avoid unneeded links against $(LDADD).
3652 * testsuite/Makefile.in: Regenerate.
3654 2010-12-15 Ian Lance Taylor <iant@google.com>
3657 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3658 for R_X86_64_32 and R_X86_64_PC32.
3659 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3660 ver_matching_def_pic.o.
3661 (ver_matching_def_pic.o): New target.
3663 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3665 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3666 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3667 Move definition before File_read::View member definitions.
3668 (File_read::View::~View): Initialize and hold lock before
3669 updating current_mapped_bytes.
3671 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3673 * dwarf_reader.cc: Remove outdated comment.
3674 * gold-threads.cc: Fix typo in error message.
3675 * archive.cc: Fix typos in comments.
3676 * archive.h: Likewise.
3677 * arm-reloc-property.cc: Likewise.
3678 * arm-reloc-property.h: Likewise.
3679 * arm-reloc.def: Likewise.
3681 * attributes.h: Likewise.
3682 * cref.cc: Likewise.
3683 * ehframe.cc: Likewise.
3684 * fileread.h: Likewise.
3686 * i386.cc: Likewise.
3688 * incremental.h: Likewise.
3689 * int_encoding.cc: Likewise.
3690 * layout.h: Likewise.
3691 * main.cc: Likewise.
3692 * merge.h: Likewise.
3693 * object.cc: Likewise.
3694 * object.h: Likewise.
3695 * options.cc: Likewise.
3696 * readsyms.cc: Likewise.
3697 * reduced_debug_output.cc: Likewise.
3698 * reloc.cc: Likewise.
3699 * script-sections.cc: Likewise.
3700 * sparc.cc: Likewise.
3701 * symtab.h: Likewise.
3702 * target-reloc.h: Likewise.
3703 * target.cc: Likewise.
3704 * target.h: Likewise.
3705 * timer.cc: Likewise.
3706 * timer.h: Likewise.
3707 * x86_64.cc: Likewise.
3709 2010-12-09 Cary Coutant <ccoutant@google.com>
3711 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3713 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3714 parameter; change all callers.
3715 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3716 * options.h (warn_execstack): New option.
3718 2010-12-07 Doug Kwan <dougkwan@google.com>
3720 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3721 like function call relocations.
3723 2010-12-07 Ian Lance Taylor <iant@google.com>
3725 * archive.cc (Archive::get_elf_object_for_member): Permit
3726 punconfigured to be NULL.
3727 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3728 (Archive::include_member): Pass NULL to get_elf_object_for_member
3729 if we searched for the archive and this is the first included
3732 2010-12-01 Ian Lance Taylor <iant@google.com>
3734 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3735 track_relocs_type_ field.
3736 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3737 Set track_relocs_type_.
3738 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3739 contents when using RELA relocs.
3740 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3742 * reloc.cc (Track_relocs::next_addend): New function.
3743 * reloc.h (class Track_relocs): Declare next_addend.
3745 2010-12-01 Ian Lance Taylor <iant@google.com>
3747 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3750 2010-12-01 Ian Lance Taylor <iant@google.com>
3752 * README: Update compilers known to work and fail.
3754 2010-11-23 Matthias Klose <doko@ubuntu.com>
3756 * configure.in: For --enable-gold, handle value `default' instead of
3757 `both*'. Always install ld as ld.bfd, install as ld if gold is
3759 * configure: Regenerate.
3761 2010-11-18 Doug Kwan <dougkwan@google.com>
3763 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3764 and right_alignment to be zero. Store result alignment only if it is
3765 greater than existing alignment.
3767 2010-11-16 Cary Coutant <ccoutant@google.com>
3770 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3771 Check for ".zdebug_line".
3773 2010-11-16 Doug Kwan <dougkwan@google.com>
3774 Cary Coutant <ccoutant@google.com>
3776 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3777 by reference; adjust all callers.
3778 * output.cc (Output_segment::set_section_addresses): Adjust references
3779 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3781 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3782 end at page boundary.
3784 2010-11-16 Cary Coutant <ccoutant@google.com>
3787 * layout.cc (Layout::choose_output_section): Transform names of
3788 compressed sections even when using a script with a SECTIONS clause.
3789 (Layout::output_section_name): Remove code to transform
3790 compressed debug section names.
3791 * output.cc (Output_section::add_input_section): Use uncompressed
3792 section size when tracking input sections.
3794 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3796 * symtab.h (Symbol::NON_PIC_REF): Remove.
3797 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3798 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3799 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3800 (Symbol::use_plt_offset): Take a flags argument and pass it
3801 directly to needs_dynamic_reloc. Restrict check for undefined
3802 weak symbols to function calls.
3803 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3804 (Target_arm::Scan::global): Use it.
3805 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3806 (Target_arm::Relocate::relocate): Likewise.
3807 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3808 parameter with an r_type parameter. Use get_reference_flags
3810 (Target_arm::Relocate::relocate): Update accordingly.
3811 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3812 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3813 (Target_i386::Scan::global): Likewise.
3814 (Target_i386::Relocate::relocate): Likewise.
3815 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3816 parameter with an r_type parameter. Use get_reference_flags
3818 (Target_i386::Relocate::relocate): Update accordingly.
3819 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3820 (Target_powerpc::Scan::global): Use it.
3821 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3822 (Target_powerpc::Relocate::relocate): Likewise.
3823 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3824 (Target_sparc::Scan::global): Use it.
3825 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3826 (Target_sparc::Relocate::relocate): Likewise.
3827 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3828 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3829 (Target_x86_64::Scan::global): Likewise.
3830 (Target_x86_64::Relocate::relocate): Likewise.
3832 2010-11-08 Doug Kwan <dougkwan@google.com>
3833 Cary Coutant <ccoutant@google.com>
3835 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3836 (Arm_exidx_merge_section::section_contents_): New data member.
3837 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3838 (Arm_input_section::~Arm_input_section): De-allocate memory.
3839 (Arm_input_section::original_contents_): New data member.
3840 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3841 in parameters instead of calling Object::section_contents without
3843 (Arm_output_section::group_section): New parameter TASK. Pass it
3844 to callees that need locking objects.
3845 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3846 to lock EXIDX input sections. Fix a formatting issue. Call
3847 Arm_exidx_merged_section::build_contents to create merged section
3849 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3850 to lock object of stub table owner.
3851 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3852 TEXT_SIZE to initialize data member TEXT_SIZE_.
3853 (Arm_exidx_input_section::addralign): Fix typo in comment.
3854 (Arm_exidx_input_section::text_size): New method.
3855 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3856 that require locking objects. Lock objects before scanning for stubs
3857 and updating local symbols.
3858 (Arm_input_section<big_endian>::init): Copy contents of original
3860 (Arm_input_section<big_endian>::do_write): Use saved contents of
3861 original input section instead of calling Object::section_contents
3863 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3864 size without calling Object::section_size().
3865 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3866 for size. Allocate a buffer for merged EXIDX entries.
3867 (Arm_exidx_merged_section::build_contents): New method.
3868 (Arm_exidx_merged_section::do_write): Move merge section contents
3869 building code to Arm_exidx_merged_section::build_contetns. Write
3870 out contetns in buffer instead of building it on the fly.
3871 (Arm_relobj::make_exidx_input_section): Also pass text section size
3872 to Arm_exidx_input_section constructor.
3873 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3874 (Arm_dynobj::do_read_symbols): Fix memory leak.
3875 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3876 * target.h: (class Task): Add forward declaration.
3877 (Target::relax): Add new parameter TASK and pass it to
3879 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3881 2010-11-05 Cary Coutant <ccoutant@google.com>
3884 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3885 object when reading from the file.
3886 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3888 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3889 when reading section contents.
3890 (get_section_contents): Likewise.
3891 (icf::find_identical_sections): Likewise.
3892 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3893 object when reading from the file.
3894 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3895 the object when doing deferred section layout.
3897 2010-11-03 Nick Clifton <nickc@redhat.com>
3900 * script.h (class Symbol_assignment: name): New member. Returns
3901 the name of the symbol.
3902 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3903 Returns true if the given symbol name is on the list of
3904 assignments wating to be processed.
3905 * archive.cc (should_incldue_member): If the symbol is undefined,
3906 check to see if it is on the list of symbols pending assignment.
3908 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3910 * script-sections.cc (Script_sections::find_memory_region): Check
3911 for a NULL output section pointer.
3913 2010-10-29 Doug Kwan <dougkwan@google.com>
3915 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3916 Output_section::add_relaxed_input_section.
3917 * output.cc (Output_section::add_relaxed_input_section): Add new
3918 arguments LAYOUT and NAME. Set section order index.
3919 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3920 Copy section order index.
3921 * output.h (Output_section::add_relaxed_input_section): Add new
3922 arguments LAYOUT and NAME.
3924 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3926 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3927 NATIVE_OR_CROSS_LINKER.
3928 * testsuite/Makefile.in: Regenerate.
3930 2010-10-20 Doug Kwan <dougkwan@google.com>
3932 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3933 without SHF_LINK_ORDER flags.
3934 * layout.cc (Layout::choose_output_section): Do not filter
3935 SHF_LINK_ORDER flag in a relocatable link.
3937 2010-10-17 Cary Coutant <ccoutant@google.com>
3939 * output.h (Output_segment::set_section_addresses): Change function
3940 signature. Update all callers.
3941 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3943 (Output_segment::set_section_addresses): Align after last TLS
3944 section. Add padding before last relro section instead of after.
3946 2010-10-17 Doug Kwan <dougkwan@google.com>
3948 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3949 GOT output section to be writable.
3951 2010-10-14 Cary Coutant <ccoutant@google.com>
3953 * debug.h (DEBUG_INCREMENTAL): New flag.
3954 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3955 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3957 * incremental.cc (report_command_line): Ignore all forms of
3959 * layout.cc (Layout::Layout): Check parameters for incremental link
3961 * options.cc (General_options::parse_incremental): New function.
3962 (General_options::parse_no_incremental): New function.
3963 (General_options::parse_incremental_full): New function.
3964 (General_options::parse_incremental_update): New function.
3965 (General_options::incremental_mode_): New data member.
3966 (General_options::finalize): Check incremental_mode_.
3967 * options.h (General_options): Update help text for --incremental.
3968 Add --no-incremental, --incremental-full, --incremental-update.
3969 (General_options::Incremental_mode): New enum type.
3970 (General_options::incremental_mode): New function.
3971 (General_options::incremental_mode_): New data member.
3972 * parameters.cc (Parameters::incremental_mode_): New data member.
3973 (Parameters::set_options): Set incremental_mode_.
3974 (Parameters::set_incremental_full): New function.
3975 (Parameters::incremental): New function.
3976 (Parameters::incremental_update): New function.
3977 (set_parameters_incremental_full): New function.
3978 * parameters.h (Parameters::set_incremental_full): New function.
3979 (Parameters::incremental): New function.
3980 (Parameters::incremental_update): New function.
3981 (Parameters::incremental_mode_): New data member.
3982 (set_parameters_incremental_full): New function.
3983 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3984 incremental link mode.
3985 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3986 (Sized_relobj::do_relocate_sections): Likewise.
3987 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3989 * testsuite/Makefile.in: Regenerate.
3990 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3992 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3994 * script-sections.h (class Script_sections): Make
3995 Sections_elements typedef public.
3996 * script-sections.cc (class Sort_output_sections): Add elements_
3997 field. Add constructor which sets it; change all callers.
3998 (Sort_output_sections::is_before): New function.
3999 (Sort_output_sections::operator()): Call is_before.
4000 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4002 * testsuite/script_test_10.sh: New test. Test script section
4004 * testsuite/script_test_10.t: Likewise.
4005 * testsuite/script_test_10.s: Likewise.
4006 * testsuite/Makefile.am: Wrap the cross linker tests and the
4007 common tests into NATIVE_OR_CROSS_LINKER.
4008 (check_SCRIPTS): Add script_test_10.sh.
4009 (check_DATA): Add script_test_10.stdout.
4010 (script_test_10.o, script_test_10): New targets.
4011 (script_test_10.stdout): New target.
4012 * configure, testsuite/Makefile.in: Regenerate.
4014 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4016 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4017 error for the deprecated relocations.
4018 (Target_arm::Scan::global): Likewise.
4019 (Target_arm::Relocate::relocate): Likewise.
4021 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4023 * fileread.cc (Input_file::find_file): Initialize *found_name
4024 and *namep when using the fallback search for case 4.
4026 2010-10-11 Cary Coutant <ccoutant@google.com>
4028 * options.h (class General_options): Redefine -z lazy as an alias for
4029 the negation of -z now.
4031 2010-10-11 Ian Lance Taylor <iant@google.com>
4033 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4036 2010-10-06 Nick Clifton <nickc@redhat.com>
4038 * script-sections.cc(class Memory_region): Remove
4039 current_lma_offset_ field. Rename current_vma_offset_ to
4040 current_offset_. Add last_section_ field.
4041 (Memory_region::get_current_vma_address): Rename to
4042 get_current_address.
4043 (Memory_region::get_current_lma_address): Delete.
4044 (Memory_region::increment_vma_offset): Rename to
4046 (Memory_region::increment_lma_offset): Delete.
4047 (Memory_region::attributes_compatible): New method. Returns
4048 true if the provided section is compatible with the region.
4049 (Memory_region::get_last_section): New method. Returns the last
4050 section to use the region.
4051 (Memory_region::set_last_section): New method. Stores the last
4052 section to use the region.
4053 (Script_sections::block_in_region): New method. Returns true if
4054 a block of memory is contained within a region.
4055 (Script_sections::find_memory_region): New method. Locates a
4056 memory region to be used to set a VMA or LMA address.
4057 (Output_section_definition::set_section_addresses): Add code to
4058 check for addresses set by memory regions.
4059 (Output_segment::set_section_addresses): Remove memory region
4061 (Script_sections::create_segment): Add a warning if a header
4062 segment is created outside of any region.
4063 * script-sections.h (class Script_sections): Add prototypes for
4064 find_memory_region and block_in_region methods.
4065 * testsuite/memory_test.s: Use .long instead of .word.
4066 * testsuite/memory_test.t: Add some more output sections.
4067 * testsuite/memory_test.sh: Update expected output.
4069 2010-10-02 Doug Kwan <dougkwan@google.com>
4071 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4072 defintion to symtab.h
4073 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4074 declaration to defintion.
4076 2010-10-01 Nick Clifton <nickc@redhat.com>
4078 * expression.cc (eval): Replace dummy argument with NULL.
4079 (eval_maybe_dot): Check for a NULL result section pointer.
4080 (Symbol_expression::value): Likewise.
4081 (Dot_expression::value): Likewise.
4082 (BINARY_EXPRESSION): Likewise.
4083 (Max_expression::value): Likewise.
4084 (Min_expression::value): Likewise.
4085 (Absolute_expression::value): Likewise.
4086 (Addr_expression::value_from_output_section): Likewise.
4087 (Loaddddr_expression::value_from_output_section): Likewise.
4088 (Segment_start_expression::value): Likewise.
4089 * script-sections.cc
4090 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4092 (Sections_elememt_dot_assignment::set_section_addresses):
4094 (Output_data_expression::do_write_to_buffer): Likewise.
4095 (Output_section_definition::finalize_symbols): Likewise.
4096 (Output_section_definition::set_section_addresses): Likewise.
4098 2010-09-30 Doug Kwan <dougkwan@google.com>
4100 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4102 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4104 * target.h (Target::can_icf_inline_merge_sections): New virtual
4106 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4108 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4110 * icf.cc (get_section_contents): Inline merge sections only when
4113 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4115 * configure: Regenerate.
4117 2010-09-17 Ian Lance Taylor <iant@google.com>
4119 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4120 * testsuite/Makefile.am (memory_test.o): New target.
4121 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4123 * testsuite/Makefile.in: Rebuild.
4125 2010-09-17 Doug Kwan <dougkwan@google.com>
4127 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4128 defintion if relocation uses GOT entries of the symbol.
4129 * testsuite/icf_safe_test.sh: Fix test.
4130 * testsuite/icf_safe_so_test.sh: Fix test.
4132 2010-09-16 Cary Coutant <ccoutant@google.com>
4134 * script_sections.cc (class Memory_region): Remove "NULL" from
4135 vector initializations.
4137 2010-09-15 Cary Coutant <ccoutant@google.com>
4139 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4140 Resolve forwarding symbols.
4142 2010-09-15 Doug Kwan <dougkwan@google.com>
4144 * gold/testsuite/script_test_3.t: Add ARM special sections.
4145 * gold/testsuite/script_test_4.t: Same.
4146 * gold/testsuite/script_test_5.t: Same.
4147 * gold/testsuite/script_test_6.t: Same.
4148 * gold/testsuite/script_test_7.t: Same.
4149 * gold/testsuite/script_test_7.t: Same.
4150 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4152 2010-09-14 Cary Coutant <ccoutant@google.com>
4154 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4155 (Target_x86_64::Relocate::relocate_tls): Replace check for
4156 saw_tls_block_reloc_ with test for executable section.
4158 2010-09-12 Cary Coutant <ccoutant@google.com>
4160 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4161 position-independent executables to shared libraries need dynamic
4163 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4164 position-independent executables.
4165 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4166 * testsuite/Makefile.in: Regenerate.
4168 2010-09-10 Nick Clifton <nickc@redhat.com>
4171 * testsuite/memory_test.t: Discard any sections that are not
4174 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4177 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4178 "This::" to work around a bug in gcc 4.2.
4180 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4182 2010-09-09 Rafael Espindola <espindola@google.com>
4184 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4185 sections with different PF_X flags in the same segment.
4186 (Layout::find_first_load_seg): Search all segments to find the first
4188 * options.h (rosegment): New.
4190 2010-09-08 Rafael Espindola <espindola@google.com>
4192 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4194 2010-09-08 Doug Kwan <dougkwan@google.com>
4196 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4197 (Arm_relobj::do_relocate_sections): Add new parameter for output
4198 file to match the parent.
4199 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4200 of local symbols instead of input values. Update code to track
4201 changes in gold::relocate_section.
4202 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4203 (Sized_relobj::compute_final_local_value_internal): New methods.
4204 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4205 body into private version of Sized_relobj::compute_final_local_value.
4206 Call the inline method.
4207 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4208 merged symbol value if there is one.
4209 (Symbol_value::has_output_value): New method defintiion.
4210 (Sized_relobj::Compute_final_local_value_status): New enum type.
4211 (Sized_relobj::compute_final_local_value): New methods.
4212 (Sized_relobj::compute_final_local_value_internal): New methods.
4213 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4214 and arm_cortex_a8.sh.
4215 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4216 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4218 * Makefile.in: Regenerate.
4219 * testsuite/arm_bl_out_of_range.s: Update test.
4220 * testsuite/thumb_bl_out_of_range.s: Ditto.
4221 * testsuite/thumb_blx_out_of_range.s: Ditto.
4222 * testsuite/arm_branch_out_of_range.sh: New file.
4223 * testsuite/arm_cortex_a8.sh: Ditto.
4224 * testsuite/arm_cortex_a8_b.s: Ditto.
4225 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4226 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4227 * testsuite/arm_cortex_a8_bl.s: Ditto.
4228 * testsuite/arm_cortex_a8_blx.s: Ditto.
4229 * testsuite/arm_cortex_a8_local.s: Ditto.
4230 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4231 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4233 2010-09-08 Rafael Espindola <espindola@google.com>
4235 * Makefile.am (memory_test.stdout): Run readelf with -W.
4236 * Makefile.in: Regenerate.
4237 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4240 2010-09-08 Rafael Espindola <espindola@google.com>
4242 * script-sections.cc (Script_sections::add_memory_region): Convert
4243 field precision to int.
4244 * script.cc (script_set_section_region, script_set_section_region):
4245 Convert field precision to int.
4247 2010-09-08 Rafael Espindola <espindola@google.com>
4249 * arm.cc (do_finalize_sections): Create the __exidx_start and
4250 __exdix_end symbols even when the section is missing.
4252 2010-09-08 Nick Clifton <nickc@redhat.com>
4254 * README: Remove claim that MEMORY is not supported.
4255 * expression.cc (script_exp_function_origin)
4256 (script_exp_function_length): Move from here to ...
4257 * script.cc: ... here.
4258 (script_set_section_region, script_add_memory)
4259 (script_parse_memory_attr, script_include_directive): New
4261 * script-sections.cc
4262 (class Memory_region): New class.
4263 (class Output_section_definition): Add set_memory_region,
4264 set_section_vma, set_section_lma and get_section_name methods.
4265 (class Script_Sections): Add add_memory_region,
4266 find_memory_region, find_memory_region_origin,
4267 find_memory_region_length and set_memory_region methods.
4268 Have set_section_addresses method walk the list of set memory
4270 Extend the print methos to display memory regions.
4271 * script-sections.h: Add prototypes for new methods.
4272 Add enum for MEMORY region attributes.
4273 * yyscript.y: Add support for parsing MEMORY regions.
4274 * script-c.h: Add prototypes for new functions.
4275 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4276 * testsuite/Makefile.in: Regenerate.
4277 * testsuite/memory_test.sh: New script.
4278 * testsuite/memory_test.s: New assembler source file.
4279 * testsuite/memory_test.t: New linker script.
4281 2010-08-27 Doug Kwan <dougkwan@google.com>
4283 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4284 reference override an existing dynamic weak reference.
4285 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4286 * testsuite/Makefile.in: Regenerate.
4287 * testsuite/dyn_weak_ref.sh: New file.
4288 * testsuite/dyn_weak_ref_1.c: Ditto.
4289 * testsuite/dyn_weak_ref_2.c: Ditto.
4291 2010-08-27 Ian Lance Taylor <iant@google.com>
4293 * incremental.h (class Incremental_input_entry): Add virtual
4296 2010-08-27 Ian Lance Taylor <iant@google.com>
4298 * testsuite/start_lib_test_3.c: Mark t3 as used.
4300 2010-08-27 Nick Clifton <nickc@redhat.com>
4302 * options.cc (version_script): Fix small typo in previous
4305 2010-08-25 Nick Clifton <nickc@redhat.com>
4307 * archive.cc: Formatting fixes: Remove whitespace between
4308 typename and following asterisk. Remove whitespace between
4309 function name and opening parenthesis.
4310 * archive.h: Likewise.
4312 * attributes.cc: Likewise.
4313 * attributes.h: Likewise.
4314 * common.cc: Likewise.
4315 * copy-relocs.cc: Likewise.
4316 * dirsearch.h: Likewise.
4317 * dynobj.cc: Likewise.
4318 * ehframe.cc: Likewise.
4319 * ehframe.h: Likewise.
4320 * expression.cc: Likewise.
4321 * fileread.cc: Likewise.
4322 * fileread.h: Likewise.
4324 * gold-threads.cc: Likewise.
4325 * gold.cc: Likewise.
4326 * i386.cc: Likewise.
4328 * incremental-dump.cc: Likewise.
4329 * incremental.cc: Likewise.
4330 * layout.cc: Likewise.
4331 * layout.h: Likewise.
4332 * main.cc: Likewise.
4333 * merge.cc: Likewise.
4334 * merge.h: Likewise.
4335 * object.cc: Likewise.
4336 * object.h: Likewise.
4337 * options.cc: Likewise.
4338 * options.h: Likewise.
4339 * output.cc: Likewise.
4340 * output.h: Likewise.
4341 * plugin.cc: Likewise.
4342 * plugin.h: Likewise.
4343 * powerpc.cc: Likewise.
4344 * reloc.cc: Likewise.
4345 * script-c.h: Likewise.
4346 * script-sections.cc: Likewise.
4347 * script.cc: Likewise.
4348 * stringpool.cc: Likewise.
4349 * symtab.cc: Likewise.
4350 * symtab.h: Likewise.
4351 * target.cc: Likewise.
4352 * timer.cc: Likewise.
4353 * timer.h: Likewise.
4354 * version.cc: Likewise.
4355 * x86_64.cc: Likewise.
4357 2010-08-24 Nick Clifton <nickc@redhat.com>
4360 * layout.cc (segment_precedes): Sort segments by their physical
4361 addresses, if they have been set.
4363 2010-08-23 Cary Coutant <ccoutant@google.com>
4365 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4367 (Lib_group::include_member): Unlock object after deleting its
4369 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4372 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4373 Cary Coutant <ccoutant@google.com>
4375 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4376 constructor, and set_blocker.
4377 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4379 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4380 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4381 * testsuite/Makefile.am (start_lib_test): New test case.
4382 * testsuite/Makefile.in: Regenerate.
4383 * testsuite/start_lib_test_main.c: New file.
4384 * testsuite/start_lib_test_1.c: New file.
4385 * testsuite/start_lib_test_2.c: New file.
4386 * testsuite/start_lib_test_3.c: New file.
4388 2010-08-19 Ian Lance Taylor <iant@google.com>
4390 * Makefile.in: Rebuild with automake 1.11.1.
4391 * aclocal.m4: Likewise.
4392 * testsuite/Makefile.in: Likewise.
4394 2010-08-19 Ian Lance Taylor <iant@google.com>
4397 * i386.cc (class Output_data_plt_i386): Update declarations.
4398 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4399 local_ifuncs_ fields.
4400 (Target_i386::do_plt_section_for_global): New function.
4401 (Target_i386::do_plt_section_for_local): New function.
4402 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4403 parameter; change all callers. Initialize global_ifuncs_ and
4404 local_ifuncs_. If doing a static link define __rel_iplt_start and
4406 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4407 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4408 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4410 (Target_i386::make_plt_section): New function, broken out of
4411 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4412 (Target_i386::make_plt_entry): Call make_plt_section.
4413 (Target_i386::make_local_ifunc_plt_entry): New function.
4414 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4415 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4416 R_386_IRELATIVE to switch.
4417 (Target_i386::Scan::global): Likewise.
4418 (Target_i386::Relocate::relocate): Likewise.
4419 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4421 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4422 (Target_x86_64::do_plt_section_for_global): New function.
4423 (Target_x86_64::do_plt_section_for_local): New function.
4424 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4425 parameter; change all callers. If doing a static link define
4426 __rela_iplt_start and __rela_iplt_end.
4427 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4428 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4429 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4431 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4432 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4434 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4435 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4436 R_X86_64_IRELATIVE to switch.
4437 (Target_x86_64::Scan::global): Likewise.
4438 (Target_x86_64::Relocate::relocate): Likewise.
4439 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4441 * target.h (class Target): Add plt_section_for_global and
4442 plt_section_for_local functions. Add do_plt_section_for_global
4443 and do_plt_section_for_local virtual functions.
4444 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4445 clarifying comments.
4446 (Symbol::use_plt_offset): Handle IFUNC symbol.
4447 * object.cc (Sized_relobj::Sized_relobj): Initialize
4449 (Sized_relobj::local_has_plt_offset): New function.
4450 (Sized_relobj::local_plt_offset): New function.
4451 (Sized_relobj::set_local_plt_offset): New function.
4452 (Sized_relobj::do_count): Handle IFUNC symbol.
4453 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4454 a bit away from input_shndx_ field. Add set_is_func_symbol and
4455 is_ifunc_symbol functions.
4456 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4457 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4458 local_plt_offsets_ field.
4459 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4460 * output.h (class Output_section_data): Add non-const
4461 output_section function.
4462 (class Output_data_got): Update declarations.
4463 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4464 Add use_plt_offset parameter to global and local constructors.
4465 Change all callers. Change local_sym_index_ field to 31 bits.
4466 Change GSYM_CODE and CONSTANT_CODE accordingly.
4467 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4468 doing a static link don't set sh_link field.
4469 (Output_data_got::Got_entry::write): Use PLT offset if
4471 (Output_data_got::add_global_plt): New function.
4472 (Output_data_got::add_local_plt): New function.
4473 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4474 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4475 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4476 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4477 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4479 * testsuite/ifunc-sel.h: New file.
4480 * testsuite/ifuncmain1.c: New file.
4481 * testsuite/ifuncmain1vis.c: New file.
4482 * testsuite/ifuncmod1.c: New file.
4483 * testsuite/ifuncdep2.c: New file.
4484 * testsuite/ifuncmain2.c: New file.
4485 * testsuite/ifuncmain3.c: New file.
4486 * testsuite/ifuncmod3.c: New file.
4487 * testsuite/ifuncmain4.c: New file.
4488 * testsuite/ifuncmain5.c: New file.
4489 * testsuite/ifuncmod5.c: New file.
4490 * testsuite/ifuncmain6pie.c: New file.
4491 * testsuite/ifuncmod6.c: New file.
4492 * testsuite/ifuncmain7.c: New file.
4493 * configure, testsuite/Makefile.in: Rebuild.
4495 2010-08-18 Ian Lance Taylor <iant@google.com>
4498 (Output_section_incremental_inputs::write_input_files): Add cast
4499 to avoid signed/unsigned comparison warning.
4500 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4502 2010-08-12 Cary Coutant <ccoutant@google.com>
4504 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4506 2010-08-13 Ian Lance Taylor <iant@google.com>
4508 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4510 2010-08-12 Cary Coutant <ccoutant@google.com>
4511 Doug Kwan <dougkwan@google.com>
4513 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4514 defintion overrides non-weak undef, remember that the original undef
4516 * symtab.cc (Symbol_table::sized_write_global): For undef without
4517 an original weak binding, set binding to global in output.
4518 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4519 * testsuite/Makefile.in: Regenerate.
4520 * testsuite/strong_ref_weak_def.sh: New file.
4521 * testsuite/strong_ref_weak_def_1.c: Ditto.
4522 * testsuite/strong_ref_weak_def_2.c: Ditto.
4524 2010-08-12 Cary Coutant <ccoutant@google.com>
4526 * testsuite/incremental_test.sh: Rewrite.
4527 * testsuite/incremental_test_1.c: Rewrite.
4528 * testsuite/incremental_test_2.c: Rewrite.
4530 2010-08-12 Cary Coutant <ccoutant@google.com>
4532 * arm.cc (Target_arm::got_size): Add const.
4533 (Target_arm::got_entry_count): New function.
4534 (Target_arm::plt_entry_count): New function.
4535 (Target_arm::first_plt_entry_offset): New function.
4536 (Target_arm::plt_entry_size): New function.
4537 (Output_data_plt_arm::entry_count): New function.
4538 (Output_data_plt_arm::first_plt_entry_offset): New function.
4539 (Output_data_plt_arm::get_plt_entry_size): New function.
4540 * i386.cc (Target_i386::got_size): Add const.
4541 (Target_i386::got_entry_count): New function.
4542 (Target_i386::plt_entry_count): New function.
4543 (Target_i386::first_plt_entry_offset): New function.
4544 (Target_i386::plt_entry_size): New function.
4545 (Output_data_plt_i386::entry_count): New function.
4546 (Output_data_plt_i386::first_plt_entry_offset): New function.
4547 (Output_data_plt_i386::get_plt_entry_size): New function.
4548 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4549 find_incremental_inputs_sections. Dump incremental_got_plt section.
4550 * incremental.cc: Include target.h.
4551 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4552 parameter. Adjust all callers. Find incremental_got_plt section.
4553 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4555 (Output_section_incremental_inputs::set_final_data_size): Calculate
4556 size of incremental_got_plt section.
4557 (Output_section_incremental_inputs::do_write): Write the
4558 incremental_got_plt section.
4559 (Got_plt_view_info): New struct.
4560 (Local_got_offset_visitor): New class.
4561 (Global_got_offset_visitor): New class.
4562 (Global_symbol_visitor_got_plt): New class.
4563 (Output_section_incremental_inputs::write_got_plt): New function.
4564 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4565 Add parameter. Adjust all callers.
4566 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4567 (Incremental_inputs::got_plt_section): New function.
4568 (Incremental_inputs::got_plt_section_): New data member.
4569 (Incremental_got_plt_reader): New class.
4570 * layout.cc (Layout::create_incremental_info_sections): Add the
4571 incremental_got_plt section.
4572 * object.h (Got_offset_list::get_list): New function.
4573 (Got offset_list::for_all_got_offsets): New function.
4574 (Sized_relobj::local_got_offset_list): New function.
4575 * powerpc.cc (Target_powerpc::got_size): Add const.
4576 (Target_powerpc::got_entry_count): New function.
4577 (Target_powerpc::plt_entry_count): New function.
4578 (Target_powerpc::first_plt_entry_offset): New function.
4579 (Target_powerpc::plt_entry_size): New function.
4580 (Output_data_plt_powerpc::entry_count): New function.
4581 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4582 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4583 * sparc.cc (Target_sparc::got_size): Add const.
4584 (Target_sparc::got_entry_count): New function.
4585 (Target_sparc::plt_entry_count): New function.
4586 (Target_sparc::first_plt_entry_offset): New function.
4587 (Target_sparc::plt_entry_size): New function.
4588 (Output_data_plt_sparc::entry_count): New function.
4589 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4590 (Output_data_plt_sparc::get_plt_entry_size): New function.
4591 * symtab.h (Symbol::got_offset_list): New function.
4592 (Symbol_table::for_all_symbols): New function.
4593 * target.h (Sized_target::got_entry_count): New function.
4594 (Sized_target::plt_entry_count): New function.
4595 (Sized_target::plt_entry_size): New function.
4596 * x86_64.cc (Target_x86_64::got_size): Add const.
4597 (Target_x86_64::got_entry_count): New function.
4598 (Target_x86_64::plt_entry_count): New function.
4599 (Target_x86_64::first_plt_entry_offset): New function.
4600 (Target_x86_64::plt_entry_size): New function.
4601 (Output_data_plt_x86_64::entry_count): New function.
4602 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4603 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4605 2010-08-12 Cary Coutant <ccoutant@google.com>
4607 * archive.cc: Include incremental.h.
4608 (Archive::Archive): Initialize incremental_info_.
4609 (Archive::include_member): Record archive members in incremental info.
4610 (Add_archive_symbols::run): Record begin and end of an archive in
4612 (Lib_group::include_member): Record objects in incremental info.
4613 * archive.h (Incremental_archive_entry): Forward declaration.
4614 (Archive::set_incremental_info): New member function.
4615 (Archive::incremental_info): New member function.
4616 (Archive::Unused_symbol_iterator): New class.
4617 (Archive::unused_symbols_begin): New member function.
4618 (Archive::unused_symbols_end): New member function.
4619 (Archive::incremental_info_): New data member.
4620 * incremental-dump.cc (find_input_containing_global): New function.
4621 (dump_incremental_inputs): Dump new incremental info sections.
4622 * incremental.cc: Include symtab.h.
4623 (Output_section_incremental_inputs): New class.
4624 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4625 new incremental info sections.
4626 (Sized_incremental_binary::do_check_inputs): Likewise.
4627 (Incremental_inputs::report_archive): Remove.
4628 (Incremental_inputs::report_archive_begin): New function.
4629 (Incremental_inputs::report_archive_end): New function.
4630 (Incremental_inputs::report_object): New function.
4631 (Incremental_inputs::finalize_inputs): Remove.
4632 (Incremental_inputs::report_input_section): New function.
4633 (Incremental_inputs::report_script): Rewrite.
4634 (Incremental_inputs::finalize): Do nothing but finalize string table.
4635 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4636 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4637 (Incremental_inputs::create_data_sections): New function.
4638 (Incremental_inputs::relocs_entsize): New function.
4639 (Output_section_incremental_inputs::set_final_data_size): New function.
4640 (Output_section_incremental_inputs::do_write): New function.
4641 (Output_section_incremental_inputs::write_header): New function.
4642 (Output_section_incremental_inputs::write_input_files): New function.
4643 (Output_section_incremental_inputs::write_info_blocks): New function.
4644 (Output_section_incremental_inputs::write_symtab): New function.
4645 * incremental.h (Incremental_script_entry): Forward declaration.
4646 (Incremental_object_entry): Forward declaration.
4647 (Incremental_archive_entry): Forward declaration.
4648 (Incremental_inputs): Forward declaration.
4649 (Incremental_inputs_header_data): Remove.
4650 (Incremental_inputs_header): Remove.
4651 (Incremental_inputs_header_write): Remove.
4652 (Incremental_inputs_entry_data): Remove.
4653 (Incremental_inputs_entry): Remove.
4654 (Incremental_inputs_entry_write): Remove.
4655 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4656 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4657 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4658 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4660 (Incremental_input_entry): New class.
4661 (Incremental_script_entry): New class.
4662 (Incremental_object_entry): New class.
4663 (Incremental_archive_entry): New class.
4664 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4665 (Incremental_inputs::report_inputs): Remove.
4666 (Incremental_inputs::report_archive): Remove.
4667 (Incremental_inputs::report_archive_begin): New function.
4668 (Incremental_inputs::report_archive_end): New function.
4669 (Incremental_inputs::report_object): Change prototype.
4670 (Incremental_inputs::report_input_section): New function.
4671 (Incremental_inputs::report_script): Change prototype.
4672 (Incremental_inputs::get_reloc_count): New function.
4673 (Incremental_inputs::set_reloc_count): New function.
4674 (Incremental_inputs::create_data_sections): New function.
4675 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4676 (Incremental_inputs::inputs_section): New function.
4677 (Incremental_inputs::symtab_section): New function.
4678 (Incremental_inputs::relocs_section): New function.
4679 (Incremental_inputs::get_stringpool): Add const.
4680 (Incremental_inputs::command_line): Add const.
4681 (Incremental_inputs::inputs): Remove.
4682 (Incremental_inputs::command_line_key): New function.
4683 (Incremental_inputs::input_file_count): New function.
4684 (Incremental_inputs::input_files): New function.
4685 (Incremental_inputs::relocs_entsize): New function.
4686 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4687 (Incremental_inputs::finalize_inputs): Remove.
4688 (Incremental_inputs::Input_info): Remove.
4689 (Incremental_inputs::lock_): Remove.
4690 (Incremental_inputs::inputs_): Change type.
4691 (Incremental_inputs::inputs_map_): Remove.
4692 (Incremental_inputs::current_object_entry_): New data member.
4693 (Incremental_inputs::inputs_section_): New data member.
4694 (Incremental_inputs::symtab_section_): New data member.
4695 (Incremental_inputs::relocs_section_): New data member.
4696 (Incremental_inputs::reloc_count_): New data member.
4697 (Incremental_inputs_reader): New class.
4698 (Incremental_symtab_reader): New class.
4699 (Incremental_relocs_reader): New class.
4700 * layout.cc (Layout::finalize): Move finalization of incremental info
4701 and creation of incremental info sections to follow finalization of
4702 symbol table. Set offsets for postprocessing sections.
4703 (Layout::create_incremental_info_sections): Call
4704 Incremental_inputs::create_data_sections. Add incremental symtab
4705 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4706 sections to layout after input sections.
4707 * layout.h (struct Timespec): Forward declaration.
4708 (Layout::incremental_inputs): Add const.
4709 (Layout::create_incremental_info_sections): Add parameter.
4710 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4711 * object.cc: Include incremental.h.
4712 (Relobj::finalize_incremental_relocs): New function.
4713 (Sized_relobj::do_layout): Record input sections in incremental info.
4714 * object.h (Object::output_section): New function.
4715 (Object::output_section_offset): Moved from Relobj.
4716 (Object::get_incremental_reloc_base): New function.
4717 (Object::get_incremental_reloc_count): New function.
4718 (Object::do_output_section): New function.
4719 (Object::do_output_section_offset): Moved from Relobj.
4720 (Object::do_get_incremental_reloc_base): New function.
4721 (Object::do_get_incremental_reloc_count): New function.
4722 (Object::Object): Initialize new data members.
4723 (Relobj::output_section): Renamed do_output_section and moved to
4725 (Relobj::output_section_offset): Moved to Object.
4726 (Relobj::do_get_incremental_reloc_base): New function.
4727 (Relobj::do_get_incremental_reloc_count): New function.
4728 (Relobj::allocate_incremental_reloc_counts): New function.
4729 (Relobj::count_incremental_reloc): New function.
4730 (Relobj::finalize_incremental_relocs): New function.
4731 (Relobj::next_incremental_reloc_index): New function.
4732 (Relobj::reloc_counts_): New data member.
4733 (Relobj::reloc_bases_): New data member.
4734 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4735 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4736 (Sized_relobj::incremental_relocs_scan): New function.
4737 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4738 (Sized_relobj::incremental_relocs_write): New function.
4739 (Sized_relobj::incremental_relocs_write_reltype): New function.
4740 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4742 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4743 archives and object files elsewhere.
4744 (Add_symbols::run): Report object files here.
4745 (Finish_group::run): Report end of archive at end of group.
4746 * reloc.cc: Include layout.h, incremental.h.
4747 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4748 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4749 (Sized_relobj::incremental_relocs_scan): New function.
4750 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4751 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4752 (Sized_relobj::incremental_relocs_write): New function.
4753 (Sized_relobj::incremental_relocs_write_reltype): New function.
4754 * script.cc (read_input_script): Rewrite test for incremental link.
4755 Change call to Incremental_inputs::report_script.
4756 * symtab.h (Symbol_table::first_global_index): New function.
4757 (Symbol_table::output_count): New function.
4759 2010-08-12 Doug Kwan <dougkwan@google.com>
4761 * arm.cc (Target_arm::merge_object_attributes): Check command line
4762 options --no-wchar-size-warning and --no-enum-size-warning.
4763 * options.h (General_options): Add ld-compatible options
4764 --no-enum-size-warning and --no-wchar-size-warning.
4766 2010-08-04 Ian Lance Taylor <iant@google.com>
4768 * x86_64.cc (Target_x86_64::Scan::local): Use
4769 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4770 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4771 (Target_x86_64::Scan::global): Likewise.
4772 (Target_x86_64::Relocate::relocate): Likewise.
4773 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4776 2010-08-03 Cary Coutant <ccoutant@google.com>
4778 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4779 to reserve space in merged_strings vector. Keep total input size
4781 (Output_merge_string::do_print_merge_stats): Print total input size.
4782 * merge.h (Output_merge_string): Add input_size_ field.
4783 * stringpool.cc (Stringpool_template::string_length): Move
4784 implementations out of Stringpool_template class and place in
4786 * stringpool.h (string_length): Move out of Stringpool_template.
4788 2010-08-03 Ian Lance Taylor <iant@google.com>
4791 * layout.cc (relaxation_loop_body): If address of load segment is
4792 set, adjust address to include headers if possible.
4794 2010-08-03 Ian Lance Taylor <iant@google.com>
4796 * version.cc (version_string): Bump to 1.10.
4798 2010-08-03 Ian Lance Taylor <iant@google.com>
4801 * layout.h (enum Output_section_order): Define.
4802 (class Layout): Update declarations.
4803 * layout.cc (Layout::get_output_section): Add order parameter.
4804 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4805 is_first_non_relro parameters. Change all callers.
4806 (Layout::choose_output_section): Likewise.
4807 (Layout::add_output_section_data): Likewise.
4808 (Layout::make_output_section): Likewise. Set order.
4809 (Layout::default_section_order): New function.
4810 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4811 * output.cc (Output_section::Output_section): Initialize order_.
4812 Don't initialize deleted fields.
4813 (Output_segment::Output_segment): Don't initialize deleted
4815 (Output_segment::add_output_section_to_load): New function
4816 replacing add_output_section. Change all callers to call this or
4817 add_output_section_to_nonload.
4818 (Output_segment::add_output_section_to_nonload): New function.
4819 (Output_segment::remove_output_section): Rewrite.
4820 (Output_segment::add_initial_output_data): Likewise.
4821 (Output_segment::has_any_data_sections): Likewise.
4822 (Output_segment::is_first_section_relro): Likewise.
4823 (Output_segment::maximum_alignment): Likewise.
4824 (Output_segment::has_dynamic_reloc): New function replacing
4825 dynamic_reloc_count. Change all callers.
4826 (Output_segment::has_dynamic_reloc_list): New function replacing
4827 dynamic_reloc_count_list. Change all callers.
4828 (Output_segment::set_section_addresses): Rewrite.
4829 (Output_segment::set_offset): Rewrite.
4830 (Output_segment::find_first_and_last_list): Remove.
4831 (Output_segment::set_tls_offsets): Rewrite.
4832 (Output_segment::first_section_load_address): Likewise.
4833 (Output_segment::output_section_count): Likewise.
4834 (Output_segment::section_with_lowest_load_address): Likewise.
4835 (Output_segment::write_section_headers): Likewise.
4836 (Output_segment::print_sections_to_map): Likewise.
4837 * output.h (class Output_data): Remove dynamic_reloc_count_
4838 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4839 (Output_data::add_dynamic_reloc): Rewrite.
4840 (Output_data::has_dynamic_reloc): New function.
4841 (Output_data::dynamic_reloc_count): Remove.
4842 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4843 is_last_relro_, is_first_non_relro_, is_interp_,
4844 is_dynamic_linker_section_ fields. Add order and set_order
4845 functions. Remove is_relro_local, set_is_relro_local,
4846 is_last_relro, set_is_last_relro, is_first_non_relro,
4847 set_is_first_non_relro functions, is_interp, set_is_interp,
4848 is_dynamic_linker_section, and set_is_dynamic_linker_section
4850 (class Output_segment): Change Output_data_list from std::list to
4851 std:;vector. Add output_lists_ field. Remove output_data_ and
4852 output_bss_ fields. Update declarations.
4854 2010-08-02 Ian Lance Taylor <iant@google.com>
4856 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4857 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4858 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4860 2010-08-02 Ian Lance Taylor <iant@google.com>
4863 * script.cc (Script_options::Script_options): Initialize
4864 symbol_definitions_ and symbol_references_.
4865 (Script_options::add_symbol_assignment): Update
4866 symbol_definitions_ and symbol_references_.
4867 (Script_options::add_symbol_reference): New function.
4868 (script_symbol): New function.
4869 * script.h (class Script_options): Add symbol_definitions_ and
4870 symbol_references_ fields.
4871 (Script_options::referenced_const_iterator): New type.
4872 (Script_options::referenced_begin): New function.
4873 (Script_options::referenced_end): New function.
4874 (Script_options::is_referenced): New function.
4875 (Script_options::any_unreferenced): New function.
4876 * script-c.h (script_symbol): Declare.
4877 * yyscript.y (exp): Call script_symbol.
4878 * symtab.cc: Include "script.h".
4879 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4880 Change all callers. Check symbols referenced by scripts.
4881 (Symbol_table::add_undefined_symbols_from_command_line): Add
4882 layout parameter. Change all callers.
4883 (Symbol_table::do_add_undefined_symbols_from_command_line):
4884 Likewise. Break out loop body. Check symbols referenced by
4886 (Symbol_table::add_undefined_symbol_from_command_line): New
4887 function broken out of
4888 do_add_undefined_symbols_from_command_line.
4889 * symtab.h (class Symbol_table): Update declarations.
4890 * archive.cc: Include "layout.h".
4891 (Archive::should_include_member): Add layout parameter. Change
4892 all callers. Check for symbol mentioned in expression.
4893 * archive.h (class Archive): Update declaration.
4894 * object.cc (Sized_relobj::do_should_include_member): Add layout
4896 * object.h (Object::should_include_member): Add layout parameter.
4898 (Object::do_should_include_member): Add layout parameter.
4899 (class Sized_relobj): Update declaration.
4900 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4902 * dynobj.h (class Sized_dynobj): Update declaration.
4903 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4905 * plugin.h (class Sized_pluginobj): Update declaration.
4907 2010-08-02 Ian Lance Taylor <iant@google.com>
4910 * output.cc (Output_segment::set_offset): Search for the first and
4911 last sections rather than assuming that the list is in order.
4912 (Output_segment::find_first_and_last_list): New function.
4913 * output.h (class Output_segment): Update declarations.
4914 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4915 (relro_strip_test_SOURCES): New variable.
4916 (relro_strip_test_DEPENDENCIES): New variable.
4917 (relro_strip_test_LDFLAGS): New variable.
4918 (relro_strip_test_LDADD): New variable.
4919 (relro_strip_test.so): New target.
4921 2010-08-02 Ian Lance Taylor <iant@google.com>
4923 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4924 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4925 (Target_i386::got_tlsdesc_section): New function.
4926 (Target_i386::got_section): Create space for GOT entries for
4927 TLSDESC relocations.
4928 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4930 (Target_i386::Scan::global): Likewise.
4931 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4933 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4934 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4935 (Target_x86_64::got_tlsdesc_section): New function.
4936 (Target_x86_64::got_section): Create space for GOT entries for
4937 TLSDESC relocations.
4938 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4940 (Target_x86_64::Scan::global): Likewise.
4941 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4944 2010-08-02 Ian Lance Taylor <iant@google.com>
4946 * testsuite/final_layout.sh: Use dc to convert from hex to
4949 2010-07-29 Sriraman Tallam <tmsriram@google.com>
4951 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4952 paramter to the call to gold::gc_process_relocs.
4953 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4954 paramter to the call to gold::gc_process_relocs.
4955 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4956 parameter to the call to gold::gc_process_relocs.
4957 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4958 template parameter to the call to gold::gc_process_relocs.
4959 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4960 paramter to the call to gold::gc_process_relocs.
4961 * gc.h (get_embedded_addend_size): New function.
4962 (gc_process_relocs): Save the size of the reloc for use by ICF.
4963 * icf.cc (get_section_contents): Get the addend from the text section
4964 for SHT_REL relocation sections.
4965 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4966 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4967 * int_encoding.h (read_from_pointer): New overloaded function.
4968 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4969 * testsuite/icf_sht_rel_addend_test.sh: New file.
4970 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4971 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4973 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4975 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4976 * Makefile.in: Regenerate.
4977 * testsuite/Makefile.in: Regenerate.
4979 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4981 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4982 * gold/testsuite/debug_msg.cc: Likewise.
4983 * gold/testsuite/odr_violation1.cc
4984 * gold/testsuite/odr_violation2.cc
4986 2010-07-21 Cary Coutant <ccoutant@google.com>
4988 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4989 string, and length fields.
4990 (Output_merge_string::Merged_strings_list): New type.
4991 (Output_merge_string::Merged_strings_lists): New typedef.
4992 (Output_merge_string): Replace merged_strings_ with
4993 merged_strings_lists_.
4994 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4995 Merged_strings_list per input object and section. Don't store pointer
4996 to the string. Don't store length with each merged string entry.
4997 (Output_merge_string::finalize_merged_data): Loop over list of merged
4998 strings lists. Recompute length of each merged string.
5000 2010-07-15 Cary Coutant <ccoutant@google.com>
5002 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5005 2010-07-14 Ian Lance Taylor <iant@google.com>
5007 * descriptors.cc (Descriptors::open): Report correct name in error
5010 2010-07-13 Doug Kwan <dougkwan@google.com>
5012 * arm.cc (Arm_input_section::Arm_input_section): For a
5013 SHT_ARM_EXIDX section, always keeps the input sections.
5014 (Arm_input_section::set_exidx_section_link): New method.
5015 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5016 has_errors_ to false.
5017 (Arm_exidx_input_section::has_errors,
5018 Arm_exidx_input_section::set_has_errors): New methods.
5019 (Arm_exidx_input_section::has_errors_): New data member.
5020 (Arm_relobj::get_exidx_shndx_list): New method.
5021 (Arm_output_section::append_text_sections_to_list): Do not skip
5022 section without SHF_EXECINSTR.
5023 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5025 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5026 section header. Make error messages more verbose. Check for
5027 a non-executable section linked to an EXIDX section.
5028 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5029 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5030 check that there is no deferred EXIDX section if we exit early.
5031 Instead of not making an EXIDX section in case of an error, make one
5032 and set the has_errors flag of it.
5033 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5034 in a relocatable link.
5035 (Target_arm::do_relax): Look for the EXIDX output section instead of
5036 assuming that it is called .ARM.exidx.
5037 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5038 section list. Do not check for SHF_EXECINSTR section flags but
5039 skip any input section with errors.
5040 * output.cc (Output_section::Output_section): Initialize
5041 always_keeps_input_sections_ to false.
5042 (Output_section::add_input_section): Check for
5043 always_keeps_input_sections_.
5044 * output.h (Output_section::always_keeps_input_sections,
5045 Output_section::set_always_keeps_input_sections): New methods.
5046 (Output_section::always_keeps_input_sections): New data member.
5048 2010-07-13 Rafael Espindola <espindola@google.com>
5050 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5051 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5053 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5054 Ian Lance Taylor <iant@google.com>
5056 * output.h (Output_section_lookup_maps::add_merge_section):
5057 Correct check of whether value was inserted.
5058 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5059 (Output_section_lookup_maps::add_relaxed_input_section):
5061 * arm.cc (Target_arm::got_section): Remove used local os.
5062 * i386.cc (Target_i386::got_section): Likewise.
5063 * x86_64.cc (Target_x86_64::got_section): Likewise.
5064 * sparc.cc (Target_sparc::got_section): Likewise.
5065 (Target_sparc::relocate): Remove unused local have_got_offset.
5066 * powerpc.cc (Target_powerpc::relocate): Likewise.
5068 2010-07-13 Ian Lance Taylor <iant@google.com>
5070 * compressed_output.cc (zlib_decompress): Fix signature in
5073 * archive.cc (Archive::include_member): Unlock an external member
5074 of a thin archive. Don't bother to delete an object we know is
5077 2010-07-12 Cary Coutant <ccoutant@google.com>
5079 * compressed_output.cc (zlib_decompress): New function.
5080 (get_uncompressed_size): New function.
5081 (decompress_input_section): New function.
5082 * compressed_output.h (get_uncompressed_size): New function.
5083 (decompress_input_section): New function.
5084 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5085 Handle compressed debug sections.
5086 * layout.cc (is_compressed_debug_section): New function.
5087 (Layout::output_section_name): Map compressed section names to
5089 * layout.h (is_compressed_debug_section): New function.
5090 (is_debug_info_section): Recognize compressed debug sections.
5091 * merge.cc: Include compressed_output.h.
5092 (Output_merge_data::do_add_input_section): Handle compressed
5094 (Output_merge_string::do_add_input_section): Handle compressed
5096 * object.cc: Include compressed_output.h.
5097 (Sized_relobj::Sized_relobj): Initialize new data members.
5098 (build_compressed_section_map): New function.
5099 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5100 * object.h (Object::section_is_compressed): New method.
5101 (Object::do_section_is_compressed): New method.
5102 (Sized_relobj::Compressed_section_map): New type.
5103 (Sized_relobj::do_section_is_compressed): New method.
5104 (Sized_relobj::compressed_sections_): New data member.
5105 * output.cc (Output_section::add_input_section): Handle compressed
5107 * reloc.cc: Include compressed_output.h.
5108 (Sized_relobj::write_sections): Handle compressed debug sections.
5110 2010-07-08 Cary Coutant <ccoutant@google.com>
5112 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5113 weak when resolving to a dynamic def.
5114 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5115 for weak undef/dynamic def cases. Adjust callers.
5116 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5117 undef_binding_weak_.
5118 (Symbol_table::sized_write_globals): Adjust symbol binding.
5119 (Symbol_table::sized_write_symbol): Add binding parameter.
5120 * symtab.h (Symbol::set_undef_binding): New method.
5121 (Symbol::is_undef_binding_weak): New method.
5122 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5123 (Symbol_table::should_override): Add new parameter.
5124 (Symbol_table::sized_write_symbol): Add new parameter.
5126 * testsuite/weak_undef_file1.cc: Add new test case.
5127 * testsuite/weak_undef_file2.cc: Fix header comment.
5128 * testsuite/weak_undef_test.cc: Add new test case.
5130 2010-06-29 Doug Kwan <dougkwan@google.com>
5132 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5133 Initialize USE_SYMBOL_.
5134 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5136 (Arm_reloc_property::uses_symbol_): New data member declaration.
5137 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5138 uses symbol value and symbol is undefined but not weakly undefined.
5140 2010-06-28 Rafael Espindola <espindola@google.com>
5142 * plugin.cc (Plugin::load): Use dlerror.
5144 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5146 * symtab.cc (detect_odr_violations): When reporting an ODR
5147 violation, report an object where the symbol is defined.
5149 2010-06-25 Doug Kwan <dougkwan@google.com>
5151 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5152 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5154 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5155 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5156 target hook to detect function points.
5157 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5158 * icf.h (Icf::check_section_for_function_pointers): Change type of
5159 parameter SECTION_NAME to const reference to std::string. Use
5160 target hook to determine if section may have unsafe pointers.
5161 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5164 2010-06-21 Rafael Espindola <espindola@google.com>
5166 * fileread.cc (Input_file::find_fie): New
5167 (Input_file::open): Use Input_file::find_fie.
5168 * fileread.h (Input_file::find_fie): New
5169 * plugin.cc (set_extra_library_path): New.
5170 (Plugin::load): Add set_extra_library_path to the transfer vector.
5171 (Plugin_manager::set_extra_library_path): New.
5172 (Plugin_manager::add_input_file): Use the extra search path if set.
5173 (set_extra_library_path(): New.
5174 * plugin.h (Plugin_manager): Add set_extra_library_path and
5177 2010-06-19 Cary Coutant <ccoutant@google.com>
5179 * layout.cc (gdb_sections): Add .debug_types.
5180 (lines_only_debug_sections): Likewise.
5182 2010-06-18 Rafael Espindola <espindola@google.com>
5184 * plugin.cc (add_input_file,add_input_library)
5185 (Plugin_manager::add_input_file): Make filename arguments const.
5186 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5189 2010-06-16 Doug Kwan <dougkwan@google.com>
5191 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5192 .ARM.attributes section if we have not merged any input
5193 attributes sections.
5195 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5197 * arm.cc: Allow combining objects with no EABI version
5200 2010-06-15 Rafael Espindola <espindola@google.com>
5202 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5204 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5206 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5207 (struct iovec): Correct !HAVE_READV definition.
5209 2010-06-10 Cary Coutant <ccoutant@google.com>
5211 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5212 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5214 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5217 * symtab.h (Symbol::is_placeholder): New member function.
5218 * target-reloc.h (relocate_section): Check for placeholder symbols.
5220 * testsuite/Makefile.am (plugin_test_8): New test.
5221 (plugin_test_9): New test.
5222 * testsuite/Makefile.in: Regenerate.
5224 2010-06-09 Nick Clifton <nickc@redhat.com>
5226 * yyscript.y (input_list_element): Allow strings prefixed with
5227 the '-' character. Treat these as libraries.
5228 * script.cc (script_add_library): New function. Adds a library
5229 specified by "-l<name>" found in an input script.
5230 * script-c.h: Add prototype for script_add_library.
5232 2010-06-07 Doug Kwan <dougkwan@google.com>
5234 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5235 Restrict stub-group size to be within long conditional branch
5236 range when working around cortex-A8 erratum.
5238 2010-06-07 Damien Diederen <dd@crosstwine.com>
5240 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5243 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5247 (Output_section::Input_section_sort_entry::compare_section_ordering):
5248 Change to return non-zero correctly.
5249 (Output_section::Input_section_sort_section_order_index_compare
5250 ::operator()): Change to fix ambiguity in comparisons.
5252 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5254 * gold.h (is_wildcard_string): New function.
5255 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5256 (Layout::layout_eh_frame): Ditto.
5257 (Layout::find_section_order_index): New method.
5258 (Layout::read_layout_from_file): New method.
5259 * layout.h (Layout::find_section_order_index): New method.
5260 (Layout::read_layout_from_file): New method.
5261 (Layout::input_section_position_): New private member.
5262 (Layout::input_section_glob_): New private member.
5263 * main.cc (main): Call read_layout_from_file here.
5264 * options.h (--section-ordering-file): New option.
5265 * output.cc (Output_section::input_section_order_specified_): New
5267 (Output_section::Output_section): Initialize new member.
5268 (Output_section::add_input_section): Add new parameter.
5269 Keep input sections when --section-ordering-file is used.
5270 (Output_section::set_final_data_size): Sort input sections when
5271 section ordering file is specified.
5272 (Output_section::Input_section_sort_entry): Add new parameter.
5274 (Output_section::Input_section_sort_entry::compare_section_ordering):
5276 (Output_section::Input_section_sort_compare::operator()): Change to
5277 consider section_order_index.
5278 (Output_section::Input_section_sort_init_fini_compare::operator()):
5279 Change to consider section_order_index.
5280 (Output_section::Input_section_sort_section_order_index_compare
5281 ::operator()): New method.
5282 (Output_section::sort_attached_input_sections): Change to sort
5283 according to section order when specified.
5284 (Output_section::add_input_section<32, true>): Add new parameter.
5285 (Output_section::add_input_section<64, true>): Add new parameter.
5286 (Output_section::add_input_section<32, false>): Add new parameter.
5287 (Output_section::add_input_section<64, false>): Add new parameter.
5288 * output.h (Output_section::add_input_section): Add new parameter.
5289 (Output_section::input_section_order_specified): New
5291 (Output_section::set_input_section_order_specified): New method.
5292 (Input_section::Input_section): Initialize section_order_index_.
5293 (Input_section::section_order_index): New method.
5294 (Input_section::set_section_order_index): New method.
5295 (Input_section::section_order_index_): New member.
5296 (Input_section::Input_section_sort_section_order_index_compare): New
5298 (Output_section::input_section_order_specified_): New member.
5299 * script-sections.cc (is_wildcard_string): Delete and move modified
5301 (Output_section_element_input::Output_section_element_input): Modify
5302 call to is_wildcard_string.
5303 (Output_section_element_input::Input_section_pattern
5304 ::Input_section_pattern): Ditto.
5305 (Output_section_element_input::Output_section_element_input): Ditto.
5306 * testsuite/Makefile.am (final_layout): New test case.
5307 * testsuite/Makefile.in: Regenerate.
5308 * testsuite/final_layout.cc: New file.
5309 * testsuite/final_layout.sh: New file.
5311 2010-06-01 Rafael Espindola <espindola@google.com>
5313 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5315 2010-06-01 Rafael Espindola <espindola@google.com>
5317 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5318 visibility of symbols.
5320 2010-05-27 Doug Kwan <dougkwan@google.com>
5322 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5323 from start of output section instead of address for a local symbol
5324 in a merged or relaxed section when doing a relocatable link.
5326 2010-05-26 Rafael Espindola <espindola@google.com>
5329 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5330 adding sections the garbage collector removed.
5331 * gold/testsuite/Makefile.am: Add test.
5332 * gold/testsuite/Makefile.in: Regenerate.
5333 * gold/testsuite/plugin_test_7.sh: New.
5334 * gold/testsuite/plugin_test_7_1.c: New.
5335 * gold/testsuite/plugin_test_7_2.c: New.
5337 2010-05-26 Rafael Espindola <espindola@google.com>
5339 * script-sections.cc (Output_section_definition::set_section_addresses):
5340 Check for --section-start.
5342 2010-05-26 Doug Kwan <dougkwan@google.com>
5344 * arm.cc (Arm_scan_relocatable_relocs): New class.
5345 (Target_arm::relocate_special_relocatable): New method.
5346 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5347 (Arm_relocate_functions::thumb_branch_common): Same.
5348 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5349 instead of Default_scan_relocatable_relocs.
5350 * target-reloc.h (relocate_for_relocatable): Let target handle
5351 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5352 * target.h (Sized_target::relocate_special_relocatable): New method.
5354 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5356 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5358 2010-05-23 Doug Kwan <dougkwan@google.com>
5360 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5362 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5363 with a direct branch, not a conditional branch, to a stub.
5364 * merge.cc (Output_merge_base::record_input_section): New method
5366 (Output_merge_data::do_add_input_section): Record input section if
5367 keeps-input-sections flag is set.
5368 (Output_merge_string::do_add_input_section): Ditto.
5369 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5370 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5372 (Output_merge_base::keeps_input_sections,
5373 Output_merge_base::set_keeps_input_sections,
5374 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5376 (Output_merge_base::Input_sections): New type declaration.
5377 (Output_merge_base::input_sections_begin,
5378 Output_merge_base::input_sections_end,
5379 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5380 (Output_merge_base::bool keeps_input_sections_,
5381 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5382 Output_merge_base::input_sections_): New data members.
5383 (Output_merge_data::do_set_keeps_input_sections): New method
5385 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5386 * output.cc (Output_section::Input_section::relobj): Move method
5387 defintion from class declaration to here and handle merge sections.
5388 (Output_section::Input_section::shndx): Ditto.
5389 (Output_section::Output_section): Remove initializations of removed
5390 data members and initialize new data member LOOKUP_MAPS_.
5391 (Output_section::add_input_section): Set keeps-input-sections flag
5392 for a newly created merge output section as appropriate. Adjust code
5393 to use Output_section_lookup_maps class.
5394 (Output_section::add_relaxed_input_section): Adjst code for lookup
5395 maps code refactoring.
5396 (Output_section::add_merge_input_section): Add a new parameter
5397 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5398 class. If adding input section to a newly created merge output
5399 section fails, remove the new merge section.
5400 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5401 Adjust code for use of the Output_section_lookup_maps class.
5402 (Output_section::find_merge_section): Ditto.
5403 (Output_section::build_lookup_maps): New method defintion.
5404 (Output_section::find_relaxed_input_section): Adjust code to use
5405 Output_section_lookup_maps class.
5406 (Output_section::get_input_sections): Export merge sections. Adjust
5407 code to use Output_section_lookup_maps class.
5408 (Output_section:::add_script_input_section): Adjust code to use
5409 Output_section_lookup_maps class. Update lookup maps for merge
5411 (Output_section::discard_states): Use Output_section_lookup_maps.
5412 (Output_section::restore_states): Same.
5413 * output.h (Merge_section_properties): Move class defintion out of
5415 (Output_section_lookup_maps): New class.
5416 (Output_section::Input_section::is_merge_section): New method
5418 (Output_section::Input_section::relobj): Move defintion out of class
5419 defintion. Declare method only.
5420 (Output_section::Input_section::shndx): Ditto.
5421 (Output_section::Input_section::output_merge_base): New method defintion.
5422 (Output_section::Input_section::u2_.pomb): New union field.
5423 (Output_section::Merge_section_by_properties_map,
5424 Output_section::Output_section_data_by_input_section_map,
5425 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5427 (Output_section::add_merge_input_section): Add new parameter
5428 KEEPS_INPUT_SECTIONS.
5429 (Output_section::build_lookup_maps): New method declaration.
5430 (Output_section::merge_section_map_,
5431 Output_section::merge_section_by_properties_map_,
5432 Output_section::relaxed_input_section_map_,
5433 Output_section::is_relaxed_input_section_map_valid_): Remove data
5435 (Output_section::lookup_maps_): New data member.
5437 2010-05-21 Doug Kwan <dougkwan@google.com>
5440 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5441 avoid a compilation error.
5443 2010-05-19 Rafael Espindola <espindola@google.com>
5445 * script-sections.cc (Output_section_definition::allocate_to_segment):
5446 Update the phdrs_list even when the output section is NULL.
5447 * testsuite/Makefile.am: Add test.
5448 * testsuite/Makefile.in: Regenerate.
5449 * testsuite/script_test_9.cc: New.
5450 * testsuite/script_test_9.sh: New.
5451 * testsuite/script_test_9.t: New.
5453 2010-05-19 Doug Kwan <dougkwan@google.com>
5455 * arm.cc (Arm_input_section::original_size): New method.
5456 (Arm_input_section::do_addralign): Add a cast.
5457 (Arm_input_section::do_output_offset): Remove static cast.
5458 (Arm_input_section::original_addralign,
5459 Arm_input_section::original_size_): Change type to uint32_t.
5460 (Arm_input_section::init): Add safe casts for section alignment
5462 (Arm_input_section::set_final_data_size): Do not set address and
5463 offset of stub table.
5464 (Arm_output_section::fix_exidx_coverage): Change use of of
5465 Output_section::Simple_input_section to that of
5466 Output_section::Input_section.
5467 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5468 except for the first pass.
5469 * output.cc (Output_section::get_input_sections): Change type of
5470 input_sections to std::list<Input_section>.
5471 (Output_section::add_script_input_section): Rename from
5472 Output_section::add_simple_input_section. Change type of SIS
5473 parameter from Simple_input_section to Input_section.
5474 * output.h (Output_section::Simple_input_section): Remove class.
5475 (Output_section::Input_section): Change class visibility to public.
5476 (Output_section::Input_section::addralign): Use stored alignments
5477 for special input sections if set.
5478 (Output_section::Input_section::set_addralign): New method.
5479 (Output_section::get_input_sections): Change parameter type from
5480 list of Simple_input_section to list of Input_section.
5481 (Output_section::add_script_input_section): Rename from
5482 Output_section::add_simple_input_section. Change first parameter's
5483 type from Simple_input_section to Input_section and remove the
5484 second and third parameters.
5485 * script-sections.cc (Input_section::Input_section_list): Change
5486 type to list of Output_section::Input_section/
5487 (Input_section_info::Input_section_info): Change parameter type of
5488 INPUT_SECTION to Output_section::Input_section.
5489 (Input_section_info::input_section): Change return type.
5490 (Input_section_info::input_section_): Change type to
5491 Output_section::Input_section.
5492 (Output_section_element_input::set_section_addresses): Adjust code
5493 to use Output_section::Input_section instead of
5494 Output_section::Simple_input_section. Adjust code for renaming
5495 of Output_section::add_simple_input_section.
5496 (Orphan_output_section::set_section_addresses): Ditto.
5498 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5500 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5501 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5503 2010-05-18 Rafael Espindola <espindola@google.com>
5505 * options.cc (General_options::finalize): Handle -nostdlib.
5506 * options.h (nostdlib): New option.
5507 * script.cc (script_add_search_dir): Handle -nostdlib.
5509 2010-05-12 Doug Kwan <dougkwan@google.com>
5511 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5512 attributes section only if there no attributes section after merging.
5513 (Target_arm::merge_object_attributes): Move value of
5514 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5515 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5516 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5517 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5518 and arm_attr_merge_7.stdout.
5519 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5520 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5521 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5522 arm_attr_merge_7b.o): New rules.
5523 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5525 * testsuite/Makefile.in: Regenerate.
5526 * testsuite/arm_attr_merge.sh: New file.
5527 * testsuite/arm_attr_merge_[67][ab].s: Same.
5529 2010-05-05 Nick Clifton <nickc@redhat.com>
5531 * po/es.po: Updated Spanish translation.
5533 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5535 * Makefile.am (install-exec-local): Properly install gold as
5536 default cross linker.
5537 * Makefile.in: Regenerated.
5539 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5540 Nick Clifton <nickc@redhat.com>
5542 * configure.ac (install_as_default): Define and set to false
5543 unless --enable-gold or --enable-gold=both/gold has been
5545 * configure: Regenerate.
5547 * Makefile.am (install-exec-local): Install the executable as
5548 'ld.gold'. If install_as_default is true then also install it as
5550 * Makefile.in: Regenerated.
5552 2010-04-24 Ian Lance Taylor <iant@google.com>
5554 * layout.cc (Layout::layout_reloc): In relocatable link don't
5555 combine reloc sections for grouped sections.
5557 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5559 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5560 sections that are not ordinary to icf.
5561 * icf.cc (get_section_contents): Handle relocation pointing to section
5562 with no object or shndx information.
5563 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5564 * testsuite/Makefile.in: Regenerate.
5565 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5566 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5568 2010-04-22 Ian Lance Taylor <iant@google.com>
5570 * expression.cc (Expression::Expression_eval_info): Add
5571 result_alignment_pointer field.
5572 (Expression::eval_with_dot): Add result_alignment_pointer
5573 parameter. Change all callers.
5574 (Expression::eval_maybe_dot): Likewise.
5575 (class Binary_expression): Add alignment_pointer parameter to
5576 left_value and right_value. Change all callers.
5577 (BINARY_EXPRESSION): Set result alignment.
5578 (class Trinary_expression): Add alignment_pointer parameter to
5579 arg2_value and arg3_value. Change all callers.
5580 (Trinary_cond::value): Set result alignment.
5581 (Max_expression::value, Min_expression::value): Likewise.
5582 (Align_expression::value): Likewise.
5583 * script-sections.cc (class Sections_element): Add dot_alignment
5584 parameter to set_section_addresses virtual function. Update
5586 (class Output_section_element): Likewise.
5587 (Script_sections::create_segments): Add dot_alignment parameter.
5589 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5590 (Script_sections::set_phdrs_clause_addresses): Likewise.
5591 * script-sections.h: Update declarations.
5592 * script.h: Update declarations.
5593 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5595 * testsuite/script_test_3.t: Set large alignment.
5596 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5597 segment has expected alignment.
5599 2010-04-22 Nick Clifton <nickc@redhat.com>
5601 * po/gold.pot: Updated by the Translation project.
5602 * po/vi.po: Updated Vietnamese translation.
5604 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5606 * testsuite/Makefile.am (check_PROGRAMS): Add
5607 icf_virtual_function_folding_test.
5608 * testsuite/Makefile.in: Regenerated.
5610 2010-04-15 Andrew Haley <aph@redhat.com>
5612 * options.h (merge_exidx_entries): New option.
5613 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5614 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5615 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5616 (Target_arm::merge_exidx_entries): New function.
5617 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5618 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5619 to Arm_exidx_fixup constructor.
5620 Add new arg, merge_exidx_entries.
5621 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5622 Arm_output_section::fix_exidx_coverage.
5624 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5626 * icf.cc (get_section_contents): Check for preemptible functions.
5627 Ignore addend when appropriate.
5628 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5630 (add_from_relobj): Check for section folded.
5631 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5632 * symtab.h (should_add_dynsym_entry): Add new parameter.
5633 * target-reloc.h (scan_relocs): Check for section folded.
5634 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5635 Check reloc types for function pointers in shared objects.
5636 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5638 (icf_preemptible_functions_test): New test case.
5639 (icf_string_merge_test): New test case.
5640 * testsuite.Makefile.in: Regenerate.
5641 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5642 bar_glob. Refactor code.
5643 * testsuite/icf_preemptible_functions_test.cc: New file.
5644 * testsuite/icf_preemptible_functions_test.sh: New file.
5645 * testsuite/icf_string_merge_test.cc: New file.
5646 * testsuite/icf_string_merge_test.sh: New file.
5647 * testsuite/icf_virtual_function_folding_test.cc: New file.
5648 * testsuite/icf_virtual_function_folding_test.sh: New file.
5650 2010-04-14 Doug Kwan <dougkwan@google.com>
5652 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5653 for local symbol recounting if we remove a section due to ICF.
5654 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5655 there are no regular objects in input.
5657 2010-04-13 Doug Kwan <dougkwan@google.com>
5659 * arm.cc (Arm_input_section::set_final_data_size): Compute
5660 accurate final data size instead of using current data size.
5662 2010-04-09 Doug Kwan <dougkwan@google.com>
5664 * layout.cc (Layout::choose_output_section): Handle script section
5666 (Layout::make_output_section_for_script): Add section type parameter.
5667 Handle script section types.
5668 * layout.h (Layout::make_output_section_for_script): Add section
5670 * output.cc (Output_section::Output_section): Initialize data member
5672 (Output_section::do_reset_address_and_file_offset): Do not set address
5673 to 0 if section is a NOLOAD section.
5674 * output.h (Output_section::is_noload): New method.
5675 (Output_section::set_is_noload): Ditto.
5676 (Output_section::is_noload_): New data member.
5677 * script-c.h (Script_section_type): New enum type.
5678 (struct Parser_output_section_header): Add new file section_type.
5679 * script-sections.cc (Sections_element::output_section_name): Add
5680 parameter for returning script section type.
5681 (Output_section_definition::output_section_name): Ditto.
5682 (Output_section_definition::section_type)P; New method.
5683 (Output_section_definiton::script_section_type_name): Ditto.
5684 (Output_section_definition::script_section_type_): New data member.
5685 (Output_section_definition::Output_section_definition): Initialize
5686 data member Output_section_definition::script_section_type_.
5687 (Output_section_definition::create_sections): Pass script section type
5688 to Layout::make_output_section_for_script.
5689 (Output_section_definition::output_section_name): Return script
5690 section type to caller.
5691 (Output_section_definition::set_section_address): Do not advance
5692 dot value and load address if section type is NOLOAD. Set address
5693 of NOLOAD sections regardless of section flags.
5694 (Output_section_definition::print): Print section type if it is
5695 not SCRIPT_SECTION_TYPE_NONE.
5696 (Output_section_definition::section_type): New method.
5697 (Output_section_definition::script_section_type_name): Ditto.
5698 (Script_sections::output_section_name): Add new parameter
5699 PSECTION_TYPE for returning script section type. Pass it to
5700 section elements. Handle discard sections.
5701 (Sort_output_sections::operator()): Handle NOLOAD sections.
5702 * script-sections.h (Script_sections::Section_type): New enum type.
5703 (Script_sections::output_section_name): Add a new parameter for
5704 returning script section type.
5705 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5707 * yyscript.y (union): Add new field SECTION_TYPE.
5708 (COPY, DSECT, INFO, NOLOAD): New tokens.
5709 (opt_address_and_section_type): Change type to output_section_header.
5710 (section_type): New non-terminal
5711 (section_header): Handle section type.
5712 (opt_address_and_section_type): Return section type value.
5714 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5716 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5717 * testsuite/plugin_common_test_2.c (foo): Likewise.
5719 2010-04-08 Doug Kwan <dougkwan@google.com>
5721 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5723 * output.cc (Output_section::add_merge_input_section): Simplify
5724 code and return status of Output_merge_base::add_input_section.
5725 Update merge section map only if Output_merge_base::add_input_section
5728 2010-04-07 Doug Kwan <dougkwan@google.com>
5730 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5731 if section is marked as containing instructions but has no mapping
5733 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5734 correct section index.
5735 (Arm_relobj::find_linked_text_section): Ditto.
5737 2010-04-07 Cary Coutant <ccoutant@google.com>
5739 * archive.cc (include_member): Destroy Read_symbols_data object before
5741 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5742 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5743 (Read_symbols_data::~Read_symbols_data) New destructor.
5744 (Section_relocs::Section_relocs) New constructor.
5745 (Section_relocs::~Section_relocs) New destructor.
5746 (Read_relocs_data::Read_relocs_data) New constructor.
5747 (Read_relocs_data::~Read_relocs_data) New destructor.
5748 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5749 pointers to NULL after deleting.
5751 2010-04-07 Doug Kwan <dougkwan@google.com>
5753 * arm.cc: Replace "endianity" with "endianness" in comments.
5754 (Arm_exidx_cantunwind): Ditto.
5755 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5756 (Arm_relobj::merge_flags_and_attributes): New method.
5757 (Arm_relobj::merge_flags_and_attributes_): New data member.
5758 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5759 (Arm_relobj::scan_sections_for_stubs): Ditto.
5760 (Arm_relobj::do_read_symbols): Check to see if we really want to
5761 merge processor-specific flags and attributes. Exit early if
5762 an object is empty except for section names and the undefined symbol.
5763 (Target_arm::do_finalize_sections): Move check for ELF format to
5764 Arm_relobj::do_read_symbols. Merge processor specific flags and
5765 attributes from a regular object only when we have determined that
5766 it is aapropriate. Do not create an .ARM.attributes section in
5767 output if there is no regular input object.
5768 (Target_arm::merge_processor_specific_flags): Check
5769 --warn-mismatch before printing any error.
5770 (Target_arm::merge_object_attributes): Ditto.
5771 * gold.cc (queue_middle_tasks): Handle the case in which there is
5772 no regular object in input.
5773 * options.cc (General_options::parse_EB): New method.
5774 (General_options::parse_EL): Same.
5775 (General_options::General_options): Initialize endianness_.
5776 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5778 (General_options::Endianness): New enum.
5779 (General_options::endianness): New method.
5780 (General_options::endianness_): New data member.
5781 * parameters.cc (Parameters::set_options): Check target endianness.
5782 (Parameters::set_target_once): Ditto.
5783 (Parameters::check_target_endianness): New method.
5784 (parameters_force_valid_target): If either -EL or -EB is specified,
5785 use it to define endianness of default target.
5786 * parameters.h (Parameters::check_target_endianness): New method
5788 * target.h (class Target): Change "endianity" to "endianness"
5791 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5793 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5794 * configure: Regenerate.
5795 * Makefile.in: Regenerate.
5796 * testsuite/Makefile.in: Regenerate.
5798 2010-04-06 Cary Coutant <ccoutant@google.com>
5801 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5802 prevailing definitions of common symbols.
5803 * testsuite/plugin_test_6.sh: New test case.
5804 * testsuite/plugin_common_test_1.c: New test case.
5805 * testsuite/plugin_common_test_2.c: New test case.
5806 * testsuite/Makefile.am (plugin_test_6): New test case.
5807 * testsuite/Makefile.in: Regenerate.
5809 2010-04-06 Nick Clifton <nickc@redhat.com>
5811 * po/vi.po: New Vietnamese translation.
5813 2010-03-30 Doug Kwan <dougkwan@google.com>
5815 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5817 2010-03-25 Doug Kwan <dougkwan@google.com>
5819 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5820 to avoid a conversion warning on a 32-bit host.
5822 2010-03-24 Ian Lance Taylor <iant@google.com>
5824 * testsuite/script_test_3.t: Add a TLS segment.
5825 * testsuite/Makefile.am (check_PROGRAMS): Add
5826 tls_phdrs_script_test.
5827 (tls_phdrs_script_test_SOURCES): Define.
5828 (tls_phdrs_script_test_DEPENDENCIES): Define.
5829 (tls_phdrs_script_test_LDFLAGS): Define.
5830 (tls_phdrs_script_test_LDADD): Define.
5831 * testsuite/Makefile.in: Rebuild.
5833 2010-03-23 Cary Coutant <ccoutant@google.com>
5835 * fileread.cc (find_or_make_view): Fix comment.
5837 2010-03-23 Ian Lance Taylor <iant@google.com>
5839 * script-sections.cc (class Orphan_section_placement): Define
5840 PLACE_TLS and PLACE_TLS_BSS.
5841 (Orphan_section_placement::Orphan_section_placement): Initialize
5843 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5844 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5845 (tls_script_test_SOURCES): Define.
5846 (tls_script_test_DEPENDENCIES): Define.
5847 (tls_script_test_LDFLAGS): Define.
5848 (tls_script_test_LDADD): Define.
5849 * testsuite/Makefile.in: Rebuild.
5851 2010-03-22 Doug Kwan <dougkwan@google.com>
5853 * arm.cc (Arm_relocate_functions::abs8,
5854 Arm_relocate_functions::abs16): Use correct check for overflow
5855 specified in the ARM ELF specs.
5856 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5857 target of a BLX instruction specially.
5858 (Reloc_stub::stub_type_for_reloc): Ditto.
5859 (Relocate::relocate): Use symbolic names instead of numeric relocation
5860 codes to report error.
5861 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5863 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5864 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5865 thumb2_blx_out_of_range.stdout
5866 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5867 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5868 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5869 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5870 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5871 thumb2_blx_in_range, thumb2_blx_in_range.o,
5872 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5873 thumb2_blx_out_of_range.o): New rules.
5874 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5875 thumb2_blx_in_range and thumb2_blx_out_of_range.
5876 * testsuite/Makefile.in: Regenerate.
5877 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5878 * testsuite/thumb_blx_in_range.s: New file.
5879 * testsuite/thumb_blx_out_of_range.s: New file.
5881 2010-03-22 Rafael Espindola <espindola@google.com>
5883 * archive.cc (Should_include): Move to archive.h.
5884 (should_include_member): Make it a member of Archive.
5886 (Add_lib_group_symbols): New.
5887 * archive.h: Include options.h.
5888 (Archive_member): Moved from Archive.
5889 (Should_include): Moved from archive.cc.
5891 (Add_lib_group_symbols): New.
5892 * dynobj.cc (do_should_include_member): New.
5893 * dynobj.h (do_should_include_member): New.
5894 * gold.cc (queue_initial_tasks): Update call to queue.
5895 * main.cc (main): Print lib group stats.
5896 * object.cc (do_should_include_member): New.
5897 * object.h: Include archive.h.
5898 (Object::should_include_member): New.
5899 (Object::do_should_include_member): New.
5900 (Sized_relobj::do_should_include_member): New.
5901 * options.cc (General_options::parse_start_lib): New.
5902 (General_options::parse_end_lib): New.
5903 (Input_arguments::add_file): Handle lib groups.
5904 (Input_arguments::start_group): Check we are not in a lib.
5905 (Input_arguments::start_lib): New.
5906 (Input_arguments::end_lib): New.
5907 * options.h (General_options): Add start_lib and end_lib.
5908 (Input_argument::lib_): New.
5909 (Input_argument::lib): New.
5910 (Input_argument::is_lib): New.
5911 (Input_file_lib): New.
5912 (Input_arguments::in_lib_): New.
5913 (Input_arguments::in_lib): New.
5914 (Input_arguments::start_lib): New.
5915 (Input_arguments::end_lib_): New.
5916 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5917 in unused members as preempted.
5918 (Sized_pluginobj::do_should_include_member): New.
5919 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5920 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5922 (Read_symbols::do_whole_lib_group): New.
5923 (Read_symbols::do_lib_group): New.
5924 (Read_symbols::do_read_symbols): Handle lib groups.
5925 (Read_symbols::get_name): Handle lib groups.
5926 * readsyms.h (Read_symbols): Add an archive member pointer.
5927 (Read_symbols::do_whole_lib_group): New.
5928 (Read_symbols::do_lib_group): New.
5929 (Read_symbols::member_): New.
5930 * script.cc (read_input_script): Update call to queue_soon.
5932 2010-03-19 Doug Kwan <dougkwan@google.com>
5934 * arm.cc (Stub_table::Stub_table): Initialize new data members
5935 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5936 (Stub_table::add_reloc_stub): Assign stub offset and update
5937 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5938 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5940 (Stub_table::update_data_size_and_addralign): Use
5941 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5942 instead of going over all reloc stubs.
5943 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5944 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5945 Stringpool_template::offset_ to size of Stringpool_char.
5946 (Stringpool_template::new_key_offset): Remove code to initialize
5947 Stringpool_template::offset_.
5948 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5949 Stringpool_template::offset_ to zero.
5951 2010-03-15 Doug Kwan <dougkwan@google.com>
5953 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5955 (Stringpool_template::new_key_offset): New method.
5956 (Stringpool_template::add_string): Assign offsets when adding new
5958 (Stringpool_template::set_string_offsets): Do not set string offsets
5959 when not optimizing.
5960 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5962 (Chunked_vector::clear): Clear size_.
5963 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5964 (Chunked_vector::size): Return size_.
5965 (Chunked_vector::push_back): Use size_ to find insert position.
5966 (Chunked_vector::size_): New data member.
5967 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5968 (Stringpool_template::new_key_offset): New method declaration.
5969 (Stringpool_template::offset_): New data member.
5971 2010-03-15 Rafael Espindola <espindola@google.com>
5973 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5974 Add_symbols' constructor.
5975 * readsyms.h (Add_symbols): Remove the input_group member.
5977 2010-03-10 Ian Lance Taylor <iant@google.com>
5979 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5980 target to ask whether a reference to a symbol requires a stack
5982 * target.h (Target::is_call_to_non_split): New function.
5983 (Target::do_is_call_to_non_split): Declare virtual function.
5984 * target.cc: Include "symtab.h".
5985 (Target::do_is_call_to_non_split): New function.
5986 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5988 2010-03-10 Cary Coutant <ccoutant@google.com>
5990 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5991 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5992 (File_read::open[2]): Add whole_file_view_ to list of views.
5993 (File_read::make_view): Remove test of whole_file_view_.
5994 (File_read::find_or_make_view): Create whole_file_view_ if
5996 (File_read::clear_views): Replace bool parameter with enum;
5997 adjust all callers. Don't delete views with permanent data;
5998 do delete cached views and views from archives if
5999 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6000 if clearing the corresponding view.
6001 * fileread.h (File_read::Clear_views_mode): New enum.
6002 (File_read::View::is_permanent_view): New method.
6003 (File_read::clear_views): Replace bool parameter
6004 with enum; adjust all callers.
6005 * options.h (General_options): Change keep_files_mapped option;
6006 add map_whole_files.
6007 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6009 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6012 2010-03-10 David S. Miller <davem@davemloft.net>
6014 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6016 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6018 * icf.cc (get_section_contents): Add '@' marker after processing the
6021 2010-03-08 Doug Kwan <dougkwan@google.com>
6023 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6024 due to a conversion warning.
6025 (Arm_relobj::update_output_local_symbol_count): Check for local
6026 symbol with unset output index.
6028 2010-03-05 Ian Lance Taylor <iant@google.com>
6030 * options.h (class General_options): Add --spare-dynamic-tags.
6031 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6032 --spare-dynamic-tags.
6034 2010-03-05 Ian Lance Taylor <iant@google.com>
6036 * incremental.cc: Include "libiberty.h".
6038 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6040 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6041 function, is_info_ member.
6042 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6043 (Versions::Versions): Update caller.
6044 (Versions::define_base_version): Likewise.
6045 (Versions::add_def): Likewise.
6047 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6049 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6050 (Scan::possible_function_pointer_reloc): New function.
6051 (Scan::local_reloc_may_be_function_pointer): Change to call
6052 possible_function_pointer_reloc.
6053 (Scan::global_reloc_may_be_function_pointer): Ditto.
6054 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6055 relocations in ".data.rel.ro._ZTV" section.
6056 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6057 * testsuite/icf_safe_so_test.cc: Ditto.
6058 * testsuite/icf_safe_test.cc: Ditto.
6059 * testsuite/icf_safe_test.sh: Ditto.
6061 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6062 Ian Lance Taylor <iant@google.com>
6064 * target-reloc.h (relocate_section): Check the symbol table index
6065 for -1U before setting the local symbol index.
6066 (scan_relocatable_relocs): If copying the relocation, record that
6067 the local symbol is required.
6068 * object.h (Symbol_value::is_output_symtab_index_set): New
6070 (Symbol_value::may_be_discarded_from_output_symtab): New
6072 (Symbol_value::has_output_symtab_entry): New function.
6073 (Symbol_value::needs_output_symtab_entry): Remove.
6074 (Symbol_value::output_symtab_index): Make sure the symbol index is
6076 (Symbol_value::set_output_symtab_index): Make sure the symbol
6077 index is not set. Make sure the new index is valid.
6078 (Symbol_value::set_must_have_output_symtab_entry): New function.
6079 (Symbol_value::has_output_dynsym_entry): New function.
6080 (Symbol_value::set_output_dynsym_index): Make sure the new index
6082 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6083 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6084 local symbol if permitted.
6085 (Sized_relobj::do_finalize_local_symbols): Call
6086 is_output_symtab_index_set rather than needs_output_symtab_entry.
6087 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6088 rather than needs_output_symtab_entry. Call
6089 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6090 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6091 is_output_symtab_index_set rather than needs_output_symtab_entry.
6092 * testsuite/discard_locals_relocatable_test.c: New file.
6093 * testsuite/discard_locals_test.sh: Test -r.
6094 * testsuite/Makefile.am (check_DATA): Add
6095 discard_locals_relocatable_test1.syms,
6096 discard_local_relocatable_test2.syms.
6097 (MOSTLYCLEANFILES): Likewise. Also add
6098 discard_locals_relocatable_test1.lout and
6099 discard_locals_relocatable_test2.out.
6100 (discard_locals_relocatable_test1.syms): New target.
6101 (discard_locals_relocatable_test.o): New target.
6102 (discard_locals_relocatable_test1.out): New target.
6103 (discard_locals_relocatable_test2.syms): New target.
6104 (discard_locals_relocatable_test2.out): New target.
6105 (various): Add missing ../ld-new dependencies.
6106 * testsuite/Makefile.in: Rebuild.
6108 2010-03-03 Nick Clifton <nickc@redhat.com>
6110 * po/fi.po: New Finnish translation.
6112 2010-03-01 Doug Kwan <dougkwan@google.com>
6114 * layout.cc (Layout::Layout): Force section types of .init_array*,
6115 .preinit_array* and .fini_array* sections.
6116 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6117 Fix check of return value of std::string::find.().
6118 (Output_section::Input_section_sort_compare::operator()): Remove
6119 comment about .init_array.
6120 (Output_section::Input_section_sort_init_fini_compare::operator()):
6122 (Output_section::sort_attached_input_sections): Handle .init_array
6123 and .fini_array specially.
6124 * output.h (Output_section::Inut_section_sort_compare): Update
6126 (Output_section::Input_section_sort_init_fini_compare): New struct.
6128 2010-02-26 Doug Kwan <dougkwan@google.com>
6130 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6131 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6132 * testsuite/debug_msg.sh: Avoid matching source line number for
6133 use of global variable undef_int.
6135 2010-02-26 Doug Kwan <dougkwan@google.com>
6137 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6138 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6139 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6140 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6141 * options.cc (General_options::General_options): Initialize member
6143 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6144 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6145 and rm_no_fix_v4bx.stdout
6146 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6147 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6148 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6149 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6150 and arm_no_fix_v4bx.
6151 * Makefile.in: Regenerate.
6152 * testsuite/arm_fix_v4bx.s: New file.
6153 * testsuite/arm_fix_v4bx.sh: Ditto.
6155 2010-02-24 Doug Kwan <dougkwan@google.com>
6157 * arm.cc (Target_arm::got_section): Make the .got section the first
6158 non RELRO section in the data segment.
6159 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6160 suffixes of section names.
6162 2010-02-24 Doug Kwan <dougkwan@google.com>
6164 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6165 flags and attributes merging if an input file is a binary file.
6166 * fileread.cc (Input_file::open): Record format of original file.
6167 * fileread.h (Input_file::Format): New enum type.
6168 (Input_file::Input_file): Initialize data member format_.
6169 (Input_file::format): New method definition.
6170 (Input_file::format_):: New data member.
6172 2010-02-24 Doug Kwan <dougkwan@google.com>
6174 * arm.cc (Arm_output_data_got): New class.
6175 (ARM_TCB_SIZE): New constant
6176 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6177 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6178 If user uses a script with a SECTIONS clause, issue only a warning
6179 for a misplaced EXIDX input section. Otherwise, issue an error.
6180 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6182 (Target_arm::got_mode_index_entry): Handle static linking.
6183 (Target_arm::Scan::local): Ditto.
6184 (Target_arm::Scan::global): Ditto.
6185 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6186 all incorrectly implemented relocations.
6187 (Target_arm::fix_exidx_coverage): Pass layout to
6188 Arm_output_section::fix_exidx_coverage.
6189 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6190 from ".ARM.exidx." and ".ARM.extab.".
6192 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6194 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6195 section if it does not already exist.
6196 * attributes.cc (Attributes_section_data::Attributes_section_data):
6197 Don't crash if size is zero.
6199 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6200 Ian Lance Taylor <iant@google.com>
6202 * gold.cc (queue_middle_tasks): If no input files were opened,
6204 * workqueue.h (Task_function::Task_function): Assert that there is
6207 2010-02-22 Doug Kwan <dougkwan@google.com>
6209 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6210 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6211 types to avoid warnings due to different uint64_t implementations
6214 2010-02-21 Doug Kwan <dougkwan@google.com>
6216 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6217 handling of the maximum backward branch offset.
6218 (Arm_relocate_functions::thumb_branch_common): Ditto.
6219 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6220 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6221 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6222 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6223 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6224 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6225 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6226 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6227 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6228 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6229 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6230 thumb2_bl_out_of_range.o): New rules.
6231 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6232 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6233 thumb2_bl_out_of_range
6234 * testsuite/Makefile.in: Regenerate.
6235 * testsuite/arm_bl_in_range.s: New file.
6236 * testsuite/arm_bl_out_of_range.s: Ditto.
6237 * testsuite/arm_branch_in_range.sh: Ditto.
6238 * testsuite/arm_branch_range.t: Ditto.
6239 * testsuite/thumb2_branch_range.t: Ditto.
6240 * testsuite/thumb_bl_in_range.s: Ditto.
6241 * testsuite/thumb_bl_out_of_range.s: Ditto.
6242 * testsuite/thumb_branch_range.t: Ditto.
6244 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6246 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6247 Add reloc offset information.
6248 * icf.cc (get_section_contents): Change iterators to point to the new
6249 vectors. Add reloc offset information to the contents.
6250 * icf.h (Icf::Sections_reachable_info): New typedef.
6251 (Icf::Sections_reachable_list): New typedef.
6252 (Icf::Offset_info): New typedef.
6253 (Icf::Reloc_info): New struct typedef.
6254 (Icf::Reloc_info_list): New typedef.
6255 (Icf::symbol_reloc_list): Delete method.
6256 (Icf::addend_reloc_list): Delete method.
6257 (Icf::section_reloc_list): Delete method.
6258 (Icf::reloc_info_list): New method.
6259 (Icf::reloc_info_list_): New member.
6261 2010-02-19 Doug Kwan <dougkwan@google.com>
6263 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6264 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6265 * arm.cc (Arm_relocation_functions): New forward declaration.
6266 (Target_arm::Target_arm): Initialize new data members
6267 got_mod_index_offset_ and tls_base_symbol_defined_.
6268 (Target_arm::Relocate::relocate_tls): New method.
6269 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6270 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6272 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6273 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6274 (Target_arm::got_mod_index_offset_,
6275 Target_arm::tls_base_symbol_defined_): New data members.
6276 (Target_arm::Scan::local, Target::Scan::global,
6277 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6280 2010-02-18 Doug Kwan <dougkwan@google.com>
6282 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6283 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6284 text section as a parameter becuase some broken tools may not set
6285 the link in section header.
6286 (Target_arm::has_got_section): New method.
6287 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6288 without any mapping symbol as data only. Remove warning.
6289 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6290 link in its section header, try to discover the link by inspecting the
6291 REL31 relocation at the beginning of the section.
6292 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6294 (Target_arm::Scan::global): Treat any reference to the symbol
6295 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6297 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6299 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6300 (Scan::global_reloc_may_be_function_pointer): New function.
6301 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6302 (Scan::global_reloc_may_be_function_pointer): New function.
6303 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6304 (Scan::global_reloc_may_be_function_pointer): New function.
6305 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6306 (Scan::global_reloc_may_be_function_pointer): New function.
6307 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6308 (Scan::global_reloc_may_be_function_pointer): New function.
6309 (Scan::possible_function_pointer_reloc): New function.
6310 (Target_x86_64::can_check_for_function_pointers): New function.
6311 * gc.h (gc_process_relocs): Scan relocation types to determine if
6312 function pointers were taken for targets that support it.
6313 * icf.cc (Icf::find_identical_sections): Include functions for
6314 folding in safe ICF whose pointer is not taken.
6315 * icf.h (Secn_fptr_taken_set): New typedef.
6316 (fptr_section_id_): New member.
6317 (section_has_function_pointers): New function.
6318 (set_section_has_function_pointers): New function.
6319 (check_section_for_function_pointers): New function.
6320 * options.h: Fix comment for safe ICF option.
6321 * target.h (can_check_for_function_pointers): New function.
6322 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6323 Modify icf_safe_test for X86-64.
6324 * testsuite/Makefile.in: Regenerate.
6325 * testsuite/icf_safe_so_test.cc: New file.
6326 * testsuite/icf_safe_so_test.sh: New file.
6327 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6328 (main): Change to take pointer to function kept_func_3.
6329 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6330 folding is done correctly for X86-64.
6332 2010-02-12 David S. Miller <davem@davemloft.net>
6334 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6335 is_symbolless parameter.
6336 (Output_reloc<SHT_REL>::is_symbolless): New.
6337 (Output_reloc<SHT_REL>::is_symbolless_): New.
6338 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6339 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6340 (Output_reloc<SHT_RELA>::is_symbolless): New.
6341 (Output_data_reloc::add_global): Handle is_symbolless.
6342 (Output_data_reloc::add_global_relative): Likewise.
6343 (Output_data_reloc::add_local): Likewise.
6344 (Output_data_reloc::add_local_relative): Likewise.
6345 (Output_data_reloc::add_symbolless_global_addend): New.
6346 (Output_data_reloc::add_symbolless_local_addend): New.
6347 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6349 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6350 instead of ->is_relative_
6351 (Output_reloc::write): Likewise.
6352 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6353 (Output_reloc::write_rel): Simplify.
6355 * sparc.cc (Target_sparc::Scan::local): Use
6356 ->add_symbolless_local_addend as needed.
6357 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6358 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6359 based upon relocation offset.
6361 2010-02-11 Doug Kwan <dougkwan@google.com>
6363 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6364 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6365 beginning of function.
6366 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6367 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6368 parameter is_32bit in calls to should_apply_static_reloc.
6369 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6370 (check_DATA): Add arm_abs_global.stdout.
6371 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6372 arm_abs_global.stdout): New rules.
6373 (MOSTLLYCLEANFILES): Add arm_abs_global
6374 * Makefile.in: Regenerate.
6375 * testsuite/arm_abs_global.s: New file.
6376 * testsuite/arm_abs_global.sh: Ditto.
6377 * testsuite/arm_abs_lib.s: Ditto.
6379 2010-02-11 Ian Lance Taylor <iant@google.com>
6381 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6383 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6384 Allocate_commons_task first.
6385 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6386 task, rather than symtab_lock_.
6387 (Gc_process_relocs::~Gc_process_relocs): New function.
6388 (Gc_process_relocs::is_runnable): Check this_blocker_.
6389 (Gc_process_relocs::locks): Use next_blocker_ rather than
6391 (Scan_relocs::~Scan_relocs): New function.
6392 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6394 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6396 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6397 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6398 constructor accordingly.
6399 (class Gc_process_relocs): Likewise.
6400 (class Scan_relocs): Likewise.
6401 * common.h (class Allocate_commons_task): Remove symtab_lock_
6402 field, and corresponding constructor parameter.
6403 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6405 (Allocate_commons_task::locks): Likewise.
6407 2010-02-11 Ian Lance Taylor <iant@google.com>
6409 * gold-threads.h (class Once): Define.
6410 (class Initialize_lock): Rewrite as child of Once.
6411 * gold-threads.cc (class Once_initialize): Define.
6412 (once_pointer_control): New static variable.
6413 (once_pointer, once_arg): New static variables.
6414 (c_run_once): New static function.
6415 (Once::Once, Once::run_once, Once::internal_run): New functions.
6416 (class Initialize_lock_once): Remove.
6417 (initialize_lock_control): Remove.
6418 (initialize_lock_pointer): Remove.
6419 (initialize_lock_once): Remove.
6420 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6421 (Initialize_lock::initialize): Rewrite.
6422 (Initialize_lock::do_run_once): New function.
6423 * archive.cc (Archive::interpret_header): Only clear name if it is
6425 * fileread.cc: Include "gold-threads.h"
6426 (file_counts_lock): New static variable.
6427 (file_counts_initialize_lock): Likewise.
6428 (File_read::release): Only increment counts when using --stats.
6429 Use a lock around the increment.
6430 * parameters.cc (class Set_parameters_target_once): Define.
6431 (set_parameters_target_once): New static variable.
6432 (Parameters::Parameters): Move here from parameters.h.
6433 (Parameters::set_target): Rewrite.
6434 (Parameters::set_target_once): New function.
6435 (Parameters::clear_target): Move here and rewrite.
6436 * parameters.h (class Parameters): Update declarations. Add
6437 set_parameters_target_once_ field.
6438 (Parameters::Parameters): Move to parameters.cc.
6439 (Parameters::clear_target): Likewise.
6440 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6442 (Start_group::~Start_group): New function.
6443 (Start_group::is_runnable): New function.
6444 (Start_group::locks, Start_group::run): New functions.
6445 (Finish_group::run): Change saw_undefined to size_t.
6446 * readsyms.h (class Start_group): Define.
6447 (class Finish_group): Change saw_undefined_ field to size_t.
6448 (Finish_group::Finish_group): Remove saw_undefined and
6449 this_blocker parameters. Change all callers.
6450 (Finish_group::set_saw_undefined): New function.
6451 (Finish_group::set_blocker): New function.
6452 * symtab.h (class Symbol_table): Change saw_undefined to return
6453 size_t. Change saw_undefined_ field to size_t.
6454 * target-select.cc (Set_target_once::do_run_once): New function.
6455 (Target_selector::Target_selector): Initialize set_target_once_
6456 field. Don't initialize lock_ and initialize_lock_ fields.
6457 (Target_selector::instantiate_target): Rewrite.
6458 (Target_selector::set_target): New function.
6459 * target-select.h (class Set_target_once): Define.
6460 (class Target_selector): Update declarations. Make
6461 Set_target_once a friend. Remove lock_ and initialize_lock_
6462 fields. Add set_target_once_ field.
6464 2010-02-10 Ian Lance Taylor <iant@google.com>
6466 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6468 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6469 (queue_middle_tasks): Add all blockers before queueing any tasks.
6470 (queue_final_tasks): Likewise.
6471 * token.h (Task_token::add_blockers): New function.
6472 * object.h (Input_objects::number_of_relobjs): New function.
6474 2010-02-10 Ian Lance Taylor <iant@google.com>
6476 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6477 shared, not if not position independent.
6478 * x86_64.cc (Relocate::relocate_tls): Likewise.
6479 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6480 (tls_pie_pic_test): New target.
6481 * testsuite/Makefile.in: Rebuild.
6483 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6484 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6485 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6486 * testsuite/Makefile.in: Rebuild.
6488 2010-02-09 David S. Miller <davem@davemloft.net>
6490 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6491 R_SPARC_RELATIVE using ->add_local_relative().
6492 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6494 * output.h (Output_data_dynamic::add_section_size): New method
6495 that takes two Output_data objects.
6496 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6497 entry param. Handle it in initializers.
6498 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6499 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6500 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6502 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6503 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6504 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6505 for dynrel_includes_plt.
6506 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6507 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6508 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6510 (Target_sparc::do_finalize_sections): Update to pass true for
6511 dynrel_includes_plt.
6512 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6513 output before .rela.plt
6514 (Target_powerpc::do_finalize_sections): Update to pass true for
6515 dynrel_includes_plt when 32-bit.
6517 2010-02-08 Doug Kwan <dougkwan@google.com>
6519 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6521 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6522 Arm_relobj::scan_section_for_cortex_a8_stubs,
6523 Arm_relobj::do_relocation_section): Instead of calling
6524 Output_section::output_address, use faster
6525 Arm_relobj::simple_input_section_output_address.
6527 2010-02-08 David S. Miller <davem@davemloft.net>
6529 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6530 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6531 relocation helper function.
6533 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6534 just like R_SPARC_GOT{10,13,22}.
6535 (Target_sparc::Scan::local): Likewise.
6536 (Target_sparc::Relocate:relocate): Likewise.
6538 2010-02-06 Ian Lance Taylor <iant@google.com>
6540 * configure.ac: Rewrite targetobjs duplicate removal code to use
6541 only shell constructs.
6542 * configure: Rebuild.
6544 2010-02-05 Doug Kwan <dougkwan@google.com>
6547 * arm.cc (Arm_relobj::section_is_scannable): New method.
6548 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6549 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6551 2010-02-04 Doug Kwan <dougkwan@google.com>
6554 * arm-reloc-property.cc (cstdio): Include.
6555 * configure.ac (targetobjs): Remove duplicates.
6556 * configure: Regenerate.
6557 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6558 big and little endian version for a given address size.
6560 2010-02-03 Doug Kwan <dougkwan@google.com>
6562 * arm-reloc-property.cc
6563 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6565 * arm-reloc-property.h
6566 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6567 New method definition.
6568 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6570 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6572 (GOT_PREL): Change implemented to Y.
6573 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6574 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6575 (Arm_relocate_functions::movw_abs_nc): Remove method.
6576 (Arm_relocate_functions::movt_abs): Ditto.
6577 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6578 (Arm_relocate_functions::thm_movt_abs): Ditto.
6579 (Arm_relocate_functions::movw_rel_nc): Ditto.
6580 (Arm_relocate_functions::movw_rel): Ditto.
6581 (Arm_relocate_functions::movt_rel): Ditto.
6582 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6583 (Arm_relocate_functions:thm_movw_rel): Ditto.
6584 (Arm_relocate_functions:thm_movt_rel): Ditto.
6585 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6586 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6587 New method definitions.
6588 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6589 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6590 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6591 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6592 (Target_arm::Relocate::relocate): Check for non-static or
6593 unimplemented relocation code and exit early. Change calls to
6594 Target_arm::reloc_uses_thumb_bit and
6595 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6596 instead. Refactor code to handle similar relocations to increase
6597 code sharing. Remove check for unsupported relocation code in switch
6599 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6600 relocation property table to find out size. Change error message to
6601 print out the name of a relocation code instead of the numeric value.
6602 (Target_arm::scan_reloc_for_stub): Use relocation property table
6603 instead of calling Target_arm::reloc_uses_thumb_bit().
6605 2010-02-02 Doug Kwan <dougkwan@google.com>
6607 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6608 types of relaxed input section.
6610 2010-02-02 Doug Kwan <dougkwan@google.com>
6612 * Makefile.am (HFILES): Add arm-reloc-property.h.
6614 (TARGETSOURCES): Add arm-reloc-property.cc
6615 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6616 (libgold_a_SOURCES): $(DEFFILES)
6617 * Makefile.in: Regenerate.
6618 * arm-reloc-property.cc: New file.
6619 * arm-reloc-property.h: New file.
6620 * arm-reloc.def: New file.
6621 * arm.cc: Update comments.
6622 (arm-reloc-property.h): New included header.
6623 (arm_reloc_property_table): New global variable.
6624 (Target_arm::do_select_as_default_target): New method definition.
6625 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6626 arm-reloc-property to targ_extra_obj.
6627 * parameters.cc (set_parameters_target): Call
6628 Target::select_as_default_target().
6629 * target.h (Target::select_as_default_target): New method definition.
6630 (Target::do_select_as_default_target): Same.
6632 2010-02-01 Doug Kwan <dougkwan@google.com>
6634 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6635 first_output_text_section_.
6636 (Arm_exidx_fixup::first_output_text_section): New method definition.
6637 (Arm_exidx_fixup::first_output_text_section_): New data member.
6638 (Arm_exidx_fixup::process_exidx_section): Record the first text
6639 output section seen.
6640 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6641 and entsize in output section header.
6643 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6645 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6646 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6647 (Arm_relocate_functions::thm_alu11): New Method.
6648 (Arm_relocate_functions::thm_pc8): New Method.
6649 (Arm_relocate_functions::thm_pc12): New Method.
6650 (Target_arm::Scan::local): Handle the relocations.
6651 (Target_arm::Scan::global): Likewise.
6652 (Target_arm::Relocate::relocate): Likewise.
6653 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6655 2010-01-29 Doug Kwan <dougkwan@google.com>
6657 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6658 of relocation types as ld.
6660 2010-01-29 Doug Kwan <dougkwan@google.com>
6662 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6664 (Arm_relocate_functions::thumb_branch_common): Ditto.
6665 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6666 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6667 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6668 Arm_relocate_functions::jump24): Remove.
6669 (Target_arm::Relocate::relocate): Adjust code to call
6670 Arm_relocation_functions::arm_branch_common and
6671 Arm_relocation_functions::thumb_branch_common instead of their removed
6672 wrappers. Merge switch-cases together to reduce source code size.
6674 2010-01-29 Doug Kwan <dougkwan@google.com>
6676 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6677 output_local_symbol_count_needs_update_.
6678 (Arm_relobj::output_local_symbol_count_needs_update,
6679 Arm_relobj::set_output_local_symbol_count_needs_update,
6680 Arm_relobj::update_output_local_symbol_count): New methods.
6681 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6683 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6684 of pointed function as in a R_ARM_PREL31 relocation.
6685 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6686 for output local symbol count updating.
6687 (Target_arm::do_relax): Update output local symbol counts in objects
6689 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6691 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6693 * arm.cc: Added support for the ARM relocations:
6694 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6695 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6696 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6698 (Arm_relocate_functions::movw_rel): New method.
6699 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6700 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6702 (Arm_relocate_functions::thm_movw_rel): New method.
6703 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6705 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6707 (Target_arm::Scan::global): Likewise.
6708 (Target_arm::Relocate::relocate): Likewise.
6709 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6712 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6714 * arm.cc: Added support for ARM group relocations.
6715 (Target_arm::reloc_needs_sym_origin): New method.
6716 (Arm_relocate_functions::calc_grp_kn): New method.
6717 (Arm_relocate_functions::calc_grp_residual): New method.
6718 (Arm_relocate_functions::calc_grp_gn): New method.
6719 (Arm_relocate_functions::arm_grp_alu): New Method.
6720 (Arm_relocate_functions::arm_grp_ldr): New Method.
6721 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6722 (Arm_relocate_functions::arm_grp_ldc): New Method.
6723 (Target_arm::Scan::local): Handle the ARM group relocations.
6724 (Target_arm::Scan::global): Likewise.
6725 (Target_arm::Relocate::relocate): Likewise.
6726 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6729 2010-01-26 Doug Kwan <dougkwan@google.com>
6731 * arm.cc (set): Include.
6732 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6734 (Arm_output_section::Text_section_list): New type.
6735 (Arm_output_section::append_text_sections_to_list): New method.
6736 (Arm_output_section::fix_exidx_coverage): Ditto.
6737 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6738 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6739 Relobj::set_section_offset() instead of
6740 Sized_relobj::invalidate_section_offset().
6741 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6742 parameter for section headers. Ignore relocation sections for
6743 unallocated sections and EXIDX sections.
6744 (Target_arm::fix_exidx_coverage): New method.
6745 (Target_arm::output_section_address_less_than): New type.
6746 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6747 linked text section instead of the EXIDX section.
6748 (Arm_output_section::create_stub_group): Add an assertion to check
6749 that this is not an EXIDX output section.
6750 (Arm_output_section::append_text_sections_to_list): New method.
6751 (Arm_output_section::fix_exidx_coverage): Ditto.
6752 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6753 Arm_relobj::section_needs_reloc_stub_scanning.
6754 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6756 (Target_arm::fix_exidx_coverage): New method.
6757 * object.h (Relobj::set_output_section): New method.
6758 (Sized_relobj::invalidate_section_offset): Remove method.
6759 (Sized_relobj::do_invalidate_section_offset): Remove method.
6760 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6762 2010-01-25 Doug Kwan <dougkwan@google.com>
6764 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6765 Fix warning due to signed and unsigned comparison on a 32-bit host.
6767 2010-01-22 Doug Kwan <dougkwan@google.com>
6769 * arm.cc (Target_arm::do_relax): Record an output section for section
6770 offset adjustment it contains any stub table that has changed.
6771 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6772 offsets in an output section if necessary.
6773 * output.cc (Output_section::Output_section): Initialize
6774 section_offsets_need_adjustments_.
6775 (Output_section::add_input_section_for_script): Renamed to
6776 Output_section::add_simple_input_section.
6777 (Output_section::save_states): Add a comment.
6778 (Output_section::discard_states): New method defintion.
6779 (Output_section::adjust_section_offsets): Same.
6780 * output.h (Output_section::add_input_section_for_script): Renamed to
6781 Output_section::add_simple_input_section.
6782 (Output_section::discard_states): New method declaration.
6783 (Output_section::adjust_section_offsets): Same.
6784 (Output_section::section_offsets_need_adjustment,
6785 Output_section::set_section_offsets_need_adjustment): New method
6787 (Output_section::section_offsets_need_adjustment_): New data member.
6788 * script-sections.cc
6789 (Output_section_element_input::set_section_address): Adjust code for
6790 renaming of Output_section::add_input_section_for_script.
6791 (Orphan_output_section::set_section_address): Same.
6793 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6795 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6796 Fix_v4bx enum values .
6797 * gold/options.h (General_options): New option definitions.
6798 (General_options::fix_v4bx): New method.
6799 (General_options::Fix_v4bx): New enum.
6800 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6801 (General_options::parse_fix_v4bx_interworking): New method.
6803 2010-01-22 Doug Kwan <dougkwan@google.com>
6805 * arm.cc (Arm_exidx_fixup): New class.
6807 2010-01-21 Doug Kwan <dougkwan@google.com>
6809 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6811 (Arm_exidx_section_offset_map): New type.
6813 2010-01-21 Doug Kwan <dougkwan@google.com>
6815 * arm.cc (Arm_exidx_input_section): New class.
6816 (Arm_relobj::exidx_input_section_by_link,
6817 Arm_relobj::exidx_input_section_by_shndx,
6818 Arm_relobj::make_exidx_input_section): New methods.
6819 (read_arm_attributes_section): Remove.
6820 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6821 information about them.
6822 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6825 2010-01-20 Doug Kwan <dougkwan@google.com>
6827 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6828 Input_section_specifier to Section_id.
6829 (Target_arm::new_arm_input_section: Adjust code for change of key
6831 (Target_arm::find_arm_input_section): Ditto.
6832 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6833 (Section_id): Remove.
6834 (Garbage_collection::Section_id_hash): Remove.
6835 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6836 (Section_id): Remove.
6837 (Icf::Section_id_hash): Remove.
6838 * object.h (Section_id, Const_section_id, Section_id_hash,
6839 Const_section_id_hash): New type definitions.
6840 * output.cc (Output_section::add_relaxed_input_section): Change to
6841 use Const_section_id instead of Input_section_specifier as key type.
6842 (Output_section::add_merge_input_section): Ditto.
6843 (Output_section::build_relaxation_map): Change to use Section_id
6844 instead of Input_section_specifier as key type.
6845 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6847 (Output_section::convert_input_sections_to_relaxed_sections): Change
6848 to use Const_section_id instead of Input_section_specifier as key type.
6849 (Output_section::find_merge_section): Ditto.
6850 (Output_section::find_relaxed_input_section): Ditto.
6851 * output.h (Input_section_specifier): Remove class.
6852 (Output_section::Output_section_data_by_input_section_map): Change
6853 key type to Const_section_id.
6854 (Output_section::Output_relaxed_input_section_by_input_section_map):
6856 (Output_section::Relaxation_map): Change key type to Section_id.
6858 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6860 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6861 (class Arm_v4bx_stub): New class.
6862 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6863 (Stub_factory::make_arm_v4bx_stub): New method.
6864 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6865 (Stub_table::empty): Handle v4bx stubs.
6866 (Stub_table::add_arm_v4bx_stub): New method.
6867 (Stub_table::find_arm_v4bx_stub): New method.
6868 (Arm_relocate_functions::v4bx): New method.
6869 (Target_arm::fix_v4bx): New method.
6870 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6871 (Stub_table::relocate_stubs): Likewise.
6872 (Stub_table::do_write): Likewise.
6873 (Stub_table::update_data_size_and_addralign): Likewise.
6874 (Stub_table::finalize_stubs): Likewise.
6875 (Target_arm::Scan::local): Likewise.
6876 (Target_arm::Scan::global): Likewise.
6877 (Target_arm::do_finalize_sections): Likewise.
6878 (Target_arm::Relocate::relocate): Likewise.
6879 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6881 (Target_arm::scan_reloc_for_stub): Likewise.
6882 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6884 2010-01-19 Ian Lance Taylor <iant@google.com>
6886 * output.cc (Output_section_headers::do_sized_write): Write large
6887 segment count to sh_info field.
6888 (Output_file_header::do_sized_write): For large segment count,
6889 write PN_XNUM to e_phnum field.
6891 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6893 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6894 (Arm_relocate_functions::thm_jump8): New function.
6895 (Arm_relocate_functions::thm_jump11): New function.
6896 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6898 (Target_arm::Scan::global): Likewise.
6899 (Target_arm::Relocate::relocate): Likewise.
6900 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6903 2010-01-14 Doug Kwan <dougkwan@google.com>
6905 * arm.cc (map, utility): Include headers.
6906 (Target_arm::apply_cortex_a8_workaround): New method.
6907 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6908 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6909 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6910 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6911 the --[no-]fix-cortex-a8 command line options.
6912 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6913 (Target_arm::relocate_stub): Use addend in instruction template.
6914 * options.h (DEFINE_bool): Set the user-set flag.
6915 (General_options): Add --[no-]-fix-cortex options.
6916 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6917 : Update fast look-up map after conversion.
6919 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6921 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6922 in the first pass of do_layout.
6924 2010-01-13 Doug Kwan <dougkwan@google.com>
6926 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6927 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6928 apparent compiler problem of not folding static constant integral
6929 data members of elfcpp::Elf_sizes<32>.
6931 2010-01-13 Doug Kwan <dougkwan@google.com>
6933 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6934 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6935 Arm_relobj::scan_section_for_cortex_a8_erratum,
6936 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6937 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6938 sections to scan for relocation stubs into a new method
6939 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6940 relocation and Cortex-A8 stub scanning.
6941 (Target_arm::do_relax): Force stubs to be after stubbed sections
6942 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
6943 the beginning of a new relaxation pass. Update a comment.
6944 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6946 2010-01-12 Ian Lance Taylor <iant@google.com>
6948 * target-reloc.h (visibility_error): New inline function.
6949 (relocate_section): Call visibility_error.
6950 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6951 (MOSTLYCLEANFILES): Likewise.
6952 (protected_4_pic.o, protected_3.err): New targets.
6953 * testsuite/protected_4.cc: New file.
6955 2010-01-12 Doug Kwan <dougkwan@google.com>
6957 * arm.cc (Cortex_a8_reloc): New class.
6958 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6959 and cortex_a8_relocs_info_.
6960 (Target_arm::fix_cortex_a8): New method definition.
6961 (Target_arm::Cortex_a8_relocs_info): New type.
6962 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6963 New data member declarations.
6964 (Target_arm::scan_reloc_for_stub): Record information about
6965 relocations for THUMB branches that might be exempted from the
6966 Cortex-A8 workaround.
6967 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6968 at the beginning of a relaxation pass.
6970 2010-01-12 Doug Kwan <dougkwan@google.com>
6972 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6973 (Arm_relobj::Mapping_symbol_position,
6974 Arm_reloj::Mapping_symbol_position_less,
6975 Arm_relobj::Mapping_symbols_info): New types.
6976 (Target_arm::is_mapping_symbol_name): New method definition.
6977 (Arm_relobj::do_count_local_symbols): Save information about mapping
6980 2010-01-11 Doug Kwan <dougkwan@google.com>
6982 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6983 Arm_relocate_functions::thumb32_branch_upper,
6984 Arm_relocate_functions::thumb32_branch_lower,
6985 Arm_relocate_functions::thumb32_cond_branch_offset,
6986 Arm_relocate_functions::thumb32_cond_branch_upper,
6987 Arm_relocate_functions::thumb32_cond_branch_lower,
6988 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6989 branch offset encoding.
6990 (Arm_relocate_functions::thumb_branch_common): Use new branch
6991 offset encoding methods to avoid code duplication.
6992 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6993 (Stub_addend_reader::operator()): Use new branch encoding method
6994 to avoid code duplication.
6996 2010-01-11 Doug Kwan <dougkwan@google.com>
6998 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6999 (Target_arm::do_finalize_sections): Define special EXIDX section
7000 symbols only if referenced.
7001 * gc.h (Garbage_collection::add_reference): New method.
7002 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7005 2010-01-11 Ian Lance Taylor <iant@google.com>
7007 * script.cc (Version_script_info::build_expression_list_lookup):
7008 Change complaing about duplicate wildcard match from error to
7011 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7013 (Version_script_info::Version_script_info): Initialize globs_,
7014 default_version_, default_is_global_, and exact_. Don't
7015 initialize globals_ or locals_.
7016 (Version_script_info::build_lookup_tables): Build local symbols
7018 (Version_script_info::unquote): New function.
7019 (Version_script_info::add_exact_match): New function.
7020 (Version_script_info::build_expression_list_lookup): Remove lookup
7021 parameter. Add is_global parameter. Change all callers. Handle
7022 wildcard pattern specially. Unquote pattern. Call
7024 (Version_script_info::get_name_to_match): New function.
7025 (Version_script_info::get_symbol_version): New function.
7026 (Version_script_info::get_symbol_version_helper): Remove.
7027 (Version_script_info::check_unmatched_names): Call unquote.
7028 * script.h (class Version_script_info): Change get_symbol_version
7029 to be non-inline and add is_global parameter; change all callers.
7030 Rewrite symbol_is_local. Update declarations. Define struct
7031 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7032 Remove globals_ and locals_ members. Add exact_, globs_,
7033 default_version_, is_global_.
7034 (Version_script_info::Glob): Remove pattern, add expression and
7035 is_global. Update constructor. Change all callers.
7036 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7038 (Versions::symbol_section_contents): If a symbol is undefined, or
7039 defined in a dynamic object, set the version index to
7041 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7043 (Symbol_table::add_from_pluginobj): Likewise.
7044 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7046 2010-01-11 Doug Kwan <dougkwan@google.com>
7048 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7049 (incremental_dump_LDADD): Add linking option for libintl.
7050 * Makefile.in: Regenerate.
7052 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7055 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7057 * testsuite/Makefile.in: Regenerated.
7059 2010-01-10 Doug Kwan <dougkwan@google.com>
7061 * options.h (DEFINE_var): Use parentheses around argument varname__
7062 in macro body to avoid any unintended subsequent substitutions.
7064 2010-01-10 Ian Lance Taylor <iant@google.com>
7066 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7067 candidates before doing symbol resolution.
7069 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7070 ODR candidates if only one is weak.
7072 2010-01-08 Ian Lance Taylor <iant@google.com>
7074 * script.cc (Version_script_info::build_expression_list_lookup):
7075 Don't warn about ambiguous version, just record the ambiguity.
7076 (Version_script_info::get_symbol_version_helper): Give error if
7077 version is ambiguous.
7079 2010-01-08 Doug Kwan <dougkwan@google.com>
7081 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7082 prev_data_size_ and prev_addralign_. Remove initializer for
7083 deleted data member has_been_changed_.
7084 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7085 to determine if the table is empty.
7086 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7088 (Stub_table::add_reloc_stub): Define method in class definition
7089 instead of just declaring it there.
7090 (Stub_table::add_cortex_a8_stub): New method definition.
7091 (Stub_table::update_data_size_and_addralign): Ditto.
7092 (Stub_table::finalize_stubs): Ditto.
7093 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7094 (Stub_table::do_addralign_): Return address alignment in the
7095 (Stub_table::do_reset_address_and_file_offset): Define method in
7096 class definition instead of declaring it there. Set current data
7097 size to be the data size of the previous pass.
7098 (Stub_table::set_final_data_size): Use current data size as the
7100 (Stub_table::relocate_stub): Change parameter type of stub from
7101 Reloc_stub pointer to Stub pointer.
7102 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7103 (Stub_table::Cortex_a8_stub_list): New typedef.
7104 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7105 Stub_table::prev_addralign_): New data member.
7106 (Arm_relobj::Arm_relobj): Initialize data member
7107 section_has_cortex_a8_workaround_.
7108 (Arm_relobj::section_has_cortex_a8_workaround,
7109 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7111 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7113 (Target_arm::relocate_stub): Change parameter type of stub from
7114 Reloc_stub pointer to Stub pointer.
7115 (Insn_template::size, Insn_template::alignment): Handle
7116 THUMB16_SPECIAL_TYPE.
7117 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7118 Stub_table::update_data_size_and_addralign,
7119 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7121 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7122 (Stub_table::do_write): Ditto.
7123 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7125 2010-01-08 Ian Lance Taylor <iant@google.com>
7128 * symtab.h (class Symbol): Remove fields is_target_special_ and
7129 has_plt_offset_. Add field is_defined_in_discarded_section_.
7130 (Symbol::is_defined_in_discarded_section): New function.
7131 (Symbol::set_is_defined_in_discarded_section): New function.
7132 (Symbol::has_plt_offset): Rewrite.
7133 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7134 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7135 Don't initialize is_target_special_ or has_plt_offset_.
7136 Initialize is_defined_in_discarded_section_.
7137 (Symbol_table::add_from_relobj): If appropriate, set
7138 is_defined_in_discarded_section.
7139 * resolve.cc (Symbol::override_base_with_special): Don't test
7140 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7141 * target-reloc.h (relocate_section): Do special handling for
7142 symbols defined in discarded sections for global symbols as well
7145 2010-01-08 Ian Lance Taylor <iant@google.com>
7147 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7148 the SHT_SYMTAB case.
7150 2010-01-08 Ian Lance Taylor <iant@google.com>
7152 * object.cc (Sized_relobj::do_layout): Don't get confused if
7153 layout_eh_frame returns NULL.
7155 2010-01-08 Ian Lance Taylor <iant@google.com>
7158 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7159 dynamic symbol table, use the normal symbol table.
7160 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7163 2010-01-08 Ian Lance Taylor <iant@google.com>
7166 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7169 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7171 * version.cc (print_version): Change to "Copyright 2010".
7173 2010-01-08 Ian Lance Taylor <iant@google.com>
7177 * i386.cc (class Target_i386): Change return type of plt_section
7179 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7180 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7181 tls_desc_rel_ field.
7182 (Output_data_plt_i386::rel_tls_desc): New function.
7183 (Target_i386::rel_tls_desc_section): New function.
7184 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7185 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7186 R_386_TLS_DESC reloc in rel_tls_desc_section.
7187 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7188 Define struct Tlsdesc_info.
7189 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7190 (Target_x86_64::do_reloc_symbol_index): New function.
7191 (Target_x86_64::add_tlsdesc_info): New function.
7192 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7193 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7195 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7197 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7198 (Target_x86_64::rela_tlsdesc_section): New function.
7199 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7201 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7202 (Target_x86_64::do_reloc_addend): New function.
7203 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7204 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7205 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7206 (Output_reloc::type): New function.
7207 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7208 (Output_reloc::is_target_specific): New function.
7209 (Output_reloc::target_arg): New function.
7210 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7211 absolute relocs and target specific relocs.
7212 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7213 add_target_specific.
7214 (class Output_data_reloc) [SHT_RELA]: Likewise.
7215 * output.cc (Output_reloc::Output_reloc): Add four new versions
7216 for absolute relocs and target specific relocs.
7217 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7218 (Output_reloc::get_symbol_index): Likewise.
7219 (Output_reloc::local_section_offset): Check that local_sym_index_
7220 is not TARGET_CODE or 0.
7221 (Output_reloc::symbol_value): Likewise.
7222 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7224 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7225 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7227 * layout.cc (add_target_dynamic_tags): Use output section for
7228 DT_PLTRELSZ and DT_JMPREL.
7230 2010-01-07 Ian Lance Taylor <iant@google.com>
7233 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7235 (class Output_data_reloc_generic): Define.
7236 (class Output_data_reloc_base): Change base class to
7237 Output_data_reloc_generic. Change add() method to call
7238 bump_relative_reloc_count for a relative reloc. Remove
7240 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7242 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7243 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7245 * layout.h (class Layout): Update declaration.
7247 2010-01-07 Ian Lance Taylor <iant@google.com>
7249 * output.h (class Output_data): Add const version of
7250 output_section and do_output_section.
7251 (class Output_section_data): Add const version of
7253 (class Output_section): Likewise.
7254 * layout.cc (Layout::add_target_dynamic_tags): New function.
7255 * layout.h (class Layout): Update declarations.
7256 * arm.cc (Target_arm::do_finalize_sections): Use
7257 add_target_dynamic_tags.
7258 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7259 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7260 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7261 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7263 2010-01-07 Ian Lance Taylor <iant@google.com>
7266 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7269 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7270 Ian Lance Taylor <iant@google.com>
7273 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7274 Xindex::read_symtab_xindex.
7276 2010-01-07 Doug Kwan <dougkwan@google.com>
7278 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7279 (Insn_template::thumb16_bcond_insn): New method declaration.
7280 (Insn_template): Fix spelling.
7281 (Stub::thumb16_special): New method declaration.
7282 (Stub::do_write): Define virtual method which was previously pure
7284 (Stub::do_thumb16_special): New method declaration.
7285 (Stub::do_fixed_endian_write): New template member.
7286 (Reloc_stub::do_write): Remove.
7287 (Reloc_stub::do_fixed_endian_write): Remove.
7288 (Cortex_a8_stub): New class definition.
7289 (Stub_factory::make_cortex_a8_stub): New method definition.
7290 (Stub_factory::Stub_factory): Add missing static storage class
7291 qualifier for elf32_arm_stub_a8_veneer_blx.
7293 2010-01-07 Ian Lance Taylor <iant@google.com>
7296 * options.h (class General_options): Add --warn-unresolved-symbols
7297 and --error-unresolved-symbols.
7298 * errors.cc (Errors::undefined_symbol): Implement
7299 --warn-unresolved-symbols.
7301 * options.h (class General_options): Add -z text and -z textoff.
7302 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7304 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7306 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7307 (Garbage_collection::cident_sections): New function.
7308 (Garbage_collection::add_cident_section): New function.
7309 (Garbage_collection::cident_sections_): New member.
7310 (gc_process_relocs): Add references to sections whose names are C
7312 * gold.h (cident_section_start_prefix): New constant.
7313 (cident_section_stop_prefix): New constant.
7314 (is_cident): New function.
7315 * layout.cc (Layout::define_section_symbols): Replace string constants
7316 with the newly defined constants.
7317 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7319 * testsuite/Makefile.am: Add gc_orphan_section_test.
7320 * testsuite/Makefile.in: Regenerate.
7321 * testsuite/gc_orphan_section_test.cc: New file.
7322 * testsuite/gc_orphan_section_test.sh: New file.
7324 2010-01-06 Ian Lance Taylor <iant@google.com>
7327 * options.h (class General_options): Add --warn-shared-textrel.
7328 * layout.cc (Layout::finish_dynamic_section): Implement
7329 --warn-shared-textrel.
7332 * options.h (class General_options): Add --warn-multiple-gp.
7334 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7336 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7337 $(THREADSLIB) and $(LIBDL).
7338 * Makefile.in: Rebuild.
7340 2010-01-06 Ian Lance Taylor <iant@google.com>
7343 * options.cc (General_options::parse_section_start): New function.
7344 (General_options::section_start): New function.
7345 (General_options::General_options): Initialize all members.
7346 * options.h: Include <map>
7347 (class General_options): Add --section-start. Add section_starts_
7349 * layout.cc (Layout::attach_allocated_section_to_segment): If
7350 --section-start was used, set the address of the segment. Remove
7351 local sort_sections.
7352 (Layout::relaxation_loop_body): If the address of the load segment
7353 has been set by --section-start, don't use it.
7354 * output.h (Output_segment::update_flags_for_output_section): New
7356 * output.cc (Output_segment::add_output_section): Call
7357 update_flags_for_output_section.
7359 2010-01-05 Ian Lance Taylor <iant@google.com>
7362 * options.h (class General_options): Add --undefined-version.
7363 * script.cc (struct Version_expression): Add was_matched_by_symbol
7365 (Version_script_info::matched_symbol): New function.
7366 (Version_script_info::get_symbol_version_helper): Call
7368 (Version_script_info::check_unmatched_names): New function.
7369 * script.h (class Version_script_info): Update declarations.
7370 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7372 * options.h (class General_options): Use DEFINE_bool_alias for
7373 allow_multiple_definition.
7374 * resolve.cc (Symbol_table::should_override): Don't test
7375 allow_multiple_definition.
7378 * options.h (class General_options): Add --cref.
7379 * main.cc (main): Print cref table if --cref. Don't close mapfile
7380 until after printing cref table.
7381 * cref.cc: Include "symtab.h".
7382 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7383 (Cref_table_compare::operator()): New function.
7384 (Cref_inputs::gather_cref): New function.
7385 (filecol): New static const.
7386 (Cref_inputs::print_cref): New function.
7387 (Cref::print_cref): New function.
7388 * cref.h: Include <cstdio>.
7389 (class Cref): Update declarations.
7390 * mapfile.h (Mapfile::file): New function.
7391 * object.h (class Object): Define Symbols. Declare virtual
7392 do_get_global_symbols.
7393 (Object::get_global_symbols): New function.
7394 * object.cc (Input_objects::add_object): Pass object to cref_ if
7396 (Input_objects::archive_start): Likewise.
7397 (Input_objects::archive_stop): Likewise.
7398 (Input_objects::print_cref): New function.
7399 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7400 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7402 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7404 * plugin.h (class Sized_pluginobj): Update declarations.
7406 2010-01-05 Ian Lance Taylor <iant@google.com>
7408 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7409 to is_default_version. Rename insdef to insdefault.
7410 (Symbol_table::add_from_relobj): Rename def to is_default_version
7411 and local to is_forced_local.
7412 (Symbol_table::add_from_pluginobj): Likewise.
7413 (Symbol_table::add_from_dynobj): Likewise.
7414 (Symbol_table::define_special_symbol): Rename insdef to
7417 2010-01-04 Ian Lance Taylor <iant@google.com>
7420 * options.h (class General_options): Add
7421 --allow-multiple-definition and -z muldefs.
7422 * resolve.cc (Symbol_table::should_override): Don't warn about a
7423 multiple symbol definition if --allow-multiple-definition or -z
7427 * options.h (class General_options): Add --add-needed and
7428 --copy-dt-needed-entries. Tweak --as-needed help entry.
7429 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7430 error if --copy-dt-needed-entries aka --add-needed is used and
7431 would cause a change in behaviour.
7434 * options.h (class General_options): Add -G as a short version of
7435 --shared. Add no-op options -assert, -g, and -i.
7437 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7439 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7440 check for .text or .gnu.linkonce.t sections.
7441 * icf.cc (Icf::find_identical_sections): Ditto.
7442 Change the detection for mangled function name within the section
7444 * icf.h (is_section_foldable_candidate): New function.
7446 2009-12-30 Ian Lance Taylor <iant@google.com>
7449 * options.h (class General_options): Permit two dashes with
7450 --retain-symbols-file.
7452 2009-12-30 Ian Lance Taylor <iant@google.com>
7455 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7456 don't put the file header and segment headers in the text
7460 * common.cc (Sort_commons::operator()): Stabilize sort when both
7462 (Symbol_table::do_allocate_commons_list): When allocating common
7463 symbols, skip a symbol which is no longer common.
7464 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7465 an object before checking its type.
7466 * testsuite/common_test_2.c: New file.
7467 * testsuite/common_test_3.c: New file.
7468 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7469 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7470 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7471 (common_test_2_pic.o, common_test_2.so): New targets.
7472 (common_test_3_pic.o, common_test_3.so): New targets.
7473 * testsuite/Makefile.in: Rebuild.
7476 * script.cc (read_input_script): If we see a new SECTIONS clause,
7477 and we have added an input section, give an error.
7478 * layout.h (class Layout): Add have_added_input_section function.
7479 Add have_added_input_section_ field.
7480 * layout.cc (Layout::Layout): Initialize
7481 have_added_input_section_.
7482 (Layout::layout): Set have_added_input_section_.
7483 (Layout::layout_eh_frame): Likewise.
7485 2009-12-30 Ian Lance Taylor <iant@google.com>
7488 * options.h (class General_options): Add --sort-common option.
7489 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7490 * common.cc (Sort_common): Add sort_order parameter to
7491 constructor. Add sort_order_ field.
7492 (Sort_commons::operator): Check sort_order_.
7493 (Symbol_table::allocate_commons): Determine the sort order.
7494 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7496 (Symbol_table::do_allocate_commons_list): Likewise.
7498 2009-12-30 Ian Lance Taylor <iant@google.com>
7501 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7502 symbols from this object, don't change the visibility of an
7504 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7506 2009-12-30 Ian Lance Taylor <iant@google.com>
7509 * script.h (class Version_script_info): Define Language enum.
7510 Update declarations. Define Glob, Exact, and Lookup types. Add
7511 new fields globals_, locals_, and is_finalized_.
7512 * script.cc: Various formatting fixes.
7513 (class Parser_closure): Change language_stack_ from a vector of
7514 std::string to one of Version_script_info::Language. Adjust all
7516 (class Lazy_demangler): Remove.
7517 (struct Version_expression): Change language from std::string to
7518 Version_script_info::Language.
7519 (Version_script_info::Version_script_info): New function.
7520 (Version_script_info::~Version_script_info): Don't call clear.
7521 (Version_script_info::finalize): New function.
7522 (Version_script_info::build_lookup_tables): New function.
7523 (Version_script_info::build_expression_list_lookup): New
7525 (Version_script_info::get_symbol_version_helper): Rewrite to use
7527 (Version_script_info::print_expression_list): Adjust to use
7528 Version_script_info::Language.
7529 (script_push_lex_into_version_mode): Check that the version script
7530 has not been finalized.
7531 (version_script_push_lang): Change language string to
7532 Version_script_info::Language.
7533 * options.cc (Command_line::version_script): New function.
7534 * options.h (class General_options): Add finalize_dynamic_list
7535 function. Change version_script from declaration to definition.
7536 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7537 * testsuite/version_script.map: Remove duplicate def of foo.
7538 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7540 * testsuite/Makefile.in: Rebuild.
7542 2009-12-30 Ian Lance Taylor <iant@google.com>
7545 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7546 if the input symbol index is 0, make the output symbol index 0.
7548 2009-12-30 Ian Lance Taylor <iant@google.com>
7551 * options.h (class General_options): Add -x/--discard-all.
7552 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7553 --discard-all. If the local symbol needs a dynamic entry, check
7554 that before handling --discard-locals.
7556 2009-12-30 Ian Lance Taylor <iant@google.com>
7559 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7561 (Output_segment::add_output_section): Don't change the flags if
7565 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7566 GNU hash table if they need a dynamic value. Otherwise, don't add
7567 them if they are defined in a dynamic object or are forced local.
7569 2009-12-29 Ian Lance Taylor <iant@google.com>
7572 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7573 .gnu.hash table for a 32-bit target.
7576 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7577 regular and a dynamic object only needs a dynamic symbol table
7578 entry if it is externally visible.
7581 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7582 constructor. Add global_offset_table_ field.
7583 (Target_i386::got_section): Set global_offset_table_.
7584 (Target_i386::do_finalize_sections): Set global_offset_table_
7586 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7587 in constructor. Add global_offset_table_ field.
7588 (Target_x86_64::got_section): Set global_offset_table_.
7589 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7592 * layout.cc (Layout::Layout): Initialize increase_relro_.
7593 (Layout::get_output_section): Add is_relro, is_last_relro, and
7594 is_first_non_relro parameters. Change all callers.
7595 (Layout::choose_output_section): Likewise.
7596 (Layout::add_output_section_data): Likewise.
7597 (Layout::make_output_section): Likewise.
7598 (Layout::set_segment_offsets): Clear increase_relro when using a
7600 * layout.h (class Layout): Add increase_relro method. Add
7601 increase_relro_ field. Update declarations.
7602 * output.cc (Output_section::Output_section): Initialize
7603 is_last_relro_ and is_first_non_relro_.
7604 (Output_segment::add_output_section): Group relro sections is
7605 do_sort is true. Handle is_last_relro and is_first_non_relro.
7606 (Output_segment::maximum_alignment): Remove relro handling.
7607 (Output_segment::set_section_addresses): Add increase_relro
7608 parameter. Change all callers. Add initial alignment to align
7609 relro sections on separate page. Remove old relro handling.
7610 (Output_segment::set_section_list_addresses): Remove in_relro
7611 parameter. Change all callers.
7612 (Output_segment::set_offset): Add increase parameter. Change all
7613 callers. Remove old relro handling.
7614 * output.h (class Output_section): Add new methods: is_last_relro,
7615 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7616 Add is_last_relro_ and is_first_non_relro_ fields.
7617 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7618 Create separate .got.plt section. Call increase_relro.
7619 * x86_64.cc (Target_x86_64::got_section): Likewise.
7620 * testsuite/relro_script_test.t: Add .got.plt.
7623 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7624 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7625 (Layout::finalize): Call set_dynamic_symbol_size.
7626 (Layout::set_dynamic_symbol_size): New function.
7627 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7628 set_dynamic_symbol_size.
7631 * output.h (class Output_section): Add is_entsize_zero_ field.
7632 * output.cc (Output_section::Output_section): Initialize
7634 (Output_section::set_entsize): If two different entsizes are
7635 requested, force it to zero.
7636 (Output_section::add_input_section): Set flags for .debug_str
7637 before updating section flags. Set entsize.
7638 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7639 and SHF_STRING if all input sections have those flags.
7641 2009-12-29 Rafael Espindola <espindola@google.com>
7643 * main.cc (main): Fix the sys time reporting.
7644 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7647 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7649 * options.cc (General_options::parse_version): Allow -v to exit
7650 without an error if there is nothing to link.
7652 2009-12-29 Ian Lance Taylor <iant@google.com>
7654 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7655 using a version of gcc before 4.1.
7656 * configure: Rebuild.
7658 2009-12-28 Chris Demetriou <cgd@google.com>
7660 * attributes.cc (Output_attributes_section_data::do_write): Use
7661 std::vector::front rather than std::vector::data.
7663 2009-12-28 Ian Lance Taylor <iant@google.com>
7665 * symtab.h (class Symbol_table): Add enum Defined.
7666 * resolve.cc (Symbol_table::should_override): Add defined
7667 parameter. Change all callers. Test whether object is NULL
7668 before calling a method on it.
7669 (Symbol_table::report_resolve_problem): Add defined parameter.
7671 (Symbol_table::should_override_with_special): Likewise.
7672 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7673 parameter. Change all callers.
7674 (Symbol_table::do_define_in_output_data): Likewise.
7675 (Symbol_table::define_in_output_segment): Likewise.
7676 (Symbol_table::do_define_in_output_segment): Likewise.
7677 (Symbol_table::define_as_constant): Likewise.
7678 (Symbol_table::do_define_as_constant): Likewise.
7679 * script.h (class Symbol_assignment): Add is_defsym parameter to
7680 constructor; change all callers.
7681 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7682 parameter. Change all callers. Add is_defsym_ field.
7683 (class Parser_closure): Add parsing_defsym parameter to
7684 constructor; change all callers. Add parsing_defsym accessor
7685 function. Add parsing_defsym_ field.
7687 2009-12-28 Ian Lance Taylor <iant@google.com>
7689 * gold.cc (queue_middle_tasks): Fix formatting.
7690 * object.cc (Relobj::is_section_name_included): Likewise.
7692 2009-12-23 Ian Lance Taylor <iant@google.com>
7694 * i386.cc (Target_i386::do_calls_non_split): Recognize
7695 -fsplit-stack prologue for a function with a static chain.
7696 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7697 -fsplit-stack prologue when using %r11.
7699 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7701 * options.cc (General_options::parse_version): Make -v continue and do
7702 the link like GNU ld does.
7704 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7706 * Makefile.am (CCFILES): Add timer.cc.
7707 (HFILES): Add timer.h.
7708 * configure.ac: Check for sysconf and times.
7709 * main.cc: include timer.h.
7710 (main): Use Timer instead of get_run_time.
7713 * workqueue.cc: include timer.h.
7714 (Workqueue::find_and_run_task):
7715 Report user, sys and wall time.
7716 * Makefile.in: Regenerate.
7717 * config.in: Regenerate.
7718 * configure: Regenerate.
7720 2009-12-16 Doug Kwan <dougkwan@google.com>
7722 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7724 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7725 relaxed input sections.
7726 * output.cc (Output_section::find_relaxed_input_section): Change
7727 return type to Output_relaxed_input_section pointer. Adjust code
7728 for new type of relaxed_input_section_map_.
7729 * output.h (Output_section::find_relaxed_input_section): Change
7730 return type to Output_relaxed_input_section pointer.
7731 (Output_section::Output_relaxed_input_section_by_input_section_map):
7733 (Output_section::relaxed_input_section_map_): Change type to
7734 Output_section::Output_relaxed_input_section_by_input_section_map.
7735 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7738 2009-12-15 Ian Lance Taylor <iant@google.com>
7740 * layout.cc (Layout::create_shstrtab): Only write out after input
7741 sections if we are compressing debug sections.
7743 2009-12-15 Ian Lance Taylor <iant@google.com>
7745 * archive.cc (Archive::add_symbols): Only look up a symbol without
7746 a version if there is, in fact, a version.
7748 2009-12-14 Ian Lance Taylor <iant@google.com>
7750 Revert -Wshadow changes, all changes from:
7751 2009-12-11 Doug Kwan <dougkwan@google.com>
7752 2009-12-11 Nick Clifton <nickc@redhat.com>
7753 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7755 2009-12-11 Doug Kwan <dougkwan@google.com>
7757 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7759 * attributes.cc (Object_attribute::size): Ditto.
7760 (Attributes_section_data::size): Ditto.
7761 (Attributes_section_data::Attributes_section_data): Ditto.
7762 (Output_attributes_section_data::do_write): Ditto.
7763 * attributes.h (Object_attribute::set_type): Ditto.
7764 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7766 2009-12-11 Nick Clifton <nickc@redhat.com>
7768 * archive.cc: Fix shadowed variable warnings.
7770 * compressed_output.cc: Likewise.
7771 * compressed_output.h: Likewise.
7772 * configure: Likewise.
7773 * dwarf_reader.cc: Likewise.
7774 * dynobj.cc: Likewise.
7775 * dynobj.h: Likewise.
7776 * ehframe.cc: Likewise.
7777 * ehframe.h: Likewise.
7778 * errors.cc: Likewise.
7779 * expression.cc: Likewise.
7780 * fileread.cc: Likewise.
7781 * fileread.h: Likewise.
7782 * freebsd.h: Likewise.
7783 * i386.cc: Likewise.
7785 * incremental.h: Likewise.
7786 * layout.cc: Likewise.
7787 * layout.h: Likewise.
7788 * mapfile.cc: Likewise.
7789 * merge.cc: Likewise.
7790 * merge.h: Likewise.
7791 * object.cc: Likewise.
7792 * object.h: Likewise.
7793 * options.h: Likewise.
7794 * output.cc: Likewise.
7795 * output.h: Likewise.
7796 * parameters.cc: Likewise.
7797 * plugin.cc: Likewise.
7798 * powerpc.cc: Likewise.
7799 * reduced_debug_output.cc: Likewise.
7800 * reduced_debug_output.h: Likewise.
7801 * reloc.cc: Likewise.
7802 * reloc.h: Likewise.
7803 * resolve.cc: Likewise.
7804 * script-sections.cc: Likewise.
7805 * script.cc: Likewise.
7806 * script.h: Likewise.
7807 * sparc.cc: Likewise.
7808 * symtab.cc: Likewise.
7809 * symtab.h: Likewise.
7810 * target-select.cc: Likewise.
7811 * target-select.h: Likewise.
7812 * token.h: Likewise.
7813 * workqueue.cc: Likewise.
7814 * workqueue.h: Likewise.
7815 * x86_64.cc: Likewise.
7817 2009-12-10 Doug Kwan <dougkwan@google.com>
7819 * arm.cc (attributes.h): New include.
7820 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7821 (Arm_relobj::~Arm_relobj): Delete object pointed by
7822 attributes_section_data_.
7823 (Arm_relobj::attributes_section_data): New method definition.
7824 (Arm_relobj::attributes_section_data_): New data member declaration.
7825 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7826 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7827 attributes_section_data_.
7828 (Arm_dynobj::attributes_section_data): New method definition.
7829 (Arm_dynobj::attributes_section_data_): New data member declaration.
7830 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7831 initialization value of may_use_blx_ to false.
7832 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7833 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7834 object attributes to compute results instead of hard-coding.
7835 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7836 Target_arm::get_secondary_compatible_arch,
7837 Target_arm::set_secondary_compatible_arch
7838 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7839 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7840 New method declarations.
7841 (Target_arm::get_aeabi_object_attribute): New method definition.
7842 (Target_arm::attributes_section_data_): New data member declaration.
7843 (read_arm_attributes_section): New template definition.
7844 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7845 (Arm_dynobj::do_read_symbols): Ditto.
7846 (Target_arm::do_finalize_sections): Merge attributes sections from
7847 input. Check for BLX use after attributes section merging.
7848 Fix __exidx_start and __exidx_end visibility. Create an
7849 .ARM.attributes section if necessary.
7850 (Target_arm::get_secondary_compatible_arch,
7851 Target_arm::set_secondary_compatible_arch,
7852 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7853 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7854 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7855 New method definitions.
7857 2009-12-09 Ian Lance Taylor <iant@google.com>
7859 * plugin.cc (Plugin::load): Don't cast from void* to a function
7862 2009-12-09 Ian Lance Taylor <iant@google.com>
7864 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7867 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7869 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7870 Replace two_file_shared_1.so with two_file_shared_2.so.
7871 * testsuite/Makefile.in: Regenerated.
7873 2009-12-08 Doug Kwan <dougkwan@google.com>
7875 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7876 (HFILES): Add attributes.h and int_encoding.h.
7877 * Makefile.in: Regenerate.
7878 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7879 function definitions to int_encoding.cc
7880 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7881 prototypes to int_encoding.h
7882 * reduced_debug_output.cc (int_encoding.h): New include.
7883 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7884 function definitions to int_encoding.cc
7885 (insert_into_vector, read_from_pointer): Move template definitions to
7887 * attributes.cc: New file.
7888 * attributes.h: New file.
7889 * int_encoding.cc: New file.
7890 * int_encoding.h: New file.
7892 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7895 * incremental-dump.cc (dump_incremental_inputs): New.
7896 (main): Use dump_incremental_inputs.
7898 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7901 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7902 checking elfcpp::STT_FUNC.
7903 (Target_i386::Relocate::relocate): Likewise.
7904 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7906 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7907 symbols from shared libraries into normal FUNC symbols.
7909 * symtab.h (Symbol): Add is_func and use it.
7911 2009-12-05 Doug Kwan <dougkwan@google.com>
7913 * arm.cc (Target_arm::arm_info): Initialize new fields
7914 attributes_section and attributes_vendor.
7915 * i386.cc (Target_i386::i386_info): Same.
7916 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7917 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7918 fields attributes_section and attributes_vendor.
7919 * sparc.cc (Target_sparc::sparc_info): Same.
7920 * target.h (Target::attributes_section, Target::attributes_vendor,
7921 Target::is_attributes_section, Target::attribute_arg_type,
7922 Target::attributes_order): New method definitions.
7923 (Target::Target_info::attributes_section,
7924 Target::Target_info::attributes_vendor): New fields.
7925 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7926 virtual method definitions.
7927 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7928 attributes_section and attributes_vendor.
7929 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7931 2009-12-05 Doug Kwan <dougkwan@google.com>
7933 * arm.cc: Update comments about interworking and stub generation.
7934 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7935 considered as non-PIC.
7936 (Arm_relocate_functions::base_abs): Fix formatting.
7937 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7938 of function to use GOT entry address instead of offset.
7939 (Target_arm::Scan::global): Issue an error if a symbol would need a
7940 PLT does not get one because it is untyped. Remove code to create
7941 dynamic symbols for relative branches.
7942 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7943 takes unsigned integer instead of boolean.
7945 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7947 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7948 (two_file_test_LDADD): Likewise.
7949 (common_test_1_LDADD): Likewise.
7950 (exception_test_LDADD) Likewise.
7951 (weak_test_LDADD): Likewise.
7952 (many_sections_test_LDADD): Likewise.
7953 (initpri1_LDADD): Likewise.
7954 (script_test_1_LDADD): Likewise.
7955 (script_test_2_LDADD): Likewise.
7956 (justsyms_LDADD): Likewise.
7957 (binary_test_LDADD): Likewise.
7958 (large_LDADD): Likewise.
7959 * testsuite/Makefile.in: Regenerated.
7961 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
7963 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7964 (Symbol_table::override_with_special): Likewise.
7965 (Symbol_table::add_from_object): Likewise.
7967 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7969 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7970 Don't set the data_offset twice.
7972 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7974 * testsuite/Makefile.in: Regenerate.
7976 2009-12-03 Doug Kwan <dougkwan@google.com>
7978 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7979 (Target_arm::do_finalize_sections): Add parameter for symbol table
7980 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7981 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7982 parameter for symbol table pointer.
7983 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7984 an additional parameter for a pointer to symbol table.
7985 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7986 parameter for a symbol table pointer.
7987 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7988 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7990 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7991 parameter for a symbol table pointer.
7993 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7995 * incremental.cc (Incremental_inputs_header)
7996 (Incremental_inputs_header_write, Incremental_inputs_entry)
7997 (Incremental_inputs_entry_write): Move ...
7998 * incremental.h (Incremental_inputs_header)
7999 (Incremental_inputs_header_write, Incremental_inputs_entry)
8000 (Incremental_inputs_entry_write): here.
8002 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8004 * incremental.cc (make_sized_incremental_binary): Set the target.
8005 Error if it is incompatible.
8006 * output.h (Output_file): Add filename method.
8008 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8010 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8011 from the get_* methods.
8013 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8015 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8016 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8017 Write 0 for the data_offset of scripts.
8019 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8021 * testsuite/Makefile.am: Add the incremental_test.sh test.
8022 * testsuite/incremental_test.sh: New.
8023 * testsuite/incremental_test_1.c: New.
8024 * testsuite/incremental_test_2.c: New.
8026 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8028 * incremental-dump.cc (main): Fix typos.
8030 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8033 * incremental-dump.cc (main): Use llu to print 64 bit values.
8035 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8036 H.J. Lu <hongjiu.lu@intel.com>
8038 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8040 (incremental_dump_LDADD): Likewise.
8041 * Makefile.in: Regenerated.
8043 2009-11-25 Doug Kwan <dougkwan@google.com>
8047 2009-11-25 Doug Kwan <dougkwan@google.com>
8049 * arm.cc (Target_arm::Target_arm): Move method definition
8050 outside of class definition. Add code to handle
8051 --target1-rel, --target1-abs and --target2= options.
8052 (Target_arm::get_reloc_reloc_type): Change method to be
8053 non-static and const.
8054 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8055 New data member declaration.
8056 (Target_arm::Scan::local, Target_arm::Scan::global,
8057 Target_arm::Relocate::relocate,
8058 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8059 Adjust call to Target_arm::get_real_reloc_type.
8060 (Target_arm::get_real_reloc_type): Use command line options
8061 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8062 * options.h (--target1-rel, --target1-abs, --target2): New
8065 2009-11-25 Doug Kwan <dougkwan@google.com>
8067 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8068 class definition. Add code to handle --target1-rel, --target1-abs
8069 and --target2= options.
8070 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8072 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8074 (Target_arm::Scan::local, Target_arm::Scan::global,
8075 Target_arm::Relocate::relocate,
8076 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8077 call to Target_arm::get_real_reloc_type.
8078 (Target_arm::get_real_reloc_type): Use command line options to
8079 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8080 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8083 2009-11-25 Doug Kwan <dougkwan@google.com>
8085 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8086 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8087 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8089 (Arm_relocate_functions::thm_call): Replace body with a call to
8090 Arm_relocate_functions::thumb_branch_common.
8091 (Arm_relocate_functions::thm_jump24,
8092 Arm_relocate_functions::thm_xpc22): New method definitions.
8093 (Arm_relocate_functions::thumb_branch_common): New method definition.
8094 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8096 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8097 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8099 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8101 * Makefile.am: Build incremental-dump
8102 * Makefile.in: Regenerate.
8103 * incremental-dump.cc: New.
8104 * incremental.cc (Incremental_inputs_header_data,
8105 Incremental_inputs_entry_data): Move to incremental.h
8106 * incremental.h: (Incremental_inputs_header_data,
8107 Incremental_inputs_entry_data): Move from incremental.cc
8109 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8111 * incremental.cc (Incremental_inputs_header,
8112 Incremental_inputs_header_write, Incremental_inputs_entry,
8113 Incremental_inputs_entry_write): Add a typedef with the data type.
8115 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8117 * incremental.cc (Incremental_inputs_header,
8118 Incremental_inputs_header_write, Incremental_inputs_entry,
8119 Incremental_inputs_entry_write): Update comment about which
8120 type has the filed descriptions.
8122 2009-11-15 Doug Kwan <dougkwan@google.com>
8124 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8125 (Arm_relocate_functions::arm_branch_common): Change method defintion
8126 in class definition to a method declaration and update list of formal
8128 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8129 Arm_relocation_functions::jump24): Adjust call to
8130 Arm_relocate_functions::arm_branch_common. Update list of formal
8132 (Arm_relocate_functions::xpc25): New method definition.
8133 (Arm_relocate_functions::arm_branch_common): Move method defintion
8134 out from class definition. Use stubs for mode-switching and extending
8136 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8137 specially. Change code to enable use of stubs in ARM branches.
8139 2009-11-10 Doug Kwan <dougkwan@google.com>
8141 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8142 in method declaration.
8143 (Target_arm::relocate_stub): New method declaration.
8144 (Target_arm::default_target): Change to return a pointer instead of
8146 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8147 Target_arm::default_target.
8148 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8150 (Target_arm::relocate_section): Adjust view.
8151 (Target_arm::relocate_stub): New method definition.
8153 2009-11-10 Doug Kwan <dougkwan@google.com>
8155 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8157 * incremental.cc (open_incremental_binary): Initialized local
8158 variables to avoid warnings.
8159 * object.cc (make_elf_object): Ditto.
8160 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8163 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8166 * testsuite/plugin_test.c: Include "config.h".
8168 2009-11-09 Doug Kwan <dougkwan@google.com>
8170 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8171 (arm_symbol_value): Remove.
8172 (Arm_relocate_functions::arm_branch_common,
8173 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8174 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8175 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8176 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8177 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8178 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8179 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8180 Arm_relocate_functions::thm_mobw_abs_nc,
8181 Arm_relocate_functions::thm_mov_abs,
8182 Arm_relocate_functions::movw_prel_nc,
8183 Arm_relocate_functions::thm_movt_abs,
8184 Arm_relocate_functions::movt_prel,
8185 Arm_relocate_functions::thm_movw_prel_nc,
8186 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8187 (Target_arm::Relocate::relocate): Only decompose address into two
8188 parts if relocation type uses the thumb-bit and pass the actual
8189 bit instead of a flag indicating that the thumb-bit is used. Adjust
8190 calls to methods in Arm_relocate_functions for this change.
8192 2009-11-08 Ian Lance Taylor <iant@google.com>
8195 * reloc.cc: Instantiate
8196 Sized_relobj::initialize_input_to_output_maps and
8197 Sized_relobj:free_input_to_output_maps.
8199 2009-11-06 Ian Lance Taylor <iant@google.com>
8202 * defstd.cc (in_segment): Set only_if_ref true for "end".
8204 2009-11-06 Doug Kwan <dougkwan@google.com>
8206 * arm.cc (class Reloc_stub): Correct a comment.
8207 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8208 (Target_arm::scan_section_for_stubs): New method declaration.
8209 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8210 Change methods from private to protected.
8211 (Target_arm::do_may_relax): New method definition.
8212 (Target_arm::do_relax, Target_arm::group_sections,
8213 Target_arm::scan_reloc_for_stub,
8214 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8215 (Target_arm::arm_input_section_map_): New data member declaration.
8216 (Target_arm::scan_reloc_for_stub,
8217 Target_arm::scan_reloc_section_for_stubs,
8218 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8219 Target_arm::do_relax): New method definitions.
8221 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8223 * configure.ac: Check for (struct stat)::st_mtim
8224 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8225 * config.in: Regenerate.
8226 * configure: Regenerate.
8228 2009-11-05 Ian Lance Taylor <iant@google.com>
8231 * output.cc (Output_segment::add_output_section): Add missing
8234 2009-11-04 Ian Lance Taylor <iant@google.com>
8237 * object.h (class Object): Add is_needed and set_is_needed
8238 methods. Add is_needed_ field. Make bool fields into bitfields.
8239 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8240 defined in a dynamic object and referenced by a regular object,
8241 set is_needed for the dynamic object.
8242 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8243 if the file is marked with as_needed and it is not needed.
8245 2009-11-04 Ian Lance Taylor <iant@google.com>
8248 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8249 tags if data is discarded by linker script.
8250 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8251 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8252 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8253 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8255 2009-11-04 Ian Lance Taylor <iant@google.com>
8257 * layout.cc (Layout::get_output_section): Add is_interp and
8258 is_dynamic_linker_section parameters. Change all callers.
8259 (Layout::choose_output_section): Likewise.
8260 (Layout::make_output_section): Likewise.
8261 (Layout::add_output_section_data): Add is_dynamic_linker_section
8262 parameter. Change all callers.
8263 * layout.h (class Layout): Update declarations.
8264 * output.h (class Output_section): Add is_interp, set_is_interp,
8265 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8266 Add is_interp_, is_dynamic_linker_section_ fields. Change
8267 generate_code_fills_at_write_ to a bitfield.
8268 * output.cc (Output_section::Output_sections): Initialize new
8270 (Output_segment::add_output_section): Add do_sort parameter.
8273 2009-11-03 Ian Lance Taylor <iant@google.com>
8276 * options.h (class General_options): Add --warn-common.
8277 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8278 merging two common symbols.
8279 (Symbol_table::should_override): Handle --warn-common when merging
8280 a common symbol with a defined symbol. Use report_resolve_problem
8281 for multiple definitions.
8282 (Symbol_table::report_resolve_problem): New function.
8283 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8285 2009-11-03 Doug Kwan <dougkwan@google.com>
8287 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8289 (Target_arm::stub_factory): New method definition.
8290 (Target_arm::new_arm_input_section,
8291 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8292 Target_arm::reloc_uses_thumb_bit): New method declarations.
8293 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8294 New type definitions.
8295 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8296 member declarations.
8297 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8298 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8299 New method definitions.
8301 2009-11-03 Ian Lance Taylor <iant@google.com>
8303 * options.h (class General_options): Add --warn_constructors.
8305 2009-11-03 Ian Lance Taylor <iant@google.com>
8308 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8309 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8311 2009-11-03 Ian Lance Taylor <iant@google.com>
8314 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8315 --msgid-bugs-address.
8316 (install-pdf): New target.
8317 (install-data_yes): Look up one directory to find mkinstalldirs.
8319 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8321 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8324 2009-10-30 Doug Kwan <dougkwan@google.com>
8326 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8328 2009-10-30 Doug Kwan <dougkwan@google.com>
8330 * arm.cc (Stub_addend_reader): New struct template definition
8331 and partial specializations.
8332 (Stub_addend_reader::operator()): New method definition for a
8333 partially specialized template.
8335 2009-10-30 Doug Kwan <dougkwan@google.com>
8337 * arm.cc (Arm_relobj::processor_specific_flags): New method
8339 (Arm_relobj::do_read_symbols): New method declaration.
8340 (Arm_relobj::processor_specific_flags_): New data member declaration.
8341 (Arm_dynobj): New class definition.
8342 (Target_arm::do_finalize_sections): Add input_objects parameter.
8343 (Target_arm::do_adjust_elf_header): New method declaration.
8344 (Target_arm::are_eabi_versions_compatible,
8345 (Target_arm::merge_processor_specific_flags): New method declaration.
8346 (Target_arm::do_make_elf_object): New overloaded method definitions
8348 (Arm_relobj::do_read_symbols): New method definition.
8349 (Arm_dynobj::do_read_symbols): Ditto.
8350 (Target_arm::do_finalize_sections): Add input_objects parameters.
8351 Merge processor-specific flags from all input objects.
8352 (Target_arm::are_eabi_versions_compatible,
8353 Target_arm::merge_processor_specific_flags,
8354 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8355 New method definitions.
8356 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8357 Input_objects pointer type parameter.
8358 * layout.cc (Layout::finalize): Pass input objects to target's.
8359 finalize_sections function.
8360 * output.cc (Output_file_header::do_sized_write): Set ELF file
8361 header's processor-specific flags.
8362 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8363 Input_objects pointer type parameter.
8364 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8365 * target.h (Input_objects): New forward class declaration.
8366 (Target::processor_specific_flags,
8367 Target::are_processor_specific_flags_sect): New method definitions.
8368 (Target::finalize_sections): Add input_objects parameter.
8369 (Target::Target): Initialize processor_specific_flags_ and
8370 are_processor_specific_flags_set_.
8371 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8373 (Target::set_processor_specific_flags): New method definition.
8374 (Target::processor_specific_flags_,
8375 Target::are_processor_specific_flags_set_): New data member
8377 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8378 Input_objects pointer type parameter.
8380 2009-10-30 Doug Kwan <dougkwan@google.com>
8382 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8384 2009-10-28 Ian Lance Taylor <iant@google.com>
8386 * object.h (class Relobj): Drop options parameter from
8387 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8388 do_scan_relocs, do_relocate. Change all callers.
8389 (class Sized_relobj): Drop options parameters from
8390 do_gc_process_relocs, do_scan_relocs, do_relocate,
8391 do_relocate_sections, relocate_sections, emit_relocs_scan,
8392 emit_relocs_scan_reltype. Change all callers.
8393 (struct Relocate_info): Remove options field and all references to
8395 * reloc.h (class Read_relocs): Remove options constructor
8396 parameter and options_ field. Change all callers.
8397 (class Gc_process_relocs, class Scan_relocs): Likewise.
8398 (class Relocate_task): Likewise.
8399 * target-reloc.h (scan_relocs): Remove options parameter. Change
8401 (scan_relocatable_relocs): Likewise.
8402 * target.h (class Sized_target): Remove options parameter from
8403 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8405 * gc.h (gc_process_relocs): Remove options parameter. Change all
8407 * arm.cc: Update functions to remove options parameters.
8408 * i386.cc: Likewise.
8409 * powerpc.cc: Likewise.
8410 * sparc.cc: Likewise.
8411 * x86_64.cc: Likewise.
8412 * testsuite/testfile.cc: Likewise.
8414 2009-10-28 Doug Kwan <dougkwan@google.com>
8416 * arm.cc (Arm_relobj): New class definition.
8417 (Arm_relobj::scan_sections_for_stubs,
8418 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8419 New method definitions.
8421 2009-10-28 Cary Coutant <ccoutant@google.com>
8423 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8424 (Plugin::cleanup_done_): New member.
8425 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8426 (Plugin_manager::cleanup_done_): Remove.
8427 (Plugin_manager::add_input_file): Edit error message.
8428 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8429 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8431 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8433 * fileread.cc: (File_read::View::~View): Use the new
8434 data_ownership_ filed.
8435 (File_read::~File_read): Dispose the new whole_file_view_.
8436 (File_read::open): Mmap the whole file if needed.
8437 (File_read::open): Use whole_file_view_ instead of contents_.
8438 (File_read::find_view): Use whole_file_view_ if applicable.
8439 (File_read::do_read): Use whole_file_view_ instead of contents_.
8440 (File_read::make_view): Use whole_file_view_ instead of contents_,
8441 update File_read::View::View call.
8442 (File_read::find_or_make_view): Update File_read::View::View
8444 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8446 (File_read::View::Data_ownership): New enum.
8447 (File_read::View::View): Replace bool mapped_ with Data_ownership
8449 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8450 (File_read::View::data_ownership_): New field.
8451 (File_read::contents_): Remove (replaced by whole_file_view_).
8452 (File_read::whole_file_view_): New field.
8453 * options.h (class General_options): Add --keep-files-mapped.
8455 2009-10-27 Cary Coutant <ccoutant@google.com>
8457 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8458 * testsuite/Makefile.am (plugin_test_5): New test case.
8459 * testsuite/Makefile.in: Regenerate.
8461 2009-10-25 Doug Kwan <dougkwan@google.com>
8463 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8464 from private to protected to allow access by child class.
8465 (Sized_relobj::do_relocate_sections): New method declaration.
8466 (Sized_relobj::relocate_sections): Virtualize.
8467 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8468 Sized_relobj::relocate_sections. Instantiate template explicitly
8469 for different target sizes and endianity.
8471 2009-10-24 Doug Kwan <dougkwan@google.com>
8473 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8474 (Arm_input_section::as_arm_input_section): New method.
8475 (Arm_output_section): New class definition.
8476 (Arm_output_section::create_stub_group,
8477 Arm_output_section::group_sections): New method definitions.
8479 2009-10-22 Doug Kwan <dougkwan@google.com>
8481 * arm.cc (Arm_input_section): New class definition.
8482 (Arm_input_section::init, Arm_input_section:do_write,
8483 Arm_input_section::set_final_data_size,
8484 Arm_input_section::do_reset_address_and_file_offset): New method
8487 2009-10-21 Doug Kwan <dougkwan@google.com>
8489 * arm.cc (Stub_table, Arm_input_section): New forward class
8491 (Stub_table): New class defintion.
8492 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8493 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8494 New method definition.
8496 2009-10-21 Doug Kwan <dougkwan@google.com>
8498 * arm.cc: Update copyright comments.
8499 (Target_arm): New forward class template declaration.
8500 (Arm_address): New type.
8501 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8502 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8503 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8505 (Insn_template): Same.
8506 (DEF_STUBS): New macro.
8507 (Stub_type): New enum type.
8508 (Stub_template): New class definition.
8511 (Stub_factory): Same.
8512 (Target_arm::Target_arm): Initialize may_use_blx_ and
8513 should_force_pic_veneer_.
8514 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8515 Target_arm::should_force_pic_veneer,
8516 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8517 Target_arm::using_thumb_only, Target_arm:;default_target): New
8519 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8520 New data member declarations.
8521 (Insn_template::size, Insn_template::alignment): New method defintions.
8522 (Stub_template::Stub_template): New method definition.
8523 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8524 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8525 (Stub_factory::Stub_factory): New method definition.
8526 * gold.h (string_hash): New template.
8527 * output.h (Input_section_specifier::hash_value): Use
8529 (Input_section_specifier::string_hash): Remove.
8530 * stringpool.cc (Stringpool_template::string_hash): Use
8533 2009-10-20 Doug Kwan <dougkwan@google.com>
8535 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8536 symbols of relaxed input sections.
8537 * output.h (Output_section::find_relaxed_input_section): Make
8540 2009-10-16 Doug Kwan <dougkwan@google.com>
8542 * dynobj.cc (Versions::Versions): Initialize version_script_.
8543 Only insert base version symbol definition for a shared object
8544 if version script defines any version versions.
8545 (Versions::define_base_version): New method definition.
8546 (Versions::add_def): Check that base version is not needed.
8547 (Versions::add_need): Define base version lazily.
8548 * dynobj.h (Versions::define_base_version): New method declaration.
8549 (Versions::needs_base_version_): New data member declaration.
8550 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8551 (check_DATA): Add no_version_test.stdout.
8552 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8554 * testsuite/Makefile.in: Regenerate.
8555 * testsuite/no_version_test.c: New file.
8556 * testsuite/no_version_test.sh: Ditto.
8558 2009-10-16 Doug Kwan <dougkwan@google.com>
8560 * expression.cc (class Segment_start_expression): New class definition.
8561 (Segment_start_expression::value): New method definition.
8562 (script_exp_function_segment_start): Return a new
8563 Segment_start_expression.
8564 * gold/script-c.h (script_saw_segment_start_expression): New function
8566 * script-sections.cc (Script_sections::Script_sections): Initialize
8567 SAW_SEGMENT_START_EXPRESSION_ to false.
8568 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8569 and -Tbbs options to specify section addresses if given in
8570 command line and no SEGMENT_START expression is seen in a script.
8571 * script-sections.h (Script_sections::saw_segment_start_expression,
8572 Script_sections::set_saw_segment_start_expression): New method
8574 (Script_sections::saw_segment_start_expression_): New data member
8576 * script.cc (script_saw_segment_start_expression): New function.
8577 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8578 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8579 script_test_7.sh and script_test_8.sh.
8580 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8581 script_test_8.stdout.
8582 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8583 (script_test_6, script_test_6.stdout, script_test_7,
8584 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8585 * Makefile.in: Regenerate.
8586 * testsuite/script_test_6.sh: New file.
8587 * testsuite/script_test_6.t: Same.
8588 * testsuite/script_test_7.sh: Same.
8589 * testsuite/script_test_7.t: Same.
8590 * testsuite/script_test_8.sh: Same.
8592 2009-10-16 Doug Kwan <dougkwan@google.com>
8594 * output.cc (Output_segment::set_section_list_address): Cast
8595 expressions to unsigned long long type to avoid format warnings.
8597 2009-10-15 Ian Lance Taylor <iant@google.com>
8599 * script.cc (Script_options::add_symbol_assignment): Always add a
8600 dot assignment to script_sections_.
8601 * script-sections.cc (Script_sections::add_dot_assignment):
8602 Initialize if necessary.
8604 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8605 program headers with no load segment if there is a linker script.
8607 * layout.cc (Layout::set_segment_offsets): Align the file offset
8608 to the segment aligment for -N or -n with no load segment.
8609 * output.cc (Output_segment::add_output_section): Don't crash if
8610 the first section is a TLS section.
8611 (Output_segment::set_section_list_addresses): Print an error
8612 message if the address moves backward in a linker script.
8613 * script-sections.cc
8614 (Output_section_element_input::set_section_addresses): Don't
8615 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8616 (Orphan_output_section::set_section_addresses): Likewise.
8618 2009-10-15 Doug Kwan <dougkwan@google.com>
8620 * layout.cc (Layout::finish_dynamic_section): Generate tags
8621 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8622 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8623 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8625 2009-10-14 Ian Lance Taylor <iant@google.com>
8627 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8629 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8630 data_shdr fields of relinfo.
8631 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8632 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8633 R_386_TLS_LDO_32, adjust based on section flags.
8634 (Target_i386::Relocate::fix_up_ldo): Remove.
8636 2009-10-13 Ian Lance Taylor <iant@google.com>
8638 Add support for -pie.
8639 * options.h (class General_options): Add -pie and
8641 (General_options::output_is_position_independent): Test -pie.
8642 (General_options::output_is_executable): Return true if not shared
8643 and not relocatable.
8644 (General_options::output_is_pie): Remove.
8645 * options.cc (General_options::finalize): Reject incompatible uses
8647 * gold.cc (queue_middle_tasks): A -pie link is not static.
8648 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8649 * symtab.cc (Symbol::final_value_is_known): Return false if
8650 output_is_position_independent.
8651 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8652 output_is_position_independent.
8653 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8654 output_is_position_independent.
8655 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8656 output_is_position_independent.
8657 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8659 (basic_pie_test.o, basic_pie_test): New targets.
8660 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8661 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8662 (two_file_pie_test): New target.
8663 * testsuite/Makefile.in: Rebuild.
8664 * README: Remove note saying that -pie is not supported.
8666 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8668 * options.h (class General_options): Add -init and -fini.
8669 * layout.cc (Layout::finish_dynamic_section): Emit
8670 given init and fini functions.
8672 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8674 * gc.h (gc_process_relocs): Check if icf is enabled using new
8676 * gold.cc (queue_initial_tasks): Likewise.
8677 (queue_middle_tasks): Likewise.
8678 * object.cc (do_layout): Likewise.
8679 * symtab.cc (is_section_folded): Likewise.
8680 * main.cc (main): Likewise.
8681 * reloc.cc (Read_relocs::run): Likewise.
8682 (Sized_relobj::do_scan_relocs): Likewise.
8683 * icf.cc (is_function_ctor_or_dtor): New function.
8684 (Icf::find_identical_sections): Check if function is ctor or dtor when
8686 * options.h (General_options::icf): Change option to be an enum.
8687 (Icf_status): New enum.
8688 (icf_enabled): New method.
8689 (icf_safe_folding): New method.
8690 (set_icf_status): New method.
8691 (icf_status_): New variable.
8692 * (options.cc) (General_options::finalize): Set icf_status_.
8693 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8694 icf_test and icf_keep_unique_test to use the --icf enum flag.
8695 * testsuite/icf_safe_test.sh: New file.
8696 * testsuite/icf_safe_test.cc: New file.
8698 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8700 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8701 includes to gc.h and icf.h.
8702 * arm.cc: Include gc.h.
8703 * gold.cc: Likewise.
8704 * i386.cc: Likewise.
8705 * powerpc.cc: Likewise.
8706 * sparc.cc: Likewise.
8707 * x86_64.cc: Likewise.
8708 * gc.h: Include icf.h.
8710 2009-10-11 Ian Lance Taylor <iant@google.com>
8712 * plugin.cc: Include "gold.h" before other header files.
8714 2009-10-10 Chris Demetriou <cgd@google.com>
8716 * options.h (Input_file_argument::Input_file_type): New enum.
8717 (Input_file_argument::is_lib_): Replace with...
8718 (Input_file_argument::type_): New member.
8719 (Input_file_argument::Input_file_argument): Take Input_file_type
8720 'type' rather than boolean 'is_lib' as second argument.
8721 (Input_file_argument::is_lib): Use type_.
8722 (Input_file_argument::is_searched_file): New function.
8723 (Input_file_argument::may_need_search): Handle is_searched_file.
8724 * options.cc (General_options::parse_library): Support -l:filename.
8725 (General_options::parse_just_symbols): Update for Input_file_argument
8727 (Command_line::process): Likewise.
8728 * archive.cc (Archive::get_file_and_offset): Likewise.
8729 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8730 * script.cc (read_script_file, script_add_file): Likewise.
8731 * fileread.cc (Input_file::Input_file): Likewise.
8732 (Input_file::will_search_for): Handle is_searched_file.
8733 (Input_file::open): Likewise.
8734 * readsyms.cc (Read_symbols::get_name): Likewise.
8735 * testsuite/Makefile.am (searched_file_test): New test.
8736 * testsuite/Makefile.in: Regenerate.
8737 * testsuite/searched_file_test.cc: New file.
8738 * testsuite/searched_file_test_lib.cc: New file.
8740 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8741 Ian Lance Taylor <iant@google.com>
8743 * descriptor.cc: Include <cstdio> and "binary-io.h".
8744 (Descriptors::open): Open the files in binary mode always.
8745 * script.cc (Lex::get_token): Treat \r as whitespace.
8747 2009-10-09 Ian Lance Taylor <iant@google.com>
8749 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8751 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8752 Ian Lance Taylor <iant@google.com>
8754 * configure.ac: Check for readv function also.
8755 * fileread.cc (readv): Define if not HAVE_READV.
8756 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8758 * config.in: Regenerate.
8759 * configure: Regenerate.
8761 2009-10-09 Doug Kwan <dougkwan@google.com>
8763 * layout.cc (Layout::make_output_section): Call target hook to make
8764 ordinary output section.
8765 (Layout::finalize): Adjust parameter list of call the
8766 Target::may_relax().
8767 * layout.h (class Layout::section_list): New method.
8768 * merge.h (Output_merge_base::entsize): Change visibility to public.
8769 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8771 (Output_merge_string::do_is_string): New method.
8772 * object.cc (Sized_relobj::do_setup): renamed from
8773 Sized_relobj::set_up.
8774 * object.h (Sized_relobj::adjust_shndx,
8775 Sized_relobj::initializ_input_to_output_maps,
8776 Sized_relobj::free_input_to_output_maps): Change visibilities to
8778 (Sized_relobj::setup): Virtualize.
8779 (Sized_relobj::do_setup): New method declaration.
8780 (Sized_relobj::invalidate_section_offset,
8781 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8782 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8783 * options.cc (parse_int): New function.
8784 * options.h (parse_int): New declaration.
8785 (DEFINE_int): New macro.
8786 (stub_group_size): New option.
8787 * output.cc (Output_section::Output_section): Initialize memebers
8788 merge_section_map_, merge_section_by_properties_map_,
8789 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8790 (Output_section::add_input_section): Handled deferred code-fill
8791 generation and remove an old comment.
8792 (Output_section::add_relaxed_input_section): New method definition.
8793 (Output_section::add_merge_input_section): Use merge section by
8794 properties map to speed to search. Update merge section maps
8796 (Output_section::build_relaxation_map): New method definition.
8797 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8799 (Output_section::relax_input_section): Renamed to
8800 Output_section::convert_input_sections_to_relaxed_sections and change
8801 interface to take a vector of pointers to relaxed sections.
8802 (Output_section::find_merge_section,
8803 Output_section::find_relaxed_input_section): New method definitions.
8804 (Output_section::is_input_address_mapped,
8805 Output_section::output_offset, Output_section::output_address):
8806 Use output section data maps to speed up searching.
8807 (Output_section::find_starting_output_address): Add comments.
8808 (Output_section::do_write,
8809 Output_section::write_to_postprocessing_buffer): Do code-fill
8810 generation as appropriate.
8811 (Output_section::get_input_sections): Invalidate relaxed input section
8813 (Output_section::restore_states): Adjust type of checkpoint .
8814 Invalidate relaxed input section map.
8815 * output.h (Output_merge_base): New class declaration.
8816 (Input_section_specifier): New class defintion.
8817 (class Output_relaxed_input_section) Change base class to
8818 Output_section_data_build.
8819 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8820 base class initializer.
8821 (Output_section::add_relaxed_input_section): New method declaration.
8822 (Output_section::Input_section): Change visibility to protected.
8823 (Output_section::Input_section::relobj,
8824 Output_section::Input_section::shndx): Handle relaxed input sections.
8825 Output_section::input_sections) Change visibility to protected. Also
8826 define overload to return a non-const pointer.
8827 (Output_section::Merge_section_properties): New class defintion.
8828 (Output_section::Merge_section_by_properties_map,
8829 Output_section::Output_section_data_by_input_section_map,
8830 Output_section::Relaxation_map): New types.
8831 (Output_section::relax_input_section): Rename method to
8832 Output_section::convert_input_sections_to_relaxed_sections and change
8833 interface to take a vector of relaxed section pointers.
8834 (Output_section::find_merge_section,
8835 Output_section::find_relaxed_input_section,
8836 Output_section::build_relaxation_map,
8837 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8838 New method declarations.
8839 (Output_section::merge_section_map_
8840 Output_section::merge_section_by_properties_map_,
8841 Output_section::relaxed_input_section_map_,
8842 Output_section::is_relaxed_input_section_map_valid_,
8843 Output_section::generate_code_fills_at_write_): New data members.
8844 * script-sections.cc
8845 (Output_section_element_input::set_section_addresses): Call
8846 current_data_size and addralign methods of relaxed input sections.
8847 (Orphan_output_section::set_section_addresses): Call current_data_size
8848 and addralign methods of relaxed input sections.
8849 * symtab.cc (Symbol_table::compute_final_value): Extract template
8850 from the body of Symbol_table::sized_finalize_symbol.
8851 (Symbol_table::sized_finalized_symbol): Call
8852 Symbol_table::compute_final_value.
8853 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8854 (Symbol_table::compute_final_value): New templated method declaration.
8855 * target.cc (Target::do_make_output_section): New method defintion.
8856 * target.h (Target::make_output_section): New method declaration.
8857 (Target::relax): Add more parameters for input objects, symbol table
8858 and layout. Adjust call to do_relax.
8859 (Target::do_make_output_section): New method declaration.
8860 (Target::do_relax): Add parameters for input objects, symbol table
8863 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8865 * pread.c: Include stdio.h.
8867 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8869 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8872 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8874 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8875 Change read_shndx type to unsigned int.
8876 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8878 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8879 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8880 Change read_shndx type to unsigned int.
8881 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8883 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8884 * layout.cc (Layout::create_symtab_sections): Cast the result of
8885 local_symcount * symsize to off_t in the gold_assert.
8887 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8889 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8890 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8892 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8893 (Arm_relocate_functions::thm_abs5): New function.
8894 (Arm_relocate_functions::abs12): New function.
8895 (Arm_relocate_functions::abs16): New function.
8896 (Arm_relocate_functions::base_abs): New function.
8897 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8898 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8899 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8901 (Scan::global): Likewise.
8902 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8903 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8904 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8905 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8908 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8910 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8911 (Arm_relocate_functions::movt_prel): New function.
8912 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8913 (Arm_relocate_functions::thm_movt_prel): New function.
8914 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8915 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8916 (Scan::global, Relocate::relocate): Likewise.
8917 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8919 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8921 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8922 Incremental_checker.
8923 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8925 (class Incremental_inputs_header): New class.
8926 (Incremental_inputs_header_writer): Edit comment.
8927 (Incremental_inputs_entry): New class.
8928 (Incremental_inputs_entry_writer): Edit comment.
8929 (Sized_incremental_binary::do_find_incremental_inputs_section):
8930 Add *strtab_shndx parameter, fill it.
8931 (Sized_incremental_binary::do_check_inputs): New method.
8932 (Incremental_checker::can_incrementally_link_output_file): Use
8933 Sized_incremental_binary::check_inputs.
8934 (Incremental_inputs::report_command_line): Save command line in
8937 (Incremental_binary::find_incremental_inputs_section): New
8939 (Incremental_binary::do_find_incremental_inputs_section): Add
8940 strtab_shndx parameter.
8941 (Incremental_binary::do_check_inputs): New pure virtual method.
8942 (Sized_incremental_binary::do_check_inputs): Declare.
8943 (Incremental_checker::Incremental_checker): Add incremental_inputs
8944 parameter, use it to initialize incremental_inputs_.
8945 (Incremental_checker::incremental_inputs_): New field.
8946 (Incremental_checker::command_line): New method.
8947 (Incremental_checker::inputs): New method.
8948 (Incremental_checker::command_line_): New field.
8950 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8952 * incremental.cc: Include <cstdarg> and "target-select.h".
8953 (vexplain_no_incremental): New function.
8954 (explain_no_incremental): New function.
8955 (Incremental_binary::error): New method.
8956 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8958 (make_sized_incremental_binary): New function.
8959 (open_incremental_binary): New function.
8960 (can_incrementally_link_file): Add checks if output is ELF and has
8962 * incremental.h: Include "elfcpp_file.h" and "output.h".
8963 (Incremental_binary): New class.
8964 (Sized_incremental_binary): New class.
8965 (open_incremental_binary): Declare.
8966 * object.cc (is_elf_object): Use
8967 elfcpp::Elf_recognizer::is_elf_file.
8968 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8969 * output.h (Output_file::filesize): New method.
8971 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8973 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8975 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8976 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8978 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8980 (Arm_relocate_functions::movw_abs_nc): New function.
8981 (Arm_relocate_functions::movt_abs): New function.
8982 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8983 (Arm_relocate_functions::thm_movt_abs): New function.
8984 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8985 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8986 (Scan::global): Likewise.
8987 (Relocate::relocate): Likewise.
8988 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8990 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8992 * arm.cc (Arm_relocate_functions::got_prel) New function.
8993 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8994 (Relocate::relocate): Likewise.
8995 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8997 2009-10-06 Ian Lance Taylor <iant@google.com>
8999 * options.h (class General_options): Define
9000 split_stack_adjust_size parameter.
9001 * object.h (class Object): Add uses_split_stack_ and
9002 has_no_split_stack_ fields. Add uses_split_stack and
9003 has_no_split_stack accessor functions. Declare
9004 handle_split_stack_section.
9005 (class Reloc_symbol_changes): Define.
9006 (class Sized_relobj): Define Function_offsets. Declare
9007 split_stack_adjust, split_stack_adjust_reltype, and
9009 * object.cc (Object::handle_split_stack_section): New function.
9010 (Sized_relobj::do_layout): Call handle_split_stack_section.
9011 * dynobj.cc (Sized_dynobj::do_layout): Call
9012 handle_split_stack_section.
9013 * reloc.cc (Sized_relobj::relocate_sections): Call
9014 split_stack_adjust for executable sections in split_stack
9015 objects. Pass reloc_map to relocate_section.
9016 (Sized_relobj::split_stack_adjust): New function.
9017 (Sized_relobj::split_stack_adjust_reltype): New function.
9018 (Sized_relobj::find_functions): New function.
9019 * target-reloc.h: Include "object.h".
9020 (relocate_section): Add reloc_symbol_changes parameter. Change
9022 * target.h (class Target): Add calls_non_split method. Declare
9023 do_calls_non_split virtual method. Declare match_view and
9025 * target.cc: Include "elfcpp.h".
9026 (Target::do_calls_non_split): New function.
9027 (Target::match_view): New function.
9028 (Target::set_view_to_nop): New function.
9029 * gold.cc (queue_middle_tasks): Give an error if mixing
9030 split-stack and non-split-stack objects with -r.
9031 * i386.cc (Target_i386::relocate_section): Add
9032 reloc_symbol_changes parameter.
9033 (Target_i386::do_calls_non_split): New function.
9034 * x86_64.cc (Target_x86_64::relocate_section): Add
9035 reloc_symbol_changes parameter.
9036 (Target_x86_64::do_calls_non_split): New function.
9037 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9039 * powerpc.cc (Target_powerpc::relocate_section): Add
9040 reloc_symbol_changes parameter.
9041 * sparc.cc (Target_sparc::relocate_section): Add
9042 reloc_symbol_changes parameter.
9043 * configure.ac: Call AM_CONDITIONAL for the default target.
9044 * configure: Rebuild.
9045 * testsuite/Makefile.am (TEST_AS): New variable.
9046 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9047 (check_DATA): Add split_i386 and split_x86_64 files.
9048 (SPLIT_DEFSYMS): Define.
9049 (split_i386_[1234n].o): New targets.
9050 (split_i386_[124]): New targets.
9051 (split_i386_[1234r].stdout): New targets.
9052 (split_x86_64_[1234n].o): New targets.
9053 (split_x86_64_[124]): New targets.
9054 (split_x86_64_[1234r].stdout): New targets.
9055 (MOSTLYCLEANFILES): Add new executables.
9056 * testsuite/split_i386.sh: New file.
9057 * testsuite/split_x86_64.sh: New file.
9058 * testsuite/split_i386_1.s: New file.
9059 * testsuite/split_i386_2.s: New file.
9060 * testsuite/split_i386_3.s: New file.
9061 * testsuite/split_i386_4.s: New file.
9062 * testsuite/split_i386_n.s: New file.
9063 * testsuite/split_x86_64_1.s: New file.
9064 * testsuite/split_x86_64_2.s: New file.
9065 * testsuite/split_x86_64_3.s: New file.
9066 * testsuite/split_x86_64_4.s: New file.
9067 * testsuite/split_x86_64_n.s: New file.
9068 * testsuite/testfile.cc (Target_test): Update relocation_section
9070 * testsuite/Makefile.in: Rebuild.
9072 2009-10-06 Ian Lance Taylor <iant@google.com>
9074 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9075 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9076 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9077 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9078 the address on ldo_addrs_.
9079 (Target_i386::Relocate::fix_up_ldo): New function.
9081 2009-10-06 Rafael Espindola <espindola@google.com>
9083 * plugin.cc (add_input_library): New.
9084 (Plugin::load): Add add_input_library to tv.
9085 (Plugin_manager::add_input_file): Add the is_lib argument.
9086 (add_input_file): Update call to Plugin_manager::add_input_file.
9087 (add_input_library): New.
9088 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9090 2009-09-30 Doug Kwan <dougkwan@google.com>
9092 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9093 symbol and call Symbol::may_need_copy_reloc to determine if
9094 a copy reloc is needed.
9095 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9096 nocopyreloc is given in command line.
9097 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9098 given in command line.
9099 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9100 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9101 of the removed Target_i386::may_need_copy_reloc.
9102 * options.h (copyreloc): New option with default value false.
9103 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9104 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9105 instead of the removed Target_powerpc::may_need_copy_reloc.
9106 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9107 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9108 instead of the removed Target_sparc::may_need_copy_reloc.
9109 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9110 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9111 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9112 instead of the removed Target_x86_64::may_need_copy_reloc.
9114 2009-09-30 Ian Lance Taylor <iant@google.com>
9116 * object.h (class Object): Remove target_ field, and target,
9117 sized_target, and set_target methods.
9118 (Object::sized_target): Remove.
9119 (class Sized_relobj): Update declarations. Remove sized_target.
9120 * object.cc (Sized_relobj::setup): Remove target parameter.
9122 (Input_objects::add_object): Don't do anything with the target.
9123 (make_elf_sized_object): Add punconfigured parameter. Change all
9124 callers. Set or test parameter target.
9125 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9127 * parameters.cc (Parameters::set_target): Change parameter type to
9129 (Parameters::default_target): Remove.
9130 (set_parameters_target): Change parameter type to be non-const.
9131 (parameters_force_valid_target): New function.
9132 (parameters_clear_target): New function.
9133 * parameters.h (class Parameters): Update declarations. Remove
9134 default_target method. Add sized_target and clear_target
9135 methods. Change target_ to be non-const.
9136 (set_parameters_target): Update declaration.
9137 (parameters_force_valid_target): Declare.
9138 (parameters_clear_target): Declare.
9139 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9140 as NULL if we aren't searching.
9141 (Add_symbols::run): Don't check for compatible target.
9142 * fileread.cc (Input_file::open_binary): Call
9143 parameters_force_valid_target.
9144 * gold.cc (queue_middle_tasks): Likewise.
9145 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9146 set_target on object.
9147 * dynobj.h (class Sized_dynobj): Update declarations.
9148 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9149 make_elf_object returns NULL.
9150 (Archive::include_member): Don't check whether object target is
9152 * output.cc (Output_section::add_input_section): Get target from
9154 (Output_section::relax_input_section): Likewise.
9155 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9157 (Sized_relobj::do_scan_relocs): Likewise.
9158 (Sized_relobj::relocate_sections): Likewise.
9159 * resolve.cc (Symbol_table::resolve): Likewise.
9160 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9161 parameter. Change all callers.
9162 (Symbol_table::add_from_object): Get target from parameters.
9163 (Symbol_table::add_from_relobj): Don't check object target.
9164 (Symbol_table::add_from_dynobj): Likewise.
9165 (Symbol_table::define_special_symbol): Get target from
9167 * symtab.h (class Symbol_table): Update declaration.
9168 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9169 parameter. Change all callers. Clear parameter target.
9170 (Binary_test): Test target here.
9171 * testsuite/object_unittest.cc (gold_testsuite): Remove
9172 target_test_pointer parameter. Change all callers.
9173 (Object_test): Test target here.
9175 2009-09-26 Ian Lance Taylor <iant@google.com>
9177 * testsuite/initpri1.c: Don't try to use constructor priorities if
9178 compiling with gcc before 4.3.
9180 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9182 * testsuite/retain_symbols_file_test.sh (check_present): Change
9183 output file name to retain_symbols_file_test.stdout.
9184 (check_absent): Likewise.
9186 2009-09-18 Craig Silverstein <csilvers@google.com>
9188 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9189 * options.cc: Include <cerrno> and <fstream>.
9190 (General_options::finalize): Parse -retain-symbols-file tag.
9191 * options.h: New flag.
9192 (General_options): New method should_retain_symbol, new
9193 variable symbols_to_retain.
9194 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9195 should_retain_symbol map.
9196 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9197 * testsuite/Makefile.in: Regenerate.
9198 * testsuite/retain_symbols_file_test.sh: New file.
9200 2009-09-18 Nick Clifton <nickc@redhat.com>
9202 * po/es.po: Updated Spanish translation.
9204 2009-09-17 Doug Kwan <dougkwan@google.com>
9206 * debug.h (DEBUG_RELAXATION): New constant.
9207 (DEBUG_ALL): Add DEBUG_RELAXATION.
9208 (debug_string_to_enum): Add relaxation debug option.
9210 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9211 Layout::Relaxation_debug_check::read_sections,
9212 Layout::Relaxation_debug_check::read_sections): New method definitions.
9213 (Layout::Layout): Initialize data members
9214 record_output_section_data_from_scrips_,
9215 script_output_section_data_list_ and relaxation_debug_check_.
9216 (Layout::save_segments, Layout::restore_segments,
9217 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9218 Layout::relaxation_loop_body): New method definitions.
9219 (Layout::finalize): Support relaxation. Move section layout code to
9220 Layout::relaxation_loop_body.
9221 (Layout::set_asection_address_from_script): Move code for orphan
9222 section placement out.
9223 (Layout::place_orphan_sections_in_script): New method definition.
9224 * layout.h (Output_segment_headers, Output_file_header):
9225 New forward class declarations.
9226 (Layout::~Layout): Define.
9227 (Layout::new_output_section_data_from_script): New method definition.
9228 (Layout::place_orphan_sections_in_script): New method declaration.
9229 (Layout::Segment_states): New type declaration.
9230 (Layout::save_segments, Layout::restore_segments,
9231 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9232 Layout::relaxation_loop_body): New method declarations.
9233 (Layout::Output_section_data_list): New type declaration.
9234 (Layout::Relaxation_debug_check): New class definition.
9235 (Layout::record_output_section_data_from_script_,
9236 Layout::script_output_section_data_list_, Layout::segment_states_,
9237 Layout::relaxation_debug_check_): New data members.
9238 * output.cc: (Output_section_headers::do_size): New method definition.
9239 (Output_section_headers::Output_section_headers): Move size
9240 computation to Output_section_headers::do_size.
9241 (Output_segment_headers::do_size): New method definition.
9242 (Output_file_header::Output_file_header): Move size computation to
9243 Output_file_header::do_size and call it.
9244 (Output_file_header::do_size): New method definition.
9245 (Output_data_group::Output_data_group): Adjust call to
9246 Output_section_data.
9247 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9248 (Output_symtab_xindex::do_write): Add array bound check.
9249 (Output_section::Input_section::print_to_mapfile): Handle
9250 RELAXED_INPUT_SECTION_CODE.
9251 (Output_section::Output_section): Initialize data member checkpoint_.
9252 (Output_section::~Output_section): Delete checkpoint object pointed
9254 (Output_section::add_input_section): Always add an Input_section if
9256 (Output_section::add_merge_input_section): Add assert.
9257 (Output_section::relax_input_section): New method definition.
9258 (Output_section::set_final_data_size): Set load address to zero for
9259 an unallocated section.
9260 (Output_section::do_address_and_file_offset_have_reset_values):
9261 New method definition.
9262 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9263 Handle relaxed input section.
9264 (Output_section::sort_attached_input_sections): Checkpoint input
9265 section list lazily.
9266 (Output_section::get_input_sections): Change type of input_sections to
9267 list of Simple_input_section pointers. Checkpoint input section list
9268 lazily. Also handle relaxed input sections.
9269 (Output_section::add_input_section_for_script): Take a reference to
9270 a Simple_input_section object instead of Relobj pointer and section
9271 index as parameter. Handle relaxed input sections.
9272 (Output_section::save_states, Output_section::restore_states): New
9274 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9275 (Output_data::is_data_size_fixed): New method definition.
9276 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9278 (Output_data::address_and_file_offset_have_reset_values): New method
9280 (Output_data::do_address_and_file_offset_have_reset_values): New method
9282 (Output_data::set_data_size): Check that data size is not fixed.
9283 (Output_data::fix_data_size): New method definition.
9284 (Output_data::is_data_size_fixed_): New data member.
9285 (Output_section_headers::set_final_data_size): New method definition.
9286 (Output_section_headers::do_size): New method declaration.
9287 (Output_segment_headers::set_final_data_size): New method definition.
9288 (Output_segment_headers::do_size): New method declaration.
9289 (Output_file_header::set_final_data_size)::New method definition.
9290 (Output_file_header::do_size)::New method declaration.
9291 (Output_section_data::Output_section_data): Add new parameter
9292 is_data_size_fixed and use it to fix data size.
9293 (Output_data_const::Output_data_const): Adjust call to base class
9294 constructor and fix data size.
9295 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9296 base class constructor and fix data size.
9297 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9298 base class constructor and fix data size.
9299 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9300 class constructor and fix data size.
9301 (Output_data_group::set_final_data_size): New method definition.
9302 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9303 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9304 class constructor and fix data size.
9305 (Output_relaxed_input_section): New class definition.
9306 (Output_section::Simple_input_section): New class definition.
9307 (Output_section::get_input_sections): Adjust parameter list.
9308 (Output_section::add_input_section_for_script): Same.
9309 (Output_section::save_states, Output_section::restore_states,
9310 Output_section::do_address_and_file_offset_have_reset_values,
9311 (Output_section::Input_section::Input_section): Handle
9312 RELAXED_INPUT_SECTION_CODE. Add new overload for
9313 Output_relaxed_input_section.
9314 (Output_section::Input_section::is_input_section,
9315 Output_section::Input_section::set_output_section): Handle relaxed
9317 (Output_section::Input_section::is_relaxed_input_section,
9318 Output_section::Input_section::output_section_data,
9319 Output_section::Input_section::relaxed_input_section): New method
9321 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9323 (Output_section::Input_section::u1_): Update comments.
9324 (Output_section::Input_section::u2_): Add new union member poris.
9325 (Output_section::Checkpoint_output_section): New classs definition.
9326 (Output_section::relax_input_section): New method declaration.
9327 (Output_section::checkpoint_): New data member.
9328 (Output_segment): Update comments.
9329 (Output_segment::Output_segment): Un-privatize copy constructor.
9330 (Output_segment::operator=): Un-privatize.
9331 * script-sections.cc (Output_section_element::Input_section_list):
9332 Change element type to Output_section::Simple_input_section.
9333 (Output_section_element_dot_assignment::set_section_addresses):
9334 Register output section data for relaxation clean up.
9335 (Output_data_exression::Output_data_expression): Adjust call to base
9336 constructor to fix data size.
9337 (Output_section_element_data::set_section_addresses): Register
9338 Output_data_expression object for relaxation clean up.
9339 (struct Input_section_info): Replace Relobj pointer and section index
9340 pair with Output_section::Simple_input_section and Convert struct to a
9342 (Input_section_sorter::operator()): Adjust access to
9343 Input_section_info data member to use accessors.
9344 (Output_section_element_input::set_section_addresses): Use layout
9345 parameter. Adjust code to use Output_section::Simple_input_section
9346 and Input_secction_info classes. Register filler for relaxation
9348 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9349 and section index pair with Output_section::Simple_input_section
9350 class. Adjust code accordingly.
9351 (Phdrs_element::release_segment): New method definition.
9352 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9354 (Script_sections::release_segments): New method definition.
9355 * gold/script-sections.h (Script_sections::release_segments): New
9357 * gold/target.h (Target::may_relax, Target::relax,
9358 Target::do_may_relax, Target::do_relax): New method definitions.
9360 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9362 * arm.cc (has_signed_unsigned_overflow): New function.
9363 (Arm_relocate_functions::abs8): New function.
9364 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9365 (Target_arm::Scan::global): Likewise.
9366 (Target_arm::relocate::relocate): Likewise.
9367 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9370 2009-09-16 Cary Coutant <ccoutant@google.com>
9372 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9373 * testsuite/Makefile.in: Regenerate.
9375 2009-09-11 Nick Clifton <nickc@redhat.com>
9377 * po/gold.pot: Updated by the Translation project.
9379 2009-09-08 Cary Coutant <ccoutant@google.com>
9381 * output.cc (Output_file::open): Add execute permission to empty file.
9382 * testsuite/Makefile.am (permission_test): New test.
9383 * testsuite/Makefile.in: Regenerate.
9385 2009-09-02 Ian Lance Taylor <iant@google.com>
9387 * output.cc (Output_file::resize): Call map_no_anonymous rather
9390 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9392 * gold.cc: Include "incremental.h".
9393 (queue_initial_tasks): Call Incremental_checker methods.
9394 * incremental.cc: Include "output.h".
9395 (Incremental_checker::can_incrementally_link_output_file): New
9397 * incremental.h (Incremental_checker): New class.
9399 * output.cc (Output_file::open_for_modification): New method.
9400 (Output_file::map_anonymous): Changed return type to bool. Record
9402 (Output_file::map_no_anonymous): New method, broken out of map.
9403 (Output_file::map): Use map_no_anonymous and map_anonymous.
9404 * output.h (class Output_file): Update declarations.
9406 2009-08-24 Cary Coutant <ccoutant@google.com>
9408 * options.h (Command_line::Pre_options): New class.
9409 (Command_line::pre_options): New member.
9410 * options.cc (gold::options::ready_to_register): New variable.
9411 (One_option::register_option): Do nothing if not registering options.
9412 Assert if same short option registered twice.
9413 (General_options::General_options): Turn off option registration when
9415 (Command_line::Pre_options::Pre_options): New constructor.
9417 2009-08-24 Cary Coutant <ccoutant@google.com>
9419 * options.h (General_options::no_keep_memory): Remove incorrect
9422 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9424 * Makefile.am (am__skiplex, am__skipyacc): New.
9425 * Makefile.in: Regenerate.
9427 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9429 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9430 (INCLUDES): ... this.
9431 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9432 (AM_CPPFLAGS): Renamed from ...
9433 (INCLUDE): ... this.
9434 * Makefile.in, testsuite/Makefile.in: Regenerate.
9436 * Makefile.in: Regenerate.
9437 * aclocal.m4: Likewise.
9438 * config.in: Likewise.
9439 * configure: Likewise.
9440 * testsuite/Makefile.in: Likewise.
9442 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9443 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9444 * Makefile.in: Regenerate.
9445 * testsuite/Makefile.in: Regenerate.
9447 2009-08-19 Cary Coutant <ccoutant@google.com>
9449 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9450 symbols in shared libraries overridden by hidden or internal symbols
9451 in the main program.
9453 2009-08-19 Chris Demetriou <cgd@google.com>
9455 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9456 checking source file names in error messages.
9458 2009-08-18 Doug Kwan <dougkwan@google.com>
9460 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9461 an elcpp::Ehdr as parameter. Adjust call to set_target.
9462 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9463 an elfcpp::Ehdr as parameter.
9464 * object.cc (Object::set_target): Remove the version that looks up
9465 a target and sets it.
9466 (Sized_relobj::setup): Take a Target object instead of
9467 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9468 (make_elf_sized_object): Find target and ask target to
9470 * object.h: (Object::set_target): Remove the version that looks up
9471 a target and sets it.
9472 (Sized_relobj::setup): Take a Target object instead of
9473 an elfcpp:Ehdr as parameter.
9474 * target.cc: Include dynobj.h.
9475 (Target::do_make_elf_object_implementation): New.
9476 (Target::do_make_elf_object): New.
9477 * target.h (Target::make_elf_object): New template declaration.
9478 (Target::do_make_elf_object): New method declarations.
9479 (Target::do_make_elf_object_implementation): New template declaration.
9481 2009-08-14 Ian Lance Taylor <iant@google.com>
9483 * gold.h (FUNCTION_NAME): Define.
9484 (gold_unreachable): Use FUNCTION_NAME.
9486 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9488 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9489 symbol in the --keep-unique list is not found.
9491 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9493 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9494 been maked as --keep-unique.
9495 (Icf::unfold_section): New function.
9496 * icf.h (Icf::unfold_section): New function.
9497 * options.h (General_options::keep_unique): New option.
9498 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9499 * testsuite/Makefile.in: Regenerate.
9500 * testsuite/icf_keep_unique_test.sh: New file.
9501 * testsuite/icf_keep_unique_test.cc: New file.
9503 2009-08-12 Cary Coutant <ccoutant@google.com>
9506 * resolve.cc (Symbol_table::resolve): Check for references from
9507 dynamic objects to hidden and internal symbols.
9508 * testsuite/Makefile.am (hidden_test.sh): New test.
9509 * testsuite/Makefile.in: Regenerate.
9510 * testsuite/hidden_test.sh: New script.
9511 * testsuite/hidden_test_1.c: New test source.
9512 * testsuite/hidden_test_main.c: New test source.
9514 2009-08-11 Doug Kwan <dougkwan@google.com>
9516 * arm.cc: Update comments.
9517 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9518 segment to locate the .ARM.exidx section if present.
9520 2009-08-09 Doug Kwan <dougkwan@google.com>
9522 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9525 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9526 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9529 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9531 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9532 valid tls_segment only for non-debug-section relocations.
9533 * testsuite/Makefile.am: Add gc_tls_test.
9534 * testsuite/Makefile.in: Regenerate.
9535 * testsuite/gc_tls_test.cc: New file.
9536 * testsuite/gc_tls_test.sh: New file.
9538 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9542 * Makefile.am (CCFILES): Add icf.cc.
9544 * Makefile.in: Regenerate.
9545 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9546 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9547 section, symbol and addend information for the relocs.
9548 * gold.cc (queue_middle_tasks): Call identical code folding.
9549 * gold.h: Add defines for multimap.
9550 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9551 to the call of finalize_local_symbols.
9552 * main.cc (main): Create object of class Icf.
9553 * object.cc (Sized_relobj::do_layout): Allow this function to be
9554 called twice during icf.
9555 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9556 to sections marked as identical by icf.
9557 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9559 (Sized_relobj::do_section_entsize): New function.
9560 * object.h (Object::section_entsize): New function.
9561 (Object::do_section_entsize): New pure virtual function.
9562 (Relobj::finalize_local_symbols): Add new parameter.
9563 (Relobj::do_section_entsize): New function.
9564 * options.h (General_options::icf): New option.
9565 (General_options::icf_iterations): New option.
9566 (General_options::print_icf_sections): New option.
9567 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9568 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9569 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9571 * symtab.cc (Symbol_table::is_section_folded): New function.
9572 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9573 to sections marked as identical by icf.
9574 * symtab.h (Symbol_table::set_icf): New function.
9575 (Symbol_table::icf): New function.
9576 (Symbol_table::is_section_folded): New function.
9577 (Symbol_table::icf_): New data member.
9578 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9579 * testsuite/Makefile.am: Add commands to build icf_test.
9580 * testsuite/Makefile.in: Regenerate.
9581 * testsuite/icf_test.sh: New file.
9582 * testsuite/icf_test.cc: New file.
9584 2009-07-24 Chris Demetriou <cgd@google.com>
9586 * layout.cc (is_compressible_debug_section): Fix incorrect
9587 comment about compressed section names.
9589 2009-07-20 Ian Lance Taylor <ian@airs.com>
9592 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9594 2009-07-16 Ian Lance Taylor <iant@google.com>
9597 * layout.h: #include <map>.
9598 (class Kept_section): Change from struct to class. Add accessors
9599 and setters. Add section size to Comdat_group mapping. Change
9600 Comdat_group to std::map. Add is_comdat_ field. Add
9601 linkonce_size field in union.
9602 (class Layout): Update declaration of find_or_add_kept_section.
9603 Don't declare find_kept_object.
9604 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9605 parameter. Add object, shndx, is_comdat, and is_group_name
9606 parameters. Change all callers. Adjust for new Kept_section.
9607 (Layout::find_kept_object): Remove.
9608 * object.cc (Sized_relobj::include_section_group): Update use of
9609 Kept_section. Rename secnum to shndx. Only record
9610 Kept_comdat_section if sections are the same size.
9611 (Sized_relobj::include_linkonce_section): Update use of
9612 Kept_section. Only record Kept_comdat_section if sections are the
9613 same size. Set size of linkonce section.
9614 (Sized_relobj::map_to_kept_section): Update call to
9615 get_kept_comdat_section.
9616 * object.h (class Sized_relobj): Rename fields in
9617 Kept_comdat_section to drop trailing underscores; change object
9618 field to Relobj*. Change Kept_comdat_section_table to store
9619 struct rather than pointer.
9620 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9621 Add kept_object and kept_shndx parameters. Change all callers.
9622 (Sized_relobj::get_kept_comdat_section): Change return type to
9623 bool. Add kept_object and kept_shndx parameters. Change all
9625 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9626 Layout::find_or_add_kept_section.
9628 2009-07-09 Ian Lance Taylor <iant@google.com>
9630 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9631 Reserve space in the hash table.
9633 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9635 * fileread.cc (File_read::get_mtime): New method.
9636 * fileread.h (Timespec): New structure.
9637 (File_read::get_mtime): New method.
9638 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9639 Renamed from timestamp_nsec.
9640 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9642 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9644 (Incremental_inputs::report_archive): Save mtime; style fix.
9645 (Incremental_inputs::report_obejct): Save mtime; style fix.
9646 (Incremental_inputs::report_script): Save mtime; style fix.
9647 (Incremental_inputs::finalize_inputs): Style fix.
9648 (Incremental_inputs::finalize): Style fix.
9649 (Incremental_inputs::create_input_section_data): Store inputs
9651 * incremental.h (Incremental_inputs::report_script): Add mtime
9653 (Incremental_inputs::Input_info::Input_info): Intialize only one
9655 (Incremental_inputs::Input_info::archive): Move to nameless
9657 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9658 (Incremental_inputs::Input_info::script): Move to nameless union.
9659 (Incremental_inputs::mtime): New field.
9660 * script.cc (read_input_script): Pass file mtime to
9662 * script.h (Script_info::inputs): Style fix.
9664 2009-07-01 Ian Lance Taylor <ian@airs.com>
9666 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9669 2009-06-24 Ian Lance Taylor <iant@google.com>
9672 * layout.cc (Layout::choose_output_section): If we find an
9673 existing section, update the flags.
9674 (Layout::create_notes): New function, broken out of
9676 (Layout::finalize): Don't create note sections.
9677 (Layout::create_note): Don't crash if linker script discards
9679 (Layout::create_gold_note): Likewise.
9680 (Layout::create_build_id): Likewise. Don't set
9681 after_input_sections on the section.
9682 (Layout::create_executable_stack_info): Remove target parameter.
9684 * layout.h (class Layout): Declare create_notes. Update
9685 declaration of create_executable_stack_info.
9686 * gold.cc (queue_middle_tasks): Call create_notes.
9687 * output.cc (Output_section::update_flags_for_input_section): Move
9688 here from output.h. If SHF_ALLOC flag is newly set, mark address
9690 * output.h (Output_data::mark_address_invalid): New function.
9691 (class Output_section): Only declare, not define,
9692 update_flags_for_input_section. Remove set_flags.
9694 2009-06-24 Ian Lance Taylor <iant@google.com>
9696 * script-sections.cc (Output_section_definition::
9697 set_section_addresses): Rename shadowing local load_address to
9700 2009-06-24 Ian Lance Taylor <iant@google.com>
9703 * reloc.cc (relocate_sections): Skip empty relocation sections.
9705 2009-06-23 Ian Lance Taylor <iant@google.com>
9708 * layout.cc (Layout::create_note): Use choose_output_section
9709 rather than make_output_section.
9711 2009-06-23 Ian Lance Taylor <iant@google.com>
9714 * options.cc (General_options::parse_V): Set printed_version_.
9715 (General_options::General_options): Initialize printed_version_.
9716 * options.h (class General_options): Add printed_version_ field.
9717 * gold.cc (queue_initial_tasks): If there are no input files,
9718 don't give a fatal error if we printed the version information.
9719 (queue_middle_tasks): If using -r with a shared object, give a
9720 fatal error rather than an ordinary error.
9722 2009-06-23 Ian Lance Taylor <iant@google.com>
9725 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9726 (Layout::make_output_section): Set have_stabstr_section_ if we see
9727 a .stab*str section.
9728 (Layout::finalize): Call link_stabs_sections.
9729 (Layout::link_stabs_sections): New file.
9730 * layout.h (class Layout): Add have_stabstr_section_ field.
9731 Declare link_stabs_sections.
9733 2009-06-23 Doug Kwan <dougkwan@google.com>
9735 * Makefile.am (libgold_a_LIBADD): New.
9736 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9737 * Makefile.in: Regenerate.
9738 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9739 * configure: Regenerate.
9740 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9741 * fileread.cc: Include sys/state.h
9742 * gold.h: Declare memmem and strndup if found missing.
9743 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9745 2009-06-23 Ian Lance Taylor <iant@google.com>
9747 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9748 * configure: Rebuild.
9750 2009-06-23 Ian Lance Taylor <iant@google.com>
9753 * object.cc (Object::section_contents): Don't try to get a view if
9754 the section has length zero.
9755 (Object::handle_gnu_warning_section): If the section is empty, use
9756 the name of the section as the warning.
9758 2009-06-23 Ian Lance Taylor <iant@google.com>
9761 * stringpool.h (class Stringpool_template): Add optimize_ field.
9762 (Stringpool_template::set_optimize): New function.
9763 * stringpool.cc (Stringpool_template::Stringpool_template):
9764 Initialize optimize_ field.
9765 (Stringpool_template::set_string_offsets): Test local optimize
9766 fild rather than parameter.
9767 * layout.cc (Layout::Layout): Call set_optimize on the section
9770 2009-06-22 Ian Lance Taylor <iant@google.com>
9773 * yyscript.y: Parse TARGET.
9774 * script.cc (script_set_target): New function.
9775 * script-c.h (script_set_target): Declare.
9776 * options.cc (General_options::string_to_object_format): Rename
9777 from string_to_object_format in anonymous namespace. Change
9779 * options.h (class General_options): Declare
9780 string_to_object_format.
9782 2009-06-22 Ian Lance Taylor <iant@google.com>
9784 * script-sections.cc (Script_sections::create_segments): Don't put
9785 program headers in a PT_LOAD segment if -n or -N.
9787 2009-06-22 Ian Lance Taylor <iant@google.com>
9790 * options.h (class General_options): Add -z lazy and -z now. Sort
9791 -z options into alphabetical order.
9792 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9794 2009-06-21 Ian Lance Taylor <iant@google.com>
9796 * layout.cc (Layout::make_output_section): Call
9797 Target::new_output_section.
9798 (Layout::attach_allocated_section_to_segment): Put large section
9799 sections in a separate load segment with the large segment flag
9801 (Layout::segment_precedes): Sort large data segments after other
9803 (align_file_offset): New static function.
9804 (Layout::set_segment_offsets): Use align_file_offset.
9805 * output.h (class Output_section): Add is_small_section_ and
9806 is_large_section_ fields.
9807 (Output_section::is_small_section): New function.
9808 (Output_section::set_is_small_section): New function.
9809 (Output_section::is_large_section): New function.
9810 (Output_section::set_is_large_section): New function.
9811 (Output_section::is_large_data_section): New function.
9812 (class Output_segment): Add is_large_data_segment_ field.
9813 (Output_segment::is_large_data_segment): New function.
9814 (Output_segment::set_is_large_data_segment): New function.
9815 * output.cc (Output_section::Output_section): Initialize new
9817 (Output_segment::Output_segment): Likewise.
9818 (Output_segment::add_output_section): Add assertion that large
9819 data sections always go in large data segments. Force small data
9820 sections to the end of the list of data sections. Force small BSS
9821 sections to the start of the list of BSS sections. For large BSS
9822 sections to the end of the list of BSS sections.
9823 * symtab.h (class Symbol): Declare is_common_shndx.
9824 (Symbol::is_defined): Check Symbol::is_common_shndx.
9825 (Symbol::is_common): Likewise.
9826 (class Symbol_table): Define enum Commons_section_type. Update
9827 declarations. Add small_commons_ and large_commons_ fields.
9828 * symtab.cc (Symbol::is_common_shndx): New function.
9829 (Symbol_table::Symbol_table): Initialize new fields.
9830 (Symbol_table::add_from_object): Put small and large common
9831 symbols in the right list.
9832 (Symbol_table::sized_finalized_symbol): Check
9833 Symbol::is_common_shndx.
9834 (Symbol_table::sized_write_globals): Likewise.
9835 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9836 common symbol lists. Don't call do_allocate_commons_list if the
9838 (Symbol_table::do_allocate_commons_list): Remove is_tls
9839 parameter. Add comons_section_type parameter. Change all
9840 callers. Handle small and large common symbols.
9841 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9842 Symbol::is_common_shndx.
9843 * resolve.cc (symbol_to_bits): Likewise.
9844 * target.h (Target::small_common_shndx): New function.
9845 (Target::small_common_section_flags): New function.
9846 (Target::large_common_shndx): New function.
9847 (Target::large_common_section_flags): New function.
9848 (Target::new_output_section): New function.
9849 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9850 small_common_section_flags, and large_common_section_flags
9852 (Target::do_new_output_section): New virtual function.
9853 * arm.cc (Target_arm::arm_info): Initialize new fields.
9854 * i386.cc (Target_i386::i386_info): Likewise.
9855 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9857 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9858 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9859 (Target_x86_64::do_new_output_section): New function.
9860 * configure.ac: Define conditional MCMODEL_MEDIUM.
9861 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9862 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9863 (large_LDFLAGS): Define.
9864 * testsuite/large.c: New file.
9865 * testsuite/testfile.cc (Target_test::test_target_info):
9866 Initialize new fields.
9867 * configure, testsuite/Makefile.in: Rebuild.
9869 2009-06-05 Doug Kwan <dougkwan@google.com>
9871 * Makefile.am (CCFILES): Add target.cc.
9872 * Makefile.in: Regenerate.
9873 * i386.cc (class Target_i386): Define new virtual method to
9874 override do_is_local_label_name in parent.
9875 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9876 local symbols if --discard-locals or -X is given.
9877 * options.h (class General_options): Declare new options
9878 '--discard-locals' and '-X' for discarding locals.
9879 * target.h (class Target): Define new methods is_local_label_name.
9880 Declare new virtual method do_is_local_label_name.
9881 * target.cc: New file.
9882 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9883 (check_SCRIPTS): Add discard_locals_test.sh.
9884 (check_DATA): Add discard_local_tests.syms.
9885 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9886 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9887 * testsuite/Makefile.in: Regenerate.
9888 * testsuite/discard_locals_test.c: New file.
9889 * testsuite/discard_locals_test.sh: Same.
9891 2009-06-05 Doug Kwan <dougkwan@google.com>
9893 * object.cc (Sized_relobj::Sized_relobj): Initialize
9894 discarded_eh_frame_shndx_ to -1U.
9895 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9897 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9898 a discarded .eh_frame section.
9899 (Sized_relobj::do_finalize_local_symbols): Ditto.
9900 * object.h (class Sized_relobj): Declare new member
9901 discarded_eh_frame_shndx_.
9902 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9903 (local_labels_test.o, local_labels_test): New rules.
9904 * testsuite/Makefile.in: Regenerate.
9906 2009-06-04 Doug Kwan <dougkwan@google.com>
9908 * layout.cc (Layout::section_name_mapping): Add mapping for
9909 special ARM sections.
9911 2009-06-03 Doug Kwan <dougkwan@google.com>
9913 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9914 (utils::has_overflow): Same.
9916 2009-06-03 Ian Lance Taylor <iant@google.com>
9918 * layout.cc (Layout::section_name_mapping): New array, replacing
9919 Layout::linkonce_mapping.
9920 (Layout::section_name_mapping_count): New variable, replacing
9921 Layout::linkonce_mapping_count.
9922 (Layout::linkonce_output_name): Remove.
9923 (Layout::output_section_name): Rewrite.
9924 * layout.h (class Layout): Rename Linkonce_mapping to
9925 Section_name_mapping, linkonce_mapping to section_name_mapping,
9926 linkonce_mapping_count to section_name_mapping_count. Don't
9927 declare linkonce_output_name.
9929 2009-06-03 Doug Kwan <dougkwan@google.com>
9931 * gold/arm.cc (namespace utils): New.
9932 (Target_arm::reloc_is_non_pic): Define new method.
9933 (class Arm_relocate_functions): New.
9934 (Target_arm::Relocate::relocate): Handle relocation types used by
9937 2009-06-03 Ian Lance Taylor <iant@google.com>
9939 * arm.cc (Target_arm::scan::global): Use || instead of |.
9941 2009-06-02 Doug Kwan <dougkwan@google.com>
9943 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9944 issued_non_pic_error_.
9945 (class Target_arm::Scan): Declare new method check_non_pic.
9946 Define new method symbol_needs_plt_entry.
9947 Declare new data member issued_non_pic_error_.
9948 (class Target_arm::Relocate): Declare new method
9949 should_apply_static_reloc.
9950 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9951 (Target_arm::Scan::check_non_pic): Define new method.
9952 (Target_arm::Scan::local): Handle a small subset of reloc types used
9954 (Target_arm::Scan::local): Same.
9955 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9957 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9959 * incremental.cc (Incremental_inputs::report_command_line): Filter
9960 out --incremental-* options.
9962 2009-05-29 Doug Kwan <dougkwan@google.com>
9964 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9966 (class Target_arm): Update comment.
9967 (Target_arm::Target_arm): Initialize new data members GOT_,
9968 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9969 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9970 and Target_arm::rel_dyn_section.
9971 Declare new_enum Target_arm::Got_type.
9972 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9974 Update commments for member do_dynsym_value.
9975 (Target_arm::got_size, Target_arm::plt_section,
9976 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9977 new methods inside class defintion.
9978 (Target_arm::got_section): Define new method.
9979 (Target_arm::rel_dyn_section): Same.
9980 (Output_data_plt_arm): New template class.
9981 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9982 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9983 (Output_data_plt_arm::add_entry): Same.
9984 (Output_data_plt_arm::first_plt_entry): Define new
9985 static data member for PLT instruction template.
9986 (Output_data_plt_arm::plt_entry): Same.
9987 (Output_data_plt_arm::do_write): Define new method.
9988 (Target_arm::make_plt_entry): Same.
9989 (Target_arm::do_finalize_sections): Same.
9990 (Target_arm::do_dynsym_value): Same.
9992 2009-05-28 Doug Kwan <dougkwan@google.com>
9994 * Makefile.am (TARGETSOURCES): Add arm.cc.
9995 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9996 * Makefile.in: Regenerate.
9998 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10000 2009-05-26 Doug Kwan <dougkwan@google.com>
10002 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10003 (General_options::check_excluded_libs): Strip off directories in
10004 archive name before matching like GNU ld does.
10005 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10006 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10007 (exclude_libs_test_LDFLAGS): Add linker option
10008 -Wl,--exclude-libs,libexclude_libs_test_3
10009 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10010 an explicit archive without using -l.
10011 (alt/libexclude_libs_test_3.a): New make rule.
10012 * testsuite/Makefile.in: Regenerate.
10013 * testsuite/exclude_libs_test.c : Declare lib3_default().
10015 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10016 * exclude_libs_test_3.c: New file.
10018 2009-05-26 Nick Clifton <nickc@redhat.com>
10020 * po/id.po: New Indonesian translation.
10021 * po/gold.pot: Updated template file.
10023 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10025 * testsuite/Makefile.am: Add -ffunction-sections to compile
10026 gc_comdat_test files. Add -Wl,--gc-sections to build
10028 * testsuite/Makefile.in: Regenerate.
10029 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10031 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10033 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10034 kept comdat section was garbage collected.
10035 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10036 * testsuite/Makefile.in: Regenerate.
10037 * testsuite/gc_comdat_test.sh: New file.
10038 * testsuite/gc_comdat_test_1.cc: New file.
10039 * testsuite/gc_comdat_test_2.cc: New file.
10041 2009-05-19 Doug Kwan <dougkwan@google.com>
10043 * archive.cc (Archive::Archive): Move constructor from archive.h
10044 to here. Initialize no_export_.
10045 (Archive::get_elf_object_for_member): Set no_export flag of object.
10046 * archive.h (Archive::Archive): Move constructor body to
10048 (Archive::no_export): New method.
10049 (Archive::no_export_): New field.
10050 * object.h (Object::Object): Initialize no_export_ to false.
10051 (Object::no_export, Object::set_no_export): New methods.
10052 (Object::no_export_): New field.
10053 * options.cc (General_options::parse_exclude_libs): New method.
10054 (General_options::check_excluded_libs) Same.
10055 * options.h (exclude_libs): New option.
10056 (General_options::check_excluded_libs): New method declaration.
10057 (General_options::excluded_libs_): New field.
10058 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10059 default or protected visibility if an object has no-export flag set.
10060 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10061 (check_SCRIPTS): Add exclude_libs_test.sh.
10062 (check_DATA): Add exclude_libs_test.syms.
10063 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10064 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10065 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10066 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10067 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10068 libexclude_libs_test_2.a): New rules.
10069 * testsuite/Makefile.in: Regenerate.
10070 * testsuite/exclude_libs_test.c: New file.
10071 * testsuite/exclude_libs_test.sh: Ditto.
10072 * testsuite/exclude_libs_test_1.c: Ditto.
10073 * testsuite/exclude_libs_test_2.c: Ditto.
10075 2009-05-15 Ian Lance Taylor <iant@google.com>
10077 * configure.ac: Check for declarations for cases where libiberty.h
10078 checks HAVE_DECL_xxx.
10079 * configure, config.in: Rebuild.
10081 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10083 * gold.h (Incremental_argument_list): Remove (invalid) forward
10085 * incremental.cc (Incremental_inputs::report_achive): New method.
10086 (Incremental_inputs::report_object): New method.
10087 (Incremental_inputs::report_script): New method.
10088 (Incremental_inputs::finalize_inputs): New method.
10089 (Incremental_inputs::finalize): Call finalize_inputs().
10090 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10091 Create inputs entries.
10092 * incremental.h (Incremental_input_type): New enum.
10093 (Incremental_inputs::Incremental_input): Initialize new fields.
10094 (Incremental_inputs::report_inputs): New method.
10095 (Incremental_inputs::report_achive): New method.
10096 (Incremental_inputs::report_object): New method.
10097 (Incremental_inputs::report_script): New method.
10098 (Incremental_inputs::finalize_inputs): New method.
10099 (Incremental_inputs::Input_info): New struct.
10100 (Incremental_inputs::Input_info_map): New typedef.
10101 (Incremental_inputs::lock_): New field.
10102 (Incremental_inputs::Inputs_): New field.
10103 (Incremental_inputs::Inputs_map): New field.
10104 * main.cc (main): Call Incremental_input::report_inputs.
10105 * options.h (Input_argument_list): Typedef moved from
10107 (Input_file_group::Files): Remove, use ::Input_argument_list.
10108 (Input_file_group::Input_argument_list): Remove, use
10109 ::Input_argument_list.
10110 * plugin.cc (Plugin_manager::add_input_file): Add error in
10112 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10114 * script.cc (read_input_script): Call
10115 Incremental_input::report_script.
10116 * script.h (Script_info): New class.
10118 2009-04-27 Ian Lance Taylor <iant@google.com>
10120 * x86_64.cc (do_adjust_output_section): Set entsize to
10123 2009-04-23 Elliott Hughes <enh@google.com>
10125 * output.cc (Output_file::close): After short writes, continue
10126 writing from the correct offset in the buffer being written.
10128 2009-04-23 Chris Demetriou <cgd@google.com>
10130 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10131 * configure: Regenerate.
10132 * config.in: Regenerate.
10133 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10134 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10136 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10138 * incremental.cc (Incremental_inputs_header_data): Renamed from
10139 Incremental_input_header_data.
10140 (Incremental_inputs_header_data::data_size): New field.
10141 (Incremental_inputs_header_data::put_input_file_count): Renamed
10142 from input_file_count.
10143 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10144 from command_line_offset.
10145 (Incremental_inputs_header_data::put_reserved): Renamed from
10147 (Incremental_inputs_entry_data): Renamed from
10148 Incremental_input_entry_data.
10149 (Incremental_inputs_entry_data::data_size): New field.
10150 (Incremental_inputs::report_command_line): New method.
10151 (Incremental_inputs::finalize): New method.
10152 (Incremental_inputs::create_incremental_inputs_data): New method.
10153 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10154 * incremental.h: New file.
10155 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10156 (Layout::finalize): Create incremental inputs section in
10157 incremental builds.
10158 (Layout::create_incremental_info_sections): New method.
10159 * layout.h (Layout::incremental_inputs): New method.
10160 (Layout::create_incremental_info_sections): New method.
10161 (Layout::incremental_inputs_): New field.
10162 * main.cc (main): Notify Incremental_input of the command line.
10164 2009-04-01 Ian Lance Taylor <iant@google.com>
10165 Mikolaj Zalewski <mikolajz@google.com>
10167 * gold.h (reserve_unordered_map): Define, three versions, one for
10168 each version of Unordered_map.
10169 * layout.cc (Layout::Layout): Remove options parameter. Add
10170 number_of_input_files parameter. Don't initialize options_.
10171 Initialize number_of_input_files_ and resized_signatures_. Move
10172 sections_are_attached_.
10173 (Layout::layout_group): Reserve space for group_signatures_.
10174 (Layout::find_or_add_kept_section): Change name parameter to be a
10175 reference. Resize signatures_ map when it gets large enough.
10176 (Layout::layout_eh_frame): Use parameters->options() instead of
10178 (Layout::make_output_section): Likewise.
10179 (Layout::attach_allocated_section_to_segment): Likewise.
10180 (Layout::finalize, Layout::create_executable_stack): Likewise.
10181 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10182 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10183 * layout.h (class Layout): Update declarations. Remove options_
10184 field. Add number_of_input_files_ and resized_signatures_
10185 fields. Move sections_are_attached_ field.
10186 * main.cc (main): Pass number of input files to Layout
10187 constructor. Don't pass options.
10189 2009-03-30 Ian Lance Taylor <iant@google.com>
10191 * ffsll.c (ffsll): Correct implementation.
10193 2009-03-27 Ian Lance Taylor <iant@google.com>
10195 * ffsll.c: New file.
10196 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10197 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10198 * ftruncate.c (ftruncate): Declare before definition.
10199 * mremap.c (mremap): Likewise.
10200 * pread.c (pread): Likewise.
10201 * configure, Makefile.in, config.in: Rebuild.
10203 * mremap.c: New file.
10204 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10205 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10206 (mremap): Declare if HAVE_MREMAP is not defined.
10207 * configure, Makefile.in, config.in: Rebuild.
10209 2009-03-27 Cary Coutant <ccoutant@google.com>
10211 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10212 position independent.
10213 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10214 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10216 2009-03-24 Cary Coutant <ccoutant@google.com>
10218 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10220 (needs_dynamic_reloc): Likewise.
10222 2009-03-24 Ian Lance Taylor <iant@google.com>
10224 * yyscript.y (file_cmd): Recognize EXTERN.
10225 (extern_name_list, extern_name_list_body): New nonterminals.
10226 * script.cc (script_add_extern): Define.
10227 * script-c.h (script_add_extern): Declare.
10229 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10231 * object.cc (is_elf_object): Define.
10232 * object.h (is_elf_object): Declare.
10233 * archive.cc (Archive::get_elf_object_for_member): Call
10235 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10237 2009-03-24 Elliott Hughes <enh@google.com>
10239 * output.cc (Output_file::map_anonymous): Define.
10240 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10241 try an anonymous one. Report the size if the mmap fails.
10242 * output.h (class Output_file): Declare map_anonymous.
10244 2009-03-24 Ian Lance Taylor <iant@google.com>
10246 * target-select.cc (instantiate_target): Don't acquire the lock if
10247 the instantiated_target_ field has already been set.
10249 2009-03-23 Ian Lance Taylor <iant@google.com>
10251 * gold-threads.h (class Initialize_lock): Define.
10252 * gold-threads.cc (class Initialize_lock_once): Define.
10253 (initialize_lock_control): New static variable.
10254 (initialize_lock_pointer): New static variable.
10255 (initialize_lock_once): New static function.
10256 (Initialize_lock::Initialize_lock): Define.
10257 (Initialize_lock::initialize): Define.
10258 * target-select.h: Include "gold-threads.h".
10259 (class Target_selector): Add lock_ and initialize_lock_ fields.
10260 Don't define instantiate_target, just declare it.
10261 * target-select.cc (Target_selector::Target_selector): Initialize
10263 (Target_selector::instantiate_target): Define.
10264 * descriptors.h: Include "gold-threads.h".
10265 (class Descriptors): Add initialize_lock_ field.
10266 * descriptors.cc (Descriptors::Descriptors): Initialize new
10268 (Descriptors::open): Use initialize_lock_ field
10269 * errors.h (class Errors): Add initialize_lock_ field.
10270 * errors.cc (Errors::Errors): Initialize new field.
10271 (Errors::initialize_lock): Use initialize_lock_ field.
10272 * powerpc.cc (class Target_selector_powerpc): Remove
10273 instantiated_target_ field. In do_recognize call
10274 instantiate_target rather than do_instantiate_target. In
10275 do_instantiate_target just allocate a new target.
10276 * sparc.cc (class Target_selector_sparc): Likewise.
10278 * freebsd.h: New file.
10279 * i386.cc: Include "freebsd.h".
10280 (Target_i386): Derive from Target_freebsd rather than
10282 (Target_selector_i386): Derive from Target_selector_freebsd rather
10283 than Target_selector.
10284 * x86_64.cc: Include "freebsd.h".
10285 (Target_x86_64): Derive from Target_freebsd rather than
10287 (Target_selector_x86_64): Derive from Target_selector_freebsd
10288 rather than Target_selector.
10289 * target.h (class Target): Add adjust_elf_header and
10290 do_adjust_elf_header.
10291 * output.cc (Output_file_header:: do_sized_write): Call target
10292 adjust_elf_header routine.
10293 * configure.tgt: Set targ_osabi.
10294 * configure.ac: Define GOLD_DEFAULT_OSABI.
10295 * parameters.cc (Parameters::default_target): Pass
10296 GOLD_DEFAULT_OSABI to select_target.
10297 * target-select.h (class Target_selector): Make instantiate_target
10298 protected rather than private.
10299 * Makefile.am (HFILES): Add freebsd.h.
10300 * configure, Makefile.in, config.in: Rebuild.
10302 * merge.cc (do_add_input_section): Correct pend value. Change
10303 message about last entry not being null terminated from error to
10306 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10308 * incremental.cc: New file.
10309 * Makefile.am (CCFILES): Add incremental.cc.
10310 * Makefile.in: Rebuild.
10312 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10314 * layout.cc (Layout::output_section_name): Preserve names
10315 of '.note.' sections.
10317 2009-03-19 Ian Lance Taylor <iant@google.com>
10319 * descriptors.cc (Descriptors::open): Check that the options are
10320 valid before using them.
10322 2009-03-18 Ian Lance Taylor <iant@google.com>
10324 * script-sections.h: Include <list>.
10325 (class Script_sections): Change Sections_elements from std::vector
10326 to std::list. Typedef public Elements_iterator. Add
10327 orphan_section_placement_, data_segment_align_start_, and
10328 saw_data_segment_align_ fields. Remove data_segment_align_index_
10330 * script-sections.cc (class Orphan_section_placement): New class.
10331 (class Sections_element): Add virtual functions is_relro and
10332 orphan_section_init. Remove virtual function place_orphan_here.
10333 (class Output_section_definition): Add is_relro and
10334 orphan_section_init. Remove place_orphan_here.
10335 (class Orphan_output_section): Likewise.
10336 (Script_sections::Script_sections): Update for field changes.
10337 (Script_sections::data_segment_align): Set saw_data_segment_align_
10338 and data_segment_align_start_, not data_segment_align_index.
10339 (Script_sections::data_segment_relro_end): Check
10340 saw_data_segment_align_. Use data_segment_align_start_ rather
10341 than data_segment_align_index_.
10342 (Script_sections::place_orphan): Rewrite to use
10343 Orphan_section_placement.
10345 2009-03-17 Ian Lance Taylor <iant@google.com>
10347 * archive.cc (Archive::add_symbols): Check for a version attached
10348 to the symbol name in the archive map.
10349 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10350 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10351 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10352 (ver_test_11.a): New target.
10353 * testsuite/Makefile.in: Rebuild.
10355 * configure.ac: Check for chsize and posix_fallocate. Replace
10357 * ftruncate.c: New file, from gnulib.
10358 * output.cc (posix_fallocate): Define dummy version if not
10359 HAVE_POSIX_FALLOCATE.
10360 (Output_file::map): Call posix_fallocate rather than lseek and
10362 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10363 * configure, Makefile.in, config.in: Rebuild.
10365 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10367 * layout.h (Layout::create_note): Add section_name parameter.
10368 * layout.cc (Layout::create_note): Likewise.
10369 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10371 2009-03-17 Ian Lance Taylor <iant@google.com>
10373 * descriptors.cc: Include "options.h".
10374 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10375 (Descriptors::open): Always use O_CLOEXEC when opening a new
10376 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10377 then set FD_CLOEXEC.
10379 * sparc.cc (class Target_sparc): Add has_got_section.
10380 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10381 make sure we have a GOT section.
10383 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10384 (Target_sparc::Scan::local): Likewise.
10385 (Target_sparc::Scan::global): Likewise.
10386 (Target_sparc::Relocate::relocate): Likewise.
10387 (Target_sparc::Relocate::relocate_tls): Likewise.
10389 * symtab.cc (Symbol_table::define_default_version): New function,
10390 broken out of add_from_object.
10391 (Symbol_table::add_from_object): Call define_default_version.
10392 (Symbol_table::define_special_symbol): Add resolve_oldsym
10393 parameter. Change all callers. If the version for a symbol comes
10394 from a version script, resolve it with the symbol with the same
10395 name with no version. Also add the symbol without a version if
10397 (do_define_in_output_data): If resolving with oldsym, don't delete
10399 (do_define_in_output_segment): Likewise.
10400 (do_define_as_constant): Likewise.
10401 * symtab.h (class Symbol_table): Update declarations.
10403 2009-03-13 Ian Lance Taylor <iant@google.com>
10405 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10406 (Read_symbols::requeue): New function.
10407 (Read_symbols::do_read_symbols): If make_elf_object fails because
10408 the target type is not configured, and the file was searched for,
10409 issue a warning and retry with the next directory.
10410 (Add_symbols::run): If the file has an incompatible format, and
10411 it was searched for, requeue the Read_symbols task. On error,
10412 release the object.
10413 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10414 dirindex parameter to constructor. Change all callers. Declare
10415 incompatible_warning and requeue.
10416 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10417 input_argument_ and input_group_ fields. Add them to
10418 constructor. Change all callers.
10419 (class Read_script): Add dirindex_ field. Add it to constructor.
10420 Change all callers.
10421 * archive.cc (Archive::setup): Remove input_objects parameter.
10422 Change all callers.
10423 (Archive::get_file_and_offset): Likewise.
10424 (Archive::read_all_symbols): Likewise.
10425 (Archive::read_symbols): Likewise.
10426 (Archive::get_elf_object_for_member): Remove input_objects
10427 parameter. Add punconfigured parameter. Change all callers.
10428 (Archive::add_symbols): Change return type to bool. Check return
10429 value of include_member.
10430 (Archive::include_all_members): Likewise.
10431 (Archive::include_member): Change return type to bool. Return
10432 false if first included object has incompatible target. Set
10433 included_member_ field.
10434 (Add_archive_symbols::run): If add_symbols returns false, requeue
10436 * archive.h (class Archive): Add included_member_ field.
10437 Initialize it in constructor. Add input_file and searched_for
10438 methods. Update declarations.
10439 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10440 input_argument_ fields. Add them to constructor. Change all
10442 * script.cc: Include "target-select.h".
10443 (class Parser_closure): Add skip_on_incompatible_target_ and
10444 found_incompatible_target_ fields. Add
10445 skip_on_incompatible_target parameter to constructor. Change all
10446 callers. Add methods skip_on_incompatible_target,
10447 clear_skip_on_incompatible_target, found_incompatible_target, and
10448 set_found_incompatible_target.
10449 (read_input_script): Add dirindex parameter. Change all callers.
10450 If parser finds an incompatible target, requeue Read_symbols
10452 (script_set_symbol): Clear skip_on_incompatible_target in
10454 (script_add_assertion, script_parse_option): Likewise.
10455 (script_start_sections, script_add_phdr): Likewise.
10456 (script_check_output_format): New function.
10457 * script.h (read_input_script): Update declaration.
10458 * script-c.h (script_check_output_format): Declare.
10459 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10460 (ignore_cmd): Remove OUTPUT_FORMAT.
10461 * fileread.cc (Input_file::Input_file): Add explicit this.
10462 (Input_file::will_search_for): New function.
10463 (Input_file::open): Add pindex parameter. Change all callers.
10464 * fileread.h (class Input_file): Add input_file_argument method.
10465 Declare will_search_for. Update declarations.
10466 * object.cc (make_elf_object): Add punconfigured parameter.
10467 Change all callers.
10468 * object.h (class Object): Make input_file public. Add
10469 searched_for method.
10470 (make_elf_object): Update declaration.
10471 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10473 * dirsearch.h (class Dirsearch): Update declaration.
10474 * options.h (class General_options): Add --warn-search-mismatch.
10475 * parameters.cc (Parameters::is_compatible_target): New function.
10476 * parameters.h (class Parameters): Declare is_compatible_target.
10477 * workqueue.cc (Workqueue::add_blocker): New function.
10478 * workqueue.h (class Workqueue): Declare add_blocker.
10480 * fileread.cc (Input_file::open): Remove options parameter.
10481 Change all callers.
10482 (Input_file::open_binary): Likewise.
10483 * script.cc (read_input_script): Likewise.
10484 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10485 options parameter from constructor. Change all callers.
10486 (class Read_script): Likewise.
10487 * fileread.h (class Input_file): Update declarations.
10488 * script.h (read_input_script): Update declaration.
10490 2009-03-10 Nick Clifton <nickc@redhat.com>
10492 * po/es.po: New Spanish translation.
10494 2009-03-06 Cary Coutant <ccoutant@google.com>
10496 * options.cc (parse_short_option): Keep dash_z from registering itself.
10498 2009-03-03 Ian Lance Taylor <iant@google.com>
10501 * target-reloc.h (relocate_section): Pass output_section to
10503 * i386.cc (Target_i386::should_apply_static_reloc): Add
10504 output_section parameter. Change all callers.
10505 (Target_i386::Relocate::relocate): Add output_section parameter.
10506 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10507 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10508 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10509 * testsuite/two_file_shared.sh: New script.
10510 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10511 (check_DATA): Add two_file_shared.dbg.
10512 (two_file_shared.dbg): New target.
10513 * testsuite/Makefile.in: Rebuild.
10515 2009-03-01 Ian Lance Taylor <iant@google.com>
10517 * configure.ac: Check for byteswap.h.
10518 * configure: Rebuild.
10519 * config.in: Rebuild.
10521 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10523 * layout.cc (Layout::find_or_add_kept_section): New function.
10524 (Layout::add_comdat): Removed.
10525 * layout.h (struct Kept_section): Move out of class Layout.
10526 Remove trailing underscores from field names. Add group_sections
10527 field. Rename group_ field to is_group. Change all uses.
10528 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10529 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10530 comdat_groups_ field.
10531 (Sized_relobj::include_section_group): Use
10532 find_or_add_kept_section and Kept_section::group_sections.
10533 (Sized_relobj::include_linkonce_section): Likewise.
10534 * object.cc (class Sized_relobj): Don't define Comdat_group or
10535 Comdat_group_table. Remove find_comdat_group and
10536 add_comdat_group. Remove comdat_groups_ field.
10537 * plugin.cc (include_comdat_group): Use
10538 Layout::find_or_add_kept_section.
10540 2009-02-28 Ian Lance Taylor <iant@google.com>
10542 * README: --gc-sections and map files are now supported. Document
10543 some build requirements.
10546 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10547 relocatable link set the value of the section symbol to zero.
10548 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10549 relocatable link don't include the section address in the local
10552 2009-02-27 Ian Lance Taylor <iant@google.com>
10555 * options.h (class Search_directory): Add is_system_directory.
10556 (class General_options): Declare is_in_system_directory.
10557 * options.cc (get_relative_sysroot): Make static.
10558 (get_default_sysroot): Make static.
10559 (General_optoins::is_in_system_directory): New function.
10560 * fileread.cc (Input_file::is_in_system_directory): New function.
10561 * fileread.h (class Input_file): Declare is_in_system_directory.
10562 * object.h (class Object): Add is_in_system_directory.
10563 (class Input_objects): Remove system_library_directory_ field.
10564 * object.cc (Input_objects::add_object): Don't set
10565 system_library_directory_.
10566 (input_objects::found_in_system_library_directory): Remove.
10567 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10568 parameter. Change all callers.
10569 (Symbol_table::sized_write_globals): Likewise.
10570 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10571 Call Object::is_in_system_directory.
10572 * symtab.h (class Symbol_table): Update declarations.
10575 * descriptors.h (Open_descriptor): Add is_on_stack field.
10576 * descriptors.cc (Descriptors::open): If the descriptor is on the
10577 top of the stack, remove it. Initialize is_on_stack field.
10578 (Descriptors::release): Only add pod to stack if it is not on the
10580 (Descriptors::close_some_descriptor): Clear stack_next and
10581 is_on_stack fields.
10584 * output.cc (Output_section::find_starting_output_address): Rename
10585 from starting_output_address; add PADDR parameter; change return
10587 * output.h (class Output_section): Declare
10588 find_starting_output_address instead of starting_output_address.
10589 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10590 section symbol for which we can't find a merge section.
10593 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10594 hidden or internal, force the symbol to be local.
10595 * resolve.cc (Symbol::override_visibility): Define.
10596 (Symbol::override_base): Use override_visibility.
10597 (Symbol_table::resolve): Likewise.
10598 (Symbol::override_base_with_special): Likewise.
10599 (Symbol_table::override_with_special): If the visibility is hidden
10600 or internal, force the symbol to be local.
10601 * symtab.h (class Symbol): Add set_visibility and
10602 override_visibility.
10603 * testsuite/ver_test_1.sh: New file.
10604 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10605 (check_DATA): Add ver_test_1.syms.
10606 (ver_test_1.syms): New target.
10607 * testsuite/Makefile.in: Rebuild.
10609 2009-02-25 Cary Coutant <ccoutant@google.com>
10611 * layout.cc (Layout::choose_output_section): Don't rename sections
10612 when using a linker script that has a SECTIONS clause.
10613 * Makefile.in: Regenerate.
10615 * testsuite/Makefile.am (script_test_5.sh): New test case.
10616 * testsuite/Makefile.in: Regenerate.
10617 * testsuite/script_test_5.cc: New file.
10618 * testsuite/script_test_5.sh: New file.
10619 * testsuite/script_test_5.t: New file.
10621 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10623 * archive.cc (Archive::include_member): Update calls to add_symbols.
10624 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10625 the Layout argument.
10626 * dynobj.h (do_add_symbols): Add the Layout argument.
10627 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10629 * object.h (Object::add_symbols): Add the Layout argument.
10630 (Object::do_add_symbols): Add the Layout argument.
10631 (Sized_relobj::do_add_symbols): Add the Layout argument.
10632 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10633 Unify the two versions.
10634 (Add_plugin_symbols): Remove.
10635 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10636 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10637 (Add_plugin_symbols): Remove.
10638 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10639 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10640 (Add_symbols::run): Make it work with Pulginobj.
10642 2009-02-06 Ian Lance Taylor <iant@google.com>
10644 * object.cc (Sized_relobj::do_layout): Make info message start
10645 with lower case letter.
10647 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10649 * binary.cc: Fix file comment.
10651 * options.h (enum Incremental_disposition): Define.
10652 (class General_options): Add new options: --incremental,
10653 --incremental_changed, --incremental_unchanged,
10654 --incremental_unknown. Add incremental_disposition_ and
10655 implicit_incremental_ fields.
10656 (General_options::incremental_disposition): New function.
10657 (class Position_dependent_options): Add incremental_disposition
10659 (Position_dependent_options::copy_from_options): Set incremental
10661 * options.cc (General_options::parse_incremental_changed): New
10663 (General_options::parse_incremental_unchanged): New function.
10664 (General_options::parse_incremental_unknown): New function.
10665 (General_options::General_options): Initialize new fields
10666 incremental_disposition_ and implicit_incremental_.
10667 (General_options::finalize): Check for uasge of --incremental-*
10668 without --incremental.
10670 2009-02-06 Chris Demetriou <cgd@google.com>
10672 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10673 pointer and to report location as the file name associated with
10675 (gold_undefined_symbol_at_location): New function to replace the
10676 old gold_undefined_symbol functionality.
10677 * target-reloc.h (relocate_section): Update to use
10678 gold_undefined_symbol_at_location.
10679 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10680 Call gold_undefined_symbol function rather than gold_error.
10681 * errors.h (Errors::undefined_symbol): Take location as a
10682 string, rather than calculating it from a relocation.
10683 * errors.cc (Errors::fatal): Print "fatal error:" before the
10685 (Errors::error, Errors::error_at_location): Print "error: "
10686 before the formatted message.
10687 (Errors::undefined_symbol): Take location as a string, rather
10688 than calculating it from a relocation.
10689 (gold_undefined_symbol_at_location): New function akin to
10690 old gold_undefined_symbol, calculates location from relocation.
10691 (gold_undefined_symbol): Change to take only a Symbol pointer
10692 and to report location as the file name associated with the symbol.
10693 * testsuite/debug_msg.sh: Update for changed error messages.
10694 * testsuite/undef_symbol.sh: Likewise.
10696 2009-02-04 Duncan Sands <baldrick@free.fr>
10699 * reduced_debug_output.h
10700 (Output_reduced_debug_abbrev_section::failed): Use format for
10702 (Output_reduced_debug_info_section::faild): Likewise.
10704 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10706 * script.cc (Lazy_demangler): New class.
10707 (Version_script_info::get_symbol_version_helper): Demangle a
10710 2009-01-29 Cary Coutant <ccoutant@google.com>
10712 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10714 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10716 2009-01-28 Ian Lance Taylor <iant@google.com>
10718 * version.cc (version_string): Bump to 1.9.
10720 * gold.h: Include <cstring> and <stdint.h>.
10721 * version.cc: Include <cstdio>.
10722 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10724 * reduced_debug_output.cc (insert_into_vector): Rename from
10725 Insert_into_vector; change all callers. Use Swap_unaligned to
10726 avoid aliasing issue; remove union since it is unnecessary.
10728 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10730 * Makefile.am (CCFILES): Add gc.cc.
10731 (HFILES): Add gc.h.
10732 * Makefile.in: Regenerate.
10733 * gold.cc (Gc_runner): New class.
10734 (queue_initial_tasks): Call garbage collection related tasks
10735 when corresponding options are invoked.
10736 (queue_middle_gc_tasks): New function.
10737 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10738 processed early before laying out sections during garbage collection.
10739 * gold.h (queue_middle_gc_tasks): New function.
10740 (is_prefix_of): Move from "layout.cc".
10741 * i386.cc (Target_i386::gc_process_relocs): New function.
10742 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10743 * main.cc (main): Create object of class "Garbage_collection".
10744 * object.cc (Relobj::copy_symbols_data): New function.
10745 (Relobj::is_section_name_included): New function.
10746 (Sized_relobj::do_layout): Allow this function to be called twice
10747 during garbage collection and defer layout of section during the
10749 * object.h (Relobj::get_symbols_data): New function.
10750 (Relobj::is_section_name_included): New function.
10751 (Relobj::copy_symbols_data): New function.
10752 (Relobj::set_symbols_data): New function.
10753 (Relobj::get_relocs_data): New function.
10754 (Relobj::set_relocs_data): New function.
10755 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10756 (Relobj::gc_process_relocs): New function.
10757 (Relobj::do_gc_process_relocs): New pure virtual function.
10758 (Relobj::sd_): New data member.
10759 (Sized_relobj::is_output_section_offset_invalid): New function.
10760 (Sized_relobj::do_gc_process_relocs): New function.
10761 * options.h (General_options::gc_sections): Modify to not be a no-op.
10762 (General_options::print_gc_sections): New option.
10763 * plugin.cc (Plugin_finish::run): Remove function call to
10764 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10765 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10766 * reloc.cc (Read_relocs::run): Add task to process relocs and
10767 determine unreferenced sections when doing garbage collection.
10768 (Gc_process_relocs): New class.
10769 (Sized_relobj::do_gc_process_relocs): New function.
10770 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10771 sections that are garbage collected.
10772 * reloc.h (Gc_process_relocs): New class.
10773 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10774 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10775 symbols whose corresponding sections are garbage collected.
10776 (Symbol_table::Symbol_table): Add new parameter for the garbage
10778 (Symbol_table::gc_mark_undef_symbols): New function.
10779 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10780 (Symbol_table::gc_mark_dyn_syms): New function.
10781 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10783 (Symbol_table::add_from_object): Likewise.
10784 (Symbol_table::add_from_relobj): When building shared objects, do not
10785 treat externally visible symbols as garbage.
10786 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10787 table information for static and relocatable links.
10788 * symtab.h (Symbol_table::set_gc): New function.
10789 (Symbol_table::gc): New function.
10790 (Symbol_table::gc_mark_undef_symbols): New function.
10791 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10792 (Symbol_table::gc_mark_dyn_syms): New function.
10793 (Symbol_table::gc_): New data member.
10794 * target.h (Sized_target::gc_process_relocs): New pure virtual
10796 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10797 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10799 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10801 * options.h (General_options::gc_sections): Define as a no-op for now.
10802 (General_options::no_keep_memory): Ditto.
10803 (General_options::Bshareable): Define.
10804 * options.cc (General_options::finalize): Honor -Bshareable.
10806 2009-01-20 Andreas Schwab <schwab@suse.de>
10808 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10809 read the value in the contents, since we don't use it. Use the
10810 template endianness when writing.
10811 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10813 2009-01-19 Andreas Schwab <schwab@suse.de>
10815 * configure.tgt (powerpc64-*): Fix targ_obj.
10817 2009-01-15 Ian Lance Taylor <iant@google.com>
10819 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10820 local symbols when stripping all symbols.
10822 2009-01-14 Cary Coutant <ccoutant@google.com>
10824 * output.cc (Output_reloc): Add explicit instantiations.
10826 2009-01-14 Cary Coutant <ccoutant@google.com>
10828 * archive.cc (Archive::get_elf_object_for_member): Remove call
10829 to File_read::claim_for_plugin.
10830 * descriptors.cc (Descriptors::open): Remove reference to
10832 (Descriptors::claim_for_plugin): Remove.
10833 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10834 (Descriptors::is_claimed): Remove.
10835 (claim_descriptor_for_plugin): Remove.
10836 * fileread.cc (File_read::claim_for_plugin): Remove.
10837 * fileread.h (File_read::claim_for_plugin): Remove.
10838 (File_read::descriptor): Reopen descriptor if necessary.
10839 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10840 (Plugin_manager::all_symbols_read): Add task parameter. Change
10842 (Plugin_manager::get_input_file): New function.
10843 (Plugin_manager::release_input_file): New function.
10844 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10845 corresponding data member.
10846 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10847 and pass to base constructor. Change all callers.
10848 (get_input_file, release_input_file): New functions.
10849 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10850 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10851 (Plugin_manager::all_symbols_read): Add task parameter.
10852 (Plugin_manager::get_input_file): New function.
10853 (Plugin_manager::release_input_file): New function.
10854 (Plugin_manager::task_): New data member.
10855 (Pluginobj::Pluginobj): Add filesize parameter.
10856 (Pluginobj::filename): New function.
10857 (Pluginobj::descriptor): New function.
10858 (Pluginobj::filesize): New function.
10859 (Pluginobj::filesize_): New data member.
10860 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10861 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10862 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10864 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10865 with archive libraries.
10866 * testsuite/Makefile.in: Regenerate.
10867 * testsuite/plugin_test.c (struct sym_info): New type.
10868 (get_input_file, release_input_file): New static variables.
10869 (onload): Capture new transfer vector entries.
10870 (claim_file_hook): Stop reading at end of file according to filesize.
10871 Factor out parsing of readelf output into separate function.
10872 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10873 APIs and get the source file name from the symbol table. Convert
10874 source file name to corresponding object file name. Print info
10875 message when adding new input files.
10876 (parse_readelf_line): New function.
10877 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10878 * testsuite/plugin_test_2.sh: Likewise.
10879 * testsuite/plugin_test_3.sh: Likewise.
10880 * testsuite/plugin_test_4.sh: New test case.
10882 2009-01-07 Ian Lance Taylor <iant@google.com>
10884 * version.cc (version_string): Bump to 1.8.
10886 2008-12-23 Cary Coutant <ccoutant@google.com>
10888 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10889 * plugin.cc (Plugin_manager::finish): Rename as
10890 layout_deferred_objects. Move cleanup to separate function.
10891 (Plugin_manager::cleanup): New function.
10892 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10894 * plugin.h (Plugin_manager::finish): Rename as
10895 layout_deferred_objects.
10896 (Plugin_manager::cleanup): New function.
10897 (Plugin_manager::cleanup_done): New field.
10899 2008-12-23 Cary Coutant <ccoutant@google.com>
10901 * plugin.cc (is_visible_from_outside): New function.
10902 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10903 so we don't return "IR only" status for exported symbols or -r links.
10905 * testsuite/Makefile.am (plugin_test_3): New test case.
10906 * testsuite/Makefile.in: Regenerate.
10907 * testsuite/plugin_test_3.sh: New file.
10909 2008-12-22 Cary Coutant <ccoutant@google.com>
10911 * object.cc (Sized_relobj::layout_section): New function.
10912 (Sized_relobj::do_layout): Defer layout of input sections until after
10913 plugin has provided replacement files.
10914 (Sized_relobj::do_layout_deferred_sections): New function.
10915 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10916 (Relobj::layout_deferred_sections): New function.
10917 (Relobj::do_layout_deferred_sections): New function.
10918 (Sized_relobj::do_layout_deferred_sections): New function.
10919 (Sized_relobj::layout_section): New function.
10920 (Sized_relobj::Deferred_layout): New structure.
10921 (Sized_relobj::deferred_layout_): New field.
10922 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10923 Change all callers. Layout deferred sections.
10924 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10926 (Plugin_hook::run): Move code from do_plugin_hook inline.
10927 (Plugin_hook::do_plugin_hook): Remove.
10928 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10929 (Plugin_manager::finish): Renamed, was cleanup.
10930 (Plugin_manager::should_defer_layout): New function.
10931 (Plugin_manager::add_deferred_layout_object): New function.
10932 (Plugin_manager::Deferred_layout_list): New type.
10933 (Plugin_manager::deferred_layout_objects_): New field.
10934 (Plugin_hook::do_plugin_hook): Remove.
10936 2008-12-17 Ian Lance Taylor <iant@google.com>
10938 * options.h (class General_options): Add --no case for
10941 2008-12-16 Cary Coutant <ccoutant@google.com>
10943 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10945 (Plugin_manager::claim_file): Create plugin object even if
10946 plugin did not call the add_symbols callback.
10947 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10948 asking for more symbols than were added.
10949 * testsuite/Makefile.am (plugin_test_1): Add test case with
10951 (empty.syms): New target.
10952 * testsuite/Makefile.in: Regenerate.
10953 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10954 message. Don't call add_symbols if no globals.
10955 (all_symbols_read_hook): Don't provide replacement for empty
10958 2008-12-12 Ian Lance Taylor <iant@google.com>
10960 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10961 r_type == 0 for a local symbol with r_sym == 0.
10962 (scan_relocatable_relocs): Pass r_sym to
10963 local_non_section_strategy.
10964 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10967 * configure.ac: Update test for TLS descriptors: they are
10968 supported as of glibc 2.9.
10969 * configure: Rebuild.
10971 2008-12-11 Ian Lance Taylor <iant@google.com>
10974 * target-reloc.h (Default_scan_relocatable_relocs): For each
10975 function, map r_type == 0 to RELOC_DISCARD.
10977 2008-12-10 Cary Coutant <ccoutant@google.com>
10979 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10980 object to override a kept COMDAT group from a plugin object.
10982 2008-12-09 Ian Lance Taylor <iant@google.com>
10985 * yyscript.y (file_cmd): Handle INPUT.
10987 * testsuite/initpri1.c: Change all declarations to be full
10988 prototypes by adding void, to avoid compiler warnings.
10990 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10992 * options.cc (General_options::parse_plugin_opt): New.
10993 (General_options::add_plugin): The argument now is just the filename.
10994 (General_options::add_plugin_option): New.
10995 * options.h (plugin_opt): New.
10996 (add_plugin): Change argument name.
10997 (add_plugin_option): New.
10998 * plugin.cc (Plugin::load): Don't parse the plugin option.
10999 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11000 (Plugin::add_option): New.
11001 (Plugin::args_): Change type.
11002 (Plugin::filename_): New.
11003 (Plugin_manager::add_plugin_option): New.
11004 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11005 * testsuite/Makefile.in: Regenerate.
11007 2008-12-05 Cary Coutant <ccoutant@google.com>
11009 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11010 Handle --strip-lto-sections option.
11011 * options.h (strip_lto_sections): New option.
11013 2008-12-01 Cary Coutant <ccoutant@google.com>
11015 * plugin.cc (ld_plugin_message): Change format parameter to const.
11016 Fix mismatch between new[] and delete.
11018 2008-11-14 Cary Coutant <ccoutant@google.com>
11020 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11023 2008-11-05 Craig Silverstein <csilvers@google.com>
11025 * options.cc (General_options::parse_dynamic_list): New function.
11026 * options.h (General_options): New flags dynamic_list,
11027 dynamic_list_data, dynamic_list_cpp_new, and
11028 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11029 (General_options::in_dynamic_list): New function.
11030 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11031 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11032 (Lex::can_continue_name): Likewise.
11034 (read_script_file): New parameter script_options.
11035 (read_dynamic_list): New function.
11036 (Script_options::define_dynamic_list): New function.
11037 (dynamic_list_keyword_parsecodes): New variable.
11038 (dynamic_list_keywords): New variable.
11039 * script.h (Script_options::define_dynamic_list): New function
11041 (read_dynamic_list): New function prototype.
11042 * symtab.cc (strprefix): New macro.
11043 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11044 dynamic_list_data, dynamic_list_cpp_new, and
11045 dynamic_list_cpp_typeinfo.
11046 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11047 (dynamic_list_expr): New rule.
11048 (dynamic_list_nodes): Likewise.
11049 (dynamic_list_node): Likewise.
11050 * testsuite/Makefile.am (dynamic_list): New test.
11051 * testsuite/Makefile.in: Regenerated.
11052 * testsuite/dynamic_list.t: New file.
11053 * testsuite/dynamic_list.sh: New file.
11055 2008-11-05 Craig Silverstein <csilvers@google.com>
11057 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11058 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11059 (t11_last): Likewise.
11060 * testsuite/ver_test_6.c (main): Likewise.
11062 2008-10-07 Cary Coutant <ccoutant@google.com>
11064 * options.c (General_options::finalize): Add check for -static and
11066 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11069 2008-10-02 Cary Coutant <ccoutant@google.com>
11071 * plugin.cc (make_sized_plugin_object): Fix conditional
11072 compilation to work when not all targets are enabled.
11074 2008-09-29 Cary Coutant <ccoutant@google.com>
11076 * archive.cc (Archive::get_file_and_offset): Use filename instead
11077 of name to get library path.
11078 (Archive::include_member): Unlock external member of a thin archive.
11080 * testsuite/Makefile.am (TEST_AR): New variable.
11081 (thin_archive_test_1): New test.
11082 (thin_archive_test_2): New test.
11083 * testsuite/Makefile.in: Regenerate.
11084 * testsuite/thin_archive_main.cc: New file.
11085 * testsuite/thin_archive_test_1.cc: New file.
11086 * testsuite/thin_archive_test_2.cc: New file.
11087 * testsuite/thin_archive_test_3.cc: New file.
11088 * testsuite/thin_archive_test_4.cc: New file.
11090 2008-09-29 Cary Coutant <ccoutant@google.com>
11092 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11093 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11095 (Sized_relobj::do_finalize_local_symbols): Likewise.
11096 (Sized_relobj::map_to_kept_section): Likewise.
11097 * object.h (Sized_relobj::invalid_address): New constant.
11098 (Sized_relobj::do_output_section_offset): Check for invalid_address
11100 * output.cc (Output_reloc::local_section_offset): Use constant
11101 invalid_address instead of -1U.
11102 (Output_reloc::get_address): Likewise.
11103 (Output_section::output_address): Change -1U to -1ULL.
11104 * output.h (Output_reloc::invalid_address): New constant.
11105 * reloc.cc (Sized_relobj::write_sections): Use constant
11106 invalid_address instead of -1U.
11107 (Sized_relobj::relocate_sections): Likewise.
11108 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11109 values for merge sections.
11110 * target-reloc.h (relocate_for_relocatable): Use constant
11111 invalid_address instead of -1U.
11113 2008-09-19 Cary Coutant <ccoutant@google.com>
11115 Add plugin functionality for link-time optimization (LTO).
11116 * configure.ac (plugins): Add --enable-plugins option.
11117 * configure: Regenerate.
11118 * config.in: Regenerate.
11119 * Makefile.am (LIBDL): New variable.
11120 (CCFILES): Add plugin.cc.
11121 (HFILES): Add plugin.h.
11122 (ldadd_var): Add LIBDL.
11123 * Makefile.in: Regenerate.
11125 * archive.cc: Include "plugin.h".
11126 (Archive::setup): Don't preread archive symbols when using a plugin.
11127 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11128 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11130 (Archive::include_member): Add symbols from plugin objects.
11131 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11132 * descriptors.cc (Descriptors::open): Check for file descriptors
11133 abandoned by plugins.
11134 (Descriptors::claim_for_plugin): New function.
11135 * descriptors.h (Descriptors::claim_for_plugin): New function.
11136 (Open_descriptor::is_claimed): New field.
11137 (claim_descriptor_for_plugin): New function.
11138 * fileread.cc (File_read::claim_for_plugin): New function.
11139 * fileread.h (File_read::claim_for_plugin): New function.
11140 (File_read::descriptor): New function.
11141 * gold.cc: Include "plugin.h".
11142 (queue_initial_tasks): Add task to call plugin hooks for generating
11144 * main.cc: Include "plugin.h".
11145 (main): Load plugin libraries.
11146 * object.h (Pluginobj): Declare.
11147 (Object::pluginobj): New function.
11148 (Object::do_pluginobj): New function.
11149 (Object::set_target): New function.
11150 * options.cc: Include "plugin.h".
11151 (General_options::parse_plugin): New function.
11152 (General_options::General_options): Initialize plugins_ field.
11153 (General_options::add_plugin): New function.
11154 * options.h (Plugin_manager): Declare.
11155 (General_options): Add --plugin option.
11156 (General_options::has_plugins): New function.
11157 (General_options::plugins): New function.
11158 (General_options::add_plugin): New function.
11159 (General_options::plugins_): New field.
11160 * plugin.cc: New file.
11161 * plugin.h: New file.
11162 * readsyms.cc: Include "plugin.h".
11163 (Read_symbols::do_read_symbols): Check for archive before checking
11164 for ELF file. Call plugin hooks to claim files.
11165 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11166 from a real object file; force override when processing replacement
11168 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11169 (Symbol::init_base_object): Likewise.
11170 (Symbol::init_base_output_data): Likewise.
11171 (Symbol::init_base_output_segment): Likewise.
11172 (Symbol::init_base_constant): Likewise.
11173 (Symbol::init_base_undefined): Likewise.
11174 (Symbol::output_section): Assert that object is not a plugin.
11175 (Symbol_table::add_from_pluginobj): New function.
11176 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11178 (Symbol_table::sized_write_globals): Likewise.
11179 (Symbol_table::add_from_pluginobj): Instantiate template.
11180 * symtab.h (Sized_pluginobj): Declare.
11181 (Symbol::in_real_elf): New function.
11182 (Symbol::set_in_real_elf): New function.
11183 (Symbol::in_real_elf_): New field.
11184 (Symbol_table::add_from_pluginobj): New function.
11186 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11187 (LIBDL): New variable.
11188 (LDADD): Add LIBDL.
11189 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11190 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11191 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11192 (MOSTLYCLEANFILES): Likewise.
11193 * testsuite/Makefile.in: Regenerate.
11194 * testsuite/plugin_test.c: New file.
11195 * testsuite/plugin_test_1.sh: New file.
11196 * testsuite/plugin_test_2.sh: New file.
11198 2008-09-16 Ian Lance Taylor <iant@google.com>
11200 * target-reloc.h (relocate_section): Check whether a symbol is
11201 defined by the ABI before reporting an undefined symbol error.
11202 * target.h (Target::is_defined_by_abi): Make parameter const.
11203 (Target::do_is_defined_by_abi): Likewise.
11204 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11205 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11206 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11207 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11208 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11209 * testsuite/Makefile.in: Rebuild.
11211 * fileread.cc (make_view): Add casts to avoid warning.
11213 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11215 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11216 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11218 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11220 * options.h (General_options::output_is_executable): New.
11221 (General_options::output_is_pie): New.
11222 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11223 for shared libraries.
11224 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11226 2008-09-11 Chris Demetriou <cgd@google.com>
11228 * options.h (origin): New -z option.
11229 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11230 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11233 2008-09-05 Cary Coutant <ccoutant@google.com>
11235 * fileread.cc (File_read::make_view): Add check for attempt to map
11236 beyond end of file.
11238 2008-09-05 Cary Coutant <ccoutant@google.com>
11240 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11241 explicit instantiations.
11243 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11246 * options.cc (General_options::finalize): Allow undefined symbols
11247 in shlibs if linking -shared.
11250 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11251 symbols as not needing a dynsym entry.
11253 2008-08-20 Craig Silverstein <csilvers@google.com>
11255 * fileread.cc (File_read::open): Do not lock the file unless it
11256 was successfully opened.
11258 2008-08-14 Cary Coutant <ccoutant@google.com>
11260 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11261 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11262 * testsuite/tls_test.cc (struct int128): 128-bit struct
11263 for testing TLS relocs with non-zero addend.
11264 (v12): New TLS variable.
11266 (t_last): Add check for v12.
11267 * testsuite/tls_test.h (t12): New function.
11268 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11270 2008-08-13 Ian Lance Taylor <iant@google.com>
11272 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11273 set tls_segment_ or relro_segment_.
11274 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11276 * output.h (Output_section::clear_is_relro): New function.
11277 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11278 sections specially even when output_data_ is empty.
11279 (Output_segment::maximum_alignment): When first section is relro,
11280 only force alignment for PT_LOAD segments.
11281 * script.cc (script_data_segment_align): New function.
11282 (script_data_segment_relro_end): New function.
11283 * script-c.h (script_data_segment_align): Declare.
11284 (script_data_segment_relro_end): Declare.
11285 * script-sections.h (class Script_sections): Declare
11286 data_segment_align and data_segment_relro_end. Add fields
11287 segment_align_index_ and saw_relro_end_.
11288 * script-sections.cc (class Sections_element): Add set_is_relro
11289 virtual function. Add new bool* parameter to place_orphan_here.
11290 Add get_output_section virtual function.
11291 (class Output_section_definition): Add set_is_relro. Add new
11292 bool* parameter to place_orphan_here. Add get_output_section.
11293 Add is_relro_ field.
11294 (Output_section_definition::Output_section_definition): Initialize
11295 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11296 and is_relro_ fields.
11297 (Output_section_definition::place_orphan_here): Add is_relro
11299 (Output_section_definition::set_section_addresses): Set relro for
11301 (Output_section_definition::alternate_constraint): Likewise.
11302 (class Orphan_output_section): Add new bool* parameter to
11303 place_orphan_here. Add get_output_section.
11304 (Orphan_output_section::place_orphan_here): Add is_relro
11306 (Script_sections::Script_sections): Initialize
11307 data_segment_align_index_ and saw_relro_end_.
11308 (Script_sections::data_segment_align): New function.
11309 (Script_sections::data_segment_relro_end): New function.
11310 (Script_sections::place_orphan): Set or clear is_relro.
11311 (Script_sections::set_section_addresses): Force alignment of first
11313 * yyscript.y (exp): Call script_data_segment_align and
11314 script_data_segment_relro_end.
11315 * testsuite/relro_script_test.t: New file.
11316 * testsuite/relro_test.cc (using_script): Declare.
11317 (t1, t2): Test using_script.
11318 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11319 (relro_script_test_SOURCES): Define.
11320 (relro_script_test_DEPENDENCIES): Define.
11321 (relro_script_test_LDFLAGS): Define.
11322 (relro_script_test_LDADD): Define.
11323 (relro_script_test.so): New target.
11324 * testsuite/Makefile.in: Rebuild.
11326 2008-08-06 Cary Coutant <ccoutant@google.com>
11328 * archive.cc (Archive::total_archives, Archive::total_members)
11329 (Archive::total_members_loaded): New variables.
11330 (Archive::setup): Add parameter. Add option to preread
11332 (Archive::read_armap): Add counter.
11333 (Archive::get_file_and_offset): New function.
11334 (Archive::get_elf_object_for_member): New function.
11335 (Archive::read_all_symbols): New function.
11336 (Archive::read_symbols): New function.
11337 (Archive::add_symbols): Add counters.
11338 (Archive::include_all_members): Use armap to find members if it's
11340 (Archive::include_member): Skip reading symbols if already read.
11341 Factored code into Archive::get_file_and_offset and
11342 Archive::get_elf_object_for_member. Changed call to
11343 Mapfile::report_include_archive_member.
11344 (Archive::print_stats): New function.
11345 * archive.h: Declare Object and Read_symbols_data classes.
11346 (Archive::Archive): Add initializers for new members.
11347 (Archive::setup): Add parameter.
11348 (Archive::print_stats): New function.
11349 (Archive::total_archives, Archive::total_members)
11350 (Archive::total_members_loaded): New variables.
11351 (Archive::get_file_and_offset): New function.
11352 (Archive::get_elf_object_for_member): New function.
11353 (Archive::read_all_symbols): New function.
11354 (Archive::read_symbols): New function.
11355 (Archive::Archive_member): New class.
11356 (Archive::members_): New member.
11357 (Archive::num_members_): New member.
11358 * main.cc: Include archive.h.
11359 (main): Call Archive::print_stats.
11360 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11361 archive parameter; member_name is now the fully-decorated name.
11362 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11363 * options.h: (General_options): Add --preread-archive-symbols option.
11364 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11367 2008-08-04 Ian Lance Taylor <iant@google.com>
11369 * symtab.h (Symbol::use_plt_offset): New function.
11370 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11371 * powerpc.cc (Relocate::relocate): Likewise.
11372 * sparc.cc (Relocate::relocate): Likewise.
11373 * x86_64.cc (Relocate::relocate): Likewise.
11374 * testsuite/weak_plt.sh: New test.
11375 * testsuite/weak_plt_main.cc: New test.
11376 * testsuite/weak_plt_shared.cc: New test.
11377 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11378 (check_PROGRAMS): Add weak_plt.
11379 (check_DATA): Add weak_plt_shared.so.
11380 (weak_plt_main_pic.o, weak_plt): New targets.
11381 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11382 * testsuite/Makefile.in: Rebuild.
11384 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11386 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11387 * testsuite/Makefile.in: Rebuild.
11389 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11391 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11392 * Makefile.in: Regenerate.
11393 * po/POTFILES.in: Regenerate.
11395 2008-07-29 Ian Lance Taylor <iant@google.com>
11397 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11398 symbols before other symbols.
11399 * testsuite/script_test_2.cc (test_addr): Declare.
11400 (test_addr_alias): Declare.
11401 (main): Check that test_addr and test_addr_alias have the right
11403 * testsuite/script_test_2.t: Define test_addr_alias and
11406 2008-07-24 Ian Lance Taylor <iant@google.com>
11409 * descriptors.cc: New file.
11410 * descriptors.h: New file.
11411 * gold-threads.h (class Hold_optional_lock): New class.
11412 * fileread.cc: Include "descriptors.h".
11413 (File_read::~File_read): Release descriptor rather than closing
11415 (File_read::open) [file]: Call open_descriptor rather than open.
11416 Set is_descriptor_opened_.
11417 (File_read::open) [memory]: Assert that descriptor is not open.
11418 (File_read::reopen_descriptor): New function.
11419 (File_read::release): Release descriptor.
11420 (File_read::do_read): Make non-const. Reopen descriptor.
11421 (File_read::read): Make non-const.
11422 (File_read::make_view): Reopen descriptor.
11423 (File_read::do_readv): Likewise.
11424 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11425 Update declarations.
11426 * layout.cc: Include "descriptors.h".
11427 (Layout::create_build_id): Use open_descriptor rather than open.
11428 * output.cc: Include "descriptors.h".
11429 (Output_file::open): Use open_descriptor rather than open.
11430 * archive.cc (Archive::const_iterator): Change Archive to be
11432 (Archive::begin, Archive::end): Make non-const.
11433 (Archive::count_members): Likewise.
11434 * archive.h (class Archive): Update declarations.
11435 * object.h (Object::read): Make non-const.
11436 * Makefile.am (CCFILES): Add descriptors.cc.
11437 (HFILES): Add descriptors.h.
11438 * Makefile.in: Rebuild.
11441 * gold.h: Always include <clocale>. Add Solaris workarounds
11442 following code in binutils/sysdep.h.
11445 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11446 this->eh_frame_hdr_ is NULL before using it.
11448 * dynobj.cc (Versions::Versions): Update comment.
11450 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11451 the base version name.
11453 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11454 array size plus one.
11455 (Stringpool_template::set_string_offsets): Subtract one from key
11456 before using it as an array index.
11457 (Stringpool_template::get_offset_with_length): Likewise.
11458 (Stringpool_template::write_to_buffer): Likewise.
11459 * stringpool.h (Stringpool_template::get_offset_from_key):
11462 2008-07-23 Ian Lance Taylor <iant@google.com>
11465 * object.h (Merged_symbol_value::value): Do our best to handle a
11469 * script.cc (Version_script_info::get_versions): Don't add empty
11470 version tag to return value.
11471 (Version_script_info::get_symbol_version_helper): Change return
11472 type to bool. Add pversion parameter. Change all callers.
11473 (script_register_vers_node): Don't require a non-NULL tag.
11474 * script.h (class Version_script_info): Update declarations.
11475 (Version_script_info::get_symbol_version): Change return type to
11476 bool. Add version parameter. Change all callers.
11477 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11478 handling. Handle an empty version from a version script.
11479 (Symbol_table::define_special_symbol): Likewise.
11480 * testsuite/ver_test_10.script: New file.
11481 * testsuite/ver_test_10.sh: New file.
11482 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11483 (check_DATA): Add ver_test_10.syms.
11484 (ver_test_10.syms, ver_test_10.so): New target.
11485 * testsuite/Makefile.in: Rebuild.
11487 2008-07-23 Simon Baldwin <simonb@google.com>
11489 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11490 to zero for undefined symbols from dynamic libraries.
11492 2008-07-23 Ian Lance Taylor <iant@google.com>
11494 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11495 Change all callers.
11496 * symtab.h (class Symbol_table): Update declaration.
11497 * testsuite/ver_test_9.cc: New file.
11498 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11499 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11500 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11501 (ver_test_9.so, ver_test_9.o): New targets.
11502 * testsuite/Makefile.in: Rebuild.
11504 2008-07-22 Ian Lance Taylor <iant@google.com>
11506 * options.h (class General_options): Define --check-sections.
11507 * layout.cc (Layout::set_segment_offsets): Handle
11510 * options.h (class General_options): Define -n/--nmagic and
11512 * options.cc (General_options::finalize): For -n/--nmagic or
11513 -N/--omagic, set -static.
11514 * layout.cc (Layout::attach_allocated_section_to_segment): If
11515 -N/--omagic, don't put read-only and read-write sections in
11516 different segments.
11517 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11518 finding a read-only segment.
11519 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11520 don't set the minimum segment alignment to the common page size,
11521 and don't set the file offset to the address modulo the page size.
11522 * script-sections.cc (Script_sections::create_segments): If
11523 -n/--omagic, don't put read-only and read-write sections in
11524 different segments.
11526 * cref.cc: New file.
11527 * cref.h: New file.
11528 * options.h (class General_options): Add --print-symbol-counts.
11529 * main.cc (main): Issue defined symbol report if requested.
11530 * archive.cc (Archive::interpret_header): Make into a const member
11532 (Archive::add_symbols): Call Input_objects::archive_start and
11534 (Archive::const_iterator): Define new class.
11535 (Archive::begin, Archive::end): New functions.
11536 (Archive::include_all_members): Rewrite to use iterator.
11537 (Archive::count_members): New function.
11538 * archive.h (class Archive): Update declarations.
11539 (Archive::filename): New function.
11540 * object.cc: Include "cref.h".
11541 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11542 (Sized_relobj::do_get_global_symbol_counts): New function.
11543 (Input_objects::add_object): Add object to cross-referencer.
11544 (Input_objects::archive_start): New function.
11545 (Input_objects::archive_stop): New function.
11546 (Input_objects::print_symbol_counts): New function.
11547 * object.h: Declare Cref and Archive.
11548 (Object::get_global_symbol_counts): New function.
11549 (Object::do_get_global_symbol_counts): New pure virtual function.
11550 (class Sized_relobj): Add defined_count_ field. Update
11552 (class Input_objects): Add cref_ field. Update constructor.
11553 Update declarations.
11554 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11556 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11558 (Sized_dynobj::do_get_global_symbol_counts): New function.
11559 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11560 defined_count_. Update declarations. Define Symbols typedef.
11561 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11562 parameter. Change all callers.
11563 (Symbol_table::add_from_dynobj): Add sympointers and defined
11564 parameters. Change all callers.
11565 * symtab.h (class Symbol_table): Update declarations.
11566 * Makefile.am (CCFILES): Add cref.cc.
11567 (HFILES): Add cref.h.
11568 * Makefile.in: Rebuild.
11570 2008-07-22 Simon Baldwin <simonb@google.com>
11572 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11573 to zero when writing undefined symbols.
11575 2008-07-22 Ian Lance Taylor <iant@google.com>
11577 * output.cc (Output_section::add_input_section): Don't try to
11578 merge empty merge sections.
11580 2008-07-21 Craig Silverstein <csilvers@google.com>
11582 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11583 Include symbol version in error message.
11585 2008-07-20 Chris Demetriou <cgd@google.com>
11587 * configure.ac (gold_cv_c_random_seed): New configured variable.
11588 (RANDOM_SEED_CFLAGS): New substituted variable.
11589 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11590 * configure: Rebuild.
11591 * Makefile.in: Likewise.
11592 * testsuite/Makefile.in: Likewise.
11594 2008-07-18 Ian Lance Taylor <iant@google.com>
11596 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11597 where we see NAME/NULL and NAME/VERSION as separate symbols.
11598 * testsuite/ver_test_main.cc (main): Call t4.
11599 (t4, t4_2a): Define.
11600 * testsuite/ver_test_2.cc (t4_2): Define.
11601 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11602 * testsuite/ver_test_4.cc (t4_2a): Define.
11603 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11604 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11606 2008-07-17 Ian Lance Taylor <iant@google.com>
11608 * dynobj.cc (Versions::add_def): If we give an error about a
11609 missing version, go ahead and create the version anyhow.
11611 2008-07-10 Ian Lance Taylor <iant@google.com>
11613 Handle output sections with more than 0x7fffffff bytes.
11614 * object.h (class Relobj): Change map_to_output_ to
11615 output_sections_, and just keep a section pointer. Change all
11616 uses. Move comdat group support to Sized_relobj.
11617 (Relobj::is_section_specially_mapped): Remove.
11618 (Relobj::output_section): Remove poff parameter. Change all
11620 (Relobj::output_section_offset): New function.
11621 (Relobj::set_section_offset): Rewrite.
11622 (Relobj::map_to_output): Remove.
11623 (Relobj::output_sections): New function.
11624 (Relobj::do_output_section_offset): New pure virtual function.
11625 (Relobj::do_set_section_offset): Likewise.
11626 (class Sized_relobj): Add section_offsets_ field. Add comdat
11627 group support from Relobj. Update declarations.
11628 (Sized_relobj::get_output_section_offset): New function.
11629 (Sized_relobj::do_output_section_offset): New function.
11630 (Sized_relobj::do_set_section_offset): New function.
11631 * object.cc (Relobj::output_section_address): Remove.
11632 (Sized_relobj::Sized_relobj): Initialize new fields.
11633 (Sized_relobj::include_section_group): Cast find_kept_object to
11635 (Sized_relobj::include_linkonce_section): Likewise.
11636 (Sized_relobj::do_layout): Use separate arrays for output section
11638 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11640 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11641 output_sections and section_offsets.
11642 (Sized_relobj::write_local_symbols): Likewise.
11643 (map_to_kept_section): Compute output address directly.
11644 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11645 output_sections and section_offsets.
11646 (Sized_relobj::write_sections): Likewise.
11647 (Sized_relobj::relocate_sections): Likewise.
11648 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11649 * output.h (class Output_reloc): Update declarations. Change
11650 u2_.relobj to Sized_relobj*.
11651 (class Output_data_reloc): Change add functions to use
11653 * output.cc (Output_reloc::Output_reloc): Change relobj to
11655 (Output_reloc::local_section_offset): Change return type to
11656 Elf_Addr. Use get_output_section_offset.
11657 (Output_reloc::get_address): Likewise.
11658 (Output_section::is_input_address_mapped): Don't call
11659 is_section_specially_mapped.
11660 (Output_section::output_offset): Likewise.
11661 (Output_section::output_address): Likewise.
11662 (Output_section::starting_output_address): Likewise.
11663 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11664 parameter to Sized_relobj*.
11665 (Copy_relocs::need_copy_reloc): Likewise.
11666 (Copy_relocs::save): Likewise.
11667 * copy-relocs.h (class Copy_relocs): Update declarations.
11668 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11669 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11670 * target-reloc.h (relocate_for_relocatable): Change
11671 offset_in_output_section type to Elf_Addr. Change code that uses
11673 * layout.cc (Layout::layout): Always set *off.
11674 * mapfile.cc (Mapfile::print_input_section): Use
11675 output_section_offset.
11676 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11678 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11679 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11680 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11682 2008-07-03 Ian Lance Taylor <iant@google.com>
11684 * layout.cc (Layout::include_section): Do not discard unrecognized
11685 SHT_STRTAB sections.
11687 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11689 * script.cc (Lex::can_continue_name): Make '?' allowable in
11690 version-script names.
11691 * testsuite/version_script.map: Change glob pattern to use '?'
11693 2008-06-30 Manish Singh <yosh@gimp.org>
11696 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11699 2008-06-30 Ian Lance Taylor <iant@google.com>
11703 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11704 versions]: Don't try to read the value in the contents, since we
11705 don't use it. Use the template endianness when writing.
11707 2008-06-25 Cary Coutant <ccoutant@google.com>
11709 * fileread.cc (File_read::make_view): Assert on zero-length view.
11710 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11711 symbol table when there are no symbols to read.
11713 2008-06-23 Craig Silverstein <csilvers@google.com>
11715 * version.cc (version_string): Bump to 1.7
11717 2008-06-18 Craig Silverstein <csilvers@google.com>
11719 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11720 constant 0xFFFF to type Valtype.
11721 (Powerpc_relocate_functions::rel16_ha): Likewise.
11723 2008-06-17 Ian Lance Taylor <iant@google.com>
11725 * output.h (Output_section::Input_section): Initialize p2align_ to
11726 zero for Output_section_data constructors.
11727 (Output_section::Input_section::addralign): If not an input
11728 section, return the alignment of the Output_section_data.
11729 * testsuite/copy_test.cc: New file.
11730 * testsuite/copy_test_1.cc: New file.
11731 * testsuite/copy_test_2.cc: New file.
11732 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11733 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11734 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11735 (copy_test_1_pic.o, copy_test_1.so): New targets.
11736 (copy_test_2_pic.o, copy_test_2.so): New targets.
11737 * testsuite/Makefile.in: Rebuild.
11739 * script-sections.cc (Script_sections::place_orphan): Initialize
11740 local variable exact.
11742 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11744 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11746 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11747 David S. Miller <davem@davemloft.net>
11749 * powerpc.cc: New file.
11750 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11751 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11752 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11753 * Makefile.in: Rebuild.
11755 2008-06-09 Ian Lance Taylor <iant@google.com>
11757 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11759 (throwing, orig_terminate): New static variables.
11760 (terminate_handler): New static function.
11761 (t2): Set terminate handler.
11763 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11766 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11769 2008-05-30 Cary Coutant <ccoutant@google.com>
11771 * archive.cc (Archive::include_all_members) Correct to step
11772 over symbol table and extended name table in thin archives.
11774 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11777 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11780 2008-05-28 Caleb Howe <cshowe@google.com>
11782 * reduced_debug_output.cc: New file.
11783 * reduced_debug_output.h: New file.
11784 * options.h (class General_options): Add --strip-debug-non-line.
11785 * options.cc (General_options::finalize): Add strip_debug_non_line
11786 to the strip heirarchy.
11787 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11789 * layout.cc: Include "reduced_debug_output.h".
11790 (Layout::Layout): Initialize new fields.
11791 (line_only_debug_sections): New static array.
11792 (is_lines_only_debug_sections): New static inline function.
11793 (Layout::include_section): Handle --strip-debug-non-line.
11794 (Layout::make_output_section): If --strip-debug-non-line, build
11795 new output sections for .debug_abbrev and .debug_info.
11796 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11797 gold. Warn about possible overflow.
11798 (read_signed_LEB_128): Likewise.
11799 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11800 (read_signed_LEB_128): Declare.
11801 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11802 (HFILES): Add reduced_debug_output.h.
11803 * Makefile.in: Rebuild.
11805 2008-05-21 Ian Lance Taylor <iant@google.com>
11807 * mapfile.cc: New file.
11808 * mapfile.h: New file.
11809 * options.h (class General_options): Add -M/--print-map and -Map.
11810 * options.cc (General_options::finalize): Make -M equivalent to
11812 * main.cc: Include <cstdio> and "mapfile.h".
11813 (main): Open mapfile if requested.
11814 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11815 constructor. Change caller.
11816 (queue_initial_tasks): Add mapfile parameter. Change caller.
11817 (queue_middle_tasks): Likewise.
11818 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11820 * archive.cc: Include "mapfile.h".
11821 (Archive::add_symbols): Add mapfile parameter. Change all
11822 callers. Pass mapfile, symbol, and reason to include_member.
11823 (Archive::include_all_members): Add mapfile parameter. Change all
11825 (Archive::include_member): Add mapfile, sym, and why parameters.
11826 Change all callers. Report inclusion to map file.
11827 * archive.h: Include "fileread.h".
11828 (class Archive): Update declarations.
11829 (Archive::file): New const method.
11830 (class Add_archive_symbols): Add mapfile_ field. Update
11831 constructor. Change all callers.
11832 * readsyms.h (class Read_symbols): Likewise.
11833 (class Finish_group): Likewise.
11834 (class Read_script): Likewise.
11835 * common.cc: Include "mapfile.h".
11836 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11838 (Symbol_table::do_allocate_commons): Likewise.
11839 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11840 symbol allocation to mapfile.
11841 * common.h (class Allocate_commons_task): Add mapfile_ field.
11842 Update constructor. Change all callers.
11843 * symtab.h (class Symbol_table): Update declarations.
11844 * layout.cc: Include "mapfile.h".
11845 (Layout_task_runner::run): Print information to mapfile.
11846 (Layout::create_gold_note): Change Output_data_fixed_space to
11847 Output_data_zero_fill.
11848 (Layout::create_build_id): Likewise.
11849 (Layout::print_to_mapfile): New function.
11850 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11851 constructor. Change caller.
11852 (class Layout): Declare print_to_mapfile.
11853 * output.cc (Output_section::Input_section::print_to_mapfile): New
11855 (Output_section::add_input_section): If producing a map, always
11856 add to input_sections_ list.
11857 (Output_section::do_print_to_mapfile): New function.
11858 (Output_segment::print_sections_to_mapfile): New function.
11859 (Output_segment::print_section_list_to_mapfile): New function.
11860 * output.h: Include "mapfile.h".
11861 (Output_data::print_to_mapfile): New function.
11862 (Output_data::do_print_to_mapfile): New virtual function.
11863 (Output_segment_headers::do_print_to_mapfile): New function.
11864 (Output_file_header::do_print_to_mapfile): New function.
11865 (Output_data_const::do_print_to_mapfile): New function.
11866 (class Output_data_const_buffer): Add map_name_ field. Update
11867 constructor. Change all callers. Add do_print_to_mapfile
11869 (class Output_data_fixed_space): Likewise.
11870 (class Output_data_space): Likewise.
11871 (class Output_data_zero_fill): New class.
11872 (Output_data_strtab::do_print_to_mapfile): New function.
11873 (Output_data_reloc_base::do_print_to_mapfile): New function.
11874 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11875 (Output_data_group::do_print_to_mapfile): New function.
11876 (Output_data_got::do_print_to_mapfile): New function.
11877 (Output_data_dynamic::do_print_to_mapfile): New function.
11878 (Output_symtab_xindex::do_print_to_mapfile): New function.
11879 (class Output_section): Declare do_print_to_mapflie. Declare
11880 print_to_mapfile in Input_section.
11881 (class Output_segment): Declare new functions.
11882 * object.h (Sized_relobj::symbol_count): New function.
11883 * script-sections.cc
11884 (Output_section_element_dot_assignment::set_section_addresses):
11885 Change Output_data_fixed_space to Output_data_zero_fill.
11886 (Output_data_expression::do_print_to_mapfile): New function.
11887 * script.cc (read_input_script): Add mapfile parameter. Change
11889 * script.h (read_input_script): Update declaration.
11890 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11891 (Eh_frame::do_print_to_mapfile): New function.
11892 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11893 (Output_merge_string::do_print_to_mapfile): New function.
11894 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11896 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11898 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11900 * Makefile.am (CCFILES): Add mapfile.cc.
11901 (HFILES): Add mapfile.h.
11902 * Makefile.in: Rebuild.
11904 2008-05-19 Ian Lance Taylor <iant@google.com>
11906 * options.h (class General_options): Add -z relro.
11907 * layout.cc (Layout::Layout): Initialize relro_segment_.
11908 (Layout::add_output_section_data): Return the output section.
11909 (Layout::make_output_section): Rcognize relro sections and mark
11910 them appropriately.
11911 (Layout::attach_allocated_section_to_segment): Put relro sections
11912 in a PT_GNU_RELRO segment.
11913 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11915 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11917 (Layout::linkonce_mapping): Map d.rel.ro.local to
11918 .data.rel.ro.local.
11919 (Layout::output_section_name): Us .data.rel.ro.local for any
11920 section which begins with that.
11921 * layout.h (class Layout): Update add_output_section_data
11922 declaration. Add relro_segment_ field.
11923 * output.cc (Output_section::Output_section): Initialize is_relro_
11924 and is_relro_local_ fields.
11925 (Output_segment::add_output_section): Group relro sections.
11926 (Output_segment::is_first_section_relro): New function.
11927 (Output_segment::maximum_alignment): If there is a relro section,
11928 align the segment to the common page size.
11929 (Output_segment::set_section_addresses): Track whether we are
11930 looking at relro sections. If the last section is a relro
11931 section, align to the common page size.
11932 (Output_segment::set_section_list_addresses): Add in_relro
11933 parameter. Change all callers. Align to the page size when
11934 moving from relro to non-relro section.
11935 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11937 * output.h (class Output_section): Add is_relro_ and
11938 is_relro_local_ fields.
11939 (Output_section::is_relro): New function.
11940 (Output_section::set_is_relro): New function.
11941 (Output_section::is_relro_local): New function.
11942 (Output_section::set_is_relro_local): New function.
11943 (class Output_segment): Update declarations.
11944 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11945 * sparc.cc (Target_sparc::got_section): Likewise.
11946 * x86_64.cc (Target_x86_64::got_section): Likewise.
11947 * testsuite/relro_test_main.cc: New file.
11948 * testsuite/relro_test.cc: New file.
11949 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11950 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11951 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11952 (relro_test.so, relro_test_pic.o): New targets.
11953 * testsuite/Makefile.in: Rebuild.
11955 2008-05-16 Ian Lance Taylor <iant@google.com>
11957 * output.cc (Output_segment::add_output_section): Remove front
11959 * output.h (class Output_segment): Remove
11960 add_initial_output_section and overloaded add_output_section.
11961 Update declaration of remaining add_output_section.
11962 * layout.cc (Layout::create_interp): Call add_output_section
11963 rather than add_initial_output_section.
11964 (Layout::finish_dynamic_section): Likewise.
11966 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11967 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11968 know the dynamic type.
11969 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11970 field. Initialize it in constructor.
11971 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11972 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11973 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11976 * output.cc (Output_reloc::get_address): Change return type to
11978 * output.h (class Output_reloc): Update get_address declaration.
11979 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11980 for section addresses.
11982 2008-05-09 Ian Lance Taylor <iant@google.com>
11985 * gold.cc (gold_nomem): Use return value of write.
11987 2008-05-08 Ian Lance Taylor <iant@google.com>
11989 * symtab.c (Symbol::init_base_output_data): Add version
11990 parameter. Change all callers.
11991 (Symbol::init_base_output_segment): Likewise.
11992 (Symbol::init_base_constant): Likewise.
11993 (Symbol::init_base_undefined): Likewise.
11994 (Sized_symbol::init_output_data): Likewise.
11995 (Sized_symbol::init_output_segment): Likewise.
11996 (Sized_symbol::init_constant): Likewise.
11997 (Sized_symbol::init_undefined): Likewise.
11998 (Symbol_table::do_define_in_output_data): If the new symbol has a
11999 version, mark it as the default.
12000 (Symbol_table::do_define_in_output_segment): Likewise.
12001 (Symbol_table::do_define_as_constant): Likewise.
12002 * symtab.h (class Symbol): Update declarations.
12003 (class Sized_symbol): Likewise.
12004 * resolve.cc (Symbol::override_version): New function.
12005 (Symbol::override_base): Call override_version.
12006 (Symbol::override_base_with_special): Likewise.
12007 * testsuite/ver_script_8.script: New file.
12008 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12009 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12010 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12011 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12013 2008-05-06 Ian Lance Taylor <iant@google.com>
12016 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12018 (class General_options): Remove existing --undefined, and add
12019 --no-undefined instead. Add new --undefined as synonym for -u.
12020 * archive.cc (Archive::add_symbols): Check whether symbol was
12022 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12023 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12024 all uses. Add IS_UNDEFINED. Update declarations to split
12025 different versions of init_base. Declare init_base_undefined.
12026 (Symbol::is_defined): Handle IS_UNDEFINED.
12027 (Symbol::is_undefined): Likewise.
12028 (Symbol::is_weak_undefined): Call is_undefined.
12029 (Symbol::is_absolute): Handle IS_CONSTANT.
12030 (class Sized_symbol): Update declarations to split different
12031 versions of init. Declare init_undefined.
12032 (class Symbol_table): Declare new functions.
12033 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12034 Change all callers.
12035 (Symbol::init_base_output_data): Likewise.
12036 (Symbol::init_base_output_segment): Likewise.
12037 (Symbol::init_base_constant): Likewise.
12038 (Symbol::init_base_undefined): New function.
12039 (Sized_symbol::init_object): Rename from init. Change all
12041 (Sized_symbol::init_output_data): Likewise.
12042 (Sized_symbol::init_output_segment): Likewise.
12043 (Sized_symbol::init_constant): Likewise.
12044 (Sized_symbol::init_undefined): New function.
12045 (Symbol_table::add_undefined_symbols_from_command_line): New
12047 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12049 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12050 (Symbol::output_section): Likewise.
12051 (Symbol::set_output_section): Likewise.
12052 (Symbol_table::sized_finalize_symbol): Likewise.
12053 (Symbol_table::sized_write_globals): Likewise.
12054 * resolve.cc (Symbol_table::should_override): Likewise.
12055 (Symbol::override_base_with_special): Likewise.
12057 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12058 symbol, change it to have default visibility.
12059 * testsuite/protected_1.cc: New file.
12060 * testsuite/protected_2.cc: New file.
12061 * testsuite/protected_3.cc: New file.
12062 * testsuite/protected_main_1.cc: New file.
12063 * testsuite/protected_main_2.cc: New file.
12064 * testsuite/protected_main_3.cc: New file.
12065 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12066 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12067 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12068 (protected_1.so): New target.
12069 (protected_1_pic.o, protected_2_pic.o): New targets.
12070 (protected_3_pic.o): New target.
12071 (check_PROGRAMS): Add protected_2.
12072 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12073 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12074 * testsuite/Makefile.in: Rebuild.
12076 * options.h (DEFINE_var): Add set_user_set_##varname__.
12077 (DEFINE_bool_alias): New macro.
12078 (class General_options): Define -Bstatic using DEFINE_bool_alias
12079 rather than DEFINE_special. Add --undefined as an alias for -z
12081 * options.cc (General_options::parse_Bstatic): Remove.
12083 * options.h (class General_options): Add --fatal-warnings.
12084 * main.cc (main): Implement --fatal-warnings.
12085 * errors.h (Errors::warning_count): New function.
12087 * options.h (class General_options): Add -Bsymbolic-functions.
12088 * symtab.h (Symbol::is_preemptible): Check for
12089 -Bsymbolic-functions.
12091 2008-05-05 Ian Lance Taylor <iant@google.com>
12093 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12094 as noVARNAME rather than no-VARNAME.
12095 (class General_options): Add option -z combreloc.
12096 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12098 (Output_reloc::sort_before) [SHT_REL]: New function.
12099 (Output_reloc::sort_before) [SHT_RELA]: New function.
12100 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12101 Sort_relocs_comparison.
12102 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12103 parameter. Change all callers.
12104 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12105 sort_relocs parameter. Change all callers.
12106 * output.cc (Output_reloc::get_address): New function, broken out
12108 (Output_reloc::write_rel): Call it.
12109 (Output_reloc::compare): New function.
12110 (Output_data_reloc_base::do_write): Optionally sort relocs.
12112 * configure.ac: If targ_extra_obj is set, link it in.
12113 * configure.tgt: Initialize all variables.
12114 (x86_64*): Set targ_extra_obj and targ_extra_size.
12115 * configure: Rebuild.
12117 * object.cc (Sized_relobj::include_section_group): Adjust section
12118 indexes read from group data. Build vector to pass to
12120 * layout.cc (Layout::layout_group): Add flags and shndxes
12121 parameters. Remove contents parameter. Change caller. Update
12122 explicit instantiations.
12123 * layout.h (class Layout): Update layout_group declaration.
12124 * output.cc (Output_data_group::Output_data_group): Add flags and
12125 input_shndxes parameters. Remove contents parameter. Change
12127 (Output_data_group::do_write): Change input_sections_ to
12129 * output.h (class Output_data_group): Update constructor
12130 declaration. Rename input_sections_ to input_shndxes_.
12131 * testsuite/many_sections_test.cc: Add template.
12133 2008-04-30 Cary Coutant <ccoutant@google.com>
12135 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12137 * layout.cc (Layout::include_section): Refactored check for debug
12139 (Layout::add_comdat): Add new parameters. Change type
12140 of signature parameter. Add object and shndx to signatures table.
12141 (Layout::find_kept_object): New function.
12142 * layout.h: Include <cstring>.
12143 (Layout::is_debug_info_section): New function.
12144 (Layout::add_comdat): Add new parameters.
12145 (Layout::find_kept_object): New function.
12146 (Layout::Kept_section): New struct.
12147 (Layout::Signatures): Change type of map range.
12148 * object.cc (Relobj::output_section_address): New function.
12149 (Sized_relobj::include_section_group): Add new parameters. Change
12150 calls to Layout::add_comdat. Change to build table of kept comdat
12151 groups and table mapping discarded sections to kept sections.
12152 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12153 (Sized_relobj::do_layout): Change calls to include_section_group and
12154 include_linkonce_section.
12155 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12156 value to zero when section is discarded.
12157 (Sized_relobj::map_to_kept_section): New function.
12158 * object.h (Relobj::output_section_address): New function.
12159 (Relobj::Comdat_group): New type.
12160 (Relobj::find_comdat_group): New function.
12161 (Relobj::Comdat_group_table): New type.
12162 (Relobj::Kept_comdat_section): New type.
12163 (Relobj::Kept_comdat_section_table): New type.
12164 (Relobj::add_comdat_group): New function.
12165 (Relobj::set_kept_comdat_section): New function.
12166 (Relobj::get_kept_comdat_section): New function.
12167 (Relobj::comdat_groups_): New field.
12168 (Relobj::kept_comdat_sections_): New field.
12169 (Symbol_value::input_value): Update comment.
12170 (Sized_relobj::map_to_kept_section) New function.
12171 (Sized_relobj::include_linkonce_section): Add new parameter.
12172 * target-reloc.h (Comdat_behavior): New type.
12173 (get_comdat_behavior): New function.
12174 (relocate_section): Add code to map a discarded section to the
12175 corresponding kept section when applying a relocation.
12177 2008-04-30 Craig Silverstein <csilvers@google.com>
12179 * dwarf_reader.cc (next_generation_count): New static var.
12180 (Addr2line_cache_entry): New struct.
12181 (addr2line_cache): New static var.
12182 (Dwarf_line_info::one_addr2line): Added caching.
12183 (Dwarf_line_info::clear_addr2line_cache): New function.
12184 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12185 cache-size parameter.
12186 (Dwarf_line_info::one_addr2line_cache): New function.
12187 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12188 new cache-size argument to one_addr2line(), and clear cache.
12190 2008-04-28 Cary Coutant <ccoutant@google.com>
12192 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12193 R_386_PC8 relocations.
12195 2008-04-23 Ian Lance Taylor <iant@google.com>
12197 * object.cc (Sized_relobj::include_section_group): Check for
12198 invalid section group.
12200 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12203 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12204 than read for file header.
12205 * archive.cc (Archive::include_member): Likewise.
12207 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12209 * aclocal.m4: Regenerate.
12210 * configure: Regenerate.
12212 2008-04-19 Ian Lance Taylor <iant@google.com>
12214 * version.cc (version_string): Bump to 1.6.
12216 * testsuite/Makefile.am (many_sections_r_test): New target.
12217 (many_sections_r_test_SOURCES): Remove.
12218 (many_sections_r_test_DEPENDENCIES): Remove.
12219 (many_sections_r_test_LDFLAGS): Remove.
12220 (many_sections_r_test_LDADD): Remove.
12222 * object.cc (Sized_relobj::do_add_symbols): Always pass
12223 local_symbol_count_ to add_from_relobj.
12225 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12226 every thousand variables.
12227 * testsuite/Makefile.in: Rebuild.
12229 * object.cc (Xindex::initialize_symtab_xindex): New function.
12230 (Xindex::read_symtab_xindex): New function.
12231 (Xindex::sym_xindex_to_shndx): New function.
12232 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12234 (Sized_relobj::do_initialize_xindex): New function.
12235 (Sized_relobj::do_read_symbols): Adjust section links.
12236 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12237 parameter. Change all callers.
12238 (Sized_relobj::include_section_group): Adjust section links and
12239 symbol section indexes.
12240 (Sized_relobj::do_layout): Adjust section links.
12241 (Sized_relobj::do_count_local_symbols): Adjust section links and
12242 symbol section indexes.
12243 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12244 ordinary and special symbols.
12245 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12246 dynsym_xindex parameters. Change all callers. Adjust section
12247 links. Use SHN_XINDEX when needed.
12248 (Sized_relobj::get_symbol_location_info): Adjust section links.
12249 Don't get fooled by special symbols.
12250 * object.h (class Xindex): Define.
12251 (class Object): Add xindex_ parameter. Declare virtual functoin
12252 do_initialize_xindex.
12253 (Object::adjust_sym_shndx): New function.
12254 (Object::set_xindex): New protected function.
12255 (class Symbol_value): Add is_ordinary_shndx_ field.
12256 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12257 (Symbol_value::value): Assert ordinary section.
12258 (Symbol_value::initialize_input_to_output_map): Likewise.
12259 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12260 Change all callers.
12261 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12263 (class Sized_relobj): Update declarations.
12264 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12265 parameter. Change all callers.
12266 (Sized_relobj::adjust_shndx): New function.
12267 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12269 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12270 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12271 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12272 (Sized_dynobj::read_dynsym_section): Adjust section links.
12273 (Sized_dynobj::read_dynamic): Likewise.
12274 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12276 (Sized_dynobj::do_initialize_xindex): New function.
12277 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12278 do_initialize_xindex.
12279 (Sized_dynobj::adjust_shndx): New function.
12280 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12281 dynsym_xindex_ fields.
12282 (Layout::finalize): Add a call to set_section_indexes before
12283 creating the symtab sections.
12284 (Layout::set_section_indexes): Don't do anything if the section
12285 already has a section index.
12286 (Layout::create_symtab_sections): Add shnum parameter. Change
12287 caller. Create .symtab_shndx section if needed.
12288 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12290 (Layout::allocated_output_section_count): New function.
12291 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12293 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12294 fields. Update declarations.
12295 (Layout::symtab_xindex): New function.
12296 (Layout::dynsym_xindex): New function.
12297 (class Write_symbols_task): Add layout_ field.
12298 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12300 * output.cc (Output_section_headers::Output_section_headers): Add
12301 shstrtab_section parameter. Change all callers.
12302 (Output_section_headers::do_sized_write): Store overflow values
12303 for section count and section string table section index in
12304 section header zero.
12305 (Output_file_header::do_sized_write): Check for overflow of
12306 section count and section string table section index.
12307 (Output_symtab_xindex::do_write): New function.
12308 (Output_symtab_xindex::endian_do_write): New function.
12309 * output.h (class Output_section_headers): Add shstrtab_section_.
12310 Update declarations.
12311 (class Output_symtab_xindex): Define.
12312 (Output_section::has_out_shndx): New function.
12313 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12315 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12316 Change all callers.
12317 (Sized_symbol::init): Likewise.
12318 (Symbol::output_section): Check for ordinary symbol.
12319 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12320 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12322 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12323 Change all callers. Simplify handling of symbols from sections
12324 not included in the link.
12325 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12327 (Weak_alias_sorter::operator()): Assert that symbols are
12329 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12331 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12332 parameters. Change all callers.
12333 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12334 symbol distinction. Use SHN_XINDEX when needed.
12335 (Symbol_table::write_section_symbol): Add symtab_xindex
12336 parameter. Change all callers.
12337 (Symbol_table::sized_write_section_symbol): Likewise. Use
12338 SHN_XINDEX when needed.
12339 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12341 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12342 (Symbol::is_defined): Check is_ordinary.
12343 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12344 (Symbol::is_absolute, Symbol::is_common): Likewise.
12345 (class Sized_symbol): Update declarations.
12346 (class Symbol_table): Update declarations.
12347 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12348 parameters. Change all callers.
12349 (Sized_symbol::override): Likewise.
12350 (Symbol_table::override): Likewise.
12351 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12352 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12353 is_ordinary, and orig_st_shndx parameters. Change all callers.
12354 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12355 to be in an ordinary section.
12356 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12357 object and is_ordinary parameters. Change all callers.
12358 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12359 Change all callers. Don't add undefined or non-ordinary symbols
12361 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12362 Change all callers.
12363 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12365 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12366 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12367 (Sized_relobj::relocate_sections): Likewise.
12368 * target-reloc.h (scan_relocs): Adjust section symbol index.
12369 (scan_relocatable_relocs): Likewise.
12370 * i386.cc (Scan::local): Check for ordinary symbols.
12371 * sparc.cc (Scan::local): Likewise.
12372 * x86_64.cc (Scan::local): Likewise.
12373 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12374 to symbol_section_and_value.
12375 * testsuite/many_sections_test.cc: New file.
12376 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12377 (check_PROGRAMS): Add many_sections_test.
12378 (many_sections_test_SOURCES): Define.
12379 (many_sections_test_DEPENDENCIES): Define.
12380 (many_sections_test_LDFLAGS): Define.
12381 (BUILT_SOURCES): Add many_sections_define.h.
12382 (many_sections_define.h): New target.
12383 (BUILT_SOURCES): Add many_sections_check.h.
12384 (many_sections_check.h): New target.
12385 (check_PROGRAMS): Add many_sections_r_test.
12386 (many_sections_r_test_SOURCES): Define.
12387 (many_sections_r_test_DEPENDENCIES): Define.
12388 (many_sections_r_test_LDFLAGS): Define.
12389 (many_sections_r_test_LDADD): Define.
12390 (many_sections_r_test.o): New target.
12391 * testsuite/Makefile.in: Rebuild.
12393 2008-04-17 Cary Coutant <ccoutant@google.com>
12395 * errors.cc (Errors::info): New function.
12396 (gold_info): New function.
12397 * errors.h (Errors::info): New function.
12398 * gold.h (gold_info): New function.
12399 * object.cc (Input_objects::add_object): Print trace output.
12400 * options.cc (options::parse_set): New function.
12401 (General_options::parse_wrap): Deleted.
12402 (General_options::General_options): Deleted initializer.
12403 * options.h (options::String_set): New typedef.
12404 (options::parse_set): New function.
12405 (DEFINE_set): New macro.
12406 (General_options::wrap): Changed to use DEFINE_set. Changed
12407 callers of any_wrap_symbols and is_wrap_symbol.
12408 (General_options::trace, General_options::trace_symbol):
12410 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12411 (General_options::wrap_symbols_): Deleted.
12412 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12414 2008-04-17 David S. Miller <davem@davemloft.net>
12416 * options.cc (General_options::parse_V): New function.
12417 * options.h: Add entries for -V and -Qy.
12419 2008-04-17 Ian Lance Taylor <iant@google.com>
12421 * common.cc (Symbol_table::allocate_commons): Remove options
12422 parameter. Change caller.
12423 (Symbol_table::do_allocate_commons): Remove options parameter.
12424 Change caller. Just call do_allocate_commons_list twice.
12425 (Symbol_table::do_allocate_commons_list): New function, broken out
12426 of do_allocate_commons.
12427 * common.h (class Allocate_commons_task): Remove options_ field.
12428 Update constructor.
12429 * symtab.cc (Symbol_table::Symbol_table): Initialize
12431 (Symbol_table::add_from_object): Put TLS common symbols on
12433 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12434 which are IN_OUTPUT_DATA.
12435 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12436 allocate_commons and do_allocate_commons declarations. Declare
12437 do_allocate_commons_list.
12438 * gold.cc (queue_middle_tasks): Update creation of
12439 Allocate_commons_task to not pass options.
12440 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12441 (TLS_TEST_C_FLAGS): New variable.
12442 (tls_test_c_pic.o): New target.
12443 (tls_test_shared.so): Link in tls_test_c_pic.o.
12444 (tls_test_c_pic_ie.o): New target.
12445 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12446 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12447 (tls_test_c.o): New target.
12448 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12449 (tls_pic_test_LDADD): Likewise.
12450 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12451 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12452 (tls_test_c_gnu2.o): New target.
12453 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12455 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12456 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12457 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12458 * testsuite/tls_test.cc: Include "config.h".
12459 (t_last): Call t11_last.
12460 * testsuite/tls_test.h (t11, t11_last): Declare.
12461 * testsuite/tls_test_c.c: New file.
12462 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12463 * configure.ac: Check for OpenMP support.
12464 * configure, config.in, Makefile.in: Rebuild.
12465 * testsuite/Makefile.in: Rebuild.
12467 2008-04-16 Cary Coutant <ccoutant@google.com>
12469 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12470 (Target_i386::tls_base_symbol_defined_): New field.
12471 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12472 (Target_i386::Scan::global): Likewise.
12473 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12474 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12475 (Target_x86_64::tls_base_symbol_defined_): New field.
12476 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12477 (Target_x86_64::Scan::global): Likewise.
12479 2008-04-16 Cary Coutant <ccoutant@google.com>
12481 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12482 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12483 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12484 building shared libraries.
12485 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12486 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12487 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12488 * testsuite/Makefile.in: Rebuild.
12489 * testsuite/weak_undef.h: New file.
12490 * testsuite/weak_undef_file1.cc: Add extra test cases.
12491 * testsuite/weak_undef_file2.cc: Likewise.
12492 * testsuite/weak_undef_test.cc: Likewise.
12494 2008-04-16 David S. Miller <davem@davemloft.net>
12496 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12497 Add issued_non_pic_error_ field. Declare check_non_pic.
12498 (Target_sparc::Scan::check_non_pic): New function.
12499 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12500 (Target_sparc::Scan::global): Likewise.
12502 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12503 * configure: Rebuild.
12505 * options.h (DEFINE_enable): New macro.
12506 (new_dtags): New enable option.
12507 (initfirst, interpose, loadfltr, nodefaultlib,
12508 nodelete, nodlopen, nodump): New -z options.
12509 * layout.cc (Layout:finish_dynamic_section): If new
12510 dtags enabled, emit DT_RUNPATH. Also, emit a
12511 DT_FLAGS_1 containing any specified -z flags.
12513 2008-04-16 Ian Lance Taylor <iant@google.com>
12515 * copy-relocs.cc: New file.
12516 * copy-relocs.h: New file.
12517 * reloc.cc: Remove Copy_relocs code.
12518 * reloc.h: Likewise.
12519 * reloc-types.h (struct Reloc_types) [both versions]: Add
12520 get_reloc_addend_noerror.
12521 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12522 variants of add_global which take an addend which must be zero.
12523 * i386.cc: Include "copy-relocs.h".
12524 (class Target_i386): Change type of copy_relocs_ to variable,
12525 update initializer.
12526 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12527 Change all callers.
12528 (Target_i386::do_finalize_sections): Change handling of
12530 * sparc.cc: Include "copy-relocs.h".
12531 (class Target_sparc): Change type of copy_relocs_ to variable,
12532 update initializer.
12533 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12534 Change all callers.
12535 (Target_sparc::do_finalize_sections): Change handling of
12537 * x86_64.cc: Include "copy-relocs.h".
12538 (class Target_x86_64): Change type of copy_relocs_ to variable,
12539 update initializer.
12540 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12541 class. Change all callers.
12542 (Target_x86_64::do_finalize_sections): Change handling of
12544 * Makefile.am (CCFILES): Add copy-relocs.cc.
12545 (HFILES): Add copy-relocs.h.
12547 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12549 * testsuite/script_test_4.sh: Permit leading zeroes.
12551 2008-04-15 Ian Lance Taylor <iant@google.com>
12553 * script-sections.cc (Script_sections::create_segments): Use
12554 header_size_adjustment even when there is enough room for the
12556 * testsuite/script_test_4.sh: New file.
12557 * testsuite/script_test_4.t: New file.
12558 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12559 (check_DATA): Add script_test_4.stdout.
12560 (MOSTLYCLEANFILES): Likewise.
12561 (script_test_4): New target.
12562 (script_test_4.stdout): New target.
12563 * testsuite/Makefile.in: Rebuild.
12565 * sparc.cc: Add definitions for Output_data_plt_sparc class
12568 2008-04-14 David S. Miller <davem@davemloft.net>
12570 * sparc.cc: New file.
12571 * Makefile.am (TARGETSOURCES): Add sparc.cc
12572 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12573 * configure.tgt: Document targ_extra_size and
12574 targ_extra_big_endian. Add entries for sparc-* and
12576 * configure.ac: Handle targ_extra_size and
12577 targ_extra_big_endian.
12578 * Makefile.in: Rebuild.
12579 * configure: Likewise.
12580 * po/POTFILES.in: Likewise.
12581 * po/gold.pot: Likewise.
12583 2008-04-14 Ian Lance Taylor <iant@google.com>
12585 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12586 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12587 in the name/type/flags to section mapping. Don't call
12588 allocate_output_section.
12589 (Layout::choose_output_section): Change parameter from adjust_name
12590 to is_input_section. Don't permit input sections after sections
12591 are attached to segments. Don't call allocate_output_section.
12592 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12593 not write_enable_output_section.
12594 (Layout::make_output_section): Don't push to
12595 unattached_section_list_ nor call attach_to_segment. Call
12596 attach_section_to_segment if sections are attached.
12597 (Layout::attach_sections_to_segments): New function.
12598 (Layout::attach_section_to_segment): New function.
12599 (Layout::attach_allocated_section_to_segment): Rename from
12600 attach_to_segment. Remove flags parameter.
12601 (Layout::allocate_output_section): Remove function.
12602 (Layout::write_enable_output_section): Remove function.
12603 * layout.h (class Layout): Update for above changes. Add new
12604 field sections_are_attached_.
12605 * output.h (Output_section::update_flags_for_input_section): New
12607 * output.cc (Output_section::add_input_section): Call
12608 update_flags_for_input_section.
12609 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12611 2008-04-11 Cary Coutant <ccoutant@google.com>
12613 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12614 thought unnecessary.
12615 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12617 2008-04-11 Ian Lance Taylor <iant@google.com>
12619 * output.h (class Output_section_data): Remove inline definition
12621 * output.cc (Output_section_data::set_addralign): New function.
12623 2008-04-11 Cary Coutant <ccoutant@google.com>
12625 Add support for TLS descriptors for i386 and x86_64.
12626 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12627 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12628 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12630 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12631 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12632 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12634 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12635 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12636 Fix problem with initial-exec relocations.
12637 (Target_i386::Relocate::relocate_tls): Likewise.
12638 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12640 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12641 support for section-plus-offset dynamic table entries.
12642 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12643 (Output_data_dynamic::Dynamic_entry): Add support for
12644 section-plus-offset dynamic table entries.
12645 (Output_data_dynamic::Classification): Likewise.
12646 (Output_data_dynamic::classification_): Renamed offset_.
12647 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12648 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12649 (Target_x86_64::make_plt_section): New function.
12650 (Target_x86_64::reserve_tlsdesc_entries): New function.
12651 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12652 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12653 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12654 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12655 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12656 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12657 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12658 add extra PLT entry for TLS descriptors.
12659 (Output_data_plt_x86_64::got_): New field.
12660 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12661 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12663 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12665 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12666 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12667 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12668 R_386_TLS_DESC_CALL relocations.
12669 (Target_x86_64::Scan::global): Likewise.
12670 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12671 for TLS descriptors.
12672 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12673 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12674 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12675 GD-to-IE relaxation.
12676 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12677 and TLS_DESCRIPTORS.
12678 * Makefile.in: Rebuild.
12679 * configure: Rebuild.
12680 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12681 (tls_test_shared2.so): New target.
12682 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12683 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12684 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12685 (tls_shared_gd_to_ie_test_LDADD): New variable.
12686 (tls_shared_gnu2_gd_to_ie_test): New target.
12687 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12689 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12690 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12691 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12692 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12693 (tls_shared_gnu2_test): New target.
12694 (tls_test_gnu2_shared.so): New target.
12695 (tls_shared_gnu2_test_SOURCES): New variable.
12696 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12697 (tls_shared_gnu2_test_LDFLAGS): New variable.
12698 (tls_shared_gnu2_test_LDADD): New variable.
12699 * testsuite/Makefile.in: Rebuild.
12700 * testsuite/Makefile.
12702 2008-04-11 Ian Lance Taylor <iant@google.com>
12704 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12706 * testsuite/Makefile.in: Rebuild.
12708 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12710 * testsuite/script_test_2.cc (main): Adjust test.
12712 2008-04-11 David S. Miller <davem@davemloft.net>
12713 Ian Lance Taylor <iant@google.com>
12715 * options.h (General_options): Add entries for '-Y' and
12717 * options.cc (General_options:finalize): If -Y was used, add those
12718 entries to the library path instead of the default "/lib" and
12721 2008-04-11 David S. Miller <davem@davemloft.net>
12723 * testsuite/justsyms.t: Start at 0x100.
12724 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12725 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12727 * testsuite/script_test_2.cc: Adjust string and section length
12730 2008-04-09 Ian Lance Taylor <iant@google.com>
12733 * script-sections.cc (Sections_element::allocate_to_segment): Add
12735 (Output_section_definition::allocate_to_segment): Likewise.
12736 (Orphan_output_section::allocate_to_segment): Likewise.
12737 (Script_sections::attach_sections_using_phdrs_clause): Don't
12738 propagate non-PT_LOAD segments to orphan sections.
12739 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12740 readelf rather than objdump.
12741 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12742 .interp section and PT_INTERP segment are the same size.
12743 * testsuite/Makefile.in: Rebuild.
12745 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12746 aliases for symbols defined in the same object.
12747 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12748 (weak_alias_test_SOURCES): New variable.
12749 (weak_alias_test_DEPENDENCIES): New variable.
12750 (weak_alias_test_LDFLAGS): New variable.
12751 (weak_alias_test_LDADD): New variable.
12752 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12753 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12754 (weak_alias_test_3.o): New target.
12755 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12756 * testsuite/weak_alias_test_main.cc: New file.
12757 * testsuite/weak_alias_test_1.cc: New file.
12758 * testsuite/weak_alias_test_2.cc: New file.
12759 * testsuite/weak_alias_test_3.cc: New file.
12761 2008-04-08 Ian Lance Taylor <iant@google.com>
12763 * options.h (class General_options): Add --noinhibit-exec option.
12764 * main.cc (main): Check --noinhibit-exec.
12766 * options.h (class General_options): Define --wrap as a special
12767 option. Add wrap_symbols_ field.
12768 (General_options::any_wrap_symbols): New function.
12769 (General_options::is_wrap_symbol): New function.
12770 * options.cc (General_options::parse_wrap): New function.
12771 (General_options::General_options): Initialize wrap_symbols_.
12772 * symtab.cc (Symbol_table::wrap_symbol): New function.
12773 (Symbol_table::add_from_object): Handle --wrap.
12774 * symtab.h (class Symbol_table): Declare wrap_symbol.
12775 * target.h (Target::wrap_char): New function.
12776 (Target::Target_info): Add wrap_char field.
12777 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12778 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12779 * testsuite/testfile.cc (Target_test::test_target_info):
12782 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12785 * layout.h (class Layout): Add added_eh_frame_data_ field.
12786 * layout.cc (Layout::Layout): Initialize new field.
12787 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12788 output section until we find a section we merged successfully.
12789 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12790 that the size be non-zero.
12792 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12795 2008-04-08 Craig Silverstein <csilvers@google.com>
12797 * configure.ac: Export new conditional variable HAVE_ZLIB.
12798 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12800 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12801 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12803 2008-04-07 Ian Lance Taylor <iant@google.com>
12805 * version.cc (version_string): Set to "1.5".
12807 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12808 Add issued_non_pic_error_ field. Declare check_non_pic.
12809 (Target_x86_64::Scan::check_non_pic): New function.
12810 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12811 (Target_x86_64::Scan::global): Likewise.
12813 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12814 addend parameter. Change caller. Handle merge sections.
12815 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12816 Address to Addend. Don't add in the result of
12817 local_section_offset, pass down the addend and use the returned
12819 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12820 Update declarations of local_section_offset and symbol_value.
12821 * testsuite/two_file_test_1.cc (t18): New function.
12822 * testsuite/two_file_test_2.cc (f18): New function.
12823 * testsuite/two_file_test_main.cc (main): Call t18.
12824 * testsuite/two_file_test.h (t18, f18): Declare.
12826 * configure.ac: Don't test for objdump, c++filt, or readelf.
12827 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12829 (TEST_READELF): New variable.
12830 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12831 (check_PROGRAMS): Add two_file_strip_test.
12832 (two_file_strip_test): New target.
12833 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12834 (two_file_same_shared_strip_test_SOURCES): New variable.
12835 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12836 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12837 (two_file_same_shared_strip_test_LDADD): New variable.
12838 (two_file_shared_strip.so): New target.
12839 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12840 (ver_test_5.syms, ver_test_7.syms): Likewise.
12841 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12842 (strip_test_3.stdout): Use TEST_OBJDUMP.
12843 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12845 2008-04-04 Cary Coutant <ccoutant@google.com>
12847 * symtab.h (Symbol::is_weak_undefined): New function.
12848 (Symbol::is_strong_undefined): New function.
12849 (Symbol::is_absolute): New function.
12850 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12851 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12853 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12854 (weak_undef_test): New target.
12855 * testsuite/Makefile.in: Rebuild.
12856 * testsuite/weak_undef_file1.cc: New file.
12857 * testsuite/weak_undef_file2.cc: New file.
12858 * testsuite/weak_undef_test.cc: New file.
12860 2008-04-03 Craig Silverstein <csilvers@google.com>
12862 * compressed_output.h (class Output_compressed_section): Use
12864 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12866 (zlib_compressed_suffix): Removed.
12867 (Output_compressed_section::set_final_data_size): Use unsigned
12869 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12870 Fix linker invocation.
12871 (flagstest_o_specialfile_and_compress_debug_sections):
12873 * testsuite/Makefile.in: Regenerated.
12875 2008-04-02 David S. Miller <davem@davemloft.net>
12877 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12878 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12880 2008-04-02 Craig Silverstein <csilvers@google.com>
12884 2008-04-02 Ian Lance Taylor <iant@google.com>
12886 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12887 parameters. Update for new key type to views_. Change all
12889 (File_read::read): Adjust for byteshift in returned view.
12890 (File_read::add_view): New function, broken out of
12891 find_and_make_view.
12892 (File_read::make_view): New function, broken out of
12893 find_and_make_view.
12894 (File_read::find_or_make_view): Add offset and aligned
12895 parameters. Rewrite accordingly. Change all callers.
12896 (File_read::get_view): Add offset and aligned parameters. Adjust
12897 for byteshift in return value.
12898 (File_read::get_lasting_view): Likewise.
12899 * fileread.h (class File_read): Update declarations.
12900 (class File_read::View): Add byteshift_ field. Add byteshift to
12901 constructor. Add byteshift method.
12902 * archive.h (Archive::clear_uncached_views): New function.
12903 (Archive::get_view): Add aligned parameter. Change all callers.
12904 * object.h (Object::get_view): Add aligned parameter. Change all
12906 (Object::get_lasting_view): Likewise.
12908 * fileread.cc (File_read::release): Don't call clear_views if
12909 there are multiple objects.
12910 * fileread.h (File_read::clear_uncached_views): New function.
12911 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12914 2008-03-31 Cary Coutant <ccoutant@google.com>
12916 Add thin archive support.
12917 * archive.cc (Archive::armagt): New const.
12918 (Archive::setup): Remove task parameter and calls to unlock.
12919 (Archive::unlock_nested_archives): New function.
12920 (Archive::read_header): Add nested_off parameter. Change
12922 (Archive::interpret_header): Likewise.
12923 (Archive::include_all_members): Change to handle thin
12925 (Archive::include_member): Likewise.
12926 * archive.h (Archive::Archive): Add new parameters and
12928 (Archive::armagt): New const.
12929 (Archive::setup): Remove task parameter.
12930 (Archive::unlock_nested_archives): New function.
12931 (Archive::read_header): Add nested_off parameter.
12932 (Archive::interpret_header): Likewise.
12933 (Archive::Nested_archive_table): New typedef.
12934 (Archive::is_thin_archive_): New field.
12935 (Archive::nested_archives_): New field.
12936 (Archive::options_): New field.
12937 (Archive::dirpath_): New field.
12938 (Archive::task_): New field.
12939 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12940 for thin archives. Pass additional parameters to
12941 Archive::Archive. Unlock the archive file after calling
12944 2008-03-29 Ian Lance Taylor <iant@google.com>
12946 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12947 version symbol to be local.
12948 * testsuite/ver_test_4.sh: New file.
12949 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12950 (check_DATA): Add ver_test_4.syms.
12951 (ver_test_4.syms): New target.
12952 * testsuite/Makefile.in: Rebuild.
12955 (Output_section::Input_section_sort_entry::has_priority): New
12957 (Output_section::Input_section_sort_entry::match_file_name): New
12959 (Output_section::Input_section_sort_entry::match_section_name):
12961 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12963 (Output_section::Input_section_sort_entry::match_section_file):
12965 (Output_section::Input_section_sort_compare::operator()): Rewrite
12966 using new Input_section_sort_entry functions. Sort crtbegin and
12967 crtend first. Sort sections with no priority before sections with
12969 * testsuite/initpri1.c (d3): Check j != 4.
12970 (cd5): New constructor/destructor function.
12971 (main): Check j != 2.
12973 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12974 new symbol when resolving, don't call set_is_default.
12975 * testsuite/ver_test_7.cc: New file.
12976 * testsuite/ver_test_7.sh: New file.
12977 * testsuite/Makefile.am (ver_test_7.so): New target.
12978 (ver_test_7.o): New target.
12979 (check_SCRIPTS): Add ver_test_7.sh.
12980 (check_DATA): Add ver_test_7.syms.
12981 (ver_test_7.syms): New target.
12983 2008-03-28 Ian Lance Taylor <iant@google.com>
12985 * layout.cc (Layout::layout): If we see an input section with a
12986 name that needs sorting, set the must_sort flag for the output
12988 (Layout::make_output_section): If the name of the output section
12989 indicates that it might require sorting, set the may_sort flag.
12990 * output.h (Output_section::may_sort_attached_input_sections): New
12992 (Output_section::set_may_sort_attached_input_sections): New
12994 (Output_section::must_sort_attached_input_sections): New
12996 (Output_section::set_must_sort_attached_input_sections): New
12998 (class Output_section): Declare Input_section_sort_entry. Define
12999 Input_section_sort_compare. Declare
13000 sort_attached_input_sections. Add new fields:
13001 may_sort_attached_input_sections_,
13002 must_sort_attached_input_sections_,
13003 attached_input_sections_are_sorted_.
13004 * output.cc (Output_section::Output_section): Initialize new
13006 (Output_section::add_input_section): Add an entry to
13007 input_sections_ if may_sort or must_sort are true.
13008 (Output_section::set_final_data_size): Call
13009 sort_attached_input_sections if necessary.
13010 (Output_section::Input_section_sort_entry): Define new class.
13011 (Output_section::Input_section_sort_compare::operator()): New
13013 (Output_section::sort_attached_input_sections): New function.
13014 * configure.ac: Check whether the compiler supports constructor
13015 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13016 * testsuite/initpri1.c: New file.
13017 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13018 CONSTRUCTOR_PRIORITY.
13019 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13020 (initpri1_LDFLAGS): New variable.
13021 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13023 2008-03-27 Ian Lance Taylor <iant@google.com>
13025 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13026 * testsuite/common_test_1.c: New file.
13027 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13028 (common_test_1_SOURCES): New variable.
13029 (common_test_1_DEPENDENCIES): New variable.
13030 (common_test_1_LDFLAGS): New variable.
13032 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13033 and commons_ correctly when NAME/VERSION does not override
13035 * testsuite/ver_test_6.c: New file.
13036 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13037 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13038 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13040 2008-03-26 Ian Lance Taylor <iant@google.com>
13042 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13043 of an undefined symbol from a version script.
13044 * testsuite/Makefile.am (ver_test_5.so): New target.
13045 (ver_test_5.o): New target.
13046 (check_SCRIPTS): Add ver_test_5.sh.
13047 (check_DATA): Add ver_test_5.syms.
13048 (ver_test_5.syms): New target.
13049 * testsuite/ver_test_5.cc: New file.
13050 * testsuite/ver_test_5.script: New file.
13051 * testsuite/ver_test_5.sh: New file.
13052 * Makefile.in, testsuite/Makefile.in: Rebuild.
13055 Fix problems building gold with gcc 4.3.0.
13056 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13057 (gold_error_at_location, gold_warning_at_location): Use it.
13058 * configure.ac: Check whether we can compile and use a template
13059 function with a printf attribute.
13060 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13061 when jumping over bytes.
13062 * object.cc: Instantiate Object::read_section_data.
13063 * debug.h: Include <cstring>
13064 * dwarf_reader.cc: Include <algorithm>
13065 * main.cc: Include <cstring>.
13066 * options.cc: Include <cstring>.
13067 * output.cc: Include <cstring>.
13068 * script.cc: Include <cstring>.
13069 * script.h: Include <string>.
13070 * symtab.cc: Include <cstring> and <algorithm>.
13071 * target-select.cc: Include <cstring>.
13072 * version.cc: Include <string>.
13073 * testsuite/testmain.cc: Include <cstdlib>.
13074 * configure, config.in: Rebuild.
13076 2008-03-25 Ian Lance Taylor <iant@google.com>
13078 * options.cc: Include "../bfd/bfdver.h".
13079 (options::help): Print bug reporting address.
13081 * version.cc (print_version): Adjust output for current value of
13082 BFD_VERSION_STRING.
13086 * options.cc (options::help): Print list of supported targets.
13087 * target-select.h: Include <vector>.
13088 (class Target_selector): Make machine_, size_, and is_big_endian_
13089 fields const. Add bfd_name_ and instantiated_target_ fields.
13090 (Target_selector::Target_selector): Add bfd_name parameter.
13091 (Target_selector::recognize): Make non-virtual, call
13093 (Target_selector::recognize_by_name): Make non-virtual, call
13094 do_recognize_by_name.
13095 (Target_selector::supported_names): New function.
13096 (Target_selector::bfd_name): New function.
13097 (Target_selector::do_instantiate_target): New pure virtual
13099 (Target_selector::do_recognize): New virtual function.
13100 (Target_selector::do_recognize_by_name): New virtual function.
13101 (Target_selector::instantiate_target): New private function.
13102 (supported_target_names): Declare.
13103 * target-select.cc (Target_selector::Target_selector): Update for
13104 new parameter and fields.
13105 (select_target_by_name): Check that the name matches before
13106 calling recognize_by_name.
13107 (supported_target_names): New function.
13108 * i386.cc (class Target_selector_i386): Update Target_selector
13109 constructor call. Remove recognize and recognize_by_name. Add
13110 do_instantiate_target.
13111 * x86_64.cc (class Target_selector_x86_64): Likewise.
13112 * testsuite/testfile.cc (class Target_selector_test): Update for
13113 changes to Target_selector.
13115 * README: Rewrite, with some notes on unsupported features.
13117 2008-03-24 Cary Coutant <ccoutant@google.com>
13119 * i386.cc (Target_i386::Got_type): New enum declaration.
13120 (Target_i386::Scan::local): Updated callers of Output_data_got
13122 (Target_i386::Scan::global): Likewise.
13123 (Target_i386::Relocate::relocate): Likewise.
13124 (Target_i386::Relocate::relocate_tls): Likewise.
13125 * object.h (Got_offset_list): New class.
13126 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13127 (Sized_relobj::local_got_offset): Likewise.
13128 (Sized_relobj::set_local_got_offset): Likewise.
13129 (Sized_relobj::local_has_tls_got_offset): Removed.
13130 (Sized_relobj::local_tls_got_offset): Removed.
13131 (Sized_relobj::set_local_tls_got_offset): Removed.
13132 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13133 * output.cc (Output_data_got::add_global): Added got_type parameter.
13134 (Output_data_got::add_global_with_rel): Likewise.
13135 (Output_data_got::add_global_with_rela): Likewise.
13136 (Output_data_got::add_global_pair_with_rel): New function.
13137 (Output_data_got::add_global_pair_with_rela): New function.
13138 (Output_data_got::add_local): Added got_type parameter.
13139 (Output_data_got::add_local_with_rel): Likewise.
13140 (Output_data_got::add_local_with_rela): Likewise.
13141 (Output_data_got::add_local_pair_with_rel): New function.
13142 (Output_data_got::add_local_pair_with_rela): New function.
13143 (Output_data_got::add_global_tls): Removed.
13144 (Output_data_got::add_global_tls_with_rel): Removed.
13145 (Output_data_got::add_global_tls_with_rela): Removed.
13146 (Output_data_got::add_local_tls): Removed.
13147 (Output_data_got::add_local_tls_with_rel): Removed.
13148 (Output_data_got::add_local_tls_with_rela): Removed.
13149 * output.h (Output_data_got::add_global): Added got_type parameter.
13150 (Output_data_got::add_global_with_rel): Likewise.
13151 (Output_data_got::add_global_with_rela): Likewise.
13152 (Output_data_got::add_global_pair_with_rel): New function.
13153 (Output_data_got::add_global_pair_with_rela): New function.
13154 (Output_data_got::add_local): Added got_type parameter.
13155 (Output_data_got::add_local_with_rel): Likewise.
13156 (Output_data_got::add_local_with_rela): Likewise.
13157 (Output_data_got::add_local_pair_with_rel): New function.
13158 (Output_data_got::add_local_pair_with_rela): New function.
13159 (Output_data_got::add_global_tls): Removed.
13160 (Output_data_got::add_global_tls_with_rel): Removed.
13161 (Output_data_got::add_global_tls_with_rela): Removed.
13162 (Output_data_got::add_local_tls): Removed.
13163 (Output_data_got::add_local_tls_with_rel): Removed.
13164 (Output_data_got::add_local_tls_with_rela): Removed.
13165 * resolve.cc (Symbol::override_base_with_special): Removed
13166 reference to has_got_offset_ field.
13167 * symtab.cc (Symbol::init_fields): Replaced initialization
13168 of got_offset_ with got_offsets_. Removed initialization
13170 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13171 (Symbol::got_offset): Likewise.
13172 (Symbol::set_got_offset): Likewise.
13173 (Symbol::has_tls_got_offset): Removed.
13174 (Symbol::tls_got_offset): Removed.
13175 (Symbol::set_tls_got_offset): Removed.
13176 (Symbol::got_offset_): Removed.
13177 (Symbol::tls_mod_got_offset_): Removed.
13178 (Symbol::tls_pair_got_offset_): Removed.
13179 (Symbol::got_offsets_): New field.
13180 (Symbol::has_got_offset): Removed.
13181 (Symbol::has_tls_mod_got_offset): Removed.
13182 (Symbol::has_tls_pair_got_offset): Removed.
13183 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13184 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13186 (Target_x86_64::Scan::global): Likewise.
13187 (Target_x86_64::Relocate::relocate): Likewise.
13188 (Target_x86_64::Relocate::relocate_tls): Likewise.
13190 2008-03-25 Ben Elliston <bje@au.ibm.com>
13192 * yyscript.y: Fix spelling error in comment.
13194 2008-03-24 Ian Lance Taylor <iant@google.com>
13196 * options.h (class General_options): Define build_id option.
13197 * layout.h (class Layout): Declare write_build_id, create_note,
13198 create_build_id. Add build_id_note_ member.
13199 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13200 "libiberty.h", "md5.h", "sha1.h".
13201 (Layout::Layout): Initialize eh_frame_data_,
13202 eh_frame_hdr_section_, and build_id_note_.
13203 (Layout::finalize): Call create_build_id.
13204 (Layout::create_note): New function, broken out of
13205 Layout::create_gold_note.
13206 (Layout::create_gold_note): Call create_note.
13207 (Layout::create_build_id): New function.
13208 (Layout::write_build_id): New function.
13209 (Close_task_runner::run): Call write_build_id.
13211 * x86_64.cc: Correct license to GPLv3.
13213 2008-03-23 Ian Lance Taylor <iant@google.com>
13215 * options.cc: Include "demangle.h".
13216 (parse_optional_string): New function.
13217 (parse_long_option): Handle takes_optional_argument.
13218 (parse_short_option): Update dash_z initializer. Handle
13219 takes_optional_argument.
13220 (General_options::General_options): Initialize do_demangle_.
13221 (General_options::finalize): Set do_demangle_. Handle demangling
13223 * options.h (parse_optional_string): Declare.
13224 (struct One_option): Add optional_arg field. Update constructor.
13225 Update call constructor calls. Add takes_optional_argument
13227 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13228 (DEFINE_optional_string): Define.
13229 (General_options::demangle): Change from DEFINE_bool to
13230 DEFINE_optional_string.
13231 (General_options::no_demangle): New function.
13232 (General_options::do_demangle): New function.
13233 (General_options::set_do_demangle): New function.
13234 (General_options::execstack_status_): Move definition to end of
13236 (General_options::static_): Likewise.
13237 (General_options::do_demangle_): New field.
13238 * object.cc (big_endian>::get_symbol_location_info): Call
13239 Options::do_demangle, not Options::demangle.
13240 * symtab.cc (demangle): Likewise.
13242 2008-03-22 Ian Lance Taylor <iant@google.com>
13244 * gold.h: Include <cstddef> and <sys/types.h>
13245 * options.h: Include <cstring>.
13247 2008-03-21 Ian Lance Taylor <iant@google.com>
13249 * Added source code to GNU binutils.