1 2012-06-22 Roland McGrath <mcgrathr@google.com>
3 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
5 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
7 * plugin.cc (Plugin::load): Handle position independent executables.
9 2012-06-06 Cary Coutant <ccoutant@google.com>
11 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
13 (lines_only_debug_sections): Likewise.
14 (gdb_fast_lookup_sections): New static array.
15 (is_gdb_debug_section): Rename formal parameter.
16 (is_lines_only_debug_section): Likewise.
17 (is_gdb_fast_lookup_section): New function.
18 (Layout::include_section): Check for ".zdebug_" prefix; pass
19 section name suffix to is_gdb_debug_section, et al.; check for
20 fast-lookup sections when building .gdb_index.
21 * options.h (--strip-debug-gdb): Update GDB version number.
23 2012-06-06 Cary Coutant <ccoutant@google.com>
25 * configure.ac: Add check for fallocate.
26 * configure: Regenerate.
27 * config.in: Regenerate.
29 * options.h (class General_options): Add --mmap-output-file and
30 --posix-fallocate options.
31 * output.cc: (posix_fallocate): Remove; replace with...
32 (gold_fallocate): New function.
33 (Output_file::map_no_anonymous): Call gold_fallocate.
34 (Output_file::map): Check --mmap-output-file option.
36 2012-06-05 Jing Yu <jingyu@google.com>
38 * gold.h (textdomain): Add do {} to empty while(0).
39 (bindtextdomain): Likewise.
41 2012-06-04 Cary Coutant <ccoutant@google.com>
43 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
46 2012-05-25 Sriraman Tallam <tmsriram@google.com>
48 * symtab.cc (Symbol_table::define_special_symbol):
49 Initialize *poldsym to prevent uninitialized variable errors.
51 2012-05-23 Cary Coutant <ccoutant@google.com>
53 * layout.cc (Layout::section_name_mapping): Add rules to handle
54 exact match on .data.rel.ro.local or .data.rel.ro.
55 (Layout::output_section_name): Check for exact matches.
57 2012-05-23 Cary Coutant <ccoutant@google.com>
59 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
62 2012-05-22 Cary Coutant <ccoutant@google.com>
64 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
65 object before exporting symbol.
67 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
69 * testsuite/tls_test.cc: Include "config.h" first.
70 * testsuite/tls_test_c.c: Likewise.
72 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
73 Nick Clifton <nickc@redhat.com>
76 * configure.in: Add check that sysdep.h has been included before
77 any system header files.
78 * configure: Regenerate.
79 * config.in: Regenerate.
81 2012-05-14 Cary Coutant <ccoutant@google.com>
83 * layout.cc (Layout::make_output_section): Mark .tdata section
85 * testsuite/relro_test.cc: Add a TLS variable.
87 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
90 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
91 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
94 2012-05-08 Cary Coutant <ccoutant@google.com>
96 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
97 (lines_only_debug_sections): Likewise.
99 2012-05-02 Roland McGrath <mcgrathr@google.com>
103 * Makefile.am (CCFILES, HFILES): Add them.
104 * Makefile.in: Regenerate.
105 * i386.cc (Output_data_plt_i386_nacl): New class.
106 (Output_data_plt_i386_nacl_exec): New class.
107 (Output_data_plt_i386_nacl_dyn): New class.
108 (Target_i386_nacl): New class.
109 (Target_selector_i386_nacl): New class.
110 (target_selector_i386): Use it instead of Target_selector_i386.
111 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
112 (Target_x86_64_nacl): New class.
113 (Target_selector_x86_64_nacl): New class.
114 (target_selector_x86_64, target_selector_x32): Use it instead of
115 Target_selector_x86_64.
116 * arm.cc (Output_data_plt_arm_nacl): New class.
117 (Target_arm_nacl): New class.
118 (Target_selector_arm_nacl): New class.
119 (target_selector_arm, target_selector_armbe): Use it instead of
122 * target-select.cc (select_target): Take new Input_file* and off_t
123 arguments, pass them on to recognize method of selector.
124 * object.cc (make_elf_sized_object): Update caller.
125 * parameters.cc (parameters_force_valid_target): Likewise.
126 * incremental.cc (make_sized_incremental_binary): Likewise.
127 * target-select.h: Update decl.
128 (Target_selector::recognize): Take new Input_file* argument,
129 pass it on to do_recognize.
130 (Target_selector::do_recognize): Take new Input_file* argument.
131 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
132 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
133 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
134 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
136 * target.h (Target::Target_info): New members isolate_execinstr
138 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
139 * arm.cc (Target_arm::arm_info): Update initializer.
140 * i386.cc (Target_i386::i386_info): Likewise.
141 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
142 * sparc.cc (Target_sparc::sparc_info): Likewise.
143 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
144 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
145 * layout.cc (Layout::attach_allocated_section_to_segment):
146 Take new const Target* argument. If target->isolate_execinstr(), act
148 (Layout::find_first_load_seg): Take new const Target* argument;
149 if target->isolate_execinstr(), reject PF_X segments.
150 (Layout::relaxation_loop_body): Update caller.
151 (Layout::set_segment_offsets): If target->isolate_execinstr(),
152 reset file offset to zero when we hit LOAD_SEG, and then do a second
153 loop over the segments before LOAD_SEG to reassign offsets after
154 addresses have been determined. Handle target->rosegment_gap().
155 (Layout::attach_section_to_segment): Take new const Target* argument;
156 pass it to attach_allocated_section_to_segment.
157 (Layout::make_output_section): Update caller.
158 (Layout::attach_sections_to_segments): Take new const Target* argument;
159 pass it to attach_section_to_segment.
160 * gold.cc (queue_middle_tasks): Update caller.
161 * layout.h (Layout): Update method decls with new arguments.
163 * arm.cc (Target_arm::Target_arm): Take optional argument for the
164 Target_info pointer to use.
165 (Target_arm::do_make_data_plt): New virtual method.
166 (Target_arm::make_data_plt): New method that calls it.
167 (Target_arm::make_plt_entry): Use it.
168 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
169 for the section alignment.
170 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
172 (Output_data_plt_arm::first_plt_entry_offset): Call it.
173 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
175 (Output_data_plt_arm::get_plt_entry_size): Call it.
176 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
177 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
178 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
180 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
181 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
182 method instead of sizeof(plt_entry).
183 (Output_data_plt_arm::add_entry): Likewise.
184 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
185 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
187 (Target_arm::plt_entry_size): Likewise.
188 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
190 (Output_data_plt_arm_standard): ... here, new class.
191 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
192 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
193 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
195 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
196 Take additional argument for the PLT entry size.
197 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
198 Use get_plt_entry_size method rather than plt_entry_size variable.
199 (Output_data_plt_x86_64::reserve_slot): Likewise.
200 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
201 (Output_data_plt_x86_64::add_entry): Likewise.
202 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
203 (Output_data_plt_x86_64::address_for_global): Likewise.
204 (Output_data_plt_x86_64::address_for_local): Likewise.
205 (Output_data_plt_x86_64::set_final_data_size): Likewise.
206 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
207 Make method non-static.
208 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
210 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
211 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
212 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
213 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
215 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
216 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
218 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
219 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
221 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
222 (Output_data_plt_x86_64::plt_entry_size)
223 (Output_data_plt_x86_64::first_plt_entry)
224 (Output_data_plt_x86_64::plt_entry)
225 (Output_data_plt_x86_64::tlsdesc_plt_entry)
226 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
227 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
228 (Output_data_plt_x86_64_standard): ... here, new class.
229 (Target_x86_64::Target_x86_64): Take optional argument for the
230 Target_info pointer to use.
231 (Target_x86_64::do_make_data_plt): New virtual method.
232 (Target_x86_64::make_data_plt): New method to call it.
233 (Target_x86_64::init_got_plt_for_update): Use that.
234 Call this->plt_->add_eh_frame method here.
235 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
236 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
237 rather than static method.
238 (Target_x86_64::plt_entry_size): Likewise.
239 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
240 rather than plt_entry_size variable. Move guts of PLT filling to...
241 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
242 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
243 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
245 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
246 additional argument for the section alignment.
247 Don't do add_eh_frame_for_plt here.
248 (Output_data_plt_i386::first_plt_entry_offset): Make the method
249 non-static. Use get_plt_entry_size method rather than plt_entry_size
251 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
253 (Output_data_plt_i386::get_plt_entry_size): Call it.
254 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
255 (Output_data_plt_i386::add_eh_frame): New method to call it.
256 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
258 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
259 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
261 (Output_data_plt_i386::fill_plt_entry): New method to call it.
262 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
263 method instead of plt_entry_size.
264 (Output_data_plt_i386::plt_entry_size)
265 (Output_data_plt_i386::plt_eh_frame_fde_size)
266 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
267 (Output_data_plt_i386_standard): ... here, new class.
268 (Output_data_plt_i386_exec): New class.
269 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
270 (Output_data_plt_i386_exec::first_plt_entry): ... here.
271 (Output_data_plt_i386::exec_plt_entry): Move to ...
272 (Output_data_plt_i386_exec::plt_entry): ... here.
273 (Output_data_plt_i386_dyn): New class.
274 (Output_data_plt_i386::first_plt_entry): Move to ...
275 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
276 (Output_data_plt_i386::dyn_plt_entry): Move to ...
277 (Output_data_plt_i386_dyn::plt_entry): ... here.
278 (Target_i386::Target_i386): Take optional argument for the Target_info
280 (Target_i386::do_make_data_plt): New virtual method.
281 (Target_i386::make_data_plt): New method to call it.
282 (Target_i386::make_plt_section): Use that.
283 Call this->plt_->add_eh_frame method here.
284 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
285 rather than plt_entry_size variable.
286 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
287 (Output_data_plt_i386::address_for_local): Likewise.
288 (Output_data_plt_i386::do_write): Likewise.
289 Move guts of PLT filling to...
290 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
291 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
292 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
293 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
295 2012-05-01 Cary Coutant <ccoutant@google.com>
297 * dwarf_reader.cc (Dwarf_die::read_attributes)
298 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
299 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
300 * reduced_debug_output.cc
301 (Output_reduced_debug_info_section::get_die_end): Remove
302 DW_FORM_GNU_ref_index. Add default case.
304 2012-04-26 Mark Wielaard <mjw@redhat.com>
306 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
307 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
308 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
309 DW_AT_high_pc as offset from DW_AT_low_pc.
311 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
312 * testsuite/Makefile.in: Regenerate.
313 * testsuite/gdb_index_test_3.c: New test source file.
314 * testsuite/gdb_index_test_3.sh: New test source file.
316 2012-04-25 Ian Lance Taylor <iant@google.com>
318 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
320 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
321 as a class, not a struct.
322 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
323 (Target_arm::apply_cortex_a8_workaround): Likewise.
324 * gc.h: Declare Reloc_types as a struct, not a class.
325 * object.h: Declare Symbols_data as a struct.
326 * reloc.h: Declare Read_relocs_data as a struct.
327 * target.h: Declare Relocate_info as a struct.
329 2012-04-24 David S. Miller <davem@davemloft.net>
331 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
332 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
335 2012-04-24 Cary Coutant <ccoutant@google.com>
337 * incremental-dump.cc (find_input_containing_global): Replace
338 magic number with symbolic constant.
339 (dump_incremental_inputs): Update version number.
340 * incremental.cc (Output_section_incremental_inputs): Update version
341 number; import symbolic constants from Incremental_inputs_reader.
342 (Incremental_inputs::create_data_sections): Align relocations
343 section correctly for 64-bit targets.
344 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
345 constants; add padding.
346 (Output_section_incremental_inputs::write_header): Add assert for
348 (Output_section_incremental_inputs::write_input_files): Add assert
349 for input_entry_size.
350 (Output_section_incremental_inputs::write_info_blocks): Add padding;
351 add assert for object_info_size, input_section_entry_size,
352 global_sym_entry_size.
353 * incremental.h (Incremental_inputs_reader): Add symbolic constants
354 for data structure sizes; use them.
355 (Incremental_input_entry_reader): Import symbolic constants from
356 Incremental_inputs_reader; use them.
358 2012-04-23 David S. Miller <davem@davemloft.net>
360 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
362 (Target_sparc::Target_sparc): Initialize new fields.
363 (Target_sparc::do_make_elf_object): New function.
364 (Target_sparc::do_adjust_elf_header): New function.
366 2012-04-23 Cary Coutant <ccoutant@google.com>
368 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
369 CU range table of gdb index.
371 2012-04-20 David S. Miller <davem@davemloft.net>
373 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
376 2012-04-16 David S. Miller <davem@davemloft.net>
378 * sparc.cc (Target_sparc::got_address): New function.
379 (Sparc_relocate_functions::gdop_hix22): New function.
380 (Sparc_relocate_functions::gdop_lox10): New function.
381 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
383 (Target_sparc::Scan::local): Likewise if the global symbol is not
384 preemptible and is not IFUNC.
385 (Target_sparc::Relocate::relocate): Perform GOTDATA code
386 transformations for local and non-preemptible non-IFUNC global
389 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
390 writing out 64-bit part of ranges.
392 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
393 -fpic and -fpie respectively.
394 * Makefile.in: Regenerate.
396 * sparc.cc (class Target_sparc): Add rela_ifunc_.
397 (Target_sparc::Target_sparc): Initialize new field.
398 (Target_sparc::do_plt_section_for_global): New function.
399 (Target_sparc::do_plt_section_for_local): New function.
400 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
401 (Target_sparc::make_plt_section): New function, broken out of
402 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
403 (Target_sparc::make_plt_entry): Call make_plt_section.
404 (Target_sparc::make_local_ifunc_plt_entry): New function.
405 (Target_sparc::rela_ifunc_section): New function.
406 (Target_sparc::plt_section): Remove const.
407 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
408 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
409 and ifunc_count_ fields.
410 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
411 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
412 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
413 (Output_data_plt_sparc::rela_ifunc): New function.
414 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
415 (Output_data_plt_sparc::has_ifunc_section): New function.
416 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
417 (Output_data_plt_sparc::address_for_global): New function.
418 (Output_data_plt_sparc::address_for_local): New function.
419 (Output_data_plt_sparc::plt_index_to_offset): New function.
420 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
422 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
424 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
425 R_SPARC_JMP_IREL to switch.
426 (Target_sparc::Scan::check_non_pic): Likewise.
427 (Target_sparc::Scan::local): Handle IFUNC symbols.
428 (Target_sparc::Scan::local): Likewise.
429 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
430 and plt_address_for_local.
431 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
432 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
434 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
435 (class Output_data_reloc): Adjust calls to Output_reloc_type.
436 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
437 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
439 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
440 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
442 * sparc.cc (Target_sparc::Scan::global): Likewise.
443 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
445 2012-04-16 Cary Coutant <ccoutant@google.com>
447 * archive.cc (Library_base::should_include_member): Check for
448 --export-dynamic-symbol.
449 * options.h (class General_options): Add --export-dynamic-symbol.
450 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
451 --export-dynamic-symbol.
452 (Symbol_table::gc_mark_undef_symbols): Likewise.
453 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
455 2012-04-12 David S. Miller <davem@davemloft.net>
457 * sparc.cc (Reloc::wdisp10): New relocation method.
458 (Reloc::h34): Likewise.
459 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
460 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
462 (Target_sparc::Scan::local): Likewise.
463 (Target_sparc::Scan::global): Likewise.
464 (Target_sparc::Relocate::relocate): Likewise.
466 2012-04-09 Cary Coutant <ccoutant@google.com>
468 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
471 2012-04-06 Ian Lance Taylor <iant@google.com>
473 * timer.cc: #include <unistd.h>.
475 2012-04-06 Roland McGrath <mcgrathr@google.com>
477 * configure.in (AC_CHECK_HEADERS): Add locale.h.
478 * config.in: Regenerate.
479 * configure: Regenerate.
481 2012-04-05 Nick Clifton <nickc@redhat.com>
483 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
484 (AM_LC_MESSAGES): Add.
485 * aclocal.m4: Regenerate.
486 * config.in: Regenerate.
487 * configure: Regenerate.
489 2012-03-21 Cary Coutant <ccoutant@google.com>
491 * Makefile.am: Add gdb-index.cc, gdb-index.h.
492 * Makefile.in: Regenerate.
493 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
494 (Sized_elf_reloc_mapper::symbol_section): New function.
495 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
496 (make_elf_reloc_mapper): New function.
497 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
498 (Dwarf_abbrev_table::do_read_abbrevs): New function.
499 (Dwarf_abbrev_table::do_get_abbrev): New function.
500 (Dwarf_ranges_table::read_ranges_table): New function.
501 (Dwarf_ranges_table::read_range_list): New function.
502 (Dwarf_pubnames_table::read_section): New function.
503 (Dwarf_pubnames_table::read_header): New function.
504 (Dwarf_pubnames_table::next_name): New function.
505 (Dwarf_die::Dwarf_die): New function.
506 (Dwarf_die::read_attributes): New function.
507 (Dwarf_die::skip_attributes): New function.
508 (Dwarf_die::set_name): New function.
509 (Dwarf_die::set_linkage_name): New function.
510 (Dwarf_die::attribute): New function.
511 (Dwarf_die::string_attribute): New function.
512 (Dwarf_die::int_attribute): New function.
513 (Dwarf_die::uint_attribute): New function.
514 (Dwarf_die::ref_attribute): New function.
515 (Dwarf_die::child_offset): New function.
516 (Dwarf_die::sibling_offset): New function.
517 (Dwarf_info_reader::check_buffer): New function.
518 (Dwarf_info_reader::parse): New function.
519 (Dwarf_info_reader::do_parse): New function.
520 (Dwarf_info_reader::do_read_string_table): New function.
521 (Dwarf_info_reader::lookup_reloc): New function.
522 (Dwarf_info_reader::get_string): New function.
523 (Dwarf_info_reader::visit_compilation_unit): New function.
524 (Dwarf_info_reader::visit_type_unit): New function.
525 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
526 Sized_elf_reloc_mapper.
527 (Sized_dwarf_line_info::symbol_section): Remove function.
528 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
529 (Sized_dwarf_line_info::read_line_mappings): Remove object
530 parameter, adjust callers.
531 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
532 * dwarf_reader.h: Include <sys/types.h>.
533 (class Track_relocs): Remove forward declaration.
534 (class Elf_reloc_mapper): New class.
535 (class Sized_elf_reloc_mapper): New class.
536 (class Dwarf_abbrev_table): New class.
537 (class Dwarf_range_list): New class.
538 (class Dwarf_ranges_table): New class.
539 (class Dwarf_pubnames_table): New class.
540 (class Dwarf_die): New class.
541 (class Dwarf_info_reader): New class.
542 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
543 (Sized_dwarf_line_info::symbol_section): Remove member function.
544 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
546 * gdb-index.cc: New source file.
547 * gdb-index.h: New source file.
548 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
549 and .debug_types sections, call Layout::add_to_gdb_index.
550 (Sized_relobj_incr::do_section_name): Implement.
551 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
552 return type; Implement.
553 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
555 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
556 parameter list and return type.
557 (Sized_incr_dynobj::do_section_contents): Likewise.
558 * layout.cc: Include gdb-index.h.
559 (Layout::Layout): Initialize gdb_index_data_.
560 (Layout::init_fixed_output_section): Check for .gdb_index section.
561 (Layout::add_to_gdb_index): New function. Instantiate.
562 * layout.h: Add forward declaration for class Gdb_index.
563 (Layout::add_to_gdb_index): New member function.
564 (Layout::gdb_index_data_): New data member.
565 * main.cc: Include gdb-index.h.
566 (main): Print statistics for gdb index.
567 * object.cc (Object::section_contents): Move code into
569 (need_decompressed_section): Check for sections needed when building
571 (build_compressed_section_map): Likewise.
572 (Sized_relobj_file::do_read_symbols): Need local symbols when building
574 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
575 sections; call Layout::add_to_gdb_index.
576 (Sized_relobj_file::do_decompressed_section_contents): Call
577 do_section_contents directly.
578 * object.h (Object::do_section_contents): Adjust parameter list and
580 (Object::do_decompressed_section_contents): Call do_section_contents
582 (Sized_relobj_file::do_section_contents): Adjust parameter list and
584 * options.h (class General_options): Add --gdb-index option.
585 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
586 list and return type.
587 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
588 * reloc.h (Track_relocs::checkpoint): New function.
589 (Track_relocs::reset): New function.
591 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
593 * testsuite/Makefile.in: Regenerate.
594 * testsuite/gdb_index_test.cc: New test source file.
595 * testsuite/gdb_index_test_1.sh: New test source file.
596 * testsuite/gdb_index_test_2.sh: New test source file.
598 2012-03-19 Doug Kwan <dougkwan@google.com>
600 * arm.cc (Target_arm::do_define_standard_symbols): New method.
601 (Target_arm::do_finalize_sections): Remove code which defines
602 __exidx_start and __exidx_end. Make symbol table parameter
603 anonymous as it is not used.
604 * gold.cc (queue_middle_tasks): Call target hook to define any
605 target-specific symbols.
606 * target.h (Target::define_standard_symbols): New method.
607 (Target::do_define_standard_symbols): Same.
608 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
609 * testsuite/Makefile.in: Regenerate.
610 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
612 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
613 relocations are generated for __exidx_start and __exidx_end.
615 2012-03-16 Doug Kwan <dougkwan@google.com>
617 * testsuite/Makefile.am: Disable test initpri3b.
618 * testsuite/Makefile.in: Regenerate.
620 2012-03-15 Doug Kwan <dougkwan@google.com>
622 * arm.cc (Target_arm::got_section): Make .got section read-only
625 2012-03-15 Ian Lance Taylor <iant@google.com>
628 * layout.cc (Layout::make_output_section): Correctly mark
629 SHT_INIT_ARRAY, et. al., as relro.
631 2012-03-14 Doug Kwan <dougkwan@google.com>
633 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
634 dynamic relocations for protected symbols in shared objects.
636 2012-03-13 Ian Lance Taylor <iant@google.com>
638 * resolve.cc (Symbol_table::resolve): When merging common symbols,
639 keep the larger alignment.
641 2012-03-12 Cary Coutant <ccoutant@google.com>
643 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
644 handling of DW_LNE_define_file.
646 2012-03-12 Cary Coutant <ccoutant@google.com>
648 * reduced_debug_output.cc
649 (Output_reduced_debug_info_section::get_die_end): Add new FORM
652 2012-02-29 Cary Coutant <ccoutant@google.com>
654 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
656 2012-02-29 Cary Coutant <ccoutant@google.com>
658 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
659 Call Object::decompressed_section_contents.
660 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
662 (Sized_dwarf_line_info::buffer_start_): New data member.
663 * merge.cc (Output_merge_data::do_add_input_section): Call
664 Object::decompressed_section_contents.
665 (Output_merge_string::do_add_input_section): Likewise.
666 * object.cc (need_decompressed_section): New function.
667 (build_compressed_section_map): Decompress sections needed later.
668 (Sized_relobj_file::do_decompressed_section_contents): New function.
669 (Sized_relobj_file::do_discard_decompressed_sections): New function.
670 * object.h (Object::decompressed_section_contents): New function.
671 (Object::discard_decompressed_sections): New function.
672 (Object::do_decompressed_section_contents): New function.
673 (Object::do_discard_decompressed_sections): New function.
674 (Compressed_section_info): New type.
675 (Compressed_section_map): Include decompressed section contents.
676 (Sized_relobj_file::do_decompressed_section_contents): New function.
677 (Sized_relobj_file::do_discard_decompressed_sections): New function.
679 2012-02-16 Cary Coutant <ccoutant@google.com>
681 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
682 * testsuite/Makefile.in: Regenerate.
684 2012-02-14 Cary Coutant <ccoutant@google.com>
686 * options.cc (General_options::finalize): Disallow -pie and -static.
688 2012-02-03 Doug Kwan <dougkwan@google.com>
690 * arm.cc (Arm_relocate_functions::abs8,
691 Arm_relocate_functions::abs16): Use
692 Bits::has_signed_unsigned_overflow32.
693 (Arm_relocate_functions::thm_abs8): Correct range of
695 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
698 2012-02-02 Doug Kwan <dougkwan@google.com>
700 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
701 position independent outputs, not just shared objects.
703 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
705 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
706 * configure: Regenerated.
708 2012-01-27 Ian Lance Taylor <iant@google.com>
710 * reloc.h (Bits): New class with static functions, copied from
711 namespace utils in arm.cc.
712 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
715 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
717 * incremental.cc (write_info_blocks): Correct relocation offset.
719 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
721 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
722 (Relocate::tls_gd_to_le): Likewise.
724 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
726 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
728 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
730 * configure.ac: Check if -mcmodel=medium works.
731 * configure: Regenerated.
733 2012-01-24 Cary Coutant <ccoutant@google.com>
735 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
737 (read_unsigned_LEB_128_x): ... this new function.
738 (read_signed_LEB_128): Replaced with inline definition and ...
739 (read_signed_LEB_128_x): ... this new function.
740 * int_encoding.h (read_unsigned_LEB_128_x): New function.
741 (read_unsigned_LEB_128): Add inline definition.
742 (read_signed_LEB_128_x): New function.
743 (read_signed_LEB_128): Add inline definition.
744 * testsuite/Makefile.am (leb128_unittest): New unit test.
745 * testsuite/Makefile.in: Regenerate.
746 * testsuite/leb128_unittest.cc: New unit test.
748 2012-01-23 Ian Lance Taylor <iant@google.com>
751 * i386.cc (Target_i386::do_code_fill): When using a jmp
752 instruction, pad with nop instructions.
753 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
755 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
757 * x86_64.cc (gc_process_relocs): Add typename on types used in
759 (scan_relocs): Likewise.
760 (relocate_section): Likewise.
761 (apply_relocation): Likewise.
763 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
765 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
766 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
769 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
771 * x86_64.cc: Initial support for x32.
773 2012-01-03 Cary Coutant <ccoutant@google.com>
775 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
776 Use abstract base class for GOT.
777 * gold/output.h (class Output_data_got_base): New abstract base class.
778 (class Output_data_got): Derive from new base class, adjust ctors.
779 (Output_data_got::reserve_slot): Make virtual; rename to
780 do_reserve_slot; Adjust callers.
781 * gold/target.h (Sized_target::init_got_plt_for_update): Return
782 pointer to abstract base class.
783 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
785 2011-12-18 Ian Lance Taylor <iant@google.com>
787 * object.h (Relobj::local_symbol_value): New function.
788 (Relobj::local_plt_offset): New function.
789 (Relobj::local_has_got_offset): New function.
790 (Relobj::local_got_offset): New function.
791 (Relobj::set_local_got_offset): New function.
792 (Relobj::do_local_symbol_value): New pure virtual function.
793 (Relobj::do_local_plt_offset): Likewise.
794 (Relobj::do_local_has_got_offset): Likewise.
795 (Relobj::do_local_got_offset): Likewise.
796 (Relobj::do_set_local_got_offset): Likewise.
797 (Sized_relobj::do_local_has_got_offset): Rename from
798 local_has_got_offset.
799 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
800 (Sized_relobj::do_set_local_got_offset): Rename from
801 set_local_got_offset.
802 (Sized_relobj_file::do_local_plt_offset): Rename from
804 (Sized_relobj_file::do_local_symbol_value): New function.
805 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
807 * output.cc (Output_data_got::Got_entry::write): Change object to
808 Relobj. Use local_symbol_value.
809 (Output_data_got::add_global_with_rel): Change rel_dyn to
810 Output_data_reloc_generic*. Use add_global_generic.
811 (Output_data_got::add_global_with_rela): Remove. Change all
812 callers to use add_global_with_rel.
813 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
814 Output_data_reloc_generic*. Use add_global_generic.
815 (Output_data_got::add_global_pair_with_rela): Remove. Change all
816 callers to use add_global_pair_with_rel.
817 (Output_data_got::add_local): Change object to Relobj*.
818 (Output_data_got::add_local_plt): Likewise.
819 (Output_data_got::add_local_with_rel): Change object to Relobj*,
820 change rel_dyn to Output_data_reloc_generic*. Use
822 (Output_data_got::add_local_with_rela): Remove. Change all
823 callers to use all_local_with_rel.
824 (Output_data_got::add_local_pair_with_rel): Change object to
825 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
826 add_output_section_generic.
827 (Output_data_got::add_local_pair_with_rela): Remove. Change all
828 callers to use add_local_pair_with_rel.
829 (Output_data_got::reserve_local): Change object to Relobj*.
830 * output.h: (class Output_data_reloc_generic): Add pure virtual
831 declarations for add_global_generic, add_local_generic,
832 add_output_section_generic.
833 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
834 functions for Output_data_reloc_generic. Update declarations for
835 changes listed in output.cc.
836 (class Output_data_got): Change template parameter to got_size.
837 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
838 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
840 (Sized_relobj_incr::do_local_plt_offset): New function.
841 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
844 2011-12-17 Cary Coutant <ccoutant@google.com>
846 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
847 * resolve.cc (Symbol_table::resolve): Likewise.
848 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
850 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
852 2011-12-16 Ian Lance Taylor <iant@google.com>
854 * output.h (Output_data_reloc_generic::add): Only call
855 add_dynamic_reloc if this is a dynamic reloc section.
857 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
860 * target-reloc.h (apply_relocation): Replace <64, false> with
863 2011-11-25 Nick Clifton <nickc@redhat.com>
865 * po/it.po: New Italian translation.
867 2011-11-17 Sterling Augustine <saugustine@google.com>
869 * script.cc (script_include_directive): Implement.
870 (read_script_file): New local variables name and search_path. Update
871 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
872 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
873 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
875 2011-11-11 Sterling Augustine <saugustine@google.com>
877 * yyscript.y (section_cmd): Add support for INCLUDE directive.
878 (file_or_sections_cmd): Likewise.
880 2011-11-11 Doug Kwan <dougkwan@google.com>
882 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
883 if --just-symbols is given.
885 2011-11-10 Doug Kwan <dougkwan@google.com>
888 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
889 when processing data relocs.
890 * reloc.h (Relocate_functions::rel_unaligned): New method.
891 (Relocate_functions::pcrel_unaligned): Ditto.
892 (Relocate_functions::rel32_unaligned): Ditto.
893 (Relocate_functions::pcrel32_unaligned): Ditto.
895 2011-11-09 Doug Kwan <dougkwan@google.com>
898 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
899 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
900 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
901 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
902 (Relocate_functions::rel_unaligned): New.
903 (Relocate_functions::rel32_unaligned): New.
904 * target-reloc.h (relocate_for_relocatable): Add code to handle
905 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
906 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
907 arm_unaligned_reloc_r): New targets.
908 * testsuite/Makefile.in: Regenerate.
909 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
912 2011-11-02 Ian Lance Taylor <iant@google.com>
914 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
916 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
917 * options.cc (General_options::finalize): Use library search path
918 from configure script if specified. If not native and no sysroot,
919 only search TOOLLIBDIR.
920 * options.h (Search_directory::Search_directory): Change name to
922 (General_options::add_to_library_path_with_sysroot): Change arg to
924 * configure, Makefile.in, config.in: Rebuild.
926 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
928 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
929 we are working around the ARM1176 Erratum.
930 * options.h (General_options::fix_arm1176): Add option.
931 * testsuite/Makefile.am: Add testcases, and keep current ones
933 * testsuite/Makefile.in: Regenerate.
934 * testsuite/arm_fix_1176.s: New file.
935 * testsuite/arm_fix_1176.sh: Likewise.
937 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
939 * arm.cc (Target_arm::Target_arm): Remove initialisation of
941 (Target_arm::may_use_blx): Remove method.
942 (Target_arm::set_may_use_blx): Likewise.
943 (Target_arm::may_use_v4t_interworking): New method.
944 (Target_arm::may_use_v5t_interworking): Likewise.
945 (Target_arm::may_use_blx_): Remove member variable.
946 (Arm_relocate_functions::arm_branch_common): Check for v5T
948 (Arm_relocate_functions::thumb_branch_common): Likewise.
949 (Reloc_stub::stub_type_for_reloc): Likewise.
950 (Target_arm::do_finalize_sections): Correct interworking checks.
951 * testsuite/Makefile.am: Add new tests.
952 * testsuite/Makefile.in: Regenerate.
953 * testsuite/arm_farcall_arm_arm.s: New test.
954 * testsuite/arm_farcall_arm_arm.sh: Likewise.
955 * testsuite/arm_farcall_arm_thumb.s: Likewise.
956 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
957 * testsuite/arm_farcall_thumb_arm.s: Likewise.
958 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
959 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
960 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
962 2011-10-31 Cary Coutant <ccoutant@google.com>
965 * expression.cc (Expression::eval_with_dot): Add
966 is_section_dot_assignment parameter.
967 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
968 absolute and assigning to dot within a section.
970 (Output_section_element_assignment::set_section_addresses): Pass
971 dot_section to set_if_absolute.
972 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
973 as is_section_dot_assignment flag to eval_with_dot.
974 (Output_section_element_dot_assignment::set_section_addresses):
976 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
977 parameter. Also set value if relative to dot_section; set the
978 symbol's output_section.
979 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
980 parameter. Adjust all callers.
981 (Expression::eval_maybe_dot): Likewise.
982 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
984 * testsuite/script_test_2.t: Test assignment of an absolute value
985 to dot within an output section element.
987 2011-10-31 Cary Coutant <ccoutant@google.com>
989 * options.h (class General_options): Add --[no-]gnu-unique options.
990 * symtab.cc (Symbol_table::sized_write_globals): Convert
991 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
993 2011-10-31 Cary Coutant <ccoutant@google.com>
996 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
997 unnecessary assertion.
998 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1000 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1002 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1004 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1006 Change to just keep the section associated with symbol.
1007 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1008 they are externally visible and --export-dynamic is turned on.
1009 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1011 2011-10-19 Ian Lance Taylor <iant@google.com>
1014 * script-sections.cc
1015 (Output_section_element_dot_assignment::needs_output_section): New
1018 2011-10-19 Ian Lance Taylor <iant@google.com>
1021 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1022 --section-start option was seen.
1023 * options.h (General_options::any_section_start): New function.
1025 2011-10-18 David S. Miller <davem@davemloft.net>
1028 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1029 member to track relocation locations that have moved during TLS
1030 reloc optimizations.
1031 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1032 (Target_sparc::Relocate::relocate): Adjust view down by 4
1033 bytes if it matches reloc_adjust_addr_.
1034 (Target_sparc::Relocate::relocate_tls): Always move the
1035 __tls_get_addr call delay slot instruction forward 4 bytes when
1036 performing relaxation.
1038 2011-10-18 Cary Coutant <ccoutant@google.com>
1040 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1041 (Output_file::map_no_anonymous): Check for non-zero
1042 return code from posix_fallocate.
1044 2011-10-17 Cary Coutant <ccoutant@google.com>
1047 * plugin.cc (is_visible_from_outside): Check for symbols
1048 referenced from dynamic objects.
1049 * resolve.cc (Symbol_table::resolve): Don't count references
1050 from dynamic objects as references from real ELF files.
1051 * testsuite/plugin_test_2.sh: Adjust expected result.
1053 2011-10-17 Cary Coutant <ccoutant@google.com>
1055 * gold.cc: Include timer.h.
1056 (queue_middle_tasks): Stamp time.
1057 (queue_final_tasks): Likewise.
1058 * main.cc (main): Store timer in parameters. Print timers
1060 * parameters.cc (Parameters::Parameters): Initialize timer_.
1061 (Parameters::set_timer): New function.
1062 (set_parameters_timer): New function.
1063 * parameters.h (Parameters::set_timer): New function.
1064 (Parameters::timer): New function.
1065 (Parameters::timer_): New data member.
1066 (set_parameters_timer): New function.
1067 * timer.cc (Timer::stamp): New function.
1068 (Timer::get_pass_time): New function.
1069 * timer.h (Timer::stamp): New function.
1070 (Timer::get_pass_time): New function.
1071 (Timer::pass_times_): New data member.
1073 2011-10-17 Cary Coutant <ccoutant@google.com>
1075 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1076 task for members of lib groups.
1078 2011-10-17 Cary Coutant <ccoutant@google.com>
1081 * fileread.cc (File_read::find_view): Add assert.
1082 (File_read::make_view): Move bounds check (replace with assert)...
1083 (File_read::find_or_make_view): ... to here.
1085 2011-10-12 Cary Coutant <ccoutant@google.com>
1087 * output.cc (Output_file::open_base_file): Handle case where
1088 ::read returns less than requested size.
1090 2011-10-10 Cary Coutant <ccoutant@google.com>
1092 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1093 Initialize defined_count_.
1094 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1095 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1096 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1097 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1098 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1099 * incremental.h (Sized_relobj_incr::defined_count_): New data
1101 (Sized_incr_dynobj::defined_count_): New data member.
1102 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1103 Return zeroes instead of internal error.
1105 2011-10-10 Cary Coutant <ccoutant@google.com>
1108 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1109 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1110 * output.h (class Output_reloc): Add use_plt_offset flag.
1111 (Output_reloc::type_): Adjust size of bit field.
1112 (Output_reloc::use_plt_offset_): New bit field.
1113 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1114 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1115 flag. Adjust all callers.
1116 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1117 creating RELATIVE relocations.
1119 2011-10-10 Nick Clifton <nickc@redhat.com>
1121 * po/es.po: Updated Spanish translation.
1122 * po/fi.po: Updated Finnish translation.
1124 2011-10-03 Diego Novillo <dnovillo@google.com>
1126 * options.cc (parse_uint): Fix dereference of RETVAL.
1128 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1130 * layout.h (section_order_map_): New member.
1131 (get_section_order_map): New member function.
1132 * output.cc (Output_section::add_input_section): Check for patterns
1133 only when --section-ordering-file is specified.
1134 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1135 output_sections have been formed.
1136 * layout.cc (Layout_Layout): Initialize section_order_map_.
1137 * plugin.cc (update_section_order): Store order in order_map. Do not
1139 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1140 * testsuite/Makefile.in: Regenerate.
1141 * testsuite/plugin_section_order.c: New file.
1142 * testsuite/plugin_final_layout.cc: New file.
1143 * testsuite/plugin_final_layout.sh: New file.
1145 2011-09-29 Cary Coutant <ccoutant@google.com>
1147 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1149 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1150 symbols during incremental update.
1151 (Symbol_table::add_from_dynobj): Likewise.
1153 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1154 Ian Lance Taylor <iant@google.com>
1156 * symtab.cc (Symbol_table::define_special_symbol): Always
1157 canonicalize version string.
1159 2011-09-26 Cary Coutant <ccoutant@google.com>
1161 * gold.cc (queue_initial_tasks): Move option checks ...
1162 * options.cc (General_options::finalize): ... to here. Disable
1163 some options; make others fatal.
1165 2011-09-26 Cary Coutant <ccoutant@google.com>
1168 * plugin.cc (get_symbols_v2): New function.
1169 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1170 (is_referenced_from_outside): New function.
1171 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1172 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1173 (get_symbols): Pass version parameter.
1174 (get_symbols_v2): New function.
1175 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1177 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1178 (onload): Add LDPT_GET_SYMBOLS_V2.
1179 (all_symbols_read_hook): Use get_symbols_v2; check for
1180 LDPR_PREVAILING_DEF_IRONLY_EXP.
1181 * testsuite/plugin_test_3.sh: Update expected results.
1183 2011-09-23 Simon Baldwin <simonb@google.com>
1185 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1186 configuration options.
1187 * configure: Regenerate.
1188 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1189 * Makefile.in: Regenerate.
1190 * testsuite/Makefile.in: Regenerate.
1192 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1194 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1196 2011-09-19 Cary Coutant <ccoutant@google.com>
1198 * incremental.cc (can_incremental_update): Fix typo in comment.
1199 * incremental.h (can_incremental_update): Likewise.
1201 2011-09-18 Cary Coutant <ccoutant@google.com>
1203 * incremental.cc (can_incremental_update): New function.
1204 * incremental.h (can_incremental_update): New function.
1205 * layout.cc (Layout::init_fixed_output_section): Call it.
1206 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1207 * object.cc (Sized_relobj_file::do_layout): Call
1208 can_incremental_update.
1210 2011-09-13 Cary Coutant <ccoutant@google.com>
1212 * configure.ac: Check for glibc support for gnu_indirect_function
1213 support with static linking, setting automake conditional
1215 * Makefile.in: Regenerate.
1216 * configure: Regenerate.
1218 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1219 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1221 * testsuite/Makefile.in: Regenerate.
1223 2011-09-13 Cary Coutant <ccoutant@google.com>
1225 * incremental.cc (Sized_relobj_incr::do_layout): Call
1226 report_comdat_group for kept comdat sections.
1227 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1228 * testsuite/Makefile.in: Regenerate.
1229 * testsuite/incr_comdat_test_1.cc: New source file.
1230 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1231 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1232 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1234 2011-09-13 Ian Lance Taylor <iant@google.com>
1236 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1237 variable external_symbols_offset.
1239 2011-09-12 Ian Lance Taylor <iant@google.com>
1241 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1242 triggered if object has no symbols.
1244 2011-09-09 David S. Miller <davem@davemloft.net>
1246 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1247 (Output_fill_debug_line::do_write): Likewise.
1249 2011-08-29 Cary Coutant <ccoutant@google.com>
1251 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1252 casts to match formatting specs.
1253 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1255 2011-08-26 Cary Coutant <ccoutant@google.com>
1257 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1258 remaining hole size when allocating.
1259 (Layout::make_output_section): Set fill methods for debug sections.
1260 * layout.h (Free_list::Free_list_node): Move from private to
1262 (Free_list::set_min_hole_size): New function.
1263 (Free_list::begin, Free_list::end): New functions.
1264 (Free_list::min_hole_): New data member.
1265 * output.cc: Include dwarf.h.
1266 (Output_fill_debug_info::do_minimum_hole_size): New function.
1267 (Output_fill_debug_info::do_write): New function.
1268 (Output_fill_debug_line::do_minimum_hole_size): New function.
1269 (Output_fill_debug_line::do_write): New function.
1270 (Output_section::Output_section): Initialize new data member.
1271 (Output_section::set_final_data_size): Ensure patch space is larger
1272 than minimum hole size.
1273 (Output_section::do_write): Fill holes in debug sections.
1274 * output.h (Output_fill): New class.
1275 (Output_fill_debug_info): New class.
1276 (Output_fill_debug_line): New class.
1277 (Output_section::set_free_space_fill): New function.
1278 (Output_section::free_space_fill_): New data member.
1279 * testsuite/Makefile.am (incremental_test_3): Add
1280 --incremental-patch option.
1281 (incremental_test_4): Likewise.
1282 (incremental_test_5): Likewise.
1283 (incremental_test_6): Likewise.
1284 (incremental_copy_test): Likewise.
1285 (incremental_common_test_1): Likewise.
1286 * testsuite/Makefile.in: Regenerate.
1288 2011-08-26 Nick Clifton <nickc@redhat.com>
1290 * po/es.po: Updated Spanish translation.
1292 2011-08-01 Cary Coutant <ccoutant@google.com>
1294 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1295 * gold/testsuite/Makefile.in: Regenerate.
1296 * gold/testsuite/justsyms_exec.c: New source file.
1297 * gold/testsuite/justsyms_lib.c: New source file.
1299 2011-08-01 Cary Coutant <ccoutant@google.com>
1301 * layout.cc (Layout::set_segment_offsets): Don't realign text
1302 segment if -Ttext was specified.
1303 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1305 * object.h (Sized_relobj_file::e_type): New function.
1306 (Sized_relobj_file::e_type_): New data member.
1307 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1308 base address for ET_EXEC files.
1309 * target.cc (Target::do_make_elf_object_implementation): Allow
1310 ET_EXEC files with --just-symbols option.
1312 2011-07-28 Cary Coutant <ccoutant@google.com>
1314 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1315 Add thread_number parameter.
1316 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1317 * workqueue-threads.cc
1318 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1319 current thread if its thread number is greater than desired thread
1321 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1322 Add thread_number parameter.
1323 (Workqueue::should_cancel_thread): Likewise.
1324 (Workqueue::find_runnable_or_wait): Pass thread_number to
1325 should_cancel_thread.
1326 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1329 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1331 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1332 only after checking if it cannot be forced local.
1333 * symtab.h (is_externally_visible): Check if the symbol is not forced
1336 2011-07-15 Ian Lance Taylor <iant@google.com>
1338 * options.h (class General_options): Add --print-output-format.
1339 Move -EL next to -EB, for better --help output.
1340 * target-select.cc: Include <cstdio>, "options.h", and
1342 (Target_selector::do_target_bfd_name): New function.
1343 (print_output_format): New function.
1344 * target-select.h (class Target_selector): Update declarations.
1345 (Target_selector::target_bfd_name): New function.
1346 (print_output_format): Declare.
1347 * main.cc: Include "target-select.h".
1348 (main): Handle --print-output-format.
1349 * gold.cc: Include "target-select.h".
1350 (queue_initial_tasks): Handle --print-output-format when there are
1352 * parameters.cc (parameters_force_valid_target): Give a better
1353 error message if -EB/-EL does not match target.
1354 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1357 2011-07-15 Ian Lance Taylor <iant@google.com>
1359 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1360 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1361 (Output_data_plt_i386::do_write): Write address of .dynamic
1362 section to first entry in .got.plt section.
1363 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1364 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1366 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1367 section to first entry in .got.plt section.
1368 * layout.h (Layout::dynamic_section): New function.
1370 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1372 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1374 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1375 input_section_position_, and input_section_glob_.
1376 (read_layout_from_file): Call function section_ordering_specified.
1377 * layout.h (is_section_ordering_specified): New function.
1378 (section_ordering_specified): New function.
1379 (section_ordering_specified_): New boolean member.
1380 * main.cc(main): Call load_plugins after layout object is defined.
1381 * output.cc (Output_section::add_input_section): Use
1382 function section_ordering_specified to check if section ordering is
1384 * output.cc (Output_section::add_relaxed_input_section): Use
1385 function section_ordering_specified to check if section ordering is
1387 (Output_section::update_section_layout): New function.
1388 (Output_section::sort_attached_input_sections): Check if input section
1390 * output.h (Output_section::update_section_layout): New function.
1391 * plugin.cc (get_section_count): New function.
1392 (get_section_type): New function.
1393 (get_section_name): New function.
1394 (get_section_contents): New function.
1395 (update_section_order): New function.
1396 (allow_section_ordering): New function.
1397 (Plugin::load): Add the new interfaces to the transfer vector.
1398 (Plugin_manager::load_plugins): New parameter.
1399 (Plugin_manager::all_symbols_read): New parameter.
1400 (Plugin_manager::claim_file): New parameter. Save the elf object for
1402 (Plugin_manager::get_elf_object): New function.
1403 (Plugin_manager::get_view): Change to directly use the bool to check
1404 if get_view is called from claim_file_hook.
1405 * plugin.h (input_objects): New function
1406 (Plugin__manager::load_plugins): New parameter.
1407 (Plugin_manager::claim_file): New parameter.
1408 (Plugin_manager::get_elf_object): New function.
1409 (Plugin_manager::in_claim_file_handler): New function.
1410 (Plugin_manager::in_claim_file_handler_): New member.
1411 (layout): New function.
1412 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1413 handler with an extra parameter. Make the elf object before calling
1415 * testsuite/plugin_test.c (get_section_count): New function pointer.
1416 (get_section_type): New function pointer.
1417 (get_section_name): New function pointer.
1418 (get_section_contents): New function pointer.
1419 (update_section_order): New function pointer.
1420 (allow_section_ordering): New function pointer.
1421 (onload): Check if the new interfaces exist.
1423 2011-07-13 Ian Lance Taylor <iant@google.com>
1425 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1427 * x86_64.cc (Target_x86_64::got_section): Likewise.
1428 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1429 (relro_now_test_SOURCES): New variable.
1430 (relro_now_test_DEPENDENCIES): New variable.
1431 (relro_now_test_LDFLAGS): New variable.
1432 (relro_now_test_LDADD): New variable.
1433 (relro_now_test.so): New target.
1434 * testsuite/Makefile.in: Rebuild.
1436 2011-07-12 Ian Lance Taylor <iant@google.com>
1439 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1440 GLOB_DAT relocation rather than a RELATIVE relocation for a
1441 protected symbol when creating a shared library.
1442 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1443 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1444 * testsuite/protected_main_1.cc (main): Test that protected
1445 function has same address.
1447 2011-07-11 Ian Lance Taylor <iant@google.com>
1450 * options.h (class General_options): Add -Bgroup.
1451 * options.cc (General_options::finalize): If -Bgroup is set,
1452 default to --unresolved-symbols=report-all.
1453 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1454 * target-reloc.h (issue_undefined_symbol_error): Handle
1455 --unresolved-symbols=report-all.
1457 2011-07-08 Ian Lance Taylor <iant@google.com>
1460 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1461 if linker script discards key sections.
1462 (Layout::create_dynamic_symtab): Likewise.
1463 (Layout::assign_local_dynsym_offsets): Likewise.
1464 (Layout::sized_create_version_sections): Likewise.
1465 (Layout::create_interp): Likewise.
1466 (Layout::finish_dynamic_section): Likewise.
1467 (Layout::set_dynamic_symbol_size): Likewise.
1469 2011-07-08 Ian Lance Taylor <iant@google.com>
1472 * options.h (class General_options): Add --unresolved-symbols.
1473 * target-reloc.h (issue_undefined_symbol_error): Check
1474 --unresolved-symbols. Add comments.
1476 2011-07-08 Ian Lance Taylor <iant@google.com>
1478 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1479 expression more complex.
1481 2011-07-08 Ian Lance Taylor <iant@google.com>
1484 * target-reloc.h (issue_undefined_symbol_error): New inline
1485 function, broken out of relocate_section.
1486 (relocate_section): Call issue_undefined_symbol_error.
1487 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1488 there is no TLS segment if we are about to issue an undefined
1490 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1492 2011-07-08 Ian Lance Taylor <iant@google.com>
1495 * resolve.cc (Symbol_table::should_override): Add fromtype
1496 parameter. Change all callers. Give error when linking together
1497 TLS and non-TLS symbol.
1498 (Symbol_table::should_override_with_special): Add fromtype
1499 parameter. Change all callers.
1500 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1501 there is no TLS segment if we have reported some errors.
1502 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1504 2011-07-08 Ian Lance Taylor <iant@google.com>
1507 * target.h (Target::plt_address_for_global): New function.
1508 (Target::plt_address_for_local): New function.
1509 (Target::plt_section_for_global): Remove.
1510 (Target::plt_section_for_local): Remove.
1511 (Target::do_plt_address_for_global): New virtual function.
1512 (Target::do_plt_address_for_local): New virtual function.
1513 (Target::do_plt_section_for_global): Remove.
1514 (Target::do_plt_section_for_local): Remove.
1515 (Target::register_global_plt_entry): Add Symbol_table and Layout
1517 * output.cc (Output_data_got::Got_entry::write): Use
1518 plt_address_for_global and plt_address_for_local.
1519 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1520 address of output section.
1521 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1522 got_irelative_, and irelative_count_ fields. Update
1524 (Output_data_plt_i386::has_irelative_section): New function.
1525 (Output_data_plt_i386::entry_count): Add irelative_count_.
1526 (Output_data_plt_i386::set_final_data_size): Likewise.
1527 (class Target_i386): Add got_irelative_ and rel_irelative_
1528 fields. Update declarations.
1529 (Target_i386::Target_i386): Initialize new fields.
1530 (Target_i386::do_plt_address_for_global): New function replacing
1531 do_plt_section_for_global.
1532 (Target_i386::do_plt_address_for_local): New function replacing
1533 do_plt_section_for_local.
1534 (Target_i386::got_section): Create got_irelative_.
1535 (Target_i386::rel_irelative_section): New function.
1536 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1537 fields. Don't define __rel_iplt_{start,end}.
1538 (Output_data_plt_i386::add_entry): Add symtab and layout
1539 parameters. Change all callers. Use different PLT and GOT for
1541 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1542 layout parameters. Change all callers. Use different PLT and
1544 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1545 (Output_data_plt_i386::rel_irelative): New function.
1546 (Output_data_plt_i386::address_for_global): New function.
1547 (Output_data_plt_i386::address_for_local): New function.
1548 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1549 IRELATIVE GOT when changing IFUNC GOT entries.
1550 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1552 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1553 if we didn't create an IRELATIVE GOT.
1554 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1555 plt_address_for_local.
1556 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1557 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1558 got_irelative_, and irelative_count_ fields. Update
1560 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1561 Initialize new fields. Remove symtab parameter. Change all
1563 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1565 (Output_data_plt_x86_64::has_irelative_section): New function.
1566 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1567 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1568 fields. Update declarations.
1569 (Target_x86_64::Target_x86_64): Initialize new fields.
1570 (Target_x86_64::do_plt_address_for_global): New function replacing
1571 do_plt_section_for_global.
1572 (Target_x86_64::do_plt_address_for_local): New function replacing
1573 do_plt_section_for_local.
1574 (Target_x86_64::got_section): Create got_irelative_.
1575 (Target_x86_64::rela_irelative_section): New function.
1576 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1577 all callers. Don't create __rel_iplt_{start,end}.
1578 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1579 parameters. Change all callers. Use different PLT and GOT for
1581 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1582 layout parameters. Change all callers. Use different PLT and
1584 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1585 parameters. Change all callers. Use different PLT and GOT for
1587 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1588 (Output_data_plt_x86_64::rela_irelative): New function.
1589 (Output_data_plt_x86_64::address_for_global): New function.
1590 (Output_data_plt_x86_64::address_for_local): New function.
1591 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1592 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1593 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1594 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1596 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1598 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1599 symbols if we didn't create an IRELATIVE GOT.
1600 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1601 plt_address_for_local.
1602 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1603 * testsuite/ifuncvar1.c: New test file.
1604 * testsuite/ifuncvar2.c: New test file.
1605 * testsuite/ifuncvar3.c: New test file.
1606 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1607 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1608 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1609 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1610 * testsuite/Makefile.in: Rebuild.
1612 2011-07-07 Cary Coutant <ccoutant@google.com>
1614 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1615 (two_file_test_1_ndebug.o): Likewise.
1616 (two_file_test_1b_ndebug.o): Likewise.
1617 (two_file_test_2_ndebug.o): Likewise.
1618 (two_file_test_main_ndebug.o): Likewise.
1619 (incremental_test_2): Link with no-debug versions.
1621 2011-07-06 Cary Coutant <ccoutant@google.com>
1623 * gold/incremental.cc
1624 (Output_section_incremental_inputs::write_info_blocks): Check for
1625 hidden and internal symbols.
1627 2011-07-06 Cary Coutant <ccoutant@google.com>
1629 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1630 Check disposition for startup file.
1631 (Incremental_inputs::report_command_line): Ignore
1632 --incremental-startup-unchanged option.
1633 * options.cc (General_options::parse_incremental_startup_unchanged):
1635 (General_options::General_options): Initialize new data member.
1636 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1637 (General_options): Add --incremental-startup-unchanged option.
1638 (General_options::incremental_startup_disposition): New function.
1639 (General_options::incremental_startup_disposition_): New data member.
1641 2011-07-06 Cary Coutant <ccoutant@google.com>
1643 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1644 input file index to Script_info ctor.
1645 (Sized_incremental_binary::do_file_has_changed): Find the
1646 command-line argument for files named in scripts.
1647 * incremental.h (Script_info::Script_info): New ctor
1648 with input file index.
1649 (Script_info::input_file_index): New function.
1650 (Script_info::input_file_index_): New data member.
1651 (Incremental_binary::get_library): Add const.
1652 (Incremental_binary::get_script_info): Add const.
1653 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1654 * testsuite/Makefile.am (incremental_test_5): New test case.
1655 (incremental_test_6): New test case.
1656 * testsuite/Makefile.in: Regenerate.
1658 2011-07-06 Cary Coutant <ccoutant@google.com>
1660 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1661 debug output when command lines differ.
1663 2011-07-06 Cary Coutant <ccoutant@google.com>
1665 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1666 --incremental-patch option.
1667 * layout.cc (Free_list::allocate): Extend allocation beyond original
1669 (Layout::make_output_section): Mark sections that should get
1671 * options.cc (parse_percent): New function.
1672 * options.h (parse_percent): New function.
1673 (DEFINE_percent): New macro.
1674 (General_options): Add --incremental-patch option.
1675 * output.cc (Output_section::Output_section): Initialize new data
1677 (Output_section::add_input_section): Print section name when out
1679 (Output_section::add_output_section_data): Likewise.
1680 (Output_section::set_final_data_size): Add patch space when
1681 doing --incremental-full.
1682 (Output_section::do_reset_address_and_file_offset): Remove patch
1684 (Output_segment::set_section_list_addresses): Print debug output
1685 only if --incremental-update.
1686 * output.h (Output_section::set_is_patch_space_allowed): New function.
1687 (Output_section::is_patch_space_allowed_): New data member.
1688 (Output_section::patch_space_): New data member.
1689 * parameters.cc (Parameters::incremental_full): New function.
1690 * parameters.h (Parameters::incremental_full): New function
1691 * testsuite/Makefile.am (incremental_test_2): Add test for
1692 --incremental-patch option.
1693 * testsuite/Makefile.in: Regenerate.
1694 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1695 (t18): Remove function body.
1697 2011-07-05 Doug Kwan <dougkwan@google.com>
1700 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1701 Arm_Address type for relocation result.
1702 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1704 (Arm_relocate_functions::abs32): Use unaligned access.
1705 (Arm_relocate_functions::rel32): Ditto.
1706 (Arm_relocate_functions::prel31): Ditto.
1707 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1708 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1709 static data relocations.
1710 * testsuite/Makefile.in: Regnerate.
1711 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1713 2011-07-05 Ian Lance Taylor <iant@google.com>
1716 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1717 symbols if necessary.
1718 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1720 2011-07-05 Ian Lance Taylor <iant@google.com>
1723 * resolve.cc (Symbol::override_base_with_special): Simply override
1724 version with special symbol version, ignoring previous version.
1726 2011-07-05 Ian Lance Taylor <iant@google.com>
1728 * object.cc (Sized_relobj_file::include_section_group): Add
1729 information to comment about signature location.
1731 2011-07-02 Ian Lance Taylor <iant@google.com>
1734 * options.h (class General_options): Add -f and -F.
1735 * options.cc (General_options::finalize): Fatal error if -f/-F
1736 are used without -shared.
1737 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1739 2011-07-02 Ian Lance Taylor <iant@google.com>
1741 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1743 2011-07-01 Ian Lance Taylor <iant@google.com>
1747 * resolve.cc (Symbol::override_base_with_special): Don't override
1748 the version if the overriding symbol has a different name.
1749 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1750 all callers. If we give an error about an undefined version,
1751 define the base version if necessary.
1752 * dynobj.h (class Versions): Update declaration.
1753 * testsuite/weak_alias_test_5.cc: New file.
1754 * testsuite/weak_alias_test.script: New file.
1755 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1756 and versioned_alias have the right value, and call t2.
1757 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1758 weak_alias_test_5.so.
1759 (weak_alias_test_LDADD): Likewise.
1760 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1761 * testsuite/Makefile.in: Rebuild.
1763 2011-07-01 Ian Lance Taylor <iant@google.com>
1766 * options.h (class General_options): Support -z notext.
1767 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1769 (two_file_shared_nonpic.so): Likewise.
1770 (two_file_shared_mixed.so): Likewise.
1771 (two_file_shared_mixed_1.so): Likewise.
1772 (weak_undef_lib_nonpic.so): Likewise.
1773 (alt/weak_undef_lib_nonpic.so): Likewise.
1774 (tls_test_shared_nonpic.so): Likewise.
1775 * testsuite/Makefile.in: Rebuild.
1777 2011-07-01 Ian Lance Taylor <iant@google.com>
1780 * configure.ac: Test whether static linking works, setting
1781 the automake conditional HAVE_STATIC.
1782 * testsuite/Makefile.am: Disable tests using -static if
1783 HAVE_STATIC is not true.
1784 * configure, testsuite/Makefile.in: Rebuild.
1786 2011-07-01 Ian Lance Taylor <iant@google.com>
1789 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1790 Assert if we see DW_EH_PE_indirect.
1791 * target.h (Target::ehframe_datarel_base): New function.
1792 (Target::do_ehframe_datarel_base): New target function.
1793 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1794 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1797 2011-07-01 Ian Lance Taylor <iant@google.com>
1800 * options.h (class General_options): Add
1801 --ld-generated-unwind-info.
1802 * ehframe.cc (Fde::write): Add address parameter. Change all
1803 callers. If associated with PLT, fill in address and size.
1804 (Cie::set_output_offset): Only add merge mapping if there is an
1806 (Cie::write): Add address parameter. Change all callers.
1807 (Eh_frame::add_ehframe_for_plt): New function.
1808 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1809 input_offset_ fields into union u_, with new plt field.
1810 (Fde::Fde): Adjust for new union field.
1811 (Fde::Fde) [Output_data version]: New constructor.
1812 (Fde::add_mapping): Only add merge mapping if there is an object.
1813 (class Cie): Update declarations.
1814 (class Eh_frame): Declare add_ehframe_for_plt.
1815 * layout.cc (Layout::layout_eh_frame): Break out code into
1816 make_eh_frame_section, and call it.
1817 (Layout::make_eh_frame_section): New function.
1818 (Layout::add_eh_frame_for_plt): New function.
1819 * layout.h (class Layout): Update declarations.
1820 * merge.cc (Merge_map::add_mapping): Add assertion.
1821 * i386.cc: Include "dwarf.h".
1822 (class Output_data_plt_i386): Make first_plt_entry,
1823 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1824 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1825 and plt_eh_frame_fde.
1826 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1827 boundary. Call add_eh_frame_for_plt if appropriate.
1828 * x86_64.cc: Include "dwarf.h".
1829 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1830 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1831 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1832 and plt_eh_frame_fde.
1833 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1836 2011-06-29 Ian Lance Taylor <iant@google.com>
1839 * object.cc (Sized_relobj_file::layout_section): Change shdr
1840 parameter to be const.
1841 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1843 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1844 appropriate. Call layout_eh_frame_section.
1845 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1847 * object.h (class Sized_relobj_file): Update declarations.
1849 2011-06-29 Ian Lance Taylor <iant@google.com>
1852 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1854 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1856 2011-06-29 Ian Lance Taylor <iant@google.com>
1859 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1861 * layout.cc (Layout::layout_eh_frame): Likewise.
1863 2011-06-29 Ian Lance Taylor <iant@google.com>
1866 * layout.cc (Layout::symtab_section_shndx): New function.
1867 * layout.h (class Layout): Declare symtab_section_shndx.
1868 * output.cc (Output_section::write_header): Call it.
1870 2011-06-29 Ian Lance Taylor <iant@google.com>
1873 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1874 symbols which are not used in a relocation.
1876 2011-06-28 Ian Lance Taylor <iant@google.com>
1879 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1880 script create indistinguishable segments.
1881 (Layout::set_segment_offsets): Use stable_sort when sorting
1882 segments. Pass this to Compare_segments constructor.
1883 * layout.h (class Layout): Make segment_precedes non-static.
1884 (class Compare_segments): Change from struct to class. Add
1885 layout_ field. Add constructor.
1886 * script-sections.cc
1887 (Script_sections::attach_sections_using_phdrs_clause): Rename
1888 local orphan to is_orphan. Don't report failure to put empty
1889 section in segment. On attachment failure, report name of
1890 section, and attach to first PT_LOAD segment.
1892 2011-06-28 Ian Lance Taylor <iant@google.com>
1895 * target-select.cc (Target_selector::Target_selector): Add
1896 emulation parameter. Change all callers.
1897 (select_target_by_bfd_name): Rename from select_target_by_name.
1899 (select_target_by_emulation): New function.
1900 (supported_emulation_names): New function.
1901 * target-select.h (class Target_selector): Add emulation_ field.
1902 Update declarations.
1903 (Target_selector::recognize_by_bfd_name): Rename from
1904 recognize_by_name. Change all callers.
1905 (Target_selector::supported_bfd_names): Rename from
1906 supported_names. Change all callers.
1907 (Target_selector::recognize_by_emulation): New function.
1908 (Target_selector::supported_emulations): New function.
1909 (Target_selector::emulation): New function.
1910 (Target_selector::do_recognize_by_bfd_name): Rename from
1911 do_recognize_by_name. Change all callers.
1912 (Target_selector::do_supported_bfd_names): Rename from
1913 do_supported_names. Change all callers.
1914 (Target_selector::do_recognize_by_emulation): New function.
1915 (Target_selector::do_supported_emulations): New function.
1916 (select_target_by_bfd_name): Change name in declaration.
1917 (select_target_by_emulation): Declare.
1918 (supported_emulation_names): Declare.
1919 * parameters.cc (parameters_force_valid_target): Try to find
1920 target based on emulation from -m option.
1921 * options.h (class General_options): Change doc string for -m.
1922 * options.cc (help): Print emulations.
1923 (General_options::parse_V): Likewise.
1924 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1925 Add emulation parameter. Change all callers.
1927 2011-06-28 Ian Lance Taylor <iant@google.com>
1929 * target.h (class Target): Add osabi_ field.
1930 (Target::osabi): New function.
1931 (Target::set_osabi): New function.
1932 (Target::Target): Initialize osabi_.
1933 (Target::do_adjust_elf_header): Make pure virtual.
1934 (Sized_target::do_adjust_elf_header): Declare.
1935 * target.cc (Sized_target::do_adjust_elf_header): New function.
1936 (class Sized_target): Instantiate all versions.
1937 * freebsd.h (class Target_freebsd): Remove.
1938 (Target_selector_freebsd::do_recognize): Call set_osabi on
1940 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1941 (Target_selector_freebsd::set_osabi): Remove.
1942 * i386.cc (class Target_i386): Inherit from Sized_target rather
1943 than Target_freebsd.
1944 * x86_64.cc (class Target_x86_64): Likewise.
1946 2011-06-28 Ian Lance Taylor <iant@google.com>
1948 * target.h (Target::can_check_for_function_pointers): Rewrite.
1950 (Target::can_icf_inline_merge_sections): Likewise.
1951 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1952 (Target::Target_info): Add can_icf_inline_merge_sections field.
1953 (Target::do_can_check_for_function_pointers): New virtual
1955 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1956 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1957 from can_check_for_function_pointers, move in file.
1958 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1959 section_may_have_icf_unsafe_poineters, move in file.
1960 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1961 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1962 Rename from can_check_for_function_pointers, move in file.
1963 (Target_i386::can_icf_inline_merge_sections): Remove.
1964 (Target_i386::i386_info): Initialize
1965 can_icf_inline_merge_sections.
1966 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1967 Initialize can_icf_inline_merge_sections.
1968 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1969 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1970 Rename from can_check_for_function_pointers, move in file.
1971 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1972 (Target_x86_64::x86_64_info): Initialize
1973 can_icf_inline_merge_sections.
1974 * testsuite/testfile.cc (Target_test::test_target_info):
1976 * icf.cc (get_section_contents): Correct formatting.
1978 2011-06-27 Ian Lance Taylor <iant@google.com>
1980 * symtab.cc (Symbol::versioned_name): New function.
1981 (Symbol_table::add_to_final_symtab): Use versioned_name when
1983 (Symbol_table::sized_write_symbol): Likewise.
1984 * symtab.h (class Symbol): Declare versioned_name.
1985 * stringpool.h (class Stringpool_template): Add variant of add
1986 which takes a std::basic_string.
1987 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1988 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1989 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1990 (ver_test_12.o): New target.
1991 * testsuite/Makefile.in: Rebuild.
1993 2011-06-27 Doug Kwan <dougkwan@google.com>
1995 * arm.cc (Arm_relocate_functions::thm_jump8,
1996 Arm_relocate_functions::thm_jump11): Use a wider signed
1997 type to compute offset.
1998 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2000 * testsuite/Makefile.in: Regenerate.
2001 * testsuite/arm_branch_in_range.sh: Check test results of
2002 arm_thm_jump11 and arm_thm_jump8.
2003 * testsuite/arm_thm_jump11.s: New test source file.
2004 * testsuite/arm_thm_jump11.t: New linker script.
2005 * testsuite/arm_thm_jump8.s: New test source file.
2006 * testsuite/arm_thm_jump8.t: New linker script.
2008 2011-06-24 Ian Lance Taylor <iant@google.com>
2010 * layout.cc: Include "object.h".
2011 (ctors_sections_in_init_array): New static variable.
2012 (Layout::is_ctors_in_init_array): New function.
2013 (Layout::layout): Add entry to ctors_sections_in_init_array if
2015 * layout.h (class Layout): Declare is_ctors_in_init_array.
2016 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2017 is_ctors_reverse_view is set.
2018 (Sized_relobj_file::write_sections): Add layout parameter. Change
2019 all callers. Set is_ctors_reverse_view field of View_size.
2020 (Sized_relobj_file::reverse_words): New function.
2021 * object.h (Sized_relobj_file::View_size): Add
2022 is_ctors_reverse_view field.
2023 (class Sized_relobj_file): Update declarations.
2024 * testsuite/initpri3.c: New test.
2025 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2027 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2028 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2029 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2030 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2031 * testsuite/Makefile.in: Rebuild.
2033 2011-06-24 Cary Coutant <ccoutant@google.com>
2035 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2036 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2037 (debug_msg_cdebug.err): New targets.
2038 * testsuite/Makefile.in: Regenerate.
2039 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2040 Fix checks for link with shared library.
2042 2011-06-24 Doug Kwan <dougkwan@google.com>
2044 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2045 skip empty text sections.
2046 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2048 2011-06-22 Ian Lance Taylor <iant@google.com>
2051 * options.h (class General_options): Add --ctors-in-init-array.
2052 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2053 friends as SHT_PROGBITS for merging sections.
2054 (Layout::layout): Remove special handling of .init_array and
2055 friends. Don't sort if doing relocatable link. Sort for .ctors
2056 and .dtors if ctors_in_init_array.
2057 (Layout::make_output_section): Force correct section types for
2058 .init_array and friends. Don't sort if doing relocatable link,
2059 Don't sort .ctors and .dtors if ctors_in_init_array.
2060 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2061 (Layout::output_section_name): Add relobj parameter. Change all
2062 callers. Handle .ctors. and .dtors. in code rather than table.
2063 Handle .ctors and .dtors if ctors_in_init_array.
2064 (Layout::match_file_name): New function, moved from output.cc.
2065 * layout.h (class Layout): Update declarations.
2066 * output.cc: Include "layout.h".
2067 (Input_section_sort_entry::get_priority): New function.
2068 (Input_section_sort_entry::match_file_name): Just call
2069 Layout::match_file_name.
2070 (Output_section::Input_section_sort_init_fini_compare::operator()):
2071 Handle .ctors and .dtors. Sort by explicit priority rather than
2073 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2074 * testsuite/initpri2.c: New test.
2075 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2076 (check_PROGRAMS): Add initpri2.
2077 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2078 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2079 * configure, testsuite/Makefile.in: Rebuild.
2081 2011-06-19 Ian Lance Taylor <iant@google.com>
2084 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2085 .interp section to a PT_INTERP segment even if we have seen a
2086 --dynamic-linker option. Don't do it if we have seen a PHDRS
2087 clause in a linker script.
2088 (Layout::finalize): Don't create a .interp section if we've
2089 already create a PT_INTERP segment.
2090 (Layout::create_interp): Always call choose_output_section (revert
2091 patch of 2011-06-17). Don't create PT_INTERP segment.
2092 * script-sections.cc
2093 (Script_sections::create_note_and_tls_segments): Add a .interp
2094 section to a PT_INTERP segment even if we have seen a
2095 --dynamic-linker option.
2097 2011-06-18 Ian Lance Taylor <iant@google.com>
2099 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2100 merely because a non-PT_LOAD segment has a dynamic reloc.
2102 2011-06-18 Ian Lance Taylor <iant@google.com>
2104 * layout.cc (Layout::finish_dynamic_section): Don't create
2105 DT_FLAGS entry if not needed.
2107 2011-06-18 Ian Lance Taylor <iant@google.com>
2110 * layout.cc (Layout::layout_eh_frame): Correct handling of
2111 writable .eh_frame section.
2113 2011-06-17 Ian Lance Taylor <iant@google.com>
2116 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2117 symbol is redefined with the exact same object and value.
2119 2011-06-17 Ian Lance Taylor <iant@google.com>
2122 * layout.h (class Layout): Add interp_segment_ field.
2123 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2124 (Layout::attach_allocated_section_to_segment): If making shared
2125 library, put .interp section in PT_INTERP segment.
2126 (Layout::finalize): Also call create_interp if -dynamic-linker
2128 (Layout::create_interp): Assert that there is no PT_INTERP
2129 segment. If not using a SECTIONS clause, use make_output_section.
2130 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2131 * script-sections.cc
2132 (Script_sections::create_note_and_tls_segments): If making shared
2133 library, put .interp section in PT_INTERP segment.
2135 2011-06-17 Ian Lance Taylor <iant@google.com>
2137 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2138 when making a shared library.
2140 2011-06-17 Ian Lance Taylor <iant@google.com>
2142 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2143 parameter. Change all callers. Don't issue warning about PC32
2144 against locally defined symbol.
2146 2011-06-16 Ian Lance Taylor <iant@google.com>
2148 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2149 occurs in same object.
2151 2011-06-14 Alan Modra <amodra@gmail.com>
2153 * po/POTFILES.in: Regenerate.
2155 2011-06-09 Ian Lance Taylor <iant@google.com>
2157 * script-sections.cc
2158 (Orphan_output_section::set_section_addresses): For a relocatable
2159 link set address to 0.
2161 2011-06-09 Cary Coutant <ccoutant@google.com>
2164 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2165 used with --compress-debug-sections.
2166 * gold/object.cc (Sized_relobj_file::do_layout): Report
2167 uncompressed size of compressed input sections.
2169 2011-06-08 Cary Coutant <ccoutant@google.com>
2172 * testsuite/two_file_test_2_v1.cc: Change initialization of
2173 v2 to keep it in .data.
2175 2011-06-07 Cary Coutant <ccoutant@google.com>
2177 * common.cc (Symbol_table::do_allocate_commons_list): Call
2179 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2180 (Errors::fallback): New function.
2181 (gold_fallback): New function.
2182 * errors.h (Errors::fallback): New function.
2183 * gold.cc (gold_exit): Change status parameter to enum; adjust
2185 (queue_initial_tasks): Call gold_fallback.
2186 * gold.h: Include cstdlib.
2187 (Exit_status): New enum type.
2188 (gold_exit): Change status parameter to enum.
2189 (gold_fallback): New function.
2190 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2191 (Layout::create_symtab_sections): Likewise.
2192 (Layout::create_shdrs): Likewise.
2193 * main.cc (main): Adjust call to gold_exit.
2194 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2195 (Output_data_got::add_got_entry_pair): Likewise.
2196 (Output_section::add_input_section): Likewise.
2197 (Output_section::add_output_section_data): Likewise.
2198 (Output_segment::set_section_list_addresses): Likewise.
2199 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2201 2011-06-07 Cary Coutant <ccoutant@google.com>
2203 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2204 for incremental links.
2205 * output.cc (Output_segment::set_section_list_addresses): Remove
2206 FIXME and test for TLS or BSS.
2208 2011-06-07 Cary Coutant <ccoutant@google.com>
2210 * testsuite/Makefile.am: Add incremental_copy_test,
2211 incremental_common_test_1.
2212 * testsuite/Makefile.in: Regenerate.
2213 * testsuite/common_test_1_v1.c: New source file.
2214 * testsuite/common_test_1_v2.c: New source file.
2215 * testsuite/copy_test_v1.cc: New source file.
2217 2011-06-07 Cary Coutant <ccoutant@google.com>
2219 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2220 update, allocate common from bss section's free list.
2221 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2222 linker-defined symbols.
2223 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2224 Skip GOT and PLT entries that are no longer referenced.
2225 (Output_section_incremental_inputs::write_info_blocks): Mark
2226 linker-defined symbols.
2227 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2228 * output.cc (Output_section::allocate): New function.
2229 * output.h (Output_section::allocate): New function.
2230 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2231 linker-defined symbols.
2232 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2233 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2234 (Symbol::init_base_output_data): Likewise.
2235 (Symbol::init_base_output_segment): Likewise.
2236 (Symbol::init_base_constant): Likewise.
2237 (Sized_symbol::init_output_data): Likewise.
2238 (Sized_symbol::init_output_segment): Likewise.
2239 (Sized_symbol::init_constant): Likewise.
2240 (Symbol_table::do_define_in_output_data): Likewise.
2241 (Symbol_table::do_define_in_output_segment): Likewise.
2242 (Symbol_table::do_define_as_constant): Likewise.
2243 * symtab.h (Symbol::is_predefined): New function.
2244 (Symbol::init_base_output_data): Add is_predefined parameter.
2245 (Symbol::init_base_output_segment): Likewise.
2246 (Symbol::init_base_constant): Likewise.
2247 (Symbol::is_predefined_): New data member.
2248 (Sized_symbol::init_output_data): Add is_predefined parameter.
2249 (Sized_symbol::init_output_segment): Likewise.
2250 (Sized_symbol::init_constant): Likewise.
2251 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2253 2011-06-07 Cary Coutant <ccoutant@google.com>
2255 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2256 instead of emit_copy_reloc.
2257 (Copy_relocs::emit_copy_reloc): Refactor.
2258 (Copy_relocs::make_copy_reloc): New function.
2259 (Copy_relocs::add_copy_reloc): Remove.
2260 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2262 (Copy_relocs::make_copy_reloc): New function.
2263 (Copy_relocs::add_copy_reloc): Remove.
2264 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2265 unchanged input files.
2266 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2267 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2268 Reserve BSS space for COPY relocations.
2269 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2270 (Output_section_incremental_inputs::write_info_blocks): Record
2271 whether a symbol is copied from a shared object.
2272 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2273 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2274 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2275 (Incremental_input_entry_reader::get_output_symbol_index): Add
2277 (Incremental_binary::emit_copy_relocs): New function.
2278 (Incremental_binary::do_emit_copy_relocs): New function.
2279 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2281 (Sized_incremental_binary::add_copy_reloc): New function.
2282 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2283 (Sized_incremental_binary::Copy_reloc): New struct.
2284 (Sized_incremental_binary::Copy_relocs): New typedef.
2285 (Sized_incremental_binary::copy_relocs_): New data member.
2286 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2287 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2288 * target.h (Sized_target::emit_copy_reloc): New function.
2289 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2291 2011-06-02 Cary Coutant <ccoutant@google.com>
2294 * gold/archive.cc (Archive::Archive): Initialize new data member.
2295 (Archive::include_all_members): Return if archive has already been
2297 * gold/archive.h (Archive::include_all_members_): New data member.
2299 2011-06-02 Nick Clifton <nickc@redhat.com>
2301 * dynobj.h: Fix spelling mistake in comment.
2302 * output.cc: Likewise.
2304 2011-05-31 Doug Kwan <dougkwan@google.com>
2308 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2309 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2310 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2311 redundant arm_exidx_test.so.
2312 * testsuite/Makefile.in: Regenerate.
2313 (check_SCRIPTS): Add pr12826.sh
2314 (check_DATA): Add pr12826.stdout
2315 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2316 * testsuite/pr12826.sh: New file.
2317 * testsuite/pr12826_1.s: Ditto.
2318 * testsuite/pr12826_1.s: Ditto.
2320 2011-05-30 Ian Lance Taylor <iant@google.com>
2322 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2325 2011-05-29 Ian Lance Taylor <iant@google.com>
2328 * testsuite/Makefile.am: Use different file name for two_file_test
2329 temporary file for each incremental test.
2330 * testsuite/Makefile.in: Rebuild.
2332 2011-05-29 Ian Lance Taylor <iant@google.com>
2334 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2335 binary input file is empty.
2337 2011-05-27 Ian Lance Taylor <iant@google.com>
2339 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2340 (ver_test_9.so): Likewise.
2341 * testsuite/Makefile.in: Rebuild.
2343 2011-05-26 Cary Coutant <ccoutant@google.com>
2345 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2346 * incremental.cc (Incremental_inputs::report_input_section): Fix
2347 comment, indentation.
2348 (Incremental_inputs::report_comdat_group): New function.
2349 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2350 of data for incremental input file entry.
2351 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2352 group count, COMDAT group signatures.
2353 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2354 an unchanged input file.
2355 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2356 Initialize new data member.
2357 (Incremental_object_entry::add_comdat_group): New function.
2358 (Incremental_object_entry::get_comdat_group_count): New function.
2359 (Incremental_object_entry::get_comdat_signature_key): New function.
2360 (Incremental_object_entry::groups_): New data member.
2361 (Incremental_inputs::report_comdat_group): New function.
2362 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2363 data for incremental input file entry.
2364 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2365 (Incremental_input_entry_reader::get_input_section): Adjust size of
2366 data for incremental input file entry.
2367 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2368 (Incremental_input_entry_reader::get_comdat_group_signature): New
2370 * object.cc (Sized_relobj::include_section_group): Report kept
2371 COMDAT groups for incremental links.
2373 2011-05-24 David Meyer <pdox@google.com>
2375 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2376 with name parameter. Add found_name parameter.
2377 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2378 * dirsearch.h (class Dirsearch): Update declaration.
2380 2011-05-24 Ian Lance Taylor <iant@google.com>
2382 * archive.cc (Library_base::should_include_member): Pull in object
2383 from archive if it defines the entry symbol.
2384 * parameters.cc (Parameters::entry): New function.
2385 * parameters.h (class Parameters): Declare entry.
2386 * output.h (class Output_file_header): Remove entry_ field.
2387 * output.cc (Output_file_header::Output_file_header): Remove entry
2388 parameter. Change all callers.
2389 (Output_file_header::entry): Use parameters->entry.
2390 * gold.cc (queue_middle_tasks): Likewise.
2391 * plugin.cc (Plugin_hook::run): Likewise.
2393 2011-05-24 Cary Coutant <ccoutant@google.com>
2395 * gold.cc (queue_initial_tasks): Pass incremental base filename
2396 to Output_file::open_base_file; don't print error message.
2397 * incremental-dump.cc (main): Adjust call to
2398 Output_file::open_for_modification.
2399 * incremental-dump.cc (main): Likewise.
2400 * incremental.cc (Incremental_inputs::report_command_line):
2401 Ignore --incremental-base option when comparing command lines.
2402 Ignore parameter when given as separate argument.
2403 * options.h (class General_options): Add --incremental-base.
2404 * output.cc (Output_file::Output_file):
2405 (Output_file::open_base_file): Add base_name and writable parameters;
2406 read base file into new file; print error message here.
2407 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2409 * output.h (Output_file::open_for_modification): Rename to...
2410 (Output_file::open_base_file): ...this; add base_name and
2411 writable parameters; adjust all callers.
2412 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2414 * testsuite/Makefile.am (incremental_test_4): Test
2416 * testsuite/Makefile.in: Regenerate.
2418 2011-05-24 Cary Coutant <ccoutant@google.com>
2420 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2422 * testsuite/Makefile.in: Regenerate.
2423 * testsuite/two_file_test_1_v1.cc: New test source file.
2424 * testsuite/two_file_test_1b_v1.cc: New test source file.
2425 * testsuite/two_file_test_2_v1.cc: New test source file.
2427 2011-05-24 Cary Coutant <ccoutant@google.com>
2429 * dynobj.h (Dynobj::do_dynobj): New function.
2430 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2431 flag and soname for shared objects.
2432 * incremental.cc (Incremental_inputs::report_object): Make
2433 either Incremental_object_entry or Incremental_dynobj_entry; add
2434 soname to string table.
2435 (Incremental_inputs::report_input_section): Add assertion.
2436 (Output_section_incremental_inputs::set_final_data_size): Adjust
2437 type of input file entry for shared libraries; adjust size of
2438 shared library info entry.
2439 (Output_section_incremental_inputs::write_input_files): Write
2440 as_needed flag for shared libraries.
2441 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2442 of input file entry for shared libraries; write soname.
2443 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2444 soname from incremental info.
2445 * incremental.h (enum Incremental_input_flags): Add
2446 INCREMENTAL_INPUT_AS_NEEDED.
2447 (Incremental_input_entry::Incremental_input_entry): Initialize new
2449 (Incremental_input_entry::set_as_needed): New function.
2450 (Incremental_input_entry::as_needed): New function.
2451 (Incremental_input_entry::do_dynobj_entry): New function.
2452 (Incremental_input_entry::as_needed_): New data member.
2453 (Incremental_object_entry::Incremental_object_entry): Don't check
2455 (Incremental_object_entry::do_type): Likewise.
2456 (class Incremental_dynobj_entry): New class.
2457 (Incremental_input_entry_reader::as_needed): New function.
2458 (Incremental_input_entry_reader::get_soname): New function.
2459 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2460 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2461 size of shared library info entry.
2462 * layout.cc (Layout::finish_dynamic_section): Don't test for
2463 incremental link when adding DT_NEEDED entries.
2464 * object.h (Object::Object): Initialize new data member.
2465 (Object::dynobj): New function.
2466 (Object::set_as_needed): New function.
2467 (Object::as_needed): New function.
2468 (Object::do_dynobj): New function.
2469 (Object::as_needed_): New data member.
2471 2011-05-24 Cary Coutant <ccoutant@google.com>
2473 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2474 info; adjust display of GOT entries.
2475 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2476 vector of input objects; remove file_status_.
2477 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2478 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2479 got_plt reader; call target hooks to reserve GOT entries.
2480 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2481 of input file info header and GOT info entry.
2482 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2484 (Got_plt_view_info::got_descriptor): Remove.
2485 (Got_plt_view_info::sym_index): New data member.
2486 (Got_plt_view_info::input_index): New data member.
2487 (Local_got_offset_visitor::visit): Write input file index.
2488 (Global_got_offset_visitor::visit): Write 0 for input file index.
2489 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2490 with sym_index and input_index.
2491 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2492 incremental info GOT entry; replace got_descriptor with input_index.
2493 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2494 map from input file index to object.
2495 (Sized_relobj_incr::do_layout): Replace direct data member reference
2496 with accessor function.
2497 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2498 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2499 Adjust size of input file info header.
2500 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2501 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2502 (Incremental_input_entry_reader::get_input_section): Adjust size of
2503 input file info header.
2504 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2505 of incremental info GOT entry.
2506 (Incremental_got_plt_reader::get_got_desc): Remove.
2507 (Incremental_got_plt_reader::get_got_symndx): New function.
2508 (Incremental_got_plt_reader::get_got_input_index): New function.
2509 (Sized_incremental_binary::Sized_incremental_binary): Remove
2510 file_status_; add input_objects_.
2511 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2512 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2513 (Sized_incremental_binary::file_is_unchanged): Remove.
2514 (Sized_incremental_binary::set_input_object): New function.
2515 (Sized_incremental_binary::input_object): New function.
2516 (Sized_incremental_binary::file_status_): Remove.
2517 (Sized_incremental_binary::input_objects_): New data member.
2518 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2520 (Sized_relobj_incr::invalid_address): Move to base class.
2521 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2523 (Sized_relobj_incr::do_output_section_offset): Likewise.
2524 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2525 (Sized_relobj_incr::section_offsets_): Likewise.
2526 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2528 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2529 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2530 with accessor function.
2531 (Sized_relobj_file::do_layout): Likewise.
2532 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2533 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2534 (Sized_relobj_file::compute_final_local_value): Replace refs to
2535 section_offsets_ with accessor function.
2536 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2537 * object.h (Relobj::Relobj): Initialize new data members.
2538 (Relobj::add_dyn_reloc): New function.
2539 (Relobj::first_dyn_reloc): New function.
2540 (Relobj::dyn_reloc_count): New function.
2541 (Relobj::first_dyn_reloc_): New data member.
2542 (Relobj::dyn_reloc_count_): New data member.
2543 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2545 (Sized_relobj::Address): New typedef.
2546 (Sized_relobj::invalid_address): Move here from child class.
2547 (Sized_relobj::Sized_relobj): Initialize new data members.
2548 (Sized_relobj::sized_relobj): New function.
2549 (Sized_relobj::is_output_section_offset_invalid): Move here from
2551 (Sized_relobj::get_output_section_offset): Likewise.
2552 (Sized_relobj::local_has_got_offset): Likewise.
2553 (Sized_relobj::local_got_offset): Likewise.
2554 (Sized_relobj::set_local_got_offset): Likewise.
2555 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2556 (Sized_relobj::clear_got_offsets): New function.
2557 (Sized_relobj::section_offsets): Move here from child class.
2558 (Sized_relobj::do_output_section_offset): Likewise.
2559 (Sized_relobj::do_set_section_offset): Likewise.
2560 (Sized_relobj::Local_got_offsets): Likewise.
2561 (Sized_relobj::local_got_offsets_): Likewise.
2562 (Sized_relobj::section_offsets_): Likewise.
2563 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2565 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2567 (Sized_relobj_file::sized_relobj): New function
2568 (Sized_relobj_file::local_has_got_offset): Move to base class.
2569 (Sized_relobj_file::local_got_offset): Likewise.
2570 (Sized_relobj_file::set_local_got_offset): Likewise.
2571 (Sized_relobj_file::get_output_section_offset): Likewise.
2572 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2573 (Sized_relobj_file::do_output_section_offset): Likewise.
2574 (Sized_relobj_file::do_set_section_offset): Likewise.
2575 (Sized_relobj_file::Local_got_offsets): Likewise.
2576 (Sized_relobj_file::local_got_offsets_): Likewise.
2577 (Sized_relobj_file::section_offsets_): Likewise.
2578 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2580 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2581 (Output_reloc::get_symbol_index): Likewise.
2582 (Output_reloc::local_section_offset): Likewise.
2583 (Output_reloc::get_address): Likewise.
2584 (Output_reloc::symbol_value): Likewise.
2585 (Output_data_got::reserve_slot): Move to class definition.
2586 (Output_data_got::reserve_local): New function.
2587 (Output_data_got::reserve_slot_for_global): Remove.
2588 (Output_data_got::reserve_global): New function.
2589 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2590 (all constructors, two instantiations).
2591 (Output_reloc::get_relobj): New function (two instantiations).
2592 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2593 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2594 (Output_data_reloc::add_global): Adjust type of relobj.
2595 (Output_data_reloc::add_global_relative): Likewise.
2596 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2597 (Output_data_reloc::add_local): Likewise.
2598 (Output_data_reloc::add_local_relative): Likewise.
2599 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2600 (Output_data_reloc::add_local_section): Likewise.
2601 (Output_data_reloc::add_output_section): Likewise.
2602 (Output_data_reloc::add_absolute): Likewise.
2603 (Output_data_reloc::add_target_specific): Likewise.
2604 (Output_data_got::reserve_slot): Move definition here.
2605 (Output_data_got::reserve_local): New function.
2606 (Output_data_got::reserve_global): New function.
2607 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2608 section_offsets_ with accessor function.
2609 (Sized_relobj_file::write_sections): Likewise.
2610 (Sized_relobj_file::do_relocate_sections): Likewise.
2611 * target.h (Sized_target::reserve_local_got_entry): New function.
2612 (Sized_target::reserve_global_got_entry): New function.
2613 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2614 (Target_x86_64::reserve_global_got_entry): New function.
2615 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2617 2011-05-23 Cary Coutant <ccoutant@google.com>
2619 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2620 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2621 bit when checking got_type.
2622 * incremental.cc (Sized_incremental_binary::setup_readers):
2623 Store symbol table and string table locations; initialize bit vector
2624 of file status flags.
2625 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2627 (Sized_incremental_binary::do_process_got_plt): New function.
2628 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2629 (Output_section_incremental_inputs::set_final_data_size): Record
2630 file index for each input file.
2631 (Output_section_incremental_inputs::write_got_plt): Store file index
2632 instead of input entry offset for each GOT entry.
2634 (Incremental_input_entry::Incremental_input_entry): Initialize new
2636 (Incremental_input_entry::set_offset): Store file index.
2637 (Incremental_input_entry::get_file_index): New function.
2638 (Incremental_input_entry::file_index_): New data member.
2639 (Incremental_binary::process_got_plt): New function.
2640 (Incremental_binary::do_process_got_plt): New function.
2641 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2643 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2644 (Sized_incremental_binary::set_file_is_unchanged): New function.
2645 (Sized_incremental_binary::file_is_unchanged): New function.
2646 (Sized_incremental_binary::do_process_got_plt): New function.
2647 (Sized_incremental_binary::file_status_): New data member.
2648 (Sized_incremental_binary::main_symtab_loc_): New data member.
2649 (Sized_incremental_binary::main_strtab_loc_): New data member.
2650 * output.cc (Output_data_got::Got_entry::write): Add case
2652 (Output_data_got::add_global): Call add_got_entry.
2653 (Output_data_got::add_global_plt): Likewise.
2654 (Output_data_got::add_global_with_rel): Likewise.
2655 (Output_data_got::add_global_with_rela): Likewise.
2656 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2657 (Output_data_got::add_global_pair_with_rela): Likewise.
2658 (Output_data_got::add_local): Call add_got_entry.
2659 (Output_data_got::add_local_plt): Likewise.
2660 (Output_data_got::add_local_with_rel): Likewise.
2661 (Output_data_got::add_local_with_rela): Likewise.
2662 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2663 (Output_data_got::add_local_pair_with_rela): Likewise.
2664 (Output_data_got::reserve_slot): New function.
2665 (Output_data_got::reserve_slot_for_global): New function.
2666 (Output_data_got::add_got_entry): New function.
2667 (Output_data_got::add_got_entry_pair): New function.
2668 (Output_section::add_output_section_data): Edit FIXME.
2670 (Output_section_data_build::Output_section_data_build): New
2671 constructor with size parameter.
2672 (Output_data_space::Output_data_space): Likewise.
2673 (Output_data_got::Output_data_got): Initialize new data member; new
2674 constructor with size parameter.
2675 (Output_data_got::add_constant): Call add_got_entry.
2676 (Output_data_got::reserve_slot): New function.
2677 (Output_data_got::reserve_slot_for_global): New function.
2678 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2679 (Output_data_got::add_got_entry): New function.
2680 (Output_data_got::add_got_entry_pair): New function.
2681 (Output_data_got::free_list_): New data member.
2682 * target.h (Sized_target::init_got_plt_for_update): New function.
2683 (Sized_target::register_global_plt_entry): New function.
2684 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2685 Initialize new data member; call init; add constructor with PLT count.
2686 (Output_data_plt_x86_64::init): New function.
2687 (Output_data_plt_x86_64::add_relocation): New function.
2688 (Output_data_plt_x86_64::reserve_slot): New function.
2689 (Output_data_plt_x86_64::free_list_): New data member.
2690 (Target_x86_64::init_got_plt_for_update): New function.
2691 (Target_x86_64::register_global_plt_entry): New function.
2692 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2693 incremental updates.
2694 (Output_data_plt_x86_64::add_relocation): New function.
2695 * testsuite/object_unittest.cc (Object_test): Set default options.
2697 2011-05-16 Ian Lance Taylor <iant@google.com>
2699 * options.h (class General_options): Make -i a synonym for -r.
2701 2011-05-16 Ian Lance Taylor <iant@google.com>
2703 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2705 2011-05-10 Cary Coutant <ccoutant@google.com>
2707 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2710 2011-05-06 Ian Lance Taylor <iant@google.com>
2712 * layout.cc (Layout::layout): If the output section flags change,
2713 update the ordering.
2715 2011-04-25 Cary Coutant <ccoutant@google.com>
2717 * incremental-dump.cc (dump_incremental_inputs): Print local
2718 symbol info for each input file.
2720 (Output_section_incremental_inputs::set_final_data_size): Add local
2721 symbol info to input file entries in incremental info.
2722 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2723 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2724 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2725 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2727 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2728 (Sized_incr_relobj::do_relocate): Write the local symbols.
2729 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2730 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2731 Adjust size of input file header.
2732 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2733 (Incremental_inputs_reader::get_local_symbol_count): New function.
2734 (Incremental_inputs_reader::get_input_section): Adjust size of input
2736 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2737 (Sized_incr_relobj::This): New typedef.
2738 (Sized_incr_relobj::sym_size): New const data member.
2739 (Sized_incr_relobj::Local_symbol): New struct.
2740 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2741 (Sized_incr_relobj::do_local_symbol_offset): New function.
2742 (Sized_incr_relobj::local_symbol_count_): New data member.
2743 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2744 (Sized_incr_relobj::local_symbol_index_): New data member.
2745 (Sized_incr_relobj::local_symbol_offset_): New data member.
2746 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2747 (Sized_incr_relobj::local_symbols_): New data member.
2748 * object.h (Relobj::output_local_symbol_count): New function.
2749 (Relobj::local_symbol_offset): New function.
2750 (Relobj::do_output_local_symbol_count): New function.
2751 (Relobj::do_local_symbol_offset): New function.
2752 (Sized_relobj::do_output_local_symbol_count): New function.
2753 (Sized_relobj::do_local_symbol_offset): New function.
2755 2011-04-22 Vladimir Simonov <sv@sw.ru>
2757 * descriptors.cc (set_close_on_exec): New function.
2758 (Descriptors::open): Use set_close_on_exec.
2759 * output.cc (S_ISLNK): Define if not defined.
2761 2011-04-22 Cary Coutant <ccoutant@google.com>
2763 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2765 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2766 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2767 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2769 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2770 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2771 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2773 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2775 (Incremental_binary::apply_incremental_relocs): New function.
2776 (Incremental_binary::do_apply_incremental_relocs): New function.
2777 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2779 (Sized_incremental_binary::add_global_symbol): New function.
2780 (Sized_incremental_binary::global_symbol): New function.
2781 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2782 (Sized_incremental_binary::symbol_map_): New data member.
2783 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2784 * target.h (Sized_target::apply_relocation): New function.
2785 * target-reloc.h (apply_relocation): New function.
2786 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2788 2011-04-22 Doug Kwan <dougkwan@google.com>
2790 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2791 flag of a SHT_ARM_EXIDX section.
2792 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2793 * testsuite/Makefile.in: Regenerate.
2794 * testsuite/arm_exidx_test.s: New file.
2795 * testsuite/arm_exidx_test.sh: Same.
2797 2011-04-20 Cary Coutant <ccoutant@google.com>
2800 * archive.h (Incremental_archive_entry::Archive_member):
2801 Initialize arg_serial_ (second constructor).
2803 2011-04-17 Ian Lance Taylor <iant@google.com>
2805 * object.cc (Relocate_info::location): Simplify location string.
2806 * errors.cc (Errors::error_at_location): Don't print program
2808 (Errors::warning_at_location): Likewise.
2809 (Errors::undefined_symbol): Likewise.
2810 * testsuite/debug_msg.sh: Update accordingly.
2812 2011-04-14 Cary Coutant <ccoutant@google.com>
2814 * gold/layout.cc (Layout::symtab_section_offset): New function.
2815 * gold/layout.h (Layout::symtab_section_offset): New function.
2816 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2818 2011-04-12 Ian Lance Taylor <iant@google.com>
2820 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2821 with MREMAP_MAYMOVE.
2822 * output.h (class Output_file): Add map_is_allocated_ field.
2823 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2824 not available, provide stubs. If mremap is not available, #define
2826 (MREMAP_MAYMOVE): Define if not defined.
2827 (Output_file::Output_file): Initialize map_is_allocated_.
2828 (Output_file::resize): Check map_is_allocated_.
2829 (Output_file::map_anonymous): If mmap fails, use malloc.
2830 (Output_file::unmap): Don't do anything for an anonymous map.
2831 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2832 is not available, provide stubs.
2833 (File_read::View::~View): Use free rather than delete[].
2834 (File_read::make_view): Use malloc rather than new[]. If mmap
2836 (File_read::find_or_make_view): Use malloc rather than new[].
2837 * gold.h: Remove HAVE_REMAP code.
2838 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2839 exists. Rename mremap to gold_mremap. If mmap is not available
2841 * configure, config.in: Rebuild.
2843 2011-04-11 Ian Lance Taylor <iant@google.com>
2845 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2846 initialize local variable v.
2848 2011-04-11 Cary Coutant <ccoutant@google.com>
2850 * archive.cc (Archive::include_member): Adjust call to
2852 (Add_archive_symbols::run): Track argument serial numbers.
2853 (Lib_group::include_member): Likewise.
2854 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2855 * archive.h (Incremental_archive_entry::Archive_member):
2856 Initialize arg_serial_.
2857 (Archive_member::arg_serial_): New data member.
2858 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2859 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2861 (Sized_dynobj::do_for_all_local_got_entries): New function.
2862 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2864 * fileread.cc (get_mtime): New function.
2865 * fileread.h (get_mtime): New function.
2866 * gold.cc (queue_initial_tasks): Check for incremental update.
2867 (process_incremental_input): New function.
2868 (queue_middle_tasks): Don't force valid target for incremental
2870 * incremental-dump.cc (find_input_containing_global): Adjust
2871 size of symbol info entry.
2872 (dump_incremental_inputs): Dump argument serial number and
2873 in_system_directory flag; bias shndx by 1; print symbol names
2874 when dumping per-file symbol lists; use new symbol info readers.
2876 (Output_section_incremental_inputs:update_data_size): New function.
2877 (Sized_incremental_binary::setup_readers): Setup input readers
2878 for each input file; build maps for files added from libraries
2880 (Sized_incremental_binary::check_input_args): New function.
2881 (Sized_incremental_binary::do_check_inputs): Build map of argument
2882 serial numbers to input arguments.
2883 (Sized_incremental_binary::do_file_has_changed): Rename
2884 do_file_is_unchanged to this; compare file modification times.
2885 (Sized_incremental_binary::do_init_layout): New function.
2886 (Sized_incremental_binary::do_reserve_layout): New function.
2887 (Sized_incremental_binary::do_get_input_reader): Remove.
2888 (Sized_incremental_binary::get_symtab_view): New function.
2889 (Incremental_checker::can_incrementally_link_output_file): Remove.
2890 (Incremental_inputs::report_command_line): Exclude --debug options.
2891 (Incremental_inputs::report_archive_begin): Add parameter; track
2892 argument serial numbers; don't put input file entry for archive
2893 before archive members.
2894 (Incremental_inputs::report_archive_end): Put input file entry
2895 for archive after archive members.
2896 (Incremental_inputs::report_object): Add parameter; track argument
2897 serial numbers and in_system_directory flag.
2898 (Incremental_inputs::report_script): Add parameter; track argument
2900 (Output_section_incremental_inputs::set_final_data_size): Adjust
2901 size of symbol info entry; check for forwarding symbols.
2902 (Output_section_incremental_inputs::write_input_files): Write
2903 in_system_directory flag and argument serial number.
2904 (Output_section_incremental_inputs::write_info_blocks): Map section
2905 indices between incremental info and original input file; store
2906 input section index for each symbol.
2907 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2908 change operator() to visit().
2909 (class Global_got_offset_visitor): Likewise.
2910 (class Global_symbol_visitor_got_plt):
2911 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2913 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2914 (Sized_incr_relobj::do_read_symbols): New function.
2915 (Sized_incr_relobj::do_layout): New function.
2916 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2917 (Sized_incr_relobj::do_add_symbols): New function.
2918 (Sized_incr_relobj::do_should_include_member): New function.
2919 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2920 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2921 (Sized_incr_relobj::do_section_size): New function.
2922 (Sized_incr_relobj::do_section_name): New function.
2923 (Sized_incr_relobj::do_section_contents): New function.
2924 (Sized_incr_relobj::do_section_flags): New function.
2925 (Sized_incr_relobj::do_section_entsize): New function.
2926 (Sized_incr_relobj::do_section_address): New function.
2927 (Sized_incr_relobj::do_section_type): New function.
2928 (Sized_incr_relobj::do_section_link): New function.
2929 (Sized_incr_relobj::do_section_info): New function.
2930 (Sized_incr_relobj::do_section_addralign): New function.
2931 (Sized_incr_relobj::do_initialize_xindex): New function.
2932 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2933 (Sized_incr_relobj::do_read_relocs): New function.
2934 (Sized_incr_relobj::do_gc_process_relocs): New function.
2935 (Sized_incr_relobj::do_scan_relocs): New function.
2936 (Sized_incr_relobj::do_count_local_symbols): New function.
2937 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2938 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2939 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2940 (Sized_incr_relobj::do_relocate): New function.
2941 (Sized_incr_relobj::do_set_section_offset): New function.
2942 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2943 (Sized_incr_dynobj::do_read_symbols): New function.
2944 (Sized_incr_dynobj::do_layout): New function.
2945 (Sized_incr_dynobj::do_add_symbols): New function.
2946 (Sized_incr_dynobj::do_should_include_member): New function.
2947 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2948 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2949 (Sized_incr_dynobj::do_section_size): New function.
2950 (Sized_incr_dynobj::do_section_name): New function.
2951 (Sized_incr_dynobj::do_section_contents): New function.
2952 (Sized_incr_dynobj::do_section_flags): New function.
2953 (Sized_incr_dynobj::do_section_entsize): New function.
2954 (Sized_incr_dynobj::do_section_address): New function.
2955 (Sized_incr_dynobj::do_section_type): New function.
2956 (Sized_incr_dynobj::do_section_link): New function.
2957 (Sized_incr_dynobj::do_section_info): New function.
2958 (Sized_incr_dynobj::do_section_addralign): New function.
2959 (Sized_incr_dynobj::do_initialize_xindex): New function.
2960 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2961 (make_sized_incremental_object): New function.
2962 (Incremental_library::copy_unused_symbols): New function.
2963 (Incremental_library::do_for_all_unused_symbols): New function.
2964 * incremental.h (enum Incremental_input_flags): New type.
2965 (class Incremental_checker): Remove.
2966 (Incremental_input_entry::Incremental_input_entry): Add argument
2968 (Incremental_input_entry::arg_serial): New function.
2969 (Incremental_input_entry::set_is_in_system_directory): New function.
2970 (Incremental_input_entry::is_in_system_directory): New function.
2971 (Incremental_input_entry::arg_serial_): New data member.
2972 (Incremental_input_entry::is_in_system_directory_): New data member.
2973 (class Script_info): Move here from script.h.
2974 (Script_info::Script_info): Add filename parameter.
2975 (Script_info::filename): New function.
2976 (Script_info::filename_): New data member.
2977 (Incremental_script_entry::Incremental_script_entry): Add argument
2979 (Incremental_object_entry::Incremental_object_entry): Likewise.
2980 (Incremental_object_entry::add_input_section): Build list of input
2981 sections with map to original shndx.
2982 (Incremental_object_entry::get_input_section_index): New function.
2983 (Incremental_object_entry::shndx_): New data member.
2984 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2985 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2986 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2988 (Incremental_inputs::report_archive_begin): Likewise.
2989 (Incremental_inputs::report_object): Likewise.
2990 (Incremental_inputs::report_script): Likewise.
2991 (class Incremental_global_symbol_reader): New class.
2992 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2993 and store flags and input file type.
2994 (Incremental_input_entry_reader::arg_serial): New function.
2995 (Incremental_input_entry_reader::type): Extract type from flags.
2996 (Incremental_input_entry_reader::is_in_system_directory): New function.
2997 (Incremental_input_entry_reader::get_input_section_count): Call
2998 accessor function for type.
2999 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3000 function for type; adjust size of global symbol entry.
3001 (Incremental_input_entry_reader::get_global_symbol_count): Call
3002 accessor function for type.
3003 (Incremental_input_entry_reader::get_object_count): Likewise.
3004 (Incremental_input_entry_reader::get_object_offset): Likewise.
3005 (Incremental_input_entry_reader::get_member_count): Likewise.
3006 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3007 (Incremental_input_entry_reader::get_member_offset): Likewise.
3008 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3009 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3010 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3011 (Incremental_input_entry_reader::get_global_symbol_reader): New
3013 (Incremental_input_entry_reader::get_output_symbol_index): New
3015 (Incremental_input_entry_reader::type_): Remove.
3016 (Incremental_input_entry_reader::flags_): New data member.
3017 (Incremental_inputs_reader::input_file_offset): New function.
3018 (Incremental_inputs_reader::input_file_index): New function.
3019 (Incremental_inputs_reader::input_file): Call input_file_offset.
3020 (Incremental_inputs_reader::input_file_at_offset): New function.
3021 (Incremental_relocs_reader::get_r_type): Reformat.
3022 (Incremental_relocs_reader::get_r_shndx): Reformat.
3023 (Incremental_relocs_reader::get_r_offset): Reformat.
3024 (Incremental_relocs_reader::data): New function.
3025 (Incremental_binary::Incremental_binary): Initialize new data members.
3026 (Incremental_binary::check_inputs): Add cmdline parameter.
3027 (Incremental_binary::file_is_unchanged): Remove.
3028 (Input_reader::arg_serial): New function.
3029 (Input_reader::get_unused_symbol_count): New function.
3030 (Input_reader::get_unused_symbol): New function.
3031 (Input_reader::do_arg_serial): New function.
3032 (Input_reader::do_get_unused_symbol_count): New function.
3033 (Input_reader::do_get_unused_symbol): New function.
3034 (Incremental_binary::input_file_count): New function.
3035 (Incremental_binary::get_input_reader): Change signature to use
3036 index instead of filename.
3037 (Incremental_binary::file_has_changed): New function.
3038 (Incremental_binary::get_input_argument): New function.
3039 (Incremental_binary::get_library): New function.
3040 (Incremental_binary::get_script_info): New function.
3041 (Incremental_binary::init_layout): New function.
3042 (Incremental_binary::reserve_layout): New function.
3043 (Incremental_binary::output_file): New function.
3044 (Incremental_binary::do_check_inputs): New function.
3045 (Incremental_binary::do_file_is_unchanged): Remove.
3046 (Incremental_binary::do_file_has_changed): New function.
3047 (Incremental_binary::do_init_layout): New function.
3048 (Incremental_binary::do_reserve_layout): New function.
3049 (Incremental_binary::do_input_file_count): New function.
3050 (Incremental_binary::do_get_input_reader): Change signature.
3051 (Incremental_binary::input_args_map_): New data member.
3052 (Incremental_binary::library_map_): New data member.
3053 (Incremental_binary::script_map_): New data member.
3054 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3056 (Sized_incremental_binary::output_section): New function.
3057 (Sized_incremental_binary::inputs_reader): Add const.
3058 (Sized_incremental_binary::symtab_reader): Add const.
3059 (Sized_incremental_binary::relocs_reader): Add const.
3060 (Sized_incremental_binary::got_plt_reader): Add const.
3061 (Sized_incremental_binary::get_symtab_view): New function.
3062 (Sized_incremental_binary::Inputs_reader): New typedef.
3063 (Sized_incremental_binary::Input_entry_reader): New typedef.
3064 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3065 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3066 (Sized_incremental_binary::do_file_has_changed): New function.
3067 (Sized_incremental_binary::do_init_layout): New function.
3068 (Sized_incremental_binary::do_reserve_layout): New function.
3069 (Sized_input_reader::Inputs_reader): Remove.
3070 (Sized_input_reader::Input_entry_reader): Remove.
3071 (Sized_input_reader::do_arg_serial): New function.
3072 (Sized_input_reader::do_get_unused_symbol_count): New function.
3073 (Sized_input_reader::do_get_unused_symbol): New function.
3074 (Sized_incremental_binary::do_input_file_count): New function.
3075 (Sized_incremental_binary::do_get_input_reader): Change signature;
3076 use index instead of filename.
3077 (Sized_incremental_binary::section_map_): New data member.
3078 (Sized_incremental_binary::input_entry_readers_): New data member.
3079 (class Sized_incr_relobj): New class.
3080 (class Sized_incr_dynobj): New class.
3081 (make_sized_incremental_object): New function.
3082 (class Incremental_library): New class.
3083 * layout.cc (Free_list::num_lists): New static data member.
3084 (Free_list::num_nodes): New static data member.
3085 (Free_list::num_removes): New static data member.
3086 (Free_list::num_remove_visits): New static data member.
3087 (Free_list::num_allocates): New static data member.
3088 (Free_list::num_allocate_visits): New static data member.
3089 (Free_list::init): New function.
3090 (Free_list::remove): New function.
3091 (Free_list::allocate): New function.
3092 (Free_list::dump): New function.
3093 (Free_list::print_stats): New function.
3094 (Layout_task_runner::run): Resize output file for incremental updates.
3095 (Layout::Layout): Initialize new data members.
3096 (Layout::set_incremental_base): New function.
3097 (Layout::init_fixed_output_section): New function.
3098 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3099 incremental updates.
3100 (Layout::create_gold_note): Do not create gold note section for
3101 incremental updates.
3102 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3103 for incremental updates.
3104 (Layout::set_section_offsets): For incremental updates, allocate space
3106 (Layout::create_symtab_sections): Layout with offsets relative to
3107 start of section; for incremental updates, allocate space from free
3109 (Layout::create_shdrs): For incremental updates, allocate space from
3111 (Layout::finish_dynamic_section): For incremental updates, do not
3112 check --as-needed (fixed in subsequent patch).
3113 * layout.h (class Free_list): New class.
3114 (Layout::set_incremental_base): New function.
3115 (Layout::incremental_base): New function.
3116 (Layout::init_fixed_output_section): New function.
3117 (Layout::allocate): New function.
3118 (Layout::incremental_base_): New data member.
3119 (Layout::free_list_): New data member.
3120 * main.cc (main): Print Free_list statistics.
3121 * object.cc (Relobj::finalize_incremental_relocs): Add
3122 clear_counts parameter; clear counts only when clear_counts is set.
3123 (Sized_relobj::Sized_relobj): Initialize new base class.
3124 (Sized_relobj::do_layout): Don't report special sections.
3125 (Sized_relobj::do_for_all_local_got_entries): New function.
3126 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3127 symtab_off to all symbol table offsets.
3128 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3129 * object.h (class Got_offset_list): Move to top of file.
3130 (Object::Object): Allow case where input_file == NULL.
3131 (Object::~Object): Likewise.
3132 (Object::input_file): Assert that input_file != NULL.
3133 (Object::lock): Allow case where input_file == NULL.
3134 (Object::unlock): Likewise.
3135 (Object::is_locked): Likewise.
3136 (Object::token): Likewise.
3137 (Object::release): Likewise.
3138 (Object::is_incremental): New function.
3139 (Object::get_mtime): New function.
3140 (Object::for_all_local_got_entries): New function.
3141 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3142 (Object::set_is_in_system_directory): New function.
3143 (Object::is_in_system_directory): New function.
3144 (Object::do_is_incremental): New function.
3145 (Object::do_get_mtime): New function.
3146 (Object::do_for_all_local_got_entries): New function.
3147 (Object::is_in_system_directory_): New data member.
3148 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3149 (class Sized_relobj_base): New class.
3150 (class Sized_relobj): Derive from Sized_relobj_base.
3151 (class Sized_relobj::Symbols): Redeclare from base class.
3152 (class Sized_relobj::local_got_offset_list): Remove.
3153 (class Sized_relobj::Output_sections): Redeclare from base class.
3154 (class Sized_relobj::do_for_all_local_got_entries): New function.
3155 (class Sized_relobj::write_local_symbols): Add offset parameter.
3156 (class Sized_relobj::local_symbol_offset_): Update comment.
3157 (class Sized_relobj::local_dynsym_offset_): Update comment.
3158 * options.cc (Input_arguments::add_file): Remove const.
3159 * options.h (Input_file_argument::Input_file_argument):
3160 Initialize arg_serial_ (all constructors).
3161 (Input_file_argument::set_arg_serial): New function.
3162 (Input_file_argument::arg_serial): New function.
3163 (Input_file_argument::arg_serial_): New data member.
3164 (Input_arguments::Input_arguments): Initialize file_count_.
3165 (Input_arguments::add_file): Remove const.
3166 (Input_arguments::number_of_input_files): New function.
3167 (Input_arguments::file_count_): New data member.
3168 (Command_line::number_of_input_files): Call
3169 Input_arguments::number_of_input_files.
3170 * output.cc (Output_segment_headers::Output_segment_headers):
3172 (Output_section::Input_section::current_data_size): New function.
3173 (Output_section::Output_section): Initialize new data members.
3174 (Output_section::add_input_section): Don't do merge sections for
3175 an incremental link; allocate space from free list for an
3177 (Output_section::add_output_section_data): Allocate space from
3178 free list for an incremental update.
3179 (Output_section::update_data_size): New function.
3180 (Output_section::set_fixed_layout): New function.
3181 (Output_section::reserve): New function.
3182 (Output_segment::set_section_addresses): Remove const.
3183 (Output_segment::set_section_list_addresses): Remove const; allocate
3184 space from free list for an incremental update.
3185 (Output_segment::set_offset): Adjust size of RELRO segment for an
3187 * output.h (Output_data::current_data_size): Move here from
3189 (Output_data::pre_finalize_data_size): New function.
3190 (Output_data::update_data_size): New function.
3191 (Output_section_headers::update_data_size): new function.
3192 (Output_section_data_build::current_data_size): Move to Output_data.
3193 (Output_data_strtab::update_data_size): New function.
3194 (Output_section::current_data_size): Move to Output_data.
3195 (Output_section::set_fixed_layout): New function.
3196 (Output_section::has_fixed_layout): New function.
3197 (Output_section::reserve): New function.
3198 (Output_section::update_data_size): New function.
3199 (Output_section::has_fixed_layout_): New data member.
3200 (Output_section::free_list_): New data member.
3201 (Output_segment::set_section_addresses): Remove const.
3202 (Output_segment::set_section_list_addresses): Remove const.
3203 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3205 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3207 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3208 parameter when calling Add_symbols constructor; store argument
3209 serial number for members of a lib group.
3210 (Add_symbols::locks): Allow case where token == NULL.
3211 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3212 (Read_member::~Read_member): New function.
3213 (Read_member::is_runnable): New function.
3214 (Read_member::locks): New function.
3215 (Read_member::run): New function.
3216 (Check_script::~Check_script): New function.
3217 (Check_script::is_runnable): New function.
3218 (Check_script::locks): New function.
3219 (Check_script::run): New function.
3220 (Check_library::~Check_library): New function.
3221 (Check_library::is_runnable): New function.
3222 (Check_library::locks): New function.
3223 (Check_library::run): New function.
3224 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3225 (Add_symbols::library_): New data member.
3226 (class Read_member): New class.
3227 (class Check_script): New class.
3228 (class Check_library): New class.
3229 * reloc.cc (Read_relocs::is_runnable): Allow case where
3231 (Read_relocs::locks): Likewise.
3232 (Scan_relocs::locks): Likewise.
3233 (Relocate_task::locks): Likewise.
3234 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3236 (Sized_relobj::incremental_relocs_scan): Fix comment.
3237 (Sized_relobj::do_relocate): Pass output file offset to
3238 write_local_symbols.
3239 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3240 from class declaration.
3241 * script.cc (read_input_script): Allocate Script_info; pass
3242 argument serial number to report_script.
3243 * script.h (class Script_info): Move to incremental.h.
3244 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3245 * symtab.h (Symbol_table::add_from_incrobj): New function.
3246 (Symbol_table::set_file_offset): New function.
3248 2011-04-05 Cary Coutant <ccoutant@google.com>
3250 * incremental-dump.cc (dump_incremental_inputs): Change signature
3251 to take a Sized_incremental_binary; change caller. Use readers
3252 in Sized_incremental_binary.
3254 (Sized_incremental_binary::find_incremental_inputs_sections):
3255 Rename do_find_incremental_inputs_sections to this.
3256 (Sized_incremental_binary::setup_readers): New function.
3257 (Sized_incremental_binary::do_check_inputs): Check
3258 has_incremental_info_ flag; move setup code to setup_readers;
3260 (Sized_incremental_binary::do_file_is_unchanged): New function.
3261 (Sized_incremental_binary::do_get_input_reader): New function.
3262 * incremental.h (class Incremental_binary): Move to end of file.
3263 (Incremental_binary::file_is_unchanged): New function.
3264 (Incremental_binary::do_file_is_unchanged): New function.
3265 (Incremental_binary::Input_reader): New class.
3266 (Incremental_binary::get_input_reader): New function.
3267 (class Sized_incremental_binary): Move to end of file.
3268 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3269 input section reader classes.
3270 (Sized_incremental_binary::has_incremental_info): New function.
3271 (Sized_incremental_binary::inputs_reader): New function.
3272 (Sized_incremental_binary::symtab_reader): New function.
3273 (Sized_incremental_binary::relocs_reader): New function.
3274 (Sized_incremental_binary::got_plt_reader): New function.
3275 (Sized_incremental_binary::do_file_is_unchanged): New function.
3276 (Sized_incremental_binary::Sized_input_reader): New class.
3277 (Sized_incremental_binary::get_input_reader): New function.
3278 (Sized_incremental_binary::find_incremental_inputs_sections):
3279 Rename do_find_incremental_inputs_sections to this.
3280 (Sized_incremental_binary::setup_readers): New function.
3281 (Sized_incremental_binary::has_incremental_info_): New data member.
3282 (Sized_incremental_binary::inputs_reader_): New data member.
3283 (Sized_incremental_binary::symtab_reader_): New data member.
3284 (Sized_incremental_binary::relocs_reader_): New data member.
3285 (Sized_incremental_binary::got_plt_reader_): New data member.
3286 (Sized_incremental_binary::current_input_file_): New data member.
3288 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3291 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3294 2011-03-30 Cary Coutant <ccoutant@google.com>
3296 * archive.cc (Archive::include_member): Adjust call to report_object.
3297 (Add_archive_symbols::run): Add script_info to call to
3298 report_archive_begin.
3299 (Lib_group::include_member): Adjust call to report_object.
3300 (Add_lib_group_symbols::run): Adjust call to report_object.
3301 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3302 blocks. Add object count for script input files.
3303 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3304 script_info parameter; change all callers.
3305 (Incremental_inputs::report_object): Add script_info parameter;
3307 (Incremental_inputs::report_script): Store backpointer to
3308 incremental info entry.
3309 (Output_section_incremental_inputs::set_final_data_size): Record
3310 additional information for scripts.
3311 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3312 * incremental.h (Incremental_script_entry::add_object): New function.
3313 (Incremental_script_entry::get_object_count): New function.
3314 (Incremental_script_entry::get_object): New function.
3315 (Incremental_script_entry::objects_): New data member; adjust
3317 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3318 (Incremental_inputs::report_object): Add script_info parameter.
3319 (Incremental_inputs_reader::get_object_count): New function.
3320 (Incremental_inputs_reader::get_object_offset): New function.
3321 * options.cc (Input_arguments::add_file): Return reference to
3323 * options.h (Input_argument::set_script_info): New function.
3324 (Input_argument::script_info): New function.
3325 (Input_argument::script_info_): New data member; adjust all
3327 (Input_file_group::add_file): Return reference to new input argument.
3328 (Input_file_lib::add_file): Likewise.
3329 (Input_arguments::add_file): Likewise.
3330 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3331 * script.cc (Parser_closure::Parser_closure): Add script_info
3332 parameter; adjust all callers.
3333 (Parser_closure::script_info): New function.
3334 (Parser_closure::script_info_): New data member.
3335 (read_input_script): Report scripts earlier to incremental info.
3336 (script_add_file): Set script_info in Input_argument.
3337 (script_add_library): Likewise.
3338 * script.h (Script_options::Script_info): Rewrite class.
3340 2011-03-29 Cary Coutant <ccoutant@google.com>
3342 * archive.cc (Library_base::should_include_member): Move
3343 method here from class Archive.
3344 (Archive::Archive): Initialize base class.
3345 (Archive::should_include_member): Move to base class.
3346 (Archive::do_for_all_unused_symbols): New function.
3347 (Add_archive_symbols::run): Remove redundant access to
3349 (Lib_group::Lib_group): Initialize base class.
3350 (Lib_group::do_filename): New function.
3351 (Lib_group::include_member): Pass pointer to Lib_group to
3353 (Lib_group::do_for_all_unused_symbols): New function.
3354 (Add_lib_group_symbols::run): Report archive information for
3356 * archive.h (class Library_base): New base class.
3357 (class Archive): Derive from Library_base.
3358 (Archive::filename): Move to base class.
3359 (Archive::set_incremental_info): Likewise.
3360 (Archive::incremental_info): Likewise.
3361 (Archive::Should_include): Likewise.
3362 (Archive::should_include_member): Likewise.
3363 (Archive::Armap_entry): Remove.
3364 (Archive::Unused_symbol_iterator): Remove.
3365 (Archive::unused_symbols_begin): Remove.
3366 (Archive::unused_symbols_end): Remove.
3367 (Archive::do_filename): New function.
3368 (Archive::do_get_mtime): New function.
3369 (Archive::do_for_all_unused_symbols): New function.
3370 (Archive::task_): Move to base class.
3371 (Archive::incremental_info_): Likewise.
3372 (class Lib_group): Derive from Library_base.
3373 (Lib_group::do_filename): New function.
3374 (Lib_group::do_get_mtime): New function.
3375 (Lib_group::do_for_all_unused_symbols): New function.
3376 (Lib_group::task_): Move to base class.
3377 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3379 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3381 * incremental.cc (Incremental_inputs::report_archive_begin):
3382 Use Library_base; call library's get_mtime; add incremental inputs
3383 entry before members.
3384 (class Unused_symbol_visitor): New class.
3385 (Incremental_inputs::report_archive_end): Use Library_base; use
3386 visitor class to record unused symbols; don't add incremental inputs
3387 entry after members.
3388 (Incremental_inputs::report_object): Use Library_base.
3390 (Incremental_archive_entry::Incremental_archive_entry): Remove
3391 unused Archive parameter.
3392 (Incremental_inputs::report_archive_begin): Use Library_base.
3393 (Incremental_inputs::report_archive_end): Likewise.
3394 (Incremental_inputs::report_object): Likewise.
3395 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3397 * object.h (Object::for_all_global_symbols): New function.
3398 (Object::do_for_all_global_symbols): New function.
3399 (Sized_relobj::do_for_all_global_symbols): New function.
3400 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3402 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3405 2011-03-27 Ian Lance Taylor <iant@google.com>
3407 * archive.cc (Archive::interpret_header): Return -1 if something
3408 goes wrong. Change callers accordingly.
3410 2011-03-25 Cary Coutant <ccoutant@google.com>
3412 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3413 * testsuite/Makefile.in: Regenerate.
3415 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3417 * plugin.cc (get_view): New.
3418 (Plugin::load): Pass get_view to the plugin.
3419 (Plugin_manager::get_view): New.
3421 2011-03-21 Ian Lance Taylor <iant@google.com>
3423 * testsuite/final_layout.sh: Rewrite to not use dc.
3424 * testsuite/relro_test.sh: Fail if dc is not present.
3426 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3428 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3430 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3431 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3433 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3434 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3436 2011-03-14 Ian Lance Taylor <iant@google.com>
3438 * script-sections.cc (Sort_output_sections::script_compare):
3439 Rename from is_before, change return type.
3440 (Sort_output_sections::operator()): Adjust accordingly.
3442 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3445 * testsuite/odr_violation2.cc: Add comment to make all error line
3446 numbers double digits.
3447 * testsuite/debug_msg.sh: Adjust expected errors.
3449 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3451 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3452 but mark earlier ones as non-canonical
3453 (offset_to_iterator): Update search target and example
3454 (do_addr2line): Return extra lines in a vector*
3455 (format_file_lineno): Extract from do_addr2line
3456 (one_addr2line): Add vector* out-param
3457 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3458 when a lineno entry appeared last for its instruction
3459 (Dwarf_line_info): Add vector* out-param
3460 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3461 * symtab.cc (Odr_violation_compare): Include the lineno in the
3463 (linenos_from_loc): New. Combine the canonical line for an
3464 address with its other lines.
3465 (True_if_intersect): New. Helper functor to make
3466 std::set_intersection a query.
3467 (detect_odr_violations): Compare sets of lines instead of just
3468 one line for each function. This became less deterministic, but
3469 has fewer false positives.
3470 * symtab.h: Declarations.
3471 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3472 mix an optimized and non-optimized object in the same binary
3473 (odr_violation2.so): Same.
3474 * testsuite/Makefile.in: Regenerate from Makefile.am.
3475 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3476 * testsuite/debug_msg.sh: Update line numbers and add
3478 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3479 non-optimized context.
3480 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3481 isn't inlined, and use OdrDerived in an optimized context.
3482 * testsuite/odr_header1.h: Defines OdrDerived, where
3483 optimization will change the
3484 first-instruction-in-the-destructor's file and line number.
3485 * testsuite/odr_header2.h: Defines OdrBase.
3487 2011-03-09 Ian Lance Taylor <iant@google.com>
3489 * fileread.cc (File_read::clear_views): Don't delete the whole
3492 2011-03-08 Ian Lance Taylor <iant@google.com>
3495 * fileread.cc: #include <climits>.
3496 (GOLD_IOV_MAX): Define.
3497 (File_read::read_multiple): Limit number of entries by iov_max.
3498 * fileread.h (class File_read): Always set max_readv_entries to
3501 2011-03-07 Ian Lance Taylor <iant@google.com>
3504 * options.h (class General_options): Add -dy and -dn.
3506 2011-03-02 Cary Coutant <ccoutant@google.com>
3508 * testsuite/script_test_9.t: Add TLS segment.
3510 2011-03-02 Simon Baldwin <simonb@google.com>
3512 * configure.ac: Add check for gnu_indirect_function support in
3513 the toolchain building binutils.
3514 * configure: Rebuild.
3516 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3518 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3519 plugin only symbols.
3520 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3521 in plugin files as not needed in the symbol table.
3523 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3525 * output.cc (Output_section::add_input_section): Delay fill
3526 generation for section ordering.
3528 2011-02-09 Ian Lance Taylor <iant@google.com>
3531 * object.h (class Sized_relobj): Remove clear_local_symbols.
3532 * reloc.cc (Sized_relobj::do_relocate): Don't call
3533 clear_local_symbols.
3535 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3537 * plugin.cc (is_visible_from_outside): Return true for symbols
3540 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3542 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3545 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3547 * icf.h (is_section_foldable_candidate): Change type of parameter
3549 * icf.cc (Icf::find_identical_sections): Change type of local variable
3550 section_name to be std::string.
3551 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3553 2011-01-25 Ian Lance Taylor <iant@google.com>
3555 * script.cc (script_add_extern): Rewrite to use
3556 add_symbol_reference.
3558 2011-01-25 Doug Kwan <dougkwan@google.com>
3560 * icf.cc (get_section_contents): Always lock section's object.
3562 2011-01-24 Ian Lance Taylor <iant@google.com>
3564 * options.h (class General_options): Accept
3565 --no-detect-odr-violations.
3567 2011-01-24 Ian Lance Taylor <iant@google.com>
3569 * version.cc (version_string): Bump to 1.11.
3571 2011-01-24 Ian Lance Taylor <iant@google.com>
3573 * plugin.cc (class Plugin_rescan): Define new class.
3574 (Plugin_manager::claim_file): Set any_claimed_.
3575 (Plugin_manager::save_archive): New function.
3576 (Plugin_manager::save_input_group): New function.
3577 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3579 (Plugin_manager::new_undefined_symbol): New function.
3580 (Plugin_manager::rescan): New function.
3581 (Plugin_manager::rescannable_defines): New function.
3582 (Plugin_manager::add_input_file): Set any_added_.
3583 * plugin.h (class Plugin_manager): define new fields rescannable_,
3584 undefined_symbols_, any_claimed_, and any_added_. Declare
3585 Plugin_rescan as friend. Declare new functions.
3586 (Plugin_manager::Rescannable): Define type.
3587 (Plugin_manager::Rescannable_list): Define type.
3588 (Plugin_manager::Undefined_symbol_list): Define type.
3589 (Plugin_manager::Plugin_manager): Initialize new fields.
3590 * archive.cc (Archive::defines_symbol): New function.
3591 (Add_archive_symbols::run): Pass archive to plugins if any.
3592 * archive.h (class Archive): Declare defines_symbol.
3593 * readsyms.cc (Input_group::~Input_group): New function.
3594 (Finish_group::run): Pass input_group to plugins if any.
3595 * readsyms.h (class Input_group): Declare destructor.
3596 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3599 2011-01-10 Ian Lance Taylor <iant@google.com>
3601 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3603 (Layout::set_segment_offsets): Reset increase_relro before calling
3604 set_section_addresses a second time.
3606 2011-01-04 Cary Coutant <ccoutant@google.com>
3608 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3609 sections before NOBITS sections.
3611 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3613 * version.cc (print_version): Update copyright to 2011.
3615 2010-12-23 Cary Coutant <ccoutant@google.com>
3617 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3618 of OS to this->add. Add OD parameter to second form of the function.
3620 2010-12-20 Ian Lance Taylor <iant@google.com>
3622 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3623 second of two consecutive entries with same offset.
3625 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3627 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3628 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3629 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3630 to avoid unneeded links against $(LDADD).
3631 * testsuite/Makefile.in: Regenerate.
3633 2010-12-15 Ian Lance Taylor <iant@google.com>
3636 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3637 for R_X86_64_32 and R_X86_64_PC32.
3638 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3639 ver_matching_def_pic.o.
3640 (ver_matching_def_pic.o): New target.
3642 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3644 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3645 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3646 Move definition before File_read::View member definitions.
3647 (File_read::View::~View): Initialize and hold lock before
3648 updating current_mapped_bytes.
3650 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3652 * dwarf_reader.cc: Remove outdated comment.
3653 * gold-threads.cc: Fix typo in error message.
3654 * archive.cc: Fix typos in comments.
3655 * archive.h: Likewise.
3656 * arm-reloc-property.cc: Likewise.
3657 * arm-reloc-property.h: Likewise.
3658 * arm-reloc.def: Likewise.
3660 * attributes.h: Likewise.
3661 * cref.cc: Likewise.
3662 * ehframe.cc: Likewise.
3663 * fileread.h: Likewise.
3665 * i386.cc: Likewise.
3667 * incremental.h: Likewise.
3668 * int_encoding.cc: Likewise.
3669 * layout.h: Likewise.
3670 * main.cc: Likewise.
3671 * merge.h: Likewise.
3672 * object.cc: Likewise.
3673 * object.h: Likewise.
3674 * options.cc: Likewise.
3675 * readsyms.cc: Likewise.
3676 * reduced_debug_output.cc: Likewise.
3677 * reloc.cc: Likewise.
3678 * script-sections.cc: Likewise.
3679 * sparc.cc: Likewise.
3680 * symtab.h: Likewise.
3681 * target-reloc.h: Likewise.
3682 * target.cc: Likewise.
3683 * target.h: Likewise.
3684 * timer.cc: Likewise.
3685 * timer.h: Likewise.
3686 * x86_64.cc: Likewise.
3688 2010-12-09 Cary Coutant <ccoutant@google.com>
3690 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3692 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3693 parameter; change all callers.
3694 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3695 * options.h (warn_execstack): New option.
3697 2010-12-07 Doug Kwan <dougkwan@google.com>
3699 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3700 like function call relocations.
3702 2010-12-07 Ian Lance Taylor <iant@google.com>
3704 * archive.cc (Archive::get_elf_object_for_member): Permit
3705 punconfigured to be NULL.
3706 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3707 (Archive::include_member): Pass NULL to get_elf_object_for_member
3708 if we searched for the archive and this is the first included
3711 2010-12-01 Ian Lance Taylor <iant@google.com>
3713 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3714 track_relocs_type_ field.
3715 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3716 Set track_relocs_type_.
3717 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3718 contents when using RELA relocs.
3719 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3721 * reloc.cc (Track_relocs::next_addend): New function.
3722 * reloc.h (class Track_relocs): Declare next_addend.
3724 2010-12-01 Ian Lance Taylor <iant@google.com>
3726 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3729 2010-12-01 Ian Lance Taylor <iant@google.com>
3731 * README: Update compilers known to work and fail.
3733 2010-11-23 Matthias Klose <doko@ubuntu.com>
3735 * configure.in: For --enable-gold, handle value `default' instead of
3736 `both*'. Always install ld as ld.bfd, install as ld if gold is
3738 * configure: Regenerate.
3740 2010-11-18 Doug Kwan <dougkwan@google.com>
3742 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3743 and right_alignment to be zero. Store result alignment only if it is
3744 greater than existing alignment.
3746 2010-11-16 Cary Coutant <ccoutant@google.com>
3749 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3750 Check for ".zdebug_line".
3752 2010-11-16 Doug Kwan <dougkwan@google.com>
3753 Cary Coutant <ccoutant@google.com>
3755 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3756 by reference; adjust all callers.
3757 * output.cc (Output_segment::set_section_addresses): Adjust references
3758 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3760 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3761 end at page boundary.
3763 2010-11-16 Cary Coutant <ccoutant@google.com>
3766 * layout.cc (Layout::choose_output_section): Transform names of
3767 compressed sections even when using a script with a SECTIONS clause.
3768 (Layout::output_section_name): Remove code to transform
3769 compressed debug section names.
3770 * output.cc (Output_section::add_input_section): Use uncompressed
3771 section size when tracking input sections.
3773 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3775 * symtab.h (Symbol::NON_PIC_REF): Remove.
3776 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3777 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3778 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3779 (Symbol::use_plt_offset): Take a flags argument and pass it
3780 directly to needs_dynamic_reloc. Restrict check for undefined
3781 weak symbols to function calls.
3782 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3783 (Target_arm::Scan::global): Use it.
3784 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3785 (Target_arm::Relocate::relocate): Likewise.
3786 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3787 parameter with an r_type parameter. Use get_reference_flags
3789 (Target_arm::Relocate::relocate): Update accordingly.
3790 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3791 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3792 (Target_i386::Scan::global): Likewise.
3793 (Target_i386::Relocate::relocate): Likewise.
3794 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3795 parameter with an r_type parameter. Use get_reference_flags
3797 (Target_i386::Relocate::relocate): Update accordingly.
3798 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3799 (Target_powerpc::Scan::global): Use it.
3800 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3801 (Target_powerpc::Relocate::relocate): Likewise.
3802 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3803 (Target_sparc::Scan::global): Use it.
3804 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3805 (Target_sparc::Relocate::relocate): Likewise.
3806 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3807 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3808 (Target_x86_64::Scan::global): Likewise.
3809 (Target_x86_64::Relocate::relocate): Likewise.
3811 2010-11-08 Doug Kwan <dougkwan@google.com>
3812 Cary Coutant <ccoutant@google.com>
3814 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3815 (Arm_exidx_merge_section::section_contents_): New data member.
3816 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3817 (Arm_input_section::~Arm_input_section): De-allocate memory.
3818 (Arm_input_section::original_contents_): New data member.
3819 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3820 in parameters instead of calling Object::section_contents without
3822 (Arm_output_section::group_section): New parameter TASK. Pass it
3823 to callees that need locking objects.
3824 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3825 to lock EXIDX input sections. Fix a formatting issue. Call
3826 Arm_exidx_merged_section::build_contents to create merged section
3828 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3829 to lock object of stub table owner.
3830 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3831 TEXT_SIZE to initialize data member TEXT_SIZE_.
3832 (Arm_exidx_input_section::addralign): Fix typo in comment.
3833 (Arm_exidx_input_section::text_size): New method.
3834 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3835 that require locking objects. Lock objects before scanning for stubs
3836 and updating local symbols.
3837 (Arm_input_section<big_endian>::init): Copy contents of original
3839 (Arm_input_section<big_endian>::do_write): Use saved contents of
3840 original input section instead of calling Object::section_contents
3842 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3843 size without calling Object::section_size().
3844 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3845 for size. Allocate a buffer for merged EXIDX entries.
3846 (Arm_exidx_merged_section::build_contents): New method.
3847 (Arm_exidx_merged_section::do_write): Move merge section contents
3848 building code to Arm_exidx_merged_section::build_contetns. Write
3849 out contetns in buffer instead of building it on the fly.
3850 (Arm_relobj::make_exidx_input_section): Also pass text section size
3851 to Arm_exidx_input_section constructor.
3852 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3853 (Arm_dynobj::do_read_symbols): Fix memory leak.
3854 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3855 * target.h: (class Task): Add forward declaration.
3856 (Target::relax): Add new parameter TASK and pass it to
3858 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3860 2010-11-05 Cary Coutant <ccoutant@google.com>
3863 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3864 object when reading from the file.
3865 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3867 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3868 when reading section contents.
3869 (get_section_contents): Likewise.
3870 (icf::find_identical_sections): Likewise.
3871 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3872 object when reading from the file.
3873 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3874 the object when doing deferred section layout.
3876 2010-11-03 Nick Clifton <nickc@redhat.com>
3879 * script.h (class Symbol_assignment: name): New member. Returns
3880 the name of the symbol.
3881 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3882 Returns true if the given symbol name is on the list of
3883 assignments wating to be processed.
3884 * archive.cc (should_incldue_member): If the symbol is undefined,
3885 check to see if it is on the list of symbols pending assignment.
3887 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3889 * script-sections.cc (Script_sections::find_memory_region): Check
3890 for a NULL output section pointer.
3892 2010-10-29 Doug Kwan <dougkwan@google.com>
3894 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3895 Output_section::add_relaxed_input_section.
3896 * output.cc (Output_section::add_relaxed_input_section): Add new
3897 arguments LAYOUT and NAME. Set section order index.
3898 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3899 Copy section order index.
3900 * output.h (Output_section::add_relaxed_input_section): Add new
3901 arguments LAYOUT and NAME.
3903 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3905 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3906 NATIVE_OR_CROSS_LINKER.
3907 * testsuite/Makefile.in: Regenerate.
3909 2010-10-20 Doug Kwan <dougkwan@google.com>
3911 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3912 without SHF_LINK_ORDER flags.
3913 * layout.cc (Layout::choose_output_section): Do not filter
3914 SHF_LINK_ORDER flag in a relocatable link.
3916 2010-10-17 Cary Coutant <ccoutant@google.com>
3918 * output.h (Output_segment::set_section_addresses): Change function
3919 signature. Update all callers.
3920 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3922 (Output_segment::set_section_addresses): Align after last TLS
3923 section. Add padding before last relro section instead of after.
3925 2010-10-17 Doug Kwan <dougkwan@google.com>
3927 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3928 GOT output section to be writable.
3930 2010-10-14 Cary Coutant <ccoutant@google.com>
3932 * debug.h (DEBUG_INCREMENTAL): New flag.
3933 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3934 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3936 * incremental.cc (report_command_line): Ignore all forms of
3938 * layout.cc (Layout::Layout): Check parameters for incremental link
3940 * options.cc (General_options::parse_incremental): New function.
3941 (General_options::parse_no_incremental): New function.
3942 (General_options::parse_incremental_full): New function.
3943 (General_options::parse_incremental_update): New function.
3944 (General_options::incremental_mode_): New data member.
3945 (General_options::finalize): Check incremental_mode_.
3946 * options.h (General_options): Update help text for --incremental.
3947 Add --no-incremental, --incremental-full, --incremental-update.
3948 (General_options::Incremental_mode): New enum type.
3949 (General_options::incremental_mode): New function.
3950 (General_options::incremental_mode_): New data member.
3951 * parameters.cc (Parameters::incremental_mode_): New data member.
3952 (Parameters::set_options): Set incremental_mode_.
3953 (Parameters::set_incremental_full): New function.
3954 (Parameters::incremental): New function.
3955 (Parameters::incremental_update): New function.
3956 (set_parameters_incremental_full): New function.
3957 * parameters.h (Parameters::set_incremental_full): New function.
3958 (Parameters::incremental): New function.
3959 (Parameters::incremental_update): New function.
3960 (Parameters::incremental_mode_): New data member.
3961 (set_parameters_incremental_full): New function.
3962 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3963 incremental link mode.
3964 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3965 (Sized_relobj::do_relocate_sections): Likewise.
3966 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3968 * testsuite/Makefile.in: Regenerate.
3969 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3971 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3973 * script-sections.h (class Script_sections): Make
3974 Sections_elements typedef public.
3975 * script-sections.cc (class Sort_output_sections): Add elements_
3976 field. Add constructor which sets it; change all callers.
3977 (Sort_output_sections::is_before): New function.
3978 (Sort_output_sections::operator()): Call is_before.
3979 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3981 * testsuite/script_test_10.sh: New test. Test script section
3983 * testsuite/script_test_10.t: Likewise.
3984 * testsuite/script_test_10.s: Likewise.
3985 * testsuite/Makefile.am: Wrap the cross linker tests and the
3986 common tests into NATIVE_OR_CROSS_LINKER.
3987 (check_SCRIPTS): Add script_test_10.sh.
3988 (check_DATA): Add script_test_10.stdout.
3989 (script_test_10.o, script_test_10): New targets.
3990 (script_test_10.stdout): New target.
3991 * configure, testsuite/Makefile.in: Regenerate.
3993 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3995 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3996 error for the deprecated relocations.
3997 (Target_arm::Scan::global): Likewise.
3998 (Target_arm::Relocate::relocate): Likewise.
4000 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4002 * fileread.cc (Input_file::find_file): Initialize *found_name
4003 and *namep when using the fallback search for case 4.
4005 2010-10-11 Cary Coutant <ccoutant@google.com>
4007 * options.h (class General_options): Redefine -z lazy as an alias for
4008 the negation of -z now.
4010 2010-10-11 Ian Lance Taylor <iant@google.com>
4012 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4015 2010-10-06 Nick Clifton <nickc@redhat.com>
4017 * script-sections.cc(class Memory_region): Remove
4018 current_lma_offset_ field. Rename current_vma_offset_ to
4019 current_offset_. Add last_section_ field.
4020 (Memory_region::get_current_vma_address): Rename to
4021 get_current_address.
4022 (Memory_region::get_current_lma_address): Delete.
4023 (Memory_region::increment_vma_offset): Rename to
4025 (Memory_region::increment_lma_offset): Delete.
4026 (Memory_region::attributes_compatible): New method. Returns
4027 true if the provided section is compatible with the region.
4028 (Memory_region::get_last_section): New method. Returns the last
4029 section to use the region.
4030 (Memory_region::set_last_section): New method. Stores the last
4031 section to use the region.
4032 (Script_sections::block_in_region): New method. Returns true if
4033 a block of memory is contained within a region.
4034 (Script_sections::find_memory_region): New method. Locates a
4035 memory region to be used to set a VMA or LMA address.
4036 (Output_section_definition::set_section_addresses): Add code to
4037 check for addresses set by memory regions.
4038 (Output_segment::set_section_addresses): Remove memory region
4040 (Script_sections::create_segment): Add a warning if a header
4041 segment is created outside of any region.
4042 * script-sections.h (class Script_sections): Add prototypes for
4043 find_memory_region and block_in_region methods.
4044 * testsuite/memory_test.s: Use .long instead of .word.
4045 * testsuite/memory_test.t: Add some more output sections.
4046 * testsuite/memory_test.sh: Update expected output.
4048 2010-10-02 Doug Kwan <dougkwan@google.com>
4050 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4051 defintion to symtab.h
4052 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4053 declaration to defintion.
4055 2010-10-01 Nick Clifton <nickc@redhat.com>
4057 * expression.cc (eval): Replace dummy argument with NULL.
4058 (eval_maybe_dot): Check for a NULL result section pointer.
4059 (Symbol_expression::value): Likewise.
4060 (Dot_expression::value): Likewise.
4061 (BINARY_EXPRESSION): Likewise.
4062 (Max_expression::value): Likewise.
4063 (Min_expression::value): Likewise.
4064 (Absolute_expression::value): Likewise.
4065 (Addr_expression::value_from_output_section): Likewise.
4066 (Loaddddr_expression::value_from_output_section): Likewise.
4067 (Segment_start_expression::value): Likewise.
4068 * script-sections.cc
4069 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4071 (Sections_elememt_dot_assignment::set_section_addresses):
4073 (Output_data_expression::do_write_to_buffer): Likewise.
4074 (Output_section_definition::finalize_symbols): Likewise.
4075 (Output_section_definition::set_section_addresses): Likewise.
4077 2010-09-30 Doug Kwan <dougkwan@google.com>
4079 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4081 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4083 * target.h (Target::can_icf_inline_merge_sections): New virtual
4085 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4087 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4089 * icf.cc (get_section_contents): Inline merge sections only when
4092 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4094 * configure: Regenerate.
4096 2010-09-17 Ian Lance Taylor <iant@google.com>
4098 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4099 * testsuite/Makefile.am (memory_test.o): New target.
4100 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4102 * testsuite/Makefile.in: Rebuild.
4104 2010-09-17 Doug Kwan <dougkwan@google.com>
4106 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4107 defintion if relocation uses GOT entries of the symbol.
4108 * testsuite/icf_safe_test.sh: Fix test.
4109 * testsuite/icf_safe_so_test.sh: Fix test.
4111 2010-09-16 Cary Coutant <ccoutant@google.com>
4113 * script_sections.cc (class Memory_region): Remove "NULL" from
4114 vector initializations.
4116 2010-09-15 Cary Coutant <ccoutant@google.com>
4118 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4119 Resolve forwarding symbols.
4121 2010-09-15 Doug Kwan <dougkwan@google.com>
4123 * gold/testsuite/script_test_3.t: Add ARM special sections.
4124 * gold/testsuite/script_test_4.t: Same.
4125 * gold/testsuite/script_test_5.t: Same.
4126 * gold/testsuite/script_test_6.t: Same.
4127 * gold/testsuite/script_test_7.t: Same.
4128 * gold/testsuite/script_test_7.t: Same.
4129 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4131 2010-09-14 Cary Coutant <ccoutant@google.com>
4133 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4134 (Target_x86_64::Relocate::relocate_tls): Replace check for
4135 saw_tls_block_reloc_ with test for executable section.
4137 2010-09-12 Cary Coutant <ccoutant@google.com>
4139 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4140 position-independent executables to shared libraries need dynamic
4142 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4143 position-independent executables.
4144 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4145 * testsuite/Makefile.in: Regenerate.
4147 2010-09-10 Nick Clifton <nickc@redhat.com>
4150 * testsuite/memory_test.t: Discard any sections that are not
4153 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4156 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4157 "This::" to work around a bug in gcc 4.2.
4159 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4161 2010-09-09 Rafael Espindola <espindola@google.com>
4163 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4164 sections with different PF_X flags in the same segment.
4165 (Layout::find_first_load_seg): Search all segments to find the first
4167 * options.h (rosegment): New.
4169 2010-09-08 Rafael Espindola <espindola@google.com>
4171 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4173 2010-09-08 Doug Kwan <dougkwan@google.com>
4175 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4176 (Arm_relobj::do_relocate_sections): Add new parameter for output
4177 file to match the parent.
4178 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4179 of local symbols instead of input values. Update code to track
4180 changes in gold::relocate_section.
4181 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4182 (Sized_relobj::compute_final_local_value_internal): New methods.
4183 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4184 body into private version of Sized_relobj::compute_final_local_value.
4185 Call the inline method.
4186 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4187 merged symbol value if there is one.
4188 (Symbol_value::has_output_value): New method defintiion.
4189 (Sized_relobj::Compute_final_local_value_status): New enum type.
4190 (Sized_relobj::compute_final_local_value): New methods.
4191 (Sized_relobj::compute_final_local_value_internal): New methods.
4192 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4193 and arm_cortex_a8.sh.
4194 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4195 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4197 * Makefile.in: Regenerate.
4198 * testsuite/arm_bl_out_of_range.s: Update test.
4199 * testsuite/thumb_bl_out_of_range.s: Ditto.
4200 * testsuite/thumb_blx_out_of_range.s: Ditto.
4201 * testsuite/arm_branch_out_of_range.sh: New file.
4202 * testsuite/arm_cortex_a8.sh: Ditto.
4203 * testsuite/arm_cortex_a8_b.s: Ditto.
4204 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4205 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4206 * testsuite/arm_cortex_a8_bl.s: Ditto.
4207 * testsuite/arm_cortex_a8_blx.s: Ditto.
4208 * testsuite/arm_cortex_a8_local.s: Ditto.
4209 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4210 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4212 2010-09-08 Rafael Espindola <espindola@google.com>
4214 * Makefile.am (memory_test.stdout): Run readelf with -W.
4215 * Makefile.in: Regenerate.
4216 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4219 2010-09-08 Rafael Espindola <espindola@google.com>
4221 * script-sections.cc (Script_sections::add_memory_region): Convert
4222 field precision to int.
4223 * script.cc (script_set_section_region, script_set_section_region):
4224 Convert field precision to int.
4226 2010-09-08 Rafael Espindola <espindola@google.com>
4228 * arm.cc (do_finalize_sections): Create the __exidx_start and
4229 __exdix_end symbols even when the section is missing.
4231 2010-09-08 Nick Clifton <nickc@redhat.com>
4233 * README: Remove claim that MEMORY is not supported.
4234 * expression.cc (script_exp_function_origin)
4235 (script_exp_function_length): Move from here to ...
4236 * script.cc: ... here.
4237 (script_set_section_region, script_add_memory)
4238 (script_parse_memory_attr, script_include_directive): New
4240 * script-sections.cc
4241 (class Memory_region): New class.
4242 (class Output_section_definition): Add set_memory_region,
4243 set_section_vma, set_section_lma and get_section_name methods.
4244 (class Script_Sections): Add add_memory_region,
4245 find_memory_region, find_memory_region_origin,
4246 find_memory_region_length and set_memory_region methods.
4247 Have set_section_addresses method walk the list of set memory
4249 Extend the print methos to display memory regions.
4250 * script-sections.h: Add prototypes for new methods.
4251 Add enum for MEMORY region attributes.
4252 * yyscript.y: Add support for parsing MEMORY regions.
4253 * script-c.h: Add prototypes for new functions.
4254 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4255 * testsuite/Makefile.in: Regenerate.
4256 * testsuite/memory_test.sh: New script.
4257 * testsuite/memory_test.s: New assembler source file.
4258 * testsuite/memory_test.t: New linker script.
4260 2010-08-27 Doug Kwan <dougkwan@google.com>
4262 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4263 reference override an existing dynamic weak reference.
4264 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4265 * testsuite/Makefile.in: Regenerate.
4266 * testsuite/dyn_weak_ref.sh: New file.
4267 * testsuite/dyn_weak_ref_1.c: Ditto.
4268 * testsuite/dyn_weak_ref_2.c: Ditto.
4270 2010-08-27 Ian Lance Taylor <iant@google.com>
4272 * incremental.h (class Incremental_input_entry): Add virtual
4275 2010-08-27 Ian Lance Taylor <iant@google.com>
4277 * testsuite/start_lib_test_3.c: Mark t3 as used.
4279 2010-08-27 Nick Clifton <nickc@redhat.com>
4281 * options.cc (version_script): Fix small typo in previous
4284 2010-08-25 Nick Clifton <nickc@redhat.com>
4286 * archive.cc: Formatting fixes: Remove whitespace between
4287 typename and following asterisk. Remove whitespace between
4288 function name and opening parenthesis.
4289 * archive.h: Likewise.
4291 * attributes.cc: Likewise.
4292 * attributes.h: Likewise.
4293 * common.cc: Likewise.
4294 * copy-relocs.cc: Likewise.
4295 * dirsearch.h: Likewise.
4296 * dynobj.cc: Likewise.
4297 * ehframe.cc: Likewise.
4298 * ehframe.h: Likewise.
4299 * expression.cc: Likewise.
4300 * fileread.cc: Likewise.
4301 * fileread.h: Likewise.
4303 * gold-threads.cc: Likewise.
4304 * gold.cc: Likewise.
4305 * i386.cc: Likewise.
4307 * incremental-dump.cc: Likewise.
4308 * incremental.cc: Likewise.
4309 * layout.cc: Likewise.
4310 * layout.h: Likewise.
4311 * main.cc: Likewise.
4312 * merge.cc: Likewise.
4313 * merge.h: Likewise.
4314 * object.cc: Likewise.
4315 * object.h: Likewise.
4316 * options.cc: Likewise.
4317 * options.h: Likewise.
4318 * output.cc: Likewise.
4319 * output.h: Likewise.
4320 * plugin.cc: Likewise.
4321 * plugin.h: Likewise.
4322 * powerpc.cc: Likewise.
4323 * reloc.cc: Likewise.
4324 * script-c.h: Likewise.
4325 * script-sections.cc: Likewise.
4326 * script.cc: Likewise.
4327 * stringpool.cc: Likewise.
4328 * symtab.cc: Likewise.
4329 * symtab.h: Likewise.
4330 * target.cc: Likewise.
4331 * timer.cc: Likewise.
4332 * timer.h: Likewise.
4333 * version.cc: Likewise.
4334 * x86_64.cc: Likewise.
4336 2010-08-24 Nick Clifton <nickc@redhat.com>
4339 * layout.cc (segment_precedes): Sort segments by their physical
4340 addresses, if they have been set.
4342 2010-08-23 Cary Coutant <ccoutant@google.com>
4344 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4346 (Lib_group::include_member): Unlock object after deleting its
4348 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4351 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4352 Cary Coutant <ccoutant@google.com>
4354 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4355 constructor, and set_blocker.
4356 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4358 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4359 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4360 * testsuite/Makefile.am (start_lib_test): New test case.
4361 * testsuite/Makefile.in: Regenerate.
4362 * testsuite/start_lib_test_main.c: New file.
4363 * testsuite/start_lib_test_1.c: New file.
4364 * testsuite/start_lib_test_2.c: New file.
4365 * testsuite/start_lib_test_3.c: New file.
4367 2010-08-19 Ian Lance Taylor <iant@google.com>
4369 * Makefile.in: Rebuild with automake 1.11.1.
4370 * aclocal.m4: Likewise.
4371 * testsuite/Makefile.in: Likewise.
4373 2010-08-19 Ian Lance Taylor <iant@google.com>
4376 * i386.cc (class Output_data_plt_i386): Update declarations.
4377 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4378 local_ifuncs_ fields.
4379 (Target_i386::do_plt_section_for_global): New function.
4380 (Target_i386::do_plt_section_for_local): New function.
4381 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4382 parameter; change all callers. Initialize global_ifuncs_ and
4383 local_ifuncs_. If doing a static link define __rel_iplt_start and
4385 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4386 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4387 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4389 (Target_i386::make_plt_section): New function, broken out of
4390 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4391 (Target_i386::make_plt_entry): Call make_plt_section.
4392 (Target_i386::make_local_ifunc_plt_entry): New function.
4393 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4394 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4395 R_386_IRELATIVE to switch.
4396 (Target_i386::Scan::global): Likewise.
4397 (Target_i386::Relocate::relocate): Likewise.
4398 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4400 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4401 (Target_x86_64::do_plt_section_for_global): New function.
4402 (Target_x86_64::do_plt_section_for_local): New function.
4403 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4404 parameter; change all callers. If doing a static link define
4405 __rela_iplt_start and __rela_iplt_end.
4406 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4407 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4408 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4410 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4411 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4413 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4414 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4415 R_X86_64_IRELATIVE to switch.
4416 (Target_x86_64::Scan::global): Likewise.
4417 (Target_x86_64::Relocate::relocate): Likewise.
4418 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4420 * target.h (class Target): Add plt_section_for_global and
4421 plt_section_for_local functions. Add do_plt_section_for_global
4422 and do_plt_section_for_local virtual functions.
4423 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4424 clarifying comments.
4425 (Symbol::use_plt_offset): Handle IFUNC symbol.
4426 * object.cc (Sized_relobj::Sized_relobj): Initialize
4428 (Sized_relobj::local_has_plt_offset): New function.
4429 (Sized_relobj::local_plt_offset): New function.
4430 (Sized_relobj::set_local_plt_offset): New function.
4431 (Sized_relobj::do_count): Handle IFUNC symbol.
4432 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4433 a bit away from input_shndx_ field. Add set_is_func_symbol and
4434 is_ifunc_symbol functions.
4435 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4436 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4437 local_plt_offsets_ field.
4438 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4439 * output.h (class Output_section_data): Add non-const
4440 output_section function.
4441 (class Output_data_got): Update declarations.
4442 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4443 Add use_plt_offset parameter to global and local constructors.
4444 Change all callers. Change local_sym_index_ field to 31 bits.
4445 Change GSYM_CODE and CONSTANT_CODE accordingly.
4446 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4447 doing a static link don't set sh_link field.
4448 (Output_data_got::Got_entry::write): Use PLT offset if
4450 (Output_data_got::add_global_plt): New function.
4451 (Output_data_got::add_local_plt): New function.
4452 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4453 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4454 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4455 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4456 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4458 * testsuite/ifunc-sel.h: New file.
4459 * testsuite/ifuncmain1.c: New file.
4460 * testsuite/ifuncmain1vis.c: New file.
4461 * testsuite/ifuncmod1.c: New file.
4462 * testsuite/ifuncdep2.c: New file.
4463 * testsuite/ifuncmain2.c: New file.
4464 * testsuite/ifuncmain3.c: New file.
4465 * testsuite/ifuncmod3.c: New file.
4466 * testsuite/ifuncmain4.c: New file.
4467 * testsuite/ifuncmain5.c: New file.
4468 * testsuite/ifuncmod5.c: New file.
4469 * testsuite/ifuncmain6pie.c: New file.
4470 * testsuite/ifuncmod6.c: New file.
4471 * testsuite/ifuncmain7.c: New file.
4472 * configure, testsuite/Makefile.in: Rebuild.
4474 2010-08-18 Ian Lance Taylor <iant@google.com>
4477 (Output_section_incremental_inputs::write_input_files): Add cast
4478 to avoid signed/unsigned comparison warning.
4479 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4481 2010-08-12 Cary Coutant <ccoutant@google.com>
4483 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4485 2010-08-13 Ian Lance Taylor <iant@google.com>
4487 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4489 2010-08-12 Cary Coutant <ccoutant@google.com>
4490 Doug Kwan <dougkwan@google.com>
4492 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4493 defintion overrides non-weak undef, remember that the original undef
4495 * symtab.cc (Symbol_table::sized_write_global): For undef without
4496 an original weak binding, set binding to global in output.
4497 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4498 * testsuite/Makefile.in: Regenerate.
4499 * testsuite/strong_ref_weak_def.sh: New file.
4500 * testsuite/strong_ref_weak_def_1.c: Ditto.
4501 * testsuite/strong_ref_weak_def_2.c: Ditto.
4503 2010-08-12 Cary Coutant <ccoutant@google.com>
4505 * testsuite/incremental_test.sh: Rewrite.
4506 * testsuite/incremental_test_1.c: Rewrite.
4507 * testsuite/incremental_test_2.c: Rewrite.
4509 2010-08-12 Cary Coutant <ccoutant@google.com>
4511 * arm.cc (Target_arm::got_size): Add const.
4512 (Target_arm::got_entry_count): New function.
4513 (Target_arm::plt_entry_count): New function.
4514 (Target_arm::first_plt_entry_offset): New function.
4515 (Target_arm::plt_entry_size): New function.
4516 (Output_data_plt_arm::entry_count): New function.
4517 (Output_data_plt_arm::first_plt_entry_offset): New function.
4518 (Output_data_plt_arm::get_plt_entry_size): New function.
4519 * i386.cc (Target_i386::got_size): Add const.
4520 (Target_i386::got_entry_count): New function.
4521 (Target_i386::plt_entry_count): New function.
4522 (Target_i386::first_plt_entry_offset): New function.
4523 (Target_i386::plt_entry_size): New function.
4524 (Output_data_plt_i386::entry_count): New function.
4525 (Output_data_plt_i386::first_plt_entry_offset): New function.
4526 (Output_data_plt_i386::get_plt_entry_size): New function.
4527 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4528 find_incremental_inputs_sections. Dump incremental_got_plt section.
4529 * incremental.cc: Include target.h.
4530 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4531 parameter. Adjust all callers. Find incremental_got_plt section.
4532 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4534 (Output_section_incremental_inputs::set_final_data_size): Calculate
4535 size of incremental_got_plt section.
4536 (Output_section_incremental_inputs::do_write): Write the
4537 incremental_got_plt section.
4538 (Got_plt_view_info): New struct.
4539 (Local_got_offset_visitor): New class.
4540 (Global_got_offset_visitor): New class.
4541 (Global_symbol_visitor_got_plt): New class.
4542 (Output_section_incremental_inputs::write_got_plt): New function.
4543 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4544 Add parameter. Adjust all callers.
4545 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4546 (Incremental_inputs::got_plt_section): New function.
4547 (Incremental_inputs::got_plt_section_): New data member.
4548 (Incremental_got_plt_reader): New class.
4549 * layout.cc (Layout::create_incremental_info_sections): Add the
4550 incremental_got_plt section.
4551 * object.h (Got_offset_list::get_list): New function.
4552 (Got offset_list::for_all_got_offsets): New function.
4553 (Sized_relobj::local_got_offset_list): New function.
4554 * powerpc.cc (Target_powerpc::got_size): Add const.
4555 (Target_powerpc::got_entry_count): New function.
4556 (Target_powerpc::plt_entry_count): New function.
4557 (Target_powerpc::first_plt_entry_offset): New function.
4558 (Target_powerpc::plt_entry_size): New function.
4559 (Output_data_plt_powerpc::entry_count): New function.
4560 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4561 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4562 * sparc.cc (Target_sparc::got_size): Add const.
4563 (Target_sparc::got_entry_count): New function.
4564 (Target_sparc::plt_entry_count): New function.
4565 (Target_sparc::first_plt_entry_offset): New function.
4566 (Target_sparc::plt_entry_size): New function.
4567 (Output_data_plt_sparc::entry_count): New function.
4568 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4569 (Output_data_plt_sparc::get_plt_entry_size): New function.
4570 * symtab.h (Symbol::got_offset_list): New function.
4571 (Symbol_table::for_all_symbols): New function.
4572 * target.h (Sized_target::got_entry_count): New function.
4573 (Sized_target::plt_entry_count): New function.
4574 (Sized_target::plt_entry_size): New function.
4575 * x86_64.cc (Target_x86_64::got_size): Add const.
4576 (Target_x86_64::got_entry_count): New function.
4577 (Target_x86_64::plt_entry_count): New function.
4578 (Target_x86_64::first_plt_entry_offset): New function.
4579 (Target_x86_64::plt_entry_size): New function.
4580 (Output_data_plt_x86_64::entry_count): New function.
4581 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4582 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4584 2010-08-12 Cary Coutant <ccoutant@google.com>
4586 * archive.cc: Include incremental.h.
4587 (Archive::Archive): Initialize incremental_info_.
4588 (Archive::include_member): Record archive members in incremental info.
4589 (Add_archive_symbols::run): Record begin and end of an archive in
4591 (Lib_group::include_member): Record objects in incremental info.
4592 * archive.h (Incremental_archive_entry): Forward declaration.
4593 (Archive::set_incremental_info): New member function.
4594 (Archive::incremental_info): New member function.
4595 (Archive::Unused_symbol_iterator): New class.
4596 (Archive::unused_symbols_begin): New member function.
4597 (Archive::unused_symbols_end): New member function.
4598 (Archive::incremental_info_): New data member.
4599 * incremental-dump.cc (find_input_containing_global): New function.
4600 (dump_incremental_inputs): Dump new incremental info sections.
4601 * incremental.cc: Include symtab.h.
4602 (Output_section_incremental_inputs): New class.
4603 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4604 new incremental info sections.
4605 (Sized_incremental_binary::do_check_inputs): Likewise.
4606 (Incremental_inputs::report_archive): Remove.
4607 (Incremental_inputs::report_archive_begin): New function.
4608 (Incremental_inputs::report_archive_end): New function.
4609 (Incremental_inputs::report_object): New function.
4610 (Incremental_inputs::finalize_inputs): Remove.
4611 (Incremental_inputs::report_input_section): New function.
4612 (Incremental_inputs::report_script): Rewrite.
4613 (Incremental_inputs::finalize): Do nothing but finalize string table.
4614 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4615 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4616 (Incremental_inputs::create_data_sections): New function.
4617 (Incremental_inputs::relocs_entsize): New function.
4618 (Output_section_incremental_inputs::set_final_data_size): New function.
4619 (Output_section_incremental_inputs::do_write): New function.
4620 (Output_section_incremental_inputs::write_header): New function.
4621 (Output_section_incremental_inputs::write_input_files): New function.
4622 (Output_section_incremental_inputs::write_info_blocks): New function.
4623 (Output_section_incremental_inputs::write_symtab): New function.
4624 * incremental.h (Incremental_script_entry): Forward declaration.
4625 (Incremental_object_entry): Forward declaration.
4626 (Incremental_archive_entry): Forward declaration.
4627 (Incremental_inputs): Forward declaration.
4628 (Incremental_inputs_header_data): Remove.
4629 (Incremental_inputs_header): Remove.
4630 (Incremental_inputs_header_write): Remove.
4631 (Incremental_inputs_entry_data): Remove.
4632 (Incremental_inputs_entry): Remove.
4633 (Incremental_inputs_entry_write): Remove.
4634 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4635 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4636 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4637 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4639 (Incremental_input_entry): New class.
4640 (Incremental_script_entry): New class.
4641 (Incremental_object_entry): New class.
4642 (Incremental_archive_entry): New class.
4643 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4644 (Incremental_inputs::report_inputs): Remove.
4645 (Incremental_inputs::report_archive): Remove.
4646 (Incremental_inputs::report_archive_begin): New function.
4647 (Incremental_inputs::report_archive_end): New function.
4648 (Incremental_inputs::report_object): Change prototype.
4649 (Incremental_inputs::report_input_section): New function.
4650 (Incremental_inputs::report_script): Change prototype.
4651 (Incremental_inputs::get_reloc_count): New function.
4652 (Incremental_inputs::set_reloc_count): New function.
4653 (Incremental_inputs::create_data_sections): New function.
4654 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4655 (Incremental_inputs::inputs_section): New function.
4656 (Incremental_inputs::symtab_section): New function.
4657 (Incremental_inputs::relocs_section): New function.
4658 (Incremental_inputs::get_stringpool): Add const.
4659 (Incremental_inputs::command_line): Add const.
4660 (Incremental_inputs::inputs): Remove.
4661 (Incremental_inputs::command_line_key): New function.
4662 (Incremental_inputs::input_file_count): New function.
4663 (Incremental_inputs::input_files): New function.
4664 (Incremental_inputs::relocs_entsize): New function.
4665 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4666 (Incremental_inputs::finalize_inputs): Remove.
4667 (Incremental_inputs::Input_info): Remove.
4668 (Incremental_inputs::lock_): Remove.
4669 (Incremental_inputs::inputs_): Change type.
4670 (Incremental_inputs::inputs_map_): Remove.
4671 (Incremental_inputs::current_object_entry_): New data member.
4672 (Incremental_inputs::inputs_section_): New data member.
4673 (Incremental_inputs::symtab_section_): New data member.
4674 (Incremental_inputs::relocs_section_): New data member.
4675 (Incremental_inputs::reloc_count_): New data member.
4676 (Incremental_inputs_reader): New class.
4677 (Incremental_symtab_reader): New class.
4678 (Incremental_relocs_reader): New class.
4679 * layout.cc (Layout::finalize): Move finalization of incremental info
4680 and creation of incremental info sections to follow finalization of
4681 symbol table. Set offsets for postprocessing sections.
4682 (Layout::create_incremental_info_sections): Call
4683 Incremental_inputs::create_data_sections. Add incremental symtab
4684 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4685 sections to layout after input sections.
4686 * layout.h (struct Timespec): Forward declaration.
4687 (Layout::incremental_inputs): Add const.
4688 (Layout::create_incremental_info_sections): Add parameter.
4689 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4690 * object.cc: Include incremental.h.
4691 (Relobj::finalize_incremental_relocs): New function.
4692 (Sized_relobj::do_layout): Record input sections in incremental info.
4693 * object.h (Object::output_section): New function.
4694 (Object::output_section_offset): Moved from Relobj.
4695 (Object::get_incremental_reloc_base): New function.
4696 (Object::get_incremental_reloc_count): New function.
4697 (Object::do_output_section): New function.
4698 (Object::do_output_section_offset): Moved from Relobj.
4699 (Object::do_get_incremental_reloc_base): New function.
4700 (Object::do_get_incremental_reloc_count): New function.
4701 (Object::Object): Initialize new data members.
4702 (Relobj::output_section): Renamed do_output_section and moved to
4704 (Relobj::output_section_offset): Moved to Object.
4705 (Relobj::do_get_incremental_reloc_base): New function.
4706 (Relobj::do_get_incremental_reloc_count): New function.
4707 (Relobj::allocate_incremental_reloc_counts): New function.
4708 (Relobj::count_incremental_reloc): New function.
4709 (Relobj::finalize_incremental_relocs): New function.
4710 (Relobj::next_incremental_reloc_index): New function.
4711 (Relobj::reloc_counts_): New data member.
4712 (Relobj::reloc_bases_): New data member.
4713 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4714 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4715 (Sized_relobj::incremental_relocs_scan): New function.
4716 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4717 (Sized_relobj::incremental_relocs_write): New function.
4718 (Sized_relobj::incremental_relocs_write_reltype): New function.
4719 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4721 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4722 archives and object files elsewhere.
4723 (Add_symbols::run): Report object files here.
4724 (Finish_group::run): Report end of archive at end of group.
4725 * reloc.cc: Include layout.h, incremental.h.
4726 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4727 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4728 (Sized_relobj::incremental_relocs_scan): New function.
4729 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4730 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4731 (Sized_relobj::incremental_relocs_write): New function.
4732 (Sized_relobj::incremental_relocs_write_reltype): New function.
4733 * script.cc (read_input_script): Rewrite test for incremental link.
4734 Change call to Incremental_inputs::report_script.
4735 * symtab.h (Symbol_table::first_global_index): New function.
4736 (Symbol_table::output_count): New function.
4738 2010-08-12 Doug Kwan <dougkwan@google.com>
4740 * arm.cc (Target_arm::merge_object_attributes): Check command line
4741 options --no-wchar-size-warning and --no-enum-size-warning.
4742 * options.h (General_options): Add ld-compatible options
4743 --no-enum-size-warning and --no-wchar-size-warning.
4745 2010-08-04 Ian Lance Taylor <iant@google.com>
4747 * x86_64.cc (Target_x86_64::Scan::local): Use
4748 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4749 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4750 (Target_x86_64::Scan::global): Likewise.
4751 (Target_x86_64::Relocate::relocate): Likewise.
4752 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4755 2010-08-03 Cary Coutant <ccoutant@google.com>
4757 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4758 to reserve space in merged_strings vector. Keep total input size
4760 (Output_merge_string::do_print_merge_stats): Print total input size.
4761 * merge.h (Output_merge_string): Add input_size_ field.
4762 * stringpool.cc (Stringpool_template::string_length): Move
4763 implementations out of Stringpool_template class and place in
4765 * stringpool.h (string_length): Move out of Stringpool_template.
4767 2010-08-03 Ian Lance Taylor <iant@google.com>
4770 * layout.cc (relaxation_loop_body): If address of load segment is
4771 set, adjust address to include headers if possible.
4773 2010-08-03 Ian Lance Taylor <iant@google.com>
4775 * version.cc (version_string): Bump to 1.10.
4777 2010-08-03 Ian Lance Taylor <iant@google.com>
4780 * layout.h (enum Output_section_order): Define.
4781 (class Layout): Update declarations.
4782 * layout.cc (Layout::get_output_section): Add order parameter.
4783 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4784 is_first_non_relro parameters. Change all callers.
4785 (Layout::choose_output_section): Likewise.
4786 (Layout::add_output_section_data): Likewise.
4787 (Layout::make_output_section): Likewise. Set order.
4788 (Layout::default_section_order): New function.
4789 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4790 * output.cc (Output_section::Output_section): Initialize order_.
4791 Don't initialize deleted fields.
4792 (Output_segment::Output_segment): Don't initialize deleted
4794 (Output_segment::add_output_section_to_load): New function
4795 replacing add_output_section. Change all callers to call this or
4796 add_output_section_to_nonload.
4797 (Output_segment::add_output_section_to_nonload): New function.
4798 (Output_segment::remove_output_section): Rewrite.
4799 (Output_segment::add_initial_output_data): Likewise.
4800 (Output_segment::has_any_data_sections): Likewise.
4801 (Output_segment::is_first_section_relro): Likewise.
4802 (Output_segment::maximum_alignment): Likewise.
4803 (Output_segment::has_dynamic_reloc): New function replacing
4804 dynamic_reloc_count. Change all callers.
4805 (Output_segment::has_dynamic_reloc_list): New function replacing
4806 dynamic_reloc_count_list. Change all callers.
4807 (Output_segment::set_section_addresses): Rewrite.
4808 (Output_segment::set_offset): Rewrite.
4809 (Output_segment::find_first_and_last_list): Remove.
4810 (Output_segment::set_tls_offsets): Rewrite.
4811 (Output_segment::first_section_load_address): Likewise.
4812 (Output_segment::output_section_count): Likewise.
4813 (Output_segment::section_with_lowest_load_address): Likewise.
4814 (Output_segment::write_section_headers): Likewise.
4815 (Output_segment::print_sections_to_map): Likewise.
4816 * output.h (class Output_data): Remove dynamic_reloc_count_
4817 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4818 (Output_data::add_dynamic_reloc): Rewrite.
4819 (Output_data::has_dynamic_reloc): New function.
4820 (Output_data::dynamic_reloc_count): Remove.
4821 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4822 is_last_relro_, is_first_non_relro_, is_interp_,
4823 is_dynamic_linker_section_ fields. Add order and set_order
4824 functions. Remove is_relro_local, set_is_relro_local,
4825 is_last_relro, set_is_last_relro, is_first_non_relro,
4826 set_is_first_non_relro functions, is_interp, set_is_interp,
4827 is_dynamic_linker_section, and set_is_dynamic_linker_section
4829 (class Output_segment): Change Output_data_list from std::list to
4830 std:;vector. Add output_lists_ field. Remove output_data_ and
4831 output_bss_ fields. Update declarations.
4833 2010-08-02 Ian Lance Taylor <iant@google.com>
4835 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4836 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4837 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4839 2010-08-02 Ian Lance Taylor <iant@google.com>
4842 * script.cc (Script_options::Script_options): Initialize
4843 symbol_definitions_ and symbol_references_.
4844 (Script_options::add_symbol_assignment): Update
4845 symbol_definitions_ and symbol_references_.
4846 (Script_options::add_symbol_reference): New function.
4847 (script_symbol): New function.
4848 * script.h (class Script_options): Add symbol_definitions_ and
4849 symbol_references_ fields.
4850 (Script_options::referenced_const_iterator): New type.
4851 (Script_options::referenced_begin): New function.
4852 (Script_options::referenced_end): New function.
4853 (Script_options::is_referenced): New function.
4854 (Script_options::any_unreferenced): New function.
4855 * script-c.h (script_symbol): Declare.
4856 * yyscript.y (exp): Call script_symbol.
4857 * symtab.cc: Include "script.h".
4858 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4859 Change all callers. Check symbols referenced by scripts.
4860 (Symbol_table::add_undefined_symbols_from_command_line): Add
4861 layout parameter. Change all callers.
4862 (Symbol_table::do_add_undefined_symbols_from_command_line):
4863 Likewise. Break out loop body. Check symbols referenced by
4865 (Symbol_table::add_undefined_symbol_from_command_line): New
4866 function broken out of
4867 do_add_undefined_symbols_from_command_line.
4868 * symtab.h (class Symbol_table): Update declarations.
4869 * archive.cc: Include "layout.h".
4870 (Archive::should_include_member): Add layout parameter. Change
4871 all callers. Check for symbol mentioned in expression.
4872 * archive.h (class Archive): Update declaration.
4873 * object.cc (Sized_relobj::do_should_include_member): Add layout
4875 * object.h (Object::should_include_member): Add layout parameter.
4877 (Object::do_should_include_member): Add layout parameter.
4878 (class Sized_relobj): Update declaration.
4879 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4881 * dynobj.h (class Sized_dynobj): Update declaration.
4882 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4884 * plugin.h (class Sized_pluginobj): Update declaration.
4886 2010-08-02 Ian Lance Taylor <iant@google.com>
4889 * output.cc (Output_segment::set_offset): Search for the first and
4890 last sections rather than assuming that the list is in order.
4891 (Output_segment::find_first_and_last_list): New function.
4892 * output.h (class Output_segment): Update declarations.
4893 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4894 (relro_strip_test_SOURCES): New variable.
4895 (relro_strip_test_DEPENDENCIES): New variable.
4896 (relro_strip_test_LDFLAGS): New variable.
4897 (relro_strip_test_LDADD): New variable.
4898 (relro_strip_test.so): New target.
4900 2010-08-02 Ian Lance Taylor <iant@google.com>
4902 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4903 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4904 (Target_i386::got_tlsdesc_section): New function.
4905 (Target_i386::got_section): Create space for GOT entries for
4906 TLSDESC relocations.
4907 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4909 (Target_i386::Scan::global): Likewise.
4910 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4912 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4913 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4914 (Target_x86_64::got_tlsdesc_section): New function.
4915 (Target_x86_64::got_section): Create space for GOT entries for
4916 TLSDESC relocations.
4917 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4919 (Target_x86_64::Scan::global): Likewise.
4920 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4923 2010-08-02 Ian Lance Taylor <iant@google.com>
4925 * testsuite/final_layout.sh: Use dc to convert from hex to
4928 2010-07-29 Sriraman Tallam <tmsriram@google.com>
4930 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4931 paramter to the call to gold::gc_process_relocs.
4932 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4933 paramter to the call to gold::gc_process_relocs.
4934 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4935 parameter to the call to gold::gc_process_relocs.
4936 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4937 template parameter to the call to gold::gc_process_relocs.
4938 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4939 paramter to the call to gold::gc_process_relocs.
4940 * gc.h (get_embedded_addend_size): New function.
4941 (gc_process_relocs): Save the size of the reloc for use by ICF.
4942 * icf.cc (get_section_contents): Get the addend from the text section
4943 for SHT_REL relocation sections.
4944 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4945 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4946 * int_encoding.h (read_from_pointer): New overloaded function.
4947 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4948 * testsuite/icf_sht_rel_addend_test.sh: New file.
4949 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4950 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4952 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4954 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4955 * Makefile.in: Regenerate.
4956 * testsuite/Makefile.in: Regenerate.
4958 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4960 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4961 * gold/testsuite/debug_msg.cc: Likewise.
4962 * gold/testsuite/odr_violation1.cc
4963 * gold/testsuite/odr_violation2.cc
4965 2010-07-21 Cary Coutant <ccoutant@google.com>
4967 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4968 string, and length fields.
4969 (Output_merge_string::Merged_strings_list): New type.
4970 (Output_merge_string::Merged_strings_lists): New typedef.
4971 (Output_merge_string): Replace merged_strings_ with
4972 merged_strings_lists_.
4973 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4974 Merged_strings_list per input object and section. Don't store pointer
4975 to the string. Don't store length with each merged string entry.
4976 (Output_merge_string::finalize_merged_data): Loop over list of merged
4977 strings lists. Recompute length of each merged string.
4979 2010-07-15 Cary Coutant <ccoutant@google.com>
4981 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4984 2010-07-14 Ian Lance Taylor <iant@google.com>
4986 * descriptors.cc (Descriptors::open): Report correct name in error
4989 2010-07-13 Doug Kwan <dougkwan@google.com>
4991 * arm.cc (Arm_input_section::Arm_input_section): For a
4992 SHT_ARM_EXIDX section, always keeps the input sections.
4993 (Arm_input_section::set_exidx_section_link): New method.
4994 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4995 has_errors_ to false.
4996 (Arm_exidx_input_section::has_errors,
4997 Arm_exidx_input_section::set_has_errors): New methods.
4998 (Arm_exidx_input_section::has_errors_): New data member.
4999 (Arm_relobj::get_exidx_shndx_list): New method.
5000 (Arm_output_section::append_text_sections_to_list): Do not skip
5001 section without SHF_EXECINSTR.
5002 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5004 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5005 section header. Make error messages more verbose. Check for
5006 a non-executable section linked to an EXIDX section.
5007 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5008 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5009 check that there is no deferred EXIDX section if we exit early.
5010 Instead of not making an EXIDX section in case of an error, make one
5011 and set the has_errors flag of it.
5012 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5013 in a relocatable link.
5014 (Target_arm::do_relax): Look for the EXIDX output section instead of
5015 assuming that it is called .ARM.exidx.
5016 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5017 section list. Do not check for SHF_EXECINSTR section flags but
5018 skip any input section with errors.
5019 * output.cc (Output_section::Output_section): Initialize
5020 always_keeps_input_sections_ to false.
5021 (Output_section::add_input_section): Check for
5022 always_keeps_input_sections_.
5023 * output.h (Output_section::always_keeps_input_sections,
5024 Output_section::set_always_keeps_input_sections): New methods.
5025 (Output_section::always_keeps_input_sections): New data member.
5027 2010-07-13 Rafael Espindola <espindola@google.com>
5029 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5030 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5032 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5033 Ian Lance Taylor <iant@google.com>
5035 * output.h (Output_section_lookup_maps::add_merge_section):
5036 Correct check of whether value was inserted.
5037 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5038 (Output_section_lookup_maps::add_relaxed_input_section):
5040 * arm.cc (Target_arm::got_section): Remove used local os.
5041 * i386.cc (Target_i386::got_section): Likewise.
5042 * x86_64.cc (Target_x86_64::got_section): Likewise.
5043 * sparc.cc (Target_sparc::got_section): Likewise.
5044 (Target_sparc::relocate): Remove unused local have_got_offset.
5045 * powerpc.cc (Target_powerpc::relocate): Likewise.
5047 2010-07-13 Ian Lance Taylor <iant@google.com>
5049 * compressed_output.cc (zlib_decompress): Fix signature in
5052 * archive.cc (Archive::include_member): Unlock an external member
5053 of a thin archive. Don't bother to delete an object we know is
5056 2010-07-12 Cary Coutant <ccoutant@google.com>
5058 * compressed_output.cc (zlib_decompress): New function.
5059 (get_uncompressed_size): New function.
5060 (decompress_input_section): New function.
5061 * compressed_output.h (get_uncompressed_size): New function.
5062 (decompress_input_section): New function.
5063 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5064 Handle compressed debug sections.
5065 * layout.cc (is_compressed_debug_section): New function.
5066 (Layout::output_section_name): Map compressed section names to
5068 * layout.h (is_compressed_debug_section): New function.
5069 (is_debug_info_section): Recognize compressed debug sections.
5070 * merge.cc: Include compressed_output.h.
5071 (Output_merge_data::do_add_input_section): Handle compressed
5073 (Output_merge_string::do_add_input_section): Handle compressed
5075 * object.cc: Include compressed_output.h.
5076 (Sized_relobj::Sized_relobj): Initialize new data members.
5077 (build_compressed_section_map): New function.
5078 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5079 * object.h (Object::section_is_compressed): New method.
5080 (Object::do_section_is_compressed): New method.
5081 (Sized_relobj::Compressed_section_map): New type.
5082 (Sized_relobj::do_section_is_compressed): New method.
5083 (Sized_relobj::compressed_sections_): New data member.
5084 * output.cc (Output_section::add_input_section): Handle compressed
5086 * reloc.cc: Include compressed_output.h.
5087 (Sized_relobj::write_sections): Handle compressed debug sections.
5089 2010-07-08 Cary Coutant <ccoutant@google.com>
5091 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5092 weak when resolving to a dynamic def.
5093 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5094 for weak undef/dynamic def cases. Adjust callers.
5095 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5096 undef_binding_weak_.
5097 (Symbol_table::sized_write_globals): Adjust symbol binding.
5098 (Symbol_table::sized_write_symbol): Add binding parameter.
5099 * symtab.h (Symbol::set_undef_binding): New method.
5100 (Symbol::is_undef_binding_weak): New method.
5101 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5102 (Symbol_table::should_override): Add new parameter.
5103 (Symbol_table::sized_write_symbol): Add new parameter.
5105 * testsuite/weak_undef_file1.cc: Add new test case.
5106 * testsuite/weak_undef_file2.cc: Fix header comment.
5107 * testsuite/weak_undef_test.cc: Add new test case.
5109 2010-06-29 Doug Kwan <dougkwan@google.com>
5111 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5112 Initialize USE_SYMBOL_.
5113 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5115 (Arm_reloc_property::uses_symbol_): New data member declaration.
5116 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5117 uses symbol value and symbol is undefined but not weakly undefined.
5119 2010-06-28 Rafael Espindola <espindola@google.com>
5121 * plugin.cc (Plugin::load): Use dlerror.
5123 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5125 * symtab.cc (detect_odr_violations): When reporting an ODR
5126 violation, report an object where the symbol is defined.
5128 2010-06-25 Doug Kwan <dougkwan@google.com>
5130 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5131 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5133 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5134 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5135 target hook to detect function points.
5136 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5137 * icf.h (Icf::check_section_for_function_pointers): Change type of
5138 parameter SECTION_NAME to const reference to std::string. Use
5139 target hook to determine if section may have unsafe pointers.
5140 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5143 2010-06-21 Rafael Espindola <espindola@google.com>
5145 * fileread.cc (Input_file::find_fie): New
5146 (Input_file::open): Use Input_file::find_fie.
5147 * fileread.h (Input_file::find_fie): New
5148 * plugin.cc (set_extra_library_path): New.
5149 (Plugin::load): Add set_extra_library_path to the transfer vector.
5150 (Plugin_manager::set_extra_library_path): New.
5151 (Plugin_manager::add_input_file): Use the extra search path if set.
5152 (set_extra_library_path(): New.
5153 * plugin.h (Plugin_manager): Add set_extra_library_path and
5156 2010-06-19 Cary Coutant <ccoutant@google.com>
5158 * layout.cc (gdb_sections): Add .debug_types.
5159 (lines_only_debug_sections): Likewise.
5161 2010-06-18 Rafael Espindola <espindola@google.com>
5163 * plugin.cc (add_input_file,add_input_library)
5164 (Plugin_manager::add_input_file): Make filename arguments const.
5165 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5168 2010-06-16 Doug Kwan <dougkwan@google.com>
5170 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5171 .ARM.attributes section if we have not merged any input
5172 attributes sections.
5174 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5176 * arm.cc: Allow combining objects with no EABI version
5179 2010-06-15 Rafael Espindola <espindola@google.com>
5181 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5183 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5185 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5186 (struct iovec): Correct !HAVE_READV definition.
5188 2010-06-10 Cary Coutant <ccoutant@google.com>
5190 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5191 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5193 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5196 * symtab.h (Symbol::is_placeholder): New member function.
5197 * target-reloc.h (relocate_section): Check for placeholder symbols.
5199 * testsuite/Makefile.am (plugin_test_8): New test.
5200 (plugin_test_9): New test.
5201 * testsuite/Makefile.in: Regenerate.
5203 2010-06-09 Nick Clifton <nickc@redhat.com>
5205 * yyscript.y (input_list_element): Allow strings prefixed with
5206 the '-' character. Treat these as libraries.
5207 * script.cc (script_add_library): New function. Adds a library
5208 specified by "-l<name>" found in an input script.
5209 * script-c.h: Add prototype for script_add_library.
5211 2010-06-07 Doug Kwan <dougkwan@google.com>
5213 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5214 Restrict stub-group size to be within long conditional branch
5215 range when working around cortex-A8 erratum.
5217 2010-06-07 Damien Diederen <dd@crosstwine.com>
5219 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5222 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5226 (Output_section::Input_section_sort_entry::compare_section_ordering):
5227 Change to return non-zero correctly.
5228 (Output_section::Input_section_sort_section_order_index_compare
5229 ::operator()): Change to fix ambiguity in comparisons.
5231 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5233 * gold.h (is_wildcard_string): New function.
5234 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5235 (Layout::layout_eh_frame): Ditto.
5236 (Layout::find_section_order_index): New method.
5237 (Layout::read_layout_from_file): New method.
5238 * layout.h (Layout::find_section_order_index): New method.
5239 (Layout::read_layout_from_file): New method.
5240 (Layout::input_section_position_): New private member.
5241 (Layout::input_section_glob_): New private member.
5242 * main.cc (main): Call read_layout_from_file here.
5243 * options.h (--section-ordering-file): New option.
5244 * output.cc (Output_section::input_section_order_specified_): New
5246 (Output_section::Output_section): Initialize new member.
5247 (Output_section::add_input_section): Add new parameter.
5248 Keep input sections when --section-ordering-file is used.
5249 (Output_section::set_final_data_size): Sort input sections when
5250 section ordering file is specified.
5251 (Output_section::Input_section_sort_entry): Add new parameter.
5253 (Output_section::Input_section_sort_entry::compare_section_ordering):
5255 (Output_section::Input_section_sort_compare::operator()): Change to
5256 consider section_order_index.
5257 (Output_section::Input_section_sort_init_fini_compare::operator()):
5258 Change to consider section_order_index.
5259 (Output_section::Input_section_sort_section_order_index_compare
5260 ::operator()): New method.
5261 (Output_section::sort_attached_input_sections): Change to sort
5262 according to section order when specified.
5263 (Output_section::add_input_section<32, true>): Add new parameter.
5264 (Output_section::add_input_section<64, true>): Add new parameter.
5265 (Output_section::add_input_section<32, false>): Add new parameter.
5266 (Output_section::add_input_section<64, false>): Add new parameter.
5267 * output.h (Output_section::add_input_section): Add new parameter.
5268 (Output_section::input_section_order_specified): New
5270 (Output_section::set_input_section_order_specified): New method.
5271 (Input_section::Input_section): Initialize section_order_index_.
5272 (Input_section::section_order_index): New method.
5273 (Input_section::set_section_order_index): New method.
5274 (Input_section::section_order_index_): New member.
5275 (Input_section::Input_section_sort_section_order_index_compare): New
5277 (Output_section::input_section_order_specified_): New member.
5278 * script-sections.cc (is_wildcard_string): Delete and move modified
5280 (Output_section_element_input::Output_section_element_input): Modify
5281 call to is_wildcard_string.
5282 (Output_section_element_input::Input_section_pattern
5283 ::Input_section_pattern): Ditto.
5284 (Output_section_element_input::Output_section_element_input): Ditto.
5285 * testsuite/Makefile.am (final_layout): New test case.
5286 * testsuite/Makefile.in: Regenerate.
5287 * testsuite/final_layout.cc: New file.
5288 * testsuite/final_layout.sh: New file.
5290 2010-06-01 Rafael Espindola <espindola@google.com>
5292 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5294 2010-06-01 Rafael Espindola <espindola@google.com>
5296 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5297 visibility of symbols.
5299 2010-05-27 Doug Kwan <dougkwan@google.com>
5301 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5302 from start of output section instead of address for a local symbol
5303 in a merged or relaxed section when doing a relocatable link.
5305 2010-05-26 Rafael Espindola <espindola@google.com>
5308 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5309 adding sections the garbage collector removed.
5310 * gold/testsuite/Makefile.am: Add test.
5311 * gold/testsuite/Makefile.in: Regenerate.
5312 * gold/testsuite/plugin_test_7.sh: New.
5313 * gold/testsuite/plugin_test_7_1.c: New.
5314 * gold/testsuite/plugin_test_7_2.c: New.
5316 2010-05-26 Rafael Espindola <espindola@google.com>
5318 * script-sections.cc (Output_section_definition::set_section_addresses):
5319 Check for --section-start.
5321 2010-05-26 Doug Kwan <dougkwan@google.com>
5323 * arm.cc (Arm_scan_relocatable_relocs): New class.
5324 (Target_arm::relocate_special_relocatable): New method.
5325 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5326 (Arm_relocate_functions::thumb_branch_common): Same.
5327 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5328 instead of Default_scan_relocatable_relocs.
5329 * target-reloc.h (relocate_for_relocatable): Let target handle
5330 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5331 * target.h (Sized_target::relocate_special_relocatable): New method.
5333 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5335 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5337 2010-05-23 Doug Kwan <dougkwan@google.com>
5339 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5341 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5342 with a direct branch, not a conditional branch, to a stub.
5343 * merge.cc (Output_merge_base::record_input_section): New method
5345 (Output_merge_data::do_add_input_section): Record input section if
5346 keeps-input-sections flag is set.
5347 (Output_merge_string::do_add_input_section): Ditto.
5348 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5349 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5351 (Output_merge_base::keeps_input_sections,
5352 Output_merge_base::set_keeps_input_sections,
5353 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5355 (Output_merge_base::Input_sections): New type declaration.
5356 (Output_merge_base::input_sections_begin,
5357 Output_merge_base::input_sections_end,
5358 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5359 (Output_merge_base::bool keeps_input_sections_,
5360 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5361 Output_merge_base::input_sections_): New data members.
5362 (Output_merge_data::do_set_keeps_input_sections): New method
5364 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5365 * output.cc (Output_section::Input_section::relobj): Move method
5366 defintion from class declaration to here and handle merge sections.
5367 (Output_section::Input_section::shndx): Ditto.
5368 (Output_section::Output_section): Remove initializations of removed
5369 data members and initialize new data member LOOKUP_MAPS_.
5370 (Output_section::add_input_section): Set keeps-input-sections flag
5371 for a newly created merge output section as appropriate. Adjust code
5372 to use Output_section_lookup_maps class.
5373 (Output_section::add_relaxed_input_section): Adjst code for lookup
5374 maps code refactoring.
5375 (Output_section::add_merge_input_section): Add a new parameter
5376 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5377 class. If adding input section to a newly created merge output
5378 section fails, remove the new merge section.
5379 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5380 Adjust code for use of the Output_section_lookup_maps class.
5381 (Output_section::find_merge_section): Ditto.
5382 (Output_section::build_lookup_maps): New method defintion.
5383 (Output_section::find_relaxed_input_section): Adjust code to use
5384 Output_section_lookup_maps class.
5385 (Output_section::get_input_sections): Export merge sections. Adjust
5386 code to use Output_section_lookup_maps class.
5387 (Output_section:::add_script_input_section): Adjust code to use
5388 Output_section_lookup_maps class. Update lookup maps for merge
5390 (Output_section::discard_states): Use Output_section_lookup_maps.
5391 (Output_section::restore_states): Same.
5392 * output.h (Merge_section_properties): Move class defintion out of
5394 (Output_section_lookup_maps): New class.
5395 (Output_section::Input_section::is_merge_section): New method
5397 (Output_section::Input_section::relobj): Move defintion out of class
5398 defintion. Declare method only.
5399 (Output_section::Input_section::shndx): Ditto.
5400 (Output_section::Input_section::output_merge_base): New method defintion.
5401 (Output_section::Input_section::u2_.pomb): New union field.
5402 (Output_section::Merge_section_by_properties_map,
5403 Output_section::Output_section_data_by_input_section_map,
5404 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5406 (Output_section::add_merge_input_section): Add new parameter
5407 KEEPS_INPUT_SECTIONS.
5408 (Output_section::build_lookup_maps): New method declaration.
5409 (Output_section::merge_section_map_,
5410 Output_section::merge_section_by_properties_map_,
5411 Output_section::relaxed_input_section_map_,
5412 Output_section::is_relaxed_input_section_map_valid_): Remove data
5414 (Output_section::lookup_maps_): New data member.
5416 2010-05-21 Doug Kwan <dougkwan@google.com>
5419 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5420 avoid a compilation error.
5422 2010-05-19 Rafael Espindola <espindola@google.com>
5424 * script-sections.cc (Output_section_definition::allocate_to_segment):
5425 Update the phdrs_list even when the output section is NULL.
5426 * testsuite/Makefile.am: Add test.
5427 * testsuite/Makefile.in: Regenerate.
5428 * testsuite/script_test_9.cc: New.
5429 * testsuite/script_test_9.sh: New.
5430 * testsuite/script_test_9.t: New.
5432 2010-05-19 Doug Kwan <dougkwan@google.com>
5434 * arm.cc (Arm_input_section::original_size): New method.
5435 (Arm_input_section::do_addralign): Add a cast.
5436 (Arm_input_section::do_output_offset): Remove static cast.
5437 (Arm_input_section::original_addralign,
5438 Arm_input_section::original_size_): Change type to uint32_t.
5439 (Arm_input_section::init): Add safe casts for section alignment
5441 (Arm_input_section::set_final_data_size): Do not set address and
5442 offset of stub table.
5443 (Arm_output_section::fix_exidx_coverage): Change use of of
5444 Output_section::Simple_input_section to that of
5445 Output_section::Input_section.
5446 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5447 except for the first pass.
5448 * output.cc (Output_section::get_input_sections): Change type of
5449 input_sections to std::list<Input_section>.
5450 (Output_section::add_script_input_section): Rename from
5451 Output_section::add_simple_input_section. Change type of SIS
5452 parameter from Simple_input_section to Input_section.
5453 * output.h (Output_section::Simple_input_section): Remove class.
5454 (Output_section::Input_section): Change class visibility to public.
5455 (Output_section::Input_section::addralign): Use stored alignments
5456 for special input sections if set.
5457 (Output_section::Input_section::set_addralign): New method.
5458 (Output_section::get_input_sections): Change parameter type from
5459 list of Simple_input_section to list of Input_section.
5460 (Output_section::add_script_input_section): Rename from
5461 Output_section::add_simple_input_section. Change first parameter's
5462 type from Simple_input_section to Input_section and remove the
5463 second and third parameters.
5464 * script-sections.cc (Input_section::Input_section_list): Change
5465 type to list of Output_section::Input_section/
5466 (Input_section_info::Input_section_info): Change parameter type of
5467 INPUT_SECTION to Output_section::Input_section.
5468 (Input_section_info::input_section): Change return type.
5469 (Input_section_info::input_section_): Change type to
5470 Output_section::Input_section.
5471 (Output_section_element_input::set_section_addresses): Adjust code
5472 to use Output_section::Input_section instead of
5473 Output_section::Simple_input_section. Adjust code for renaming
5474 of Output_section::add_simple_input_section.
5475 (Orphan_output_section::set_section_addresses): Ditto.
5477 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5479 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5480 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5482 2010-05-18 Rafael Espindola <espindola@google.com>
5484 * options.cc (General_options::finalize): Handle -nostdlib.
5485 * options.h (nostdlib): New option.
5486 * script.cc (script_add_search_dir): Handle -nostdlib.
5488 2010-05-12 Doug Kwan <dougkwan@google.com>
5490 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5491 attributes section only if there no attributes section after merging.
5492 (Target_arm::merge_object_attributes): Move value of
5493 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5494 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5495 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5496 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5497 and arm_attr_merge_7.stdout.
5498 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5499 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5500 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5501 arm_attr_merge_7b.o): New rules.
5502 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5504 * testsuite/Makefile.in: Regenerate.
5505 * testsuite/arm_attr_merge.sh: New file.
5506 * testsuite/arm_attr_merge_[67][ab].s: Same.
5508 2010-05-05 Nick Clifton <nickc@redhat.com>
5510 * po/es.po: Updated Spanish translation.
5512 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5514 * Makefile.am (install-exec-local): Properly install gold as
5515 default cross linker.
5516 * Makefile.in: Regenerated.
5518 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5519 Nick Clifton <nickc@redhat.com>
5521 * configure.ac (install_as_default): Define and set to false
5522 unless --enable-gold or --enable-gold=both/gold has been
5524 * configure: Regenerate.
5526 * Makefile.am (install-exec-local): Install the executable as
5527 'ld.gold'. If install_as_default is true then also install it as
5529 * Makefile.in: Regenerated.
5531 2010-04-24 Ian Lance Taylor <iant@google.com>
5533 * layout.cc (Layout::layout_reloc): In relocatable link don't
5534 combine reloc sections for grouped sections.
5536 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5538 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5539 sections that are not ordinary to icf.
5540 * icf.cc (get_section_contents): Handle relocation pointing to section
5541 with no object or shndx information.
5542 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5543 * testsuite/Makefile.in: Regenerate.
5544 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5545 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5547 2010-04-22 Ian Lance Taylor <iant@google.com>
5549 * expression.cc (Expression::Expression_eval_info): Add
5550 result_alignment_pointer field.
5551 (Expression::eval_with_dot): Add result_alignment_pointer
5552 parameter. Change all callers.
5553 (Expression::eval_maybe_dot): Likewise.
5554 (class Binary_expression): Add alignment_pointer parameter to
5555 left_value and right_value. Change all callers.
5556 (BINARY_EXPRESSION): Set result alignment.
5557 (class Trinary_expression): Add alignment_pointer parameter to
5558 arg2_value and arg3_value. Change all callers.
5559 (Trinary_cond::value): Set result alignment.
5560 (Max_expression::value, Min_expression::value): Likewise.
5561 (Align_expression::value): Likewise.
5562 * script-sections.cc (class Sections_element): Add dot_alignment
5563 parameter to set_section_addresses virtual function. Update
5565 (class Output_section_element): Likewise.
5566 (Script_sections::create_segments): Add dot_alignment parameter.
5568 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5569 (Script_sections::set_phdrs_clause_addresses): Likewise.
5570 * script-sections.h: Update declarations.
5571 * script.h: Update declarations.
5572 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5574 * testsuite/script_test_3.t: Set large alignment.
5575 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5576 segment has expected alignment.
5578 2010-04-22 Nick Clifton <nickc@redhat.com>
5580 * po/gold.pot: Updated by the Translation project.
5581 * po/vi.po: Updated Vietnamese translation.
5583 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5585 * testsuite/Makefile.am (check_PROGRAMS): Add
5586 icf_virtual_function_folding_test.
5587 * testsuite/Makefile.in: Regenerated.
5589 2010-04-15 Andrew Haley <aph@redhat.com>
5591 * options.h (merge_exidx_entries): New option.
5592 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5593 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5594 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5595 (Target_arm::merge_exidx_entries): New function.
5596 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5597 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5598 to Arm_exidx_fixup constructor.
5599 Add new arg, merge_exidx_entries.
5600 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5601 Arm_output_section::fix_exidx_coverage.
5603 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5605 * icf.cc (get_section_contents): Check for preemptible functions.
5606 Ignore addend when appropriate.
5607 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5609 (add_from_relobj): Check for section folded.
5610 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5611 * symtab.h (should_add_dynsym_entry): Add new parameter.
5612 * target-reloc.h (scan_relocs): Check for section folded.
5613 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5614 Check reloc types for function pointers in shared objects.
5615 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5617 (icf_preemptible_functions_test): New test case.
5618 (icf_string_merge_test): New test case.
5619 * testsuite.Makefile.in: Regenerate.
5620 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5621 bar_glob. Refactor code.
5622 * testsuite/icf_preemptible_functions_test.cc: New file.
5623 * testsuite/icf_preemptible_functions_test.sh: New file.
5624 * testsuite/icf_string_merge_test.cc: New file.
5625 * testsuite/icf_string_merge_test.sh: New file.
5626 * testsuite/icf_virtual_function_folding_test.cc: New file.
5627 * testsuite/icf_virtual_function_folding_test.sh: New file.
5629 2010-04-14 Doug Kwan <dougkwan@google.com>
5631 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5632 for local symbol recounting if we remove a section due to ICF.
5633 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5634 there are no regular objects in input.
5636 2010-04-13 Doug Kwan <dougkwan@google.com>
5638 * arm.cc (Arm_input_section::set_final_data_size): Compute
5639 accurate final data size instead of using current data size.
5641 2010-04-09 Doug Kwan <dougkwan@google.com>
5643 * layout.cc (Layout::choose_output_section): Handle script section
5645 (Layout::make_output_section_for_script): Add section type parameter.
5646 Handle script section types.
5647 * layout.h (Layout::make_output_section_for_script): Add section
5649 * output.cc (Output_section::Output_section): Initialize data member
5651 (Output_section::do_reset_address_and_file_offset): Do not set address
5652 to 0 if section is a NOLOAD section.
5653 * output.h (Output_section::is_noload): New method.
5654 (Output_section::set_is_noload): Ditto.
5655 (Output_section::is_noload_): New data member.
5656 * script-c.h (Script_section_type): New enum type.
5657 (struct Parser_output_section_header): Add new file section_type.
5658 * script-sections.cc (Sections_element::output_section_name): Add
5659 parameter for returning script section type.
5660 (Output_section_definition::output_section_name): Ditto.
5661 (Output_section_definition::section_type)P; New method.
5662 (Output_section_definiton::script_section_type_name): Ditto.
5663 (Output_section_definition::script_section_type_): New data member.
5664 (Output_section_definition::Output_section_definition): Initialize
5665 data member Output_section_definition::script_section_type_.
5666 (Output_section_definition::create_sections): Pass script section type
5667 to Layout::make_output_section_for_script.
5668 (Output_section_definition::output_section_name): Return script
5669 section type to caller.
5670 (Output_section_definition::set_section_address): Do not advance
5671 dot value and load address if section type is NOLOAD. Set address
5672 of NOLOAD sections regardless of section flags.
5673 (Output_section_definition::print): Print section type if it is
5674 not SCRIPT_SECTION_TYPE_NONE.
5675 (Output_section_definition::section_type): New method.
5676 (Output_section_definition::script_section_type_name): Ditto.
5677 (Script_sections::output_section_name): Add new parameter
5678 PSECTION_TYPE for returning script section type. Pass it to
5679 section elements. Handle discard sections.
5680 (Sort_output_sections::operator()): Handle NOLOAD sections.
5681 * script-sections.h (Script_sections::Section_type): New enum type.
5682 (Script_sections::output_section_name): Add a new parameter for
5683 returning script section type.
5684 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5686 * yyscript.y (union): Add new field SECTION_TYPE.
5687 (COPY, DSECT, INFO, NOLOAD): New tokens.
5688 (opt_address_and_section_type): Change type to output_section_header.
5689 (section_type): New non-terminal
5690 (section_header): Handle section type.
5691 (opt_address_and_section_type): Return section type value.
5693 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5695 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5696 * testsuite/plugin_common_test_2.c (foo): Likewise.
5698 2010-04-08 Doug Kwan <dougkwan@google.com>
5700 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5702 * output.cc (Output_section::add_merge_input_section): Simplify
5703 code and return status of Output_merge_base::add_input_section.
5704 Update merge section map only if Output_merge_base::add_input_section
5707 2010-04-07 Doug Kwan <dougkwan@google.com>
5709 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5710 if section is marked as containing instructions but has no mapping
5712 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5713 correct section index.
5714 (Arm_relobj::find_linked_text_section): Ditto.
5716 2010-04-07 Cary Coutant <ccoutant@google.com>
5718 * archive.cc (include_member): Destroy Read_symbols_data object before
5720 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5721 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5722 (Read_symbols_data::~Read_symbols_data) New destructor.
5723 (Section_relocs::Section_relocs) New constructor.
5724 (Section_relocs::~Section_relocs) New destructor.
5725 (Read_relocs_data::Read_relocs_data) New constructor.
5726 (Read_relocs_data::~Read_relocs_data) New destructor.
5727 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5728 pointers to NULL after deleting.
5730 2010-04-07 Doug Kwan <dougkwan@google.com>
5732 * arm.cc: Replace "endianity" with "endianness" in comments.
5733 (Arm_exidx_cantunwind): Ditto.
5734 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5735 (Arm_relobj::merge_flags_and_attributes): New method.
5736 (Arm_relobj::merge_flags_and_attributes_): New data member.
5737 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5738 (Arm_relobj::scan_sections_for_stubs): Ditto.
5739 (Arm_relobj::do_read_symbols): Check to see if we really want to
5740 merge processor-specific flags and attributes. Exit early if
5741 an object is empty except for section names and the undefined symbol.
5742 (Target_arm::do_finalize_sections): Move check for ELF format to
5743 Arm_relobj::do_read_symbols. Merge processor specific flags and
5744 attributes from a regular object only when we have determined that
5745 it is aapropriate. Do not create an .ARM.attributes section in
5746 output if there is no regular input object.
5747 (Target_arm::merge_processor_specific_flags): Check
5748 --warn-mismatch before printing any error.
5749 (Target_arm::merge_object_attributes): Ditto.
5750 * gold.cc (queue_middle_tasks): Handle the case in which there is
5751 no regular object in input.
5752 * options.cc (General_options::parse_EB): New method.
5753 (General_options::parse_EL): Same.
5754 (General_options::General_options): Initialize endianness_.
5755 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5757 (General_options::Endianness): New enum.
5758 (General_options::endianness): New method.
5759 (General_options::endianness_): New data member.
5760 * parameters.cc (Parameters::set_options): Check target endianness.
5761 (Parameters::set_target_once): Ditto.
5762 (Parameters::check_target_endianness): New method.
5763 (parameters_force_valid_target): If either -EL or -EB is specified,
5764 use it to define endianness of default target.
5765 * parameters.h (Parameters::check_target_endianness): New method
5767 * target.h (class Target): Change "endianity" to "endianness"
5770 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5772 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5773 * configure: Regenerate.
5774 * Makefile.in: Regenerate.
5775 * testsuite/Makefile.in: Regenerate.
5777 2010-04-06 Cary Coutant <ccoutant@google.com>
5780 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5781 prevailing definitions of common symbols.
5782 * testsuite/plugin_test_6.sh: New test case.
5783 * testsuite/plugin_common_test_1.c: New test case.
5784 * testsuite/plugin_common_test_2.c: New test case.
5785 * testsuite/Makefile.am (plugin_test_6): New test case.
5786 * testsuite/Makefile.in: Regenerate.
5788 2010-04-06 Nick Clifton <nickc@redhat.com>
5790 * po/vi.po: New Vietnamese translation.
5792 2010-03-30 Doug Kwan <dougkwan@google.com>
5794 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5796 2010-03-25 Doug Kwan <dougkwan@google.com>
5798 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5799 to avoid a conversion warning on a 32-bit host.
5801 2010-03-24 Ian Lance Taylor <iant@google.com>
5803 * testsuite/script_test_3.t: Add a TLS segment.
5804 * testsuite/Makefile.am (check_PROGRAMS): Add
5805 tls_phdrs_script_test.
5806 (tls_phdrs_script_test_SOURCES): Define.
5807 (tls_phdrs_script_test_DEPENDENCIES): Define.
5808 (tls_phdrs_script_test_LDFLAGS): Define.
5809 (tls_phdrs_script_test_LDADD): Define.
5810 * testsuite/Makefile.in: Rebuild.
5812 2010-03-23 Cary Coutant <ccoutant@google.com>
5814 * fileread.cc (find_or_make_view): Fix comment.
5816 2010-03-23 Ian Lance Taylor <iant@google.com>
5818 * script-sections.cc (class Orphan_section_placement): Define
5819 PLACE_TLS and PLACE_TLS_BSS.
5820 (Orphan_section_placement::Orphan_section_placement): Initialize
5822 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5823 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5824 (tls_script_test_SOURCES): Define.
5825 (tls_script_test_DEPENDENCIES): Define.
5826 (tls_script_test_LDFLAGS): Define.
5827 (tls_script_test_LDADD): Define.
5828 * testsuite/Makefile.in: Rebuild.
5830 2010-03-22 Doug Kwan <dougkwan@google.com>
5832 * arm.cc (Arm_relocate_functions::abs8,
5833 Arm_relocate_functions::abs16): Use correct check for overflow
5834 specified in the ARM ELF specs.
5835 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5836 target of a BLX instruction specially.
5837 (Reloc_stub::stub_type_for_reloc): Ditto.
5838 (Relocate::relocate): Use symbolic names instead of numeric relocation
5839 codes to report error.
5840 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5842 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5843 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5844 thumb2_blx_out_of_range.stdout
5845 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5846 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5847 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5848 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5849 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5850 thumb2_blx_in_range, thumb2_blx_in_range.o,
5851 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5852 thumb2_blx_out_of_range.o): New rules.
5853 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5854 thumb2_blx_in_range and thumb2_blx_out_of_range.
5855 * testsuite/Makefile.in: Regenerate.
5856 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5857 * testsuite/thumb_blx_in_range.s: New file.
5858 * testsuite/thumb_blx_out_of_range.s: New file.
5860 2010-03-22 Rafael Espindola <espindola@google.com>
5862 * archive.cc (Should_include): Move to archive.h.
5863 (should_include_member): Make it a member of Archive.
5865 (Add_lib_group_symbols): New.
5866 * archive.h: Include options.h.
5867 (Archive_member): Moved from Archive.
5868 (Should_include): Moved from archive.cc.
5870 (Add_lib_group_symbols): New.
5871 * dynobj.cc (do_should_include_member): New.
5872 * dynobj.h (do_should_include_member): New.
5873 * gold.cc (queue_initial_tasks): Update call to queue.
5874 * main.cc (main): Print lib group stats.
5875 * object.cc (do_should_include_member): New.
5876 * object.h: Include archive.h.
5877 (Object::should_include_member): New.
5878 (Object::do_should_include_member): New.
5879 (Sized_relobj::do_should_include_member): New.
5880 * options.cc (General_options::parse_start_lib): New.
5881 (General_options::parse_end_lib): New.
5882 (Input_arguments::add_file): Handle lib groups.
5883 (Input_arguments::start_group): Check we are not in a lib.
5884 (Input_arguments::start_lib): New.
5885 (Input_arguments::end_lib): New.
5886 * options.h (General_options): Add start_lib and end_lib.
5887 (Input_argument::lib_): New.
5888 (Input_argument::lib): New.
5889 (Input_argument::is_lib): New.
5890 (Input_file_lib): New.
5891 (Input_arguments::in_lib_): New.
5892 (Input_arguments::in_lib): New.
5893 (Input_arguments::start_lib): New.
5894 (Input_arguments::end_lib_): New.
5895 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5896 in unused members as preempted.
5897 (Sized_pluginobj::do_should_include_member): New.
5898 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5899 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5901 (Read_symbols::do_whole_lib_group): New.
5902 (Read_symbols::do_lib_group): New.
5903 (Read_symbols::do_read_symbols): Handle lib groups.
5904 (Read_symbols::get_name): Handle lib groups.
5905 * readsyms.h (Read_symbols): Add an archive member pointer.
5906 (Read_symbols::do_whole_lib_group): New.
5907 (Read_symbols::do_lib_group): New.
5908 (Read_symbols::member_): New.
5909 * script.cc (read_input_script): Update call to queue_soon.
5911 2010-03-19 Doug Kwan <dougkwan@google.com>
5913 * arm.cc (Stub_table::Stub_table): Initialize new data members
5914 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5915 (Stub_table::add_reloc_stub): Assign stub offset and update
5916 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5917 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5919 (Stub_table::update_data_size_and_addralign): Use
5920 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5921 instead of going over all reloc stubs.
5922 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5923 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5924 Stringpool_template::offset_ to size of Stringpool_char.
5925 (Stringpool_template::new_key_offset): Remove code to initialize
5926 Stringpool_template::offset_.
5927 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5928 Stringpool_template::offset_ to zero.
5930 2010-03-15 Doug Kwan <dougkwan@google.com>
5932 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5934 (Stringpool_template::new_key_offset): New method.
5935 (Stringpool_template::add_string): Assign offsets when adding new
5937 (Stringpool_template::set_string_offsets): Do not set string offsets
5938 when not optimizing.
5939 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5941 (Chunked_vector::clear): Clear size_.
5942 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5943 (Chunked_vector::size): Return size_.
5944 (Chunked_vector::push_back): Use size_ to find insert position.
5945 (Chunked_vector::size_): New data member.
5946 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5947 (Stringpool_template::new_key_offset): New method declaration.
5948 (Stringpool_template::offset_): New data member.
5950 2010-03-15 Rafael Espindola <espindola@google.com>
5952 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5953 Add_symbols' constructor.
5954 * readsyms.h (Add_symbols): Remove the input_group member.
5956 2010-03-10 Ian Lance Taylor <iant@google.com>
5958 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5959 target to ask whether a reference to a symbol requires a stack
5961 * target.h (Target::is_call_to_non_split): New function.
5962 (Target::do_is_call_to_non_split): Declare virtual function.
5963 * target.cc: Include "symtab.h".
5964 (Target::do_is_call_to_non_split): New function.
5965 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5967 2010-03-10 Cary Coutant <ccoutant@google.com>
5969 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5970 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5971 (File_read::open[2]): Add whole_file_view_ to list of views.
5972 (File_read::make_view): Remove test of whole_file_view_.
5973 (File_read::find_or_make_view): Create whole_file_view_ if
5975 (File_read::clear_views): Replace bool parameter with enum;
5976 adjust all callers. Don't delete views with permanent data;
5977 do delete cached views and views from archives if
5978 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5979 if clearing the corresponding view.
5980 * fileread.h (File_read::Clear_views_mode): New enum.
5981 (File_read::View::is_permanent_view): New method.
5982 (File_read::clear_views): Replace bool parameter
5983 with enum; adjust all callers.
5984 * options.h (General_options): Change keep_files_mapped option;
5985 add map_whole_files.
5986 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5988 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5991 2010-03-10 David S. Miller <davem@davemloft.net>
5993 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5995 2010-03-09 Sriraman Tallam <tmsriram@google.com>
5997 * icf.cc (get_section_contents): Add '@' marker after processing the
6000 2010-03-08 Doug Kwan <dougkwan@google.com>
6002 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6003 due to a conversion warning.
6004 (Arm_relobj::update_output_local_symbol_count): Check for local
6005 symbol with unset output index.
6007 2010-03-05 Ian Lance Taylor <iant@google.com>
6009 * options.h (class General_options): Add --spare-dynamic-tags.
6010 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6011 --spare-dynamic-tags.
6013 2010-03-05 Ian Lance Taylor <iant@google.com>
6015 * incremental.cc: Include "libiberty.h".
6017 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6019 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6020 function, is_info_ member.
6021 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6022 (Versions::Versions): Update caller.
6023 (Versions::define_base_version): Likewise.
6024 (Versions::add_def): Likewise.
6026 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6028 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6029 (Scan::possible_function_pointer_reloc): New function.
6030 (Scan::local_reloc_may_be_function_pointer): Change to call
6031 possible_function_pointer_reloc.
6032 (Scan::global_reloc_may_be_function_pointer): Ditto.
6033 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6034 relocations in ".data.rel.ro._ZTV" section.
6035 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6036 * testsuite/icf_safe_so_test.cc: Ditto.
6037 * testsuite/icf_safe_test.cc: Ditto.
6038 * testsuite/icf_safe_test.sh: Ditto.
6040 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6041 Ian Lance Taylor <iant@google.com>
6043 * target-reloc.h (relocate_section): Check the symbol table index
6044 for -1U before setting the local symbol index.
6045 (scan_relocatable_relocs): If copying the relocation, record that
6046 the local symbol is required.
6047 * object.h (Symbol_value::is_output_symtab_index_set): New
6049 (Symbol_value::may_be_discarded_from_output_symtab): New
6051 (Symbol_value::has_output_symtab_entry): New function.
6052 (Symbol_value::needs_output_symtab_entry): Remove.
6053 (Symbol_value::output_symtab_index): Make sure the symbol index is
6055 (Symbol_value::set_output_symtab_index): Make sure the symbol
6056 index is not set. Make sure the new index is valid.
6057 (Symbol_value::set_must_have_output_symtab_entry): New function.
6058 (Symbol_value::has_output_dynsym_entry): New function.
6059 (Symbol_value::set_output_dynsym_index): Make sure the new index
6061 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6062 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6063 local symbol if permitted.
6064 (Sized_relobj::do_finalize_local_symbols): Call
6065 is_output_symtab_index_set rather than needs_output_symtab_entry.
6066 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6067 rather than needs_output_symtab_entry. Call
6068 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6069 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6070 is_output_symtab_index_set rather than needs_output_symtab_entry.
6071 * testsuite/discard_locals_relocatable_test.c: New file.
6072 * testsuite/discard_locals_test.sh: Test -r.
6073 * testsuite/Makefile.am (check_DATA): Add
6074 discard_locals_relocatable_test1.syms,
6075 discard_local_relocatable_test2.syms.
6076 (MOSTLYCLEANFILES): Likewise. Also add
6077 discard_locals_relocatable_test1.lout and
6078 discard_locals_relocatable_test2.out.
6079 (discard_locals_relocatable_test1.syms): New target.
6080 (discard_locals_relocatable_test.o): New target.
6081 (discard_locals_relocatable_test1.out): New target.
6082 (discard_locals_relocatable_test2.syms): New target.
6083 (discard_locals_relocatable_test2.out): New target.
6084 (various): Add missing ../ld-new dependencies.
6085 * testsuite/Makefile.in: Rebuild.
6087 2010-03-03 Nick Clifton <nickc@redhat.com>
6089 * po/fi.po: New Finnish translation.
6091 2010-03-01 Doug Kwan <dougkwan@google.com>
6093 * layout.cc (Layout::Layout): Force section types of .init_array*,
6094 .preinit_array* and .fini_array* sections.
6095 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6096 Fix check of return value of std::string::find.().
6097 (Output_section::Input_section_sort_compare::operator()): Remove
6098 comment about .init_array.
6099 (Output_section::Input_section_sort_init_fini_compare::operator()):
6101 (Output_section::sort_attached_input_sections): Handle .init_array
6102 and .fini_array specially.
6103 * output.h (Output_section::Inut_section_sort_compare): Update
6105 (Output_section::Input_section_sort_init_fini_compare): New struct.
6107 2010-02-26 Doug Kwan <dougkwan@google.com>
6109 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6110 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6111 * testsuite/debug_msg.sh: Avoid matching source line number for
6112 use of global variable undef_int.
6114 2010-02-26 Doug Kwan <dougkwan@google.com>
6116 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6117 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6118 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6119 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6120 * options.cc (General_options::General_options): Initialize member
6122 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6123 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6124 and rm_no_fix_v4bx.stdout
6125 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6126 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6127 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6128 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6129 and arm_no_fix_v4bx.
6130 * Makefile.in: Regenerate.
6131 * testsuite/arm_fix_v4bx.s: New file.
6132 * testsuite/arm_fix_v4bx.sh: Ditto.
6134 2010-02-24 Doug Kwan <dougkwan@google.com>
6136 * arm.cc (Target_arm::got_section): Make the .got section the first
6137 non RELRO section in the data segment.
6138 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6139 suffixes of section names.
6141 2010-02-24 Doug Kwan <dougkwan@google.com>
6143 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6144 flags and attributes merging if an input file is a binary file.
6145 * fileread.cc (Input_file::open): Record format of original file.
6146 * fileread.h (Input_file::Format): New enum type.
6147 (Input_file::Input_file): Initialize data member format_.
6148 (Input_file::format): New method definition.
6149 (Input_file::format_):: New data member.
6151 2010-02-24 Doug Kwan <dougkwan@google.com>
6153 * arm.cc (Arm_output_data_got): New class.
6154 (ARM_TCB_SIZE): New constant
6155 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6156 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6157 If user uses a script with a SECTIONS clause, issue only a warning
6158 for a misplaced EXIDX input section. Otherwise, issue an error.
6159 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6161 (Target_arm::got_mode_index_entry): Handle static linking.
6162 (Target_arm::Scan::local): Ditto.
6163 (Target_arm::Scan::global): Ditto.
6164 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6165 all incorrectly implemented relocations.
6166 (Target_arm::fix_exidx_coverage): Pass layout to
6167 Arm_output_section::fix_exidx_coverage.
6168 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6169 from ".ARM.exidx." and ".ARM.extab.".
6171 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6173 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6174 section if it does not already exist.
6175 * attributes.cc (Attributes_section_data::Attributes_section_data):
6176 Don't crash if size is zero.
6178 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6179 Ian Lance Taylor <iant@google.com>
6181 * gold.cc (queue_middle_tasks): If no input files were opened,
6183 * workqueue.h (Task_function::Task_function): Assert that there is
6186 2010-02-22 Doug Kwan <dougkwan@google.com>
6188 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6189 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6190 types to avoid warnings due to different uint64_t implementations
6193 2010-02-21 Doug Kwan <dougkwan@google.com>
6195 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6196 handling of the maximum backward branch offset.
6197 (Arm_relocate_functions::thumb_branch_common): Ditto.
6198 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6199 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6200 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6201 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6202 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6203 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6204 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6205 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6206 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6207 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6208 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6209 thumb2_bl_out_of_range.o): New rules.
6210 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6211 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6212 thumb2_bl_out_of_range
6213 * testsuite/Makefile.in: Regenerate.
6214 * testsuite/arm_bl_in_range.s: New file.
6215 * testsuite/arm_bl_out_of_range.s: Ditto.
6216 * testsuite/arm_branch_in_range.sh: Ditto.
6217 * testsuite/arm_branch_range.t: Ditto.
6218 * testsuite/thumb2_branch_range.t: Ditto.
6219 * testsuite/thumb_bl_in_range.s: Ditto.
6220 * testsuite/thumb_bl_out_of_range.s: Ditto.
6221 * testsuite/thumb_branch_range.t: Ditto.
6223 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6225 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6226 Add reloc offset information.
6227 * icf.cc (get_section_contents): Change iterators to point to the new
6228 vectors. Add reloc offset information to the contents.
6229 * icf.h (Icf::Sections_reachable_info): New typedef.
6230 (Icf::Sections_reachable_list): New typedef.
6231 (Icf::Offset_info): New typedef.
6232 (Icf::Reloc_info): New struct typedef.
6233 (Icf::Reloc_info_list): New typedef.
6234 (Icf::symbol_reloc_list): Delete method.
6235 (Icf::addend_reloc_list): Delete method.
6236 (Icf::section_reloc_list): Delete method.
6237 (Icf::reloc_info_list): New method.
6238 (Icf::reloc_info_list_): New member.
6240 2010-02-19 Doug Kwan <dougkwan@google.com>
6242 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6243 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6244 * arm.cc (Arm_relocation_functions): New forward declaration.
6245 (Target_arm::Target_arm): Initialize new data members
6246 got_mod_index_offset_ and tls_base_symbol_defined_.
6247 (Target_arm::Relocate::relocate_tls): New method.
6248 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6249 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6251 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6252 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6253 (Target_arm::got_mod_index_offset_,
6254 Target_arm::tls_base_symbol_defined_): New data members.
6255 (Target_arm::Scan::local, Target::Scan::global,
6256 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6259 2010-02-18 Doug Kwan <dougkwan@google.com>
6261 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6262 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6263 text section as a parameter becuase some broken tools may not set
6264 the link in section header.
6265 (Target_arm::has_got_section): New method.
6266 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6267 without any mapping symbol as data only. Remove warning.
6268 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6269 link in its section header, try to discover the link by inspecting the
6270 REL31 relocation at the beginning of the section.
6271 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6273 (Target_arm::Scan::global): Treat any reference to the symbol
6274 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6276 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6278 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6279 (Scan::global_reloc_may_be_function_pointer): New function.
6280 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6281 (Scan::global_reloc_may_be_function_pointer): New function.
6282 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6283 (Scan::global_reloc_may_be_function_pointer): New function.
6284 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6285 (Scan::global_reloc_may_be_function_pointer): New function.
6286 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6287 (Scan::global_reloc_may_be_function_pointer): New function.
6288 (Scan::possible_function_pointer_reloc): New function.
6289 (Target_x86_64::can_check_for_function_pointers): New function.
6290 * gc.h (gc_process_relocs): Scan relocation types to determine if
6291 function pointers were taken for targets that support it.
6292 * icf.cc (Icf::find_identical_sections): Include functions for
6293 folding in safe ICF whose pointer is not taken.
6294 * icf.h (Secn_fptr_taken_set): New typedef.
6295 (fptr_section_id_): New member.
6296 (section_has_function_pointers): New function.
6297 (set_section_has_function_pointers): New function.
6298 (check_section_for_function_pointers): New function.
6299 * options.h: Fix comment for safe ICF option.
6300 * target.h (can_check_for_function_pointers): New function.
6301 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6302 Modify icf_safe_test for X86-64.
6303 * testsuite/Makefile.in: Regenerate.
6304 * testsuite/icf_safe_so_test.cc: New file.
6305 * testsuite/icf_safe_so_test.sh: New file.
6306 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6307 (main): Change to take pointer to function kept_func_3.
6308 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6309 folding is done correctly for X86-64.
6311 2010-02-12 David S. Miller <davem@davemloft.net>
6313 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6314 is_symbolless parameter.
6315 (Output_reloc<SHT_REL>::is_symbolless): New.
6316 (Output_reloc<SHT_REL>::is_symbolless_): New.
6317 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6318 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6319 (Output_reloc<SHT_RELA>::is_symbolless): New.
6320 (Output_data_reloc::add_global): Handle is_symbolless.
6321 (Output_data_reloc::add_global_relative): Likewise.
6322 (Output_data_reloc::add_local): Likewise.
6323 (Output_data_reloc::add_local_relative): Likewise.
6324 (Output_data_reloc::add_symbolless_global_addend): New.
6325 (Output_data_reloc::add_symbolless_local_addend): New.
6326 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6328 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6329 instead of ->is_relative_
6330 (Output_reloc::write): Likewise.
6331 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6332 (Output_reloc::write_rel): Simplify.
6334 * sparc.cc (Target_sparc::Scan::local): Use
6335 ->add_symbolless_local_addend as needed.
6336 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6337 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6338 based upon relocation offset.
6340 2010-02-11 Doug Kwan <dougkwan@google.com>
6342 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6343 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6344 beginning of function.
6345 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6346 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6347 parameter is_32bit in calls to should_apply_static_reloc.
6348 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6349 (check_DATA): Add arm_abs_global.stdout.
6350 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6351 arm_abs_global.stdout): New rules.
6352 (MOSTLLYCLEANFILES): Add arm_abs_global
6353 * Makefile.in: Regenerate.
6354 * testsuite/arm_abs_global.s: New file.
6355 * testsuite/arm_abs_global.sh: Ditto.
6356 * testsuite/arm_abs_lib.s: Ditto.
6358 2010-02-11 Ian Lance Taylor <iant@google.com>
6360 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6362 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6363 Allocate_commons_task first.
6364 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6365 task, rather than symtab_lock_.
6366 (Gc_process_relocs::~Gc_process_relocs): New function.
6367 (Gc_process_relocs::is_runnable): Check this_blocker_.
6368 (Gc_process_relocs::locks): Use next_blocker_ rather than
6370 (Scan_relocs::~Scan_relocs): New function.
6371 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6373 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6375 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6376 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6377 constructor accordingly.
6378 (class Gc_process_relocs): Likewise.
6379 (class Scan_relocs): Likewise.
6380 * common.h (class Allocate_commons_task): Remove symtab_lock_
6381 field, and corresponding constructor parameter.
6382 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6384 (Allocate_commons_task::locks): Likewise.
6386 2010-02-11 Ian Lance Taylor <iant@google.com>
6388 * gold-threads.h (class Once): Define.
6389 (class Initialize_lock): Rewrite as child of Once.
6390 * gold-threads.cc (class Once_initialize): Define.
6391 (once_pointer_control): New static variable.
6392 (once_pointer, once_arg): New static variables.
6393 (c_run_once): New static function.
6394 (Once::Once, Once::run_once, Once::internal_run): New functions.
6395 (class Initialize_lock_once): Remove.
6396 (initialize_lock_control): Remove.
6397 (initialize_lock_pointer): Remove.
6398 (initialize_lock_once): Remove.
6399 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6400 (Initialize_lock::initialize): Rewrite.
6401 (Initialize_lock::do_run_once): New function.
6402 * archive.cc (Archive::interpret_header): Only clear name if it is
6404 * fileread.cc: Include "gold-threads.h"
6405 (file_counts_lock): New static variable.
6406 (file_counts_initialize_lock): Likewise.
6407 (File_read::release): Only increment counts when using --stats.
6408 Use a lock around the increment.
6409 * parameters.cc (class Set_parameters_target_once): Define.
6410 (set_parameters_target_once): New static variable.
6411 (Parameters::Parameters): Move here from parameters.h.
6412 (Parameters::set_target): Rewrite.
6413 (Parameters::set_target_once): New function.
6414 (Parameters::clear_target): Move here and rewrite.
6415 * parameters.h (class Parameters): Update declarations. Add
6416 set_parameters_target_once_ field.
6417 (Parameters::Parameters): Move to parameters.cc.
6418 (Parameters::clear_target): Likewise.
6419 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6421 (Start_group::~Start_group): New function.
6422 (Start_group::is_runnable): New function.
6423 (Start_group::locks, Start_group::run): New functions.
6424 (Finish_group::run): Change saw_undefined to size_t.
6425 * readsyms.h (class Start_group): Define.
6426 (class Finish_group): Change saw_undefined_ field to size_t.
6427 (Finish_group::Finish_group): Remove saw_undefined and
6428 this_blocker parameters. Change all callers.
6429 (Finish_group::set_saw_undefined): New function.
6430 (Finish_group::set_blocker): New function.
6431 * symtab.h (class Symbol_table): Change saw_undefined to return
6432 size_t. Change saw_undefined_ field to size_t.
6433 * target-select.cc (Set_target_once::do_run_once): New function.
6434 (Target_selector::Target_selector): Initialize set_target_once_
6435 field. Don't initialize lock_ and initialize_lock_ fields.
6436 (Target_selector::instantiate_target): Rewrite.
6437 (Target_selector::set_target): New function.
6438 * target-select.h (class Set_target_once): Define.
6439 (class Target_selector): Update declarations. Make
6440 Set_target_once a friend. Remove lock_ and initialize_lock_
6441 fields. Add set_target_once_ field.
6443 2010-02-10 Ian Lance Taylor <iant@google.com>
6445 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6447 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6448 (queue_middle_tasks): Add all blockers before queueing any tasks.
6449 (queue_final_tasks): Likewise.
6450 * token.h (Task_token::add_blockers): New function.
6451 * object.h (Input_objects::number_of_relobjs): New function.
6453 2010-02-10 Ian Lance Taylor <iant@google.com>
6455 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6456 shared, not if not position independent.
6457 * x86_64.cc (Relocate::relocate_tls): Likewise.
6458 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6459 (tls_pie_pic_test): New target.
6460 * testsuite/Makefile.in: Rebuild.
6462 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6463 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6464 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6465 * testsuite/Makefile.in: Rebuild.
6467 2010-02-09 David S. Miller <davem@davemloft.net>
6469 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6470 R_SPARC_RELATIVE using ->add_local_relative().
6471 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6473 * output.h (Output_data_dynamic::add_section_size): New method
6474 that takes two Output_data objects.
6475 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6476 entry param. Handle it in initializers.
6477 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6478 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6479 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6481 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6482 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6483 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6484 for dynrel_includes_plt.
6485 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6486 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6487 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6489 (Target_sparc::do_finalize_sections): Update to pass true for
6490 dynrel_includes_plt.
6491 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6492 output before .rela.plt
6493 (Target_powerpc::do_finalize_sections): Update to pass true for
6494 dynrel_includes_plt when 32-bit.
6496 2010-02-08 Doug Kwan <dougkwan@google.com>
6498 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6500 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6501 Arm_relobj::scan_section_for_cortex_a8_stubs,
6502 Arm_relobj::do_relocation_section): Instead of calling
6503 Output_section::output_address, use faster
6504 Arm_relobj::simple_input_section_output_address.
6506 2010-02-08 David S. Miller <davem@davemloft.net>
6508 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6509 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6510 relocation helper function.
6512 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6513 just like R_SPARC_GOT{10,13,22}.
6514 (Target_sparc::Scan::local): Likewise.
6515 (Target_sparc::Relocate:relocate): Likewise.
6517 2010-02-06 Ian Lance Taylor <iant@google.com>
6519 * configure.ac: Rewrite targetobjs duplicate removal code to use
6520 only shell constructs.
6521 * configure: Rebuild.
6523 2010-02-05 Doug Kwan <dougkwan@google.com>
6526 * arm.cc (Arm_relobj::section_is_scannable): New method.
6527 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6528 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6530 2010-02-04 Doug Kwan <dougkwan@google.com>
6533 * arm-reloc-property.cc (cstdio): Include.
6534 * configure.ac (targetobjs): Remove duplicates.
6535 * configure: Regenerate.
6536 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6537 big and little endian version for a given address size.
6539 2010-02-03 Doug Kwan <dougkwan@google.com>
6541 * arm-reloc-property.cc
6542 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6544 * arm-reloc-property.h
6545 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6546 New method definition.
6547 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6549 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6551 (GOT_PREL): Change implemented to Y.
6552 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6553 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6554 (Arm_relocate_functions::movw_abs_nc): Remove method.
6555 (Arm_relocate_functions::movt_abs): Ditto.
6556 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6557 (Arm_relocate_functions::thm_movt_abs): Ditto.
6558 (Arm_relocate_functions::movw_rel_nc): Ditto.
6559 (Arm_relocate_functions::movw_rel): Ditto.
6560 (Arm_relocate_functions::movt_rel): Ditto.
6561 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6562 (Arm_relocate_functions:thm_movw_rel): Ditto.
6563 (Arm_relocate_functions:thm_movt_rel): Ditto.
6564 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6565 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6566 New method definitions.
6567 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6568 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6569 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6570 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6571 (Target_arm::Relocate::relocate): Check for non-static or
6572 unimplemented relocation code and exit early. Change calls to
6573 Target_arm::reloc_uses_thumb_bit and
6574 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6575 instead. Refactor code to handle similar relocations to increase
6576 code sharing. Remove check for unsupported relocation code in switch
6578 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6579 relocation property table to find out size. Change error message to
6580 print out the name of a relocation code instead of the numeric value.
6581 (Target_arm::scan_reloc_for_stub): Use relocation property table
6582 instead of calling Target_arm::reloc_uses_thumb_bit().
6584 2010-02-02 Doug Kwan <dougkwan@google.com>
6586 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6587 types of relaxed input section.
6589 2010-02-02 Doug Kwan <dougkwan@google.com>
6591 * Makefile.am (HFILES): Add arm-reloc-property.h.
6593 (TARGETSOURCES): Add arm-reloc-property.cc
6594 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6595 (libgold_a_SOURCES): $(DEFFILES)
6596 * Makefile.in: Regenerate.
6597 * arm-reloc-property.cc: New file.
6598 * arm-reloc-property.h: New file.
6599 * arm-reloc.def: New file.
6600 * arm.cc: Update comments.
6601 (arm-reloc-property.h): New included header.
6602 (arm_reloc_property_table): New global variable.
6603 (Target_arm::do_select_as_default_target): New method definition.
6604 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6605 arm-reloc-property to targ_extra_obj.
6606 * parameters.cc (set_parameters_target): Call
6607 Target::select_as_default_target().
6608 * target.h (Target::select_as_default_target): New method definition.
6609 (Target::do_select_as_default_target): Same.
6611 2010-02-01 Doug Kwan <dougkwan@google.com>
6613 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6614 first_output_text_section_.
6615 (Arm_exidx_fixup::first_output_text_section): New method definition.
6616 (Arm_exidx_fixup::first_output_text_section_): New data member.
6617 (Arm_exidx_fixup::process_exidx_section): Record the first text
6618 output section seen.
6619 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6620 and entsize in output section header.
6622 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6624 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6625 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6626 (Arm_relocate_functions::thm_alu11): New Method.
6627 (Arm_relocate_functions::thm_pc8): New Method.
6628 (Arm_relocate_functions::thm_pc12): New Method.
6629 (Target_arm::Scan::local): Handle the relocations.
6630 (Target_arm::Scan::global): Likewise.
6631 (Target_arm::Relocate::relocate): Likewise.
6632 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6634 2010-01-29 Doug Kwan <dougkwan@google.com>
6636 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6637 of relocation types as ld.
6639 2010-01-29 Doug Kwan <dougkwan@google.com>
6641 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6643 (Arm_relocate_functions::thumb_branch_common): Ditto.
6644 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6645 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6646 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6647 Arm_relocate_functions::jump24): Remove.
6648 (Target_arm::Relocate::relocate): Adjust code to call
6649 Arm_relocation_functions::arm_branch_common and
6650 Arm_relocation_functions::thumb_branch_common instead of their removed
6651 wrappers. Merge switch-cases together to reduce source code size.
6653 2010-01-29 Doug Kwan <dougkwan@google.com>
6655 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6656 output_local_symbol_count_needs_update_.
6657 (Arm_relobj::output_local_symbol_count_needs_update,
6658 Arm_relobj::set_output_local_symbol_count_needs_update,
6659 Arm_relobj::update_output_local_symbol_count): New methods.
6660 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6662 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6663 of pointed function as in a R_ARM_PREL31 relocation.
6664 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6665 for output local symbol count updating.
6666 (Target_arm::do_relax): Update output local symbol counts in objects
6668 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6670 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6672 * arm.cc: Added support for the ARM relocations:
6673 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6674 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6675 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6677 (Arm_relocate_functions::movw_rel): New method.
6678 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6679 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6681 (Arm_relocate_functions::thm_movw_rel): New method.
6682 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6684 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6686 (Target_arm::Scan::global): Likewise.
6687 (Target_arm::Relocate::relocate): Likewise.
6688 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6691 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6693 * arm.cc: Added support for ARM group relocations.
6694 (Target_arm::reloc_needs_sym_origin): New method.
6695 (Arm_relocate_functions::calc_grp_kn): New method.
6696 (Arm_relocate_functions::calc_grp_residual): New method.
6697 (Arm_relocate_functions::calc_grp_gn): New method.
6698 (Arm_relocate_functions::arm_grp_alu): New Method.
6699 (Arm_relocate_functions::arm_grp_ldr): New Method.
6700 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6701 (Arm_relocate_functions::arm_grp_ldc): New Method.
6702 (Target_arm::Scan::local): Handle the ARM group relocations.
6703 (Target_arm::Scan::global): Likewise.
6704 (Target_arm::Relocate::relocate): Likewise.
6705 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6708 2010-01-26 Doug Kwan <dougkwan@google.com>
6710 * arm.cc (set): Include.
6711 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6713 (Arm_output_section::Text_section_list): New type.
6714 (Arm_output_section::append_text_sections_to_list): New method.
6715 (Arm_output_section::fix_exidx_coverage): Ditto.
6716 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6717 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6718 Relobj::set_section_offset() instead of
6719 Sized_relobj::invalidate_section_offset().
6720 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6721 parameter for section headers. Ignore relocation sections for
6722 unallocated sections and EXIDX sections.
6723 (Target_arm::fix_exidx_coverage): New method.
6724 (Target_arm::output_section_address_less_than): New type.
6725 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6726 linked text section instead of the EXIDX section.
6727 (Arm_output_section::create_stub_group): Add an assertion to check
6728 that this is not an EXIDX output section.
6729 (Arm_output_section::append_text_sections_to_list): New method.
6730 (Arm_output_section::fix_exidx_coverage): Ditto.
6731 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6732 Arm_relobj::section_needs_reloc_stub_scanning.
6733 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6735 (Target_arm::fix_exidx_coverage): New method.
6736 * object.h (Relobj::set_output_section): New method.
6737 (Sized_relobj::invalidate_section_offset): Remove method.
6738 (Sized_relobj::do_invalidate_section_offset): Remove method.
6739 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6741 2010-01-25 Doug Kwan <dougkwan@google.com>
6743 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6744 Fix warning due to signed and unsigned comparison on a 32-bit host.
6746 2010-01-22 Doug Kwan <dougkwan@google.com>
6748 * arm.cc (Target_arm::do_relax): Record an output section for section
6749 offset adjustment it contains any stub table that has changed.
6750 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6751 offsets in an output section if necessary.
6752 * output.cc (Output_section::Output_section): Initialize
6753 section_offsets_need_adjustments_.
6754 (Output_section::add_input_section_for_script): Renamed to
6755 Output_section::add_simple_input_section.
6756 (Output_section::save_states): Add a comment.
6757 (Output_section::discard_states): New method defintion.
6758 (Output_section::adjust_section_offsets): Same.
6759 * output.h (Output_section::add_input_section_for_script): Renamed to
6760 Output_section::add_simple_input_section.
6761 (Output_section::discard_states): New method declaration.
6762 (Output_section::adjust_section_offsets): Same.
6763 (Output_section::section_offsets_need_adjustment,
6764 Output_section::set_section_offsets_need_adjustment): New method
6766 (Output_section::section_offsets_need_adjustment_): New data member.
6767 * script-sections.cc
6768 (Output_section_element_input::set_section_address): Adjust code for
6769 renaming of Output_section::add_input_section_for_script.
6770 (Orphan_output_section::set_section_address): Same.
6772 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6774 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6775 Fix_v4bx enum values .
6776 * gold/options.h (General_options): New option definitions.
6777 (General_options::fix_v4bx): New method.
6778 (General_options::Fix_v4bx): New enum.
6779 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6780 (General_options::parse_fix_v4bx_interworking): New method.
6782 2010-01-22 Doug Kwan <dougkwan@google.com>
6784 * arm.cc (Arm_exidx_fixup): New class.
6786 2010-01-21 Doug Kwan <dougkwan@google.com>
6788 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6790 (Arm_exidx_section_offset_map): New type.
6792 2010-01-21 Doug Kwan <dougkwan@google.com>
6794 * arm.cc (Arm_exidx_input_section): New class.
6795 (Arm_relobj::exidx_input_section_by_link,
6796 Arm_relobj::exidx_input_section_by_shndx,
6797 Arm_relobj::make_exidx_input_section): New methods.
6798 (read_arm_attributes_section): Remove.
6799 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6800 information about them.
6801 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6804 2010-01-20 Doug Kwan <dougkwan@google.com>
6806 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6807 Input_section_specifier to Section_id.
6808 (Target_arm::new_arm_input_section: Adjust code for change of key
6810 (Target_arm::find_arm_input_section): Ditto.
6811 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6812 (Section_id): Remove.
6813 (Garbage_collection::Section_id_hash): Remove.
6814 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6815 (Section_id): Remove.
6816 (Icf::Section_id_hash): Remove.
6817 * object.h (Section_id, Const_section_id, Section_id_hash,
6818 Const_section_id_hash): New type definitions.
6819 * output.cc (Output_section::add_relaxed_input_section): Change to
6820 use Const_section_id instead of Input_section_specifier as key type.
6821 (Output_section::add_merge_input_section): Ditto.
6822 (Output_section::build_relaxation_map): Change to use Section_id
6823 instead of Input_section_specifier as key type.
6824 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6826 (Output_section::convert_input_sections_to_relaxed_sections): Change
6827 to use Const_section_id instead of Input_section_specifier as key type.
6828 (Output_section::find_merge_section): Ditto.
6829 (Output_section::find_relaxed_input_section): Ditto.
6830 * output.h (Input_section_specifier): Remove class.
6831 (Output_section::Output_section_data_by_input_section_map): Change
6832 key type to Const_section_id.
6833 (Output_section::Output_relaxed_input_section_by_input_section_map):
6835 (Output_section::Relaxation_map): Change key type to Section_id.
6837 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6839 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6840 (class Arm_v4bx_stub): New class.
6841 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6842 (Stub_factory::make_arm_v4bx_stub): New method.
6843 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6844 (Stub_table::empty): Handle v4bx stubs.
6845 (Stub_table::add_arm_v4bx_stub): New method.
6846 (Stub_table::find_arm_v4bx_stub): New method.
6847 (Arm_relocate_functions::v4bx): New method.
6848 (Target_arm::fix_v4bx): New method.
6849 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6850 (Stub_table::relocate_stubs): Likewise.
6851 (Stub_table::do_write): Likewise.
6852 (Stub_table::update_data_size_and_addralign): Likewise.
6853 (Stub_table::finalize_stubs): Likewise.
6854 (Target_arm::Scan::local): Likewise.
6855 (Target_arm::Scan::global): Likewise.
6856 (Target_arm::do_finalize_sections): Likewise.
6857 (Target_arm::Relocate::relocate): Likewise.
6858 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6860 (Target_arm::scan_reloc_for_stub): Likewise.
6861 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6863 2010-01-19 Ian Lance Taylor <iant@google.com>
6865 * output.cc (Output_section_headers::do_sized_write): Write large
6866 segment count to sh_info field.
6867 (Output_file_header::do_sized_write): For large segment count,
6868 write PN_XNUM to e_phnum field.
6870 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6872 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6873 (Arm_relocate_functions::thm_jump8): New function.
6874 (Arm_relocate_functions::thm_jump11): New function.
6875 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6877 (Target_arm::Scan::global): Likewise.
6878 (Target_arm::Relocate::relocate): Likewise.
6879 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6882 2010-01-14 Doug Kwan <dougkwan@google.com>
6884 * arm.cc (map, utility): Include headers.
6885 (Target_arm::apply_cortex_a8_workaround): New method.
6886 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6887 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6888 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6889 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6890 the --[no-]fix-cortex-a8 command line options.
6891 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6892 (Target_arm::relocate_stub): Use addend in instruction template.
6893 * options.h (DEFINE_bool): Set the user-set flag.
6894 (General_options): Add --[no-]-fix-cortex options.
6895 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6896 : Update fast look-up map after conversion.
6898 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6900 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6901 in the first pass of do_layout.
6903 2010-01-13 Doug Kwan <dougkwan@google.com>
6905 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6906 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6907 apparent compiler problem of not folding static constant integral
6908 data members of elfcpp::Elf_sizes<32>.
6910 2010-01-13 Doug Kwan <dougkwan@google.com>
6912 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6913 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6914 Arm_relobj::scan_section_for_cortex_a8_erratum,
6915 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6916 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6917 sections to scan for relocation stubs into a new method
6918 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6919 relocation and Cortex-A8 stub scanning.
6920 (Target_arm::do_relax): Force stubs to be after stubbed sections
6921 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
6922 the beginning of a new relaxation pass. Update a comment.
6923 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6925 2010-01-12 Ian Lance Taylor <iant@google.com>
6927 * target-reloc.h (visibility_error): New inline function.
6928 (relocate_section): Call visibility_error.
6929 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6930 (MOSTLYCLEANFILES): Likewise.
6931 (protected_4_pic.o, protected_3.err): New targets.
6932 * testsuite/protected_4.cc: New file.
6934 2010-01-12 Doug Kwan <dougkwan@google.com>
6936 * arm.cc (Cortex_a8_reloc): New class.
6937 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6938 and cortex_a8_relocs_info_.
6939 (Target_arm::fix_cortex_a8): New method definition.
6940 (Target_arm::Cortex_a8_relocs_info): New type.
6941 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6942 New data member declarations.
6943 (Target_arm::scan_reloc_for_stub): Record information about
6944 relocations for THUMB branches that might be exempted from the
6945 Cortex-A8 workaround.
6946 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6947 at the beginning of a relaxation pass.
6949 2010-01-12 Doug Kwan <dougkwan@google.com>
6951 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6952 (Arm_relobj::Mapping_symbol_position,
6953 Arm_reloj::Mapping_symbol_position_less,
6954 Arm_relobj::Mapping_symbols_info): New types.
6955 (Target_arm::is_mapping_symbol_name): New method definition.
6956 (Arm_relobj::do_count_local_symbols): Save information about mapping
6959 2010-01-11 Doug Kwan <dougkwan@google.com>
6961 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6962 Arm_relocate_functions::thumb32_branch_upper,
6963 Arm_relocate_functions::thumb32_branch_lower,
6964 Arm_relocate_functions::thumb32_cond_branch_offset,
6965 Arm_relocate_functions::thumb32_cond_branch_upper,
6966 Arm_relocate_functions::thumb32_cond_branch_lower,
6967 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6968 branch offset encoding.
6969 (Arm_relocate_functions::thumb_branch_common): Use new branch
6970 offset encoding methods to avoid code duplication.
6971 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6972 (Stub_addend_reader::operator()): Use new branch encoding method
6973 to avoid code duplication.
6975 2010-01-11 Doug Kwan <dougkwan@google.com>
6977 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6978 (Target_arm::do_finalize_sections): Define special EXIDX section
6979 symbols only if referenced.
6980 * gc.h (Garbage_collection::add_reference): New method.
6981 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6984 2010-01-11 Ian Lance Taylor <iant@google.com>
6986 * script.cc (Version_script_info::build_expression_list_lookup):
6987 Change complaing about duplicate wildcard match from error to
6990 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6992 (Version_script_info::Version_script_info): Initialize globs_,
6993 default_version_, default_is_global_, and exact_. Don't
6994 initialize globals_ or locals_.
6995 (Version_script_info::build_lookup_tables): Build local symbols
6997 (Version_script_info::unquote): New function.
6998 (Version_script_info::add_exact_match): New function.
6999 (Version_script_info::build_expression_list_lookup): Remove lookup
7000 parameter. Add is_global parameter. Change all callers. Handle
7001 wildcard pattern specially. Unquote pattern. Call
7003 (Version_script_info::get_name_to_match): New function.
7004 (Version_script_info::get_symbol_version): New function.
7005 (Version_script_info::get_symbol_version_helper): Remove.
7006 (Version_script_info::check_unmatched_names): Call unquote.
7007 * script.h (class Version_script_info): Change get_symbol_version
7008 to be non-inline and add is_global parameter; change all callers.
7009 Rewrite symbol_is_local. Update declarations. Define struct
7010 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7011 Remove globals_ and locals_ members. Add exact_, globs_,
7012 default_version_, is_global_.
7013 (Version_script_info::Glob): Remove pattern, add expression and
7014 is_global. Update constructor. Change all callers.
7015 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7017 (Versions::symbol_section_contents): If a symbol is undefined, or
7018 defined in a dynamic object, set the version index to
7020 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7022 (Symbol_table::add_from_pluginobj): Likewise.
7023 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7025 2010-01-11 Doug Kwan <dougkwan@google.com>
7027 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7028 (incremental_dump_LDADD): Add linking option for libintl.
7029 * Makefile.in: Regenerate.
7031 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7034 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7036 * testsuite/Makefile.in: Regenerated.
7038 2010-01-10 Doug Kwan <dougkwan@google.com>
7040 * options.h (DEFINE_var): Use parentheses around argument varname__
7041 in macro body to avoid any unintended subsequent substitutions.
7043 2010-01-10 Ian Lance Taylor <iant@google.com>
7045 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7046 candidates before doing symbol resolution.
7048 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7049 ODR candidates if only one is weak.
7051 2010-01-08 Ian Lance Taylor <iant@google.com>
7053 * script.cc (Version_script_info::build_expression_list_lookup):
7054 Don't warn about ambiguous version, just record the ambiguity.
7055 (Version_script_info::get_symbol_version_helper): Give error if
7056 version is ambiguous.
7058 2010-01-08 Doug Kwan <dougkwan@google.com>
7060 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7061 prev_data_size_ and prev_addralign_. Remove initializer for
7062 deleted data member has_been_changed_.
7063 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7064 to determine if the table is empty.
7065 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7067 (Stub_table::add_reloc_stub): Define method in class definition
7068 instead of just declaring it there.
7069 (Stub_table::add_cortex_a8_stub): New method definition.
7070 (Stub_table::update_data_size_and_addralign): Ditto.
7071 (Stub_table::finalize_stubs): Ditto.
7072 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7073 (Stub_table::do_addralign_): Return address alignment in the
7074 (Stub_table::do_reset_address_and_file_offset): Define method in
7075 class definition instead of declaring it there. Set current data
7076 size to be the data size of the previous pass.
7077 (Stub_table::set_final_data_size): Use current data size as the
7079 (Stub_table::relocate_stub): Change parameter type of stub from
7080 Reloc_stub pointer to Stub pointer.
7081 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7082 (Stub_table::Cortex_a8_stub_list): New typedef.
7083 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7084 Stub_table::prev_addralign_): New data member.
7085 (Arm_relobj::Arm_relobj): Initialize data member
7086 section_has_cortex_a8_workaround_.
7087 (Arm_relobj::section_has_cortex_a8_workaround,
7088 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7090 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7092 (Target_arm::relocate_stub): Change parameter type of stub from
7093 Reloc_stub pointer to Stub pointer.
7094 (Insn_template::size, Insn_template::alignment): Handle
7095 THUMB16_SPECIAL_TYPE.
7096 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7097 Stub_table::update_data_size_and_addralign,
7098 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7100 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7101 (Stub_table::do_write): Ditto.
7102 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7104 2010-01-08 Ian Lance Taylor <iant@google.com>
7107 * symtab.h (class Symbol): Remove fields is_target_special_ and
7108 has_plt_offset_. Add field is_defined_in_discarded_section_.
7109 (Symbol::is_defined_in_discarded_section): New function.
7110 (Symbol::set_is_defined_in_discarded_section): New function.
7111 (Symbol::has_plt_offset): Rewrite.
7112 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7113 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7114 Don't initialize is_target_special_ or has_plt_offset_.
7115 Initialize is_defined_in_discarded_section_.
7116 (Symbol_table::add_from_relobj): If appropriate, set
7117 is_defined_in_discarded_section.
7118 * resolve.cc (Symbol::override_base_with_special): Don't test
7119 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7120 * target-reloc.h (relocate_section): Do special handling for
7121 symbols defined in discarded sections for global symbols as well
7124 2010-01-08 Ian Lance Taylor <iant@google.com>
7126 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7127 the SHT_SYMTAB case.
7129 2010-01-08 Ian Lance Taylor <iant@google.com>
7131 * object.cc (Sized_relobj::do_layout): Don't get confused if
7132 layout_eh_frame returns NULL.
7134 2010-01-08 Ian Lance Taylor <iant@google.com>
7137 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7138 dynamic symbol table, use the normal symbol table.
7139 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7142 2010-01-08 Ian Lance Taylor <iant@google.com>
7145 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7148 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7150 * version.cc (print_version): Change to "Copyright 2010".
7152 2010-01-08 Ian Lance Taylor <iant@google.com>
7156 * i386.cc (class Target_i386): Change return type of plt_section
7158 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7159 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7160 tls_desc_rel_ field.
7161 (Output_data_plt_i386::rel_tls_desc): New function.
7162 (Target_i386::rel_tls_desc_section): New function.
7163 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7164 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7165 R_386_TLS_DESC reloc in rel_tls_desc_section.
7166 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7167 Define struct Tlsdesc_info.
7168 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7169 (Target_x86_64::do_reloc_symbol_index): New function.
7170 (Target_x86_64::add_tlsdesc_info): New function.
7171 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7172 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7174 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7176 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7177 (Target_x86_64::rela_tlsdesc_section): New function.
7178 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7180 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7181 (Target_x86_64::do_reloc_addend): New function.
7182 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7183 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7184 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7185 (Output_reloc::type): New function.
7186 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7187 (Output_reloc::is_target_specific): New function.
7188 (Output_reloc::target_arg): New function.
7189 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7190 absolute relocs and target specific relocs.
7191 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7192 add_target_specific.
7193 (class Output_data_reloc) [SHT_RELA]: Likewise.
7194 * output.cc (Output_reloc::Output_reloc): Add four new versions
7195 for absolute relocs and target specific relocs.
7196 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7197 (Output_reloc::get_symbol_index): Likewise.
7198 (Output_reloc::local_section_offset): Check that local_sym_index_
7199 is not TARGET_CODE or 0.
7200 (Output_reloc::symbol_value): Likewise.
7201 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7203 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7204 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7206 * layout.cc (add_target_dynamic_tags): Use output section for
7207 DT_PLTRELSZ and DT_JMPREL.
7209 2010-01-07 Ian Lance Taylor <iant@google.com>
7212 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7214 (class Output_data_reloc_generic): Define.
7215 (class Output_data_reloc_base): Change base class to
7216 Output_data_reloc_generic. Change add() method to call
7217 bump_relative_reloc_count for a relative reloc. Remove
7219 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7221 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7222 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7224 * layout.h (class Layout): Update declaration.
7226 2010-01-07 Ian Lance Taylor <iant@google.com>
7228 * output.h (class Output_data): Add const version of
7229 output_section and do_output_section.
7230 (class Output_section_data): Add const version of
7232 (class Output_section): Likewise.
7233 * layout.cc (Layout::add_target_dynamic_tags): New function.
7234 * layout.h (class Layout): Update declarations.
7235 * arm.cc (Target_arm::do_finalize_sections): Use
7236 add_target_dynamic_tags.
7237 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7238 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7239 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7240 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7242 2010-01-07 Ian Lance Taylor <iant@google.com>
7245 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7248 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7249 Ian Lance Taylor <iant@google.com>
7252 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7253 Xindex::read_symtab_xindex.
7255 2010-01-07 Doug Kwan <dougkwan@google.com>
7257 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7258 (Insn_template::thumb16_bcond_insn): New method declaration.
7259 (Insn_template): Fix spelling.
7260 (Stub::thumb16_special): New method declaration.
7261 (Stub::do_write): Define virtual method which was previously pure
7263 (Stub::do_thumb16_special): New method declaration.
7264 (Stub::do_fixed_endian_write): New template member.
7265 (Reloc_stub::do_write): Remove.
7266 (Reloc_stub::do_fixed_endian_write): Remove.
7267 (Cortex_a8_stub): New class definition.
7268 (Stub_factory::make_cortex_a8_stub): New method definition.
7269 (Stub_factory::Stub_factory): Add missing static storage class
7270 qualifier for elf32_arm_stub_a8_veneer_blx.
7272 2010-01-07 Ian Lance Taylor <iant@google.com>
7275 * options.h (class General_options): Add --warn-unresolved-symbols
7276 and --error-unresolved-symbols.
7277 * errors.cc (Errors::undefined_symbol): Implement
7278 --warn-unresolved-symbols.
7280 * options.h (class General_options): Add -z text and -z textoff.
7281 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7283 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7285 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7286 (Garbage_collection::cident_sections): New function.
7287 (Garbage_collection::add_cident_section): New function.
7288 (Garbage_collection::cident_sections_): New member.
7289 (gc_process_relocs): Add references to sections whose names are C
7291 * gold.h (cident_section_start_prefix): New constant.
7292 (cident_section_stop_prefix): New constant.
7293 (is_cident): New function.
7294 * layout.cc (Layout::define_section_symbols): Replace string constants
7295 with the newly defined constants.
7296 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7298 * testsuite/Makefile.am: Add gc_orphan_section_test.
7299 * testsuite/Makefile.in: Regenerate.
7300 * testsuite/gc_orphan_section_test.cc: New file.
7301 * testsuite/gc_orphan_section_test.sh: New file.
7303 2010-01-06 Ian Lance Taylor <iant@google.com>
7306 * options.h (class General_options): Add --warn-shared-textrel.
7307 * layout.cc (Layout::finish_dynamic_section): Implement
7308 --warn-shared-textrel.
7311 * options.h (class General_options): Add --warn-multiple-gp.
7313 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7315 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7316 $(THREADSLIB) and $(LIBDL).
7317 * Makefile.in: Rebuild.
7319 2010-01-06 Ian Lance Taylor <iant@google.com>
7322 * options.cc (General_options::parse_section_start): New function.
7323 (General_options::section_start): New function.
7324 (General_options::General_options): Initialize all members.
7325 * options.h: Include <map>
7326 (class General_options): Add --section-start. Add section_starts_
7328 * layout.cc (Layout::attach_allocated_section_to_segment): If
7329 --section-start was used, set the address of the segment. Remove
7330 local sort_sections.
7331 (Layout::relaxation_loop_body): If the address of the load segment
7332 has been set by --section-start, don't use it.
7333 * output.h (Output_segment::update_flags_for_output_section): New
7335 * output.cc (Output_segment::add_output_section): Call
7336 update_flags_for_output_section.
7338 2010-01-05 Ian Lance Taylor <iant@google.com>
7341 * options.h (class General_options): Add --undefined-version.
7342 * script.cc (struct Version_expression): Add was_matched_by_symbol
7344 (Version_script_info::matched_symbol): New function.
7345 (Version_script_info::get_symbol_version_helper): Call
7347 (Version_script_info::check_unmatched_names): New function.
7348 * script.h (class Version_script_info): Update declarations.
7349 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7351 * options.h (class General_options): Use DEFINE_bool_alias for
7352 allow_multiple_definition.
7353 * resolve.cc (Symbol_table::should_override): Don't test
7354 allow_multiple_definition.
7357 * options.h (class General_options): Add --cref.
7358 * main.cc (main): Print cref table if --cref. Don't close mapfile
7359 until after printing cref table.
7360 * cref.cc: Include "symtab.h".
7361 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7362 (Cref_table_compare::operator()): New function.
7363 (Cref_inputs::gather_cref): New function.
7364 (filecol): New static const.
7365 (Cref_inputs::print_cref): New function.
7366 (Cref::print_cref): New function.
7367 * cref.h: Include <cstdio>.
7368 (class Cref): Update declarations.
7369 * mapfile.h (Mapfile::file): New function.
7370 * object.h (class Object): Define Symbols. Declare virtual
7371 do_get_global_symbols.
7372 (Object::get_global_symbols): New function.
7373 * object.cc (Input_objects::add_object): Pass object to cref_ if
7375 (Input_objects::archive_start): Likewise.
7376 (Input_objects::archive_stop): Likewise.
7377 (Input_objects::print_cref): New function.
7378 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7379 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7381 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7383 * plugin.h (class Sized_pluginobj): Update declarations.
7385 2010-01-05 Ian Lance Taylor <iant@google.com>
7387 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7388 to is_default_version. Rename insdef to insdefault.
7389 (Symbol_table::add_from_relobj): Rename def to is_default_version
7390 and local to is_forced_local.
7391 (Symbol_table::add_from_pluginobj): Likewise.
7392 (Symbol_table::add_from_dynobj): Likewise.
7393 (Symbol_table::define_special_symbol): Rename insdef to
7396 2010-01-04 Ian Lance Taylor <iant@google.com>
7399 * options.h (class General_options): Add
7400 --allow-multiple-definition and -z muldefs.
7401 * resolve.cc (Symbol_table::should_override): Don't warn about a
7402 multiple symbol definition if --allow-multiple-definition or -z
7406 * options.h (class General_options): Add --add-needed and
7407 --copy-dt-needed-entries. Tweak --as-needed help entry.
7408 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7409 error if --copy-dt-needed-entries aka --add-needed is used and
7410 would cause a change in behaviour.
7413 * options.h (class General_options): Add -G as a short version of
7414 --shared. Add no-op options -assert, -g, and -i.
7416 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7418 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7419 check for .text or .gnu.linkonce.t sections.
7420 * icf.cc (Icf::find_identical_sections): Ditto.
7421 Change the detection for mangled function name within the section
7423 * icf.h (is_section_foldable_candidate): New function.
7425 2009-12-30 Ian Lance Taylor <iant@google.com>
7428 * options.h (class General_options): Permit two dashes with
7429 --retain-symbols-file.
7431 2009-12-30 Ian Lance Taylor <iant@google.com>
7434 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7435 don't put the file header and segment headers in the text
7439 * common.cc (Sort_commons::operator()): Stabilize sort when both
7441 (Symbol_table::do_allocate_commons_list): When allocating common
7442 symbols, skip a symbol which is no longer common.
7443 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7444 an object before checking its type.
7445 * testsuite/common_test_2.c: New file.
7446 * testsuite/common_test_3.c: New file.
7447 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7448 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7449 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7450 (common_test_2_pic.o, common_test_2.so): New targets.
7451 (common_test_3_pic.o, common_test_3.so): New targets.
7452 * testsuite/Makefile.in: Rebuild.
7455 * script.cc (read_input_script): If we see a new SECTIONS clause,
7456 and we have added an input section, give an error.
7457 * layout.h (class Layout): Add have_added_input_section function.
7458 Add have_added_input_section_ field.
7459 * layout.cc (Layout::Layout): Initialize
7460 have_added_input_section_.
7461 (Layout::layout): Set have_added_input_section_.
7462 (Layout::layout_eh_frame): Likewise.
7464 2009-12-30 Ian Lance Taylor <iant@google.com>
7467 * options.h (class General_options): Add --sort-common option.
7468 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7469 * common.cc (Sort_common): Add sort_order parameter to
7470 constructor. Add sort_order_ field.
7471 (Sort_commons::operator): Check sort_order_.
7472 (Symbol_table::allocate_commons): Determine the sort order.
7473 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7475 (Symbol_table::do_allocate_commons_list): Likewise.
7477 2009-12-30 Ian Lance Taylor <iant@google.com>
7480 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7481 symbols from this object, don't change the visibility of an
7483 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7485 2009-12-30 Ian Lance Taylor <iant@google.com>
7488 * script.h (class Version_script_info): Define Language enum.
7489 Update declarations. Define Glob, Exact, and Lookup types. Add
7490 new fields globals_, locals_, and is_finalized_.
7491 * script.cc: Various formatting fixes.
7492 (class Parser_closure): Change language_stack_ from a vector of
7493 std::string to one of Version_script_info::Language. Adjust all
7495 (class Lazy_demangler): Remove.
7496 (struct Version_expression): Change language from std::string to
7497 Version_script_info::Language.
7498 (Version_script_info::Version_script_info): New function.
7499 (Version_script_info::~Version_script_info): Don't call clear.
7500 (Version_script_info::finalize): New function.
7501 (Version_script_info::build_lookup_tables): New function.
7502 (Version_script_info::build_expression_list_lookup): New
7504 (Version_script_info::get_symbol_version_helper): Rewrite to use
7506 (Version_script_info::print_expression_list): Adjust to use
7507 Version_script_info::Language.
7508 (script_push_lex_into_version_mode): Check that the version script
7509 has not been finalized.
7510 (version_script_push_lang): Change language string to
7511 Version_script_info::Language.
7512 * options.cc (Command_line::version_script): New function.
7513 * options.h (class General_options): Add finalize_dynamic_list
7514 function. Change version_script from declaration to definition.
7515 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7516 * testsuite/version_script.map: Remove duplicate def of foo.
7517 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7519 * testsuite/Makefile.in: Rebuild.
7521 2009-12-30 Ian Lance Taylor <iant@google.com>
7524 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7525 if the input symbol index is 0, make the output symbol index 0.
7527 2009-12-30 Ian Lance Taylor <iant@google.com>
7530 * options.h (class General_options): Add -x/--discard-all.
7531 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7532 --discard-all. If the local symbol needs a dynamic entry, check
7533 that before handling --discard-locals.
7535 2009-12-30 Ian Lance Taylor <iant@google.com>
7538 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7540 (Output_segment::add_output_section): Don't change the flags if
7544 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7545 GNU hash table if they need a dynamic value. Otherwise, don't add
7546 them if they are defined in a dynamic object or are forced local.
7548 2009-12-29 Ian Lance Taylor <iant@google.com>
7551 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7552 .gnu.hash table for a 32-bit target.
7555 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7556 regular and a dynamic object only needs a dynamic symbol table
7557 entry if it is externally visible.
7560 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7561 constructor. Add global_offset_table_ field.
7562 (Target_i386::got_section): Set global_offset_table_.
7563 (Target_i386::do_finalize_sections): Set global_offset_table_
7565 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7566 in constructor. Add global_offset_table_ field.
7567 (Target_x86_64::got_section): Set global_offset_table_.
7568 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7571 * layout.cc (Layout::Layout): Initialize increase_relro_.
7572 (Layout::get_output_section): Add is_relro, is_last_relro, and
7573 is_first_non_relro parameters. Change all callers.
7574 (Layout::choose_output_section): Likewise.
7575 (Layout::add_output_section_data): Likewise.
7576 (Layout::make_output_section): Likewise.
7577 (Layout::set_segment_offsets): Clear increase_relro when using a
7579 * layout.h (class Layout): Add increase_relro method. Add
7580 increase_relro_ field. Update declarations.
7581 * output.cc (Output_section::Output_section): Initialize
7582 is_last_relro_ and is_first_non_relro_.
7583 (Output_segment::add_output_section): Group relro sections is
7584 do_sort is true. Handle is_last_relro and is_first_non_relro.
7585 (Output_segment::maximum_alignment): Remove relro handling.
7586 (Output_segment::set_section_addresses): Add increase_relro
7587 parameter. Change all callers. Add initial alignment to align
7588 relro sections on separate page. Remove old relro handling.
7589 (Output_segment::set_section_list_addresses): Remove in_relro
7590 parameter. Change all callers.
7591 (Output_segment::set_offset): Add increase parameter. Change all
7592 callers. Remove old relro handling.
7593 * output.h (class Output_section): Add new methods: is_last_relro,
7594 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7595 Add is_last_relro_ and is_first_non_relro_ fields.
7596 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7597 Create separate .got.plt section. Call increase_relro.
7598 * x86_64.cc (Target_x86_64::got_section): Likewise.
7599 * testsuite/relro_script_test.t: Add .got.plt.
7602 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7603 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7604 (Layout::finalize): Call set_dynamic_symbol_size.
7605 (Layout::set_dynamic_symbol_size): New function.
7606 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7607 set_dynamic_symbol_size.
7610 * output.h (class Output_section): Add is_entsize_zero_ field.
7611 * output.cc (Output_section::Output_section): Initialize
7613 (Output_section::set_entsize): If two different entsizes are
7614 requested, force it to zero.
7615 (Output_section::add_input_section): Set flags for .debug_str
7616 before updating section flags. Set entsize.
7617 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7618 and SHF_STRING if all input sections have those flags.
7620 2009-12-29 Rafael Espindola <espindola@google.com>
7622 * main.cc (main): Fix the sys time reporting.
7623 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7626 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7628 * options.cc (General_options::parse_version): Allow -v to exit
7629 without an error if there is nothing to link.
7631 2009-12-29 Ian Lance Taylor <iant@google.com>
7633 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7634 using a version of gcc before 4.1.
7635 * configure: Rebuild.
7637 2009-12-28 Chris Demetriou <cgd@google.com>
7639 * attributes.cc (Output_attributes_section_data::do_write): Use
7640 std::vector::front rather than std::vector::data.
7642 2009-12-28 Ian Lance Taylor <iant@google.com>
7644 * symtab.h (class Symbol_table): Add enum Defined.
7645 * resolve.cc (Symbol_table::should_override): Add defined
7646 parameter. Change all callers. Test whether object is NULL
7647 before calling a method on it.
7648 (Symbol_table::report_resolve_problem): Add defined parameter.
7650 (Symbol_table::should_override_with_special): Likewise.
7651 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7652 parameter. Change all callers.
7653 (Symbol_table::do_define_in_output_data): Likewise.
7654 (Symbol_table::define_in_output_segment): Likewise.
7655 (Symbol_table::do_define_in_output_segment): Likewise.
7656 (Symbol_table::define_as_constant): Likewise.
7657 (Symbol_table::do_define_as_constant): Likewise.
7658 * script.h (class Symbol_assignment): Add is_defsym parameter to
7659 constructor; change all callers.
7660 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7661 parameter. Change all callers. Add is_defsym_ field.
7662 (class Parser_closure): Add parsing_defsym parameter to
7663 constructor; change all callers. Add parsing_defsym accessor
7664 function. Add parsing_defsym_ field.
7666 2009-12-28 Ian Lance Taylor <iant@google.com>
7668 * gold.cc (queue_middle_tasks): Fix formatting.
7669 * object.cc (Relobj::is_section_name_included): Likewise.
7671 2009-12-23 Ian Lance Taylor <iant@google.com>
7673 * i386.cc (Target_i386::do_calls_non_split): Recognize
7674 -fsplit-stack prologue for a function with a static chain.
7675 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7676 -fsplit-stack prologue when using %r11.
7678 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7680 * options.cc (General_options::parse_version): Make -v continue and do
7681 the link like GNU ld does.
7683 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7685 * Makefile.am (CCFILES): Add timer.cc.
7686 (HFILES): Add timer.h.
7687 * configure.ac: Check for sysconf and times.
7688 * main.cc: include timer.h.
7689 (main): Use Timer instead of get_run_time.
7692 * workqueue.cc: include timer.h.
7693 (Workqueue::find_and_run_task):
7694 Report user, sys and wall time.
7695 * Makefile.in: Regenerate.
7696 * config.in: Regenerate.
7697 * configure: Regenerate.
7699 2009-12-16 Doug Kwan <dougkwan@google.com>
7701 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7703 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7704 relaxed input sections.
7705 * output.cc (Output_section::find_relaxed_input_section): Change
7706 return type to Output_relaxed_input_section pointer. Adjust code
7707 for new type of relaxed_input_section_map_.
7708 * output.h (Output_section::find_relaxed_input_section): Change
7709 return type to Output_relaxed_input_section pointer.
7710 (Output_section::Output_relaxed_input_section_by_input_section_map):
7712 (Output_section::relaxed_input_section_map_): Change type to
7713 Output_section::Output_relaxed_input_section_by_input_section_map.
7714 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7717 2009-12-15 Ian Lance Taylor <iant@google.com>
7719 * layout.cc (Layout::create_shstrtab): Only write out after input
7720 sections if we are compressing debug sections.
7722 2009-12-15 Ian Lance Taylor <iant@google.com>
7724 * archive.cc (Archive::add_symbols): Only look up a symbol without
7725 a version if there is, in fact, a version.
7727 2009-12-14 Ian Lance Taylor <iant@google.com>
7729 Revert -Wshadow changes, all changes from:
7730 2009-12-11 Doug Kwan <dougkwan@google.com>
7731 2009-12-11 Nick Clifton <nickc@redhat.com>
7732 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7734 2009-12-11 Doug Kwan <dougkwan@google.com>
7736 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7738 * attributes.cc (Object_attribute::size): Ditto.
7739 (Attributes_section_data::size): Ditto.
7740 (Attributes_section_data::Attributes_section_data): Ditto.
7741 (Output_attributes_section_data::do_write): Ditto.
7742 * attributes.h (Object_attribute::set_type): Ditto.
7743 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7745 2009-12-11 Nick Clifton <nickc@redhat.com>
7747 * archive.cc: Fix shadowed variable warnings.
7749 * compressed_output.cc: Likewise.
7750 * compressed_output.h: Likewise.
7751 * configure: Likewise.
7752 * dwarf_reader.cc: Likewise.
7753 * dynobj.cc: Likewise.
7754 * dynobj.h: Likewise.
7755 * ehframe.cc: Likewise.
7756 * ehframe.h: Likewise.
7757 * errors.cc: Likewise.
7758 * expression.cc: Likewise.
7759 * fileread.cc: Likewise.
7760 * fileread.h: Likewise.
7761 * freebsd.h: Likewise.
7762 * i386.cc: Likewise.
7764 * incremental.h: Likewise.
7765 * layout.cc: Likewise.
7766 * layout.h: Likewise.
7767 * mapfile.cc: Likewise.
7768 * merge.cc: Likewise.
7769 * merge.h: Likewise.
7770 * object.cc: Likewise.
7771 * object.h: Likewise.
7772 * options.h: Likewise.
7773 * output.cc: Likewise.
7774 * output.h: Likewise.
7775 * parameters.cc: Likewise.
7776 * plugin.cc: Likewise.
7777 * powerpc.cc: Likewise.
7778 * reduced_debug_output.cc: Likewise.
7779 * reduced_debug_output.h: Likewise.
7780 * reloc.cc: Likewise.
7781 * reloc.h: Likewise.
7782 * resolve.cc: Likewise.
7783 * script-sections.cc: Likewise.
7784 * script.cc: Likewise.
7785 * script.h: Likewise.
7786 * sparc.cc: Likewise.
7787 * symtab.cc: Likewise.
7788 * symtab.h: Likewise.
7789 * target-select.cc: Likewise.
7790 * target-select.h: Likewise.
7791 * token.h: Likewise.
7792 * workqueue.cc: Likewise.
7793 * workqueue.h: Likewise.
7794 * x86_64.cc: Likewise.
7796 2009-12-10 Doug Kwan <dougkwan@google.com>
7798 * arm.cc (attributes.h): New include.
7799 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7800 (Arm_relobj::~Arm_relobj): Delete object pointed by
7801 attributes_section_data_.
7802 (Arm_relobj::attributes_section_data): New method definition.
7803 (Arm_relobj::attributes_section_data_): New data member declaration.
7804 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7805 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7806 attributes_section_data_.
7807 (Arm_dynobj::attributes_section_data): New method definition.
7808 (Arm_dynobj::attributes_section_data_): New data member declaration.
7809 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7810 initialization value of may_use_blx_ to false.
7811 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7812 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7813 object attributes to compute results instead of hard-coding.
7814 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7815 Target_arm::get_secondary_compatible_arch,
7816 Target_arm::set_secondary_compatible_arch
7817 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7818 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7819 New method declarations.
7820 (Target_arm::get_aeabi_object_attribute): New method definition.
7821 (Target_arm::attributes_section_data_): New data member declaration.
7822 (read_arm_attributes_section): New template definition.
7823 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7824 (Arm_dynobj::do_read_symbols): Ditto.
7825 (Target_arm::do_finalize_sections): Merge attributes sections from
7826 input. Check for BLX use after attributes section merging.
7827 Fix __exidx_start and __exidx_end visibility. Create an
7828 .ARM.attributes section if necessary.
7829 (Target_arm::get_secondary_compatible_arch,
7830 Target_arm::set_secondary_compatible_arch,
7831 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7832 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7833 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7834 New method definitions.
7836 2009-12-09 Ian Lance Taylor <iant@google.com>
7838 * plugin.cc (Plugin::load): Don't cast from void* to a function
7841 2009-12-09 Ian Lance Taylor <iant@google.com>
7843 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7846 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7848 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7849 Replace two_file_shared_1.so with two_file_shared_2.so.
7850 * testsuite/Makefile.in: Regenerated.
7852 2009-12-08 Doug Kwan <dougkwan@google.com>
7854 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7855 (HFILES): Add attributes.h and int_encoding.h.
7856 * Makefile.in: Regenerate.
7857 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7858 function definitions to int_encoding.cc
7859 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7860 prototypes to int_encoding.h
7861 * reduced_debug_output.cc (int_encoding.h): New include.
7862 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7863 function definitions to int_encoding.cc
7864 (insert_into_vector, read_from_pointer): Move template definitions to
7866 * attributes.cc: New file.
7867 * attributes.h: New file.
7868 * int_encoding.cc: New file.
7869 * int_encoding.h: New file.
7871 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7874 * incremental-dump.cc (dump_incremental_inputs): New.
7875 (main): Use dump_incremental_inputs.
7877 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7880 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7881 checking elfcpp::STT_FUNC.
7882 (Target_i386::Relocate::relocate): Likewise.
7883 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7885 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7886 symbols from shared libraries into normal FUNC symbols.
7888 * symtab.h (Symbol): Add is_func and use it.
7890 2009-12-05 Doug Kwan <dougkwan@google.com>
7892 * arm.cc (Target_arm::arm_info): Initialize new fields
7893 attributes_section and attributes_vendor.
7894 * i386.cc (Target_i386::i386_info): Same.
7895 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7896 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7897 fields attributes_section and attributes_vendor.
7898 * sparc.cc (Target_sparc::sparc_info): Same.
7899 * target.h (Target::attributes_section, Target::attributes_vendor,
7900 Target::is_attributes_section, Target::attribute_arg_type,
7901 Target::attributes_order): New method definitions.
7902 (Target::Target_info::attributes_section,
7903 Target::Target_info::attributes_vendor): New fields.
7904 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7905 virtual method definitions.
7906 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7907 attributes_section and attributes_vendor.
7908 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7910 2009-12-05 Doug Kwan <dougkwan@google.com>
7912 * arm.cc: Update comments about interworking and stub generation.
7913 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7914 considered as non-PIC.
7915 (Arm_relocate_functions::base_abs): Fix formatting.
7916 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7917 of function to use GOT entry address instead of offset.
7918 (Target_arm::Scan::global): Issue an error if a symbol would need a
7919 PLT does not get one because it is untyped. Remove code to create
7920 dynamic symbols for relative branches.
7921 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7922 takes unsigned integer instead of boolean.
7924 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7926 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7927 (two_file_test_LDADD): Likewise.
7928 (common_test_1_LDADD): Likewise.
7929 (exception_test_LDADD) Likewise.
7930 (weak_test_LDADD): Likewise.
7931 (many_sections_test_LDADD): Likewise.
7932 (initpri1_LDADD): Likewise.
7933 (script_test_1_LDADD): Likewise.
7934 (script_test_2_LDADD): Likewise.
7935 (justsyms_LDADD): Likewise.
7936 (binary_test_LDADD): Likewise.
7937 (large_LDADD): Likewise.
7938 * testsuite/Makefile.in: Regenerated.
7940 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
7942 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7943 (Symbol_table::override_with_special): Likewise.
7944 (Symbol_table::add_from_object): Likewise.
7946 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7948 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7949 Don't set the data_offset twice.
7951 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7953 * testsuite/Makefile.in: Regenerate.
7955 2009-12-03 Doug Kwan <dougkwan@google.com>
7957 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7958 (Target_arm::do_finalize_sections): Add parameter for symbol table
7959 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7960 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7961 parameter for symbol table pointer.
7962 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7963 an additional parameter for a pointer to symbol table.
7964 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7965 parameter for a symbol table pointer.
7966 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7967 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7969 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7970 parameter for a symbol table pointer.
7972 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7974 * incremental.cc (Incremental_inputs_header)
7975 (Incremental_inputs_header_write, Incremental_inputs_entry)
7976 (Incremental_inputs_entry_write): Move ...
7977 * incremental.h (Incremental_inputs_header)
7978 (Incremental_inputs_header_write, Incremental_inputs_entry)
7979 (Incremental_inputs_entry_write): here.
7981 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7983 * incremental.cc (make_sized_incremental_binary): Set the target.
7984 Error if it is incompatible.
7985 * output.h (Output_file): Add filename method.
7987 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7989 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7990 from the get_* methods.
7992 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7994 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7995 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7996 Write 0 for the data_offset of scripts.
7998 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8000 * testsuite/Makefile.am: Add the incremental_test.sh test.
8001 * testsuite/incremental_test.sh: New.
8002 * testsuite/incremental_test_1.c: New.
8003 * testsuite/incremental_test_2.c: New.
8005 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8007 * incremental-dump.cc (main): Fix typos.
8009 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8012 * incremental-dump.cc (main): Use llu to print 64 bit values.
8014 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8015 H.J. Lu <hongjiu.lu@intel.com>
8017 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8019 (incremental_dump_LDADD): Likewise.
8020 * Makefile.in: Regenerated.
8022 2009-11-25 Doug Kwan <dougkwan@google.com>
8026 2009-11-25 Doug Kwan <dougkwan@google.com>
8028 * arm.cc (Target_arm::Target_arm): Move method definition
8029 outside of class definition. Add code to handle
8030 --target1-rel, --target1-abs and --target2= options.
8031 (Target_arm::get_reloc_reloc_type): Change method to be
8032 non-static and const.
8033 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8034 New data member declaration.
8035 (Target_arm::Scan::local, Target_arm::Scan::global,
8036 Target_arm::Relocate::relocate,
8037 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8038 Adjust call to Target_arm::get_real_reloc_type.
8039 (Target_arm::get_real_reloc_type): Use command line options
8040 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8041 * options.h (--target1-rel, --target1-abs, --target2): New
8044 2009-11-25 Doug Kwan <dougkwan@google.com>
8046 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8047 class definition. Add code to handle --target1-rel, --target1-abs
8048 and --target2= options.
8049 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8051 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8053 (Target_arm::Scan::local, Target_arm::Scan::global,
8054 Target_arm::Relocate::relocate,
8055 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8056 call to Target_arm::get_real_reloc_type.
8057 (Target_arm::get_real_reloc_type): Use command line options to
8058 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8059 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8062 2009-11-25 Doug Kwan <dougkwan@google.com>
8064 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8065 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8066 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8068 (Arm_relocate_functions::thm_call): Replace body with a call to
8069 Arm_relocate_functions::thumb_branch_common.
8070 (Arm_relocate_functions::thm_jump24,
8071 Arm_relocate_functions::thm_xpc22): New method definitions.
8072 (Arm_relocate_functions::thumb_branch_common): New method definition.
8073 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8075 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8076 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8078 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8080 * Makefile.am: Build incremental-dump
8081 * Makefile.in: Regenerate.
8082 * incremental-dump.cc: New.
8083 * incremental.cc (Incremental_inputs_header_data,
8084 Incremental_inputs_entry_data): Move to incremental.h
8085 * incremental.h: (Incremental_inputs_header_data,
8086 Incremental_inputs_entry_data): Move from incremental.cc
8088 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8090 * incremental.cc (Incremental_inputs_header,
8091 Incremental_inputs_header_write, Incremental_inputs_entry,
8092 Incremental_inputs_entry_write): Add a typedef with the data type.
8094 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8096 * incremental.cc (Incremental_inputs_header,
8097 Incremental_inputs_header_write, Incremental_inputs_entry,
8098 Incremental_inputs_entry_write): Update comment about which
8099 type has the filed descriptions.
8101 2009-11-15 Doug Kwan <dougkwan@google.com>
8103 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8104 (Arm_relocate_functions::arm_branch_common): Change method defintion
8105 in class definition to a method declaration and update list of formal
8107 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8108 Arm_relocation_functions::jump24): Adjust call to
8109 Arm_relocate_functions::arm_branch_common. Update list of formal
8111 (Arm_relocate_functions::xpc25): New method definition.
8112 (Arm_relocate_functions::arm_branch_common): Move method defintion
8113 out from class definition. Use stubs for mode-switching and extending
8115 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8116 specially. Change code to enable use of stubs in ARM branches.
8118 2009-11-10 Doug Kwan <dougkwan@google.com>
8120 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8121 in method declaration.
8122 (Target_arm::relocate_stub): New method declaration.
8123 (Target_arm::default_target): Change to return a pointer instead of
8125 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8126 Target_arm::default_target.
8127 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8129 (Target_arm::relocate_section): Adjust view.
8130 (Target_arm::relocate_stub): New method definition.
8132 2009-11-10 Doug Kwan <dougkwan@google.com>
8134 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8136 * incremental.cc (open_incremental_binary): Initialized local
8137 variables to avoid warnings.
8138 * object.cc (make_elf_object): Ditto.
8139 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8142 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8145 * testsuite/plugin_test.c: Include "config.h".
8147 2009-11-09 Doug Kwan <dougkwan@google.com>
8149 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8150 (arm_symbol_value): Remove.
8151 (Arm_relocate_functions::arm_branch_common,
8152 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8153 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8154 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8155 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8156 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8157 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8158 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8159 Arm_relocate_functions::thm_mobw_abs_nc,
8160 Arm_relocate_functions::thm_mov_abs,
8161 Arm_relocate_functions::movw_prel_nc,
8162 Arm_relocate_functions::thm_movt_abs,
8163 Arm_relocate_functions::movt_prel,
8164 Arm_relocate_functions::thm_movw_prel_nc,
8165 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8166 (Target_arm::Relocate::relocate): Only decompose address into two
8167 parts if relocation type uses the thumb-bit and pass the actual
8168 bit instead of a flag indicating that the thumb-bit is used. Adjust
8169 calls to methods in Arm_relocate_functions for this change.
8171 2009-11-08 Ian Lance Taylor <iant@google.com>
8174 * reloc.cc: Instantiate
8175 Sized_relobj::initialize_input_to_output_maps and
8176 Sized_relobj:free_input_to_output_maps.
8178 2009-11-06 Ian Lance Taylor <iant@google.com>
8181 * defstd.cc (in_segment): Set only_if_ref true for "end".
8183 2009-11-06 Doug Kwan <dougkwan@google.com>
8185 * arm.cc (class Reloc_stub): Correct a comment.
8186 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8187 (Target_arm::scan_section_for_stubs): New method declaration.
8188 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8189 Change methods from private to protected.
8190 (Target_arm::do_may_relax): New method definition.
8191 (Target_arm::do_relax, Target_arm::group_sections,
8192 Target_arm::scan_reloc_for_stub,
8193 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8194 (Target_arm::arm_input_section_map_): New data member declaration.
8195 (Target_arm::scan_reloc_for_stub,
8196 Target_arm::scan_reloc_section_for_stubs,
8197 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8198 Target_arm::do_relax): New method definitions.
8200 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8202 * configure.ac: Check for (struct stat)::st_mtim
8203 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8204 * config.in: Regenerate.
8205 * configure: Regenerate.
8207 2009-11-05 Ian Lance Taylor <iant@google.com>
8210 * output.cc (Output_segment::add_output_section): Add missing
8213 2009-11-04 Ian Lance Taylor <iant@google.com>
8216 * object.h (class Object): Add is_needed and set_is_needed
8217 methods. Add is_needed_ field. Make bool fields into bitfields.
8218 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8219 defined in a dynamic object and referenced by a regular object,
8220 set is_needed for the dynamic object.
8221 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8222 if the file is marked with as_needed and it is not needed.
8224 2009-11-04 Ian Lance Taylor <iant@google.com>
8227 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8228 tags if data is discarded by linker script.
8229 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8230 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8231 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8232 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8234 2009-11-04 Ian Lance Taylor <iant@google.com>
8236 * layout.cc (Layout::get_output_section): Add is_interp and
8237 is_dynamic_linker_section parameters. Change all callers.
8238 (Layout::choose_output_section): Likewise.
8239 (Layout::make_output_section): Likewise.
8240 (Layout::add_output_section_data): Add is_dynamic_linker_section
8241 parameter. Change all callers.
8242 * layout.h (class Layout): Update declarations.
8243 * output.h (class Output_section): Add is_interp, set_is_interp,
8244 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8245 Add is_interp_, is_dynamic_linker_section_ fields. Change
8246 generate_code_fills_at_write_ to a bitfield.
8247 * output.cc (Output_section::Output_sections): Initialize new
8249 (Output_segment::add_output_section): Add do_sort parameter.
8252 2009-11-03 Ian Lance Taylor <iant@google.com>
8255 * options.h (class General_options): Add --warn-common.
8256 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8257 merging two common symbols.
8258 (Symbol_table::should_override): Handle --warn-common when merging
8259 a common symbol with a defined symbol. Use report_resolve_problem
8260 for multiple definitions.
8261 (Symbol_table::report_resolve_problem): New function.
8262 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8264 2009-11-03 Doug Kwan <dougkwan@google.com>
8266 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8268 (Target_arm::stub_factory): New method definition.
8269 (Target_arm::new_arm_input_section,
8270 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8271 Target_arm::reloc_uses_thumb_bit): New method declarations.
8272 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8273 New type definitions.
8274 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8275 member declarations.
8276 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8277 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8278 New method definitions.
8280 2009-11-03 Ian Lance Taylor <iant@google.com>
8282 * options.h (class General_options): Add --warn_constructors.
8284 2009-11-03 Ian Lance Taylor <iant@google.com>
8287 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8288 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8290 2009-11-03 Ian Lance Taylor <iant@google.com>
8293 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8294 --msgid-bugs-address.
8295 (install-pdf): New target.
8296 (install-data_yes): Look up one directory to find mkinstalldirs.
8298 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8300 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8303 2009-10-30 Doug Kwan <dougkwan@google.com>
8305 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8307 2009-10-30 Doug Kwan <dougkwan@google.com>
8309 * arm.cc (Stub_addend_reader): New struct template definition
8310 and partial specializations.
8311 (Stub_addend_reader::operator()): New method definition for a
8312 partially specialized template.
8314 2009-10-30 Doug Kwan <dougkwan@google.com>
8316 * arm.cc (Arm_relobj::processor_specific_flags): New method
8318 (Arm_relobj::do_read_symbols): New method declaration.
8319 (Arm_relobj::processor_specific_flags_): New data member declaration.
8320 (Arm_dynobj): New class definition.
8321 (Target_arm::do_finalize_sections): Add input_objects parameter.
8322 (Target_arm::do_adjust_elf_header): New method declaration.
8323 (Target_arm::are_eabi_versions_compatible,
8324 (Target_arm::merge_processor_specific_flags): New method declaration.
8325 (Target_arm::do_make_elf_object): New overloaded method definitions
8327 (Arm_relobj::do_read_symbols): New method definition.
8328 (Arm_dynobj::do_read_symbols): Ditto.
8329 (Target_arm::do_finalize_sections): Add input_objects parameters.
8330 Merge processor-specific flags from all input objects.
8331 (Target_arm::are_eabi_versions_compatible,
8332 Target_arm::merge_processor_specific_flags,
8333 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8334 New method definitions.
8335 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8336 Input_objects pointer type parameter.
8337 * layout.cc (Layout::finalize): Pass input objects to target's.
8338 finalize_sections function.
8339 * output.cc (Output_file_header::do_sized_write): Set ELF file
8340 header's processor-specific flags.
8341 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8342 Input_objects pointer type parameter.
8343 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8344 * target.h (Input_objects): New forward class declaration.
8345 (Target::processor_specific_flags,
8346 Target::are_processor_specific_flags_sect): New method definitions.
8347 (Target::finalize_sections): Add input_objects parameter.
8348 (Target::Target): Initialize processor_specific_flags_ and
8349 are_processor_specific_flags_set_.
8350 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8352 (Target::set_processor_specific_flags): New method definition.
8353 (Target::processor_specific_flags_,
8354 Target::are_processor_specific_flags_set_): New data member
8356 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8357 Input_objects pointer type parameter.
8359 2009-10-30 Doug Kwan <dougkwan@google.com>
8361 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8363 2009-10-28 Ian Lance Taylor <iant@google.com>
8365 * object.h (class Relobj): Drop options parameter from
8366 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8367 do_scan_relocs, do_relocate. Change all callers.
8368 (class Sized_relobj): Drop options parameters from
8369 do_gc_process_relocs, do_scan_relocs, do_relocate,
8370 do_relocate_sections, relocate_sections, emit_relocs_scan,
8371 emit_relocs_scan_reltype. Change all callers.
8372 (struct Relocate_info): Remove options field and all references to
8374 * reloc.h (class Read_relocs): Remove options constructor
8375 parameter and options_ field. Change all callers.
8376 (class Gc_process_relocs, class Scan_relocs): Likewise.
8377 (class Relocate_task): Likewise.
8378 * target-reloc.h (scan_relocs): Remove options parameter. Change
8380 (scan_relocatable_relocs): Likewise.
8381 * target.h (class Sized_target): Remove options parameter from
8382 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8384 * gc.h (gc_process_relocs): Remove options parameter. Change all
8386 * arm.cc: Update functions to remove options parameters.
8387 * i386.cc: Likewise.
8388 * powerpc.cc: Likewise.
8389 * sparc.cc: Likewise.
8390 * x86_64.cc: Likewise.
8391 * testsuite/testfile.cc: Likewise.
8393 2009-10-28 Doug Kwan <dougkwan@google.com>
8395 * arm.cc (Arm_relobj): New class definition.
8396 (Arm_relobj::scan_sections_for_stubs,
8397 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8398 New method definitions.
8400 2009-10-28 Cary Coutant <ccoutant@google.com>
8402 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8403 (Plugin::cleanup_done_): New member.
8404 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8405 (Plugin_manager::cleanup_done_): Remove.
8406 (Plugin_manager::add_input_file): Edit error message.
8407 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8408 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8410 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8412 * fileread.cc: (File_read::View::~View): Use the new
8413 data_ownership_ filed.
8414 (File_read::~File_read): Dispose the new whole_file_view_.
8415 (File_read::open): Mmap the whole file if needed.
8416 (File_read::open): Use whole_file_view_ instead of contents_.
8417 (File_read::find_view): Use whole_file_view_ if applicable.
8418 (File_read::do_read): Use whole_file_view_ instead of contents_.
8419 (File_read::make_view): Use whole_file_view_ instead of contents_,
8420 update File_read::View::View call.
8421 (File_read::find_or_make_view): Update File_read::View::View
8423 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8425 (File_read::View::Data_ownership): New enum.
8426 (File_read::View::View): Replace bool mapped_ with Data_ownership
8428 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8429 (File_read::View::data_ownership_): New field.
8430 (File_read::contents_): Remove (replaced by whole_file_view_).
8431 (File_read::whole_file_view_): New field.
8432 * options.h (class General_options): Add --keep-files-mapped.
8434 2009-10-27 Cary Coutant <ccoutant@google.com>
8436 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8437 * testsuite/Makefile.am (plugin_test_5): New test case.
8438 * testsuite/Makefile.in: Regenerate.
8440 2009-10-25 Doug Kwan <dougkwan@google.com>
8442 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8443 from private to protected to allow access by child class.
8444 (Sized_relobj::do_relocate_sections): New method declaration.
8445 (Sized_relobj::relocate_sections): Virtualize.
8446 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8447 Sized_relobj::relocate_sections. Instantiate template explicitly
8448 for different target sizes and endianity.
8450 2009-10-24 Doug Kwan <dougkwan@google.com>
8452 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8453 (Arm_input_section::as_arm_input_section): New method.
8454 (Arm_output_section): New class definition.
8455 (Arm_output_section::create_stub_group,
8456 Arm_output_section::group_sections): New method definitions.
8458 2009-10-22 Doug Kwan <dougkwan@google.com>
8460 * arm.cc (Arm_input_section): New class definition.
8461 (Arm_input_section::init, Arm_input_section:do_write,
8462 Arm_input_section::set_final_data_size,
8463 Arm_input_section::do_reset_address_and_file_offset): New method
8466 2009-10-21 Doug Kwan <dougkwan@google.com>
8468 * arm.cc (Stub_table, Arm_input_section): New forward class
8470 (Stub_table): New class defintion.
8471 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8472 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8473 New method definition.
8475 2009-10-21 Doug Kwan <dougkwan@google.com>
8477 * arm.cc: Update copyright comments.
8478 (Target_arm): New forward class template declaration.
8479 (Arm_address): New type.
8480 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8481 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8482 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8484 (Insn_template): Same.
8485 (DEF_STUBS): New macro.
8486 (Stub_type): New enum type.
8487 (Stub_template): New class definition.
8490 (Stub_factory): Same.
8491 (Target_arm::Target_arm): Initialize may_use_blx_ and
8492 should_force_pic_veneer_.
8493 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8494 Target_arm::should_force_pic_veneer,
8495 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8496 Target_arm::using_thumb_only, Target_arm:;default_target): New
8498 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8499 New data member declarations.
8500 (Insn_template::size, Insn_template::alignment): New method defintions.
8501 (Stub_template::Stub_template): New method definition.
8502 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8503 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8504 (Stub_factory::Stub_factory): New method definition.
8505 * gold.h (string_hash): New template.
8506 * output.h (Input_section_specifier::hash_value): Use
8508 (Input_section_specifier::string_hash): Remove.
8509 * stringpool.cc (Stringpool_template::string_hash): Use
8512 2009-10-20 Doug Kwan <dougkwan@google.com>
8514 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8515 symbols of relaxed input sections.
8516 * output.h (Output_section::find_relaxed_input_section): Make
8519 2009-10-16 Doug Kwan <dougkwan@google.com>
8521 * dynobj.cc (Versions::Versions): Initialize version_script_.
8522 Only insert base version symbol definition for a shared object
8523 if version script defines any version versions.
8524 (Versions::define_base_version): New method definition.
8525 (Versions::add_def): Check that base version is not needed.
8526 (Versions::add_need): Define base version lazily.
8527 * dynobj.h (Versions::define_base_version): New method declaration.
8528 (Versions::needs_base_version_): New data member declaration.
8529 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8530 (check_DATA): Add no_version_test.stdout.
8531 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8533 * testsuite/Makefile.in: Regenerate.
8534 * testsuite/no_version_test.c: New file.
8535 * testsuite/no_version_test.sh: Ditto.
8537 2009-10-16 Doug Kwan <dougkwan@google.com>
8539 * expression.cc (class Segment_start_expression): New class definition.
8540 (Segment_start_expression::value): New method definition.
8541 (script_exp_function_segment_start): Return a new
8542 Segment_start_expression.
8543 * gold/script-c.h (script_saw_segment_start_expression): New function
8545 * script-sections.cc (Script_sections::Script_sections): Initialize
8546 SAW_SEGMENT_START_EXPRESSION_ to false.
8547 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8548 and -Tbbs options to specify section addresses if given in
8549 command line and no SEGMENT_START expression is seen in a script.
8550 * script-sections.h (Script_sections::saw_segment_start_expression,
8551 Script_sections::set_saw_segment_start_expression): New method
8553 (Script_sections::saw_segment_start_expression_): New data member
8555 * script.cc (script_saw_segment_start_expression): New function.
8556 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8557 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8558 script_test_7.sh and script_test_8.sh.
8559 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8560 script_test_8.stdout.
8561 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8562 (script_test_6, script_test_6.stdout, script_test_7,
8563 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8564 * Makefile.in: Regenerate.
8565 * testsuite/script_test_6.sh: New file.
8566 * testsuite/script_test_6.t: Same.
8567 * testsuite/script_test_7.sh: Same.
8568 * testsuite/script_test_7.t: Same.
8569 * testsuite/script_test_8.sh: Same.
8571 2009-10-16 Doug Kwan <dougkwan@google.com>
8573 * output.cc (Output_segment::set_section_list_address): Cast
8574 expressions to unsigned long long type to avoid format warnings.
8576 2009-10-15 Ian Lance Taylor <iant@google.com>
8578 * script.cc (Script_options::add_symbol_assignment): Always add a
8579 dot assignment to script_sections_.
8580 * script-sections.cc (Script_sections::add_dot_assignment):
8581 Initialize if necessary.
8583 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8584 program headers with no load segment if there is a linker script.
8586 * layout.cc (Layout::set_segment_offsets): Align the file offset
8587 to the segment aligment for -N or -n with no load segment.
8588 * output.cc (Output_segment::add_output_section): Don't crash if
8589 the first section is a TLS section.
8590 (Output_segment::set_section_list_addresses): Print an error
8591 message if the address moves backward in a linker script.
8592 * script-sections.cc
8593 (Output_section_element_input::set_section_addresses): Don't
8594 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8595 (Orphan_output_section::set_section_addresses): Likewise.
8597 2009-10-15 Doug Kwan <dougkwan@google.com>
8599 * layout.cc (Layout::finish_dynamic_section): Generate tags
8600 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8601 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8602 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8604 2009-10-14 Ian Lance Taylor <iant@google.com>
8606 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8608 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8609 data_shdr fields of relinfo.
8610 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8611 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8612 R_386_TLS_LDO_32, adjust based on section flags.
8613 (Target_i386::Relocate::fix_up_ldo): Remove.
8615 2009-10-13 Ian Lance Taylor <iant@google.com>
8617 Add support for -pie.
8618 * options.h (class General_options): Add -pie and
8620 (General_options::output_is_position_independent): Test -pie.
8621 (General_options::output_is_executable): Return true if not shared
8622 and not relocatable.
8623 (General_options::output_is_pie): Remove.
8624 * options.cc (General_options::finalize): Reject incompatible uses
8626 * gold.cc (queue_middle_tasks): A -pie link is not static.
8627 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8628 * symtab.cc (Symbol::final_value_is_known): Return false if
8629 output_is_position_independent.
8630 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8631 output_is_position_independent.
8632 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8633 output_is_position_independent.
8634 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8635 output_is_position_independent.
8636 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8638 (basic_pie_test.o, basic_pie_test): New targets.
8639 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8640 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8641 (two_file_pie_test): New target.
8642 * testsuite/Makefile.in: Rebuild.
8643 * README: Remove note saying that -pie is not supported.
8645 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8647 * options.h (class General_options): Add -init and -fini.
8648 * layout.cc (Layout::finish_dynamic_section): Emit
8649 given init and fini functions.
8651 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8653 * gc.h (gc_process_relocs): Check if icf is enabled using new
8655 * gold.cc (queue_initial_tasks): Likewise.
8656 (queue_middle_tasks): Likewise.
8657 * object.cc (do_layout): Likewise.
8658 * symtab.cc (is_section_folded): Likewise.
8659 * main.cc (main): Likewise.
8660 * reloc.cc (Read_relocs::run): Likewise.
8661 (Sized_relobj::do_scan_relocs): Likewise.
8662 * icf.cc (is_function_ctor_or_dtor): New function.
8663 (Icf::find_identical_sections): Check if function is ctor or dtor when
8665 * options.h (General_options::icf): Change option to be an enum.
8666 (Icf_status): New enum.
8667 (icf_enabled): New method.
8668 (icf_safe_folding): New method.
8669 (set_icf_status): New method.
8670 (icf_status_): New variable.
8671 * (options.cc) (General_options::finalize): Set icf_status_.
8672 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8673 icf_test and icf_keep_unique_test to use the --icf enum flag.
8674 * testsuite/icf_safe_test.sh: New file.
8675 * testsuite/icf_safe_test.cc: New file.
8677 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8679 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8680 includes to gc.h and icf.h.
8681 * arm.cc: Include gc.h.
8682 * gold.cc: Likewise.
8683 * i386.cc: Likewise.
8684 * powerpc.cc: Likewise.
8685 * sparc.cc: Likewise.
8686 * x86_64.cc: Likewise.
8687 * gc.h: Include icf.h.
8689 2009-10-11 Ian Lance Taylor <iant@google.com>
8691 * plugin.cc: Include "gold.h" before other header files.
8693 2009-10-10 Chris Demetriou <cgd@google.com>
8695 * options.h (Input_file_argument::Input_file_type): New enum.
8696 (Input_file_argument::is_lib_): Replace with...
8697 (Input_file_argument::type_): New member.
8698 (Input_file_argument::Input_file_argument): Take Input_file_type
8699 'type' rather than boolean 'is_lib' as second argument.
8700 (Input_file_argument::is_lib): Use type_.
8701 (Input_file_argument::is_searched_file): New function.
8702 (Input_file_argument::may_need_search): Handle is_searched_file.
8703 * options.cc (General_options::parse_library): Support -l:filename.
8704 (General_options::parse_just_symbols): Update for Input_file_argument
8706 (Command_line::process): Likewise.
8707 * archive.cc (Archive::get_file_and_offset): Likewise.
8708 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8709 * script.cc (read_script_file, script_add_file): Likewise.
8710 * fileread.cc (Input_file::Input_file): Likewise.
8711 (Input_file::will_search_for): Handle is_searched_file.
8712 (Input_file::open): Likewise.
8713 * readsyms.cc (Read_symbols::get_name): Likewise.
8714 * testsuite/Makefile.am (searched_file_test): New test.
8715 * testsuite/Makefile.in: Regenerate.
8716 * testsuite/searched_file_test.cc: New file.
8717 * testsuite/searched_file_test_lib.cc: New file.
8719 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8720 Ian Lance Taylor <iant@google.com>
8722 * descriptor.cc: Include <cstdio> and "binary-io.h".
8723 (Descriptors::open): Open the files in binary mode always.
8724 * script.cc (Lex::get_token): Treat \r as whitespace.
8726 2009-10-09 Ian Lance Taylor <iant@google.com>
8728 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8730 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8731 Ian Lance Taylor <iant@google.com>
8733 * configure.ac: Check for readv function also.
8734 * fileread.cc (readv): Define if not HAVE_READV.
8735 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8737 * config.in: Regenerate.
8738 * configure: Regenerate.
8740 2009-10-09 Doug Kwan <dougkwan@google.com>
8742 * layout.cc (Layout::make_output_section): Call target hook to make
8743 ordinary output section.
8744 (Layout::finalize): Adjust parameter list of call the
8745 Target::may_relax().
8746 * layout.h (class Layout::section_list): New method.
8747 * merge.h (Output_merge_base::entsize): Change visibility to public.
8748 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8750 (Output_merge_string::do_is_string): New method.
8751 * object.cc (Sized_relobj::do_setup): renamed from
8752 Sized_relobj::set_up.
8753 * object.h (Sized_relobj::adjust_shndx,
8754 Sized_relobj::initializ_input_to_output_maps,
8755 Sized_relobj::free_input_to_output_maps): Change visibilities to
8757 (Sized_relobj::setup): Virtualize.
8758 (Sized_relobj::do_setup): New method declaration.
8759 (Sized_relobj::invalidate_section_offset,
8760 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8761 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8762 * options.cc (parse_int): New function.
8763 * options.h (parse_int): New declaration.
8764 (DEFINE_int): New macro.
8765 (stub_group_size): New option.
8766 * output.cc (Output_section::Output_section): Initialize memebers
8767 merge_section_map_, merge_section_by_properties_map_,
8768 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8769 (Output_section::add_input_section): Handled deferred code-fill
8770 generation and remove an old comment.
8771 (Output_section::add_relaxed_input_section): New method definition.
8772 (Output_section::add_merge_input_section): Use merge section by
8773 properties map to speed to search. Update merge section maps
8775 (Output_section::build_relaxation_map): New method definition.
8776 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8778 (Output_section::relax_input_section): Renamed to
8779 Output_section::convert_input_sections_to_relaxed_sections and change
8780 interface to take a vector of pointers to relaxed sections.
8781 (Output_section::find_merge_section,
8782 Output_section::find_relaxed_input_section): New method definitions.
8783 (Output_section::is_input_address_mapped,
8784 Output_section::output_offset, Output_section::output_address):
8785 Use output section data maps to speed up searching.
8786 (Output_section::find_starting_output_address): Add comments.
8787 (Output_section::do_write,
8788 Output_section::write_to_postprocessing_buffer): Do code-fill
8789 generation as appropriate.
8790 (Output_section::get_input_sections): Invalidate relaxed input section
8792 (Output_section::restore_states): Adjust type of checkpoint .
8793 Invalidate relaxed input section map.
8794 * output.h (Output_merge_base): New class declaration.
8795 (Input_section_specifier): New class defintion.
8796 (class Output_relaxed_input_section) Change base class to
8797 Output_section_data_build.
8798 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8799 base class initializer.
8800 (Output_section::add_relaxed_input_section): New method declaration.
8801 (Output_section::Input_section): Change visibility to protected.
8802 (Output_section::Input_section::relobj,
8803 Output_section::Input_section::shndx): Handle relaxed input sections.
8804 Output_section::input_sections) Change visibility to protected. Also
8805 define overload to return a non-const pointer.
8806 (Output_section::Merge_section_properties): New class defintion.
8807 (Output_section::Merge_section_by_properties_map,
8808 Output_section::Output_section_data_by_input_section_map,
8809 Output_section::Relaxation_map): New types.
8810 (Output_section::relax_input_section): Rename method to
8811 Output_section::convert_input_sections_to_relaxed_sections and change
8812 interface to take a vector of relaxed section pointers.
8813 (Output_section::find_merge_section,
8814 Output_section::find_relaxed_input_section,
8815 Output_section::build_relaxation_map,
8816 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8817 New method declarations.
8818 (Output_section::merge_section_map_
8819 Output_section::merge_section_by_properties_map_,
8820 Output_section::relaxed_input_section_map_,
8821 Output_section::is_relaxed_input_section_map_valid_,
8822 Output_section::generate_code_fills_at_write_): New data members.
8823 * script-sections.cc
8824 (Output_section_element_input::set_section_addresses): Call
8825 current_data_size and addralign methods of relaxed input sections.
8826 (Orphan_output_section::set_section_addresses): Call current_data_size
8827 and addralign methods of relaxed input sections.
8828 * symtab.cc (Symbol_table::compute_final_value): Extract template
8829 from the body of Symbol_table::sized_finalize_symbol.
8830 (Symbol_table::sized_finalized_symbol): Call
8831 Symbol_table::compute_final_value.
8832 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8833 (Symbol_table::compute_final_value): New templated method declaration.
8834 * target.cc (Target::do_make_output_section): New method defintion.
8835 * target.h (Target::make_output_section): New method declaration.
8836 (Target::relax): Add more parameters for input objects, symbol table
8837 and layout. Adjust call to do_relax.
8838 (Target::do_make_output_section): New method declaration.
8839 (Target::do_relax): Add parameters for input objects, symbol table
8842 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8844 * pread.c: Include stdio.h.
8846 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8848 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8851 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8853 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8854 Change read_shndx type to unsigned int.
8855 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8857 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8858 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8859 Change read_shndx type to unsigned int.
8860 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8862 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8863 * layout.cc (Layout::create_symtab_sections): Cast the result of
8864 local_symcount * symsize to off_t in the gold_assert.
8866 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8868 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8869 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8871 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8872 (Arm_relocate_functions::thm_abs5): New function.
8873 (Arm_relocate_functions::abs12): New function.
8874 (Arm_relocate_functions::abs16): New function.
8875 (Arm_relocate_functions::base_abs): New function.
8876 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8877 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8878 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8880 (Scan::global): Likewise.
8881 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8882 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8883 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8884 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8887 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8889 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8890 (Arm_relocate_functions::movt_prel): New function.
8891 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8892 (Arm_relocate_functions::thm_movt_prel): New function.
8893 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8894 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8895 (Scan::global, Relocate::relocate): Likewise.
8896 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8898 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8900 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8901 Incremental_checker.
8902 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8904 (class Incremental_inputs_header): New class.
8905 (Incremental_inputs_header_writer): Edit comment.
8906 (Incremental_inputs_entry): New class.
8907 (Incremental_inputs_entry_writer): Edit comment.
8908 (Sized_incremental_binary::do_find_incremental_inputs_section):
8909 Add *strtab_shndx parameter, fill it.
8910 (Sized_incremental_binary::do_check_inputs): New method.
8911 (Incremental_checker::can_incrementally_link_output_file): Use
8912 Sized_incremental_binary::check_inputs.
8913 (Incremental_inputs::report_command_line): Save command line in
8916 (Incremental_binary::find_incremental_inputs_section): New
8918 (Incremental_binary::do_find_incremental_inputs_section): Add
8919 strtab_shndx parameter.
8920 (Incremental_binary::do_check_inputs): New pure virtual method.
8921 (Sized_incremental_binary::do_check_inputs): Declare.
8922 (Incremental_checker::Incremental_checker): Add incremental_inputs
8923 parameter, use it to initialize incremental_inputs_.
8924 (Incremental_checker::incremental_inputs_): New field.
8925 (Incremental_checker::command_line): New method.
8926 (Incremental_checker::inputs): New method.
8927 (Incremental_checker::command_line_): New field.
8929 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8931 * incremental.cc: Include <cstdarg> and "target-select.h".
8932 (vexplain_no_incremental): New function.
8933 (explain_no_incremental): New function.
8934 (Incremental_binary::error): New method.
8935 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8937 (make_sized_incremental_binary): New function.
8938 (open_incremental_binary): New function.
8939 (can_incrementally_link_file): Add checks if output is ELF and has
8941 * incremental.h: Include "elfcpp_file.h" and "output.h".
8942 (Incremental_binary): New class.
8943 (Sized_incremental_binary): New class.
8944 (open_incremental_binary): Declare.
8945 * object.cc (is_elf_object): Use
8946 elfcpp::Elf_recognizer::is_elf_file.
8947 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8948 * output.h (Output_file::filesize): New method.
8950 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8952 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8954 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8955 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8957 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8959 (Arm_relocate_functions::movw_abs_nc): New function.
8960 (Arm_relocate_functions::movt_abs): New function.
8961 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8962 (Arm_relocate_functions::thm_movt_abs): New function.
8963 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8964 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8965 (Scan::global): Likewise.
8966 (Relocate::relocate): Likewise.
8967 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8969 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8971 * arm.cc (Arm_relocate_functions::got_prel) New function.
8972 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8973 (Relocate::relocate): Likewise.
8974 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8976 2009-10-06 Ian Lance Taylor <iant@google.com>
8978 * options.h (class General_options): Define
8979 split_stack_adjust_size parameter.
8980 * object.h (class Object): Add uses_split_stack_ and
8981 has_no_split_stack_ fields. Add uses_split_stack and
8982 has_no_split_stack accessor functions. Declare
8983 handle_split_stack_section.
8984 (class Reloc_symbol_changes): Define.
8985 (class Sized_relobj): Define Function_offsets. Declare
8986 split_stack_adjust, split_stack_adjust_reltype, and
8988 * object.cc (Object::handle_split_stack_section): New function.
8989 (Sized_relobj::do_layout): Call handle_split_stack_section.
8990 * dynobj.cc (Sized_dynobj::do_layout): Call
8991 handle_split_stack_section.
8992 * reloc.cc (Sized_relobj::relocate_sections): Call
8993 split_stack_adjust for executable sections in split_stack
8994 objects. Pass reloc_map to relocate_section.
8995 (Sized_relobj::split_stack_adjust): New function.
8996 (Sized_relobj::split_stack_adjust_reltype): New function.
8997 (Sized_relobj::find_functions): New function.
8998 * target-reloc.h: Include "object.h".
8999 (relocate_section): Add reloc_symbol_changes parameter. Change
9001 * target.h (class Target): Add calls_non_split method. Declare
9002 do_calls_non_split virtual method. Declare match_view and
9004 * target.cc: Include "elfcpp.h".
9005 (Target::do_calls_non_split): New function.
9006 (Target::match_view): New function.
9007 (Target::set_view_to_nop): New function.
9008 * gold.cc (queue_middle_tasks): Give an error if mixing
9009 split-stack and non-split-stack objects with -r.
9010 * i386.cc (Target_i386::relocate_section): Add
9011 reloc_symbol_changes parameter.
9012 (Target_i386::do_calls_non_split): New function.
9013 * x86_64.cc (Target_x86_64::relocate_section): Add
9014 reloc_symbol_changes parameter.
9015 (Target_x86_64::do_calls_non_split): New function.
9016 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9018 * powerpc.cc (Target_powerpc::relocate_section): Add
9019 reloc_symbol_changes parameter.
9020 * sparc.cc (Target_sparc::relocate_section): Add
9021 reloc_symbol_changes parameter.
9022 * configure.ac: Call AM_CONDITIONAL for the default target.
9023 * configure: Rebuild.
9024 * testsuite/Makefile.am (TEST_AS): New variable.
9025 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9026 (check_DATA): Add split_i386 and split_x86_64 files.
9027 (SPLIT_DEFSYMS): Define.
9028 (split_i386_[1234n].o): New targets.
9029 (split_i386_[124]): New targets.
9030 (split_i386_[1234r].stdout): New targets.
9031 (split_x86_64_[1234n].o): New targets.
9032 (split_x86_64_[124]): New targets.
9033 (split_x86_64_[1234r].stdout): New targets.
9034 (MOSTLYCLEANFILES): Add new executables.
9035 * testsuite/split_i386.sh: New file.
9036 * testsuite/split_x86_64.sh: New file.
9037 * testsuite/split_i386_1.s: New file.
9038 * testsuite/split_i386_2.s: New file.
9039 * testsuite/split_i386_3.s: New file.
9040 * testsuite/split_i386_4.s: New file.
9041 * testsuite/split_i386_n.s: New file.
9042 * testsuite/split_x86_64_1.s: New file.
9043 * testsuite/split_x86_64_2.s: New file.
9044 * testsuite/split_x86_64_3.s: New file.
9045 * testsuite/split_x86_64_4.s: New file.
9046 * testsuite/split_x86_64_n.s: New file.
9047 * testsuite/testfile.cc (Target_test): Update relocation_section
9049 * testsuite/Makefile.in: Rebuild.
9051 2009-10-06 Ian Lance Taylor <iant@google.com>
9053 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9054 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9055 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9056 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9057 the address on ldo_addrs_.
9058 (Target_i386::Relocate::fix_up_ldo): New function.
9060 2009-10-06 Rafael Espindola <espindola@google.com>
9062 * plugin.cc (add_input_library): New.
9063 (Plugin::load): Add add_input_library to tv.
9064 (Plugin_manager::add_input_file): Add the is_lib argument.
9065 (add_input_file): Update call to Plugin_manager::add_input_file.
9066 (add_input_library): New.
9067 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9069 2009-09-30 Doug Kwan <dougkwan@google.com>
9071 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9072 symbol and call Symbol::may_need_copy_reloc to determine if
9073 a copy reloc is needed.
9074 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9075 nocopyreloc is given in command line.
9076 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9077 given in command line.
9078 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9079 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9080 of the removed Target_i386::may_need_copy_reloc.
9081 * options.h (copyreloc): New option with default value false.
9082 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9083 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9084 instead of the removed Target_powerpc::may_need_copy_reloc.
9085 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9086 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9087 instead of the removed Target_sparc::may_need_copy_reloc.
9088 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9089 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9090 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9091 instead of the removed Target_x86_64::may_need_copy_reloc.
9093 2009-09-30 Ian Lance Taylor <iant@google.com>
9095 * object.h (class Object): Remove target_ field, and target,
9096 sized_target, and set_target methods.
9097 (Object::sized_target): Remove.
9098 (class Sized_relobj): Update declarations. Remove sized_target.
9099 * object.cc (Sized_relobj::setup): Remove target parameter.
9101 (Input_objects::add_object): Don't do anything with the target.
9102 (make_elf_sized_object): Add punconfigured parameter. Change all
9103 callers. Set or test parameter target.
9104 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9106 * parameters.cc (Parameters::set_target): Change parameter type to
9108 (Parameters::default_target): Remove.
9109 (set_parameters_target): Change parameter type to be non-const.
9110 (parameters_force_valid_target): New function.
9111 (parameters_clear_target): New function.
9112 * parameters.h (class Parameters): Update declarations. Remove
9113 default_target method. Add sized_target and clear_target
9114 methods. Change target_ to be non-const.
9115 (set_parameters_target): Update declaration.
9116 (parameters_force_valid_target): Declare.
9117 (parameters_clear_target): Declare.
9118 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9119 as NULL if we aren't searching.
9120 (Add_symbols::run): Don't check for compatible target.
9121 * fileread.cc (Input_file::open_binary): Call
9122 parameters_force_valid_target.
9123 * gold.cc (queue_middle_tasks): Likewise.
9124 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9125 set_target on object.
9126 * dynobj.h (class Sized_dynobj): Update declarations.
9127 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9128 make_elf_object returns NULL.
9129 (Archive::include_member): Don't check whether object target is
9131 * output.cc (Output_section::add_input_section): Get target from
9133 (Output_section::relax_input_section): Likewise.
9134 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9136 (Sized_relobj::do_scan_relocs): Likewise.
9137 (Sized_relobj::relocate_sections): Likewise.
9138 * resolve.cc (Symbol_table::resolve): Likewise.
9139 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9140 parameter. Change all callers.
9141 (Symbol_table::add_from_object): Get target from parameters.
9142 (Symbol_table::add_from_relobj): Don't check object target.
9143 (Symbol_table::add_from_dynobj): Likewise.
9144 (Symbol_table::define_special_symbol): Get target from
9146 * symtab.h (class Symbol_table): Update declaration.
9147 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9148 parameter. Change all callers. Clear parameter target.
9149 (Binary_test): Test target here.
9150 * testsuite/object_unittest.cc (gold_testsuite): Remove
9151 target_test_pointer parameter. Change all callers.
9152 (Object_test): Test target here.
9154 2009-09-26 Ian Lance Taylor <iant@google.com>
9156 * testsuite/initpri1.c: Don't try to use constructor priorities if
9157 compiling with gcc before 4.3.
9159 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9161 * testsuite/retain_symbols_file_test.sh (check_present): Change
9162 output file name to retain_symbols_file_test.stdout.
9163 (check_absent): Likewise.
9165 2009-09-18 Craig Silverstein <csilvers@google.com>
9167 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9168 * options.cc: Include <cerrno> and <fstream>.
9169 (General_options::finalize): Parse -retain-symbols-file tag.
9170 * options.h: New flag.
9171 (General_options): New method should_retain_symbol, new
9172 variable symbols_to_retain.
9173 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9174 should_retain_symbol map.
9175 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9176 * testsuite/Makefile.in: Regenerate.
9177 * testsuite/retain_symbols_file_test.sh: New file.
9179 2009-09-18 Nick Clifton <nickc@redhat.com>
9181 * po/es.po: Updated Spanish translation.
9183 2009-09-17 Doug Kwan <dougkwan@google.com>
9185 * debug.h (DEBUG_RELAXATION): New constant.
9186 (DEBUG_ALL): Add DEBUG_RELAXATION.
9187 (debug_string_to_enum): Add relaxation debug option.
9189 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9190 Layout::Relaxation_debug_check::read_sections,
9191 Layout::Relaxation_debug_check::read_sections): New method definitions.
9192 (Layout::Layout): Initialize data members
9193 record_output_section_data_from_scrips_,
9194 script_output_section_data_list_ and relaxation_debug_check_.
9195 (Layout::save_segments, Layout::restore_segments,
9196 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9197 Layout::relaxation_loop_body): New method definitions.
9198 (Layout::finalize): Support relaxation. Move section layout code to
9199 Layout::relaxation_loop_body.
9200 (Layout::set_asection_address_from_script): Move code for orphan
9201 section placement out.
9202 (Layout::place_orphan_sections_in_script): New method definition.
9203 * layout.h (Output_segment_headers, Output_file_header):
9204 New forward class declarations.
9205 (Layout::~Layout): Define.
9206 (Layout::new_output_section_data_from_script): New method definition.
9207 (Layout::place_orphan_sections_in_script): New method declaration.
9208 (Layout::Segment_states): New type declaration.
9209 (Layout::save_segments, Layout::restore_segments,
9210 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9211 Layout::relaxation_loop_body): New method declarations.
9212 (Layout::Output_section_data_list): New type declaration.
9213 (Layout::Relaxation_debug_check): New class definition.
9214 (Layout::record_output_section_data_from_script_,
9215 Layout::script_output_section_data_list_, Layout::segment_states_,
9216 Layout::relaxation_debug_check_): New data members.
9217 * output.cc: (Output_section_headers::do_size): New method definition.
9218 (Output_section_headers::Output_section_headers): Move size
9219 computation to Output_section_headers::do_size.
9220 (Output_segment_headers::do_size): New method definition.
9221 (Output_file_header::Output_file_header): Move size computation to
9222 Output_file_header::do_size and call it.
9223 (Output_file_header::do_size): New method definition.
9224 (Output_data_group::Output_data_group): Adjust call to
9225 Output_section_data.
9226 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9227 (Output_symtab_xindex::do_write): Add array bound check.
9228 (Output_section::Input_section::print_to_mapfile): Handle
9229 RELAXED_INPUT_SECTION_CODE.
9230 (Output_section::Output_section): Initialize data member checkpoint_.
9231 (Output_section::~Output_section): Delete checkpoint object pointed
9233 (Output_section::add_input_section): Always add an Input_section if
9235 (Output_section::add_merge_input_section): Add assert.
9236 (Output_section::relax_input_section): New method definition.
9237 (Output_section::set_final_data_size): Set load address to zero for
9238 an unallocated section.
9239 (Output_section::do_address_and_file_offset_have_reset_values):
9240 New method definition.
9241 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9242 Handle relaxed input section.
9243 (Output_section::sort_attached_input_sections): Checkpoint input
9244 section list lazily.
9245 (Output_section::get_input_sections): Change type of input_sections to
9246 list of Simple_input_section pointers. Checkpoint input section list
9247 lazily. Also handle relaxed input sections.
9248 (Output_section::add_input_section_for_script): Take a reference to
9249 a Simple_input_section object instead of Relobj pointer and section
9250 index as parameter. Handle relaxed input sections.
9251 (Output_section::save_states, Output_section::restore_states): New
9253 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9254 (Output_data::is_data_size_fixed): New method definition.
9255 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9257 (Output_data::address_and_file_offset_have_reset_values): New method
9259 (Output_data::do_address_and_file_offset_have_reset_values): New method
9261 (Output_data::set_data_size): Check that data size is not fixed.
9262 (Output_data::fix_data_size): New method definition.
9263 (Output_data::is_data_size_fixed_): New data member.
9264 (Output_section_headers::set_final_data_size): New method definition.
9265 (Output_section_headers::do_size): New method declaration.
9266 (Output_segment_headers::set_final_data_size): New method definition.
9267 (Output_segment_headers::do_size): New method declaration.
9268 (Output_file_header::set_final_data_size)::New method definition.
9269 (Output_file_header::do_size)::New method declaration.
9270 (Output_section_data::Output_section_data): Add new parameter
9271 is_data_size_fixed and use it to fix data size.
9272 (Output_data_const::Output_data_const): Adjust call to base class
9273 constructor and fix data size.
9274 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9275 base class constructor and fix data size.
9276 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9277 base class constructor and fix data size.
9278 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9279 class constructor and fix data size.
9280 (Output_data_group::set_final_data_size): New method definition.
9281 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9282 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9283 class constructor and fix data size.
9284 (Output_relaxed_input_section): New class definition.
9285 (Output_section::Simple_input_section): New class definition.
9286 (Output_section::get_input_sections): Adjust parameter list.
9287 (Output_section::add_input_section_for_script): Same.
9288 (Output_section::save_states, Output_section::restore_states,
9289 Output_section::do_address_and_file_offset_have_reset_values,
9290 (Output_section::Input_section::Input_section): Handle
9291 RELAXED_INPUT_SECTION_CODE. Add new overload for
9292 Output_relaxed_input_section.
9293 (Output_section::Input_section::is_input_section,
9294 Output_section::Input_section::set_output_section): Handle relaxed
9296 (Output_section::Input_section::is_relaxed_input_section,
9297 Output_section::Input_section::output_section_data,
9298 Output_section::Input_section::relaxed_input_section): New method
9300 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9302 (Output_section::Input_section::u1_): Update comments.
9303 (Output_section::Input_section::u2_): Add new union member poris.
9304 (Output_section::Checkpoint_output_section): New classs definition.
9305 (Output_section::relax_input_section): New method declaration.
9306 (Output_section::checkpoint_): New data member.
9307 (Output_segment): Update comments.
9308 (Output_segment::Output_segment): Un-privatize copy constructor.
9309 (Output_segment::operator=): Un-privatize.
9310 * script-sections.cc (Output_section_element::Input_section_list):
9311 Change element type to Output_section::Simple_input_section.
9312 (Output_section_element_dot_assignment::set_section_addresses):
9313 Register output section data for relaxation clean up.
9314 (Output_data_exression::Output_data_expression): Adjust call to base
9315 constructor to fix data size.
9316 (Output_section_element_data::set_section_addresses): Register
9317 Output_data_expression object for relaxation clean up.
9318 (struct Input_section_info): Replace Relobj pointer and section index
9319 pair with Output_section::Simple_input_section and Convert struct to a
9321 (Input_section_sorter::operator()): Adjust access to
9322 Input_section_info data member to use accessors.
9323 (Output_section_element_input::set_section_addresses): Use layout
9324 parameter. Adjust code to use Output_section::Simple_input_section
9325 and Input_secction_info classes. Register filler for relaxation
9327 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9328 and section index pair with Output_section::Simple_input_section
9329 class. Adjust code accordingly.
9330 (Phdrs_element::release_segment): New method definition.
9331 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9333 (Script_sections::release_segments): New method definition.
9334 * gold/script-sections.h (Script_sections::release_segments): New
9336 * gold/target.h (Target::may_relax, Target::relax,
9337 Target::do_may_relax, Target::do_relax): New method definitions.
9339 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9341 * arm.cc (has_signed_unsigned_overflow): New function.
9342 (Arm_relocate_functions::abs8): New function.
9343 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9344 (Target_arm::Scan::global): Likewise.
9345 (Target_arm::relocate::relocate): Likewise.
9346 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9349 2009-09-16 Cary Coutant <ccoutant@google.com>
9351 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9352 * testsuite/Makefile.in: Regenerate.
9354 2009-09-11 Nick Clifton <nickc@redhat.com>
9356 * po/gold.pot: Updated by the Translation project.
9358 2009-09-08 Cary Coutant <ccoutant@google.com>
9360 * output.cc (Output_file::open): Add execute permission to empty file.
9361 * testsuite/Makefile.am (permission_test): New test.
9362 * testsuite/Makefile.in: Regenerate.
9364 2009-09-02 Ian Lance Taylor <iant@google.com>
9366 * output.cc (Output_file::resize): Call map_no_anonymous rather
9369 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9371 * gold.cc: Include "incremental.h".
9372 (queue_initial_tasks): Call Incremental_checker methods.
9373 * incremental.cc: Include "output.h".
9374 (Incremental_checker::can_incrementally_link_output_file): New
9376 * incremental.h (Incremental_checker): New class.
9378 * output.cc (Output_file::open_for_modification): New method.
9379 (Output_file::map_anonymous): Changed return type to bool. Record
9381 (Output_file::map_no_anonymous): New method, broken out of map.
9382 (Output_file::map): Use map_no_anonymous and map_anonymous.
9383 * output.h (class Output_file): Update declarations.
9385 2009-08-24 Cary Coutant <ccoutant@google.com>
9387 * options.h (Command_line::Pre_options): New class.
9388 (Command_line::pre_options): New member.
9389 * options.cc (gold::options::ready_to_register): New variable.
9390 (One_option::register_option): Do nothing if not registering options.
9391 Assert if same short option registered twice.
9392 (General_options::General_options): Turn off option registration when
9394 (Command_line::Pre_options::Pre_options): New constructor.
9396 2009-08-24 Cary Coutant <ccoutant@google.com>
9398 * options.h (General_options::no_keep_memory): Remove incorrect
9401 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9403 * Makefile.am (am__skiplex, am__skipyacc): New.
9404 * Makefile.in: Regenerate.
9406 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9408 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9409 (INCLUDES): ... this.
9410 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9411 (AM_CPPFLAGS): Renamed from ...
9412 (INCLUDE): ... this.
9413 * Makefile.in, testsuite/Makefile.in: Regenerate.
9415 * Makefile.in: Regenerate.
9416 * aclocal.m4: Likewise.
9417 * config.in: Likewise.
9418 * configure: Likewise.
9419 * testsuite/Makefile.in: Likewise.
9421 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9422 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9423 * Makefile.in: Regenerate.
9424 * testsuite/Makefile.in: Regenerate.
9426 2009-08-19 Cary Coutant <ccoutant@google.com>
9428 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9429 symbols in shared libraries overridden by hidden or internal symbols
9430 in the main program.
9432 2009-08-19 Chris Demetriou <cgd@google.com>
9434 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9435 checking source file names in error messages.
9437 2009-08-18 Doug Kwan <dougkwan@google.com>
9439 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9440 an elcpp::Ehdr as parameter. Adjust call to set_target.
9441 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9442 an elfcpp::Ehdr as parameter.
9443 * object.cc (Object::set_target): Remove the version that looks up
9444 a target and sets it.
9445 (Sized_relobj::setup): Take a Target object instead of
9446 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9447 (make_elf_sized_object): Find target and ask target to
9449 * object.h: (Object::set_target): Remove the version that looks up
9450 a target and sets it.
9451 (Sized_relobj::setup): Take a Target object instead of
9452 an elfcpp:Ehdr as parameter.
9453 * target.cc: Include dynobj.h.
9454 (Target::do_make_elf_object_implementation): New.
9455 (Target::do_make_elf_object): New.
9456 * target.h (Target::make_elf_object): New template declaration.
9457 (Target::do_make_elf_object): New method declarations.
9458 (Target::do_make_elf_object_implementation): New template declaration.
9460 2009-08-14 Ian Lance Taylor <iant@google.com>
9462 * gold.h (FUNCTION_NAME): Define.
9463 (gold_unreachable): Use FUNCTION_NAME.
9465 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9467 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9468 symbol in the --keep-unique list is not found.
9470 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9472 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9473 been maked as --keep-unique.
9474 (Icf::unfold_section): New function.
9475 * icf.h (Icf::unfold_section): New function.
9476 * options.h (General_options::keep_unique): New option.
9477 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9478 * testsuite/Makefile.in: Regenerate.
9479 * testsuite/icf_keep_unique_test.sh: New file.
9480 * testsuite/icf_keep_unique_test.cc: New file.
9482 2009-08-12 Cary Coutant <ccoutant@google.com>
9485 * resolve.cc (Symbol_table::resolve): Check for references from
9486 dynamic objects to hidden and internal symbols.
9487 * testsuite/Makefile.am (hidden_test.sh): New test.
9488 * testsuite/Makefile.in: Regenerate.
9489 * testsuite/hidden_test.sh: New script.
9490 * testsuite/hidden_test_1.c: New test source.
9491 * testsuite/hidden_test_main.c: New test source.
9493 2009-08-11 Doug Kwan <dougkwan@google.com>
9495 * arm.cc: Update comments.
9496 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9497 segment to locate the .ARM.exidx section if present.
9499 2009-08-09 Doug Kwan <dougkwan@google.com>
9501 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9504 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9505 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9508 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9510 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9511 valid tls_segment only for non-debug-section relocations.
9512 * testsuite/Makefile.am: Add gc_tls_test.
9513 * testsuite/Makefile.in: Regenerate.
9514 * testsuite/gc_tls_test.cc: New file.
9515 * testsuite/gc_tls_test.sh: New file.
9517 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9521 * Makefile.am (CCFILES): Add icf.cc.
9523 * Makefile.in: Regenerate.
9524 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9525 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9526 section, symbol and addend information for the relocs.
9527 * gold.cc (queue_middle_tasks): Call identical code folding.
9528 * gold.h: Add defines for multimap.
9529 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9530 to the call of finalize_local_symbols.
9531 * main.cc (main): Create object of class Icf.
9532 * object.cc (Sized_relobj::do_layout): Allow this function to be
9533 called twice during icf.
9534 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9535 to sections marked as identical by icf.
9536 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9538 (Sized_relobj::do_section_entsize): New function.
9539 * object.h (Object::section_entsize): New function.
9540 (Object::do_section_entsize): New pure virtual function.
9541 (Relobj::finalize_local_symbols): Add new parameter.
9542 (Relobj::do_section_entsize): New function.
9543 * options.h (General_options::icf): New option.
9544 (General_options::icf_iterations): New option.
9545 (General_options::print_icf_sections): New option.
9546 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9547 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9548 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9550 * symtab.cc (Symbol_table::is_section_folded): New function.
9551 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9552 to sections marked as identical by icf.
9553 * symtab.h (Symbol_table::set_icf): New function.
9554 (Symbol_table::icf): New function.
9555 (Symbol_table::is_section_folded): New function.
9556 (Symbol_table::icf_): New data member.
9557 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9558 * testsuite/Makefile.am: Add commands to build icf_test.
9559 * testsuite/Makefile.in: Regenerate.
9560 * testsuite/icf_test.sh: New file.
9561 * testsuite/icf_test.cc: New file.
9563 2009-07-24 Chris Demetriou <cgd@google.com>
9565 * layout.cc (is_compressible_debug_section): Fix incorrect
9566 comment about compressed section names.
9568 2009-07-20 Ian Lance Taylor <ian@airs.com>
9571 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9573 2009-07-16 Ian Lance Taylor <iant@google.com>
9576 * layout.h: #include <map>.
9577 (class Kept_section): Change from struct to class. Add accessors
9578 and setters. Add section size to Comdat_group mapping. Change
9579 Comdat_group to std::map. Add is_comdat_ field. Add
9580 linkonce_size field in union.
9581 (class Layout): Update declaration of find_or_add_kept_section.
9582 Don't declare find_kept_object.
9583 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9584 parameter. Add object, shndx, is_comdat, and is_group_name
9585 parameters. Change all callers. Adjust for new Kept_section.
9586 (Layout::find_kept_object): Remove.
9587 * object.cc (Sized_relobj::include_section_group): Update use of
9588 Kept_section. Rename secnum to shndx. Only record
9589 Kept_comdat_section if sections are the same size.
9590 (Sized_relobj::include_linkonce_section): Update use of
9591 Kept_section. Only record Kept_comdat_section if sections are the
9592 same size. Set size of linkonce section.
9593 (Sized_relobj::map_to_kept_section): Update call to
9594 get_kept_comdat_section.
9595 * object.h (class Sized_relobj): Rename fields in
9596 Kept_comdat_section to drop trailing underscores; change object
9597 field to Relobj*. Change Kept_comdat_section_table to store
9598 struct rather than pointer.
9599 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9600 Add kept_object and kept_shndx parameters. Change all callers.
9601 (Sized_relobj::get_kept_comdat_section): Change return type to
9602 bool. Add kept_object and kept_shndx parameters. Change all
9604 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9605 Layout::find_or_add_kept_section.
9607 2009-07-09 Ian Lance Taylor <iant@google.com>
9609 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9610 Reserve space in the hash table.
9612 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9614 * fileread.cc (File_read::get_mtime): New method.
9615 * fileread.h (Timespec): New structure.
9616 (File_read::get_mtime): New method.
9617 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9618 Renamed from timestamp_nsec.
9619 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9621 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9623 (Incremental_inputs::report_archive): Save mtime; style fix.
9624 (Incremental_inputs::report_obejct): Save mtime; style fix.
9625 (Incremental_inputs::report_script): Save mtime; style fix.
9626 (Incremental_inputs::finalize_inputs): Style fix.
9627 (Incremental_inputs::finalize): Style fix.
9628 (Incremental_inputs::create_input_section_data): Store inputs
9630 * incremental.h (Incremental_inputs::report_script): Add mtime
9632 (Incremental_inputs::Input_info::Input_info): Intialize only one
9634 (Incremental_inputs::Input_info::archive): Move to nameless
9636 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9637 (Incremental_inputs::Input_info::script): Move to nameless union.
9638 (Incremental_inputs::mtime): New field.
9639 * script.cc (read_input_script): Pass file mtime to
9641 * script.h (Script_info::inputs): Style fix.
9643 2009-07-01 Ian Lance Taylor <ian@airs.com>
9645 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9648 2009-06-24 Ian Lance Taylor <iant@google.com>
9651 * layout.cc (Layout::choose_output_section): If we find an
9652 existing section, update the flags.
9653 (Layout::create_notes): New function, broken out of
9655 (Layout::finalize): Don't create note sections.
9656 (Layout::create_note): Don't crash if linker script discards
9658 (Layout::create_gold_note): Likewise.
9659 (Layout::create_build_id): Likewise. Don't set
9660 after_input_sections on the section.
9661 (Layout::create_executable_stack_info): Remove target parameter.
9663 * layout.h (class Layout): Declare create_notes. Update
9664 declaration of create_executable_stack_info.
9665 * gold.cc (queue_middle_tasks): Call create_notes.
9666 * output.cc (Output_section::update_flags_for_input_section): Move
9667 here from output.h. If SHF_ALLOC flag is newly set, mark address
9669 * output.h (Output_data::mark_address_invalid): New function.
9670 (class Output_section): Only declare, not define,
9671 update_flags_for_input_section. Remove set_flags.
9673 2009-06-24 Ian Lance Taylor <iant@google.com>
9675 * script-sections.cc (Output_section_definition::
9676 set_section_addresses): Rename shadowing local load_address to
9679 2009-06-24 Ian Lance Taylor <iant@google.com>
9682 * reloc.cc (relocate_sections): Skip empty relocation sections.
9684 2009-06-23 Ian Lance Taylor <iant@google.com>
9687 * layout.cc (Layout::create_note): Use choose_output_section
9688 rather than make_output_section.
9690 2009-06-23 Ian Lance Taylor <iant@google.com>
9693 * options.cc (General_options::parse_V): Set printed_version_.
9694 (General_options::General_options): Initialize printed_version_.
9695 * options.h (class General_options): Add printed_version_ field.
9696 * gold.cc (queue_initial_tasks): If there are no input files,
9697 don't give a fatal error if we printed the version information.
9698 (queue_middle_tasks): If using -r with a shared object, give a
9699 fatal error rather than an ordinary error.
9701 2009-06-23 Ian Lance Taylor <iant@google.com>
9704 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9705 (Layout::make_output_section): Set have_stabstr_section_ if we see
9706 a .stab*str section.
9707 (Layout::finalize): Call link_stabs_sections.
9708 (Layout::link_stabs_sections): New file.
9709 * layout.h (class Layout): Add have_stabstr_section_ field.
9710 Declare link_stabs_sections.
9712 2009-06-23 Doug Kwan <dougkwan@google.com>
9714 * Makefile.am (libgold_a_LIBADD): New.
9715 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9716 * Makefile.in: Regenerate.
9717 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9718 * configure: Regenerate.
9719 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9720 * fileread.cc: Include sys/state.h
9721 * gold.h: Declare memmem and strndup if found missing.
9722 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9724 2009-06-23 Ian Lance Taylor <iant@google.com>
9726 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9727 * configure: Rebuild.
9729 2009-06-23 Ian Lance Taylor <iant@google.com>
9732 * object.cc (Object::section_contents): Don't try to get a view if
9733 the section has length zero.
9734 (Object::handle_gnu_warning_section): If the section is empty, use
9735 the name of the section as the warning.
9737 2009-06-23 Ian Lance Taylor <iant@google.com>
9740 * stringpool.h (class Stringpool_template): Add optimize_ field.
9741 (Stringpool_template::set_optimize): New function.
9742 * stringpool.cc (Stringpool_template::Stringpool_template):
9743 Initialize optimize_ field.
9744 (Stringpool_template::set_string_offsets): Test local optimize
9745 fild rather than parameter.
9746 * layout.cc (Layout::Layout): Call set_optimize on the section
9749 2009-06-22 Ian Lance Taylor <iant@google.com>
9752 * yyscript.y: Parse TARGET.
9753 * script.cc (script_set_target): New function.
9754 * script-c.h (script_set_target): Declare.
9755 * options.cc (General_options::string_to_object_format): Rename
9756 from string_to_object_format in anonymous namespace. Change
9758 * options.h (class General_options): Declare
9759 string_to_object_format.
9761 2009-06-22 Ian Lance Taylor <iant@google.com>
9763 * script-sections.cc (Script_sections::create_segments): Don't put
9764 program headers in a PT_LOAD segment if -n or -N.
9766 2009-06-22 Ian Lance Taylor <iant@google.com>
9769 * options.h (class General_options): Add -z lazy and -z now. Sort
9770 -z options into alphabetical order.
9771 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9773 2009-06-21 Ian Lance Taylor <iant@google.com>
9775 * layout.cc (Layout::make_output_section): Call
9776 Target::new_output_section.
9777 (Layout::attach_allocated_section_to_segment): Put large section
9778 sections in a separate load segment with the large segment flag
9780 (Layout::segment_precedes): Sort large data segments after other
9782 (align_file_offset): New static function.
9783 (Layout::set_segment_offsets): Use align_file_offset.
9784 * output.h (class Output_section): Add is_small_section_ and
9785 is_large_section_ fields.
9786 (Output_section::is_small_section): New function.
9787 (Output_section::set_is_small_section): New function.
9788 (Output_section::is_large_section): New function.
9789 (Output_section::set_is_large_section): New function.
9790 (Output_section::is_large_data_section): New function.
9791 (class Output_segment): Add is_large_data_segment_ field.
9792 (Output_segment::is_large_data_segment): New function.
9793 (Output_segment::set_is_large_data_segment): New function.
9794 * output.cc (Output_section::Output_section): Initialize new
9796 (Output_segment::Output_segment): Likewise.
9797 (Output_segment::add_output_section): Add assertion that large
9798 data sections always go in large data segments. Force small data
9799 sections to the end of the list of data sections. Force small BSS
9800 sections to the start of the list of BSS sections. For large BSS
9801 sections to the end of the list of BSS sections.
9802 * symtab.h (class Symbol): Declare is_common_shndx.
9803 (Symbol::is_defined): Check Symbol::is_common_shndx.
9804 (Symbol::is_common): Likewise.
9805 (class Symbol_table): Define enum Commons_section_type. Update
9806 declarations. Add small_commons_ and large_commons_ fields.
9807 * symtab.cc (Symbol::is_common_shndx): New function.
9808 (Symbol_table::Symbol_table): Initialize new fields.
9809 (Symbol_table::add_from_object): Put small and large common
9810 symbols in the right list.
9811 (Symbol_table::sized_finalized_symbol): Check
9812 Symbol::is_common_shndx.
9813 (Symbol_table::sized_write_globals): Likewise.
9814 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9815 common symbol lists. Don't call do_allocate_commons_list if the
9817 (Symbol_table::do_allocate_commons_list): Remove is_tls
9818 parameter. Add comons_section_type parameter. Change all
9819 callers. Handle small and large common symbols.
9820 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9821 Symbol::is_common_shndx.
9822 * resolve.cc (symbol_to_bits): Likewise.
9823 * target.h (Target::small_common_shndx): New function.
9824 (Target::small_common_section_flags): New function.
9825 (Target::large_common_shndx): New function.
9826 (Target::large_common_section_flags): New function.
9827 (Target::new_output_section): New function.
9828 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9829 small_common_section_flags, and large_common_section_flags
9831 (Target::do_new_output_section): New virtual function.
9832 * arm.cc (Target_arm::arm_info): Initialize new fields.
9833 * i386.cc (Target_i386::i386_info): Likewise.
9834 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9836 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9837 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9838 (Target_x86_64::do_new_output_section): New function.
9839 * configure.ac: Define conditional MCMODEL_MEDIUM.
9840 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9841 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9842 (large_LDFLAGS): Define.
9843 * testsuite/large.c: New file.
9844 * testsuite/testfile.cc (Target_test::test_target_info):
9845 Initialize new fields.
9846 * configure, testsuite/Makefile.in: Rebuild.
9848 2009-06-05 Doug Kwan <dougkwan@google.com>
9850 * Makefile.am (CCFILES): Add target.cc.
9851 * Makefile.in: Regenerate.
9852 * i386.cc (class Target_i386): Define new virtual method to
9853 override do_is_local_label_name in parent.
9854 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9855 local symbols if --discard-locals or -X is given.
9856 * options.h (class General_options): Declare new options
9857 '--discard-locals' and '-X' for discarding locals.
9858 * target.h (class Target): Define new methods is_local_label_name.
9859 Declare new virtual method do_is_local_label_name.
9860 * target.cc: New file.
9861 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9862 (check_SCRIPTS): Add discard_locals_test.sh.
9863 (check_DATA): Add discard_local_tests.syms.
9864 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9865 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9866 * testsuite/Makefile.in: Regenerate.
9867 * testsuite/discard_locals_test.c: New file.
9868 * testsuite/discard_locals_test.sh: Same.
9870 2009-06-05 Doug Kwan <dougkwan@google.com>
9872 * object.cc (Sized_relobj::Sized_relobj): Initialize
9873 discarded_eh_frame_shndx_ to -1U.
9874 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9876 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9877 a discarded .eh_frame section.
9878 (Sized_relobj::do_finalize_local_symbols): Ditto.
9879 * object.h (class Sized_relobj): Declare new member
9880 discarded_eh_frame_shndx_.
9881 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9882 (local_labels_test.o, local_labels_test): New rules.
9883 * testsuite/Makefile.in: Regenerate.
9885 2009-06-04 Doug Kwan <dougkwan@google.com>
9887 * layout.cc (Layout::section_name_mapping): Add mapping for
9888 special ARM sections.
9890 2009-06-03 Doug Kwan <dougkwan@google.com>
9892 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9893 (utils::has_overflow): Same.
9895 2009-06-03 Ian Lance Taylor <iant@google.com>
9897 * layout.cc (Layout::section_name_mapping): New array, replacing
9898 Layout::linkonce_mapping.
9899 (Layout::section_name_mapping_count): New variable, replacing
9900 Layout::linkonce_mapping_count.
9901 (Layout::linkonce_output_name): Remove.
9902 (Layout::output_section_name): Rewrite.
9903 * layout.h (class Layout): Rename Linkonce_mapping to
9904 Section_name_mapping, linkonce_mapping to section_name_mapping,
9905 linkonce_mapping_count to section_name_mapping_count. Don't
9906 declare linkonce_output_name.
9908 2009-06-03 Doug Kwan <dougkwan@google.com>
9910 * gold/arm.cc (namespace utils): New.
9911 (Target_arm::reloc_is_non_pic): Define new method.
9912 (class Arm_relocate_functions): New.
9913 (Target_arm::Relocate::relocate): Handle relocation types used by
9916 2009-06-03 Ian Lance Taylor <iant@google.com>
9918 * arm.cc (Target_arm::scan::global): Use || instead of |.
9920 2009-06-02 Doug Kwan <dougkwan@google.com>
9922 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9923 issued_non_pic_error_.
9924 (class Target_arm::Scan): Declare new method check_non_pic.
9925 Define new method symbol_needs_plt_entry.
9926 Declare new data member issued_non_pic_error_.
9927 (class Target_arm::Relocate): Declare new method
9928 should_apply_static_reloc.
9929 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9930 (Target_arm::Scan::check_non_pic): Define new method.
9931 (Target_arm::Scan::local): Handle a small subset of reloc types used
9933 (Target_arm::Scan::local): Same.
9934 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9936 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9938 * incremental.cc (Incremental_inputs::report_command_line): Filter
9939 out --incremental-* options.
9941 2009-05-29 Doug Kwan <dougkwan@google.com>
9943 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9945 (class Target_arm): Update comment.
9946 (Target_arm::Target_arm): Initialize new data members GOT_,
9947 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9948 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9949 and Target_arm::rel_dyn_section.
9950 Declare new_enum Target_arm::Got_type.
9951 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9953 Update commments for member do_dynsym_value.
9954 (Target_arm::got_size, Target_arm::plt_section,
9955 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9956 new methods inside class defintion.
9957 (Target_arm::got_section): Define new method.
9958 (Target_arm::rel_dyn_section): Same.
9959 (Output_data_plt_arm): New template class.
9960 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9961 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9962 (Output_data_plt_arm::add_entry): Same.
9963 (Output_data_plt_arm::first_plt_entry): Define new
9964 static data member for PLT instruction template.
9965 (Output_data_plt_arm::plt_entry): Same.
9966 (Output_data_plt_arm::do_write): Define new method.
9967 (Target_arm::make_plt_entry): Same.
9968 (Target_arm::do_finalize_sections): Same.
9969 (Target_arm::do_dynsym_value): Same.
9971 2009-05-28 Doug Kwan <dougkwan@google.com>
9973 * Makefile.am (TARGETSOURCES): Add arm.cc.
9974 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9975 * Makefile.in: Regenerate.
9977 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9979 2009-05-26 Doug Kwan <dougkwan@google.com>
9981 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9982 (General_options::check_excluded_libs): Strip off directories in
9983 archive name before matching like GNU ld does.
9984 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9985 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9986 (exclude_libs_test_LDFLAGS): Add linker option
9987 -Wl,--exclude-libs,libexclude_libs_test_3
9988 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9989 an explicit archive without using -l.
9990 (alt/libexclude_libs_test_3.a): New make rule.
9991 * testsuite/Makefile.in: Regenerate.
9992 * testsuite/exclude_libs_test.c : Declare lib3_default().
9994 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9995 * exclude_libs_test_3.c: New file.
9997 2009-05-26 Nick Clifton <nickc@redhat.com>
9999 * po/id.po: New Indonesian translation.
10000 * po/gold.pot: Updated template file.
10002 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10004 * testsuite/Makefile.am: Add -ffunction-sections to compile
10005 gc_comdat_test files. Add -Wl,--gc-sections to build
10007 * testsuite/Makefile.in: Regenerate.
10008 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10010 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10012 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10013 kept comdat section was garbage collected.
10014 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10015 * testsuite/Makefile.in: Regenerate.
10016 * testsuite/gc_comdat_test.sh: New file.
10017 * testsuite/gc_comdat_test_1.cc: New file.
10018 * testsuite/gc_comdat_test_2.cc: New file.
10020 2009-05-19 Doug Kwan <dougkwan@google.com>
10022 * archive.cc (Archive::Archive): Move constructor from archive.h
10023 to here. Initialize no_export_.
10024 (Archive::get_elf_object_for_member): Set no_export flag of object.
10025 * archive.h (Archive::Archive): Move constructor body to
10027 (Archive::no_export): New method.
10028 (Archive::no_export_): New field.
10029 * object.h (Object::Object): Initialize no_export_ to false.
10030 (Object::no_export, Object::set_no_export): New methods.
10031 (Object::no_export_): New field.
10032 * options.cc (General_options::parse_exclude_libs): New method.
10033 (General_options::check_excluded_libs) Same.
10034 * options.h (exclude_libs): New option.
10035 (General_options::check_excluded_libs): New method declaration.
10036 (General_options::excluded_libs_): New field.
10037 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10038 default or protected visibility if an object has no-export flag set.
10039 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10040 (check_SCRIPTS): Add exclude_libs_test.sh.
10041 (check_DATA): Add exclude_libs_test.syms.
10042 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10043 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10044 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10045 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10046 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10047 libexclude_libs_test_2.a): New rules.
10048 * testsuite/Makefile.in: Regenerate.
10049 * testsuite/exclude_libs_test.c: New file.
10050 * testsuite/exclude_libs_test.sh: Ditto.
10051 * testsuite/exclude_libs_test_1.c: Ditto.
10052 * testsuite/exclude_libs_test_2.c: Ditto.
10054 2009-05-15 Ian Lance Taylor <iant@google.com>
10056 * configure.ac: Check for declarations for cases where libiberty.h
10057 checks HAVE_DECL_xxx.
10058 * configure, config.in: Rebuild.
10060 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10062 * gold.h (Incremental_argument_list): Remove (invalid) forward
10064 * incremental.cc (Incremental_inputs::report_achive): New method.
10065 (Incremental_inputs::report_object): New method.
10066 (Incremental_inputs::report_script): New method.
10067 (Incremental_inputs::finalize_inputs): New method.
10068 (Incremental_inputs::finalize): Call finalize_inputs().
10069 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10070 Create inputs entries.
10071 * incremental.h (Incremental_input_type): New enum.
10072 (Incremental_inputs::Incremental_input): Initialize new fields.
10073 (Incremental_inputs::report_inputs): New method.
10074 (Incremental_inputs::report_achive): New method.
10075 (Incremental_inputs::report_object): New method.
10076 (Incremental_inputs::report_script): New method.
10077 (Incremental_inputs::finalize_inputs): New method.
10078 (Incremental_inputs::Input_info): New struct.
10079 (Incremental_inputs::Input_info_map): New typedef.
10080 (Incremental_inputs::lock_): New field.
10081 (Incremental_inputs::Inputs_): New field.
10082 (Incremental_inputs::Inputs_map): New field.
10083 * main.cc (main): Call Incremental_input::report_inputs.
10084 * options.h (Input_argument_list): Typedef moved from
10086 (Input_file_group::Files): Remove, use ::Input_argument_list.
10087 (Input_file_group::Input_argument_list): Remove, use
10088 ::Input_argument_list.
10089 * plugin.cc (Plugin_manager::add_input_file): Add error in
10091 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10093 * script.cc (read_input_script): Call
10094 Incremental_input::report_script.
10095 * script.h (Script_info): New class.
10097 2009-04-27 Ian Lance Taylor <iant@google.com>
10099 * x86_64.cc (do_adjust_output_section): Set entsize to
10102 2009-04-23 Elliott Hughes <enh@google.com>
10104 * output.cc (Output_file::close): After short writes, continue
10105 writing from the correct offset in the buffer being written.
10107 2009-04-23 Chris Demetriou <cgd@google.com>
10109 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10110 * configure: Regenerate.
10111 * config.in: Regenerate.
10112 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10113 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10115 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10117 * incremental.cc (Incremental_inputs_header_data): Renamed from
10118 Incremental_input_header_data.
10119 (Incremental_inputs_header_data::data_size): New field.
10120 (Incremental_inputs_header_data::put_input_file_count): Renamed
10121 from input_file_count.
10122 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10123 from command_line_offset.
10124 (Incremental_inputs_header_data::put_reserved): Renamed from
10126 (Incremental_inputs_entry_data): Renamed from
10127 Incremental_input_entry_data.
10128 (Incremental_inputs_entry_data::data_size): New field.
10129 (Incremental_inputs::report_command_line): New method.
10130 (Incremental_inputs::finalize): New method.
10131 (Incremental_inputs::create_incremental_inputs_data): New method.
10132 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10133 * incremental.h: New file.
10134 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10135 (Layout::finalize): Create incremental inputs section in
10136 incremental builds.
10137 (Layout::create_incremental_info_sections): New method.
10138 * layout.h (Layout::incremental_inputs): New method.
10139 (Layout::create_incremental_info_sections): New method.
10140 (Layout::incremental_inputs_): New field.
10141 * main.cc (main): Notify Incremental_input of the command line.
10143 2009-04-01 Ian Lance Taylor <iant@google.com>
10144 Mikolaj Zalewski <mikolajz@google.com>
10146 * gold.h (reserve_unordered_map): Define, three versions, one for
10147 each version of Unordered_map.
10148 * layout.cc (Layout::Layout): Remove options parameter. Add
10149 number_of_input_files parameter. Don't initialize options_.
10150 Initialize number_of_input_files_ and resized_signatures_. Move
10151 sections_are_attached_.
10152 (Layout::layout_group): Reserve space for group_signatures_.
10153 (Layout::find_or_add_kept_section): Change name parameter to be a
10154 reference. Resize signatures_ map when it gets large enough.
10155 (Layout::layout_eh_frame): Use parameters->options() instead of
10157 (Layout::make_output_section): Likewise.
10158 (Layout::attach_allocated_section_to_segment): Likewise.
10159 (Layout::finalize, Layout::create_executable_stack): Likewise.
10160 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10161 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10162 * layout.h (class Layout): Update declarations. Remove options_
10163 field. Add number_of_input_files_ and resized_signatures_
10164 fields. Move sections_are_attached_ field.
10165 * main.cc (main): Pass number of input files to Layout
10166 constructor. Don't pass options.
10168 2009-03-30 Ian Lance Taylor <iant@google.com>
10170 * ffsll.c (ffsll): Correct implementation.
10172 2009-03-27 Ian Lance Taylor <iant@google.com>
10174 * ffsll.c: New file.
10175 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10176 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10177 * ftruncate.c (ftruncate): Declare before definition.
10178 * mremap.c (mremap): Likewise.
10179 * pread.c (pread): Likewise.
10180 * configure, Makefile.in, config.in: Rebuild.
10182 * mremap.c: New file.
10183 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10184 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10185 (mremap): Declare if HAVE_MREMAP is not defined.
10186 * configure, Makefile.in, config.in: Rebuild.
10188 2009-03-27 Cary Coutant <ccoutant@google.com>
10190 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10191 position independent.
10192 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10193 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10195 2009-03-24 Cary Coutant <ccoutant@google.com>
10197 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10199 (needs_dynamic_reloc): Likewise.
10201 2009-03-24 Ian Lance Taylor <iant@google.com>
10203 * yyscript.y (file_cmd): Recognize EXTERN.
10204 (extern_name_list, extern_name_list_body): New nonterminals.
10205 * script.cc (script_add_extern): Define.
10206 * script-c.h (script_add_extern): Declare.
10208 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10210 * object.cc (is_elf_object): Define.
10211 * object.h (is_elf_object): Declare.
10212 * archive.cc (Archive::get_elf_object_for_member): Call
10214 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10216 2009-03-24 Elliott Hughes <enh@google.com>
10218 * output.cc (Output_file::map_anonymous): Define.
10219 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10220 try an anonymous one. Report the size if the mmap fails.
10221 * output.h (class Output_file): Declare map_anonymous.
10223 2009-03-24 Ian Lance Taylor <iant@google.com>
10225 * target-select.cc (instantiate_target): Don't acquire the lock if
10226 the instantiated_target_ field has already been set.
10228 2009-03-23 Ian Lance Taylor <iant@google.com>
10230 * gold-threads.h (class Initialize_lock): Define.
10231 * gold-threads.cc (class Initialize_lock_once): Define.
10232 (initialize_lock_control): New static variable.
10233 (initialize_lock_pointer): New static variable.
10234 (initialize_lock_once): New static function.
10235 (Initialize_lock::Initialize_lock): Define.
10236 (Initialize_lock::initialize): Define.
10237 * target-select.h: Include "gold-threads.h".
10238 (class Target_selector): Add lock_ and initialize_lock_ fields.
10239 Don't define instantiate_target, just declare it.
10240 * target-select.cc (Target_selector::Target_selector): Initialize
10242 (Target_selector::instantiate_target): Define.
10243 * descriptors.h: Include "gold-threads.h".
10244 (class Descriptors): Add initialize_lock_ field.
10245 * descriptors.cc (Descriptors::Descriptors): Initialize new
10247 (Descriptors::open): Use initialize_lock_ field
10248 * errors.h (class Errors): Add initialize_lock_ field.
10249 * errors.cc (Errors::Errors): Initialize new field.
10250 (Errors::initialize_lock): Use initialize_lock_ field.
10251 * powerpc.cc (class Target_selector_powerpc): Remove
10252 instantiated_target_ field. In do_recognize call
10253 instantiate_target rather than do_instantiate_target. In
10254 do_instantiate_target just allocate a new target.
10255 * sparc.cc (class Target_selector_sparc): Likewise.
10257 * freebsd.h: New file.
10258 * i386.cc: Include "freebsd.h".
10259 (Target_i386): Derive from Target_freebsd rather than
10261 (Target_selector_i386): Derive from Target_selector_freebsd rather
10262 than Target_selector.
10263 * x86_64.cc: Include "freebsd.h".
10264 (Target_x86_64): Derive from Target_freebsd rather than
10266 (Target_selector_x86_64): Derive from Target_selector_freebsd
10267 rather than Target_selector.
10268 * target.h (class Target): Add adjust_elf_header and
10269 do_adjust_elf_header.
10270 * output.cc (Output_file_header:: do_sized_write): Call target
10271 adjust_elf_header routine.
10272 * configure.tgt: Set targ_osabi.
10273 * configure.ac: Define GOLD_DEFAULT_OSABI.
10274 * parameters.cc (Parameters::default_target): Pass
10275 GOLD_DEFAULT_OSABI to select_target.
10276 * target-select.h (class Target_selector): Make instantiate_target
10277 protected rather than private.
10278 * Makefile.am (HFILES): Add freebsd.h.
10279 * configure, Makefile.in, config.in: Rebuild.
10281 * merge.cc (do_add_input_section): Correct pend value. Change
10282 message about last entry not being null terminated from error to
10285 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10287 * incremental.cc: New file.
10288 * Makefile.am (CCFILES): Add incremental.cc.
10289 * Makefile.in: Rebuild.
10291 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10293 * layout.cc (Layout::output_section_name): Preserve names
10294 of '.note.' sections.
10296 2009-03-19 Ian Lance Taylor <iant@google.com>
10298 * descriptors.cc (Descriptors::open): Check that the options are
10299 valid before using them.
10301 2009-03-18 Ian Lance Taylor <iant@google.com>
10303 * script-sections.h: Include <list>.
10304 (class Script_sections): Change Sections_elements from std::vector
10305 to std::list. Typedef public Elements_iterator. Add
10306 orphan_section_placement_, data_segment_align_start_, and
10307 saw_data_segment_align_ fields. Remove data_segment_align_index_
10309 * script-sections.cc (class Orphan_section_placement): New class.
10310 (class Sections_element): Add virtual functions is_relro and
10311 orphan_section_init. Remove virtual function place_orphan_here.
10312 (class Output_section_definition): Add is_relro and
10313 orphan_section_init. Remove place_orphan_here.
10314 (class Orphan_output_section): Likewise.
10315 (Script_sections::Script_sections): Update for field changes.
10316 (Script_sections::data_segment_align): Set saw_data_segment_align_
10317 and data_segment_align_start_, not data_segment_align_index.
10318 (Script_sections::data_segment_relro_end): Check
10319 saw_data_segment_align_. Use data_segment_align_start_ rather
10320 than data_segment_align_index_.
10321 (Script_sections::place_orphan): Rewrite to use
10322 Orphan_section_placement.
10324 2009-03-17 Ian Lance Taylor <iant@google.com>
10326 * archive.cc (Archive::add_symbols): Check for a version attached
10327 to the symbol name in the archive map.
10328 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10329 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10330 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10331 (ver_test_11.a): New target.
10332 * testsuite/Makefile.in: Rebuild.
10334 * configure.ac: Check for chsize and posix_fallocate. Replace
10336 * ftruncate.c: New file, from gnulib.
10337 * output.cc (posix_fallocate): Define dummy version if not
10338 HAVE_POSIX_FALLOCATE.
10339 (Output_file::map): Call posix_fallocate rather than lseek and
10341 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10342 * configure, Makefile.in, config.in: Rebuild.
10344 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10346 * layout.h (Layout::create_note): Add section_name parameter.
10347 * layout.cc (Layout::create_note): Likewise.
10348 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10350 2009-03-17 Ian Lance Taylor <iant@google.com>
10352 * descriptors.cc: Include "options.h".
10353 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10354 (Descriptors::open): Always use O_CLOEXEC when opening a new
10355 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10356 then set FD_CLOEXEC.
10358 * sparc.cc (class Target_sparc): Add has_got_section.
10359 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10360 make sure we have a GOT section.
10362 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10363 (Target_sparc::Scan::local): Likewise.
10364 (Target_sparc::Scan::global): Likewise.
10365 (Target_sparc::Relocate::relocate): Likewise.
10366 (Target_sparc::Relocate::relocate_tls): Likewise.
10368 * symtab.cc (Symbol_table::define_default_version): New function,
10369 broken out of add_from_object.
10370 (Symbol_table::add_from_object): Call define_default_version.
10371 (Symbol_table::define_special_symbol): Add resolve_oldsym
10372 parameter. Change all callers. If the version for a symbol comes
10373 from a version script, resolve it with the symbol with the same
10374 name with no version. Also add the symbol without a version if
10376 (do_define_in_output_data): If resolving with oldsym, don't delete
10378 (do_define_in_output_segment): Likewise.
10379 (do_define_as_constant): Likewise.
10380 * symtab.h (class Symbol_table): Update declarations.
10382 2009-03-13 Ian Lance Taylor <iant@google.com>
10384 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10385 (Read_symbols::requeue): New function.
10386 (Read_symbols::do_read_symbols): If make_elf_object fails because
10387 the target type is not configured, and the file was searched for,
10388 issue a warning and retry with the next directory.
10389 (Add_symbols::run): If the file has an incompatible format, and
10390 it was searched for, requeue the Read_symbols task. On error,
10391 release the object.
10392 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10393 dirindex parameter to constructor. Change all callers. Declare
10394 incompatible_warning and requeue.
10395 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10396 input_argument_ and input_group_ fields. Add them to
10397 constructor. Change all callers.
10398 (class Read_script): Add dirindex_ field. Add it to constructor.
10399 Change all callers.
10400 * archive.cc (Archive::setup): Remove input_objects parameter.
10401 Change all callers.
10402 (Archive::get_file_and_offset): Likewise.
10403 (Archive::read_all_symbols): Likewise.
10404 (Archive::read_symbols): Likewise.
10405 (Archive::get_elf_object_for_member): Remove input_objects
10406 parameter. Add punconfigured parameter. Change all callers.
10407 (Archive::add_symbols): Change return type to bool. Check return
10408 value of include_member.
10409 (Archive::include_all_members): Likewise.
10410 (Archive::include_member): Change return type to bool. Return
10411 false if first included object has incompatible target. Set
10412 included_member_ field.
10413 (Add_archive_symbols::run): If add_symbols returns false, requeue
10415 * archive.h (class Archive): Add included_member_ field.
10416 Initialize it in constructor. Add input_file and searched_for
10417 methods. Update declarations.
10418 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10419 input_argument_ fields. Add them to constructor. Change all
10421 * script.cc: Include "target-select.h".
10422 (class Parser_closure): Add skip_on_incompatible_target_ and
10423 found_incompatible_target_ fields. Add
10424 skip_on_incompatible_target parameter to constructor. Change all
10425 callers. Add methods skip_on_incompatible_target,
10426 clear_skip_on_incompatible_target, found_incompatible_target, and
10427 set_found_incompatible_target.
10428 (read_input_script): Add dirindex parameter. Change all callers.
10429 If parser finds an incompatible target, requeue Read_symbols
10431 (script_set_symbol): Clear skip_on_incompatible_target in
10433 (script_add_assertion, script_parse_option): Likewise.
10434 (script_start_sections, script_add_phdr): Likewise.
10435 (script_check_output_format): New function.
10436 * script.h (read_input_script): Update declaration.
10437 * script-c.h (script_check_output_format): Declare.
10438 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10439 (ignore_cmd): Remove OUTPUT_FORMAT.
10440 * fileread.cc (Input_file::Input_file): Add explicit this.
10441 (Input_file::will_search_for): New function.
10442 (Input_file::open): Add pindex parameter. Change all callers.
10443 * fileread.h (class Input_file): Add input_file_argument method.
10444 Declare will_search_for. Update declarations.
10445 * object.cc (make_elf_object): Add punconfigured parameter.
10446 Change all callers.
10447 * object.h (class Object): Make input_file public. Add
10448 searched_for method.
10449 (make_elf_object): Update declaration.
10450 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10452 * dirsearch.h (class Dirsearch): Update declaration.
10453 * options.h (class General_options): Add --warn-search-mismatch.
10454 * parameters.cc (Parameters::is_compatible_target): New function.
10455 * parameters.h (class Parameters): Declare is_compatible_target.
10456 * workqueue.cc (Workqueue::add_blocker): New function.
10457 * workqueue.h (class Workqueue): Declare add_blocker.
10459 * fileread.cc (Input_file::open): Remove options parameter.
10460 Change all callers.
10461 (Input_file::open_binary): Likewise.
10462 * script.cc (read_input_script): Likewise.
10463 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10464 options parameter from constructor. Change all callers.
10465 (class Read_script): Likewise.
10466 * fileread.h (class Input_file): Update declarations.
10467 * script.h (read_input_script): Update declaration.
10469 2009-03-10 Nick Clifton <nickc@redhat.com>
10471 * po/es.po: New Spanish translation.
10473 2009-03-06 Cary Coutant <ccoutant@google.com>
10475 * options.cc (parse_short_option): Keep dash_z from registering itself.
10477 2009-03-03 Ian Lance Taylor <iant@google.com>
10480 * target-reloc.h (relocate_section): Pass output_section to
10482 * i386.cc (Target_i386::should_apply_static_reloc): Add
10483 output_section parameter. Change all callers.
10484 (Target_i386::Relocate::relocate): Add output_section parameter.
10485 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10486 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10487 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10488 * testsuite/two_file_shared.sh: New script.
10489 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10490 (check_DATA): Add two_file_shared.dbg.
10491 (two_file_shared.dbg): New target.
10492 * testsuite/Makefile.in: Rebuild.
10494 2009-03-01 Ian Lance Taylor <iant@google.com>
10496 * configure.ac: Check for byteswap.h.
10497 * configure: Rebuild.
10498 * config.in: Rebuild.
10500 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10502 * layout.cc (Layout::find_or_add_kept_section): New function.
10503 (Layout::add_comdat): Removed.
10504 * layout.h (struct Kept_section): Move out of class Layout.
10505 Remove trailing underscores from field names. Add group_sections
10506 field. Rename group_ field to is_group. Change all uses.
10507 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10508 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10509 comdat_groups_ field.
10510 (Sized_relobj::include_section_group): Use
10511 find_or_add_kept_section and Kept_section::group_sections.
10512 (Sized_relobj::include_linkonce_section): Likewise.
10513 * object.cc (class Sized_relobj): Don't define Comdat_group or
10514 Comdat_group_table. Remove find_comdat_group and
10515 add_comdat_group. Remove comdat_groups_ field.
10516 * plugin.cc (include_comdat_group): Use
10517 Layout::find_or_add_kept_section.
10519 2009-02-28 Ian Lance Taylor <iant@google.com>
10521 * README: --gc-sections and map files are now supported. Document
10522 some build requirements.
10525 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10526 relocatable link set the value of the section symbol to zero.
10527 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10528 relocatable link don't include the section address in the local
10531 2009-02-27 Ian Lance Taylor <iant@google.com>
10534 * options.h (class Search_directory): Add is_system_directory.
10535 (class General_options): Declare is_in_system_directory.
10536 * options.cc (get_relative_sysroot): Make static.
10537 (get_default_sysroot): Make static.
10538 (General_optoins::is_in_system_directory): New function.
10539 * fileread.cc (Input_file::is_in_system_directory): New function.
10540 * fileread.h (class Input_file): Declare is_in_system_directory.
10541 * object.h (class Object): Add is_in_system_directory.
10542 (class Input_objects): Remove system_library_directory_ field.
10543 * object.cc (Input_objects::add_object): Don't set
10544 system_library_directory_.
10545 (input_objects::found_in_system_library_directory): Remove.
10546 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10547 parameter. Change all callers.
10548 (Symbol_table::sized_write_globals): Likewise.
10549 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10550 Call Object::is_in_system_directory.
10551 * symtab.h (class Symbol_table): Update declarations.
10554 * descriptors.h (Open_descriptor): Add is_on_stack field.
10555 * descriptors.cc (Descriptors::open): If the descriptor is on the
10556 top of the stack, remove it. Initialize is_on_stack field.
10557 (Descriptors::release): Only add pod to stack if it is not on the
10559 (Descriptors::close_some_descriptor): Clear stack_next and
10560 is_on_stack fields.
10563 * output.cc (Output_section::find_starting_output_address): Rename
10564 from starting_output_address; add PADDR parameter; change return
10566 * output.h (class Output_section): Declare
10567 find_starting_output_address instead of starting_output_address.
10568 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10569 section symbol for which we can't find a merge section.
10572 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10573 hidden or internal, force the symbol to be local.
10574 * resolve.cc (Symbol::override_visibility): Define.
10575 (Symbol::override_base): Use override_visibility.
10576 (Symbol_table::resolve): Likewise.
10577 (Symbol::override_base_with_special): Likewise.
10578 (Symbol_table::override_with_special): If the visibility is hidden
10579 or internal, force the symbol to be local.
10580 * symtab.h (class Symbol): Add set_visibility and
10581 override_visibility.
10582 * testsuite/ver_test_1.sh: New file.
10583 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10584 (check_DATA): Add ver_test_1.syms.
10585 (ver_test_1.syms): New target.
10586 * testsuite/Makefile.in: Rebuild.
10588 2009-02-25 Cary Coutant <ccoutant@google.com>
10590 * layout.cc (Layout::choose_output_section): Don't rename sections
10591 when using a linker script that has a SECTIONS clause.
10592 * Makefile.in: Regenerate.
10594 * testsuite/Makefile.am (script_test_5.sh): New test case.
10595 * testsuite/Makefile.in: Regenerate.
10596 * testsuite/script_test_5.cc: New file.
10597 * testsuite/script_test_5.sh: New file.
10598 * testsuite/script_test_5.t: New file.
10600 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10602 * archive.cc (Archive::include_member): Update calls to add_symbols.
10603 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10604 the Layout argument.
10605 * dynobj.h (do_add_symbols): Add the Layout argument.
10606 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10608 * object.h (Object::add_symbols): Add the Layout argument.
10609 (Object::do_add_symbols): Add the Layout argument.
10610 (Sized_relobj::do_add_symbols): Add the Layout argument.
10611 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10612 Unify the two versions.
10613 (Add_plugin_symbols): Remove.
10614 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10615 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10616 (Add_plugin_symbols): Remove.
10617 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10618 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10619 (Add_symbols::run): Make it work with Pulginobj.
10621 2009-02-06 Ian Lance Taylor <iant@google.com>
10623 * object.cc (Sized_relobj::do_layout): Make info message start
10624 with lower case letter.
10626 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10628 * binary.cc: Fix file comment.
10630 * options.h (enum Incremental_disposition): Define.
10631 (class General_options): Add new options: --incremental,
10632 --incremental_changed, --incremental_unchanged,
10633 --incremental_unknown. Add incremental_disposition_ and
10634 implicit_incremental_ fields.
10635 (General_options::incremental_disposition): New function.
10636 (class Position_dependent_options): Add incremental_disposition
10638 (Position_dependent_options::copy_from_options): Set incremental
10640 * options.cc (General_options::parse_incremental_changed): New
10642 (General_options::parse_incremental_unchanged): New function.
10643 (General_options::parse_incremental_unknown): New function.
10644 (General_options::General_options): Initialize new fields
10645 incremental_disposition_ and implicit_incremental_.
10646 (General_options::finalize): Check for uasge of --incremental-*
10647 without --incremental.
10649 2009-02-06 Chris Demetriou <cgd@google.com>
10651 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10652 pointer and to report location as the file name associated with
10654 (gold_undefined_symbol_at_location): New function to replace the
10655 old gold_undefined_symbol functionality.
10656 * target-reloc.h (relocate_section): Update to use
10657 gold_undefined_symbol_at_location.
10658 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10659 Call gold_undefined_symbol function rather than gold_error.
10660 * errors.h (Errors::undefined_symbol): Take location as a
10661 string, rather than calculating it from a relocation.
10662 * errors.cc (Errors::fatal): Print "fatal error:" before the
10664 (Errors::error, Errors::error_at_location): Print "error: "
10665 before the formatted message.
10666 (Errors::undefined_symbol): Take location as a string, rather
10667 than calculating it from a relocation.
10668 (gold_undefined_symbol_at_location): New function akin to
10669 old gold_undefined_symbol, calculates location from relocation.
10670 (gold_undefined_symbol): Change to take only a Symbol pointer
10671 and to report location as the file name associated with the symbol.
10672 * testsuite/debug_msg.sh: Update for changed error messages.
10673 * testsuite/undef_symbol.sh: Likewise.
10675 2009-02-04 Duncan Sands <baldrick@free.fr>
10678 * reduced_debug_output.h
10679 (Output_reduced_debug_abbrev_section::failed): Use format for
10681 (Output_reduced_debug_info_section::faild): Likewise.
10683 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10685 * script.cc (Lazy_demangler): New class.
10686 (Version_script_info::get_symbol_version_helper): Demangle a
10689 2009-01-29 Cary Coutant <ccoutant@google.com>
10691 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10693 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10695 2009-01-28 Ian Lance Taylor <iant@google.com>
10697 * version.cc (version_string): Bump to 1.9.
10699 * gold.h: Include <cstring> and <stdint.h>.
10700 * version.cc: Include <cstdio>.
10701 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10703 * reduced_debug_output.cc (insert_into_vector): Rename from
10704 Insert_into_vector; change all callers. Use Swap_unaligned to
10705 avoid aliasing issue; remove union since it is unnecessary.
10707 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10709 * Makefile.am (CCFILES): Add gc.cc.
10710 (HFILES): Add gc.h.
10711 * Makefile.in: Regenerate.
10712 * gold.cc (Gc_runner): New class.
10713 (queue_initial_tasks): Call garbage collection related tasks
10714 when corresponding options are invoked.
10715 (queue_middle_gc_tasks): New function.
10716 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10717 processed early before laying out sections during garbage collection.
10718 * gold.h (queue_middle_gc_tasks): New function.
10719 (is_prefix_of): Move from "layout.cc".
10720 * i386.cc (Target_i386::gc_process_relocs): New function.
10721 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10722 * main.cc (main): Create object of class "Garbage_collection".
10723 * object.cc (Relobj::copy_symbols_data): New function.
10724 (Relobj::is_section_name_included): New function.
10725 (Sized_relobj::do_layout): Allow this function to be called twice
10726 during garbage collection and defer layout of section during the
10728 * object.h (Relobj::get_symbols_data): New function.
10729 (Relobj::is_section_name_included): New function.
10730 (Relobj::copy_symbols_data): New function.
10731 (Relobj::set_symbols_data): New function.
10732 (Relobj::get_relocs_data): New function.
10733 (Relobj::set_relocs_data): New function.
10734 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10735 (Relobj::gc_process_relocs): New function.
10736 (Relobj::do_gc_process_relocs): New pure virtual function.
10737 (Relobj::sd_): New data member.
10738 (Sized_relobj::is_output_section_offset_invalid): New function.
10739 (Sized_relobj::do_gc_process_relocs): New function.
10740 * options.h (General_options::gc_sections): Modify to not be a no-op.
10741 (General_options::print_gc_sections): New option.
10742 * plugin.cc (Plugin_finish::run): Remove function call to
10743 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10744 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10745 * reloc.cc (Read_relocs::run): Add task to process relocs and
10746 determine unreferenced sections when doing garbage collection.
10747 (Gc_process_relocs): New class.
10748 (Sized_relobj::do_gc_process_relocs): New function.
10749 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10750 sections that are garbage collected.
10751 * reloc.h (Gc_process_relocs): New class.
10752 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10753 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10754 symbols whose corresponding sections are garbage collected.
10755 (Symbol_table::Symbol_table): Add new parameter for the garbage
10757 (Symbol_table::gc_mark_undef_symbols): New function.
10758 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10759 (Symbol_table::gc_mark_dyn_syms): New function.
10760 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10762 (Symbol_table::add_from_object): Likewise.
10763 (Symbol_table::add_from_relobj): When building shared objects, do not
10764 treat externally visible symbols as garbage.
10765 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10766 table information for static and relocatable links.
10767 * symtab.h (Symbol_table::set_gc): New function.
10768 (Symbol_table::gc): New function.
10769 (Symbol_table::gc_mark_undef_symbols): New function.
10770 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10771 (Symbol_table::gc_mark_dyn_syms): New function.
10772 (Symbol_table::gc_): New data member.
10773 * target.h (Sized_target::gc_process_relocs): New pure virtual
10775 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10776 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10778 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10780 * options.h (General_options::gc_sections): Define as a no-op for now.
10781 (General_options::no_keep_memory): Ditto.
10782 (General_options::Bshareable): Define.
10783 * options.cc (General_options::finalize): Honor -Bshareable.
10785 2009-01-20 Andreas Schwab <schwab@suse.de>
10787 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10788 read the value in the contents, since we don't use it. Use the
10789 template endianness when writing.
10790 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10792 2009-01-19 Andreas Schwab <schwab@suse.de>
10794 * configure.tgt (powerpc64-*): Fix targ_obj.
10796 2009-01-15 Ian Lance Taylor <iant@google.com>
10798 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10799 local symbols when stripping all symbols.
10801 2009-01-14 Cary Coutant <ccoutant@google.com>
10803 * output.cc (Output_reloc): Add explicit instantiations.
10805 2009-01-14 Cary Coutant <ccoutant@google.com>
10807 * archive.cc (Archive::get_elf_object_for_member): Remove call
10808 to File_read::claim_for_plugin.
10809 * descriptors.cc (Descriptors::open): Remove reference to
10811 (Descriptors::claim_for_plugin): Remove.
10812 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10813 (Descriptors::is_claimed): Remove.
10814 (claim_descriptor_for_plugin): Remove.
10815 * fileread.cc (File_read::claim_for_plugin): Remove.
10816 * fileread.h (File_read::claim_for_plugin): Remove.
10817 (File_read::descriptor): Reopen descriptor if necessary.
10818 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10819 (Plugin_manager::all_symbols_read): Add task parameter. Change
10821 (Plugin_manager::get_input_file): New function.
10822 (Plugin_manager::release_input_file): New function.
10823 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10824 corresponding data member.
10825 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10826 and pass to base constructor. Change all callers.
10827 (get_input_file, release_input_file): New functions.
10828 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10829 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10830 (Plugin_manager::all_symbols_read): Add task parameter.
10831 (Plugin_manager::get_input_file): New function.
10832 (Plugin_manager::release_input_file): New function.
10833 (Plugin_manager::task_): New data member.
10834 (Pluginobj::Pluginobj): Add filesize parameter.
10835 (Pluginobj::filename): New function.
10836 (Pluginobj::descriptor): New function.
10837 (Pluginobj::filesize): New function.
10838 (Pluginobj::filesize_): New data member.
10839 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10840 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10841 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10843 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10844 with archive libraries.
10845 * testsuite/Makefile.in: Regenerate.
10846 * testsuite/plugin_test.c (struct sym_info): New type.
10847 (get_input_file, release_input_file): New static variables.
10848 (onload): Capture new transfer vector entries.
10849 (claim_file_hook): Stop reading at end of file according to filesize.
10850 Factor out parsing of readelf output into separate function.
10851 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10852 APIs and get the source file name from the symbol table. Convert
10853 source file name to corresponding object file name. Print info
10854 message when adding new input files.
10855 (parse_readelf_line): New function.
10856 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10857 * testsuite/plugin_test_2.sh: Likewise.
10858 * testsuite/plugin_test_3.sh: Likewise.
10859 * testsuite/plugin_test_4.sh: New test case.
10861 2009-01-07 Ian Lance Taylor <iant@google.com>
10863 * version.cc (version_string): Bump to 1.8.
10865 2008-12-23 Cary Coutant <ccoutant@google.com>
10867 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10868 * plugin.cc (Plugin_manager::finish): Rename as
10869 layout_deferred_objects. Move cleanup to separate function.
10870 (Plugin_manager::cleanup): New function.
10871 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10873 * plugin.h (Plugin_manager::finish): Rename as
10874 layout_deferred_objects.
10875 (Plugin_manager::cleanup): New function.
10876 (Plugin_manager::cleanup_done): New field.
10878 2008-12-23 Cary Coutant <ccoutant@google.com>
10880 * plugin.cc (is_visible_from_outside): New function.
10881 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10882 so we don't return "IR only" status for exported symbols or -r links.
10884 * testsuite/Makefile.am (plugin_test_3): New test case.
10885 * testsuite/Makefile.in: Regenerate.
10886 * testsuite/plugin_test_3.sh: New file.
10888 2008-12-22 Cary Coutant <ccoutant@google.com>
10890 * object.cc (Sized_relobj::layout_section): New function.
10891 (Sized_relobj::do_layout): Defer layout of input sections until after
10892 plugin has provided replacement files.
10893 (Sized_relobj::do_layout_deferred_sections): New function.
10894 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10895 (Relobj::layout_deferred_sections): New function.
10896 (Relobj::do_layout_deferred_sections): New function.
10897 (Sized_relobj::do_layout_deferred_sections): New function.
10898 (Sized_relobj::layout_section): New function.
10899 (Sized_relobj::Deferred_layout): New structure.
10900 (Sized_relobj::deferred_layout_): New field.
10901 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10902 Change all callers. Layout deferred sections.
10903 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10905 (Plugin_hook::run): Move code from do_plugin_hook inline.
10906 (Plugin_hook::do_plugin_hook): Remove.
10907 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10908 (Plugin_manager::finish): Renamed, was cleanup.
10909 (Plugin_manager::should_defer_layout): New function.
10910 (Plugin_manager::add_deferred_layout_object): New function.
10911 (Plugin_manager::Deferred_layout_list): New type.
10912 (Plugin_manager::deferred_layout_objects_): New field.
10913 (Plugin_hook::do_plugin_hook): Remove.
10915 2008-12-17 Ian Lance Taylor <iant@google.com>
10917 * options.h (class General_options): Add --no case for
10920 2008-12-16 Cary Coutant <ccoutant@google.com>
10922 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10924 (Plugin_manager::claim_file): Create plugin object even if
10925 plugin did not call the add_symbols callback.
10926 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10927 asking for more symbols than were added.
10928 * testsuite/Makefile.am (plugin_test_1): Add test case with
10930 (empty.syms): New target.
10931 * testsuite/Makefile.in: Regenerate.
10932 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10933 message. Don't call add_symbols if no globals.
10934 (all_symbols_read_hook): Don't provide replacement for empty
10937 2008-12-12 Ian Lance Taylor <iant@google.com>
10939 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10940 r_type == 0 for a local symbol with r_sym == 0.
10941 (scan_relocatable_relocs): Pass r_sym to
10942 local_non_section_strategy.
10943 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10946 * configure.ac: Update test for TLS descriptors: they are
10947 supported as of glibc 2.9.
10948 * configure: Rebuild.
10950 2008-12-11 Ian Lance Taylor <iant@google.com>
10953 * target-reloc.h (Default_scan_relocatable_relocs): For each
10954 function, map r_type == 0 to RELOC_DISCARD.
10956 2008-12-10 Cary Coutant <ccoutant@google.com>
10958 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10959 object to override a kept COMDAT group from a plugin object.
10961 2008-12-09 Ian Lance Taylor <iant@google.com>
10964 * yyscript.y (file_cmd): Handle INPUT.
10966 * testsuite/initpri1.c: Change all declarations to be full
10967 prototypes by adding void, to avoid compiler warnings.
10969 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10971 * options.cc (General_options::parse_plugin_opt): New.
10972 (General_options::add_plugin): The argument now is just the filename.
10973 (General_options::add_plugin_option): New.
10974 * options.h (plugin_opt): New.
10975 (add_plugin): Change argument name.
10976 (add_plugin_option): New.
10977 * plugin.cc (Plugin::load): Don't parse the plugin option.
10978 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10979 (Plugin::add_option): New.
10980 (Plugin::args_): Change type.
10981 (Plugin::filename_): New.
10982 (Plugin_manager::add_plugin_option): New.
10983 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10984 * testsuite/Makefile.in: Regenerate.
10986 2008-12-05 Cary Coutant <ccoutant@google.com>
10988 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10989 Handle --strip-lto-sections option.
10990 * options.h (strip_lto_sections): New option.
10992 2008-12-01 Cary Coutant <ccoutant@google.com>
10994 * plugin.cc (ld_plugin_message): Change format parameter to const.
10995 Fix mismatch between new[] and delete.
10997 2008-11-14 Cary Coutant <ccoutant@google.com>
10999 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11002 2008-11-05 Craig Silverstein <csilvers@google.com>
11004 * options.cc (General_options::parse_dynamic_list): New function.
11005 * options.h (General_options): New flags dynamic_list,
11006 dynamic_list_data, dynamic_list_cpp_new, and
11007 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11008 (General_options::in_dynamic_list): New function.
11009 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11010 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11011 (Lex::can_continue_name): Likewise.
11013 (read_script_file): New parameter script_options.
11014 (read_dynamic_list): New function.
11015 (Script_options::define_dynamic_list): New function.
11016 (dynamic_list_keyword_parsecodes): New variable.
11017 (dynamic_list_keywords): New variable.
11018 * script.h (Script_options::define_dynamic_list): New function
11020 (read_dynamic_list): New function prototype.
11021 * symtab.cc (strprefix): New macro.
11022 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11023 dynamic_list_data, dynamic_list_cpp_new, and
11024 dynamic_list_cpp_typeinfo.
11025 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11026 (dynamic_list_expr): New rule.
11027 (dynamic_list_nodes): Likewise.
11028 (dynamic_list_node): Likewise.
11029 * testsuite/Makefile.am (dynamic_list): New test.
11030 * testsuite/Makefile.in: Regenerated.
11031 * testsuite/dynamic_list.t: New file.
11032 * testsuite/dynamic_list.sh: New file.
11034 2008-11-05 Craig Silverstein <csilvers@google.com>
11036 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11037 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11038 (t11_last): Likewise.
11039 * testsuite/ver_test_6.c (main): Likewise.
11041 2008-10-07 Cary Coutant <ccoutant@google.com>
11043 * options.c (General_options::finalize): Add check for -static and
11045 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11048 2008-10-02 Cary Coutant <ccoutant@google.com>
11050 * plugin.cc (make_sized_plugin_object): Fix conditional
11051 compilation to work when not all targets are enabled.
11053 2008-09-29 Cary Coutant <ccoutant@google.com>
11055 * archive.cc (Archive::get_file_and_offset): Use filename instead
11056 of name to get library path.
11057 (Archive::include_member): Unlock external member of a thin archive.
11059 * testsuite/Makefile.am (TEST_AR): New variable.
11060 (thin_archive_test_1): New test.
11061 (thin_archive_test_2): New test.
11062 * testsuite/Makefile.in: Regenerate.
11063 * testsuite/thin_archive_main.cc: New file.
11064 * testsuite/thin_archive_test_1.cc: New file.
11065 * testsuite/thin_archive_test_2.cc: New file.
11066 * testsuite/thin_archive_test_3.cc: New file.
11067 * testsuite/thin_archive_test_4.cc: New file.
11069 2008-09-29 Cary Coutant <ccoutant@google.com>
11071 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11072 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11074 (Sized_relobj::do_finalize_local_symbols): Likewise.
11075 (Sized_relobj::map_to_kept_section): Likewise.
11076 * object.h (Sized_relobj::invalid_address): New constant.
11077 (Sized_relobj::do_output_section_offset): Check for invalid_address
11079 * output.cc (Output_reloc::local_section_offset): Use constant
11080 invalid_address instead of -1U.
11081 (Output_reloc::get_address): Likewise.
11082 (Output_section::output_address): Change -1U to -1ULL.
11083 * output.h (Output_reloc::invalid_address): New constant.
11084 * reloc.cc (Sized_relobj::write_sections): Use constant
11085 invalid_address instead of -1U.
11086 (Sized_relobj::relocate_sections): Likewise.
11087 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11088 values for merge sections.
11089 * target-reloc.h (relocate_for_relocatable): Use constant
11090 invalid_address instead of -1U.
11092 2008-09-19 Cary Coutant <ccoutant@google.com>
11094 Add plugin functionality for link-time optimization (LTO).
11095 * configure.ac (plugins): Add --enable-plugins option.
11096 * configure: Regenerate.
11097 * config.in: Regenerate.
11098 * Makefile.am (LIBDL): New variable.
11099 (CCFILES): Add plugin.cc.
11100 (HFILES): Add plugin.h.
11101 (ldadd_var): Add LIBDL.
11102 * Makefile.in: Regenerate.
11104 * archive.cc: Include "plugin.h".
11105 (Archive::setup): Don't preread archive symbols when using a plugin.
11106 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11107 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11109 (Archive::include_member): Add symbols from plugin objects.
11110 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11111 * descriptors.cc (Descriptors::open): Check for file descriptors
11112 abandoned by plugins.
11113 (Descriptors::claim_for_plugin): New function.
11114 * descriptors.h (Descriptors::claim_for_plugin): New function.
11115 (Open_descriptor::is_claimed): New field.
11116 (claim_descriptor_for_plugin): New function.
11117 * fileread.cc (File_read::claim_for_plugin): New function.
11118 * fileread.h (File_read::claim_for_plugin): New function.
11119 (File_read::descriptor): New function.
11120 * gold.cc: Include "plugin.h".
11121 (queue_initial_tasks): Add task to call plugin hooks for generating
11123 * main.cc: Include "plugin.h".
11124 (main): Load plugin libraries.
11125 * object.h (Pluginobj): Declare.
11126 (Object::pluginobj): New function.
11127 (Object::do_pluginobj): New function.
11128 (Object::set_target): New function.
11129 * options.cc: Include "plugin.h".
11130 (General_options::parse_plugin): New function.
11131 (General_options::General_options): Initialize plugins_ field.
11132 (General_options::add_plugin): New function.
11133 * options.h (Plugin_manager): Declare.
11134 (General_options): Add --plugin option.
11135 (General_options::has_plugins): New function.
11136 (General_options::plugins): New function.
11137 (General_options::add_plugin): New function.
11138 (General_options::plugins_): New field.
11139 * plugin.cc: New file.
11140 * plugin.h: New file.
11141 * readsyms.cc: Include "plugin.h".
11142 (Read_symbols::do_read_symbols): Check for archive before checking
11143 for ELF file. Call plugin hooks to claim files.
11144 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11145 from a real object file; force override when processing replacement
11147 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11148 (Symbol::init_base_object): Likewise.
11149 (Symbol::init_base_output_data): Likewise.
11150 (Symbol::init_base_output_segment): Likewise.
11151 (Symbol::init_base_constant): Likewise.
11152 (Symbol::init_base_undefined): Likewise.
11153 (Symbol::output_section): Assert that object is not a plugin.
11154 (Symbol_table::add_from_pluginobj): New function.
11155 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11157 (Symbol_table::sized_write_globals): Likewise.
11158 (Symbol_table::add_from_pluginobj): Instantiate template.
11159 * symtab.h (Sized_pluginobj): Declare.
11160 (Symbol::in_real_elf): New function.
11161 (Symbol::set_in_real_elf): New function.
11162 (Symbol::in_real_elf_): New field.
11163 (Symbol_table::add_from_pluginobj): New function.
11165 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11166 (LIBDL): New variable.
11167 (LDADD): Add LIBDL.
11168 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11169 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11170 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11171 (MOSTLYCLEANFILES): Likewise.
11172 * testsuite/Makefile.in: Regenerate.
11173 * testsuite/plugin_test.c: New file.
11174 * testsuite/plugin_test_1.sh: New file.
11175 * testsuite/plugin_test_2.sh: New file.
11177 2008-09-16 Ian Lance Taylor <iant@google.com>
11179 * target-reloc.h (relocate_section): Check whether a symbol is
11180 defined by the ABI before reporting an undefined symbol error.
11181 * target.h (Target::is_defined_by_abi): Make parameter const.
11182 (Target::do_is_defined_by_abi): Likewise.
11183 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11184 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11185 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11186 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11187 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11188 * testsuite/Makefile.in: Rebuild.
11190 * fileread.cc (make_view): Add casts to avoid warning.
11192 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11194 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11195 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11197 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11199 * options.h (General_options::output_is_executable): New.
11200 (General_options::output_is_pie): New.
11201 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11202 for shared libraries.
11203 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11205 2008-09-11 Chris Demetriou <cgd@google.com>
11207 * options.h (origin): New -z option.
11208 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11209 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11212 2008-09-05 Cary Coutant <ccoutant@google.com>
11214 * fileread.cc (File_read::make_view): Add check for attempt to map
11215 beyond end of file.
11217 2008-09-05 Cary Coutant <ccoutant@google.com>
11219 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11220 explicit instantiations.
11222 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11225 * options.cc (General_options::finalize): Allow undefined symbols
11226 in shlibs if linking -shared.
11229 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11230 symbols as not needing a dynsym entry.
11232 2008-08-20 Craig Silverstein <csilvers@google.com>
11234 * fileread.cc (File_read::open): Do not lock the file unless it
11235 was successfully opened.
11237 2008-08-14 Cary Coutant <ccoutant@google.com>
11239 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11240 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11241 * testsuite/tls_test.cc (struct int128): 128-bit struct
11242 for testing TLS relocs with non-zero addend.
11243 (v12): New TLS variable.
11245 (t_last): Add check for v12.
11246 * testsuite/tls_test.h (t12): New function.
11247 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11249 2008-08-13 Ian Lance Taylor <iant@google.com>
11251 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11252 set tls_segment_ or relro_segment_.
11253 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11255 * output.h (Output_section::clear_is_relro): New function.
11256 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11257 sections specially even when output_data_ is empty.
11258 (Output_segment::maximum_alignment): When first section is relro,
11259 only force alignment for PT_LOAD segments.
11260 * script.cc (script_data_segment_align): New function.
11261 (script_data_segment_relro_end): New function.
11262 * script-c.h (script_data_segment_align): Declare.
11263 (script_data_segment_relro_end): Declare.
11264 * script-sections.h (class Script_sections): Declare
11265 data_segment_align and data_segment_relro_end. Add fields
11266 segment_align_index_ and saw_relro_end_.
11267 * script-sections.cc (class Sections_element): Add set_is_relro
11268 virtual function. Add new bool* parameter to place_orphan_here.
11269 Add get_output_section virtual function.
11270 (class Output_section_definition): Add set_is_relro. Add new
11271 bool* parameter to place_orphan_here. Add get_output_section.
11272 Add is_relro_ field.
11273 (Output_section_definition::Output_section_definition): Initialize
11274 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11275 and is_relro_ fields.
11276 (Output_section_definition::place_orphan_here): Add is_relro
11278 (Output_section_definition::set_section_addresses): Set relro for
11280 (Output_section_definition::alternate_constraint): Likewise.
11281 (class Orphan_output_section): Add new bool* parameter to
11282 place_orphan_here. Add get_output_section.
11283 (Orphan_output_section::place_orphan_here): Add is_relro
11285 (Script_sections::Script_sections): Initialize
11286 data_segment_align_index_ and saw_relro_end_.
11287 (Script_sections::data_segment_align): New function.
11288 (Script_sections::data_segment_relro_end): New function.
11289 (Script_sections::place_orphan): Set or clear is_relro.
11290 (Script_sections::set_section_addresses): Force alignment of first
11292 * yyscript.y (exp): Call script_data_segment_align and
11293 script_data_segment_relro_end.
11294 * testsuite/relro_script_test.t: New file.
11295 * testsuite/relro_test.cc (using_script): Declare.
11296 (t1, t2): Test using_script.
11297 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11298 (relro_script_test_SOURCES): Define.
11299 (relro_script_test_DEPENDENCIES): Define.
11300 (relro_script_test_LDFLAGS): Define.
11301 (relro_script_test_LDADD): Define.
11302 (relro_script_test.so): New target.
11303 * testsuite/Makefile.in: Rebuild.
11305 2008-08-06 Cary Coutant <ccoutant@google.com>
11307 * archive.cc (Archive::total_archives, Archive::total_members)
11308 (Archive::total_members_loaded): New variables.
11309 (Archive::setup): Add parameter. Add option to preread
11311 (Archive::read_armap): Add counter.
11312 (Archive::get_file_and_offset): New function.
11313 (Archive::get_elf_object_for_member): New function.
11314 (Archive::read_all_symbols): New function.
11315 (Archive::read_symbols): New function.
11316 (Archive::add_symbols): Add counters.
11317 (Archive::include_all_members): Use armap to find members if it's
11319 (Archive::include_member): Skip reading symbols if already read.
11320 Factored code into Archive::get_file_and_offset and
11321 Archive::get_elf_object_for_member. Changed call to
11322 Mapfile::report_include_archive_member.
11323 (Archive::print_stats): New function.
11324 * archive.h: Declare Object and Read_symbols_data classes.
11325 (Archive::Archive): Add initializers for new members.
11326 (Archive::setup): Add parameter.
11327 (Archive::print_stats): New function.
11328 (Archive::total_archives, Archive::total_members)
11329 (Archive::total_members_loaded): New variables.
11330 (Archive::get_file_and_offset): New function.
11331 (Archive::get_elf_object_for_member): New function.
11332 (Archive::read_all_symbols): New function.
11333 (Archive::read_symbols): New function.
11334 (Archive::Archive_member): New class.
11335 (Archive::members_): New member.
11336 (Archive::num_members_): New member.
11337 * main.cc: Include archive.h.
11338 (main): Call Archive::print_stats.
11339 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11340 archive parameter; member_name is now the fully-decorated name.
11341 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11342 * options.h: (General_options): Add --preread-archive-symbols option.
11343 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11346 2008-08-04 Ian Lance Taylor <iant@google.com>
11348 * symtab.h (Symbol::use_plt_offset): New function.
11349 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11350 * powerpc.cc (Relocate::relocate): Likewise.
11351 * sparc.cc (Relocate::relocate): Likewise.
11352 * x86_64.cc (Relocate::relocate): Likewise.
11353 * testsuite/weak_plt.sh: New test.
11354 * testsuite/weak_plt_main.cc: New test.
11355 * testsuite/weak_plt_shared.cc: New test.
11356 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11357 (check_PROGRAMS): Add weak_plt.
11358 (check_DATA): Add weak_plt_shared.so.
11359 (weak_plt_main_pic.o, weak_plt): New targets.
11360 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11361 * testsuite/Makefile.in: Rebuild.
11363 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11365 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11366 * testsuite/Makefile.in: Rebuild.
11368 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11370 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11371 * Makefile.in: Regenerate.
11372 * po/POTFILES.in: Regenerate.
11374 2008-07-29 Ian Lance Taylor <iant@google.com>
11376 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11377 symbols before other symbols.
11378 * testsuite/script_test_2.cc (test_addr): Declare.
11379 (test_addr_alias): Declare.
11380 (main): Check that test_addr and test_addr_alias have the right
11382 * testsuite/script_test_2.t: Define test_addr_alias and
11385 2008-07-24 Ian Lance Taylor <iant@google.com>
11388 * descriptors.cc: New file.
11389 * descriptors.h: New file.
11390 * gold-threads.h (class Hold_optional_lock): New class.
11391 * fileread.cc: Include "descriptors.h".
11392 (File_read::~File_read): Release descriptor rather than closing
11394 (File_read::open) [file]: Call open_descriptor rather than open.
11395 Set is_descriptor_opened_.
11396 (File_read::open) [memory]: Assert that descriptor is not open.
11397 (File_read::reopen_descriptor): New function.
11398 (File_read::release): Release descriptor.
11399 (File_read::do_read): Make non-const. Reopen descriptor.
11400 (File_read::read): Make non-const.
11401 (File_read::make_view): Reopen descriptor.
11402 (File_read::do_readv): Likewise.
11403 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11404 Update declarations.
11405 * layout.cc: Include "descriptors.h".
11406 (Layout::create_build_id): Use open_descriptor rather than open.
11407 * output.cc: Include "descriptors.h".
11408 (Output_file::open): Use open_descriptor rather than open.
11409 * archive.cc (Archive::const_iterator): Change Archive to be
11411 (Archive::begin, Archive::end): Make non-const.
11412 (Archive::count_members): Likewise.
11413 * archive.h (class Archive): Update declarations.
11414 * object.h (Object::read): Make non-const.
11415 * Makefile.am (CCFILES): Add descriptors.cc.
11416 (HFILES): Add descriptors.h.
11417 * Makefile.in: Rebuild.
11420 * gold.h: Always include <clocale>. Add Solaris workarounds
11421 following code in binutils/sysdep.h.
11424 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11425 this->eh_frame_hdr_ is NULL before using it.
11427 * dynobj.cc (Versions::Versions): Update comment.
11429 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11430 the base version name.
11432 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11433 array size plus one.
11434 (Stringpool_template::set_string_offsets): Subtract one from key
11435 before using it as an array index.
11436 (Stringpool_template::get_offset_with_length): Likewise.
11437 (Stringpool_template::write_to_buffer): Likewise.
11438 * stringpool.h (Stringpool_template::get_offset_from_key):
11441 2008-07-23 Ian Lance Taylor <iant@google.com>
11444 * object.h (Merged_symbol_value::value): Do our best to handle a
11448 * script.cc (Version_script_info::get_versions): Don't add empty
11449 version tag to return value.
11450 (Version_script_info::get_symbol_version_helper): Change return
11451 type to bool. Add pversion parameter. Change all callers.
11452 (script_register_vers_node): Don't require a non-NULL tag.
11453 * script.h (class Version_script_info): Update declarations.
11454 (Version_script_info::get_symbol_version): Change return type to
11455 bool. Add version parameter. Change all callers.
11456 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11457 handling. Handle an empty version from a version script.
11458 (Symbol_table::define_special_symbol): Likewise.
11459 * testsuite/ver_test_10.script: New file.
11460 * testsuite/ver_test_10.sh: New file.
11461 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11462 (check_DATA): Add ver_test_10.syms.
11463 (ver_test_10.syms, ver_test_10.so): New target.
11464 * testsuite/Makefile.in: Rebuild.
11466 2008-07-23 Simon Baldwin <simonb@google.com>
11468 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11469 to zero for undefined symbols from dynamic libraries.
11471 2008-07-23 Ian Lance Taylor <iant@google.com>
11473 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11474 Change all callers.
11475 * symtab.h (class Symbol_table): Update declaration.
11476 * testsuite/ver_test_9.cc: New file.
11477 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11478 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11479 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11480 (ver_test_9.so, ver_test_9.o): New targets.
11481 * testsuite/Makefile.in: Rebuild.
11483 2008-07-22 Ian Lance Taylor <iant@google.com>
11485 * options.h (class General_options): Define --check-sections.
11486 * layout.cc (Layout::set_segment_offsets): Handle
11489 * options.h (class General_options): Define -n/--nmagic and
11491 * options.cc (General_options::finalize): For -n/--nmagic or
11492 -N/--omagic, set -static.
11493 * layout.cc (Layout::attach_allocated_section_to_segment): If
11494 -N/--omagic, don't put read-only and read-write sections in
11495 different segments.
11496 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11497 finding a read-only segment.
11498 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11499 don't set the minimum segment alignment to the common page size,
11500 and don't set the file offset to the address modulo the page size.
11501 * script-sections.cc (Script_sections::create_segments): If
11502 -n/--omagic, don't put read-only and read-write sections in
11503 different segments.
11505 * cref.cc: New file.
11506 * cref.h: New file.
11507 * options.h (class General_options): Add --print-symbol-counts.
11508 * main.cc (main): Issue defined symbol report if requested.
11509 * archive.cc (Archive::interpret_header): Make into a const member
11511 (Archive::add_symbols): Call Input_objects::archive_start and
11513 (Archive::const_iterator): Define new class.
11514 (Archive::begin, Archive::end): New functions.
11515 (Archive::include_all_members): Rewrite to use iterator.
11516 (Archive::count_members): New function.
11517 * archive.h (class Archive): Update declarations.
11518 (Archive::filename): New function.
11519 * object.cc: Include "cref.h".
11520 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11521 (Sized_relobj::do_get_global_symbol_counts): New function.
11522 (Input_objects::add_object): Add object to cross-referencer.
11523 (Input_objects::archive_start): New function.
11524 (Input_objects::archive_stop): New function.
11525 (Input_objects::print_symbol_counts): New function.
11526 * object.h: Declare Cref and Archive.
11527 (Object::get_global_symbol_counts): New function.
11528 (Object::do_get_global_symbol_counts): New pure virtual function.
11529 (class Sized_relobj): Add defined_count_ field. Update
11531 (class Input_objects): Add cref_ field. Update constructor.
11532 Update declarations.
11533 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11535 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11537 (Sized_dynobj::do_get_global_symbol_counts): New function.
11538 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11539 defined_count_. Update declarations. Define Symbols typedef.
11540 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11541 parameter. Change all callers.
11542 (Symbol_table::add_from_dynobj): Add sympointers and defined
11543 parameters. Change all callers.
11544 * symtab.h (class Symbol_table): Update declarations.
11545 * Makefile.am (CCFILES): Add cref.cc.
11546 (HFILES): Add cref.h.
11547 * Makefile.in: Rebuild.
11549 2008-07-22 Simon Baldwin <simonb@google.com>
11551 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11552 to zero when writing undefined symbols.
11554 2008-07-22 Ian Lance Taylor <iant@google.com>
11556 * output.cc (Output_section::add_input_section): Don't try to
11557 merge empty merge sections.
11559 2008-07-21 Craig Silverstein <csilvers@google.com>
11561 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11562 Include symbol version in error message.
11564 2008-07-20 Chris Demetriou <cgd@google.com>
11566 * configure.ac (gold_cv_c_random_seed): New configured variable.
11567 (RANDOM_SEED_CFLAGS): New substituted variable.
11568 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11569 * configure: Rebuild.
11570 * Makefile.in: Likewise.
11571 * testsuite/Makefile.in: Likewise.
11573 2008-07-18 Ian Lance Taylor <iant@google.com>
11575 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11576 where we see NAME/NULL and NAME/VERSION as separate symbols.
11577 * testsuite/ver_test_main.cc (main): Call t4.
11578 (t4, t4_2a): Define.
11579 * testsuite/ver_test_2.cc (t4_2): Define.
11580 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11581 * testsuite/ver_test_4.cc (t4_2a): Define.
11582 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11583 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11585 2008-07-17 Ian Lance Taylor <iant@google.com>
11587 * dynobj.cc (Versions::add_def): If we give an error about a
11588 missing version, go ahead and create the version anyhow.
11590 2008-07-10 Ian Lance Taylor <iant@google.com>
11592 Handle output sections with more than 0x7fffffff bytes.
11593 * object.h (class Relobj): Change map_to_output_ to
11594 output_sections_, and just keep a section pointer. Change all
11595 uses. Move comdat group support to Sized_relobj.
11596 (Relobj::is_section_specially_mapped): Remove.
11597 (Relobj::output_section): Remove poff parameter. Change all
11599 (Relobj::output_section_offset): New function.
11600 (Relobj::set_section_offset): Rewrite.
11601 (Relobj::map_to_output): Remove.
11602 (Relobj::output_sections): New function.
11603 (Relobj::do_output_section_offset): New pure virtual function.
11604 (Relobj::do_set_section_offset): Likewise.
11605 (class Sized_relobj): Add section_offsets_ field. Add comdat
11606 group support from Relobj. Update declarations.
11607 (Sized_relobj::get_output_section_offset): New function.
11608 (Sized_relobj::do_output_section_offset): New function.
11609 (Sized_relobj::do_set_section_offset): New function.
11610 * object.cc (Relobj::output_section_address): Remove.
11611 (Sized_relobj::Sized_relobj): Initialize new fields.
11612 (Sized_relobj::include_section_group): Cast find_kept_object to
11614 (Sized_relobj::include_linkonce_section): Likewise.
11615 (Sized_relobj::do_layout): Use separate arrays for output section
11617 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11619 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11620 output_sections and section_offsets.
11621 (Sized_relobj::write_local_symbols): Likewise.
11622 (map_to_kept_section): Compute output address directly.
11623 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11624 output_sections and section_offsets.
11625 (Sized_relobj::write_sections): Likewise.
11626 (Sized_relobj::relocate_sections): Likewise.
11627 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11628 * output.h (class Output_reloc): Update declarations. Change
11629 u2_.relobj to Sized_relobj*.
11630 (class Output_data_reloc): Change add functions to use
11632 * output.cc (Output_reloc::Output_reloc): Change relobj to
11634 (Output_reloc::local_section_offset): Change return type to
11635 Elf_Addr. Use get_output_section_offset.
11636 (Output_reloc::get_address): Likewise.
11637 (Output_section::is_input_address_mapped): Don't call
11638 is_section_specially_mapped.
11639 (Output_section::output_offset): Likewise.
11640 (Output_section::output_address): Likewise.
11641 (Output_section::starting_output_address): Likewise.
11642 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11643 parameter to Sized_relobj*.
11644 (Copy_relocs::need_copy_reloc): Likewise.
11645 (Copy_relocs::save): Likewise.
11646 * copy-relocs.h (class Copy_relocs): Update declarations.
11647 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11648 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11649 * target-reloc.h (relocate_for_relocatable): Change
11650 offset_in_output_section type to Elf_Addr. Change code that uses
11652 * layout.cc (Layout::layout): Always set *off.
11653 * mapfile.cc (Mapfile::print_input_section): Use
11654 output_section_offset.
11655 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11657 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11658 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11659 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11661 2008-07-03 Ian Lance Taylor <iant@google.com>
11663 * layout.cc (Layout::include_section): Do not discard unrecognized
11664 SHT_STRTAB sections.
11666 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11668 * script.cc (Lex::can_continue_name): Make '?' allowable in
11669 version-script names.
11670 * testsuite/version_script.map: Change glob pattern to use '?'
11672 2008-06-30 Manish Singh <yosh@gimp.org>
11675 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11678 2008-06-30 Ian Lance Taylor <iant@google.com>
11682 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11683 versions]: Don't try to read the value in the contents, since we
11684 don't use it. Use the template endianness when writing.
11686 2008-06-25 Cary Coutant <ccoutant@google.com>
11688 * fileread.cc (File_read::make_view): Assert on zero-length view.
11689 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11690 symbol table when there are no symbols to read.
11692 2008-06-23 Craig Silverstein <csilvers@google.com>
11694 * version.cc (version_string): Bump to 1.7
11696 2008-06-18 Craig Silverstein <csilvers@google.com>
11698 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11699 constant 0xFFFF to type Valtype.
11700 (Powerpc_relocate_functions::rel16_ha): Likewise.
11702 2008-06-17 Ian Lance Taylor <iant@google.com>
11704 * output.h (Output_section::Input_section): Initialize p2align_ to
11705 zero for Output_section_data constructors.
11706 (Output_section::Input_section::addralign): If not an input
11707 section, return the alignment of the Output_section_data.
11708 * testsuite/copy_test.cc: New file.
11709 * testsuite/copy_test_1.cc: New file.
11710 * testsuite/copy_test_2.cc: New file.
11711 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11712 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11713 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11714 (copy_test_1_pic.o, copy_test_1.so): New targets.
11715 (copy_test_2_pic.o, copy_test_2.so): New targets.
11716 * testsuite/Makefile.in: Rebuild.
11718 * script-sections.cc (Script_sections::place_orphan): Initialize
11719 local variable exact.
11721 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11723 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11725 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11726 David S. Miller <davem@davemloft.net>
11728 * powerpc.cc: New file.
11729 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11730 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11731 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11732 * Makefile.in: Rebuild.
11734 2008-06-09 Ian Lance Taylor <iant@google.com>
11736 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11738 (throwing, orig_terminate): New static variables.
11739 (terminate_handler): New static function.
11740 (t2): Set terminate handler.
11742 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11745 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11748 2008-05-30 Cary Coutant <ccoutant@google.com>
11750 * archive.cc (Archive::include_all_members) Correct to step
11751 over symbol table and extended name table in thin archives.
11753 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11756 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11759 2008-05-28 Caleb Howe <cshowe@google.com>
11761 * reduced_debug_output.cc: New file.
11762 * reduced_debug_output.h: New file.
11763 * options.h (class General_options): Add --strip-debug-non-line.
11764 * options.cc (General_options::finalize): Add strip_debug_non_line
11765 to the strip heirarchy.
11766 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11768 * layout.cc: Include "reduced_debug_output.h".
11769 (Layout::Layout): Initialize new fields.
11770 (line_only_debug_sections): New static array.
11771 (is_lines_only_debug_sections): New static inline function.
11772 (Layout::include_section): Handle --strip-debug-non-line.
11773 (Layout::make_output_section): If --strip-debug-non-line, build
11774 new output sections for .debug_abbrev and .debug_info.
11775 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11776 gold. Warn about possible overflow.
11777 (read_signed_LEB_128): Likewise.
11778 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11779 (read_signed_LEB_128): Declare.
11780 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11781 (HFILES): Add reduced_debug_output.h.
11782 * Makefile.in: Rebuild.
11784 2008-05-21 Ian Lance Taylor <iant@google.com>
11786 * mapfile.cc: New file.
11787 * mapfile.h: New file.
11788 * options.h (class General_options): Add -M/--print-map and -Map.
11789 * options.cc (General_options::finalize): Make -M equivalent to
11791 * main.cc: Include <cstdio> and "mapfile.h".
11792 (main): Open mapfile if requested.
11793 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11794 constructor. Change caller.
11795 (queue_initial_tasks): Add mapfile parameter. Change caller.
11796 (queue_middle_tasks): Likewise.
11797 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11799 * archive.cc: Include "mapfile.h".
11800 (Archive::add_symbols): Add mapfile parameter. Change all
11801 callers. Pass mapfile, symbol, and reason to include_member.
11802 (Archive::include_all_members): Add mapfile parameter. Change all
11804 (Archive::include_member): Add mapfile, sym, and why parameters.
11805 Change all callers. Report inclusion to map file.
11806 * archive.h: Include "fileread.h".
11807 (class Archive): Update declarations.
11808 (Archive::file): New const method.
11809 (class Add_archive_symbols): Add mapfile_ field. Update
11810 constructor. Change all callers.
11811 * readsyms.h (class Read_symbols): Likewise.
11812 (class Finish_group): Likewise.
11813 (class Read_script): Likewise.
11814 * common.cc: Include "mapfile.h".
11815 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11817 (Symbol_table::do_allocate_commons): Likewise.
11818 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11819 symbol allocation to mapfile.
11820 * common.h (class Allocate_commons_task): Add mapfile_ field.
11821 Update constructor. Change all callers.
11822 * symtab.h (class Symbol_table): Update declarations.
11823 * layout.cc: Include "mapfile.h".
11824 (Layout_task_runner::run): Print information to mapfile.
11825 (Layout::create_gold_note): Change Output_data_fixed_space to
11826 Output_data_zero_fill.
11827 (Layout::create_build_id): Likewise.
11828 (Layout::print_to_mapfile): New function.
11829 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11830 constructor. Change caller.
11831 (class Layout): Declare print_to_mapfile.
11832 * output.cc (Output_section::Input_section::print_to_mapfile): New
11834 (Output_section::add_input_section): If producing a map, always
11835 add to input_sections_ list.
11836 (Output_section::do_print_to_mapfile): New function.
11837 (Output_segment::print_sections_to_mapfile): New function.
11838 (Output_segment::print_section_list_to_mapfile): New function.
11839 * output.h: Include "mapfile.h".
11840 (Output_data::print_to_mapfile): New function.
11841 (Output_data::do_print_to_mapfile): New virtual function.
11842 (Output_segment_headers::do_print_to_mapfile): New function.
11843 (Output_file_header::do_print_to_mapfile): New function.
11844 (Output_data_const::do_print_to_mapfile): New function.
11845 (class Output_data_const_buffer): Add map_name_ field. Update
11846 constructor. Change all callers. Add do_print_to_mapfile
11848 (class Output_data_fixed_space): Likewise.
11849 (class Output_data_space): Likewise.
11850 (class Output_data_zero_fill): New class.
11851 (Output_data_strtab::do_print_to_mapfile): New function.
11852 (Output_data_reloc_base::do_print_to_mapfile): New function.
11853 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11854 (Output_data_group::do_print_to_mapfile): New function.
11855 (Output_data_got::do_print_to_mapfile): New function.
11856 (Output_data_dynamic::do_print_to_mapfile): New function.
11857 (Output_symtab_xindex::do_print_to_mapfile): New function.
11858 (class Output_section): Declare do_print_to_mapflie. Declare
11859 print_to_mapfile in Input_section.
11860 (class Output_segment): Declare new functions.
11861 * object.h (Sized_relobj::symbol_count): New function.
11862 * script-sections.cc
11863 (Output_section_element_dot_assignment::set_section_addresses):
11864 Change Output_data_fixed_space to Output_data_zero_fill.
11865 (Output_data_expression::do_print_to_mapfile): New function.
11866 * script.cc (read_input_script): Add mapfile parameter. Change
11868 * script.h (read_input_script): Update declaration.
11869 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11870 (Eh_frame::do_print_to_mapfile): New function.
11871 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11872 (Output_merge_string::do_print_to_mapfile): New function.
11873 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11875 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11877 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11879 * Makefile.am (CCFILES): Add mapfile.cc.
11880 (HFILES): Add mapfile.h.
11881 * Makefile.in: Rebuild.
11883 2008-05-19 Ian Lance Taylor <iant@google.com>
11885 * options.h (class General_options): Add -z relro.
11886 * layout.cc (Layout::Layout): Initialize relro_segment_.
11887 (Layout::add_output_section_data): Return the output section.
11888 (Layout::make_output_section): Rcognize relro sections and mark
11889 them appropriately.
11890 (Layout::attach_allocated_section_to_segment): Put relro sections
11891 in a PT_GNU_RELRO segment.
11892 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11894 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11896 (Layout::linkonce_mapping): Map d.rel.ro.local to
11897 .data.rel.ro.local.
11898 (Layout::output_section_name): Us .data.rel.ro.local for any
11899 section which begins with that.
11900 * layout.h (class Layout): Update add_output_section_data
11901 declaration. Add relro_segment_ field.
11902 * output.cc (Output_section::Output_section): Initialize is_relro_
11903 and is_relro_local_ fields.
11904 (Output_segment::add_output_section): Group relro sections.
11905 (Output_segment::is_first_section_relro): New function.
11906 (Output_segment::maximum_alignment): If there is a relro section,
11907 align the segment to the common page size.
11908 (Output_segment::set_section_addresses): Track whether we are
11909 looking at relro sections. If the last section is a relro
11910 section, align to the common page size.
11911 (Output_segment::set_section_list_addresses): Add in_relro
11912 parameter. Change all callers. Align to the page size when
11913 moving from relro to non-relro section.
11914 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11916 * output.h (class Output_section): Add is_relro_ and
11917 is_relro_local_ fields.
11918 (Output_section::is_relro): New function.
11919 (Output_section::set_is_relro): New function.
11920 (Output_section::is_relro_local): New function.
11921 (Output_section::set_is_relro_local): New function.
11922 (class Output_segment): Update declarations.
11923 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11924 * sparc.cc (Target_sparc::got_section): Likewise.
11925 * x86_64.cc (Target_x86_64::got_section): Likewise.
11926 * testsuite/relro_test_main.cc: New file.
11927 * testsuite/relro_test.cc: New file.
11928 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11929 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11930 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11931 (relro_test.so, relro_test_pic.o): New targets.
11932 * testsuite/Makefile.in: Rebuild.
11934 2008-05-16 Ian Lance Taylor <iant@google.com>
11936 * output.cc (Output_segment::add_output_section): Remove front
11938 * output.h (class Output_segment): Remove
11939 add_initial_output_section and overloaded add_output_section.
11940 Update declaration of remaining add_output_section.
11941 * layout.cc (Layout::create_interp): Call add_output_section
11942 rather than add_initial_output_section.
11943 (Layout::finish_dynamic_section): Likewise.
11945 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11946 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11947 know the dynamic type.
11948 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11949 field. Initialize it in constructor.
11950 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11951 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11952 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11955 * output.cc (Output_reloc::get_address): Change return type to
11957 * output.h (class Output_reloc): Update get_address declaration.
11958 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11959 for section addresses.
11961 2008-05-09 Ian Lance Taylor <iant@google.com>
11964 * gold.cc (gold_nomem): Use return value of write.
11966 2008-05-08 Ian Lance Taylor <iant@google.com>
11968 * symtab.c (Symbol::init_base_output_data): Add version
11969 parameter. Change all callers.
11970 (Symbol::init_base_output_segment): Likewise.
11971 (Symbol::init_base_constant): Likewise.
11972 (Symbol::init_base_undefined): Likewise.
11973 (Sized_symbol::init_output_data): Likewise.
11974 (Sized_symbol::init_output_segment): Likewise.
11975 (Sized_symbol::init_constant): Likewise.
11976 (Sized_symbol::init_undefined): Likewise.
11977 (Symbol_table::do_define_in_output_data): If the new symbol has a
11978 version, mark it as the default.
11979 (Symbol_table::do_define_in_output_segment): Likewise.
11980 (Symbol_table::do_define_as_constant): Likewise.
11981 * symtab.h (class Symbol): Update declarations.
11982 (class Sized_symbol): Likewise.
11983 * resolve.cc (Symbol::override_version): New function.
11984 (Symbol::override_base): Call override_version.
11985 (Symbol::override_base_with_special): Likewise.
11986 * testsuite/ver_script_8.script: New file.
11987 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11988 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11989 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11990 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11992 2008-05-06 Ian Lance Taylor <iant@google.com>
11995 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11997 (class General_options): Remove existing --undefined, and add
11998 --no-undefined instead. Add new --undefined as synonym for -u.
11999 * archive.cc (Archive::add_symbols): Check whether symbol was
12001 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12002 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12003 all uses. Add IS_UNDEFINED. Update declarations to split
12004 different versions of init_base. Declare init_base_undefined.
12005 (Symbol::is_defined): Handle IS_UNDEFINED.
12006 (Symbol::is_undefined): Likewise.
12007 (Symbol::is_weak_undefined): Call is_undefined.
12008 (Symbol::is_absolute): Handle IS_CONSTANT.
12009 (class Sized_symbol): Update declarations to split different
12010 versions of init. Declare init_undefined.
12011 (class Symbol_table): Declare new functions.
12012 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12013 Change all callers.
12014 (Symbol::init_base_output_data): Likewise.
12015 (Symbol::init_base_output_segment): Likewise.
12016 (Symbol::init_base_constant): Likewise.
12017 (Symbol::init_base_undefined): New function.
12018 (Sized_symbol::init_object): Rename from init. Change all
12020 (Sized_symbol::init_output_data): Likewise.
12021 (Sized_symbol::init_output_segment): Likewise.
12022 (Sized_symbol::init_constant): Likewise.
12023 (Sized_symbol::init_undefined): New function.
12024 (Symbol_table::add_undefined_symbols_from_command_line): New
12026 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12028 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12029 (Symbol::output_section): Likewise.
12030 (Symbol::set_output_section): Likewise.
12031 (Symbol_table::sized_finalize_symbol): Likewise.
12032 (Symbol_table::sized_write_globals): Likewise.
12033 * resolve.cc (Symbol_table::should_override): Likewise.
12034 (Symbol::override_base_with_special): Likewise.
12036 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12037 symbol, change it to have default visibility.
12038 * testsuite/protected_1.cc: New file.
12039 * testsuite/protected_2.cc: New file.
12040 * testsuite/protected_3.cc: New file.
12041 * testsuite/protected_main_1.cc: New file.
12042 * testsuite/protected_main_2.cc: New file.
12043 * testsuite/protected_main_3.cc: New file.
12044 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12045 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12046 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12047 (protected_1.so): New target.
12048 (protected_1_pic.o, protected_2_pic.o): New targets.
12049 (protected_3_pic.o): New target.
12050 (check_PROGRAMS): Add protected_2.
12051 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12052 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12053 * testsuite/Makefile.in: Rebuild.
12055 * options.h (DEFINE_var): Add set_user_set_##varname__.
12056 (DEFINE_bool_alias): New macro.
12057 (class General_options): Define -Bstatic using DEFINE_bool_alias
12058 rather than DEFINE_special. Add --undefined as an alias for -z
12060 * options.cc (General_options::parse_Bstatic): Remove.
12062 * options.h (class General_options): Add --fatal-warnings.
12063 * main.cc (main): Implement --fatal-warnings.
12064 * errors.h (Errors::warning_count): New function.
12066 * options.h (class General_options): Add -Bsymbolic-functions.
12067 * symtab.h (Symbol::is_preemptible): Check for
12068 -Bsymbolic-functions.
12070 2008-05-05 Ian Lance Taylor <iant@google.com>
12072 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12073 as noVARNAME rather than no-VARNAME.
12074 (class General_options): Add option -z combreloc.
12075 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12077 (Output_reloc::sort_before) [SHT_REL]: New function.
12078 (Output_reloc::sort_before) [SHT_RELA]: New function.
12079 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12080 Sort_relocs_comparison.
12081 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12082 parameter. Change all callers.
12083 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12084 sort_relocs parameter. Change all callers.
12085 * output.cc (Output_reloc::get_address): New function, broken out
12087 (Output_reloc::write_rel): Call it.
12088 (Output_reloc::compare): New function.
12089 (Output_data_reloc_base::do_write): Optionally sort relocs.
12091 * configure.ac: If targ_extra_obj is set, link it in.
12092 * configure.tgt: Initialize all variables.
12093 (x86_64*): Set targ_extra_obj and targ_extra_size.
12094 * configure: Rebuild.
12096 * object.cc (Sized_relobj::include_section_group): Adjust section
12097 indexes read from group data. Build vector to pass to
12099 * layout.cc (Layout::layout_group): Add flags and shndxes
12100 parameters. Remove contents parameter. Change caller. Update
12101 explicit instantiations.
12102 * layout.h (class Layout): Update layout_group declaration.
12103 * output.cc (Output_data_group::Output_data_group): Add flags and
12104 input_shndxes parameters. Remove contents parameter. Change
12106 (Output_data_group::do_write): Change input_sections_ to
12108 * output.h (class Output_data_group): Update constructor
12109 declaration. Rename input_sections_ to input_shndxes_.
12110 * testsuite/many_sections_test.cc: Add template.
12112 2008-04-30 Cary Coutant <ccoutant@google.com>
12114 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12116 * layout.cc (Layout::include_section): Refactored check for debug
12118 (Layout::add_comdat): Add new parameters. Change type
12119 of signature parameter. Add object and shndx to signatures table.
12120 (Layout::find_kept_object): New function.
12121 * layout.h: Include <cstring>.
12122 (Layout::is_debug_info_section): New function.
12123 (Layout::add_comdat): Add new parameters.
12124 (Layout::find_kept_object): New function.
12125 (Layout::Kept_section): New struct.
12126 (Layout::Signatures): Change type of map range.
12127 * object.cc (Relobj::output_section_address): New function.
12128 (Sized_relobj::include_section_group): Add new parameters. Change
12129 calls to Layout::add_comdat. Change to build table of kept comdat
12130 groups and table mapping discarded sections to kept sections.
12131 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12132 (Sized_relobj::do_layout): Change calls to include_section_group and
12133 include_linkonce_section.
12134 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12135 value to zero when section is discarded.
12136 (Sized_relobj::map_to_kept_section): New function.
12137 * object.h (Relobj::output_section_address): New function.
12138 (Relobj::Comdat_group): New type.
12139 (Relobj::find_comdat_group): New function.
12140 (Relobj::Comdat_group_table): New type.
12141 (Relobj::Kept_comdat_section): New type.
12142 (Relobj::Kept_comdat_section_table): New type.
12143 (Relobj::add_comdat_group): New function.
12144 (Relobj::set_kept_comdat_section): New function.
12145 (Relobj::get_kept_comdat_section): New function.
12146 (Relobj::comdat_groups_): New field.
12147 (Relobj::kept_comdat_sections_): New field.
12148 (Symbol_value::input_value): Update comment.
12149 (Sized_relobj::map_to_kept_section) New function.
12150 (Sized_relobj::include_linkonce_section): Add new parameter.
12151 * target-reloc.h (Comdat_behavior): New type.
12152 (get_comdat_behavior): New function.
12153 (relocate_section): Add code to map a discarded section to the
12154 corresponding kept section when applying a relocation.
12156 2008-04-30 Craig Silverstein <csilvers@google.com>
12158 * dwarf_reader.cc (next_generation_count): New static var.
12159 (Addr2line_cache_entry): New struct.
12160 (addr2line_cache): New static var.
12161 (Dwarf_line_info::one_addr2line): Added caching.
12162 (Dwarf_line_info::clear_addr2line_cache): New function.
12163 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12164 cache-size parameter.
12165 (Dwarf_line_info::one_addr2line_cache): New function.
12166 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12167 new cache-size argument to one_addr2line(), and clear cache.
12169 2008-04-28 Cary Coutant <ccoutant@google.com>
12171 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12172 R_386_PC8 relocations.
12174 2008-04-23 Ian Lance Taylor <iant@google.com>
12176 * object.cc (Sized_relobj::include_section_group): Check for
12177 invalid section group.
12179 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12182 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12183 than read for file header.
12184 * archive.cc (Archive::include_member): Likewise.
12186 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12188 * aclocal.m4: Regenerate.
12189 * configure: Regenerate.
12191 2008-04-19 Ian Lance Taylor <iant@google.com>
12193 * version.cc (version_string): Bump to 1.6.
12195 * testsuite/Makefile.am (many_sections_r_test): New target.
12196 (many_sections_r_test_SOURCES): Remove.
12197 (many_sections_r_test_DEPENDENCIES): Remove.
12198 (many_sections_r_test_LDFLAGS): Remove.
12199 (many_sections_r_test_LDADD): Remove.
12201 * object.cc (Sized_relobj::do_add_symbols): Always pass
12202 local_symbol_count_ to add_from_relobj.
12204 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12205 every thousand variables.
12206 * testsuite/Makefile.in: Rebuild.
12208 * object.cc (Xindex::initialize_symtab_xindex): New function.
12209 (Xindex::read_symtab_xindex): New function.
12210 (Xindex::sym_xindex_to_shndx): New function.
12211 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12213 (Sized_relobj::do_initialize_xindex): New function.
12214 (Sized_relobj::do_read_symbols): Adjust section links.
12215 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12216 parameter. Change all callers.
12217 (Sized_relobj::include_section_group): Adjust section links and
12218 symbol section indexes.
12219 (Sized_relobj::do_layout): Adjust section links.
12220 (Sized_relobj::do_count_local_symbols): Adjust section links and
12221 symbol section indexes.
12222 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12223 ordinary and special symbols.
12224 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12225 dynsym_xindex parameters. Change all callers. Adjust section
12226 links. Use SHN_XINDEX when needed.
12227 (Sized_relobj::get_symbol_location_info): Adjust section links.
12228 Don't get fooled by special symbols.
12229 * object.h (class Xindex): Define.
12230 (class Object): Add xindex_ parameter. Declare virtual functoin
12231 do_initialize_xindex.
12232 (Object::adjust_sym_shndx): New function.
12233 (Object::set_xindex): New protected function.
12234 (class Symbol_value): Add is_ordinary_shndx_ field.
12235 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12236 (Symbol_value::value): Assert ordinary section.
12237 (Symbol_value::initialize_input_to_output_map): Likewise.
12238 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12239 Change all callers.
12240 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12242 (class Sized_relobj): Update declarations.
12243 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12244 parameter. Change all callers.
12245 (Sized_relobj::adjust_shndx): New function.
12246 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12248 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12249 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12250 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12251 (Sized_dynobj::read_dynsym_section): Adjust section links.
12252 (Sized_dynobj::read_dynamic): Likewise.
12253 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12255 (Sized_dynobj::do_initialize_xindex): New function.
12256 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12257 do_initialize_xindex.
12258 (Sized_dynobj::adjust_shndx): New function.
12259 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12260 dynsym_xindex_ fields.
12261 (Layout::finalize): Add a call to set_section_indexes before
12262 creating the symtab sections.
12263 (Layout::set_section_indexes): Don't do anything if the section
12264 already has a section index.
12265 (Layout::create_symtab_sections): Add shnum parameter. Change
12266 caller. Create .symtab_shndx section if needed.
12267 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12269 (Layout::allocated_output_section_count): New function.
12270 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12272 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12273 fields. Update declarations.
12274 (Layout::symtab_xindex): New function.
12275 (Layout::dynsym_xindex): New function.
12276 (class Write_symbols_task): Add layout_ field.
12277 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12279 * output.cc (Output_section_headers::Output_section_headers): Add
12280 shstrtab_section parameter. Change all callers.
12281 (Output_section_headers::do_sized_write): Store overflow values
12282 for section count and section string table section index in
12283 section header zero.
12284 (Output_file_header::do_sized_write): Check for overflow of
12285 section count and section string table section index.
12286 (Output_symtab_xindex::do_write): New function.
12287 (Output_symtab_xindex::endian_do_write): New function.
12288 * output.h (class Output_section_headers): Add shstrtab_section_.
12289 Update declarations.
12290 (class Output_symtab_xindex): Define.
12291 (Output_section::has_out_shndx): New function.
12292 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12294 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12295 Change all callers.
12296 (Sized_symbol::init): Likewise.
12297 (Symbol::output_section): Check for ordinary symbol.
12298 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12299 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12301 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12302 Change all callers. Simplify handling of symbols from sections
12303 not included in the link.
12304 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12306 (Weak_alias_sorter::operator()): Assert that symbols are
12308 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12310 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12311 parameters. Change all callers.
12312 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12313 symbol distinction. Use SHN_XINDEX when needed.
12314 (Symbol_table::write_section_symbol): Add symtab_xindex
12315 parameter. Change all callers.
12316 (Symbol_table::sized_write_section_symbol): Likewise. Use
12317 SHN_XINDEX when needed.
12318 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12320 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12321 (Symbol::is_defined): Check is_ordinary.
12322 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12323 (Symbol::is_absolute, Symbol::is_common): Likewise.
12324 (class Sized_symbol): Update declarations.
12325 (class Symbol_table): Update declarations.
12326 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12327 parameters. Change all callers.
12328 (Sized_symbol::override): Likewise.
12329 (Symbol_table::override): Likewise.
12330 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12331 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12332 is_ordinary, and orig_st_shndx parameters. Change all callers.
12333 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12334 to be in an ordinary section.
12335 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12336 object and is_ordinary parameters. Change all callers.
12337 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12338 Change all callers. Don't add undefined or non-ordinary symbols
12340 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12341 Change all callers.
12342 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12344 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12345 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12346 (Sized_relobj::relocate_sections): Likewise.
12347 * target-reloc.h (scan_relocs): Adjust section symbol index.
12348 (scan_relocatable_relocs): Likewise.
12349 * i386.cc (Scan::local): Check for ordinary symbols.
12350 * sparc.cc (Scan::local): Likewise.
12351 * x86_64.cc (Scan::local): Likewise.
12352 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12353 to symbol_section_and_value.
12354 * testsuite/many_sections_test.cc: New file.
12355 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12356 (check_PROGRAMS): Add many_sections_test.
12357 (many_sections_test_SOURCES): Define.
12358 (many_sections_test_DEPENDENCIES): Define.
12359 (many_sections_test_LDFLAGS): Define.
12360 (BUILT_SOURCES): Add many_sections_define.h.
12361 (many_sections_define.h): New target.
12362 (BUILT_SOURCES): Add many_sections_check.h.
12363 (many_sections_check.h): New target.
12364 (check_PROGRAMS): Add many_sections_r_test.
12365 (many_sections_r_test_SOURCES): Define.
12366 (many_sections_r_test_DEPENDENCIES): Define.
12367 (many_sections_r_test_LDFLAGS): Define.
12368 (many_sections_r_test_LDADD): Define.
12369 (many_sections_r_test.o): New target.
12370 * testsuite/Makefile.in: Rebuild.
12372 2008-04-17 Cary Coutant <ccoutant@google.com>
12374 * errors.cc (Errors::info): New function.
12375 (gold_info): New function.
12376 * errors.h (Errors::info): New function.
12377 * gold.h (gold_info): New function.
12378 * object.cc (Input_objects::add_object): Print trace output.
12379 * options.cc (options::parse_set): New function.
12380 (General_options::parse_wrap): Deleted.
12381 (General_options::General_options): Deleted initializer.
12382 * options.h (options::String_set): New typedef.
12383 (options::parse_set): New function.
12384 (DEFINE_set): New macro.
12385 (General_options::wrap): Changed to use DEFINE_set. Changed
12386 callers of any_wrap_symbols and is_wrap_symbol.
12387 (General_options::trace, General_options::trace_symbol):
12389 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12390 (General_options::wrap_symbols_): Deleted.
12391 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12393 2008-04-17 David S. Miller <davem@davemloft.net>
12395 * options.cc (General_options::parse_V): New function.
12396 * options.h: Add entries for -V and -Qy.
12398 2008-04-17 Ian Lance Taylor <iant@google.com>
12400 * common.cc (Symbol_table::allocate_commons): Remove options
12401 parameter. Change caller.
12402 (Symbol_table::do_allocate_commons): Remove options parameter.
12403 Change caller. Just call do_allocate_commons_list twice.
12404 (Symbol_table::do_allocate_commons_list): New function, broken out
12405 of do_allocate_commons.
12406 * common.h (class Allocate_commons_task): Remove options_ field.
12407 Update constructor.
12408 * symtab.cc (Symbol_table::Symbol_table): Initialize
12410 (Symbol_table::add_from_object): Put TLS common symbols on
12412 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12413 which are IN_OUTPUT_DATA.
12414 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12415 allocate_commons and do_allocate_commons declarations. Declare
12416 do_allocate_commons_list.
12417 * gold.cc (queue_middle_tasks): Update creation of
12418 Allocate_commons_task to not pass options.
12419 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12420 (TLS_TEST_C_FLAGS): New variable.
12421 (tls_test_c_pic.o): New target.
12422 (tls_test_shared.so): Link in tls_test_c_pic.o.
12423 (tls_test_c_pic_ie.o): New target.
12424 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12425 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12426 (tls_test_c.o): New target.
12427 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12428 (tls_pic_test_LDADD): Likewise.
12429 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12430 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12431 (tls_test_c_gnu2.o): New target.
12432 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12434 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12435 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12436 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12437 * testsuite/tls_test.cc: Include "config.h".
12438 (t_last): Call t11_last.
12439 * testsuite/tls_test.h (t11, t11_last): Declare.
12440 * testsuite/tls_test_c.c: New file.
12441 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12442 * configure.ac: Check for OpenMP support.
12443 * configure, config.in, Makefile.in: Rebuild.
12444 * testsuite/Makefile.in: Rebuild.
12446 2008-04-16 Cary Coutant <ccoutant@google.com>
12448 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12449 (Target_i386::tls_base_symbol_defined_): New field.
12450 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12451 (Target_i386::Scan::global): Likewise.
12452 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12453 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12454 (Target_x86_64::tls_base_symbol_defined_): New field.
12455 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12456 (Target_x86_64::Scan::global): Likewise.
12458 2008-04-16 Cary Coutant <ccoutant@google.com>
12460 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12461 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12462 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12463 building shared libraries.
12464 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12465 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12466 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12467 * testsuite/Makefile.in: Rebuild.
12468 * testsuite/weak_undef.h: New file.
12469 * testsuite/weak_undef_file1.cc: Add extra test cases.
12470 * testsuite/weak_undef_file2.cc: Likewise.
12471 * testsuite/weak_undef_test.cc: Likewise.
12473 2008-04-16 David S. Miller <davem@davemloft.net>
12475 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12476 Add issued_non_pic_error_ field. Declare check_non_pic.
12477 (Target_sparc::Scan::check_non_pic): New function.
12478 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12479 (Target_sparc::Scan::global): Likewise.
12481 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12482 * configure: Rebuild.
12484 * options.h (DEFINE_enable): New macro.
12485 (new_dtags): New enable option.
12486 (initfirst, interpose, loadfltr, nodefaultlib,
12487 nodelete, nodlopen, nodump): New -z options.
12488 * layout.cc (Layout:finish_dynamic_section): If new
12489 dtags enabled, emit DT_RUNPATH. Also, emit a
12490 DT_FLAGS_1 containing any specified -z flags.
12492 2008-04-16 Ian Lance Taylor <iant@google.com>
12494 * copy-relocs.cc: New file.
12495 * copy-relocs.h: New file.
12496 * reloc.cc: Remove Copy_relocs code.
12497 * reloc.h: Likewise.
12498 * reloc-types.h (struct Reloc_types) [both versions]: Add
12499 get_reloc_addend_noerror.
12500 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12501 variants of add_global which take an addend which must be zero.
12502 * i386.cc: Include "copy-relocs.h".
12503 (class Target_i386): Change type of copy_relocs_ to variable,
12504 update initializer.
12505 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12506 Change all callers.
12507 (Target_i386::do_finalize_sections): Change handling of
12509 * sparc.cc: Include "copy-relocs.h".
12510 (class Target_sparc): Change type of copy_relocs_ to variable,
12511 update initializer.
12512 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12513 Change all callers.
12514 (Target_sparc::do_finalize_sections): Change handling of
12516 * x86_64.cc: Include "copy-relocs.h".
12517 (class Target_x86_64): Change type of copy_relocs_ to variable,
12518 update initializer.
12519 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12520 class. Change all callers.
12521 (Target_x86_64::do_finalize_sections): Change handling of
12523 * Makefile.am (CCFILES): Add copy-relocs.cc.
12524 (HFILES): Add copy-relocs.h.
12526 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12528 * testsuite/script_test_4.sh: Permit leading zeroes.
12530 2008-04-15 Ian Lance Taylor <iant@google.com>
12532 * script-sections.cc (Script_sections::create_segments): Use
12533 header_size_adjustment even when there is enough room for the
12535 * testsuite/script_test_4.sh: New file.
12536 * testsuite/script_test_4.t: New file.
12537 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12538 (check_DATA): Add script_test_4.stdout.
12539 (MOSTLYCLEANFILES): Likewise.
12540 (script_test_4): New target.
12541 (script_test_4.stdout): New target.
12542 * testsuite/Makefile.in: Rebuild.
12544 * sparc.cc: Add definitions for Output_data_plt_sparc class
12547 2008-04-14 David S. Miller <davem@davemloft.net>
12549 * sparc.cc: New file.
12550 * Makefile.am (TARGETSOURCES): Add sparc.cc
12551 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12552 * configure.tgt: Document targ_extra_size and
12553 targ_extra_big_endian. Add entries for sparc-* and
12555 * configure.ac: Handle targ_extra_size and
12556 targ_extra_big_endian.
12557 * Makefile.in: Rebuild.
12558 * configure: Likewise.
12559 * po/POTFILES.in: Likewise.
12560 * po/gold.pot: Likewise.
12562 2008-04-14 Ian Lance Taylor <iant@google.com>
12564 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12565 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12566 in the name/type/flags to section mapping. Don't call
12567 allocate_output_section.
12568 (Layout::choose_output_section): Change parameter from adjust_name
12569 to is_input_section. Don't permit input sections after sections
12570 are attached to segments. Don't call allocate_output_section.
12571 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12572 not write_enable_output_section.
12573 (Layout::make_output_section): Don't push to
12574 unattached_section_list_ nor call attach_to_segment. Call
12575 attach_section_to_segment if sections are attached.
12576 (Layout::attach_sections_to_segments): New function.
12577 (Layout::attach_section_to_segment): New function.
12578 (Layout::attach_allocated_section_to_segment): Rename from
12579 attach_to_segment. Remove flags parameter.
12580 (Layout::allocate_output_section): Remove function.
12581 (Layout::write_enable_output_section): Remove function.
12582 * layout.h (class Layout): Update for above changes. Add new
12583 field sections_are_attached_.
12584 * output.h (Output_section::update_flags_for_input_section): New
12586 * output.cc (Output_section::add_input_section): Call
12587 update_flags_for_input_section.
12588 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12590 2008-04-11 Cary Coutant <ccoutant@google.com>
12592 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12593 thought unnecessary.
12594 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12596 2008-04-11 Ian Lance Taylor <iant@google.com>
12598 * output.h (class Output_section_data): Remove inline definition
12600 * output.cc (Output_section_data::set_addralign): New function.
12602 2008-04-11 Cary Coutant <ccoutant@google.com>
12604 Add support for TLS descriptors for i386 and x86_64.
12605 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12606 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12607 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12609 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12610 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12611 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12613 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12614 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12615 Fix problem with initial-exec relocations.
12616 (Target_i386::Relocate::relocate_tls): Likewise.
12617 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12619 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12620 support for section-plus-offset dynamic table entries.
12621 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12622 (Output_data_dynamic::Dynamic_entry): Add support for
12623 section-plus-offset dynamic table entries.
12624 (Output_data_dynamic::Classification): Likewise.
12625 (Output_data_dynamic::classification_): Renamed offset_.
12626 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12627 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12628 (Target_x86_64::make_plt_section): New function.
12629 (Target_x86_64::reserve_tlsdesc_entries): New function.
12630 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12631 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12632 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12633 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12634 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12635 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12636 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12637 add extra PLT entry for TLS descriptors.
12638 (Output_data_plt_x86_64::got_): New field.
12639 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12640 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12642 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12644 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12645 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12646 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12647 R_386_TLS_DESC_CALL relocations.
12648 (Target_x86_64::Scan::global): Likewise.
12649 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12650 for TLS descriptors.
12651 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12652 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12653 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12654 GD-to-IE relaxation.
12655 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12656 and TLS_DESCRIPTORS.
12657 * Makefile.in: Rebuild.
12658 * configure: Rebuild.
12659 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12660 (tls_test_shared2.so): New target.
12661 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12662 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12663 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12664 (tls_shared_gd_to_ie_test_LDADD): New variable.
12665 (tls_shared_gnu2_gd_to_ie_test): New target.
12666 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12668 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12669 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12670 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12671 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12672 (tls_shared_gnu2_test): New target.
12673 (tls_test_gnu2_shared.so): New target.
12674 (tls_shared_gnu2_test_SOURCES): New variable.
12675 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12676 (tls_shared_gnu2_test_LDFLAGS): New variable.
12677 (tls_shared_gnu2_test_LDADD): New variable.
12678 * testsuite/Makefile.in: Rebuild.
12679 * testsuite/Makefile.
12681 2008-04-11 Ian Lance Taylor <iant@google.com>
12683 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12685 * testsuite/Makefile.in: Rebuild.
12687 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12689 * testsuite/script_test_2.cc (main): Adjust test.
12691 2008-04-11 David S. Miller <davem@davemloft.net>
12692 Ian Lance Taylor <iant@google.com>
12694 * options.h (General_options): Add entries for '-Y' and
12696 * options.cc (General_options:finalize): If -Y was used, add those
12697 entries to the library path instead of the default "/lib" and
12700 2008-04-11 David S. Miller <davem@davemloft.net>
12702 * testsuite/justsyms.t: Start at 0x100.
12703 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12704 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12706 * testsuite/script_test_2.cc: Adjust string and section length
12709 2008-04-09 Ian Lance Taylor <iant@google.com>
12712 * script-sections.cc (Sections_element::allocate_to_segment): Add
12714 (Output_section_definition::allocate_to_segment): Likewise.
12715 (Orphan_output_section::allocate_to_segment): Likewise.
12716 (Script_sections::attach_sections_using_phdrs_clause): Don't
12717 propagate non-PT_LOAD segments to orphan sections.
12718 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12719 readelf rather than objdump.
12720 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12721 .interp section and PT_INTERP segment are the same size.
12722 * testsuite/Makefile.in: Rebuild.
12724 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12725 aliases for symbols defined in the same object.
12726 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12727 (weak_alias_test_SOURCES): New variable.
12728 (weak_alias_test_DEPENDENCIES): New variable.
12729 (weak_alias_test_LDFLAGS): New variable.
12730 (weak_alias_test_LDADD): New variable.
12731 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12732 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12733 (weak_alias_test_3.o): New target.
12734 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12735 * testsuite/weak_alias_test_main.cc: New file.
12736 * testsuite/weak_alias_test_1.cc: New file.
12737 * testsuite/weak_alias_test_2.cc: New file.
12738 * testsuite/weak_alias_test_3.cc: New file.
12740 2008-04-08 Ian Lance Taylor <iant@google.com>
12742 * options.h (class General_options): Add --noinhibit-exec option.
12743 * main.cc (main): Check --noinhibit-exec.
12745 * options.h (class General_options): Define --wrap as a special
12746 option. Add wrap_symbols_ field.
12747 (General_options::any_wrap_symbols): New function.
12748 (General_options::is_wrap_symbol): New function.
12749 * options.cc (General_options::parse_wrap): New function.
12750 (General_options::General_options): Initialize wrap_symbols_.
12751 * symtab.cc (Symbol_table::wrap_symbol): New function.
12752 (Symbol_table::add_from_object): Handle --wrap.
12753 * symtab.h (class Symbol_table): Declare wrap_symbol.
12754 * target.h (Target::wrap_char): New function.
12755 (Target::Target_info): Add wrap_char field.
12756 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12757 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12758 * testsuite/testfile.cc (Target_test::test_target_info):
12761 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12764 * layout.h (class Layout): Add added_eh_frame_data_ field.
12765 * layout.cc (Layout::Layout): Initialize new field.
12766 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12767 output section until we find a section we merged successfully.
12768 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12769 that the size be non-zero.
12771 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12774 2008-04-08 Craig Silverstein <csilvers@google.com>
12776 * configure.ac: Export new conditional variable HAVE_ZLIB.
12777 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12779 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12780 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12782 2008-04-07 Ian Lance Taylor <iant@google.com>
12784 * version.cc (version_string): Set to "1.5".
12786 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12787 Add issued_non_pic_error_ field. Declare check_non_pic.
12788 (Target_x86_64::Scan::check_non_pic): New function.
12789 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12790 (Target_x86_64::Scan::global): Likewise.
12792 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12793 addend parameter. Change caller. Handle merge sections.
12794 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12795 Address to Addend. Don't add in the result of
12796 local_section_offset, pass down the addend and use the returned
12798 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12799 Update declarations of local_section_offset and symbol_value.
12800 * testsuite/two_file_test_1.cc (t18): New function.
12801 * testsuite/two_file_test_2.cc (f18): New function.
12802 * testsuite/two_file_test_main.cc (main): Call t18.
12803 * testsuite/two_file_test.h (t18, f18): Declare.
12805 * configure.ac: Don't test for objdump, c++filt, or readelf.
12806 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12808 (TEST_READELF): New variable.
12809 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12810 (check_PROGRAMS): Add two_file_strip_test.
12811 (two_file_strip_test): New target.
12812 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12813 (two_file_same_shared_strip_test_SOURCES): New variable.
12814 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12815 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12816 (two_file_same_shared_strip_test_LDADD): New variable.
12817 (two_file_shared_strip.so): New target.
12818 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12819 (ver_test_5.syms, ver_test_7.syms): Likewise.
12820 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12821 (strip_test_3.stdout): Use TEST_OBJDUMP.
12822 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12824 2008-04-04 Cary Coutant <ccoutant@google.com>
12826 * symtab.h (Symbol::is_weak_undefined): New function.
12827 (Symbol::is_strong_undefined): New function.
12828 (Symbol::is_absolute): New function.
12829 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12830 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12832 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12833 (weak_undef_test): New target.
12834 * testsuite/Makefile.in: Rebuild.
12835 * testsuite/weak_undef_file1.cc: New file.
12836 * testsuite/weak_undef_file2.cc: New file.
12837 * testsuite/weak_undef_test.cc: New file.
12839 2008-04-03 Craig Silverstein <csilvers@google.com>
12841 * compressed_output.h (class Output_compressed_section): Use
12843 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12845 (zlib_compressed_suffix): Removed.
12846 (Output_compressed_section::set_final_data_size): Use unsigned
12848 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12849 Fix linker invocation.
12850 (flagstest_o_specialfile_and_compress_debug_sections):
12852 * testsuite/Makefile.in: Regenerated.
12854 2008-04-02 David S. Miller <davem@davemloft.net>
12856 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12857 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12859 2008-04-02 Craig Silverstein <csilvers@google.com>
12863 2008-04-02 Ian Lance Taylor <iant@google.com>
12865 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12866 parameters. Update for new key type to views_. Change all
12868 (File_read::read): Adjust for byteshift in returned view.
12869 (File_read::add_view): New function, broken out of
12870 find_and_make_view.
12871 (File_read::make_view): New function, broken out of
12872 find_and_make_view.
12873 (File_read::find_or_make_view): Add offset and aligned
12874 parameters. Rewrite accordingly. Change all callers.
12875 (File_read::get_view): Add offset and aligned parameters. Adjust
12876 for byteshift in return value.
12877 (File_read::get_lasting_view): Likewise.
12878 * fileread.h (class File_read): Update declarations.
12879 (class File_read::View): Add byteshift_ field. Add byteshift to
12880 constructor. Add byteshift method.
12881 * archive.h (Archive::clear_uncached_views): New function.
12882 (Archive::get_view): Add aligned parameter. Change all callers.
12883 * object.h (Object::get_view): Add aligned parameter. Change all
12885 (Object::get_lasting_view): Likewise.
12887 * fileread.cc (File_read::release): Don't call clear_views if
12888 there are multiple objects.
12889 * fileread.h (File_read::clear_uncached_views): New function.
12890 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12893 2008-03-31 Cary Coutant <ccoutant@google.com>
12895 Add thin archive support.
12896 * archive.cc (Archive::armagt): New const.
12897 (Archive::setup): Remove task parameter and calls to unlock.
12898 (Archive::unlock_nested_archives): New function.
12899 (Archive::read_header): Add nested_off parameter. Change
12901 (Archive::interpret_header): Likewise.
12902 (Archive::include_all_members): Change to handle thin
12904 (Archive::include_member): Likewise.
12905 * archive.h (Archive::Archive): Add new parameters and
12907 (Archive::armagt): New const.
12908 (Archive::setup): Remove task parameter.
12909 (Archive::unlock_nested_archives): New function.
12910 (Archive::read_header): Add nested_off parameter.
12911 (Archive::interpret_header): Likewise.
12912 (Archive::Nested_archive_table): New typedef.
12913 (Archive::is_thin_archive_): New field.
12914 (Archive::nested_archives_): New field.
12915 (Archive::options_): New field.
12916 (Archive::dirpath_): New field.
12917 (Archive::task_): New field.
12918 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12919 for thin archives. Pass additional parameters to
12920 Archive::Archive. Unlock the archive file after calling
12923 2008-03-29 Ian Lance Taylor <iant@google.com>
12925 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12926 version symbol to be local.
12927 * testsuite/ver_test_4.sh: New file.
12928 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12929 (check_DATA): Add ver_test_4.syms.
12930 (ver_test_4.syms): New target.
12931 * testsuite/Makefile.in: Rebuild.
12934 (Output_section::Input_section_sort_entry::has_priority): New
12936 (Output_section::Input_section_sort_entry::match_file_name): New
12938 (Output_section::Input_section_sort_entry::match_section_name):
12940 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12942 (Output_section::Input_section_sort_entry::match_section_file):
12944 (Output_section::Input_section_sort_compare::operator()): Rewrite
12945 using new Input_section_sort_entry functions. Sort crtbegin and
12946 crtend first. Sort sections with no priority before sections with
12948 * testsuite/initpri1.c (d3): Check j != 4.
12949 (cd5): New constructor/destructor function.
12950 (main): Check j != 2.
12952 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12953 new symbol when resolving, don't call set_is_default.
12954 * testsuite/ver_test_7.cc: New file.
12955 * testsuite/ver_test_7.sh: New file.
12956 * testsuite/Makefile.am (ver_test_7.so): New target.
12957 (ver_test_7.o): New target.
12958 (check_SCRIPTS): Add ver_test_7.sh.
12959 (check_DATA): Add ver_test_7.syms.
12960 (ver_test_7.syms): New target.
12962 2008-03-28 Ian Lance Taylor <iant@google.com>
12964 * layout.cc (Layout::layout): If we see an input section with a
12965 name that needs sorting, set the must_sort flag for the output
12967 (Layout::make_output_section): If the name of the output section
12968 indicates that it might require sorting, set the may_sort flag.
12969 * output.h (Output_section::may_sort_attached_input_sections): New
12971 (Output_section::set_may_sort_attached_input_sections): New
12973 (Output_section::must_sort_attached_input_sections): New
12975 (Output_section::set_must_sort_attached_input_sections): New
12977 (class Output_section): Declare Input_section_sort_entry. Define
12978 Input_section_sort_compare. Declare
12979 sort_attached_input_sections. Add new fields:
12980 may_sort_attached_input_sections_,
12981 must_sort_attached_input_sections_,
12982 attached_input_sections_are_sorted_.
12983 * output.cc (Output_section::Output_section): Initialize new
12985 (Output_section::add_input_section): Add an entry to
12986 input_sections_ if may_sort or must_sort are true.
12987 (Output_section::set_final_data_size): Call
12988 sort_attached_input_sections if necessary.
12989 (Output_section::Input_section_sort_entry): Define new class.
12990 (Output_section::Input_section_sort_compare::operator()): New
12992 (Output_section::sort_attached_input_sections): New function.
12993 * configure.ac: Check whether the compiler supports constructor
12994 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12995 * testsuite/initpri1.c: New file.
12996 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12997 CONSTRUCTOR_PRIORITY.
12998 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12999 (initpri1_LDFLAGS): New variable.
13000 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13002 2008-03-27 Ian Lance Taylor <iant@google.com>
13004 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13005 * testsuite/common_test_1.c: New file.
13006 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13007 (common_test_1_SOURCES): New variable.
13008 (common_test_1_DEPENDENCIES): New variable.
13009 (common_test_1_LDFLAGS): New variable.
13011 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13012 and commons_ correctly when NAME/VERSION does not override
13014 * testsuite/ver_test_6.c: New file.
13015 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13016 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13017 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13019 2008-03-26 Ian Lance Taylor <iant@google.com>
13021 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13022 of an undefined symbol from a version script.
13023 * testsuite/Makefile.am (ver_test_5.so): New target.
13024 (ver_test_5.o): New target.
13025 (check_SCRIPTS): Add ver_test_5.sh.
13026 (check_DATA): Add ver_test_5.syms.
13027 (ver_test_5.syms): New target.
13028 * testsuite/ver_test_5.cc: New file.
13029 * testsuite/ver_test_5.script: New file.
13030 * testsuite/ver_test_5.sh: New file.
13031 * Makefile.in, testsuite/Makefile.in: Rebuild.
13034 Fix problems building gold with gcc 4.3.0.
13035 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13036 (gold_error_at_location, gold_warning_at_location): Use it.
13037 * configure.ac: Check whether we can compile and use a template
13038 function with a printf attribute.
13039 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13040 when jumping over bytes.
13041 * object.cc: Instantiate Object::read_section_data.
13042 * debug.h: Include <cstring>
13043 * dwarf_reader.cc: Include <algorithm>
13044 * main.cc: Include <cstring>.
13045 * options.cc: Include <cstring>.
13046 * output.cc: Include <cstring>.
13047 * script.cc: Include <cstring>.
13048 * script.h: Include <string>.
13049 * symtab.cc: Include <cstring> and <algorithm>.
13050 * target-select.cc: Include <cstring>.
13051 * version.cc: Include <string>.
13052 * testsuite/testmain.cc: Include <cstdlib>.
13053 * configure, config.in: Rebuild.
13055 2008-03-25 Ian Lance Taylor <iant@google.com>
13057 * options.cc: Include "../bfd/bfdver.h".
13058 (options::help): Print bug reporting address.
13060 * version.cc (print_version): Adjust output for current value of
13061 BFD_VERSION_STRING.
13065 * options.cc (options::help): Print list of supported targets.
13066 * target-select.h: Include <vector>.
13067 (class Target_selector): Make machine_, size_, and is_big_endian_
13068 fields const. Add bfd_name_ and instantiated_target_ fields.
13069 (Target_selector::Target_selector): Add bfd_name parameter.
13070 (Target_selector::recognize): Make non-virtual, call
13072 (Target_selector::recognize_by_name): Make non-virtual, call
13073 do_recognize_by_name.
13074 (Target_selector::supported_names): New function.
13075 (Target_selector::bfd_name): New function.
13076 (Target_selector::do_instantiate_target): New pure virtual
13078 (Target_selector::do_recognize): New virtual function.
13079 (Target_selector::do_recognize_by_name): New virtual function.
13080 (Target_selector::instantiate_target): New private function.
13081 (supported_target_names): Declare.
13082 * target-select.cc (Target_selector::Target_selector): Update for
13083 new parameter and fields.
13084 (select_target_by_name): Check that the name matches before
13085 calling recognize_by_name.
13086 (supported_target_names): New function.
13087 * i386.cc (class Target_selector_i386): Update Target_selector
13088 constructor call. Remove recognize and recognize_by_name. Add
13089 do_instantiate_target.
13090 * x86_64.cc (class Target_selector_x86_64): Likewise.
13091 * testsuite/testfile.cc (class Target_selector_test): Update for
13092 changes to Target_selector.
13094 * README: Rewrite, with some notes on unsupported features.
13096 2008-03-24 Cary Coutant <ccoutant@google.com>
13098 * i386.cc (Target_i386::Got_type): New enum declaration.
13099 (Target_i386::Scan::local): Updated callers of Output_data_got
13101 (Target_i386::Scan::global): Likewise.
13102 (Target_i386::Relocate::relocate): Likewise.
13103 (Target_i386::Relocate::relocate_tls): Likewise.
13104 * object.h (Got_offset_list): New class.
13105 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13106 (Sized_relobj::local_got_offset): Likewise.
13107 (Sized_relobj::set_local_got_offset): Likewise.
13108 (Sized_relobj::local_has_tls_got_offset): Removed.
13109 (Sized_relobj::local_tls_got_offset): Removed.
13110 (Sized_relobj::set_local_tls_got_offset): Removed.
13111 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13112 * output.cc (Output_data_got::add_global): Added got_type parameter.
13113 (Output_data_got::add_global_with_rel): Likewise.
13114 (Output_data_got::add_global_with_rela): Likewise.
13115 (Output_data_got::add_global_pair_with_rel): New function.
13116 (Output_data_got::add_global_pair_with_rela): New function.
13117 (Output_data_got::add_local): Added got_type parameter.
13118 (Output_data_got::add_local_with_rel): Likewise.
13119 (Output_data_got::add_local_with_rela): Likewise.
13120 (Output_data_got::add_local_pair_with_rel): New function.
13121 (Output_data_got::add_local_pair_with_rela): New function.
13122 (Output_data_got::add_global_tls): Removed.
13123 (Output_data_got::add_global_tls_with_rel): Removed.
13124 (Output_data_got::add_global_tls_with_rela): Removed.
13125 (Output_data_got::add_local_tls): Removed.
13126 (Output_data_got::add_local_tls_with_rel): Removed.
13127 (Output_data_got::add_local_tls_with_rela): Removed.
13128 * output.h (Output_data_got::add_global): Added got_type parameter.
13129 (Output_data_got::add_global_with_rel): Likewise.
13130 (Output_data_got::add_global_with_rela): Likewise.
13131 (Output_data_got::add_global_pair_with_rel): New function.
13132 (Output_data_got::add_global_pair_with_rela): New function.
13133 (Output_data_got::add_local): Added got_type parameter.
13134 (Output_data_got::add_local_with_rel): Likewise.
13135 (Output_data_got::add_local_with_rela): Likewise.
13136 (Output_data_got::add_local_pair_with_rel): New function.
13137 (Output_data_got::add_local_pair_with_rela): New function.
13138 (Output_data_got::add_global_tls): Removed.
13139 (Output_data_got::add_global_tls_with_rel): Removed.
13140 (Output_data_got::add_global_tls_with_rela): Removed.
13141 (Output_data_got::add_local_tls): Removed.
13142 (Output_data_got::add_local_tls_with_rel): Removed.
13143 (Output_data_got::add_local_tls_with_rela): Removed.
13144 * resolve.cc (Symbol::override_base_with_special): Removed
13145 reference to has_got_offset_ field.
13146 * symtab.cc (Symbol::init_fields): Replaced initialization
13147 of got_offset_ with got_offsets_. Removed initialization
13149 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13150 (Symbol::got_offset): Likewise.
13151 (Symbol::set_got_offset): Likewise.
13152 (Symbol::has_tls_got_offset): Removed.
13153 (Symbol::tls_got_offset): Removed.
13154 (Symbol::set_tls_got_offset): Removed.
13155 (Symbol::got_offset_): Removed.
13156 (Symbol::tls_mod_got_offset_): Removed.
13157 (Symbol::tls_pair_got_offset_): Removed.
13158 (Symbol::got_offsets_): New field.
13159 (Symbol::has_got_offset): Removed.
13160 (Symbol::has_tls_mod_got_offset): Removed.
13161 (Symbol::has_tls_pair_got_offset): Removed.
13162 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13163 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13165 (Target_x86_64::Scan::global): Likewise.
13166 (Target_x86_64::Relocate::relocate): Likewise.
13167 (Target_x86_64::Relocate::relocate_tls): Likewise.
13169 2008-03-25 Ben Elliston <bje@au.ibm.com>
13171 * yyscript.y: Fix spelling error in comment.
13173 2008-03-24 Ian Lance Taylor <iant@google.com>
13175 * options.h (class General_options): Define build_id option.
13176 * layout.h (class Layout): Declare write_build_id, create_note,
13177 create_build_id. Add build_id_note_ member.
13178 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13179 "libiberty.h", "md5.h", "sha1.h".
13180 (Layout::Layout): Initialize eh_frame_data_,
13181 eh_frame_hdr_section_, and build_id_note_.
13182 (Layout::finalize): Call create_build_id.
13183 (Layout::create_note): New function, broken out of
13184 Layout::create_gold_note.
13185 (Layout::create_gold_note): Call create_note.
13186 (Layout::create_build_id): New function.
13187 (Layout::write_build_id): New function.
13188 (Close_task_runner::run): Call write_build_id.
13190 * x86_64.cc: Correct license to GPLv3.
13192 2008-03-23 Ian Lance Taylor <iant@google.com>
13194 * options.cc: Include "demangle.h".
13195 (parse_optional_string): New function.
13196 (parse_long_option): Handle takes_optional_argument.
13197 (parse_short_option): Update dash_z initializer. Handle
13198 takes_optional_argument.
13199 (General_options::General_options): Initialize do_demangle_.
13200 (General_options::finalize): Set do_demangle_. Handle demangling
13202 * options.h (parse_optional_string): Declare.
13203 (struct One_option): Add optional_arg field. Update constructor.
13204 Update call constructor calls. Add takes_optional_argument
13206 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13207 (DEFINE_optional_string): Define.
13208 (General_options::demangle): Change from DEFINE_bool to
13209 DEFINE_optional_string.
13210 (General_options::no_demangle): New function.
13211 (General_options::do_demangle): New function.
13212 (General_options::set_do_demangle): New function.
13213 (General_options::execstack_status_): Move definition to end of
13215 (General_options::static_): Likewise.
13216 (General_options::do_demangle_): New field.
13217 * object.cc (big_endian>::get_symbol_location_info): Call
13218 Options::do_demangle, not Options::demangle.
13219 * symtab.cc (demangle): Likewise.
13221 2008-03-22 Ian Lance Taylor <iant@google.com>
13223 * gold.h: Include <cstddef> and <sys/types.h>
13224 * options.h: Include <cstring>.
13226 2008-03-21 Ian Lance Taylor <iant@google.com>
13228 * Added source code to GNU binutils.