1 2012-07-10 Dodji Seketeli <dodji@redhat.com>
2 Ian Lance Taylor <iant@google.com>
5 * configure.ac: Test whether std::tr1::hash<off_t> works.
6 * gold.h: Add a specialization for std::tr1::hash<off_t> if
8 * output.h (class Output_fill): Add virtual destructor.
9 * configure, config.in: Rebuild.
11 2012-06-22 Roland McGrath <mcgrathr@google.com>
13 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
15 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
17 * plugin.cc (Plugin::load): Handle position independent executables.
19 2012-06-06 Cary Coutant <ccoutant@google.com>
21 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
23 (lines_only_debug_sections): Likewise.
24 (gdb_fast_lookup_sections): New static array.
25 (is_gdb_debug_section): Rename formal parameter.
26 (is_lines_only_debug_section): Likewise.
27 (is_gdb_fast_lookup_section): New function.
28 (Layout::include_section): Check for ".zdebug_" prefix; pass
29 section name suffix to is_gdb_debug_section, et al.; check for
30 fast-lookup sections when building .gdb_index.
31 * options.h (--strip-debug-gdb): Update GDB version number.
33 2012-06-06 Cary Coutant <ccoutant@google.com>
35 * configure.ac: Add check for fallocate.
36 * configure: Regenerate.
37 * config.in: Regenerate.
39 * options.h (class General_options): Add --mmap-output-file and
40 --posix-fallocate options.
41 * output.cc: (posix_fallocate): Remove; replace with...
42 (gold_fallocate): New function.
43 (Output_file::map_no_anonymous): Call gold_fallocate.
44 (Output_file::map): Check --mmap-output-file option.
46 2012-06-05 Jing Yu <jingyu@google.com>
48 * gold.h (textdomain): Add do {} to empty while(0).
49 (bindtextdomain): Likewise.
51 2012-06-04 Cary Coutant <ccoutant@google.com>
53 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
56 2012-05-25 Sriraman Tallam <tmsriram@google.com>
58 * symtab.cc (Symbol_table::define_special_symbol):
59 Initialize *poldsym to prevent uninitialized variable errors.
61 2012-05-23 Cary Coutant <ccoutant@google.com>
63 * layout.cc (Layout::section_name_mapping): Add rules to handle
64 exact match on .data.rel.ro.local or .data.rel.ro.
65 (Layout::output_section_name): Check for exact matches.
67 2012-05-23 Cary Coutant <ccoutant@google.com>
69 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
72 2012-05-22 Cary Coutant <ccoutant@google.com>
74 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
75 object before exporting symbol.
77 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
79 * testsuite/tls_test.cc: Include "config.h" first.
80 * testsuite/tls_test_c.c: Likewise.
82 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
83 Nick Clifton <nickc@redhat.com>
86 * configure.in: Add check that sysdep.h has been included before
87 any system header files.
88 * configure: Regenerate.
89 * config.in: Regenerate.
91 2012-05-14 Cary Coutant <ccoutant@google.com>
93 * layout.cc (Layout::make_output_section): Mark .tdata section
95 * testsuite/relro_test.cc: Add a TLS variable.
97 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
100 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
101 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
104 2012-05-08 Cary Coutant <ccoutant@google.com>
106 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
107 (lines_only_debug_sections): Likewise.
109 2012-05-02 Roland McGrath <mcgrathr@google.com>
113 * Makefile.am (CCFILES, HFILES): Add them.
114 * Makefile.in: Regenerate.
115 * i386.cc (Output_data_plt_i386_nacl): New class.
116 (Output_data_plt_i386_nacl_exec): New class.
117 (Output_data_plt_i386_nacl_dyn): New class.
118 (Target_i386_nacl): New class.
119 (Target_selector_i386_nacl): New class.
120 (target_selector_i386): Use it instead of Target_selector_i386.
121 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
122 (Target_x86_64_nacl): New class.
123 (Target_selector_x86_64_nacl): New class.
124 (target_selector_x86_64, target_selector_x32): Use it instead of
125 Target_selector_x86_64.
126 * arm.cc (Output_data_plt_arm_nacl): New class.
127 (Target_arm_nacl): New class.
128 (Target_selector_arm_nacl): New class.
129 (target_selector_arm, target_selector_armbe): Use it instead of
132 * target-select.cc (select_target): Take new Input_file* and off_t
133 arguments, pass them on to recognize method of selector.
134 * object.cc (make_elf_sized_object): Update caller.
135 * parameters.cc (parameters_force_valid_target): Likewise.
136 * incremental.cc (make_sized_incremental_binary): Likewise.
137 * target-select.h: Update decl.
138 (Target_selector::recognize): Take new Input_file* argument,
139 pass it on to do_recognize.
140 (Target_selector::do_recognize): Take new Input_file* argument.
141 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
142 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
143 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
144 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
146 * target.h (Target::Target_info): New members isolate_execinstr
148 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
149 * arm.cc (Target_arm::arm_info): Update initializer.
150 * i386.cc (Target_i386::i386_info): Likewise.
151 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
152 * sparc.cc (Target_sparc::sparc_info): Likewise.
153 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
154 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
155 * layout.cc (Layout::attach_allocated_section_to_segment):
156 Take new const Target* argument. If target->isolate_execinstr(), act
158 (Layout::find_first_load_seg): Take new const Target* argument;
159 if target->isolate_execinstr(), reject PF_X segments.
160 (Layout::relaxation_loop_body): Update caller.
161 (Layout::set_segment_offsets): If target->isolate_execinstr(),
162 reset file offset to zero when we hit LOAD_SEG, and then do a second
163 loop over the segments before LOAD_SEG to reassign offsets after
164 addresses have been determined. Handle target->rosegment_gap().
165 (Layout::attach_section_to_segment): Take new const Target* argument;
166 pass it to attach_allocated_section_to_segment.
167 (Layout::make_output_section): Update caller.
168 (Layout::attach_sections_to_segments): Take new const Target* argument;
169 pass it to attach_section_to_segment.
170 * gold.cc (queue_middle_tasks): Update caller.
171 * layout.h (Layout): Update method decls with new arguments.
173 * arm.cc (Target_arm::Target_arm): Take optional argument for the
174 Target_info pointer to use.
175 (Target_arm::do_make_data_plt): New virtual method.
176 (Target_arm::make_data_plt): New method that calls it.
177 (Target_arm::make_plt_entry): Use it.
178 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
179 for the section alignment.
180 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
182 (Output_data_plt_arm::first_plt_entry_offset): Call it.
183 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
185 (Output_data_plt_arm::get_plt_entry_size): Call it.
186 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
187 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
188 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
190 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
191 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
192 method instead of sizeof(plt_entry).
193 (Output_data_plt_arm::add_entry): Likewise.
194 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
195 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
197 (Target_arm::plt_entry_size): Likewise.
198 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
200 (Output_data_plt_arm_standard): ... here, new class.
201 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
202 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
203 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
205 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
206 Take additional argument for the PLT entry size.
207 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
208 Use get_plt_entry_size method rather than plt_entry_size variable.
209 (Output_data_plt_x86_64::reserve_slot): Likewise.
210 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
211 (Output_data_plt_x86_64::add_entry): Likewise.
212 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
213 (Output_data_plt_x86_64::address_for_global): Likewise.
214 (Output_data_plt_x86_64::address_for_local): Likewise.
215 (Output_data_plt_x86_64::set_final_data_size): Likewise.
216 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
217 Make method non-static.
218 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
220 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
221 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
222 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
223 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
225 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
226 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
228 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
229 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
231 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
232 (Output_data_plt_x86_64::plt_entry_size)
233 (Output_data_plt_x86_64::first_plt_entry)
234 (Output_data_plt_x86_64::plt_entry)
235 (Output_data_plt_x86_64::tlsdesc_plt_entry)
236 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
237 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
238 (Output_data_plt_x86_64_standard): ... here, new class.
239 (Target_x86_64::Target_x86_64): Take optional argument for the
240 Target_info pointer to use.
241 (Target_x86_64::do_make_data_plt): New virtual method.
242 (Target_x86_64::make_data_plt): New method to call it.
243 (Target_x86_64::init_got_plt_for_update): Use that.
244 Call this->plt_->add_eh_frame method here.
245 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
246 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
247 rather than static method.
248 (Target_x86_64::plt_entry_size): Likewise.
249 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
250 rather than plt_entry_size variable. Move guts of PLT filling to...
251 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
252 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
253 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
255 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
256 additional argument for the section alignment.
257 Don't do add_eh_frame_for_plt here.
258 (Output_data_plt_i386::first_plt_entry_offset): Make the method
259 non-static. Use get_plt_entry_size method rather than plt_entry_size
261 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
263 (Output_data_plt_i386::get_plt_entry_size): Call it.
264 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
265 (Output_data_plt_i386::add_eh_frame): New method to call it.
266 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
268 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
269 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
271 (Output_data_plt_i386::fill_plt_entry): New method to call it.
272 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
273 method instead of plt_entry_size.
274 (Output_data_plt_i386::plt_entry_size)
275 (Output_data_plt_i386::plt_eh_frame_fde_size)
276 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
277 (Output_data_plt_i386_standard): ... here, new class.
278 (Output_data_plt_i386_exec): New class.
279 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
280 (Output_data_plt_i386_exec::first_plt_entry): ... here.
281 (Output_data_plt_i386::exec_plt_entry): Move to ...
282 (Output_data_plt_i386_exec::plt_entry): ... here.
283 (Output_data_plt_i386_dyn): New class.
284 (Output_data_plt_i386::first_plt_entry): Move to ...
285 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
286 (Output_data_plt_i386::dyn_plt_entry): Move to ...
287 (Output_data_plt_i386_dyn::plt_entry): ... here.
288 (Target_i386::Target_i386): Take optional argument for the Target_info
290 (Target_i386::do_make_data_plt): New virtual method.
291 (Target_i386::make_data_plt): New method to call it.
292 (Target_i386::make_plt_section): Use that.
293 Call this->plt_->add_eh_frame method here.
294 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
295 rather than plt_entry_size variable.
296 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
297 (Output_data_plt_i386::address_for_local): Likewise.
298 (Output_data_plt_i386::do_write): Likewise.
299 Move guts of PLT filling to...
300 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
301 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
302 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
303 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
305 2012-05-01 Cary Coutant <ccoutant@google.com>
307 * dwarf_reader.cc (Dwarf_die::read_attributes)
308 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
309 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
310 * reduced_debug_output.cc
311 (Output_reduced_debug_info_section::get_die_end): Remove
312 DW_FORM_GNU_ref_index. Add default case.
314 2012-04-26 Mark Wielaard <mjw@redhat.com>
316 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
317 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
318 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
319 DW_AT_high_pc as offset from DW_AT_low_pc.
321 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
322 * testsuite/Makefile.in: Regenerate.
323 * testsuite/gdb_index_test_3.c: New test source file.
324 * testsuite/gdb_index_test_3.sh: New test source file.
326 2012-04-25 Ian Lance Taylor <iant@google.com>
328 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
330 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
331 as a class, not a struct.
332 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
333 (Target_arm::apply_cortex_a8_workaround): Likewise.
334 * gc.h: Declare Reloc_types as a struct, not a class.
335 * object.h: Declare Symbols_data as a struct.
336 * reloc.h: Declare Read_relocs_data as a struct.
337 * target.h: Declare Relocate_info as a struct.
339 2012-04-24 David S. Miller <davem@davemloft.net>
341 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
342 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
345 2012-04-24 Cary Coutant <ccoutant@google.com>
347 * incremental-dump.cc (find_input_containing_global): Replace
348 magic number with symbolic constant.
349 (dump_incremental_inputs): Update version number.
350 * incremental.cc (Output_section_incremental_inputs): Update version
351 number; import symbolic constants from Incremental_inputs_reader.
352 (Incremental_inputs::create_data_sections): Align relocations
353 section correctly for 64-bit targets.
354 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
355 constants; add padding.
356 (Output_section_incremental_inputs::write_header): Add assert for
358 (Output_section_incremental_inputs::write_input_files): Add assert
359 for input_entry_size.
360 (Output_section_incremental_inputs::write_info_blocks): Add padding;
361 add assert for object_info_size, input_section_entry_size,
362 global_sym_entry_size.
363 * incremental.h (Incremental_inputs_reader): Add symbolic constants
364 for data structure sizes; use them.
365 (Incremental_input_entry_reader): Import symbolic constants from
366 Incremental_inputs_reader; use them.
368 2012-04-23 David S. Miller <davem@davemloft.net>
370 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
372 (Target_sparc::Target_sparc): Initialize new fields.
373 (Target_sparc::do_make_elf_object): New function.
374 (Target_sparc::do_adjust_elf_header): New function.
376 2012-04-23 Cary Coutant <ccoutant@google.com>
378 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
379 CU range table of gdb index.
381 2012-04-20 David S. Miller <davem@davemloft.net>
383 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
386 2012-04-16 David S. Miller <davem@davemloft.net>
388 * sparc.cc (Target_sparc::got_address): New function.
389 (Sparc_relocate_functions::gdop_hix22): New function.
390 (Sparc_relocate_functions::gdop_lox10): New function.
391 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
393 (Target_sparc::Scan::local): Likewise if the global symbol is not
394 preemptible and is not IFUNC.
395 (Target_sparc::Relocate::relocate): Perform GOTDATA code
396 transformations for local and non-preemptible non-IFUNC global
399 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
400 writing out 64-bit part of ranges.
402 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
403 -fpic and -fpie respectively.
404 * Makefile.in: Regenerate.
406 * sparc.cc (class Target_sparc): Add rela_ifunc_.
407 (Target_sparc::Target_sparc): Initialize new field.
408 (Target_sparc::do_plt_section_for_global): New function.
409 (Target_sparc::do_plt_section_for_local): New function.
410 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
411 (Target_sparc::make_plt_section): New function, broken out of
412 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
413 (Target_sparc::make_plt_entry): Call make_plt_section.
414 (Target_sparc::make_local_ifunc_plt_entry): New function.
415 (Target_sparc::rela_ifunc_section): New function.
416 (Target_sparc::plt_section): Remove const.
417 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
418 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
419 and ifunc_count_ fields.
420 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
421 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
422 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
423 (Output_data_plt_sparc::rela_ifunc): New function.
424 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
425 (Output_data_plt_sparc::has_ifunc_section): New function.
426 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
427 (Output_data_plt_sparc::address_for_global): New function.
428 (Output_data_plt_sparc::address_for_local): New function.
429 (Output_data_plt_sparc::plt_index_to_offset): New function.
430 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
432 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
434 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
435 R_SPARC_JMP_IREL to switch.
436 (Target_sparc::Scan::check_non_pic): Likewise.
437 (Target_sparc::Scan::local): Handle IFUNC symbols.
438 (Target_sparc::Scan::local): Likewise.
439 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
440 and plt_address_for_local.
441 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
442 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
444 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
445 (class Output_data_reloc): Adjust calls to Output_reloc_type.
446 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
447 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
449 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
450 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
452 * sparc.cc (Target_sparc::Scan::global): Likewise.
453 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
455 2012-04-16 Cary Coutant <ccoutant@google.com>
457 * archive.cc (Library_base::should_include_member): Check for
458 --export-dynamic-symbol.
459 * options.h (class General_options): Add --export-dynamic-symbol.
460 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
461 --export-dynamic-symbol.
462 (Symbol_table::gc_mark_undef_symbols): Likewise.
463 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
465 2012-04-12 David S. Miller <davem@davemloft.net>
467 * sparc.cc (Reloc::wdisp10): New relocation method.
468 (Reloc::h34): Likewise.
469 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
470 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
472 (Target_sparc::Scan::local): Likewise.
473 (Target_sparc::Scan::global): Likewise.
474 (Target_sparc::Relocate::relocate): Likewise.
476 2012-04-09 Cary Coutant <ccoutant@google.com>
478 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
481 2012-04-06 Ian Lance Taylor <iant@google.com>
483 * timer.cc: #include <unistd.h>.
485 2012-04-06 Roland McGrath <mcgrathr@google.com>
487 * configure.in (AC_CHECK_HEADERS): Add locale.h.
488 * config.in: Regenerate.
489 * configure: Regenerate.
491 2012-04-05 Nick Clifton <nickc@redhat.com>
493 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
494 (AM_LC_MESSAGES): Add.
495 * aclocal.m4: Regenerate.
496 * config.in: Regenerate.
497 * configure: Regenerate.
499 2012-03-21 Cary Coutant <ccoutant@google.com>
501 * Makefile.am: Add gdb-index.cc, gdb-index.h.
502 * Makefile.in: Regenerate.
503 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
504 (Sized_elf_reloc_mapper::symbol_section): New function.
505 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
506 (make_elf_reloc_mapper): New function.
507 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
508 (Dwarf_abbrev_table::do_read_abbrevs): New function.
509 (Dwarf_abbrev_table::do_get_abbrev): New function.
510 (Dwarf_ranges_table::read_ranges_table): New function.
511 (Dwarf_ranges_table::read_range_list): New function.
512 (Dwarf_pubnames_table::read_section): New function.
513 (Dwarf_pubnames_table::read_header): New function.
514 (Dwarf_pubnames_table::next_name): New function.
515 (Dwarf_die::Dwarf_die): New function.
516 (Dwarf_die::read_attributes): New function.
517 (Dwarf_die::skip_attributes): New function.
518 (Dwarf_die::set_name): New function.
519 (Dwarf_die::set_linkage_name): New function.
520 (Dwarf_die::attribute): New function.
521 (Dwarf_die::string_attribute): New function.
522 (Dwarf_die::int_attribute): New function.
523 (Dwarf_die::uint_attribute): New function.
524 (Dwarf_die::ref_attribute): New function.
525 (Dwarf_die::child_offset): New function.
526 (Dwarf_die::sibling_offset): New function.
527 (Dwarf_info_reader::check_buffer): New function.
528 (Dwarf_info_reader::parse): New function.
529 (Dwarf_info_reader::do_parse): New function.
530 (Dwarf_info_reader::do_read_string_table): New function.
531 (Dwarf_info_reader::lookup_reloc): New function.
532 (Dwarf_info_reader::get_string): New function.
533 (Dwarf_info_reader::visit_compilation_unit): New function.
534 (Dwarf_info_reader::visit_type_unit): New function.
535 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
536 Sized_elf_reloc_mapper.
537 (Sized_dwarf_line_info::symbol_section): Remove function.
538 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
539 (Sized_dwarf_line_info::read_line_mappings): Remove object
540 parameter, adjust callers.
541 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
542 * dwarf_reader.h: Include <sys/types.h>.
543 (class Track_relocs): Remove forward declaration.
544 (class Elf_reloc_mapper): New class.
545 (class Sized_elf_reloc_mapper): New class.
546 (class Dwarf_abbrev_table): New class.
547 (class Dwarf_range_list): New class.
548 (class Dwarf_ranges_table): New class.
549 (class Dwarf_pubnames_table): New class.
550 (class Dwarf_die): New class.
551 (class Dwarf_info_reader): New class.
552 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
553 (Sized_dwarf_line_info::symbol_section): Remove member function.
554 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
556 * gdb-index.cc: New source file.
557 * gdb-index.h: New source file.
558 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
559 and .debug_types sections, call Layout::add_to_gdb_index.
560 (Sized_relobj_incr::do_section_name): Implement.
561 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
562 return type; Implement.
563 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
565 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
566 parameter list and return type.
567 (Sized_incr_dynobj::do_section_contents): Likewise.
568 * layout.cc: Include gdb-index.h.
569 (Layout::Layout): Initialize gdb_index_data_.
570 (Layout::init_fixed_output_section): Check for .gdb_index section.
571 (Layout::add_to_gdb_index): New function. Instantiate.
572 * layout.h: Add forward declaration for class Gdb_index.
573 (Layout::add_to_gdb_index): New member function.
574 (Layout::gdb_index_data_): New data member.
575 * main.cc: Include gdb-index.h.
576 (main): Print statistics for gdb index.
577 * object.cc (Object::section_contents): Move code into
579 (need_decompressed_section): Check for sections needed when building
581 (build_compressed_section_map): Likewise.
582 (Sized_relobj_file::do_read_symbols): Need local symbols when building
584 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
585 sections; call Layout::add_to_gdb_index.
586 (Sized_relobj_file::do_decompressed_section_contents): Call
587 do_section_contents directly.
588 * object.h (Object::do_section_contents): Adjust parameter list and
590 (Object::do_decompressed_section_contents): Call do_section_contents
592 (Sized_relobj_file::do_section_contents): Adjust parameter list and
594 * options.h (class General_options): Add --gdb-index option.
595 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
596 list and return type.
597 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
598 * reloc.h (Track_relocs::checkpoint): New function.
599 (Track_relocs::reset): New function.
601 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
603 * testsuite/Makefile.in: Regenerate.
604 * testsuite/gdb_index_test.cc: New test source file.
605 * testsuite/gdb_index_test_1.sh: New test source file.
606 * testsuite/gdb_index_test_2.sh: New test source file.
608 2012-03-19 Doug Kwan <dougkwan@google.com>
610 * arm.cc (Target_arm::do_define_standard_symbols): New method.
611 (Target_arm::do_finalize_sections): Remove code which defines
612 __exidx_start and __exidx_end. Make symbol table parameter
613 anonymous as it is not used.
614 * gold.cc (queue_middle_tasks): Call target hook to define any
615 target-specific symbols.
616 * target.h (Target::define_standard_symbols): New method.
617 (Target::do_define_standard_symbols): Same.
618 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
619 * testsuite/Makefile.in: Regenerate.
620 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
622 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
623 relocations are generated for __exidx_start and __exidx_end.
625 2012-03-16 Doug Kwan <dougkwan@google.com>
627 * testsuite/Makefile.am: Disable test initpri3b.
628 * testsuite/Makefile.in: Regenerate.
630 2012-03-15 Doug Kwan <dougkwan@google.com>
632 * arm.cc (Target_arm::got_section): Make .got section read-only
635 2012-03-15 Ian Lance Taylor <iant@google.com>
638 * layout.cc (Layout::make_output_section): Correctly mark
639 SHT_INIT_ARRAY, et. al., as relro.
641 2012-03-14 Doug Kwan <dougkwan@google.com>
643 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
644 dynamic relocations for protected symbols in shared objects.
646 2012-03-13 Ian Lance Taylor <iant@google.com>
648 * resolve.cc (Symbol_table::resolve): When merging common symbols,
649 keep the larger alignment.
651 2012-03-12 Cary Coutant <ccoutant@google.com>
653 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
654 handling of DW_LNE_define_file.
656 2012-03-12 Cary Coutant <ccoutant@google.com>
658 * reduced_debug_output.cc
659 (Output_reduced_debug_info_section::get_die_end): Add new FORM
662 2012-02-29 Cary Coutant <ccoutant@google.com>
664 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
666 2012-02-29 Cary Coutant <ccoutant@google.com>
668 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
669 Call Object::decompressed_section_contents.
670 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
672 (Sized_dwarf_line_info::buffer_start_): New data member.
673 * merge.cc (Output_merge_data::do_add_input_section): Call
674 Object::decompressed_section_contents.
675 (Output_merge_string::do_add_input_section): Likewise.
676 * object.cc (need_decompressed_section): New function.
677 (build_compressed_section_map): Decompress sections needed later.
678 (Sized_relobj_file::do_decompressed_section_contents): New function.
679 (Sized_relobj_file::do_discard_decompressed_sections): New function.
680 * object.h (Object::decompressed_section_contents): New function.
681 (Object::discard_decompressed_sections): New function.
682 (Object::do_decompressed_section_contents): New function.
683 (Object::do_discard_decompressed_sections): New function.
684 (Compressed_section_info): New type.
685 (Compressed_section_map): Include decompressed section contents.
686 (Sized_relobj_file::do_decompressed_section_contents): New function.
687 (Sized_relobj_file::do_discard_decompressed_sections): New function.
689 2012-02-16 Cary Coutant <ccoutant@google.com>
691 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
692 * testsuite/Makefile.in: Regenerate.
694 2012-02-14 Cary Coutant <ccoutant@google.com>
696 * options.cc (General_options::finalize): Disallow -pie and -static.
698 2012-02-03 Doug Kwan <dougkwan@google.com>
700 * arm.cc (Arm_relocate_functions::abs8,
701 Arm_relocate_functions::abs16): Use
702 Bits::has_signed_unsigned_overflow32.
703 (Arm_relocate_functions::thm_abs8): Correct range of
705 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
708 2012-02-02 Doug Kwan <dougkwan@google.com>
710 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
711 position independent outputs, not just shared objects.
713 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
715 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
716 * configure: Regenerated.
718 2012-01-27 Ian Lance Taylor <iant@google.com>
720 * reloc.h (Bits): New class with static functions, copied from
721 namespace utils in arm.cc.
722 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
725 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
727 * incremental.cc (write_info_blocks): Correct relocation offset.
729 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
731 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
732 (Relocate::tls_gd_to_le): Likewise.
734 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
736 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
738 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
740 * configure.ac: Check if -mcmodel=medium works.
741 * configure: Regenerated.
743 2012-01-24 Cary Coutant <ccoutant@google.com>
745 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
747 (read_unsigned_LEB_128_x): ... this new function.
748 (read_signed_LEB_128): Replaced with inline definition and ...
749 (read_signed_LEB_128_x): ... this new function.
750 * int_encoding.h (read_unsigned_LEB_128_x): New function.
751 (read_unsigned_LEB_128): Add inline definition.
752 (read_signed_LEB_128_x): New function.
753 (read_signed_LEB_128): Add inline definition.
754 * testsuite/Makefile.am (leb128_unittest): New unit test.
755 * testsuite/Makefile.in: Regenerate.
756 * testsuite/leb128_unittest.cc: New unit test.
758 2012-01-23 Ian Lance Taylor <iant@google.com>
761 * i386.cc (Target_i386::do_code_fill): When using a jmp
762 instruction, pad with nop instructions.
763 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
765 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
767 * x86_64.cc (gc_process_relocs): Add typename on types used in
769 (scan_relocs): Likewise.
770 (relocate_section): Likewise.
771 (apply_relocation): Likewise.
773 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
775 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
776 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
779 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
781 * x86_64.cc: Initial support for x32.
783 2012-01-03 Cary Coutant <ccoutant@google.com>
785 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
786 Use abstract base class for GOT.
787 * gold/output.h (class Output_data_got_base): New abstract base class.
788 (class Output_data_got): Derive from new base class, adjust ctors.
789 (Output_data_got::reserve_slot): Make virtual; rename to
790 do_reserve_slot; Adjust callers.
791 * gold/target.h (Sized_target::init_got_plt_for_update): Return
792 pointer to abstract base class.
793 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
795 2011-12-18 Ian Lance Taylor <iant@google.com>
797 * object.h (Relobj::local_symbol_value): New function.
798 (Relobj::local_plt_offset): New function.
799 (Relobj::local_has_got_offset): New function.
800 (Relobj::local_got_offset): New function.
801 (Relobj::set_local_got_offset): New function.
802 (Relobj::do_local_symbol_value): New pure virtual function.
803 (Relobj::do_local_plt_offset): Likewise.
804 (Relobj::do_local_has_got_offset): Likewise.
805 (Relobj::do_local_got_offset): Likewise.
806 (Relobj::do_set_local_got_offset): Likewise.
807 (Sized_relobj::do_local_has_got_offset): Rename from
808 local_has_got_offset.
809 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
810 (Sized_relobj::do_set_local_got_offset): Rename from
811 set_local_got_offset.
812 (Sized_relobj_file::do_local_plt_offset): Rename from
814 (Sized_relobj_file::do_local_symbol_value): New function.
815 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
817 * output.cc (Output_data_got::Got_entry::write): Change object to
818 Relobj. Use local_symbol_value.
819 (Output_data_got::add_global_with_rel): Change rel_dyn to
820 Output_data_reloc_generic*. Use add_global_generic.
821 (Output_data_got::add_global_with_rela): Remove. Change all
822 callers to use add_global_with_rel.
823 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
824 Output_data_reloc_generic*. Use add_global_generic.
825 (Output_data_got::add_global_pair_with_rela): Remove. Change all
826 callers to use add_global_pair_with_rel.
827 (Output_data_got::add_local): Change object to Relobj*.
828 (Output_data_got::add_local_plt): Likewise.
829 (Output_data_got::add_local_with_rel): Change object to Relobj*,
830 change rel_dyn to Output_data_reloc_generic*. Use
832 (Output_data_got::add_local_with_rela): Remove. Change all
833 callers to use all_local_with_rel.
834 (Output_data_got::add_local_pair_with_rel): Change object to
835 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
836 add_output_section_generic.
837 (Output_data_got::add_local_pair_with_rela): Remove. Change all
838 callers to use add_local_pair_with_rel.
839 (Output_data_got::reserve_local): Change object to Relobj*.
840 * output.h: (class Output_data_reloc_generic): Add pure virtual
841 declarations for add_global_generic, add_local_generic,
842 add_output_section_generic.
843 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
844 functions for Output_data_reloc_generic. Update declarations for
845 changes listed in output.cc.
846 (class Output_data_got): Change template parameter to got_size.
847 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
848 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
850 (Sized_relobj_incr::do_local_plt_offset): New function.
851 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
854 2011-12-17 Cary Coutant <ccoutant@google.com>
856 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
857 * resolve.cc (Symbol_table::resolve): Likewise.
858 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
860 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
862 2011-12-16 Ian Lance Taylor <iant@google.com>
864 * output.h (Output_data_reloc_generic::add): Only call
865 add_dynamic_reloc if this is a dynamic reloc section.
867 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
870 * target-reloc.h (apply_relocation): Replace <64, false> with
873 2011-11-25 Nick Clifton <nickc@redhat.com>
875 * po/it.po: New Italian translation.
877 2011-11-17 Sterling Augustine <saugustine@google.com>
879 * script.cc (script_include_directive): Implement.
880 (read_script_file): New local variables name and search_path. Update
881 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
882 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
883 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
885 2011-11-11 Sterling Augustine <saugustine@google.com>
887 * yyscript.y (section_cmd): Add support for INCLUDE directive.
888 (file_or_sections_cmd): Likewise.
890 2011-11-11 Doug Kwan <dougkwan@google.com>
892 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
893 if --just-symbols is given.
895 2011-11-10 Doug Kwan <dougkwan@google.com>
898 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
899 when processing data relocs.
900 * reloc.h (Relocate_functions::rel_unaligned): New method.
901 (Relocate_functions::pcrel_unaligned): Ditto.
902 (Relocate_functions::rel32_unaligned): Ditto.
903 (Relocate_functions::pcrel32_unaligned): Ditto.
905 2011-11-09 Doug Kwan <dougkwan@google.com>
908 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
909 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
910 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
911 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
912 (Relocate_functions::rel_unaligned): New.
913 (Relocate_functions::rel32_unaligned): New.
914 * target-reloc.h (relocate_for_relocatable): Add code to handle
915 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
916 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
917 arm_unaligned_reloc_r): New targets.
918 * testsuite/Makefile.in: Regenerate.
919 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
922 2011-11-02 Ian Lance Taylor <iant@google.com>
924 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
926 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
927 * options.cc (General_options::finalize): Use library search path
928 from configure script if specified. If not native and no sysroot,
929 only search TOOLLIBDIR.
930 * options.h (Search_directory::Search_directory): Change name to
932 (General_options::add_to_library_path_with_sysroot): Change arg to
934 * configure, Makefile.in, config.in: Rebuild.
936 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
938 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
939 we are working around the ARM1176 Erratum.
940 * options.h (General_options::fix_arm1176): Add option.
941 * testsuite/Makefile.am: Add testcases, and keep current ones
943 * testsuite/Makefile.in: Regenerate.
944 * testsuite/arm_fix_1176.s: New file.
945 * testsuite/arm_fix_1176.sh: Likewise.
947 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
949 * arm.cc (Target_arm::Target_arm): Remove initialisation of
951 (Target_arm::may_use_blx): Remove method.
952 (Target_arm::set_may_use_blx): Likewise.
953 (Target_arm::may_use_v4t_interworking): New method.
954 (Target_arm::may_use_v5t_interworking): Likewise.
955 (Target_arm::may_use_blx_): Remove member variable.
956 (Arm_relocate_functions::arm_branch_common): Check for v5T
958 (Arm_relocate_functions::thumb_branch_common): Likewise.
959 (Reloc_stub::stub_type_for_reloc): Likewise.
960 (Target_arm::do_finalize_sections): Correct interworking checks.
961 * testsuite/Makefile.am: Add new tests.
962 * testsuite/Makefile.in: Regenerate.
963 * testsuite/arm_farcall_arm_arm.s: New test.
964 * testsuite/arm_farcall_arm_arm.sh: Likewise.
965 * testsuite/arm_farcall_arm_thumb.s: Likewise.
966 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
967 * testsuite/arm_farcall_thumb_arm.s: Likewise.
968 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
969 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
970 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
972 2011-10-31 Cary Coutant <ccoutant@google.com>
975 * expression.cc (Expression::eval_with_dot): Add
976 is_section_dot_assignment parameter.
977 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
978 absolute and assigning to dot within a section.
980 (Output_section_element_assignment::set_section_addresses): Pass
981 dot_section to set_if_absolute.
982 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
983 as is_section_dot_assignment flag to eval_with_dot.
984 (Output_section_element_dot_assignment::set_section_addresses):
986 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
987 parameter. Also set value if relative to dot_section; set the
988 symbol's output_section.
989 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
990 parameter. Adjust all callers.
991 (Expression::eval_maybe_dot): Likewise.
992 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
994 * testsuite/script_test_2.t: Test assignment of an absolute value
995 to dot within an output section element.
997 2011-10-31 Cary Coutant <ccoutant@google.com>
999 * options.h (class General_options): Add --[no-]gnu-unique options.
1000 * symtab.cc (Symbol_table::sized_write_globals): Convert
1001 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1003 2011-10-31 Cary Coutant <ccoutant@google.com>
1006 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1007 unnecessary assertion.
1008 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1010 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1012 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1014 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1016 Change to just keep the section associated with symbol.
1017 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1018 they are externally visible and --export-dynamic is turned on.
1019 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1021 2011-10-19 Ian Lance Taylor <iant@google.com>
1024 * script-sections.cc
1025 (Output_section_element_dot_assignment::needs_output_section): New
1028 2011-10-19 Ian Lance Taylor <iant@google.com>
1031 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1032 --section-start option was seen.
1033 * options.h (General_options::any_section_start): New function.
1035 2011-10-18 David S. Miller <davem@davemloft.net>
1038 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1039 member to track relocation locations that have moved during TLS
1040 reloc optimizations.
1041 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1042 (Target_sparc::Relocate::relocate): Adjust view down by 4
1043 bytes if it matches reloc_adjust_addr_.
1044 (Target_sparc::Relocate::relocate_tls): Always move the
1045 __tls_get_addr call delay slot instruction forward 4 bytes when
1046 performing relaxation.
1048 2011-10-18 Cary Coutant <ccoutant@google.com>
1050 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1051 (Output_file::map_no_anonymous): Check for non-zero
1052 return code from posix_fallocate.
1054 2011-10-17 Cary Coutant <ccoutant@google.com>
1057 * plugin.cc (is_visible_from_outside): Check for symbols
1058 referenced from dynamic objects.
1059 * resolve.cc (Symbol_table::resolve): Don't count references
1060 from dynamic objects as references from real ELF files.
1061 * testsuite/plugin_test_2.sh: Adjust expected result.
1063 2011-10-17 Cary Coutant <ccoutant@google.com>
1065 * gold.cc: Include timer.h.
1066 (queue_middle_tasks): Stamp time.
1067 (queue_final_tasks): Likewise.
1068 * main.cc (main): Store timer in parameters. Print timers
1070 * parameters.cc (Parameters::Parameters): Initialize timer_.
1071 (Parameters::set_timer): New function.
1072 (set_parameters_timer): New function.
1073 * parameters.h (Parameters::set_timer): New function.
1074 (Parameters::timer): New function.
1075 (Parameters::timer_): New data member.
1076 (set_parameters_timer): New function.
1077 * timer.cc (Timer::stamp): New function.
1078 (Timer::get_pass_time): New function.
1079 * timer.h (Timer::stamp): New function.
1080 (Timer::get_pass_time): New function.
1081 (Timer::pass_times_): New data member.
1083 2011-10-17 Cary Coutant <ccoutant@google.com>
1085 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1086 task for members of lib groups.
1088 2011-10-17 Cary Coutant <ccoutant@google.com>
1091 * fileread.cc (File_read::find_view): Add assert.
1092 (File_read::make_view): Move bounds check (replace with assert)...
1093 (File_read::find_or_make_view): ... to here.
1095 2011-10-12 Cary Coutant <ccoutant@google.com>
1097 * output.cc (Output_file::open_base_file): Handle case where
1098 ::read returns less than requested size.
1100 2011-10-10 Cary Coutant <ccoutant@google.com>
1102 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1103 Initialize defined_count_.
1104 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1105 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1106 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1107 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1108 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1109 * incremental.h (Sized_relobj_incr::defined_count_): New data
1111 (Sized_incr_dynobj::defined_count_): New data member.
1112 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1113 Return zeroes instead of internal error.
1115 2011-10-10 Cary Coutant <ccoutant@google.com>
1118 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1119 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1120 * output.h (class Output_reloc): Add use_plt_offset flag.
1121 (Output_reloc::type_): Adjust size of bit field.
1122 (Output_reloc::use_plt_offset_): New bit field.
1123 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1124 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1125 flag. Adjust all callers.
1126 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1127 creating RELATIVE relocations.
1129 2011-10-10 Nick Clifton <nickc@redhat.com>
1131 * po/es.po: Updated Spanish translation.
1132 * po/fi.po: Updated Finnish translation.
1134 2011-10-03 Diego Novillo <dnovillo@google.com>
1136 * options.cc (parse_uint): Fix dereference of RETVAL.
1138 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1140 * layout.h (section_order_map_): New member.
1141 (get_section_order_map): New member function.
1142 * output.cc (Output_section::add_input_section): Check for patterns
1143 only when --section-ordering-file is specified.
1144 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1145 output_sections have been formed.
1146 * layout.cc (Layout_Layout): Initialize section_order_map_.
1147 * plugin.cc (update_section_order): Store order in order_map. Do not
1149 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1150 * testsuite/Makefile.in: Regenerate.
1151 * testsuite/plugin_section_order.c: New file.
1152 * testsuite/plugin_final_layout.cc: New file.
1153 * testsuite/plugin_final_layout.sh: New file.
1155 2011-09-29 Cary Coutant <ccoutant@google.com>
1157 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1159 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1160 symbols during incremental update.
1161 (Symbol_table::add_from_dynobj): Likewise.
1163 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1164 Ian Lance Taylor <iant@google.com>
1166 * symtab.cc (Symbol_table::define_special_symbol): Always
1167 canonicalize version string.
1169 2011-09-26 Cary Coutant <ccoutant@google.com>
1171 * gold.cc (queue_initial_tasks): Move option checks ...
1172 * options.cc (General_options::finalize): ... to here. Disable
1173 some options; make others fatal.
1175 2011-09-26 Cary Coutant <ccoutant@google.com>
1178 * plugin.cc (get_symbols_v2): New function.
1179 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1180 (is_referenced_from_outside): New function.
1181 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1182 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1183 (get_symbols): Pass version parameter.
1184 (get_symbols_v2): New function.
1185 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1187 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1188 (onload): Add LDPT_GET_SYMBOLS_V2.
1189 (all_symbols_read_hook): Use get_symbols_v2; check for
1190 LDPR_PREVAILING_DEF_IRONLY_EXP.
1191 * testsuite/plugin_test_3.sh: Update expected results.
1193 2011-09-23 Simon Baldwin <simonb@google.com>
1195 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1196 configuration options.
1197 * configure: Regenerate.
1198 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1199 * Makefile.in: Regenerate.
1200 * testsuite/Makefile.in: Regenerate.
1202 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1204 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1206 2011-09-19 Cary Coutant <ccoutant@google.com>
1208 * incremental.cc (can_incremental_update): Fix typo in comment.
1209 * incremental.h (can_incremental_update): Likewise.
1211 2011-09-18 Cary Coutant <ccoutant@google.com>
1213 * incremental.cc (can_incremental_update): New function.
1214 * incremental.h (can_incremental_update): New function.
1215 * layout.cc (Layout::init_fixed_output_section): Call it.
1216 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1217 * object.cc (Sized_relobj_file::do_layout): Call
1218 can_incremental_update.
1220 2011-09-13 Cary Coutant <ccoutant@google.com>
1222 * configure.ac: Check for glibc support for gnu_indirect_function
1223 support with static linking, setting automake conditional
1225 * Makefile.in: Regenerate.
1226 * configure: Regenerate.
1228 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1229 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1231 * testsuite/Makefile.in: Regenerate.
1233 2011-09-13 Cary Coutant <ccoutant@google.com>
1235 * incremental.cc (Sized_relobj_incr::do_layout): Call
1236 report_comdat_group for kept comdat sections.
1237 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1238 * testsuite/Makefile.in: Regenerate.
1239 * testsuite/incr_comdat_test_1.cc: New source file.
1240 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1241 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1242 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1244 2011-09-13 Ian Lance Taylor <iant@google.com>
1246 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1247 variable external_symbols_offset.
1249 2011-09-12 Ian Lance Taylor <iant@google.com>
1251 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1252 triggered if object has no symbols.
1254 2011-09-09 David S. Miller <davem@davemloft.net>
1256 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1257 (Output_fill_debug_line::do_write): Likewise.
1259 2011-08-29 Cary Coutant <ccoutant@google.com>
1261 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1262 casts to match formatting specs.
1263 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1265 2011-08-26 Cary Coutant <ccoutant@google.com>
1267 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1268 remaining hole size when allocating.
1269 (Layout::make_output_section): Set fill methods for debug sections.
1270 * layout.h (Free_list::Free_list_node): Move from private to
1272 (Free_list::set_min_hole_size): New function.
1273 (Free_list::begin, Free_list::end): New functions.
1274 (Free_list::min_hole_): New data member.
1275 * output.cc: Include dwarf.h.
1276 (Output_fill_debug_info::do_minimum_hole_size): New function.
1277 (Output_fill_debug_info::do_write): New function.
1278 (Output_fill_debug_line::do_minimum_hole_size): New function.
1279 (Output_fill_debug_line::do_write): New function.
1280 (Output_section::Output_section): Initialize new data member.
1281 (Output_section::set_final_data_size): Ensure patch space is larger
1282 than minimum hole size.
1283 (Output_section::do_write): Fill holes in debug sections.
1284 * output.h (Output_fill): New class.
1285 (Output_fill_debug_info): New class.
1286 (Output_fill_debug_line): New class.
1287 (Output_section::set_free_space_fill): New function.
1288 (Output_section::free_space_fill_): New data member.
1289 * testsuite/Makefile.am (incremental_test_3): Add
1290 --incremental-patch option.
1291 (incremental_test_4): Likewise.
1292 (incremental_test_5): Likewise.
1293 (incremental_test_6): Likewise.
1294 (incremental_copy_test): Likewise.
1295 (incremental_common_test_1): Likewise.
1296 * testsuite/Makefile.in: Regenerate.
1298 2011-08-26 Nick Clifton <nickc@redhat.com>
1300 * po/es.po: Updated Spanish translation.
1302 2011-08-01 Cary Coutant <ccoutant@google.com>
1304 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1305 * gold/testsuite/Makefile.in: Regenerate.
1306 * gold/testsuite/justsyms_exec.c: New source file.
1307 * gold/testsuite/justsyms_lib.c: New source file.
1309 2011-08-01 Cary Coutant <ccoutant@google.com>
1311 * layout.cc (Layout::set_segment_offsets): Don't realign text
1312 segment if -Ttext was specified.
1313 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1315 * object.h (Sized_relobj_file::e_type): New function.
1316 (Sized_relobj_file::e_type_): New data member.
1317 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1318 base address for ET_EXEC files.
1319 * target.cc (Target::do_make_elf_object_implementation): Allow
1320 ET_EXEC files with --just-symbols option.
1322 2011-07-28 Cary Coutant <ccoutant@google.com>
1324 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1325 Add thread_number parameter.
1326 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1327 * workqueue-threads.cc
1328 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1329 current thread if its thread number is greater than desired thread
1331 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1332 Add thread_number parameter.
1333 (Workqueue::should_cancel_thread): Likewise.
1334 (Workqueue::find_runnable_or_wait): Pass thread_number to
1335 should_cancel_thread.
1336 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1339 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1341 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1342 only after checking if it cannot be forced local.
1343 * symtab.h (is_externally_visible): Check if the symbol is not forced
1346 2011-07-15 Ian Lance Taylor <iant@google.com>
1348 * options.h (class General_options): Add --print-output-format.
1349 Move -EL next to -EB, for better --help output.
1350 * target-select.cc: Include <cstdio>, "options.h", and
1352 (Target_selector::do_target_bfd_name): New function.
1353 (print_output_format): New function.
1354 * target-select.h (class Target_selector): Update declarations.
1355 (Target_selector::target_bfd_name): New function.
1356 (print_output_format): Declare.
1357 * main.cc: Include "target-select.h".
1358 (main): Handle --print-output-format.
1359 * gold.cc: Include "target-select.h".
1360 (queue_initial_tasks): Handle --print-output-format when there are
1362 * parameters.cc (parameters_force_valid_target): Give a better
1363 error message if -EB/-EL does not match target.
1364 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1367 2011-07-15 Ian Lance Taylor <iant@google.com>
1369 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1370 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1371 (Output_data_plt_i386::do_write): Write address of .dynamic
1372 section to first entry in .got.plt section.
1373 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1374 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1376 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1377 section to first entry in .got.plt section.
1378 * layout.h (Layout::dynamic_section): New function.
1380 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1382 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1384 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1385 input_section_position_, and input_section_glob_.
1386 (read_layout_from_file): Call function section_ordering_specified.
1387 * layout.h (is_section_ordering_specified): New function.
1388 (section_ordering_specified): New function.
1389 (section_ordering_specified_): New boolean member.
1390 * main.cc(main): Call load_plugins after layout object is defined.
1391 * output.cc (Output_section::add_input_section): Use
1392 function section_ordering_specified to check if section ordering is
1394 * output.cc (Output_section::add_relaxed_input_section): Use
1395 function section_ordering_specified to check if section ordering is
1397 (Output_section::update_section_layout): New function.
1398 (Output_section::sort_attached_input_sections): Check if input section
1400 * output.h (Output_section::update_section_layout): New function.
1401 * plugin.cc (get_section_count): New function.
1402 (get_section_type): New function.
1403 (get_section_name): New function.
1404 (get_section_contents): New function.
1405 (update_section_order): New function.
1406 (allow_section_ordering): New function.
1407 (Plugin::load): Add the new interfaces to the transfer vector.
1408 (Plugin_manager::load_plugins): New parameter.
1409 (Plugin_manager::all_symbols_read): New parameter.
1410 (Plugin_manager::claim_file): New parameter. Save the elf object for
1412 (Plugin_manager::get_elf_object): New function.
1413 (Plugin_manager::get_view): Change to directly use the bool to check
1414 if get_view is called from claim_file_hook.
1415 * plugin.h (input_objects): New function
1416 (Plugin__manager::load_plugins): New parameter.
1417 (Plugin_manager::claim_file): New parameter.
1418 (Plugin_manager::get_elf_object): New function.
1419 (Plugin_manager::in_claim_file_handler): New function.
1420 (Plugin_manager::in_claim_file_handler_): New member.
1421 (layout): New function.
1422 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1423 handler with an extra parameter. Make the elf object before calling
1425 * testsuite/plugin_test.c (get_section_count): New function pointer.
1426 (get_section_type): New function pointer.
1427 (get_section_name): New function pointer.
1428 (get_section_contents): New function pointer.
1429 (update_section_order): New function pointer.
1430 (allow_section_ordering): New function pointer.
1431 (onload): Check if the new interfaces exist.
1433 2011-07-13 Ian Lance Taylor <iant@google.com>
1435 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1437 * x86_64.cc (Target_x86_64::got_section): Likewise.
1438 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1439 (relro_now_test_SOURCES): New variable.
1440 (relro_now_test_DEPENDENCIES): New variable.
1441 (relro_now_test_LDFLAGS): New variable.
1442 (relro_now_test_LDADD): New variable.
1443 (relro_now_test.so): New target.
1444 * testsuite/Makefile.in: Rebuild.
1446 2011-07-12 Ian Lance Taylor <iant@google.com>
1449 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1450 GLOB_DAT relocation rather than a RELATIVE relocation for a
1451 protected symbol when creating a shared library.
1452 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1453 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1454 * testsuite/protected_main_1.cc (main): Test that protected
1455 function has same address.
1457 2011-07-11 Ian Lance Taylor <iant@google.com>
1460 * options.h (class General_options): Add -Bgroup.
1461 * options.cc (General_options::finalize): If -Bgroup is set,
1462 default to --unresolved-symbols=report-all.
1463 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1464 * target-reloc.h (issue_undefined_symbol_error): Handle
1465 --unresolved-symbols=report-all.
1467 2011-07-08 Ian Lance Taylor <iant@google.com>
1470 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1471 if linker script discards key sections.
1472 (Layout::create_dynamic_symtab): Likewise.
1473 (Layout::assign_local_dynsym_offsets): Likewise.
1474 (Layout::sized_create_version_sections): Likewise.
1475 (Layout::create_interp): Likewise.
1476 (Layout::finish_dynamic_section): Likewise.
1477 (Layout::set_dynamic_symbol_size): Likewise.
1479 2011-07-08 Ian Lance Taylor <iant@google.com>
1482 * options.h (class General_options): Add --unresolved-symbols.
1483 * target-reloc.h (issue_undefined_symbol_error): Check
1484 --unresolved-symbols. Add comments.
1486 2011-07-08 Ian Lance Taylor <iant@google.com>
1488 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1489 expression more complex.
1491 2011-07-08 Ian Lance Taylor <iant@google.com>
1494 * target-reloc.h (issue_undefined_symbol_error): New inline
1495 function, broken out of relocate_section.
1496 (relocate_section): Call issue_undefined_symbol_error.
1497 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1498 there is no TLS segment if we are about to issue an undefined
1500 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1502 2011-07-08 Ian Lance Taylor <iant@google.com>
1505 * resolve.cc (Symbol_table::should_override): Add fromtype
1506 parameter. Change all callers. Give error when linking together
1507 TLS and non-TLS symbol.
1508 (Symbol_table::should_override_with_special): Add fromtype
1509 parameter. Change all callers.
1510 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1511 there is no TLS segment if we have reported some errors.
1512 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1514 2011-07-08 Ian Lance Taylor <iant@google.com>
1517 * target.h (Target::plt_address_for_global): New function.
1518 (Target::plt_address_for_local): New function.
1519 (Target::plt_section_for_global): Remove.
1520 (Target::plt_section_for_local): Remove.
1521 (Target::do_plt_address_for_global): New virtual function.
1522 (Target::do_plt_address_for_local): New virtual function.
1523 (Target::do_plt_section_for_global): Remove.
1524 (Target::do_plt_section_for_local): Remove.
1525 (Target::register_global_plt_entry): Add Symbol_table and Layout
1527 * output.cc (Output_data_got::Got_entry::write): Use
1528 plt_address_for_global and plt_address_for_local.
1529 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1530 address of output section.
1531 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1532 got_irelative_, and irelative_count_ fields. Update
1534 (Output_data_plt_i386::has_irelative_section): New function.
1535 (Output_data_plt_i386::entry_count): Add irelative_count_.
1536 (Output_data_plt_i386::set_final_data_size): Likewise.
1537 (class Target_i386): Add got_irelative_ and rel_irelative_
1538 fields. Update declarations.
1539 (Target_i386::Target_i386): Initialize new fields.
1540 (Target_i386::do_plt_address_for_global): New function replacing
1541 do_plt_section_for_global.
1542 (Target_i386::do_plt_address_for_local): New function replacing
1543 do_plt_section_for_local.
1544 (Target_i386::got_section): Create got_irelative_.
1545 (Target_i386::rel_irelative_section): New function.
1546 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1547 fields. Don't define __rel_iplt_{start,end}.
1548 (Output_data_plt_i386::add_entry): Add symtab and layout
1549 parameters. Change all callers. Use different PLT and GOT for
1551 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1552 layout parameters. Change all callers. Use different PLT and
1554 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1555 (Output_data_plt_i386::rel_irelative): New function.
1556 (Output_data_plt_i386::address_for_global): New function.
1557 (Output_data_plt_i386::address_for_local): New function.
1558 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1559 IRELATIVE GOT when changing IFUNC GOT entries.
1560 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1562 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1563 if we didn't create an IRELATIVE GOT.
1564 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1565 plt_address_for_local.
1566 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1567 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1568 got_irelative_, and irelative_count_ fields. Update
1570 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1571 Initialize new fields. Remove symtab parameter. Change all
1573 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1575 (Output_data_plt_x86_64::has_irelative_section): New function.
1576 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1577 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1578 fields. Update declarations.
1579 (Target_x86_64::Target_x86_64): Initialize new fields.
1580 (Target_x86_64::do_plt_address_for_global): New function replacing
1581 do_plt_section_for_global.
1582 (Target_x86_64::do_plt_address_for_local): New function replacing
1583 do_plt_section_for_local.
1584 (Target_x86_64::got_section): Create got_irelative_.
1585 (Target_x86_64::rela_irelative_section): New function.
1586 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1587 all callers. Don't create __rel_iplt_{start,end}.
1588 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1589 parameters. Change all callers. Use different PLT and GOT for
1591 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1592 layout parameters. Change all callers. Use different PLT and
1594 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1595 parameters. Change all callers. Use different PLT and GOT for
1597 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1598 (Output_data_plt_x86_64::rela_irelative): New function.
1599 (Output_data_plt_x86_64::address_for_global): New function.
1600 (Output_data_plt_x86_64::address_for_local): New function.
1601 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1602 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1603 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1604 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1606 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1608 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1609 symbols if we didn't create an IRELATIVE GOT.
1610 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1611 plt_address_for_local.
1612 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1613 * testsuite/ifuncvar1.c: New test file.
1614 * testsuite/ifuncvar2.c: New test file.
1615 * testsuite/ifuncvar3.c: New test file.
1616 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1617 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1618 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1619 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1620 * testsuite/Makefile.in: Rebuild.
1622 2011-07-07 Cary Coutant <ccoutant@google.com>
1624 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1625 (two_file_test_1_ndebug.o): Likewise.
1626 (two_file_test_1b_ndebug.o): Likewise.
1627 (two_file_test_2_ndebug.o): Likewise.
1628 (two_file_test_main_ndebug.o): Likewise.
1629 (incremental_test_2): Link with no-debug versions.
1631 2011-07-06 Cary Coutant <ccoutant@google.com>
1633 * gold/incremental.cc
1634 (Output_section_incremental_inputs::write_info_blocks): Check for
1635 hidden and internal symbols.
1637 2011-07-06 Cary Coutant <ccoutant@google.com>
1639 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1640 Check disposition for startup file.
1641 (Incremental_inputs::report_command_line): Ignore
1642 --incremental-startup-unchanged option.
1643 * options.cc (General_options::parse_incremental_startup_unchanged):
1645 (General_options::General_options): Initialize new data member.
1646 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1647 (General_options): Add --incremental-startup-unchanged option.
1648 (General_options::incremental_startup_disposition): New function.
1649 (General_options::incremental_startup_disposition_): New data member.
1651 2011-07-06 Cary Coutant <ccoutant@google.com>
1653 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1654 input file index to Script_info ctor.
1655 (Sized_incremental_binary::do_file_has_changed): Find the
1656 command-line argument for files named in scripts.
1657 * incremental.h (Script_info::Script_info): New ctor
1658 with input file index.
1659 (Script_info::input_file_index): New function.
1660 (Script_info::input_file_index_): New data member.
1661 (Incremental_binary::get_library): Add const.
1662 (Incremental_binary::get_script_info): Add const.
1663 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1664 * testsuite/Makefile.am (incremental_test_5): New test case.
1665 (incremental_test_6): New test case.
1666 * testsuite/Makefile.in: Regenerate.
1668 2011-07-06 Cary Coutant <ccoutant@google.com>
1670 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1671 debug output when command lines differ.
1673 2011-07-06 Cary Coutant <ccoutant@google.com>
1675 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1676 --incremental-patch option.
1677 * layout.cc (Free_list::allocate): Extend allocation beyond original
1679 (Layout::make_output_section): Mark sections that should get
1681 * options.cc (parse_percent): New function.
1682 * options.h (parse_percent): New function.
1683 (DEFINE_percent): New macro.
1684 (General_options): Add --incremental-patch option.
1685 * output.cc (Output_section::Output_section): Initialize new data
1687 (Output_section::add_input_section): Print section name when out
1689 (Output_section::add_output_section_data): Likewise.
1690 (Output_section::set_final_data_size): Add patch space when
1691 doing --incremental-full.
1692 (Output_section::do_reset_address_and_file_offset): Remove patch
1694 (Output_segment::set_section_list_addresses): Print debug output
1695 only if --incremental-update.
1696 * output.h (Output_section::set_is_patch_space_allowed): New function.
1697 (Output_section::is_patch_space_allowed_): New data member.
1698 (Output_section::patch_space_): New data member.
1699 * parameters.cc (Parameters::incremental_full): New function.
1700 * parameters.h (Parameters::incremental_full): New function
1701 * testsuite/Makefile.am (incremental_test_2): Add test for
1702 --incremental-patch option.
1703 * testsuite/Makefile.in: Regenerate.
1704 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1705 (t18): Remove function body.
1707 2011-07-05 Doug Kwan <dougkwan@google.com>
1710 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1711 Arm_Address type for relocation result.
1712 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1714 (Arm_relocate_functions::abs32): Use unaligned access.
1715 (Arm_relocate_functions::rel32): Ditto.
1716 (Arm_relocate_functions::prel31): Ditto.
1717 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1718 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1719 static data relocations.
1720 * testsuite/Makefile.in: Regnerate.
1721 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1723 2011-07-05 Ian Lance Taylor <iant@google.com>
1726 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1727 symbols if necessary.
1728 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1730 2011-07-05 Ian Lance Taylor <iant@google.com>
1733 * resolve.cc (Symbol::override_base_with_special): Simply override
1734 version with special symbol version, ignoring previous version.
1736 2011-07-05 Ian Lance Taylor <iant@google.com>
1738 * object.cc (Sized_relobj_file::include_section_group): Add
1739 information to comment about signature location.
1741 2011-07-02 Ian Lance Taylor <iant@google.com>
1744 * options.h (class General_options): Add -f and -F.
1745 * options.cc (General_options::finalize): Fatal error if -f/-F
1746 are used without -shared.
1747 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1749 2011-07-02 Ian Lance Taylor <iant@google.com>
1751 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1753 2011-07-01 Ian Lance Taylor <iant@google.com>
1757 * resolve.cc (Symbol::override_base_with_special): Don't override
1758 the version if the overriding symbol has a different name.
1759 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1760 all callers. If we give an error about an undefined version,
1761 define the base version if necessary.
1762 * dynobj.h (class Versions): Update declaration.
1763 * testsuite/weak_alias_test_5.cc: New file.
1764 * testsuite/weak_alias_test.script: New file.
1765 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1766 and versioned_alias have the right value, and call t2.
1767 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1768 weak_alias_test_5.so.
1769 (weak_alias_test_LDADD): Likewise.
1770 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1771 * testsuite/Makefile.in: Rebuild.
1773 2011-07-01 Ian Lance Taylor <iant@google.com>
1776 * options.h (class General_options): Support -z notext.
1777 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1779 (two_file_shared_nonpic.so): Likewise.
1780 (two_file_shared_mixed.so): Likewise.
1781 (two_file_shared_mixed_1.so): Likewise.
1782 (weak_undef_lib_nonpic.so): Likewise.
1783 (alt/weak_undef_lib_nonpic.so): Likewise.
1784 (tls_test_shared_nonpic.so): Likewise.
1785 * testsuite/Makefile.in: Rebuild.
1787 2011-07-01 Ian Lance Taylor <iant@google.com>
1790 * configure.ac: Test whether static linking works, setting
1791 the automake conditional HAVE_STATIC.
1792 * testsuite/Makefile.am: Disable tests using -static if
1793 HAVE_STATIC is not true.
1794 * configure, testsuite/Makefile.in: Rebuild.
1796 2011-07-01 Ian Lance Taylor <iant@google.com>
1799 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1800 Assert if we see DW_EH_PE_indirect.
1801 * target.h (Target::ehframe_datarel_base): New function.
1802 (Target::do_ehframe_datarel_base): New target function.
1803 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1804 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1807 2011-07-01 Ian Lance Taylor <iant@google.com>
1810 * options.h (class General_options): Add
1811 --ld-generated-unwind-info.
1812 * ehframe.cc (Fde::write): Add address parameter. Change all
1813 callers. If associated with PLT, fill in address and size.
1814 (Cie::set_output_offset): Only add merge mapping if there is an
1816 (Cie::write): Add address parameter. Change all callers.
1817 (Eh_frame::add_ehframe_for_plt): New function.
1818 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1819 input_offset_ fields into union u_, with new plt field.
1820 (Fde::Fde): Adjust for new union field.
1821 (Fde::Fde) [Output_data version]: New constructor.
1822 (Fde::add_mapping): Only add merge mapping if there is an object.
1823 (class Cie): Update declarations.
1824 (class Eh_frame): Declare add_ehframe_for_plt.
1825 * layout.cc (Layout::layout_eh_frame): Break out code into
1826 make_eh_frame_section, and call it.
1827 (Layout::make_eh_frame_section): New function.
1828 (Layout::add_eh_frame_for_plt): New function.
1829 * layout.h (class Layout): Update declarations.
1830 * merge.cc (Merge_map::add_mapping): Add assertion.
1831 * i386.cc: Include "dwarf.h".
1832 (class Output_data_plt_i386): Make first_plt_entry,
1833 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1834 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1835 and plt_eh_frame_fde.
1836 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1837 boundary. Call add_eh_frame_for_plt if appropriate.
1838 * x86_64.cc: Include "dwarf.h".
1839 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1840 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1841 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1842 and plt_eh_frame_fde.
1843 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1846 2011-06-29 Ian Lance Taylor <iant@google.com>
1849 * object.cc (Sized_relobj_file::layout_section): Change shdr
1850 parameter to be const.
1851 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1853 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1854 appropriate. Call layout_eh_frame_section.
1855 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1857 * object.h (class Sized_relobj_file): Update declarations.
1859 2011-06-29 Ian Lance Taylor <iant@google.com>
1862 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1864 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1866 2011-06-29 Ian Lance Taylor <iant@google.com>
1869 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1871 * layout.cc (Layout::layout_eh_frame): Likewise.
1873 2011-06-29 Ian Lance Taylor <iant@google.com>
1876 * layout.cc (Layout::symtab_section_shndx): New function.
1877 * layout.h (class Layout): Declare symtab_section_shndx.
1878 * output.cc (Output_section::write_header): Call it.
1880 2011-06-29 Ian Lance Taylor <iant@google.com>
1883 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1884 symbols which are not used in a relocation.
1886 2011-06-28 Ian Lance Taylor <iant@google.com>
1889 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1890 script create indistinguishable segments.
1891 (Layout::set_segment_offsets): Use stable_sort when sorting
1892 segments. Pass this to Compare_segments constructor.
1893 * layout.h (class Layout): Make segment_precedes non-static.
1894 (class Compare_segments): Change from struct to class. Add
1895 layout_ field. Add constructor.
1896 * script-sections.cc
1897 (Script_sections::attach_sections_using_phdrs_clause): Rename
1898 local orphan to is_orphan. Don't report failure to put empty
1899 section in segment. On attachment failure, report name of
1900 section, and attach to first PT_LOAD segment.
1902 2011-06-28 Ian Lance Taylor <iant@google.com>
1905 * target-select.cc (Target_selector::Target_selector): Add
1906 emulation parameter. Change all callers.
1907 (select_target_by_bfd_name): Rename from select_target_by_name.
1909 (select_target_by_emulation): New function.
1910 (supported_emulation_names): New function.
1911 * target-select.h (class Target_selector): Add emulation_ field.
1912 Update declarations.
1913 (Target_selector::recognize_by_bfd_name): Rename from
1914 recognize_by_name. Change all callers.
1915 (Target_selector::supported_bfd_names): Rename from
1916 supported_names. Change all callers.
1917 (Target_selector::recognize_by_emulation): New function.
1918 (Target_selector::supported_emulations): New function.
1919 (Target_selector::emulation): New function.
1920 (Target_selector::do_recognize_by_bfd_name): Rename from
1921 do_recognize_by_name. Change all callers.
1922 (Target_selector::do_supported_bfd_names): Rename from
1923 do_supported_names. Change all callers.
1924 (Target_selector::do_recognize_by_emulation): New function.
1925 (Target_selector::do_supported_emulations): New function.
1926 (select_target_by_bfd_name): Change name in declaration.
1927 (select_target_by_emulation): Declare.
1928 (supported_emulation_names): Declare.
1929 * parameters.cc (parameters_force_valid_target): Try to find
1930 target based on emulation from -m option.
1931 * options.h (class General_options): Change doc string for -m.
1932 * options.cc (help): Print emulations.
1933 (General_options::parse_V): Likewise.
1934 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1935 Add emulation parameter. Change all callers.
1937 2011-06-28 Ian Lance Taylor <iant@google.com>
1939 * target.h (class Target): Add osabi_ field.
1940 (Target::osabi): New function.
1941 (Target::set_osabi): New function.
1942 (Target::Target): Initialize osabi_.
1943 (Target::do_adjust_elf_header): Make pure virtual.
1944 (Sized_target::do_adjust_elf_header): Declare.
1945 * target.cc (Sized_target::do_adjust_elf_header): New function.
1946 (class Sized_target): Instantiate all versions.
1947 * freebsd.h (class Target_freebsd): Remove.
1948 (Target_selector_freebsd::do_recognize): Call set_osabi on
1950 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1951 (Target_selector_freebsd::set_osabi): Remove.
1952 * i386.cc (class Target_i386): Inherit from Sized_target rather
1953 than Target_freebsd.
1954 * x86_64.cc (class Target_x86_64): Likewise.
1956 2011-06-28 Ian Lance Taylor <iant@google.com>
1958 * target.h (Target::can_check_for_function_pointers): Rewrite.
1960 (Target::can_icf_inline_merge_sections): Likewise.
1961 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1962 (Target::Target_info): Add can_icf_inline_merge_sections field.
1963 (Target::do_can_check_for_function_pointers): New virtual
1965 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1966 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1967 from can_check_for_function_pointers, move in file.
1968 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1969 section_may_have_icf_unsafe_poineters, move in file.
1970 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1971 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1972 Rename from can_check_for_function_pointers, move in file.
1973 (Target_i386::can_icf_inline_merge_sections): Remove.
1974 (Target_i386::i386_info): Initialize
1975 can_icf_inline_merge_sections.
1976 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1977 Initialize can_icf_inline_merge_sections.
1978 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1979 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1980 Rename from can_check_for_function_pointers, move in file.
1981 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1982 (Target_x86_64::x86_64_info): Initialize
1983 can_icf_inline_merge_sections.
1984 * testsuite/testfile.cc (Target_test::test_target_info):
1986 * icf.cc (get_section_contents): Correct formatting.
1988 2011-06-27 Ian Lance Taylor <iant@google.com>
1990 * symtab.cc (Symbol::versioned_name): New function.
1991 (Symbol_table::add_to_final_symtab): Use versioned_name when
1993 (Symbol_table::sized_write_symbol): Likewise.
1994 * symtab.h (class Symbol): Declare versioned_name.
1995 * stringpool.h (class Stringpool_template): Add variant of add
1996 which takes a std::basic_string.
1997 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1998 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1999 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2000 (ver_test_12.o): New target.
2001 * testsuite/Makefile.in: Rebuild.
2003 2011-06-27 Doug Kwan <dougkwan@google.com>
2005 * arm.cc (Arm_relocate_functions::thm_jump8,
2006 Arm_relocate_functions::thm_jump11): Use a wider signed
2007 type to compute offset.
2008 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2010 * testsuite/Makefile.in: Regenerate.
2011 * testsuite/arm_branch_in_range.sh: Check test results of
2012 arm_thm_jump11 and arm_thm_jump8.
2013 * testsuite/arm_thm_jump11.s: New test source file.
2014 * testsuite/arm_thm_jump11.t: New linker script.
2015 * testsuite/arm_thm_jump8.s: New test source file.
2016 * testsuite/arm_thm_jump8.t: New linker script.
2018 2011-06-24 Ian Lance Taylor <iant@google.com>
2020 * layout.cc: Include "object.h".
2021 (ctors_sections_in_init_array): New static variable.
2022 (Layout::is_ctors_in_init_array): New function.
2023 (Layout::layout): Add entry to ctors_sections_in_init_array if
2025 * layout.h (class Layout): Declare is_ctors_in_init_array.
2026 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2027 is_ctors_reverse_view is set.
2028 (Sized_relobj_file::write_sections): Add layout parameter. Change
2029 all callers. Set is_ctors_reverse_view field of View_size.
2030 (Sized_relobj_file::reverse_words): New function.
2031 * object.h (Sized_relobj_file::View_size): Add
2032 is_ctors_reverse_view field.
2033 (class Sized_relobj_file): Update declarations.
2034 * testsuite/initpri3.c: New test.
2035 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2037 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2038 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2039 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2040 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2041 * testsuite/Makefile.in: Rebuild.
2043 2011-06-24 Cary Coutant <ccoutant@google.com>
2045 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2046 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2047 (debug_msg_cdebug.err): New targets.
2048 * testsuite/Makefile.in: Regenerate.
2049 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2050 Fix checks for link with shared library.
2052 2011-06-24 Doug Kwan <dougkwan@google.com>
2054 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2055 skip empty text sections.
2056 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2058 2011-06-22 Ian Lance Taylor <iant@google.com>
2061 * options.h (class General_options): Add --ctors-in-init-array.
2062 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2063 friends as SHT_PROGBITS for merging sections.
2064 (Layout::layout): Remove special handling of .init_array and
2065 friends. Don't sort if doing relocatable link. Sort for .ctors
2066 and .dtors if ctors_in_init_array.
2067 (Layout::make_output_section): Force correct section types for
2068 .init_array and friends. Don't sort if doing relocatable link,
2069 Don't sort .ctors and .dtors if ctors_in_init_array.
2070 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2071 (Layout::output_section_name): Add relobj parameter. Change all
2072 callers. Handle .ctors. and .dtors. in code rather than table.
2073 Handle .ctors and .dtors if ctors_in_init_array.
2074 (Layout::match_file_name): New function, moved from output.cc.
2075 * layout.h (class Layout): Update declarations.
2076 * output.cc: Include "layout.h".
2077 (Input_section_sort_entry::get_priority): New function.
2078 (Input_section_sort_entry::match_file_name): Just call
2079 Layout::match_file_name.
2080 (Output_section::Input_section_sort_init_fini_compare::operator()):
2081 Handle .ctors and .dtors. Sort by explicit priority rather than
2083 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2084 * testsuite/initpri2.c: New test.
2085 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2086 (check_PROGRAMS): Add initpri2.
2087 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2088 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2089 * configure, testsuite/Makefile.in: Rebuild.
2091 2011-06-19 Ian Lance Taylor <iant@google.com>
2094 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2095 .interp section to a PT_INTERP segment even if we have seen a
2096 --dynamic-linker option. Don't do it if we have seen a PHDRS
2097 clause in a linker script.
2098 (Layout::finalize): Don't create a .interp section if we've
2099 already create a PT_INTERP segment.
2100 (Layout::create_interp): Always call choose_output_section (revert
2101 patch of 2011-06-17). Don't create PT_INTERP segment.
2102 * script-sections.cc
2103 (Script_sections::create_note_and_tls_segments): Add a .interp
2104 section to a PT_INTERP segment even if we have seen a
2105 --dynamic-linker option.
2107 2011-06-18 Ian Lance Taylor <iant@google.com>
2109 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2110 merely because a non-PT_LOAD segment has a dynamic reloc.
2112 2011-06-18 Ian Lance Taylor <iant@google.com>
2114 * layout.cc (Layout::finish_dynamic_section): Don't create
2115 DT_FLAGS entry if not needed.
2117 2011-06-18 Ian Lance Taylor <iant@google.com>
2120 * layout.cc (Layout::layout_eh_frame): Correct handling of
2121 writable .eh_frame section.
2123 2011-06-17 Ian Lance Taylor <iant@google.com>
2126 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2127 symbol is redefined with the exact same object and value.
2129 2011-06-17 Ian Lance Taylor <iant@google.com>
2132 * layout.h (class Layout): Add interp_segment_ field.
2133 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2134 (Layout::attach_allocated_section_to_segment): If making shared
2135 library, put .interp section in PT_INTERP segment.
2136 (Layout::finalize): Also call create_interp if -dynamic-linker
2138 (Layout::create_interp): Assert that there is no PT_INTERP
2139 segment. If not using a SECTIONS clause, use make_output_section.
2140 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2141 * script-sections.cc
2142 (Script_sections::create_note_and_tls_segments): If making shared
2143 library, put .interp section in PT_INTERP segment.
2145 2011-06-17 Ian Lance Taylor <iant@google.com>
2147 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2148 when making a shared library.
2150 2011-06-17 Ian Lance Taylor <iant@google.com>
2152 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2153 parameter. Change all callers. Don't issue warning about PC32
2154 against locally defined symbol.
2156 2011-06-16 Ian Lance Taylor <iant@google.com>
2158 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2159 occurs in same object.
2161 2011-06-14 Alan Modra <amodra@gmail.com>
2163 * po/POTFILES.in: Regenerate.
2165 2011-06-09 Ian Lance Taylor <iant@google.com>
2167 * script-sections.cc
2168 (Orphan_output_section::set_section_addresses): For a relocatable
2169 link set address to 0.
2171 2011-06-09 Cary Coutant <ccoutant@google.com>
2174 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2175 used with --compress-debug-sections.
2176 * gold/object.cc (Sized_relobj_file::do_layout): Report
2177 uncompressed size of compressed input sections.
2179 2011-06-08 Cary Coutant <ccoutant@google.com>
2182 * testsuite/two_file_test_2_v1.cc: Change initialization of
2183 v2 to keep it in .data.
2185 2011-06-07 Cary Coutant <ccoutant@google.com>
2187 * common.cc (Symbol_table::do_allocate_commons_list): Call
2189 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2190 (Errors::fallback): New function.
2191 (gold_fallback): New function.
2192 * errors.h (Errors::fallback): New function.
2193 * gold.cc (gold_exit): Change status parameter to enum; adjust
2195 (queue_initial_tasks): Call gold_fallback.
2196 * gold.h: Include cstdlib.
2197 (Exit_status): New enum type.
2198 (gold_exit): Change status parameter to enum.
2199 (gold_fallback): New function.
2200 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2201 (Layout::create_symtab_sections): Likewise.
2202 (Layout::create_shdrs): Likewise.
2203 * main.cc (main): Adjust call to gold_exit.
2204 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2205 (Output_data_got::add_got_entry_pair): Likewise.
2206 (Output_section::add_input_section): Likewise.
2207 (Output_section::add_output_section_data): Likewise.
2208 (Output_segment::set_section_list_addresses): Likewise.
2209 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2211 2011-06-07 Cary Coutant <ccoutant@google.com>
2213 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2214 for incremental links.
2215 * output.cc (Output_segment::set_section_list_addresses): Remove
2216 FIXME and test for TLS or BSS.
2218 2011-06-07 Cary Coutant <ccoutant@google.com>
2220 * testsuite/Makefile.am: Add incremental_copy_test,
2221 incremental_common_test_1.
2222 * testsuite/Makefile.in: Regenerate.
2223 * testsuite/common_test_1_v1.c: New source file.
2224 * testsuite/common_test_1_v2.c: New source file.
2225 * testsuite/copy_test_v1.cc: New source file.
2227 2011-06-07 Cary Coutant <ccoutant@google.com>
2229 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2230 update, allocate common from bss section's free list.
2231 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2232 linker-defined symbols.
2233 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2234 Skip GOT and PLT entries that are no longer referenced.
2235 (Output_section_incremental_inputs::write_info_blocks): Mark
2236 linker-defined symbols.
2237 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2238 * output.cc (Output_section::allocate): New function.
2239 * output.h (Output_section::allocate): New function.
2240 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2241 linker-defined symbols.
2242 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2243 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2244 (Symbol::init_base_output_data): Likewise.
2245 (Symbol::init_base_output_segment): Likewise.
2246 (Symbol::init_base_constant): Likewise.
2247 (Sized_symbol::init_output_data): Likewise.
2248 (Sized_symbol::init_output_segment): Likewise.
2249 (Sized_symbol::init_constant): Likewise.
2250 (Symbol_table::do_define_in_output_data): Likewise.
2251 (Symbol_table::do_define_in_output_segment): Likewise.
2252 (Symbol_table::do_define_as_constant): Likewise.
2253 * symtab.h (Symbol::is_predefined): New function.
2254 (Symbol::init_base_output_data): Add is_predefined parameter.
2255 (Symbol::init_base_output_segment): Likewise.
2256 (Symbol::init_base_constant): Likewise.
2257 (Symbol::is_predefined_): New data member.
2258 (Sized_symbol::init_output_data): Add is_predefined parameter.
2259 (Sized_symbol::init_output_segment): Likewise.
2260 (Sized_symbol::init_constant): Likewise.
2261 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2263 2011-06-07 Cary Coutant <ccoutant@google.com>
2265 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2266 instead of emit_copy_reloc.
2267 (Copy_relocs::emit_copy_reloc): Refactor.
2268 (Copy_relocs::make_copy_reloc): New function.
2269 (Copy_relocs::add_copy_reloc): Remove.
2270 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2272 (Copy_relocs::make_copy_reloc): New function.
2273 (Copy_relocs::add_copy_reloc): Remove.
2274 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2275 unchanged input files.
2276 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2277 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2278 Reserve BSS space for COPY relocations.
2279 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2280 (Output_section_incremental_inputs::write_info_blocks): Record
2281 whether a symbol is copied from a shared object.
2282 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2283 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2284 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2285 (Incremental_input_entry_reader::get_output_symbol_index): Add
2287 (Incremental_binary::emit_copy_relocs): New function.
2288 (Incremental_binary::do_emit_copy_relocs): New function.
2289 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2291 (Sized_incremental_binary::add_copy_reloc): New function.
2292 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2293 (Sized_incremental_binary::Copy_reloc): New struct.
2294 (Sized_incremental_binary::Copy_relocs): New typedef.
2295 (Sized_incremental_binary::copy_relocs_): New data member.
2296 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2297 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2298 * target.h (Sized_target::emit_copy_reloc): New function.
2299 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2301 2011-06-02 Cary Coutant <ccoutant@google.com>
2304 * gold/archive.cc (Archive::Archive): Initialize new data member.
2305 (Archive::include_all_members): Return if archive has already been
2307 * gold/archive.h (Archive::include_all_members_): New data member.
2309 2011-06-02 Nick Clifton <nickc@redhat.com>
2311 * dynobj.h: Fix spelling mistake in comment.
2312 * output.cc: Likewise.
2314 2011-05-31 Doug Kwan <dougkwan@google.com>
2318 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2319 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2320 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2321 redundant arm_exidx_test.so.
2322 * testsuite/Makefile.in: Regenerate.
2323 (check_SCRIPTS): Add pr12826.sh
2324 (check_DATA): Add pr12826.stdout
2325 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2326 * testsuite/pr12826.sh: New file.
2327 * testsuite/pr12826_1.s: Ditto.
2328 * testsuite/pr12826_1.s: Ditto.
2330 2011-05-30 Ian Lance Taylor <iant@google.com>
2332 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2335 2011-05-29 Ian Lance Taylor <iant@google.com>
2338 * testsuite/Makefile.am: Use different file name for two_file_test
2339 temporary file for each incremental test.
2340 * testsuite/Makefile.in: Rebuild.
2342 2011-05-29 Ian Lance Taylor <iant@google.com>
2344 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2345 binary input file is empty.
2347 2011-05-27 Ian Lance Taylor <iant@google.com>
2349 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2350 (ver_test_9.so): Likewise.
2351 * testsuite/Makefile.in: Rebuild.
2353 2011-05-26 Cary Coutant <ccoutant@google.com>
2355 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2356 * incremental.cc (Incremental_inputs::report_input_section): Fix
2357 comment, indentation.
2358 (Incremental_inputs::report_comdat_group): New function.
2359 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2360 of data for incremental input file entry.
2361 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2362 group count, COMDAT group signatures.
2363 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2364 an unchanged input file.
2365 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2366 Initialize new data member.
2367 (Incremental_object_entry::add_comdat_group): New function.
2368 (Incremental_object_entry::get_comdat_group_count): New function.
2369 (Incremental_object_entry::get_comdat_signature_key): New function.
2370 (Incremental_object_entry::groups_): New data member.
2371 (Incremental_inputs::report_comdat_group): New function.
2372 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2373 data for incremental input file entry.
2374 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2375 (Incremental_input_entry_reader::get_input_section): Adjust size of
2376 data for incremental input file entry.
2377 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2378 (Incremental_input_entry_reader::get_comdat_group_signature): New
2380 * object.cc (Sized_relobj::include_section_group): Report kept
2381 COMDAT groups for incremental links.
2383 2011-05-24 David Meyer <pdox@google.com>
2385 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2386 with name parameter. Add found_name parameter.
2387 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2388 * dirsearch.h (class Dirsearch): Update declaration.
2390 2011-05-24 Ian Lance Taylor <iant@google.com>
2392 * archive.cc (Library_base::should_include_member): Pull in object
2393 from archive if it defines the entry symbol.
2394 * parameters.cc (Parameters::entry): New function.
2395 * parameters.h (class Parameters): Declare entry.
2396 * output.h (class Output_file_header): Remove entry_ field.
2397 * output.cc (Output_file_header::Output_file_header): Remove entry
2398 parameter. Change all callers.
2399 (Output_file_header::entry): Use parameters->entry.
2400 * gold.cc (queue_middle_tasks): Likewise.
2401 * plugin.cc (Plugin_hook::run): Likewise.
2403 2011-05-24 Cary Coutant <ccoutant@google.com>
2405 * gold.cc (queue_initial_tasks): Pass incremental base filename
2406 to Output_file::open_base_file; don't print error message.
2407 * incremental-dump.cc (main): Adjust call to
2408 Output_file::open_for_modification.
2409 * incremental-dump.cc (main): Likewise.
2410 * incremental.cc (Incremental_inputs::report_command_line):
2411 Ignore --incremental-base option when comparing command lines.
2412 Ignore parameter when given as separate argument.
2413 * options.h (class General_options): Add --incremental-base.
2414 * output.cc (Output_file::Output_file):
2415 (Output_file::open_base_file): Add base_name and writable parameters;
2416 read base file into new file; print error message here.
2417 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2419 * output.h (Output_file::open_for_modification): Rename to...
2420 (Output_file::open_base_file): ...this; add base_name and
2421 writable parameters; adjust all callers.
2422 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2424 * testsuite/Makefile.am (incremental_test_4): Test
2426 * testsuite/Makefile.in: Regenerate.
2428 2011-05-24 Cary Coutant <ccoutant@google.com>
2430 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2432 * testsuite/Makefile.in: Regenerate.
2433 * testsuite/two_file_test_1_v1.cc: New test source file.
2434 * testsuite/two_file_test_1b_v1.cc: New test source file.
2435 * testsuite/two_file_test_2_v1.cc: New test source file.
2437 2011-05-24 Cary Coutant <ccoutant@google.com>
2439 * dynobj.h (Dynobj::do_dynobj): New function.
2440 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2441 flag and soname for shared objects.
2442 * incremental.cc (Incremental_inputs::report_object): Make
2443 either Incremental_object_entry or Incremental_dynobj_entry; add
2444 soname to string table.
2445 (Incremental_inputs::report_input_section): Add assertion.
2446 (Output_section_incremental_inputs::set_final_data_size): Adjust
2447 type of input file entry for shared libraries; adjust size of
2448 shared library info entry.
2449 (Output_section_incremental_inputs::write_input_files): Write
2450 as_needed flag for shared libraries.
2451 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2452 of input file entry for shared libraries; write soname.
2453 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2454 soname from incremental info.
2455 * incremental.h (enum Incremental_input_flags): Add
2456 INCREMENTAL_INPUT_AS_NEEDED.
2457 (Incremental_input_entry::Incremental_input_entry): Initialize new
2459 (Incremental_input_entry::set_as_needed): New function.
2460 (Incremental_input_entry::as_needed): New function.
2461 (Incremental_input_entry::do_dynobj_entry): New function.
2462 (Incremental_input_entry::as_needed_): New data member.
2463 (Incremental_object_entry::Incremental_object_entry): Don't check
2465 (Incremental_object_entry::do_type): Likewise.
2466 (class Incremental_dynobj_entry): New class.
2467 (Incremental_input_entry_reader::as_needed): New function.
2468 (Incremental_input_entry_reader::get_soname): New function.
2469 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2470 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2471 size of shared library info entry.
2472 * layout.cc (Layout::finish_dynamic_section): Don't test for
2473 incremental link when adding DT_NEEDED entries.
2474 * object.h (Object::Object): Initialize new data member.
2475 (Object::dynobj): New function.
2476 (Object::set_as_needed): New function.
2477 (Object::as_needed): New function.
2478 (Object::do_dynobj): New function.
2479 (Object::as_needed_): New data member.
2481 2011-05-24 Cary Coutant <ccoutant@google.com>
2483 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2484 info; adjust display of GOT entries.
2485 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2486 vector of input objects; remove file_status_.
2487 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2488 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2489 got_plt reader; call target hooks to reserve GOT entries.
2490 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2491 of input file info header and GOT info entry.
2492 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2494 (Got_plt_view_info::got_descriptor): Remove.
2495 (Got_plt_view_info::sym_index): New data member.
2496 (Got_plt_view_info::input_index): New data member.
2497 (Local_got_offset_visitor::visit): Write input file index.
2498 (Global_got_offset_visitor::visit): Write 0 for input file index.
2499 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2500 with sym_index and input_index.
2501 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2502 incremental info GOT entry; replace got_descriptor with input_index.
2503 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2504 map from input file index to object.
2505 (Sized_relobj_incr::do_layout): Replace direct data member reference
2506 with accessor function.
2507 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2508 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2509 Adjust size of input file info header.
2510 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2511 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2512 (Incremental_input_entry_reader::get_input_section): Adjust size of
2513 input file info header.
2514 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2515 of incremental info GOT entry.
2516 (Incremental_got_plt_reader::get_got_desc): Remove.
2517 (Incremental_got_plt_reader::get_got_symndx): New function.
2518 (Incremental_got_plt_reader::get_got_input_index): New function.
2519 (Sized_incremental_binary::Sized_incremental_binary): Remove
2520 file_status_; add input_objects_.
2521 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2522 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2523 (Sized_incremental_binary::file_is_unchanged): Remove.
2524 (Sized_incremental_binary::set_input_object): New function.
2525 (Sized_incremental_binary::input_object): New function.
2526 (Sized_incremental_binary::file_status_): Remove.
2527 (Sized_incremental_binary::input_objects_): New data member.
2528 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2530 (Sized_relobj_incr::invalid_address): Move to base class.
2531 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2533 (Sized_relobj_incr::do_output_section_offset): Likewise.
2534 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2535 (Sized_relobj_incr::section_offsets_): Likewise.
2536 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2538 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2539 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2540 with accessor function.
2541 (Sized_relobj_file::do_layout): Likewise.
2542 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2543 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2544 (Sized_relobj_file::compute_final_local_value): Replace refs to
2545 section_offsets_ with accessor function.
2546 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2547 * object.h (Relobj::Relobj): Initialize new data members.
2548 (Relobj::add_dyn_reloc): New function.
2549 (Relobj::first_dyn_reloc): New function.
2550 (Relobj::dyn_reloc_count): New function.
2551 (Relobj::first_dyn_reloc_): New data member.
2552 (Relobj::dyn_reloc_count_): New data member.
2553 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2555 (Sized_relobj::Address): New typedef.
2556 (Sized_relobj::invalid_address): Move here from child class.
2557 (Sized_relobj::Sized_relobj): Initialize new data members.
2558 (Sized_relobj::sized_relobj): New function.
2559 (Sized_relobj::is_output_section_offset_invalid): Move here from
2561 (Sized_relobj::get_output_section_offset): Likewise.
2562 (Sized_relobj::local_has_got_offset): Likewise.
2563 (Sized_relobj::local_got_offset): Likewise.
2564 (Sized_relobj::set_local_got_offset): Likewise.
2565 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2566 (Sized_relobj::clear_got_offsets): New function.
2567 (Sized_relobj::section_offsets): Move here from child class.
2568 (Sized_relobj::do_output_section_offset): Likewise.
2569 (Sized_relobj::do_set_section_offset): Likewise.
2570 (Sized_relobj::Local_got_offsets): Likewise.
2571 (Sized_relobj::local_got_offsets_): Likewise.
2572 (Sized_relobj::section_offsets_): Likewise.
2573 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2575 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2577 (Sized_relobj_file::sized_relobj): New function
2578 (Sized_relobj_file::local_has_got_offset): Move to base class.
2579 (Sized_relobj_file::local_got_offset): Likewise.
2580 (Sized_relobj_file::set_local_got_offset): Likewise.
2581 (Sized_relobj_file::get_output_section_offset): Likewise.
2582 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2583 (Sized_relobj_file::do_output_section_offset): Likewise.
2584 (Sized_relobj_file::do_set_section_offset): Likewise.
2585 (Sized_relobj_file::Local_got_offsets): Likewise.
2586 (Sized_relobj_file::local_got_offsets_): Likewise.
2587 (Sized_relobj_file::section_offsets_): Likewise.
2588 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2590 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2591 (Output_reloc::get_symbol_index): Likewise.
2592 (Output_reloc::local_section_offset): Likewise.
2593 (Output_reloc::get_address): Likewise.
2594 (Output_reloc::symbol_value): Likewise.
2595 (Output_data_got::reserve_slot): Move to class definition.
2596 (Output_data_got::reserve_local): New function.
2597 (Output_data_got::reserve_slot_for_global): Remove.
2598 (Output_data_got::reserve_global): New function.
2599 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2600 (all constructors, two instantiations).
2601 (Output_reloc::get_relobj): New function (two instantiations).
2602 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2603 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2604 (Output_data_reloc::add_global): Adjust type of relobj.
2605 (Output_data_reloc::add_global_relative): Likewise.
2606 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2607 (Output_data_reloc::add_local): Likewise.
2608 (Output_data_reloc::add_local_relative): Likewise.
2609 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2610 (Output_data_reloc::add_local_section): Likewise.
2611 (Output_data_reloc::add_output_section): Likewise.
2612 (Output_data_reloc::add_absolute): Likewise.
2613 (Output_data_reloc::add_target_specific): Likewise.
2614 (Output_data_got::reserve_slot): Move definition here.
2615 (Output_data_got::reserve_local): New function.
2616 (Output_data_got::reserve_global): New function.
2617 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2618 section_offsets_ with accessor function.
2619 (Sized_relobj_file::write_sections): Likewise.
2620 (Sized_relobj_file::do_relocate_sections): Likewise.
2621 * target.h (Sized_target::reserve_local_got_entry): New function.
2622 (Sized_target::reserve_global_got_entry): New function.
2623 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2624 (Target_x86_64::reserve_global_got_entry): New function.
2625 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2627 2011-05-23 Cary Coutant <ccoutant@google.com>
2629 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2630 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2631 bit when checking got_type.
2632 * incremental.cc (Sized_incremental_binary::setup_readers):
2633 Store symbol table and string table locations; initialize bit vector
2634 of file status flags.
2635 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2637 (Sized_incremental_binary::do_process_got_plt): New function.
2638 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2639 (Output_section_incremental_inputs::set_final_data_size): Record
2640 file index for each input file.
2641 (Output_section_incremental_inputs::write_got_plt): Store file index
2642 instead of input entry offset for each GOT entry.
2644 (Incremental_input_entry::Incremental_input_entry): Initialize new
2646 (Incremental_input_entry::set_offset): Store file index.
2647 (Incremental_input_entry::get_file_index): New function.
2648 (Incremental_input_entry::file_index_): New data member.
2649 (Incremental_binary::process_got_plt): New function.
2650 (Incremental_binary::do_process_got_plt): New function.
2651 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2653 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2654 (Sized_incremental_binary::set_file_is_unchanged): New function.
2655 (Sized_incremental_binary::file_is_unchanged): New function.
2656 (Sized_incremental_binary::do_process_got_plt): New function.
2657 (Sized_incremental_binary::file_status_): New data member.
2658 (Sized_incremental_binary::main_symtab_loc_): New data member.
2659 (Sized_incremental_binary::main_strtab_loc_): New data member.
2660 * output.cc (Output_data_got::Got_entry::write): Add case
2662 (Output_data_got::add_global): Call add_got_entry.
2663 (Output_data_got::add_global_plt): Likewise.
2664 (Output_data_got::add_global_with_rel): Likewise.
2665 (Output_data_got::add_global_with_rela): Likewise.
2666 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2667 (Output_data_got::add_global_pair_with_rela): Likewise.
2668 (Output_data_got::add_local): Call add_got_entry.
2669 (Output_data_got::add_local_plt): Likewise.
2670 (Output_data_got::add_local_with_rel): Likewise.
2671 (Output_data_got::add_local_with_rela): Likewise.
2672 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2673 (Output_data_got::add_local_pair_with_rela): Likewise.
2674 (Output_data_got::reserve_slot): New function.
2675 (Output_data_got::reserve_slot_for_global): New function.
2676 (Output_data_got::add_got_entry): New function.
2677 (Output_data_got::add_got_entry_pair): New function.
2678 (Output_section::add_output_section_data): Edit FIXME.
2680 (Output_section_data_build::Output_section_data_build): New
2681 constructor with size parameter.
2682 (Output_data_space::Output_data_space): Likewise.
2683 (Output_data_got::Output_data_got): Initialize new data member; new
2684 constructor with size parameter.
2685 (Output_data_got::add_constant): Call add_got_entry.
2686 (Output_data_got::reserve_slot): New function.
2687 (Output_data_got::reserve_slot_for_global): New function.
2688 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2689 (Output_data_got::add_got_entry): New function.
2690 (Output_data_got::add_got_entry_pair): New function.
2691 (Output_data_got::free_list_): New data member.
2692 * target.h (Sized_target::init_got_plt_for_update): New function.
2693 (Sized_target::register_global_plt_entry): New function.
2694 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2695 Initialize new data member; call init; add constructor with PLT count.
2696 (Output_data_plt_x86_64::init): New function.
2697 (Output_data_plt_x86_64::add_relocation): New function.
2698 (Output_data_plt_x86_64::reserve_slot): New function.
2699 (Output_data_plt_x86_64::free_list_): New data member.
2700 (Target_x86_64::init_got_plt_for_update): New function.
2701 (Target_x86_64::register_global_plt_entry): New function.
2702 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2703 incremental updates.
2704 (Output_data_plt_x86_64::add_relocation): New function.
2705 * testsuite/object_unittest.cc (Object_test): Set default options.
2707 2011-05-16 Ian Lance Taylor <iant@google.com>
2709 * options.h (class General_options): Make -i a synonym for -r.
2711 2011-05-16 Ian Lance Taylor <iant@google.com>
2713 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2715 2011-05-10 Cary Coutant <ccoutant@google.com>
2717 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2720 2011-05-06 Ian Lance Taylor <iant@google.com>
2722 * layout.cc (Layout::layout): If the output section flags change,
2723 update the ordering.
2725 2011-04-25 Cary Coutant <ccoutant@google.com>
2727 * incremental-dump.cc (dump_incremental_inputs): Print local
2728 symbol info for each input file.
2730 (Output_section_incremental_inputs::set_final_data_size): Add local
2731 symbol info to input file entries in incremental info.
2732 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2733 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2734 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2735 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2737 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2738 (Sized_incr_relobj::do_relocate): Write the local symbols.
2739 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2740 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2741 Adjust size of input file header.
2742 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2743 (Incremental_inputs_reader::get_local_symbol_count): New function.
2744 (Incremental_inputs_reader::get_input_section): Adjust size of input
2746 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2747 (Sized_incr_relobj::This): New typedef.
2748 (Sized_incr_relobj::sym_size): New const data member.
2749 (Sized_incr_relobj::Local_symbol): New struct.
2750 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2751 (Sized_incr_relobj::do_local_symbol_offset): New function.
2752 (Sized_incr_relobj::local_symbol_count_): New data member.
2753 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2754 (Sized_incr_relobj::local_symbol_index_): New data member.
2755 (Sized_incr_relobj::local_symbol_offset_): New data member.
2756 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2757 (Sized_incr_relobj::local_symbols_): New data member.
2758 * object.h (Relobj::output_local_symbol_count): New function.
2759 (Relobj::local_symbol_offset): New function.
2760 (Relobj::do_output_local_symbol_count): New function.
2761 (Relobj::do_local_symbol_offset): New function.
2762 (Sized_relobj::do_output_local_symbol_count): New function.
2763 (Sized_relobj::do_local_symbol_offset): New function.
2765 2011-04-22 Vladimir Simonov <sv@sw.ru>
2767 * descriptors.cc (set_close_on_exec): New function.
2768 (Descriptors::open): Use set_close_on_exec.
2769 * output.cc (S_ISLNK): Define if not defined.
2771 2011-04-22 Cary Coutant <ccoutant@google.com>
2773 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2775 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2776 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2777 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2779 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2780 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2781 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2783 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2785 (Incremental_binary::apply_incremental_relocs): New function.
2786 (Incremental_binary::do_apply_incremental_relocs): New function.
2787 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2789 (Sized_incremental_binary::add_global_symbol): New function.
2790 (Sized_incremental_binary::global_symbol): New function.
2791 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2792 (Sized_incremental_binary::symbol_map_): New data member.
2793 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2794 * target.h (Sized_target::apply_relocation): New function.
2795 * target-reloc.h (apply_relocation): New function.
2796 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2798 2011-04-22 Doug Kwan <dougkwan@google.com>
2800 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2801 flag of a SHT_ARM_EXIDX section.
2802 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2803 * testsuite/Makefile.in: Regenerate.
2804 * testsuite/arm_exidx_test.s: New file.
2805 * testsuite/arm_exidx_test.sh: Same.
2807 2011-04-20 Cary Coutant <ccoutant@google.com>
2810 * archive.h (Incremental_archive_entry::Archive_member):
2811 Initialize arg_serial_ (second constructor).
2813 2011-04-17 Ian Lance Taylor <iant@google.com>
2815 * object.cc (Relocate_info::location): Simplify location string.
2816 * errors.cc (Errors::error_at_location): Don't print program
2818 (Errors::warning_at_location): Likewise.
2819 (Errors::undefined_symbol): Likewise.
2820 * testsuite/debug_msg.sh: Update accordingly.
2822 2011-04-14 Cary Coutant <ccoutant@google.com>
2824 * gold/layout.cc (Layout::symtab_section_offset): New function.
2825 * gold/layout.h (Layout::symtab_section_offset): New function.
2826 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2828 2011-04-12 Ian Lance Taylor <iant@google.com>
2830 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2831 with MREMAP_MAYMOVE.
2832 * output.h (class Output_file): Add map_is_allocated_ field.
2833 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2834 not available, provide stubs. If mremap is not available, #define
2836 (MREMAP_MAYMOVE): Define if not defined.
2837 (Output_file::Output_file): Initialize map_is_allocated_.
2838 (Output_file::resize): Check map_is_allocated_.
2839 (Output_file::map_anonymous): If mmap fails, use malloc.
2840 (Output_file::unmap): Don't do anything for an anonymous map.
2841 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2842 is not available, provide stubs.
2843 (File_read::View::~View): Use free rather than delete[].
2844 (File_read::make_view): Use malloc rather than new[]. If mmap
2846 (File_read::find_or_make_view): Use malloc rather than new[].
2847 * gold.h: Remove HAVE_REMAP code.
2848 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2849 exists. Rename mremap to gold_mremap. If mmap is not available
2851 * configure, config.in: Rebuild.
2853 2011-04-11 Ian Lance Taylor <iant@google.com>
2855 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2856 initialize local variable v.
2858 2011-04-11 Cary Coutant <ccoutant@google.com>
2860 * archive.cc (Archive::include_member): Adjust call to
2862 (Add_archive_symbols::run): Track argument serial numbers.
2863 (Lib_group::include_member): Likewise.
2864 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2865 * archive.h (Incremental_archive_entry::Archive_member):
2866 Initialize arg_serial_.
2867 (Archive_member::arg_serial_): New data member.
2868 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2869 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2871 (Sized_dynobj::do_for_all_local_got_entries): New function.
2872 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2874 * fileread.cc (get_mtime): New function.
2875 * fileread.h (get_mtime): New function.
2876 * gold.cc (queue_initial_tasks): Check for incremental update.
2877 (process_incremental_input): New function.
2878 (queue_middle_tasks): Don't force valid target for incremental
2880 * incremental-dump.cc (find_input_containing_global): Adjust
2881 size of symbol info entry.
2882 (dump_incremental_inputs): Dump argument serial number and
2883 in_system_directory flag; bias shndx by 1; print symbol names
2884 when dumping per-file symbol lists; use new symbol info readers.
2886 (Output_section_incremental_inputs:update_data_size): New function.
2887 (Sized_incremental_binary::setup_readers): Setup input readers
2888 for each input file; build maps for files added from libraries
2890 (Sized_incremental_binary::check_input_args): New function.
2891 (Sized_incremental_binary::do_check_inputs): Build map of argument
2892 serial numbers to input arguments.
2893 (Sized_incremental_binary::do_file_has_changed): Rename
2894 do_file_is_unchanged to this; compare file modification times.
2895 (Sized_incremental_binary::do_init_layout): New function.
2896 (Sized_incremental_binary::do_reserve_layout): New function.
2897 (Sized_incremental_binary::do_get_input_reader): Remove.
2898 (Sized_incremental_binary::get_symtab_view): New function.
2899 (Incremental_checker::can_incrementally_link_output_file): Remove.
2900 (Incremental_inputs::report_command_line): Exclude --debug options.
2901 (Incremental_inputs::report_archive_begin): Add parameter; track
2902 argument serial numbers; don't put input file entry for archive
2903 before archive members.
2904 (Incremental_inputs::report_archive_end): Put input file entry
2905 for archive after archive members.
2906 (Incremental_inputs::report_object): Add parameter; track argument
2907 serial numbers and in_system_directory flag.
2908 (Incremental_inputs::report_script): Add parameter; track argument
2910 (Output_section_incremental_inputs::set_final_data_size): Adjust
2911 size of symbol info entry; check for forwarding symbols.
2912 (Output_section_incremental_inputs::write_input_files): Write
2913 in_system_directory flag and argument serial number.
2914 (Output_section_incremental_inputs::write_info_blocks): Map section
2915 indices between incremental info and original input file; store
2916 input section index for each symbol.
2917 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2918 change operator() to visit().
2919 (class Global_got_offset_visitor): Likewise.
2920 (class Global_symbol_visitor_got_plt):
2921 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2923 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2924 (Sized_incr_relobj::do_read_symbols): New function.
2925 (Sized_incr_relobj::do_layout): New function.
2926 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2927 (Sized_incr_relobj::do_add_symbols): New function.
2928 (Sized_incr_relobj::do_should_include_member): New function.
2929 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2930 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2931 (Sized_incr_relobj::do_section_size): New function.
2932 (Sized_incr_relobj::do_section_name): New function.
2933 (Sized_incr_relobj::do_section_contents): New function.
2934 (Sized_incr_relobj::do_section_flags): New function.
2935 (Sized_incr_relobj::do_section_entsize): New function.
2936 (Sized_incr_relobj::do_section_address): New function.
2937 (Sized_incr_relobj::do_section_type): New function.
2938 (Sized_incr_relobj::do_section_link): New function.
2939 (Sized_incr_relobj::do_section_info): New function.
2940 (Sized_incr_relobj::do_section_addralign): New function.
2941 (Sized_incr_relobj::do_initialize_xindex): New function.
2942 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2943 (Sized_incr_relobj::do_read_relocs): New function.
2944 (Sized_incr_relobj::do_gc_process_relocs): New function.
2945 (Sized_incr_relobj::do_scan_relocs): New function.
2946 (Sized_incr_relobj::do_count_local_symbols): New function.
2947 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2948 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2949 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2950 (Sized_incr_relobj::do_relocate): New function.
2951 (Sized_incr_relobj::do_set_section_offset): New function.
2952 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2953 (Sized_incr_dynobj::do_read_symbols): New function.
2954 (Sized_incr_dynobj::do_layout): New function.
2955 (Sized_incr_dynobj::do_add_symbols): New function.
2956 (Sized_incr_dynobj::do_should_include_member): New function.
2957 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2958 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2959 (Sized_incr_dynobj::do_section_size): New function.
2960 (Sized_incr_dynobj::do_section_name): New function.
2961 (Sized_incr_dynobj::do_section_contents): New function.
2962 (Sized_incr_dynobj::do_section_flags): New function.
2963 (Sized_incr_dynobj::do_section_entsize): New function.
2964 (Sized_incr_dynobj::do_section_address): New function.
2965 (Sized_incr_dynobj::do_section_type): New function.
2966 (Sized_incr_dynobj::do_section_link): New function.
2967 (Sized_incr_dynobj::do_section_info): New function.
2968 (Sized_incr_dynobj::do_section_addralign): New function.
2969 (Sized_incr_dynobj::do_initialize_xindex): New function.
2970 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2971 (make_sized_incremental_object): New function.
2972 (Incremental_library::copy_unused_symbols): New function.
2973 (Incremental_library::do_for_all_unused_symbols): New function.
2974 * incremental.h (enum Incremental_input_flags): New type.
2975 (class Incremental_checker): Remove.
2976 (Incremental_input_entry::Incremental_input_entry): Add argument
2978 (Incremental_input_entry::arg_serial): New function.
2979 (Incremental_input_entry::set_is_in_system_directory): New function.
2980 (Incremental_input_entry::is_in_system_directory): New function.
2981 (Incremental_input_entry::arg_serial_): New data member.
2982 (Incremental_input_entry::is_in_system_directory_): New data member.
2983 (class Script_info): Move here from script.h.
2984 (Script_info::Script_info): Add filename parameter.
2985 (Script_info::filename): New function.
2986 (Script_info::filename_): New data member.
2987 (Incremental_script_entry::Incremental_script_entry): Add argument
2989 (Incremental_object_entry::Incremental_object_entry): Likewise.
2990 (Incremental_object_entry::add_input_section): Build list of input
2991 sections with map to original shndx.
2992 (Incremental_object_entry::get_input_section_index): New function.
2993 (Incremental_object_entry::shndx_): New data member.
2994 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2995 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2996 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2998 (Incremental_inputs::report_archive_begin): Likewise.
2999 (Incremental_inputs::report_object): Likewise.
3000 (Incremental_inputs::report_script): Likewise.
3001 (class Incremental_global_symbol_reader): New class.
3002 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3003 and store flags and input file type.
3004 (Incremental_input_entry_reader::arg_serial): New function.
3005 (Incremental_input_entry_reader::type): Extract type from flags.
3006 (Incremental_input_entry_reader::is_in_system_directory): New function.
3007 (Incremental_input_entry_reader::get_input_section_count): Call
3008 accessor function for type.
3009 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3010 function for type; adjust size of global symbol entry.
3011 (Incremental_input_entry_reader::get_global_symbol_count): Call
3012 accessor function for type.
3013 (Incremental_input_entry_reader::get_object_count): Likewise.
3014 (Incremental_input_entry_reader::get_object_offset): Likewise.
3015 (Incremental_input_entry_reader::get_member_count): Likewise.
3016 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3017 (Incremental_input_entry_reader::get_member_offset): Likewise.
3018 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3019 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3020 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3021 (Incremental_input_entry_reader::get_global_symbol_reader): New
3023 (Incremental_input_entry_reader::get_output_symbol_index): New
3025 (Incremental_input_entry_reader::type_): Remove.
3026 (Incremental_input_entry_reader::flags_): New data member.
3027 (Incremental_inputs_reader::input_file_offset): New function.
3028 (Incremental_inputs_reader::input_file_index): New function.
3029 (Incremental_inputs_reader::input_file): Call input_file_offset.
3030 (Incremental_inputs_reader::input_file_at_offset): New function.
3031 (Incremental_relocs_reader::get_r_type): Reformat.
3032 (Incremental_relocs_reader::get_r_shndx): Reformat.
3033 (Incremental_relocs_reader::get_r_offset): Reformat.
3034 (Incremental_relocs_reader::data): New function.
3035 (Incremental_binary::Incremental_binary): Initialize new data members.
3036 (Incremental_binary::check_inputs): Add cmdline parameter.
3037 (Incremental_binary::file_is_unchanged): Remove.
3038 (Input_reader::arg_serial): New function.
3039 (Input_reader::get_unused_symbol_count): New function.
3040 (Input_reader::get_unused_symbol): New function.
3041 (Input_reader::do_arg_serial): New function.
3042 (Input_reader::do_get_unused_symbol_count): New function.
3043 (Input_reader::do_get_unused_symbol): New function.
3044 (Incremental_binary::input_file_count): New function.
3045 (Incremental_binary::get_input_reader): Change signature to use
3046 index instead of filename.
3047 (Incremental_binary::file_has_changed): New function.
3048 (Incremental_binary::get_input_argument): New function.
3049 (Incremental_binary::get_library): New function.
3050 (Incremental_binary::get_script_info): New function.
3051 (Incremental_binary::init_layout): New function.
3052 (Incremental_binary::reserve_layout): New function.
3053 (Incremental_binary::output_file): New function.
3054 (Incremental_binary::do_check_inputs): New function.
3055 (Incremental_binary::do_file_is_unchanged): Remove.
3056 (Incremental_binary::do_file_has_changed): New function.
3057 (Incremental_binary::do_init_layout): New function.
3058 (Incremental_binary::do_reserve_layout): New function.
3059 (Incremental_binary::do_input_file_count): New function.
3060 (Incremental_binary::do_get_input_reader): Change signature.
3061 (Incremental_binary::input_args_map_): New data member.
3062 (Incremental_binary::library_map_): New data member.
3063 (Incremental_binary::script_map_): New data member.
3064 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3066 (Sized_incremental_binary::output_section): New function.
3067 (Sized_incremental_binary::inputs_reader): Add const.
3068 (Sized_incremental_binary::symtab_reader): Add const.
3069 (Sized_incremental_binary::relocs_reader): Add const.
3070 (Sized_incremental_binary::got_plt_reader): Add const.
3071 (Sized_incremental_binary::get_symtab_view): New function.
3072 (Sized_incremental_binary::Inputs_reader): New typedef.
3073 (Sized_incremental_binary::Input_entry_reader): New typedef.
3074 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3075 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3076 (Sized_incremental_binary::do_file_has_changed): New function.
3077 (Sized_incremental_binary::do_init_layout): New function.
3078 (Sized_incremental_binary::do_reserve_layout): New function.
3079 (Sized_input_reader::Inputs_reader): Remove.
3080 (Sized_input_reader::Input_entry_reader): Remove.
3081 (Sized_input_reader::do_arg_serial): New function.
3082 (Sized_input_reader::do_get_unused_symbol_count): New function.
3083 (Sized_input_reader::do_get_unused_symbol): New function.
3084 (Sized_incremental_binary::do_input_file_count): New function.
3085 (Sized_incremental_binary::do_get_input_reader): Change signature;
3086 use index instead of filename.
3087 (Sized_incremental_binary::section_map_): New data member.
3088 (Sized_incremental_binary::input_entry_readers_): New data member.
3089 (class Sized_incr_relobj): New class.
3090 (class Sized_incr_dynobj): New class.
3091 (make_sized_incremental_object): New function.
3092 (class Incremental_library): New class.
3093 * layout.cc (Free_list::num_lists): New static data member.
3094 (Free_list::num_nodes): New static data member.
3095 (Free_list::num_removes): New static data member.
3096 (Free_list::num_remove_visits): New static data member.
3097 (Free_list::num_allocates): New static data member.
3098 (Free_list::num_allocate_visits): New static data member.
3099 (Free_list::init): New function.
3100 (Free_list::remove): New function.
3101 (Free_list::allocate): New function.
3102 (Free_list::dump): New function.
3103 (Free_list::print_stats): New function.
3104 (Layout_task_runner::run): Resize output file for incremental updates.
3105 (Layout::Layout): Initialize new data members.
3106 (Layout::set_incremental_base): New function.
3107 (Layout::init_fixed_output_section): New function.
3108 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3109 incremental updates.
3110 (Layout::create_gold_note): Do not create gold note section for
3111 incremental updates.
3112 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3113 for incremental updates.
3114 (Layout::set_section_offsets): For incremental updates, allocate space
3116 (Layout::create_symtab_sections): Layout with offsets relative to
3117 start of section; for incremental updates, allocate space from free
3119 (Layout::create_shdrs): For incremental updates, allocate space from
3121 (Layout::finish_dynamic_section): For incremental updates, do not
3122 check --as-needed (fixed in subsequent patch).
3123 * layout.h (class Free_list): New class.
3124 (Layout::set_incremental_base): New function.
3125 (Layout::incremental_base): New function.
3126 (Layout::init_fixed_output_section): New function.
3127 (Layout::allocate): New function.
3128 (Layout::incremental_base_): New data member.
3129 (Layout::free_list_): New data member.
3130 * main.cc (main): Print Free_list statistics.
3131 * object.cc (Relobj::finalize_incremental_relocs): Add
3132 clear_counts parameter; clear counts only when clear_counts is set.
3133 (Sized_relobj::Sized_relobj): Initialize new base class.
3134 (Sized_relobj::do_layout): Don't report special sections.
3135 (Sized_relobj::do_for_all_local_got_entries): New function.
3136 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3137 symtab_off to all symbol table offsets.
3138 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3139 * object.h (class Got_offset_list): Move to top of file.
3140 (Object::Object): Allow case where input_file == NULL.
3141 (Object::~Object): Likewise.
3142 (Object::input_file): Assert that input_file != NULL.
3143 (Object::lock): Allow case where input_file == NULL.
3144 (Object::unlock): Likewise.
3145 (Object::is_locked): Likewise.
3146 (Object::token): Likewise.
3147 (Object::release): Likewise.
3148 (Object::is_incremental): New function.
3149 (Object::get_mtime): New function.
3150 (Object::for_all_local_got_entries): New function.
3151 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3152 (Object::set_is_in_system_directory): New function.
3153 (Object::is_in_system_directory): New function.
3154 (Object::do_is_incremental): New function.
3155 (Object::do_get_mtime): New function.
3156 (Object::do_for_all_local_got_entries): New function.
3157 (Object::is_in_system_directory_): New data member.
3158 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3159 (class Sized_relobj_base): New class.
3160 (class Sized_relobj): Derive from Sized_relobj_base.
3161 (class Sized_relobj::Symbols): Redeclare from base class.
3162 (class Sized_relobj::local_got_offset_list): Remove.
3163 (class Sized_relobj::Output_sections): Redeclare from base class.
3164 (class Sized_relobj::do_for_all_local_got_entries): New function.
3165 (class Sized_relobj::write_local_symbols): Add offset parameter.
3166 (class Sized_relobj::local_symbol_offset_): Update comment.
3167 (class Sized_relobj::local_dynsym_offset_): Update comment.
3168 * options.cc (Input_arguments::add_file): Remove const.
3169 * options.h (Input_file_argument::Input_file_argument):
3170 Initialize arg_serial_ (all constructors).
3171 (Input_file_argument::set_arg_serial): New function.
3172 (Input_file_argument::arg_serial): New function.
3173 (Input_file_argument::arg_serial_): New data member.
3174 (Input_arguments::Input_arguments): Initialize file_count_.
3175 (Input_arguments::add_file): Remove const.
3176 (Input_arguments::number_of_input_files): New function.
3177 (Input_arguments::file_count_): New data member.
3178 (Command_line::number_of_input_files): Call
3179 Input_arguments::number_of_input_files.
3180 * output.cc (Output_segment_headers::Output_segment_headers):
3182 (Output_section::Input_section::current_data_size): New function.
3183 (Output_section::Output_section): Initialize new data members.
3184 (Output_section::add_input_section): Don't do merge sections for
3185 an incremental link; allocate space from free list for an
3187 (Output_section::add_output_section_data): Allocate space from
3188 free list for an incremental update.
3189 (Output_section::update_data_size): New function.
3190 (Output_section::set_fixed_layout): New function.
3191 (Output_section::reserve): New function.
3192 (Output_segment::set_section_addresses): Remove const.
3193 (Output_segment::set_section_list_addresses): Remove const; allocate
3194 space from free list for an incremental update.
3195 (Output_segment::set_offset): Adjust size of RELRO segment for an
3197 * output.h (Output_data::current_data_size): Move here from
3199 (Output_data::pre_finalize_data_size): New function.
3200 (Output_data::update_data_size): New function.
3201 (Output_section_headers::update_data_size): new function.
3202 (Output_section_data_build::current_data_size): Move to Output_data.
3203 (Output_data_strtab::update_data_size): New function.
3204 (Output_section::current_data_size): Move to Output_data.
3205 (Output_section::set_fixed_layout): New function.
3206 (Output_section::has_fixed_layout): New function.
3207 (Output_section::reserve): New function.
3208 (Output_section::update_data_size): New function.
3209 (Output_section::has_fixed_layout_): New data member.
3210 (Output_section::free_list_): New data member.
3211 (Output_segment::set_section_addresses): Remove const.
3212 (Output_segment::set_section_list_addresses): Remove const.
3213 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3215 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3217 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3218 parameter when calling Add_symbols constructor; store argument
3219 serial number for members of a lib group.
3220 (Add_symbols::locks): Allow case where token == NULL.
3221 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3222 (Read_member::~Read_member): New function.
3223 (Read_member::is_runnable): New function.
3224 (Read_member::locks): New function.
3225 (Read_member::run): New function.
3226 (Check_script::~Check_script): New function.
3227 (Check_script::is_runnable): New function.
3228 (Check_script::locks): New function.
3229 (Check_script::run): New function.
3230 (Check_library::~Check_library): New function.
3231 (Check_library::is_runnable): New function.
3232 (Check_library::locks): New function.
3233 (Check_library::run): New function.
3234 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3235 (Add_symbols::library_): New data member.
3236 (class Read_member): New class.
3237 (class Check_script): New class.
3238 (class Check_library): New class.
3239 * reloc.cc (Read_relocs::is_runnable): Allow case where
3241 (Read_relocs::locks): Likewise.
3242 (Scan_relocs::locks): Likewise.
3243 (Relocate_task::locks): Likewise.
3244 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3246 (Sized_relobj::incremental_relocs_scan): Fix comment.
3247 (Sized_relobj::do_relocate): Pass output file offset to
3248 write_local_symbols.
3249 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3250 from class declaration.
3251 * script.cc (read_input_script): Allocate Script_info; pass
3252 argument serial number to report_script.
3253 * script.h (class Script_info): Move to incremental.h.
3254 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3255 * symtab.h (Symbol_table::add_from_incrobj): New function.
3256 (Symbol_table::set_file_offset): New function.
3258 2011-04-05 Cary Coutant <ccoutant@google.com>
3260 * incremental-dump.cc (dump_incremental_inputs): Change signature
3261 to take a Sized_incremental_binary; change caller. Use readers
3262 in Sized_incremental_binary.
3264 (Sized_incremental_binary::find_incremental_inputs_sections):
3265 Rename do_find_incremental_inputs_sections to this.
3266 (Sized_incremental_binary::setup_readers): New function.
3267 (Sized_incremental_binary::do_check_inputs): Check
3268 has_incremental_info_ flag; move setup code to setup_readers;
3270 (Sized_incremental_binary::do_file_is_unchanged): New function.
3271 (Sized_incremental_binary::do_get_input_reader): New function.
3272 * incremental.h (class Incremental_binary): Move to end of file.
3273 (Incremental_binary::file_is_unchanged): New function.
3274 (Incremental_binary::do_file_is_unchanged): New function.
3275 (Incremental_binary::Input_reader): New class.
3276 (Incremental_binary::get_input_reader): New function.
3277 (class Sized_incremental_binary): Move to end of file.
3278 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3279 input section reader classes.
3280 (Sized_incremental_binary::has_incremental_info): New function.
3281 (Sized_incremental_binary::inputs_reader): New function.
3282 (Sized_incremental_binary::symtab_reader): New function.
3283 (Sized_incremental_binary::relocs_reader): New function.
3284 (Sized_incremental_binary::got_plt_reader): New function.
3285 (Sized_incremental_binary::do_file_is_unchanged): New function.
3286 (Sized_incremental_binary::Sized_input_reader): New class.
3287 (Sized_incremental_binary::get_input_reader): New function.
3288 (Sized_incremental_binary::find_incremental_inputs_sections):
3289 Rename do_find_incremental_inputs_sections to this.
3290 (Sized_incremental_binary::setup_readers): New function.
3291 (Sized_incremental_binary::has_incremental_info_): New data member.
3292 (Sized_incremental_binary::inputs_reader_): New data member.
3293 (Sized_incremental_binary::symtab_reader_): New data member.
3294 (Sized_incremental_binary::relocs_reader_): New data member.
3295 (Sized_incremental_binary::got_plt_reader_): New data member.
3296 (Sized_incremental_binary::current_input_file_): New data member.
3298 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3301 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3304 2011-03-30 Cary Coutant <ccoutant@google.com>
3306 * archive.cc (Archive::include_member): Adjust call to report_object.
3307 (Add_archive_symbols::run): Add script_info to call to
3308 report_archive_begin.
3309 (Lib_group::include_member): Adjust call to report_object.
3310 (Add_lib_group_symbols::run): Adjust call to report_object.
3311 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3312 blocks. Add object count for script input files.
3313 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3314 script_info parameter; change all callers.
3315 (Incremental_inputs::report_object): Add script_info parameter;
3317 (Incremental_inputs::report_script): Store backpointer to
3318 incremental info entry.
3319 (Output_section_incremental_inputs::set_final_data_size): Record
3320 additional information for scripts.
3321 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3322 * incremental.h (Incremental_script_entry::add_object): New function.
3323 (Incremental_script_entry::get_object_count): New function.
3324 (Incremental_script_entry::get_object): New function.
3325 (Incremental_script_entry::objects_): New data member; adjust
3327 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3328 (Incremental_inputs::report_object): Add script_info parameter.
3329 (Incremental_inputs_reader::get_object_count): New function.
3330 (Incremental_inputs_reader::get_object_offset): New function.
3331 * options.cc (Input_arguments::add_file): Return reference to
3333 * options.h (Input_argument::set_script_info): New function.
3334 (Input_argument::script_info): New function.
3335 (Input_argument::script_info_): New data member; adjust all
3337 (Input_file_group::add_file): Return reference to new input argument.
3338 (Input_file_lib::add_file): Likewise.
3339 (Input_arguments::add_file): Likewise.
3340 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3341 * script.cc (Parser_closure::Parser_closure): Add script_info
3342 parameter; adjust all callers.
3343 (Parser_closure::script_info): New function.
3344 (Parser_closure::script_info_): New data member.
3345 (read_input_script): Report scripts earlier to incremental info.
3346 (script_add_file): Set script_info in Input_argument.
3347 (script_add_library): Likewise.
3348 * script.h (Script_options::Script_info): Rewrite class.
3350 2011-03-29 Cary Coutant <ccoutant@google.com>
3352 * archive.cc (Library_base::should_include_member): Move
3353 method here from class Archive.
3354 (Archive::Archive): Initialize base class.
3355 (Archive::should_include_member): Move to base class.
3356 (Archive::do_for_all_unused_symbols): New function.
3357 (Add_archive_symbols::run): Remove redundant access to
3359 (Lib_group::Lib_group): Initialize base class.
3360 (Lib_group::do_filename): New function.
3361 (Lib_group::include_member): Pass pointer to Lib_group to
3363 (Lib_group::do_for_all_unused_symbols): New function.
3364 (Add_lib_group_symbols::run): Report archive information for
3366 * archive.h (class Library_base): New base class.
3367 (class Archive): Derive from Library_base.
3368 (Archive::filename): Move to base class.
3369 (Archive::set_incremental_info): Likewise.
3370 (Archive::incremental_info): Likewise.
3371 (Archive::Should_include): Likewise.
3372 (Archive::should_include_member): Likewise.
3373 (Archive::Armap_entry): Remove.
3374 (Archive::Unused_symbol_iterator): Remove.
3375 (Archive::unused_symbols_begin): Remove.
3376 (Archive::unused_symbols_end): Remove.
3377 (Archive::do_filename): New function.
3378 (Archive::do_get_mtime): New function.
3379 (Archive::do_for_all_unused_symbols): New function.
3380 (Archive::task_): Move to base class.
3381 (Archive::incremental_info_): Likewise.
3382 (class Lib_group): Derive from Library_base.
3383 (Lib_group::do_filename): New function.
3384 (Lib_group::do_get_mtime): New function.
3385 (Lib_group::do_for_all_unused_symbols): New function.
3386 (Lib_group::task_): Move to base class.
3387 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3389 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3391 * incremental.cc (Incremental_inputs::report_archive_begin):
3392 Use Library_base; call library's get_mtime; add incremental inputs
3393 entry before members.
3394 (class Unused_symbol_visitor): New class.
3395 (Incremental_inputs::report_archive_end): Use Library_base; use
3396 visitor class to record unused symbols; don't add incremental inputs
3397 entry after members.
3398 (Incremental_inputs::report_object): Use Library_base.
3400 (Incremental_archive_entry::Incremental_archive_entry): Remove
3401 unused Archive parameter.
3402 (Incremental_inputs::report_archive_begin): Use Library_base.
3403 (Incremental_inputs::report_archive_end): Likewise.
3404 (Incremental_inputs::report_object): Likewise.
3405 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3407 * object.h (Object::for_all_global_symbols): New function.
3408 (Object::do_for_all_global_symbols): New function.
3409 (Sized_relobj::do_for_all_global_symbols): New function.
3410 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3412 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3415 2011-03-27 Ian Lance Taylor <iant@google.com>
3417 * archive.cc (Archive::interpret_header): Return -1 if something
3418 goes wrong. Change callers accordingly.
3420 2011-03-25 Cary Coutant <ccoutant@google.com>
3422 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3423 * testsuite/Makefile.in: Regenerate.
3425 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3427 * plugin.cc (get_view): New.
3428 (Plugin::load): Pass get_view to the plugin.
3429 (Plugin_manager::get_view): New.
3431 2011-03-21 Ian Lance Taylor <iant@google.com>
3433 * testsuite/final_layout.sh: Rewrite to not use dc.
3434 * testsuite/relro_test.sh: Fail if dc is not present.
3436 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3438 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3440 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3441 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3443 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3444 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3446 2011-03-14 Ian Lance Taylor <iant@google.com>
3448 * script-sections.cc (Sort_output_sections::script_compare):
3449 Rename from is_before, change return type.
3450 (Sort_output_sections::operator()): Adjust accordingly.
3452 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3455 * testsuite/odr_violation2.cc: Add comment to make all error line
3456 numbers double digits.
3457 * testsuite/debug_msg.sh: Adjust expected errors.
3459 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3461 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3462 but mark earlier ones as non-canonical
3463 (offset_to_iterator): Update search target and example
3464 (do_addr2line): Return extra lines in a vector*
3465 (format_file_lineno): Extract from do_addr2line
3466 (one_addr2line): Add vector* out-param
3467 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3468 when a lineno entry appeared last for its instruction
3469 (Dwarf_line_info): Add vector* out-param
3470 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3471 * symtab.cc (Odr_violation_compare): Include the lineno in the
3473 (linenos_from_loc): New. Combine the canonical line for an
3474 address with its other lines.
3475 (True_if_intersect): New. Helper functor to make
3476 std::set_intersection a query.
3477 (detect_odr_violations): Compare sets of lines instead of just
3478 one line for each function. This became less deterministic, but
3479 has fewer false positives.
3480 * symtab.h: Declarations.
3481 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3482 mix an optimized and non-optimized object in the same binary
3483 (odr_violation2.so): Same.
3484 * testsuite/Makefile.in: Regenerate from Makefile.am.
3485 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3486 * testsuite/debug_msg.sh: Update line numbers and add
3488 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3489 non-optimized context.
3490 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3491 isn't inlined, and use OdrDerived in an optimized context.
3492 * testsuite/odr_header1.h: Defines OdrDerived, where
3493 optimization will change the
3494 first-instruction-in-the-destructor's file and line number.
3495 * testsuite/odr_header2.h: Defines OdrBase.
3497 2011-03-09 Ian Lance Taylor <iant@google.com>
3499 * fileread.cc (File_read::clear_views): Don't delete the whole
3502 2011-03-08 Ian Lance Taylor <iant@google.com>
3505 * fileread.cc: #include <climits>.
3506 (GOLD_IOV_MAX): Define.
3507 (File_read::read_multiple): Limit number of entries by iov_max.
3508 * fileread.h (class File_read): Always set max_readv_entries to
3511 2011-03-07 Ian Lance Taylor <iant@google.com>
3514 * options.h (class General_options): Add -dy and -dn.
3516 2011-03-02 Cary Coutant <ccoutant@google.com>
3518 * testsuite/script_test_9.t: Add TLS segment.
3520 2011-03-02 Simon Baldwin <simonb@google.com>
3522 * configure.ac: Add check for gnu_indirect_function support in
3523 the toolchain building binutils.
3524 * configure: Rebuild.
3526 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3528 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3529 plugin only symbols.
3530 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3531 in plugin files as not needed in the symbol table.
3533 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3535 * output.cc (Output_section::add_input_section): Delay fill
3536 generation for section ordering.
3538 2011-02-09 Ian Lance Taylor <iant@google.com>
3541 * object.h (class Sized_relobj): Remove clear_local_symbols.
3542 * reloc.cc (Sized_relobj::do_relocate): Don't call
3543 clear_local_symbols.
3545 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3547 * plugin.cc (is_visible_from_outside): Return true for symbols
3550 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3552 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3555 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3557 * icf.h (is_section_foldable_candidate): Change type of parameter
3559 * icf.cc (Icf::find_identical_sections): Change type of local variable
3560 section_name to be std::string.
3561 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3563 2011-01-25 Ian Lance Taylor <iant@google.com>
3565 * script.cc (script_add_extern): Rewrite to use
3566 add_symbol_reference.
3568 2011-01-25 Doug Kwan <dougkwan@google.com>
3570 * icf.cc (get_section_contents): Always lock section's object.
3572 2011-01-24 Ian Lance Taylor <iant@google.com>
3574 * options.h (class General_options): Accept
3575 --no-detect-odr-violations.
3577 2011-01-24 Ian Lance Taylor <iant@google.com>
3579 * version.cc (version_string): Bump to 1.11.
3581 2011-01-24 Ian Lance Taylor <iant@google.com>
3583 * plugin.cc (class Plugin_rescan): Define new class.
3584 (Plugin_manager::claim_file): Set any_claimed_.
3585 (Plugin_manager::save_archive): New function.
3586 (Plugin_manager::save_input_group): New function.
3587 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3589 (Plugin_manager::new_undefined_symbol): New function.
3590 (Plugin_manager::rescan): New function.
3591 (Plugin_manager::rescannable_defines): New function.
3592 (Plugin_manager::add_input_file): Set any_added_.
3593 * plugin.h (class Plugin_manager): define new fields rescannable_,
3594 undefined_symbols_, any_claimed_, and any_added_. Declare
3595 Plugin_rescan as friend. Declare new functions.
3596 (Plugin_manager::Rescannable): Define type.
3597 (Plugin_manager::Rescannable_list): Define type.
3598 (Plugin_manager::Undefined_symbol_list): Define type.
3599 (Plugin_manager::Plugin_manager): Initialize new fields.
3600 * archive.cc (Archive::defines_symbol): New function.
3601 (Add_archive_symbols::run): Pass archive to plugins if any.
3602 * archive.h (class Archive): Declare defines_symbol.
3603 * readsyms.cc (Input_group::~Input_group): New function.
3604 (Finish_group::run): Pass input_group to plugins if any.
3605 * readsyms.h (class Input_group): Declare destructor.
3606 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3609 2011-01-10 Ian Lance Taylor <iant@google.com>
3611 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3613 (Layout::set_segment_offsets): Reset increase_relro before calling
3614 set_section_addresses a second time.
3616 2011-01-04 Cary Coutant <ccoutant@google.com>
3618 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3619 sections before NOBITS sections.
3621 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3623 * version.cc (print_version): Update copyright to 2011.
3625 2010-12-23 Cary Coutant <ccoutant@google.com>
3627 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3628 of OS to this->add. Add OD parameter to second form of the function.
3630 2010-12-20 Ian Lance Taylor <iant@google.com>
3632 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3633 second of two consecutive entries with same offset.
3635 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3637 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3638 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3639 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3640 to avoid unneeded links against $(LDADD).
3641 * testsuite/Makefile.in: Regenerate.
3643 2010-12-15 Ian Lance Taylor <iant@google.com>
3646 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3647 for R_X86_64_32 and R_X86_64_PC32.
3648 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3649 ver_matching_def_pic.o.
3650 (ver_matching_def_pic.o): New target.
3652 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3654 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3655 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3656 Move definition before File_read::View member definitions.
3657 (File_read::View::~View): Initialize and hold lock before
3658 updating current_mapped_bytes.
3660 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3662 * dwarf_reader.cc: Remove outdated comment.
3663 * gold-threads.cc: Fix typo in error message.
3664 * archive.cc: Fix typos in comments.
3665 * archive.h: Likewise.
3666 * arm-reloc-property.cc: Likewise.
3667 * arm-reloc-property.h: Likewise.
3668 * arm-reloc.def: Likewise.
3670 * attributes.h: Likewise.
3671 * cref.cc: Likewise.
3672 * ehframe.cc: Likewise.
3673 * fileread.h: Likewise.
3675 * i386.cc: Likewise.
3677 * incremental.h: Likewise.
3678 * int_encoding.cc: Likewise.
3679 * layout.h: Likewise.
3680 * main.cc: Likewise.
3681 * merge.h: Likewise.
3682 * object.cc: Likewise.
3683 * object.h: Likewise.
3684 * options.cc: Likewise.
3685 * readsyms.cc: Likewise.
3686 * reduced_debug_output.cc: Likewise.
3687 * reloc.cc: Likewise.
3688 * script-sections.cc: Likewise.
3689 * sparc.cc: Likewise.
3690 * symtab.h: Likewise.
3691 * target-reloc.h: Likewise.
3692 * target.cc: Likewise.
3693 * target.h: Likewise.
3694 * timer.cc: Likewise.
3695 * timer.h: Likewise.
3696 * x86_64.cc: Likewise.
3698 2010-12-09 Cary Coutant <ccoutant@google.com>
3700 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3702 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3703 parameter; change all callers.
3704 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3705 * options.h (warn_execstack): New option.
3707 2010-12-07 Doug Kwan <dougkwan@google.com>
3709 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3710 like function call relocations.
3712 2010-12-07 Ian Lance Taylor <iant@google.com>
3714 * archive.cc (Archive::get_elf_object_for_member): Permit
3715 punconfigured to be NULL.
3716 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3717 (Archive::include_member): Pass NULL to get_elf_object_for_member
3718 if we searched for the archive and this is the first included
3721 2010-12-01 Ian Lance Taylor <iant@google.com>
3723 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3724 track_relocs_type_ field.
3725 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3726 Set track_relocs_type_.
3727 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3728 contents when using RELA relocs.
3729 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3731 * reloc.cc (Track_relocs::next_addend): New function.
3732 * reloc.h (class Track_relocs): Declare next_addend.
3734 2010-12-01 Ian Lance Taylor <iant@google.com>
3736 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3739 2010-12-01 Ian Lance Taylor <iant@google.com>
3741 * README: Update compilers known to work and fail.
3743 2010-11-23 Matthias Klose <doko@ubuntu.com>
3745 * configure.in: For --enable-gold, handle value `default' instead of
3746 `both*'. Always install ld as ld.bfd, install as ld if gold is
3748 * configure: Regenerate.
3750 2010-11-18 Doug Kwan <dougkwan@google.com>
3752 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3753 and right_alignment to be zero. Store result alignment only if it is
3754 greater than existing alignment.
3756 2010-11-16 Cary Coutant <ccoutant@google.com>
3759 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3760 Check for ".zdebug_line".
3762 2010-11-16 Doug Kwan <dougkwan@google.com>
3763 Cary Coutant <ccoutant@google.com>
3765 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3766 by reference; adjust all callers.
3767 * output.cc (Output_segment::set_section_addresses): Adjust references
3768 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3770 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3771 end at page boundary.
3773 2010-11-16 Cary Coutant <ccoutant@google.com>
3776 * layout.cc (Layout::choose_output_section): Transform names of
3777 compressed sections even when using a script with a SECTIONS clause.
3778 (Layout::output_section_name): Remove code to transform
3779 compressed debug section names.
3780 * output.cc (Output_section::add_input_section): Use uncompressed
3781 section size when tracking input sections.
3783 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3785 * symtab.h (Symbol::NON_PIC_REF): Remove.
3786 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3787 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3788 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3789 (Symbol::use_plt_offset): Take a flags argument and pass it
3790 directly to needs_dynamic_reloc. Restrict check for undefined
3791 weak symbols to function calls.
3792 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3793 (Target_arm::Scan::global): Use it.
3794 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3795 (Target_arm::Relocate::relocate): Likewise.
3796 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3797 parameter with an r_type parameter. Use get_reference_flags
3799 (Target_arm::Relocate::relocate): Update accordingly.
3800 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3801 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3802 (Target_i386::Scan::global): Likewise.
3803 (Target_i386::Relocate::relocate): Likewise.
3804 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3805 parameter with an r_type parameter. Use get_reference_flags
3807 (Target_i386::Relocate::relocate): Update accordingly.
3808 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3809 (Target_powerpc::Scan::global): Use it.
3810 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3811 (Target_powerpc::Relocate::relocate): Likewise.
3812 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3813 (Target_sparc::Scan::global): Use it.
3814 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3815 (Target_sparc::Relocate::relocate): Likewise.
3816 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3817 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3818 (Target_x86_64::Scan::global): Likewise.
3819 (Target_x86_64::Relocate::relocate): Likewise.
3821 2010-11-08 Doug Kwan <dougkwan@google.com>
3822 Cary Coutant <ccoutant@google.com>
3824 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3825 (Arm_exidx_merge_section::section_contents_): New data member.
3826 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3827 (Arm_input_section::~Arm_input_section): De-allocate memory.
3828 (Arm_input_section::original_contents_): New data member.
3829 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3830 in parameters instead of calling Object::section_contents without
3832 (Arm_output_section::group_section): New parameter TASK. Pass it
3833 to callees that need locking objects.
3834 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3835 to lock EXIDX input sections. Fix a formatting issue. Call
3836 Arm_exidx_merged_section::build_contents to create merged section
3838 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3839 to lock object of stub table owner.
3840 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3841 TEXT_SIZE to initialize data member TEXT_SIZE_.
3842 (Arm_exidx_input_section::addralign): Fix typo in comment.
3843 (Arm_exidx_input_section::text_size): New method.
3844 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3845 that require locking objects. Lock objects before scanning for stubs
3846 and updating local symbols.
3847 (Arm_input_section<big_endian>::init): Copy contents of original
3849 (Arm_input_section<big_endian>::do_write): Use saved contents of
3850 original input section instead of calling Object::section_contents
3852 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3853 size without calling Object::section_size().
3854 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3855 for size. Allocate a buffer for merged EXIDX entries.
3856 (Arm_exidx_merged_section::build_contents): New method.
3857 (Arm_exidx_merged_section::do_write): Move merge section contents
3858 building code to Arm_exidx_merged_section::build_contetns. Write
3859 out contetns in buffer instead of building it on the fly.
3860 (Arm_relobj::make_exidx_input_section): Also pass text section size
3861 to Arm_exidx_input_section constructor.
3862 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3863 (Arm_dynobj::do_read_symbols): Fix memory leak.
3864 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3865 * target.h: (class Task): Add forward declaration.
3866 (Target::relax): Add new parameter TASK and pass it to
3868 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3870 2010-11-05 Cary Coutant <ccoutant@google.com>
3873 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3874 object when reading from the file.
3875 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3877 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3878 when reading section contents.
3879 (get_section_contents): Likewise.
3880 (icf::find_identical_sections): Likewise.
3881 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3882 object when reading from the file.
3883 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3884 the object when doing deferred section layout.
3886 2010-11-03 Nick Clifton <nickc@redhat.com>
3889 * script.h (class Symbol_assignment: name): New member. Returns
3890 the name of the symbol.
3891 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3892 Returns true if the given symbol name is on the list of
3893 assignments wating to be processed.
3894 * archive.cc (should_incldue_member): If the symbol is undefined,
3895 check to see if it is on the list of symbols pending assignment.
3897 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3899 * script-sections.cc (Script_sections::find_memory_region): Check
3900 for a NULL output section pointer.
3902 2010-10-29 Doug Kwan <dougkwan@google.com>
3904 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3905 Output_section::add_relaxed_input_section.
3906 * output.cc (Output_section::add_relaxed_input_section): Add new
3907 arguments LAYOUT and NAME. Set section order index.
3908 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3909 Copy section order index.
3910 * output.h (Output_section::add_relaxed_input_section): Add new
3911 arguments LAYOUT and NAME.
3913 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3915 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3916 NATIVE_OR_CROSS_LINKER.
3917 * testsuite/Makefile.in: Regenerate.
3919 2010-10-20 Doug Kwan <dougkwan@google.com>
3921 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3922 without SHF_LINK_ORDER flags.
3923 * layout.cc (Layout::choose_output_section): Do not filter
3924 SHF_LINK_ORDER flag in a relocatable link.
3926 2010-10-17 Cary Coutant <ccoutant@google.com>
3928 * output.h (Output_segment::set_section_addresses): Change function
3929 signature. Update all callers.
3930 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3932 (Output_segment::set_section_addresses): Align after last TLS
3933 section. Add padding before last relro section instead of after.
3935 2010-10-17 Doug Kwan <dougkwan@google.com>
3937 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3938 GOT output section to be writable.
3940 2010-10-14 Cary Coutant <ccoutant@google.com>
3942 * debug.h (DEBUG_INCREMENTAL): New flag.
3943 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3944 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3946 * incremental.cc (report_command_line): Ignore all forms of
3948 * layout.cc (Layout::Layout): Check parameters for incremental link
3950 * options.cc (General_options::parse_incremental): New function.
3951 (General_options::parse_no_incremental): New function.
3952 (General_options::parse_incremental_full): New function.
3953 (General_options::parse_incremental_update): New function.
3954 (General_options::incremental_mode_): New data member.
3955 (General_options::finalize): Check incremental_mode_.
3956 * options.h (General_options): Update help text for --incremental.
3957 Add --no-incremental, --incremental-full, --incremental-update.
3958 (General_options::Incremental_mode): New enum type.
3959 (General_options::incremental_mode): New function.
3960 (General_options::incremental_mode_): New data member.
3961 * parameters.cc (Parameters::incremental_mode_): New data member.
3962 (Parameters::set_options): Set incremental_mode_.
3963 (Parameters::set_incremental_full): New function.
3964 (Parameters::incremental): New function.
3965 (Parameters::incremental_update): New function.
3966 (set_parameters_incremental_full): New function.
3967 * parameters.h (Parameters::set_incremental_full): New function.
3968 (Parameters::incremental): New function.
3969 (Parameters::incremental_update): New function.
3970 (Parameters::incremental_mode_): New data member.
3971 (set_parameters_incremental_full): New function.
3972 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3973 incremental link mode.
3974 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3975 (Sized_relobj::do_relocate_sections): Likewise.
3976 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3978 * testsuite/Makefile.in: Regenerate.
3979 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3981 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3983 * script-sections.h (class Script_sections): Make
3984 Sections_elements typedef public.
3985 * script-sections.cc (class Sort_output_sections): Add elements_
3986 field. Add constructor which sets it; change all callers.
3987 (Sort_output_sections::is_before): New function.
3988 (Sort_output_sections::operator()): Call is_before.
3989 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3991 * testsuite/script_test_10.sh: New test. Test script section
3993 * testsuite/script_test_10.t: Likewise.
3994 * testsuite/script_test_10.s: Likewise.
3995 * testsuite/Makefile.am: Wrap the cross linker tests and the
3996 common tests into NATIVE_OR_CROSS_LINKER.
3997 (check_SCRIPTS): Add script_test_10.sh.
3998 (check_DATA): Add script_test_10.stdout.
3999 (script_test_10.o, script_test_10): New targets.
4000 (script_test_10.stdout): New target.
4001 * configure, testsuite/Makefile.in: Regenerate.
4003 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4005 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4006 error for the deprecated relocations.
4007 (Target_arm::Scan::global): Likewise.
4008 (Target_arm::Relocate::relocate): Likewise.
4010 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4012 * fileread.cc (Input_file::find_file): Initialize *found_name
4013 and *namep when using the fallback search for case 4.
4015 2010-10-11 Cary Coutant <ccoutant@google.com>
4017 * options.h (class General_options): Redefine -z lazy as an alias for
4018 the negation of -z now.
4020 2010-10-11 Ian Lance Taylor <iant@google.com>
4022 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4025 2010-10-06 Nick Clifton <nickc@redhat.com>
4027 * script-sections.cc(class Memory_region): Remove
4028 current_lma_offset_ field. Rename current_vma_offset_ to
4029 current_offset_. Add last_section_ field.
4030 (Memory_region::get_current_vma_address): Rename to
4031 get_current_address.
4032 (Memory_region::get_current_lma_address): Delete.
4033 (Memory_region::increment_vma_offset): Rename to
4035 (Memory_region::increment_lma_offset): Delete.
4036 (Memory_region::attributes_compatible): New method. Returns
4037 true if the provided section is compatible with the region.
4038 (Memory_region::get_last_section): New method. Returns the last
4039 section to use the region.
4040 (Memory_region::set_last_section): New method. Stores the last
4041 section to use the region.
4042 (Script_sections::block_in_region): New method. Returns true if
4043 a block of memory is contained within a region.
4044 (Script_sections::find_memory_region): New method. Locates a
4045 memory region to be used to set a VMA or LMA address.
4046 (Output_section_definition::set_section_addresses): Add code to
4047 check for addresses set by memory regions.
4048 (Output_segment::set_section_addresses): Remove memory region
4050 (Script_sections::create_segment): Add a warning if a header
4051 segment is created outside of any region.
4052 * script-sections.h (class Script_sections): Add prototypes for
4053 find_memory_region and block_in_region methods.
4054 * testsuite/memory_test.s: Use .long instead of .word.
4055 * testsuite/memory_test.t: Add some more output sections.
4056 * testsuite/memory_test.sh: Update expected output.
4058 2010-10-02 Doug Kwan <dougkwan@google.com>
4060 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4061 defintion to symtab.h
4062 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4063 declaration to defintion.
4065 2010-10-01 Nick Clifton <nickc@redhat.com>
4067 * expression.cc (eval): Replace dummy argument with NULL.
4068 (eval_maybe_dot): Check for a NULL result section pointer.
4069 (Symbol_expression::value): Likewise.
4070 (Dot_expression::value): Likewise.
4071 (BINARY_EXPRESSION): Likewise.
4072 (Max_expression::value): Likewise.
4073 (Min_expression::value): Likewise.
4074 (Absolute_expression::value): Likewise.
4075 (Addr_expression::value_from_output_section): Likewise.
4076 (Loaddddr_expression::value_from_output_section): Likewise.
4077 (Segment_start_expression::value): Likewise.
4078 * script-sections.cc
4079 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4081 (Sections_elememt_dot_assignment::set_section_addresses):
4083 (Output_data_expression::do_write_to_buffer): Likewise.
4084 (Output_section_definition::finalize_symbols): Likewise.
4085 (Output_section_definition::set_section_addresses): Likewise.
4087 2010-09-30 Doug Kwan <dougkwan@google.com>
4089 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4091 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4093 * target.h (Target::can_icf_inline_merge_sections): New virtual
4095 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4097 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4099 * icf.cc (get_section_contents): Inline merge sections only when
4102 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4104 * configure: Regenerate.
4106 2010-09-17 Ian Lance Taylor <iant@google.com>
4108 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4109 * testsuite/Makefile.am (memory_test.o): New target.
4110 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4112 * testsuite/Makefile.in: Rebuild.
4114 2010-09-17 Doug Kwan <dougkwan@google.com>
4116 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4117 defintion if relocation uses GOT entries of the symbol.
4118 * testsuite/icf_safe_test.sh: Fix test.
4119 * testsuite/icf_safe_so_test.sh: Fix test.
4121 2010-09-16 Cary Coutant <ccoutant@google.com>
4123 * script_sections.cc (class Memory_region): Remove "NULL" from
4124 vector initializations.
4126 2010-09-15 Cary Coutant <ccoutant@google.com>
4128 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4129 Resolve forwarding symbols.
4131 2010-09-15 Doug Kwan <dougkwan@google.com>
4133 * gold/testsuite/script_test_3.t: Add ARM special sections.
4134 * gold/testsuite/script_test_4.t: Same.
4135 * gold/testsuite/script_test_5.t: Same.
4136 * gold/testsuite/script_test_6.t: Same.
4137 * gold/testsuite/script_test_7.t: Same.
4138 * gold/testsuite/script_test_7.t: Same.
4139 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4141 2010-09-14 Cary Coutant <ccoutant@google.com>
4143 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4144 (Target_x86_64::Relocate::relocate_tls): Replace check for
4145 saw_tls_block_reloc_ with test for executable section.
4147 2010-09-12 Cary Coutant <ccoutant@google.com>
4149 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4150 position-independent executables to shared libraries need dynamic
4152 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4153 position-independent executables.
4154 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4155 * testsuite/Makefile.in: Regenerate.
4157 2010-09-10 Nick Clifton <nickc@redhat.com>
4160 * testsuite/memory_test.t: Discard any sections that are not
4163 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4166 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4167 "This::" to work around a bug in gcc 4.2.
4169 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4171 2010-09-09 Rafael Espindola <espindola@google.com>
4173 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4174 sections with different PF_X flags in the same segment.
4175 (Layout::find_first_load_seg): Search all segments to find the first
4177 * options.h (rosegment): New.
4179 2010-09-08 Rafael Espindola <espindola@google.com>
4181 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4183 2010-09-08 Doug Kwan <dougkwan@google.com>
4185 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4186 (Arm_relobj::do_relocate_sections): Add new parameter for output
4187 file to match the parent.
4188 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4189 of local symbols instead of input values. Update code to track
4190 changes in gold::relocate_section.
4191 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4192 (Sized_relobj::compute_final_local_value_internal): New methods.
4193 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4194 body into private version of Sized_relobj::compute_final_local_value.
4195 Call the inline method.
4196 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4197 merged symbol value if there is one.
4198 (Symbol_value::has_output_value): New method defintiion.
4199 (Sized_relobj::Compute_final_local_value_status): New enum type.
4200 (Sized_relobj::compute_final_local_value): New methods.
4201 (Sized_relobj::compute_final_local_value_internal): New methods.
4202 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4203 and arm_cortex_a8.sh.
4204 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4205 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4207 * Makefile.in: Regenerate.
4208 * testsuite/arm_bl_out_of_range.s: Update test.
4209 * testsuite/thumb_bl_out_of_range.s: Ditto.
4210 * testsuite/thumb_blx_out_of_range.s: Ditto.
4211 * testsuite/arm_branch_out_of_range.sh: New file.
4212 * testsuite/arm_cortex_a8.sh: Ditto.
4213 * testsuite/arm_cortex_a8_b.s: Ditto.
4214 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4215 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4216 * testsuite/arm_cortex_a8_bl.s: Ditto.
4217 * testsuite/arm_cortex_a8_blx.s: Ditto.
4218 * testsuite/arm_cortex_a8_local.s: Ditto.
4219 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4220 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4222 2010-09-08 Rafael Espindola <espindola@google.com>
4224 * Makefile.am (memory_test.stdout): Run readelf with -W.
4225 * Makefile.in: Regenerate.
4226 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4229 2010-09-08 Rafael Espindola <espindola@google.com>
4231 * script-sections.cc (Script_sections::add_memory_region): Convert
4232 field precision to int.
4233 * script.cc (script_set_section_region, script_set_section_region):
4234 Convert field precision to int.
4236 2010-09-08 Rafael Espindola <espindola@google.com>
4238 * arm.cc (do_finalize_sections): Create the __exidx_start and
4239 __exdix_end symbols even when the section is missing.
4241 2010-09-08 Nick Clifton <nickc@redhat.com>
4243 * README: Remove claim that MEMORY is not supported.
4244 * expression.cc (script_exp_function_origin)
4245 (script_exp_function_length): Move from here to ...
4246 * script.cc: ... here.
4247 (script_set_section_region, script_add_memory)
4248 (script_parse_memory_attr, script_include_directive): New
4250 * script-sections.cc
4251 (class Memory_region): New class.
4252 (class Output_section_definition): Add set_memory_region,
4253 set_section_vma, set_section_lma and get_section_name methods.
4254 (class Script_Sections): Add add_memory_region,
4255 find_memory_region, find_memory_region_origin,
4256 find_memory_region_length and set_memory_region methods.
4257 Have set_section_addresses method walk the list of set memory
4259 Extend the print methos to display memory regions.
4260 * script-sections.h: Add prototypes for new methods.
4261 Add enum for MEMORY region attributes.
4262 * yyscript.y: Add support for parsing MEMORY regions.
4263 * script-c.h: Add prototypes for new functions.
4264 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4265 * testsuite/Makefile.in: Regenerate.
4266 * testsuite/memory_test.sh: New script.
4267 * testsuite/memory_test.s: New assembler source file.
4268 * testsuite/memory_test.t: New linker script.
4270 2010-08-27 Doug Kwan <dougkwan@google.com>
4272 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4273 reference override an existing dynamic weak reference.
4274 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4275 * testsuite/Makefile.in: Regenerate.
4276 * testsuite/dyn_weak_ref.sh: New file.
4277 * testsuite/dyn_weak_ref_1.c: Ditto.
4278 * testsuite/dyn_weak_ref_2.c: Ditto.
4280 2010-08-27 Ian Lance Taylor <iant@google.com>
4282 * incremental.h (class Incremental_input_entry): Add virtual
4285 2010-08-27 Ian Lance Taylor <iant@google.com>
4287 * testsuite/start_lib_test_3.c: Mark t3 as used.
4289 2010-08-27 Nick Clifton <nickc@redhat.com>
4291 * options.cc (version_script): Fix small typo in previous
4294 2010-08-25 Nick Clifton <nickc@redhat.com>
4296 * archive.cc: Formatting fixes: Remove whitespace between
4297 typename and following asterisk. Remove whitespace between
4298 function name and opening parenthesis.
4299 * archive.h: Likewise.
4301 * attributes.cc: Likewise.
4302 * attributes.h: Likewise.
4303 * common.cc: Likewise.
4304 * copy-relocs.cc: Likewise.
4305 * dirsearch.h: Likewise.
4306 * dynobj.cc: Likewise.
4307 * ehframe.cc: Likewise.
4308 * ehframe.h: Likewise.
4309 * expression.cc: Likewise.
4310 * fileread.cc: Likewise.
4311 * fileread.h: Likewise.
4313 * gold-threads.cc: Likewise.
4314 * gold.cc: Likewise.
4315 * i386.cc: Likewise.
4317 * incremental-dump.cc: Likewise.
4318 * incremental.cc: Likewise.
4319 * layout.cc: Likewise.
4320 * layout.h: Likewise.
4321 * main.cc: Likewise.
4322 * merge.cc: Likewise.
4323 * merge.h: Likewise.
4324 * object.cc: Likewise.
4325 * object.h: Likewise.
4326 * options.cc: Likewise.
4327 * options.h: Likewise.
4328 * output.cc: Likewise.
4329 * output.h: Likewise.
4330 * plugin.cc: Likewise.
4331 * plugin.h: Likewise.
4332 * powerpc.cc: Likewise.
4333 * reloc.cc: Likewise.
4334 * script-c.h: Likewise.
4335 * script-sections.cc: Likewise.
4336 * script.cc: Likewise.
4337 * stringpool.cc: Likewise.
4338 * symtab.cc: Likewise.
4339 * symtab.h: Likewise.
4340 * target.cc: Likewise.
4341 * timer.cc: Likewise.
4342 * timer.h: Likewise.
4343 * version.cc: Likewise.
4344 * x86_64.cc: Likewise.
4346 2010-08-24 Nick Clifton <nickc@redhat.com>
4349 * layout.cc (segment_precedes): Sort segments by their physical
4350 addresses, if they have been set.
4352 2010-08-23 Cary Coutant <ccoutant@google.com>
4354 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4356 (Lib_group::include_member): Unlock object after deleting its
4358 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4361 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4362 Cary Coutant <ccoutant@google.com>
4364 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4365 constructor, and set_blocker.
4366 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4368 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4369 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4370 * testsuite/Makefile.am (start_lib_test): New test case.
4371 * testsuite/Makefile.in: Regenerate.
4372 * testsuite/start_lib_test_main.c: New file.
4373 * testsuite/start_lib_test_1.c: New file.
4374 * testsuite/start_lib_test_2.c: New file.
4375 * testsuite/start_lib_test_3.c: New file.
4377 2010-08-19 Ian Lance Taylor <iant@google.com>
4379 * Makefile.in: Rebuild with automake 1.11.1.
4380 * aclocal.m4: Likewise.
4381 * testsuite/Makefile.in: Likewise.
4383 2010-08-19 Ian Lance Taylor <iant@google.com>
4386 * i386.cc (class Output_data_plt_i386): Update declarations.
4387 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4388 local_ifuncs_ fields.
4389 (Target_i386::do_plt_section_for_global): New function.
4390 (Target_i386::do_plt_section_for_local): New function.
4391 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4392 parameter; change all callers. Initialize global_ifuncs_ and
4393 local_ifuncs_. If doing a static link define __rel_iplt_start and
4395 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4396 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4397 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4399 (Target_i386::make_plt_section): New function, broken out of
4400 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4401 (Target_i386::make_plt_entry): Call make_plt_section.
4402 (Target_i386::make_local_ifunc_plt_entry): New function.
4403 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4404 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4405 R_386_IRELATIVE to switch.
4406 (Target_i386::Scan::global): Likewise.
4407 (Target_i386::Relocate::relocate): Likewise.
4408 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4410 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4411 (Target_x86_64::do_plt_section_for_global): New function.
4412 (Target_x86_64::do_plt_section_for_local): New function.
4413 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4414 parameter; change all callers. If doing a static link define
4415 __rela_iplt_start and __rela_iplt_end.
4416 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4417 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4418 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4420 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4421 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4423 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4424 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4425 R_X86_64_IRELATIVE to switch.
4426 (Target_x86_64::Scan::global): Likewise.
4427 (Target_x86_64::Relocate::relocate): Likewise.
4428 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4430 * target.h (class Target): Add plt_section_for_global and
4431 plt_section_for_local functions. Add do_plt_section_for_global
4432 and do_plt_section_for_local virtual functions.
4433 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4434 clarifying comments.
4435 (Symbol::use_plt_offset): Handle IFUNC symbol.
4436 * object.cc (Sized_relobj::Sized_relobj): Initialize
4438 (Sized_relobj::local_has_plt_offset): New function.
4439 (Sized_relobj::local_plt_offset): New function.
4440 (Sized_relobj::set_local_plt_offset): New function.
4441 (Sized_relobj::do_count): Handle IFUNC symbol.
4442 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4443 a bit away from input_shndx_ field. Add set_is_func_symbol and
4444 is_ifunc_symbol functions.
4445 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4446 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4447 local_plt_offsets_ field.
4448 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4449 * output.h (class Output_section_data): Add non-const
4450 output_section function.
4451 (class Output_data_got): Update declarations.
4452 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4453 Add use_plt_offset parameter to global and local constructors.
4454 Change all callers. Change local_sym_index_ field to 31 bits.
4455 Change GSYM_CODE and CONSTANT_CODE accordingly.
4456 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4457 doing a static link don't set sh_link field.
4458 (Output_data_got::Got_entry::write): Use PLT offset if
4460 (Output_data_got::add_global_plt): New function.
4461 (Output_data_got::add_local_plt): New function.
4462 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4463 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4464 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4465 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4466 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4468 * testsuite/ifunc-sel.h: New file.
4469 * testsuite/ifuncmain1.c: New file.
4470 * testsuite/ifuncmain1vis.c: New file.
4471 * testsuite/ifuncmod1.c: New file.
4472 * testsuite/ifuncdep2.c: New file.
4473 * testsuite/ifuncmain2.c: New file.
4474 * testsuite/ifuncmain3.c: New file.
4475 * testsuite/ifuncmod3.c: New file.
4476 * testsuite/ifuncmain4.c: New file.
4477 * testsuite/ifuncmain5.c: New file.
4478 * testsuite/ifuncmod5.c: New file.
4479 * testsuite/ifuncmain6pie.c: New file.
4480 * testsuite/ifuncmod6.c: New file.
4481 * testsuite/ifuncmain7.c: New file.
4482 * configure, testsuite/Makefile.in: Rebuild.
4484 2010-08-18 Ian Lance Taylor <iant@google.com>
4487 (Output_section_incremental_inputs::write_input_files): Add cast
4488 to avoid signed/unsigned comparison warning.
4489 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4491 2010-08-12 Cary Coutant <ccoutant@google.com>
4493 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4495 2010-08-13 Ian Lance Taylor <iant@google.com>
4497 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4499 2010-08-12 Cary Coutant <ccoutant@google.com>
4500 Doug Kwan <dougkwan@google.com>
4502 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4503 defintion overrides non-weak undef, remember that the original undef
4505 * symtab.cc (Symbol_table::sized_write_global): For undef without
4506 an original weak binding, set binding to global in output.
4507 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4508 * testsuite/Makefile.in: Regenerate.
4509 * testsuite/strong_ref_weak_def.sh: New file.
4510 * testsuite/strong_ref_weak_def_1.c: Ditto.
4511 * testsuite/strong_ref_weak_def_2.c: Ditto.
4513 2010-08-12 Cary Coutant <ccoutant@google.com>
4515 * testsuite/incremental_test.sh: Rewrite.
4516 * testsuite/incremental_test_1.c: Rewrite.
4517 * testsuite/incremental_test_2.c: Rewrite.
4519 2010-08-12 Cary Coutant <ccoutant@google.com>
4521 * arm.cc (Target_arm::got_size): Add const.
4522 (Target_arm::got_entry_count): New function.
4523 (Target_arm::plt_entry_count): New function.
4524 (Target_arm::first_plt_entry_offset): New function.
4525 (Target_arm::plt_entry_size): New function.
4526 (Output_data_plt_arm::entry_count): New function.
4527 (Output_data_plt_arm::first_plt_entry_offset): New function.
4528 (Output_data_plt_arm::get_plt_entry_size): New function.
4529 * i386.cc (Target_i386::got_size): Add const.
4530 (Target_i386::got_entry_count): New function.
4531 (Target_i386::plt_entry_count): New function.
4532 (Target_i386::first_plt_entry_offset): New function.
4533 (Target_i386::plt_entry_size): New function.
4534 (Output_data_plt_i386::entry_count): New function.
4535 (Output_data_plt_i386::first_plt_entry_offset): New function.
4536 (Output_data_plt_i386::get_plt_entry_size): New function.
4537 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4538 find_incremental_inputs_sections. Dump incremental_got_plt section.
4539 * incremental.cc: Include target.h.
4540 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4541 parameter. Adjust all callers. Find incremental_got_plt section.
4542 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4544 (Output_section_incremental_inputs::set_final_data_size): Calculate
4545 size of incremental_got_plt section.
4546 (Output_section_incremental_inputs::do_write): Write the
4547 incremental_got_plt section.
4548 (Got_plt_view_info): New struct.
4549 (Local_got_offset_visitor): New class.
4550 (Global_got_offset_visitor): New class.
4551 (Global_symbol_visitor_got_plt): New class.
4552 (Output_section_incremental_inputs::write_got_plt): New function.
4553 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4554 Add parameter. Adjust all callers.
4555 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4556 (Incremental_inputs::got_plt_section): New function.
4557 (Incremental_inputs::got_plt_section_): New data member.
4558 (Incremental_got_plt_reader): New class.
4559 * layout.cc (Layout::create_incremental_info_sections): Add the
4560 incremental_got_plt section.
4561 * object.h (Got_offset_list::get_list): New function.
4562 (Got offset_list::for_all_got_offsets): New function.
4563 (Sized_relobj::local_got_offset_list): New function.
4564 * powerpc.cc (Target_powerpc::got_size): Add const.
4565 (Target_powerpc::got_entry_count): New function.
4566 (Target_powerpc::plt_entry_count): New function.
4567 (Target_powerpc::first_plt_entry_offset): New function.
4568 (Target_powerpc::plt_entry_size): New function.
4569 (Output_data_plt_powerpc::entry_count): New function.
4570 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4571 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4572 * sparc.cc (Target_sparc::got_size): Add const.
4573 (Target_sparc::got_entry_count): New function.
4574 (Target_sparc::plt_entry_count): New function.
4575 (Target_sparc::first_plt_entry_offset): New function.
4576 (Target_sparc::plt_entry_size): New function.
4577 (Output_data_plt_sparc::entry_count): New function.
4578 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4579 (Output_data_plt_sparc::get_plt_entry_size): New function.
4580 * symtab.h (Symbol::got_offset_list): New function.
4581 (Symbol_table::for_all_symbols): New function.
4582 * target.h (Sized_target::got_entry_count): New function.
4583 (Sized_target::plt_entry_count): New function.
4584 (Sized_target::plt_entry_size): New function.
4585 * x86_64.cc (Target_x86_64::got_size): Add const.
4586 (Target_x86_64::got_entry_count): New function.
4587 (Target_x86_64::plt_entry_count): New function.
4588 (Target_x86_64::first_plt_entry_offset): New function.
4589 (Target_x86_64::plt_entry_size): New function.
4590 (Output_data_plt_x86_64::entry_count): New function.
4591 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4592 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4594 2010-08-12 Cary Coutant <ccoutant@google.com>
4596 * archive.cc: Include incremental.h.
4597 (Archive::Archive): Initialize incremental_info_.
4598 (Archive::include_member): Record archive members in incremental info.
4599 (Add_archive_symbols::run): Record begin and end of an archive in
4601 (Lib_group::include_member): Record objects in incremental info.
4602 * archive.h (Incremental_archive_entry): Forward declaration.
4603 (Archive::set_incremental_info): New member function.
4604 (Archive::incremental_info): New member function.
4605 (Archive::Unused_symbol_iterator): New class.
4606 (Archive::unused_symbols_begin): New member function.
4607 (Archive::unused_symbols_end): New member function.
4608 (Archive::incremental_info_): New data member.
4609 * incremental-dump.cc (find_input_containing_global): New function.
4610 (dump_incremental_inputs): Dump new incremental info sections.
4611 * incremental.cc: Include symtab.h.
4612 (Output_section_incremental_inputs): New class.
4613 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4614 new incremental info sections.
4615 (Sized_incremental_binary::do_check_inputs): Likewise.
4616 (Incremental_inputs::report_archive): Remove.
4617 (Incremental_inputs::report_archive_begin): New function.
4618 (Incremental_inputs::report_archive_end): New function.
4619 (Incremental_inputs::report_object): New function.
4620 (Incremental_inputs::finalize_inputs): Remove.
4621 (Incremental_inputs::report_input_section): New function.
4622 (Incremental_inputs::report_script): Rewrite.
4623 (Incremental_inputs::finalize): Do nothing but finalize string table.
4624 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4625 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4626 (Incremental_inputs::create_data_sections): New function.
4627 (Incremental_inputs::relocs_entsize): New function.
4628 (Output_section_incremental_inputs::set_final_data_size): New function.
4629 (Output_section_incremental_inputs::do_write): New function.
4630 (Output_section_incremental_inputs::write_header): New function.
4631 (Output_section_incremental_inputs::write_input_files): New function.
4632 (Output_section_incremental_inputs::write_info_blocks): New function.
4633 (Output_section_incremental_inputs::write_symtab): New function.
4634 * incremental.h (Incremental_script_entry): Forward declaration.
4635 (Incremental_object_entry): Forward declaration.
4636 (Incremental_archive_entry): Forward declaration.
4637 (Incremental_inputs): Forward declaration.
4638 (Incremental_inputs_header_data): Remove.
4639 (Incremental_inputs_header): Remove.
4640 (Incremental_inputs_header_write): Remove.
4641 (Incremental_inputs_entry_data): Remove.
4642 (Incremental_inputs_entry): Remove.
4643 (Incremental_inputs_entry_write): Remove.
4644 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4645 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4646 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4647 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4649 (Incremental_input_entry): New class.
4650 (Incremental_script_entry): New class.
4651 (Incremental_object_entry): New class.
4652 (Incremental_archive_entry): New class.
4653 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4654 (Incremental_inputs::report_inputs): Remove.
4655 (Incremental_inputs::report_archive): Remove.
4656 (Incremental_inputs::report_archive_begin): New function.
4657 (Incremental_inputs::report_archive_end): New function.
4658 (Incremental_inputs::report_object): Change prototype.
4659 (Incremental_inputs::report_input_section): New function.
4660 (Incremental_inputs::report_script): Change prototype.
4661 (Incremental_inputs::get_reloc_count): New function.
4662 (Incremental_inputs::set_reloc_count): New function.
4663 (Incremental_inputs::create_data_sections): New function.
4664 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4665 (Incremental_inputs::inputs_section): New function.
4666 (Incremental_inputs::symtab_section): New function.
4667 (Incremental_inputs::relocs_section): New function.
4668 (Incremental_inputs::get_stringpool): Add const.
4669 (Incremental_inputs::command_line): Add const.
4670 (Incremental_inputs::inputs): Remove.
4671 (Incremental_inputs::command_line_key): New function.
4672 (Incremental_inputs::input_file_count): New function.
4673 (Incremental_inputs::input_files): New function.
4674 (Incremental_inputs::relocs_entsize): New function.
4675 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4676 (Incremental_inputs::finalize_inputs): Remove.
4677 (Incremental_inputs::Input_info): Remove.
4678 (Incremental_inputs::lock_): Remove.
4679 (Incremental_inputs::inputs_): Change type.
4680 (Incremental_inputs::inputs_map_): Remove.
4681 (Incremental_inputs::current_object_entry_): New data member.
4682 (Incremental_inputs::inputs_section_): New data member.
4683 (Incremental_inputs::symtab_section_): New data member.
4684 (Incremental_inputs::relocs_section_): New data member.
4685 (Incremental_inputs::reloc_count_): New data member.
4686 (Incremental_inputs_reader): New class.
4687 (Incremental_symtab_reader): New class.
4688 (Incremental_relocs_reader): New class.
4689 * layout.cc (Layout::finalize): Move finalization of incremental info
4690 and creation of incremental info sections to follow finalization of
4691 symbol table. Set offsets for postprocessing sections.
4692 (Layout::create_incremental_info_sections): Call
4693 Incremental_inputs::create_data_sections. Add incremental symtab
4694 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4695 sections to layout after input sections.
4696 * layout.h (struct Timespec): Forward declaration.
4697 (Layout::incremental_inputs): Add const.
4698 (Layout::create_incremental_info_sections): Add parameter.
4699 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4700 * object.cc: Include incremental.h.
4701 (Relobj::finalize_incremental_relocs): New function.
4702 (Sized_relobj::do_layout): Record input sections in incremental info.
4703 * object.h (Object::output_section): New function.
4704 (Object::output_section_offset): Moved from Relobj.
4705 (Object::get_incremental_reloc_base): New function.
4706 (Object::get_incremental_reloc_count): New function.
4707 (Object::do_output_section): New function.
4708 (Object::do_output_section_offset): Moved from Relobj.
4709 (Object::do_get_incremental_reloc_base): New function.
4710 (Object::do_get_incremental_reloc_count): New function.
4711 (Object::Object): Initialize new data members.
4712 (Relobj::output_section): Renamed do_output_section and moved to
4714 (Relobj::output_section_offset): Moved to Object.
4715 (Relobj::do_get_incremental_reloc_base): New function.
4716 (Relobj::do_get_incremental_reloc_count): New function.
4717 (Relobj::allocate_incremental_reloc_counts): New function.
4718 (Relobj::count_incremental_reloc): New function.
4719 (Relobj::finalize_incremental_relocs): New function.
4720 (Relobj::next_incremental_reloc_index): New function.
4721 (Relobj::reloc_counts_): New data member.
4722 (Relobj::reloc_bases_): New data member.
4723 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4724 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4725 (Sized_relobj::incremental_relocs_scan): New function.
4726 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4727 (Sized_relobj::incremental_relocs_write): New function.
4728 (Sized_relobj::incremental_relocs_write_reltype): New function.
4729 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4731 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4732 archives and object files elsewhere.
4733 (Add_symbols::run): Report object files here.
4734 (Finish_group::run): Report end of archive at end of group.
4735 * reloc.cc: Include layout.h, incremental.h.
4736 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4737 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4738 (Sized_relobj::incremental_relocs_scan): New function.
4739 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4740 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4741 (Sized_relobj::incremental_relocs_write): New function.
4742 (Sized_relobj::incremental_relocs_write_reltype): New function.
4743 * script.cc (read_input_script): Rewrite test for incremental link.
4744 Change call to Incremental_inputs::report_script.
4745 * symtab.h (Symbol_table::first_global_index): New function.
4746 (Symbol_table::output_count): New function.
4748 2010-08-12 Doug Kwan <dougkwan@google.com>
4750 * arm.cc (Target_arm::merge_object_attributes): Check command line
4751 options --no-wchar-size-warning and --no-enum-size-warning.
4752 * options.h (General_options): Add ld-compatible options
4753 --no-enum-size-warning and --no-wchar-size-warning.
4755 2010-08-04 Ian Lance Taylor <iant@google.com>
4757 * x86_64.cc (Target_x86_64::Scan::local): Use
4758 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4759 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4760 (Target_x86_64::Scan::global): Likewise.
4761 (Target_x86_64::Relocate::relocate): Likewise.
4762 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4765 2010-08-03 Cary Coutant <ccoutant@google.com>
4767 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4768 to reserve space in merged_strings vector. Keep total input size
4770 (Output_merge_string::do_print_merge_stats): Print total input size.
4771 * merge.h (Output_merge_string): Add input_size_ field.
4772 * stringpool.cc (Stringpool_template::string_length): Move
4773 implementations out of Stringpool_template class and place in
4775 * stringpool.h (string_length): Move out of Stringpool_template.
4777 2010-08-03 Ian Lance Taylor <iant@google.com>
4780 * layout.cc (relaxation_loop_body): If address of load segment is
4781 set, adjust address to include headers if possible.
4783 2010-08-03 Ian Lance Taylor <iant@google.com>
4785 * version.cc (version_string): Bump to 1.10.
4787 2010-08-03 Ian Lance Taylor <iant@google.com>
4790 * layout.h (enum Output_section_order): Define.
4791 (class Layout): Update declarations.
4792 * layout.cc (Layout::get_output_section): Add order parameter.
4793 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4794 is_first_non_relro parameters. Change all callers.
4795 (Layout::choose_output_section): Likewise.
4796 (Layout::add_output_section_data): Likewise.
4797 (Layout::make_output_section): Likewise. Set order.
4798 (Layout::default_section_order): New function.
4799 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4800 * output.cc (Output_section::Output_section): Initialize order_.
4801 Don't initialize deleted fields.
4802 (Output_segment::Output_segment): Don't initialize deleted
4804 (Output_segment::add_output_section_to_load): New function
4805 replacing add_output_section. Change all callers to call this or
4806 add_output_section_to_nonload.
4807 (Output_segment::add_output_section_to_nonload): New function.
4808 (Output_segment::remove_output_section): Rewrite.
4809 (Output_segment::add_initial_output_data): Likewise.
4810 (Output_segment::has_any_data_sections): Likewise.
4811 (Output_segment::is_first_section_relro): Likewise.
4812 (Output_segment::maximum_alignment): Likewise.
4813 (Output_segment::has_dynamic_reloc): New function replacing
4814 dynamic_reloc_count. Change all callers.
4815 (Output_segment::has_dynamic_reloc_list): New function replacing
4816 dynamic_reloc_count_list. Change all callers.
4817 (Output_segment::set_section_addresses): Rewrite.
4818 (Output_segment::set_offset): Rewrite.
4819 (Output_segment::find_first_and_last_list): Remove.
4820 (Output_segment::set_tls_offsets): Rewrite.
4821 (Output_segment::first_section_load_address): Likewise.
4822 (Output_segment::output_section_count): Likewise.
4823 (Output_segment::section_with_lowest_load_address): Likewise.
4824 (Output_segment::write_section_headers): Likewise.
4825 (Output_segment::print_sections_to_map): Likewise.
4826 * output.h (class Output_data): Remove dynamic_reloc_count_
4827 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4828 (Output_data::add_dynamic_reloc): Rewrite.
4829 (Output_data::has_dynamic_reloc): New function.
4830 (Output_data::dynamic_reloc_count): Remove.
4831 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4832 is_last_relro_, is_first_non_relro_, is_interp_,
4833 is_dynamic_linker_section_ fields. Add order and set_order
4834 functions. Remove is_relro_local, set_is_relro_local,
4835 is_last_relro, set_is_last_relro, is_first_non_relro,
4836 set_is_first_non_relro functions, is_interp, set_is_interp,
4837 is_dynamic_linker_section, and set_is_dynamic_linker_section
4839 (class Output_segment): Change Output_data_list from std::list to
4840 std:;vector. Add output_lists_ field. Remove output_data_ and
4841 output_bss_ fields. Update declarations.
4843 2010-08-02 Ian Lance Taylor <iant@google.com>
4845 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4846 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4847 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4849 2010-08-02 Ian Lance Taylor <iant@google.com>
4852 * script.cc (Script_options::Script_options): Initialize
4853 symbol_definitions_ and symbol_references_.
4854 (Script_options::add_symbol_assignment): Update
4855 symbol_definitions_ and symbol_references_.
4856 (Script_options::add_symbol_reference): New function.
4857 (script_symbol): New function.
4858 * script.h (class Script_options): Add symbol_definitions_ and
4859 symbol_references_ fields.
4860 (Script_options::referenced_const_iterator): New type.
4861 (Script_options::referenced_begin): New function.
4862 (Script_options::referenced_end): New function.
4863 (Script_options::is_referenced): New function.
4864 (Script_options::any_unreferenced): New function.
4865 * script-c.h (script_symbol): Declare.
4866 * yyscript.y (exp): Call script_symbol.
4867 * symtab.cc: Include "script.h".
4868 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4869 Change all callers. Check symbols referenced by scripts.
4870 (Symbol_table::add_undefined_symbols_from_command_line): Add
4871 layout parameter. Change all callers.
4872 (Symbol_table::do_add_undefined_symbols_from_command_line):
4873 Likewise. Break out loop body. Check symbols referenced by
4875 (Symbol_table::add_undefined_symbol_from_command_line): New
4876 function broken out of
4877 do_add_undefined_symbols_from_command_line.
4878 * symtab.h (class Symbol_table): Update declarations.
4879 * archive.cc: Include "layout.h".
4880 (Archive::should_include_member): Add layout parameter. Change
4881 all callers. Check for symbol mentioned in expression.
4882 * archive.h (class Archive): Update declaration.
4883 * object.cc (Sized_relobj::do_should_include_member): Add layout
4885 * object.h (Object::should_include_member): Add layout parameter.
4887 (Object::do_should_include_member): Add layout parameter.
4888 (class Sized_relobj): Update declaration.
4889 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4891 * dynobj.h (class Sized_dynobj): Update declaration.
4892 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4894 * plugin.h (class Sized_pluginobj): Update declaration.
4896 2010-08-02 Ian Lance Taylor <iant@google.com>
4899 * output.cc (Output_segment::set_offset): Search for the first and
4900 last sections rather than assuming that the list is in order.
4901 (Output_segment::find_first_and_last_list): New function.
4902 * output.h (class Output_segment): Update declarations.
4903 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4904 (relro_strip_test_SOURCES): New variable.
4905 (relro_strip_test_DEPENDENCIES): New variable.
4906 (relro_strip_test_LDFLAGS): New variable.
4907 (relro_strip_test_LDADD): New variable.
4908 (relro_strip_test.so): New target.
4910 2010-08-02 Ian Lance Taylor <iant@google.com>
4912 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4913 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4914 (Target_i386::got_tlsdesc_section): New function.
4915 (Target_i386::got_section): Create space for GOT entries for
4916 TLSDESC relocations.
4917 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4919 (Target_i386::Scan::global): Likewise.
4920 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4922 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4923 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4924 (Target_x86_64::got_tlsdesc_section): New function.
4925 (Target_x86_64::got_section): Create space for GOT entries for
4926 TLSDESC relocations.
4927 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4929 (Target_x86_64::Scan::global): Likewise.
4930 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4933 2010-08-02 Ian Lance Taylor <iant@google.com>
4935 * testsuite/final_layout.sh: Use dc to convert from hex to
4938 2010-07-29 Sriraman Tallam <tmsriram@google.com>
4940 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4941 paramter to the call to gold::gc_process_relocs.
4942 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4943 paramter to the call to gold::gc_process_relocs.
4944 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4945 parameter to the call to gold::gc_process_relocs.
4946 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4947 template parameter to the call to gold::gc_process_relocs.
4948 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4949 paramter to the call to gold::gc_process_relocs.
4950 * gc.h (get_embedded_addend_size): New function.
4951 (gc_process_relocs): Save the size of the reloc for use by ICF.
4952 * icf.cc (get_section_contents): Get the addend from the text section
4953 for SHT_REL relocation sections.
4954 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4955 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4956 * int_encoding.h (read_from_pointer): New overloaded function.
4957 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4958 * testsuite/icf_sht_rel_addend_test.sh: New file.
4959 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4960 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4962 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4964 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4965 * Makefile.in: Regenerate.
4966 * testsuite/Makefile.in: Regenerate.
4968 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4970 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4971 * gold/testsuite/debug_msg.cc: Likewise.
4972 * gold/testsuite/odr_violation1.cc
4973 * gold/testsuite/odr_violation2.cc
4975 2010-07-21 Cary Coutant <ccoutant@google.com>
4977 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4978 string, and length fields.
4979 (Output_merge_string::Merged_strings_list): New type.
4980 (Output_merge_string::Merged_strings_lists): New typedef.
4981 (Output_merge_string): Replace merged_strings_ with
4982 merged_strings_lists_.
4983 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4984 Merged_strings_list per input object and section. Don't store pointer
4985 to the string. Don't store length with each merged string entry.
4986 (Output_merge_string::finalize_merged_data): Loop over list of merged
4987 strings lists. Recompute length of each merged string.
4989 2010-07-15 Cary Coutant <ccoutant@google.com>
4991 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4994 2010-07-14 Ian Lance Taylor <iant@google.com>
4996 * descriptors.cc (Descriptors::open): Report correct name in error
4999 2010-07-13 Doug Kwan <dougkwan@google.com>
5001 * arm.cc (Arm_input_section::Arm_input_section): For a
5002 SHT_ARM_EXIDX section, always keeps the input sections.
5003 (Arm_input_section::set_exidx_section_link): New method.
5004 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5005 has_errors_ to false.
5006 (Arm_exidx_input_section::has_errors,
5007 Arm_exidx_input_section::set_has_errors): New methods.
5008 (Arm_exidx_input_section::has_errors_): New data member.
5009 (Arm_relobj::get_exidx_shndx_list): New method.
5010 (Arm_output_section::append_text_sections_to_list): Do not skip
5011 section without SHF_EXECINSTR.
5012 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5014 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5015 section header. Make error messages more verbose. Check for
5016 a non-executable section linked to an EXIDX section.
5017 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5018 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5019 check that there is no deferred EXIDX section if we exit early.
5020 Instead of not making an EXIDX section in case of an error, make one
5021 and set the has_errors flag of it.
5022 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5023 in a relocatable link.
5024 (Target_arm::do_relax): Look for the EXIDX output section instead of
5025 assuming that it is called .ARM.exidx.
5026 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5027 section list. Do not check for SHF_EXECINSTR section flags but
5028 skip any input section with errors.
5029 * output.cc (Output_section::Output_section): Initialize
5030 always_keeps_input_sections_ to false.
5031 (Output_section::add_input_section): Check for
5032 always_keeps_input_sections_.
5033 * output.h (Output_section::always_keeps_input_sections,
5034 Output_section::set_always_keeps_input_sections): New methods.
5035 (Output_section::always_keeps_input_sections): New data member.
5037 2010-07-13 Rafael Espindola <espindola@google.com>
5039 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5040 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5042 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5043 Ian Lance Taylor <iant@google.com>
5045 * output.h (Output_section_lookup_maps::add_merge_section):
5046 Correct check of whether value was inserted.
5047 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5048 (Output_section_lookup_maps::add_relaxed_input_section):
5050 * arm.cc (Target_arm::got_section): Remove used local os.
5051 * i386.cc (Target_i386::got_section): Likewise.
5052 * x86_64.cc (Target_x86_64::got_section): Likewise.
5053 * sparc.cc (Target_sparc::got_section): Likewise.
5054 (Target_sparc::relocate): Remove unused local have_got_offset.
5055 * powerpc.cc (Target_powerpc::relocate): Likewise.
5057 2010-07-13 Ian Lance Taylor <iant@google.com>
5059 * compressed_output.cc (zlib_decompress): Fix signature in
5062 * archive.cc (Archive::include_member): Unlock an external member
5063 of a thin archive. Don't bother to delete an object we know is
5066 2010-07-12 Cary Coutant <ccoutant@google.com>
5068 * compressed_output.cc (zlib_decompress): New function.
5069 (get_uncompressed_size): New function.
5070 (decompress_input_section): New function.
5071 * compressed_output.h (get_uncompressed_size): New function.
5072 (decompress_input_section): New function.
5073 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5074 Handle compressed debug sections.
5075 * layout.cc (is_compressed_debug_section): New function.
5076 (Layout::output_section_name): Map compressed section names to
5078 * layout.h (is_compressed_debug_section): New function.
5079 (is_debug_info_section): Recognize compressed debug sections.
5080 * merge.cc: Include compressed_output.h.
5081 (Output_merge_data::do_add_input_section): Handle compressed
5083 (Output_merge_string::do_add_input_section): Handle compressed
5085 * object.cc: Include compressed_output.h.
5086 (Sized_relobj::Sized_relobj): Initialize new data members.
5087 (build_compressed_section_map): New function.
5088 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5089 * object.h (Object::section_is_compressed): New method.
5090 (Object::do_section_is_compressed): New method.
5091 (Sized_relobj::Compressed_section_map): New type.
5092 (Sized_relobj::do_section_is_compressed): New method.
5093 (Sized_relobj::compressed_sections_): New data member.
5094 * output.cc (Output_section::add_input_section): Handle compressed
5096 * reloc.cc: Include compressed_output.h.
5097 (Sized_relobj::write_sections): Handle compressed debug sections.
5099 2010-07-08 Cary Coutant <ccoutant@google.com>
5101 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5102 weak when resolving to a dynamic def.
5103 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5104 for weak undef/dynamic def cases. Adjust callers.
5105 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5106 undef_binding_weak_.
5107 (Symbol_table::sized_write_globals): Adjust symbol binding.
5108 (Symbol_table::sized_write_symbol): Add binding parameter.
5109 * symtab.h (Symbol::set_undef_binding): New method.
5110 (Symbol::is_undef_binding_weak): New method.
5111 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5112 (Symbol_table::should_override): Add new parameter.
5113 (Symbol_table::sized_write_symbol): Add new parameter.
5115 * testsuite/weak_undef_file1.cc: Add new test case.
5116 * testsuite/weak_undef_file2.cc: Fix header comment.
5117 * testsuite/weak_undef_test.cc: Add new test case.
5119 2010-06-29 Doug Kwan <dougkwan@google.com>
5121 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5122 Initialize USE_SYMBOL_.
5123 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5125 (Arm_reloc_property::uses_symbol_): New data member declaration.
5126 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5127 uses symbol value and symbol is undefined but not weakly undefined.
5129 2010-06-28 Rafael Espindola <espindola@google.com>
5131 * plugin.cc (Plugin::load): Use dlerror.
5133 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5135 * symtab.cc (detect_odr_violations): When reporting an ODR
5136 violation, report an object where the symbol is defined.
5138 2010-06-25 Doug Kwan <dougkwan@google.com>
5140 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5141 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5143 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5144 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5145 target hook to detect function points.
5146 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5147 * icf.h (Icf::check_section_for_function_pointers): Change type of
5148 parameter SECTION_NAME to const reference to std::string. Use
5149 target hook to determine if section may have unsafe pointers.
5150 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5153 2010-06-21 Rafael Espindola <espindola@google.com>
5155 * fileread.cc (Input_file::find_fie): New
5156 (Input_file::open): Use Input_file::find_fie.
5157 * fileread.h (Input_file::find_fie): New
5158 * plugin.cc (set_extra_library_path): New.
5159 (Plugin::load): Add set_extra_library_path to the transfer vector.
5160 (Plugin_manager::set_extra_library_path): New.
5161 (Plugin_manager::add_input_file): Use the extra search path if set.
5162 (set_extra_library_path(): New.
5163 * plugin.h (Plugin_manager): Add set_extra_library_path and
5166 2010-06-19 Cary Coutant <ccoutant@google.com>
5168 * layout.cc (gdb_sections): Add .debug_types.
5169 (lines_only_debug_sections): Likewise.
5171 2010-06-18 Rafael Espindola <espindola@google.com>
5173 * plugin.cc (add_input_file,add_input_library)
5174 (Plugin_manager::add_input_file): Make filename arguments const.
5175 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5178 2010-06-16 Doug Kwan <dougkwan@google.com>
5180 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5181 .ARM.attributes section if we have not merged any input
5182 attributes sections.
5184 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5186 * arm.cc: Allow combining objects with no EABI version
5189 2010-06-15 Rafael Espindola <espindola@google.com>
5191 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5193 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5195 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5196 (struct iovec): Correct !HAVE_READV definition.
5198 2010-06-10 Cary Coutant <ccoutant@google.com>
5200 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5201 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5203 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5206 * symtab.h (Symbol::is_placeholder): New member function.
5207 * target-reloc.h (relocate_section): Check for placeholder symbols.
5209 * testsuite/Makefile.am (plugin_test_8): New test.
5210 (plugin_test_9): New test.
5211 * testsuite/Makefile.in: Regenerate.
5213 2010-06-09 Nick Clifton <nickc@redhat.com>
5215 * yyscript.y (input_list_element): Allow strings prefixed with
5216 the '-' character. Treat these as libraries.
5217 * script.cc (script_add_library): New function. Adds a library
5218 specified by "-l<name>" found in an input script.
5219 * script-c.h: Add prototype for script_add_library.
5221 2010-06-07 Doug Kwan <dougkwan@google.com>
5223 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5224 Restrict stub-group size to be within long conditional branch
5225 range when working around cortex-A8 erratum.
5227 2010-06-07 Damien Diederen <dd@crosstwine.com>
5229 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5232 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5236 (Output_section::Input_section_sort_entry::compare_section_ordering):
5237 Change to return non-zero correctly.
5238 (Output_section::Input_section_sort_section_order_index_compare
5239 ::operator()): Change to fix ambiguity in comparisons.
5241 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5243 * gold.h (is_wildcard_string): New function.
5244 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5245 (Layout::layout_eh_frame): Ditto.
5246 (Layout::find_section_order_index): New method.
5247 (Layout::read_layout_from_file): New method.
5248 * layout.h (Layout::find_section_order_index): New method.
5249 (Layout::read_layout_from_file): New method.
5250 (Layout::input_section_position_): New private member.
5251 (Layout::input_section_glob_): New private member.
5252 * main.cc (main): Call read_layout_from_file here.
5253 * options.h (--section-ordering-file): New option.
5254 * output.cc (Output_section::input_section_order_specified_): New
5256 (Output_section::Output_section): Initialize new member.
5257 (Output_section::add_input_section): Add new parameter.
5258 Keep input sections when --section-ordering-file is used.
5259 (Output_section::set_final_data_size): Sort input sections when
5260 section ordering file is specified.
5261 (Output_section::Input_section_sort_entry): Add new parameter.
5263 (Output_section::Input_section_sort_entry::compare_section_ordering):
5265 (Output_section::Input_section_sort_compare::operator()): Change to
5266 consider section_order_index.
5267 (Output_section::Input_section_sort_init_fini_compare::operator()):
5268 Change to consider section_order_index.
5269 (Output_section::Input_section_sort_section_order_index_compare
5270 ::operator()): New method.
5271 (Output_section::sort_attached_input_sections): Change to sort
5272 according to section order when specified.
5273 (Output_section::add_input_section<32, true>): Add new parameter.
5274 (Output_section::add_input_section<64, true>): Add new parameter.
5275 (Output_section::add_input_section<32, false>): Add new parameter.
5276 (Output_section::add_input_section<64, false>): Add new parameter.
5277 * output.h (Output_section::add_input_section): Add new parameter.
5278 (Output_section::input_section_order_specified): New
5280 (Output_section::set_input_section_order_specified): New method.
5281 (Input_section::Input_section): Initialize section_order_index_.
5282 (Input_section::section_order_index): New method.
5283 (Input_section::set_section_order_index): New method.
5284 (Input_section::section_order_index_): New member.
5285 (Input_section::Input_section_sort_section_order_index_compare): New
5287 (Output_section::input_section_order_specified_): New member.
5288 * script-sections.cc (is_wildcard_string): Delete and move modified
5290 (Output_section_element_input::Output_section_element_input): Modify
5291 call to is_wildcard_string.
5292 (Output_section_element_input::Input_section_pattern
5293 ::Input_section_pattern): Ditto.
5294 (Output_section_element_input::Output_section_element_input): Ditto.
5295 * testsuite/Makefile.am (final_layout): New test case.
5296 * testsuite/Makefile.in: Regenerate.
5297 * testsuite/final_layout.cc: New file.
5298 * testsuite/final_layout.sh: New file.
5300 2010-06-01 Rafael Espindola <espindola@google.com>
5302 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5304 2010-06-01 Rafael Espindola <espindola@google.com>
5306 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5307 visibility of symbols.
5309 2010-05-27 Doug Kwan <dougkwan@google.com>
5311 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5312 from start of output section instead of address for a local symbol
5313 in a merged or relaxed section when doing a relocatable link.
5315 2010-05-26 Rafael Espindola <espindola@google.com>
5318 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5319 adding sections the garbage collector removed.
5320 * gold/testsuite/Makefile.am: Add test.
5321 * gold/testsuite/Makefile.in: Regenerate.
5322 * gold/testsuite/plugin_test_7.sh: New.
5323 * gold/testsuite/plugin_test_7_1.c: New.
5324 * gold/testsuite/plugin_test_7_2.c: New.
5326 2010-05-26 Rafael Espindola <espindola@google.com>
5328 * script-sections.cc (Output_section_definition::set_section_addresses):
5329 Check for --section-start.
5331 2010-05-26 Doug Kwan <dougkwan@google.com>
5333 * arm.cc (Arm_scan_relocatable_relocs): New class.
5334 (Target_arm::relocate_special_relocatable): New method.
5335 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5336 (Arm_relocate_functions::thumb_branch_common): Same.
5337 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5338 instead of Default_scan_relocatable_relocs.
5339 * target-reloc.h (relocate_for_relocatable): Let target handle
5340 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5341 * target.h (Sized_target::relocate_special_relocatable): New method.
5343 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5345 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5347 2010-05-23 Doug Kwan <dougkwan@google.com>
5349 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5351 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5352 with a direct branch, not a conditional branch, to a stub.
5353 * merge.cc (Output_merge_base::record_input_section): New method
5355 (Output_merge_data::do_add_input_section): Record input section if
5356 keeps-input-sections flag is set.
5357 (Output_merge_string::do_add_input_section): Ditto.
5358 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5359 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5361 (Output_merge_base::keeps_input_sections,
5362 Output_merge_base::set_keeps_input_sections,
5363 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5365 (Output_merge_base::Input_sections): New type declaration.
5366 (Output_merge_base::input_sections_begin,
5367 Output_merge_base::input_sections_end,
5368 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5369 (Output_merge_base::bool keeps_input_sections_,
5370 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5371 Output_merge_base::input_sections_): New data members.
5372 (Output_merge_data::do_set_keeps_input_sections): New method
5374 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5375 * output.cc (Output_section::Input_section::relobj): Move method
5376 defintion from class declaration to here and handle merge sections.
5377 (Output_section::Input_section::shndx): Ditto.
5378 (Output_section::Output_section): Remove initializations of removed
5379 data members and initialize new data member LOOKUP_MAPS_.
5380 (Output_section::add_input_section): Set keeps-input-sections flag
5381 for a newly created merge output section as appropriate. Adjust code
5382 to use Output_section_lookup_maps class.
5383 (Output_section::add_relaxed_input_section): Adjst code for lookup
5384 maps code refactoring.
5385 (Output_section::add_merge_input_section): Add a new parameter
5386 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5387 class. If adding input section to a newly created merge output
5388 section fails, remove the new merge section.
5389 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5390 Adjust code for use of the Output_section_lookup_maps class.
5391 (Output_section::find_merge_section): Ditto.
5392 (Output_section::build_lookup_maps): New method defintion.
5393 (Output_section::find_relaxed_input_section): Adjust code to use
5394 Output_section_lookup_maps class.
5395 (Output_section::get_input_sections): Export merge sections. Adjust
5396 code to use Output_section_lookup_maps class.
5397 (Output_section:::add_script_input_section): Adjust code to use
5398 Output_section_lookup_maps class. Update lookup maps for merge
5400 (Output_section::discard_states): Use Output_section_lookup_maps.
5401 (Output_section::restore_states): Same.
5402 * output.h (Merge_section_properties): Move class defintion out of
5404 (Output_section_lookup_maps): New class.
5405 (Output_section::Input_section::is_merge_section): New method
5407 (Output_section::Input_section::relobj): Move defintion out of class
5408 defintion. Declare method only.
5409 (Output_section::Input_section::shndx): Ditto.
5410 (Output_section::Input_section::output_merge_base): New method defintion.
5411 (Output_section::Input_section::u2_.pomb): New union field.
5412 (Output_section::Merge_section_by_properties_map,
5413 Output_section::Output_section_data_by_input_section_map,
5414 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5416 (Output_section::add_merge_input_section): Add new parameter
5417 KEEPS_INPUT_SECTIONS.
5418 (Output_section::build_lookup_maps): New method declaration.
5419 (Output_section::merge_section_map_,
5420 Output_section::merge_section_by_properties_map_,
5421 Output_section::relaxed_input_section_map_,
5422 Output_section::is_relaxed_input_section_map_valid_): Remove data
5424 (Output_section::lookup_maps_): New data member.
5426 2010-05-21 Doug Kwan <dougkwan@google.com>
5429 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5430 avoid a compilation error.
5432 2010-05-19 Rafael Espindola <espindola@google.com>
5434 * script-sections.cc (Output_section_definition::allocate_to_segment):
5435 Update the phdrs_list even when the output section is NULL.
5436 * testsuite/Makefile.am: Add test.
5437 * testsuite/Makefile.in: Regenerate.
5438 * testsuite/script_test_9.cc: New.
5439 * testsuite/script_test_9.sh: New.
5440 * testsuite/script_test_9.t: New.
5442 2010-05-19 Doug Kwan <dougkwan@google.com>
5444 * arm.cc (Arm_input_section::original_size): New method.
5445 (Arm_input_section::do_addralign): Add a cast.
5446 (Arm_input_section::do_output_offset): Remove static cast.
5447 (Arm_input_section::original_addralign,
5448 Arm_input_section::original_size_): Change type to uint32_t.
5449 (Arm_input_section::init): Add safe casts for section alignment
5451 (Arm_input_section::set_final_data_size): Do not set address and
5452 offset of stub table.
5453 (Arm_output_section::fix_exidx_coverage): Change use of of
5454 Output_section::Simple_input_section to that of
5455 Output_section::Input_section.
5456 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5457 except for the first pass.
5458 * output.cc (Output_section::get_input_sections): Change type of
5459 input_sections to std::list<Input_section>.
5460 (Output_section::add_script_input_section): Rename from
5461 Output_section::add_simple_input_section. Change type of SIS
5462 parameter from Simple_input_section to Input_section.
5463 * output.h (Output_section::Simple_input_section): Remove class.
5464 (Output_section::Input_section): Change class visibility to public.
5465 (Output_section::Input_section::addralign): Use stored alignments
5466 for special input sections if set.
5467 (Output_section::Input_section::set_addralign): New method.
5468 (Output_section::get_input_sections): Change parameter type from
5469 list of Simple_input_section to list of Input_section.
5470 (Output_section::add_script_input_section): Rename from
5471 Output_section::add_simple_input_section. Change first parameter's
5472 type from Simple_input_section to Input_section and remove the
5473 second and third parameters.
5474 * script-sections.cc (Input_section::Input_section_list): Change
5475 type to list of Output_section::Input_section/
5476 (Input_section_info::Input_section_info): Change parameter type of
5477 INPUT_SECTION to Output_section::Input_section.
5478 (Input_section_info::input_section): Change return type.
5479 (Input_section_info::input_section_): Change type to
5480 Output_section::Input_section.
5481 (Output_section_element_input::set_section_addresses): Adjust code
5482 to use Output_section::Input_section instead of
5483 Output_section::Simple_input_section. Adjust code for renaming
5484 of Output_section::add_simple_input_section.
5485 (Orphan_output_section::set_section_addresses): Ditto.
5487 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5489 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5490 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5492 2010-05-18 Rafael Espindola <espindola@google.com>
5494 * options.cc (General_options::finalize): Handle -nostdlib.
5495 * options.h (nostdlib): New option.
5496 * script.cc (script_add_search_dir): Handle -nostdlib.
5498 2010-05-12 Doug Kwan <dougkwan@google.com>
5500 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5501 attributes section only if there no attributes section after merging.
5502 (Target_arm::merge_object_attributes): Move value of
5503 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5504 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5505 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5506 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5507 and arm_attr_merge_7.stdout.
5508 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5509 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5510 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5511 arm_attr_merge_7b.o): New rules.
5512 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5514 * testsuite/Makefile.in: Regenerate.
5515 * testsuite/arm_attr_merge.sh: New file.
5516 * testsuite/arm_attr_merge_[67][ab].s: Same.
5518 2010-05-05 Nick Clifton <nickc@redhat.com>
5520 * po/es.po: Updated Spanish translation.
5522 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5524 * Makefile.am (install-exec-local): Properly install gold as
5525 default cross linker.
5526 * Makefile.in: Regenerated.
5528 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5529 Nick Clifton <nickc@redhat.com>
5531 * configure.ac (install_as_default): Define and set to false
5532 unless --enable-gold or --enable-gold=both/gold has been
5534 * configure: Regenerate.
5536 * Makefile.am (install-exec-local): Install the executable as
5537 'ld.gold'. If install_as_default is true then also install it as
5539 * Makefile.in: Regenerated.
5541 2010-04-24 Ian Lance Taylor <iant@google.com>
5543 * layout.cc (Layout::layout_reloc): In relocatable link don't
5544 combine reloc sections for grouped sections.
5546 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5548 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5549 sections that are not ordinary to icf.
5550 * icf.cc (get_section_contents): Handle relocation pointing to section
5551 with no object or shndx information.
5552 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5553 * testsuite/Makefile.in: Regenerate.
5554 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5555 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5557 2010-04-22 Ian Lance Taylor <iant@google.com>
5559 * expression.cc (Expression::Expression_eval_info): Add
5560 result_alignment_pointer field.
5561 (Expression::eval_with_dot): Add result_alignment_pointer
5562 parameter. Change all callers.
5563 (Expression::eval_maybe_dot): Likewise.
5564 (class Binary_expression): Add alignment_pointer parameter to
5565 left_value and right_value. Change all callers.
5566 (BINARY_EXPRESSION): Set result alignment.
5567 (class Trinary_expression): Add alignment_pointer parameter to
5568 arg2_value and arg3_value. Change all callers.
5569 (Trinary_cond::value): Set result alignment.
5570 (Max_expression::value, Min_expression::value): Likewise.
5571 (Align_expression::value): Likewise.
5572 * script-sections.cc (class Sections_element): Add dot_alignment
5573 parameter to set_section_addresses virtual function. Update
5575 (class Output_section_element): Likewise.
5576 (Script_sections::create_segments): Add dot_alignment parameter.
5578 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5579 (Script_sections::set_phdrs_clause_addresses): Likewise.
5580 * script-sections.h: Update declarations.
5581 * script.h: Update declarations.
5582 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5584 * testsuite/script_test_3.t: Set large alignment.
5585 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5586 segment has expected alignment.
5588 2010-04-22 Nick Clifton <nickc@redhat.com>
5590 * po/gold.pot: Updated by the Translation project.
5591 * po/vi.po: Updated Vietnamese translation.
5593 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5595 * testsuite/Makefile.am (check_PROGRAMS): Add
5596 icf_virtual_function_folding_test.
5597 * testsuite/Makefile.in: Regenerated.
5599 2010-04-15 Andrew Haley <aph@redhat.com>
5601 * options.h (merge_exidx_entries): New option.
5602 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5603 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5604 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5605 (Target_arm::merge_exidx_entries): New function.
5606 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5607 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5608 to Arm_exidx_fixup constructor.
5609 Add new arg, merge_exidx_entries.
5610 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5611 Arm_output_section::fix_exidx_coverage.
5613 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5615 * icf.cc (get_section_contents): Check for preemptible functions.
5616 Ignore addend when appropriate.
5617 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5619 (add_from_relobj): Check for section folded.
5620 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5621 * symtab.h (should_add_dynsym_entry): Add new parameter.
5622 * target-reloc.h (scan_relocs): Check for section folded.
5623 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5624 Check reloc types for function pointers in shared objects.
5625 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5627 (icf_preemptible_functions_test): New test case.
5628 (icf_string_merge_test): New test case.
5629 * testsuite.Makefile.in: Regenerate.
5630 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5631 bar_glob. Refactor code.
5632 * testsuite/icf_preemptible_functions_test.cc: New file.
5633 * testsuite/icf_preemptible_functions_test.sh: New file.
5634 * testsuite/icf_string_merge_test.cc: New file.
5635 * testsuite/icf_string_merge_test.sh: New file.
5636 * testsuite/icf_virtual_function_folding_test.cc: New file.
5637 * testsuite/icf_virtual_function_folding_test.sh: New file.
5639 2010-04-14 Doug Kwan <dougkwan@google.com>
5641 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5642 for local symbol recounting if we remove a section due to ICF.
5643 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5644 there are no regular objects in input.
5646 2010-04-13 Doug Kwan <dougkwan@google.com>
5648 * arm.cc (Arm_input_section::set_final_data_size): Compute
5649 accurate final data size instead of using current data size.
5651 2010-04-09 Doug Kwan <dougkwan@google.com>
5653 * layout.cc (Layout::choose_output_section): Handle script section
5655 (Layout::make_output_section_for_script): Add section type parameter.
5656 Handle script section types.
5657 * layout.h (Layout::make_output_section_for_script): Add section
5659 * output.cc (Output_section::Output_section): Initialize data member
5661 (Output_section::do_reset_address_and_file_offset): Do not set address
5662 to 0 if section is a NOLOAD section.
5663 * output.h (Output_section::is_noload): New method.
5664 (Output_section::set_is_noload): Ditto.
5665 (Output_section::is_noload_): New data member.
5666 * script-c.h (Script_section_type): New enum type.
5667 (struct Parser_output_section_header): Add new file section_type.
5668 * script-sections.cc (Sections_element::output_section_name): Add
5669 parameter for returning script section type.
5670 (Output_section_definition::output_section_name): Ditto.
5671 (Output_section_definition::section_type)P; New method.
5672 (Output_section_definiton::script_section_type_name): Ditto.
5673 (Output_section_definition::script_section_type_): New data member.
5674 (Output_section_definition::Output_section_definition): Initialize
5675 data member Output_section_definition::script_section_type_.
5676 (Output_section_definition::create_sections): Pass script section type
5677 to Layout::make_output_section_for_script.
5678 (Output_section_definition::output_section_name): Return script
5679 section type to caller.
5680 (Output_section_definition::set_section_address): Do not advance
5681 dot value and load address if section type is NOLOAD. Set address
5682 of NOLOAD sections regardless of section flags.
5683 (Output_section_definition::print): Print section type if it is
5684 not SCRIPT_SECTION_TYPE_NONE.
5685 (Output_section_definition::section_type): New method.
5686 (Output_section_definition::script_section_type_name): Ditto.
5687 (Script_sections::output_section_name): Add new parameter
5688 PSECTION_TYPE for returning script section type. Pass it to
5689 section elements. Handle discard sections.
5690 (Sort_output_sections::operator()): Handle NOLOAD sections.
5691 * script-sections.h (Script_sections::Section_type): New enum type.
5692 (Script_sections::output_section_name): Add a new parameter for
5693 returning script section type.
5694 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5696 * yyscript.y (union): Add new field SECTION_TYPE.
5697 (COPY, DSECT, INFO, NOLOAD): New tokens.
5698 (opt_address_and_section_type): Change type to output_section_header.
5699 (section_type): New non-terminal
5700 (section_header): Handle section type.
5701 (opt_address_and_section_type): Return section type value.
5703 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5705 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5706 * testsuite/plugin_common_test_2.c (foo): Likewise.
5708 2010-04-08 Doug Kwan <dougkwan@google.com>
5710 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5712 * output.cc (Output_section::add_merge_input_section): Simplify
5713 code and return status of Output_merge_base::add_input_section.
5714 Update merge section map only if Output_merge_base::add_input_section
5717 2010-04-07 Doug Kwan <dougkwan@google.com>
5719 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5720 if section is marked as containing instructions but has no mapping
5722 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5723 correct section index.
5724 (Arm_relobj::find_linked_text_section): Ditto.
5726 2010-04-07 Cary Coutant <ccoutant@google.com>
5728 * archive.cc (include_member): Destroy Read_symbols_data object before
5730 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5731 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5732 (Read_symbols_data::~Read_symbols_data) New destructor.
5733 (Section_relocs::Section_relocs) New constructor.
5734 (Section_relocs::~Section_relocs) New destructor.
5735 (Read_relocs_data::Read_relocs_data) New constructor.
5736 (Read_relocs_data::~Read_relocs_data) New destructor.
5737 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5738 pointers to NULL after deleting.
5740 2010-04-07 Doug Kwan <dougkwan@google.com>
5742 * arm.cc: Replace "endianity" with "endianness" in comments.
5743 (Arm_exidx_cantunwind): Ditto.
5744 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5745 (Arm_relobj::merge_flags_and_attributes): New method.
5746 (Arm_relobj::merge_flags_and_attributes_): New data member.
5747 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5748 (Arm_relobj::scan_sections_for_stubs): Ditto.
5749 (Arm_relobj::do_read_symbols): Check to see if we really want to
5750 merge processor-specific flags and attributes. Exit early if
5751 an object is empty except for section names and the undefined symbol.
5752 (Target_arm::do_finalize_sections): Move check for ELF format to
5753 Arm_relobj::do_read_symbols. Merge processor specific flags and
5754 attributes from a regular object only when we have determined that
5755 it is aapropriate. Do not create an .ARM.attributes section in
5756 output if there is no regular input object.
5757 (Target_arm::merge_processor_specific_flags): Check
5758 --warn-mismatch before printing any error.
5759 (Target_arm::merge_object_attributes): Ditto.
5760 * gold.cc (queue_middle_tasks): Handle the case in which there is
5761 no regular object in input.
5762 * options.cc (General_options::parse_EB): New method.
5763 (General_options::parse_EL): Same.
5764 (General_options::General_options): Initialize endianness_.
5765 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5767 (General_options::Endianness): New enum.
5768 (General_options::endianness): New method.
5769 (General_options::endianness_): New data member.
5770 * parameters.cc (Parameters::set_options): Check target endianness.
5771 (Parameters::set_target_once): Ditto.
5772 (Parameters::check_target_endianness): New method.
5773 (parameters_force_valid_target): If either -EL or -EB is specified,
5774 use it to define endianness of default target.
5775 * parameters.h (Parameters::check_target_endianness): New method
5777 * target.h (class Target): Change "endianity" to "endianness"
5780 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5782 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5783 * configure: Regenerate.
5784 * Makefile.in: Regenerate.
5785 * testsuite/Makefile.in: Regenerate.
5787 2010-04-06 Cary Coutant <ccoutant@google.com>
5790 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5791 prevailing definitions of common symbols.
5792 * testsuite/plugin_test_6.sh: New test case.
5793 * testsuite/plugin_common_test_1.c: New test case.
5794 * testsuite/plugin_common_test_2.c: New test case.
5795 * testsuite/Makefile.am (plugin_test_6): New test case.
5796 * testsuite/Makefile.in: Regenerate.
5798 2010-04-06 Nick Clifton <nickc@redhat.com>
5800 * po/vi.po: New Vietnamese translation.
5802 2010-03-30 Doug Kwan <dougkwan@google.com>
5804 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5806 2010-03-25 Doug Kwan <dougkwan@google.com>
5808 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5809 to avoid a conversion warning on a 32-bit host.
5811 2010-03-24 Ian Lance Taylor <iant@google.com>
5813 * testsuite/script_test_3.t: Add a TLS segment.
5814 * testsuite/Makefile.am (check_PROGRAMS): Add
5815 tls_phdrs_script_test.
5816 (tls_phdrs_script_test_SOURCES): Define.
5817 (tls_phdrs_script_test_DEPENDENCIES): Define.
5818 (tls_phdrs_script_test_LDFLAGS): Define.
5819 (tls_phdrs_script_test_LDADD): Define.
5820 * testsuite/Makefile.in: Rebuild.
5822 2010-03-23 Cary Coutant <ccoutant@google.com>
5824 * fileread.cc (find_or_make_view): Fix comment.
5826 2010-03-23 Ian Lance Taylor <iant@google.com>
5828 * script-sections.cc (class Orphan_section_placement): Define
5829 PLACE_TLS and PLACE_TLS_BSS.
5830 (Orphan_section_placement::Orphan_section_placement): Initialize
5832 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5833 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5834 (tls_script_test_SOURCES): Define.
5835 (tls_script_test_DEPENDENCIES): Define.
5836 (tls_script_test_LDFLAGS): Define.
5837 (tls_script_test_LDADD): Define.
5838 * testsuite/Makefile.in: Rebuild.
5840 2010-03-22 Doug Kwan <dougkwan@google.com>
5842 * arm.cc (Arm_relocate_functions::abs8,
5843 Arm_relocate_functions::abs16): Use correct check for overflow
5844 specified in the ARM ELF specs.
5845 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5846 target of a BLX instruction specially.
5847 (Reloc_stub::stub_type_for_reloc): Ditto.
5848 (Relocate::relocate): Use symbolic names instead of numeric relocation
5849 codes to report error.
5850 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5852 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5853 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5854 thumb2_blx_out_of_range.stdout
5855 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5856 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5857 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5858 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5859 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5860 thumb2_blx_in_range, thumb2_blx_in_range.o,
5861 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5862 thumb2_blx_out_of_range.o): New rules.
5863 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5864 thumb2_blx_in_range and thumb2_blx_out_of_range.
5865 * testsuite/Makefile.in: Regenerate.
5866 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5867 * testsuite/thumb_blx_in_range.s: New file.
5868 * testsuite/thumb_blx_out_of_range.s: New file.
5870 2010-03-22 Rafael Espindola <espindola@google.com>
5872 * archive.cc (Should_include): Move to archive.h.
5873 (should_include_member): Make it a member of Archive.
5875 (Add_lib_group_symbols): New.
5876 * archive.h: Include options.h.
5877 (Archive_member): Moved from Archive.
5878 (Should_include): Moved from archive.cc.
5880 (Add_lib_group_symbols): New.
5881 * dynobj.cc (do_should_include_member): New.
5882 * dynobj.h (do_should_include_member): New.
5883 * gold.cc (queue_initial_tasks): Update call to queue.
5884 * main.cc (main): Print lib group stats.
5885 * object.cc (do_should_include_member): New.
5886 * object.h: Include archive.h.
5887 (Object::should_include_member): New.
5888 (Object::do_should_include_member): New.
5889 (Sized_relobj::do_should_include_member): New.
5890 * options.cc (General_options::parse_start_lib): New.
5891 (General_options::parse_end_lib): New.
5892 (Input_arguments::add_file): Handle lib groups.
5893 (Input_arguments::start_group): Check we are not in a lib.
5894 (Input_arguments::start_lib): New.
5895 (Input_arguments::end_lib): New.
5896 * options.h (General_options): Add start_lib and end_lib.
5897 (Input_argument::lib_): New.
5898 (Input_argument::lib): New.
5899 (Input_argument::is_lib): New.
5900 (Input_file_lib): New.
5901 (Input_arguments::in_lib_): New.
5902 (Input_arguments::in_lib): New.
5903 (Input_arguments::start_lib): New.
5904 (Input_arguments::end_lib_): New.
5905 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5906 in unused members as preempted.
5907 (Sized_pluginobj::do_should_include_member): New.
5908 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5909 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5911 (Read_symbols::do_whole_lib_group): New.
5912 (Read_symbols::do_lib_group): New.
5913 (Read_symbols::do_read_symbols): Handle lib groups.
5914 (Read_symbols::get_name): Handle lib groups.
5915 * readsyms.h (Read_symbols): Add an archive member pointer.
5916 (Read_symbols::do_whole_lib_group): New.
5917 (Read_symbols::do_lib_group): New.
5918 (Read_symbols::member_): New.
5919 * script.cc (read_input_script): Update call to queue_soon.
5921 2010-03-19 Doug Kwan <dougkwan@google.com>
5923 * arm.cc (Stub_table::Stub_table): Initialize new data members
5924 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5925 (Stub_table::add_reloc_stub): Assign stub offset and update
5926 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5927 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5929 (Stub_table::update_data_size_and_addralign): Use
5930 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5931 instead of going over all reloc stubs.
5932 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5933 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5934 Stringpool_template::offset_ to size of Stringpool_char.
5935 (Stringpool_template::new_key_offset): Remove code to initialize
5936 Stringpool_template::offset_.
5937 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5938 Stringpool_template::offset_ to zero.
5940 2010-03-15 Doug Kwan <dougkwan@google.com>
5942 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5944 (Stringpool_template::new_key_offset): New method.
5945 (Stringpool_template::add_string): Assign offsets when adding new
5947 (Stringpool_template::set_string_offsets): Do not set string offsets
5948 when not optimizing.
5949 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5951 (Chunked_vector::clear): Clear size_.
5952 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5953 (Chunked_vector::size): Return size_.
5954 (Chunked_vector::push_back): Use size_ to find insert position.
5955 (Chunked_vector::size_): New data member.
5956 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5957 (Stringpool_template::new_key_offset): New method declaration.
5958 (Stringpool_template::offset_): New data member.
5960 2010-03-15 Rafael Espindola <espindola@google.com>
5962 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5963 Add_symbols' constructor.
5964 * readsyms.h (Add_symbols): Remove the input_group member.
5966 2010-03-10 Ian Lance Taylor <iant@google.com>
5968 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5969 target to ask whether a reference to a symbol requires a stack
5971 * target.h (Target::is_call_to_non_split): New function.
5972 (Target::do_is_call_to_non_split): Declare virtual function.
5973 * target.cc: Include "symtab.h".
5974 (Target::do_is_call_to_non_split): New function.
5975 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5977 2010-03-10 Cary Coutant <ccoutant@google.com>
5979 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5980 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5981 (File_read::open[2]): Add whole_file_view_ to list of views.
5982 (File_read::make_view): Remove test of whole_file_view_.
5983 (File_read::find_or_make_view): Create whole_file_view_ if
5985 (File_read::clear_views): Replace bool parameter with enum;
5986 adjust all callers. Don't delete views with permanent data;
5987 do delete cached views and views from archives if
5988 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5989 if clearing the corresponding view.
5990 * fileread.h (File_read::Clear_views_mode): New enum.
5991 (File_read::View::is_permanent_view): New method.
5992 (File_read::clear_views): Replace bool parameter
5993 with enum; adjust all callers.
5994 * options.h (General_options): Change keep_files_mapped option;
5995 add map_whole_files.
5996 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5998 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6001 2010-03-10 David S. Miller <davem@davemloft.net>
6003 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6005 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6007 * icf.cc (get_section_contents): Add '@' marker after processing the
6010 2010-03-08 Doug Kwan <dougkwan@google.com>
6012 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6013 due to a conversion warning.
6014 (Arm_relobj::update_output_local_symbol_count): Check for local
6015 symbol with unset output index.
6017 2010-03-05 Ian Lance Taylor <iant@google.com>
6019 * options.h (class General_options): Add --spare-dynamic-tags.
6020 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6021 --spare-dynamic-tags.
6023 2010-03-05 Ian Lance Taylor <iant@google.com>
6025 * incremental.cc: Include "libiberty.h".
6027 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6029 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6030 function, is_info_ member.
6031 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6032 (Versions::Versions): Update caller.
6033 (Versions::define_base_version): Likewise.
6034 (Versions::add_def): Likewise.
6036 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6038 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6039 (Scan::possible_function_pointer_reloc): New function.
6040 (Scan::local_reloc_may_be_function_pointer): Change to call
6041 possible_function_pointer_reloc.
6042 (Scan::global_reloc_may_be_function_pointer): Ditto.
6043 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6044 relocations in ".data.rel.ro._ZTV" section.
6045 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6046 * testsuite/icf_safe_so_test.cc: Ditto.
6047 * testsuite/icf_safe_test.cc: Ditto.
6048 * testsuite/icf_safe_test.sh: Ditto.
6050 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6051 Ian Lance Taylor <iant@google.com>
6053 * target-reloc.h (relocate_section): Check the symbol table index
6054 for -1U before setting the local symbol index.
6055 (scan_relocatable_relocs): If copying the relocation, record that
6056 the local symbol is required.
6057 * object.h (Symbol_value::is_output_symtab_index_set): New
6059 (Symbol_value::may_be_discarded_from_output_symtab): New
6061 (Symbol_value::has_output_symtab_entry): New function.
6062 (Symbol_value::needs_output_symtab_entry): Remove.
6063 (Symbol_value::output_symtab_index): Make sure the symbol index is
6065 (Symbol_value::set_output_symtab_index): Make sure the symbol
6066 index is not set. Make sure the new index is valid.
6067 (Symbol_value::set_must_have_output_symtab_entry): New function.
6068 (Symbol_value::has_output_dynsym_entry): New function.
6069 (Symbol_value::set_output_dynsym_index): Make sure the new index
6071 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6072 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6073 local symbol if permitted.
6074 (Sized_relobj::do_finalize_local_symbols): Call
6075 is_output_symtab_index_set rather than needs_output_symtab_entry.
6076 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6077 rather than needs_output_symtab_entry. Call
6078 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6079 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6080 is_output_symtab_index_set rather than needs_output_symtab_entry.
6081 * testsuite/discard_locals_relocatable_test.c: New file.
6082 * testsuite/discard_locals_test.sh: Test -r.
6083 * testsuite/Makefile.am (check_DATA): Add
6084 discard_locals_relocatable_test1.syms,
6085 discard_local_relocatable_test2.syms.
6086 (MOSTLYCLEANFILES): Likewise. Also add
6087 discard_locals_relocatable_test1.lout and
6088 discard_locals_relocatable_test2.out.
6089 (discard_locals_relocatable_test1.syms): New target.
6090 (discard_locals_relocatable_test.o): New target.
6091 (discard_locals_relocatable_test1.out): New target.
6092 (discard_locals_relocatable_test2.syms): New target.
6093 (discard_locals_relocatable_test2.out): New target.
6094 (various): Add missing ../ld-new dependencies.
6095 * testsuite/Makefile.in: Rebuild.
6097 2010-03-03 Nick Clifton <nickc@redhat.com>
6099 * po/fi.po: New Finnish translation.
6101 2010-03-01 Doug Kwan <dougkwan@google.com>
6103 * layout.cc (Layout::Layout): Force section types of .init_array*,
6104 .preinit_array* and .fini_array* sections.
6105 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6106 Fix check of return value of std::string::find.().
6107 (Output_section::Input_section_sort_compare::operator()): Remove
6108 comment about .init_array.
6109 (Output_section::Input_section_sort_init_fini_compare::operator()):
6111 (Output_section::sort_attached_input_sections): Handle .init_array
6112 and .fini_array specially.
6113 * output.h (Output_section::Inut_section_sort_compare): Update
6115 (Output_section::Input_section_sort_init_fini_compare): New struct.
6117 2010-02-26 Doug Kwan <dougkwan@google.com>
6119 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6120 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6121 * testsuite/debug_msg.sh: Avoid matching source line number for
6122 use of global variable undef_int.
6124 2010-02-26 Doug Kwan <dougkwan@google.com>
6126 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6127 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6128 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6129 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6130 * options.cc (General_options::General_options): Initialize member
6132 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6133 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6134 and rm_no_fix_v4bx.stdout
6135 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6136 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6137 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6138 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6139 and arm_no_fix_v4bx.
6140 * Makefile.in: Regenerate.
6141 * testsuite/arm_fix_v4bx.s: New file.
6142 * testsuite/arm_fix_v4bx.sh: Ditto.
6144 2010-02-24 Doug Kwan <dougkwan@google.com>
6146 * arm.cc (Target_arm::got_section): Make the .got section the first
6147 non RELRO section in the data segment.
6148 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6149 suffixes of section names.
6151 2010-02-24 Doug Kwan <dougkwan@google.com>
6153 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6154 flags and attributes merging if an input file is a binary file.
6155 * fileread.cc (Input_file::open): Record format of original file.
6156 * fileread.h (Input_file::Format): New enum type.
6157 (Input_file::Input_file): Initialize data member format_.
6158 (Input_file::format): New method definition.
6159 (Input_file::format_):: New data member.
6161 2010-02-24 Doug Kwan <dougkwan@google.com>
6163 * arm.cc (Arm_output_data_got): New class.
6164 (ARM_TCB_SIZE): New constant
6165 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6166 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6167 If user uses a script with a SECTIONS clause, issue only a warning
6168 for a misplaced EXIDX input section. Otherwise, issue an error.
6169 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6171 (Target_arm::got_mode_index_entry): Handle static linking.
6172 (Target_arm::Scan::local): Ditto.
6173 (Target_arm::Scan::global): Ditto.
6174 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6175 all incorrectly implemented relocations.
6176 (Target_arm::fix_exidx_coverage): Pass layout to
6177 Arm_output_section::fix_exidx_coverage.
6178 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6179 from ".ARM.exidx." and ".ARM.extab.".
6181 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6183 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6184 section if it does not already exist.
6185 * attributes.cc (Attributes_section_data::Attributes_section_data):
6186 Don't crash if size is zero.
6188 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6189 Ian Lance Taylor <iant@google.com>
6191 * gold.cc (queue_middle_tasks): If no input files were opened,
6193 * workqueue.h (Task_function::Task_function): Assert that there is
6196 2010-02-22 Doug Kwan <dougkwan@google.com>
6198 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6199 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6200 types to avoid warnings due to different uint64_t implementations
6203 2010-02-21 Doug Kwan <dougkwan@google.com>
6205 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6206 handling of the maximum backward branch offset.
6207 (Arm_relocate_functions::thumb_branch_common): Ditto.
6208 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6209 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6210 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6211 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6212 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6213 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6214 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6215 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6216 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6217 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6218 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6219 thumb2_bl_out_of_range.o): New rules.
6220 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6221 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6222 thumb2_bl_out_of_range
6223 * testsuite/Makefile.in: Regenerate.
6224 * testsuite/arm_bl_in_range.s: New file.
6225 * testsuite/arm_bl_out_of_range.s: Ditto.
6226 * testsuite/arm_branch_in_range.sh: Ditto.
6227 * testsuite/arm_branch_range.t: Ditto.
6228 * testsuite/thumb2_branch_range.t: Ditto.
6229 * testsuite/thumb_bl_in_range.s: Ditto.
6230 * testsuite/thumb_bl_out_of_range.s: Ditto.
6231 * testsuite/thumb_branch_range.t: Ditto.
6233 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6235 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6236 Add reloc offset information.
6237 * icf.cc (get_section_contents): Change iterators to point to the new
6238 vectors. Add reloc offset information to the contents.
6239 * icf.h (Icf::Sections_reachable_info): New typedef.
6240 (Icf::Sections_reachable_list): New typedef.
6241 (Icf::Offset_info): New typedef.
6242 (Icf::Reloc_info): New struct typedef.
6243 (Icf::Reloc_info_list): New typedef.
6244 (Icf::symbol_reloc_list): Delete method.
6245 (Icf::addend_reloc_list): Delete method.
6246 (Icf::section_reloc_list): Delete method.
6247 (Icf::reloc_info_list): New method.
6248 (Icf::reloc_info_list_): New member.
6250 2010-02-19 Doug Kwan <dougkwan@google.com>
6252 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6253 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6254 * arm.cc (Arm_relocation_functions): New forward declaration.
6255 (Target_arm::Target_arm): Initialize new data members
6256 got_mod_index_offset_ and tls_base_symbol_defined_.
6257 (Target_arm::Relocate::relocate_tls): New method.
6258 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6259 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6261 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6262 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6263 (Target_arm::got_mod_index_offset_,
6264 Target_arm::tls_base_symbol_defined_): New data members.
6265 (Target_arm::Scan::local, Target::Scan::global,
6266 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6269 2010-02-18 Doug Kwan <dougkwan@google.com>
6271 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6272 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6273 text section as a parameter becuase some broken tools may not set
6274 the link in section header.
6275 (Target_arm::has_got_section): New method.
6276 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6277 without any mapping symbol as data only. Remove warning.
6278 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6279 link in its section header, try to discover the link by inspecting the
6280 REL31 relocation at the beginning of the section.
6281 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6283 (Target_arm::Scan::global): Treat any reference to the symbol
6284 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6286 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6288 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6289 (Scan::global_reloc_may_be_function_pointer): New function.
6290 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6291 (Scan::global_reloc_may_be_function_pointer): New function.
6292 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6293 (Scan::global_reloc_may_be_function_pointer): New function.
6294 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6295 (Scan::global_reloc_may_be_function_pointer): New function.
6296 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6297 (Scan::global_reloc_may_be_function_pointer): New function.
6298 (Scan::possible_function_pointer_reloc): New function.
6299 (Target_x86_64::can_check_for_function_pointers): New function.
6300 * gc.h (gc_process_relocs): Scan relocation types to determine if
6301 function pointers were taken for targets that support it.
6302 * icf.cc (Icf::find_identical_sections): Include functions for
6303 folding in safe ICF whose pointer is not taken.
6304 * icf.h (Secn_fptr_taken_set): New typedef.
6305 (fptr_section_id_): New member.
6306 (section_has_function_pointers): New function.
6307 (set_section_has_function_pointers): New function.
6308 (check_section_for_function_pointers): New function.
6309 * options.h: Fix comment for safe ICF option.
6310 * target.h (can_check_for_function_pointers): New function.
6311 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6312 Modify icf_safe_test for X86-64.
6313 * testsuite/Makefile.in: Regenerate.
6314 * testsuite/icf_safe_so_test.cc: New file.
6315 * testsuite/icf_safe_so_test.sh: New file.
6316 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6317 (main): Change to take pointer to function kept_func_3.
6318 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6319 folding is done correctly for X86-64.
6321 2010-02-12 David S. Miller <davem@davemloft.net>
6323 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6324 is_symbolless parameter.
6325 (Output_reloc<SHT_REL>::is_symbolless): New.
6326 (Output_reloc<SHT_REL>::is_symbolless_): New.
6327 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6328 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6329 (Output_reloc<SHT_RELA>::is_symbolless): New.
6330 (Output_data_reloc::add_global): Handle is_symbolless.
6331 (Output_data_reloc::add_global_relative): Likewise.
6332 (Output_data_reloc::add_local): Likewise.
6333 (Output_data_reloc::add_local_relative): Likewise.
6334 (Output_data_reloc::add_symbolless_global_addend): New.
6335 (Output_data_reloc::add_symbolless_local_addend): New.
6336 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6338 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6339 instead of ->is_relative_
6340 (Output_reloc::write): Likewise.
6341 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6342 (Output_reloc::write_rel): Simplify.
6344 * sparc.cc (Target_sparc::Scan::local): Use
6345 ->add_symbolless_local_addend as needed.
6346 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6347 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6348 based upon relocation offset.
6350 2010-02-11 Doug Kwan <dougkwan@google.com>
6352 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6353 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6354 beginning of function.
6355 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6356 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6357 parameter is_32bit in calls to should_apply_static_reloc.
6358 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6359 (check_DATA): Add arm_abs_global.stdout.
6360 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6361 arm_abs_global.stdout): New rules.
6362 (MOSTLLYCLEANFILES): Add arm_abs_global
6363 * Makefile.in: Regenerate.
6364 * testsuite/arm_abs_global.s: New file.
6365 * testsuite/arm_abs_global.sh: Ditto.
6366 * testsuite/arm_abs_lib.s: Ditto.
6368 2010-02-11 Ian Lance Taylor <iant@google.com>
6370 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6372 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6373 Allocate_commons_task first.
6374 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6375 task, rather than symtab_lock_.
6376 (Gc_process_relocs::~Gc_process_relocs): New function.
6377 (Gc_process_relocs::is_runnable): Check this_blocker_.
6378 (Gc_process_relocs::locks): Use next_blocker_ rather than
6380 (Scan_relocs::~Scan_relocs): New function.
6381 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6383 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6385 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6386 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6387 constructor accordingly.
6388 (class Gc_process_relocs): Likewise.
6389 (class Scan_relocs): Likewise.
6390 * common.h (class Allocate_commons_task): Remove symtab_lock_
6391 field, and corresponding constructor parameter.
6392 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6394 (Allocate_commons_task::locks): Likewise.
6396 2010-02-11 Ian Lance Taylor <iant@google.com>
6398 * gold-threads.h (class Once): Define.
6399 (class Initialize_lock): Rewrite as child of Once.
6400 * gold-threads.cc (class Once_initialize): Define.
6401 (once_pointer_control): New static variable.
6402 (once_pointer, once_arg): New static variables.
6403 (c_run_once): New static function.
6404 (Once::Once, Once::run_once, Once::internal_run): New functions.
6405 (class Initialize_lock_once): Remove.
6406 (initialize_lock_control): Remove.
6407 (initialize_lock_pointer): Remove.
6408 (initialize_lock_once): Remove.
6409 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6410 (Initialize_lock::initialize): Rewrite.
6411 (Initialize_lock::do_run_once): New function.
6412 * archive.cc (Archive::interpret_header): Only clear name if it is
6414 * fileread.cc: Include "gold-threads.h"
6415 (file_counts_lock): New static variable.
6416 (file_counts_initialize_lock): Likewise.
6417 (File_read::release): Only increment counts when using --stats.
6418 Use a lock around the increment.
6419 * parameters.cc (class Set_parameters_target_once): Define.
6420 (set_parameters_target_once): New static variable.
6421 (Parameters::Parameters): Move here from parameters.h.
6422 (Parameters::set_target): Rewrite.
6423 (Parameters::set_target_once): New function.
6424 (Parameters::clear_target): Move here and rewrite.
6425 * parameters.h (class Parameters): Update declarations. Add
6426 set_parameters_target_once_ field.
6427 (Parameters::Parameters): Move to parameters.cc.
6428 (Parameters::clear_target): Likewise.
6429 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6431 (Start_group::~Start_group): New function.
6432 (Start_group::is_runnable): New function.
6433 (Start_group::locks, Start_group::run): New functions.
6434 (Finish_group::run): Change saw_undefined to size_t.
6435 * readsyms.h (class Start_group): Define.
6436 (class Finish_group): Change saw_undefined_ field to size_t.
6437 (Finish_group::Finish_group): Remove saw_undefined and
6438 this_blocker parameters. Change all callers.
6439 (Finish_group::set_saw_undefined): New function.
6440 (Finish_group::set_blocker): New function.
6441 * symtab.h (class Symbol_table): Change saw_undefined to return
6442 size_t. Change saw_undefined_ field to size_t.
6443 * target-select.cc (Set_target_once::do_run_once): New function.
6444 (Target_selector::Target_selector): Initialize set_target_once_
6445 field. Don't initialize lock_ and initialize_lock_ fields.
6446 (Target_selector::instantiate_target): Rewrite.
6447 (Target_selector::set_target): New function.
6448 * target-select.h (class Set_target_once): Define.
6449 (class Target_selector): Update declarations. Make
6450 Set_target_once a friend. Remove lock_ and initialize_lock_
6451 fields. Add set_target_once_ field.
6453 2010-02-10 Ian Lance Taylor <iant@google.com>
6455 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6457 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6458 (queue_middle_tasks): Add all blockers before queueing any tasks.
6459 (queue_final_tasks): Likewise.
6460 * token.h (Task_token::add_blockers): New function.
6461 * object.h (Input_objects::number_of_relobjs): New function.
6463 2010-02-10 Ian Lance Taylor <iant@google.com>
6465 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6466 shared, not if not position independent.
6467 * x86_64.cc (Relocate::relocate_tls): Likewise.
6468 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6469 (tls_pie_pic_test): New target.
6470 * testsuite/Makefile.in: Rebuild.
6472 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6473 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6474 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6475 * testsuite/Makefile.in: Rebuild.
6477 2010-02-09 David S. Miller <davem@davemloft.net>
6479 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6480 R_SPARC_RELATIVE using ->add_local_relative().
6481 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6483 * output.h (Output_data_dynamic::add_section_size): New method
6484 that takes two Output_data objects.
6485 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6486 entry param. Handle it in initializers.
6487 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6488 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6489 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6491 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6492 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6493 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6494 for dynrel_includes_plt.
6495 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6496 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6497 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6499 (Target_sparc::do_finalize_sections): Update to pass true for
6500 dynrel_includes_plt.
6501 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6502 output before .rela.plt
6503 (Target_powerpc::do_finalize_sections): Update to pass true for
6504 dynrel_includes_plt when 32-bit.
6506 2010-02-08 Doug Kwan <dougkwan@google.com>
6508 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6510 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6511 Arm_relobj::scan_section_for_cortex_a8_stubs,
6512 Arm_relobj::do_relocation_section): Instead of calling
6513 Output_section::output_address, use faster
6514 Arm_relobj::simple_input_section_output_address.
6516 2010-02-08 David S. Miller <davem@davemloft.net>
6518 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6519 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6520 relocation helper function.
6522 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6523 just like R_SPARC_GOT{10,13,22}.
6524 (Target_sparc::Scan::local): Likewise.
6525 (Target_sparc::Relocate:relocate): Likewise.
6527 2010-02-06 Ian Lance Taylor <iant@google.com>
6529 * configure.ac: Rewrite targetobjs duplicate removal code to use
6530 only shell constructs.
6531 * configure: Rebuild.
6533 2010-02-05 Doug Kwan <dougkwan@google.com>
6536 * arm.cc (Arm_relobj::section_is_scannable): New method.
6537 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6538 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6540 2010-02-04 Doug Kwan <dougkwan@google.com>
6543 * arm-reloc-property.cc (cstdio): Include.
6544 * configure.ac (targetobjs): Remove duplicates.
6545 * configure: Regenerate.
6546 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6547 big and little endian version for a given address size.
6549 2010-02-03 Doug Kwan <dougkwan@google.com>
6551 * arm-reloc-property.cc
6552 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6554 * arm-reloc-property.h
6555 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6556 New method definition.
6557 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6559 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6561 (GOT_PREL): Change implemented to Y.
6562 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6563 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6564 (Arm_relocate_functions::movw_abs_nc): Remove method.
6565 (Arm_relocate_functions::movt_abs): Ditto.
6566 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6567 (Arm_relocate_functions::thm_movt_abs): Ditto.
6568 (Arm_relocate_functions::movw_rel_nc): Ditto.
6569 (Arm_relocate_functions::movw_rel): Ditto.
6570 (Arm_relocate_functions::movt_rel): Ditto.
6571 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6572 (Arm_relocate_functions:thm_movw_rel): Ditto.
6573 (Arm_relocate_functions:thm_movt_rel): Ditto.
6574 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6575 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6576 New method definitions.
6577 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6578 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6579 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6580 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6581 (Target_arm::Relocate::relocate): Check for non-static or
6582 unimplemented relocation code and exit early. Change calls to
6583 Target_arm::reloc_uses_thumb_bit and
6584 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6585 instead. Refactor code to handle similar relocations to increase
6586 code sharing. Remove check for unsupported relocation code in switch
6588 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6589 relocation property table to find out size. Change error message to
6590 print out the name of a relocation code instead of the numeric value.
6591 (Target_arm::scan_reloc_for_stub): Use relocation property table
6592 instead of calling Target_arm::reloc_uses_thumb_bit().
6594 2010-02-02 Doug Kwan <dougkwan@google.com>
6596 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6597 types of relaxed input section.
6599 2010-02-02 Doug Kwan <dougkwan@google.com>
6601 * Makefile.am (HFILES): Add arm-reloc-property.h.
6603 (TARGETSOURCES): Add arm-reloc-property.cc
6604 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6605 (libgold_a_SOURCES): $(DEFFILES)
6606 * Makefile.in: Regenerate.
6607 * arm-reloc-property.cc: New file.
6608 * arm-reloc-property.h: New file.
6609 * arm-reloc.def: New file.
6610 * arm.cc: Update comments.
6611 (arm-reloc-property.h): New included header.
6612 (arm_reloc_property_table): New global variable.
6613 (Target_arm::do_select_as_default_target): New method definition.
6614 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6615 arm-reloc-property to targ_extra_obj.
6616 * parameters.cc (set_parameters_target): Call
6617 Target::select_as_default_target().
6618 * target.h (Target::select_as_default_target): New method definition.
6619 (Target::do_select_as_default_target): Same.
6621 2010-02-01 Doug Kwan <dougkwan@google.com>
6623 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6624 first_output_text_section_.
6625 (Arm_exidx_fixup::first_output_text_section): New method definition.
6626 (Arm_exidx_fixup::first_output_text_section_): New data member.
6627 (Arm_exidx_fixup::process_exidx_section): Record the first text
6628 output section seen.
6629 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6630 and entsize in output section header.
6632 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6634 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6635 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6636 (Arm_relocate_functions::thm_alu11): New Method.
6637 (Arm_relocate_functions::thm_pc8): New Method.
6638 (Arm_relocate_functions::thm_pc12): New Method.
6639 (Target_arm::Scan::local): Handle the relocations.
6640 (Target_arm::Scan::global): Likewise.
6641 (Target_arm::Relocate::relocate): Likewise.
6642 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6644 2010-01-29 Doug Kwan <dougkwan@google.com>
6646 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6647 of relocation types as ld.
6649 2010-01-29 Doug Kwan <dougkwan@google.com>
6651 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6653 (Arm_relocate_functions::thumb_branch_common): Ditto.
6654 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6655 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6656 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6657 Arm_relocate_functions::jump24): Remove.
6658 (Target_arm::Relocate::relocate): Adjust code to call
6659 Arm_relocation_functions::arm_branch_common and
6660 Arm_relocation_functions::thumb_branch_common instead of their removed
6661 wrappers. Merge switch-cases together to reduce source code size.
6663 2010-01-29 Doug Kwan <dougkwan@google.com>
6665 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6666 output_local_symbol_count_needs_update_.
6667 (Arm_relobj::output_local_symbol_count_needs_update,
6668 Arm_relobj::set_output_local_symbol_count_needs_update,
6669 Arm_relobj::update_output_local_symbol_count): New methods.
6670 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6672 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6673 of pointed function as in a R_ARM_PREL31 relocation.
6674 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6675 for output local symbol count updating.
6676 (Target_arm::do_relax): Update output local symbol counts in objects
6678 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6680 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6682 * arm.cc: Added support for the ARM relocations:
6683 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6684 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6685 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6687 (Arm_relocate_functions::movw_rel): New method.
6688 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6689 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6691 (Arm_relocate_functions::thm_movw_rel): New method.
6692 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6694 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6696 (Target_arm::Scan::global): Likewise.
6697 (Target_arm::Relocate::relocate): Likewise.
6698 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6701 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6703 * arm.cc: Added support for ARM group relocations.
6704 (Target_arm::reloc_needs_sym_origin): New method.
6705 (Arm_relocate_functions::calc_grp_kn): New method.
6706 (Arm_relocate_functions::calc_grp_residual): New method.
6707 (Arm_relocate_functions::calc_grp_gn): New method.
6708 (Arm_relocate_functions::arm_grp_alu): New Method.
6709 (Arm_relocate_functions::arm_grp_ldr): New Method.
6710 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6711 (Arm_relocate_functions::arm_grp_ldc): New Method.
6712 (Target_arm::Scan::local): Handle the ARM group relocations.
6713 (Target_arm::Scan::global): Likewise.
6714 (Target_arm::Relocate::relocate): Likewise.
6715 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6718 2010-01-26 Doug Kwan <dougkwan@google.com>
6720 * arm.cc (set): Include.
6721 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6723 (Arm_output_section::Text_section_list): New type.
6724 (Arm_output_section::append_text_sections_to_list): New method.
6725 (Arm_output_section::fix_exidx_coverage): Ditto.
6726 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6727 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6728 Relobj::set_section_offset() instead of
6729 Sized_relobj::invalidate_section_offset().
6730 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6731 parameter for section headers. Ignore relocation sections for
6732 unallocated sections and EXIDX sections.
6733 (Target_arm::fix_exidx_coverage): New method.
6734 (Target_arm::output_section_address_less_than): New type.
6735 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6736 linked text section instead of the EXIDX section.
6737 (Arm_output_section::create_stub_group): Add an assertion to check
6738 that this is not an EXIDX output section.
6739 (Arm_output_section::append_text_sections_to_list): New method.
6740 (Arm_output_section::fix_exidx_coverage): Ditto.
6741 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6742 Arm_relobj::section_needs_reloc_stub_scanning.
6743 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6745 (Target_arm::fix_exidx_coverage): New method.
6746 * object.h (Relobj::set_output_section): New method.
6747 (Sized_relobj::invalidate_section_offset): Remove method.
6748 (Sized_relobj::do_invalidate_section_offset): Remove method.
6749 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6751 2010-01-25 Doug Kwan <dougkwan@google.com>
6753 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6754 Fix warning due to signed and unsigned comparison on a 32-bit host.
6756 2010-01-22 Doug Kwan <dougkwan@google.com>
6758 * arm.cc (Target_arm::do_relax): Record an output section for section
6759 offset adjustment it contains any stub table that has changed.
6760 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6761 offsets in an output section if necessary.
6762 * output.cc (Output_section::Output_section): Initialize
6763 section_offsets_need_adjustments_.
6764 (Output_section::add_input_section_for_script): Renamed to
6765 Output_section::add_simple_input_section.
6766 (Output_section::save_states): Add a comment.
6767 (Output_section::discard_states): New method defintion.
6768 (Output_section::adjust_section_offsets): Same.
6769 * output.h (Output_section::add_input_section_for_script): Renamed to
6770 Output_section::add_simple_input_section.
6771 (Output_section::discard_states): New method declaration.
6772 (Output_section::adjust_section_offsets): Same.
6773 (Output_section::section_offsets_need_adjustment,
6774 Output_section::set_section_offsets_need_adjustment): New method
6776 (Output_section::section_offsets_need_adjustment_): New data member.
6777 * script-sections.cc
6778 (Output_section_element_input::set_section_address): Adjust code for
6779 renaming of Output_section::add_input_section_for_script.
6780 (Orphan_output_section::set_section_address): Same.
6782 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6784 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6785 Fix_v4bx enum values .
6786 * gold/options.h (General_options): New option definitions.
6787 (General_options::fix_v4bx): New method.
6788 (General_options::Fix_v4bx): New enum.
6789 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6790 (General_options::parse_fix_v4bx_interworking): New method.
6792 2010-01-22 Doug Kwan <dougkwan@google.com>
6794 * arm.cc (Arm_exidx_fixup): New class.
6796 2010-01-21 Doug Kwan <dougkwan@google.com>
6798 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6800 (Arm_exidx_section_offset_map): New type.
6802 2010-01-21 Doug Kwan <dougkwan@google.com>
6804 * arm.cc (Arm_exidx_input_section): New class.
6805 (Arm_relobj::exidx_input_section_by_link,
6806 Arm_relobj::exidx_input_section_by_shndx,
6807 Arm_relobj::make_exidx_input_section): New methods.
6808 (read_arm_attributes_section): Remove.
6809 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6810 information about them.
6811 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6814 2010-01-20 Doug Kwan <dougkwan@google.com>
6816 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6817 Input_section_specifier to Section_id.
6818 (Target_arm::new_arm_input_section: Adjust code for change of key
6820 (Target_arm::find_arm_input_section): Ditto.
6821 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6822 (Section_id): Remove.
6823 (Garbage_collection::Section_id_hash): Remove.
6824 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6825 (Section_id): Remove.
6826 (Icf::Section_id_hash): Remove.
6827 * object.h (Section_id, Const_section_id, Section_id_hash,
6828 Const_section_id_hash): New type definitions.
6829 * output.cc (Output_section::add_relaxed_input_section): Change to
6830 use Const_section_id instead of Input_section_specifier as key type.
6831 (Output_section::add_merge_input_section): Ditto.
6832 (Output_section::build_relaxation_map): Change to use Section_id
6833 instead of Input_section_specifier as key type.
6834 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6836 (Output_section::convert_input_sections_to_relaxed_sections): Change
6837 to use Const_section_id instead of Input_section_specifier as key type.
6838 (Output_section::find_merge_section): Ditto.
6839 (Output_section::find_relaxed_input_section): Ditto.
6840 * output.h (Input_section_specifier): Remove class.
6841 (Output_section::Output_section_data_by_input_section_map): Change
6842 key type to Const_section_id.
6843 (Output_section::Output_relaxed_input_section_by_input_section_map):
6845 (Output_section::Relaxation_map): Change key type to Section_id.
6847 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6849 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6850 (class Arm_v4bx_stub): New class.
6851 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6852 (Stub_factory::make_arm_v4bx_stub): New method.
6853 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6854 (Stub_table::empty): Handle v4bx stubs.
6855 (Stub_table::add_arm_v4bx_stub): New method.
6856 (Stub_table::find_arm_v4bx_stub): New method.
6857 (Arm_relocate_functions::v4bx): New method.
6858 (Target_arm::fix_v4bx): New method.
6859 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6860 (Stub_table::relocate_stubs): Likewise.
6861 (Stub_table::do_write): Likewise.
6862 (Stub_table::update_data_size_and_addralign): Likewise.
6863 (Stub_table::finalize_stubs): Likewise.
6864 (Target_arm::Scan::local): Likewise.
6865 (Target_arm::Scan::global): Likewise.
6866 (Target_arm::do_finalize_sections): Likewise.
6867 (Target_arm::Relocate::relocate): Likewise.
6868 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6870 (Target_arm::scan_reloc_for_stub): Likewise.
6871 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6873 2010-01-19 Ian Lance Taylor <iant@google.com>
6875 * output.cc (Output_section_headers::do_sized_write): Write large
6876 segment count to sh_info field.
6877 (Output_file_header::do_sized_write): For large segment count,
6878 write PN_XNUM to e_phnum field.
6880 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6882 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6883 (Arm_relocate_functions::thm_jump8): New function.
6884 (Arm_relocate_functions::thm_jump11): New function.
6885 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6887 (Target_arm::Scan::global): Likewise.
6888 (Target_arm::Relocate::relocate): Likewise.
6889 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6892 2010-01-14 Doug Kwan <dougkwan@google.com>
6894 * arm.cc (map, utility): Include headers.
6895 (Target_arm::apply_cortex_a8_workaround): New method.
6896 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6897 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6898 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6899 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6900 the --[no-]fix-cortex-a8 command line options.
6901 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6902 (Target_arm::relocate_stub): Use addend in instruction template.
6903 * options.h (DEFINE_bool): Set the user-set flag.
6904 (General_options): Add --[no-]-fix-cortex options.
6905 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6906 : Update fast look-up map after conversion.
6908 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6910 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6911 in the first pass of do_layout.
6913 2010-01-13 Doug Kwan <dougkwan@google.com>
6915 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6916 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6917 apparent compiler problem of not folding static constant integral
6918 data members of elfcpp::Elf_sizes<32>.
6920 2010-01-13 Doug Kwan <dougkwan@google.com>
6922 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6923 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6924 Arm_relobj::scan_section_for_cortex_a8_erratum,
6925 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6926 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6927 sections to scan for relocation stubs into a new method
6928 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6929 relocation and Cortex-A8 stub scanning.
6930 (Target_arm::do_relax): Force stubs to be after stubbed sections
6931 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
6932 the beginning of a new relaxation pass. Update a comment.
6933 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6935 2010-01-12 Ian Lance Taylor <iant@google.com>
6937 * target-reloc.h (visibility_error): New inline function.
6938 (relocate_section): Call visibility_error.
6939 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6940 (MOSTLYCLEANFILES): Likewise.
6941 (protected_4_pic.o, protected_3.err): New targets.
6942 * testsuite/protected_4.cc: New file.
6944 2010-01-12 Doug Kwan <dougkwan@google.com>
6946 * arm.cc (Cortex_a8_reloc): New class.
6947 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6948 and cortex_a8_relocs_info_.
6949 (Target_arm::fix_cortex_a8): New method definition.
6950 (Target_arm::Cortex_a8_relocs_info): New type.
6951 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6952 New data member declarations.
6953 (Target_arm::scan_reloc_for_stub): Record information about
6954 relocations for THUMB branches that might be exempted from the
6955 Cortex-A8 workaround.
6956 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6957 at the beginning of a relaxation pass.
6959 2010-01-12 Doug Kwan <dougkwan@google.com>
6961 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6962 (Arm_relobj::Mapping_symbol_position,
6963 Arm_reloj::Mapping_symbol_position_less,
6964 Arm_relobj::Mapping_symbols_info): New types.
6965 (Target_arm::is_mapping_symbol_name): New method definition.
6966 (Arm_relobj::do_count_local_symbols): Save information about mapping
6969 2010-01-11 Doug Kwan <dougkwan@google.com>
6971 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6972 Arm_relocate_functions::thumb32_branch_upper,
6973 Arm_relocate_functions::thumb32_branch_lower,
6974 Arm_relocate_functions::thumb32_cond_branch_offset,
6975 Arm_relocate_functions::thumb32_cond_branch_upper,
6976 Arm_relocate_functions::thumb32_cond_branch_lower,
6977 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6978 branch offset encoding.
6979 (Arm_relocate_functions::thumb_branch_common): Use new branch
6980 offset encoding methods to avoid code duplication.
6981 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6982 (Stub_addend_reader::operator()): Use new branch encoding method
6983 to avoid code duplication.
6985 2010-01-11 Doug Kwan <dougkwan@google.com>
6987 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6988 (Target_arm::do_finalize_sections): Define special EXIDX section
6989 symbols only if referenced.
6990 * gc.h (Garbage_collection::add_reference): New method.
6991 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6994 2010-01-11 Ian Lance Taylor <iant@google.com>
6996 * script.cc (Version_script_info::build_expression_list_lookup):
6997 Change complaing about duplicate wildcard match from error to
7000 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7002 (Version_script_info::Version_script_info): Initialize globs_,
7003 default_version_, default_is_global_, and exact_. Don't
7004 initialize globals_ or locals_.
7005 (Version_script_info::build_lookup_tables): Build local symbols
7007 (Version_script_info::unquote): New function.
7008 (Version_script_info::add_exact_match): New function.
7009 (Version_script_info::build_expression_list_lookup): Remove lookup
7010 parameter. Add is_global parameter. Change all callers. Handle
7011 wildcard pattern specially. Unquote pattern. Call
7013 (Version_script_info::get_name_to_match): New function.
7014 (Version_script_info::get_symbol_version): New function.
7015 (Version_script_info::get_symbol_version_helper): Remove.
7016 (Version_script_info::check_unmatched_names): Call unquote.
7017 * script.h (class Version_script_info): Change get_symbol_version
7018 to be non-inline and add is_global parameter; change all callers.
7019 Rewrite symbol_is_local. Update declarations. Define struct
7020 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7021 Remove globals_ and locals_ members. Add exact_, globs_,
7022 default_version_, is_global_.
7023 (Version_script_info::Glob): Remove pattern, add expression and
7024 is_global. Update constructor. Change all callers.
7025 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7027 (Versions::symbol_section_contents): If a symbol is undefined, or
7028 defined in a dynamic object, set the version index to
7030 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7032 (Symbol_table::add_from_pluginobj): Likewise.
7033 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7035 2010-01-11 Doug Kwan <dougkwan@google.com>
7037 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7038 (incremental_dump_LDADD): Add linking option for libintl.
7039 * Makefile.in: Regenerate.
7041 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7044 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7046 * testsuite/Makefile.in: Regenerated.
7048 2010-01-10 Doug Kwan <dougkwan@google.com>
7050 * options.h (DEFINE_var): Use parentheses around argument varname__
7051 in macro body to avoid any unintended subsequent substitutions.
7053 2010-01-10 Ian Lance Taylor <iant@google.com>
7055 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7056 candidates before doing symbol resolution.
7058 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7059 ODR candidates if only one is weak.
7061 2010-01-08 Ian Lance Taylor <iant@google.com>
7063 * script.cc (Version_script_info::build_expression_list_lookup):
7064 Don't warn about ambiguous version, just record the ambiguity.
7065 (Version_script_info::get_symbol_version_helper): Give error if
7066 version is ambiguous.
7068 2010-01-08 Doug Kwan <dougkwan@google.com>
7070 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7071 prev_data_size_ and prev_addralign_. Remove initializer for
7072 deleted data member has_been_changed_.
7073 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7074 to determine if the table is empty.
7075 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7077 (Stub_table::add_reloc_stub): Define method in class definition
7078 instead of just declaring it there.
7079 (Stub_table::add_cortex_a8_stub): New method definition.
7080 (Stub_table::update_data_size_and_addralign): Ditto.
7081 (Stub_table::finalize_stubs): Ditto.
7082 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7083 (Stub_table::do_addralign_): Return address alignment in the
7084 (Stub_table::do_reset_address_and_file_offset): Define method in
7085 class definition instead of declaring it there. Set current data
7086 size to be the data size of the previous pass.
7087 (Stub_table::set_final_data_size): Use current data size as the
7089 (Stub_table::relocate_stub): Change parameter type of stub from
7090 Reloc_stub pointer to Stub pointer.
7091 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7092 (Stub_table::Cortex_a8_stub_list): New typedef.
7093 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7094 Stub_table::prev_addralign_): New data member.
7095 (Arm_relobj::Arm_relobj): Initialize data member
7096 section_has_cortex_a8_workaround_.
7097 (Arm_relobj::section_has_cortex_a8_workaround,
7098 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7100 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7102 (Target_arm::relocate_stub): Change parameter type of stub from
7103 Reloc_stub pointer to Stub pointer.
7104 (Insn_template::size, Insn_template::alignment): Handle
7105 THUMB16_SPECIAL_TYPE.
7106 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7107 Stub_table::update_data_size_and_addralign,
7108 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7110 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7111 (Stub_table::do_write): Ditto.
7112 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7114 2010-01-08 Ian Lance Taylor <iant@google.com>
7117 * symtab.h (class Symbol): Remove fields is_target_special_ and
7118 has_plt_offset_. Add field is_defined_in_discarded_section_.
7119 (Symbol::is_defined_in_discarded_section): New function.
7120 (Symbol::set_is_defined_in_discarded_section): New function.
7121 (Symbol::has_plt_offset): Rewrite.
7122 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7123 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7124 Don't initialize is_target_special_ or has_plt_offset_.
7125 Initialize is_defined_in_discarded_section_.
7126 (Symbol_table::add_from_relobj): If appropriate, set
7127 is_defined_in_discarded_section.
7128 * resolve.cc (Symbol::override_base_with_special): Don't test
7129 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7130 * target-reloc.h (relocate_section): Do special handling for
7131 symbols defined in discarded sections for global symbols as well
7134 2010-01-08 Ian Lance Taylor <iant@google.com>
7136 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7137 the SHT_SYMTAB case.
7139 2010-01-08 Ian Lance Taylor <iant@google.com>
7141 * object.cc (Sized_relobj::do_layout): Don't get confused if
7142 layout_eh_frame returns NULL.
7144 2010-01-08 Ian Lance Taylor <iant@google.com>
7147 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7148 dynamic symbol table, use the normal symbol table.
7149 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7152 2010-01-08 Ian Lance Taylor <iant@google.com>
7155 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7158 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7160 * version.cc (print_version): Change to "Copyright 2010".
7162 2010-01-08 Ian Lance Taylor <iant@google.com>
7166 * i386.cc (class Target_i386): Change return type of plt_section
7168 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7169 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7170 tls_desc_rel_ field.
7171 (Output_data_plt_i386::rel_tls_desc): New function.
7172 (Target_i386::rel_tls_desc_section): New function.
7173 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7174 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7175 R_386_TLS_DESC reloc in rel_tls_desc_section.
7176 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7177 Define struct Tlsdesc_info.
7178 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7179 (Target_x86_64::do_reloc_symbol_index): New function.
7180 (Target_x86_64::add_tlsdesc_info): New function.
7181 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7182 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7184 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7186 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7187 (Target_x86_64::rela_tlsdesc_section): New function.
7188 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7190 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7191 (Target_x86_64::do_reloc_addend): New function.
7192 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7193 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7194 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7195 (Output_reloc::type): New function.
7196 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7197 (Output_reloc::is_target_specific): New function.
7198 (Output_reloc::target_arg): New function.
7199 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7200 absolute relocs and target specific relocs.
7201 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7202 add_target_specific.
7203 (class Output_data_reloc) [SHT_RELA]: Likewise.
7204 * output.cc (Output_reloc::Output_reloc): Add four new versions
7205 for absolute relocs and target specific relocs.
7206 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7207 (Output_reloc::get_symbol_index): Likewise.
7208 (Output_reloc::local_section_offset): Check that local_sym_index_
7209 is not TARGET_CODE or 0.
7210 (Output_reloc::symbol_value): Likewise.
7211 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7213 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7214 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7216 * layout.cc (add_target_dynamic_tags): Use output section for
7217 DT_PLTRELSZ and DT_JMPREL.
7219 2010-01-07 Ian Lance Taylor <iant@google.com>
7222 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7224 (class Output_data_reloc_generic): Define.
7225 (class Output_data_reloc_base): Change base class to
7226 Output_data_reloc_generic. Change add() method to call
7227 bump_relative_reloc_count for a relative reloc. Remove
7229 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7231 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7232 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7234 * layout.h (class Layout): Update declaration.
7236 2010-01-07 Ian Lance Taylor <iant@google.com>
7238 * output.h (class Output_data): Add const version of
7239 output_section and do_output_section.
7240 (class Output_section_data): Add const version of
7242 (class Output_section): Likewise.
7243 * layout.cc (Layout::add_target_dynamic_tags): New function.
7244 * layout.h (class Layout): Update declarations.
7245 * arm.cc (Target_arm::do_finalize_sections): Use
7246 add_target_dynamic_tags.
7247 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7248 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7249 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7250 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7252 2010-01-07 Ian Lance Taylor <iant@google.com>
7255 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7258 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7259 Ian Lance Taylor <iant@google.com>
7262 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7263 Xindex::read_symtab_xindex.
7265 2010-01-07 Doug Kwan <dougkwan@google.com>
7267 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7268 (Insn_template::thumb16_bcond_insn): New method declaration.
7269 (Insn_template): Fix spelling.
7270 (Stub::thumb16_special): New method declaration.
7271 (Stub::do_write): Define virtual method which was previously pure
7273 (Stub::do_thumb16_special): New method declaration.
7274 (Stub::do_fixed_endian_write): New template member.
7275 (Reloc_stub::do_write): Remove.
7276 (Reloc_stub::do_fixed_endian_write): Remove.
7277 (Cortex_a8_stub): New class definition.
7278 (Stub_factory::make_cortex_a8_stub): New method definition.
7279 (Stub_factory::Stub_factory): Add missing static storage class
7280 qualifier for elf32_arm_stub_a8_veneer_blx.
7282 2010-01-07 Ian Lance Taylor <iant@google.com>
7285 * options.h (class General_options): Add --warn-unresolved-symbols
7286 and --error-unresolved-symbols.
7287 * errors.cc (Errors::undefined_symbol): Implement
7288 --warn-unresolved-symbols.
7290 * options.h (class General_options): Add -z text and -z textoff.
7291 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7293 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7295 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7296 (Garbage_collection::cident_sections): New function.
7297 (Garbage_collection::add_cident_section): New function.
7298 (Garbage_collection::cident_sections_): New member.
7299 (gc_process_relocs): Add references to sections whose names are C
7301 * gold.h (cident_section_start_prefix): New constant.
7302 (cident_section_stop_prefix): New constant.
7303 (is_cident): New function.
7304 * layout.cc (Layout::define_section_symbols): Replace string constants
7305 with the newly defined constants.
7306 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7308 * testsuite/Makefile.am: Add gc_orphan_section_test.
7309 * testsuite/Makefile.in: Regenerate.
7310 * testsuite/gc_orphan_section_test.cc: New file.
7311 * testsuite/gc_orphan_section_test.sh: New file.
7313 2010-01-06 Ian Lance Taylor <iant@google.com>
7316 * options.h (class General_options): Add --warn-shared-textrel.
7317 * layout.cc (Layout::finish_dynamic_section): Implement
7318 --warn-shared-textrel.
7321 * options.h (class General_options): Add --warn-multiple-gp.
7323 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7325 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7326 $(THREADSLIB) and $(LIBDL).
7327 * Makefile.in: Rebuild.
7329 2010-01-06 Ian Lance Taylor <iant@google.com>
7332 * options.cc (General_options::parse_section_start): New function.
7333 (General_options::section_start): New function.
7334 (General_options::General_options): Initialize all members.
7335 * options.h: Include <map>
7336 (class General_options): Add --section-start. Add section_starts_
7338 * layout.cc (Layout::attach_allocated_section_to_segment): If
7339 --section-start was used, set the address of the segment. Remove
7340 local sort_sections.
7341 (Layout::relaxation_loop_body): If the address of the load segment
7342 has been set by --section-start, don't use it.
7343 * output.h (Output_segment::update_flags_for_output_section): New
7345 * output.cc (Output_segment::add_output_section): Call
7346 update_flags_for_output_section.
7348 2010-01-05 Ian Lance Taylor <iant@google.com>
7351 * options.h (class General_options): Add --undefined-version.
7352 * script.cc (struct Version_expression): Add was_matched_by_symbol
7354 (Version_script_info::matched_symbol): New function.
7355 (Version_script_info::get_symbol_version_helper): Call
7357 (Version_script_info::check_unmatched_names): New function.
7358 * script.h (class Version_script_info): Update declarations.
7359 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7361 * options.h (class General_options): Use DEFINE_bool_alias for
7362 allow_multiple_definition.
7363 * resolve.cc (Symbol_table::should_override): Don't test
7364 allow_multiple_definition.
7367 * options.h (class General_options): Add --cref.
7368 * main.cc (main): Print cref table if --cref. Don't close mapfile
7369 until after printing cref table.
7370 * cref.cc: Include "symtab.h".
7371 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7372 (Cref_table_compare::operator()): New function.
7373 (Cref_inputs::gather_cref): New function.
7374 (filecol): New static const.
7375 (Cref_inputs::print_cref): New function.
7376 (Cref::print_cref): New function.
7377 * cref.h: Include <cstdio>.
7378 (class Cref): Update declarations.
7379 * mapfile.h (Mapfile::file): New function.
7380 * object.h (class Object): Define Symbols. Declare virtual
7381 do_get_global_symbols.
7382 (Object::get_global_symbols): New function.
7383 * object.cc (Input_objects::add_object): Pass object to cref_ if
7385 (Input_objects::archive_start): Likewise.
7386 (Input_objects::archive_stop): Likewise.
7387 (Input_objects::print_cref): New function.
7388 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7389 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7391 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7393 * plugin.h (class Sized_pluginobj): Update declarations.
7395 2010-01-05 Ian Lance Taylor <iant@google.com>
7397 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7398 to is_default_version. Rename insdef to insdefault.
7399 (Symbol_table::add_from_relobj): Rename def to is_default_version
7400 and local to is_forced_local.
7401 (Symbol_table::add_from_pluginobj): Likewise.
7402 (Symbol_table::add_from_dynobj): Likewise.
7403 (Symbol_table::define_special_symbol): Rename insdef to
7406 2010-01-04 Ian Lance Taylor <iant@google.com>
7409 * options.h (class General_options): Add
7410 --allow-multiple-definition and -z muldefs.
7411 * resolve.cc (Symbol_table::should_override): Don't warn about a
7412 multiple symbol definition if --allow-multiple-definition or -z
7416 * options.h (class General_options): Add --add-needed and
7417 --copy-dt-needed-entries. Tweak --as-needed help entry.
7418 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7419 error if --copy-dt-needed-entries aka --add-needed is used and
7420 would cause a change in behaviour.
7423 * options.h (class General_options): Add -G as a short version of
7424 --shared. Add no-op options -assert, -g, and -i.
7426 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7428 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7429 check for .text or .gnu.linkonce.t sections.
7430 * icf.cc (Icf::find_identical_sections): Ditto.
7431 Change the detection for mangled function name within the section
7433 * icf.h (is_section_foldable_candidate): New function.
7435 2009-12-30 Ian Lance Taylor <iant@google.com>
7438 * options.h (class General_options): Permit two dashes with
7439 --retain-symbols-file.
7441 2009-12-30 Ian Lance Taylor <iant@google.com>
7444 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7445 don't put the file header and segment headers in the text
7449 * common.cc (Sort_commons::operator()): Stabilize sort when both
7451 (Symbol_table::do_allocate_commons_list): When allocating common
7452 symbols, skip a symbol which is no longer common.
7453 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7454 an object before checking its type.
7455 * testsuite/common_test_2.c: New file.
7456 * testsuite/common_test_3.c: New file.
7457 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7458 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7459 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7460 (common_test_2_pic.o, common_test_2.so): New targets.
7461 (common_test_3_pic.o, common_test_3.so): New targets.
7462 * testsuite/Makefile.in: Rebuild.
7465 * script.cc (read_input_script): If we see a new SECTIONS clause,
7466 and we have added an input section, give an error.
7467 * layout.h (class Layout): Add have_added_input_section function.
7468 Add have_added_input_section_ field.
7469 * layout.cc (Layout::Layout): Initialize
7470 have_added_input_section_.
7471 (Layout::layout): Set have_added_input_section_.
7472 (Layout::layout_eh_frame): Likewise.
7474 2009-12-30 Ian Lance Taylor <iant@google.com>
7477 * options.h (class General_options): Add --sort-common option.
7478 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7479 * common.cc (Sort_common): Add sort_order parameter to
7480 constructor. Add sort_order_ field.
7481 (Sort_commons::operator): Check sort_order_.
7482 (Symbol_table::allocate_commons): Determine the sort order.
7483 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7485 (Symbol_table::do_allocate_commons_list): Likewise.
7487 2009-12-30 Ian Lance Taylor <iant@google.com>
7490 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7491 symbols from this object, don't change the visibility of an
7493 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7495 2009-12-30 Ian Lance Taylor <iant@google.com>
7498 * script.h (class Version_script_info): Define Language enum.
7499 Update declarations. Define Glob, Exact, and Lookup types. Add
7500 new fields globals_, locals_, and is_finalized_.
7501 * script.cc: Various formatting fixes.
7502 (class Parser_closure): Change language_stack_ from a vector of
7503 std::string to one of Version_script_info::Language. Adjust all
7505 (class Lazy_demangler): Remove.
7506 (struct Version_expression): Change language from std::string to
7507 Version_script_info::Language.
7508 (Version_script_info::Version_script_info): New function.
7509 (Version_script_info::~Version_script_info): Don't call clear.
7510 (Version_script_info::finalize): New function.
7511 (Version_script_info::build_lookup_tables): New function.
7512 (Version_script_info::build_expression_list_lookup): New
7514 (Version_script_info::get_symbol_version_helper): Rewrite to use
7516 (Version_script_info::print_expression_list): Adjust to use
7517 Version_script_info::Language.
7518 (script_push_lex_into_version_mode): Check that the version script
7519 has not been finalized.
7520 (version_script_push_lang): Change language string to
7521 Version_script_info::Language.
7522 * options.cc (Command_line::version_script): New function.
7523 * options.h (class General_options): Add finalize_dynamic_list
7524 function. Change version_script from declaration to definition.
7525 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7526 * testsuite/version_script.map: Remove duplicate def of foo.
7527 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7529 * testsuite/Makefile.in: Rebuild.
7531 2009-12-30 Ian Lance Taylor <iant@google.com>
7534 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7535 if the input symbol index is 0, make the output symbol index 0.
7537 2009-12-30 Ian Lance Taylor <iant@google.com>
7540 * options.h (class General_options): Add -x/--discard-all.
7541 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7542 --discard-all. If the local symbol needs a dynamic entry, check
7543 that before handling --discard-locals.
7545 2009-12-30 Ian Lance Taylor <iant@google.com>
7548 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7550 (Output_segment::add_output_section): Don't change the flags if
7554 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7555 GNU hash table if they need a dynamic value. Otherwise, don't add
7556 them if they are defined in a dynamic object or are forced local.
7558 2009-12-29 Ian Lance Taylor <iant@google.com>
7561 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7562 .gnu.hash table for a 32-bit target.
7565 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7566 regular and a dynamic object only needs a dynamic symbol table
7567 entry if it is externally visible.
7570 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7571 constructor. Add global_offset_table_ field.
7572 (Target_i386::got_section): Set global_offset_table_.
7573 (Target_i386::do_finalize_sections): Set global_offset_table_
7575 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7576 in constructor. Add global_offset_table_ field.
7577 (Target_x86_64::got_section): Set global_offset_table_.
7578 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7581 * layout.cc (Layout::Layout): Initialize increase_relro_.
7582 (Layout::get_output_section): Add is_relro, is_last_relro, and
7583 is_first_non_relro parameters. Change all callers.
7584 (Layout::choose_output_section): Likewise.
7585 (Layout::add_output_section_data): Likewise.
7586 (Layout::make_output_section): Likewise.
7587 (Layout::set_segment_offsets): Clear increase_relro when using a
7589 * layout.h (class Layout): Add increase_relro method. Add
7590 increase_relro_ field. Update declarations.
7591 * output.cc (Output_section::Output_section): Initialize
7592 is_last_relro_ and is_first_non_relro_.
7593 (Output_segment::add_output_section): Group relro sections is
7594 do_sort is true. Handle is_last_relro and is_first_non_relro.
7595 (Output_segment::maximum_alignment): Remove relro handling.
7596 (Output_segment::set_section_addresses): Add increase_relro
7597 parameter. Change all callers. Add initial alignment to align
7598 relro sections on separate page. Remove old relro handling.
7599 (Output_segment::set_section_list_addresses): Remove in_relro
7600 parameter. Change all callers.
7601 (Output_segment::set_offset): Add increase parameter. Change all
7602 callers. Remove old relro handling.
7603 * output.h (class Output_section): Add new methods: is_last_relro,
7604 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7605 Add is_last_relro_ and is_first_non_relro_ fields.
7606 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7607 Create separate .got.plt section. Call increase_relro.
7608 * x86_64.cc (Target_x86_64::got_section): Likewise.
7609 * testsuite/relro_script_test.t: Add .got.plt.
7612 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7613 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7614 (Layout::finalize): Call set_dynamic_symbol_size.
7615 (Layout::set_dynamic_symbol_size): New function.
7616 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7617 set_dynamic_symbol_size.
7620 * output.h (class Output_section): Add is_entsize_zero_ field.
7621 * output.cc (Output_section::Output_section): Initialize
7623 (Output_section::set_entsize): If two different entsizes are
7624 requested, force it to zero.
7625 (Output_section::add_input_section): Set flags for .debug_str
7626 before updating section flags. Set entsize.
7627 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7628 and SHF_STRING if all input sections have those flags.
7630 2009-12-29 Rafael Espindola <espindola@google.com>
7632 * main.cc (main): Fix the sys time reporting.
7633 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7636 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7638 * options.cc (General_options::parse_version): Allow -v to exit
7639 without an error if there is nothing to link.
7641 2009-12-29 Ian Lance Taylor <iant@google.com>
7643 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7644 using a version of gcc before 4.1.
7645 * configure: Rebuild.
7647 2009-12-28 Chris Demetriou <cgd@google.com>
7649 * attributes.cc (Output_attributes_section_data::do_write): Use
7650 std::vector::front rather than std::vector::data.
7652 2009-12-28 Ian Lance Taylor <iant@google.com>
7654 * symtab.h (class Symbol_table): Add enum Defined.
7655 * resolve.cc (Symbol_table::should_override): Add defined
7656 parameter. Change all callers. Test whether object is NULL
7657 before calling a method on it.
7658 (Symbol_table::report_resolve_problem): Add defined parameter.
7660 (Symbol_table::should_override_with_special): Likewise.
7661 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7662 parameter. Change all callers.
7663 (Symbol_table::do_define_in_output_data): Likewise.
7664 (Symbol_table::define_in_output_segment): Likewise.
7665 (Symbol_table::do_define_in_output_segment): Likewise.
7666 (Symbol_table::define_as_constant): Likewise.
7667 (Symbol_table::do_define_as_constant): Likewise.
7668 * script.h (class Symbol_assignment): Add is_defsym parameter to
7669 constructor; change all callers.
7670 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7671 parameter. Change all callers. Add is_defsym_ field.
7672 (class Parser_closure): Add parsing_defsym parameter to
7673 constructor; change all callers. Add parsing_defsym accessor
7674 function. Add parsing_defsym_ field.
7676 2009-12-28 Ian Lance Taylor <iant@google.com>
7678 * gold.cc (queue_middle_tasks): Fix formatting.
7679 * object.cc (Relobj::is_section_name_included): Likewise.
7681 2009-12-23 Ian Lance Taylor <iant@google.com>
7683 * i386.cc (Target_i386::do_calls_non_split): Recognize
7684 -fsplit-stack prologue for a function with a static chain.
7685 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7686 -fsplit-stack prologue when using %r11.
7688 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7690 * options.cc (General_options::parse_version): Make -v continue and do
7691 the link like GNU ld does.
7693 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7695 * Makefile.am (CCFILES): Add timer.cc.
7696 (HFILES): Add timer.h.
7697 * configure.ac: Check for sysconf and times.
7698 * main.cc: include timer.h.
7699 (main): Use Timer instead of get_run_time.
7702 * workqueue.cc: include timer.h.
7703 (Workqueue::find_and_run_task):
7704 Report user, sys and wall time.
7705 * Makefile.in: Regenerate.
7706 * config.in: Regenerate.
7707 * configure: Regenerate.
7709 2009-12-16 Doug Kwan <dougkwan@google.com>
7711 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7713 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7714 relaxed input sections.
7715 * output.cc (Output_section::find_relaxed_input_section): Change
7716 return type to Output_relaxed_input_section pointer. Adjust code
7717 for new type of relaxed_input_section_map_.
7718 * output.h (Output_section::find_relaxed_input_section): Change
7719 return type to Output_relaxed_input_section pointer.
7720 (Output_section::Output_relaxed_input_section_by_input_section_map):
7722 (Output_section::relaxed_input_section_map_): Change type to
7723 Output_section::Output_relaxed_input_section_by_input_section_map.
7724 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7727 2009-12-15 Ian Lance Taylor <iant@google.com>
7729 * layout.cc (Layout::create_shstrtab): Only write out after input
7730 sections if we are compressing debug sections.
7732 2009-12-15 Ian Lance Taylor <iant@google.com>
7734 * archive.cc (Archive::add_symbols): Only look up a symbol without
7735 a version if there is, in fact, a version.
7737 2009-12-14 Ian Lance Taylor <iant@google.com>
7739 Revert -Wshadow changes, all changes from:
7740 2009-12-11 Doug Kwan <dougkwan@google.com>
7741 2009-12-11 Nick Clifton <nickc@redhat.com>
7742 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7744 2009-12-11 Doug Kwan <dougkwan@google.com>
7746 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7748 * attributes.cc (Object_attribute::size): Ditto.
7749 (Attributes_section_data::size): Ditto.
7750 (Attributes_section_data::Attributes_section_data): Ditto.
7751 (Output_attributes_section_data::do_write): Ditto.
7752 * attributes.h (Object_attribute::set_type): Ditto.
7753 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7755 2009-12-11 Nick Clifton <nickc@redhat.com>
7757 * archive.cc: Fix shadowed variable warnings.
7759 * compressed_output.cc: Likewise.
7760 * compressed_output.h: Likewise.
7761 * configure: Likewise.
7762 * dwarf_reader.cc: Likewise.
7763 * dynobj.cc: Likewise.
7764 * dynobj.h: Likewise.
7765 * ehframe.cc: Likewise.
7766 * ehframe.h: Likewise.
7767 * errors.cc: Likewise.
7768 * expression.cc: Likewise.
7769 * fileread.cc: Likewise.
7770 * fileread.h: Likewise.
7771 * freebsd.h: Likewise.
7772 * i386.cc: Likewise.
7774 * incremental.h: Likewise.
7775 * layout.cc: Likewise.
7776 * layout.h: Likewise.
7777 * mapfile.cc: Likewise.
7778 * merge.cc: Likewise.
7779 * merge.h: Likewise.
7780 * object.cc: Likewise.
7781 * object.h: Likewise.
7782 * options.h: Likewise.
7783 * output.cc: Likewise.
7784 * output.h: Likewise.
7785 * parameters.cc: Likewise.
7786 * plugin.cc: Likewise.
7787 * powerpc.cc: Likewise.
7788 * reduced_debug_output.cc: Likewise.
7789 * reduced_debug_output.h: Likewise.
7790 * reloc.cc: Likewise.
7791 * reloc.h: Likewise.
7792 * resolve.cc: Likewise.
7793 * script-sections.cc: Likewise.
7794 * script.cc: Likewise.
7795 * script.h: Likewise.
7796 * sparc.cc: Likewise.
7797 * symtab.cc: Likewise.
7798 * symtab.h: Likewise.
7799 * target-select.cc: Likewise.
7800 * target-select.h: Likewise.
7801 * token.h: Likewise.
7802 * workqueue.cc: Likewise.
7803 * workqueue.h: Likewise.
7804 * x86_64.cc: Likewise.
7806 2009-12-10 Doug Kwan <dougkwan@google.com>
7808 * arm.cc (attributes.h): New include.
7809 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7810 (Arm_relobj::~Arm_relobj): Delete object pointed by
7811 attributes_section_data_.
7812 (Arm_relobj::attributes_section_data): New method definition.
7813 (Arm_relobj::attributes_section_data_): New data member declaration.
7814 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7815 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7816 attributes_section_data_.
7817 (Arm_dynobj::attributes_section_data): New method definition.
7818 (Arm_dynobj::attributes_section_data_): New data member declaration.
7819 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7820 initialization value of may_use_blx_ to false.
7821 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7822 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7823 object attributes to compute results instead of hard-coding.
7824 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7825 Target_arm::get_secondary_compatible_arch,
7826 Target_arm::set_secondary_compatible_arch
7827 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7828 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7829 New method declarations.
7830 (Target_arm::get_aeabi_object_attribute): New method definition.
7831 (Target_arm::attributes_section_data_): New data member declaration.
7832 (read_arm_attributes_section): New template definition.
7833 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7834 (Arm_dynobj::do_read_symbols): Ditto.
7835 (Target_arm::do_finalize_sections): Merge attributes sections from
7836 input. Check for BLX use after attributes section merging.
7837 Fix __exidx_start and __exidx_end visibility. Create an
7838 .ARM.attributes section if necessary.
7839 (Target_arm::get_secondary_compatible_arch,
7840 Target_arm::set_secondary_compatible_arch,
7841 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7842 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7843 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7844 New method definitions.
7846 2009-12-09 Ian Lance Taylor <iant@google.com>
7848 * plugin.cc (Plugin::load): Don't cast from void* to a function
7851 2009-12-09 Ian Lance Taylor <iant@google.com>
7853 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7856 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7858 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7859 Replace two_file_shared_1.so with two_file_shared_2.so.
7860 * testsuite/Makefile.in: Regenerated.
7862 2009-12-08 Doug Kwan <dougkwan@google.com>
7864 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7865 (HFILES): Add attributes.h and int_encoding.h.
7866 * Makefile.in: Regenerate.
7867 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7868 function definitions to int_encoding.cc
7869 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7870 prototypes to int_encoding.h
7871 * reduced_debug_output.cc (int_encoding.h): New include.
7872 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7873 function definitions to int_encoding.cc
7874 (insert_into_vector, read_from_pointer): Move template definitions to
7876 * attributes.cc: New file.
7877 * attributes.h: New file.
7878 * int_encoding.cc: New file.
7879 * int_encoding.h: New file.
7881 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7884 * incremental-dump.cc (dump_incremental_inputs): New.
7885 (main): Use dump_incremental_inputs.
7887 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7890 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7891 checking elfcpp::STT_FUNC.
7892 (Target_i386::Relocate::relocate): Likewise.
7893 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7895 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7896 symbols from shared libraries into normal FUNC symbols.
7898 * symtab.h (Symbol): Add is_func and use it.
7900 2009-12-05 Doug Kwan <dougkwan@google.com>
7902 * arm.cc (Target_arm::arm_info): Initialize new fields
7903 attributes_section and attributes_vendor.
7904 * i386.cc (Target_i386::i386_info): Same.
7905 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7906 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7907 fields attributes_section and attributes_vendor.
7908 * sparc.cc (Target_sparc::sparc_info): Same.
7909 * target.h (Target::attributes_section, Target::attributes_vendor,
7910 Target::is_attributes_section, Target::attribute_arg_type,
7911 Target::attributes_order): New method definitions.
7912 (Target::Target_info::attributes_section,
7913 Target::Target_info::attributes_vendor): New fields.
7914 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7915 virtual method definitions.
7916 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7917 attributes_section and attributes_vendor.
7918 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7920 2009-12-05 Doug Kwan <dougkwan@google.com>
7922 * arm.cc: Update comments about interworking and stub generation.
7923 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7924 considered as non-PIC.
7925 (Arm_relocate_functions::base_abs): Fix formatting.
7926 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7927 of function to use GOT entry address instead of offset.
7928 (Target_arm::Scan::global): Issue an error if a symbol would need a
7929 PLT does not get one because it is untyped. Remove code to create
7930 dynamic symbols for relative branches.
7931 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7932 takes unsigned integer instead of boolean.
7934 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7936 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7937 (two_file_test_LDADD): Likewise.
7938 (common_test_1_LDADD): Likewise.
7939 (exception_test_LDADD) Likewise.
7940 (weak_test_LDADD): Likewise.
7941 (many_sections_test_LDADD): Likewise.
7942 (initpri1_LDADD): Likewise.
7943 (script_test_1_LDADD): Likewise.
7944 (script_test_2_LDADD): Likewise.
7945 (justsyms_LDADD): Likewise.
7946 (binary_test_LDADD): Likewise.
7947 (large_LDADD): Likewise.
7948 * testsuite/Makefile.in: Regenerated.
7950 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
7952 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7953 (Symbol_table::override_with_special): Likewise.
7954 (Symbol_table::add_from_object): Likewise.
7956 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7958 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7959 Don't set the data_offset twice.
7961 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7963 * testsuite/Makefile.in: Regenerate.
7965 2009-12-03 Doug Kwan <dougkwan@google.com>
7967 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7968 (Target_arm::do_finalize_sections): Add parameter for symbol table
7969 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7970 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7971 parameter for symbol table pointer.
7972 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7973 an additional parameter for a pointer to symbol table.
7974 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7975 parameter for a symbol table pointer.
7976 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7977 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7979 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7980 parameter for a symbol table pointer.
7982 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7984 * incremental.cc (Incremental_inputs_header)
7985 (Incremental_inputs_header_write, Incremental_inputs_entry)
7986 (Incremental_inputs_entry_write): Move ...
7987 * incremental.h (Incremental_inputs_header)
7988 (Incremental_inputs_header_write, Incremental_inputs_entry)
7989 (Incremental_inputs_entry_write): here.
7991 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7993 * incremental.cc (make_sized_incremental_binary): Set the target.
7994 Error if it is incompatible.
7995 * output.h (Output_file): Add filename method.
7997 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7999 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8000 from the get_* methods.
8002 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8004 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8005 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8006 Write 0 for the data_offset of scripts.
8008 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8010 * testsuite/Makefile.am: Add the incremental_test.sh test.
8011 * testsuite/incremental_test.sh: New.
8012 * testsuite/incremental_test_1.c: New.
8013 * testsuite/incremental_test_2.c: New.
8015 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8017 * incremental-dump.cc (main): Fix typos.
8019 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8022 * incremental-dump.cc (main): Use llu to print 64 bit values.
8024 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8025 H.J. Lu <hongjiu.lu@intel.com>
8027 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8029 (incremental_dump_LDADD): Likewise.
8030 * Makefile.in: Regenerated.
8032 2009-11-25 Doug Kwan <dougkwan@google.com>
8036 2009-11-25 Doug Kwan <dougkwan@google.com>
8038 * arm.cc (Target_arm::Target_arm): Move method definition
8039 outside of class definition. Add code to handle
8040 --target1-rel, --target1-abs and --target2= options.
8041 (Target_arm::get_reloc_reloc_type): Change method to be
8042 non-static and const.
8043 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8044 New data member declaration.
8045 (Target_arm::Scan::local, Target_arm::Scan::global,
8046 Target_arm::Relocate::relocate,
8047 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8048 Adjust call to Target_arm::get_real_reloc_type.
8049 (Target_arm::get_real_reloc_type): Use command line options
8050 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8051 * options.h (--target1-rel, --target1-abs, --target2): New
8054 2009-11-25 Doug Kwan <dougkwan@google.com>
8056 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8057 class definition. Add code to handle --target1-rel, --target1-abs
8058 and --target2= options.
8059 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8061 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8063 (Target_arm::Scan::local, Target_arm::Scan::global,
8064 Target_arm::Relocate::relocate,
8065 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8066 call to Target_arm::get_real_reloc_type.
8067 (Target_arm::get_real_reloc_type): Use command line options to
8068 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8069 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8072 2009-11-25 Doug Kwan <dougkwan@google.com>
8074 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8075 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8076 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8078 (Arm_relocate_functions::thm_call): Replace body with a call to
8079 Arm_relocate_functions::thumb_branch_common.
8080 (Arm_relocate_functions::thm_jump24,
8081 Arm_relocate_functions::thm_xpc22): New method definitions.
8082 (Arm_relocate_functions::thumb_branch_common): New method definition.
8083 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8085 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8086 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8088 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8090 * Makefile.am: Build incremental-dump
8091 * Makefile.in: Regenerate.
8092 * incremental-dump.cc: New.
8093 * incremental.cc (Incremental_inputs_header_data,
8094 Incremental_inputs_entry_data): Move to incremental.h
8095 * incremental.h: (Incremental_inputs_header_data,
8096 Incremental_inputs_entry_data): Move from incremental.cc
8098 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8100 * incremental.cc (Incremental_inputs_header,
8101 Incremental_inputs_header_write, Incremental_inputs_entry,
8102 Incremental_inputs_entry_write): Add a typedef with the data type.
8104 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8106 * incremental.cc (Incremental_inputs_header,
8107 Incremental_inputs_header_write, Incremental_inputs_entry,
8108 Incremental_inputs_entry_write): Update comment about which
8109 type has the filed descriptions.
8111 2009-11-15 Doug Kwan <dougkwan@google.com>
8113 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8114 (Arm_relocate_functions::arm_branch_common): Change method defintion
8115 in class definition to a method declaration and update list of formal
8117 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8118 Arm_relocation_functions::jump24): Adjust call to
8119 Arm_relocate_functions::arm_branch_common. Update list of formal
8121 (Arm_relocate_functions::xpc25): New method definition.
8122 (Arm_relocate_functions::arm_branch_common): Move method defintion
8123 out from class definition. Use stubs for mode-switching and extending
8125 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8126 specially. Change code to enable use of stubs in ARM branches.
8128 2009-11-10 Doug Kwan <dougkwan@google.com>
8130 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8131 in method declaration.
8132 (Target_arm::relocate_stub): New method declaration.
8133 (Target_arm::default_target): Change to return a pointer instead of
8135 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8136 Target_arm::default_target.
8137 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8139 (Target_arm::relocate_section): Adjust view.
8140 (Target_arm::relocate_stub): New method definition.
8142 2009-11-10 Doug Kwan <dougkwan@google.com>
8144 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8146 * incremental.cc (open_incremental_binary): Initialized local
8147 variables to avoid warnings.
8148 * object.cc (make_elf_object): Ditto.
8149 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8152 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8155 * testsuite/plugin_test.c: Include "config.h".
8157 2009-11-09 Doug Kwan <dougkwan@google.com>
8159 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8160 (arm_symbol_value): Remove.
8161 (Arm_relocate_functions::arm_branch_common,
8162 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8163 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8164 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8165 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8166 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8167 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8168 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8169 Arm_relocate_functions::thm_mobw_abs_nc,
8170 Arm_relocate_functions::thm_mov_abs,
8171 Arm_relocate_functions::movw_prel_nc,
8172 Arm_relocate_functions::thm_movt_abs,
8173 Arm_relocate_functions::movt_prel,
8174 Arm_relocate_functions::thm_movw_prel_nc,
8175 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8176 (Target_arm::Relocate::relocate): Only decompose address into two
8177 parts if relocation type uses the thumb-bit and pass the actual
8178 bit instead of a flag indicating that the thumb-bit is used. Adjust
8179 calls to methods in Arm_relocate_functions for this change.
8181 2009-11-08 Ian Lance Taylor <iant@google.com>
8184 * reloc.cc: Instantiate
8185 Sized_relobj::initialize_input_to_output_maps and
8186 Sized_relobj:free_input_to_output_maps.
8188 2009-11-06 Ian Lance Taylor <iant@google.com>
8191 * defstd.cc (in_segment): Set only_if_ref true for "end".
8193 2009-11-06 Doug Kwan <dougkwan@google.com>
8195 * arm.cc (class Reloc_stub): Correct a comment.
8196 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8197 (Target_arm::scan_section_for_stubs): New method declaration.
8198 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8199 Change methods from private to protected.
8200 (Target_arm::do_may_relax): New method definition.
8201 (Target_arm::do_relax, Target_arm::group_sections,
8202 Target_arm::scan_reloc_for_stub,
8203 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8204 (Target_arm::arm_input_section_map_): New data member declaration.
8205 (Target_arm::scan_reloc_for_stub,
8206 Target_arm::scan_reloc_section_for_stubs,
8207 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8208 Target_arm::do_relax): New method definitions.
8210 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8212 * configure.ac: Check for (struct stat)::st_mtim
8213 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8214 * config.in: Regenerate.
8215 * configure: Regenerate.
8217 2009-11-05 Ian Lance Taylor <iant@google.com>
8220 * output.cc (Output_segment::add_output_section): Add missing
8223 2009-11-04 Ian Lance Taylor <iant@google.com>
8226 * object.h (class Object): Add is_needed and set_is_needed
8227 methods. Add is_needed_ field. Make bool fields into bitfields.
8228 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8229 defined in a dynamic object and referenced by a regular object,
8230 set is_needed for the dynamic object.
8231 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8232 if the file is marked with as_needed and it is not needed.
8234 2009-11-04 Ian Lance Taylor <iant@google.com>
8237 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8238 tags if data is discarded by linker script.
8239 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8240 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8241 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8242 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8244 2009-11-04 Ian Lance Taylor <iant@google.com>
8246 * layout.cc (Layout::get_output_section): Add is_interp and
8247 is_dynamic_linker_section parameters. Change all callers.
8248 (Layout::choose_output_section): Likewise.
8249 (Layout::make_output_section): Likewise.
8250 (Layout::add_output_section_data): Add is_dynamic_linker_section
8251 parameter. Change all callers.
8252 * layout.h (class Layout): Update declarations.
8253 * output.h (class Output_section): Add is_interp, set_is_interp,
8254 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8255 Add is_interp_, is_dynamic_linker_section_ fields. Change
8256 generate_code_fills_at_write_ to a bitfield.
8257 * output.cc (Output_section::Output_sections): Initialize new
8259 (Output_segment::add_output_section): Add do_sort parameter.
8262 2009-11-03 Ian Lance Taylor <iant@google.com>
8265 * options.h (class General_options): Add --warn-common.
8266 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8267 merging two common symbols.
8268 (Symbol_table::should_override): Handle --warn-common when merging
8269 a common symbol with a defined symbol. Use report_resolve_problem
8270 for multiple definitions.
8271 (Symbol_table::report_resolve_problem): New function.
8272 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8274 2009-11-03 Doug Kwan <dougkwan@google.com>
8276 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8278 (Target_arm::stub_factory): New method definition.
8279 (Target_arm::new_arm_input_section,
8280 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8281 Target_arm::reloc_uses_thumb_bit): New method declarations.
8282 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8283 New type definitions.
8284 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8285 member declarations.
8286 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8287 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8288 New method definitions.
8290 2009-11-03 Ian Lance Taylor <iant@google.com>
8292 * options.h (class General_options): Add --warn_constructors.
8294 2009-11-03 Ian Lance Taylor <iant@google.com>
8297 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8298 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8300 2009-11-03 Ian Lance Taylor <iant@google.com>
8303 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8304 --msgid-bugs-address.
8305 (install-pdf): New target.
8306 (install-data_yes): Look up one directory to find mkinstalldirs.
8308 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8310 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8313 2009-10-30 Doug Kwan <dougkwan@google.com>
8315 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8317 2009-10-30 Doug Kwan <dougkwan@google.com>
8319 * arm.cc (Stub_addend_reader): New struct template definition
8320 and partial specializations.
8321 (Stub_addend_reader::operator()): New method definition for a
8322 partially specialized template.
8324 2009-10-30 Doug Kwan <dougkwan@google.com>
8326 * arm.cc (Arm_relobj::processor_specific_flags): New method
8328 (Arm_relobj::do_read_symbols): New method declaration.
8329 (Arm_relobj::processor_specific_flags_): New data member declaration.
8330 (Arm_dynobj): New class definition.
8331 (Target_arm::do_finalize_sections): Add input_objects parameter.
8332 (Target_arm::do_adjust_elf_header): New method declaration.
8333 (Target_arm::are_eabi_versions_compatible,
8334 (Target_arm::merge_processor_specific_flags): New method declaration.
8335 (Target_arm::do_make_elf_object): New overloaded method definitions
8337 (Arm_relobj::do_read_symbols): New method definition.
8338 (Arm_dynobj::do_read_symbols): Ditto.
8339 (Target_arm::do_finalize_sections): Add input_objects parameters.
8340 Merge processor-specific flags from all input objects.
8341 (Target_arm::are_eabi_versions_compatible,
8342 Target_arm::merge_processor_specific_flags,
8343 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8344 New method definitions.
8345 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8346 Input_objects pointer type parameter.
8347 * layout.cc (Layout::finalize): Pass input objects to target's.
8348 finalize_sections function.
8349 * output.cc (Output_file_header::do_sized_write): Set ELF file
8350 header's processor-specific flags.
8351 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8352 Input_objects pointer type parameter.
8353 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8354 * target.h (Input_objects): New forward class declaration.
8355 (Target::processor_specific_flags,
8356 Target::are_processor_specific_flags_sect): New method definitions.
8357 (Target::finalize_sections): Add input_objects parameter.
8358 (Target::Target): Initialize processor_specific_flags_ and
8359 are_processor_specific_flags_set_.
8360 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8362 (Target::set_processor_specific_flags): New method definition.
8363 (Target::processor_specific_flags_,
8364 Target::are_processor_specific_flags_set_): New data member
8366 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8367 Input_objects pointer type parameter.
8369 2009-10-30 Doug Kwan <dougkwan@google.com>
8371 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8373 2009-10-28 Ian Lance Taylor <iant@google.com>
8375 * object.h (class Relobj): Drop options parameter from
8376 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8377 do_scan_relocs, do_relocate. Change all callers.
8378 (class Sized_relobj): Drop options parameters from
8379 do_gc_process_relocs, do_scan_relocs, do_relocate,
8380 do_relocate_sections, relocate_sections, emit_relocs_scan,
8381 emit_relocs_scan_reltype. Change all callers.
8382 (struct Relocate_info): Remove options field and all references to
8384 * reloc.h (class Read_relocs): Remove options constructor
8385 parameter and options_ field. Change all callers.
8386 (class Gc_process_relocs, class Scan_relocs): Likewise.
8387 (class Relocate_task): Likewise.
8388 * target-reloc.h (scan_relocs): Remove options parameter. Change
8390 (scan_relocatable_relocs): Likewise.
8391 * target.h (class Sized_target): Remove options parameter from
8392 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8394 * gc.h (gc_process_relocs): Remove options parameter. Change all
8396 * arm.cc: Update functions to remove options parameters.
8397 * i386.cc: Likewise.
8398 * powerpc.cc: Likewise.
8399 * sparc.cc: Likewise.
8400 * x86_64.cc: Likewise.
8401 * testsuite/testfile.cc: Likewise.
8403 2009-10-28 Doug Kwan <dougkwan@google.com>
8405 * arm.cc (Arm_relobj): New class definition.
8406 (Arm_relobj::scan_sections_for_stubs,
8407 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8408 New method definitions.
8410 2009-10-28 Cary Coutant <ccoutant@google.com>
8412 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8413 (Plugin::cleanup_done_): New member.
8414 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8415 (Plugin_manager::cleanup_done_): Remove.
8416 (Plugin_manager::add_input_file): Edit error message.
8417 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8418 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8420 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8422 * fileread.cc: (File_read::View::~View): Use the new
8423 data_ownership_ filed.
8424 (File_read::~File_read): Dispose the new whole_file_view_.
8425 (File_read::open): Mmap the whole file if needed.
8426 (File_read::open): Use whole_file_view_ instead of contents_.
8427 (File_read::find_view): Use whole_file_view_ if applicable.
8428 (File_read::do_read): Use whole_file_view_ instead of contents_.
8429 (File_read::make_view): Use whole_file_view_ instead of contents_,
8430 update File_read::View::View call.
8431 (File_read::find_or_make_view): Update File_read::View::View
8433 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8435 (File_read::View::Data_ownership): New enum.
8436 (File_read::View::View): Replace bool mapped_ with Data_ownership
8438 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8439 (File_read::View::data_ownership_): New field.
8440 (File_read::contents_): Remove (replaced by whole_file_view_).
8441 (File_read::whole_file_view_): New field.
8442 * options.h (class General_options): Add --keep-files-mapped.
8444 2009-10-27 Cary Coutant <ccoutant@google.com>
8446 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8447 * testsuite/Makefile.am (plugin_test_5): New test case.
8448 * testsuite/Makefile.in: Regenerate.
8450 2009-10-25 Doug Kwan <dougkwan@google.com>
8452 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8453 from private to protected to allow access by child class.
8454 (Sized_relobj::do_relocate_sections): New method declaration.
8455 (Sized_relobj::relocate_sections): Virtualize.
8456 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8457 Sized_relobj::relocate_sections. Instantiate template explicitly
8458 for different target sizes and endianity.
8460 2009-10-24 Doug Kwan <dougkwan@google.com>
8462 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8463 (Arm_input_section::as_arm_input_section): New method.
8464 (Arm_output_section): New class definition.
8465 (Arm_output_section::create_stub_group,
8466 Arm_output_section::group_sections): New method definitions.
8468 2009-10-22 Doug Kwan <dougkwan@google.com>
8470 * arm.cc (Arm_input_section): New class definition.
8471 (Arm_input_section::init, Arm_input_section:do_write,
8472 Arm_input_section::set_final_data_size,
8473 Arm_input_section::do_reset_address_and_file_offset): New method
8476 2009-10-21 Doug Kwan <dougkwan@google.com>
8478 * arm.cc (Stub_table, Arm_input_section): New forward class
8480 (Stub_table): New class defintion.
8481 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8482 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8483 New method definition.
8485 2009-10-21 Doug Kwan <dougkwan@google.com>
8487 * arm.cc: Update copyright comments.
8488 (Target_arm): New forward class template declaration.
8489 (Arm_address): New type.
8490 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8491 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8492 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8494 (Insn_template): Same.
8495 (DEF_STUBS): New macro.
8496 (Stub_type): New enum type.
8497 (Stub_template): New class definition.
8500 (Stub_factory): Same.
8501 (Target_arm::Target_arm): Initialize may_use_blx_ and
8502 should_force_pic_veneer_.
8503 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8504 Target_arm::should_force_pic_veneer,
8505 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8506 Target_arm::using_thumb_only, Target_arm:;default_target): New
8508 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8509 New data member declarations.
8510 (Insn_template::size, Insn_template::alignment): New method defintions.
8511 (Stub_template::Stub_template): New method definition.
8512 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8513 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8514 (Stub_factory::Stub_factory): New method definition.
8515 * gold.h (string_hash): New template.
8516 * output.h (Input_section_specifier::hash_value): Use
8518 (Input_section_specifier::string_hash): Remove.
8519 * stringpool.cc (Stringpool_template::string_hash): Use
8522 2009-10-20 Doug Kwan <dougkwan@google.com>
8524 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8525 symbols of relaxed input sections.
8526 * output.h (Output_section::find_relaxed_input_section): Make
8529 2009-10-16 Doug Kwan <dougkwan@google.com>
8531 * dynobj.cc (Versions::Versions): Initialize version_script_.
8532 Only insert base version symbol definition for a shared object
8533 if version script defines any version versions.
8534 (Versions::define_base_version): New method definition.
8535 (Versions::add_def): Check that base version is not needed.
8536 (Versions::add_need): Define base version lazily.
8537 * dynobj.h (Versions::define_base_version): New method declaration.
8538 (Versions::needs_base_version_): New data member declaration.
8539 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8540 (check_DATA): Add no_version_test.stdout.
8541 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8543 * testsuite/Makefile.in: Regenerate.
8544 * testsuite/no_version_test.c: New file.
8545 * testsuite/no_version_test.sh: Ditto.
8547 2009-10-16 Doug Kwan <dougkwan@google.com>
8549 * expression.cc (class Segment_start_expression): New class definition.
8550 (Segment_start_expression::value): New method definition.
8551 (script_exp_function_segment_start): Return a new
8552 Segment_start_expression.
8553 * gold/script-c.h (script_saw_segment_start_expression): New function
8555 * script-sections.cc (Script_sections::Script_sections): Initialize
8556 SAW_SEGMENT_START_EXPRESSION_ to false.
8557 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8558 and -Tbbs options to specify section addresses if given in
8559 command line and no SEGMENT_START expression is seen in a script.
8560 * script-sections.h (Script_sections::saw_segment_start_expression,
8561 Script_sections::set_saw_segment_start_expression): New method
8563 (Script_sections::saw_segment_start_expression_): New data member
8565 * script.cc (script_saw_segment_start_expression): New function.
8566 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8567 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8568 script_test_7.sh and script_test_8.sh.
8569 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8570 script_test_8.stdout.
8571 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8572 (script_test_6, script_test_6.stdout, script_test_7,
8573 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8574 * Makefile.in: Regenerate.
8575 * testsuite/script_test_6.sh: New file.
8576 * testsuite/script_test_6.t: Same.
8577 * testsuite/script_test_7.sh: Same.
8578 * testsuite/script_test_7.t: Same.
8579 * testsuite/script_test_8.sh: Same.
8581 2009-10-16 Doug Kwan <dougkwan@google.com>
8583 * output.cc (Output_segment::set_section_list_address): Cast
8584 expressions to unsigned long long type to avoid format warnings.
8586 2009-10-15 Ian Lance Taylor <iant@google.com>
8588 * script.cc (Script_options::add_symbol_assignment): Always add a
8589 dot assignment to script_sections_.
8590 * script-sections.cc (Script_sections::add_dot_assignment):
8591 Initialize if necessary.
8593 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8594 program headers with no load segment if there is a linker script.
8596 * layout.cc (Layout::set_segment_offsets): Align the file offset
8597 to the segment aligment for -N or -n with no load segment.
8598 * output.cc (Output_segment::add_output_section): Don't crash if
8599 the first section is a TLS section.
8600 (Output_segment::set_section_list_addresses): Print an error
8601 message if the address moves backward in a linker script.
8602 * script-sections.cc
8603 (Output_section_element_input::set_section_addresses): Don't
8604 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8605 (Orphan_output_section::set_section_addresses): Likewise.
8607 2009-10-15 Doug Kwan <dougkwan@google.com>
8609 * layout.cc (Layout::finish_dynamic_section): Generate tags
8610 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8611 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8612 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8614 2009-10-14 Ian Lance Taylor <iant@google.com>
8616 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8618 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8619 data_shdr fields of relinfo.
8620 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8621 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8622 R_386_TLS_LDO_32, adjust based on section flags.
8623 (Target_i386::Relocate::fix_up_ldo): Remove.
8625 2009-10-13 Ian Lance Taylor <iant@google.com>
8627 Add support for -pie.
8628 * options.h (class General_options): Add -pie and
8630 (General_options::output_is_position_independent): Test -pie.
8631 (General_options::output_is_executable): Return true if not shared
8632 and not relocatable.
8633 (General_options::output_is_pie): Remove.
8634 * options.cc (General_options::finalize): Reject incompatible uses
8636 * gold.cc (queue_middle_tasks): A -pie link is not static.
8637 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8638 * symtab.cc (Symbol::final_value_is_known): Return false if
8639 output_is_position_independent.
8640 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8641 output_is_position_independent.
8642 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8643 output_is_position_independent.
8644 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8645 output_is_position_independent.
8646 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8648 (basic_pie_test.o, basic_pie_test): New targets.
8649 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8650 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8651 (two_file_pie_test): New target.
8652 * testsuite/Makefile.in: Rebuild.
8653 * README: Remove note saying that -pie is not supported.
8655 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8657 * options.h (class General_options): Add -init and -fini.
8658 * layout.cc (Layout::finish_dynamic_section): Emit
8659 given init and fini functions.
8661 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8663 * gc.h (gc_process_relocs): Check if icf is enabled using new
8665 * gold.cc (queue_initial_tasks): Likewise.
8666 (queue_middle_tasks): Likewise.
8667 * object.cc (do_layout): Likewise.
8668 * symtab.cc (is_section_folded): Likewise.
8669 * main.cc (main): Likewise.
8670 * reloc.cc (Read_relocs::run): Likewise.
8671 (Sized_relobj::do_scan_relocs): Likewise.
8672 * icf.cc (is_function_ctor_or_dtor): New function.
8673 (Icf::find_identical_sections): Check if function is ctor or dtor when
8675 * options.h (General_options::icf): Change option to be an enum.
8676 (Icf_status): New enum.
8677 (icf_enabled): New method.
8678 (icf_safe_folding): New method.
8679 (set_icf_status): New method.
8680 (icf_status_): New variable.
8681 * (options.cc) (General_options::finalize): Set icf_status_.
8682 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8683 icf_test and icf_keep_unique_test to use the --icf enum flag.
8684 * testsuite/icf_safe_test.sh: New file.
8685 * testsuite/icf_safe_test.cc: New file.
8687 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8689 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8690 includes to gc.h and icf.h.
8691 * arm.cc: Include gc.h.
8692 * gold.cc: Likewise.
8693 * i386.cc: Likewise.
8694 * powerpc.cc: Likewise.
8695 * sparc.cc: Likewise.
8696 * x86_64.cc: Likewise.
8697 * gc.h: Include icf.h.
8699 2009-10-11 Ian Lance Taylor <iant@google.com>
8701 * plugin.cc: Include "gold.h" before other header files.
8703 2009-10-10 Chris Demetriou <cgd@google.com>
8705 * options.h (Input_file_argument::Input_file_type): New enum.
8706 (Input_file_argument::is_lib_): Replace with...
8707 (Input_file_argument::type_): New member.
8708 (Input_file_argument::Input_file_argument): Take Input_file_type
8709 'type' rather than boolean 'is_lib' as second argument.
8710 (Input_file_argument::is_lib): Use type_.
8711 (Input_file_argument::is_searched_file): New function.
8712 (Input_file_argument::may_need_search): Handle is_searched_file.
8713 * options.cc (General_options::parse_library): Support -l:filename.
8714 (General_options::parse_just_symbols): Update for Input_file_argument
8716 (Command_line::process): Likewise.
8717 * archive.cc (Archive::get_file_and_offset): Likewise.
8718 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8719 * script.cc (read_script_file, script_add_file): Likewise.
8720 * fileread.cc (Input_file::Input_file): Likewise.
8721 (Input_file::will_search_for): Handle is_searched_file.
8722 (Input_file::open): Likewise.
8723 * readsyms.cc (Read_symbols::get_name): Likewise.
8724 * testsuite/Makefile.am (searched_file_test): New test.
8725 * testsuite/Makefile.in: Regenerate.
8726 * testsuite/searched_file_test.cc: New file.
8727 * testsuite/searched_file_test_lib.cc: New file.
8729 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8730 Ian Lance Taylor <iant@google.com>
8732 * descriptor.cc: Include <cstdio> and "binary-io.h".
8733 (Descriptors::open): Open the files in binary mode always.
8734 * script.cc (Lex::get_token): Treat \r as whitespace.
8736 2009-10-09 Ian Lance Taylor <iant@google.com>
8738 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8740 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8741 Ian Lance Taylor <iant@google.com>
8743 * configure.ac: Check for readv function also.
8744 * fileread.cc (readv): Define if not HAVE_READV.
8745 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8747 * config.in: Regenerate.
8748 * configure: Regenerate.
8750 2009-10-09 Doug Kwan <dougkwan@google.com>
8752 * layout.cc (Layout::make_output_section): Call target hook to make
8753 ordinary output section.
8754 (Layout::finalize): Adjust parameter list of call the
8755 Target::may_relax().
8756 * layout.h (class Layout::section_list): New method.
8757 * merge.h (Output_merge_base::entsize): Change visibility to public.
8758 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8760 (Output_merge_string::do_is_string): New method.
8761 * object.cc (Sized_relobj::do_setup): renamed from
8762 Sized_relobj::set_up.
8763 * object.h (Sized_relobj::adjust_shndx,
8764 Sized_relobj::initializ_input_to_output_maps,
8765 Sized_relobj::free_input_to_output_maps): Change visibilities to
8767 (Sized_relobj::setup): Virtualize.
8768 (Sized_relobj::do_setup): New method declaration.
8769 (Sized_relobj::invalidate_section_offset,
8770 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8771 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8772 * options.cc (parse_int): New function.
8773 * options.h (parse_int): New declaration.
8774 (DEFINE_int): New macro.
8775 (stub_group_size): New option.
8776 * output.cc (Output_section::Output_section): Initialize memebers
8777 merge_section_map_, merge_section_by_properties_map_,
8778 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8779 (Output_section::add_input_section): Handled deferred code-fill
8780 generation and remove an old comment.
8781 (Output_section::add_relaxed_input_section): New method definition.
8782 (Output_section::add_merge_input_section): Use merge section by
8783 properties map to speed to search. Update merge section maps
8785 (Output_section::build_relaxation_map): New method definition.
8786 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8788 (Output_section::relax_input_section): Renamed to
8789 Output_section::convert_input_sections_to_relaxed_sections and change
8790 interface to take a vector of pointers to relaxed sections.
8791 (Output_section::find_merge_section,
8792 Output_section::find_relaxed_input_section): New method definitions.
8793 (Output_section::is_input_address_mapped,
8794 Output_section::output_offset, Output_section::output_address):
8795 Use output section data maps to speed up searching.
8796 (Output_section::find_starting_output_address): Add comments.
8797 (Output_section::do_write,
8798 Output_section::write_to_postprocessing_buffer): Do code-fill
8799 generation as appropriate.
8800 (Output_section::get_input_sections): Invalidate relaxed input section
8802 (Output_section::restore_states): Adjust type of checkpoint .
8803 Invalidate relaxed input section map.
8804 * output.h (Output_merge_base): New class declaration.
8805 (Input_section_specifier): New class defintion.
8806 (class Output_relaxed_input_section) Change base class to
8807 Output_section_data_build.
8808 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8809 base class initializer.
8810 (Output_section::add_relaxed_input_section): New method declaration.
8811 (Output_section::Input_section): Change visibility to protected.
8812 (Output_section::Input_section::relobj,
8813 Output_section::Input_section::shndx): Handle relaxed input sections.
8814 Output_section::input_sections) Change visibility to protected. Also
8815 define overload to return a non-const pointer.
8816 (Output_section::Merge_section_properties): New class defintion.
8817 (Output_section::Merge_section_by_properties_map,
8818 Output_section::Output_section_data_by_input_section_map,
8819 Output_section::Relaxation_map): New types.
8820 (Output_section::relax_input_section): Rename method to
8821 Output_section::convert_input_sections_to_relaxed_sections and change
8822 interface to take a vector of relaxed section pointers.
8823 (Output_section::find_merge_section,
8824 Output_section::find_relaxed_input_section,
8825 Output_section::build_relaxation_map,
8826 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8827 New method declarations.
8828 (Output_section::merge_section_map_
8829 Output_section::merge_section_by_properties_map_,
8830 Output_section::relaxed_input_section_map_,
8831 Output_section::is_relaxed_input_section_map_valid_,
8832 Output_section::generate_code_fills_at_write_): New data members.
8833 * script-sections.cc
8834 (Output_section_element_input::set_section_addresses): Call
8835 current_data_size and addralign methods of relaxed input sections.
8836 (Orphan_output_section::set_section_addresses): Call current_data_size
8837 and addralign methods of relaxed input sections.
8838 * symtab.cc (Symbol_table::compute_final_value): Extract template
8839 from the body of Symbol_table::sized_finalize_symbol.
8840 (Symbol_table::sized_finalized_symbol): Call
8841 Symbol_table::compute_final_value.
8842 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8843 (Symbol_table::compute_final_value): New templated method declaration.
8844 * target.cc (Target::do_make_output_section): New method defintion.
8845 * target.h (Target::make_output_section): New method declaration.
8846 (Target::relax): Add more parameters for input objects, symbol table
8847 and layout. Adjust call to do_relax.
8848 (Target::do_make_output_section): New method declaration.
8849 (Target::do_relax): Add parameters for input objects, symbol table
8852 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8854 * pread.c: Include stdio.h.
8856 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8858 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8861 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8863 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8864 Change read_shndx type to unsigned int.
8865 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8867 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8868 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8869 Change read_shndx type to unsigned int.
8870 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8872 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8873 * layout.cc (Layout::create_symtab_sections): Cast the result of
8874 local_symcount * symsize to off_t in the gold_assert.
8876 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8878 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8879 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8881 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8882 (Arm_relocate_functions::thm_abs5): New function.
8883 (Arm_relocate_functions::abs12): New function.
8884 (Arm_relocate_functions::abs16): New function.
8885 (Arm_relocate_functions::base_abs): New function.
8886 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8887 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8888 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8890 (Scan::global): Likewise.
8891 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8892 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8893 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8894 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8897 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8899 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8900 (Arm_relocate_functions::movt_prel): New function.
8901 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8902 (Arm_relocate_functions::thm_movt_prel): New function.
8903 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8904 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8905 (Scan::global, Relocate::relocate): Likewise.
8906 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8908 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8910 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8911 Incremental_checker.
8912 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8914 (class Incremental_inputs_header): New class.
8915 (Incremental_inputs_header_writer): Edit comment.
8916 (Incremental_inputs_entry): New class.
8917 (Incremental_inputs_entry_writer): Edit comment.
8918 (Sized_incremental_binary::do_find_incremental_inputs_section):
8919 Add *strtab_shndx parameter, fill it.
8920 (Sized_incremental_binary::do_check_inputs): New method.
8921 (Incremental_checker::can_incrementally_link_output_file): Use
8922 Sized_incremental_binary::check_inputs.
8923 (Incremental_inputs::report_command_line): Save command line in
8926 (Incremental_binary::find_incremental_inputs_section): New
8928 (Incremental_binary::do_find_incremental_inputs_section): Add
8929 strtab_shndx parameter.
8930 (Incremental_binary::do_check_inputs): New pure virtual method.
8931 (Sized_incremental_binary::do_check_inputs): Declare.
8932 (Incremental_checker::Incremental_checker): Add incremental_inputs
8933 parameter, use it to initialize incremental_inputs_.
8934 (Incremental_checker::incremental_inputs_): New field.
8935 (Incremental_checker::command_line): New method.
8936 (Incremental_checker::inputs): New method.
8937 (Incremental_checker::command_line_): New field.
8939 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8941 * incremental.cc: Include <cstdarg> and "target-select.h".
8942 (vexplain_no_incremental): New function.
8943 (explain_no_incremental): New function.
8944 (Incremental_binary::error): New method.
8945 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8947 (make_sized_incremental_binary): New function.
8948 (open_incremental_binary): New function.
8949 (can_incrementally_link_file): Add checks if output is ELF and has
8951 * incremental.h: Include "elfcpp_file.h" and "output.h".
8952 (Incremental_binary): New class.
8953 (Sized_incremental_binary): New class.
8954 (open_incremental_binary): Declare.
8955 * object.cc (is_elf_object): Use
8956 elfcpp::Elf_recognizer::is_elf_file.
8957 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8958 * output.h (Output_file::filesize): New method.
8960 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8962 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8964 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8965 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8967 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8969 (Arm_relocate_functions::movw_abs_nc): New function.
8970 (Arm_relocate_functions::movt_abs): New function.
8971 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8972 (Arm_relocate_functions::thm_movt_abs): New function.
8973 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8974 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8975 (Scan::global): Likewise.
8976 (Relocate::relocate): Likewise.
8977 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8979 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8981 * arm.cc (Arm_relocate_functions::got_prel) New function.
8982 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8983 (Relocate::relocate): Likewise.
8984 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8986 2009-10-06 Ian Lance Taylor <iant@google.com>
8988 * options.h (class General_options): Define
8989 split_stack_adjust_size parameter.
8990 * object.h (class Object): Add uses_split_stack_ and
8991 has_no_split_stack_ fields. Add uses_split_stack and
8992 has_no_split_stack accessor functions. Declare
8993 handle_split_stack_section.
8994 (class Reloc_symbol_changes): Define.
8995 (class Sized_relobj): Define Function_offsets. Declare
8996 split_stack_adjust, split_stack_adjust_reltype, and
8998 * object.cc (Object::handle_split_stack_section): New function.
8999 (Sized_relobj::do_layout): Call handle_split_stack_section.
9000 * dynobj.cc (Sized_dynobj::do_layout): Call
9001 handle_split_stack_section.
9002 * reloc.cc (Sized_relobj::relocate_sections): Call
9003 split_stack_adjust for executable sections in split_stack
9004 objects. Pass reloc_map to relocate_section.
9005 (Sized_relobj::split_stack_adjust): New function.
9006 (Sized_relobj::split_stack_adjust_reltype): New function.
9007 (Sized_relobj::find_functions): New function.
9008 * target-reloc.h: Include "object.h".
9009 (relocate_section): Add reloc_symbol_changes parameter. Change
9011 * target.h (class Target): Add calls_non_split method. Declare
9012 do_calls_non_split virtual method. Declare match_view and
9014 * target.cc: Include "elfcpp.h".
9015 (Target::do_calls_non_split): New function.
9016 (Target::match_view): New function.
9017 (Target::set_view_to_nop): New function.
9018 * gold.cc (queue_middle_tasks): Give an error if mixing
9019 split-stack and non-split-stack objects with -r.
9020 * i386.cc (Target_i386::relocate_section): Add
9021 reloc_symbol_changes parameter.
9022 (Target_i386::do_calls_non_split): New function.
9023 * x86_64.cc (Target_x86_64::relocate_section): Add
9024 reloc_symbol_changes parameter.
9025 (Target_x86_64::do_calls_non_split): New function.
9026 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9028 * powerpc.cc (Target_powerpc::relocate_section): Add
9029 reloc_symbol_changes parameter.
9030 * sparc.cc (Target_sparc::relocate_section): Add
9031 reloc_symbol_changes parameter.
9032 * configure.ac: Call AM_CONDITIONAL for the default target.
9033 * configure: Rebuild.
9034 * testsuite/Makefile.am (TEST_AS): New variable.
9035 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9036 (check_DATA): Add split_i386 and split_x86_64 files.
9037 (SPLIT_DEFSYMS): Define.
9038 (split_i386_[1234n].o): New targets.
9039 (split_i386_[124]): New targets.
9040 (split_i386_[1234r].stdout): New targets.
9041 (split_x86_64_[1234n].o): New targets.
9042 (split_x86_64_[124]): New targets.
9043 (split_x86_64_[1234r].stdout): New targets.
9044 (MOSTLYCLEANFILES): Add new executables.
9045 * testsuite/split_i386.sh: New file.
9046 * testsuite/split_x86_64.sh: New file.
9047 * testsuite/split_i386_1.s: New file.
9048 * testsuite/split_i386_2.s: New file.
9049 * testsuite/split_i386_3.s: New file.
9050 * testsuite/split_i386_4.s: New file.
9051 * testsuite/split_i386_n.s: New file.
9052 * testsuite/split_x86_64_1.s: New file.
9053 * testsuite/split_x86_64_2.s: New file.
9054 * testsuite/split_x86_64_3.s: New file.
9055 * testsuite/split_x86_64_4.s: New file.
9056 * testsuite/split_x86_64_n.s: New file.
9057 * testsuite/testfile.cc (Target_test): Update relocation_section
9059 * testsuite/Makefile.in: Rebuild.
9061 2009-10-06 Ian Lance Taylor <iant@google.com>
9063 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9064 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9065 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9066 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9067 the address on ldo_addrs_.
9068 (Target_i386::Relocate::fix_up_ldo): New function.
9070 2009-10-06 Rafael Espindola <espindola@google.com>
9072 * plugin.cc (add_input_library): New.
9073 (Plugin::load): Add add_input_library to tv.
9074 (Plugin_manager::add_input_file): Add the is_lib argument.
9075 (add_input_file): Update call to Plugin_manager::add_input_file.
9076 (add_input_library): New.
9077 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9079 2009-09-30 Doug Kwan <dougkwan@google.com>
9081 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9082 symbol and call Symbol::may_need_copy_reloc to determine if
9083 a copy reloc is needed.
9084 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9085 nocopyreloc is given in command line.
9086 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9087 given in command line.
9088 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9089 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9090 of the removed Target_i386::may_need_copy_reloc.
9091 * options.h (copyreloc): New option with default value false.
9092 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9093 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9094 instead of the removed Target_powerpc::may_need_copy_reloc.
9095 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9096 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9097 instead of the removed Target_sparc::may_need_copy_reloc.
9098 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9099 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9100 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9101 instead of the removed Target_x86_64::may_need_copy_reloc.
9103 2009-09-30 Ian Lance Taylor <iant@google.com>
9105 * object.h (class Object): Remove target_ field, and target,
9106 sized_target, and set_target methods.
9107 (Object::sized_target): Remove.
9108 (class Sized_relobj): Update declarations. Remove sized_target.
9109 * object.cc (Sized_relobj::setup): Remove target parameter.
9111 (Input_objects::add_object): Don't do anything with the target.
9112 (make_elf_sized_object): Add punconfigured parameter. Change all
9113 callers. Set or test parameter target.
9114 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9116 * parameters.cc (Parameters::set_target): Change parameter type to
9118 (Parameters::default_target): Remove.
9119 (set_parameters_target): Change parameter type to be non-const.
9120 (parameters_force_valid_target): New function.
9121 (parameters_clear_target): New function.
9122 * parameters.h (class Parameters): Update declarations. Remove
9123 default_target method. Add sized_target and clear_target
9124 methods. Change target_ to be non-const.
9125 (set_parameters_target): Update declaration.
9126 (parameters_force_valid_target): Declare.
9127 (parameters_clear_target): Declare.
9128 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9129 as NULL if we aren't searching.
9130 (Add_symbols::run): Don't check for compatible target.
9131 * fileread.cc (Input_file::open_binary): Call
9132 parameters_force_valid_target.
9133 * gold.cc (queue_middle_tasks): Likewise.
9134 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9135 set_target on object.
9136 * dynobj.h (class Sized_dynobj): Update declarations.
9137 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9138 make_elf_object returns NULL.
9139 (Archive::include_member): Don't check whether object target is
9141 * output.cc (Output_section::add_input_section): Get target from
9143 (Output_section::relax_input_section): Likewise.
9144 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9146 (Sized_relobj::do_scan_relocs): Likewise.
9147 (Sized_relobj::relocate_sections): Likewise.
9148 * resolve.cc (Symbol_table::resolve): Likewise.
9149 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9150 parameter. Change all callers.
9151 (Symbol_table::add_from_object): Get target from parameters.
9152 (Symbol_table::add_from_relobj): Don't check object target.
9153 (Symbol_table::add_from_dynobj): Likewise.
9154 (Symbol_table::define_special_symbol): Get target from
9156 * symtab.h (class Symbol_table): Update declaration.
9157 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9158 parameter. Change all callers. Clear parameter target.
9159 (Binary_test): Test target here.
9160 * testsuite/object_unittest.cc (gold_testsuite): Remove
9161 target_test_pointer parameter. Change all callers.
9162 (Object_test): Test target here.
9164 2009-09-26 Ian Lance Taylor <iant@google.com>
9166 * testsuite/initpri1.c: Don't try to use constructor priorities if
9167 compiling with gcc before 4.3.
9169 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9171 * testsuite/retain_symbols_file_test.sh (check_present): Change
9172 output file name to retain_symbols_file_test.stdout.
9173 (check_absent): Likewise.
9175 2009-09-18 Craig Silverstein <csilvers@google.com>
9177 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9178 * options.cc: Include <cerrno> and <fstream>.
9179 (General_options::finalize): Parse -retain-symbols-file tag.
9180 * options.h: New flag.
9181 (General_options): New method should_retain_symbol, new
9182 variable symbols_to_retain.
9183 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9184 should_retain_symbol map.
9185 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9186 * testsuite/Makefile.in: Regenerate.
9187 * testsuite/retain_symbols_file_test.sh: New file.
9189 2009-09-18 Nick Clifton <nickc@redhat.com>
9191 * po/es.po: Updated Spanish translation.
9193 2009-09-17 Doug Kwan <dougkwan@google.com>
9195 * debug.h (DEBUG_RELAXATION): New constant.
9196 (DEBUG_ALL): Add DEBUG_RELAXATION.
9197 (debug_string_to_enum): Add relaxation debug option.
9199 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9200 Layout::Relaxation_debug_check::read_sections,
9201 Layout::Relaxation_debug_check::read_sections): New method definitions.
9202 (Layout::Layout): Initialize data members
9203 record_output_section_data_from_scrips_,
9204 script_output_section_data_list_ and relaxation_debug_check_.
9205 (Layout::save_segments, Layout::restore_segments,
9206 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9207 Layout::relaxation_loop_body): New method definitions.
9208 (Layout::finalize): Support relaxation. Move section layout code to
9209 Layout::relaxation_loop_body.
9210 (Layout::set_asection_address_from_script): Move code for orphan
9211 section placement out.
9212 (Layout::place_orphan_sections_in_script): New method definition.
9213 * layout.h (Output_segment_headers, Output_file_header):
9214 New forward class declarations.
9215 (Layout::~Layout): Define.
9216 (Layout::new_output_section_data_from_script): New method definition.
9217 (Layout::place_orphan_sections_in_script): New method declaration.
9218 (Layout::Segment_states): New type declaration.
9219 (Layout::save_segments, Layout::restore_segments,
9220 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9221 Layout::relaxation_loop_body): New method declarations.
9222 (Layout::Output_section_data_list): New type declaration.
9223 (Layout::Relaxation_debug_check): New class definition.
9224 (Layout::record_output_section_data_from_script_,
9225 Layout::script_output_section_data_list_, Layout::segment_states_,
9226 Layout::relaxation_debug_check_): New data members.
9227 * output.cc: (Output_section_headers::do_size): New method definition.
9228 (Output_section_headers::Output_section_headers): Move size
9229 computation to Output_section_headers::do_size.
9230 (Output_segment_headers::do_size): New method definition.
9231 (Output_file_header::Output_file_header): Move size computation to
9232 Output_file_header::do_size and call it.
9233 (Output_file_header::do_size): New method definition.
9234 (Output_data_group::Output_data_group): Adjust call to
9235 Output_section_data.
9236 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9237 (Output_symtab_xindex::do_write): Add array bound check.
9238 (Output_section::Input_section::print_to_mapfile): Handle
9239 RELAXED_INPUT_SECTION_CODE.
9240 (Output_section::Output_section): Initialize data member checkpoint_.
9241 (Output_section::~Output_section): Delete checkpoint object pointed
9243 (Output_section::add_input_section): Always add an Input_section if
9245 (Output_section::add_merge_input_section): Add assert.
9246 (Output_section::relax_input_section): New method definition.
9247 (Output_section::set_final_data_size): Set load address to zero for
9248 an unallocated section.
9249 (Output_section::do_address_and_file_offset_have_reset_values):
9250 New method definition.
9251 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9252 Handle relaxed input section.
9253 (Output_section::sort_attached_input_sections): Checkpoint input
9254 section list lazily.
9255 (Output_section::get_input_sections): Change type of input_sections to
9256 list of Simple_input_section pointers. Checkpoint input section list
9257 lazily. Also handle relaxed input sections.
9258 (Output_section::add_input_section_for_script): Take a reference to
9259 a Simple_input_section object instead of Relobj pointer and section
9260 index as parameter. Handle relaxed input sections.
9261 (Output_section::save_states, Output_section::restore_states): New
9263 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9264 (Output_data::is_data_size_fixed): New method definition.
9265 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9267 (Output_data::address_and_file_offset_have_reset_values): New method
9269 (Output_data::do_address_and_file_offset_have_reset_values): New method
9271 (Output_data::set_data_size): Check that data size is not fixed.
9272 (Output_data::fix_data_size): New method definition.
9273 (Output_data::is_data_size_fixed_): New data member.
9274 (Output_section_headers::set_final_data_size): New method definition.
9275 (Output_section_headers::do_size): New method declaration.
9276 (Output_segment_headers::set_final_data_size): New method definition.
9277 (Output_segment_headers::do_size): New method declaration.
9278 (Output_file_header::set_final_data_size)::New method definition.
9279 (Output_file_header::do_size)::New method declaration.
9280 (Output_section_data::Output_section_data): Add new parameter
9281 is_data_size_fixed and use it to fix data size.
9282 (Output_data_const::Output_data_const): Adjust call to base class
9283 constructor and fix data size.
9284 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9285 base class constructor and fix data size.
9286 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9287 base class constructor and fix data size.
9288 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9289 class constructor and fix data size.
9290 (Output_data_group::set_final_data_size): New method definition.
9291 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9292 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9293 class constructor and fix data size.
9294 (Output_relaxed_input_section): New class definition.
9295 (Output_section::Simple_input_section): New class definition.
9296 (Output_section::get_input_sections): Adjust parameter list.
9297 (Output_section::add_input_section_for_script): Same.
9298 (Output_section::save_states, Output_section::restore_states,
9299 Output_section::do_address_and_file_offset_have_reset_values,
9300 (Output_section::Input_section::Input_section): Handle
9301 RELAXED_INPUT_SECTION_CODE. Add new overload for
9302 Output_relaxed_input_section.
9303 (Output_section::Input_section::is_input_section,
9304 Output_section::Input_section::set_output_section): Handle relaxed
9306 (Output_section::Input_section::is_relaxed_input_section,
9307 Output_section::Input_section::output_section_data,
9308 Output_section::Input_section::relaxed_input_section): New method
9310 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9312 (Output_section::Input_section::u1_): Update comments.
9313 (Output_section::Input_section::u2_): Add new union member poris.
9314 (Output_section::Checkpoint_output_section): New classs definition.
9315 (Output_section::relax_input_section): New method declaration.
9316 (Output_section::checkpoint_): New data member.
9317 (Output_segment): Update comments.
9318 (Output_segment::Output_segment): Un-privatize copy constructor.
9319 (Output_segment::operator=): Un-privatize.
9320 * script-sections.cc (Output_section_element::Input_section_list):
9321 Change element type to Output_section::Simple_input_section.
9322 (Output_section_element_dot_assignment::set_section_addresses):
9323 Register output section data for relaxation clean up.
9324 (Output_data_exression::Output_data_expression): Adjust call to base
9325 constructor to fix data size.
9326 (Output_section_element_data::set_section_addresses): Register
9327 Output_data_expression object for relaxation clean up.
9328 (struct Input_section_info): Replace Relobj pointer and section index
9329 pair with Output_section::Simple_input_section and Convert struct to a
9331 (Input_section_sorter::operator()): Adjust access to
9332 Input_section_info data member to use accessors.
9333 (Output_section_element_input::set_section_addresses): Use layout
9334 parameter. Adjust code to use Output_section::Simple_input_section
9335 and Input_secction_info classes. Register filler for relaxation
9337 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9338 and section index pair with Output_section::Simple_input_section
9339 class. Adjust code accordingly.
9340 (Phdrs_element::release_segment): New method definition.
9341 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9343 (Script_sections::release_segments): New method definition.
9344 * gold/script-sections.h (Script_sections::release_segments): New
9346 * gold/target.h (Target::may_relax, Target::relax,
9347 Target::do_may_relax, Target::do_relax): New method definitions.
9349 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9351 * arm.cc (has_signed_unsigned_overflow): New function.
9352 (Arm_relocate_functions::abs8): New function.
9353 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9354 (Target_arm::Scan::global): Likewise.
9355 (Target_arm::relocate::relocate): Likewise.
9356 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9359 2009-09-16 Cary Coutant <ccoutant@google.com>
9361 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9362 * testsuite/Makefile.in: Regenerate.
9364 2009-09-11 Nick Clifton <nickc@redhat.com>
9366 * po/gold.pot: Updated by the Translation project.
9368 2009-09-08 Cary Coutant <ccoutant@google.com>
9370 * output.cc (Output_file::open): Add execute permission to empty file.
9371 * testsuite/Makefile.am (permission_test): New test.
9372 * testsuite/Makefile.in: Regenerate.
9374 2009-09-02 Ian Lance Taylor <iant@google.com>
9376 * output.cc (Output_file::resize): Call map_no_anonymous rather
9379 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9381 * gold.cc: Include "incremental.h".
9382 (queue_initial_tasks): Call Incremental_checker methods.
9383 * incremental.cc: Include "output.h".
9384 (Incremental_checker::can_incrementally_link_output_file): New
9386 * incremental.h (Incremental_checker): New class.
9388 * output.cc (Output_file::open_for_modification): New method.
9389 (Output_file::map_anonymous): Changed return type to bool. Record
9391 (Output_file::map_no_anonymous): New method, broken out of map.
9392 (Output_file::map): Use map_no_anonymous and map_anonymous.
9393 * output.h (class Output_file): Update declarations.
9395 2009-08-24 Cary Coutant <ccoutant@google.com>
9397 * options.h (Command_line::Pre_options): New class.
9398 (Command_line::pre_options): New member.
9399 * options.cc (gold::options::ready_to_register): New variable.
9400 (One_option::register_option): Do nothing if not registering options.
9401 Assert if same short option registered twice.
9402 (General_options::General_options): Turn off option registration when
9404 (Command_line::Pre_options::Pre_options): New constructor.
9406 2009-08-24 Cary Coutant <ccoutant@google.com>
9408 * options.h (General_options::no_keep_memory): Remove incorrect
9411 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9413 * Makefile.am (am__skiplex, am__skipyacc): New.
9414 * Makefile.in: Regenerate.
9416 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9418 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9419 (INCLUDES): ... this.
9420 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9421 (AM_CPPFLAGS): Renamed from ...
9422 (INCLUDE): ... this.
9423 * Makefile.in, testsuite/Makefile.in: Regenerate.
9425 * Makefile.in: Regenerate.
9426 * aclocal.m4: Likewise.
9427 * config.in: Likewise.
9428 * configure: Likewise.
9429 * testsuite/Makefile.in: Likewise.
9431 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9432 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9433 * Makefile.in: Regenerate.
9434 * testsuite/Makefile.in: Regenerate.
9436 2009-08-19 Cary Coutant <ccoutant@google.com>
9438 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9439 symbols in shared libraries overridden by hidden or internal symbols
9440 in the main program.
9442 2009-08-19 Chris Demetriou <cgd@google.com>
9444 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9445 checking source file names in error messages.
9447 2009-08-18 Doug Kwan <dougkwan@google.com>
9449 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9450 an elcpp::Ehdr as parameter. Adjust call to set_target.
9451 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9452 an elfcpp::Ehdr as parameter.
9453 * object.cc (Object::set_target): Remove the version that looks up
9454 a target and sets it.
9455 (Sized_relobj::setup): Take a Target object instead of
9456 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9457 (make_elf_sized_object): Find target and ask target to
9459 * object.h: (Object::set_target): Remove the version that looks up
9460 a target and sets it.
9461 (Sized_relobj::setup): Take a Target object instead of
9462 an elfcpp:Ehdr as parameter.
9463 * target.cc: Include dynobj.h.
9464 (Target::do_make_elf_object_implementation): New.
9465 (Target::do_make_elf_object): New.
9466 * target.h (Target::make_elf_object): New template declaration.
9467 (Target::do_make_elf_object): New method declarations.
9468 (Target::do_make_elf_object_implementation): New template declaration.
9470 2009-08-14 Ian Lance Taylor <iant@google.com>
9472 * gold.h (FUNCTION_NAME): Define.
9473 (gold_unreachable): Use FUNCTION_NAME.
9475 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9477 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9478 symbol in the --keep-unique list is not found.
9480 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9482 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9483 been maked as --keep-unique.
9484 (Icf::unfold_section): New function.
9485 * icf.h (Icf::unfold_section): New function.
9486 * options.h (General_options::keep_unique): New option.
9487 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9488 * testsuite/Makefile.in: Regenerate.
9489 * testsuite/icf_keep_unique_test.sh: New file.
9490 * testsuite/icf_keep_unique_test.cc: New file.
9492 2009-08-12 Cary Coutant <ccoutant@google.com>
9495 * resolve.cc (Symbol_table::resolve): Check for references from
9496 dynamic objects to hidden and internal symbols.
9497 * testsuite/Makefile.am (hidden_test.sh): New test.
9498 * testsuite/Makefile.in: Regenerate.
9499 * testsuite/hidden_test.sh: New script.
9500 * testsuite/hidden_test_1.c: New test source.
9501 * testsuite/hidden_test_main.c: New test source.
9503 2009-08-11 Doug Kwan <dougkwan@google.com>
9505 * arm.cc: Update comments.
9506 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9507 segment to locate the .ARM.exidx section if present.
9509 2009-08-09 Doug Kwan <dougkwan@google.com>
9511 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9514 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9515 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9518 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9520 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9521 valid tls_segment only for non-debug-section relocations.
9522 * testsuite/Makefile.am: Add gc_tls_test.
9523 * testsuite/Makefile.in: Regenerate.
9524 * testsuite/gc_tls_test.cc: New file.
9525 * testsuite/gc_tls_test.sh: New file.
9527 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9531 * Makefile.am (CCFILES): Add icf.cc.
9533 * Makefile.in: Regenerate.
9534 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9535 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9536 section, symbol and addend information for the relocs.
9537 * gold.cc (queue_middle_tasks): Call identical code folding.
9538 * gold.h: Add defines for multimap.
9539 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9540 to the call of finalize_local_symbols.
9541 * main.cc (main): Create object of class Icf.
9542 * object.cc (Sized_relobj::do_layout): Allow this function to be
9543 called twice during icf.
9544 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9545 to sections marked as identical by icf.
9546 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9548 (Sized_relobj::do_section_entsize): New function.
9549 * object.h (Object::section_entsize): New function.
9550 (Object::do_section_entsize): New pure virtual function.
9551 (Relobj::finalize_local_symbols): Add new parameter.
9552 (Relobj::do_section_entsize): New function.
9553 * options.h (General_options::icf): New option.
9554 (General_options::icf_iterations): New option.
9555 (General_options::print_icf_sections): New option.
9556 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9557 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9558 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9560 * symtab.cc (Symbol_table::is_section_folded): New function.
9561 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9562 to sections marked as identical by icf.
9563 * symtab.h (Symbol_table::set_icf): New function.
9564 (Symbol_table::icf): New function.
9565 (Symbol_table::is_section_folded): New function.
9566 (Symbol_table::icf_): New data member.
9567 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9568 * testsuite/Makefile.am: Add commands to build icf_test.
9569 * testsuite/Makefile.in: Regenerate.
9570 * testsuite/icf_test.sh: New file.
9571 * testsuite/icf_test.cc: New file.
9573 2009-07-24 Chris Demetriou <cgd@google.com>
9575 * layout.cc (is_compressible_debug_section): Fix incorrect
9576 comment about compressed section names.
9578 2009-07-20 Ian Lance Taylor <ian@airs.com>
9581 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9583 2009-07-16 Ian Lance Taylor <iant@google.com>
9586 * layout.h: #include <map>.
9587 (class Kept_section): Change from struct to class. Add accessors
9588 and setters. Add section size to Comdat_group mapping. Change
9589 Comdat_group to std::map. Add is_comdat_ field. Add
9590 linkonce_size field in union.
9591 (class Layout): Update declaration of find_or_add_kept_section.
9592 Don't declare find_kept_object.
9593 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9594 parameter. Add object, shndx, is_comdat, and is_group_name
9595 parameters. Change all callers. Adjust for new Kept_section.
9596 (Layout::find_kept_object): Remove.
9597 * object.cc (Sized_relobj::include_section_group): Update use of
9598 Kept_section. Rename secnum to shndx. Only record
9599 Kept_comdat_section if sections are the same size.
9600 (Sized_relobj::include_linkonce_section): Update use of
9601 Kept_section. Only record Kept_comdat_section if sections are the
9602 same size. Set size of linkonce section.
9603 (Sized_relobj::map_to_kept_section): Update call to
9604 get_kept_comdat_section.
9605 * object.h (class Sized_relobj): Rename fields in
9606 Kept_comdat_section to drop trailing underscores; change object
9607 field to Relobj*. Change Kept_comdat_section_table to store
9608 struct rather than pointer.
9609 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9610 Add kept_object and kept_shndx parameters. Change all callers.
9611 (Sized_relobj::get_kept_comdat_section): Change return type to
9612 bool. Add kept_object and kept_shndx parameters. Change all
9614 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9615 Layout::find_or_add_kept_section.
9617 2009-07-09 Ian Lance Taylor <iant@google.com>
9619 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9620 Reserve space in the hash table.
9622 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9624 * fileread.cc (File_read::get_mtime): New method.
9625 * fileread.h (Timespec): New structure.
9626 (File_read::get_mtime): New method.
9627 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9628 Renamed from timestamp_nsec.
9629 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9631 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9633 (Incremental_inputs::report_archive): Save mtime; style fix.
9634 (Incremental_inputs::report_obejct): Save mtime; style fix.
9635 (Incremental_inputs::report_script): Save mtime; style fix.
9636 (Incremental_inputs::finalize_inputs): Style fix.
9637 (Incremental_inputs::finalize): Style fix.
9638 (Incremental_inputs::create_input_section_data): Store inputs
9640 * incremental.h (Incremental_inputs::report_script): Add mtime
9642 (Incremental_inputs::Input_info::Input_info): Intialize only one
9644 (Incremental_inputs::Input_info::archive): Move to nameless
9646 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9647 (Incremental_inputs::Input_info::script): Move to nameless union.
9648 (Incremental_inputs::mtime): New field.
9649 * script.cc (read_input_script): Pass file mtime to
9651 * script.h (Script_info::inputs): Style fix.
9653 2009-07-01 Ian Lance Taylor <ian@airs.com>
9655 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9658 2009-06-24 Ian Lance Taylor <iant@google.com>
9661 * layout.cc (Layout::choose_output_section): If we find an
9662 existing section, update the flags.
9663 (Layout::create_notes): New function, broken out of
9665 (Layout::finalize): Don't create note sections.
9666 (Layout::create_note): Don't crash if linker script discards
9668 (Layout::create_gold_note): Likewise.
9669 (Layout::create_build_id): Likewise. Don't set
9670 after_input_sections on the section.
9671 (Layout::create_executable_stack_info): Remove target parameter.
9673 * layout.h (class Layout): Declare create_notes. Update
9674 declaration of create_executable_stack_info.
9675 * gold.cc (queue_middle_tasks): Call create_notes.
9676 * output.cc (Output_section::update_flags_for_input_section): Move
9677 here from output.h. If SHF_ALLOC flag is newly set, mark address
9679 * output.h (Output_data::mark_address_invalid): New function.
9680 (class Output_section): Only declare, not define,
9681 update_flags_for_input_section. Remove set_flags.
9683 2009-06-24 Ian Lance Taylor <iant@google.com>
9685 * script-sections.cc (Output_section_definition::
9686 set_section_addresses): Rename shadowing local load_address to
9689 2009-06-24 Ian Lance Taylor <iant@google.com>
9692 * reloc.cc (relocate_sections): Skip empty relocation sections.
9694 2009-06-23 Ian Lance Taylor <iant@google.com>
9697 * layout.cc (Layout::create_note): Use choose_output_section
9698 rather than make_output_section.
9700 2009-06-23 Ian Lance Taylor <iant@google.com>
9703 * options.cc (General_options::parse_V): Set printed_version_.
9704 (General_options::General_options): Initialize printed_version_.
9705 * options.h (class General_options): Add printed_version_ field.
9706 * gold.cc (queue_initial_tasks): If there are no input files,
9707 don't give a fatal error if we printed the version information.
9708 (queue_middle_tasks): If using -r with a shared object, give a
9709 fatal error rather than an ordinary error.
9711 2009-06-23 Ian Lance Taylor <iant@google.com>
9714 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9715 (Layout::make_output_section): Set have_stabstr_section_ if we see
9716 a .stab*str section.
9717 (Layout::finalize): Call link_stabs_sections.
9718 (Layout::link_stabs_sections): New file.
9719 * layout.h (class Layout): Add have_stabstr_section_ field.
9720 Declare link_stabs_sections.
9722 2009-06-23 Doug Kwan <dougkwan@google.com>
9724 * Makefile.am (libgold_a_LIBADD): New.
9725 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9726 * Makefile.in: Regenerate.
9727 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9728 * configure: Regenerate.
9729 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9730 * fileread.cc: Include sys/state.h
9731 * gold.h: Declare memmem and strndup if found missing.
9732 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9734 2009-06-23 Ian Lance Taylor <iant@google.com>
9736 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9737 * configure: Rebuild.
9739 2009-06-23 Ian Lance Taylor <iant@google.com>
9742 * object.cc (Object::section_contents): Don't try to get a view if
9743 the section has length zero.
9744 (Object::handle_gnu_warning_section): If the section is empty, use
9745 the name of the section as the warning.
9747 2009-06-23 Ian Lance Taylor <iant@google.com>
9750 * stringpool.h (class Stringpool_template): Add optimize_ field.
9751 (Stringpool_template::set_optimize): New function.
9752 * stringpool.cc (Stringpool_template::Stringpool_template):
9753 Initialize optimize_ field.
9754 (Stringpool_template::set_string_offsets): Test local optimize
9755 fild rather than parameter.
9756 * layout.cc (Layout::Layout): Call set_optimize on the section
9759 2009-06-22 Ian Lance Taylor <iant@google.com>
9762 * yyscript.y: Parse TARGET.
9763 * script.cc (script_set_target): New function.
9764 * script-c.h (script_set_target): Declare.
9765 * options.cc (General_options::string_to_object_format): Rename
9766 from string_to_object_format in anonymous namespace. Change
9768 * options.h (class General_options): Declare
9769 string_to_object_format.
9771 2009-06-22 Ian Lance Taylor <iant@google.com>
9773 * script-sections.cc (Script_sections::create_segments): Don't put
9774 program headers in a PT_LOAD segment if -n or -N.
9776 2009-06-22 Ian Lance Taylor <iant@google.com>
9779 * options.h (class General_options): Add -z lazy and -z now. Sort
9780 -z options into alphabetical order.
9781 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9783 2009-06-21 Ian Lance Taylor <iant@google.com>
9785 * layout.cc (Layout::make_output_section): Call
9786 Target::new_output_section.
9787 (Layout::attach_allocated_section_to_segment): Put large section
9788 sections in a separate load segment with the large segment flag
9790 (Layout::segment_precedes): Sort large data segments after other
9792 (align_file_offset): New static function.
9793 (Layout::set_segment_offsets): Use align_file_offset.
9794 * output.h (class Output_section): Add is_small_section_ and
9795 is_large_section_ fields.
9796 (Output_section::is_small_section): New function.
9797 (Output_section::set_is_small_section): New function.
9798 (Output_section::is_large_section): New function.
9799 (Output_section::set_is_large_section): New function.
9800 (Output_section::is_large_data_section): New function.
9801 (class Output_segment): Add is_large_data_segment_ field.
9802 (Output_segment::is_large_data_segment): New function.
9803 (Output_segment::set_is_large_data_segment): New function.
9804 * output.cc (Output_section::Output_section): Initialize new
9806 (Output_segment::Output_segment): Likewise.
9807 (Output_segment::add_output_section): Add assertion that large
9808 data sections always go in large data segments. Force small data
9809 sections to the end of the list of data sections. Force small BSS
9810 sections to the start of the list of BSS sections. For large BSS
9811 sections to the end of the list of BSS sections.
9812 * symtab.h (class Symbol): Declare is_common_shndx.
9813 (Symbol::is_defined): Check Symbol::is_common_shndx.
9814 (Symbol::is_common): Likewise.
9815 (class Symbol_table): Define enum Commons_section_type. Update
9816 declarations. Add small_commons_ and large_commons_ fields.
9817 * symtab.cc (Symbol::is_common_shndx): New function.
9818 (Symbol_table::Symbol_table): Initialize new fields.
9819 (Symbol_table::add_from_object): Put small and large common
9820 symbols in the right list.
9821 (Symbol_table::sized_finalized_symbol): Check
9822 Symbol::is_common_shndx.
9823 (Symbol_table::sized_write_globals): Likewise.
9824 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9825 common symbol lists. Don't call do_allocate_commons_list if the
9827 (Symbol_table::do_allocate_commons_list): Remove is_tls
9828 parameter. Add comons_section_type parameter. Change all
9829 callers. Handle small and large common symbols.
9830 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9831 Symbol::is_common_shndx.
9832 * resolve.cc (symbol_to_bits): Likewise.
9833 * target.h (Target::small_common_shndx): New function.
9834 (Target::small_common_section_flags): New function.
9835 (Target::large_common_shndx): New function.
9836 (Target::large_common_section_flags): New function.
9837 (Target::new_output_section): New function.
9838 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9839 small_common_section_flags, and large_common_section_flags
9841 (Target::do_new_output_section): New virtual function.
9842 * arm.cc (Target_arm::arm_info): Initialize new fields.
9843 * i386.cc (Target_i386::i386_info): Likewise.
9844 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9846 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9847 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9848 (Target_x86_64::do_new_output_section): New function.
9849 * configure.ac: Define conditional MCMODEL_MEDIUM.
9850 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9851 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9852 (large_LDFLAGS): Define.
9853 * testsuite/large.c: New file.
9854 * testsuite/testfile.cc (Target_test::test_target_info):
9855 Initialize new fields.
9856 * configure, testsuite/Makefile.in: Rebuild.
9858 2009-06-05 Doug Kwan <dougkwan@google.com>
9860 * Makefile.am (CCFILES): Add target.cc.
9861 * Makefile.in: Regenerate.
9862 * i386.cc (class Target_i386): Define new virtual method to
9863 override do_is_local_label_name in parent.
9864 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9865 local symbols if --discard-locals or -X is given.
9866 * options.h (class General_options): Declare new options
9867 '--discard-locals' and '-X' for discarding locals.
9868 * target.h (class Target): Define new methods is_local_label_name.
9869 Declare new virtual method do_is_local_label_name.
9870 * target.cc: New file.
9871 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9872 (check_SCRIPTS): Add discard_locals_test.sh.
9873 (check_DATA): Add discard_local_tests.syms.
9874 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9875 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9876 * testsuite/Makefile.in: Regenerate.
9877 * testsuite/discard_locals_test.c: New file.
9878 * testsuite/discard_locals_test.sh: Same.
9880 2009-06-05 Doug Kwan <dougkwan@google.com>
9882 * object.cc (Sized_relobj::Sized_relobj): Initialize
9883 discarded_eh_frame_shndx_ to -1U.
9884 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9886 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9887 a discarded .eh_frame section.
9888 (Sized_relobj::do_finalize_local_symbols): Ditto.
9889 * object.h (class Sized_relobj): Declare new member
9890 discarded_eh_frame_shndx_.
9891 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9892 (local_labels_test.o, local_labels_test): New rules.
9893 * testsuite/Makefile.in: Regenerate.
9895 2009-06-04 Doug Kwan <dougkwan@google.com>
9897 * layout.cc (Layout::section_name_mapping): Add mapping for
9898 special ARM sections.
9900 2009-06-03 Doug Kwan <dougkwan@google.com>
9902 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9903 (utils::has_overflow): Same.
9905 2009-06-03 Ian Lance Taylor <iant@google.com>
9907 * layout.cc (Layout::section_name_mapping): New array, replacing
9908 Layout::linkonce_mapping.
9909 (Layout::section_name_mapping_count): New variable, replacing
9910 Layout::linkonce_mapping_count.
9911 (Layout::linkonce_output_name): Remove.
9912 (Layout::output_section_name): Rewrite.
9913 * layout.h (class Layout): Rename Linkonce_mapping to
9914 Section_name_mapping, linkonce_mapping to section_name_mapping,
9915 linkonce_mapping_count to section_name_mapping_count. Don't
9916 declare linkonce_output_name.
9918 2009-06-03 Doug Kwan <dougkwan@google.com>
9920 * gold/arm.cc (namespace utils): New.
9921 (Target_arm::reloc_is_non_pic): Define new method.
9922 (class Arm_relocate_functions): New.
9923 (Target_arm::Relocate::relocate): Handle relocation types used by
9926 2009-06-03 Ian Lance Taylor <iant@google.com>
9928 * arm.cc (Target_arm::scan::global): Use || instead of |.
9930 2009-06-02 Doug Kwan <dougkwan@google.com>
9932 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9933 issued_non_pic_error_.
9934 (class Target_arm::Scan): Declare new method check_non_pic.
9935 Define new method symbol_needs_plt_entry.
9936 Declare new data member issued_non_pic_error_.
9937 (class Target_arm::Relocate): Declare new method
9938 should_apply_static_reloc.
9939 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9940 (Target_arm::Scan::check_non_pic): Define new method.
9941 (Target_arm::Scan::local): Handle a small subset of reloc types used
9943 (Target_arm::Scan::local): Same.
9944 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9946 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9948 * incremental.cc (Incremental_inputs::report_command_line): Filter
9949 out --incremental-* options.
9951 2009-05-29 Doug Kwan <dougkwan@google.com>
9953 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9955 (class Target_arm): Update comment.
9956 (Target_arm::Target_arm): Initialize new data members GOT_,
9957 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9958 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9959 and Target_arm::rel_dyn_section.
9960 Declare new_enum Target_arm::Got_type.
9961 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9963 Update commments for member do_dynsym_value.
9964 (Target_arm::got_size, Target_arm::plt_section,
9965 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9966 new methods inside class defintion.
9967 (Target_arm::got_section): Define new method.
9968 (Target_arm::rel_dyn_section): Same.
9969 (Output_data_plt_arm): New template class.
9970 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9971 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9972 (Output_data_plt_arm::add_entry): Same.
9973 (Output_data_plt_arm::first_plt_entry): Define new
9974 static data member for PLT instruction template.
9975 (Output_data_plt_arm::plt_entry): Same.
9976 (Output_data_plt_arm::do_write): Define new method.
9977 (Target_arm::make_plt_entry): Same.
9978 (Target_arm::do_finalize_sections): Same.
9979 (Target_arm::do_dynsym_value): Same.
9981 2009-05-28 Doug Kwan <dougkwan@google.com>
9983 * Makefile.am (TARGETSOURCES): Add arm.cc.
9984 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9985 * Makefile.in: Regenerate.
9987 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9989 2009-05-26 Doug Kwan <dougkwan@google.com>
9991 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9992 (General_options::check_excluded_libs): Strip off directories in
9993 archive name before matching like GNU ld does.
9994 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9995 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9996 (exclude_libs_test_LDFLAGS): Add linker option
9997 -Wl,--exclude-libs,libexclude_libs_test_3
9998 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9999 an explicit archive without using -l.
10000 (alt/libexclude_libs_test_3.a): New make rule.
10001 * testsuite/Makefile.in: Regenerate.
10002 * testsuite/exclude_libs_test.c : Declare lib3_default().
10004 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10005 * exclude_libs_test_3.c: New file.
10007 2009-05-26 Nick Clifton <nickc@redhat.com>
10009 * po/id.po: New Indonesian translation.
10010 * po/gold.pot: Updated template file.
10012 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10014 * testsuite/Makefile.am: Add -ffunction-sections to compile
10015 gc_comdat_test files. Add -Wl,--gc-sections to build
10017 * testsuite/Makefile.in: Regenerate.
10018 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10020 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10022 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10023 kept comdat section was garbage collected.
10024 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10025 * testsuite/Makefile.in: Regenerate.
10026 * testsuite/gc_comdat_test.sh: New file.
10027 * testsuite/gc_comdat_test_1.cc: New file.
10028 * testsuite/gc_comdat_test_2.cc: New file.
10030 2009-05-19 Doug Kwan <dougkwan@google.com>
10032 * archive.cc (Archive::Archive): Move constructor from archive.h
10033 to here. Initialize no_export_.
10034 (Archive::get_elf_object_for_member): Set no_export flag of object.
10035 * archive.h (Archive::Archive): Move constructor body to
10037 (Archive::no_export): New method.
10038 (Archive::no_export_): New field.
10039 * object.h (Object::Object): Initialize no_export_ to false.
10040 (Object::no_export, Object::set_no_export): New methods.
10041 (Object::no_export_): New field.
10042 * options.cc (General_options::parse_exclude_libs): New method.
10043 (General_options::check_excluded_libs) Same.
10044 * options.h (exclude_libs): New option.
10045 (General_options::check_excluded_libs): New method declaration.
10046 (General_options::excluded_libs_): New field.
10047 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10048 default or protected visibility if an object has no-export flag set.
10049 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10050 (check_SCRIPTS): Add exclude_libs_test.sh.
10051 (check_DATA): Add exclude_libs_test.syms.
10052 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10053 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10054 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10055 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10056 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10057 libexclude_libs_test_2.a): New rules.
10058 * testsuite/Makefile.in: Regenerate.
10059 * testsuite/exclude_libs_test.c: New file.
10060 * testsuite/exclude_libs_test.sh: Ditto.
10061 * testsuite/exclude_libs_test_1.c: Ditto.
10062 * testsuite/exclude_libs_test_2.c: Ditto.
10064 2009-05-15 Ian Lance Taylor <iant@google.com>
10066 * configure.ac: Check for declarations for cases where libiberty.h
10067 checks HAVE_DECL_xxx.
10068 * configure, config.in: Rebuild.
10070 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10072 * gold.h (Incremental_argument_list): Remove (invalid) forward
10074 * incremental.cc (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::finalize): Call finalize_inputs().
10079 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10080 Create inputs entries.
10081 * incremental.h (Incremental_input_type): New enum.
10082 (Incremental_inputs::Incremental_input): Initialize new fields.
10083 (Incremental_inputs::report_inputs): New method.
10084 (Incremental_inputs::report_achive): New method.
10085 (Incremental_inputs::report_object): New method.
10086 (Incremental_inputs::report_script): New method.
10087 (Incremental_inputs::finalize_inputs): New method.
10088 (Incremental_inputs::Input_info): New struct.
10089 (Incremental_inputs::Input_info_map): New typedef.
10090 (Incremental_inputs::lock_): New field.
10091 (Incremental_inputs::Inputs_): New field.
10092 (Incremental_inputs::Inputs_map): New field.
10093 * main.cc (main): Call Incremental_input::report_inputs.
10094 * options.h (Input_argument_list): Typedef moved from
10096 (Input_file_group::Files): Remove, use ::Input_argument_list.
10097 (Input_file_group::Input_argument_list): Remove, use
10098 ::Input_argument_list.
10099 * plugin.cc (Plugin_manager::add_input_file): Add error in
10101 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10103 * script.cc (read_input_script): Call
10104 Incremental_input::report_script.
10105 * script.h (Script_info): New class.
10107 2009-04-27 Ian Lance Taylor <iant@google.com>
10109 * x86_64.cc (do_adjust_output_section): Set entsize to
10112 2009-04-23 Elliott Hughes <enh@google.com>
10114 * output.cc (Output_file::close): After short writes, continue
10115 writing from the correct offset in the buffer being written.
10117 2009-04-23 Chris Demetriou <cgd@google.com>
10119 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10120 * configure: Regenerate.
10121 * config.in: Regenerate.
10122 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10123 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10125 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10127 * incremental.cc (Incremental_inputs_header_data): Renamed from
10128 Incremental_input_header_data.
10129 (Incremental_inputs_header_data::data_size): New field.
10130 (Incremental_inputs_header_data::put_input_file_count): Renamed
10131 from input_file_count.
10132 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10133 from command_line_offset.
10134 (Incremental_inputs_header_data::put_reserved): Renamed from
10136 (Incremental_inputs_entry_data): Renamed from
10137 Incremental_input_entry_data.
10138 (Incremental_inputs_entry_data::data_size): New field.
10139 (Incremental_inputs::report_command_line): New method.
10140 (Incremental_inputs::finalize): New method.
10141 (Incremental_inputs::create_incremental_inputs_data): New method.
10142 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10143 * incremental.h: New file.
10144 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10145 (Layout::finalize): Create incremental inputs section in
10146 incremental builds.
10147 (Layout::create_incremental_info_sections): New method.
10148 * layout.h (Layout::incremental_inputs): New method.
10149 (Layout::create_incremental_info_sections): New method.
10150 (Layout::incremental_inputs_): New field.
10151 * main.cc (main): Notify Incremental_input of the command line.
10153 2009-04-01 Ian Lance Taylor <iant@google.com>
10154 Mikolaj Zalewski <mikolajz@google.com>
10156 * gold.h (reserve_unordered_map): Define, three versions, one for
10157 each version of Unordered_map.
10158 * layout.cc (Layout::Layout): Remove options parameter. Add
10159 number_of_input_files parameter. Don't initialize options_.
10160 Initialize number_of_input_files_ and resized_signatures_. Move
10161 sections_are_attached_.
10162 (Layout::layout_group): Reserve space for group_signatures_.
10163 (Layout::find_or_add_kept_section): Change name parameter to be a
10164 reference. Resize signatures_ map when it gets large enough.
10165 (Layout::layout_eh_frame): Use parameters->options() instead of
10167 (Layout::make_output_section): Likewise.
10168 (Layout::attach_allocated_section_to_segment): Likewise.
10169 (Layout::finalize, Layout::create_executable_stack): Likewise.
10170 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10171 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10172 * layout.h (class Layout): Update declarations. Remove options_
10173 field. Add number_of_input_files_ and resized_signatures_
10174 fields. Move sections_are_attached_ field.
10175 * main.cc (main): Pass number of input files to Layout
10176 constructor. Don't pass options.
10178 2009-03-30 Ian Lance Taylor <iant@google.com>
10180 * ffsll.c (ffsll): Correct implementation.
10182 2009-03-27 Ian Lance Taylor <iant@google.com>
10184 * ffsll.c: New file.
10185 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10186 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10187 * ftruncate.c (ftruncate): Declare before definition.
10188 * mremap.c (mremap): Likewise.
10189 * pread.c (pread): Likewise.
10190 * configure, Makefile.in, config.in: Rebuild.
10192 * mremap.c: New file.
10193 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10194 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10195 (mremap): Declare if HAVE_MREMAP is not defined.
10196 * configure, Makefile.in, config.in: Rebuild.
10198 2009-03-27 Cary Coutant <ccoutant@google.com>
10200 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10201 position independent.
10202 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10203 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10205 2009-03-24 Cary Coutant <ccoutant@google.com>
10207 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10209 (needs_dynamic_reloc): Likewise.
10211 2009-03-24 Ian Lance Taylor <iant@google.com>
10213 * yyscript.y (file_cmd): Recognize EXTERN.
10214 (extern_name_list, extern_name_list_body): New nonterminals.
10215 * script.cc (script_add_extern): Define.
10216 * script-c.h (script_add_extern): Declare.
10218 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10220 * object.cc (is_elf_object): Define.
10221 * object.h (is_elf_object): Declare.
10222 * archive.cc (Archive::get_elf_object_for_member): Call
10224 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10226 2009-03-24 Elliott Hughes <enh@google.com>
10228 * output.cc (Output_file::map_anonymous): Define.
10229 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10230 try an anonymous one. Report the size if the mmap fails.
10231 * output.h (class Output_file): Declare map_anonymous.
10233 2009-03-24 Ian Lance Taylor <iant@google.com>
10235 * target-select.cc (instantiate_target): Don't acquire the lock if
10236 the instantiated_target_ field has already been set.
10238 2009-03-23 Ian Lance Taylor <iant@google.com>
10240 * gold-threads.h (class Initialize_lock): Define.
10241 * gold-threads.cc (class Initialize_lock_once): Define.
10242 (initialize_lock_control): New static variable.
10243 (initialize_lock_pointer): New static variable.
10244 (initialize_lock_once): New static function.
10245 (Initialize_lock::Initialize_lock): Define.
10246 (Initialize_lock::initialize): Define.
10247 * target-select.h: Include "gold-threads.h".
10248 (class Target_selector): Add lock_ and initialize_lock_ fields.
10249 Don't define instantiate_target, just declare it.
10250 * target-select.cc (Target_selector::Target_selector): Initialize
10252 (Target_selector::instantiate_target): Define.
10253 * descriptors.h: Include "gold-threads.h".
10254 (class Descriptors): Add initialize_lock_ field.
10255 * descriptors.cc (Descriptors::Descriptors): Initialize new
10257 (Descriptors::open): Use initialize_lock_ field
10258 * errors.h (class Errors): Add initialize_lock_ field.
10259 * errors.cc (Errors::Errors): Initialize new field.
10260 (Errors::initialize_lock): Use initialize_lock_ field.
10261 * powerpc.cc (class Target_selector_powerpc): Remove
10262 instantiated_target_ field. In do_recognize call
10263 instantiate_target rather than do_instantiate_target. In
10264 do_instantiate_target just allocate a new target.
10265 * sparc.cc (class Target_selector_sparc): Likewise.
10267 * freebsd.h: New file.
10268 * i386.cc: Include "freebsd.h".
10269 (Target_i386): Derive from Target_freebsd rather than
10271 (Target_selector_i386): Derive from Target_selector_freebsd rather
10272 than Target_selector.
10273 * x86_64.cc: Include "freebsd.h".
10274 (Target_x86_64): Derive from Target_freebsd rather than
10276 (Target_selector_x86_64): Derive from Target_selector_freebsd
10277 rather than Target_selector.
10278 * target.h (class Target): Add adjust_elf_header and
10279 do_adjust_elf_header.
10280 * output.cc (Output_file_header:: do_sized_write): Call target
10281 adjust_elf_header routine.
10282 * configure.tgt: Set targ_osabi.
10283 * configure.ac: Define GOLD_DEFAULT_OSABI.
10284 * parameters.cc (Parameters::default_target): Pass
10285 GOLD_DEFAULT_OSABI to select_target.
10286 * target-select.h (class Target_selector): Make instantiate_target
10287 protected rather than private.
10288 * Makefile.am (HFILES): Add freebsd.h.
10289 * configure, Makefile.in, config.in: Rebuild.
10291 * merge.cc (do_add_input_section): Correct pend value. Change
10292 message about last entry not being null terminated from error to
10295 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10297 * incremental.cc: New file.
10298 * Makefile.am (CCFILES): Add incremental.cc.
10299 * Makefile.in: Rebuild.
10301 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10303 * layout.cc (Layout::output_section_name): Preserve names
10304 of '.note.' sections.
10306 2009-03-19 Ian Lance Taylor <iant@google.com>
10308 * descriptors.cc (Descriptors::open): Check that the options are
10309 valid before using them.
10311 2009-03-18 Ian Lance Taylor <iant@google.com>
10313 * script-sections.h: Include <list>.
10314 (class Script_sections): Change Sections_elements from std::vector
10315 to std::list. Typedef public Elements_iterator. Add
10316 orphan_section_placement_, data_segment_align_start_, and
10317 saw_data_segment_align_ fields. Remove data_segment_align_index_
10319 * script-sections.cc (class Orphan_section_placement): New class.
10320 (class Sections_element): Add virtual functions is_relro and
10321 orphan_section_init. Remove virtual function place_orphan_here.
10322 (class Output_section_definition): Add is_relro and
10323 orphan_section_init. Remove place_orphan_here.
10324 (class Orphan_output_section): Likewise.
10325 (Script_sections::Script_sections): Update for field changes.
10326 (Script_sections::data_segment_align): Set saw_data_segment_align_
10327 and data_segment_align_start_, not data_segment_align_index.
10328 (Script_sections::data_segment_relro_end): Check
10329 saw_data_segment_align_. Use data_segment_align_start_ rather
10330 than data_segment_align_index_.
10331 (Script_sections::place_orphan): Rewrite to use
10332 Orphan_section_placement.
10334 2009-03-17 Ian Lance Taylor <iant@google.com>
10336 * archive.cc (Archive::add_symbols): Check for a version attached
10337 to the symbol name in the archive map.
10338 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10339 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10340 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10341 (ver_test_11.a): New target.
10342 * testsuite/Makefile.in: Rebuild.
10344 * configure.ac: Check for chsize and posix_fallocate. Replace
10346 * ftruncate.c: New file, from gnulib.
10347 * output.cc (posix_fallocate): Define dummy version if not
10348 HAVE_POSIX_FALLOCATE.
10349 (Output_file::map): Call posix_fallocate rather than lseek and
10351 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10352 * configure, Makefile.in, config.in: Rebuild.
10354 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10356 * layout.h (Layout::create_note): Add section_name parameter.
10357 * layout.cc (Layout::create_note): Likewise.
10358 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10360 2009-03-17 Ian Lance Taylor <iant@google.com>
10362 * descriptors.cc: Include "options.h".
10363 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10364 (Descriptors::open): Always use O_CLOEXEC when opening a new
10365 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10366 then set FD_CLOEXEC.
10368 * sparc.cc (class Target_sparc): Add has_got_section.
10369 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10370 make sure we have a GOT section.
10372 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10373 (Target_sparc::Scan::local): Likewise.
10374 (Target_sparc::Scan::global): Likewise.
10375 (Target_sparc::Relocate::relocate): Likewise.
10376 (Target_sparc::Relocate::relocate_tls): Likewise.
10378 * symtab.cc (Symbol_table::define_default_version): New function,
10379 broken out of add_from_object.
10380 (Symbol_table::add_from_object): Call define_default_version.
10381 (Symbol_table::define_special_symbol): Add resolve_oldsym
10382 parameter. Change all callers. If the version for a symbol comes
10383 from a version script, resolve it with the symbol with the same
10384 name with no version. Also add the symbol without a version if
10386 (do_define_in_output_data): If resolving with oldsym, don't delete
10388 (do_define_in_output_segment): Likewise.
10389 (do_define_as_constant): Likewise.
10390 * symtab.h (class Symbol_table): Update declarations.
10392 2009-03-13 Ian Lance Taylor <iant@google.com>
10394 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10395 (Read_symbols::requeue): New function.
10396 (Read_symbols::do_read_symbols): If make_elf_object fails because
10397 the target type is not configured, and the file was searched for,
10398 issue a warning and retry with the next directory.
10399 (Add_symbols::run): If the file has an incompatible format, and
10400 it was searched for, requeue the Read_symbols task. On error,
10401 release the object.
10402 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10403 dirindex parameter to constructor. Change all callers. Declare
10404 incompatible_warning and requeue.
10405 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10406 input_argument_ and input_group_ fields. Add them to
10407 constructor. Change all callers.
10408 (class Read_script): Add dirindex_ field. Add it to constructor.
10409 Change all callers.
10410 * archive.cc (Archive::setup): Remove input_objects parameter.
10411 Change all callers.
10412 (Archive::get_file_and_offset): Likewise.
10413 (Archive::read_all_symbols): Likewise.
10414 (Archive::read_symbols): Likewise.
10415 (Archive::get_elf_object_for_member): Remove input_objects
10416 parameter. Add punconfigured parameter. Change all callers.
10417 (Archive::add_symbols): Change return type to bool. Check return
10418 value of include_member.
10419 (Archive::include_all_members): Likewise.
10420 (Archive::include_member): Change return type to bool. Return
10421 false if first included object has incompatible target. Set
10422 included_member_ field.
10423 (Add_archive_symbols::run): If add_symbols returns false, requeue
10425 * archive.h (class Archive): Add included_member_ field.
10426 Initialize it in constructor. Add input_file and searched_for
10427 methods. Update declarations.
10428 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10429 input_argument_ fields. Add them to constructor. Change all
10431 * script.cc: Include "target-select.h".
10432 (class Parser_closure): Add skip_on_incompatible_target_ and
10433 found_incompatible_target_ fields. Add
10434 skip_on_incompatible_target parameter to constructor. Change all
10435 callers. Add methods skip_on_incompatible_target,
10436 clear_skip_on_incompatible_target, found_incompatible_target, and
10437 set_found_incompatible_target.
10438 (read_input_script): Add dirindex parameter. Change all callers.
10439 If parser finds an incompatible target, requeue Read_symbols
10441 (script_set_symbol): Clear skip_on_incompatible_target in
10443 (script_add_assertion, script_parse_option): Likewise.
10444 (script_start_sections, script_add_phdr): Likewise.
10445 (script_check_output_format): New function.
10446 * script.h (read_input_script): Update declaration.
10447 * script-c.h (script_check_output_format): Declare.
10448 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10449 (ignore_cmd): Remove OUTPUT_FORMAT.
10450 * fileread.cc (Input_file::Input_file): Add explicit this.
10451 (Input_file::will_search_for): New function.
10452 (Input_file::open): Add pindex parameter. Change all callers.
10453 * fileread.h (class Input_file): Add input_file_argument method.
10454 Declare will_search_for. Update declarations.
10455 * object.cc (make_elf_object): Add punconfigured parameter.
10456 Change all callers.
10457 * object.h (class Object): Make input_file public. Add
10458 searched_for method.
10459 (make_elf_object): Update declaration.
10460 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10462 * dirsearch.h (class Dirsearch): Update declaration.
10463 * options.h (class General_options): Add --warn-search-mismatch.
10464 * parameters.cc (Parameters::is_compatible_target): New function.
10465 * parameters.h (class Parameters): Declare is_compatible_target.
10466 * workqueue.cc (Workqueue::add_blocker): New function.
10467 * workqueue.h (class Workqueue): Declare add_blocker.
10469 * fileread.cc (Input_file::open): Remove options parameter.
10470 Change all callers.
10471 (Input_file::open_binary): Likewise.
10472 * script.cc (read_input_script): Likewise.
10473 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10474 options parameter from constructor. Change all callers.
10475 (class Read_script): Likewise.
10476 * fileread.h (class Input_file): Update declarations.
10477 * script.h (read_input_script): Update declaration.
10479 2009-03-10 Nick Clifton <nickc@redhat.com>
10481 * po/es.po: New Spanish translation.
10483 2009-03-06 Cary Coutant <ccoutant@google.com>
10485 * options.cc (parse_short_option): Keep dash_z from registering itself.
10487 2009-03-03 Ian Lance Taylor <iant@google.com>
10490 * target-reloc.h (relocate_section): Pass output_section to
10492 * i386.cc (Target_i386::should_apply_static_reloc): Add
10493 output_section parameter. Change all callers.
10494 (Target_i386::Relocate::relocate): Add output_section parameter.
10495 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10496 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10497 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10498 * testsuite/two_file_shared.sh: New script.
10499 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10500 (check_DATA): Add two_file_shared.dbg.
10501 (two_file_shared.dbg): New target.
10502 * testsuite/Makefile.in: Rebuild.
10504 2009-03-01 Ian Lance Taylor <iant@google.com>
10506 * configure.ac: Check for byteswap.h.
10507 * configure: Rebuild.
10508 * config.in: Rebuild.
10510 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10512 * layout.cc (Layout::find_or_add_kept_section): New function.
10513 (Layout::add_comdat): Removed.
10514 * layout.h (struct Kept_section): Move out of class Layout.
10515 Remove trailing underscores from field names. Add group_sections
10516 field. Rename group_ field to is_group. Change all uses.
10517 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10518 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10519 comdat_groups_ field.
10520 (Sized_relobj::include_section_group): Use
10521 find_or_add_kept_section and Kept_section::group_sections.
10522 (Sized_relobj::include_linkonce_section): Likewise.
10523 * object.cc (class Sized_relobj): Don't define Comdat_group or
10524 Comdat_group_table. Remove find_comdat_group and
10525 add_comdat_group. Remove comdat_groups_ field.
10526 * plugin.cc (include_comdat_group): Use
10527 Layout::find_or_add_kept_section.
10529 2009-02-28 Ian Lance Taylor <iant@google.com>
10531 * README: --gc-sections and map files are now supported. Document
10532 some build requirements.
10535 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10536 relocatable link set the value of the section symbol to zero.
10537 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10538 relocatable link don't include the section address in the local
10541 2009-02-27 Ian Lance Taylor <iant@google.com>
10544 * options.h (class Search_directory): Add is_system_directory.
10545 (class General_options): Declare is_in_system_directory.
10546 * options.cc (get_relative_sysroot): Make static.
10547 (get_default_sysroot): Make static.
10548 (General_optoins::is_in_system_directory): New function.
10549 * fileread.cc (Input_file::is_in_system_directory): New function.
10550 * fileread.h (class Input_file): Declare is_in_system_directory.
10551 * object.h (class Object): Add is_in_system_directory.
10552 (class Input_objects): Remove system_library_directory_ field.
10553 * object.cc (Input_objects::add_object): Don't set
10554 system_library_directory_.
10555 (input_objects::found_in_system_library_directory): Remove.
10556 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10557 parameter. Change all callers.
10558 (Symbol_table::sized_write_globals): Likewise.
10559 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10560 Call Object::is_in_system_directory.
10561 * symtab.h (class Symbol_table): Update declarations.
10564 * descriptors.h (Open_descriptor): Add is_on_stack field.
10565 * descriptors.cc (Descriptors::open): If the descriptor is on the
10566 top of the stack, remove it. Initialize is_on_stack field.
10567 (Descriptors::release): Only add pod to stack if it is not on the
10569 (Descriptors::close_some_descriptor): Clear stack_next and
10570 is_on_stack fields.
10573 * output.cc (Output_section::find_starting_output_address): Rename
10574 from starting_output_address; add PADDR parameter; change return
10576 * output.h (class Output_section): Declare
10577 find_starting_output_address instead of starting_output_address.
10578 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10579 section symbol for which we can't find a merge section.
10582 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10583 hidden or internal, force the symbol to be local.
10584 * resolve.cc (Symbol::override_visibility): Define.
10585 (Symbol::override_base): Use override_visibility.
10586 (Symbol_table::resolve): Likewise.
10587 (Symbol::override_base_with_special): Likewise.
10588 (Symbol_table::override_with_special): If the visibility is hidden
10589 or internal, force the symbol to be local.
10590 * symtab.h (class Symbol): Add set_visibility and
10591 override_visibility.
10592 * testsuite/ver_test_1.sh: New file.
10593 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10594 (check_DATA): Add ver_test_1.syms.
10595 (ver_test_1.syms): New target.
10596 * testsuite/Makefile.in: Rebuild.
10598 2009-02-25 Cary Coutant <ccoutant@google.com>
10600 * layout.cc (Layout::choose_output_section): Don't rename sections
10601 when using a linker script that has a SECTIONS clause.
10602 * Makefile.in: Regenerate.
10604 * testsuite/Makefile.am (script_test_5.sh): New test case.
10605 * testsuite/Makefile.in: Regenerate.
10606 * testsuite/script_test_5.cc: New file.
10607 * testsuite/script_test_5.sh: New file.
10608 * testsuite/script_test_5.t: New file.
10610 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10612 * archive.cc (Archive::include_member): Update calls to add_symbols.
10613 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10614 the Layout argument.
10615 * dynobj.h (do_add_symbols): Add the Layout argument.
10616 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10618 * object.h (Object::add_symbols): Add the Layout argument.
10619 (Object::do_add_symbols): Add the Layout argument.
10620 (Sized_relobj::do_add_symbols): Add the Layout argument.
10621 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10622 Unify the two versions.
10623 (Add_plugin_symbols): Remove.
10624 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10625 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10626 (Add_plugin_symbols): Remove.
10627 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10628 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10629 (Add_symbols::run): Make it work with Pulginobj.
10631 2009-02-06 Ian Lance Taylor <iant@google.com>
10633 * object.cc (Sized_relobj::do_layout): Make info message start
10634 with lower case letter.
10636 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10638 * binary.cc: Fix file comment.
10640 * options.h (enum Incremental_disposition): Define.
10641 (class General_options): Add new options: --incremental,
10642 --incremental_changed, --incremental_unchanged,
10643 --incremental_unknown. Add incremental_disposition_ and
10644 implicit_incremental_ fields.
10645 (General_options::incremental_disposition): New function.
10646 (class Position_dependent_options): Add incremental_disposition
10648 (Position_dependent_options::copy_from_options): Set incremental
10650 * options.cc (General_options::parse_incremental_changed): New
10652 (General_options::parse_incremental_unchanged): New function.
10653 (General_options::parse_incremental_unknown): New function.
10654 (General_options::General_options): Initialize new fields
10655 incremental_disposition_ and implicit_incremental_.
10656 (General_options::finalize): Check for uasge of --incremental-*
10657 without --incremental.
10659 2009-02-06 Chris Demetriou <cgd@google.com>
10661 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10662 pointer and to report location as the file name associated with
10664 (gold_undefined_symbol_at_location): New function to replace the
10665 old gold_undefined_symbol functionality.
10666 * target-reloc.h (relocate_section): Update to use
10667 gold_undefined_symbol_at_location.
10668 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10669 Call gold_undefined_symbol function rather than gold_error.
10670 * errors.h (Errors::undefined_symbol): Take location as a
10671 string, rather than calculating it from a relocation.
10672 * errors.cc (Errors::fatal): Print "fatal error:" before the
10674 (Errors::error, Errors::error_at_location): Print "error: "
10675 before the formatted message.
10676 (Errors::undefined_symbol): Take location as a string, rather
10677 than calculating it from a relocation.
10678 (gold_undefined_symbol_at_location): New function akin to
10679 old gold_undefined_symbol, calculates location from relocation.
10680 (gold_undefined_symbol): Change to take only a Symbol pointer
10681 and to report location as the file name associated with the symbol.
10682 * testsuite/debug_msg.sh: Update for changed error messages.
10683 * testsuite/undef_symbol.sh: Likewise.
10685 2009-02-04 Duncan Sands <baldrick@free.fr>
10688 * reduced_debug_output.h
10689 (Output_reduced_debug_abbrev_section::failed): Use format for
10691 (Output_reduced_debug_info_section::faild): Likewise.
10693 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10695 * script.cc (Lazy_demangler): New class.
10696 (Version_script_info::get_symbol_version_helper): Demangle a
10699 2009-01-29 Cary Coutant <ccoutant@google.com>
10701 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10703 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10705 2009-01-28 Ian Lance Taylor <iant@google.com>
10707 * version.cc (version_string): Bump to 1.9.
10709 * gold.h: Include <cstring> and <stdint.h>.
10710 * version.cc: Include <cstdio>.
10711 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10713 * reduced_debug_output.cc (insert_into_vector): Rename from
10714 Insert_into_vector; change all callers. Use Swap_unaligned to
10715 avoid aliasing issue; remove union since it is unnecessary.
10717 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10719 * Makefile.am (CCFILES): Add gc.cc.
10720 (HFILES): Add gc.h.
10721 * Makefile.in: Regenerate.
10722 * gold.cc (Gc_runner): New class.
10723 (queue_initial_tasks): Call garbage collection related tasks
10724 when corresponding options are invoked.
10725 (queue_middle_gc_tasks): New function.
10726 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10727 processed early before laying out sections during garbage collection.
10728 * gold.h (queue_middle_gc_tasks): New function.
10729 (is_prefix_of): Move from "layout.cc".
10730 * i386.cc (Target_i386::gc_process_relocs): New function.
10731 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10732 * main.cc (main): Create object of class "Garbage_collection".
10733 * object.cc (Relobj::copy_symbols_data): New function.
10734 (Relobj::is_section_name_included): New function.
10735 (Sized_relobj::do_layout): Allow this function to be called twice
10736 during garbage collection and defer layout of section during the
10738 * object.h (Relobj::get_symbols_data): New function.
10739 (Relobj::is_section_name_included): New function.
10740 (Relobj::copy_symbols_data): New function.
10741 (Relobj::set_symbols_data): New function.
10742 (Relobj::get_relocs_data): New function.
10743 (Relobj::set_relocs_data): New function.
10744 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10745 (Relobj::gc_process_relocs): New function.
10746 (Relobj::do_gc_process_relocs): New pure virtual function.
10747 (Relobj::sd_): New data member.
10748 (Sized_relobj::is_output_section_offset_invalid): New function.
10749 (Sized_relobj::do_gc_process_relocs): New function.
10750 * options.h (General_options::gc_sections): Modify to not be a no-op.
10751 (General_options::print_gc_sections): New option.
10752 * plugin.cc (Plugin_finish::run): Remove function call to
10753 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10754 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10755 * reloc.cc (Read_relocs::run): Add task to process relocs and
10756 determine unreferenced sections when doing garbage collection.
10757 (Gc_process_relocs): New class.
10758 (Sized_relobj::do_gc_process_relocs): New function.
10759 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10760 sections that are garbage collected.
10761 * reloc.h (Gc_process_relocs): New class.
10762 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10763 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10764 symbols whose corresponding sections are garbage collected.
10765 (Symbol_table::Symbol_table): Add new parameter for the garbage
10767 (Symbol_table::gc_mark_undef_symbols): New function.
10768 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10769 (Symbol_table::gc_mark_dyn_syms): New function.
10770 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10772 (Symbol_table::add_from_object): Likewise.
10773 (Symbol_table::add_from_relobj): When building shared objects, do not
10774 treat externally visible symbols as garbage.
10775 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10776 table information for static and relocatable links.
10777 * symtab.h (Symbol_table::set_gc): New function.
10778 (Symbol_table::gc): New function.
10779 (Symbol_table::gc_mark_undef_symbols): New function.
10780 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10781 (Symbol_table::gc_mark_dyn_syms): New function.
10782 (Symbol_table::gc_): New data member.
10783 * target.h (Sized_target::gc_process_relocs): New pure virtual
10785 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10786 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10788 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10790 * options.h (General_options::gc_sections): Define as a no-op for now.
10791 (General_options::no_keep_memory): Ditto.
10792 (General_options::Bshareable): Define.
10793 * options.cc (General_options::finalize): Honor -Bshareable.
10795 2009-01-20 Andreas Schwab <schwab@suse.de>
10797 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10798 read the value in the contents, since we don't use it. Use the
10799 template endianness when writing.
10800 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10802 2009-01-19 Andreas Schwab <schwab@suse.de>
10804 * configure.tgt (powerpc64-*): Fix targ_obj.
10806 2009-01-15 Ian Lance Taylor <iant@google.com>
10808 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10809 local symbols when stripping all symbols.
10811 2009-01-14 Cary Coutant <ccoutant@google.com>
10813 * output.cc (Output_reloc): Add explicit instantiations.
10815 2009-01-14 Cary Coutant <ccoutant@google.com>
10817 * archive.cc (Archive::get_elf_object_for_member): Remove call
10818 to File_read::claim_for_plugin.
10819 * descriptors.cc (Descriptors::open): Remove reference to
10821 (Descriptors::claim_for_plugin): Remove.
10822 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10823 (Descriptors::is_claimed): Remove.
10824 (claim_descriptor_for_plugin): Remove.
10825 * fileread.cc (File_read::claim_for_plugin): Remove.
10826 * fileread.h (File_read::claim_for_plugin): Remove.
10827 (File_read::descriptor): Reopen descriptor if necessary.
10828 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10829 (Plugin_manager::all_symbols_read): Add task parameter. Change
10831 (Plugin_manager::get_input_file): New function.
10832 (Plugin_manager::release_input_file): New function.
10833 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10834 corresponding data member.
10835 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10836 and pass to base constructor. Change all callers.
10837 (get_input_file, release_input_file): New functions.
10838 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10839 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10840 (Plugin_manager::all_symbols_read): Add task parameter.
10841 (Plugin_manager::get_input_file): New function.
10842 (Plugin_manager::release_input_file): New function.
10843 (Plugin_manager::task_): New data member.
10844 (Pluginobj::Pluginobj): Add filesize parameter.
10845 (Pluginobj::filename): New function.
10846 (Pluginobj::descriptor): New function.
10847 (Pluginobj::filesize): New function.
10848 (Pluginobj::filesize_): New data member.
10849 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10850 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10851 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10853 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10854 with archive libraries.
10855 * testsuite/Makefile.in: Regenerate.
10856 * testsuite/plugin_test.c (struct sym_info): New type.
10857 (get_input_file, release_input_file): New static variables.
10858 (onload): Capture new transfer vector entries.
10859 (claim_file_hook): Stop reading at end of file according to filesize.
10860 Factor out parsing of readelf output into separate function.
10861 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10862 APIs and get the source file name from the symbol table. Convert
10863 source file name to corresponding object file name. Print info
10864 message when adding new input files.
10865 (parse_readelf_line): New function.
10866 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10867 * testsuite/plugin_test_2.sh: Likewise.
10868 * testsuite/plugin_test_3.sh: Likewise.
10869 * testsuite/plugin_test_4.sh: New test case.
10871 2009-01-07 Ian Lance Taylor <iant@google.com>
10873 * version.cc (version_string): Bump to 1.8.
10875 2008-12-23 Cary Coutant <ccoutant@google.com>
10877 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10878 * plugin.cc (Plugin_manager::finish): Rename as
10879 layout_deferred_objects. Move cleanup to separate function.
10880 (Plugin_manager::cleanup): New function.
10881 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10883 * plugin.h (Plugin_manager::finish): Rename as
10884 layout_deferred_objects.
10885 (Plugin_manager::cleanup): New function.
10886 (Plugin_manager::cleanup_done): New field.
10888 2008-12-23 Cary Coutant <ccoutant@google.com>
10890 * plugin.cc (is_visible_from_outside): New function.
10891 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10892 so we don't return "IR only" status for exported symbols or -r links.
10894 * testsuite/Makefile.am (plugin_test_3): New test case.
10895 * testsuite/Makefile.in: Regenerate.
10896 * testsuite/plugin_test_3.sh: New file.
10898 2008-12-22 Cary Coutant <ccoutant@google.com>
10900 * object.cc (Sized_relobj::layout_section): New function.
10901 (Sized_relobj::do_layout): Defer layout of input sections until after
10902 plugin has provided replacement files.
10903 (Sized_relobj::do_layout_deferred_sections): New function.
10904 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10905 (Relobj::layout_deferred_sections): New function.
10906 (Relobj::do_layout_deferred_sections): New function.
10907 (Sized_relobj::do_layout_deferred_sections): New function.
10908 (Sized_relobj::layout_section): New function.
10909 (Sized_relobj::Deferred_layout): New structure.
10910 (Sized_relobj::deferred_layout_): New field.
10911 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10912 Change all callers. Layout deferred sections.
10913 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10915 (Plugin_hook::run): Move code from do_plugin_hook inline.
10916 (Plugin_hook::do_plugin_hook): Remove.
10917 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10918 (Plugin_manager::finish): Renamed, was cleanup.
10919 (Plugin_manager::should_defer_layout): New function.
10920 (Plugin_manager::add_deferred_layout_object): New function.
10921 (Plugin_manager::Deferred_layout_list): New type.
10922 (Plugin_manager::deferred_layout_objects_): New field.
10923 (Plugin_hook::do_plugin_hook): Remove.
10925 2008-12-17 Ian Lance Taylor <iant@google.com>
10927 * options.h (class General_options): Add --no case for
10930 2008-12-16 Cary Coutant <ccoutant@google.com>
10932 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10934 (Plugin_manager::claim_file): Create plugin object even if
10935 plugin did not call the add_symbols callback.
10936 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10937 asking for more symbols than were added.
10938 * testsuite/Makefile.am (plugin_test_1): Add test case with
10940 (empty.syms): New target.
10941 * testsuite/Makefile.in: Regenerate.
10942 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10943 message. Don't call add_symbols if no globals.
10944 (all_symbols_read_hook): Don't provide replacement for empty
10947 2008-12-12 Ian Lance Taylor <iant@google.com>
10949 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10950 r_type == 0 for a local symbol with r_sym == 0.
10951 (scan_relocatable_relocs): Pass r_sym to
10952 local_non_section_strategy.
10953 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10956 * configure.ac: Update test for TLS descriptors: they are
10957 supported as of glibc 2.9.
10958 * configure: Rebuild.
10960 2008-12-11 Ian Lance Taylor <iant@google.com>
10963 * target-reloc.h (Default_scan_relocatable_relocs): For each
10964 function, map r_type == 0 to RELOC_DISCARD.
10966 2008-12-10 Cary Coutant <ccoutant@google.com>
10968 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10969 object to override a kept COMDAT group from a plugin object.
10971 2008-12-09 Ian Lance Taylor <iant@google.com>
10974 * yyscript.y (file_cmd): Handle INPUT.
10976 * testsuite/initpri1.c: Change all declarations to be full
10977 prototypes by adding void, to avoid compiler warnings.
10979 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10981 * options.cc (General_options::parse_plugin_opt): New.
10982 (General_options::add_plugin): The argument now is just the filename.
10983 (General_options::add_plugin_option): New.
10984 * options.h (plugin_opt): New.
10985 (add_plugin): Change argument name.
10986 (add_plugin_option): New.
10987 * plugin.cc (Plugin::load): Don't parse the plugin option.
10988 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10989 (Plugin::add_option): New.
10990 (Plugin::args_): Change type.
10991 (Plugin::filename_): New.
10992 (Plugin_manager::add_plugin_option): New.
10993 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10994 * testsuite/Makefile.in: Regenerate.
10996 2008-12-05 Cary Coutant <ccoutant@google.com>
10998 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10999 Handle --strip-lto-sections option.
11000 * options.h (strip_lto_sections): New option.
11002 2008-12-01 Cary Coutant <ccoutant@google.com>
11004 * plugin.cc (ld_plugin_message): Change format parameter to const.
11005 Fix mismatch between new[] and delete.
11007 2008-11-14 Cary Coutant <ccoutant@google.com>
11009 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11012 2008-11-05 Craig Silverstein <csilvers@google.com>
11014 * options.cc (General_options::parse_dynamic_list): New function.
11015 * options.h (General_options): New flags dynamic_list,
11016 dynamic_list_data, dynamic_list_cpp_new, and
11017 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11018 (General_options::in_dynamic_list): New function.
11019 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11020 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11021 (Lex::can_continue_name): Likewise.
11023 (read_script_file): New parameter script_options.
11024 (read_dynamic_list): New function.
11025 (Script_options::define_dynamic_list): New function.
11026 (dynamic_list_keyword_parsecodes): New variable.
11027 (dynamic_list_keywords): New variable.
11028 * script.h (Script_options::define_dynamic_list): New function
11030 (read_dynamic_list): New function prototype.
11031 * symtab.cc (strprefix): New macro.
11032 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11033 dynamic_list_data, dynamic_list_cpp_new, and
11034 dynamic_list_cpp_typeinfo.
11035 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11036 (dynamic_list_expr): New rule.
11037 (dynamic_list_nodes): Likewise.
11038 (dynamic_list_node): Likewise.
11039 * testsuite/Makefile.am (dynamic_list): New test.
11040 * testsuite/Makefile.in: Regenerated.
11041 * testsuite/dynamic_list.t: New file.
11042 * testsuite/dynamic_list.sh: New file.
11044 2008-11-05 Craig Silverstein <csilvers@google.com>
11046 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11047 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11048 (t11_last): Likewise.
11049 * testsuite/ver_test_6.c (main): Likewise.
11051 2008-10-07 Cary Coutant <ccoutant@google.com>
11053 * options.c (General_options::finalize): Add check for -static and
11055 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11058 2008-10-02 Cary Coutant <ccoutant@google.com>
11060 * plugin.cc (make_sized_plugin_object): Fix conditional
11061 compilation to work when not all targets are enabled.
11063 2008-09-29 Cary Coutant <ccoutant@google.com>
11065 * archive.cc (Archive::get_file_and_offset): Use filename instead
11066 of name to get library path.
11067 (Archive::include_member): Unlock external member of a thin archive.
11069 * testsuite/Makefile.am (TEST_AR): New variable.
11070 (thin_archive_test_1): New test.
11071 (thin_archive_test_2): New test.
11072 * testsuite/Makefile.in: Regenerate.
11073 * testsuite/thin_archive_main.cc: New file.
11074 * testsuite/thin_archive_test_1.cc: New file.
11075 * testsuite/thin_archive_test_2.cc: New file.
11076 * testsuite/thin_archive_test_3.cc: New file.
11077 * testsuite/thin_archive_test_4.cc: New file.
11079 2008-09-29 Cary Coutant <ccoutant@google.com>
11081 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11082 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11084 (Sized_relobj::do_finalize_local_symbols): Likewise.
11085 (Sized_relobj::map_to_kept_section): Likewise.
11086 * object.h (Sized_relobj::invalid_address): New constant.
11087 (Sized_relobj::do_output_section_offset): Check for invalid_address
11089 * output.cc (Output_reloc::local_section_offset): Use constant
11090 invalid_address instead of -1U.
11091 (Output_reloc::get_address): Likewise.
11092 (Output_section::output_address): Change -1U to -1ULL.
11093 * output.h (Output_reloc::invalid_address): New constant.
11094 * reloc.cc (Sized_relobj::write_sections): Use constant
11095 invalid_address instead of -1U.
11096 (Sized_relobj::relocate_sections): Likewise.
11097 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11098 values for merge sections.
11099 * target-reloc.h (relocate_for_relocatable): Use constant
11100 invalid_address instead of -1U.
11102 2008-09-19 Cary Coutant <ccoutant@google.com>
11104 Add plugin functionality for link-time optimization (LTO).
11105 * configure.ac (plugins): Add --enable-plugins option.
11106 * configure: Regenerate.
11107 * config.in: Regenerate.
11108 * Makefile.am (LIBDL): New variable.
11109 (CCFILES): Add plugin.cc.
11110 (HFILES): Add plugin.h.
11111 (ldadd_var): Add LIBDL.
11112 * Makefile.in: Regenerate.
11114 * archive.cc: Include "plugin.h".
11115 (Archive::setup): Don't preread archive symbols when using a plugin.
11116 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11117 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11119 (Archive::include_member): Add symbols from plugin objects.
11120 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11121 * descriptors.cc (Descriptors::open): Check for file descriptors
11122 abandoned by plugins.
11123 (Descriptors::claim_for_plugin): New function.
11124 * descriptors.h (Descriptors::claim_for_plugin): New function.
11125 (Open_descriptor::is_claimed): New field.
11126 (claim_descriptor_for_plugin): New function.
11127 * fileread.cc (File_read::claim_for_plugin): New function.
11128 * fileread.h (File_read::claim_for_plugin): New function.
11129 (File_read::descriptor): New function.
11130 * gold.cc: Include "plugin.h".
11131 (queue_initial_tasks): Add task to call plugin hooks for generating
11133 * main.cc: Include "plugin.h".
11134 (main): Load plugin libraries.
11135 * object.h (Pluginobj): Declare.
11136 (Object::pluginobj): New function.
11137 (Object::do_pluginobj): New function.
11138 (Object::set_target): New function.
11139 * options.cc: Include "plugin.h".
11140 (General_options::parse_plugin): New function.
11141 (General_options::General_options): Initialize plugins_ field.
11142 (General_options::add_plugin): New function.
11143 * options.h (Plugin_manager): Declare.
11144 (General_options): Add --plugin option.
11145 (General_options::has_plugins): New function.
11146 (General_options::plugins): New function.
11147 (General_options::add_plugin): New function.
11148 (General_options::plugins_): New field.
11149 * plugin.cc: New file.
11150 * plugin.h: New file.
11151 * readsyms.cc: Include "plugin.h".
11152 (Read_symbols::do_read_symbols): Check for archive before checking
11153 for ELF file. Call plugin hooks to claim files.
11154 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11155 from a real object file; force override when processing replacement
11157 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11158 (Symbol::init_base_object): Likewise.
11159 (Symbol::init_base_output_data): Likewise.
11160 (Symbol::init_base_output_segment): Likewise.
11161 (Symbol::init_base_constant): Likewise.
11162 (Symbol::init_base_undefined): Likewise.
11163 (Symbol::output_section): Assert that object is not a plugin.
11164 (Symbol_table::add_from_pluginobj): New function.
11165 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11167 (Symbol_table::sized_write_globals): Likewise.
11168 (Symbol_table::add_from_pluginobj): Instantiate template.
11169 * symtab.h (Sized_pluginobj): Declare.
11170 (Symbol::in_real_elf): New function.
11171 (Symbol::set_in_real_elf): New function.
11172 (Symbol::in_real_elf_): New field.
11173 (Symbol_table::add_from_pluginobj): New function.
11175 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11176 (LIBDL): New variable.
11177 (LDADD): Add LIBDL.
11178 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11179 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11180 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11181 (MOSTLYCLEANFILES): Likewise.
11182 * testsuite/Makefile.in: Regenerate.
11183 * testsuite/plugin_test.c: New file.
11184 * testsuite/plugin_test_1.sh: New file.
11185 * testsuite/plugin_test_2.sh: New file.
11187 2008-09-16 Ian Lance Taylor <iant@google.com>
11189 * target-reloc.h (relocate_section): Check whether a symbol is
11190 defined by the ABI before reporting an undefined symbol error.
11191 * target.h (Target::is_defined_by_abi): Make parameter const.
11192 (Target::do_is_defined_by_abi): Likewise.
11193 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11194 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11195 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11196 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11197 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11198 * testsuite/Makefile.in: Rebuild.
11200 * fileread.cc (make_view): Add casts to avoid warning.
11202 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11204 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11205 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11207 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11209 * options.h (General_options::output_is_executable): New.
11210 (General_options::output_is_pie): New.
11211 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11212 for shared libraries.
11213 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11215 2008-09-11 Chris Demetriou <cgd@google.com>
11217 * options.h (origin): New -z option.
11218 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11219 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11222 2008-09-05 Cary Coutant <ccoutant@google.com>
11224 * fileread.cc (File_read::make_view): Add check for attempt to map
11225 beyond end of file.
11227 2008-09-05 Cary Coutant <ccoutant@google.com>
11229 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11230 explicit instantiations.
11232 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11235 * options.cc (General_options::finalize): Allow undefined symbols
11236 in shlibs if linking -shared.
11239 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11240 symbols as not needing a dynsym entry.
11242 2008-08-20 Craig Silverstein <csilvers@google.com>
11244 * fileread.cc (File_read::open): Do not lock the file unless it
11245 was successfully opened.
11247 2008-08-14 Cary Coutant <ccoutant@google.com>
11249 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11250 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11251 * testsuite/tls_test.cc (struct int128): 128-bit struct
11252 for testing TLS relocs with non-zero addend.
11253 (v12): New TLS variable.
11255 (t_last): Add check for v12.
11256 * testsuite/tls_test.h (t12): New function.
11257 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11259 2008-08-13 Ian Lance Taylor <iant@google.com>
11261 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11262 set tls_segment_ or relro_segment_.
11263 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11265 * output.h (Output_section::clear_is_relro): New function.
11266 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11267 sections specially even when output_data_ is empty.
11268 (Output_segment::maximum_alignment): When first section is relro,
11269 only force alignment for PT_LOAD segments.
11270 * script.cc (script_data_segment_align): New function.
11271 (script_data_segment_relro_end): New function.
11272 * script-c.h (script_data_segment_align): Declare.
11273 (script_data_segment_relro_end): Declare.
11274 * script-sections.h (class Script_sections): Declare
11275 data_segment_align and data_segment_relro_end. Add fields
11276 segment_align_index_ and saw_relro_end_.
11277 * script-sections.cc (class Sections_element): Add set_is_relro
11278 virtual function. Add new bool* parameter to place_orphan_here.
11279 Add get_output_section virtual function.
11280 (class Output_section_definition): Add set_is_relro. Add new
11281 bool* parameter to place_orphan_here. Add get_output_section.
11282 Add is_relro_ field.
11283 (Output_section_definition::Output_section_definition): Initialize
11284 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11285 and is_relro_ fields.
11286 (Output_section_definition::place_orphan_here): Add is_relro
11288 (Output_section_definition::set_section_addresses): Set relro for
11290 (Output_section_definition::alternate_constraint): Likewise.
11291 (class Orphan_output_section): Add new bool* parameter to
11292 place_orphan_here. Add get_output_section.
11293 (Orphan_output_section::place_orphan_here): Add is_relro
11295 (Script_sections::Script_sections): Initialize
11296 data_segment_align_index_ and saw_relro_end_.
11297 (Script_sections::data_segment_align): New function.
11298 (Script_sections::data_segment_relro_end): New function.
11299 (Script_sections::place_orphan): Set or clear is_relro.
11300 (Script_sections::set_section_addresses): Force alignment of first
11302 * yyscript.y (exp): Call script_data_segment_align and
11303 script_data_segment_relro_end.
11304 * testsuite/relro_script_test.t: New file.
11305 * testsuite/relro_test.cc (using_script): Declare.
11306 (t1, t2): Test using_script.
11307 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11308 (relro_script_test_SOURCES): Define.
11309 (relro_script_test_DEPENDENCIES): Define.
11310 (relro_script_test_LDFLAGS): Define.
11311 (relro_script_test_LDADD): Define.
11312 (relro_script_test.so): New target.
11313 * testsuite/Makefile.in: Rebuild.
11315 2008-08-06 Cary Coutant <ccoutant@google.com>
11317 * archive.cc (Archive::total_archives, Archive::total_members)
11318 (Archive::total_members_loaded): New variables.
11319 (Archive::setup): Add parameter. Add option to preread
11321 (Archive::read_armap): Add counter.
11322 (Archive::get_file_and_offset): New function.
11323 (Archive::get_elf_object_for_member): New function.
11324 (Archive::read_all_symbols): New function.
11325 (Archive::read_symbols): New function.
11326 (Archive::add_symbols): Add counters.
11327 (Archive::include_all_members): Use armap to find members if it's
11329 (Archive::include_member): Skip reading symbols if already read.
11330 Factored code into Archive::get_file_and_offset and
11331 Archive::get_elf_object_for_member. Changed call to
11332 Mapfile::report_include_archive_member.
11333 (Archive::print_stats): New function.
11334 * archive.h: Declare Object and Read_symbols_data classes.
11335 (Archive::Archive): Add initializers for new members.
11336 (Archive::setup): Add parameter.
11337 (Archive::print_stats): New function.
11338 (Archive::total_archives, Archive::total_members)
11339 (Archive::total_members_loaded): New variables.
11340 (Archive::get_file_and_offset): New function.
11341 (Archive::get_elf_object_for_member): New function.
11342 (Archive::read_all_symbols): New function.
11343 (Archive::read_symbols): New function.
11344 (Archive::Archive_member): New class.
11345 (Archive::members_): New member.
11346 (Archive::num_members_): New member.
11347 * main.cc: Include archive.h.
11348 (main): Call Archive::print_stats.
11349 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11350 archive parameter; member_name is now the fully-decorated name.
11351 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11352 * options.h: (General_options): Add --preread-archive-symbols option.
11353 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11356 2008-08-04 Ian Lance Taylor <iant@google.com>
11358 * symtab.h (Symbol::use_plt_offset): New function.
11359 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11360 * powerpc.cc (Relocate::relocate): Likewise.
11361 * sparc.cc (Relocate::relocate): Likewise.
11362 * x86_64.cc (Relocate::relocate): Likewise.
11363 * testsuite/weak_plt.sh: New test.
11364 * testsuite/weak_plt_main.cc: New test.
11365 * testsuite/weak_plt_shared.cc: New test.
11366 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11367 (check_PROGRAMS): Add weak_plt.
11368 (check_DATA): Add weak_plt_shared.so.
11369 (weak_plt_main_pic.o, weak_plt): New targets.
11370 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11371 * testsuite/Makefile.in: Rebuild.
11373 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11375 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11376 * testsuite/Makefile.in: Rebuild.
11378 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11380 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11381 * Makefile.in: Regenerate.
11382 * po/POTFILES.in: Regenerate.
11384 2008-07-29 Ian Lance Taylor <iant@google.com>
11386 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11387 symbols before other symbols.
11388 * testsuite/script_test_2.cc (test_addr): Declare.
11389 (test_addr_alias): Declare.
11390 (main): Check that test_addr and test_addr_alias have the right
11392 * testsuite/script_test_2.t: Define test_addr_alias and
11395 2008-07-24 Ian Lance Taylor <iant@google.com>
11398 * descriptors.cc: New file.
11399 * descriptors.h: New file.
11400 * gold-threads.h (class Hold_optional_lock): New class.
11401 * fileread.cc: Include "descriptors.h".
11402 (File_read::~File_read): Release descriptor rather than closing
11404 (File_read::open) [file]: Call open_descriptor rather than open.
11405 Set is_descriptor_opened_.
11406 (File_read::open) [memory]: Assert that descriptor is not open.
11407 (File_read::reopen_descriptor): New function.
11408 (File_read::release): Release descriptor.
11409 (File_read::do_read): Make non-const. Reopen descriptor.
11410 (File_read::read): Make non-const.
11411 (File_read::make_view): Reopen descriptor.
11412 (File_read::do_readv): Likewise.
11413 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11414 Update declarations.
11415 * layout.cc: Include "descriptors.h".
11416 (Layout::create_build_id): Use open_descriptor rather than open.
11417 * output.cc: Include "descriptors.h".
11418 (Output_file::open): Use open_descriptor rather than open.
11419 * archive.cc (Archive::const_iterator): Change Archive to be
11421 (Archive::begin, Archive::end): Make non-const.
11422 (Archive::count_members): Likewise.
11423 * archive.h (class Archive): Update declarations.
11424 * object.h (Object::read): Make non-const.
11425 * Makefile.am (CCFILES): Add descriptors.cc.
11426 (HFILES): Add descriptors.h.
11427 * Makefile.in: Rebuild.
11430 * gold.h: Always include <clocale>. Add Solaris workarounds
11431 following code in binutils/sysdep.h.
11434 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11435 this->eh_frame_hdr_ is NULL before using it.
11437 * dynobj.cc (Versions::Versions): Update comment.
11439 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11440 the base version name.
11442 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11443 array size plus one.
11444 (Stringpool_template::set_string_offsets): Subtract one from key
11445 before using it as an array index.
11446 (Stringpool_template::get_offset_with_length): Likewise.
11447 (Stringpool_template::write_to_buffer): Likewise.
11448 * stringpool.h (Stringpool_template::get_offset_from_key):
11451 2008-07-23 Ian Lance Taylor <iant@google.com>
11454 * object.h (Merged_symbol_value::value): Do our best to handle a
11458 * script.cc (Version_script_info::get_versions): Don't add empty
11459 version tag to return value.
11460 (Version_script_info::get_symbol_version_helper): Change return
11461 type to bool. Add pversion parameter. Change all callers.
11462 (script_register_vers_node): Don't require a non-NULL tag.
11463 * script.h (class Version_script_info): Update declarations.
11464 (Version_script_info::get_symbol_version): Change return type to
11465 bool. Add version parameter. Change all callers.
11466 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11467 handling. Handle an empty version from a version script.
11468 (Symbol_table::define_special_symbol): Likewise.
11469 * testsuite/ver_test_10.script: New file.
11470 * testsuite/ver_test_10.sh: New file.
11471 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11472 (check_DATA): Add ver_test_10.syms.
11473 (ver_test_10.syms, ver_test_10.so): New target.
11474 * testsuite/Makefile.in: Rebuild.
11476 2008-07-23 Simon Baldwin <simonb@google.com>
11478 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11479 to zero for undefined symbols from dynamic libraries.
11481 2008-07-23 Ian Lance Taylor <iant@google.com>
11483 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11484 Change all callers.
11485 * symtab.h (class Symbol_table): Update declaration.
11486 * testsuite/ver_test_9.cc: New file.
11487 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11488 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11489 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11490 (ver_test_9.so, ver_test_9.o): New targets.
11491 * testsuite/Makefile.in: Rebuild.
11493 2008-07-22 Ian Lance Taylor <iant@google.com>
11495 * options.h (class General_options): Define --check-sections.
11496 * layout.cc (Layout::set_segment_offsets): Handle
11499 * options.h (class General_options): Define -n/--nmagic and
11501 * options.cc (General_options::finalize): For -n/--nmagic or
11502 -N/--omagic, set -static.
11503 * layout.cc (Layout::attach_allocated_section_to_segment): If
11504 -N/--omagic, don't put read-only and read-write sections in
11505 different segments.
11506 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11507 finding a read-only segment.
11508 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11509 don't set the minimum segment alignment to the common page size,
11510 and don't set the file offset to the address modulo the page size.
11511 * script-sections.cc (Script_sections::create_segments): If
11512 -n/--omagic, don't put read-only and read-write sections in
11513 different segments.
11515 * cref.cc: New file.
11516 * cref.h: New file.
11517 * options.h (class General_options): Add --print-symbol-counts.
11518 * main.cc (main): Issue defined symbol report if requested.
11519 * archive.cc (Archive::interpret_header): Make into a const member
11521 (Archive::add_symbols): Call Input_objects::archive_start and
11523 (Archive::const_iterator): Define new class.
11524 (Archive::begin, Archive::end): New functions.
11525 (Archive::include_all_members): Rewrite to use iterator.
11526 (Archive::count_members): New function.
11527 * archive.h (class Archive): Update declarations.
11528 (Archive::filename): New function.
11529 * object.cc: Include "cref.h".
11530 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11531 (Sized_relobj::do_get_global_symbol_counts): New function.
11532 (Input_objects::add_object): Add object to cross-referencer.
11533 (Input_objects::archive_start): New function.
11534 (Input_objects::archive_stop): New function.
11535 (Input_objects::print_symbol_counts): New function.
11536 * object.h: Declare Cref and Archive.
11537 (Object::get_global_symbol_counts): New function.
11538 (Object::do_get_global_symbol_counts): New pure virtual function.
11539 (class Sized_relobj): Add defined_count_ field. Update
11541 (class Input_objects): Add cref_ field. Update constructor.
11542 Update declarations.
11543 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11545 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11547 (Sized_dynobj::do_get_global_symbol_counts): New function.
11548 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11549 defined_count_. Update declarations. Define Symbols typedef.
11550 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11551 parameter. Change all callers.
11552 (Symbol_table::add_from_dynobj): Add sympointers and defined
11553 parameters. Change all callers.
11554 * symtab.h (class Symbol_table): Update declarations.
11555 * Makefile.am (CCFILES): Add cref.cc.
11556 (HFILES): Add cref.h.
11557 * Makefile.in: Rebuild.
11559 2008-07-22 Simon Baldwin <simonb@google.com>
11561 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11562 to zero when writing undefined symbols.
11564 2008-07-22 Ian Lance Taylor <iant@google.com>
11566 * output.cc (Output_section::add_input_section): Don't try to
11567 merge empty merge sections.
11569 2008-07-21 Craig Silverstein <csilvers@google.com>
11571 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11572 Include symbol version in error message.
11574 2008-07-20 Chris Demetriou <cgd@google.com>
11576 * configure.ac (gold_cv_c_random_seed): New configured variable.
11577 (RANDOM_SEED_CFLAGS): New substituted variable.
11578 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11579 * configure: Rebuild.
11580 * Makefile.in: Likewise.
11581 * testsuite/Makefile.in: Likewise.
11583 2008-07-18 Ian Lance Taylor <iant@google.com>
11585 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11586 where we see NAME/NULL and NAME/VERSION as separate symbols.
11587 * testsuite/ver_test_main.cc (main): Call t4.
11588 (t4, t4_2a): Define.
11589 * testsuite/ver_test_2.cc (t4_2): Define.
11590 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11591 * testsuite/ver_test_4.cc (t4_2a): Define.
11592 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11593 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11595 2008-07-17 Ian Lance Taylor <iant@google.com>
11597 * dynobj.cc (Versions::add_def): If we give an error about a
11598 missing version, go ahead and create the version anyhow.
11600 2008-07-10 Ian Lance Taylor <iant@google.com>
11602 Handle output sections with more than 0x7fffffff bytes.
11603 * object.h (class Relobj): Change map_to_output_ to
11604 output_sections_, and just keep a section pointer. Change all
11605 uses. Move comdat group support to Sized_relobj.
11606 (Relobj::is_section_specially_mapped): Remove.
11607 (Relobj::output_section): Remove poff parameter. Change all
11609 (Relobj::output_section_offset): New function.
11610 (Relobj::set_section_offset): Rewrite.
11611 (Relobj::map_to_output): Remove.
11612 (Relobj::output_sections): New function.
11613 (Relobj::do_output_section_offset): New pure virtual function.
11614 (Relobj::do_set_section_offset): Likewise.
11615 (class Sized_relobj): Add section_offsets_ field. Add comdat
11616 group support from Relobj. Update declarations.
11617 (Sized_relobj::get_output_section_offset): New function.
11618 (Sized_relobj::do_output_section_offset): New function.
11619 (Sized_relobj::do_set_section_offset): New function.
11620 * object.cc (Relobj::output_section_address): Remove.
11621 (Sized_relobj::Sized_relobj): Initialize new fields.
11622 (Sized_relobj::include_section_group): Cast find_kept_object to
11624 (Sized_relobj::include_linkonce_section): Likewise.
11625 (Sized_relobj::do_layout): Use separate arrays for output section
11627 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11629 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11630 output_sections and section_offsets.
11631 (Sized_relobj::write_local_symbols): Likewise.
11632 (map_to_kept_section): Compute output address directly.
11633 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11634 output_sections and section_offsets.
11635 (Sized_relobj::write_sections): Likewise.
11636 (Sized_relobj::relocate_sections): Likewise.
11637 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11638 * output.h (class Output_reloc): Update declarations. Change
11639 u2_.relobj to Sized_relobj*.
11640 (class Output_data_reloc): Change add functions to use
11642 * output.cc (Output_reloc::Output_reloc): Change relobj to
11644 (Output_reloc::local_section_offset): Change return type to
11645 Elf_Addr. Use get_output_section_offset.
11646 (Output_reloc::get_address): Likewise.
11647 (Output_section::is_input_address_mapped): Don't call
11648 is_section_specially_mapped.
11649 (Output_section::output_offset): Likewise.
11650 (Output_section::output_address): Likewise.
11651 (Output_section::starting_output_address): Likewise.
11652 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11653 parameter to Sized_relobj*.
11654 (Copy_relocs::need_copy_reloc): Likewise.
11655 (Copy_relocs::save): Likewise.
11656 * copy-relocs.h (class Copy_relocs): Update declarations.
11657 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11658 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11659 * target-reloc.h (relocate_for_relocatable): Change
11660 offset_in_output_section type to Elf_Addr. Change code that uses
11662 * layout.cc (Layout::layout): Always set *off.
11663 * mapfile.cc (Mapfile::print_input_section): Use
11664 output_section_offset.
11665 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11667 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11668 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11669 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11671 2008-07-03 Ian Lance Taylor <iant@google.com>
11673 * layout.cc (Layout::include_section): Do not discard unrecognized
11674 SHT_STRTAB sections.
11676 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11678 * script.cc (Lex::can_continue_name): Make '?' allowable in
11679 version-script names.
11680 * testsuite/version_script.map: Change glob pattern to use '?'
11682 2008-06-30 Manish Singh <yosh@gimp.org>
11685 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11688 2008-06-30 Ian Lance Taylor <iant@google.com>
11692 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11693 versions]: Don't try to read the value in the contents, since we
11694 don't use it. Use the template endianness when writing.
11696 2008-06-25 Cary Coutant <ccoutant@google.com>
11698 * fileread.cc (File_read::make_view): Assert on zero-length view.
11699 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11700 symbol table when there are no symbols to read.
11702 2008-06-23 Craig Silverstein <csilvers@google.com>
11704 * version.cc (version_string): Bump to 1.7
11706 2008-06-18 Craig Silverstein <csilvers@google.com>
11708 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11709 constant 0xFFFF to type Valtype.
11710 (Powerpc_relocate_functions::rel16_ha): Likewise.
11712 2008-06-17 Ian Lance Taylor <iant@google.com>
11714 * output.h (Output_section::Input_section): Initialize p2align_ to
11715 zero for Output_section_data constructors.
11716 (Output_section::Input_section::addralign): If not an input
11717 section, return the alignment of the Output_section_data.
11718 * testsuite/copy_test.cc: New file.
11719 * testsuite/copy_test_1.cc: New file.
11720 * testsuite/copy_test_2.cc: New file.
11721 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11722 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11723 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11724 (copy_test_1_pic.o, copy_test_1.so): New targets.
11725 (copy_test_2_pic.o, copy_test_2.so): New targets.
11726 * testsuite/Makefile.in: Rebuild.
11728 * script-sections.cc (Script_sections::place_orphan): Initialize
11729 local variable exact.
11731 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11733 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11735 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11736 David S. Miller <davem@davemloft.net>
11738 * powerpc.cc: New file.
11739 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11740 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11741 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11742 * Makefile.in: Rebuild.
11744 2008-06-09 Ian Lance Taylor <iant@google.com>
11746 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11748 (throwing, orig_terminate): New static variables.
11749 (terminate_handler): New static function.
11750 (t2): Set terminate handler.
11752 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11755 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11758 2008-05-30 Cary Coutant <ccoutant@google.com>
11760 * archive.cc (Archive::include_all_members) Correct to step
11761 over symbol table and extended name table in thin archives.
11763 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11766 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11769 2008-05-28 Caleb Howe <cshowe@google.com>
11771 * reduced_debug_output.cc: New file.
11772 * reduced_debug_output.h: New file.
11773 * options.h (class General_options): Add --strip-debug-non-line.
11774 * options.cc (General_options::finalize): Add strip_debug_non_line
11775 to the strip heirarchy.
11776 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11778 * layout.cc: Include "reduced_debug_output.h".
11779 (Layout::Layout): Initialize new fields.
11780 (line_only_debug_sections): New static array.
11781 (is_lines_only_debug_sections): New static inline function.
11782 (Layout::include_section): Handle --strip-debug-non-line.
11783 (Layout::make_output_section): If --strip-debug-non-line, build
11784 new output sections for .debug_abbrev and .debug_info.
11785 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11786 gold. Warn about possible overflow.
11787 (read_signed_LEB_128): Likewise.
11788 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11789 (read_signed_LEB_128): Declare.
11790 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11791 (HFILES): Add reduced_debug_output.h.
11792 * Makefile.in: Rebuild.
11794 2008-05-21 Ian Lance Taylor <iant@google.com>
11796 * mapfile.cc: New file.
11797 * mapfile.h: New file.
11798 * options.h (class General_options): Add -M/--print-map and -Map.
11799 * options.cc (General_options::finalize): Make -M equivalent to
11801 * main.cc: Include <cstdio> and "mapfile.h".
11802 (main): Open mapfile if requested.
11803 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11804 constructor. Change caller.
11805 (queue_initial_tasks): Add mapfile parameter. Change caller.
11806 (queue_middle_tasks): Likewise.
11807 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11809 * archive.cc: Include "mapfile.h".
11810 (Archive::add_symbols): Add mapfile parameter. Change all
11811 callers. Pass mapfile, symbol, and reason to include_member.
11812 (Archive::include_all_members): Add mapfile parameter. Change all
11814 (Archive::include_member): Add mapfile, sym, and why parameters.
11815 Change all callers. Report inclusion to map file.
11816 * archive.h: Include "fileread.h".
11817 (class Archive): Update declarations.
11818 (Archive::file): New const method.
11819 (class Add_archive_symbols): Add mapfile_ field. Update
11820 constructor. Change all callers.
11821 * readsyms.h (class Read_symbols): Likewise.
11822 (class Finish_group): Likewise.
11823 (class Read_script): Likewise.
11824 * common.cc: Include "mapfile.h".
11825 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11827 (Symbol_table::do_allocate_commons): Likewise.
11828 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11829 symbol allocation to mapfile.
11830 * common.h (class Allocate_commons_task): Add mapfile_ field.
11831 Update constructor. Change all callers.
11832 * symtab.h (class Symbol_table): Update declarations.
11833 * layout.cc: Include "mapfile.h".
11834 (Layout_task_runner::run): Print information to mapfile.
11835 (Layout::create_gold_note): Change Output_data_fixed_space to
11836 Output_data_zero_fill.
11837 (Layout::create_build_id): Likewise.
11838 (Layout::print_to_mapfile): New function.
11839 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11840 constructor. Change caller.
11841 (class Layout): Declare print_to_mapfile.
11842 * output.cc (Output_section::Input_section::print_to_mapfile): New
11844 (Output_section::add_input_section): If producing a map, always
11845 add to input_sections_ list.
11846 (Output_section::do_print_to_mapfile): New function.
11847 (Output_segment::print_sections_to_mapfile): New function.
11848 (Output_segment::print_section_list_to_mapfile): New function.
11849 * output.h: Include "mapfile.h".
11850 (Output_data::print_to_mapfile): New function.
11851 (Output_data::do_print_to_mapfile): New virtual function.
11852 (Output_segment_headers::do_print_to_mapfile): New function.
11853 (Output_file_header::do_print_to_mapfile): New function.
11854 (Output_data_const::do_print_to_mapfile): New function.
11855 (class Output_data_const_buffer): Add map_name_ field. Update
11856 constructor. Change all callers. Add do_print_to_mapfile
11858 (class Output_data_fixed_space): Likewise.
11859 (class Output_data_space): Likewise.
11860 (class Output_data_zero_fill): New class.
11861 (Output_data_strtab::do_print_to_mapfile): New function.
11862 (Output_data_reloc_base::do_print_to_mapfile): New function.
11863 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11864 (Output_data_group::do_print_to_mapfile): New function.
11865 (Output_data_got::do_print_to_mapfile): New function.
11866 (Output_data_dynamic::do_print_to_mapfile): New function.
11867 (Output_symtab_xindex::do_print_to_mapfile): New function.
11868 (class Output_section): Declare do_print_to_mapflie. Declare
11869 print_to_mapfile in Input_section.
11870 (class Output_segment): Declare new functions.
11871 * object.h (Sized_relobj::symbol_count): New function.
11872 * script-sections.cc
11873 (Output_section_element_dot_assignment::set_section_addresses):
11874 Change Output_data_fixed_space to Output_data_zero_fill.
11875 (Output_data_expression::do_print_to_mapfile): New function.
11876 * script.cc (read_input_script): Add mapfile parameter. Change
11878 * script.h (read_input_script): Update declaration.
11879 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11880 (Eh_frame::do_print_to_mapfile): New function.
11881 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11882 (Output_merge_string::do_print_to_mapfile): New function.
11883 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11885 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11887 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11889 * Makefile.am (CCFILES): Add mapfile.cc.
11890 (HFILES): Add mapfile.h.
11891 * Makefile.in: Rebuild.
11893 2008-05-19 Ian Lance Taylor <iant@google.com>
11895 * options.h (class General_options): Add -z relro.
11896 * layout.cc (Layout::Layout): Initialize relro_segment_.
11897 (Layout::add_output_section_data): Return the output section.
11898 (Layout::make_output_section): Rcognize relro sections and mark
11899 them appropriately.
11900 (Layout::attach_allocated_section_to_segment): Put relro sections
11901 in a PT_GNU_RELRO segment.
11902 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11904 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11906 (Layout::linkonce_mapping): Map d.rel.ro.local to
11907 .data.rel.ro.local.
11908 (Layout::output_section_name): Us .data.rel.ro.local for any
11909 section which begins with that.
11910 * layout.h (class Layout): Update add_output_section_data
11911 declaration. Add relro_segment_ field.
11912 * output.cc (Output_section::Output_section): Initialize is_relro_
11913 and is_relro_local_ fields.
11914 (Output_segment::add_output_section): Group relro sections.
11915 (Output_segment::is_first_section_relro): New function.
11916 (Output_segment::maximum_alignment): If there is a relro section,
11917 align the segment to the common page size.
11918 (Output_segment::set_section_addresses): Track whether we are
11919 looking at relro sections. If the last section is a relro
11920 section, align to the common page size.
11921 (Output_segment::set_section_list_addresses): Add in_relro
11922 parameter. Change all callers. Align to the page size when
11923 moving from relro to non-relro section.
11924 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11926 * output.h (class Output_section): Add is_relro_ and
11927 is_relro_local_ fields.
11928 (Output_section::is_relro): New function.
11929 (Output_section::set_is_relro): New function.
11930 (Output_section::is_relro_local): New function.
11931 (Output_section::set_is_relro_local): New function.
11932 (class Output_segment): Update declarations.
11933 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11934 * sparc.cc (Target_sparc::got_section): Likewise.
11935 * x86_64.cc (Target_x86_64::got_section): Likewise.
11936 * testsuite/relro_test_main.cc: New file.
11937 * testsuite/relro_test.cc: New file.
11938 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11939 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11940 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11941 (relro_test.so, relro_test_pic.o): New targets.
11942 * testsuite/Makefile.in: Rebuild.
11944 2008-05-16 Ian Lance Taylor <iant@google.com>
11946 * output.cc (Output_segment::add_output_section): Remove front
11948 * output.h (class Output_segment): Remove
11949 add_initial_output_section and overloaded add_output_section.
11950 Update declaration of remaining add_output_section.
11951 * layout.cc (Layout::create_interp): Call add_output_section
11952 rather than add_initial_output_section.
11953 (Layout::finish_dynamic_section): Likewise.
11955 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11956 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11957 know the dynamic type.
11958 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11959 field. Initialize it in constructor.
11960 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11961 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11962 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11965 * output.cc (Output_reloc::get_address): Change return type to
11967 * output.h (class Output_reloc): Update get_address declaration.
11968 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11969 for section addresses.
11971 2008-05-09 Ian Lance Taylor <iant@google.com>
11974 * gold.cc (gold_nomem): Use return value of write.
11976 2008-05-08 Ian Lance Taylor <iant@google.com>
11978 * symtab.c (Symbol::init_base_output_data): Add version
11979 parameter. Change all callers.
11980 (Symbol::init_base_output_segment): Likewise.
11981 (Symbol::init_base_constant): Likewise.
11982 (Symbol::init_base_undefined): Likewise.
11983 (Sized_symbol::init_output_data): Likewise.
11984 (Sized_symbol::init_output_segment): Likewise.
11985 (Sized_symbol::init_constant): Likewise.
11986 (Sized_symbol::init_undefined): Likewise.
11987 (Symbol_table::do_define_in_output_data): If the new symbol has a
11988 version, mark it as the default.
11989 (Symbol_table::do_define_in_output_segment): Likewise.
11990 (Symbol_table::do_define_as_constant): Likewise.
11991 * symtab.h (class Symbol): Update declarations.
11992 (class Sized_symbol): Likewise.
11993 * resolve.cc (Symbol::override_version): New function.
11994 (Symbol::override_base): Call override_version.
11995 (Symbol::override_base_with_special): Likewise.
11996 * testsuite/ver_script_8.script: New file.
11997 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11998 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11999 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12000 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12002 2008-05-06 Ian Lance Taylor <iant@google.com>
12005 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12007 (class General_options): Remove existing --undefined, and add
12008 --no-undefined instead. Add new --undefined as synonym for -u.
12009 * archive.cc (Archive::add_symbols): Check whether symbol was
12011 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12012 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12013 all uses. Add IS_UNDEFINED. Update declarations to split
12014 different versions of init_base. Declare init_base_undefined.
12015 (Symbol::is_defined): Handle IS_UNDEFINED.
12016 (Symbol::is_undefined): Likewise.
12017 (Symbol::is_weak_undefined): Call is_undefined.
12018 (Symbol::is_absolute): Handle IS_CONSTANT.
12019 (class Sized_symbol): Update declarations to split different
12020 versions of init. Declare init_undefined.
12021 (class Symbol_table): Declare new functions.
12022 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12023 Change all callers.
12024 (Symbol::init_base_output_data): Likewise.
12025 (Symbol::init_base_output_segment): Likewise.
12026 (Symbol::init_base_constant): Likewise.
12027 (Symbol::init_base_undefined): New function.
12028 (Sized_symbol::init_object): Rename from init. Change all
12030 (Sized_symbol::init_output_data): Likewise.
12031 (Sized_symbol::init_output_segment): Likewise.
12032 (Sized_symbol::init_constant): Likewise.
12033 (Sized_symbol::init_undefined): New function.
12034 (Symbol_table::add_undefined_symbols_from_command_line): New
12036 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12038 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12039 (Symbol::output_section): Likewise.
12040 (Symbol::set_output_section): Likewise.
12041 (Symbol_table::sized_finalize_symbol): Likewise.
12042 (Symbol_table::sized_write_globals): Likewise.
12043 * resolve.cc (Symbol_table::should_override): Likewise.
12044 (Symbol::override_base_with_special): Likewise.
12046 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12047 symbol, change it to have default visibility.
12048 * testsuite/protected_1.cc: New file.
12049 * testsuite/protected_2.cc: New file.
12050 * testsuite/protected_3.cc: New file.
12051 * testsuite/protected_main_1.cc: New file.
12052 * testsuite/protected_main_2.cc: New file.
12053 * testsuite/protected_main_3.cc: New file.
12054 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12055 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12056 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12057 (protected_1.so): New target.
12058 (protected_1_pic.o, protected_2_pic.o): New targets.
12059 (protected_3_pic.o): New target.
12060 (check_PROGRAMS): Add protected_2.
12061 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12062 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12063 * testsuite/Makefile.in: Rebuild.
12065 * options.h (DEFINE_var): Add set_user_set_##varname__.
12066 (DEFINE_bool_alias): New macro.
12067 (class General_options): Define -Bstatic using DEFINE_bool_alias
12068 rather than DEFINE_special. Add --undefined as an alias for -z
12070 * options.cc (General_options::parse_Bstatic): Remove.
12072 * options.h (class General_options): Add --fatal-warnings.
12073 * main.cc (main): Implement --fatal-warnings.
12074 * errors.h (Errors::warning_count): New function.
12076 * options.h (class General_options): Add -Bsymbolic-functions.
12077 * symtab.h (Symbol::is_preemptible): Check for
12078 -Bsymbolic-functions.
12080 2008-05-05 Ian Lance Taylor <iant@google.com>
12082 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12083 as noVARNAME rather than no-VARNAME.
12084 (class General_options): Add option -z combreloc.
12085 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12087 (Output_reloc::sort_before) [SHT_REL]: New function.
12088 (Output_reloc::sort_before) [SHT_RELA]: New function.
12089 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12090 Sort_relocs_comparison.
12091 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12092 parameter. Change all callers.
12093 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12094 sort_relocs parameter. Change all callers.
12095 * output.cc (Output_reloc::get_address): New function, broken out
12097 (Output_reloc::write_rel): Call it.
12098 (Output_reloc::compare): New function.
12099 (Output_data_reloc_base::do_write): Optionally sort relocs.
12101 * configure.ac: If targ_extra_obj is set, link it in.
12102 * configure.tgt: Initialize all variables.
12103 (x86_64*): Set targ_extra_obj and targ_extra_size.
12104 * configure: Rebuild.
12106 * object.cc (Sized_relobj::include_section_group): Adjust section
12107 indexes read from group data. Build vector to pass to
12109 * layout.cc (Layout::layout_group): Add flags and shndxes
12110 parameters. Remove contents parameter. Change caller. Update
12111 explicit instantiations.
12112 * layout.h (class Layout): Update layout_group declaration.
12113 * output.cc (Output_data_group::Output_data_group): Add flags and
12114 input_shndxes parameters. Remove contents parameter. Change
12116 (Output_data_group::do_write): Change input_sections_ to
12118 * output.h (class Output_data_group): Update constructor
12119 declaration. Rename input_sections_ to input_shndxes_.
12120 * testsuite/many_sections_test.cc: Add template.
12122 2008-04-30 Cary Coutant <ccoutant@google.com>
12124 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12126 * layout.cc (Layout::include_section): Refactored check for debug
12128 (Layout::add_comdat): Add new parameters. Change type
12129 of signature parameter. Add object and shndx to signatures table.
12130 (Layout::find_kept_object): New function.
12131 * layout.h: Include <cstring>.
12132 (Layout::is_debug_info_section): New function.
12133 (Layout::add_comdat): Add new parameters.
12134 (Layout::find_kept_object): New function.
12135 (Layout::Kept_section): New struct.
12136 (Layout::Signatures): Change type of map range.
12137 * object.cc (Relobj::output_section_address): New function.
12138 (Sized_relobj::include_section_group): Add new parameters. Change
12139 calls to Layout::add_comdat. Change to build table of kept comdat
12140 groups and table mapping discarded sections to kept sections.
12141 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12142 (Sized_relobj::do_layout): Change calls to include_section_group and
12143 include_linkonce_section.
12144 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12145 value to zero when section is discarded.
12146 (Sized_relobj::map_to_kept_section): New function.
12147 * object.h (Relobj::output_section_address): New function.
12148 (Relobj::Comdat_group): New type.
12149 (Relobj::find_comdat_group): New function.
12150 (Relobj::Comdat_group_table): New type.
12151 (Relobj::Kept_comdat_section): New type.
12152 (Relobj::Kept_comdat_section_table): New type.
12153 (Relobj::add_comdat_group): New function.
12154 (Relobj::set_kept_comdat_section): New function.
12155 (Relobj::get_kept_comdat_section): New function.
12156 (Relobj::comdat_groups_): New field.
12157 (Relobj::kept_comdat_sections_): New field.
12158 (Symbol_value::input_value): Update comment.
12159 (Sized_relobj::map_to_kept_section) New function.
12160 (Sized_relobj::include_linkonce_section): Add new parameter.
12161 * target-reloc.h (Comdat_behavior): New type.
12162 (get_comdat_behavior): New function.
12163 (relocate_section): Add code to map a discarded section to the
12164 corresponding kept section when applying a relocation.
12166 2008-04-30 Craig Silverstein <csilvers@google.com>
12168 * dwarf_reader.cc (next_generation_count): New static var.
12169 (Addr2line_cache_entry): New struct.
12170 (addr2line_cache): New static var.
12171 (Dwarf_line_info::one_addr2line): Added caching.
12172 (Dwarf_line_info::clear_addr2line_cache): New function.
12173 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12174 cache-size parameter.
12175 (Dwarf_line_info::one_addr2line_cache): New function.
12176 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12177 new cache-size argument to one_addr2line(), and clear cache.
12179 2008-04-28 Cary Coutant <ccoutant@google.com>
12181 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12182 R_386_PC8 relocations.
12184 2008-04-23 Ian Lance Taylor <iant@google.com>
12186 * object.cc (Sized_relobj::include_section_group): Check for
12187 invalid section group.
12189 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12192 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12193 than read for file header.
12194 * archive.cc (Archive::include_member): Likewise.
12196 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12198 * aclocal.m4: Regenerate.
12199 * configure: Regenerate.
12201 2008-04-19 Ian Lance Taylor <iant@google.com>
12203 * version.cc (version_string): Bump to 1.6.
12205 * testsuite/Makefile.am (many_sections_r_test): New target.
12206 (many_sections_r_test_SOURCES): Remove.
12207 (many_sections_r_test_DEPENDENCIES): Remove.
12208 (many_sections_r_test_LDFLAGS): Remove.
12209 (many_sections_r_test_LDADD): Remove.
12211 * object.cc (Sized_relobj::do_add_symbols): Always pass
12212 local_symbol_count_ to add_from_relobj.
12214 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12215 every thousand variables.
12216 * testsuite/Makefile.in: Rebuild.
12218 * object.cc (Xindex::initialize_symtab_xindex): New function.
12219 (Xindex::read_symtab_xindex): New function.
12220 (Xindex::sym_xindex_to_shndx): New function.
12221 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12223 (Sized_relobj::do_initialize_xindex): New function.
12224 (Sized_relobj::do_read_symbols): Adjust section links.
12225 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12226 parameter. Change all callers.
12227 (Sized_relobj::include_section_group): Adjust section links and
12228 symbol section indexes.
12229 (Sized_relobj::do_layout): Adjust section links.
12230 (Sized_relobj::do_count_local_symbols): Adjust section links and
12231 symbol section indexes.
12232 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12233 ordinary and special symbols.
12234 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12235 dynsym_xindex parameters. Change all callers. Adjust section
12236 links. Use SHN_XINDEX when needed.
12237 (Sized_relobj::get_symbol_location_info): Adjust section links.
12238 Don't get fooled by special symbols.
12239 * object.h (class Xindex): Define.
12240 (class Object): Add xindex_ parameter. Declare virtual functoin
12241 do_initialize_xindex.
12242 (Object::adjust_sym_shndx): New function.
12243 (Object::set_xindex): New protected function.
12244 (class Symbol_value): Add is_ordinary_shndx_ field.
12245 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12246 (Symbol_value::value): Assert ordinary section.
12247 (Symbol_value::initialize_input_to_output_map): Likewise.
12248 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12249 Change all callers.
12250 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12252 (class Sized_relobj): Update declarations.
12253 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12254 parameter. Change all callers.
12255 (Sized_relobj::adjust_shndx): New function.
12256 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12258 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12259 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12260 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12261 (Sized_dynobj::read_dynsym_section): Adjust section links.
12262 (Sized_dynobj::read_dynamic): Likewise.
12263 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12265 (Sized_dynobj::do_initialize_xindex): New function.
12266 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12267 do_initialize_xindex.
12268 (Sized_dynobj::adjust_shndx): New function.
12269 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12270 dynsym_xindex_ fields.
12271 (Layout::finalize): Add a call to set_section_indexes before
12272 creating the symtab sections.
12273 (Layout::set_section_indexes): Don't do anything if the section
12274 already has a section index.
12275 (Layout::create_symtab_sections): Add shnum parameter. Change
12276 caller. Create .symtab_shndx section if needed.
12277 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12279 (Layout::allocated_output_section_count): New function.
12280 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12282 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12283 fields. Update declarations.
12284 (Layout::symtab_xindex): New function.
12285 (Layout::dynsym_xindex): New function.
12286 (class Write_symbols_task): Add layout_ field.
12287 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12289 * output.cc (Output_section_headers::Output_section_headers): Add
12290 shstrtab_section parameter. Change all callers.
12291 (Output_section_headers::do_sized_write): Store overflow values
12292 for section count and section string table section index in
12293 section header zero.
12294 (Output_file_header::do_sized_write): Check for overflow of
12295 section count and section string table section index.
12296 (Output_symtab_xindex::do_write): New function.
12297 (Output_symtab_xindex::endian_do_write): New function.
12298 * output.h (class Output_section_headers): Add shstrtab_section_.
12299 Update declarations.
12300 (class Output_symtab_xindex): Define.
12301 (Output_section::has_out_shndx): New function.
12302 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12304 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12305 Change all callers.
12306 (Sized_symbol::init): Likewise.
12307 (Symbol::output_section): Check for ordinary symbol.
12308 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12309 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12311 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12312 Change all callers. Simplify handling of symbols from sections
12313 not included in the link.
12314 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12316 (Weak_alias_sorter::operator()): Assert that symbols are
12318 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12320 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12321 parameters. Change all callers.
12322 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12323 symbol distinction. Use SHN_XINDEX when needed.
12324 (Symbol_table::write_section_symbol): Add symtab_xindex
12325 parameter. Change all callers.
12326 (Symbol_table::sized_write_section_symbol): Likewise. Use
12327 SHN_XINDEX when needed.
12328 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12330 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12331 (Symbol::is_defined): Check is_ordinary.
12332 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12333 (Symbol::is_absolute, Symbol::is_common): Likewise.
12334 (class Sized_symbol): Update declarations.
12335 (class Symbol_table): Update declarations.
12336 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12337 parameters. Change all callers.
12338 (Sized_symbol::override): Likewise.
12339 (Symbol_table::override): Likewise.
12340 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12341 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12342 is_ordinary, and orig_st_shndx parameters. Change all callers.
12343 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12344 to be in an ordinary section.
12345 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12346 object and is_ordinary parameters. Change all callers.
12347 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12348 Change all callers. Don't add undefined or non-ordinary symbols
12350 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12351 Change all callers.
12352 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12354 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12355 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12356 (Sized_relobj::relocate_sections): Likewise.
12357 * target-reloc.h (scan_relocs): Adjust section symbol index.
12358 (scan_relocatable_relocs): Likewise.
12359 * i386.cc (Scan::local): Check for ordinary symbols.
12360 * sparc.cc (Scan::local): Likewise.
12361 * x86_64.cc (Scan::local): Likewise.
12362 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12363 to symbol_section_and_value.
12364 * testsuite/many_sections_test.cc: New file.
12365 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12366 (check_PROGRAMS): Add many_sections_test.
12367 (many_sections_test_SOURCES): Define.
12368 (many_sections_test_DEPENDENCIES): Define.
12369 (many_sections_test_LDFLAGS): Define.
12370 (BUILT_SOURCES): Add many_sections_define.h.
12371 (many_sections_define.h): New target.
12372 (BUILT_SOURCES): Add many_sections_check.h.
12373 (many_sections_check.h): New target.
12374 (check_PROGRAMS): Add many_sections_r_test.
12375 (many_sections_r_test_SOURCES): Define.
12376 (many_sections_r_test_DEPENDENCIES): Define.
12377 (many_sections_r_test_LDFLAGS): Define.
12378 (many_sections_r_test_LDADD): Define.
12379 (many_sections_r_test.o): New target.
12380 * testsuite/Makefile.in: Rebuild.
12382 2008-04-17 Cary Coutant <ccoutant@google.com>
12384 * errors.cc (Errors::info): New function.
12385 (gold_info): New function.
12386 * errors.h (Errors::info): New function.
12387 * gold.h (gold_info): New function.
12388 * object.cc (Input_objects::add_object): Print trace output.
12389 * options.cc (options::parse_set): New function.
12390 (General_options::parse_wrap): Deleted.
12391 (General_options::General_options): Deleted initializer.
12392 * options.h (options::String_set): New typedef.
12393 (options::parse_set): New function.
12394 (DEFINE_set): New macro.
12395 (General_options::wrap): Changed to use DEFINE_set. Changed
12396 callers of any_wrap_symbols and is_wrap_symbol.
12397 (General_options::trace, General_options::trace_symbol):
12399 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12400 (General_options::wrap_symbols_): Deleted.
12401 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12403 2008-04-17 David S. Miller <davem@davemloft.net>
12405 * options.cc (General_options::parse_V): New function.
12406 * options.h: Add entries for -V and -Qy.
12408 2008-04-17 Ian Lance Taylor <iant@google.com>
12410 * common.cc (Symbol_table::allocate_commons): Remove options
12411 parameter. Change caller.
12412 (Symbol_table::do_allocate_commons): Remove options parameter.
12413 Change caller. Just call do_allocate_commons_list twice.
12414 (Symbol_table::do_allocate_commons_list): New function, broken out
12415 of do_allocate_commons.
12416 * common.h (class Allocate_commons_task): Remove options_ field.
12417 Update constructor.
12418 * symtab.cc (Symbol_table::Symbol_table): Initialize
12420 (Symbol_table::add_from_object): Put TLS common symbols on
12422 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12423 which are IN_OUTPUT_DATA.
12424 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12425 allocate_commons and do_allocate_commons declarations. Declare
12426 do_allocate_commons_list.
12427 * gold.cc (queue_middle_tasks): Update creation of
12428 Allocate_commons_task to not pass options.
12429 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12430 (TLS_TEST_C_FLAGS): New variable.
12431 (tls_test_c_pic.o): New target.
12432 (tls_test_shared.so): Link in tls_test_c_pic.o.
12433 (tls_test_c_pic_ie.o): New target.
12434 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12435 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12436 (tls_test_c.o): New target.
12437 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12438 (tls_pic_test_LDADD): Likewise.
12439 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12440 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12441 (tls_test_c_gnu2.o): New target.
12442 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12444 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12445 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12446 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12447 * testsuite/tls_test.cc: Include "config.h".
12448 (t_last): Call t11_last.
12449 * testsuite/tls_test.h (t11, t11_last): Declare.
12450 * testsuite/tls_test_c.c: New file.
12451 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12452 * configure.ac: Check for OpenMP support.
12453 * configure, config.in, Makefile.in: Rebuild.
12454 * testsuite/Makefile.in: Rebuild.
12456 2008-04-16 Cary Coutant <ccoutant@google.com>
12458 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12459 (Target_i386::tls_base_symbol_defined_): New field.
12460 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12461 (Target_i386::Scan::global): Likewise.
12462 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12463 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12464 (Target_x86_64::tls_base_symbol_defined_): New field.
12465 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12466 (Target_x86_64::Scan::global): Likewise.
12468 2008-04-16 Cary Coutant <ccoutant@google.com>
12470 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12471 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12472 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12473 building shared libraries.
12474 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12475 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12476 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12477 * testsuite/Makefile.in: Rebuild.
12478 * testsuite/weak_undef.h: New file.
12479 * testsuite/weak_undef_file1.cc: Add extra test cases.
12480 * testsuite/weak_undef_file2.cc: Likewise.
12481 * testsuite/weak_undef_test.cc: Likewise.
12483 2008-04-16 David S. Miller <davem@davemloft.net>
12485 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12486 Add issued_non_pic_error_ field. Declare check_non_pic.
12487 (Target_sparc::Scan::check_non_pic): New function.
12488 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12489 (Target_sparc::Scan::global): Likewise.
12491 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12492 * configure: Rebuild.
12494 * options.h (DEFINE_enable): New macro.
12495 (new_dtags): New enable option.
12496 (initfirst, interpose, loadfltr, nodefaultlib,
12497 nodelete, nodlopen, nodump): New -z options.
12498 * layout.cc (Layout:finish_dynamic_section): If new
12499 dtags enabled, emit DT_RUNPATH. Also, emit a
12500 DT_FLAGS_1 containing any specified -z flags.
12502 2008-04-16 Ian Lance Taylor <iant@google.com>
12504 * copy-relocs.cc: New file.
12505 * copy-relocs.h: New file.
12506 * reloc.cc: Remove Copy_relocs code.
12507 * reloc.h: Likewise.
12508 * reloc-types.h (struct Reloc_types) [both versions]: Add
12509 get_reloc_addend_noerror.
12510 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12511 variants of add_global which take an addend which must be zero.
12512 * i386.cc: Include "copy-relocs.h".
12513 (class Target_i386): Change type of copy_relocs_ to variable,
12514 update initializer.
12515 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12516 Change all callers.
12517 (Target_i386::do_finalize_sections): Change handling of
12519 * sparc.cc: Include "copy-relocs.h".
12520 (class Target_sparc): Change type of copy_relocs_ to variable,
12521 update initializer.
12522 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12523 Change all callers.
12524 (Target_sparc::do_finalize_sections): Change handling of
12526 * x86_64.cc: Include "copy-relocs.h".
12527 (class Target_x86_64): Change type of copy_relocs_ to variable,
12528 update initializer.
12529 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12530 class. Change all callers.
12531 (Target_x86_64::do_finalize_sections): Change handling of
12533 * Makefile.am (CCFILES): Add copy-relocs.cc.
12534 (HFILES): Add copy-relocs.h.
12536 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12538 * testsuite/script_test_4.sh: Permit leading zeroes.
12540 2008-04-15 Ian Lance Taylor <iant@google.com>
12542 * script-sections.cc (Script_sections::create_segments): Use
12543 header_size_adjustment even when there is enough room for the
12545 * testsuite/script_test_4.sh: New file.
12546 * testsuite/script_test_4.t: New file.
12547 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12548 (check_DATA): Add script_test_4.stdout.
12549 (MOSTLYCLEANFILES): Likewise.
12550 (script_test_4): New target.
12551 (script_test_4.stdout): New target.
12552 * testsuite/Makefile.in: Rebuild.
12554 * sparc.cc: Add definitions for Output_data_plt_sparc class
12557 2008-04-14 David S. Miller <davem@davemloft.net>
12559 * sparc.cc: New file.
12560 * Makefile.am (TARGETSOURCES): Add sparc.cc
12561 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12562 * configure.tgt: Document targ_extra_size and
12563 targ_extra_big_endian. Add entries for sparc-* and
12565 * configure.ac: Handle targ_extra_size and
12566 targ_extra_big_endian.
12567 * Makefile.in: Rebuild.
12568 * configure: Likewise.
12569 * po/POTFILES.in: Likewise.
12570 * po/gold.pot: Likewise.
12572 2008-04-14 Ian Lance Taylor <iant@google.com>
12574 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12575 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12576 in the name/type/flags to section mapping. Don't call
12577 allocate_output_section.
12578 (Layout::choose_output_section): Change parameter from adjust_name
12579 to is_input_section. Don't permit input sections after sections
12580 are attached to segments. Don't call allocate_output_section.
12581 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12582 not write_enable_output_section.
12583 (Layout::make_output_section): Don't push to
12584 unattached_section_list_ nor call attach_to_segment. Call
12585 attach_section_to_segment if sections are attached.
12586 (Layout::attach_sections_to_segments): New function.
12587 (Layout::attach_section_to_segment): New function.
12588 (Layout::attach_allocated_section_to_segment): Rename from
12589 attach_to_segment. Remove flags parameter.
12590 (Layout::allocate_output_section): Remove function.
12591 (Layout::write_enable_output_section): Remove function.
12592 * layout.h (class Layout): Update for above changes. Add new
12593 field sections_are_attached_.
12594 * output.h (Output_section::update_flags_for_input_section): New
12596 * output.cc (Output_section::add_input_section): Call
12597 update_flags_for_input_section.
12598 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12600 2008-04-11 Cary Coutant <ccoutant@google.com>
12602 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12603 thought unnecessary.
12604 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12606 2008-04-11 Ian Lance Taylor <iant@google.com>
12608 * output.h (class Output_section_data): Remove inline definition
12610 * output.cc (Output_section_data::set_addralign): New function.
12612 2008-04-11 Cary Coutant <ccoutant@google.com>
12614 Add support for TLS descriptors for i386 and x86_64.
12615 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12616 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12617 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12619 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12620 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12621 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12623 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12624 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12625 Fix problem with initial-exec relocations.
12626 (Target_i386::Relocate::relocate_tls): Likewise.
12627 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12629 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12630 support for section-plus-offset dynamic table entries.
12631 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12632 (Output_data_dynamic::Dynamic_entry): Add support for
12633 section-plus-offset dynamic table entries.
12634 (Output_data_dynamic::Classification): Likewise.
12635 (Output_data_dynamic::classification_): Renamed offset_.
12636 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12637 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12638 (Target_x86_64::make_plt_section): New function.
12639 (Target_x86_64::reserve_tlsdesc_entries): New function.
12640 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12641 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12642 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12643 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12644 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12645 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12646 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12647 add extra PLT entry for TLS descriptors.
12648 (Output_data_plt_x86_64::got_): New field.
12649 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12650 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12652 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12654 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12655 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12656 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12657 R_386_TLS_DESC_CALL relocations.
12658 (Target_x86_64::Scan::global): Likewise.
12659 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12660 for TLS descriptors.
12661 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12662 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12663 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12664 GD-to-IE relaxation.
12665 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12666 and TLS_DESCRIPTORS.
12667 * Makefile.in: Rebuild.
12668 * configure: Rebuild.
12669 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12670 (tls_test_shared2.so): New target.
12671 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12672 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12673 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12674 (tls_shared_gd_to_ie_test_LDADD): New variable.
12675 (tls_shared_gnu2_gd_to_ie_test): New target.
12676 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12678 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12679 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12680 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12681 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12682 (tls_shared_gnu2_test): New target.
12683 (tls_test_gnu2_shared.so): New target.
12684 (tls_shared_gnu2_test_SOURCES): New variable.
12685 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12686 (tls_shared_gnu2_test_LDFLAGS): New variable.
12687 (tls_shared_gnu2_test_LDADD): New variable.
12688 * testsuite/Makefile.in: Rebuild.
12689 * testsuite/Makefile.
12691 2008-04-11 Ian Lance Taylor <iant@google.com>
12693 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12695 * testsuite/Makefile.in: Rebuild.
12697 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12699 * testsuite/script_test_2.cc (main): Adjust test.
12701 2008-04-11 David S. Miller <davem@davemloft.net>
12702 Ian Lance Taylor <iant@google.com>
12704 * options.h (General_options): Add entries for '-Y' and
12706 * options.cc (General_options:finalize): If -Y was used, add those
12707 entries to the library path instead of the default "/lib" and
12710 2008-04-11 David S. Miller <davem@davemloft.net>
12712 * testsuite/justsyms.t: Start at 0x100.
12713 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12714 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12716 * testsuite/script_test_2.cc: Adjust string and section length
12719 2008-04-09 Ian Lance Taylor <iant@google.com>
12722 * script-sections.cc (Sections_element::allocate_to_segment): Add
12724 (Output_section_definition::allocate_to_segment): Likewise.
12725 (Orphan_output_section::allocate_to_segment): Likewise.
12726 (Script_sections::attach_sections_using_phdrs_clause): Don't
12727 propagate non-PT_LOAD segments to orphan sections.
12728 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12729 readelf rather than objdump.
12730 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12731 .interp section and PT_INTERP segment are the same size.
12732 * testsuite/Makefile.in: Rebuild.
12734 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12735 aliases for symbols defined in the same object.
12736 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12737 (weak_alias_test_SOURCES): New variable.
12738 (weak_alias_test_DEPENDENCIES): New variable.
12739 (weak_alias_test_LDFLAGS): New variable.
12740 (weak_alias_test_LDADD): New variable.
12741 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12742 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12743 (weak_alias_test_3.o): New target.
12744 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12745 * testsuite/weak_alias_test_main.cc: New file.
12746 * testsuite/weak_alias_test_1.cc: New file.
12747 * testsuite/weak_alias_test_2.cc: New file.
12748 * testsuite/weak_alias_test_3.cc: New file.
12750 2008-04-08 Ian Lance Taylor <iant@google.com>
12752 * options.h (class General_options): Add --noinhibit-exec option.
12753 * main.cc (main): Check --noinhibit-exec.
12755 * options.h (class General_options): Define --wrap as a special
12756 option. Add wrap_symbols_ field.
12757 (General_options::any_wrap_symbols): New function.
12758 (General_options::is_wrap_symbol): New function.
12759 * options.cc (General_options::parse_wrap): New function.
12760 (General_options::General_options): Initialize wrap_symbols_.
12761 * symtab.cc (Symbol_table::wrap_symbol): New function.
12762 (Symbol_table::add_from_object): Handle --wrap.
12763 * symtab.h (class Symbol_table): Declare wrap_symbol.
12764 * target.h (Target::wrap_char): New function.
12765 (Target::Target_info): Add wrap_char field.
12766 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12767 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12768 * testsuite/testfile.cc (Target_test::test_target_info):
12771 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12774 * layout.h (class Layout): Add added_eh_frame_data_ field.
12775 * layout.cc (Layout::Layout): Initialize new field.
12776 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12777 output section until we find a section we merged successfully.
12778 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12779 that the size be non-zero.
12781 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12784 2008-04-08 Craig Silverstein <csilvers@google.com>
12786 * configure.ac: Export new conditional variable HAVE_ZLIB.
12787 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12789 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12790 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12792 2008-04-07 Ian Lance Taylor <iant@google.com>
12794 * version.cc (version_string): Set to "1.5".
12796 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12797 Add issued_non_pic_error_ field. Declare check_non_pic.
12798 (Target_x86_64::Scan::check_non_pic): New function.
12799 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12800 (Target_x86_64::Scan::global): Likewise.
12802 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12803 addend parameter. Change caller. Handle merge sections.
12804 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12805 Address to Addend. Don't add in the result of
12806 local_section_offset, pass down the addend and use the returned
12808 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12809 Update declarations of local_section_offset and symbol_value.
12810 * testsuite/two_file_test_1.cc (t18): New function.
12811 * testsuite/two_file_test_2.cc (f18): New function.
12812 * testsuite/two_file_test_main.cc (main): Call t18.
12813 * testsuite/two_file_test.h (t18, f18): Declare.
12815 * configure.ac: Don't test for objdump, c++filt, or readelf.
12816 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12818 (TEST_READELF): New variable.
12819 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12820 (check_PROGRAMS): Add two_file_strip_test.
12821 (two_file_strip_test): New target.
12822 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12823 (two_file_same_shared_strip_test_SOURCES): New variable.
12824 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12825 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12826 (two_file_same_shared_strip_test_LDADD): New variable.
12827 (two_file_shared_strip.so): New target.
12828 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12829 (ver_test_5.syms, ver_test_7.syms): Likewise.
12830 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12831 (strip_test_3.stdout): Use TEST_OBJDUMP.
12832 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12834 2008-04-04 Cary Coutant <ccoutant@google.com>
12836 * symtab.h (Symbol::is_weak_undefined): New function.
12837 (Symbol::is_strong_undefined): New function.
12838 (Symbol::is_absolute): New function.
12839 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12840 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12842 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12843 (weak_undef_test): New target.
12844 * testsuite/Makefile.in: Rebuild.
12845 * testsuite/weak_undef_file1.cc: New file.
12846 * testsuite/weak_undef_file2.cc: New file.
12847 * testsuite/weak_undef_test.cc: New file.
12849 2008-04-03 Craig Silverstein <csilvers@google.com>
12851 * compressed_output.h (class Output_compressed_section): Use
12853 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12855 (zlib_compressed_suffix): Removed.
12856 (Output_compressed_section::set_final_data_size): Use unsigned
12858 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12859 Fix linker invocation.
12860 (flagstest_o_specialfile_and_compress_debug_sections):
12862 * testsuite/Makefile.in: Regenerated.
12864 2008-04-02 David S. Miller <davem@davemloft.net>
12866 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12867 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12869 2008-04-02 Craig Silverstein <csilvers@google.com>
12873 2008-04-02 Ian Lance Taylor <iant@google.com>
12875 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12876 parameters. Update for new key type to views_. Change all
12878 (File_read::read): Adjust for byteshift in returned view.
12879 (File_read::add_view): New function, broken out of
12880 find_and_make_view.
12881 (File_read::make_view): New function, broken out of
12882 find_and_make_view.
12883 (File_read::find_or_make_view): Add offset and aligned
12884 parameters. Rewrite accordingly. Change all callers.
12885 (File_read::get_view): Add offset and aligned parameters. Adjust
12886 for byteshift in return value.
12887 (File_read::get_lasting_view): Likewise.
12888 * fileread.h (class File_read): Update declarations.
12889 (class File_read::View): Add byteshift_ field. Add byteshift to
12890 constructor. Add byteshift method.
12891 * archive.h (Archive::clear_uncached_views): New function.
12892 (Archive::get_view): Add aligned parameter. Change all callers.
12893 * object.h (Object::get_view): Add aligned parameter. Change all
12895 (Object::get_lasting_view): Likewise.
12897 * fileread.cc (File_read::release): Don't call clear_views if
12898 there are multiple objects.
12899 * fileread.h (File_read::clear_uncached_views): New function.
12900 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12903 2008-03-31 Cary Coutant <ccoutant@google.com>
12905 Add thin archive support.
12906 * archive.cc (Archive::armagt): New const.
12907 (Archive::setup): Remove task parameter and calls to unlock.
12908 (Archive::unlock_nested_archives): New function.
12909 (Archive::read_header): Add nested_off parameter. Change
12911 (Archive::interpret_header): Likewise.
12912 (Archive::include_all_members): Change to handle thin
12914 (Archive::include_member): Likewise.
12915 * archive.h (Archive::Archive): Add new parameters and
12917 (Archive::armagt): New const.
12918 (Archive::setup): Remove task parameter.
12919 (Archive::unlock_nested_archives): New function.
12920 (Archive::read_header): Add nested_off parameter.
12921 (Archive::interpret_header): Likewise.
12922 (Archive::Nested_archive_table): New typedef.
12923 (Archive::is_thin_archive_): New field.
12924 (Archive::nested_archives_): New field.
12925 (Archive::options_): New field.
12926 (Archive::dirpath_): New field.
12927 (Archive::task_): New field.
12928 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12929 for thin archives. Pass additional parameters to
12930 Archive::Archive. Unlock the archive file after calling
12933 2008-03-29 Ian Lance Taylor <iant@google.com>
12935 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12936 version symbol to be local.
12937 * testsuite/ver_test_4.sh: New file.
12938 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12939 (check_DATA): Add ver_test_4.syms.
12940 (ver_test_4.syms): New target.
12941 * testsuite/Makefile.in: Rebuild.
12944 (Output_section::Input_section_sort_entry::has_priority): New
12946 (Output_section::Input_section_sort_entry::match_file_name): New
12948 (Output_section::Input_section_sort_entry::match_section_name):
12950 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12952 (Output_section::Input_section_sort_entry::match_section_file):
12954 (Output_section::Input_section_sort_compare::operator()): Rewrite
12955 using new Input_section_sort_entry functions. Sort crtbegin and
12956 crtend first. Sort sections with no priority before sections with
12958 * testsuite/initpri1.c (d3): Check j != 4.
12959 (cd5): New constructor/destructor function.
12960 (main): Check j != 2.
12962 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12963 new symbol when resolving, don't call set_is_default.
12964 * testsuite/ver_test_7.cc: New file.
12965 * testsuite/ver_test_7.sh: New file.
12966 * testsuite/Makefile.am (ver_test_7.so): New target.
12967 (ver_test_7.o): New target.
12968 (check_SCRIPTS): Add ver_test_7.sh.
12969 (check_DATA): Add ver_test_7.syms.
12970 (ver_test_7.syms): New target.
12972 2008-03-28 Ian Lance Taylor <iant@google.com>
12974 * layout.cc (Layout::layout): If we see an input section with a
12975 name that needs sorting, set the must_sort flag for the output
12977 (Layout::make_output_section): If the name of the output section
12978 indicates that it might require sorting, set the may_sort flag.
12979 * output.h (Output_section::may_sort_attached_input_sections): New
12981 (Output_section::set_may_sort_attached_input_sections): New
12983 (Output_section::must_sort_attached_input_sections): New
12985 (Output_section::set_must_sort_attached_input_sections): New
12987 (class Output_section): Declare Input_section_sort_entry. Define
12988 Input_section_sort_compare. Declare
12989 sort_attached_input_sections. Add new fields:
12990 may_sort_attached_input_sections_,
12991 must_sort_attached_input_sections_,
12992 attached_input_sections_are_sorted_.
12993 * output.cc (Output_section::Output_section): Initialize new
12995 (Output_section::add_input_section): Add an entry to
12996 input_sections_ if may_sort or must_sort are true.
12997 (Output_section::set_final_data_size): Call
12998 sort_attached_input_sections if necessary.
12999 (Output_section::Input_section_sort_entry): Define new class.
13000 (Output_section::Input_section_sort_compare::operator()): New
13002 (Output_section::sort_attached_input_sections): New function.
13003 * configure.ac: Check whether the compiler supports constructor
13004 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13005 * testsuite/initpri1.c: New file.
13006 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13007 CONSTRUCTOR_PRIORITY.
13008 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13009 (initpri1_LDFLAGS): New variable.
13010 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13012 2008-03-27 Ian Lance Taylor <iant@google.com>
13014 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13015 * testsuite/common_test_1.c: New file.
13016 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13017 (common_test_1_SOURCES): New variable.
13018 (common_test_1_DEPENDENCIES): New variable.
13019 (common_test_1_LDFLAGS): New variable.
13021 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13022 and commons_ correctly when NAME/VERSION does not override
13024 * testsuite/ver_test_6.c: New file.
13025 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13026 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13027 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13029 2008-03-26 Ian Lance Taylor <iant@google.com>
13031 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13032 of an undefined symbol from a version script.
13033 * testsuite/Makefile.am (ver_test_5.so): New target.
13034 (ver_test_5.o): New target.
13035 (check_SCRIPTS): Add ver_test_5.sh.
13036 (check_DATA): Add ver_test_5.syms.
13037 (ver_test_5.syms): New target.
13038 * testsuite/ver_test_5.cc: New file.
13039 * testsuite/ver_test_5.script: New file.
13040 * testsuite/ver_test_5.sh: New file.
13041 * Makefile.in, testsuite/Makefile.in: Rebuild.
13044 Fix problems building gold with gcc 4.3.0.
13045 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13046 (gold_error_at_location, gold_warning_at_location): Use it.
13047 * configure.ac: Check whether we can compile and use a template
13048 function with a printf attribute.
13049 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13050 when jumping over bytes.
13051 * object.cc: Instantiate Object::read_section_data.
13052 * debug.h: Include <cstring>
13053 * dwarf_reader.cc: Include <algorithm>
13054 * main.cc: Include <cstring>.
13055 * options.cc: Include <cstring>.
13056 * output.cc: Include <cstring>.
13057 * script.cc: Include <cstring>.
13058 * script.h: Include <string>.
13059 * symtab.cc: Include <cstring> and <algorithm>.
13060 * target-select.cc: Include <cstring>.
13061 * version.cc: Include <string>.
13062 * testsuite/testmain.cc: Include <cstdlib>.
13063 * configure, config.in: Rebuild.
13065 2008-03-25 Ian Lance Taylor <iant@google.com>
13067 * options.cc: Include "../bfd/bfdver.h".
13068 (options::help): Print bug reporting address.
13070 * version.cc (print_version): Adjust output for current value of
13071 BFD_VERSION_STRING.
13075 * options.cc (options::help): Print list of supported targets.
13076 * target-select.h: Include <vector>.
13077 (class Target_selector): Make machine_, size_, and is_big_endian_
13078 fields const. Add bfd_name_ and instantiated_target_ fields.
13079 (Target_selector::Target_selector): Add bfd_name parameter.
13080 (Target_selector::recognize): Make non-virtual, call
13082 (Target_selector::recognize_by_name): Make non-virtual, call
13083 do_recognize_by_name.
13084 (Target_selector::supported_names): New function.
13085 (Target_selector::bfd_name): New function.
13086 (Target_selector::do_instantiate_target): New pure virtual
13088 (Target_selector::do_recognize): New virtual function.
13089 (Target_selector::do_recognize_by_name): New virtual function.
13090 (Target_selector::instantiate_target): New private function.
13091 (supported_target_names): Declare.
13092 * target-select.cc (Target_selector::Target_selector): Update for
13093 new parameter and fields.
13094 (select_target_by_name): Check that the name matches before
13095 calling recognize_by_name.
13096 (supported_target_names): New function.
13097 * i386.cc (class Target_selector_i386): Update Target_selector
13098 constructor call. Remove recognize and recognize_by_name. Add
13099 do_instantiate_target.
13100 * x86_64.cc (class Target_selector_x86_64): Likewise.
13101 * testsuite/testfile.cc (class Target_selector_test): Update for
13102 changes to Target_selector.
13104 * README: Rewrite, with some notes on unsupported features.
13106 2008-03-24 Cary Coutant <ccoutant@google.com>
13108 * i386.cc (Target_i386::Got_type): New enum declaration.
13109 (Target_i386::Scan::local): Updated callers of Output_data_got
13111 (Target_i386::Scan::global): Likewise.
13112 (Target_i386::Relocate::relocate): Likewise.
13113 (Target_i386::Relocate::relocate_tls): Likewise.
13114 * object.h (Got_offset_list): New class.
13115 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13116 (Sized_relobj::local_got_offset): Likewise.
13117 (Sized_relobj::set_local_got_offset): Likewise.
13118 (Sized_relobj::local_has_tls_got_offset): Removed.
13119 (Sized_relobj::local_tls_got_offset): Removed.
13120 (Sized_relobj::set_local_tls_got_offset): Removed.
13121 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13122 * output.cc (Output_data_got::add_global): Added got_type parameter.
13123 (Output_data_got::add_global_with_rel): Likewise.
13124 (Output_data_got::add_global_with_rela): Likewise.
13125 (Output_data_got::add_global_pair_with_rel): New function.
13126 (Output_data_got::add_global_pair_with_rela): New function.
13127 (Output_data_got::add_local): Added got_type parameter.
13128 (Output_data_got::add_local_with_rel): Likewise.
13129 (Output_data_got::add_local_with_rela): Likewise.
13130 (Output_data_got::add_local_pair_with_rel): New function.
13131 (Output_data_got::add_local_pair_with_rela): New function.
13132 (Output_data_got::add_global_tls): Removed.
13133 (Output_data_got::add_global_tls_with_rel): Removed.
13134 (Output_data_got::add_global_tls_with_rela): Removed.
13135 (Output_data_got::add_local_tls): Removed.
13136 (Output_data_got::add_local_tls_with_rel): Removed.
13137 (Output_data_got::add_local_tls_with_rela): Removed.
13138 * output.h (Output_data_got::add_global): Added got_type parameter.
13139 (Output_data_got::add_global_with_rel): Likewise.
13140 (Output_data_got::add_global_with_rela): Likewise.
13141 (Output_data_got::add_global_pair_with_rel): New function.
13142 (Output_data_got::add_global_pair_with_rela): New function.
13143 (Output_data_got::add_local): Added got_type parameter.
13144 (Output_data_got::add_local_with_rel): Likewise.
13145 (Output_data_got::add_local_with_rela): Likewise.
13146 (Output_data_got::add_local_pair_with_rel): New function.
13147 (Output_data_got::add_local_pair_with_rela): New function.
13148 (Output_data_got::add_global_tls): Removed.
13149 (Output_data_got::add_global_tls_with_rel): Removed.
13150 (Output_data_got::add_global_tls_with_rela): Removed.
13151 (Output_data_got::add_local_tls): Removed.
13152 (Output_data_got::add_local_tls_with_rel): Removed.
13153 (Output_data_got::add_local_tls_with_rela): Removed.
13154 * resolve.cc (Symbol::override_base_with_special): Removed
13155 reference to has_got_offset_ field.
13156 * symtab.cc (Symbol::init_fields): Replaced initialization
13157 of got_offset_ with got_offsets_. Removed initialization
13159 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13160 (Symbol::got_offset): Likewise.
13161 (Symbol::set_got_offset): Likewise.
13162 (Symbol::has_tls_got_offset): Removed.
13163 (Symbol::tls_got_offset): Removed.
13164 (Symbol::set_tls_got_offset): Removed.
13165 (Symbol::got_offset_): Removed.
13166 (Symbol::tls_mod_got_offset_): Removed.
13167 (Symbol::tls_pair_got_offset_): Removed.
13168 (Symbol::got_offsets_): New field.
13169 (Symbol::has_got_offset): Removed.
13170 (Symbol::has_tls_mod_got_offset): Removed.
13171 (Symbol::has_tls_pair_got_offset): Removed.
13172 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13173 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13175 (Target_x86_64::Scan::global): Likewise.
13176 (Target_x86_64::Relocate::relocate): Likewise.
13177 (Target_x86_64::Relocate::relocate_tls): Likewise.
13179 2008-03-25 Ben Elliston <bje@au.ibm.com>
13181 * yyscript.y: Fix spelling error in comment.
13183 2008-03-24 Ian Lance Taylor <iant@google.com>
13185 * options.h (class General_options): Define build_id option.
13186 * layout.h (class Layout): Declare write_build_id, create_note,
13187 create_build_id. Add build_id_note_ member.
13188 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13189 "libiberty.h", "md5.h", "sha1.h".
13190 (Layout::Layout): Initialize eh_frame_data_,
13191 eh_frame_hdr_section_, and build_id_note_.
13192 (Layout::finalize): Call create_build_id.
13193 (Layout::create_note): New function, broken out of
13194 Layout::create_gold_note.
13195 (Layout::create_gold_note): Call create_note.
13196 (Layout::create_build_id): New function.
13197 (Layout::write_build_id): New function.
13198 (Close_task_runner::run): Call write_build_id.
13200 * x86_64.cc: Correct license to GPLv3.
13202 2008-03-23 Ian Lance Taylor <iant@google.com>
13204 * options.cc: Include "demangle.h".
13205 (parse_optional_string): New function.
13206 (parse_long_option): Handle takes_optional_argument.
13207 (parse_short_option): Update dash_z initializer. Handle
13208 takes_optional_argument.
13209 (General_options::General_options): Initialize do_demangle_.
13210 (General_options::finalize): Set do_demangle_. Handle demangling
13212 * options.h (parse_optional_string): Declare.
13213 (struct One_option): Add optional_arg field. Update constructor.
13214 Update call constructor calls. Add takes_optional_argument
13216 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13217 (DEFINE_optional_string): Define.
13218 (General_options::demangle): Change from DEFINE_bool to
13219 DEFINE_optional_string.
13220 (General_options::no_demangle): New function.
13221 (General_options::do_demangle): New function.
13222 (General_options::set_do_demangle): New function.
13223 (General_options::execstack_status_): Move definition to end of
13225 (General_options::static_): Likewise.
13226 (General_options::do_demangle_): New field.
13227 * object.cc (big_endian>::get_symbol_location_info): Call
13228 Options::do_demangle, not Options::demangle.
13229 * symtab.cc (demangle): Likewise.
13231 2008-03-22 Ian Lance Taylor <iant@google.com>
13233 * gold.h: Include <cstddef> and <sys/types.h>
13234 * options.h: Include <cstring>.
13236 2008-03-21 Ian Lance Taylor <iant@google.com>
13238 * Added source code to GNU binutils.