1 2012-06-05 Jing Yu <jingyu@google.com>
3 * gold.h (textdomain): Add do {} to empty while(0).
4 (bindtextdomain): Likewise.
6 2012-06-04 Cary Coutant <ccoutant@google.com>
8 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
11 2012-05-25 Sriraman Tallam <tmsriram@google.com>
13 * symtab.cc (Symbol_table::define_special_symbol):
14 Initialize *poldsym to prevent uninitialized variable errors.
16 2012-05-23 Cary Coutant <ccoutant@google.com>
18 * layout.cc (Layout::section_name_mapping): Add rules to handle
19 exact match on .data.rel.ro.local or .data.rel.ro.
20 (Layout::output_section_name): Check for exact matches.
22 2012-05-23 Cary Coutant <ccoutant@google.com>
24 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
27 2012-05-22 Cary Coutant <ccoutant@google.com>
29 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
30 object before exporting symbol.
32 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
34 * testsuite/tls_test.cc: Include "config.h" first.
35 * testsuite/tls_test_c.c: Likewise.
37 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
38 Nick Clifton <nickc@redhat.com>
41 * configure.in: Add check that sysdep.h has been included before
42 any system header files.
43 * configure: Regenerate.
44 * config.in: Regenerate.
46 2012-05-14 Cary Coutant <ccoutant@google.com>
48 * layout.cc (Layout::make_output_section): Mark .tdata section
50 * testsuite/relro_test.cc: Add a TLS variable.
52 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
55 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
56 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
59 2012-05-08 Cary Coutant <ccoutant@google.com>
61 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
62 (lines_only_debug_sections): Likewise.
64 2012-05-02 Roland McGrath <mcgrathr@google.com>
68 * Makefile.am (CCFILES, HFILES): Add them.
69 * Makefile.in: Regenerate.
70 * i386.cc (Output_data_plt_i386_nacl): New class.
71 (Output_data_plt_i386_nacl_exec): New class.
72 (Output_data_plt_i386_nacl_dyn): New class.
73 (Target_i386_nacl): New class.
74 (Target_selector_i386_nacl): New class.
75 (target_selector_i386): Use it instead of Target_selector_i386.
76 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
77 (Target_x86_64_nacl): New class.
78 (Target_selector_x86_64_nacl): New class.
79 (target_selector_x86_64, target_selector_x32): Use it instead of
80 Target_selector_x86_64.
81 * arm.cc (Output_data_plt_arm_nacl): New class.
82 (Target_arm_nacl): New class.
83 (Target_selector_arm_nacl): New class.
84 (target_selector_arm, target_selector_armbe): Use it instead of
87 * target-select.cc (select_target): Take new Input_file* and off_t
88 arguments, pass them on to recognize method of selector.
89 * object.cc (make_elf_sized_object): Update caller.
90 * parameters.cc (parameters_force_valid_target): Likewise.
91 * incremental.cc (make_sized_incremental_binary): Likewise.
92 * target-select.h: Update decl.
93 (Target_selector::recognize): Take new Input_file* argument,
94 pass it on to do_recognize.
95 (Target_selector::do_recognize): Take new Input_file* argument.
96 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
97 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
98 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
99 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
101 * target.h (Target::Target_info): New members isolate_execinstr
103 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
104 * arm.cc (Target_arm::arm_info): Update initializer.
105 * i386.cc (Target_i386::i386_info): Likewise.
106 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
107 * sparc.cc (Target_sparc::sparc_info): Likewise.
108 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
109 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
110 * layout.cc (Layout::attach_allocated_section_to_segment):
111 Take new const Target* argument. If target->isolate_execinstr(), act
113 (Layout::find_first_load_seg): Take new const Target* argument;
114 if target->isolate_execinstr(), reject PF_X segments.
115 (Layout::relaxation_loop_body): Update caller.
116 (Layout::set_segment_offsets): If target->isolate_execinstr(),
117 reset file offset to zero when we hit LOAD_SEG, and then do a second
118 loop over the segments before LOAD_SEG to reassign offsets after
119 addresses have been determined. Handle target->rosegment_gap().
120 (Layout::attach_section_to_segment): Take new const Target* argument;
121 pass it to attach_allocated_section_to_segment.
122 (Layout::make_output_section): Update caller.
123 (Layout::attach_sections_to_segments): Take new const Target* argument;
124 pass it to attach_section_to_segment.
125 * gold.cc (queue_middle_tasks): Update caller.
126 * layout.h (Layout): Update method decls with new arguments.
128 * arm.cc (Target_arm::Target_arm): Take optional argument for the
129 Target_info pointer to use.
130 (Target_arm::do_make_data_plt): New virtual method.
131 (Target_arm::make_data_plt): New method that calls it.
132 (Target_arm::make_plt_entry): Use it.
133 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
134 for the section alignment.
135 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
137 (Output_data_plt_arm::first_plt_entry_offset): Call it.
138 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
140 (Output_data_plt_arm::get_plt_entry_size): Call it.
141 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
142 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
143 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
145 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
146 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
147 method instead of sizeof(plt_entry).
148 (Output_data_plt_arm::add_entry): Likewise.
149 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
150 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
152 (Target_arm::plt_entry_size): Likewise.
153 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
155 (Output_data_plt_arm_standard): ... here, new class.
156 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
157 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
158 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
160 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
161 Take additional argument for the PLT entry size.
162 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
163 Use get_plt_entry_size method rather than plt_entry_size variable.
164 (Output_data_plt_x86_64::reserve_slot): Likewise.
165 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
166 (Output_data_plt_x86_64::add_entry): Likewise.
167 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
168 (Output_data_plt_x86_64::address_for_global): Likewise.
169 (Output_data_plt_x86_64::address_for_local): Likewise.
170 (Output_data_plt_x86_64::set_final_data_size): Likewise.
171 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
172 Make method non-static.
173 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
175 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
176 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
177 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
178 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
180 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
181 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
183 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
184 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
186 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
187 (Output_data_plt_x86_64::plt_entry_size)
188 (Output_data_plt_x86_64::first_plt_entry)
189 (Output_data_plt_x86_64::plt_entry)
190 (Output_data_plt_x86_64::tlsdesc_plt_entry)
191 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
192 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
193 (Output_data_plt_x86_64_standard): ... here, new class.
194 (Target_x86_64::Target_x86_64): Take optional argument for the
195 Target_info pointer to use.
196 (Target_x86_64::do_make_data_plt): New virtual method.
197 (Target_x86_64::make_data_plt): New method to call it.
198 (Target_x86_64::init_got_plt_for_update): Use that.
199 Call this->plt_->add_eh_frame method here.
200 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
201 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
202 rather than static method.
203 (Target_x86_64::plt_entry_size): Likewise.
204 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
205 rather than plt_entry_size variable. Move guts of PLT filling to...
206 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
207 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
208 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
210 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
211 additional argument for the section alignment.
212 Don't do add_eh_frame_for_plt here.
213 (Output_data_plt_i386::first_plt_entry_offset): Make the method
214 non-static. Use get_plt_entry_size method rather than plt_entry_size
216 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
218 (Output_data_plt_i386::get_plt_entry_size): Call it.
219 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
220 (Output_data_plt_i386::add_eh_frame): New method to call it.
221 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
223 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
224 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
226 (Output_data_plt_i386::fill_plt_entry): New method to call it.
227 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
228 method instead of plt_entry_size.
229 (Output_data_plt_i386::plt_entry_size)
230 (Output_data_plt_i386::plt_eh_frame_fde_size)
231 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
232 (Output_data_plt_i386_standard): ... here, new class.
233 (Output_data_plt_i386_exec): New class.
234 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
235 (Output_data_plt_i386_exec::first_plt_entry): ... here.
236 (Output_data_plt_i386::exec_plt_entry): Move to ...
237 (Output_data_plt_i386_exec::plt_entry): ... here.
238 (Output_data_plt_i386_dyn): New class.
239 (Output_data_plt_i386::first_plt_entry): Move to ...
240 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
241 (Output_data_plt_i386::dyn_plt_entry): Move to ...
242 (Output_data_plt_i386_dyn::plt_entry): ... here.
243 (Target_i386::Target_i386): Take optional argument for the Target_info
245 (Target_i386::do_make_data_plt): New virtual method.
246 (Target_i386::make_data_plt): New method to call it.
247 (Target_i386::make_plt_section): Use that.
248 Call this->plt_->add_eh_frame method here.
249 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
250 rather than plt_entry_size variable.
251 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
252 (Output_data_plt_i386::address_for_local): Likewise.
253 (Output_data_plt_i386::do_write): Likewise.
254 Move guts of PLT filling to...
255 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
256 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
257 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
258 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
260 2012-05-01 Cary Coutant <ccoutant@google.com>
262 * dwarf_reader.cc (Dwarf_die::read_attributes)
263 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
264 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
265 * reduced_debug_output.cc
266 (Output_reduced_debug_info_section::get_die_end): Remove
267 DW_FORM_GNU_ref_index. Add default case.
269 2012-04-26 Mark Wielaard <mjw@redhat.com>
271 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
272 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
273 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
274 DW_AT_high_pc as offset from DW_AT_low_pc.
276 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
277 * testsuite/Makefile.in: Regenerate.
278 * testsuite/gdb_index_test_3.c: New test source file.
279 * testsuite/gdb_index_test_3.sh: New test source file.
281 2012-04-25 Ian Lance Taylor <iant@google.com>
283 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
285 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
286 as a class, not a struct.
287 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
288 (Target_arm::apply_cortex_a8_workaround): Likewise.
289 * gc.h: Declare Reloc_types as a struct, not a class.
290 * object.h: Declare Symbols_data as a struct.
291 * reloc.h: Declare Read_relocs_data as a struct.
292 * target.h: Declare Relocate_info as a struct.
294 2012-04-24 David S. Miller <davem@davemloft.net>
296 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
297 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
300 2012-04-24 Cary Coutant <ccoutant@google.com>
302 * incremental-dump.cc (find_input_containing_global): Replace
303 magic number with symbolic constant.
304 (dump_incremental_inputs): Update version number.
305 * incremental.cc (Output_section_incremental_inputs): Update version
306 number; import symbolic constants from Incremental_inputs_reader.
307 (Incremental_inputs::create_data_sections): Align relocations
308 section correctly for 64-bit targets.
309 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
310 constants; add padding.
311 (Output_section_incremental_inputs::write_header): Add assert for
313 (Output_section_incremental_inputs::write_input_files): Add assert
314 for input_entry_size.
315 (Output_section_incremental_inputs::write_info_blocks): Add padding;
316 add assert for object_info_size, input_section_entry_size,
317 global_sym_entry_size.
318 * incremental.h (Incremental_inputs_reader): Add symbolic constants
319 for data structure sizes; use them.
320 (Incremental_input_entry_reader): Import symbolic constants from
321 Incremental_inputs_reader; use them.
323 2012-04-23 David S. Miller <davem@davemloft.net>
325 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
327 (Target_sparc::Target_sparc): Initialize new fields.
328 (Target_sparc::do_make_elf_object): New function.
329 (Target_sparc::do_adjust_elf_header): New function.
331 2012-04-23 Cary Coutant <ccoutant@google.com>
333 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
334 CU range table of gdb index.
336 2012-04-20 David S. Miller <davem@davemloft.net>
338 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
341 2012-04-16 David S. Miller <davem@davemloft.net>
343 * sparc.cc (Target_sparc::got_address): New function.
344 (Sparc_relocate_functions::gdop_hix22): New function.
345 (Sparc_relocate_functions::gdop_lox10): New function.
346 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
348 (Target_sparc::Scan::local): Likewise if the global symbol is not
349 preemptible and is not IFUNC.
350 (Target_sparc::Relocate::relocate): Perform GOTDATA code
351 transformations for local and non-preemptible non-IFUNC global
354 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
355 writing out 64-bit part of ranges.
357 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
358 -fpic and -fpie respectively.
359 * Makefile.in: Regenerate.
361 * sparc.cc (class Target_sparc): Add rela_ifunc_.
362 (Target_sparc::Target_sparc): Initialize new field.
363 (Target_sparc::do_plt_section_for_global): New function.
364 (Target_sparc::do_plt_section_for_local): New function.
365 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
366 (Target_sparc::make_plt_section): New function, broken out of
367 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
368 (Target_sparc::make_plt_entry): Call make_plt_section.
369 (Target_sparc::make_local_ifunc_plt_entry): New function.
370 (Target_sparc::rela_ifunc_section): New function.
371 (Target_sparc::plt_section): Remove const.
372 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
373 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
374 and ifunc_count_ fields.
375 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
376 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
377 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
378 (Output_data_plt_sparc::rela_ifunc): New function.
379 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
380 (Output_data_plt_sparc::has_ifunc_section): New function.
381 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
382 (Output_data_plt_sparc::address_for_global): New function.
383 (Output_data_plt_sparc::address_for_local): New function.
384 (Output_data_plt_sparc::plt_index_to_offset): New function.
385 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
387 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
389 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
390 R_SPARC_JMP_IREL to switch.
391 (Target_sparc::Scan::check_non_pic): Likewise.
392 (Target_sparc::Scan::local): Handle IFUNC symbols.
393 (Target_sparc::Scan::local): Likewise.
394 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
395 and plt_address_for_local.
396 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
397 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
399 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
400 (class Output_data_reloc): Adjust calls to Output_reloc_type.
401 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
402 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
404 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
405 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
407 * sparc.cc (Target_sparc::Scan::global): Likewise.
408 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
410 2012-04-16 Cary Coutant <ccoutant@google.com>
412 * archive.cc (Library_base::should_include_member): Check for
413 --export-dynamic-symbol.
414 * options.h (class General_options): Add --export-dynamic-symbol.
415 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
416 --export-dynamic-symbol.
417 (Symbol_table::gc_mark_undef_symbols): Likewise.
418 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
420 2012-04-12 David S. Miller <davem@davemloft.net>
422 * sparc.cc (Reloc::wdisp10): New relocation method.
423 (Reloc::h34): Likewise.
424 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
425 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
427 (Target_sparc::Scan::local): Likewise.
428 (Target_sparc::Scan::global): Likewise.
429 (Target_sparc::Relocate::relocate): Likewise.
431 2012-04-09 Cary Coutant <ccoutant@google.com>
433 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
436 2012-04-06 Ian Lance Taylor <iant@google.com>
438 * timer.cc: #include <unistd.h>.
440 2012-04-06 Roland McGrath <mcgrathr@google.com>
442 * configure.in (AC_CHECK_HEADERS): Add locale.h.
443 * config.in: Regenerate.
444 * configure: Regenerate.
446 2012-04-05 Nick Clifton <nickc@redhat.com>
448 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
449 (AM_LC_MESSAGES): Add.
450 * aclocal.m4: Regenerate.
451 * config.in: Regenerate.
452 * configure: Regenerate.
454 2012-03-21 Cary Coutant <ccoutant@google.com>
456 * Makefile.am: Add gdb-index.cc, gdb-index.h.
457 * Makefile.in: Regenerate.
458 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
459 (Sized_elf_reloc_mapper::symbol_section): New function.
460 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
461 (make_elf_reloc_mapper): New function.
462 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
463 (Dwarf_abbrev_table::do_read_abbrevs): New function.
464 (Dwarf_abbrev_table::do_get_abbrev): New function.
465 (Dwarf_ranges_table::read_ranges_table): New function.
466 (Dwarf_ranges_table::read_range_list): New function.
467 (Dwarf_pubnames_table::read_section): New function.
468 (Dwarf_pubnames_table::read_header): New function.
469 (Dwarf_pubnames_table::next_name): New function.
470 (Dwarf_die::Dwarf_die): New function.
471 (Dwarf_die::read_attributes): New function.
472 (Dwarf_die::skip_attributes): New function.
473 (Dwarf_die::set_name): New function.
474 (Dwarf_die::set_linkage_name): New function.
475 (Dwarf_die::attribute): New function.
476 (Dwarf_die::string_attribute): New function.
477 (Dwarf_die::int_attribute): New function.
478 (Dwarf_die::uint_attribute): New function.
479 (Dwarf_die::ref_attribute): New function.
480 (Dwarf_die::child_offset): New function.
481 (Dwarf_die::sibling_offset): New function.
482 (Dwarf_info_reader::check_buffer): New function.
483 (Dwarf_info_reader::parse): New function.
484 (Dwarf_info_reader::do_parse): New function.
485 (Dwarf_info_reader::do_read_string_table): New function.
486 (Dwarf_info_reader::lookup_reloc): New function.
487 (Dwarf_info_reader::get_string): New function.
488 (Dwarf_info_reader::visit_compilation_unit): New function.
489 (Dwarf_info_reader::visit_type_unit): New function.
490 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
491 Sized_elf_reloc_mapper.
492 (Sized_dwarf_line_info::symbol_section): Remove function.
493 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
494 (Sized_dwarf_line_info::read_line_mappings): Remove object
495 parameter, adjust callers.
496 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
497 * dwarf_reader.h: Include <sys/types.h>.
498 (class Track_relocs): Remove forward declaration.
499 (class Elf_reloc_mapper): New class.
500 (class Sized_elf_reloc_mapper): New class.
501 (class Dwarf_abbrev_table): New class.
502 (class Dwarf_range_list): New class.
503 (class Dwarf_ranges_table): New class.
504 (class Dwarf_pubnames_table): New class.
505 (class Dwarf_die): New class.
506 (class Dwarf_info_reader): New class.
507 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
508 (Sized_dwarf_line_info::symbol_section): Remove member function.
509 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
511 * gdb-index.cc: New source file.
512 * gdb-index.h: New source file.
513 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
514 and .debug_types sections, call Layout::add_to_gdb_index.
515 (Sized_relobj_incr::do_section_name): Implement.
516 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
517 return type; Implement.
518 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
520 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
521 parameter list and return type.
522 (Sized_incr_dynobj::do_section_contents): Likewise.
523 * layout.cc: Include gdb-index.h.
524 (Layout::Layout): Initialize gdb_index_data_.
525 (Layout::init_fixed_output_section): Check for .gdb_index section.
526 (Layout::add_to_gdb_index): New function. Instantiate.
527 * layout.h: Add forward declaration for class Gdb_index.
528 (Layout::add_to_gdb_index): New member function.
529 (Layout::gdb_index_data_): New data member.
530 * main.cc: Include gdb-index.h.
531 (main): Print statistics for gdb index.
532 * object.cc (Object::section_contents): Move code into
534 (need_decompressed_section): Check for sections needed when building
536 (build_compressed_section_map): Likewise.
537 (Sized_relobj_file::do_read_symbols): Need local symbols when building
539 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
540 sections; call Layout::add_to_gdb_index.
541 (Sized_relobj_file::do_decompressed_section_contents): Call
542 do_section_contents directly.
543 * object.h (Object::do_section_contents): Adjust parameter list and
545 (Object::do_decompressed_section_contents): Call do_section_contents
547 (Sized_relobj_file::do_section_contents): Adjust parameter list and
549 * options.h (class General_options): Add --gdb-index option.
550 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
551 list and return type.
552 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
553 * reloc.h (Track_relocs::checkpoint): New function.
554 (Track_relocs::reset): New function.
556 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
558 * testsuite/Makefile.in: Regenerate.
559 * testsuite/gdb_index_test.cc: New test source file.
560 * testsuite/gdb_index_test_1.sh: New test source file.
561 * testsuite/gdb_index_test_2.sh: New test source file.
563 2012-03-19 Doug Kwan <dougkwan@google.com>
565 * arm.cc (Target_arm::do_define_standard_symbols): New method.
566 (Target_arm::do_finalize_sections): Remove code which defines
567 __exidx_start and __exidx_end. Make symbol table parameter
568 anonymous as it is not used.
569 * gold.cc (queue_middle_tasks): Call target hook to define any
570 target-specific symbols.
571 * target.h (Target::define_standard_symbols): New method.
572 (Target::do_define_standard_symbols): Same.
573 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
574 * testsuite/Makefile.in: Regenerate.
575 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
577 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
578 relocations are generated for __exidx_start and __exidx_end.
580 2012-03-16 Doug Kwan <dougkwan@google.com>
582 * testsuite/Makefile.am: Disable test initpri3b.
583 * testsuite/Makefile.in: Regenerate.
585 2012-03-15 Doug Kwan <dougkwan@google.com>
587 * arm.cc (Target_arm::got_section): Make .got section read-only
590 2012-03-15 Ian Lance Taylor <iant@google.com>
593 * layout.cc (Layout::make_output_section): Correctly mark
594 SHT_INIT_ARRAY, et. al., as relro.
596 2012-03-14 Doug Kwan <dougkwan@google.com>
598 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
599 dynamic relocations for protected symbols in shared objects.
601 2012-03-13 Ian Lance Taylor <iant@google.com>
603 * resolve.cc (Symbol_table::resolve): When merging common symbols,
604 keep the larger alignment.
606 2012-03-12 Cary Coutant <ccoutant@google.com>
608 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
609 handling of DW_LNE_define_file.
611 2012-03-12 Cary Coutant <ccoutant@google.com>
613 * reduced_debug_output.cc
614 (Output_reduced_debug_info_section::get_die_end): Add new FORM
617 2012-02-29 Cary Coutant <ccoutant@google.com>
619 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
621 2012-02-29 Cary Coutant <ccoutant@google.com>
623 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
624 Call Object::decompressed_section_contents.
625 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
627 (Sized_dwarf_line_info::buffer_start_): New data member.
628 * merge.cc (Output_merge_data::do_add_input_section): Call
629 Object::decompressed_section_contents.
630 (Output_merge_string::do_add_input_section): Likewise.
631 * object.cc (need_decompressed_section): New function.
632 (build_compressed_section_map): Decompress sections needed later.
633 (Sized_relobj_file::do_decompressed_section_contents): New function.
634 (Sized_relobj_file::do_discard_decompressed_sections): New function.
635 * object.h (Object::decompressed_section_contents): New function.
636 (Object::discard_decompressed_sections): New function.
637 (Object::do_decompressed_section_contents): New function.
638 (Object::do_discard_decompressed_sections): New function.
639 (Compressed_section_info): New type.
640 (Compressed_section_map): Include decompressed section contents.
641 (Sized_relobj_file::do_decompressed_section_contents): New function.
642 (Sized_relobj_file::do_discard_decompressed_sections): New function.
644 2012-02-16 Cary Coutant <ccoutant@google.com>
646 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
647 * testsuite/Makefile.in: Regenerate.
649 2012-02-14 Cary Coutant <ccoutant@google.com>
651 * options.cc (General_options::finalize): Disallow -pie and -static.
653 2012-02-03 Doug Kwan <dougkwan@google.com>
655 * arm.cc (Arm_relocate_functions::abs8,
656 Arm_relocate_functions::abs16): Use
657 Bits::has_signed_unsigned_overflow32.
658 (Arm_relocate_functions::thm_abs8): Correct range of
660 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
663 2012-02-02 Doug Kwan <dougkwan@google.com>
665 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
666 position independent outputs, not just shared objects.
668 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
670 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
671 * configure: Regenerated.
673 2012-01-27 Ian Lance Taylor <iant@google.com>
675 * reloc.h (Bits): New class with static functions, copied from
676 namespace utils in arm.cc.
677 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
680 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
682 * incremental.cc (write_info_blocks): Correct relocation offset.
684 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
686 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
687 (Relocate::tls_gd_to_le): Likewise.
689 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
691 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
693 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
695 * configure.ac: Check if -mcmodel=medium works.
696 * configure: Regenerated.
698 2012-01-24 Cary Coutant <ccoutant@google.com>
700 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
702 (read_unsigned_LEB_128_x): ... this new function.
703 (read_signed_LEB_128): Replaced with inline definition and ...
704 (read_signed_LEB_128_x): ... this new function.
705 * int_encoding.h (read_unsigned_LEB_128_x): New function.
706 (read_unsigned_LEB_128): Add inline definition.
707 (read_signed_LEB_128_x): New function.
708 (read_signed_LEB_128): Add inline definition.
709 * testsuite/Makefile.am (leb128_unittest): New unit test.
710 * testsuite/Makefile.in: Regenerate.
711 * testsuite/leb128_unittest.cc: New unit test.
713 2012-01-23 Ian Lance Taylor <iant@google.com>
716 * i386.cc (Target_i386::do_code_fill): When using a jmp
717 instruction, pad with nop instructions.
718 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
720 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
722 * x86_64.cc (gc_process_relocs): Add typename on types used in
724 (scan_relocs): Likewise.
725 (relocate_section): Likewise.
726 (apply_relocation): Likewise.
728 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
730 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
731 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
734 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
736 * x86_64.cc: Initial support for x32.
738 2012-01-03 Cary Coutant <ccoutant@google.com>
740 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
741 Use abstract base class for GOT.
742 * gold/output.h (class Output_data_got_base): New abstract base class.
743 (class Output_data_got): Derive from new base class, adjust ctors.
744 (Output_data_got::reserve_slot): Make virtual; rename to
745 do_reserve_slot; Adjust callers.
746 * gold/target.h (Sized_target::init_got_plt_for_update): Return
747 pointer to abstract base class.
748 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
750 2011-12-18 Ian Lance Taylor <iant@google.com>
752 * object.h (Relobj::local_symbol_value): New function.
753 (Relobj::local_plt_offset): New function.
754 (Relobj::local_has_got_offset): New function.
755 (Relobj::local_got_offset): New function.
756 (Relobj::set_local_got_offset): New function.
757 (Relobj::do_local_symbol_value): New pure virtual function.
758 (Relobj::do_local_plt_offset): Likewise.
759 (Relobj::do_local_has_got_offset): Likewise.
760 (Relobj::do_local_got_offset): Likewise.
761 (Relobj::do_set_local_got_offset): Likewise.
762 (Sized_relobj::do_local_has_got_offset): Rename from
763 local_has_got_offset.
764 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
765 (Sized_relobj::do_set_local_got_offset): Rename from
766 set_local_got_offset.
767 (Sized_relobj_file::do_local_plt_offset): Rename from
769 (Sized_relobj_file::do_local_symbol_value): New function.
770 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
772 * output.cc (Output_data_got::Got_entry::write): Change object to
773 Relobj. Use local_symbol_value.
774 (Output_data_got::add_global_with_rel): Change rel_dyn to
775 Output_data_reloc_generic*. Use add_global_generic.
776 (Output_data_got::add_global_with_rela): Remove. Change all
777 callers to use add_global_with_rel.
778 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
779 Output_data_reloc_generic*. Use add_global_generic.
780 (Output_data_got::add_global_pair_with_rela): Remove. Change all
781 callers to use add_global_pair_with_rel.
782 (Output_data_got::add_local): Change object to Relobj*.
783 (Output_data_got::add_local_plt): Likewise.
784 (Output_data_got::add_local_with_rel): Change object to Relobj*,
785 change rel_dyn to Output_data_reloc_generic*. Use
787 (Output_data_got::add_local_with_rela): Remove. Change all
788 callers to use all_local_with_rel.
789 (Output_data_got::add_local_pair_with_rel): Change object to
790 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
791 add_output_section_generic.
792 (Output_data_got::add_local_pair_with_rela): Remove. Change all
793 callers to use add_local_pair_with_rel.
794 (Output_data_got::reserve_local): Change object to Relobj*.
795 * output.h: (class Output_data_reloc_generic): Add pure virtual
796 declarations for add_global_generic, add_local_generic,
797 add_output_section_generic.
798 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
799 functions for Output_data_reloc_generic. Update declarations for
800 changes listed in output.cc.
801 (class Output_data_got): Change template parameter to got_size.
802 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
803 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
805 (Sized_relobj_incr::do_local_plt_offset): New function.
806 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
809 2011-12-17 Cary Coutant <ccoutant@google.com>
811 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
812 * resolve.cc (Symbol_table::resolve): Likewise.
813 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
815 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
817 2011-12-16 Ian Lance Taylor <iant@google.com>
819 * output.h (Output_data_reloc_generic::add): Only call
820 add_dynamic_reloc if this is a dynamic reloc section.
822 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
825 * target-reloc.h (apply_relocation): Replace <64, false> with
828 2011-11-25 Nick Clifton <nickc@redhat.com>
830 * po/it.po: New Italian translation.
832 2011-11-17 Sterling Augustine <saugustine@google.com>
834 * script.cc (script_include_directive): Implement.
835 (read_script_file): New local variables name and search_path. Update
836 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
837 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
838 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
840 2011-11-11 Sterling Augustine <saugustine@google.com>
842 * yyscript.y (section_cmd): Add support for INCLUDE directive.
843 (file_or_sections_cmd): Likewise.
845 2011-11-11 Doug Kwan <dougkwan@google.com>
847 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
848 if --just-symbols is given.
850 2011-11-10 Doug Kwan <dougkwan@google.com>
853 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
854 when processing data relocs.
855 * reloc.h (Relocate_functions::rel_unaligned): New method.
856 (Relocate_functions::pcrel_unaligned): Ditto.
857 (Relocate_functions::rel32_unaligned): Ditto.
858 (Relocate_functions::pcrel32_unaligned): Ditto.
860 2011-11-09 Doug Kwan <dougkwan@google.com>
863 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
864 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
865 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
866 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
867 (Relocate_functions::rel_unaligned): New.
868 (Relocate_functions::rel32_unaligned): New.
869 * target-reloc.h (relocate_for_relocatable): Add code to handle
870 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
871 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
872 arm_unaligned_reloc_r): New targets.
873 * testsuite/Makefile.in: Regenerate.
874 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
877 2011-11-02 Ian Lance Taylor <iant@google.com>
879 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
881 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
882 * options.cc (General_options::finalize): Use library search path
883 from configure script if specified. If not native and no sysroot,
884 only search TOOLLIBDIR.
885 * options.h (Search_directory::Search_directory): Change name to
887 (General_options::add_to_library_path_with_sysroot): Change arg to
889 * configure, Makefile.in, config.in: Rebuild.
891 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
893 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
894 we are working around the ARM1176 Erratum.
895 * options.h (General_options::fix_arm1176): Add option.
896 * testsuite/Makefile.am: Add testcases, and keep current ones
898 * testsuite/Makefile.in: Regenerate.
899 * testsuite/arm_fix_1176.s: New file.
900 * testsuite/arm_fix_1176.sh: Likewise.
902 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
904 * arm.cc (Target_arm::Target_arm): Remove initialisation of
906 (Target_arm::may_use_blx): Remove method.
907 (Target_arm::set_may_use_blx): Likewise.
908 (Target_arm::may_use_v4t_interworking): New method.
909 (Target_arm::may_use_v5t_interworking): Likewise.
910 (Target_arm::may_use_blx_): Remove member variable.
911 (Arm_relocate_functions::arm_branch_common): Check for v5T
913 (Arm_relocate_functions::thumb_branch_common): Likewise.
914 (Reloc_stub::stub_type_for_reloc): Likewise.
915 (Target_arm::do_finalize_sections): Correct interworking checks.
916 * testsuite/Makefile.am: Add new tests.
917 * testsuite/Makefile.in: Regenerate.
918 * testsuite/arm_farcall_arm_arm.s: New test.
919 * testsuite/arm_farcall_arm_arm.sh: Likewise.
920 * testsuite/arm_farcall_arm_thumb.s: Likewise.
921 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
922 * testsuite/arm_farcall_thumb_arm.s: Likewise.
923 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
924 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
925 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
927 2011-10-31 Cary Coutant <ccoutant@google.com>
930 * expression.cc (Expression::eval_with_dot): Add
931 is_section_dot_assignment parameter.
932 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
933 absolute and assigning to dot within a section.
935 (Output_section_element_assignment::set_section_addresses): Pass
936 dot_section to set_if_absolute.
937 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
938 as is_section_dot_assignment flag to eval_with_dot.
939 (Output_section_element_dot_assignment::set_section_addresses):
941 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
942 parameter. Also set value if relative to dot_section; set the
943 symbol's output_section.
944 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
945 parameter. Adjust all callers.
946 (Expression::eval_maybe_dot): Likewise.
947 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
949 * testsuite/script_test_2.t: Test assignment of an absolute value
950 to dot within an output section element.
952 2011-10-31 Cary Coutant <ccoutant@google.com>
954 * options.h (class General_options): Add --[no-]gnu-unique options.
955 * symtab.cc (Symbol_table::sized_write_globals): Convert
956 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
958 2011-10-31 Cary Coutant <ccoutant@google.com>
961 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
962 unnecessary assertion.
963 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
965 2011-10-31 Sriraman Tallam <tmsriram@google.com>
967 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
969 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
971 Change to just keep the section associated with symbol.
972 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
973 they are externally visible and --export-dynamic is turned on.
974 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
976 2011-10-19 Ian Lance Taylor <iant@google.com>
980 (Output_section_element_dot_assignment::needs_output_section): New
983 2011-10-19 Ian Lance Taylor <iant@google.com>
986 * layout.cc (Layout::segment_precedes): Don't assert failure if a
987 --section-start option was seen.
988 * options.h (General_options::any_section_start): New function.
990 2011-10-18 David S. Miller <davem@davemloft.net>
993 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
994 member to track relocation locations that have moved during TLS
996 (Target_sparc::Relocate::Relocate): Initialize to NULL.
997 (Target_sparc::Relocate::relocate): Adjust view down by 4
998 bytes if it matches reloc_adjust_addr_.
999 (Target_sparc::Relocate::relocate_tls): Always move the
1000 __tls_get_addr call delay slot instruction forward 4 bytes when
1001 performing relaxation.
1003 2011-10-18 Cary Coutant <ccoutant@google.com>
1005 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1006 (Output_file::map_no_anonymous): Check for non-zero
1007 return code from posix_fallocate.
1009 2011-10-17 Cary Coutant <ccoutant@google.com>
1012 * plugin.cc (is_visible_from_outside): Check for symbols
1013 referenced from dynamic objects.
1014 * resolve.cc (Symbol_table::resolve): Don't count references
1015 from dynamic objects as references from real ELF files.
1016 * testsuite/plugin_test_2.sh: Adjust expected result.
1018 2011-10-17 Cary Coutant <ccoutant@google.com>
1020 * gold.cc: Include timer.h.
1021 (queue_middle_tasks): Stamp time.
1022 (queue_final_tasks): Likewise.
1023 * main.cc (main): Store timer in parameters. Print timers
1025 * parameters.cc (Parameters::Parameters): Initialize timer_.
1026 (Parameters::set_timer): New function.
1027 (set_parameters_timer): New function.
1028 * parameters.h (Parameters::set_timer): New function.
1029 (Parameters::timer): New function.
1030 (Parameters::timer_): New data member.
1031 (set_parameters_timer): New function.
1032 * timer.cc (Timer::stamp): New function.
1033 (Timer::get_pass_time): New function.
1034 * timer.h (Timer::stamp): New function.
1035 (Timer::get_pass_time): New function.
1036 (Timer::pass_times_): New data member.
1038 2011-10-17 Cary Coutant <ccoutant@google.com>
1040 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1041 task for members of lib groups.
1043 2011-10-17 Cary Coutant <ccoutant@google.com>
1046 * fileread.cc (File_read::find_view): Add assert.
1047 (File_read::make_view): Move bounds check (replace with assert)...
1048 (File_read::find_or_make_view): ... to here.
1050 2011-10-12 Cary Coutant <ccoutant@google.com>
1052 * output.cc (Output_file::open_base_file): Handle case where
1053 ::read returns less than requested size.
1055 2011-10-10 Cary Coutant <ccoutant@google.com>
1057 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1058 Initialize defined_count_.
1059 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1060 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1061 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1062 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1063 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1064 * incremental.h (Sized_relobj_incr::defined_count_): New data
1066 (Sized_incr_dynobj::defined_count_): New data member.
1067 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1068 Return zeroes instead of internal error.
1070 2011-10-10 Cary Coutant <ccoutant@google.com>
1073 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1074 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1075 * output.h (class Output_reloc): Add use_plt_offset flag.
1076 (Output_reloc::type_): Adjust size of bit field.
1077 (Output_reloc::use_plt_offset_): New bit field.
1078 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1079 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1080 flag. Adjust all callers.
1081 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1082 creating RELATIVE relocations.
1084 2011-10-10 Nick Clifton <nickc@redhat.com>
1086 * po/es.po: Updated Spanish translation.
1087 * po/fi.po: Updated Finnish translation.
1089 2011-10-03 Diego Novillo <dnovillo@google.com>
1091 * options.cc (parse_uint): Fix dereference of RETVAL.
1093 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1095 * layout.h (section_order_map_): New member.
1096 (get_section_order_map): New member function.
1097 * output.cc (Output_section::add_input_section): Check for patterns
1098 only when --section-ordering-file is specified.
1099 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1100 output_sections have been formed.
1101 * layout.cc (Layout_Layout): Initialize section_order_map_.
1102 * plugin.cc (update_section_order): Store order in order_map. Do not
1104 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1105 * testsuite/Makefile.in: Regenerate.
1106 * testsuite/plugin_section_order.c: New file.
1107 * testsuite/plugin_final_layout.cc: New file.
1108 * testsuite/plugin_final_layout.sh: New file.
1110 2011-09-29 Cary Coutant <ccoutant@google.com>
1112 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1114 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1115 symbols during incremental update.
1116 (Symbol_table::add_from_dynobj): Likewise.
1118 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1119 Ian Lance Taylor <iant@google.com>
1121 * symtab.cc (Symbol_table::define_special_symbol): Always
1122 canonicalize version string.
1124 2011-09-26 Cary Coutant <ccoutant@google.com>
1126 * gold.cc (queue_initial_tasks): Move option checks ...
1127 * options.cc (General_options::finalize): ... to here. Disable
1128 some options; make others fatal.
1130 2011-09-26 Cary Coutant <ccoutant@google.com>
1133 * plugin.cc (get_symbols_v2): New function.
1134 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1135 (is_referenced_from_outside): New function.
1136 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1137 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1138 (get_symbols): Pass version parameter.
1139 (get_symbols_v2): New function.
1140 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1142 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1143 (onload): Add LDPT_GET_SYMBOLS_V2.
1144 (all_symbols_read_hook): Use get_symbols_v2; check for
1145 LDPR_PREVAILING_DEF_IRONLY_EXP.
1146 * testsuite/plugin_test_3.sh: Update expected results.
1148 2011-09-23 Simon Baldwin <simonb@google.com>
1150 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1151 configuration options.
1152 * configure: Regenerate.
1153 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1154 * Makefile.in: Regenerate.
1155 * testsuite/Makefile.in: Regenerate.
1157 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1159 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1161 2011-09-19 Cary Coutant <ccoutant@google.com>
1163 * incremental.cc (can_incremental_update): Fix typo in comment.
1164 * incremental.h (can_incremental_update): Likewise.
1166 2011-09-18 Cary Coutant <ccoutant@google.com>
1168 * incremental.cc (can_incremental_update): New function.
1169 * incremental.h (can_incremental_update): New function.
1170 * layout.cc (Layout::init_fixed_output_section): Call it.
1171 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1172 * object.cc (Sized_relobj_file::do_layout): Call
1173 can_incremental_update.
1175 2011-09-13 Cary Coutant <ccoutant@google.com>
1177 * configure.ac: Check for glibc support for gnu_indirect_function
1178 support with static linking, setting automake conditional
1180 * Makefile.in: Regenerate.
1181 * configure: Regenerate.
1183 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1184 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1186 * testsuite/Makefile.in: Regenerate.
1188 2011-09-13 Cary Coutant <ccoutant@google.com>
1190 * incremental.cc (Sized_relobj_incr::do_layout): Call
1191 report_comdat_group for kept comdat sections.
1192 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1193 * testsuite/Makefile.in: Regenerate.
1194 * testsuite/incr_comdat_test_1.cc: New source file.
1195 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1196 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1197 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1199 2011-09-13 Ian Lance Taylor <iant@google.com>
1201 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1202 variable external_symbols_offset.
1204 2011-09-12 Ian Lance Taylor <iant@google.com>
1206 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1207 triggered if object has no symbols.
1209 2011-09-09 David S. Miller <davem@davemloft.net>
1211 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1212 (Output_fill_debug_line::do_write): Likewise.
1214 2011-08-29 Cary Coutant <ccoutant@google.com>
1216 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1217 casts to match formatting specs.
1218 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1220 2011-08-26 Cary Coutant <ccoutant@google.com>
1222 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1223 remaining hole size when allocating.
1224 (Layout::make_output_section): Set fill methods for debug sections.
1225 * layout.h (Free_list::Free_list_node): Move from private to
1227 (Free_list::set_min_hole_size): New function.
1228 (Free_list::begin, Free_list::end): New functions.
1229 (Free_list::min_hole_): New data member.
1230 * output.cc: Include dwarf.h.
1231 (Output_fill_debug_info::do_minimum_hole_size): New function.
1232 (Output_fill_debug_info::do_write): New function.
1233 (Output_fill_debug_line::do_minimum_hole_size): New function.
1234 (Output_fill_debug_line::do_write): New function.
1235 (Output_section::Output_section): Initialize new data member.
1236 (Output_section::set_final_data_size): Ensure patch space is larger
1237 than minimum hole size.
1238 (Output_section::do_write): Fill holes in debug sections.
1239 * output.h (Output_fill): New class.
1240 (Output_fill_debug_info): New class.
1241 (Output_fill_debug_line): New class.
1242 (Output_section::set_free_space_fill): New function.
1243 (Output_section::free_space_fill_): New data member.
1244 * testsuite/Makefile.am (incremental_test_3): Add
1245 --incremental-patch option.
1246 (incremental_test_4): Likewise.
1247 (incremental_test_5): Likewise.
1248 (incremental_test_6): Likewise.
1249 (incremental_copy_test): Likewise.
1250 (incremental_common_test_1): Likewise.
1251 * testsuite/Makefile.in: Regenerate.
1253 2011-08-26 Nick Clifton <nickc@redhat.com>
1255 * po/es.po: Updated Spanish translation.
1257 2011-08-01 Cary Coutant <ccoutant@google.com>
1259 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1260 * gold/testsuite/Makefile.in: Regenerate.
1261 * gold/testsuite/justsyms_exec.c: New source file.
1262 * gold/testsuite/justsyms_lib.c: New source file.
1264 2011-08-01 Cary Coutant <ccoutant@google.com>
1266 * layout.cc (Layout::set_segment_offsets): Don't realign text
1267 segment if -Ttext was specified.
1268 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1270 * object.h (Sized_relobj_file::e_type): New function.
1271 (Sized_relobj_file::e_type_): New data member.
1272 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1273 base address for ET_EXEC files.
1274 * target.cc (Target::do_make_elf_object_implementation): Allow
1275 ET_EXEC files with --just-symbols option.
1277 2011-07-28 Cary Coutant <ccoutant@google.com>
1279 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1280 Add thread_number parameter.
1281 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1282 * workqueue-threads.cc
1283 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1284 current thread if its thread number is greater than desired thread
1286 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1287 Add thread_number parameter.
1288 (Workqueue::should_cancel_thread): Likewise.
1289 (Workqueue::find_runnable_or_wait): Pass thread_number to
1290 should_cancel_thread.
1291 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1294 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1296 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1297 only after checking if it cannot be forced local.
1298 * symtab.h (is_externally_visible): Check if the symbol is not forced
1301 2011-07-15 Ian Lance Taylor <iant@google.com>
1303 * options.h (class General_options): Add --print-output-format.
1304 Move -EL next to -EB, for better --help output.
1305 * target-select.cc: Include <cstdio>, "options.h", and
1307 (Target_selector::do_target_bfd_name): New function.
1308 (print_output_format): New function.
1309 * target-select.h (class Target_selector): Update declarations.
1310 (Target_selector::target_bfd_name): New function.
1311 (print_output_format): Declare.
1312 * main.cc: Include "target-select.h".
1313 (main): Handle --print-output-format.
1314 * gold.cc: Include "target-select.h".
1315 (queue_initial_tasks): Handle --print-output-format when there are
1317 * parameters.cc (parameters_force_valid_target): Give a better
1318 error message if -EB/-EL does not match target.
1319 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1322 2011-07-15 Ian Lance Taylor <iant@google.com>
1324 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1325 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1326 (Output_data_plt_i386::do_write): Write address of .dynamic
1327 section to first entry in .got.plt section.
1328 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1329 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1331 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1332 section to first entry in .got.plt section.
1333 * layout.h (Layout::dynamic_section): New function.
1335 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1337 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1339 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1340 input_section_position_, and input_section_glob_.
1341 (read_layout_from_file): Call function section_ordering_specified.
1342 * layout.h (is_section_ordering_specified): New function.
1343 (section_ordering_specified): New function.
1344 (section_ordering_specified_): New boolean member.
1345 * main.cc(main): Call load_plugins after layout object is defined.
1346 * output.cc (Output_section::add_input_section): Use
1347 function section_ordering_specified to check if section ordering is
1349 * output.cc (Output_section::add_relaxed_input_section): Use
1350 function section_ordering_specified to check if section ordering is
1352 (Output_section::update_section_layout): New function.
1353 (Output_section::sort_attached_input_sections): Check if input section
1355 * output.h (Output_section::update_section_layout): New function.
1356 * plugin.cc (get_section_count): New function.
1357 (get_section_type): New function.
1358 (get_section_name): New function.
1359 (get_section_contents): New function.
1360 (update_section_order): New function.
1361 (allow_section_ordering): New function.
1362 (Plugin::load): Add the new interfaces to the transfer vector.
1363 (Plugin_manager::load_plugins): New parameter.
1364 (Plugin_manager::all_symbols_read): New parameter.
1365 (Plugin_manager::claim_file): New parameter. Save the elf object for
1367 (Plugin_manager::get_elf_object): New function.
1368 (Plugin_manager::get_view): Change to directly use the bool to check
1369 if get_view is called from claim_file_hook.
1370 * plugin.h (input_objects): New function
1371 (Plugin__manager::load_plugins): New parameter.
1372 (Plugin_manager::claim_file): New parameter.
1373 (Plugin_manager::get_elf_object): New function.
1374 (Plugin_manager::in_claim_file_handler): New function.
1375 (Plugin_manager::in_claim_file_handler_): New member.
1376 (layout): New function.
1377 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1378 handler with an extra parameter. Make the elf object before calling
1380 * testsuite/plugin_test.c (get_section_count): New function pointer.
1381 (get_section_type): New function pointer.
1382 (get_section_name): New function pointer.
1383 (get_section_contents): New function pointer.
1384 (update_section_order): New function pointer.
1385 (allow_section_ordering): New function pointer.
1386 (onload): Check if the new interfaces exist.
1388 2011-07-13 Ian Lance Taylor <iant@google.com>
1390 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1392 * x86_64.cc (Target_x86_64::got_section): Likewise.
1393 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1394 (relro_now_test_SOURCES): New variable.
1395 (relro_now_test_DEPENDENCIES): New variable.
1396 (relro_now_test_LDFLAGS): New variable.
1397 (relro_now_test_LDADD): New variable.
1398 (relro_now_test.so): New target.
1399 * testsuite/Makefile.in: Rebuild.
1401 2011-07-12 Ian Lance Taylor <iant@google.com>
1404 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1405 GLOB_DAT relocation rather than a RELATIVE relocation for a
1406 protected symbol when creating a shared library.
1407 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1408 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1409 * testsuite/protected_main_1.cc (main): Test that protected
1410 function has same address.
1412 2011-07-11 Ian Lance Taylor <iant@google.com>
1415 * options.h (class General_options): Add -Bgroup.
1416 * options.cc (General_options::finalize): If -Bgroup is set,
1417 default to --unresolved-symbols=report-all.
1418 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1419 * target-reloc.h (issue_undefined_symbol_error): Handle
1420 --unresolved-symbols=report-all.
1422 2011-07-08 Ian Lance Taylor <iant@google.com>
1425 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1426 if linker script discards key sections.
1427 (Layout::create_dynamic_symtab): Likewise.
1428 (Layout::assign_local_dynsym_offsets): Likewise.
1429 (Layout::sized_create_version_sections): Likewise.
1430 (Layout::create_interp): Likewise.
1431 (Layout::finish_dynamic_section): Likewise.
1432 (Layout::set_dynamic_symbol_size): Likewise.
1434 2011-07-08 Ian Lance Taylor <iant@google.com>
1437 * options.h (class General_options): Add --unresolved-symbols.
1438 * target-reloc.h (issue_undefined_symbol_error): Check
1439 --unresolved-symbols. Add comments.
1441 2011-07-08 Ian Lance Taylor <iant@google.com>
1443 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1444 expression more complex.
1446 2011-07-08 Ian Lance Taylor <iant@google.com>
1449 * target-reloc.h (issue_undefined_symbol_error): New inline
1450 function, broken out of relocate_section.
1451 (relocate_section): Call issue_undefined_symbol_error.
1452 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1453 there is no TLS segment if we are about to issue an undefined
1455 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1457 2011-07-08 Ian Lance Taylor <iant@google.com>
1460 * resolve.cc (Symbol_table::should_override): Add fromtype
1461 parameter. Change all callers. Give error when linking together
1462 TLS and non-TLS symbol.
1463 (Symbol_table::should_override_with_special): Add fromtype
1464 parameter. Change all callers.
1465 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1466 there is no TLS segment if we have reported some errors.
1467 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1469 2011-07-08 Ian Lance Taylor <iant@google.com>
1472 * target.h (Target::plt_address_for_global): New function.
1473 (Target::plt_address_for_local): New function.
1474 (Target::plt_section_for_global): Remove.
1475 (Target::plt_section_for_local): Remove.
1476 (Target::do_plt_address_for_global): New virtual function.
1477 (Target::do_plt_address_for_local): New virtual function.
1478 (Target::do_plt_section_for_global): Remove.
1479 (Target::do_plt_section_for_local): Remove.
1480 (Target::register_global_plt_entry): Add Symbol_table and Layout
1482 * output.cc (Output_data_got::Got_entry::write): Use
1483 plt_address_for_global and plt_address_for_local.
1484 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1485 address of output section.
1486 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1487 got_irelative_, and irelative_count_ fields. Update
1489 (Output_data_plt_i386::has_irelative_section): New function.
1490 (Output_data_plt_i386::entry_count): Add irelative_count_.
1491 (Output_data_plt_i386::set_final_data_size): Likewise.
1492 (class Target_i386): Add got_irelative_ and rel_irelative_
1493 fields. Update declarations.
1494 (Target_i386::Target_i386): Initialize new fields.
1495 (Target_i386::do_plt_address_for_global): New function replacing
1496 do_plt_section_for_global.
1497 (Target_i386::do_plt_address_for_local): New function replacing
1498 do_plt_section_for_local.
1499 (Target_i386::got_section): Create got_irelative_.
1500 (Target_i386::rel_irelative_section): New function.
1501 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1502 fields. Don't define __rel_iplt_{start,end}.
1503 (Output_data_plt_i386::add_entry): Add symtab and layout
1504 parameters. Change all callers. Use different PLT and GOT for
1506 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1507 layout parameters. Change all callers. Use different PLT and
1509 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1510 (Output_data_plt_i386::rel_irelative): New function.
1511 (Output_data_plt_i386::address_for_global): New function.
1512 (Output_data_plt_i386::address_for_local): New function.
1513 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1514 IRELATIVE GOT when changing IFUNC GOT entries.
1515 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1517 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1518 if we didn't create an IRELATIVE GOT.
1519 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1520 plt_address_for_local.
1521 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1522 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1523 got_irelative_, and irelative_count_ fields. Update
1525 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1526 Initialize new fields. Remove symtab parameter. Change all
1528 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1530 (Output_data_plt_x86_64::has_irelative_section): New function.
1531 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1532 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1533 fields. Update declarations.
1534 (Target_x86_64::Target_x86_64): Initialize new fields.
1535 (Target_x86_64::do_plt_address_for_global): New function replacing
1536 do_plt_section_for_global.
1537 (Target_x86_64::do_plt_address_for_local): New function replacing
1538 do_plt_section_for_local.
1539 (Target_x86_64::got_section): Create got_irelative_.
1540 (Target_x86_64::rela_irelative_section): New function.
1541 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1542 all callers. Don't create __rel_iplt_{start,end}.
1543 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1544 parameters. Change all callers. Use different PLT and GOT for
1546 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1547 layout parameters. Change all callers. Use different PLT and
1549 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1550 parameters. Change all callers. Use different PLT and GOT for
1552 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1553 (Output_data_plt_x86_64::rela_irelative): New function.
1554 (Output_data_plt_x86_64::address_for_global): New function.
1555 (Output_data_plt_x86_64::address_for_local): New function.
1556 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1557 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1558 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1559 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1561 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1563 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1564 symbols if we didn't create an IRELATIVE GOT.
1565 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1566 plt_address_for_local.
1567 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1568 * testsuite/ifuncvar1.c: New test file.
1569 * testsuite/ifuncvar2.c: New test file.
1570 * testsuite/ifuncvar3.c: New test file.
1571 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1572 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1573 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1574 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1575 * testsuite/Makefile.in: Rebuild.
1577 2011-07-07 Cary Coutant <ccoutant@google.com>
1579 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1580 (two_file_test_1_ndebug.o): Likewise.
1581 (two_file_test_1b_ndebug.o): Likewise.
1582 (two_file_test_2_ndebug.o): Likewise.
1583 (two_file_test_main_ndebug.o): Likewise.
1584 (incremental_test_2): Link with no-debug versions.
1586 2011-07-06 Cary Coutant <ccoutant@google.com>
1588 * gold/incremental.cc
1589 (Output_section_incremental_inputs::write_info_blocks): Check for
1590 hidden and internal symbols.
1592 2011-07-06 Cary Coutant <ccoutant@google.com>
1594 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1595 Check disposition for startup file.
1596 (Incremental_inputs::report_command_line): Ignore
1597 --incremental-startup-unchanged option.
1598 * options.cc (General_options::parse_incremental_startup_unchanged):
1600 (General_options::General_options): Initialize new data member.
1601 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1602 (General_options): Add --incremental-startup-unchanged option.
1603 (General_options::incremental_startup_disposition): New function.
1604 (General_options::incremental_startup_disposition_): New data member.
1606 2011-07-06 Cary Coutant <ccoutant@google.com>
1608 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1609 input file index to Script_info ctor.
1610 (Sized_incremental_binary::do_file_has_changed): Find the
1611 command-line argument for files named in scripts.
1612 * incremental.h (Script_info::Script_info): New ctor
1613 with input file index.
1614 (Script_info::input_file_index): New function.
1615 (Script_info::input_file_index_): New data member.
1616 (Incremental_binary::get_library): Add const.
1617 (Incremental_binary::get_script_info): Add const.
1618 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1619 * testsuite/Makefile.am (incremental_test_5): New test case.
1620 (incremental_test_6): New test case.
1621 * testsuite/Makefile.in: Regenerate.
1623 2011-07-06 Cary Coutant <ccoutant@google.com>
1625 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1626 debug output when command lines differ.
1628 2011-07-06 Cary Coutant <ccoutant@google.com>
1630 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1631 --incremental-patch option.
1632 * layout.cc (Free_list::allocate): Extend allocation beyond original
1634 (Layout::make_output_section): Mark sections that should get
1636 * options.cc (parse_percent): New function.
1637 * options.h (parse_percent): New function.
1638 (DEFINE_percent): New macro.
1639 (General_options): Add --incremental-patch option.
1640 * output.cc (Output_section::Output_section): Initialize new data
1642 (Output_section::add_input_section): Print section name when out
1644 (Output_section::add_output_section_data): Likewise.
1645 (Output_section::set_final_data_size): Add patch space when
1646 doing --incremental-full.
1647 (Output_section::do_reset_address_and_file_offset): Remove patch
1649 (Output_segment::set_section_list_addresses): Print debug output
1650 only if --incremental-update.
1651 * output.h (Output_section::set_is_patch_space_allowed): New function.
1652 (Output_section::is_patch_space_allowed_): New data member.
1653 (Output_section::patch_space_): New data member.
1654 * parameters.cc (Parameters::incremental_full): New function.
1655 * parameters.h (Parameters::incremental_full): New function
1656 * testsuite/Makefile.am (incremental_test_2): Add test for
1657 --incremental-patch option.
1658 * testsuite/Makefile.in: Regenerate.
1659 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1660 (t18): Remove function body.
1662 2011-07-05 Doug Kwan <dougkwan@google.com>
1665 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1666 Arm_Address type for relocation result.
1667 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1669 (Arm_relocate_functions::abs32): Use unaligned access.
1670 (Arm_relocate_functions::rel32): Ditto.
1671 (Arm_relocate_functions::prel31): Ditto.
1672 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1673 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1674 static data relocations.
1675 * testsuite/Makefile.in: Regnerate.
1676 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1678 2011-07-05 Ian Lance Taylor <iant@google.com>
1681 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1682 symbols if necessary.
1683 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1685 2011-07-05 Ian Lance Taylor <iant@google.com>
1688 * resolve.cc (Symbol::override_base_with_special): Simply override
1689 version with special symbol version, ignoring previous version.
1691 2011-07-05 Ian Lance Taylor <iant@google.com>
1693 * object.cc (Sized_relobj_file::include_section_group): Add
1694 information to comment about signature location.
1696 2011-07-02 Ian Lance Taylor <iant@google.com>
1699 * options.h (class General_options): Add -f and -F.
1700 * options.cc (General_options::finalize): Fatal error if -f/-F
1701 are used without -shared.
1702 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1704 2011-07-02 Ian Lance Taylor <iant@google.com>
1706 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1708 2011-07-01 Ian Lance Taylor <iant@google.com>
1712 * resolve.cc (Symbol::override_base_with_special): Don't override
1713 the version if the overriding symbol has a different name.
1714 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1715 all callers. If we give an error about an undefined version,
1716 define the base version if necessary.
1717 * dynobj.h (class Versions): Update declaration.
1718 * testsuite/weak_alias_test_5.cc: New file.
1719 * testsuite/weak_alias_test.script: New file.
1720 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1721 and versioned_alias have the right value, and call t2.
1722 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1723 weak_alias_test_5.so.
1724 (weak_alias_test_LDADD): Likewise.
1725 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1726 * testsuite/Makefile.in: Rebuild.
1728 2011-07-01 Ian Lance Taylor <iant@google.com>
1731 * options.h (class General_options): Support -z notext.
1732 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1734 (two_file_shared_nonpic.so): Likewise.
1735 (two_file_shared_mixed.so): Likewise.
1736 (two_file_shared_mixed_1.so): Likewise.
1737 (weak_undef_lib_nonpic.so): Likewise.
1738 (alt/weak_undef_lib_nonpic.so): Likewise.
1739 (tls_test_shared_nonpic.so): Likewise.
1740 * testsuite/Makefile.in: Rebuild.
1742 2011-07-01 Ian Lance Taylor <iant@google.com>
1745 * configure.ac: Test whether static linking works, setting
1746 the automake conditional HAVE_STATIC.
1747 * testsuite/Makefile.am: Disable tests using -static if
1748 HAVE_STATIC is not true.
1749 * configure, testsuite/Makefile.in: Rebuild.
1751 2011-07-01 Ian Lance Taylor <iant@google.com>
1754 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1755 Assert if we see DW_EH_PE_indirect.
1756 * target.h (Target::ehframe_datarel_base): New function.
1757 (Target::do_ehframe_datarel_base): New target function.
1758 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1759 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1762 2011-07-01 Ian Lance Taylor <iant@google.com>
1765 * options.h (class General_options): Add
1766 --ld-generated-unwind-info.
1767 * ehframe.cc (Fde::write): Add address parameter. Change all
1768 callers. If associated with PLT, fill in address and size.
1769 (Cie::set_output_offset): Only add merge mapping if there is an
1771 (Cie::write): Add address parameter. Change all callers.
1772 (Eh_frame::add_ehframe_for_plt): New function.
1773 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1774 input_offset_ fields into union u_, with new plt field.
1775 (Fde::Fde): Adjust for new union field.
1776 (Fde::Fde) [Output_data version]: New constructor.
1777 (Fde::add_mapping): Only add merge mapping if there is an object.
1778 (class Cie): Update declarations.
1779 (class Eh_frame): Declare add_ehframe_for_plt.
1780 * layout.cc (Layout::layout_eh_frame): Break out code into
1781 make_eh_frame_section, and call it.
1782 (Layout::make_eh_frame_section): New function.
1783 (Layout::add_eh_frame_for_plt): New function.
1784 * layout.h (class Layout): Update declarations.
1785 * merge.cc (Merge_map::add_mapping): Add assertion.
1786 * i386.cc: Include "dwarf.h".
1787 (class Output_data_plt_i386): Make first_plt_entry,
1788 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1789 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1790 and plt_eh_frame_fde.
1791 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1792 boundary. Call add_eh_frame_for_plt if appropriate.
1793 * x86_64.cc: Include "dwarf.h".
1794 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1795 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1796 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1797 and plt_eh_frame_fde.
1798 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1801 2011-06-29 Ian Lance Taylor <iant@google.com>
1804 * object.cc (Sized_relobj_file::layout_section): Change shdr
1805 parameter to be const.
1806 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1808 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1809 appropriate. Call layout_eh_frame_section.
1810 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1812 * object.h (class Sized_relobj_file): Update declarations.
1814 2011-06-29 Ian Lance Taylor <iant@google.com>
1817 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1819 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1821 2011-06-29 Ian Lance Taylor <iant@google.com>
1824 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1826 * layout.cc (Layout::layout_eh_frame): Likewise.
1828 2011-06-29 Ian Lance Taylor <iant@google.com>
1831 * layout.cc (Layout::symtab_section_shndx): New function.
1832 * layout.h (class Layout): Declare symtab_section_shndx.
1833 * output.cc (Output_section::write_header): Call it.
1835 2011-06-29 Ian Lance Taylor <iant@google.com>
1838 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1839 symbols which are not used in a relocation.
1841 2011-06-28 Ian Lance Taylor <iant@google.com>
1844 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1845 script create indistinguishable segments.
1846 (Layout::set_segment_offsets): Use stable_sort when sorting
1847 segments. Pass this to Compare_segments constructor.
1848 * layout.h (class Layout): Make segment_precedes non-static.
1849 (class Compare_segments): Change from struct to class. Add
1850 layout_ field. Add constructor.
1851 * script-sections.cc
1852 (Script_sections::attach_sections_using_phdrs_clause): Rename
1853 local orphan to is_orphan. Don't report failure to put empty
1854 section in segment. On attachment failure, report name of
1855 section, and attach to first PT_LOAD segment.
1857 2011-06-28 Ian Lance Taylor <iant@google.com>
1860 * target-select.cc (Target_selector::Target_selector): Add
1861 emulation parameter. Change all callers.
1862 (select_target_by_bfd_name): Rename from select_target_by_name.
1864 (select_target_by_emulation): New function.
1865 (supported_emulation_names): New function.
1866 * target-select.h (class Target_selector): Add emulation_ field.
1867 Update declarations.
1868 (Target_selector::recognize_by_bfd_name): Rename from
1869 recognize_by_name. Change all callers.
1870 (Target_selector::supported_bfd_names): Rename from
1871 supported_names. Change all callers.
1872 (Target_selector::recognize_by_emulation): New function.
1873 (Target_selector::supported_emulations): New function.
1874 (Target_selector::emulation): New function.
1875 (Target_selector::do_recognize_by_bfd_name): Rename from
1876 do_recognize_by_name. Change all callers.
1877 (Target_selector::do_supported_bfd_names): Rename from
1878 do_supported_names. Change all callers.
1879 (Target_selector::do_recognize_by_emulation): New function.
1880 (Target_selector::do_supported_emulations): New function.
1881 (select_target_by_bfd_name): Change name in declaration.
1882 (select_target_by_emulation): Declare.
1883 (supported_emulation_names): Declare.
1884 * parameters.cc (parameters_force_valid_target): Try to find
1885 target based on emulation from -m option.
1886 * options.h (class General_options): Change doc string for -m.
1887 * options.cc (help): Print emulations.
1888 (General_options::parse_V): Likewise.
1889 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1890 Add emulation parameter. Change all callers.
1892 2011-06-28 Ian Lance Taylor <iant@google.com>
1894 * target.h (class Target): Add osabi_ field.
1895 (Target::osabi): New function.
1896 (Target::set_osabi): New function.
1897 (Target::Target): Initialize osabi_.
1898 (Target::do_adjust_elf_header): Make pure virtual.
1899 (Sized_target::do_adjust_elf_header): Declare.
1900 * target.cc (Sized_target::do_adjust_elf_header): New function.
1901 (class Sized_target): Instantiate all versions.
1902 * freebsd.h (class Target_freebsd): Remove.
1903 (Target_selector_freebsd::do_recognize): Call set_osabi on
1905 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1906 (Target_selector_freebsd::set_osabi): Remove.
1907 * i386.cc (class Target_i386): Inherit from Sized_target rather
1908 than Target_freebsd.
1909 * x86_64.cc (class Target_x86_64): Likewise.
1911 2011-06-28 Ian Lance Taylor <iant@google.com>
1913 * target.h (Target::can_check_for_function_pointers): Rewrite.
1915 (Target::can_icf_inline_merge_sections): Likewise.
1916 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1917 (Target::Target_info): Add can_icf_inline_merge_sections field.
1918 (Target::do_can_check_for_function_pointers): New virtual
1920 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1921 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1922 from can_check_for_function_pointers, move in file.
1923 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1924 section_may_have_icf_unsafe_poineters, move in file.
1925 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1926 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1927 Rename from can_check_for_function_pointers, move in file.
1928 (Target_i386::can_icf_inline_merge_sections): Remove.
1929 (Target_i386::i386_info): Initialize
1930 can_icf_inline_merge_sections.
1931 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1932 Initialize can_icf_inline_merge_sections.
1933 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1934 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1935 Rename from can_check_for_function_pointers, move in file.
1936 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1937 (Target_x86_64::x86_64_info): Initialize
1938 can_icf_inline_merge_sections.
1939 * testsuite/testfile.cc (Target_test::test_target_info):
1941 * icf.cc (get_section_contents): Correct formatting.
1943 2011-06-27 Ian Lance Taylor <iant@google.com>
1945 * symtab.cc (Symbol::versioned_name): New function.
1946 (Symbol_table::add_to_final_symtab): Use versioned_name when
1948 (Symbol_table::sized_write_symbol): Likewise.
1949 * symtab.h (class Symbol): Declare versioned_name.
1950 * stringpool.h (class Stringpool_template): Add variant of add
1951 which takes a std::basic_string.
1952 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1953 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1954 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1955 (ver_test_12.o): New target.
1956 * testsuite/Makefile.in: Rebuild.
1958 2011-06-27 Doug Kwan <dougkwan@google.com>
1960 * arm.cc (Arm_relocate_functions::thm_jump8,
1961 Arm_relocate_functions::thm_jump11): Use a wider signed
1962 type to compute offset.
1963 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1965 * testsuite/Makefile.in: Regenerate.
1966 * testsuite/arm_branch_in_range.sh: Check test results of
1967 arm_thm_jump11 and arm_thm_jump8.
1968 * testsuite/arm_thm_jump11.s: New test source file.
1969 * testsuite/arm_thm_jump11.t: New linker script.
1970 * testsuite/arm_thm_jump8.s: New test source file.
1971 * testsuite/arm_thm_jump8.t: New linker script.
1973 2011-06-24 Ian Lance Taylor <iant@google.com>
1975 * layout.cc: Include "object.h".
1976 (ctors_sections_in_init_array): New static variable.
1977 (Layout::is_ctors_in_init_array): New function.
1978 (Layout::layout): Add entry to ctors_sections_in_init_array if
1980 * layout.h (class Layout): Declare is_ctors_in_init_array.
1981 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1982 is_ctors_reverse_view is set.
1983 (Sized_relobj_file::write_sections): Add layout parameter. Change
1984 all callers. Set is_ctors_reverse_view field of View_size.
1985 (Sized_relobj_file::reverse_words): New function.
1986 * object.h (Sized_relobj_file::View_size): Add
1987 is_ctors_reverse_view field.
1988 (class Sized_relobj_file): Update declarations.
1989 * testsuite/initpri3.c: New test.
1990 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1992 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1993 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1994 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1995 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1996 * testsuite/Makefile.in: Rebuild.
1998 2011-06-24 Cary Coutant <ccoutant@google.com>
2000 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2001 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2002 (debug_msg_cdebug.err): New targets.
2003 * testsuite/Makefile.in: Regenerate.
2004 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2005 Fix checks for link with shared library.
2007 2011-06-24 Doug Kwan <dougkwan@google.com>
2009 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2010 skip empty text sections.
2011 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2013 2011-06-22 Ian Lance Taylor <iant@google.com>
2016 * options.h (class General_options): Add --ctors-in-init-array.
2017 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2018 friends as SHT_PROGBITS for merging sections.
2019 (Layout::layout): Remove special handling of .init_array and
2020 friends. Don't sort if doing relocatable link. Sort for .ctors
2021 and .dtors if ctors_in_init_array.
2022 (Layout::make_output_section): Force correct section types for
2023 .init_array and friends. Don't sort if doing relocatable link,
2024 Don't sort .ctors and .dtors if ctors_in_init_array.
2025 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2026 (Layout::output_section_name): Add relobj parameter. Change all
2027 callers. Handle .ctors. and .dtors. in code rather than table.
2028 Handle .ctors and .dtors if ctors_in_init_array.
2029 (Layout::match_file_name): New function, moved from output.cc.
2030 * layout.h (class Layout): Update declarations.
2031 * output.cc: Include "layout.h".
2032 (Input_section_sort_entry::get_priority): New function.
2033 (Input_section_sort_entry::match_file_name): Just call
2034 Layout::match_file_name.
2035 (Output_section::Input_section_sort_init_fini_compare::operator()):
2036 Handle .ctors and .dtors. Sort by explicit priority rather than
2038 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2039 * testsuite/initpri2.c: New test.
2040 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2041 (check_PROGRAMS): Add initpri2.
2042 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2043 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2044 * configure, testsuite/Makefile.in: Rebuild.
2046 2011-06-19 Ian Lance Taylor <iant@google.com>
2049 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2050 .interp section to a PT_INTERP segment even if we have seen a
2051 --dynamic-linker option. Don't do it if we have seen a PHDRS
2052 clause in a linker script.
2053 (Layout::finalize): Don't create a .interp section if we've
2054 already create a PT_INTERP segment.
2055 (Layout::create_interp): Always call choose_output_section (revert
2056 patch of 2011-06-17). Don't create PT_INTERP segment.
2057 * script-sections.cc
2058 (Script_sections::create_note_and_tls_segments): Add a .interp
2059 section to a PT_INTERP segment even if we have seen a
2060 --dynamic-linker option.
2062 2011-06-18 Ian Lance Taylor <iant@google.com>
2064 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2065 merely because a non-PT_LOAD segment has a dynamic reloc.
2067 2011-06-18 Ian Lance Taylor <iant@google.com>
2069 * layout.cc (Layout::finish_dynamic_section): Don't create
2070 DT_FLAGS entry if not needed.
2072 2011-06-18 Ian Lance Taylor <iant@google.com>
2075 * layout.cc (Layout::layout_eh_frame): Correct handling of
2076 writable .eh_frame section.
2078 2011-06-17 Ian Lance Taylor <iant@google.com>
2081 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2082 symbol is redefined with the exact same object and value.
2084 2011-06-17 Ian Lance Taylor <iant@google.com>
2087 * layout.h (class Layout): Add interp_segment_ field.
2088 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2089 (Layout::attach_allocated_section_to_segment): If making shared
2090 library, put .interp section in PT_INTERP segment.
2091 (Layout::finalize): Also call create_interp if -dynamic-linker
2093 (Layout::create_interp): Assert that there is no PT_INTERP
2094 segment. If not using a SECTIONS clause, use make_output_section.
2095 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2096 * script-sections.cc
2097 (Script_sections::create_note_and_tls_segments): If making shared
2098 library, put .interp section in PT_INTERP segment.
2100 2011-06-17 Ian Lance Taylor <iant@google.com>
2102 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2103 when making a shared library.
2105 2011-06-17 Ian Lance Taylor <iant@google.com>
2107 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2108 parameter. Change all callers. Don't issue warning about PC32
2109 against locally defined symbol.
2111 2011-06-16 Ian Lance Taylor <iant@google.com>
2113 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2114 occurs in same object.
2116 2011-06-14 Alan Modra <amodra@gmail.com>
2118 * po/POTFILES.in: Regenerate.
2120 2011-06-09 Ian Lance Taylor <iant@google.com>
2122 * script-sections.cc
2123 (Orphan_output_section::set_section_addresses): For a relocatable
2124 link set address to 0.
2126 2011-06-09 Cary Coutant <ccoutant@google.com>
2129 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2130 used with --compress-debug-sections.
2131 * gold/object.cc (Sized_relobj_file::do_layout): Report
2132 uncompressed size of compressed input sections.
2134 2011-06-08 Cary Coutant <ccoutant@google.com>
2137 * testsuite/two_file_test_2_v1.cc: Change initialization of
2138 v2 to keep it in .data.
2140 2011-06-07 Cary Coutant <ccoutant@google.com>
2142 * common.cc (Symbol_table::do_allocate_commons_list): Call
2144 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2145 (Errors::fallback): New function.
2146 (gold_fallback): New function.
2147 * errors.h (Errors::fallback): New function.
2148 * gold.cc (gold_exit): Change status parameter to enum; adjust
2150 (queue_initial_tasks): Call gold_fallback.
2151 * gold.h: Include cstdlib.
2152 (Exit_status): New enum type.
2153 (gold_exit): Change status parameter to enum.
2154 (gold_fallback): New function.
2155 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2156 (Layout::create_symtab_sections): Likewise.
2157 (Layout::create_shdrs): Likewise.
2158 * main.cc (main): Adjust call to gold_exit.
2159 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2160 (Output_data_got::add_got_entry_pair): Likewise.
2161 (Output_section::add_input_section): Likewise.
2162 (Output_section::add_output_section_data): Likewise.
2163 (Output_segment::set_section_list_addresses): Likewise.
2164 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2166 2011-06-07 Cary Coutant <ccoutant@google.com>
2168 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2169 for incremental links.
2170 * output.cc (Output_segment::set_section_list_addresses): Remove
2171 FIXME and test for TLS or BSS.
2173 2011-06-07 Cary Coutant <ccoutant@google.com>
2175 * testsuite/Makefile.am: Add incremental_copy_test,
2176 incremental_common_test_1.
2177 * testsuite/Makefile.in: Regenerate.
2178 * testsuite/common_test_1_v1.c: New source file.
2179 * testsuite/common_test_1_v2.c: New source file.
2180 * testsuite/copy_test_v1.cc: New source file.
2182 2011-06-07 Cary Coutant <ccoutant@google.com>
2184 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2185 update, allocate common from bss section's free list.
2186 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2187 linker-defined symbols.
2188 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2189 Skip GOT and PLT entries that are no longer referenced.
2190 (Output_section_incremental_inputs::write_info_blocks): Mark
2191 linker-defined symbols.
2192 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2193 * output.cc (Output_section::allocate): New function.
2194 * output.h (Output_section::allocate): New function.
2195 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2196 linker-defined symbols.
2197 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2198 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2199 (Symbol::init_base_output_data): Likewise.
2200 (Symbol::init_base_output_segment): Likewise.
2201 (Symbol::init_base_constant): Likewise.
2202 (Sized_symbol::init_output_data): Likewise.
2203 (Sized_symbol::init_output_segment): Likewise.
2204 (Sized_symbol::init_constant): Likewise.
2205 (Symbol_table::do_define_in_output_data): Likewise.
2206 (Symbol_table::do_define_in_output_segment): Likewise.
2207 (Symbol_table::do_define_as_constant): Likewise.
2208 * symtab.h (Symbol::is_predefined): New function.
2209 (Symbol::init_base_output_data): Add is_predefined parameter.
2210 (Symbol::init_base_output_segment): Likewise.
2211 (Symbol::init_base_constant): Likewise.
2212 (Symbol::is_predefined_): New data member.
2213 (Sized_symbol::init_output_data): Add is_predefined parameter.
2214 (Sized_symbol::init_output_segment): Likewise.
2215 (Sized_symbol::init_constant): Likewise.
2216 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2218 2011-06-07 Cary Coutant <ccoutant@google.com>
2220 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2221 instead of emit_copy_reloc.
2222 (Copy_relocs::emit_copy_reloc): Refactor.
2223 (Copy_relocs::make_copy_reloc): New function.
2224 (Copy_relocs::add_copy_reloc): Remove.
2225 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2227 (Copy_relocs::make_copy_reloc): New function.
2228 (Copy_relocs::add_copy_reloc): Remove.
2229 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2230 unchanged input files.
2231 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2232 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2233 Reserve BSS space for COPY relocations.
2234 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2235 (Output_section_incremental_inputs::write_info_blocks): Record
2236 whether a symbol is copied from a shared object.
2237 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2238 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2239 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2240 (Incremental_input_entry_reader::get_output_symbol_index): Add
2242 (Incremental_binary::emit_copy_relocs): New function.
2243 (Incremental_binary::do_emit_copy_relocs): New function.
2244 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2246 (Sized_incremental_binary::add_copy_reloc): New function.
2247 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2248 (Sized_incremental_binary::Copy_reloc): New struct.
2249 (Sized_incremental_binary::Copy_relocs): New typedef.
2250 (Sized_incremental_binary::copy_relocs_): New data member.
2251 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2252 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2253 * target.h (Sized_target::emit_copy_reloc): New function.
2254 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2256 2011-06-02 Cary Coutant <ccoutant@google.com>
2259 * gold/archive.cc (Archive::Archive): Initialize new data member.
2260 (Archive::include_all_members): Return if archive has already been
2262 * gold/archive.h (Archive::include_all_members_): New data member.
2264 2011-06-02 Nick Clifton <nickc@redhat.com>
2266 * dynobj.h: Fix spelling mistake in comment.
2267 * output.cc: Likewise.
2269 2011-05-31 Doug Kwan <dougkwan@google.com>
2273 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2274 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2275 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2276 redundant arm_exidx_test.so.
2277 * testsuite/Makefile.in: Regenerate.
2278 (check_SCRIPTS): Add pr12826.sh
2279 (check_DATA): Add pr12826.stdout
2280 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2281 * testsuite/pr12826.sh: New file.
2282 * testsuite/pr12826_1.s: Ditto.
2283 * testsuite/pr12826_1.s: Ditto.
2285 2011-05-30 Ian Lance Taylor <iant@google.com>
2287 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2290 2011-05-29 Ian Lance Taylor <iant@google.com>
2293 * testsuite/Makefile.am: Use different file name for two_file_test
2294 temporary file for each incremental test.
2295 * testsuite/Makefile.in: Rebuild.
2297 2011-05-29 Ian Lance Taylor <iant@google.com>
2299 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2300 binary input file is empty.
2302 2011-05-27 Ian Lance Taylor <iant@google.com>
2304 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2305 (ver_test_9.so): Likewise.
2306 * testsuite/Makefile.in: Rebuild.
2308 2011-05-26 Cary Coutant <ccoutant@google.com>
2310 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2311 * incremental.cc (Incremental_inputs::report_input_section): Fix
2312 comment, indentation.
2313 (Incremental_inputs::report_comdat_group): New function.
2314 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2315 of data for incremental input file entry.
2316 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2317 group count, COMDAT group signatures.
2318 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2319 an unchanged input file.
2320 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2321 Initialize new data member.
2322 (Incremental_object_entry::add_comdat_group): New function.
2323 (Incremental_object_entry::get_comdat_group_count): New function.
2324 (Incremental_object_entry::get_comdat_signature_key): New function.
2325 (Incremental_object_entry::groups_): New data member.
2326 (Incremental_inputs::report_comdat_group): New function.
2327 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2328 data for incremental input file entry.
2329 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2330 (Incremental_input_entry_reader::get_input_section): Adjust size of
2331 data for incremental input file entry.
2332 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2333 (Incremental_input_entry_reader::get_comdat_group_signature): New
2335 * object.cc (Sized_relobj::include_section_group): Report kept
2336 COMDAT groups for incremental links.
2338 2011-05-24 David Meyer <pdox@google.com>
2340 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2341 with name parameter. Add found_name parameter.
2342 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2343 * dirsearch.h (class Dirsearch): Update declaration.
2345 2011-05-24 Ian Lance Taylor <iant@google.com>
2347 * archive.cc (Library_base::should_include_member): Pull in object
2348 from archive if it defines the entry symbol.
2349 * parameters.cc (Parameters::entry): New function.
2350 * parameters.h (class Parameters): Declare entry.
2351 * output.h (class Output_file_header): Remove entry_ field.
2352 * output.cc (Output_file_header::Output_file_header): Remove entry
2353 parameter. Change all callers.
2354 (Output_file_header::entry): Use parameters->entry.
2355 * gold.cc (queue_middle_tasks): Likewise.
2356 * plugin.cc (Plugin_hook::run): Likewise.
2358 2011-05-24 Cary Coutant <ccoutant@google.com>
2360 * gold.cc (queue_initial_tasks): Pass incremental base filename
2361 to Output_file::open_base_file; don't print error message.
2362 * incremental-dump.cc (main): Adjust call to
2363 Output_file::open_for_modification.
2364 * incremental-dump.cc (main): Likewise.
2365 * incremental.cc (Incremental_inputs::report_command_line):
2366 Ignore --incremental-base option when comparing command lines.
2367 Ignore parameter when given as separate argument.
2368 * options.h (class General_options): Add --incremental-base.
2369 * output.cc (Output_file::Output_file):
2370 (Output_file::open_base_file): Add base_name and writable parameters;
2371 read base file into new file; print error message here.
2372 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2374 * output.h (Output_file::open_for_modification): Rename to...
2375 (Output_file::open_base_file): ...this; add base_name and
2376 writable parameters; adjust all callers.
2377 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2379 * testsuite/Makefile.am (incremental_test_4): Test
2381 * testsuite/Makefile.in: Regenerate.
2383 2011-05-24 Cary Coutant <ccoutant@google.com>
2385 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2387 * testsuite/Makefile.in: Regenerate.
2388 * testsuite/two_file_test_1_v1.cc: New test source file.
2389 * testsuite/two_file_test_1b_v1.cc: New test source file.
2390 * testsuite/two_file_test_2_v1.cc: New test source file.
2392 2011-05-24 Cary Coutant <ccoutant@google.com>
2394 * dynobj.h (Dynobj::do_dynobj): New function.
2395 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2396 flag and soname for shared objects.
2397 * incremental.cc (Incremental_inputs::report_object): Make
2398 either Incremental_object_entry or Incremental_dynobj_entry; add
2399 soname to string table.
2400 (Incremental_inputs::report_input_section): Add assertion.
2401 (Output_section_incremental_inputs::set_final_data_size): Adjust
2402 type of input file entry for shared libraries; adjust size of
2403 shared library info entry.
2404 (Output_section_incremental_inputs::write_input_files): Write
2405 as_needed flag for shared libraries.
2406 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2407 of input file entry for shared libraries; write soname.
2408 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2409 soname from incremental info.
2410 * incremental.h (enum Incremental_input_flags): Add
2411 INCREMENTAL_INPUT_AS_NEEDED.
2412 (Incremental_input_entry::Incremental_input_entry): Initialize new
2414 (Incremental_input_entry::set_as_needed): New function.
2415 (Incremental_input_entry::as_needed): New function.
2416 (Incremental_input_entry::do_dynobj_entry): New function.
2417 (Incremental_input_entry::as_needed_): New data member.
2418 (Incremental_object_entry::Incremental_object_entry): Don't check
2420 (Incremental_object_entry::do_type): Likewise.
2421 (class Incremental_dynobj_entry): New class.
2422 (Incremental_input_entry_reader::as_needed): New function.
2423 (Incremental_input_entry_reader::get_soname): New function.
2424 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2425 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2426 size of shared library info entry.
2427 * layout.cc (Layout::finish_dynamic_section): Don't test for
2428 incremental link when adding DT_NEEDED entries.
2429 * object.h (Object::Object): Initialize new data member.
2430 (Object::dynobj): New function.
2431 (Object::set_as_needed): New function.
2432 (Object::as_needed): New function.
2433 (Object::do_dynobj): New function.
2434 (Object::as_needed_): New data member.
2436 2011-05-24 Cary Coutant <ccoutant@google.com>
2438 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2439 info; adjust display of GOT entries.
2440 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2441 vector of input objects; remove file_status_.
2442 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2443 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2444 got_plt reader; call target hooks to reserve GOT entries.
2445 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2446 of input file info header and GOT info entry.
2447 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2449 (Got_plt_view_info::got_descriptor): Remove.
2450 (Got_plt_view_info::sym_index): New data member.
2451 (Got_plt_view_info::input_index): New data member.
2452 (Local_got_offset_visitor::visit): Write input file index.
2453 (Global_got_offset_visitor::visit): Write 0 for input file index.
2454 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2455 with sym_index and input_index.
2456 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2457 incremental info GOT entry; replace got_descriptor with input_index.
2458 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2459 map from input file index to object.
2460 (Sized_relobj_incr::do_layout): Replace direct data member reference
2461 with accessor function.
2462 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2463 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2464 Adjust size of input file info header.
2465 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2466 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2467 (Incremental_input_entry_reader::get_input_section): Adjust size of
2468 input file info header.
2469 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2470 of incremental info GOT entry.
2471 (Incremental_got_plt_reader::get_got_desc): Remove.
2472 (Incremental_got_plt_reader::get_got_symndx): New function.
2473 (Incremental_got_plt_reader::get_got_input_index): New function.
2474 (Sized_incremental_binary::Sized_incremental_binary): Remove
2475 file_status_; add input_objects_.
2476 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2477 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2478 (Sized_incremental_binary::file_is_unchanged): Remove.
2479 (Sized_incremental_binary::set_input_object): New function.
2480 (Sized_incremental_binary::input_object): New function.
2481 (Sized_incremental_binary::file_status_): Remove.
2482 (Sized_incremental_binary::input_objects_): New data member.
2483 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2485 (Sized_relobj_incr::invalid_address): Move to base class.
2486 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2488 (Sized_relobj_incr::do_output_section_offset): Likewise.
2489 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2490 (Sized_relobj_incr::section_offsets_): Likewise.
2491 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2493 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2494 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2495 with accessor function.
2496 (Sized_relobj_file::do_layout): Likewise.
2497 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2498 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2499 (Sized_relobj_file::compute_final_local_value): Replace refs to
2500 section_offsets_ with accessor function.
2501 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2502 * object.h (Relobj::Relobj): Initialize new data members.
2503 (Relobj::add_dyn_reloc): New function.
2504 (Relobj::first_dyn_reloc): New function.
2505 (Relobj::dyn_reloc_count): New function.
2506 (Relobj::first_dyn_reloc_): New data member.
2507 (Relobj::dyn_reloc_count_): New data member.
2508 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2510 (Sized_relobj::Address): New typedef.
2511 (Sized_relobj::invalid_address): Move here from child class.
2512 (Sized_relobj::Sized_relobj): Initialize new data members.
2513 (Sized_relobj::sized_relobj): New function.
2514 (Sized_relobj::is_output_section_offset_invalid): Move here from
2516 (Sized_relobj::get_output_section_offset): Likewise.
2517 (Sized_relobj::local_has_got_offset): Likewise.
2518 (Sized_relobj::local_got_offset): Likewise.
2519 (Sized_relobj::set_local_got_offset): Likewise.
2520 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2521 (Sized_relobj::clear_got_offsets): New function.
2522 (Sized_relobj::section_offsets): Move here from child class.
2523 (Sized_relobj::do_output_section_offset): Likewise.
2524 (Sized_relobj::do_set_section_offset): Likewise.
2525 (Sized_relobj::Local_got_offsets): Likewise.
2526 (Sized_relobj::local_got_offsets_): Likewise.
2527 (Sized_relobj::section_offsets_): Likewise.
2528 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2530 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2532 (Sized_relobj_file::sized_relobj): New function
2533 (Sized_relobj_file::local_has_got_offset): Move to base class.
2534 (Sized_relobj_file::local_got_offset): Likewise.
2535 (Sized_relobj_file::set_local_got_offset): Likewise.
2536 (Sized_relobj_file::get_output_section_offset): Likewise.
2537 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2538 (Sized_relobj_file::do_output_section_offset): Likewise.
2539 (Sized_relobj_file::do_set_section_offset): Likewise.
2540 (Sized_relobj_file::Local_got_offsets): Likewise.
2541 (Sized_relobj_file::local_got_offsets_): Likewise.
2542 (Sized_relobj_file::section_offsets_): Likewise.
2543 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2545 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2546 (Output_reloc::get_symbol_index): Likewise.
2547 (Output_reloc::local_section_offset): Likewise.
2548 (Output_reloc::get_address): Likewise.
2549 (Output_reloc::symbol_value): Likewise.
2550 (Output_data_got::reserve_slot): Move to class definition.
2551 (Output_data_got::reserve_local): New function.
2552 (Output_data_got::reserve_slot_for_global): Remove.
2553 (Output_data_got::reserve_global): New function.
2554 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2555 (all constructors, two instantiations).
2556 (Output_reloc::get_relobj): New function (two instantiations).
2557 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2558 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2559 (Output_data_reloc::add_global): Adjust type of relobj.
2560 (Output_data_reloc::add_global_relative): Likewise.
2561 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2562 (Output_data_reloc::add_local): Likewise.
2563 (Output_data_reloc::add_local_relative): Likewise.
2564 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2565 (Output_data_reloc::add_local_section): Likewise.
2566 (Output_data_reloc::add_output_section): Likewise.
2567 (Output_data_reloc::add_absolute): Likewise.
2568 (Output_data_reloc::add_target_specific): Likewise.
2569 (Output_data_got::reserve_slot): Move definition here.
2570 (Output_data_got::reserve_local): New function.
2571 (Output_data_got::reserve_global): New function.
2572 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2573 section_offsets_ with accessor function.
2574 (Sized_relobj_file::write_sections): Likewise.
2575 (Sized_relobj_file::do_relocate_sections): Likewise.
2576 * target.h (Sized_target::reserve_local_got_entry): New function.
2577 (Sized_target::reserve_global_got_entry): New function.
2578 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2579 (Target_x86_64::reserve_global_got_entry): New function.
2580 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2582 2011-05-23 Cary Coutant <ccoutant@google.com>
2584 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2585 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2586 bit when checking got_type.
2587 * incremental.cc (Sized_incremental_binary::setup_readers):
2588 Store symbol table and string table locations; initialize bit vector
2589 of file status flags.
2590 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2592 (Sized_incremental_binary::do_process_got_plt): New function.
2593 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2594 (Output_section_incremental_inputs::set_final_data_size): Record
2595 file index for each input file.
2596 (Output_section_incremental_inputs::write_got_plt): Store file index
2597 instead of input entry offset for each GOT entry.
2599 (Incremental_input_entry::Incremental_input_entry): Initialize new
2601 (Incremental_input_entry::set_offset): Store file index.
2602 (Incremental_input_entry::get_file_index): New function.
2603 (Incremental_input_entry::file_index_): New data member.
2604 (Incremental_binary::process_got_plt): New function.
2605 (Incremental_binary::do_process_got_plt): New function.
2606 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2608 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2609 (Sized_incremental_binary::set_file_is_unchanged): New function.
2610 (Sized_incremental_binary::file_is_unchanged): New function.
2611 (Sized_incremental_binary::do_process_got_plt): New function.
2612 (Sized_incremental_binary::file_status_): New data member.
2613 (Sized_incremental_binary::main_symtab_loc_): New data member.
2614 (Sized_incremental_binary::main_strtab_loc_): New data member.
2615 * output.cc (Output_data_got::Got_entry::write): Add case
2617 (Output_data_got::add_global): Call add_got_entry.
2618 (Output_data_got::add_global_plt): Likewise.
2619 (Output_data_got::add_global_with_rel): Likewise.
2620 (Output_data_got::add_global_with_rela): Likewise.
2621 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2622 (Output_data_got::add_global_pair_with_rela): Likewise.
2623 (Output_data_got::add_local): Call add_got_entry.
2624 (Output_data_got::add_local_plt): Likewise.
2625 (Output_data_got::add_local_with_rel): Likewise.
2626 (Output_data_got::add_local_with_rela): Likewise.
2627 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2628 (Output_data_got::add_local_pair_with_rela): Likewise.
2629 (Output_data_got::reserve_slot): New function.
2630 (Output_data_got::reserve_slot_for_global): New function.
2631 (Output_data_got::add_got_entry): New function.
2632 (Output_data_got::add_got_entry_pair): New function.
2633 (Output_section::add_output_section_data): Edit FIXME.
2635 (Output_section_data_build::Output_section_data_build): New
2636 constructor with size parameter.
2637 (Output_data_space::Output_data_space): Likewise.
2638 (Output_data_got::Output_data_got): Initialize new data member; new
2639 constructor with size parameter.
2640 (Output_data_got::add_constant): Call add_got_entry.
2641 (Output_data_got::reserve_slot): New function.
2642 (Output_data_got::reserve_slot_for_global): New function.
2643 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2644 (Output_data_got::add_got_entry): New function.
2645 (Output_data_got::add_got_entry_pair): New function.
2646 (Output_data_got::free_list_): New data member.
2647 * target.h (Sized_target::init_got_plt_for_update): New function.
2648 (Sized_target::register_global_plt_entry): New function.
2649 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2650 Initialize new data member; call init; add constructor with PLT count.
2651 (Output_data_plt_x86_64::init): New function.
2652 (Output_data_plt_x86_64::add_relocation): New function.
2653 (Output_data_plt_x86_64::reserve_slot): New function.
2654 (Output_data_plt_x86_64::free_list_): New data member.
2655 (Target_x86_64::init_got_plt_for_update): New function.
2656 (Target_x86_64::register_global_plt_entry): New function.
2657 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2658 incremental updates.
2659 (Output_data_plt_x86_64::add_relocation): New function.
2660 * testsuite/object_unittest.cc (Object_test): Set default options.
2662 2011-05-16 Ian Lance Taylor <iant@google.com>
2664 * options.h (class General_options): Make -i a synonym for -r.
2666 2011-05-16 Ian Lance Taylor <iant@google.com>
2668 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2670 2011-05-10 Cary Coutant <ccoutant@google.com>
2672 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2675 2011-05-06 Ian Lance Taylor <iant@google.com>
2677 * layout.cc (Layout::layout): If the output section flags change,
2678 update the ordering.
2680 2011-04-25 Cary Coutant <ccoutant@google.com>
2682 * incremental-dump.cc (dump_incremental_inputs): Print local
2683 symbol info for each input file.
2685 (Output_section_incremental_inputs::set_final_data_size): Add local
2686 symbol info to input file entries in incremental info.
2687 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2688 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2689 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2690 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2692 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2693 (Sized_incr_relobj::do_relocate): Write the local symbols.
2694 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2695 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2696 Adjust size of input file header.
2697 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2698 (Incremental_inputs_reader::get_local_symbol_count): New function.
2699 (Incremental_inputs_reader::get_input_section): Adjust size of input
2701 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2702 (Sized_incr_relobj::This): New typedef.
2703 (Sized_incr_relobj::sym_size): New const data member.
2704 (Sized_incr_relobj::Local_symbol): New struct.
2705 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2706 (Sized_incr_relobj::do_local_symbol_offset): New function.
2707 (Sized_incr_relobj::local_symbol_count_): New data member.
2708 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2709 (Sized_incr_relobj::local_symbol_index_): New data member.
2710 (Sized_incr_relobj::local_symbol_offset_): New data member.
2711 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2712 (Sized_incr_relobj::local_symbols_): New data member.
2713 * object.h (Relobj::output_local_symbol_count): New function.
2714 (Relobj::local_symbol_offset): New function.
2715 (Relobj::do_output_local_symbol_count): New function.
2716 (Relobj::do_local_symbol_offset): New function.
2717 (Sized_relobj::do_output_local_symbol_count): New function.
2718 (Sized_relobj::do_local_symbol_offset): New function.
2720 2011-04-22 Vladimir Simonov <sv@sw.ru>
2722 * descriptors.cc (set_close_on_exec): New function.
2723 (Descriptors::open): Use set_close_on_exec.
2724 * output.cc (S_ISLNK): Define if not defined.
2726 2011-04-22 Cary Coutant <ccoutant@google.com>
2728 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2730 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2731 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2732 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2734 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2735 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2736 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2738 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2740 (Incremental_binary::apply_incremental_relocs): New function.
2741 (Incremental_binary::do_apply_incremental_relocs): New function.
2742 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2744 (Sized_incremental_binary::add_global_symbol): New function.
2745 (Sized_incremental_binary::global_symbol): New function.
2746 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2747 (Sized_incremental_binary::symbol_map_): New data member.
2748 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2749 * target.h (Sized_target::apply_relocation): New function.
2750 * target-reloc.h (apply_relocation): New function.
2751 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2753 2011-04-22 Doug Kwan <dougkwan@google.com>
2755 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2756 flag of a SHT_ARM_EXIDX section.
2757 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2758 * testsuite/Makefile.in: Regenerate.
2759 * testsuite/arm_exidx_test.s: New file.
2760 * testsuite/arm_exidx_test.sh: Same.
2762 2011-04-20 Cary Coutant <ccoutant@google.com>
2765 * archive.h (Incremental_archive_entry::Archive_member):
2766 Initialize arg_serial_ (second constructor).
2768 2011-04-17 Ian Lance Taylor <iant@google.com>
2770 * object.cc (Relocate_info::location): Simplify location string.
2771 * errors.cc (Errors::error_at_location): Don't print program
2773 (Errors::warning_at_location): Likewise.
2774 (Errors::undefined_symbol): Likewise.
2775 * testsuite/debug_msg.sh: Update accordingly.
2777 2011-04-14 Cary Coutant <ccoutant@google.com>
2779 * gold/layout.cc (Layout::symtab_section_offset): New function.
2780 * gold/layout.h (Layout::symtab_section_offset): New function.
2781 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2783 2011-04-12 Ian Lance Taylor <iant@google.com>
2785 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2786 with MREMAP_MAYMOVE.
2787 * output.h (class Output_file): Add map_is_allocated_ field.
2788 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2789 not available, provide stubs. If mremap is not available, #define
2791 (MREMAP_MAYMOVE): Define if not defined.
2792 (Output_file::Output_file): Initialize map_is_allocated_.
2793 (Output_file::resize): Check map_is_allocated_.
2794 (Output_file::map_anonymous): If mmap fails, use malloc.
2795 (Output_file::unmap): Don't do anything for an anonymous map.
2796 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2797 is not available, provide stubs.
2798 (File_read::View::~View): Use free rather than delete[].
2799 (File_read::make_view): Use malloc rather than new[]. If mmap
2801 (File_read::find_or_make_view): Use malloc rather than new[].
2802 * gold.h: Remove HAVE_REMAP code.
2803 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2804 exists. Rename mremap to gold_mremap. If mmap is not available
2806 * configure, config.in: Rebuild.
2808 2011-04-11 Ian Lance Taylor <iant@google.com>
2810 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2811 initialize local variable v.
2813 2011-04-11 Cary Coutant <ccoutant@google.com>
2815 * archive.cc (Archive::include_member): Adjust call to
2817 (Add_archive_symbols::run): Track argument serial numbers.
2818 (Lib_group::include_member): Likewise.
2819 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2820 * archive.h (Incremental_archive_entry::Archive_member):
2821 Initialize arg_serial_.
2822 (Archive_member::arg_serial_): New data member.
2823 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2824 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2826 (Sized_dynobj::do_for_all_local_got_entries): New function.
2827 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2829 * fileread.cc (get_mtime): New function.
2830 * fileread.h (get_mtime): New function.
2831 * gold.cc (queue_initial_tasks): Check for incremental update.
2832 (process_incremental_input): New function.
2833 (queue_middle_tasks): Don't force valid target for incremental
2835 * incremental-dump.cc (find_input_containing_global): Adjust
2836 size of symbol info entry.
2837 (dump_incremental_inputs): Dump argument serial number and
2838 in_system_directory flag; bias shndx by 1; print symbol names
2839 when dumping per-file symbol lists; use new symbol info readers.
2841 (Output_section_incremental_inputs:update_data_size): New function.
2842 (Sized_incremental_binary::setup_readers): Setup input readers
2843 for each input file; build maps for files added from libraries
2845 (Sized_incremental_binary::check_input_args): New function.
2846 (Sized_incremental_binary::do_check_inputs): Build map of argument
2847 serial numbers to input arguments.
2848 (Sized_incremental_binary::do_file_has_changed): Rename
2849 do_file_is_unchanged to this; compare file modification times.
2850 (Sized_incremental_binary::do_init_layout): New function.
2851 (Sized_incremental_binary::do_reserve_layout): New function.
2852 (Sized_incremental_binary::do_get_input_reader): Remove.
2853 (Sized_incremental_binary::get_symtab_view): New function.
2854 (Incremental_checker::can_incrementally_link_output_file): Remove.
2855 (Incremental_inputs::report_command_line): Exclude --debug options.
2856 (Incremental_inputs::report_archive_begin): Add parameter; track
2857 argument serial numbers; don't put input file entry for archive
2858 before archive members.
2859 (Incremental_inputs::report_archive_end): Put input file entry
2860 for archive after archive members.
2861 (Incremental_inputs::report_object): Add parameter; track argument
2862 serial numbers and in_system_directory flag.
2863 (Incremental_inputs::report_script): Add parameter; track argument
2865 (Output_section_incremental_inputs::set_final_data_size): Adjust
2866 size of symbol info entry; check for forwarding symbols.
2867 (Output_section_incremental_inputs::write_input_files): Write
2868 in_system_directory flag and argument serial number.
2869 (Output_section_incremental_inputs::write_info_blocks): Map section
2870 indices between incremental info and original input file; store
2871 input section index for each symbol.
2872 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2873 change operator() to visit().
2874 (class Global_got_offset_visitor): Likewise.
2875 (class Global_symbol_visitor_got_plt):
2876 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2878 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2879 (Sized_incr_relobj::do_read_symbols): New function.
2880 (Sized_incr_relobj::do_layout): New function.
2881 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2882 (Sized_incr_relobj::do_add_symbols): New function.
2883 (Sized_incr_relobj::do_should_include_member): New function.
2884 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2885 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2886 (Sized_incr_relobj::do_section_size): New function.
2887 (Sized_incr_relobj::do_section_name): New function.
2888 (Sized_incr_relobj::do_section_contents): New function.
2889 (Sized_incr_relobj::do_section_flags): New function.
2890 (Sized_incr_relobj::do_section_entsize): New function.
2891 (Sized_incr_relobj::do_section_address): New function.
2892 (Sized_incr_relobj::do_section_type): New function.
2893 (Sized_incr_relobj::do_section_link): New function.
2894 (Sized_incr_relobj::do_section_info): New function.
2895 (Sized_incr_relobj::do_section_addralign): New function.
2896 (Sized_incr_relobj::do_initialize_xindex): New function.
2897 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2898 (Sized_incr_relobj::do_read_relocs): New function.
2899 (Sized_incr_relobj::do_gc_process_relocs): New function.
2900 (Sized_incr_relobj::do_scan_relocs): New function.
2901 (Sized_incr_relobj::do_count_local_symbols): New function.
2902 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2903 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2904 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2905 (Sized_incr_relobj::do_relocate): New function.
2906 (Sized_incr_relobj::do_set_section_offset): New function.
2907 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2908 (Sized_incr_dynobj::do_read_symbols): New function.
2909 (Sized_incr_dynobj::do_layout): New function.
2910 (Sized_incr_dynobj::do_add_symbols): New function.
2911 (Sized_incr_dynobj::do_should_include_member): New function.
2912 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2913 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2914 (Sized_incr_dynobj::do_section_size): New function.
2915 (Sized_incr_dynobj::do_section_name): New function.
2916 (Sized_incr_dynobj::do_section_contents): New function.
2917 (Sized_incr_dynobj::do_section_flags): New function.
2918 (Sized_incr_dynobj::do_section_entsize): New function.
2919 (Sized_incr_dynobj::do_section_address): New function.
2920 (Sized_incr_dynobj::do_section_type): New function.
2921 (Sized_incr_dynobj::do_section_link): New function.
2922 (Sized_incr_dynobj::do_section_info): New function.
2923 (Sized_incr_dynobj::do_section_addralign): New function.
2924 (Sized_incr_dynobj::do_initialize_xindex): New function.
2925 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2926 (make_sized_incremental_object): New function.
2927 (Incremental_library::copy_unused_symbols): New function.
2928 (Incremental_library::do_for_all_unused_symbols): New function.
2929 * incremental.h (enum Incremental_input_flags): New type.
2930 (class Incremental_checker): Remove.
2931 (Incremental_input_entry::Incremental_input_entry): Add argument
2933 (Incremental_input_entry::arg_serial): New function.
2934 (Incremental_input_entry::set_is_in_system_directory): New function.
2935 (Incremental_input_entry::is_in_system_directory): New function.
2936 (Incremental_input_entry::arg_serial_): New data member.
2937 (Incremental_input_entry::is_in_system_directory_): New data member.
2938 (class Script_info): Move here from script.h.
2939 (Script_info::Script_info): Add filename parameter.
2940 (Script_info::filename): New function.
2941 (Script_info::filename_): New data member.
2942 (Incremental_script_entry::Incremental_script_entry): Add argument
2944 (Incremental_object_entry::Incremental_object_entry): Likewise.
2945 (Incremental_object_entry::add_input_section): Build list of input
2946 sections with map to original shndx.
2947 (Incremental_object_entry::get_input_section_index): New function.
2948 (Incremental_object_entry::shndx_): New data member.
2949 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2950 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2951 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2953 (Incremental_inputs::report_archive_begin): Likewise.
2954 (Incremental_inputs::report_object): Likewise.
2955 (Incremental_inputs::report_script): Likewise.
2956 (class Incremental_global_symbol_reader): New class.
2957 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2958 and store flags and input file type.
2959 (Incremental_input_entry_reader::arg_serial): New function.
2960 (Incremental_input_entry_reader::type): Extract type from flags.
2961 (Incremental_input_entry_reader::is_in_system_directory): New function.
2962 (Incremental_input_entry_reader::get_input_section_count): Call
2963 accessor function for type.
2964 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2965 function for type; adjust size of global symbol entry.
2966 (Incremental_input_entry_reader::get_global_symbol_count): Call
2967 accessor function for type.
2968 (Incremental_input_entry_reader::get_object_count): Likewise.
2969 (Incremental_input_entry_reader::get_object_offset): Likewise.
2970 (Incremental_input_entry_reader::get_member_count): Likewise.
2971 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2972 (Incremental_input_entry_reader::get_member_offset): Likewise.
2973 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2974 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2975 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2976 (Incremental_input_entry_reader::get_global_symbol_reader): New
2978 (Incremental_input_entry_reader::get_output_symbol_index): New
2980 (Incremental_input_entry_reader::type_): Remove.
2981 (Incremental_input_entry_reader::flags_): New data member.
2982 (Incremental_inputs_reader::input_file_offset): New function.
2983 (Incremental_inputs_reader::input_file_index): New function.
2984 (Incremental_inputs_reader::input_file): Call input_file_offset.
2985 (Incremental_inputs_reader::input_file_at_offset): New function.
2986 (Incremental_relocs_reader::get_r_type): Reformat.
2987 (Incremental_relocs_reader::get_r_shndx): Reformat.
2988 (Incremental_relocs_reader::get_r_offset): Reformat.
2989 (Incremental_relocs_reader::data): New function.
2990 (Incremental_binary::Incremental_binary): Initialize new data members.
2991 (Incremental_binary::check_inputs): Add cmdline parameter.
2992 (Incremental_binary::file_is_unchanged): Remove.
2993 (Input_reader::arg_serial): New function.
2994 (Input_reader::get_unused_symbol_count): New function.
2995 (Input_reader::get_unused_symbol): New function.
2996 (Input_reader::do_arg_serial): New function.
2997 (Input_reader::do_get_unused_symbol_count): New function.
2998 (Input_reader::do_get_unused_symbol): New function.
2999 (Incremental_binary::input_file_count): New function.
3000 (Incremental_binary::get_input_reader): Change signature to use
3001 index instead of filename.
3002 (Incremental_binary::file_has_changed): New function.
3003 (Incremental_binary::get_input_argument): New function.
3004 (Incremental_binary::get_library): New function.
3005 (Incremental_binary::get_script_info): New function.
3006 (Incremental_binary::init_layout): New function.
3007 (Incremental_binary::reserve_layout): New function.
3008 (Incremental_binary::output_file): New function.
3009 (Incremental_binary::do_check_inputs): New function.
3010 (Incremental_binary::do_file_is_unchanged): Remove.
3011 (Incremental_binary::do_file_has_changed): New function.
3012 (Incremental_binary::do_init_layout): New function.
3013 (Incremental_binary::do_reserve_layout): New function.
3014 (Incremental_binary::do_input_file_count): New function.
3015 (Incremental_binary::do_get_input_reader): Change signature.
3016 (Incremental_binary::input_args_map_): New data member.
3017 (Incremental_binary::library_map_): New data member.
3018 (Incremental_binary::script_map_): New data member.
3019 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3021 (Sized_incremental_binary::output_section): New function.
3022 (Sized_incremental_binary::inputs_reader): Add const.
3023 (Sized_incremental_binary::symtab_reader): Add const.
3024 (Sized_incremental_binary::relocs_reader): Add const.
3025 (Sized_incremental_binary::got_plt_reader): Add const.
3026 (Sized_incremental_binary::get_symtab_view): New function.
3027 (Sized_incremental_binary::Inputs_reader): New typedef.
3028 (Sized_incremental_binary::Input_entry_reader): New typedef.
3029 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3030 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3031 (Sized_incremental_binary::do_file_has_changed): New function.
3032 (Sized_incremental_binary::do_init_layout): New function.
3033 (Sized_incremental_binary::do_reserve_layout): New function.
3034 (Sized_input_reader::Inputs_reader): Remove.
3035 (Sized_input_reader::Input_entry_reader): Remove.
3036 (Sized_input_reader::do_arg_serial): New function.
3037 (Sized_input_reader::do_get_unused_symbol_count): New function.
3038 (Sized_input_reader::do_get_unused_symbol): New function.
3039 (Sized_incremental_binary::do_input_file_count): New function.
3040 (Sized_incremental_binary::do_get_input_reader): Change signature;
3041 use index instead of filename.
3042 (Sized_incremental_binary::section_map_): New data member.
3043 (Sized_incremental_binary::input_entry_readers_): New data member.
3044 (class Sized_incr_relobj): New class.
3045 (class Sized_incr_dynobj): New class.
3046 (make_sized_incremental_object): New function.
3047 (class Incremental_library): New class.
3048 * layout.cc (Free_list::num_lists): New static data member.
3049 (Free_list::num_nodes): New static data member.
3050 (Free_list::num_removes): New static data member.
3051 (Free_list::num_remove_visits): New static data member.
3052 (Free_list::num_allocates): New static data member.
3053 (Free_list::num_allocate_visits): New static data member.
3054 (Free_list::init): New function.
3055 (Free_list::remove): New function.
3056 (Free_list::allocate): New function.
3057 (Free_list::dump): New function.
3058 (Free_list::print_stats): New function.
3059 (Layout_task_runner::run): Resize output file for incremental updates.
3060 (Layout::Layout): Initialize new data members.
3061 (Layout::set_incremental_base): New function.
3062 (Layout::init_fixed_output_section): New function.
3063 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3064 incremental updates.
3065 (Layout::create_gold_note): Do not create gold note section for
3066 incremental updates.
3067 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3068 for incremental updates.
3069 (Layout::set_section_offsets): For incremental updates, allocate space
3071 (Layout::create_symtab_sections): Layout with offsets relative to
3072 start of section; for incremental updates, allocate space from free
3074 (Layout::create_shdrs): For incremental updates, allocate space from
3076 (Layout::finish_dynamic_section): For incremental updates, do not
3077 check --as-needed (fixed in subsequent patch).
3078 * layout.h (class Free_list): New class.
3079 (Layout::set_incremental_base): New function.
3080 (Layout::incremental_base): New function.
3081 (Layout::init_fixed_output_section): New function.
3082 (Layout::allocate): New function.
3083 (Layout::incremental_base_): New data member.
3084 (Layout::free_list_): New data member.
3085 * main.cc (main): Print Free_list statistics.
3086 * object.cc (Relobj::finalize_incremental_relocs): Add
3087 clear_counts parameter; clear counts only when clear_counts is set.
3088 (Sized_relobj::Sized_relobj): Initialize new base class.
3089 (Sized_relobj::do_layout): Don't report special sections.
3090 (Sized_relobj::do_for_all_local_got_entries): New function.
3091 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3092 symtab_off to all symbol table offsets.
3093 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3094 * object.h (class Got_offset_list): Move to top of file.
3095 (Object::Object): Allow case where input_file == NULL.
3096 (Object::~Object): Likewise.
3097 (Object::input_file): Assert that input_file != NULL.
3098 (Object::lock): Allow case where input_file == NULL.
3099 (Object::unlock): Likewise.
3100 (Object::is_locked): Likewise.
3101 (Object::token): Likewise.
3102 (Object::release): Likewise.
3103 (Object::is_incremental): New function.
3104 (Object::get_mtime): New function.
3105 (Object::for_all_local_got_entries): New function.
3106 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3107 (Object::set_is_in_system_directory): New function.
3108 (Object::is_in_system_directory): New function.
3109 (Object::do_is_incremental): New function.
3110 (Object::do_get_mtime): New function.
3111 (Object::do_for_all_local_got_entries): New function.
3112 (Object::is_in_system_directory_): New data member.
3113 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3114 (class Sized_relobj_base): New class.
3115 (class Sized_relobj): Derive from Sized_relobj_base.
3116 (class Sized_relobj::Symbols): Redeclare from base class.
3117 (class Sized_relobj::local_got_offset_list): Remove.
3118 (class Sized_relobj::Output_sections): Redeclare from base class.
3119 (class Sized_relobj::do_for_all_local_got_entries): New function.
3120 (class Sized_relobj::write_local_symbols): Add offset parameter.
3121 (class Sized_relobj::local_symbol_offset_): Update comment.
3122 (class Sized_relobj::local_dynsym_offset_): Update comment.
3123 * options.cc (Input_arguments::add_file): Remove const.
3124 * options.h (Input_file_argument::Input_file_argument):
3125 Initialize arg_serial_ (all constructors).
3126 (Input_file_argument::set_arg_serial): New function.
3127 (Input_file_argument::arg_serial): New function.
3128 (Input_file_argument::arg_serial_): New data member.
3129 (Input_arguments::Input_arguments): Initialize file_count_.
3130 (Input_arguments::add_file): Remove const.
3131 (Input_arguments::number_of_input_files): New function.
3132 (Input_arguments::file_count_): New data member.
3133 (Command_line::number_of_input_files): Call
3134 Input_arguments::number_of_input_files.
3135 * output.cc (Output_segment_headers::Output_segment_headers):
3137 (Output_section::Input_section::current_data_size): New function.
3138 (Output_section::Output_section): Initialize new data members.
3139 (Output_section::add_input_section): Don't do merge sections for
3140 an incremental link; allocate space from free list for an
3142 (Output_section::add_output_section_data): Allocate space from
3143 free list for an incremental update.
3144 (Output_section::update_data_size): New function.
3145 (Output_section::set_fixed_layout): New function.
3146 (Output_section::reserve): New function.
3147 (Output_segment::set_section_addresses): Remove const.
3148 (Output_segment::set_section_list_addresses): Remove const; allocate
3149 space from free list for an incremental update.
3150 (Output_segment::set_offset): Adjust size of RELRO segment for an
3152 * output.h (Output_data::current_data_size): Move here from
3154 (Output_data::pre_finalize_data_size): New function.
3155 (Output_data::update_data_size): New function.
3156 (Output_section_headers::update_data_size): new function.
3157 (Output_section_data_build::current_data_size): Move to Output_data.
3158 (Output_data_strtab::update_data_size): New function.
3159 (Output_section::current_data_size): Move to Output_data.
3160 (Output_section::set_fixed_layout): New function.
3161 (Output_section::has_fixed_layout): New function.
3162 (Output_section::reserve): New function.
3163 (Output_section::update_data_size): New function.
3164 (Output_section::has_fixed_layout_): New data member.
3165 (Output_section::free_list_): New data member.
3166 (Output_segment::set_section_addresses): Remove const.
3167 (Output_segment::set_section_list_addresses): Remove const.
3168 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3170 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3172 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3173 parameter when calling Add_symbols constructor; store argument
3174 serial number for members of a lib group.
3175 (Add_symbols::locks): Allow case where token == NULL.
3176 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3177 (Read_member::~Read_member): New function.
3178 (Read_member::is_runnable): New function.
3179 (Read_member::locks): New function.
3180 (Read_member::run): New function.
3181 (Check_script::~Check_script): New function.
3182 (Check_script::is_runnable): New function.
3183 (Check_script::locks): New function.
3184 (Check_script::run): New function.
3185 (Check_library::~Check_library): New function.
3186 (Check_library::is_runnable): New function.
3187 (Check_library::locks): New function.
3188 (Check_library::run): New function.
3189 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3190 (Add_symbols::library_): New data member.
3191 (class Read_member): New class.
3192 (class Check_script): New class.
3193 (class Check_library): New class.
3194 * reloc.cc (Read_relocs::is_runnable): Allow case where
3196 (Read_relocs::locks): Likewise.
3197 (Scan_relocs::locks): Likewise.
3198 (Relocate_task::locks): Likewise.
3199 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3201 (Sized_relobj::incremental_relocs_scan): Fix comment.
3202 (Sized_relobj::do_relocate): Pass output file offset to
3203 write_local_symbols.
3204 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3205 from class declaration.
3206 * script.cc (read_input_script): Allocate Script_info; pass
3207 argument serial number to report_script.
3208 * script.h (class Script_info): Move to incremental.h.
3209 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3210 * symtab.h (Symbol_table::add_from_incrobj): New function.
3211 (Symbol_table::set_file_offset): New function.
3213 2011-04-05 Cary Coutant <ccoutant@google.com>
3215 * incremental-dump.cc (dump_incremental_inputs): Change signature
3216 to take a Sized_incremental_binary; change caller. Use readers
3217 in Sized_incremental_binary.
3219 (Sized_incremental_binary::find_incremental_inputs_sections):
3220 Rename do_find_incremental_inputs_sections to this.
3221 (Sized_incremental_binary::setup_readers): New function.
3222 (Sized_incremental_binary::do_check_inputs): Check
3223 has_incremental_info_ flag; move setup code to setup_readers;
3225 (Sized_incremental_binary::do_file_is_unchanged): New function.
3226 (Sized_incremental_binary::do_get_input_reader): New function.
3227 * incremental.h (class Incremental_binary): Move to end of file.
3228 (Incremental_binary::file_is_unchanged): New function.
3229 (Incremental_binary::do_file_is_unchanged): New function.
3230 (Incremental_binary::Input_reader): New class.
3231 (Incremental_binary::get_input_reader): New function.
3232 (class Sized_incremental_binary): Move to end of file.
3233 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3234 input section reader classes.
3235 (Sized_incremental_binary::has_incremental_info): New function.
3236 (Sized_incremental_binary::inputs_reader): New function.
3237 (Sized_incremental_binary::symtab_reader): New function.
3238 (Sized_incremental_binary::relocs_reader): New function.
3239 (Sized_incremental_binary::got_plt_reader): New function.
3240 (Sized_incremental_binary::do_file_is_unchanged): New function.
3241 (Sized_incremental_binary::Sized_input_reader): New class.
3242 (Sized_incremental_binary::get_input_reader): New function.
3243 (Sized_incremental_binary::find_incremental_inputs_sections):
3244 Rename do_find_incremental_inputs_sections to this.
3245 (Sized_incremental_binary::setup_readers): New function.
3246 (Sized_incremental_binary::has_incremental_info_): New data member.
3247 (Sized_incremental_binary::inputs_reader_): New data member.
3248 (Sized_incremental_binary::symtab_reader_): New data member.
3249 (Sized_incremental_binary::relocs_reader_): New data member.
3250 (Sized_incremental_binary::got_plt_reader_): New data member.
3251 (Sized_incremental_binary::current_input_file_): New data member.
3253 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3256 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3259 2011-03-30 Cary Coutant <ccoutant@google.com>
3261 * archive.cc (Archive::include_member): Adjust call to report_object.
3262 (Add_archive_symbols::run): Add script_info to call to
3263 report_archive_begin.
3264 (Lib_group::include_member): Adjust call to report_object.
3265 (Add_lib_group_symbols::run): Adjust call to report_object.
3266 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3267 blocks. Add object count for script input files.
3268 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3269 script_info parameter; change all callers.
3270 (Incremental_inputs::report_object): Add script_info parameter;
3272 (Incremental_inputs::report_script): Store backpointer to
3273 incremental info entry.
3274 (Output_section_incremental_inputs::set_final_data_size): Record
3275 additional information for scripts.
3276 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3277 * incremental.h (Incremental_script_entry::add_object): New function.
3278 (Incremental_script_entry::get_object_count): New function.
3279 (Incremental_script_entry::get_object): New function.
3280 (Incremental_script_entry::objects_): New data member; adjust
3282 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3283 (Incremental_inputs::report_object): Add script_info parameter.
3284 (Incremental_inputs_reader::get_object_count): New function.
3285 (Incremental_inputs_reader::get_object_offset): New function.
3286 * options.cc (Input_arguments::add_file): Return reference to
3288 * options.h (Input_argument::set_script_info): New function.
3289 (Input_argument::script_info): New function.
3290 (Input_argument::script_info_): New data member; adjust all
3292 (Input_file_group::add_file): Return reference to new input argument.
3293 (Input_file_lib::add_file): Likewise.
3294 (Input_arguments::add_file): Likewise.
3295 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3296 * script.cc (Parser_closure::Parser_closure): Add script_info
3297 parameter; adjust all callers.
3298 (Parser_closure::script_info): New function.
3299 (Parser_closure::script_info_): New data member.
3300 (read_input_script): Report scripts earlier to incremental info.
3301 (script_add_file): Set script_info in Input_argument.
3302 (script_add_library): Likewise.
3303 * script.h (Script_options::Script_info): Rewrite class.
3305 2011-03-29 Cary Coutant <ccoutant@google.com>
3307 * archive.cc (Library_base::should_include_member): Move
3308 method here from class Archive.
3309 (Archive::Archive): Initialize base class.
3310 (Archive::should_include_member): Move to base class.
3311 (Archive::do_for_all_unused_symbols): New function.
3312 (Add_archive_symbols::run): Remove redundant access to
3314 (Lib_group::Lib_group): Initialize base class.
3315 (Lib_group::do_filename): New function.
3316 (Lib_group::include_member): Pass pointer to Lib_group to
3318 (Lib_group::do_for_all_unused_symbols): New function.
3319 (Add_lib_group_symbols::run): Report archive information for
3321 * archive.h (class Library_base): New base class.
3322 (class Archive): Derive from Library_base.
3323 (Archive::filename): Move to base class.
3324 (Archive::set_incremental_info): Likewise.
3325 (Archive::incremental_info): Likewise.
3326 (Archive::Should_include): Likewise.
3327 (Archive::should_include_member): Likewise.
3328 (Archive::Armap_entry): Remove.
3329 (Archive::Unused_symbol_iterator): Remove.
3330 (Archive::unused_symbols_begin): Remove.
3331 (Archive::unused_symbols_end): Remove.
3332 (Archive::do_filename): New function.
3333 (Archive::do_get_mtime): New function.
3334 (Archive::do_for_all_unused_symbols): New function.
3335 (Archive::task_): Move to base class.
3336 (Archive::incremental_info_): Likewise.
3337 (class Lib_group): Derive from Library_base.
3338 (Lib_group::do_filename): New function.
3339 (Lib_group::do_get_mtime): New function.
3340 (Lib_group::do_for_all_unused_symbols): New function.
3341 (Lib_group::task_): Move to base class.
3342 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3344 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3346 * incremental.cc (Incremental_inputs::report_archive_begin):
3347 Use Library_base; call library's get_mtime; add incremental inputs
3348 entry before members.
3349 (class Unused_symbol_visitor): New class.
3350 (Incremental_inputs::report_archive_end): Use Library_base; use
3351 visitor class to record unused symbols; don't add incremental inputs
3352 entry after members.
3353 (Incremental_inputs::report_object): Use Library_base.
3355 (Incremental_archive_entry::Incremental_archive_entry): Remove
3356 unused Archive parameter.
3357 (Incremental_inputs::report_archive_begin): Use Library_base.
3358 (Incremental_inputs::report_archive_end): Likewise.
3359 (Incremental_inputs::report_object): Likewise.
3360 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3362 * object.h (Object::for_all_global_symbols): New function.
3363 (Object::do_for_all_global_symbols): New function.
3364 (Sized_relobj::do_for_all_global_symbols): New function.
3365 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3367 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3370 2011-03-27 Ian Lance Taylor <iant@google.com>
3372 * archive.cc (Archive::interpret_header): Return -1 if something
3373 goes wrong. Change callers accordingly.
3375 2011-03-25 Cary Coutant <ccoutant@google.com>
3377 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3378 * testsuite/Makefile.in: Regenerate.
3380 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3382 * plugin.cc (get_view): New.
3383 (Plugin::load): Pass get_view to the plugin.
3384 (Plugin_manager::get_view): New.
3386 2011-03-21 Ian Lance Taylor <iant@google.com>
3388 * testsuite/final_layout.sh: Rewrite to not use dc.
3389 * testsuite/relro_test.sh: Fail if dc is not present.
3391 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3393 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3395 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3396 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3398 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3399 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3401 2011-03-14 Ian Lance Taylor <iant@google.com>
3403 * script-sections.cc (Sort_output_sections::script_compare):
3404 Rename from is_before, change return type.
3405 (Sort_output_sections::operator()): Adjust accordingly.
3407 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3410 * testsuite/odr_violation2.cc: Add comment to make all error line
3411 numbers double digits.
3412 * testsuite/debug_msg.sh: Adjust expected errors.
3414 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3416 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3417 but mark earlier ones as non-canonical
3418 (offset_to_iterator): Update search target and example
3419 (do_addr2line): Return extra lines in a vector*
3420 (format_file_lineno): Extract from do_addr2line
3421 (one_addr2line): Add vector* out-param
3422 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3423 when a lineno entry appeared last for its instruction
3424 (Dwarf_line_info): Add vector* out-param
3425 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3426 * symtab.cc (Odr_violation_compare): Include the lineno in the
3428 (linenos_from_loc): New. Combine the canonical line for an
3429 address with its other lines.
3430 (True_if_intersect): New. Helper functor to make
3431 std::set_intersection a query.
3432 (detect_odr_violations): Compare sets of lines instead of just
3433 one line for each function. This became less deterministic, but
3434 has fewer false positives.
3435 * symtab.h: Declarations.
3436 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3437 mix an optimized and non-optimized object in the same binary
3438 (odr_violation2.so): Same.
3439 * testsuite/Makefile.in: Regenerate from Makefile.am.
3440 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3441 * testsuite/debug_msg.sh: Update line numbers and add
3443 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3444 non-optimized context.
3445 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3446 isn't inlined, and use OdrDerived in an optimized context.
3447 * testsuite/odr_header1.h: Defines OdrDerived, where
3448 optimization will change the
3449 first-instruction-in-the-destructor's file and line number.
3450 * testsuite/odr_header2.h: Defines OdrBase.
3452 2011-03-09 Ian Lance Taylor <iant@google.com>
3454 * fileread.cc (File_read::clear_views): Don't delete the whole
3457 2011-03-08 Ian Lance Taylor <iant@google.com>
3460 * fileread.cc: #include <climits>.
3461 (GOLD_IOV_MAX): Define.
3462 (File_read::read_multiple): Limit number of entries by iov_max.
3463 * fileread.h (class File_read): Always set max_readv_entries to
3466 2011-03-07 Ian Lance Taylor <iant@google.com>
3469 * options.h (class General_options): Add -dy and -dn.
3471 2011-03-02 Cary Coutant <ccoutant@google.com>
3473 * testsuite/script_test_9.t: Add TLS segment.
3475 2011-03-02 Simon Baldwin <simonb@google.com>
3477 * configure.ac: Add check for gnu_indirect_function support in
3478 the toolchain building binutils.
3479 * configure: Rebuild.
3481 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3483 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3484 plugin only symbols.
3485 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3486 in plugin files as not needed in the symbol table.
3488 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3490 * output.cc (Output_section::add_input_section): Delay fill
3491 generation for section ordering.
3493 2011-02-09 Ian Lance Taylor <iant@google.com>
3496 * object.h (class Sized_relobj): Remove clear_local_symbols.
3497 * reloc.cc (Sized_relobj::do_relocate): Don't call
3498 clear_local_symbols.
3500 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3502 * plugin.cc (is_visible_from_outside): Return true for symbols
3505 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3507 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3510 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3512 * icf.h (is_section_foldable_candidate): Change type of parameter
3514 * icf.cc (Icf::find_identical_sections): Change type of local variable
3515 section_name to be std::string.
3516 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3518 2011-01-25 Ian Lance Taylor <iant@google.com>
3520 * script.cc (script_add_extern): Rewrite to use
3521 add_symbol_reference.
3523 2011-01-25 Doug Kwan <dougkwan@google.com>
3525 * icf.cc (get_section_contents): Always lock section's object.
3527 2011-01-24 Ian Lance Taylor <iant@google.com>
3529 * options.h (class General_options): Accept
3530 --no-detect-odr-violations.
3532 2011-01-24 Ian Lance Taylor <iant@google.com>
3534 * version.cc (version_string): Bump to 1.11.
3536 2011-01-24 Ian Lance Taylor <iant@google.com>
3538 * plugin.cc (class Plugin_rescan): Define new class.
3539 (Plugin_manager::claim_file): Set any_claimed_.
3540 (Plugin_manager::save_archive): New function.
3541 (Plugin_manager::save_input_group): New function.
3542 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3544 (Plugin_manager::new_undefined_symbol): New function.
3545 (Plugin_manager::rescan): New function.
3546 (Plugin_manager::rescannable_defines): New function.
3547 (Plugin_manager::add_input_file): Set any_added_.
3548 * plugin.h (class Plugin_manager): define new fields rescannable_,
3549 undefined_symbols_, any_claimed_, and any_added_. Declare
3550 Plugin_rescan as friend. Declare new functions.
3551 (Plugin_manager::Rescannable): Define type.
3552 (Plugin_manager::Rescannable_list): Define type.
3553 (Plugin_manager::Undefined_symbol_list): Define type.
3554 (Plugin_manager::Plugin_manager): Initialize new fields.
3555 * archive.cc (Archive::defines_symbol): New function.
3556 (Add_archive_symbols::run): Pass archive to plugins if any.
3557 * archive.h (class Archive): Declare defines_symbol.
3558 * readsyms.cc (Input_group::~Input_group): New function.
3559 (Finish_group::run): Pass input_group to plugins if any.
3560 * readsyms.h (class Input_group): Declare destructor.
3561 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3564 2011-01-10 Ian Lance Taylor <iant@google.com>
3566 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3568 (Layout::set_segment_offsets): Reset increase_relro before calling
3569 set_section_addresses a second time.
3571 2011-01-04 Cary Coutant <ccoutant@google.com>
3573 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3574 sections before NOBITS sections.
3576 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3578 * version.cc (print_version): Update copyright to 2011.
3580 2010-12-23 Cary Coutant <ccoutant@google.com>
3582 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3583 of OS to this->add. Add OD parameter to second form of the function.
3585 2010-12-20 Ian Lance Taylor <iant@google.com>
3587 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3588 second of two consecutive entries with same offset.
3590 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3592 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3593 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3594 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3595 to avoid unneeded links against $(LDADD).
3596 * testsuite/Makefile.in: Regenerate.
3598 2010-12-15 Ian Lance Taylor <iant@google.com>
3601 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3602 for R_X86_64_32 and R_X86_64_PC32.
3603 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3604 ver_matching_def_pic.o.
3605 (ver_matching_def_pic.o): New target.
3607 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3609 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3610 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3611 Move definition before File_read::View member definitions.
3612 (File_read::View::~View): Initialize and hold lock before
3613 updating current_mapped_bytes.
3615 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3617 * dwarf_reader.cc: Remove outdated comment.
3618 * gold-threads.cc: Fix typo in error message.
3619 * archive.cc: Fix typos in comments.
3620 * archive.h: Likewise.
3621 * arm-reloc-property.cc: Likewise.
3622 * arm-reloc-property.h: Likewise.
3623 * arm-reloc.def: Likewise.
3625 * attributes.h: Likewise.
3626 * cref.cc: Likewise.
3627 * ehframe.cc: Likewise.
3628 * fileread.h: Likewise.
3630 * i386.cc: Likewise.
3632 * incremental.h: Likewise.
3633 * int_encoding.cc: Likewise.
3634 * layout.h: Likewise.
3635 * main.cc: Likewise.
3636 * merge.h: Likewise.
3637 * object.cc: Likewise.
3638 * object.h: Likewise.
3639 * options.cc: Likewise.
3640 * readsyms.cc: Likewise.
3641 * reduced_debug_output.cc: Likewise.
3642 * reloc.cc: Likewise.
3643 * script-sections.cc: Likewise.
3644 * sparc.cc: Likewise.
3645 * symtab.h: Likewise.
3646 * target-reloc.h: Likewise.
3647 * target.cc: Likewise.
3648 * target.h: Likewise.
3649 * timer.cc: Likewise.
3650 * timer.h: Likewise.
3651 * x86_64.cc: Likewise.
3653 2010-12-09 Cary Coutant <ccoutant@google.com>
3655 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3657 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3658 parameter; change all callers.
3659 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3660 * options.h (warn_execstack): New option.
3662 2010-12-07 Doug Kwan <dougkwan@google.com>
3664 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3665 like function call relocations.
3667 2010-12-07 Ian Lance Taylor <iant@google.com>
3669 * archive.cc (Archive::get_elf_object_for_member): Permit
3670 punconfigured to be NULL.
3671 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3672 (Archive::include_member): Pass NULL to get_elf_object_for_member
3673 if we searched for the archive and this is the first included
3676 2010-12-01 Ian Lance Taylor <iant@google.com>
3678 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3679 track_relocs_type_ field.
3680 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3681 Set track_relocs_type_.
3682 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3683 contents when using RELA relocs.
3684 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3686 * reloc.cc (Track_relocs::next_addend): New function.
3687 * reloc.h (class Track_relocs): Declare next_addend.
3689 2010-12-01 Ian Lance Taylor <iant@google.com>
3691 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3694 2010-12-01 Ian Lance Taylor <iant@google.com>
3696 * README: Update compilers known to work and fail.
3698 2010-11-23 Matthias Klose <doko@ubuntu.com>
3700 * configure.in: For --enable-gold, handle value `default' instead of
3701 `both*'. Always install ld as ld.bfd, install as ld if gold is
3703 * configure: Regenerate.
3705 2010-11-18 Doug Kwan <dougkwan@google.com>
3707 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3708 and right_alignment to be zero. Store result alignment only if it is
3709 greater than existing alignment.
3711 2010-11-16 Cary Coutant <ccoutant@google.com>
3714 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3715 Check for ".zdebug_line".
3717 2010-11-16 Doug Kwan <dougkwan@google.com>
3718 Cary Coutant <ccoutant@google.com>
3720 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3721 by reference; adjust all callers.
3722 * output.cc (Output_segment::set_section_addresses): Adjust references
3723 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3725 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3726 end at page boundary.
3728 2010-11-16 Cary Coutant <ccoutant@google.com>
3731 * layout.cc (Layout::choose_output_section): Transform names of
3732 compressed sections even when using a script with a SECTIONS clause.
3733 (Layout::output_section_name): Remove code to transform
3734 compressed debug section names.
3735 * output.cc (Output_section::add_input_section): Use uncompressed
3736 section size when tracking input sections.
3738 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3740 * symtab.h (Symbol::NON_PIC_REF): Remove.
3741 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3742 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3743 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3744 (Symbol::use_plt_offset): Take a flags argument and pass it
3745 directly to needs_dynamic_reloc. Restrict check for undefined
3746 weak symbols to function calls.
3747 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3748 (Target_arm::Scan::global): Use it.
3749 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3750 (Target_arm::Relocate::relocate): Likewise.
3751 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3752 parameter with an r_type parameter. Use get_reference_flags
3754 (Target_arm::Relocate::relocate): Update accordingly.
3755 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3756 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3757 (Target_i386::Scan::global): Likewise.
3758 (Target_i386::Relocate::relocate): Likewise.
3759 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3760 parameter with an r_type parameter. Use get_reference_flags
3762 (Target_i386::Relocate::relocate): Update accordingly.
3763 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3764 (Target_powerpc::Scan::global): Use it.
3765 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3766 (Target_powerpc::Relocate::relocate): Likewise.
3767 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3768 (Target_sparc::Scan::global): Use it.
3769 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3770 (Target_sparc::Relocate::relocate): Likewise.
3771 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3772 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3773 (Target_x86_64::Scan::global): Likewise.
3774 (Target_x86_64::Relocate::relocate): Likewise.
3776 2010-11-08 Doug Kwan <dougkwan@google.com>
3777 Cary Coutant <ccoutant@google.com>
3779 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3780 (Arm_exidx_merge_section::section_contents_): New data member.
3781 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3782 (Arm_input_section::~Arm_input_section): De-allocate memory.
3783 (Arm_input_section::original_contents_): New data member.
3784 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3785 in parameters instead of calling Object::section_contents without
3787 (Arm_output_section::group_section): New parameter TASK. Pass it
3788 to callees that need locking objects.
3789 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3790 to lock EXIDX input sections. Fix a formatting issue. Call
3791 Arm_exidx_merged_section::build_contents to create merged section
3793 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3794 to lock object of stub table owner.
3795 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3796 TEXT_SIZE to initialize data member TEXT_SIZE_.
3797 (Arm_exidx_input_section::addralign): Fix typo in comment.
3798 (Arm_exidx_input_section::text_size): New method.
3799 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3800 that require locking objects. Lock objects before scanning for stubs
3801 and updating local symbols.
3802 (Arm_input_section<big_endian>::init): Copy contents of original
3804 (Arm_input_section<big_endian>::do_write): Use saved contents of
3805 original input section instead of calling Object::section_contents
3807 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3808 size without calling Object::section_size().
3809 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3810 for size. Allocate a buffer for merged EXIDX entries.
3811 (Arm_exidx_merged_section::build_contents): New method.
3812 (Arm_exidx_merged_section::do_write): Move merge section contents
3813 building code to Arm_exidx_merged_section::build_contetns. Write
3814 out contetns in buffer instead of building it on the fly.
3815 (Arm_relobj::make_exidx_input_section): Also pass text section size
3816 to Arm_exidx_input_section constructor.
3817 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3818 (Arm_dynobj::do_read_symbols): Fix memory leak.
3819 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3820 * target.h: (class Task): Add forward declaration.
3821 (Target::relax): Add new parameter TASK and pass it to
3823 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3825 2010-11-05 Cary Coutant <ccoutant@google.com>
3828 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3829 object when reading from the file.
3830 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3832 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3833 when reading section contents.
3834 (get_section_contents): Likewise.
3835 (icf::find_identical_sections): Likewise.
3836 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3837 object when reading from the file.
3838 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3839 the object when doing deferred section layout.
3841 2010-11-03 Nick Clifton <nickc@redhat.com>
3844 * script.h (class Symbol_assignment: name): New member. Returns
3845 the name of the symbol.
3846 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3847 Returns true if the given symbol name is on the list of
3848 assignments wating to be processed.
3849 * archive.cc (should_incldue_member): If the symbol is undefined,
3850 check to see if it is on the list of symbols pending assignment.
3852 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3854 * script-sections.cc (Script_sections::find_memory_region): Check
3855 for a NULL output section pointer.
3857 2010-10-29 Doug Kwan <dougkwan@google.com>
3859 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3860 Output_section::add_relaxed_input_section.
3861 * output.cc (Output_section::add_relaxed_input_section): Add new
3862 arguments LAYOUT and NAME. Set section order index.
3863 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3864 Copy section order index.
3865 * output.h (Output_section::add_relaxed_input_section): Add new
3866 arguments LAYOUT and NAME.
3868 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3870 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3871 NATIVE_OR_CROSS_LINKER.
3872 * testsuite/Makefile.in: Regenerate.
3874 2010-10-20 Doug Kwan <dougkwan@google.com>
3876 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3877 without SHF_LINK_ORDER flags.
3878 * layout.cc (Layout::choose_output_section): Do not filter
3879 SHF_LINK_ORDER flag in a relocatable link.
3881 2010-10-17 Cary Coutant <ccoutant@google.com>
3883 * output.h (Output_segment::set_section_addresses): Change function
3884 signature. Update all callers.
3885 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3887 (Output_segment::set_section_addresses): Align after last TLS
3888 section. Add padding before last relro section instead of after.
3890 2010-10-17 Doug Kwan <dougkwan@google.com>
3892 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3893 GOT output section to be writable.
3895 2010-10-14 Cary Coutant <ccoutant@google.com>
3897 * debug.h (DEBUG_INCREMENTAL): New flag.
3898 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3899 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3901 * incremental.cc (report_command_line): Ignore all forms of
3903 * layout.cc (Layout::Layout): Check parameters for incremental link
3905 * options.cc (General_options::parse_incremental): New function.
3906 (General_options::parse_no_incremental): New function.
3907 (General_options::parse_incremental_full): New function.
3908 (General_options::parse_incremental_update): New function.
3909 (General_options::incremental_mode_): New data member.
3910 (General_options::finalize): Check incremental_mode_.
3911 * options.h (General_options): Update help text for --incremental.
3912 Add --no-incremental, --incremental-full, --incremental-update.
3913 (General_options::Incremental_mode): New enum type.
3914 (General_options::incremental_mode): New function.
3915 (General_options::incremental_mode_): New data member.
3916 * parameters.cc (Parameters::incremental_mode_): New data member.
3917 (Parameters::set_options): Set incremental_mode_.
3918 (Parameters::set_incremental_full): New function.
3919 (Parameters::incremental): New function.
3920 (Parameters::incremental_update): New function.
3921 (set_parameters_incremental_full): New function.
3922 * parameters.h (Parameters::set_incremental_full): New function.
3923 (Parameters::incremental): New function.
3924 (Parameters::incremental_update): New function.
3925 (Parameters::incremental_mode_): New data member.
3926 (set_parameters_incremental_full): New function.
3927 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3928 incremental link mode.
3929 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3930 (Sized_relobj::do_relocate_sections): Likewise.
3931 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3933 * testsuite/Makefile.in: Regenerate.
3934 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3936 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3938 * script-sections.h (class Script_sections): Make
3939 Sections_elements typedef public.
3940 * script-sections.cc (class Sort_output_sections): Add elements_
3941 field. Add constructor which sets it; change all callers.
3942 (Sort_output_sections::is_before): New function.
3943 (Sort_output_sections::operator()): Call is_before.
3944 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3946 * testsuite/script_test_10.sh: New test. Test script section
3948 * testsuite/script_test_10.t: Likewise.
3949 * testsuite/script_test_10.s: Likewise.
3950 * testsuite/Makefile.am: Wrap the cross linker tests and the
3951 common tests into NATIVE_OR_CROSS_LINKER.
3952 (check_SCRIPTS): Add script_test_10.sh.
3953 (check_DATA): Add script_test_10.stdout.
3954 (script_test_10.o, script_test_10): New targets.
3955 (script_test_10.stdout): New target.
3956 * configure, testsuite/Makefile.in: Regenerate.
3958 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3960 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3961 error for the deprecated relocations.
3962 (Target_arm::Scan::global): Likewise.
3963 (Target_arm::Relocate::relocate): Likewise.
3965 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3967 * fileread.cc (Input_file::find_file): Initialize *found_name
3968 and *namep when using the fallback search for case 4.
3970 2010-10-11 Cary Coutant <ccoutant@google.com>
3972 * options.h (class General_options): Redefine -z lazy as an alias for
3973 the negation of -z now.
3975 2010-10-11 Ian Lance Taylor <iant@google.com>
3977 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3980 2010-10-06 Nick Clifton <nickc@redhat.com>
3982 * script-sections.cc(class Memory_region): Remove
3983 current_lma_offset_ field. Rename current_vma_offset_ to
3984 current_offset_. Add last_section_ field.
3985 (Memory_region::get_current_vma_address): Rename to
3986 get_current_address.
3987 (Memory_region::get_current_lma_address): Delete.
3988 (Memory_region::increment_vma_offset): Rename to
3990 (Memory_region::increment_lma_offset): Delete.
3991 (Memory_region::attributes_compatible): New method. Returns
3992 true if the provided section is compatible with the region.
3993 (Memory_region::get_last_section): New method. Returns the last
3994 section to use the region.
3995 (Memory_region::set_last_section): New method. Stores the last
3996 section to use the region.
3997 (Script_sections::block_in_region): New method. Returns true if
3998 a block of memory is contained within a region.
3999 (Script_sections::find_memory_region): New method. Locates a
4000 memory region to be used to set a VMA or LMA address.
4001 (Output_section_definition::set_section_addresses): Add code to
4002 check for addresses set by memory regions.
4003 (Output_segment::set_section_addresses): Remove memory region
4005 (Script_sections::create_segment): Add a warning if a header
4006 segment is created outside of any region.
4007 * script-sections.h (class Script_sections): Add prototypes for
4008 find_memory_region and block_in_region methods.
4009 * testsuite/memory_test.s: Use .long instead of .word.
4010 * testsuite/memory_test.t: Add some more output sections.
4011 * testsuite/memory_test.sh: Update expected output.
4013 2010-10-02 Doug Kwan <dougkwan@google.com>
4015 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4016 defintion to symtab.h
4017 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4018 declaration to defintion.
4020 2010-10-01 Nick Clifton <nickc@redhat.com>
4022 * expression.cc (eval): Replace dummy argument with NULL.
4023 (eval_maybe_dot): Check for a NULL result section pointer.
4024 (Symbol_expression::value): Likewise.
4025 (Dot_expression::value): Likewise.
4026 (BINARY_EXPRESSION): Likewise.
4027 (Max_expression::value): Likewise.
4028 (Min_expression::value): Likewise.
4029 (Absolute_expression::value): Likewise.
4030 (Addr_expression::value_from_output_section): Likewise.
4031 (Loaddddr_expression::value_from_output_section): Likewise.
4032 (Segment_start_expression::value): Likewise.
4033 * script-sections.cc
4034 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4036 (Sections_elememt_dot_assignment::set_section_addresses):
4038 (Output_data_expression::do_write_to_buffer): Likewise.
4039 (Output_section_definition::finalize_symbols): Likewise.
4040 (Output_section_definition::set_section_addresses): Likewise.
4042 2010-09-30 Doug Kwan <dougkwan@google.com>
4044 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4046 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4048 * target.h (Target::can_icf_inline_merge_sections): New virtual
4050 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4052 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4054 * icf.cc (get_section_contents): Inline merge sections only when
4057 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4059 * configure: Regenerate.
4061 2010-09-17 Ian Lance Taylor <iant@google.com>
4063 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4064 * testsuite/Makefile.am (memory_test.o): New target.
4065 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4067 * testsuite/Makefile.in: Rebuild.
4069 2010-09-17 Doug Kwan <dougkwan@google.com>
4071 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4072 defintion if relocation uses GOT entries of the symbol.
4073 * testsuite/icf_safe_test.sh: Fix test.
4074 * testsuite/icf_safe_so_test.sh: Fix test.
4076 2010-09-16 Cary Coutant <ccoutant@google.com>
4078 * script_sections.cc (class Memory_region): Remove "NULL" from
4079 vector initializations.
4081 2010-09-15 Cary Coutant <ccoutant@google.com>
4083 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4084 Resolve forwarding symbols.
4086 2010-09-15 Doug Kwan <dougkwan@google.com>
4088 * gold/testsuite/script_test_3.t: Add ARM special sections.
4089 * gold/testsuite/script_test_4.t: Same.
4090 * gold/testsuite/script_test_5.t: Same.
4091 * gold/testsuite/script_test_6.t: Same.
4092 * gold/testsuite/script_test_7.t: Same.
4093 * gold/testsuite/script_test_7.t: Same.
4094 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4096 2010-09-14 Cary Coutant <ccoutant@google.com>
4098 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4099 (Target_x86_64::Relocate::relocate_tls): Replace check for
4100 saw_tls_block_reloc_ with test for executable section.
4102 2010-09-12 Cary Coutant <ccoutant@google.com>
4104 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4105 position-independent executables to shared libraries need dynamic
4107 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4108 position-independent executables.
4109 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4110 * testsuite/Makefile.in: Regenerate.
4112 2010-09-10 Nick Clifton <nickc@redhat.com>
4115 * testsuite/memory_test.t: Discard any sections that are not
4118 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4121 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4122 "This::" to work around a bug in gcc 4.2.
4124 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4126 2010-09-09 Rafael Espindola <espindola@google.com>
4128 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4129 sections with different PF_X flags in the same segment.
4130 (Layout::find_first_load_seg): Search all segments to find the first
4132 * options.h (rosegment): New.
4134 2010-09-08 Rafael Espindola <espindola@google.com>
4136 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4138 2010-09-08 Doug Kwan <dougkwan@google.com>
4140 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4141 (Arm_relobj::do_relocate_sections): Add new parameter for output
4142 file to match the parent.
4143 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4144 of local symbols instead of input values. Update code to track
4145 changes in gold::relocate_section.
4146 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4147 (Sized_relobj::compute_final_local_value_internal): New methods.
4148 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4149 body into private version of Sized_relobj::compute_final_local_value.
4150 Call the inline method.
4151 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4152 merged symbol value if there is one.
4153 (Symbol_value::has_output_value): New method defintiion.
4154 (Sized_relobj::Compute_final_local_value_status): New enum type.
4155 (Sized_relobj::compute_final_local_value): New methods.
4156 (Sized_relobj::compute_final_local_value_internal): New methods.
4157 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4158 and arm_cortex_a8.sh.
4159 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4160 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4162 * Makefile.in: Regenerate.
4163 * testsuite/arm_bl_out_of_range.s: Update test.
4164 * testsuite/thumb_bl_out_of_range.s: Ditto.
4165 * testsuite/thumb_blx_out_of_range.s: Ditto.
4166 * testsuite/arm_branch_out_of_range.sh: New file.
4167 * testsuite/arm_cortex_a8.sh: Ditto.
4168 * testsuite/arm_cortex_a8_b.s: Ditto.
4169 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4170 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4171 * testsuite/arm_cortex_a8_bl.s: Ditto.
4172 * testsuite/arm_cortex_a8_blx.s: Ditto.
4173 * testsuite/arm_cortex_a8_local.s: Ditto.
4174 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4175 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4177 2010-09-08 Rafael Espindola <espindola@google.com>
4179 * Makefile.am (memory_test.stdout): Run readelf with -W.
4180 * Makefile.in: Regenerate.
4181 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4184 2010-09-08 Rafael Espindola <espindola@google.com>
4186 * script-sections.cc (Script_sections::add_memory_region): Convert
4187 field precision to int.
4188 * script.cc (script_set_section_region, script_set_section_region):
4189 Convert field precision to int.
4191 2010-09-08 Rafael Espindola <espindola@google.com>
4193 * arm.cc (do_finalize_sections): Create the __exidx_start and
4194 __exdix_end symbols even when the section is missing.
4196 2010-09-08 Nick Clifton <nickc@redhat.com>
4198 * README: Remove claim that MEMORY is not supported.
4199 * expression.cc (script_exp_function_origin)
4200 (script_exp_function_length): Move from here to ...
4201 * script.cc: ... here.
4202 (script_set_section_region, script_add_memory)
4203 (script_parse_memory_attr, script_include_directive): New
4205 * script-sections.cc
4206 (class Memory_region): New class.
4207 (class Output_section_definition): Add set_memory_region,
4208 set_section_vma, set_section_lma and get_section_name methods.
4209 (class Script_Sections): Add add_memory_region,
4210 find_memory_region, find_memory_region_origin,
4211 find_memory_region_length and set_memory_region methods.
4212 Have set_section_addresses method walk the list of set memory
4214 Extend the print methos to display memory regions.
4215 * script-sections.h: Add prototypes for new methods.
4216 Add enum for MEMORY region attributes.
4217 * yyscript.y: Add support for parsing MEMORY regions.
4218 * script-c.h: Add prototypes for new functions.
4219 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4220 * testsuite/Makefile.in: Regenerate.
4221 * testsuite/memory_test.sh: New script.
4222 * testsuite/memory_test.s: New assembler source file.
4223 * testsuite/memory_test.t: New linker script.
4225 2010-08-27 Doug Kwan <dougkwan@google.com>
4227 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4228 reference override an existing dynamic weak reference.
4229 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4230 * testsuite/Makefile.in: Regenerate.
4231 * testsuite/dyn_weak_ref.sh: New file.
4232 * testsuite/dyn_weak_ref_1.c: Ditto.
4233 * testsuite/dyn_weak_ref_2.c: Ditto.
4235 2010-08-27 Ian Lance Taylor <iant@google.com>
4237 * incremental.h (class Incremental_input_entry): Add virtual
4240 2010-08-27 Ian Lance Taylor <iant@google.com>
4242 * testsuite/start_lib_test_3.c: Mark t3 as used.
4244 2010-08-27 Nick Clifton <nickc@redhat.com>
4246 * options.cc (version_script): Fix small typo in previous
4249 2010-08-25 Nick Clifton <nickc@redhat.com>
4251 * archive.cc: Formatting fixes: Remove whitespace between
4252 typename and following asterisk. Remove whitespace between
4253 function name and opening parenthesis.
4254 * archive.h: Likewise.
4256 * attributes.cc: Likewise.
4257 * attributes.h: Likewise.
4258 * common.cc: Likewise.
4259 * copy-relocs.cc: Likewise.
4260 * dirsearch.h: Likewise.
4261 * dynobj.cc: Likewise.
4262 * ehframe.cc: Likewise.
4263 * ehframe.h: Likewise.
4264 * expression.cc: Likewise.
4265 * fileread.cc: Likewise.
4266 * fileread.h: Likewise.
4268 * gold-threads.cc: Likewise.
4269 * gold.cc: Likewise.
4270 * i386.cc: Likewise.
4272 * incremental-dump.cc: Likewise.
4273 * incremental.cc: Likewise.
4274 * layout.cc: Likewise.
4275 * layout.h: Likewise.
4276 * main.cc: Likewise.
4277 * merge.cc: Likewise.
4278 * merge.h: Likewise.
4279 * object.cc: Likewise.
4280 * object.h: Likewise.
4281 * options.cc: Likewise.
4282 * options.h: Likewise.
4283 * output.cc: Likewise.
4284 * output.h: Likewise.
4285 * plugin.cc: Likewise.
4286 * plugin.h: Likewise.
4287 * powerpc.cc: Likewise.
4288 * reloc.cc: Likewise.
4289 * script-c.h: Likewise.
4290 * script-sections.cc: Likewise.
4291 * script.cc: Likewise.
4292 * stringpool.cc: Likewise.
4293 * symtab.cc: Likewise.
4294 * symtab.h: Likewise.
4295 * target.cc: Likewise.
4296 * timer.cc: Likewise.
4297 * timer.h: Likewise.
4298 * version.cc: Likewise.
4299 * x86_64.cc: Likewise.
4301 2010-08-24 Nick Clifton <nickc@redhat.com>
4304 * layout.cc (segment_precedes): Sort segments by their physical
4305 addresses, if they have been set.
4307 2010-08-23 Cary Coutant <ccoutant@google.com>
4309 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4311 (Lib_group::include_member): Unlock object after deleting its
4313 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4316 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4317 Cary Coutant <ccoutant@google.com>
4319 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4320 constructor, and set_blocker.
4321 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4323 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4324 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4325 * testsuite/Makefile.am (start_lib_test): New test case.
4326 * testsuite/Makefile.in: Regenerate.
4327 * testsuite/start_lib_test_main.c: New file.
4328 * testsuite/start_lib_test_1.c: New file.
4329 * testsuite/start_lib_test_2.c: New file.
4330 * testsuite/start_lib_test_3.c: New file.
4332 2010-08-19 Ian Lance Taylor <iant@google.com>
4334 * Makefile.in: Rebuild with automake 1.11.1.
4335 * aclocal.m4: Likewise.
4336 * testsuite/Makefile.in: Likewise.
4338 2010-08-19 Ian Lance Taylor <iant@google.com>
4341 * i386.cc (class Output_data_plt_i386): Update declarations.
4342 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4343 local_ifuncs_ fields.
4344 (Target_i386::do_plt_section_for_global): New function.
4345 (Target_i386::do_plt_section_for_local): New function.
4346 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4347 parameter; change all callers. Initialize global_ifuncs_ and
4348 local_ifuncs_. If doing a static link define __rel_iplt_start and
4350 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4351 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4352 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4354 (Target_i386::make_plt_section): New function, broken out of
4355 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4356 (Target_i386::make_plt_entry): Call make_plt_section.
4357 (Target_i386::make_local_ifunc_plt_entry): New function.
4358 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4359 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4360 R_386_IRELATIVE to switch.
4361 (Target_i386::Scan::global): Likewise.
4362 (Target_i386::Relocate::relocate): Likewise.
4363 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4365 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4366 (Target_x86_64::do_plt_section_for_global): New function.
4367 (Target_x86_64::do_plt_section_for_local): New function.
4368 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4369 parameter; change all callers. If doing a static link define
4370 __rela_iplt_start and __rela_iplt_end.
4371 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4372 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4373 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4375 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4376 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4378 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4379 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4380 R_X86_64_IRELATIVE to switch.
4381 (Target_x86_64::Scan::global): Likewise.
4382 (Target_x86_64::Relocate::relocate): Likewise.
4383 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4385 * target.h (class Target): Add plt_section_for_global and
4386 plt_section_for_local functions. Add do_plt_section_for_global
4387 and do_plt_section_for_local virtual functions.
4388 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4389 clarifying comments.
4390 (Symbol::use_plt_offset): Handle IFUNC symbol.
4391 * object.cc (Sized_relobj::Sized_relobj): Initialize
4393 (Sized_relobj::local_has_plt_offset): New function.
4394 (Sized_relobj::local_plt_offset): New function.
4395 (Sized_relobj::set_local_plt_offset): New function.
4396 (Sized_relobj::do_count): Handle IFUNC symbol.
4397 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4398 a bit away from input_shndx_ field. Add set_is_func_symbol and
4399 is_ifunc_symbol functions.
4400 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4401 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4402 local_plt_offsets_ field.
4403 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4404 * output.h (class Output_section_data): Add non-const
4405 output_section function.
4406 (class Output_data_got): Update declarations.
4407 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4408 Add use_plt_offset parameter to global and local constructors.
4409 Change all callers. Change local_sym_index_ field to 31 bits.
4410 Change GSYM_CODE and CONSTANT_CODE accordingly.
4411 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4412 doing a static link don't set sh_link field.
4413 (Output_data_got::Got_entry::write): Use PLT offset if
4415 (Output_data_got::add_global_plt): New function.
4416 (Output_data_got::add_local_plt): New function.
4417 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4418 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4419 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4420 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4421 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4423 * testsuite/ifunc-sel.h: New file.
4424 * testsuite/ifuncmain1.c: New file.
4425 * testsuite/ifuncmain1vis.c: New file.
4426 * testsuite/ifuncmod1.c: New file.
4427 * testsuite/ifuncdep2.c: New file.
4428 * testsuite/ifuncmain2.c: New file.
4429 * testsuite/ifuncmain3.c: New file.
4430 * testsuite/ifuncmod3.c: New file.
4431 * testsuite/ifuncmain4.c: New file.
4432 * testsuite/ifuncmain5.c: New file.
4433 * testsuite/ifuncmod5.c: New file.
4434 * testsuite/ifuncmain6pie.c: New file.
4435 * testsuite/ifuncmod6.c: New file.
4436 * testsuite/ifuncmain7.c: New file.
4437 * configure, testsuite/Makefile.in: Rebuild.
4439 2010-08-18 Ian Lance Taylor <iant@google.com>
4442 (Output_section_incremental_inputs::write_input_files): Add cast
4443 to avoid signed/unsigned comparison warning.
4444 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4446 2010-08-12 Cary Coutant <ccoutant@google.com>
4448 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4450 2010-08-13 Ian Lance Taylor <iant@google.com>
4452 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4454 2010-08-12 Cary Coutant <ccoutant@google.com>
4455 Doug Kwan <dougkwan@google.com>
4457 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4458 defintion overrides non-weak undef, remember that the original undef
4460 * symtab.cc (Symbol_table::sized_write_global): For undef without
4461 an original weak binding, set binding to global in output.
4462 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4463 * testsuite/Makefile.in: Regenerate.
4464 * testsuite/strong_ref_weak_def.sh: New file.
4465 * testsuite/strong_ref_weak_def_1.c: Ditto.
4466 * testsuite/strong_ref_weak_def_2.c: Ditto.
4468 2010-08-12 Cary Coutant <ccoutant@google.com>
4470 * testsuite/incremental_test.sh: Rewrite.
4471 * testsuite/incremental_test_1.c: Rewrite.
4472 * testsuite/incremental_test_2.c: Rewrite.
4474 2010-08-12 Cary Coutant <ccoutant@google.com>
4476 * arm.cc (Target_arm::got_size): Add const.
4477 (Target_arm::got_entry_count): New function.
4478 (Target_arm::plt_entry_count): New function.
4479 (Target_arm::first_plt_entry_offset): New function.
4480 (Target_arm::plt_entry_size): New function.
4481 (Output_data_plt_arm::entry_count): New function.
4482 (Output_data_plt_arm::first_plt_entry_offset): New function.
4483 (Output_data_plt_arm::get_plt_entry_size): New function.
4484 * i386.cc (Target_i386::got_size): Add const.
4485 (Target_i386::got_entry_count): New function.
4486 (Target_i386::plt_entry_count): New function.
4487 (Target_i386::first_plt_entry_offset): New function.
4488 (Target_i386::plt_entry_size): New function.
4489 (Output_data_plt_i386::entry_count): New function.
4490 (Output_data_plt_i386::first_plt_entry_offset): New function.
4491 (Output_data_plt_i386::get_plt_entry_size): New function.
4492 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4493 find_incremental_inputs_sections. Dump incremental_got_plt section.
4494 * incremental.cc: Include target.h.
4495 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4496 parameter. Adjust all callers. Find incremental_got_plt section.
4497 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4499 (Output_section_incremental_inputs::set_final_data_size): Calculate
4500 size of incremental_got_plt section.
4501 (Output_section_incremental_inputs::do_write): Write the
4502 incremental_got_plt section.
4503 (Got_plt_view_info): New struct.
4504 (Local_got_offset_visitor): New class.
4505 (Global_got_offset_visitor): New class.
4506 (Global_symbol_visitor_got_plt): New class.
4507 (Output_section_incremental_inputs::write_got_plt): New function.
4508 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4509 Add parameter. Adjust all callers.
4510 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4511 (Incremental_inputs::got_plt_section): New function.
4512 (Incremental_inputs::got_plt_section_): New data member.
4513 (Incremental_got_plt_reader): New class.
4514 * layout.cc (Layout::create_incremental_info_sections): Add the
4515 incremental_got_plt section.
4516 * object.h (Got_offset_list::get_list): New function.
4517 (Got offset_list::for_all_got_offsets): New function.
4518 (Sized_relobj::local_got_offset_list): New function.
4519 * powerpc.cc (Target_powerpc::got_size): Add const.
4520 (Target_powerpc::got_entry_count): New function.
4521 (Target_powerpc::plt_entry_count): New function.
4522 (Target_powerpc::first_plt_entry_offset): New function.
4523 (Target_powerpc::plt_entry_size): New function.
4524 (Output_data_plt_powerpc::entry_count): New function.
4525 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4526 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4527 * sparc.cc (Target_sparc::got_size): Add const.
4528 (Target_sparc::got_entry_count): New function.
4529 (Target_sparc::plt_entry_count): New function.
4530 (Target_sparc::first_plt_entry_offset): New function.
4531 (Target_sparc::plt_entry_size): New function.
4532 (Output_data_plt_sparc::entry_count): New function.
4533 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4534 (Output_data_plt_sparc::get_plt_entry_size): New function.
4535 * symtab.h (Symbol::got_offset_list): New function.
4536 (Symbol_table::for_all_symbols): New function.
4537 * target.h (Sized_target::got_entry_count): New function.
4538 (Sized_target::plt_entry_count): New function.
4539 (Sized_target::plt_entry_size): New function.
4540 * x86_64.cc (Target_x86_64::got_size): Add const.
4541 (Target_x86_64::got_entry_count): New function.
4542 (Target_x86_64::plt_entry_count): New function.
4543 (Target_x86_64::first_plt_entry_offset): New function.
4544 (Target_x86_64::plt_entry_size): New function.
4545 (Output_data_plt_x86_64::entry_count): New function.
4546 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4547 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4549 2010-08-12 Cary Coutant <ccoutant@google.com>
4551 * archive.cc: Include incremental.h.
4552 (Archive::Archive): Initialize incremental_info_.
4553 (Archive::include_member): Record archive members in incremental info.
4554 (Add_archive_symbols::run): Record begin and end of an archive in
4556 (Lib_group::include_member): Record objects in incremental info.
4557 * archive.h (Incremental_archive_entry): Forward declaration.
4558 (Archive::set_incremental_info): New member function.
4559 (Archive::incremental_info): New member function.
4560 (Archive::Unused_symbol_iterator): New class.
4561 (Archive::unused_symbols_begin): New member function.
4562 (Archive::unused_symbols_end): New member function.
4563 (Archive::incremental_info_): New data member.
4564 * incremental-dump.cc (find_input_containing_global): New function.
4565 (dump_incremental_inputs): Dump new incremental info sections.
4566 * incremental.cc: Include symtab.h.
4567 (Output_section_incremental_inputs): New class.
4568 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4569 new incremental info sections.
4570 (Sized_incremental_binary::do_check_inputs): Likewise.
4571 (Incremental_inputs::report_archive): Remove.
4572 (Incremental_inputs::report_archive_begin): New function.
4573 (Incremental_inputs::report_archive_end): New function.
4574 (Incremental_inputs::report_object): New function.
4575 (Incremental_inputs::finalize_inputs): Remove.
4576 (Incremental_inputs::report_input_section): New function.
4577 (Incremental_inputs::report_script): Rewrite.
4578 (Incremental_inputs::finalize): Do nothing but finalize string table.
4579 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4580 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4581 (Incremental_inputs::create_data_sections): New function.
4582 (Incremental_inputs::relocs_entsize): New function.
4583 (Output_section_incremental_inputs::set_final_data_size): New function.
4584 (Output_section_incremental_inputs::do_write): New function.
4585 (Output_section_incremental_inputs::write_header): New function.
4586 (Output_section_incremental_inputs::write_input_files): New function.
4587 (Output_section_incremental_inputs::write_info_blocks): New function.
4588 (Output_section_incremental_inputs::write_symtab): New function.
4589 * incremental.h (Incremental_script_entry): Forward declaration.
4590 (Incremental_object_entry): Forward declaration.
4591 (Incremental_archive_entry): Forward declaration.
4592 (Incremental_inputs): Forward declaration.
4593 (Incremental_inputs_header_data): Remove.
4594 (Incremental_inputs_header): Remove.
4595 (Incremental_inputs_header_write): Remove.
4596 (Incremental_inputs_entry_data): Remove.
4597 (Incremental_inputs_entry): Remove.
4598 (Incremental_inputs_entry_write): Remove.
4599 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4600 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4601 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4602 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4604 (Incremental_input_entry): New class.
4605 (Incremental_script_entry): New class.
4606 (Incremental_object_entry): New class.
4607 (Incremental_archive_entry): New class.
4608 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4609 (Incremental_inputs::report_inputs): Remove.
4610 (Incremental_inputs::report_archive): Remove.
4611 (Incremental_inputs::report_archive_begin): New function.
4612 (Incremental_inputs::report_archive_end): New function.
4613 (Incremental_inputs::report_object): Change prototype.
4614 (Incremental_inputs::report_input_section): New function.
4615 (Incremental_inputs::report_script): Change prototype.
4616 (Incremental_inputs::get_reloc_count): New function.
4617 (Incremental_inputs::set_reloc_count): New function.
4618 (Incremental_inputs::create_data_sections): New function.
4619 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4620 (Incremental_inputs::inputs_section): New function.
4621 (Incremental_inputs::symtab_section): New function.
4622 (Incremental_inputs::relocs_section): New function.
4623 (Incremental_inputs::get_stringpool): Add const.
4624 (Incremental_inputs::command_line): Add const.
4625 (Incremental_inputs::inputs): Remove.
4626 (Incremental_inputs::command_line_key): New function.
4627 (Incremental_inputs::input_file_count): New function.
4628 (Incremental_inputs::input_files): New function.
4629 (Incremental_inputs::relocs_entsize): New function.
4630 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4631 (Incremental_inputs::finalize_inputs): Remove.
4632 (Incremental_inputs::Input_info): Remove.
4633 (Incremental_inputs::lock_): Remove.
4634 (Incremental_inputs::inputs_): Change type.
4635 (Incremental_inputs::inputs_map_): Remove.
4636 (Incremental_inputs::current_object_entry_): New data member.
4637 (Incremental_inputs::inputs_section_): New data member.
4638 (Incremental_inputs::symtab_section_): New data member.
4639 (Incremental_inputs::relocs_section_): New data member.
4640 (Incremental_inputs::reloc_count_): New data member.
4641 (Incremental_inputs_reader): New class.
4642 (Incremental_symtab_reader): New class.
4643 (Incremental_relocs_reader): New class.
4644 * layout.cc (Layout::finalize): Move finalization of incremental info
4645 and creation of incremental info sections to follow finalization of
4646 symbol table. Set offsets for postprocessing sections.
4647 (Layout::create_incremental_info_sections): Call
4648 Incremental_inputs::create_data_sections. Add incremental symtab
4649 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4650 sections to layout after input sections.
4651 * layout.h (struct Timespec): Forward declaration.
4652 (Layout::incremental_inputs): Add const.
4653 (Layout::create_incremental_info_sections): Add parameter.
4654 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4655 * object.cc: Include incremental.h.
4656 (Relobj::finalize_incremental_relocs): New function.
4657 (Sized_relobj::do_layout): Record input sections in incremental info.
4658 * object.h (Object::output_section): New function.
4659 (Object::output_section_offset): Moved from Relobj.
4660 (Object::get_incremental_reloc_base): New function.
4661 (Object::get_incremental_reloc_count): New function.
4662 (Object::do_output_section): New function.
4663 (Object::do_output_section_offset): Moved from Relobj.
4664 (Object::do_get_incremental_reloc_base): New function.
4665 (Object::do_get_incremental_reloc_count): New function.
4666 (Object::Object): Initialize new data members.
4667 (Relobj::output_section): Renamed do_output_section and moved to
4669 (Relobj::output_section_offset): Moved to Object.
4670 (Relobj::do_get_incremental_reloc_base): New function.
4671 (Relobj::do_get_incremental_reloc_count): New function.
4672 (Relobj::allocate_incremental_reloc_counts): New function.
4673 (Relobj::count_incremental_reloc): New function.
4674 (Relobj::finalize_incremental_relocs): New function.
4675 (Relobj::next_incremental_reloc_index): New function.
4676 (Relobj::reloc_counts_): New data member.
4677 (Relobj::reloc_bases_): New data member.
4678 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4679 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4680 (Sized_relobj::incremental_relocs_scan): New function.
4681 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4682 (Sized_relobj::incremental_relocs_write): New function.
4683 (Sized_relobj::incremental_relocs_write_reltype): New function.
4684 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4686 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4687 archives and object files elsewhere.
4688 (Add_symbols::run): Report object files here.
4689 (Finish_group::run): Report end of archive at end of group.
4690 * reloc.cc: Include layout.h, incremental.h.
4691 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4692 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4693 (Sized_relobj::incremental_relocs_scan): New function.
4694 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4695 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4696 (Sized_relobj::incremental_relocs_write): New function.
4697 (Sized_relobj::incremental_relocs_write_reltype): New function.
4698 * script.cc (read_input_script): Rewrite test for incremental link.
4699 Change call to Incremental_inputs::report_script.
4700 * symtab.h (Symbol_table::first_global_index): New function.
4701 (Symbol_table::output_count): New function.
4703 2010-08-12 Doug Kwan <dougkwan@google.com>
4705 * arm.cc (Target_arm::merge_object_attributes): Check command line
4706 options --no-wchar-size-warning and --no-enum-size-warning.
4707 * options.h (General_options): Add ld-compatible options
4708 --no-enum-size-warning and --no-wchar-size-warning.
4710 2010-08-04 Ian Lance Taylor <iant@google.com>
4712 * x86_64.cc (Target_x86_64::Scan::local): Use
4713 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4714 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4715 (Target_x86_64::Scan::global): Likewise.
4716 (Target_x86_64::Relocate::relocate): Likewise.
4717 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4720 2010-08-03 Cary Coutant <ccoutant@google.com>
4722 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4723 to reserve space in merged_strings vector. Keep total input size
4725 (Output_merge_string::do_print_merge_stats): Print total input size.
4726 * merge.h (Output_merge_string): Add input_size_ field.
4727 * stringpool.cc (Stringpool_template::string_length): Move
4728 implementations out of Stringpool_template class and place in
4730 * stringpool.h (string_length): Move out of Stringpool_template.
4732 2010-08-03 Ian Lance Taylor <iant@google.com>
4735 * layout.cc (relaxation_loop_body): If address of load segment is
4736 set, adjust address to include headers if possible.
4738 2010-08-03 Ian Lance Taylor <iant@google.com>
4740 * version.cc (version_string): Bump to 1.10.
4742 2010-08-03 Ian Lance Taylor <iant@google.com>
4745 * layout.h (enum Output_section_order): Define.
4746 (class Layout): Update declarations.
4747 * layout.cc (Layout::get_output_section): Add order parameter.
4748 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4749 is_first_non_relro parameters. Change all callers.
4750 (Layout::choose_output_section): Likewise.
4751 (Layout::add_output_section_data): Likewise.
4752 (Layout::make_output_section): Likewise. Set order.
4753 (Layout::default_section_order): New function.
4754 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4755 * output.cc (Output_section::Output_section): Initialize order_.
4756 Don't initialize deleted fields.
4757 (Output_segment::Output_segment): Don't initialize deleted
4759 (Output_segment::add_output_section_to_load): New function
4760 replacing add_output_section. Change all callers to call this or
4761 add_output_section_to_nonload.
4762 (Output_segment::add_output_section_to_nonload): New function.
4763 (Output_segment::remove_output_section): Rewrite.
4764 (Output_segment::add_initial_output_data): Likewise.
4765 (Output_segment::has_any_data_sections): Likewise.
4766 (Output_segment::is_first_section_relro): Likewise.
4767 (Output_segment::maximum_alignment): Likewise.
4768 (Output_segment::has_dynamic_reloc): New function replacing
4769 dynamic_reloc_count. Change all callers.
4770 (Output_segment::has_dynamic_reloc_list): New function replacing
4771 dynamic_reloc_count_list. Change all callers.
4772 (Output_segment::set_section_addresses): Rewrite.
4773 (Output_segment::set_offset): Rewrite.
4774 (Output_segment::find_first_and_last_list): Remove.
4775 (Output_segment::set_tls_offsets): Rewrite.
4776 (Output_segment::first_section_load_address): Likewise.
4777 (Output_segment::output_section_count): Likewise.
4778 (Output_segment::section_with_lowest_load_address): Likewise.
4779 (Output_segment::write_section_headers): Likewise.
4780 (Output_segment::print_sections_to_map): Likewise.
4781 * output.h (class Output_data): Remove dynamic_reloc_count_
4782 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4783 (Output_data::add_dynamic_reloc): Rewrite.
4784 (Output_data::has_dynamic_reloc): New function.
4785 (Output_data::dynamic_reloc_count): Remove.
4786 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4787 is_last_relro_, is_first_non_relro_, is_interp_,
4788 is_dynamic_linker_section_ fields. Add order and set_order
4789 functions. Remove is_relro_local, set_is_relro_local,
4790 is_last_relro, set_is_last_relro, is_first_non_relro,
4791 set_is_first_non_relro functions, is_interp, set_is_interp,
4792 is_dynamic_linker_section, and set_is_dynamic_linker_section
4794 (class Output_segment): Change Output_data_list from std::list to
4795 std:;vector. Add output_lists_ field. Remove output_data_ and
4796 output_bss_ fields. Update declarations.
4798 2010-08-02 Ian Lance Taylor <iant@google.com>
4800 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4801 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4802 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4804 2010-08-02 Ian Lance Taylor <iant@google.com>
4807 * script.cc (Script_options::Script_options): Initialize
4808 symbol_definitions_ and symbol_references_.
4809 (Script_options::add_symbol_assignment): Update
4810 symbol_definitions_ and symbol_references_.
4811 (Script_options::add_symbol_reference): New function.
4812 (script_symbol): New function.
4813 * script.h (class Script_options): Add symbol_definitions_ and
4814 symbol_references_ fields.
4815 (Script_options::referenced_const_iterator): New type.
4816 (Script_options::referenced_begin): New function.
4817 (Script_options::referenced_end): New function.
4818 (Script_options::is_referenced): New function.
4819 (Script_options::any_unreferenced): New function.
4820 * script-c.h (script_symbol): Declare.
4821 * yyscript.y (exp): Call script_symbol.
4822 * symtab.cc: Include "script.h".
4823 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4824 Change all callers. Check symbols referenced by scripts.
4825 (Symbol_table::add_undefined_symbols_from_command_line): Add
4826 layout parameter. Change all callers.
4827 (Symbol_table::do_add_undefined_symbols_from_command_line):
4828 Likewise. Break out loop body. Check symbols referenced by
4830 (Symbol_table::add_undefined_symbol_from_command_line): New
4831 function broken out of
4832 do_add_undefined_symbols_from_command_line.
4833 * symtab.h (class Symbol_table): Update declarations.
4834 * archive.cc: Include "layout.h".
4835 (Archive::should_include_member): Add layout parameter. Change
4836 all callers. Check for symbol mentioned in expression.
4837 * archive.h (class Archive): Update declaration.
4838 * object.cc (Sized_relobj::do_should_include_member): Add layout
4840 * object.h (Object::should_include_member): Add layout parameter.
4842 (Object::do_should_include_member): Add layout parameter.
4843 (class Sized_relobj): Update declaration.
4844 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4846 * dynobj.h (class Sized_dynobj): Update declaration.
4847 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4849 * plugin.h (class Sized_pluginobj): Update declaration.
4851 2010-08-02 Ian Lance Taylor <iant@google.com>
4854 * output.cc (Output_segment::set_offset): Search for the first and
4855 last sections rather than assuming that the list is in order.
4856 (Output_segment::find_first_and_last_list): New function.
4857 * output.h (class Output_segment): Update declarations.
4858 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4859 (relro_strip_test_SOURCES): New variable.
4860 (relro_strip_test_DEPENDENCIES): New variable.
4861 (relro_strip_test_LDFLAGS): New variable.
4862 (relro_strip_test_LDADD): New variable.
4863 (relro_strip_test.so): New target.
4865 2010-08-02 Ian Lance Taylor <iant@google.com>
4867 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4868 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4869 (Target_i386::got_tlsdesc_section): New function.
4870 (Target_i386::got_section): Create space for GOT entries for
4871 TLSDESC relocations.
4872 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4874 (Target_i386::Scan::global): Likewise.
4875 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4877 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4878 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4879 (Target_x86_64::got_tlsdesc_section): New function.
4880 (Target_x86_64::got_section): Create space for GOT entries for
4881 TLSDESC relocations.
4882 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4884 (Target_x86_64::Scan::global): Likewise.
4885 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4888 2010-08-02 Ian Lance Taylor <iant@google.com>
4890 * testsuite/final_layout.sh: Use dc to convert from hex to
4893 2010-07-29 Sriraman Tallam <tmsriram@google.com>
4895 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4896 paramter to the call to gold::gc_process_relocs.
4897 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4898 paramter to the call to gold::gc_process_relocs.
4899 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4900 parameter to the call to gold::gc_process_relocs.
4901 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4902 template parameter to the call to gold::gc_process_relocs.
4903 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4904 paramter to the call to gold::gc_process_relocs.
4905 * gc.h (get_embedded_addend_size): New function.
4906 (gc_process_relocs): Save the size of the reloc for use by ICF.
4907 * icf.cc (get_section_contents): Get the addend from the text section
4908 for SHT_REL relocation sections.
4909 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4910 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4911 * int_encoding.h (read_from_pointer): New overloaded function.
4912 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4913 * testsuite/icf_sht_rel_addend_test.sh: New file.
4914 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4915 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4917 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4919 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4920 * Makefile.in: Regenerate.
4921 * testsuite/Makefile.in: Regenerate.
4923 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4925 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4926 * gold/testsuite/debug_msg.cc: Likewise.
4927 * gold/testsuite/odr_violation1.cc
4928 * gold/testsuite/odr_violation2.cc
4930 2010-07-21 Cary Coutant <ccoutant@google.com>
4932 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4933 string, and length fields.
4934 (Output_merge_string::Merged_strings_list): New type.
4935 (Output_merge_string::Merged_strings_lists): New typedef.
4936 (Output_merge_string): Replace merged_strings_ with
4937 merged_strings_lists_.
4938 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4939 Merged_strings_list per input object and section. Don't store pointer
4940 to the string. Don't store length with each merged string entry.
4941 (Output_merge_string::finalize_merged_data): Loop over list of merged
4942 strings lists. Recompute length of each merged string.
4944 2010-07-15 Cary Coutant <ccoutant@google.com>
4946 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4949 2010-07-14 Ian Lance Taylor <iant@google.com>
4951 * descriptors.cc (Descriptors::open): Report correct name in error
4954 2010-07-13 Doug Kwan <dougkwan@google.com>
4956 * arm.cc (Arm_input_section::Arm_input_section): For a
4957 SHT_ARM_EXIDX section, always keeps the input sections.
4958 (Arm_input_section::set_exidx_section_link): New method.
4959 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4960 has_errors_ to false.
4961 (Arm_exidx_input_section::has_errors,
4962 Arm_exidx_input_section::set_has_errors): New methods.
4963 (Arm_exidx_input_section::has_errors_): New data member.
4964 (Arm_relobj::get_exidx_shndx_list): New method.
4965 (Arm_output_section::append_text_sections_to_list): Do not skip
4966 section without SHF_EXECINSTR.
4967 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4969 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4970 section header. Make error messages more verbose. Check for
4971 a non-executable section linked to an EXIDX section.
4972 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4973 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4974 check that there is no deferred EXIDX section if we exit early.
4975 Instead of not making an EXIDX section in case of an error, make one
4976 and set the has_errors flag of it.
4977 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4978 in a relocatable link.
4979 (Target_arm::do_relax): Look for the EXIDX output section instead of
4980 assuming that it is called .ARM.exidx.
4981 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4982 section list. Do not check for SHF_EXECINSTR section flags but
4983 skip any input section with errors.
4984 * output.cc (Output_section::Output_section): Initialize
4985 always_keeps_input_sections_ to false.
4986 (Output_section::add_input_section): Check for
4987 always_keeps_input_sections_.
4988 * output.h (Output_section::always_keeps_input_sections,
4989 Output_section::set_always_keeps_input_sections): New methods.
4990 (Output_section::always_keeps_input_sections): New data member.
4992 2010-07-13 Rafael Espindola <espindola@google.com>
4994 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4995 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4997 2010-07-13 Philip Herron <herron.philip@googlemail.com>
4998 Ian Lance Taylor <iant@google.com>
5000 * output.h (Output_section_lookup_maps::add_merge_section):
5001 Correct check of whether value was inserted.
5002 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5003 (Output_section_lookup_maps::add_relaxed_input_section):
5005 * arm.cc (Target_arm::got_section): Remove used local os.
5006 * i386.cc (Target_i386::got_section): Likewise.
5007 * x86_64.cc (Target_x86_64::got_section): Likewise.
5008 * sparc.cc (Target_sparc::got_section): Likewise.
5009 (Target_sparc::relocate): Remove unused local have_got_offset.
5010 * powerpc.cc (Target_powerpc::relocate): Likewise.
5012 2010-07-13 Ian Lance Taylor <iant@google.com>
5014 * compressed_output.cc (zlib_decompress): Fix signature in
5017 * archive.cc (Archive::include_member): Unlock an external member
5018 of a thin archive. Don't bother to delete an object we know is
5021 2010-07-12 Cary Coutant <ccoutant@google.com>
5023 * compressed_output.cc (zlib_decompress): New function.
5024 (get_uncompressed_size): New function.
5025 (decompress_input_section): New function.
5026 * compressed_output.h (get_uncompressed_size): New function.
5027 (decompress_input_section): New function.
5028 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5029 Handle compressed debug sections.
5030 * layout.cc (is_compressed_debug_section): New function.
5031 (Layout::output_section_name): Map compressed section names to
5033 * layout.h (is_compressed_debug_section): New function.
5034 (is_debug_info_section): Recognize compressed debug sections.
5035 * merge.cc: Include compressed_output.h.
5036 (Output_merge_data::do_add_input_section): Handle compressed
5038 (Output_merge_string::do_add_input_section): Handle compressed
5040 * object.cc: Include compressed_output.h.
5041 (Sized_relobj::Sized_relobj): Initialize new data members.
5042 (build_compressed_section_map): New function.
5043 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5044 * object.h (Object::section_is_compressed): New method.
5045 (Object::do_section_is_compressed): New method.
5046 (Sized_relobj::Compressed_section_map): New type.
5047 (Sized_relobj::do_section_is_compressed): New method.
5048 (Sized_relobj::compressed_sections_): New data member.
5049 * output.cc (Output_section::add_input_section): Handle compressed
5051 * reloc.cc: Include compressed_output.h.
5052 (Sized_relobj::write_sections): Handle compressed debug sections.
5054 2010-07-08 Cary Coutant <ccoutant@google.com>
5056 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5057 weak when resolving to a dynamic def.
5058 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5059 for weak undef/dynamic def cases. Adjust callers.
5060 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5061 undef_binding_weak_.
5062 (Symbol_table::sized_write_globals): Adjust symbol binding.
5063 (Symbol_table::sized_write_symbol): Add binding parameter.
5064 * symtab.h (Symbol::set_undef_binding): New method.
5065 (Symbol::is_undef_binding_weak): New method.
5066 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5067 (Symbol_table::should_override): Add new parameter.
5068 (Symbol_table::sized_write_symbol): Add new parameter.
5070 * testsuite/weak_undef_file1.cc: Add new test case.
5071 * testsuite/weak_undef_file2.cc: Fix header comment.
5072 * testsuite/weak_undef_test.cc: Add new test case.
5074 2010-06-29 Doug Kwan <dougkwan@google.com>
5076 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5077 Initialize USE_SYMBOL_.
5078 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5080 (Arm_reloc_property::uses_symbol_): New data member declaration.
5081 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5082 uses symbol value and symbol is undefined but not weakly undefined.
5084 2010-06-28 Rafael Espindola <espindola@google.com>
5086 * plugin.cc (Plugin::load): Use dlerror.
5088 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5090 * symtab.cc (detect_odr_violations): When reporting an ODR
5091 violation, report an object where the symbol is defined.
5093 2010-06-25 Doug Kwan <dougkwan@google.com>
5095 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5096 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5098 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5099 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5100 target hook to detect function points.
5101 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5102 * icf.h (Icf::check_section_for_function_pointers): Change type of
5103 parameter SECTION_NAME to const reference to std::string. Use
5104 target hook to determine if section may have unsafe pointers.
5105 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5108 2010-06-21 Rafael Espindola <espindola@google.com>
5110 * fileread.cc (Input_file::find_fie): New
5111 (Input_file::open): Use Input_file::find_fie.
5112 * fileread.h (Input_file::find_fie): New
5113 * plugin.cc (set_extra_library_path): New.
5114 (Plugin::load): Add set_extra_library_path to the transfer vector.
5115 (Plugin_manager::set_extra_library_path): New.
5116 (Plugin_manager::add_input_file): Use the extra search path if set.
5117 (set_extra_library_path(): New.
5118 * plugin.h (Plugin_manager): Add set_extra_library_path and
5121 2010-06-19 Cary Coutant <ccoutant@google.com>
5123 * layout.cc (gdb_sections): Add .debug_types.
5124 (lines_only_debug_sections): Likewise.
5126 2010-06-18 Rafael Espindola <espindola@google.com>
5128 * plugin.cc (add_input_file,add_input_library)
5129 (Plugin_manager::add_input_file): Make filename arguments const.
5130 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5133 2010-06-16 Doug Kwan <dougkwan@google.com>
5135 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5136 .ARM.attributes section if we have not merged any input
5137 attributes sections.
5139 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5141 * arm.cc: Allow combining objects with no EABI version
5144 2010-06-15 Rafael Espindola <espindola@google.com>
5146 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5148 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5150 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5151 (struct iovec): Correct !HAVE_READV definition.
5153 2010-06-10 Cary Coutant <ccoutant@google.com>
5155 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5156 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5158 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5161 * symtab.h (Symbol::is_placeholder): New member function.
5162 * target-reloc.h (relocate_section): Check for placeholder symbols.
5164 * testsuite/Makefile.am (plugin_test_8): New test.
5165 (plugin_test_9): New test.
5166 * testsuite/Makefile.in: Regenerate.
5168 2010-06-09 Nick Clifton <nickc@redhat.com>
5170 * yyscript.y (input_list_element): Allow strings prefixed with
5171 the '-' character. Treat these as libraries.
5172 * script.cc (script_add_library): New function. Adds a library
5173 specified by "-l<name>" found in an input script.
5174 * script-c.h: Add prototype for script_add_library.
5176 2010-06-07 Doug Kwan <dougkwan@google.com>
5178 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5179 Restrict stub-group size to be within long conditional branch
5180 range when working around cortex-A8 erratum.
5182 2010-06-07 Damien Diederen <dd@crosstwine.com>
5184 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5187 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5191 (Output_section::Input_section_sort_entry::compare_section_ordering):
5192 Change to return non-zero correctly.
5193 (Output_section::Input_section_sort_section_order_index_compare
5194 ::operator()): Change to fix ambiguity in comparisons.
5196 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5198 * gold.h (is_wildcard_string): New function.
5199 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5200 (Layout::layout_eh_frame): Ditto.
5201 (Layout::find_section_order_index): New method.
5202 (Layout::read_layout_from_file): New method.
5203 * layout.h (Layout::find_section_order_index): New method.
5204 (Layout::read_layout_from_file): New method.
5205 (Layout::input_section_position_): New private member.
5206 (Layout::input_section_glob_): New private member.
5207 * main.cc (main): Call read_layout_from_file here.
5208 * options.h (--section-ordering-file): New option.
5209 * output.cc (Output_section::input_section_order_specified_): New
5211 (Output_section::Output_section): Initialize new member.
5212 (Output_section::add_input_section): Add new parameter.
5213 Keep input sections when --section-ordering-file is used.
5214 (Output_section::set_final_data_size): Sort input sections when
5215 section ordering file is specified.
5216 (Output_section::Input_section_sort_entry): Add new parameter.
5218 (Output_section::Input_section_sort_entry::compare_section_ordering):
5220 (Output_section::Input_section_sort_compare::operator()): Change to
5221 consider section_order_index.
5222 (Output_section::Input_section_sort_init_fini_compare::operator()):
5223 Change to consider section_order_index.
5224 (Output_section::Input_section_sort_section_order_index_compare
5225 ::operator()): New method.
5226 (Output_section::sort_attached_input_sections): Change to sort
5227 according to section order when specified.
5228 (Output_section::add_input_section<32, true>): Add new parameter.
5229 (Output_section::add_input_section<64, true>): Add new parameter.
5230 (Output_section::add_input_section<32, false>): Add new parameter.
5231 (Output_section::add_input_section<64, false>): Add new parameter.
5232 * output.h (Output_section::add_input_section): Add new parameter.
5233 (Output_section::input_section_order_specified): New
5235 (Output_section::set_input_section_order_specified): New method.
5236 (Input_section::Input_section): Initialize section_order_index_.
5237 (Input_section::section_order_index): New method.
5238 (Input_section::set_section_order_index): New method.
5239 (Input_section::section_order_index_): New member.
5240 (Input_section::Input_section_sort_section_order_index_compare): New
5242 (Output_section::input_section_order_specified_): New member.
5243 * script-sections.cc (is_wildcard_string): Delete and move modified
5245 (Output_section_element_input::Output_section_element_input): Modify
5246 call to is_wildcard_string.
5247 (Output_section_element_input::Input_section_pattern
5248 ::Input_section_pattern): Ditto.
5249 (Output_section_element_input::Output_section_element_input): Ditto.
5250 * testsuite/Makefile.am (final_layout): New test case.
5251 * testsuite/Makefile.in: Regenerate.
5252 * testsuite/final_layout.cc: New file.
5253 * testsuite/final_layout.sh: New file.
5255 2010-06-01 Rafael Espindola <espindola@google.com>
5257 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5259 2010-06-01 Rafael Espindola <espindola@google.com>
5261 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5262 visibility of symbols.
5264 2010-05-27 Doug Kwan <dougkwan@google.com>
5266 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5267 from start of output section instead of address for a local symbol
5268 in a merged or relaxed section when doing a relocatable link.
5270 2010-05-26 Rafael Espindola <espindola@google.com>
5273 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5274 adding sections the garbage collector removed.
5275 * gold/testsuite/Makefile.am: Add test.
5276 * gold/testsuite/Makefile.in: Regenerate.
5277 * gold/testsuite/plugin_test_7.sh: New.
5278 * gold/testsuite/plugin_test_7_1.c: New.
5279 * gold/testsuite/plugin_test_7_2.c: New.
5281 2010-05-26 Rafael Espindola <espindola@google.com>
5283 * script-sections.cc (Output_section_definition::set_section_addresses):
5284 Check for --section-start.
5286 2010-05-26 Doug Kwan <dougkwan@google.com>
5288 * arm.cc (Arm_scan_relocatable_relocs): New class.
5289 (Target_arm::relocate_special_relocatable): New method.
5290 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5291 (Arm_relocate_functions::thumb_branch_common): Same.
5292 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5293 instead of Default_scan_relocatable_relocs.
5294 * target-reloc.h (relocate_for_relocatable): Let target handle
5295 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5296 * target.h (Sized_target::relocate_special_relocatable): New method.
5298 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5300 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5302 2010-05-23 Doug Kwan <dougkwan@google.com>
5304 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5306 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5307 with a direct branch, not a conditional branch, to a stub.
5308 * merge.cc (Output_merge_base::record_input_section): New method
5310 (Output_merge_data::do_add_input_section): Record input section if
5311 keeps-input-sections flag is set.
5312 (Output_merge_string::do_add_input_section): Ditto.
5313 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5314 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5316 (Output_merge_base::keeps_input_sections,
5317 Output_merge_base::set_keeps_input_sections,
5318 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5320 (Output_merge_base::Input_sections): New type declaration.
5321 (Output_merge_base::input_sections_begin,
5322 Output_merge_base::input_sections_end,
5323 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5324 (Output_merge_base::bool keeps_input_sections_,
5325 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5326 Output_merge_base::input_sections_): New data members.
5327 (Output_merge_data::do_set_keeps_input_sections): New method
5329 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5330 * output.cc (Output_section::Input_section::relobj): Move method
5331 defintion from class declaration to here and handle merge sections.
5332 (Output_section::Input_section::shndx): Ditto.
5333 (Output_section::Output_section): Remove initializations of removed
5334 data members and initialize new data member LOOKUP_MAPS_.
5335 (Output_section::add_input_section): Set keeps-input-sections flag
5336 for a newly created merge output section as appropriate. Adjust code
5337 to use Output_section_lookup_maps class.
5338 (Output_section::add_relaxed_input_section): Adjst code for lookup
5339 maps code refactoring.
5340 (Output_section::add_merge_input_section): Add a new parameter
5341 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5342 class. If adding input section to a newly created merge output
5343 section fails, remove the new merge section.
5344 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5345 Adjust code for use of the Output_section_lookup_maps class.
5346 (Output_section::find_merge_section): Ditto.
5347 (Output_section::build_lookup_maps): New method defintion.
5348 (Output_section::find_relaxed_input_section): Adjust code to use
5349 Output_section_lookup_maps class.
5350 (Output_section::get_input_sections): Export merge sections. Adjust
5351 code to use Output_section_lookup_maps class.
5352 (Output_section:::add_script_input_section): Adjust code to use
5353 Output_section_lookup_maps class. Update lookup maps for merge
5355 (Output_section::discard_states): Use Output_section_lookup_maps.
5356 (Output_section::restore_states): Same.
5357 * output.h (Merge_section_properties): Move class defintion out of
5359 (Output_section_lookup_maps): New class.
5360 (Output_section::Input_section::is_merge_section): New method
5362 (Output_section::Input_section::relobj): Move defintion out of class
5363 defintion. Declare method only.
5364 (Output_section::Input_section::shndx): Ditto.
5365 (Output_section::Input_section::output_merge_base): New method defintion.
5366 (Output_section::Input_section::u2_.pomb): New union field.
5367 (Output_section::Merge_section_by_properties_map,
5368 Output_section::Output_section_data_by_input_section_map,
5369 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5371 (Output_section::add_merge_input_section): Add new parameter
5372 KEEPS_INPUT_SECTIONS.
5373 (Output_section::build_lookup_maps): New method declaration.
5374 (Output_section::merge_section_map_,
5375 Output_section::merge_section_by_properties_map_,
5376 Output_section::relaxed_input_section_map_,
5377 Output_section::is_relaxed_input_section_map_valid_): Remove data
5379 (Output_section::lookup_maps_): New data member.
5381 2010-05-21 Doug Kwan <dougkwan@google.com>
5384 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5385 avoid a compilation error.
5387 2010-05-19 Rafael Espindola <espindola@google.com>
5389 * script-sections.cc (Output_section_definition::allocate_to_segment):
5390 Update the phdrs_list even when the output section is NULL.
5391 * testsuite/Makefile.am: Add test.
5392 * testsuite/Makefile.in: Regenerate.
5393 * testsuite/script_test_9.cc: New.
5394 * testsuite/script_test_9.sh: New.
5395 * testsuite/script_test_9.t: New.
5397 2010-05-19 Doug Kwan <dougkwan@google.com>
5399 * arm.cc (Arm_input_section::original_size): New method.
5400 (Arm_input_section::do_addralign): Add a cast.
5401 (Arm_input_section::do_output_offset): Remove static cast.
5402 (Arm_input_section::original_addralign,
5403 Arm_input_section::original_size_): Change type to uint32_t.
5404 (Arm_input_section::init): Add safe casts for section alignment
5406 (Arm_input_section::set_final_data_size): Do not set address and
5407 offset of stub table.
5408 (Arm_output_section::fix_exidx_coverage): Change use of of
5409 Output_section::Simple_input_section to that of
5410 Output_section::Input_section.
5411 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5412 except for the first pass.
5413 * output.cc (Output_section::get_input_sections): Change type of
5414 input_sections to std::list<Input_section>.
5415 (Output_section::add_script_input_section): Rename from
5416 Output_section::add_simple_input_section. Change type of SIS
5417 parameter from Simple_input_section to Input_section.
5418 * output.h (Output_section::Simple_input_section): Remove class.
5419 (Output_section::Input_section): Change class visibility to public.
5420 (Output_section::Input_section::addralign): Use stored alignments
5421 for special input sections if set.
5422 (Output_section::Input_section::set_addralign): New method.
5423 (Output_section::get_input_sections): Change parameter type from
5424 list of Simple_input_section to list of Input_section.
5425 (Output_section::add_script_input_section): Rename from
5426 Output_section::add_simple_input_section. Change first parameter's
5427 type from Simple_input_section to Input_section and remove the
5428 second and third parameters.
5429 * script-sections.cc (Input_section::Input_section_list): Change
5430 type to list of Output_section::Input_section/
5431 (Input_section_info::Input_section_info): Change parameter type of
5432 INPUT_SECTION to Output_section::Input_section.
5433 (Input_section_info::input_section): Change return type.
5434 (Input_section_info::input_section_): Change type to
5435 Output_section::Input_section.
5436 (Output_section_element_input::set_section_addresses): Adjust code
5437 to use Output_section::Input_section instead of
5438 Output_section::Simple_input_section. Adjust code for renaming
5439 of Output_section::add_simple_input_section.
5440 (Orphan_output_section::set_section_addresses): Ditto.
5442 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5444 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5445 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5447 2010-05-18 Rafael Espindola <espindola@google.com>
5449 * options.cc (General_options::finalize): Handle -nostdlib.
5450 * options.h (nostdlib): New option.
5451 * script.cc (script_add_search_dir): Handle -nostdlib.
5453 2010-05-12 Doug Kwan <dougkwan@google.com>
5455 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5456 attributes section only if there no attributes section after merging.
5457 (Target_arm::merge_object_attributes): Move value of
5458 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5459 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5460 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5461 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5462 and arm_attr_merge_7.stdout.
5463 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5464 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5465 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5466 arm_attr_merge_7b.o): New rules.
5467 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5469 * testsuite/Makefile.in: Regenerate.
5470 * testsuite/arm_attr_merge.sh: New file.
5471 * testsuite/arm_attr_merge_[67][ab].s: Same.
5473 2010-05-05 Nick Clifton <nickc@redhat.com>
5475 * po/es.po: Updated Spanish translation.
5477 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5479 * Makefile.am (install-exec-local): Properly install gold as
5480 default cross linker.
5481 * Makefile.in: Regenerated.
5483 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5484 Nick Clifton <nickc@redhat.com>
5486 * configure.ac (install_as_default): Define and set to false
5487 unless --enable-gold or --enable-gold=both/gold has been
5489 * configure: Regenerate.
5491 * Makefile.am (install-exec-local): Install the executable as
5492 'ld.gold'. If install_as_default is true then also install it as
5494 * Makefile.in: Regenerated.
5496 2010-04-24 Ian Lance Taylor <iant@google.com>
5498 * layout.cc (Layout::layout_reloc): In relocatable link don't
5499 combine reloc sections for grouped sections.
5501 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5503 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5504 sections that are not ordinary to icf.
5505 * icf.cc (get_section_contents): Handle relocation pointing to section
5506 with no object or shndx information.
5507 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5508 * testsuite/Makefile.in: Regenerate.
5509 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5510 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5512 2010-04-22 Ian Lance Taylor <iant@google.com>
5514 * expression.cc (Expression::Expression_eval_info): Add
5515 result_alignment_pointer field.
5516 (Expression::eval_with_dot): Add result_alignment_pointer
5517 parameter. Change all callers.
5518 (Expression::eval_maybe_dot): Likewise.
5519 (class Binary_expression): Add alignment_pointer parameter to
5520 left_value and right_value. Change all callers.
5521 (BINARY_EXPRESSION): Set result alignment.
5522 (class Trinary_expression): Add alignment_pointer parameter to
5523 arg2_value and arg3_value. Change all callers.
5524 (Trinary_cond::value): Set result alignment.
5525 (Max_expression::value, Min_expression::value): Likewise.
5526 (Align_expression::value): Likewise.
5527 * script-sections.cc (class Sections_element): Add dot_alignment
5528 parameter to set_section_addresses virtual function. Update
5530 (class Output_section_element): Likewise.
5531 (Script_sections::create_segments): Add dot_alignment parameter.
5533 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5534 (Script_sections::set_phdrs_clause_addresses): Likewise.
5535 * script-sections.h: Update declarations.
5536 * script.h: Update declarations.
5537 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5539 * testsuite/script_test_3.t: Set large alignment.
5540 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5541 segment has expected alignment.
5543 2010-04-22 Nick Clifton <nickc@redhat.com>
5545 * po/gold.pot: Updated by the Translation project.
5546 * po/vi.po: Updated Vietnamese translation.
5548 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5550 * testsuite/Makefile.am (check_PROGRAMS): Add
5551 icf_virtual_function_folding_test.
5552 * testsuite/Makefile.in: Regenerated.
5554 2010-04-15 Andrew Haley <aph@redhat.com>
5556 * options.h (merge_exidx_entries): New option.
5557 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5558 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5559 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5560 (Target_arm::merge_exidx_entries): New function.
5561 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5562 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5563 to Arm_exidx_fixup constructor.
5564 Add new arg, merge_exidx_entries.
5565 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5566 Arm_output_section::fix_exidx_coverage.
5568 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5570 * icf.cc (get_section_contents): Check for preemptible functions.
5571 Ignore addend when appropriate.
5572 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5574 (add_from_relobj): Check for section folded.
5575 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5576 * symtab.h (should_add_dynsym_entry): Add new parameter.
5577 * target-reloc.h (scan_relocs): Check for section folded.
5578 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5579 Check reloc types for function pointers in shared objects.
5580 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5582 (icf_preemptible_functions_test): New test case.
5583 (icf_string_merge_test): New test case.
5584 * testsuite.Makefile.in: Regenerate.
5585 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5586 bar_glob. Refactor code.
5587 * testsuite/icf_preemptible_functions_test.cc: New file.
5588 * testsuite/icf_preemptible_functions_test.sh: New file.
5589 * testsuite/icf_string_merge_test.cc: New file.
5590 * testsuite/icf_string_merge_test.sh: New file.
5591 * testsuite/icf_virtual_function_folding_test.cc: New file.
5592 * testsuite/icf_virtual_function_folding_test.sh: New file.
5594 2010-04-14 Doug Kwan <dougkwan@google.com>
5596 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5597 for local symbol recounting if we remove a section due to ICF.
5598 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5599 there are no regular objects in input.
5601 2010-04-13 Doug Kwan <dougkwan@google.com>
5603 * arm.cc (Arm_input_section::set_final_data_size): Compute
5604 accurate final data size instead of using current data size.
5606 2010-04-09 Doug Kwan <dougkwan@google.com>
5608 * layout.cc (Layout::choose_output_section): Handle script section
5610 (Layout::make_output_section_for_script): Add section type parameter.
5611 Handle script section types.
5612 * layout.h (Layout::make_output_section_for_script): Add section
5614 * output.cc (Output_section::Output_section): Initialize data member
5616 (Output_section::do_reset_address_and_file_offset): Do not set address
5617 to 0 if section is a NOLOAD section.
5618 * output.h (Output_section::is_noload): New method.
5619 (Output_section::set_is_noload): Ditto.
5620 (Output_section::is_noload_): New data member.
5621 * script-c.h (Script_section_type): New enum type.
5622 (struct Parser_output_section_header): Add new file section_type.
5623 * script-sections.cc (Sections_element::output_section_name): Add
5624 parameter for returning script section type.
5625 (Output_section_definition::output_section_name): Ditto.
5626 (Output_section_definition::section_type)P; New method.
5627 (Output_section_definiton::script_section_type_name): Ditto.
5628 (Output_section_definition::script_section_type_): New data member.
5629 (Output_section_definition::Output_section_definition): Initialize
5630 data member Output_section_definition::script_section_type_.
5631 (Output_section_definition::create_sections): Pass script section type
5632 to Layout::make_output_section_for_script.
5633 (Output_section_definition::output_section_name): Return script
5634 section type to caller.
5635 (Output_section_definition::set_section_address): Do not advance
5636 dot value and load address if section type is NOLOAD. Set address
5637 of NOLOAD sections regardless of section flags.
5638 (Output_section_definition::print): Print section type if it is
5639 not SCRIPT_SECTION_TYPE_NONE.
5640 (Output_section_definition::section_type): New method.
5641 (Output_section_definition::script_section_type_name): Ditto.
5642 (Script_sections::output_section_name): Add new parameter
5643 PSECTION_TYPE for returning script section type. Pass it to
5644 section elements. Handle discard sections.
5645 (Sort_output_sections::operator()): Handle NOLOAD sections.
5646 * script-sections.h (Script_sections::Section_type): New enum type.
5647 (Script_sections::output_section_name): Add a new parameter for
5648 returning script section type.
5649 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5651 * yyscript.y (union): Add new field SECTION_TYPE.
5652 (COPY, DSECT, INFO, NOLOAD): New tokens.
5653 (opt_address_and_section_type): Change type to output_section_header.
5654 (section_type): New non-terminal
5655 (section_header): Handle section type.
5656 (opt_address_and_section_type): Return section type value.
5658 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5660 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5661 * testsuite/plugin_common_test_2.c (foo): Likewise.
5663 2010-04-08 Doug Kwan <dougkwan@google.com>
5665 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5667 * output.cc (Output_section::add_merge_input_section): Simplify
5668 code and return status of Output_merge_base::add_input_section.
5669 Update merge section map only if Output_merge_base::add_input_section
5672 2010-04-07 Doug Kwan <dougkwan@google.com>
5674 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5675 if section is marked as containing instructions but has no mapping
5677 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5678 correct section index.
5679 (Arm_relobj::find_linked_text_section): Ditto.
5681 2010-04-07 Cary Coutant <ccoutant@google.com>
5683 * archive.cc (include_member): Destroy Read_symbols_data object before
5685 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5686 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5687 (Read_symbols_data::~Read_symbols_data) New destructor.
5688 (Section_relocs::Section_relocs) New constructor.
5689 (Section_relocs::~Section_relocs) New destructor.
5690 (Read_relocs_data::Read_relocs_data) New constructor.
5691 (Read_relocs_data::~Read_relocs_data) New destructor.
5692 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5693 pointers to NULL after deleting.
5695 2010-04-07 Doug Kwan <dougkwan@google.com>
5697 * arm.cc: Replace "endianity" with "endianness" in comments.
5698 (Arm_exidx_cantunwind): Ditto.
5699 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5700 (Arm_relobj::merge_flags_and_attributes): New method.
5701 (Arm_relobj::merge_flags_and_attributes_): New data member.
5702 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5703 (Arm_relobj::scan_sections_for_stubs): Ditto.
5704 (Arm_relobj::do_read_symbols): Check to see if we really want to
5705 merge processor-specific flags and attributes. Exit early if
5706 an object is empty except for section names and the undefined symbol.
5707 (Target_arm::do_finalize_sections): Move check for ELF format to
5708 Arm_relobj::do_read_symbols. Merge processor specific flags and
5709 attributes from a regular object only when we have determined that
5710 it is aapropriate. Do not create an .ARM.attributes section in
5711 output if there is no regular input object.
5712 (Target_arm::merge_processor_specific_flags): Check
5713 --warn-mismatch before printing any error.
5714 (Target_arm::merge_object_attributes): Ditto.
5715 * gold.cc (queue_middle_tasks): Handle the case in which there is
5716 no regular object in input.
5717 * options.cc (General_options::parse_EB): New method.
5718 (General_options::parse_EL): Same.
5719 (General_options::General_options): Initialize endianness_.
5720 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5722 (General_options::Endianness): New enum.
5723 (General_options::endianness): New method.
5724 (General_options::endianness_): New data member.
5725 * parameters.cc (Parameters::set_options): Check target endianness.
5726 (Parameters::set_target_once): Ditto.
5727 (Parameters::check_target_endianness): New method.
5728 (parameters_force_valid_target): If either -EL or -EB is specified,
5729 use it to define endianness of default target.
5730 * parameters.h (Parameters::check_target_endianness): New method
5732 * target.h (class Target): Change "endianity" to "endianness"
5735 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5737 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5738 * configure: Regenerate.
5739 * Makefile.in: Regenerate.
5740 * testsuite/Makefile.in: Regenerate.
5742 2010-04-06 Cary Coutant <ccoutant@google.com>
5745 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5746 prevailing definitions of common symbols.
5747 * testsuite/plugin_test_6.sh: New test case.
5748 * testsuite/plugin_common_test_1.c: New test case.
5749 * testsuite/plugin_common_test_2.c: New test case.
5750 * testsuite/Makefile.am (plugin_test_6): New test case.
5751 * testsuite/Makefile.in: Regenerate.
5753 2010-04-06 Nick Clifton <nickc@redhat.com>
5755 * po/vi.po: New Vietnamese translation.
5757 2010-03-30 Doug Kwan <dougkwan@google.com>
5759 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5761 2010-03-25 Doug Kwan <dougkwan@google.com>
5763 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5764 to avoid a conversion warning on a 32-bit host.
5766 2010-03-24 Ian Lance Taylor <iant@google.com>
5768 * testsuite/script_test_3.t: Add a TLS segment.
5769 * testsuite/Makefile.am (check_PROGRAMS): Add
5770 tls_phdrs_script_test.
5771 (tls_phdrs_script_test_SOURCES): Define.
5772 (tls_phdrs_script_test_DEPENDENCIES): Define.
5773 (tls_phdrs_script_test_LDFLAGS): Define.
5774 (tls_phdrs_script_test_LDADD): Define.
5775 * testsuite/Makefile.in: Rebuild.
5777 2010-03-23 Cary Coutant <ccoutant@google.com>
5779 * fileread.cc (find_or_make_view): Fix comment.
5781 2010-03-23 Ian Lance Taylor <iant@google.com>
5783 * script-sections.cc (class Orphan_section_placement): Define
5784 PLACE_TLS and PLACE_TLS_BSS.
5785 (Orphan_section_placement::Orphan_section_placement): Initialize
5787 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5788 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5789 (tls_script_test_SOURCES): Define.
5790 (tls_script_test_DEPENDENCIES): Define.
5791 (tls_script_test_LDFLAGS): Define.
5792 (tls_script_test_LDADD): Define.
5793 * testsuite/Makefile.in: Rebuild.
5795 2010-03-22 Doug Kwan <dougkwan@google.com>
5797 * arm.cc (Arm_relocate_functions::abs8,
5798 Arm_relocate_functions::abs16): Use correct check for overflow
5799 specified in the ARM ELF specs.
5800 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5801 target of a BLX instruction specially.
5802 (Reloc_stub::stub_type_for_reloc): Ditto.
5803 (Relocate::relocate): Use symbolic names instead of numeric relocation
5804 codes to report error.
5805 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5807 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5808 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5809 thumb2_blx_out_of_range.stdout
5810 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5811 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5812 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5813 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5814 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5815 thumb2_blx_in_range, thumb2_blx_in_range.o,
5816 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5817 thumb2_blx_out_of_range.o): New rules.
5818 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5819 thumb2_blx_in_range and thumb2_blx_out_of_range.
5820 * testsuite/Makefile.in: Regenerate.
5821 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5822 * testsuite/thumb_blx_in_range.s: New file.
5823 * testsuite/thumb_blx_out_of_range.s: New file.
5825 2010-03-22 Rafael Espindola <espindola@google.com>
5827 * archive.cc (Should_include): Move to archive.h.
5828 (should_include_member): Make it a member of Archive.
5830 (Add_lib_group_symbols): New.
5831 * archive.h: Include options.h.
5832 (Archive_member): Moved from Archive.
5833 (Should_include): Moved from archive.cc.
5835 (Add_lib_group_symbols): New.
5836 * dynobj.cc (do_should_include_member): New.
5837 * dynobj.h (do_should_include_member): New.
5838 * gold.cc (queue_initial_tasks): Update call to queue.
5839 * main.cc (main): Print lib group stats.
5840 * object.cc (do_should_include_member): New.
5841 * object.h: Include archive.h.
5842 (Object::should_include_member): New.
5843 (Object::do_should_include_member): New.
5844 (Sized_relobj::do_should_include_member): New.
5845 * options.cc (General_options::parse_start_lib): New.
5846 (General_options::parse_end_lib): New.
5847 (Input_arguments::add_file): Handle lib groups.
5848 (Input_arguments::start_group): Check we are not in a lib.
5849 (Input_arguments::start_lib): New.
5850 (Input_arguments::end_lib): New.
5851 * options.h (General_options): Add start_lib and end_lib.
5852 (Input_argument::lib_): New.
5853 (Input_argument::lib): New.
5854 (Input_argument::is_lib): New.
5855 (Input_file_lib): New.
5856 (Input_arguments::in_lib_): New.
5857 (Input_arguments::in_lib): New.
5858 (Input_arguments::start_lib): New.
5859 (Input_arguments::end_lib_): New.
5860 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5861 in unused members as preempted.
5862 (Sized_pluginobj::do_should_include_member): New.
5863 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5864 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5866 (Read_symbols::do_whole_lib_group): New.
5867 (Read_symbols::do_lib_group): New.
5868 (Read_symbols::do_read_symbols): Handle lib groups.
5869 (Read_symbols::get_name): Handle lib groups.
5870 * readsyms.h (Read_symbols): Add an archive member pointer.
5871 (Read_symbols::do_whole_lib_group): New.
5872 (Read_symbols::do_lib_group): New.
5873 (Read_symbols::member_): New.
5874 * script.cc (read_input_script): Update call to queue_soon.
5876 2010-03-19 Doug Kwan <dougkwan@google.com>
5878 * arm.cc (Stub_table::Stub_table): Initialize new data members
5879 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5880 (Stub_table::add_reloc_stub): Assign stub offset and update
5881 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5882 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5884 (Stub_table::update_data_size_and_addralign): Use
5885 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5886 instead of going over all reloc stubs.
5887 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5888 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5889 Stringpool_template::offset_ to size of Stringpool_char.
5890 (Stringpool_template::new_key_offset): Remove code to initialize
5891 Stringpool_template::offset_.
5892 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5893 Stringpool_template::offset_ to zero.
5895 2010-03-15 Doug Kwan <dougkwan@google.com>
5897 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5899 (Stringpool_template::new_key_offset): New method.
5900 (Stringpool_template::add_string): Assign offsets when adding new
5902 (Stringpool_template::set_string_offsets): Do not set string offsets
5903 when not optimizing.
5904 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5906 (Chunked_vector::clear): Clear size_.
5907 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5908 (Chunked_vector::size): Return size_.
5909 (Chunked_vector::push_back): Use size_ to find insert position.
5910 (Chunked_vector::size_): New data member.
5911 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5912 (Stringpool_template::new_key_offset): New method declaration.
5913 (Stringpool_template::offset_): New data member.
5915 2010-03-15 Rafael Espindola <espindola@google.com>
5917 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5918 Add_symbols' constructor.
5919 * readsyms.h (Add_symbols): Remove the input_group member.
5921 2010-03-10 Ian Lance Taylor <iant@google.com>
5923 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5924 target to ask whether a reference to a symbol requires a stack
5926 * target.h (Target::is_call_to_non_split): New function.
5927 (Target::do_is_call_to_non_split): Declare virtual function.
5928 * target.cc: Include "symtab.h".
5929 (Target::do_is_call_to_non_split): New function.
5930 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5932 2010-03-10 Cary Coutant <ccoutant@google.com>
5934 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5935 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5936 (File_read::open[2]): Add whole_file_view_ to list of views.
5937 (File_read::make_view): Remove test of whole_file_view_.
5938 (File_read::find_or_make_view): Create whole_file_view_ if
5940 (File_read::clear_views): Replace bool parameter with enum;
5941 adjust all callers. Don't delete views with permanent data;
5942 do delete cached views and views from archives if
5943 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5944 if clearing the corresponding view.
5945 * fileread.h (File_read::Clear_views_mode): New enum.
5946 (File_read::View::is_permanent_view): New method.
5947 (File_read::clear_views): Replace bool parameter
5948 with enum; adjust all callers.
5949 * options.h (General_options): Change keep_files_mapped option;
5950 add map_whole_files.
5951 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5953 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5956 2010-03-10 David S. Miller <davem@davemloft.net>
5958 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5960 2010-03-09 Sriraman Tallam <tmsriram@google.com>
5962 * icf.cc (get_section_contents): Add '@' marker after processing the
5965 2010-03-08 Doug Kwan <dougkwan@google.com>
5967 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5968 due to a conversion warning.
5969 (Arm_relobj::update_output_local_symbol_count): Check for local
5970 symbol with unset output index.
5972 2010-03-05 Ian Lance Taylor <iant@google.com>
5974 * options.h (class General_options): Add --spare-dynamic-tags.
5975 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5976 --spare-dynamic-tags.
5978 2010-03-05 Ian Lance Taylor <iant@google.com>
5980 * incremental.cc: Include "libiberty.h".
5982 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5984 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5985 function, is_info_ member.
5986 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5987 (Versions::Versions): Update caller.
5988 (Versions::define_base_version): Likewise.
5989 (Versions::add_def): Likewise.
5991 2010-03-03 Sriraman Tallam <tmsriram@google.com>
5993 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5994 (Scan::possible_function_pointer_reloc): New function.
5995 (Scan::local_reloc_may_be_function_pointer): Change to call
5996 possible_function_pointer_reloc.
5997 (Scan::global_reloc_may_be_function_pointer): Ditto.
5998 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5999 relocations in ".data.rel.ro._ZTV" section.
6000 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6001 * testsuite/icf_safe_so_test.cc: Ditto.
6002 * testsuite/icf_safe_test.cc: Ditto.
6003 * testsuite/icf_safe_test.sh: Ditto.
6005 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6006 Ian Lance Taylor <iant@google.com>
6008 * target-reloc.h (relocate_section): Check the symbol table index
6009 for -1U before setting the local symbol index.
6010 (scan_relocatable_relocs): If copying the relocation, record that
6011 the local symbol is required.
6012 * object.h (Symbol_value::is_output_symtab_index_set): New
6014 (Symbol_value::may_be_discarded_from_output_symtab): New
6016 (Symbol_value::has_output_symtab_entry): New function.
6017 (Symbol_value::needs_output_symtab_entry): Remove.
6018 (Symbol_value::output_symtab_index): Make sure the symbol index is
6020 (Symbol_value::set_output_symtab_index): Make sure the symbol
6021 index is not set. Make sure the new index is valid.
6022 (Symbol_value::set_must_have_output_symtab_entry): New function.
6023 (Symbol_value::has_output_dynsym_entry): New function.
6024 (Symbol_value::set_output_dynsym_index): Make sure the new index
6026 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6027 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6028 local symbol if permitted.
6029 (Sized_relobj::do_finalize_local_symbols): Call
6030 is_output_symtab_index_set rather than needs_output_symtab_entry.
6031 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6032 rather than needs_output_symtab_entry. Call
6033 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6034 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6035 is_output_symtab_index_set rather than needs_output_symtab_entry.
6036 * testsuite/discard_locals_relocatable_test.c: New file.
6037 * testsuite/discard_locals_test.sh: Test -r.
6038 * testsuite/Makefile.am (check_DATA): Add
6039 discard_locals_relocatable_test1.syms,
6040 discard_local_relocatable_test2.syms.
6041 (MOSTLYCLEANFILES): Likewise. Also add
6042 discard_locals_relocatable_test1.lout and
6043 discard_locals_relocatable_test2.out.
6044 (discard_locals_relocatable_test1.syms): New target.
6045 (discard_locals_relocatable_test.o): New target.
6046 (discard_locals_relocatable_test1.out): New target.
6047 (discard_locals_relocatable_test2.syms): New target.
6048 (discard_locals_relocatable_test2.out): New target.
6049 (various): Add missing ../ld-new dependencies.
6050 * testsuite/Makefile.in: Rebuild.
6052 2010-03-03 Nick Clifton <nickc@redhat.com>
6054 * po/fi.po: New Finnish translation.
6056 2010-03-01 Doug Kwan <dougkwan@google.com>
6058 * layout.cc (Layout::Layout): Force section types of .init_array*,
6059 .preinit_array* and .fini_array* sections.
6060 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6061 Fix check of return value of std::string::find.().
6062 (Output_section::Input_section_sort_compare::operator()): Remove
6063 comment about .init_array.
6064 (Output_section::Input_section_sort_init_fini_compare::operator()):
6066 (Output_section::sort_attached_input_sections): Handle .init_array
6067 and .fini_array specially.
6068 * output.h (Output_section::Inut_section_sort_compare): Update
6070 (Output_section::Input_section_sort_init_fini_compare): New struct.
6072 2010-02-26 Doug Kwan <dougkwan@google.com>
6074 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6075 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6076 * testsuite/debug_msg.sh: Avoid matching source line number for
6077 use of global variable undef_int.
6079 2010-02-26 Doug Kwan <dougkwan@google.com>
6081 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6082 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6083 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6084 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6085 * options.cc (General_options::General_options): Initialize member
6087 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6088 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6089 and rm_no_fix_v4bx.stdout
6090 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6091 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6092 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6093 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6094 and arm_no_fix_v4bx.
6095 * Makefile.in: Regenerate.
6096 * testsuite/arm_fix_v4bx.s: New file.
6097 * testsuite/arm_fix_v4bx.sh: Ditto.
6099 2010-02-24 Doug Kwan <dougkwan@google.com>
6101 * arm.cc (Target_arm::got_section): Make the .got section the first
6102 non RELRO section in the data segment.
6103 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6104 suffixes of section names.
6106 2010-02-24 Doug Kwan <dougkwan@google.com>
6108 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6109 flags and attributes merging if an input file is a binary file.
6110 * fileread.cc (Input_file::open): Record format of original file.
6111 * fileread.h (Input_file::Format): New enum type.
6112 (Input_file::Input_file): Initialize data member format_.
6113 (Input_file::format): New method definition.
6114 (Input_file::format_):: New data member.
6116 2010-02-24 Doug Kwan <dougkwan@google.com>
6118 * arm.cc (Arm_output_data_got): New class.
6119 (ARM_TCB_SIZE): New constant
6120 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6121 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6122 If user uses a script with a SECTIONS clause, issue only a warning
6123 for a misplaced EXIDX input section. Otherwise, issue an error.
6124 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6126 (Target_arm::got_mode_index_entry): Handle static linking.
6127 (Target_arm::Scan::local): Ditto.
6128 (Target_arm::Scan::global): Ditto.
6129 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6130 all incorrectly implemented relocations.
6131 (Target_arm::fix_exidx_coverage): Pass layout to
6132 Arm_output_section::fix_exidx_coverage.
6133 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6134 from ".ARM.exidx." and ".ARM.extab.".
6136 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6138 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6139 section if it does not already exist.
6140 * attributes.cc (Attributes_section_data::Attributes_section_data):
6141 Don't crash if size is zero.
6143 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6144 Ian Lance Taylor <iant@google.com>
6146 * gold.cc (queue_middle_tasks): If no input files were opened,
6148 * workqueue.h (Task_function::Task_function): Assert that there is
6151 2010-02-22 Doug Kwan <dougkwan@google.com>
6153 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6154 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6155 types to avoid warnings due to different uint64_t implementations
6158 2010-02-21 Doug Kwan <dougkwan@google.com>
6160 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6161 handling of the maximum backward branch offset.
6162 (Arm_relocate_functions::thumb_branch_common): Ditto.
6163 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6164 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6165 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6166 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6167 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6168 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6169 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6170 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6171 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6172 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6173 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6174 thumb2_bl_out_of_range.o): New rules.
6175 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6176 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6177 thumb2_bl_out_of_range
6178 * testsuite/Makefile.in: Regenerate.
6179 * testsuite/arm_bl_in_range.s: New file.
6180 * testsuite/arm_bl_out_of_range.s: Ditto.
6181 * testsuite/arm_branch_in_range.sh: Ditto.
6182 * testsuite/arm_branch_range.t: Ditto.
6183 * testsuite/thumb2_branch_range.t: Ditto.
6184 * testsuite/thumb_bl_in_range.s: Ditto.
6185 * testsuite/thumb_bl_out_of_range.s: Ditto.
6186 * testsuite/thumb_branch_range.t: Ditto.
6188 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6190 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6191 Add reloc offset information.
6192 * icf.cc (get_section_contents): Change iterators to point to the new
6193 vectors. Add reloc offset information to the contents.
6194 * icf.h (Icf::Sections_reachable_info): New typedef.
6195 (Icf::Sections_reachable_list): New typedef.
6196 (Icf::Offset_info): New typedef.
6197 (Icf::Reloc_info): New struct typedef.
6198 (Icf::Reloc_info_list): New typedef.
6199 (Icf::symbol_reloc_list): Delete method.
6200 (Icf::addend_reloc_list): Delete method.
6201 (Icf::section_reloc_list): Delete method.
6202 (Icf::reloc_info_list): New method.
6203 (Icf::reloc_info_list_): New member.
6205 2010-02-19 Doug Kwan <dougkwan@google.com>
6207 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6208 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6209 * arm.cc (Arm_relocation_functions): New forward declaration.
6210 (Target_arm::Target_arm): Initialize new data members
6211 got_mod_index_offset_ and tls_base_symbol_defined_.
6212 (Target_arm::Relocate::relocate_tls): New method.
6213 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6214 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6216 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6217 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6218 (Target_arm::got_mod_index_offset_,
6219 Target_arm::tls_base_symbol_defined_): New data members.
6220 (Target_arm::Scan::local, Target::Scan::global,
6221 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6224 2010-02-18 Doug Kwan <dougkwan@google.com>
6226 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6227 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6228 text section as a parameter becuase some broken tools may not set
6229 the link in section header.
6230 (Target_arm::has_got_section): New method.
6231 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6232 without any mapping symbol as data only. Remove warning.
6233 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6234 link in its section header, try to discover the link by inspecting the
6235 REL31 relocation at the beginning of the section.
6236 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6238 (Target_arm::Scan::global): Treat any reference to the symbol
6239 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6241 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6243 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6244 (Scan::global_reloc_may_be_function_pointer): New function.
6245 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6246 (Scan::global_reloc_may_be_function_pointer): New function.
6247 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6248 (Scan::global_reloc_may_be_function_pointer): New function.
6249 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6250 (Scan::global_reloc_may_be_function_pointer): New function.
6251 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6252 (Scan::global_reloc_may_be_function_pointer): New function.
6253 (Scan::possible_function_pointer_reloc): New function.
6254 (Target_x86_64::can_check_for_function_pointers): New function.
6255 * gc.h (gc_process_relocs): Scan relocation types to determine if
6256 function pointers were taken for targets that support it.
6257 * icf.cc (Icf::find_identical_sections): Include functions for
6258 folding in safe ICF whose pointer is not taken.
6259 * icf.h (Secn_fptr_taken_set): New typedef.
6260 (fptr_section_id_): New member.
6261 (section_has_function_pointers): New function.
6262 (set_section_has_function_pointers): New function.
6263 (check_section_for_function_pointers): New function.
6264 * options.h: Fix comment for safe ICF option.
6265 * target.h (can_check_for_function_pointers): New function.
6266 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6267 Modify icf_safe_test for X86-64.
6268 * testsuite/Makefile.in: Regenerate.
6269 * testsuite/icf_safe_so_test.cc: New file.
6270 * testsuite/icf_safe_so_test.sh: New file.
6271 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6272 (main): Change to take pointer to function kept_func_3.
6273 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6274 folding is done correctly for X86-64.
6276 2010-02-12 David S. Miller <davem@davemloft.net>
6278 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6279 is_symbolless parameter.
6280 (Output_reloc<SHT_REL>::is_symbolless): New.
6281 (Output_reloc<SHT_REL>::is_symbolless_): New.
6282 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6283 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6284 (Output_reloc<SHT_RELA>::is_symbolless): New.
6285 (Output_data_reloc::add_global): Handle is_symbolless.
6286 (Output_data_reloc::add_global_relative): Likewise.
6287 (Output_data_reloc::add_local): Likewise.
6288 (Output_data_reloc::add_local_relative): Likewise.
6289 (Output_data_reloc::add_symbolless_global_addend): New.
6290 (Output_data_reloc::add_symbolless_local_addend): New.
6291 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6293 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6294 instead of ->is_relative_
6295 (Output_reloc::write): Likewise.
6296 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6297 (Output_reloc::write_rel): Simplify.
6299 * sparc.cc (Target_sparc::Scan::local): Use
6300 ->add_symbolless_local_addend as needed.
6301 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6302 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6303 based upon relocation offset.
6305 2010-02-11 Doug Kwan <dougkwan@google.com>
6307 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6308 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6309 beginning of function.
6310 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6311 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6312 parameter is_32bit in calls to should_apply_static_reloc.
6313 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6314 (check_DATA): Add arm_abs_global.stdout.
6315 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6316 arm_abs_global.stdout): New rules.
6317 (MOSTLLYCLEANFILES): Add arm_abs_global
6318 * Makefile.in: Regenerate.
6319 * testsuite/arm_abs_global.s: New file.
6320 * testsuite/arm_abs_global.sh: Ditto.
6321 * testsuite/arm_abs_lib.s: Ditto.
6323 2010-02-11 Ian Lance Taylor <iant@google.com>
6325 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6327 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6328 Allocate_commons_task first.
6329 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6330 task, rather than symtab_lock_.
6331 (Gc_process_relocs::~Gc_process_relocs): New function.
6332 (Gc_process_relocs::is_runnable): Check this_blocker_.
6333 (Gc_process_relocs::locks): Use next_blocker_ rather than
6335 (Scan_relocs::~Scan_relocs): New function.
6336 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6338 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6340 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6341 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6342 constructor accordingly.
6343 (class Gc_process_relocs): Likewise.
6344 (class Scan_relocs): Likewise.
6345 * common.h (class Allocate_commons_task): Remove symtab_lock_
6346 field, and corresponding constructor parameter.
6347 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6349 (Allocate_commons_task::locks): Likewise.
6351 2010-02-11 Ian Lance Taylor <iant@google.com>
6353 * gold-threads.h (class Once): Define.
6354 (class Initialize_lock): Rewrite as child of Once.
6355 * gold-threads.cc (class Once_initialize): Define.
6356 (once_pointer_control): New static variable.
6357 (once_pointer, once_arg): New static variables.
6358 (c_run_once): New static function.
6359 (Once::Once, Once::run_once, Once::internal_run): New functions.
6360 (class Initialize_lock_once): Remove.
6361 (initialize_lock_control): Remove.
6362 (initialize_lock_pointer): Remove.
6363 (initialize_lock_once): Remove.
6364 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6365 (Initialize_lock::initialize): Rewrite.
6366 (Initialize_lock::do_run_once): New function.
6367 * archive.cc (Archive::interpret_header): Only clear name if it is
6369 * fileread.cc: Include "gold-threads.h"
6370 (file_counts_lock): New static variable.
6371 (file_counts_initialize_lock): Likewise.
6372 (File_read::release): Only increment counts when using --stats.
6373 Use a lock around the increment.
6374 * parameters.cc (class Set_parameters_target_once): Define.
6375 (set_parameters_target_once): New static variable.
6376 (Parameters::Parameters): Move here from parameters.h.
6377 (Parameters::set_target): Rewrite.
6378 (Parameters::set_target_once): New function.
6379 (Parameters::clear_target): Move here and rewrite.
6380 * parameters.h (class Parameters): Update declarations. Add
6381 set_parameters_target_once_ field.
6382 (Parameters::Parameters): Move to parameters.cc.
6383 (Parameters::clear_target): Likewise.
6384 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6386 (Start_group::~Start_group): New function.
6387 (Start_group::is_runnable): New function.
6388 (Start_group::locks, Start_group::run): New functions.
6389 (Finish_group::run): Change saw_undefined to size_t.
6390 * readsyms.h (class Start_group): Define.
6391 (class Finish_group): Change saw_undefined_ field to size_t.
6392 (Finish_group::Finish_group): Remove saw_undefined and
6393 this_blocker parameters. Change all callers.
6394 (Finish_group::set_saw_undefined): New function.
6395 (Finish_group::set_blocker): New function.
6396 * symtab.h (class Symbol_table): Change saw_undefined to return
6397 size_t. Change saw_undefined_ field to size_t.
6398 * target-select.cc (Set_target_once::do_run_once): New function.
6399 (Target_selector::Target_selector): Initialize set_target_once_
6400 field. Don't initialize lock_ and initialize_lock_ fields.
6401 (Target_selector::instantiate_target): Rewrite.
6402 (Target_selector::set_target): New function.
6403 * target-select.h (class Set_target_once): Define.
6404 (class Target_selector): Update declarations. Make
6405 Set_target_once a friend. Remove lock_ and initialize_lock_
6406 fields. Add set_target_once_ field.
6408 2010-02-10 Ian Lance Taylor <iant@google.com>
6410 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6412 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6413 (queue_middle_tasks): Add all blockers before queueing any tasks.
6414 (queue_final_tasks): Likewise.
6415 * token.h (Task_token::add_blockers): New function.
6416 * object.h (Input_objects::number_of_relobjs): New function.
6418 2010-02-10 Ian Lance Taylor <iant@google.com>
6420 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6421 shared, not if not position independent.
6422 * x86_64.cc (Relocate::relocate_tls): Likewise.
6423 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6424 (tls_pie_pic_test): New target.
6425 * testsuite/Makefile.in: Rebuild.
6427 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6428 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6429 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6430 * testsuite/Makefile.in: Rebuild.
6432 2010-02-09 David S. Miller <davem@davemloft.net>
6434 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6435 R_SPARC_RELATIVE using ->add_local_relative().
6436 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6438 * output.h (Output_data_dynamic::add_section_size): New method
6439 that takes two Output_data objects.
6440 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6441 entry param. Handle it in initializers.
6442 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6443 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6444 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6446 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6447 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6448 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6449 for dynrel_includes_plt.
6450 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6451 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6452 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6454 (Target_sparc::do_finalize_sections): Update to pass true for
6455 dynrel_includes_plt.
6456 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6457 output before .rela.plt
6458 (Target_powerpc::do_finalize_sections): Update to pass true for
6459 dynrel_includes_plt when 32-bit.
6461 2010-02-08 Doug Kwan <dougkwan@google.com>
6463 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6465 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6466 Arm_relobj::scan_section_for_cortex_a8_stubs,
6467 Arm_relobj::do_relocation_section): Instead of calling
6468 Output_section::output_address, use faster
6469 Arm_relobj::simple_input_section_output_address.
6471 2010-02-08 David S. Miller <davem@davemloft.net>
6473 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6474 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6475 relocation helper function.
6477 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6478 just like R_SPARC_GOT{10,13,22}.
6479 (Target_sparc::Scan::local): Likewise.
6480 (Target_sparc::Relocate:relocate): Likewise.
6482 2010-02-06 Ian Lance Taylor <iant@google.com>
6484 * configure.ac: Rewrite targetobjs duplicate removal code to use
6485 only shell constructs.
6486 * configure: Rebuild.
6488 2010-02-05 Doug Kwan <dougkwan@google.com>
6491 * arm.cc (Arm_relobj::section_is_scannable): New method.
6492 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6493 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6495 2010-02-04 Doug Kwan <dougkwan@google.com>
6498 * arm-reloc-property.cc (cstdio): Include.
6499 * configure.ac (targetobjs): Remove duplicates.
6500 * configure: Regenerate.
6501 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6502 big and little endian version for a given address size.
6504 2010-02-03 Doug Kwan <dougkwan@google.com>
6506 * arm-reloc-property.cc
6507 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6509 * arm-reloc-property.h
6510 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6511 New method definition.
6512 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6514 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6516 (GOT_PREL): Change implemented to Y.
6517 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6518 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6519 (Arm_relocate_functions::movw_abs_nc): Remove method.
6520 (Arm_relocate_functions::movt_abs): Ditto.
6521 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6522 (Arm_relocate_functions::thm_movt_abs): Ditto.
6523 (Arm_relocate_functions::movw_rel_nc): Ditto.
6524 (Arm_relocate_functions::movw_rel): Ditto.
6525 (Arm_relocate_functions::movt_rel): Ditto.
6526 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6527 (Arm_relocate_functions:thm_movw_rel): Ditto.
6528 (Arm_relocate_functions:thm_movt_rel): Ditto.
6529 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6530 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6531 New method definitions.
6532 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6533 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6534 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6535 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6536 (Target_arm::Relocate::relocate): Check for non-static or
6537 unimplemented relocation code and exit early. Change calls to
6538 Target_arm::reloc_uses_thumb_bit and
6539 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6540 instead. Refactor code to handle similar relocations to increase
6541 code sharing. Remove check for unsupported relocation code in switch
6543 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6544 relocation property table to find out size. Change error message to
6545 print out the name of a relocation code instead of the numeric value.
6546 (Target_arm::scan_reloc_for_stub): Use relocation property table
6547 instead of calling Target_arm::reloc_uses_thumb_bit().
6549 2010-02-02 Doug Kwan <dougkwan@google.com>
6551 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6552 types of relaxed input section.
6554 2010-02-02 Doug Kwan <dougkwan@google.com>
6556 * Makefile.am (HFILES): Add arm-reloc-property.h.
6558 (TARGETSOURCES): Add arm-reloc-property.cc
6559 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6560 (libgold_a_SOURCES): $(DEFFILES)
6561 * Makefile.in: Regenerate.
6562 * arm-reloc-property.cc: New file.
6563 * arm-reloc-property.h: New file.
6564 * arm-reloc.def: New file.
6565 * arm.cc: Update comments.
6566 (arm-reloc-property.h): New included header.
6567 (arm_reloc_property_table): New global variable.
6568 (Target_arm::do_select_as_default_target): New method definition.
6569 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6570 arm-reloc-property to targ_extra_obj.
6571 * parameters.cc (set_parameters_target): Call
6572 Target::select_as_default_target().
6573 * target.h (Target::select_as_default_target): New method definition.
6574 (Target::do_select_as_default_target): Same.
6576 2010-02-01 Doug Kwan <dougkwan@google.com>
6578 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6579 first_output_text_section_.
6580 (Arm_exidx_fixup::first_output_text_section): New method definition.
6581 (Arm_exidx_fixup::first_output_text_section_): New data member.
6582 (Arm_exidx_fixup::process_exidx_section): Record the first text
6583 output section seen.
6584 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6585 and entsize in output section header.
6587 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6589 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6590 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6591 (Arm_relocate_functions::thm_alu11): New Method.
6592 (Arm_relocate_functions::thm_pc8): New Method.
6593 (Arm_relocate_functions::thm_pc12): New Method.
6594 (Target_arm::Scan::local): Handle the relocations.
6595 (Target_arm::Scan::global): Likewise.
6596 (Target_arm::Relocate::relocate): Likewise.
6597 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6599 2010-01-29 Doug Kwan <dougkwan@google.com>
6601 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6602 of relocation types as ld.
6604 2010-01-29 Doug Kwan <dougkwan@google.com>
6606 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6608 (Arm_relocate_functions::thumb_branch_common): Ditto.
6609 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6610 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6611 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6612 Arm_relocate_functions::jump24): Remove.
6613 (Target_arm::Relocate::relocate): Adjust code to call
6614 Arm_relocation_functions::arm_branch_common and
6615 Arm_relocation_functions::thumb_branch_common instead of their removed
6616 wrappers. Merge switch-cases together to reduce source code size.
6618 2010-01-29 Doug Kwan <dougkwan@google.com>
6620 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6621 output_local_symbol_count_needs_update_.
6622 (Arm_relobj::output_local_symbol_count_needs_update,
6623 Arm_relobj::set_output_local_symbol_count_needs_update,
6624 Arm_relobj::update_output_local_symbol_count): New methods.
6625 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6627 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6628 of pointed function as in a R_ARM_PREL31 relocation.
6629 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6630 for output local symbol count updating.
6631 (Target_arm::do_relax): Update output local symbol counts in objects
6633 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6635 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6637 * arm.cc: Added support for the ARM relocations:
6638 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6639 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6640 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6642 (Arm_relocate_functions::movw_rel): New method.
6643 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6644 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6646 (Arm_relocate_functions::thm_movw_rel): New method.
6647 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6649 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6651 (Target_arm::Scan::global): Likewise.
6652 (Target_arm::Relocate::relocate): Likewise.
6653 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6656 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6658 * arm.cc: Added support for ARM group relocations.
6659 (Target_arm::reloc_needs_sym_origin): New method.
6660 (Arm_relocate_functions::calc_grp_kn): New method.
6661 (Arm_relocate_functions::calc_grp_residual): New method.
6662 (Arm_relocate_functions::calc_grp_gn): New method.
6663 (Arm_relocate_functions::arm_grp_alu): New Method.
6664 (Arm_relocate_functions::arm_grp_ldr): New Method.
6665 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6666 (Arm_relocate_functions::arm_grp_ldc): New Method.
6667 (Target_arm::Scan::local): Handle the ARM group relocations.
6668 (Target_arm::Scan::global): Likewise.
6669 (Target_arm::Relocate::relocate): Likewise.
6670 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6673 2010-01-26 Doug Kwan <dougkwan@google.com>
6675 * arm.cc (set): Include.
6676 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6678 (Arm_output_section::Text_section_list): New type.
6679 (Arm_output_section::append_text_sections_to_list): New method.
6680 (Arm_output_section::fix_exidx_coverage): Ditto.
6681 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6682 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6683 Relobj::set_section_offset() instead of
6684 Sized_relobj::invalidate_section_offset().
6685 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6686 parameter for section headers. Ignore relocation sections for
6687 unallocated sections and EXIDX sections.
6688 (Target_arm::fix_exidx_coverage): New method.
6689 (Target_arm::output_section_address_less_than): New type.
6690 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6691 linked text section instead of the EXIDX section.
6692 (Arm_output_section::create_stub_group): Add an assertion to check
6693 that this is not an EXIDX output section.
6694 (Arm_output_section::append_text_sections_to_list): New method.
6695 (Arm_output_section::fix_exidx_coverage): Ditto.
6696 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6697 Arm_relobj::section_needs_reloc_stub_scanning.
6698 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6700 (Target_arm::fix_exidx_coverage): New method.
6701 * object.h (Relobj::set_output_section): New method.
6702 (Sized_relobj::invalidate_section_offset): Remove method.
6703 (Sized_relobj::do_invalidate_section_offset): Remove method.
6704 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6706 2010-01-25 Doug Kwan <dougkwan@google.com>
6708 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6709 Fix warning due to signed and unsigned comparison on a 32-bit host.
6711 2010-01-22 Doug Kwan <dougkwan@google.com>
6713 * arm.cc (Target_arm::do_relax): Record an output section for section
6714 offset adjustment it contains any stub table that has changed.
6715 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6716 offsets in an output section if necessary.
6717 * output.cc (Output_section::Output_section): Initialize
6718 section_offsets_need_adjustments_.
6719 (Output_section::add_input_section_for_script): Renamed to
6720 Output_section::add_simple_input_section.
6721 (Output_section::save_states): Add a comment.
6722 (Output_section::discard_states): New method defintion.
6723 (Output_section::adjust_section_offsets): Same.
6724 * output.h (Output_section::add_input_section_for_script): Renamed to
6725 Output_section::add_simple_input_section.
6726 (Output_section::discard_states): New method declaration.
6727 (Output_section::adjust_section_offsets): Same.
6728 (Output_section::section_offsets_need_adjustment,
6729 Output_section::set_section_offsets_need_adjustment): New method
6731 (Output_section::section_offsets_need_adjustment_): New data member.
6732 * script-sections.cc
6733 (Output_section_element_input::set_section_address): Adjust code for
6734 renaming of Output_section::add_input_section_for_script.
6735 (Orphan_output_section::set_section_address): Same.
6737 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6739 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6740 Fix_v4bx enum values .
6741 * gold/options.h (General_options): New option definitions.
6742 (General_options::fix_v4bx): New method.
6743 (General_options::Fix_v4bx): New enum.
6744 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6745 (General_options::parse_fix_v4bx_interworking): New method.
6747 2010-01-22 Doug Kwan <dougkwan@google.com>
6749 * arm.cc (Arm_exidx_fixup): New class.
6751 2010-01-21 Doug Kwan <dougkwan@google.com>
6753 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6755 (Arm_exidx_section_offset_map): New type.
6757 2010-01-21 Doug Kwan <dougkwan@google.com>
6759 * arm.cc (Arm_exidx_input_section): New class.
6760 (Arm_relobj::exidx_input_section_by_link,
6761 Arm_relobj::exidx_input_section_by_shndx,
6762 Arm_relobj::make_exidx_input_section): New methods.
6763 (read_arm_attributes_section): Remove.
6764 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6765 information about them.
6766 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6769 2010-01-20 Doug Kwan <dougkwan@google.com>
6771 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6772 Input_section_specifier to Section_id.
6773 (Target_arm::new_arm_input_section: Adjust code for change of key
6775 (Target_arm::find_arm_input_section): Ditto.
6776 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6777 (Section_id): Remove.
6778 (Garbage_collection::Section_id_hash): Remove.
6779 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6780 (Section_id): Remove.
6781 (Icf::Section_id_hash): Remove.
6782 * object.h (Section_id, Const_section_id, Section_id_hash,
6783 Const_section_id_hash): New type definitions.
6784 * output.cc (Output_section::add_relaxed_input_section): Change to
6785 use Const_section_id instead of Input_section_specifier as key type.
6786 (Output_section::add_merge_input_section): Ditto.
6787 (Output_section::build_relaxation_map): Change to use Section_id
6788 instead of Input_section_specifier as key type.
6789 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6791 (Output_section::convert_input_sections_to_relaxed_sections): Change
6792 to use Const_section_id instead of Input_section_specifier as key type.
6793 (Output_section::find_merge_section): Ditto.
6794 (Output_section::find_relaxed_input_section): Ditto.
6795 * output.h (Input_section_specifier): Remove class.
6796 (Output_section::Output_section_data_by_input_section_map): Change
6797 key type to Const_section_id.
6798 (Output_section::Output_relaxed_input_section_by_input_section_map):
6800 (Output_section::Relaxation_map): Change key type to Section_id.
6802 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6804 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6805 (class Arm_v4bx_stub): New class.
6806 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6807 (Stub_factory::make_arm_v4bx_stub): New method.
6808 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6809 (Stub_table::empty): Handle v4bx stubs.
6810 (Stub_table::add_arm_v4bx_stub): New method.
6811 (Stub_table::find_arm_v4bx_stub): New method.
6812 (Arm_relocate_functions::v4bx): New method.
6813 (Target_arm::fix_v4bx): New method.
6814 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6815 (Stub_table::relocate_stubs): Likewise.
6816 (Stub_table::do_write): Likewise.
6817 (Stub_table::update_data_size_and_addralign): Likewise.
6818 (Stub_table::finalize_stubs): Likewise.
6819 (Target_arm::Scan::local): Likewise.
6820 (Target_arm::Scan::global): Likewise.
6821 (Target_arm::do_finalize_sections): Likewise.
6822 (Target_arm::Relocate::relocate): Likewise.
6823 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6825 (Target_arm::scan_reloc_for_stub): Likewise.
6826 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6828 2010-01-19 Ian Lance Taylor <iant@google.com>
6830 * output.cc (Output_section_headers::do_sized_write): Write large
6831 segment count to sh_info field.
6832 (Output_file_header::do_sized_write): For large segment count,
6833 write PN_XNUM to e_phnum field.
6835 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6837 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6838 (Arm_relocate_functions::thm_jump8): New function.
6839 (Arm_relocate_functions::thm_jump11): New function.
6840 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6842 (Target_arm::Scan::global): Likewise.
6843 (Target_arm::Relocate::relocate): Likewise.
6844 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6847 2010-01-14 Doug Kwan <dougkwan@google.com>
6849 * arm.cc (map, utility): Include headers.
6850 (Target_arm::apply_cortex_a8_workaround): New method.
6851 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6852 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6853 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6854 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6855 the --[no-]fix-cortex-a8 command line options.
6856 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6857 (Target_arm::relocate_stub): Use addend in instruction template.
6858 * options.h (DEFINE_bool): Set the user-set flag.
6859 (General_options): Add --[no-]-fix-cortex options.
6860 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6861 : Update fast look-up map after conversion.
6863 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6865 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6866 in the first pass of do_layout.
6868 2010-01-13 Doug Kwan <dougkwan@google.com>
6870 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6871 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6872 apparent compiler problem of not folding static constant integral
6873 data members of elfcpp::Elf_sizes<32>.
6875 2010-01-13 Doug Kwan <dougkwan@google.com>
6877 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6878 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6879 Arm_relobj::scan_section_for_cortex_a8_erratum,
6880 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6881 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6882 sections to scan for relocation stubs into a new method
6883 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6884 relocation and Cortex-A8 stub scanning.
6885 (Target_arm::do_relax): Force stubs to be after stubbed sections
6886 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
6887 the beginning of a new relaxation pass. Update a comment.
6888 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6890 2010-01-12 Ian Lance Taylor <iant@google.com>
6892 * target-reloc.h (visibility_error): New inline function.
6893 (relocate_section): Call visibility_error.
6894 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6895 (MOSTLYCLEANFILES): Likewise.
6896 (protected_4_pic.o, protected_3.err): New targets.
6897 * testsuite/protected_4.cc: New file.
6899 2010-01-12 Doug Kwan <dougkwan@google.com>
6901 * arm.cc (Cortex_a8_reloc): New class.
6902 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6903 and cortex_a8_relocs_info_.
6904 (Target_arm::fix_cortex_a8): New method definition.
6905 (Target_arm::Cortex_a8_relocs_info): New type.
6906 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6907 New data member declarations.
6908 (Target_arm::scan_reloc_for_stub): Record information about
6909 relocations for THUMB branches that might be exempted from the
6910 Cortex-A8 workaround.
6911 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6912 at the beginning of a relaxation pass.
6914 2010-01-12 Doug Kwan <dougkwan@google.com>
6916 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6917 (Arm_relobj::Mapping_symbol_position,
6918 Arm_reloj::Mapping_symbol_position_less,
6919 Arm_relobj::Mapping_symbols_info): New types.
6920 (Target_arm::is_mapping_symbol_name): New method definition.
6921 (Arm_relobj::do_count_local_symbols): Save information about mapping
6924 2010-01-11 Doug Kwan <dougkwan@google.com>
6926 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6927 Arm_relocate_functions::thumb32_branch_upper,
6928 Arm_relocate_functions::thumb32_branch_lower,
6929 Arm_relocate_functions::thumb32_cond_branch_offset,
6930 Arm_relocate_functions::thumb32_cond_branch_upper,
6931 Arm_relocate_functions::thumb32_cond_branch_lower,
6932 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6933 branch offset encoding.
6934 (Arm_relocate_functions::thumb_branch_common): Use new branch
6935 offset encoding methods to avoid code duplication.
6936 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6937 (Stub_addend_reader::operator()): Use new branch encoding method
6938 to avoid code duplication.
6940 2010-01-11 Doug Kwan <dougkwan@google.com>
6942 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6943 (Target_arm::do_finalize_sections): Define special EXIDX section
6944 symbols only if referenced.
6945 * gc.h (Garbage_collection::add_reference): New method.
6946 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6949 2010-01-11 Ian Lance Taylor <iant@google.com>
6951 * script.cc (Version_script_info::build_expression_list_lookup):
6952 Change complaing about duplicate wildcard match from error to
6955 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6957 (Version_script_info::Version_script_info): Initialize globs_,
6958 default_version_, default_is_global_, and exact_. Don't
6959 initialize globals_ or locals_.
6960 (Version_script_info::build_lookup_tables): Build local symbols
6962 (Version_script_info::unquote): New function.
6963 (Version_script_info::add_exact_match): New function.
6964 (Version_script_info::build_expression_list_lookup): Remove lookup
6965 parameter. Add is_global parameter. Change all callers. Handle
6966 wildcard pattern specially. Unquote pattern. Call
6968 (Version_script_info::get_name_to_match): New function.
6969 (Version_script_info::get_symbol_version): New function.
6970 (Version_script_info::get_symbol_version_helper): Remove.
6971 (Version_script_info::check_unmatched_names): Call unquote.
6972 * script.h (class Version_script_info): Change get_symbol_version
6973 to be non-inline and add is_global parameter; change all callers.
6974 Rewrite symbol_is_local. Update declarations. Define struct
6975 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6976 Remove globals_ and locals_ members. Add exact_, globs_,
6977 default_version_, is_global_.
6978 (Version_script_info::Glob): Remove pattern, add expression and
6979 is_global. Update constructor. Change all callers.
6980 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6982 (Versions::symbol_section_contents): If a symbol is undefined, or
6983 defined in a dynamic object, set the version index to
6985 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6987 (Symbol_table::add_from_pluginobj): Likewise.
6988 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6990 2010-01-11 Doug Kwan <dougkwan@google.com>
6992 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6993 (incremental_dump_LDADD): Add linking option for libintl.
6994 * Makefile.in: Regenerate.
6996 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6999 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7001 * testsuite/Makefile.in: Regenerated.
7003 2010-01-10 Doug Kwan <dougkwan@google.com>
7005 * options.h (DEFINE_var): Use parentheses around argument varname__
7006 in macro body to avoid any unintended subsequent substitutions.
7008 2010-01-10 Ian Lance Taylor <iant@google.com>
7010 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7011 candidates before doing symbol resolution.
7013 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7014 ODR candidates if only one is weak.
7016 2010-01-08 Ian Lance Taylor <iant@google.com>
7018 * script.cc (Version_script_info::build_expression_list_lookup):
7019 Don't warn about ambiguous version, just record the ambiguity.
7020 (Version_script_info::get_symbol_version_helper): Give error if
7021 version is ambiguous.
7023 2010-01-08 Doug Kwan <dougkwan@google.com>
7025 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7026 prev_data_size_ and prev_addralign_. Remove initializer for
7027 deleted data member has_been_changed_.
7028 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7029 to determine if the table is empty.
7030 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7032 (Stub_table::add_reloc_stub): Define method in class definition
7033 instead of just declaring it there.
7034 (Stub_table::add_cortex_a8_stub): New method definition.
7035 (Stub_table::update_data_size_and_addralign): Ditto.
7036 (Stub_table::finalize_stubs): Ditto.
7037 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7038 (Stub_table::do_addralign_): Return address alignment in the
7039 (Stub_table::do_reset_address_and_file_offset): Define method in
7040 class definition instead of declaring it there. Set current data
7041 size to be the data size of the previous pass.
7042 (Stub_table::set_final_data_size): Use current data size as the
7044 (Stub_table::relocate_stub): Change parameter type of stub from
7045 Reloc_stub pointer to Stub pointer.
7046 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7047 (Stub_table::Cortex_a8_stub_list): New typedef.
7048 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7049 Stub_table::prev_addralign_): New data member.
7050 (Arm_relobj::Arm_relobj): Initialize data member
7051 section_has_cortex_a8_workaround_.
7052 (Arm_relobj::section_has_cortex_a8_workaround,
7053 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7055 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7057 (Target_arm::relocate_stub): Change parameter type of stub from
7058 Reloc_stub pointer to Stub pointer.
7059 (Insn_template::size, Insn_template::alignment): Handle
7060 THUMB16_SPECIAL_TYPE.
7061 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7062 Stub_table::update_data_size_and_addralign,
7063 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7065 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7066 (Stub_table::do_write): Ditto.
7067 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7069 2010-01-08 Ian Lance Taylor <iant@google.com>
7072 * symtab.h (class Symbol): Remove fields is_target_special_ and
7073 has_plt_offset_. Add field is_defined_in_discarded_section_.
7074 (Symbol::is_defined_in_discarded_section): New function.
7075 (Symbol::set_is_defined_in_discarded_section): New function.
7076 (Symbol::has_plt_offset): Rewrite.
7077 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7078 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7079 Don't initialize is_target_special_ or has_plt_offset_.
7080 Initialize is_defined_in_discarded_section_.
7081 (Symbol_table::add_from_relobj): If appropriate, set
7082 is_defined_in_discarded_section.
7083 * resolve.cc (Symbol::override_base_with_special): Don't test
7084 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7085 * target-reloc.h (relocate_section): Do special handling for
7086 symbols defined in discarded sections for global symbols as well
7089 2010-01-08 Ian Lance Taylor <iant@google.com>
7091 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7092 the SHT_SYMTAB case.
7094 2010-01-08 Ian Lance Taylor <iant@google.com>
7096 * object.cc (Sized_relobj::do_layout): Don't get confused if
7097 layout_eh_frame returns NULL.
7099 2010-01-08 Ian Lance Taylor <iant@google.com>
7102 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7103 dynamic symbol table, use the normal symbol table.
7104 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7107 2010-01-08 Ian Lance Taylor <iant@google.com>
7110 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7113 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7115 * version.cc (print_version): Change to "Copyright 2010".
7117 2010-01-08 Ian Lance Taylor <iant@google.com>
7121 * i386.cc (class Target_i386): Change return type of plt_section
7123 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7124 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7125 tls_desc_rel_ field.
7126 (Output_data_plt_i386::rel_tls_desc): New function.
7127 (Target_i386::rel_tls_desc_section): New function.
7128 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7129 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7130 R_386_TLS_DESC reloc in rel_tls_desc_section.
7131 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7132 Define struct Tlsdesc_info.
7133 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7134 (Target_x86_64::do_reloc_symbol_index): New function.
7135 (Target_x86_64::add_tlsdesc_info): New function.
7136 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7137 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7139 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7141 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7142 (Target_x86_64::rela_tlsdesc_section): New function.
7143 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7145 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7146 (Target_x86_64::do_reloc_addend): New function.
7147 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7148 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7149 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7150 (Output_reloc::type): New function.
7151 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7152 (Output_reloc::is_target_specific): New function.
7153 (Output_reloc::target_arg): New function.
7154 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7155 absolute relocs and target specific relocs.
7156 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7157 add_target_specific.
7158 (class Output_data_reloc) [SHT_RELA]: Likewise.
7159 * output.cc (Output_reloc::Output_reloc): Add four new versions
7160 for absolute relocs and target specific relocs.
7161 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7162 (Output_reloc::get_symbol_index): Likewise.
7163 (Output_reloc::local_section_offset): Check that local_sym_index_
7164 is not TARGET_CODE or 0.
7165 (Output_reloc::symbol_value): Likewise.
7166 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7168 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7169 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7171 * layout.cc (add_target_dynamic_tags): Use output section for
7172 DT_PLTRELSZ and DT_JMPREL.
7174 2010-01-07 Ian Lance Taylor <iant@google.com>
7177 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7179 (class Output_data_reloc_generic): Define.
7180 (class Output_data_reloc_base): Change base class to
7181 Output_data_reloc_generic. Change add() method to call
7182 bump_relative_reloc_count for a relative reloc. Remove
7184 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7186 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7187 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7189 * layout.h (class Layout): Update declaration.
7191 2010-01-07 Ian Lance Taylor <iant@google.com>
7193 * output.h (class Output_data): Add const version of
7194 output_section and do_output_section.
7195 (class Output_section_data): Add const version of
7197 (class Output_section): Likewise.
7198 * layout.cc (Layout::add_target_dynamic_tags): New function.
7199 * layout.h (class Layout): Update declarations.
7200 * arm.cc (Target_arm::do_finalize_sections): Use
7201 add_target_dynamic_tags.
7202 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7203 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7204 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7205 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7207 2010-01-07 Ian Lance Taylor <iant@google.com>
7210 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7213 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7214 Ian Lance Taylor <iant@google.com>
7217 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7218 Xindex::read_symtab_xindex.
7220 2010-01-07 Doug Kwan <dougkwan@google.com>
7222 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7223 (Insn_template::thumb16_bcond_insn): New method declaration.
7224 (Insn_template): Fix spelling.
7225 (Stub::thumb16_special): New method declaration.
7226 (Stub::do_write): Define virtual method which was previously pure
7228 (Stub::do_thumb16_special): New method declaration.
7229 (Stub::do_fixed_endian_write): New template member.
7230 (Reloc_stub::do_write): Remove.
7231 (Reloc_stub::do_fixed_endian_write): Remove.
7232 (Cortex_a8_stub): New class definition.
7233 (Stub_factory::make_cortex_a8_stub): New method definition.
7234 (Stub_factory::Stub_factory): Add missing static storage class
7235 qualifier for elf32_arm_stub_a8_veneer_blx.
7237 2010-01-07 Ian Lance Taylor <iant@google.com>
7240 * options.h (class General_options): Add --warn-unresolved-symbols
7241 and --error-unresolved-symbols.
7242 * errors.cc (Errors::undefined_symbol): Implement
7243 --warn-unresolved-symbols.
7245 * options.h (class General_options): Add -z text and -z textoff.
7246 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7248 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7250 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7251 (Garbage_collection::cident_sections): New function.
7252 (Garbage_collection::add_cident_section): New function.
7253 (Garbage_collection::cident_sections_): New member.
7254 (gc_process_relocs): Add references to sections whose names are C
7256 * gold.h (cident_section_start_prefix): New constant.
7257 (cident_section_stop_prefix): New constant.
7258 (is_cident): New function.
7259 * layout.cc (Layout::define_section_symbols): Replace string constants
7260 with the newly defined constants.
7261 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7263 * testsuite/Makefile.am: Add gc_orphan_section_test.
7264 * testsuite/Makefile.in: Regenerate.
7265 * testsuite/gc_orphan_section_test.cc: New file.
7266 * testsuite/gc_orphan_section_test.sh: New file.
7268 2010-01-06 Ian Lance Taylor <iant@google.com>
7271 * options.h (class General_options): Add --warn-shared-textrel.
7272 * layout.cc (Layout::finish_dynamic_section): Implement
7273 --warn-shared-textrel.
7276 * options.h (class General_options): Add --warn-multiple-gp.
7278 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7280 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7281 $(THREADSLIB) and $(LIBDL).
7282 * Makefile.in: Rebuild.
7284 2010-01-06 Ian Lance Taylor <iant@google.com>
7287 * options.cc (General_options::parse_section_start): New function.
7288 (General_options::section_start): New function.
7289 (General_options::General_options): Initialize all members.
7290 * options.h: Include <map>
7291 (class General_options): Add --section-start. Add section_starts_
7293 * layout.cc (Layout::attach_allocated_section_to_segment): If
7294 --section-start was used, set the address of the segment. Remove
7295 local sort_sections.
7296 (Layout::relaxation_loop_body): If the address of the load segment
7297 has been set by --section-start, don't use it.
7298 * output.h (Output_segment::update_flags_for_output_section): New
7300 * output.cc (Output_segment::add_output_section): Call
7301 update_flags_for_output_section.
7303 2010-01-05 Ian Lance Taylor <iant@google.com>
7306 * options.h (class General_options): Add --undefined-version.
7307 * script.cc (struct Version_expression): Add was_matched_by_symbol
7309 (Version_script_info::matched_symbol): New function.
7310 (Version_script_info::get_symbol_version_helper): Call
7312 (Version_script_info::check_unmatched_names): New function.
7313 * script.h (class Version_script_info): Update declarations.
7314 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7316 * options.h (class General_options): Use DEFINE_bool_alias for
7317 allow_multiple_definition.
7318 * resolve.cc (Symbol_table::should_override): Don't test
7319 allow_multiple_definition.
7322 * options.h (class General_options): Add --cref.
7323 * main.cc (main): Print cref table if --cref. Don't close mapfile
7324 until after printing cref table.
7325 * cref.cc: Include "symtab.h".
7326 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7327 (Cref_table_compare::operator()): New function.
7328 (Cref_inputs::gather_cref): New function.
7329 (filecol): New static const.
7330 (Cref_inputs::print_cref): New function.
7331 (Cref::print_cref): New function.
7332 * cref.h: Include <cstdio>.
7333 (class Cref): Update declarations.
7334 * mapfile.h (Mapfile::file): New function.
7335 * object.h (class Object): Define Symbols. Declare virtual
7336 do_get_global_symbols.
7337 (Object::get_global_symbols): New function.
7338 * object.cc (Input_objects::add_object): Pass object to cref_ if
7340 (Input_objects::archive_start): Likewise.
7341 (Input_objects::archive_stop): Likewise.
7342 (Input_objects::print_cref): New function.
7343 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7344 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7346 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7348 * plugin.h (class Sized_pluginobj): Update declarations.
7350 2010-01-05 Ian Lance Taylor <iant@google.com>
7352 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7353 to is_default_version. Rename insdef to insdefault.
7354 (Symbol_table::add_from_relobj): Rename def to is_default_version
7355 and local to is_forced_local.
7356 (Symbol_table::add_from_pluginobj): Likewise.
7357 (Symbol_table::add_from_dynobj): Likewise.
7358 (Symbol_table::define_special_symbol): Rename insdef to
7361 2010-01-04 Ian Lance Taylor <iant@google.com>
7364 * options.h (class General_options): Add
7365 --allow-multiple-definition and -z muldefs.
7366 * resolve.cc (Symbol_table::should_override): Don't warn about a
7367 multiple symbol definition if --allow-multiple-definition or -z
7371 * options.h (class General_options): Add --add-needed and
7372 --copy-dt-needed-entries. Tweak --as-needed help entry.
7373 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7374 error if --copy-dt-needed-entries aka --add-needed is used and
7375 would cause a change in behaviour.
7378 * options.h (class General_options): Add -G as a short version of
7379 --shared. Add no-op options -assert, -g, and -i.
7381 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7383 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7384 check for .text or .gnu.linkonce.t sections.
7385 * icf.cc (Icf::find_identical_sections): Ditto.
7386 Change the detection for mangled function name within the section
7388 * icf.h (is_section_foldable_candidate): New function.
7390 2009-12-30 Ian Lance Taylor <iant@google.com>
7393 * options.h (class General_options): Permit two dashes with
7394 --retain-symbols-file.
7396 2009-12-30 Ian Lance Taylor <iant@google.com>
7399 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7400 don't put the file header and segment headers in the text
7404 * common.cc (Sort_commons::operator()): Stabilize sort when both
7406 (Symbol_table::do_allocate_commons_list): When allocating common
7407 symbols, skip a symbol which is no longer common.
7408 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7409 an object before checking its type.
7410 * testsuite/common_test_2.c: New file.
7411 * testsuite/common_test_3.c: New file.
7412 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7413 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7414 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7415 (common_test_2_pic.o, common_test_2.so): New targets.
7416 (common_test_3_pic.o, common_test_3.so): New targets.
7417 * testsuite/Makefile.in: Rebuild.
7420 * script.cc (read_input_script): If we see a new SECTIONS clause,
7421 and we have added an input section, give an error.
7422 * layout.h (class Layout): Add have_added_input_section function.
7423 Add have_added_input_section_ field.
7424 * layout.cc (Layout::Layout): Initialize
7425 have_added_input_section_.
7426 (Layout::layout): Set have_added_input_section_.
7427 (Layout::layout_eh_frame): Likewise.
7429 2009-12-30 Ian Lance Taylor <iant@google.com>
7432 * options.h (class General_options): Add --sort-common option.
7433 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7434 * common.cc (Sort_common): Add sort_order parameter to
7435 constructor. Add sort_order_ field.
7436 (Sort_commons::operator): Check sort_order_.
7437 (Symbol_table::allocate_commons): Determine the sort order.
7438 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7440 (Symbol_table::do_allocate_commons_list): Likewise.
7442 2009-12-30 Ian Lance Taylor <iant@google.com>
7445 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7446 symbols from this object, don't change the visibility of an
7448 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7450 2009-12-30 Ian Lance Taylor <iant@google.com>
7453 * script.h (class Version_script_info): Define Language enum.
7454 Update declarations. Define Glob, Exact, and Lookup types. Add
7455 new fields globals_, locals_, and is_finalized_.
7456 * script.cc: Various formatting fixes.
7457 (class Parser_closure): Change language_stack_ from a vector of
7458 std::string to one of Version_script_info::Language. Adjust all
7460 (class Lazy_demangler): Remove.
7461 (struct Version_expression): Change language from std::string to
7462 Version_script_info::Language.
7463 (Version_script_info::Version_script_info): New function.
7464 (Version_script_info::~Version_script_info): Don't call clear.
7465 (Version_script_info::finalize): New function.
7466 (Version_script_info::build_lookup_tables): New function.
7467 (Version_script_info::build_expression_list_lookup): New
7469 (Version_script_info::get_symbol_version_helper): Rewrite to use
7471 (Version_script_info::print_expression_list): Adjust to use
7472 Version_script_info::Language.
7473 (script_push_lex_into_version_mode): Check that the version script
7474 has not been finalized.
7475 (version_script_push_lang): Change language string to
7476 Version_script_info::Language.
7477 * options.cc (Command_line::version_script): New function.
7478 * options.h (class General_options): Add finalize_dynamic_list
7479 function. Change version_script from declaration to definition.
7480 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7481 * testsuite/version_script.map: Remove duplicate def of foo.
7482 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7484 * testsuite/Makefile.in: Rebuild.
7486 2009-12-30 Ian Lance Taylor <iant@google.com>
7489 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7490 if the input symbol index is 0, make the output symbol index 0.
7492 2009-12-30 Ian Lance Taylor <iant@google.com>
7495 * options.h (class General_options): Add -x/--discard-all.
7496 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7497 --discard-all. If the local symbol needs a dynamic entry, check
7498 that before handling --discard-locals.
7500 2009-12-30 Ian Lance Taylor <iant@google.com>
7503 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7505 (Output_segment::add_output_section): Don't change the flags if
7509 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7510 GNU hash table if they need a dynamic value. Otherwise, don't add
7511 them if they are defined in a dynamic object or are forced local.
7513 2009-12-29 Ian Lance Taylor <iant@google.com>
7516 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7517 .gnu.hash table for a 32-bit target.
7520 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7521 regular and a dynamic object only needs a dynamic symbol table
7522 entry if it is externally visible.
7525 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7526 constructor. Add global_offset_table_ field.
7527 (Target_i386::got_section): Set global_offset_table_.
7528 (Target_i386::do_finalize_sections): Set global_offset_table_
7530 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7531 in constructor. Add global_offset_table_ field.
7532 (Target_x86_64::got_section): Set global_offset_table_.
7533 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7536 * layout.cc (Layout::Layout): Initialize increase_relro_.
7537 (Layout::get_output_section): Add is_relro, is_last_relro, and
7538 is_first_non_relro parameters. Change all callers.
7539 (Layout::choose_output_section): Likewise.
7540 (Layout::add_output_section_data): Likewise.
7541 (Layout::make_output_section): Likewise.
7542 (Layout::set_segment_offsets): Clear increase_relro when using a
7544 * layout.h (class Layout): Add increase_relro method. Add
7545 increase_relro_ field. Update declarations.
7546 * output.cc (Output_section::Output_section): Initialize
7547 is_last_relro_ and is_first_non_relro_.
7548 (Output_segment::add_output_section): Group relro sections is
7549 do_sort is true. Handle is_last_relro and is_first_non_relro.
7550 (Output_segment::maximum_alignment): Remove relro handling.
7551 (Output_segment::set_section_addresses): Add increase_relro
7552 parameter. Change all callers. Add initial alignment to align
7553 relro sections on separate page. Remove old relro handling.
7554 (Output_segment::set_section_list_addresses): Remove in_relro
7555 parameter. Change all callers.
7556 (Output_segment::set_offset): Add increase parameter. Change all
7557 callers. Remove old relro handling.
7558 * output.h (class Output_section): Add new methods: is_last_relro,
7559 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7560 Add is_last_relro_ and is_first_non_relro_ fields.
7561 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7562 Create separate .got.plt section. Call increase_relro.
7563 * x86_64.cc (Target_x86_64::got_section): Likewise.
7564 * testsuite/relro_script_test.t: Add .got.plt.
7567 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7568 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7569 (Layout::finalize): Call set_dynamic_symbol_size.
7570 (Layout::set_dynamic_symbol_size): New function.
7571 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7572 set_dynamic_symbol_size.
7575 * output.h (class Output_section): Add is_entsize_zero_ field.
7576 * output.cc (Output_section::Output_section): Initialize
7578 (Output_section::set_entsize): If two different entsizes are
7579 requested, force it to zero.
7580 (Output_section::add_input_section): Set flags for .debug_str
7581 before updating section flags. Set entsize.
7582 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7583 and SHF_STRING if all input sections have those flags.
7585 2009-12-29 Rafael Espindola <espindola@google.com>
7587 * main.cc (main): Fix the sys time reporting.
7588 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7591 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7593 * options.cc (General_options::parse_version): Allow -v to exit
7594 without an error if there is nothing to link.
7596 2009-12-29 Ian Lance Taylor <iant@google.com>
7598 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7599 using a version of gcc before 4.1.
7600 * configure: Rebuild.
7602 2009-12-28 Chris Demetriou <cgd@google.com>
7604 * attributes.cc (Output_attributes_section_data::do_write): Use
7605 std::vector::front rather than std::vector::data.
7607 2009-12-28 Ian Lance Taylor <iant@google.com>
7609 * symtab.h (class Symbol_table): Add enum Defined.
7610 * resolve.cc (Symbol_table::should_override): Add defined
7611 parameter. Change all callers. Test whether object is NULL
7612 before calling a method on it.
7613 (Symbol_table::report_resolve_problem): Add defined parameter.
7615 (Symbol_table::should_override_with_special): Likewise.
7616 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7617 parameter. Change all callers.
7618 (Symbol_table::do_define_in_output_data): Likewise.
7619 (Symbol_table::define_in_output_segment): Likewise.
7620 (Symbol_table::do_define_in_output_segment): Likewise.
7621 (Symbol_table::define_as_constant): Likewise.
7622 (Symbol_table::do_define_as_constant): Likewise.
7623 * script.h (class Symbol_assignment): Add is_defsym parameter to
7624 constructor; change all callers.
7625 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7626 parameter. Change all callers. Add is_defsym_ field.
7627 (class Parser_closure): Add parsing_defsym parameter to
7628 constructor; change all callers. Add parsing_defsym accessor
7629 function. Add parsing_defsym_ field.
7631 2009-12-28 Ian Lance Taylor <iant@google.com>
7633 * gold.cc (queue_middle_tasks): Fix formatting.
7634 * object.cc (Relobj::is_section_name_included): Likewise.
7636 2009-12-23 Ian Lance Taylor <iant@google.com>
7638 * i386.cc (Target_i386::do_calls_non_split): Recognize
7639 -fsplit-stack prologue for a function with a static chain.
7640 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7641 -fsplit-stack prologue when using %r11.
7643 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7645 * options.cc (General_options::parse_version): Make -v continue and do
7646 the link like GNU ld does.
7648 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7650 * Makefile.am (CCFILES): Add timer.cc.
7651 (HFILES): Add timer.h.
7652 * configure.ac: Check for sysconf and times.
7653 * main.cc: include timer.h.
7654 (main): Use Timer instead of get_run_time.
7657 * workqueue.cc: include timer.h.
7658 (Workqueue::find_and_run_task):
7659 Report user, sys and wall time.
7660 * Makefile.in: Regenerate.
7661 * config.in: Regenerate.
7662 * configure: Regenerate.
7664 2009-12-16 Doug Kwan <dougkwan@google.com>
7666 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7668 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7669 relaxed input sections.
7670 * output.cc (Output_section::find_relaxed_input_section): Change
7671 return type to Output_relaxed_input_section pointer. Adjust code
7672 for new type of relaxed_input_section_map_.
7673 * output.h (Output_section::find_relaxed_input_section): Change
7674 return type to Output_relaxed_input_section pointer.
7675 (Output_section::Output_relaxed_input_section_by_input_section_map):
7677 (Output_section::relaxed_input_section_map_): Change type to
7678 Output_section::Output_relaxed_input_section_by_input_section_map.
7679 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7682 2009-12-15 Ian Lance Taylor <iant@google.com>
7684 * layout.cc (Layout::create_shstrtab): Only write out after input
7685 sections if we are compressing debug sections.
7687 2009-12-15 Ian Lance Taylor <iant@google.com>
7689 * archive.cc (Archive::add_symbols): Only look up a symbol without
7690 a version if there is, in fact, a version.
7692 2009-12-14 Ian Lance Taylor <iant@google.com>
7694 Revert -Wshadow changes, all changes from:
7695 2009-12-11 Doug Kwan <dougkwan@google.com>
7696 2009-12-11 Nick Clifton <nickc@redhat.com>
7697 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7699 2009-12-11 Doug Kwan <dougkwan@google.com>
7701 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7703 * attributes.cc (Object_attribute::size): Ditto.
7704 (Attributes_section_data::size): Ditto.
7705 (Attributes_section_data::Attributes_section_data): Ditto.
7706 (Output_attributes_section_data::do_write): Ditto.
7707 * attributes.h (Object_attribute::set_type): Ditto.
7708 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7710 2009-12-11 Nick Clifton <nickc@redhat.com>
7712 * archive.cc: Fix shadowed variable warnings.
7714 * compressed_output.cc: Likewise.
7715 * compressed_output.h: Likewise.
7716 * configure: Likewise.
7717 * dwarf_reader.cc: Likewise.
7718 * dynobj.cc: Likewise.
7719 * dynobj.h: Likewise.
7720 * ehframe.cc: Likewise.
7721 * ehframe.h: Likewise.
7722 * errors.cc: Likewise.
7723 * expression.cc: Likewise.
7724 * fileread.cc: Likewise.
7725 * fileread.h: Likewise.
7726 * freebsd.h: Likewise.
7727 * i386.cc: Likewise.
7729 * incremental.h: Likewise.
7730 * layout.cc: Likewise.
7731 * layout.h: Likewise.
7732 * mapfile.cc: Likewise.
7733 * merge.cc: Likewise.
7734 * merge.h: Likewise.
7735 * object.cc: Likewise.
7736 * object.h: Likewise.
7737 * options.h: Likewise.
7738 * output.cc: Likewise.
7739 * output.h: Likewise.
7740 * parameters.cc: Likewise.
7741 * plugin.cc: Likewise.
7742 * powerpc.cc: Likewise.
7743 * reduced_debug_output.cc: Likewise.
7744 * reduced_debug_output.h: Likewise.
7745 * reloc.cc: Likewise.
7746 * reloc.h: Likewise.
7747 * resolve.cc: Likewise.
7748 * script-sections.cc: Likewise.
7749 * script.cc: Likewise.
7750 * script.h: Likewise.
7751 * sparc.cc: Likewise.
7752 * symtab.cc: Likewise.
7753 * symtab.h: Likewise.
7754 * target-select.cc: Likewise.
7755 * target-select.h: Likewise.
7756 * token.h: Likewise.
7757 * workqueue.cc: Likewise.
7758 * workqueue.h: Likewise.
7759 * x86_64.cc: Likewise.
7761 2009-12-10 Doug Kwan <dougkwan@google.com>
7763 * arm.cc (attributes.h): New include.
7764 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7765 (Arm_relobj::~Arm_relobj): Delete object pointed by
7766 attributes_section_data_.
7767 (Arm_relobj::attributes_section_data): New method definition.
7768 (Arm_relobj::attributes_section_data_): New data member declaration.
7769 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7770 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7771 attributes_section_data_.
7772 (Arm_dynobj::attributes_section_data): New method definition.
7773 (Arm_dynobj::attributes_section_data_): New data member declaration.
7774 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7775 initialization value of may_use_blx_ to false.
7776 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7777 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7778 object attributes to compute results instead of hard-coding.
7779 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7780 Target_arm::get_secondary_compatible_arch,
7781 Target_arm::set_secondary_compatible_arch
7782 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7783 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7784 New method declarations.
7785 (Target_arm::get_aeabi_object_attribute): New method definition.
7786 (Target_arm::attributes_section_data_): New data member declaration.
7787 (read_arm_attributes_section): New template definition.
7788 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7789 (Arm_dynobj::do_read_symbols): Ditto.
7790 (Target_arm::do_finalize_sections): Merge attributes sections from
7791 input. Check for BLX use after attributes section merging.
7792 Fix __exidx_start and __exidx_end visibility. Create an
7793 .ARM.attributes section if necessary.
7794 (Target_arm::get_secondary_compatible_arch,
7795 Target_arm::set_secondary_compatible_arch,
7796 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7797 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7798 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7799 New method definitions.
7801 2009-12-09 Ian Lance Taylor <iant@google.com>
7803 * plugin.cc (Plugin::load): Don't cast from void* to a function
7806 2009-12-09 Ian Lance Taylor <iant@google.com>
7808 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7811 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7813 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7814 Replace two_file_shared_1.so with two_file_shared_2.so.
7815 * testsuite/Makefile.in: Regenerated.
7817 2009-12-08 Doug Kwan <dougkwan@google.com>
7819 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7820 (HFILES): Add attributes.h and int_encoding.h.
7821 * Makefile.in: Regenerate.
7822 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7823 function definitions to int_encoding.cc
7824 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7825 prototypes to int_encoding.h
7826 * reduced_debug_output.cc (int_encoding.h): New include.
7827 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7828 function definitions to int_encoding.cc
7829 (insert_into_vector, read_from_pointer): Move template definitions to
7831 * attributes.cc: New file.
7832 * attributes.h: New file.
7833 * int_encoding.cc: New file.
7834 * int_encoding.h: New file.
7836 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7839 * incremental-dump.cc (dump_incremental_inputs): New.
7840 (main): Use dump_incremental_inputs.
7842 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7845 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7846 checking elfcpp::STT_FUNC.
7847 (Target_i386::Relocate::relocate): Likewise.
7848 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7850 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7851 symbols from shared libraries into normal FUNC symbols.
7853 * symtab.h (Symbol): Add is_func and use it.
7855 2009-12-05 Doug Kwan <dougkwan@google.com>
7857 * arm.cc (Target_arm::arm_info): Initialize new fields
7858 attributes_section and attributes_vendor.
7859 * i386.cc (Target_i386::i386_info): Same.
7860 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7861 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7862 fields attributes_section and attributes_vendor.
7863 * sparc.cc (Target_sparc::sparc_info): Same.
7864 * target.h (Target::attributes_section, Target::attributes_vendor,
7865 Target::is_attributes_section, Target::attribute_arg_type,
7866 Target::attributes_order): New method definitions.
7867 (Target::Target_info::attributes_section,
7868 Target::Target_info::attributes_vendor): New fields.
7869 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7870 virtual method definitions.
7871 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7872 attributes_section and attributes_vendor.
7873 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7875 2009-12-05 Doug Kwan <dougkwan@google.com>
7877 * arm.cc: Update comments about interworking and stub generation.
7878 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7879 considered as non-PIC.
7880 (Arm_relocate_functions::base_abs): Fix formatting.
7881 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7882 of function to use GOT entry address instead of offset.
7883 (Target_arm::Scan::global): Issue an error if a symbol would need a
7884 PLT does not get one because it is untyped. Remove code to create
7885 dynamic symbols for relative branches.
7886 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7887 takes unsigned integer instead of boolean.
7889 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7891 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7892 (two_file_test_LDADD): Likewise.
7893 (common_test_1_LDADD): Likewise.
7894 (exception_test_LDADD) Likewise.
7895 (weak_test_LDADD): Likewise.
7896 (many_sections_test_LDADD): Likewise.
7897 (initpri1_LDADD): Likewise.
7898 (script_test_1_LDADD): Likewise.
7899 (script_test_2_LDADD): Likewise.
7900 (justsyms_LDADD): Likewise.
7901 (binary_test_LDADD): Likewise.
7902 (large_LDADD): Likewise.
7903 * testsuite/Makefile.in: Regenerated.
7905 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
7907 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7908 (Symbol_table::override_with_special): Likewise.
7909 (Symbol_table::add_from_object): Likewise.
7911 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7913 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7914 Don't set the data_offset twice.
7916 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7918 * testsuite/Makefile.in: Regenerate.
7920 2009-12-03 Doug Kwan <dougkwan@google.com>
7922 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7923 (Target_arm::do_finalize_sections): Add parameter for symbol table
7924 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7925 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7926 parameter for symbol table pointer.
7927 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7928 an additional parameter for a pointer to symbol table.
7929 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7930 parameter for a symbol table pointer.
7931 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7932 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7934 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7935 parameter for a symbol table pointer.
7937 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7939 * incremental.cc (Incremental_inputs_header)
7940 (Incremental_inputs_header_write, Incremental_inputs_entry)
7941 (Incremental_inputs_entry_write): Move ...
7942 * incremental.h (Incremental_inputs_header)
7943 (Incremental_inputs_header_write, Incremental_inputs_entry)
7944 (Incremental_inputs_entry_write): here.
7946 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7948 * incremental.cc (make_sized_incremental_binary): Set the target.
7949 Error if it is incompatible.
7950 * output.h (Output_file): Add filename method.
7952 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7954 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7955 from the get_* methods.
7957 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7959 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7960 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7961 Write 0 for the data_offset of scripts.
7963 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7965 * testsuite/Makefile.am: Add the incremental_test.sh test.
7966 * testsuite/incremental_test.sh: New.
7967 * testsuite/incremental_test_1.c: New.
7968 * testsuite/incremental_test_2.c: New.
7970 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
7972 * incremental-dump.cc (main): Fix typos.
7974 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
7977 * incremental-dump.cc (main): Use llu to print 64 bit values.
7979 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7980 H.J. Lu <hongjiu.lu@intel.com>
7982 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7984 (incremental_dump_LDADD): Likewise.
7985 * Makefile.in: Regenerated.
7987 2009-11-25 Doug Kwan <dougkwan@google.com>
7991 2009-11-25 Doug Kwan <dougkwan@google.com>
7993 * arm.cc (Target_arm::Target_arm): Move method definition
7994 outside of class definition. Add code to handle
7995 --target1-rel, --target1-abs and --target2= options.
7996 (Target_arm::get_reloc_reloc_type): Change method to be
7997 non-static and const.
7998 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7999 New data member declaration.
8000 (Target_arm::Scan::local, Target_arm::Scan::global,
8001 Target_arm::Relocate::relocate,
8002 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8003 Adjust call to Target_arm::get_real_reloc_type.
8004 (Target_arm::get_real_reloc_type): Use command line options
8005 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8006 * options.h (--target1-rel, --target1-abs, --target2): New
8009 2009-11-25 Doug Kwan <dougkwan@google.com>
8011 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8012 class definition. Add code to handle --target1-rel, --target1-abs
8013 and --target2= options.
8014 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8016 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8018 (Target_arm::Scan::local, Target_arm::Scan::global,
8019 Target_arm::Relocate::relocate,
8020 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8021 call to Target_arm::get_real_reloc_type.
8022 (Target_arm::get_real_reloc_type): Use command line options to
8023 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8024 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8027 2009-11-25 Doug Kwan <dougkwan@google.com>
8029 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8030 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8031 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8033 (Arm_relocate_functions::thm_call): Replace body with a call to
8034 Arm_relocate_functions::thumb_branch_common.
8035 (Arm_relocate_functions::thm_jump24,
8036 Arm_relocate_functions::thm_xpc22): New method definitions.
8037 (Arm_relocate_functions::thumb_branch_common): New method definition.
8038 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8040 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8041 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8043 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8045 * Makefile.am: Build incremental-dump
8046 * Makefile.in: Regenerate.
8047 * incremental-dump.cc: New.
8048 * incremental.cc (Incremental_inputs_header_data,
8049 Incremental_inputs_entry_data): Move to incremental.h
8050 * incremental.h: (Incremental_inputs_header_data,
8051 Incremental_inputs_entry_data): Move from incremental.cc
8053 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8055 * incremental.cc (Incremental_inputs_header,
8056 Incremental_inputs_header_write, Incremental_inputs_entry,
8057 Incremental_inputs_entry_write): Add a typedef with the data type.
8059 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8061 * incremental.cc (Incremental_inputs_header,
8062 Incremental_inputs_header_write, Incremental_inputs_entry,
8063 Incremental_inputs_entry_write): Update comment about which
8064 type has the filed descriptions.
8066 2009-11-15 Doug Kwan <dougkwan@google.com>
8068 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8069 (Arm_relocate_functions::arm_branch_common): Change method defintion
8070 in class definition to a method declaration and update list of formal
8072 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8073 Arm_relocation_functions::jump24): Adjust call to
8074 Arm_relocate_functions::arm_branch_common. Update list of formal
8076 (Arm_relocate_functions::xpc25): New method definition.
8077 (Arm_relocate_functions::arm_branch_common): Move method defintion
8078 out from class definition. Use stubs for mode-switching and extending
8080 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8081 specially. Change code to enable use of stubs in ARM branches.
8083 2009-11-10 Doug Kwan <dougkwan@google.com>
8085 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8086 in method declaration.
8087 (Target_arm::relocate_stub): New method declaration.
8088 (Target_arm::default_target): Change to return a pointer instead of
8090 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8091 Target_arm::default_target.
8092 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8094 (Target_arm::relocate_section): Adjust view.
8095 (Target_arm::relocate_stub): New method definition.
8097 2009-11-10 Doug Kwan <dougkwan@google.com>
8099 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8101 * incremental.cc (open_incremental_binary): Initialized local
8102 variables to avoid warnings.
8103 * object.cc (make_elf_object): Ditto.
8104 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8107 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8110 * testsuite/plugin_test.c: Include "config.h".
8112 2009-11-09 Doug Kwan <dougkwan@google.com>
8114 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8115 (arm_symbol_value): Remove.
8116 (Arm_relocate_functions::arm_branch_common,
8117 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8118 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8119 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8120 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8121 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8122 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8123 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8124 Arm_relocate_functions::thm_mobw_abs_nc,
8125 Arm_relocate_functions::thm_mov_abs,
8126 Arm_relocate_functions::movw_prel_nc,
8127 Arm_relocate_functions::thm_movt_abs,
8128 Arm_relocate_functions::movt_prel,
8129 Arm_relocate_functions::thm_movw_prel_nc,
8130 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8131 (Target_arm::Relocate::relocate): Only decompose address into two
8132 parts if relocation type uses the thumb-bit and pass the actual
8133 bit instead of a flag indicating that the thumb-bit is used. Adjust
8134 calls to methods in Arm_relocate_functions for this change.
8136 2009-11-08 Ian Lance Taylor <iant@google.com>
8139 * reloc.cc: Instantiate
8140 Sized_relobj::initialize_input_to_output_maps and
8141 Sized_relobj:free_input_to_output_maps.
8143 2009-11-06 Ian Lance Taylor <iant@google.com>
8146 * defstd.cc (in_segment): Set only_if_ref true for "end".
8148 2009-11-06 Doug Kwan <dougkwan@google.com>
8150 * arm.cc (class Reloc_stub): Correct a comment.
8151 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8152 (Target_arm::scan_section_for_stubs): New method declaration.
8153 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8154 Change methods from private to protected.
8155 (Target_arm::do_may_relax): New method definition.
8156 (Target_arm::do_relax, Target_arm::group_sections,
8157 Target_arm::scan_reloc_for_stub,
8158 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8159 (Target_arm::arm_input_section_map_): New data member declaration.
8160 (Target_arm::scan_reloc_for_stub,
8161 Target_arm::scan_reloc_section_for_stubs,
8162 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8163 Target_arm::do_relax): New method definitions.
8165 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8167 * configure.ac: Check for (struct stat)::st_mtim
8168 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8169 * config.in: Regenerate.
8170 * configure: Regenerate.
8172 2009-11-05 Ian Lance Taylor <iant@google.com>
8175 * output.cc (Output_segment::add_output_section): Add missing
8178 2009-11-04 Ian Lance Taylor <iant@google.com>
8181 * object.h (class Object): Add is_needed and set_is_needed
8182 methods. Add is_needed_ field. Make bool fields into bitfields.
8183 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8184 defined in a dynamic object and referenced by a regular object,
8185 set is_needed for the dynamic object.
8186 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8187 if the file is marked with as_needed and it is not needed.
8189 2009-11-04 Ian Lance Taylor <iant@google.com>
8192 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8193 tags if data is discarded by linker script.
8194 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8195 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8196 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8197 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8199 2009-11-04 Ian Lance Taylor <iant@google.com>
8201 * layout.cc (Layout::get_output_section): Add is_interp and
8202 is_dynamic_linker_section parameters. Change all callers.
8203 (Layout::choose_output_section): Likewise.
8204 (Layout::make_output_section): Likewise.
8205 (Layout::add_output_section_data): Add is_dynamic_linker_section
8206 parameter. Change all callers.
8207 * layout.h (class Layout): Update declarations.
8208 * output.h (class Output_section): Add is_interp, set_is_interp,
8209 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8210 Add is_interp_, is_dynamic_linker_section_ fields. Change
8211 generate_code_fills_at_write_ to a bitfield.
8212 * output.cc (Output_section::Output_sections): Initialize new
8214 (Output_segment::add_output_section): Add do_sort parameter.
8217 2009-11-03 Ian Lance Taylor <iant@google.com>
8220 * options.h (class General_options): Add --warn-common.
8221 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8222 merging two common symbols.
8223 (Symbol_table::should_override): Handle --warn-common when merging
8224 a common symbol with a defined symbol. Use report_resolve_problem
8225 for multiple definitions.
8226 (Symbol_table::report_resolve_problem): New function.
8227 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8229 2009-11-03 Doug Kwan <dougkwan@google.com>
8231 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8233 (Target_arm::stub_factory): New method definition.
8234 (Target_arm::new_arm_input_section,
8235 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8236 Target_arm::reloc_uses_thumb_bit): New method declarations.
8237 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8238 New type definitions.
8239 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8240 member declarations.
8241 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8242 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8243 New method definitions.
8245 2009-11-03 Ian Lance Taylor <iant@google.com>
8247 * options.h (class General_options): Add --warn_constructors.
8249 2009-11-03 Ian Lance Taylor <iant@google.com>
8252 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8253 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8255 2009-11-03 Ian Lance Taylor <iant@google.com>
8258 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8259 --msgid-bugs-address.
8260 (install-pdf): New target.
8261 (install-data_yes): Look up one directory to find mkinstalldirs.
8263 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8265 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8268 2009-10-30 Doug Kwan <dougkwan@google.com>
8270 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8272 2009-10-30 Doug Kwan <dougkwan@google.com>
8274 * arm.cc (Stub_addend_reader): New struct template definition
8275 and partial specializations.
8276 (Stub_addend_reader::operator()): New method definition for a
8277 partially specialized template.
8279 2009-10-30 Doug Kwan <dougkwan@google.com>
8281 * arm.cc (Arm_relobj::processor_specific_flags): New method
8283 (Arm_relobj::do_read_symbols): New method declaration.
8284 (Arm_relobj::processor_specific_flags_): New data member declaration.
8285 (Arm_dynobj): New class definition.
8286 (Target_arm::do_finalize_sections): Add input_objects parameter.
8287 (Target_arm::do_adjust_elf_header): New method declaration.
8288 (Target_arm::are_eabi_versions_compatible,
8289 (Target_arm::merge_processor_specific_flags): New method declaration.
8290 (Target_arm::do_make_elf_object): New overloaded method definitions
8292 (Arm_relobj::do_read_symbols): New method definition.
8293 (Arm_dynobj::do_read_symbols): Ditto.
8294 (Target_arm::do_finalize_sections): Add input_objects parameters.
8295 Merge processor-specific flags from all input objects.
8296 (Target_arm::are_eabi_versions_compatible,
8297 Target_arm::merge_processor_specific_flags,
8298 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8299 New method definitions.
8300 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8301 Input_objects pointer type parameter.
8302 * layout.cc (Layout::finalize): Pass input objects to target's.
8303 finalize_sections function.
8304 * output.cc (Output_file_header::do_sized_write): Set ELF file
8305 header's processor-specific flags.
8306 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8307 Input_objects pointer type parameter.
8308 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8309 * target.h (Input_objects): New forward class declaration.
8310 (Target::processor_specific_flags,
8311 Target::are_processor_specific_flags_sect): New method definitions.
8312 (Target::finalize_sections): Add input_objects parameter.
8313 (Target::Target): Initialize processor_specific_flags_ and
8314 are_processor_specific_flags_set_.
8315 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8317 (Target::set_processor_specific_flags): New method definition.
8318 (Target::processor_specific_flags_,
8319 Target::are_processor_specific_flags_set_): New data member
8321 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8322 Input_objects pointer type parameter.
8324 2009-10-30 Doug Kwan <dougkwan@google.com>
8326 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8328 2009-10-28 Ian Lance Taylor <iant@google.com>
8330 * object.h (class Relobj): Drop options parameter from
8331 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8332 do_scan_relocs, do_relocate. Change all callers.
8333 (class Sized_relobj): Drop options parameters from
8334 do_gc_process_relocs, do_scan_relocs, do_relocate,
8335 do_relocate_sections, relocate_sections, emit_relocs_scan,
8336 emit_relocs_scan_reltype. Change all callers.
8337 (struct Relocate_info): Remove options field and all references to
8339 * reloc.h (class Read_relocs): Remove options constructor
8340 parameter and options_ field. Change all callers.
8341 (class Gc_process_relocs, class Scan_relocs): Likewise.
8342 (class Relocate_task): Likewise.
8343 * target-reloc.h (scan_relocs): Remove options parameter. Change
8345 (scan_relocatable_relocs): Likewise.
8346 * target.h (class Sized_target): Remove options parameter from
8347 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8349 * gc.h (gc_process_relocs): Remove options parameter. Change all
8351 * arm.cc: Update functions to remove options parameters.
8352 * i386.cc: Likewise.
8353 * powerpc.cc: Likewise.
8354 * sparc.cc: Likewise.
8355 * x86_64.cc: Likewise.
8356 * testsuite/testfile.cc: Likewise.
8358 2009-10-28 Doug Kwan <dougkwan@google.com>
8360 * arm.cc (Arm_relobj): New class definition.
8361 (Arm_relobj::scan_sections_for_stubs,
8362 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8363 New method definitions.
8365 2009-10-28 Cary Coutant <ccoutant@google.com>
8367 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8368 (Plugin::cleanup_done_): New member.
8369 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8370 (Plugin_manager::cleanup_done_): Remove.
8371 (Plugin_manager::add_input_file): Edit error message.
8372 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8373 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8375 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8377 * fileread.cc: (File_read::View::~View): Use the new
8378 data_ownership_ filed.
8379 (File_read::~File_read): Dispose the new whole_file_view_.
8380 (File_read::open): Mmap the whole file if needed.
8381 (File_read::open): Use whole_file_view_ instead of contents_.
8382 (File_read::find_view): Use whole_file_view_ if applicable.
8383 (File_read::do_read): Use whole_file_view_ instead of contents_.
8384 (File_read::make_view): Use whole_file_view_ instead of contents_,
8385 update File_read::View::View call.
8386 (File_read::find_or_make_view): Update File_read::View::View
8388 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8390 (File_read::View::Data_ownership): New enum.
8391 (File_read::View::View): Replace bool mapped_ with Data_ownership
8393 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8394 (File_read::View::data_ownership_): New field.
8395 (File_read::contents_): Remove (replaced by whole_file_view_).
8396 (File_read::whole_file_view_): New field.
8397 * options.h (class General_options): Add --keep-files-mapped.
8399 2009-10-27 Cary Coutant <ccoutant@google.com>
8401 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8402 * testsuite/Makefile.am (plugin_test_5): New test case.
8403 * testsuite/Makefile.in: Regenerate.
8405 2009-10-25 Doug Kwan <dougkwan@google.com>
8407 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8408 from private to protected to allow access by child class.
8409 (Sized_relobj::do_relocate_sections): New method declaration.
8410 (Sized_relobj::relocate_sections): Virtualize.
8411 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8412 Sized_relobj::relocate_sections. Instantiate template explicitly
8413 for different target sizes and endianity.
8415 2009-10-24 Doug Kwan <dougkwan@google.com>
8417 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8418 (Arm_input_section::as_arm_input_section): New method.
8419 (Arm_output_section): New class definition.
8420 (Arm_output_section::create_stub_group,
8421 Arm_output_section::group_sections): New method definitions.
8423 2009-10-22 Doug Kwan <dougkwan@google.com>
8425 * arm.cc (Arm_input_section): New class definition.
8426 (Arm_input_section::init, Arm_input_section:do_write,
8427 Arm_input_section::set_final_data_size,
8428 Arm_input_section::do_reset_address_and_file_offset): New method
8431 2009-10-21 Doug Kwan <dougkwan@google.com>
8433 * arm.cc (Stub_table, Arm_input_section): New forward class
8435 (Stub_table): New class defintion.
8436 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8437 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8438 New method definition.
8440 2009-10-21 Doug Kwan <dougkwan@google.com>
8442 * arm.cc: Update copyright comments.
8443 (Target_arm): New forward class template declaration.
8444 (Arm_address): New type.
8445 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8446 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8447 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8449 (Insn_template): Same.
8450 (DEF_STUBS): New macro.
8451 (Stub_type): New enum type.
8452 (Stub_template): New class definition.
8455 (Stub_factory): Same.
8456 (Target_arm::Target_arm): Initialize may_use_blx_ and
8457 should_force_pic_veneer_.
8458 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8459 Target_arm::should_force_pic_veneer,
8460 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8461 Target_arm::using_thumb_only, Target_arm:;default_target): New
8463 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8464 New data member declarations.
8465 (Insn_template::size, Insn_template::alignment): New method defintions.
8466 (Stub_template::Stub_template): New method definition.
8467 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8468 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8469 (Stub_factory::Stub_factory): New method definition.
8470 * gold.h (string_hash): New template.
8471 * output.h (Input_section_specifier::hash_value): Use
8473 (Input_section_specifier::string_hash): Remove.
8474 * stringpool.cc (Stringpool_template::string_hash): Use
8477 2009-10-20 Doug Kwan <dougkwan@google.com>
8479 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8480 symbols of relaxed input sections.
8481 * output.h (Output_section::find_relaxed_input_section): Make
8484 2009-10-16 Doug Kwan <dougkwan@google.com>
8486 * dynobj.cc (Versions::Versions): Initialize version_script_.
8487 Only insert base version symbol definition for a shared object
8488 if version script defines any version versions.
8489 (Versions::define_base_version): New method definition.
8490 (Versions::add_def): Check that base version is not needed.
8491 (Versions::add_need): Define base version lazily.
8492 * dynobj.h (Versions::define_base_version): New method declaration.
8493 (Versions::needs_base_version_): New data member declaration.
8494 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8495 (check_DATA): Add no_version_test.stdout.
8496 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8498 * testsuite/Makefile.in: Regenerate.
8499 * testsuite/no_version_test.c: New file.
8500 * testsuite/no_version_test.sh: Ditto.
8502 2009-10-16 Doug Kwan <dougkwan@google.com>
8504 * expression.cc (class Segment_start_expression): New class definition.
8505 (Segment_start_expression::value): New method definition.
8506 (script_exp_function_segment_start): Return a new
8507 Segment_start_expression.
8508 * gold/script-c.h (script_saw_segment_start_expression): New function
8510 * script-sections.cc (Script_sections::Script_sections): Initialize
8511 SAW_SEGMENT_START_EXPRESSION_ to false.
8512 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8513 and -Tbbs options to specify section addresses if given in
8514 command line and no SEGMENT_START expression is seen in a script.
8515 * script-sections.h (Script_sections::saw_segment_start_expression,
8516 Script_sections::set_saw_segment_start_expression): New method
8518 (Script_sections::saw_segment_start_expression_): New data member
8520 * script.cc (script_saw_segment_start_expression): New function.
8521 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8522 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8523 script_test_7.sh and script_test_8.sh.
8524 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8525 script_test_8.stdout.
8526 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8527 (script_test_6, script_test_6.stdout, script_test_7,
8528 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8529 * Makefile.in: Regenerate.
8530 * testsuite/script_test_6.sh: New file.
8531 * testsuite/script_test_6.t: Same.
8532 * testsuite/script_test_7.sh: Same.
8533 * testsuite/script_test_7.t: Same.
8534 * testsuite/script_test_8.sh: Same.
8536 2009-10-16 Doug Kwan <dougkwan@google.com>
8538 * output.cc (Output_segment::set_section_list_address): Cast
8539 expressions to unsigned long long type to avoid format warnings.
8541 2009-10-15 Ian Lance Taylor <iant@google.com>
8543 * script.cc (Script_options::add_symbol_assignment): Always add a
8544 dot assignment to script_sections_.
8545 * script-sections.cc (Script_sections::add_dot_assignment):
8546 Initialize if necessary.
8548 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8549 program headers with no load segment if there is a linker script.
8551 * layout.cc (Layout::set_segment_offsets): Align the file offset
8552 to the segment aligment for -N or -n with no load segment.
8553 * output.cc (Output_segment::add_output_section): Don't crash if
8554 the first section is a TLS section.
8555 (Output_segment::set_section_list_addresses): Print an error
8556 message if the address moves backward in a linker script.
8557 * script-sections.cc
8558 (Output_section_element_input::set_section_addresses): Don't
8559 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8560 (Orphan_output_section::set_section_addresses): Likewise.
8562 2009-10-15 Doug Kwan <dougkwan@google.com>
8564 * layout.cc (Layout::finish_dynamic_section): Generate tags
8565 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8566 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8567 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8569 2009-10-14 Ian Lance Taylor <iant@google.com>
8571 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8573 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8574 data_shdr fields of relinfo.
8575 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8576 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8577 R_386_TLS_LDO_32, adjust based on section flags.
8578 (Target_i386::Relocate::fix_up_ldo): Remove.
8580 2009-10-13 Ian Lance Taylor <iant@google.com>
8582 Add support for -pie.
8583 * options.h (class General_options): Add -pie and
8585 (General_options::output_is_position_independent): Test -pie.
8586 (General_options::output_is_executable): Return true if not shared
8587 and not relocatable.
8588 (General_options::output_is_pie): Remove.
8589 * options.cc (General_options::finalize): Reject incompatible uses
8591 * gold.cc (queue_middle_tasks): A -pie link is not static.
8592 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8593 * symtab.cc (Symbol::final_value_is_known): Return false if
8594 output_is_position_independent.
8595 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8596 output_is_position_independent.
8597 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8598 output_is_position_independent.
8599 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8600 output_is_position_independent.
8601 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8603 (basic_pie_test.o, basic_pie_test): New targets.
8604 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8605 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8606 (two_file_pie_test): New target.
8607 * testsuite/Makefile.in: Rebuild.
8608 * README: Remove note saying that -pie is not supported.
8610 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8612 * options.h (class General_options): Add -init and -fini.
8613 * layout.cc (Layout::finish_dynamic_section): Emit
8614 given init and fini functions.
8616 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8618 * gc.h (gc_process_relocs): Check if icf is enabled using new
8620 * gold.cc (queue_initial_tasks): Likewise.
8621 (queue_middle_tasks): Likewise.
8622 * object.cc (do_layout): Likewise.
8623 * symtab.cc (is_section_folded): Likewise.
8624 * main.cc (main): Likewise.
8625 * reloc.cc (Read_relocs::run): Likewise.
8626 (Sized_relobj::do_scan_relocs): Likewise.
8627 * icf.cc (is_function_ctor_or_dtor): New function.
8628 (Icf::find_identical_sections): Check if function is ctor or dtor when
8630 * options.h (General_options::icf): Change option to be an enum.
8631 (Icf_status): New enum.
8632 (icf_enabled): New method.
8633 (icf_safe_folding): New method.
8634 (set_icf_status): New method.
8635 (icf_status_): New variable.
8636 * (options.cc) (General_options::finalize): Set icf_status_.
8637 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8638 icf_test and icf_keep_unique_test to use the --icf enum flag.
8639 * testsuite/icf_safe_test.sh: New file.
8640 * testsuite/icf_safe_test.cc: New file.
8642 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8644 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8645 includes to gc.h and icf.h.
8646 * arm.cc: Include gc.h.
8647 * gold.cc: Likewise.
8648 * i386.cc: Likewise.
8649 * powerpc.cc: Likewise.
8650 * sparc.cc: Likewise.
8651 * x86_64.cc: Likewise.
8652 * gc.h: Include icf.h.
8654 2009-10-11 Ian Lance Taylor <iant@google.com>
8656 * plugin.cc: Include "gold.h" before other header files.
8658 2009-10-10 Chris Demetriou <cgd@google.com>
8660 * options.h (Input_file_argument::Input_file_type): New enum.
8661 (Input_file_argument::is_lib_): Replace with...
8662 (Input_file_argument::type_): New member.
8663 (Input_file_argument::Input_file_argument): Take Input_file_type
8664 'type' rather than boolean 'is_lib' as second argument.
8665 (Input_file_argument::is_lib): Use type_.
8666 (Input_file_argument::is_searched_file): New function.
8667 (Input_file_argument::may_need_search): Handle is_searched_file.
8668 * options.cc (General_options::parse_library): Support -l:filename.
8669 (General_options::parse_just_symbols): Update for Input_file_argument
8671 (Command_line::process): Likewise.
8672 * archive.cc (Archive::get_file_and_offset): Likewise.
8673 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8674 * script.cc (read_script_file, script_add_file): Likewise.
8675 * fileread.cc (Input_file::Input_file): Likewise.
8676 (Input_file::will_search_for): Handle is_searched_file.
8677 (Input_file::open): Likewise.
8678 * readsyms.cc (Read_symbols::get_name): Likewise.
8679 * testsuite/Makefile.am (searched_file_test): New test.
8680 * testsuite/Makefile.in: Regenerate.
8681 * testsuite/searched_file_test.cc: New file.
8682 * testsuite/searched_file_test_lib.cc: New file.
8684 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8685 Ian Lance Taylor <iant@google.com>
8687 * descriptor.cc: Include <cstdio> and "binary-io.h".
8688 (Descriptors::open): Open the files in binary mode always.
8689 * script.cc (Lex::get_token): Treat \r as whitespace.
8691 2009-10-09 Ian Lance Taylor <iant@google.com>
8693 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8695 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8696 Ian Lance Taylor <iant@google.com>
8698 * configure.ac: Check for readv function also.
8699 * fileread.cc (readv): Define if not HAVE_READV.
8700 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8702 * config.in: Regenerate.
8703 * configure: Regenerate.
8705 2009-10-09 Doug Kwan <dougkwan@google.com>
8707 * layout.cc (Layout::make_output_section): Call target hook to make
8708 ordinary output section.
8709 (Layout::finalize): Adjust parameter list of call the
8710 Target::may_relax().
8711 * layout.h (class Layout::section_list): New method.
8712 * merge.h (Output_merge_base::entsize): Change visibility to public.
8713 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8715 (Output_merge_string::do_is_string): New method.
8716 * object.cc (Sized_relobj::do_setup): renamed from
8717 Sized_relobj::set_up.
8718 * object.h (Sized_relobj::adjust_shndx,
8719 Sized_relobj::initializ_input_to_output_maps,
8720 Sized_relobj::free_input_to_output_maps): Change visibilities to
8722 (Sized_relobj::setup): Virtualize.
8723 (Sized_relobj::do_setup): New method declaration.
8724 (Sized_relobj::invalidate_section_offset,
8725 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8726 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8727 * options.cc (parse_int): New function.
8728 * options.h (parse_int): New declaration.
8729 (DEFINE_int): New macro.
8730 (stub_group_size): New option.
8731 * output.cc (Output_section::Output_section): Initialize memebers
8732 merge_section_map_, merge_section_by_properties_map_,
8733 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8734 (Output_section::add_input_section): Handled deferred code-fill
8735 generation and remove an old comment.
8736 (Output_section::add_relaxed_input_section): New method definition.
8737 (Output_section::add_merge_input_section): Use merge section by
8738 properties map to speed to search. Update merge section maps
8740 (Output_section::build_relaxation_map): New method definition.
8741 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8743 (Output_section::relax_input_section): Renamed to
8744 Output_section::convert_input_sections_to_relaxed_sections and change
8745 interface to take a vector of pointers to relaxed sections.
8746 (Output_section::find_merge_section,
8747 Output_section::find_relaxed_input_section): New method definitions.
8748 (Output_section::is_input_address_mapped,
8749 Output_section::output_offset, Output_section::output_address):
8750 Use output section data maps to speed up searching.
8751 (Output_section::find_starting_output_address): Add comments.
8752 (Output_section::do_write,
8753 Output_section::write_to_postprocessing_buffer): Do code-fill
8754 generation as appropriate.
8755 (Output_section::get_input_sections): Invalidate relaxed input section
8757 (Output_section::restore_states): Adjust type of checkpoint .
8758 Invalidate relaxed input section map.
8759 * output.h (Output_merge_base): New class declaration.
8760 (Input_section_specifier): New class defintion.
8761 (class Output_relaxed_input_section) Change base class to
8762 Output_section_data_build.
8763 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8764 base class initializer.
8765 (Output_section::add_relaxed_input_section): New method declaration.
8766 (Output_section::Input_section): Change visibility to protected.
8767 (Output_section::Input_section::relobj,
8768 Output_section::Input_section::shndx): Handle relaxed input sections.
8769 Output_section::input_sections) Change visibility to protected. Also
8770 define overload to return a non-const pointer.
8771 (Output_section::Merge_section_properties): New class defintion.
8772 (Output_section::Merge_section_by_properties_map,
8773 Output_section::Output_section_data_by_input_section_map,
8774 Output_section::Relaxation_map): New types.
8775 (Output_section::relax_input_section): Rename method to
8776 Output_section::convert_input_sections_to_relaxed_sections and change
8777 interface to take a vector of relaxed section pointers.
8778 (Output_section::find_merge_section,
8779 Output_section::find_relaxed_input_section,
8780 Output_section::build_relaxation_map,
8781 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8782 New method declarations.
8783 (Output_section::merge_section_map_
8784 Output_section::merge_section_by_properties_map_,
8785 Output_section::relaxed_input_section_map_,
8786 Output_section::is_relaxed_input_section_map_valid_,
8787 Output_section::generate_code_fills_at_write_): New data members.
8788 * script-sections.cc
8789 (Output_section_element_input::set_section_addresses): Call
8790 current_data_size and addralign methods of relaxed input sections.
8791 (Orphan_output_section::set_section_addresses): Call current_data_size
8792 and addralign methods of relaxed input sections.
8793 * symtab.cc (Symbol_table::compute_final_value): Extract template
8794 from the body of Symbol_table::sized_finalize_symbol.
8795 (Symbol_table::sized_finalized_symbol): Call
8796 Symbol_table::compute_final_value.
8797 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8798 (Symbol_table::compute_final_value): New templated method declaration.
8799 * target.cc (Target::do_make_output_section): New method defintion.
8800 * target.h (Target::make_output_section): New method declaration.
8801 (Target::relax): Add more parameters for input objects, symbol table
8802 and layout. Adjust call to do_relax.
8803 (Target::do_make_output_section): New method declaration.
8804 (Target::do_relax): Add parameters for input objects, symbol table
8807 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8809 * pread.c: Include stdio.h.
8811 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8813 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8816 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8818 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8819 Change read_shndx type to unsigned int.
8820 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8822 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8823 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8824 Change read_shndx type to unsigned int.
8825 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8827 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8828 * layout.cc (Layout::create_symtab_sections): Cast the result of
8829 local_symcount * symsize to off_t in the gold_assert.
8831 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8833 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8834 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8836 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8837 (Arm_relocate_functions::thm_abs5): New function.
8838 (Arm_relocate_functions::abs12): New function.
8839 (Arm_relocate_functions::abs16): New function.
8840 (Arm_relocate_functions::base_abs): New function.
8841 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8842 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8843 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8845 (Scan::global): Likewise.
8846 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8847 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8848 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8849 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8852 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8854 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8855 (Arm_relocate_functions::movt_prel): New function.
8856 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8857 (Arm_relocate_functions::thm_movt_prel): New function.
8858 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8859 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8860 (Scan::global, Relocate::relocate): Likewise.
8861 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8863 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8865 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8866 Incremental_checker.
8867 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8869 (class Incremental_inputs_header): New class.
8870 (Incremental_inputs_header_writer): Edit comment.
8871 (Incremental_inputs_entry): New class.
8872 (Incremental_inputs_entry_writer): Edit comment.
8873 (Sized_incremental_binary::do_find_incremental_inputs_section):
8874 Add *strtab_shndx parameter, fill it.
8875 (Sized_incremental_binary::do_check_inputs): New method.
8876 (Incremental_checker::can_incrementally_link_output_file): Use
8877 Sized_incremental_binary::check_inputs.
8878 (Incremental_inputs::report_command_line): Save command line in
8881 (Incremental_binary::find_incremental_inputs_section): New
8883 (Incremental_binary::do_find_incremental_inputs_section): Add
8884 strtab_shndx parameter.
8885 (Incremental_binary::do_check_inputs): New pure virtual method.
8886 (Sized_incremental_binary::do_check_inputs): Declare.
8887 (Incremental_checker::Incremental_checker): Add incremental_inputs
8888 parameter, use it to initialize incremental_inputs_.
8889 (Incremental_checker::incremental_inputs_): New field.
8890 (Incremental_checker::command_line): New method.
8891 (Incremental_checker::inputs): New method.
8892 (Incremental_checker::command_line_): New field.
8894 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8896 * incremental.cc: Include <cstdarg> and "target-select.h".
8897 (vexplain_no_incremental): New function.
8898 (explain_no_incremental): New function.
8899 (Incremental_binary::error): New method.
8900 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8902 (make_sized_incremental_binary): New function.
8903 (open_incremental_binary): New function.
8904 (can_incrementally_link_file): Add checks if output is ELF and has
8906 * incremental.h: Include "elfcpp_file.h" and "output.h".
8907 (Incremental_binary): New class.
8908 (Sized_incremental_binary): New class.
8909 (open_incremental_binary): Declare.
8910 * object.cc (is_elf_object): Use
8911 elfcpp::Elf_recognizer::is_elf_file.
8912 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8913 * output.h (Output_file::filesize): New method.
8915 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8917 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8919 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8920 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8922 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8924 (Arm_relocate_functions::movw_abs_nc): New function.
8925 (Arm_relocate_functions::movt_abs): New function.
8926 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8927 (Arm_relocate_functions::thm_movt_abs): New function.
8928 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8929 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8930 (Scan::global): Likewise.
8931 (Relocate::relocate): Likewise.
8932 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8934 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8936 * arm.cc (Arm_relocate_functions::got_prel) New function.
8937 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8938 (Relocate::relocate): Likewise.
8939 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8941 2009-10-06 Ian Lance Taylor <iant@google.com>
8943 * options.h (class General_options): Define
8944 split_stack_adjust_size parameter.
8945 * object.h (class Object): Add uses_split_stack_ and
8946 has_no_split_stack_ fields. Add uses_split_stack and
8947 has_no_split_stack accessor functions. Declare
8948 handle_split_stack_section.
8949 (class Reloc_symbol_changes): Define.
8950 (class Sized_relobj): Define Function_offsets. Declare
8951 split_stack_adjust, split_stack_adjust_reltype, and
8953 * object.cc (Object::handle_split_stack_section): New function.
8954 (Sized_relobj::do_layout): Call handle_split_stack_section.
8955 * dynobj.cc (Sized_dynobj::do_layout): Call
8956 handle_split_stack_section.
8957 * reloc.cc (Sized_relobj::relocate_sections): Call
8958 split_stack_adjust for executable sections in split_stack
8959 objects. Pass reloc_map to relocate_section.
8960 (Sized_relobj::split_stack_adjust): New function.
8961 (Sized_relobj::split_stack_adjust_reltype): New function.
8962 (Sized_relobj::find_functions): New function.
8963 * target-reloc.h: Include "object.h".
8964 (relocate_section): Add reloc_symbol_changes parameter. Change
8966 * target.h (class Target): Add calls_non_split method. Declare
8967 do_calls_non_split virtual method. Declare match_view and
8969 * target.cc: Include "elfcpp.h".
8970 (Target::do_calls_non_split): New function.
8971 (Target::match_view): New function.
8972 (Target::set_view_to_nop): New function.
8973 * gold.cc (queue_middle_tasks): Give an error if mixing
8974 split-stack and non-split-stack objects with -r.
8975 * i386.cc (Target_i386::relocate_section): Add
8976 reloc_symbol_changes parameter.
8977 (Target_i386::do_calls_non_split): New function.
8978 * x86_64.cc (Target_x86_64::relocate_section): Add
8979 reloc_symbol_changes parameter.
8980 (Target_x86_64::do_calls_non_split): New function.
8981 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8983 * powerpc.cc (Target_powerpc::relocate_section): Add
8984 reloc_symbol_changes parameter.
8985 * sparc.cc (Target_sparc::relocate_section): Add
8986 reloc_symbol_changes parameter.
8987 * configure.ac: Call AM_CONDITIONAL for the default target.
8988 * configure: Rebuild.
8989 * testsuite/Makefile.am (TEST_AS): New variable.
8990 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8991 (check_DATA): Add split_i386 and split_x86_64 files.
8992 (SPLIT_DEFSYMS): Define.
8993 (split_i386_[1234n].o): New targets.
8994 (split_i386_[124]): New targets.
8995 (split_i386_[1234r].stdout): New targets.
8996 (split_x86_64_[1234n].o): New targets.
8997 (split_x86_64_[124]): New targets.
8998 (split_x86_64_[1234r].stdout): New targets.
8999 (MOSTLYCLEANFILES): Add new executables.
9000 * testsuite/split_i386.sh: New file.
9001 * testsuite/split_x86_64.sh: New file.
9002 * testsuite/split_i386_1.s: New file.
9003 * testsuite/split_i386_2.s: New file.
9004 * testsuite/split_i386_3.s: New file.
9005 * testsuite/split_i386_4.s: New file.
9006 * testsuite/split_i386_n.s: New file.
9007 * testsuite/split_x86_64_1.s: New file.
9008 * testsuite/split_x86_64_2.s: New file.
9009 * testsuite/split_x86_64_3.s: New file.
9010 * testsuite/split_x86_64_4.s: New file.
9011 * testsuite/split_x86_64_n.s: New file.
9012 * testsuite/testfile.cc (Target_test): Update relocation_section
9014 * testsuite/Makefile.in: Rebuild.
9016 2009-10-06 Ian Lance Taylor <iant@google.com>
9018 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9019 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9020 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9021 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9022 the address on ldo_addrs_.
9023 (Target_i386::Relocate::fix_up_ldo): New function.
9025 2009-10-06 Rafael Espindola <espindola@google.com>
9027 * plugin.cc (add_input_library): New.
9028 (Plugin::load): Add add_input_library to tv.
9029 (Plugin_manager::add_input_file): Add the is_lib argument.
9030 (add_input_file): Update call to Plugin_manager::add_input_file.
9031 (add_input_library): New.
9032 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9034 2009-09-30 Doug Kwan <dougkwan@google.com>
9036 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9037 symbol and call Symbol::may_need_copy_reloc to determine if
9038 a copy reloc is needed.
9039 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9040 nocopyreloc is given in command line.
9041 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9042 given in command line.
9043 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9044 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9045 of the removed Target_i386::may_need_copy_reloc.
9046 * options.h (copyreloc): New option with default value false.
9047 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9048 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9049 instead of the removed Target_powerpc::may_need_copy_reloc.
9050 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9051 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9052 instead of the removed Target_sparc::may_need_copy_reloc.
9053 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9054 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9055 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9056 instead of the removed Target_x86_64::may_need_copy_reloc.
9058 2009-09-30 Ian Lance Taylor <iant@google.com>
9060 * object.h (class Object): Remove target_ field, and target,
9061 sized_target, and set_target methods.
9062 (Object::sized_target): Remove.
9063 (class Sized_relobj): Update declarations. Remove sized_target.
9064 * object.cc (Sized_relobj::setup): Remove target parameter.
9066 (Input_objects::add_object): Don't do anything with the target.
9067 (make_elf_sized_object): Add punconfigured parameter. Change all
9068 callers. Set or test parameter target.
9069 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9071 * parameters.cc (Parameters::set_target): Change parameter type to
9073 (Parameters::default_target): Remove.
9074 (set_parameters_target): Change parameter type to be non-const.
9075 (parameters_force_valid_target): New function.
9076 (parameters_clear_target): New function.
9077 * parameters.h (class Parameters): Update declarations. Remove
9078 default_target method. Add sized_target and clear_target
9079 methods. Change target_ to be non-const.
9080 (set_parameters_target): Update declaration.
9081 (parameters_force_valid_target): Declare.
9082 (parameters_clear_target): Declare.
9083 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9084 as NULL if we aren't searching.
9085 (Add_symbols::run): Don't check for compatible target.
9086 * fileread.cc (Input_file::open_binary): Call
9087 parameters_force_valid_target.
9088 * gold.cc (queue_middle_tasks): Likewise.
9089 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9090 set_target on object.
9091 * dynobj.h (class Sized_dynobj): Update declarations.
9092 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9093 make_elf_object returns NULL.
9094 (Archive::include_member): Don't check whether object target is
9096 * output.cc (Output_section::add_input_section): Get target from
9098 (Output_section::relax_input_section): Likewise.
9099 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9101 (Sized_relobj::do_scan_relocs): Likewise.
9102 (Sized_relobj::relocate_sections): Likewise.
9103 * resolve.cc (Symbol_table::resolve): Likewise.
9104 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9105 parameter. Change all callers.
9106 (Symbol_table::add_from_object): Get target from parameters.
9107 (Symbol_table::add_from_relobj): Don't check object target.
9108 (Symbol_table::add_from_dynobj): Likewise.
9109 (Symbol_table::define_special_symbol): Get target from
9111 * symtab.h (class Symbol_table): Update declaration.
9112 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9113 parameter. Change all callers. Clear parameter target.
9114 (Binary_test): Test target here.
9115 * testsuite/object_unittest.cc (gold_testsuite): Remove
9116 target_test_pointer parameter. Change all callers.
9117 (Object_test): Test target here.
9119 2009-09-26 Ian Lance Taylor <iant@google.com>
9121 * testsuite/initpri1.c: Don't try to use constructor priorities if
9122 compiling with gcc before 4.3.
9124 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9126 * testsuite/retain_symbols_file_test.sh (check_present): Change
9127 output file name to retain_symbols_file_test.stdout.
9128 (check_absent): Likewise.
9130 2009-09-18 Craig Silverstein <csilvers@google.com>
9132 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9133 * options.cc: Include <cerrno> and <fstream>.
9134 (General_options::finalize): Parse -retain-symbols-file tag.
9135 * options.h: New flag.
9136 (General_options): New method should_retain_symbol, new
9137 variable symbols_to_retain.
9138 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9139 should_retain_symbol map.
9140 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9141 * testsuite/Makefile.in: Regenerate.
9142 * testsuite/retain_symbols_file_test.sh: New file.
9144 2009-09-18 Nick Clifton <nickc@redhat.com>
9146 * po/es.po: Updated Spanish translation.
9148 2009-09-17 Doug Kwan <dougkwan@google.com>
9150 * debug.h (DEBUG_RELAXATION): New constant.
9151 (DEBUG_ALL): Add DEBUG_RELAXATION.
9152 (debug_string_to_enum): Add relaxation debug option.
9154 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9155 Layout::Relaxation_debug_check::read_sections,
9156 Layout::Relaxation_debug_check::read_sections): New method definitions.
9157 (Layout::Layout): Initialize data members
9158 record_output_section_data_from_scrips_,
9159 script_output_section_data_list_ and relaxation_debug_check_.
9160 (Layout::save_segments, Layout::restore_segments,
9161 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9162 Layout::relaxation_loop_body): New method definitions.
9163 (Layout::finalize): Support relaxation. Move section layout code to
9164 Layout::relaxation_loop_body.
9165 (Layout::set_asection_address_from_script): Move code for orphan
9166 section placement out.
9167 (Layout::place_orphan_sections_in_script): New method definition.
9168 * layout.h (Output_segment_headers, Output_file_header):
9169 New forward class declarations.
9170 (Layout::~Layout): Define.
9171 (Layout::new_output_section_data_from_script): New method definition.
9172 (Layout::place_orphan_sections_in_script): New method declaration.
9173 (Layout::Segment_states): New type declaration.
9174 (Layout::save_segments, Layout::restore_segments,
9175 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9176 Layout::relaxation_loop_body): New method declarations.
9177 (Layout::Output_section_data_list): New type declaration.
9178 (Layout::Relaxation_debug_check): New class definition.
9179 (Layout::record_output_section_data_from_script_,
9180 Layout::script_output_section_data_list_, Layout::segment_states_,
9181 Layout::relaxation_debug_check_): New data members.
9182 * output.cc: (Output_section_headers::do_size): New method definition.
9183 (Output_section_headers::Output_section_headers): Move size
9184 computation to Output_section_headers::do_size.
9185 (Output_segment_headers::do_size): New method definition.
9186 (Output_file_header::Output_file_header): Move size computation to
9187 Output_file_header::do_size and call it.
9188 (Output_file_header::do_size): New method definition.
9189 (Output_data_group::Output_data_group): Adjust call to
9190 Output_section_data.
9191 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9192 (Output_symtab_xindex::do_write): Add array bound check.
9193 (Output_section::Input_section::print_to_mapfile): Handle
9194 RELAXED_INPUT_SECTION_CODE.
9195 (Output_section::Output_section): Initialize data member checkpoint_.
9196 (Output_section::~Output_section): Delete checkpoint object pointed
9198 (Output_section::add_input_section): Always add an Input_section if
9200 (Output_section::add_merge_input_section): Add assert.
9201 (Output_section::relax_input_section): New method definition.
9202 (Output_section::set_final_data_size): Set load address to zero for
9203 an unallocated section.
9204 (Output_section::do_address_and_file_offset_have_reset_values):
9205 New method definition.
9206 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9207 Handle relaxed input section.
9208 (Output_section::sort_attached_input_sections): Checkpoint input
9209 section list lazily.
9210 (Output_section::get_input_sections): Change type of input_sections to
9211 list of Simple_input_section pointers. Checkpoint input section list
9212 lazily. Also handle relaxed input sections.
9213 (Output_section::add_input_section_for_script): Take a reference to
9214 a Simple_input_section object instead of Relobj pointer and section
9215 index as parameter. Handle relaxed input sections.
9216 (Output_section::save_states, Output_section::restore_states): New
9218 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9219 (Output_data::is_data_size_fixed): New method definition.
9220 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9222 (Output_data::address_and_file_offset_have_reset_values): New method
9224 (Output_data::do_address_and_file_offset_have_reset_values): New method
9226 (Output_data::set_data_size): Check that data size is not fixed.
9227 (Output_data::fix_data_size): New method definition.
9228 (Output_data::is_data_size_fixed_): New data member.
9229 (Output_section_headers::set_final_data_size): New method definition.
9230 (Output_section_headers::do_size): New method declaration.
9231 (Output_segment_headers::set_final_data_size): New method definition.
9232 (Output_segment_headers::do_size): New method declaration.
9233 (Output_file_header::set_final_data_size)::New method definition.
9234 (Output_file_header::do_size)::New method declaration.
9235 (Output_section_data::Output_section_data): Add new parameter
9236 is_data_size_fixed and use it to fix data size.
9237 (Output_data_const::Output_data_const): Adjust call to base class
9238 constructor and fix data size.
9239 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9240 base class constructor and fix data size.
9241 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9242 base class constructor and fix data size.
9243 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9244 class constructor and fix data size.
9245 (Output_data_group::set_final_data_size): New method definition.
9246 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9247 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9248 class constructor and fix data size.
9249 (Output_relaxed_input_section): New class definition.
9250 (Output_section::Simple_input_section): New class definition.
9251 (Output_section::get_input_sections): Adjust parameter list.
9252 (Output_section::add_input_section_for_script): Same.
9253 (Output_section::save_states, Output_section::restore_states,
9254 Output_section::do_address_and_file_offset_have_reset_values,
9255 (Output_section::Input_section::Input_section): Handle
9256 RELAXED_INPUT_SECTION_CODE. Add new overload for
9257 Output_relaxed_input_section.
9258 (Output_section::Input_section::is_input_section,
9259 Output_section::Input_section::set_output_section): Handle relaxed
9261 (Output_section::Input_section::is_relaxed_input_section,
9262 Output_section::Input_section::output_section_data,
9263 Output_section::Input_section::relaxed_input_section): New method
9265 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9267 (Output_section::Input_section::u1_): Update comments.
9268 (Output_section::Input_section::u2_): Add new union member poris.
9269 (Output_section::Checkpoint_output_section): New classs definition.
9270 (Output_section::relax_input_section): New method declaration.
9271 (Output_section::checkpoint_): New data member.
9272 (Output_segment): Update comments.
9273 (Output_segment::Output_segment): Un-privatize copy constructor.
9274 (Output_segment::operator=): Un-privatize.
9275 * script-sections.cc (Output_section_element::Input_section_list):
9276 Change element type to Output_section::Simple_input_section.
9277 (Output_section_element_dot_assignment::set_section_addresses):
9278 Register output section data for relaxation clean up.
9279 (Output_data_exression::Output_data_expression): Adjust call to base
9280 constructor to fix data size.
9281 (Output_section_element_data::set_section_addresses): Register
9282 Output_data_expression object for relaxation clean up.
9283 (struct Input_section_info): Replace Relobj pointer and section index
9284 pair with Output_section::Simple_input_section and Convert struct to a
9286 (Input_section_sorter::operator()): Adjust access to
9287 Input_section_info data member to use accessors.
9288 (Output_section_element_input::set_section_addresses): Use layout
9289 parameter. Adjust code to use Output_section::Simple_input_section
9290 and Input_secction_info classes. Register filler for relaxation
9292 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9293 and section index pair with Output_section::Simple_input_section
9294 class. Adjust code accordingly.
9295 (Phdrs_element::release_segment): New method definition.
9296 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9298 (Script_sections::release_segments): New method definition.
9299 * gold/script-sections.h (Script_sections::release_segments): New
9301 * gold/target.h (Target::may_relax, Target::relax,
9302 Target::do_may_relax, Target::do_relax): New method definitions.
9304 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9306 * arm.cc (has_signed_unsigned_overflow): New function.
9307 (Arm_relocate_functions::abs8): New function.
9308 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9309 (Target_arm::Scan::global): Likewise.
9310 (Target_arm::relocate::relocate): Likewise.
9311 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9314 2009-09-16 Cary Coutant <ccoutant@google.com>
9316 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9317 * testsuite/Makefile.in: Regenerate.
9319 2009-09-11 Nick Clifton <nickc@redhat.com>
9321 * po/gold.pot: Updated by the Translation project.
9323 2009-09-08 Cary Coutant <ccoutant@google.com>
9325 * output.cc (Output_file::open): Add execute permission to empty file.
9326 * testsuite/Makefile.am (permission_test): New test.
9327 * testsuite/Makefile.in: Regenerate.
9329 2009-09-02 Ian Lance Taylor <iant@google.com>
9331 * output.cc (Output_file::resize): Call map_no_anonymous rather
9334 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9336 * gold.cc: Include "incremental.h".
9337 (queue_initial_tasks): Call Incremental_checker methods.
9338 * incremental.cc: Include "output.h".
9339 (Incremental_checker::can_incrementally_link_output_file): New
9341 * incremental.h (Incremental_checker): New class.
9343 * output.cc (Output_file::open_for_modification): New method.
9344 (Output_file::map_anonymous): Changed return type to bool. Record
9346 (Output_file::map_no_anonymous): New method, broken out of map.
9347 (Output_file::map): Use map_no_anonymous and map_anonymous.
9348 * output.h (class Output_file): Update declarations.
9350 2009-08-24 Cary Coutant <ccoutant@google.com>
9352 * options.h (Command_line::Pre_options): New class.
9353 (Command_line::pre_options): New member.
9354 * options.cc (gold::options::ready_to_register): New variable.
9355 (One_option::register_option): Do nothing if not registering options.
9356 Assert if same short option registered twice.
9357 (General_options::General_options): Turn off option registration when
9359 (Command_line::Pre_options::Pre_options): New constructor.
9361 2009-08-24 Cary Coutant <ccoutant@google.com>
9363 * options.h (General_options::no_keep_memory): Remove incorrect
9366 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9368 * Makefile.am (am__skiplex, am__skipyacc): New.
9369 * Makefile.in: Regenerate.
9371 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9373 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9374 (INCLUDES): ... this.
9375 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9376 (AM_CPPFLAGS): Renamed from ...
9377 (INCLUDE): ... this.
9378 * Makefile.in, testsuite/Makefile.in: Regenerate.
9380 * Makefile.in: Regenerate.
9381 * aclocal.m4: Likewise.
9382 * config.in: Likewise.
9383 * configure: Likewise.
9384 * testsuite/Makefile.in: Likewise.
9386 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9387 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9388 * Makefile.in: Regenerate.
9389 * testsuite/Makefile.in: Regenerate.
9391 2009-08-19 Cary Coutant <ccoutant@google.com>
9393 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9394 symbols in shared libraries overridden by hidden or internal symbols
9395 in the main program.
9397 2009-08-19 Chris Demetriou <cgd@google.com>
9399 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9400 checking source file names in error messages.
9402 2009-08-18 Doug Kwan <dougkwan@google.com>
9404 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9405 an elcpp::Ehdr as parameter. Adjust call to set_target.
9406 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9407 an elfcpp::Ehdr as parameter.
9408 * object.cc (Object::set_target): Remove the version that looks up
9409 a target and sets it.
9410 (Sized_relobj::setup): Take a Target object instead of
9411 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9412 (make_elf_sized_object): Find target and ask target to
9414 * object.h: (Object::set_target): Remove the version that looks up
9415 a target and sets it.
9416 (Sized_relobj::setup): Take a Target object instead of
9417 an elfcpp:Ehdr as parameter.
9418 * target.cc: Include dynobj.h.
9419 (Target::do_make_elf_object_implementation): New.
9420 (Target::do_make_elf_object): New.
9421 * target.h (Target::make_elf_object): New template declaration.
9422 (Target::do_make_elf_object): New method declarations.
9423 (Target::do_make_elf_object_implementation): New template declaration.
9425 2009-08-14 Ian Lance Taylor <iant@google.com>
9427 * gold.h (FUNCTION_NAME): Define.
9428 (gold_unreachable): Use FUNCTION_NAME.
9430 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9432 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9433 symbol in the --keep-unique list is not found.
9435 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9437 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9438 been maked as --keep-unique.
9439 (Icf::unfold_section): New function.
9440 * icf.h (Icf::unfold_section): New function.
9441 * options.h (General_options::keep_unique): New option.
9442 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9443 * testsuite/Makefile.in: Regenerate.
9444 * testsuite/icf_keep_unique_test.sh: New file.
9445 * testsuite/icf_keep_unique_test.cc: New file.
9447 2009-08-12 Cary Coutant <ccoutant@google.com>
9450 * resolve.cc (Symbol_table::resolve): Check for references from
9451 dynamic objects to hidden and internal symbols.
9452 * testsuite/Makefile.am (hidden_test.sh): New test.
9453 * testsuite/Makefile.in: Regenerate.
9454 * testsuite/hidden_test.sh: New script.
9455 * testsuite/hidden_test_1.c: New test source.
9456 * testsuite/hidden_test_main.c: New test source.
9458 2009-08-11 Doug Kwan <dougkwan@google.com>
9460 * arm.cc: Update comments.
9461 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9462 segment to locate the .ARM.exidx section if present.
9464 2009-08-09 Doug Kwan <dougkwan@google.com>
9466 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9469 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9470 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9473 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9475 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9476 valid tls_segment only for non-debug-section relocations.
9477 * testsuite/Makefile.am: Add gc_tls_test.
9478 * testsuite/Makefile.in: Regenerate.
9479 * testsuite/gc_tls_test.cc: New file.
9480 * testsuite/gc_tls_test.sh: New file.
9482 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9486 * Makefile.am (CCFILES): Add icf.cc.
9488 * Makefile.in: Regenerate.
9489 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9490 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9491 section, symbol and addend information for the relocs.
9492 * gold.cc (queue_middle_tasks): Call identical code folding.
9493 * gold.h: Add defines for multimap.
9494 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9495 to the call of finalize_local_symbols.
9496 * main.cc (main): Create object of class Icf.
9497 * object.cc (Sized_relobj::do_layout): Allow this function to be
9498 called twice during icf.
9499 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9500 to sections marked as identical by icf.
9501 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9503 (Sized_relobj::do_section_entsize): New function.
9504 * object.h (Object::section_entsize): New function.
9505 (Object::do_section_entsize): New pure virtual function.
9506 (Relobj::finalize_local_symbols): Add new parameter.
9507 (Relobj::do_section_entsize): New function.
9508 * options.h (General_options::icf): New option.
9509 (General_options::icf_iterations): New option.
9510 (General_options::print_icf_sections): New option.
9511 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9512 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9513 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9515 * symtab.cc (Symbol_table::is_section_folded): New function.
9516 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9517 to sections marked as identical by icf.
9518 * symtab.h (Symbol_table::set_icf): New function.
9519 (Symbol_table::icf): New function.
9520 (Symbol_table::is_section_folded): New function.
9521 (Symbol_table::icf_): New data member.
9522 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9523 * testsuite/Makefile.am: Add commands to build icf_test.
9524 * testsuite/Makefile.in: Regenerate.
9525 * testsuite/icf_test.sh: New file.
9526 * testsuite/icf_test.cc: New file.
9528 2009-07-24 Chris Demetriou <cgd@google.com>
9530 * layout.cc (is_compressible_debug_section): Fix incorrect
9531 comment about compressed section names.
9533 2009-07-20 Ian Lance Taylor <ian@airs.com>
9536 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9538 2009-07-16 Ian Lance Taylor <iant@google.com>
9541 * layout.h: #include <map>.
9542 (class Kept_section): Change from struct to class. Add accessors
9543 and setters. Add section size to Comdat_group mapping. Change
9544 Comdat_group to std::map. Add is_comdat_ field. Add
9545 linkonce_size field in union.
9546 (class Layout): Update declaration of find_or_add_kept_section.
9547 Don't declare find_kept_object.
9548 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9549 parameter. Add object, shndx, is_comdat, and is_group_name
9550 parameters. Change all callers. Adjust for new Kept_section.
9551 (Layout::find_kept_object): Remove.
9552 * object.cc (Sized_relobj::include_section_group): Update use of
9553 Kept_section. Rename secnum to shndx. Only record
9554 Kept_comdat_section if sections are the same size.
9555 (Sized_relobj::include_linkonce_section): Update use of
9556 Kept_section. Only record Kept_comdat_section if sections are the
9557 same size. Set size of linkonce section.
9558 (Sized_relobj::map_to_kept_section): Update call to
9559 get_kept_comdat_section.
9560 * object.h (class Sized_relobj): Rename fields in
9561 Kept_comdat_section to drop trailing underscores; change object
9562 field to Relobj*. Change Kept_comdat_section_table to store
9563 struct rather than pointer.
9564 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9565 Add kept_object and kept_shndx parameters. Change all callers.
9566 (Sized_relobj::get_kept_comdat_section): Change return type to
9567 bool. Add kept_object and kept_shndx parameters. Change all
9569 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9570 Layout::find_or_add_kept_section.
9572 2009-07-09 Ian Lance Taylor <iant@google.com>
9574 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9575 Reserve space in the hash table.
9577 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9579 * fileread.cc (File_read::get_mtime): New method.
9580 * fileread.h (Timespec): New structure.
9581 (File_read::get_mtime): New method.
9582 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9583 Renamed from timestamp_nsec.
9584 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9586 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9588 (Incremental_inputs::report_archive): Save mtime; style fix.
9589 (Incremental_inputs::report_obejct): Save mtime; style fix.
9590 (Incremental_inputs::report_script): Save mtime; style fix.
9591 (Incremental_inputs::finalize_inputs): Style fix.
9592 (Incremental_inputs::finalize): Style fix.
9593 (Incremental_inputs::create_input_section_data): Store inputs
9595 * incremental.h (Incremental_inputs::report_script): Add mtime
9597 (Incremental_inputs::Input_info::Input_info): Intialize only one
9599 (Incremental_inputs::Input_info::archive): Move to nameless
9601 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9602 (Incremental_inputs::Input_info::script): Move to nameless union.
9603 (Incremental_inputs::mtime): New field.
9604 * script.cc (read_input_script): Pass file mtime to
9606 * script.h (Script_info::inputs): Style fix.
9608 2009-07-01 Ian Lance Taylor <ian@airs.com>
9610 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9613 2009-06-24 Ian Lance Taylor <iant@google.com>
9616 * layout.cc (Layout::choose_output_section): If we find an
9617 existing section, update the flags.
9618 (Layout::create_notes): New function, broken out of
9620 (Layout::finalize): Don't create note sections.
9621 (Layout::create_note): Don't crash if linker script discards
9623 (Layout::create_gold_note): Likewise.
9624 (Layout::create_build_id): Likewise. Don't set
9625 after_input_sections on the section.
9626 (Layout::create_executable_stack_info): Remove target parameter.
9628 * layout.h (class Layout): Declare create_notes. Update
9629 declaration of create_executable_stack_info.
9630 * gold.cc (queue_middle_tasks): Call create_notes.
9631 * output.cc (Output_section::update_flags_for_input_section): Move
9632 here from output.h. If SHF_ALLOC flag is newly set, mark address
9634 * output.h (Output_data::mark_address_invalid): New function.
9635 (class Output_section): Only declare, not define,
9636 update_flags_for_input_section. Remove set_flags.
9638 2009-06-24 Ian Lance Taylor <iant@google.com>
9640 * script-sections.cc (Output_section_definition::
9641 set_section_addresses): Rename shadowing local load_address to
9644 2009-06-24 Ian Lance Taylor <iant@google.com>
9647 * reloc.cc (relocate_sections): Skip empty relocation sections.
9649 2009-06-23 Ian Lance Taylor <iant@google.com>
9652 * layout.cc (Layout::create_note): Use choose_output_section
9653 rather than make_output_section.
9655 2009-06-23 Ian Lance Taylor <iant@google.com>
9658 * options.cc (General_options::parse_V): Set printed_version_.
9659 (General_options::General_options): Initialize printed_version_.
9660 * options.h (class General_options): Add printed_version_ field.
9661 * gold.cc (queue_initial_tasks): If there are no input files,
9662 don't give a fatal error if we printed the version information.
9663 (queue_middle_tasks): If using -r with a shared object, give a
9664 fatal error rather than an ordinary error.
9666 2009-06-23 Ian Lance Taylor <iant@google.com>
9669 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9670 (Layout::make_output_section): Set have_stabstr_section_ if we see
9671 a .stab*str section.
9672 (Layout::finalize): Call link_stabs_sections.
9673 (Layout::link_stabs_sections): New file.
9674 * layout.h (class Layout): Add have_stabstr_section_ field.
9675 Declare link_stabs_sections.
9677 2009-06-23 Doug Kwan <dougkwan@google.com>
9679 * Makefile.am (libgold_a_LIBADD): New.
9680 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9681 * Makefile.in: Regenerate.
9682 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9683 * configure: Regenerate.
9684 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9685 * fileread.cc: Include sys/state.h
9686 * gold.h: Declare memmem and strndup if found missing.
9687 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9689 2009-06-23 Ian Lance Taylor <iant@google.com>
9691 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9692 * configure: Rebuild.
9694 2009-06-23 Ian Lance Taylor <iant@google.com>
9697 * object.cc (Object::section_contents): Don't try to get a view if
9698 the section has length zero.
9699 (Object::handle_gnu_warning_section): If the section is empty, use
9700 the name of the section as the warning.
9702 2009-06-23 Ian Lance Taylor <iant@google.com>
9705 * stringpool.h (class Stringpool_template): Add optimize_ field.
9706 (Stringpool_template::set_optimize): New function.
9707 * stringpool.cc (Stringpool_template::Stringpool_template):
9708 Initialize optimize_ field.
9709 (Stringpool_template::set_string_offsets): Test local optimize
9710 fild rather than parameter.
9711 * layout.cc (Layout::Layout): Call set_optimize on the section
9714 2009-06-22 Ian Lance Taylor <iant@google.com>
9717 * yyscript.y: Parse TARGET.
9718 * script.cc (script_set_target): New function.
9719 * script-c.h (script_set_target): Declare.
9720 * options.cc (General_options::string_to_object_format): Rename
9721 from string_to_object_format in anonymous namespace. Change
9723 * options.h (class General_options): Declare
9724 string_to_object_format.
9726 2009-06-22 Ian Lance Taylor <iant@google.com>
9728 * script-sections.cc (Script_sections::create_segments): Don't put
9729 program headers in a PT_LOAD segment if -n or -N.
9731 2009-06-22 Ian Lance Taylor <iant@google.com>
9734 * options.h (class General_options): Add -z lazy and -z now. Sort
9735 -z options into alphabetical order.
9736 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9738 2009-06-21 Ian Lance Taylor <iant@google.com>
9740 * layout.cc (Layout::make_output_section): Call
9741 Target::new_output_section.
9742 (Layout::attach_allocated_section_to_segment): Put large section
9743 sections in a separate load segment with the large segment flag
9745 (Layout::segment_precedes): Sort large data segments after other
9747 (align_file_offset): New static function.
9748 (Layout::set_segment_offsets): Use align_file_offset.
9749 * output.h (class Output_section): Add is_small_section_ and
9750 is_large_section_ fields.
9751 (Output_section::is_small_section): New function.
9752 (Output_section::set_is_small_section): New function.
9753 (Output_section::is_large_section): New function.
9754 (Output_section::set_is_large_section): New function.
9755 (Output_section::is_large_data_section): New function.
9756 (class Output_segment): Add is_large_data_segment_ field.
9757 (Output_segment::is_large_data_segment): New function.
9758 (Output_segment::set_is_large_data_segment): New function.
9759 * output.cc (Output_section::Output_section): Initialize new
9761 (Output_segment::Output_segment): Likewise.
9762 (Output_segment::add_output_section): Add assertion that large
9763 data sections always go in large data segments. Force small data
9764 sections to the end of the list of data sections. Force small BSS
9765 sections to the start of the list of BSS sections. For large BSS
9766 sections to the end of the list of BSS sections.
9767 * symtab.h (class Symbol): Declare is_common_shndx.
9768 (Symbol::is_defined): Check Symbol::is_common_shndx.
9769 (Symbol::is_common): Likewise.
9770 (class Symbol_table): Define enum Commons_section_type. Update
9771 declarations. Add small_commons_ and large_commons_ fields.
9772 * symtab.cc (Symbol::is_common_shndx): New function.
9773 (Symbol_table::Symbol_table): Initialize new fields.
9774 (Symbol_table::add_from_object): Put small and large common
9775 symbols in the right list.
9776 (Symbol_table::sized_finalized_symbol): Check
9777 Symbol::is_common_shndx.
9778 (Symbol_table::sized_write_globals): Likewise.
9779 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9780 common symbol lists. Don't call do_allocate_commons_list if the
9782 (Symbol_table::do_allocate_commons_list): Remove is_tls
9783 parameter. Add comons_section_type parameter. Change all
9784 callers. Handle small and large common symbols.
9785 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9786 Symbol::is_common_shndx.
9787 * resolve.cc (symbol_to_bits): Likewise.
9788 * target.h (Target::small_common_shndx): New function.
9789 (Target::small_common_section_flags): New function.
9790 (Target::large_common_shndx): New function.
9791 (Target::large_common_section_flags): New function.
9792 (Target::new_output_section): New function.
9793 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9794 small_common_section_flags, and large_common_section_flags
9796 (Target::do_new_output_section): New virtual function.
9797 * arm.cc (Target_arm::arm_info): Initialize new fields.
9798 * i386.cc (Target_i386::i386_info): Likewise.
9799 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9801 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9802 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9803 (Target_x86_64::do_new_output_section): New function.
9804 * configure.ac: Define conditional MCMODEL_MEDIUM.
9805 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9806 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9807 (large_LDFLAGS): Define.
9808 * testsuite/large.c: New file.
9809 * testsuite/testfile.cc (Target_test::test_target_info):
9810 Initialize new fields.
9811 * configure, testsuite/Makefile.in: Rebuild.
9813 2009-06-05 Doug Kwan <dougkwan@google.com>
9815 * Makefile.am (CCFILES): Add target.cc.
9816 * Makefile.in: Regenerate.
9817 * i386.cc (class Target_i386): Define new virtual method to
9818 override do_is_local_label_name in parent.
9819 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9820 local symbols if --discard-locals or -X is given.
9821 * options.h (class General_options): Declare new options
9822 '--discard-locals' and '-X' for discarding locals.
9823 * target.h (class Target): Define new methods is_local_label_name.
9824 Declare new virtual method do_is_local_label_name.
9825 * target.cc: New file.
9826 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9827 (check_SCRIPTS): Add discard_locals_test.sh.
9828 (check_DATA): Add discard_local_tests.syms.
9829 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9830 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9831 * testsuite/Makefile.in: Regenerate.
9832 * testsuite/discard_locals_test.c: New file.
9833 * testsuite/discard_locals_test.sh: Same.
9835 2009-06-05 Doug Kwan <dougkwan@google.com>
9837 * object.cc (Sized_relobj::Sized_relobj): Initialize
9838 discarded_eh_frame_shndx_ to -1U.
9839 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9841 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9842 a discarded .eh_frame section.
9843 (Sized_relobj::do_finalize_local_symbols): Ditto.
9844 * object.h (class Sized_relobj): Declare new member
9845 discarded_eh_frame_shndx_.
9846 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9847 (local_labels_test.o, local_labels_test): New rules.
9848 * testsuite/Makefile.in: Regenerate.
9850 2009-06-04 Doug Kwan <dougkwan@google.com>
9852 * layout.cc (Layout::section_name_mapping): Add mapping for
9853 special ARM sections.
9855 2009-06-03 Doug Kwan <dougkwan@google.com>
9857 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9858 (utils::has_overflow): Same.
9860 2009-06-03 Ian Lance Taylor <iant@google.com>
9862 * layout.cc (Layout::section_name_mapping): New array, replacing
9863 Layout::linkonce_mapping.
9864 (Layout::section_name_mapping_count): New variable, replacing
9865 Layout::linkonce_mapping_count.
9866 (Layout::linkonce_output_name): Remove.
9867 (Layout::output_section_name): Rewrite.
9868 * layout.h (class Layout): Rename Linkonce_mapping to
9869 Section_name_mapping, linkonce_mapping to section_name_mapping,
9870 linkonce_mapping_count to section_name_mapping_count. Don't
9871 declare linkonce_output_name.
9873 2009-06-03 Doug Kwan <dougkwan@google.com>
9875 * gold/arm.cc (namespace utils): New.
9876 (Target_arm::reloc_is_non_pic): Define new method.
9877 (class Arm_relocate_functions): New.
9878 (Target_arm::Relocate::relocate): Handle relocation types used by
9881 2009-06-03 Ian Lance Taylor <iant@google.com>
9883 * arm.cc (Target_arm::scan::global): Use || instead of |.
9885 2009-06-02 Doug Kwan <dougkwan@google.com>
9887 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9888 issued_non_pic_error_.
9889 (class Target_arm::Scan): Declare new method check_non_pic.
9890 Define new method symbol_needs_plt_entry.
9891 Declare new data member issued_non_pic_error_.
9892 (class Target_arm::Relocate): Declare new method
9893 should_apply_static_reloc.
9894 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9895 (Target_arm::Scan::check_non_pic): Define new method.
9896 (Target_arm::Scan::local): Handle a small subset of reloc types used
9898 (Target_arm::Scan::local): Same.
9899 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9901 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9903 * incremental.cc (Incremental_inputs::report_command_line): Filter
9904 out --incremental-* options.
9906 2009-05-29 Doug Kwan <dougkwan@google.com>
9908 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9910 (class Target_arm): Update comment.
9911 (Target_arm::Target_arm): Initialize new data members GOT_,
9912 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9913 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9914 and Target_arm::rel_dyn_section.
9915 Declare new_enum Target_arm::Got_type.
9916 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9918 Update commments for member do_dynsym_value.
9919 (Target_arm::got_size, Target_arm::plt_section,
9920 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9921 new methods inside class defintion.
9922 (Target_arm::got_section): Define new method.
9923 (Target_arm::rel_dyn_section): Same.
9924 (Output_data_plt_arm): New template class.
9925 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9926 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9927 (Output_data_plt_arm::add_entry): Same.
9928 (Output_data_plt_arm::first_plt_entry): Define new
9929 static data member for PLT instruction template.
9930 (Output_data_plt_arm::plt_entry): Same.
9931 (Output_data_plt_arm::do_write): Define new method.
9932 (Target_arm::make_plt_entry): Same.
9933 (Target_arm::do_finalize_sections): Same.
9934 (Target_arm::do_dynsym_value): Same.
9936 2009-05-28 Doug Kwan <dougkwan@google.com>
9938 * Makefile.am (TARGETSOURCES): Add arm.cc.
9939 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9940 * Makefile.in: Regenerate.
9942 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9944 2009-05-26 Doug Kwan <dougkwan@google.com>
9946 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9947 (General_options::check_excluded_libs): Strip off directories in
9948 archive name before matching like GNU ld does.
9949 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9950 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9951 (exclude_libs_test_LDFLAGS): Add linker option
9952 -Wl,--exclude-libs,libexclude_libs_test_3
9953 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9954 an explicit archive without using -l.
9955 (alt/libexclude_libs_test_3.a): New make rule.
9956 * testsuite/Makefile.in: Regenerate.
9957 * testsuite/exclude_libs_test.c : Declare lib3_default().
9959 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9960 * exclude_libs_test_3.c: New file.
9962 2009-05-26 Nick Clifton <nickc@redhat.com>
9964 * po/id.po: New Indonesian translation.
9965 * po/gold.pot: Updated template file.
9967 2009-05-22 Sriraman Tallam <tmsriram@google.com>
9969 * testsuite/Makefile.am: Add -ffunction-sections to compile
9970 gc_comdat_test files. Add -Wl,--gc-sections to build
9972 * testsuite/Makefile.in: Regenerate.
9973 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9975 2009-05-21 Sriraman Tallam <tmsriram@google.com>
9977 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9978 kept comdat section was garbage collected.
9979 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9980 * testsuite/Makefile.in: Regenerate.
9981 * testsuite/gc_comdat_test.sh: New file.
9982 * testsuite/gc_comdat_test_1.cc: New file.
9983 * testsuite/gc_comdat_test_2.cc: New file.
9985 2009-05-19 Doug Kwan <dougkwan@google.com>
9987 * archive.cc (Archive::Archive): Move constructor from archive.h
9988 to here. Initialize no_export_.
9989 (Archive::get_elf_object_for_member): Set no_export flag of object.
9990 * archive.h (Archive::Archive): Move constructor body to
9992 (Archive::no_export): New method.
9993 (Archive::no_export_): New field.
9994 * object.h (Object::Object): Initialize no_export_ to false.
9995 (Object::no_export, Object::set_no_export): New methods.
9996 (Object::no_export_): New field.
9997 * options.cc (General_options::parse_exclude_libs): New method.
9998 (General_options::check_excluded_libs) Same.
9999 * options.h (exclude_libs): New option.
10000 (General_options::check_excluded_libs): New method declaration.
10001 (General_options::excluded_libs_): New field.
10002 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10003 default or protected visibility if an object has no-export flag set.
10004 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10005 (check_SCRIPTS): Add exclude_libs_test.sh.
10006 (check_DATA): Add exclude_libs_test.syms.
10007 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10008 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10009 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10010 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10011 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10012 libexclude_libs_test_2.a): New rules.
10013 * testsuite/Makefile.in: Regenerate.
10014 * testsuite/exclude_libs_test.c: New file.
10015 * testsuite/exclude_libs_test.sh: Ditto.
10016 * testsuite/exclude_libs_test_1.c: Ditto.
10017 * testsuite/exclude_libs_test_2.c: Ditto.
10019 2009-05-15 Ian Lance Taylor <iant@google.com>
10021 * configure.ac: Check for declarations for cases where libiberty.h
10022 checks HAVE_DECL_xxx.
10023 * configure, config.in: Rebuild.
10025 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10027 * gold.h (Incremental_argument_list): Remove (invalid) forward
10029 * incremental.cc (Incremental_inputs::report_achive): New method.
10030 (Incremental_inputs::report_object): New method.
10031 (Incremental_inputs::report_script): New method.
10032 (Incremental_inputs::finalize_inputs): New method.
10033 (Incremental_inputs::finalize): Call finalize_inputs().
10034 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10035 Create inputs entries.
10036 * incremental.h (Incremental_input_type): New enum.
10037 (Incremental_inputs::Incremental_input): Initialize new fields.
10038 (Incremental_inputs::report_inputs): New method.
10039 (Incremental_inputs::report_achive): New method.
10040 (Incremental_inputs::report_object): New method.
10041 (Incremental_inputs::report_script): New method.
10042 (Incremental_inputs::finalize_inputs): New method.
10043 (Incremental_inputs::Input_info): New struct.
10044 (Incremental_inputs::Input_info_map): New typedef.
10045 (Incremental_inputs::lock_): New field.
10046 (Incremental_inputs::Inputs_): New field.
10047 (Incremental_inputs::Inputs_map): New field.
10048 * main.cc (main): Call Incremental_input::report_inputs.
10049 * options.h (Input_argument_list): Typedef moved from
10051 (Input_file_group::Files): Remove, use ::Input_argument_list.
10052 (Input_file_group::Input_argument_list): Remove, use
10053 ::Input_argument_list.
10054 * plugin.cc (Plugin_manager::add_input_file): Add error in
10056 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10058 * script.cc (read_input_script): Call
10059 Incremental_input::report_script.
10060 * script.h (Script_info): New class.
10062 2009-04-27 Ian Lance Taylor <iant@google.com>
10064 * x86_64.cc (do_adjust_output_section): Set entsize to
10067 2009-04-23 Elliott Hughes <enh@google.com>
10069 * output.cc (Output_file::close): After short writes, continue
10070 writing from the correct offset in the buffer being written.
10072 2009-04-23 Chris Demetriou <cgd@google.com>
10074 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10075 * configure: Regenerate.
10076 * config.in: Regenerate.
10077 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10078 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10080 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10082 * incremental.cc (Incremental_inputs_header_data): Renamed from
10083 Incremental_input_header_data.
10084 (Incremental_inputs_header_data::data_size): New field.
10085 (Incremental_inputs_header_data::put_input_file_count): Renamed
10086 from input_file_count.
10087 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10088 from command_line_offset.
10089 (Incremental_inputs_header_data::put_reserved): Renamed from
10091 (Incremental_inputs_entry_data): Renamed from
10092 Incremental_input_entry_data.
10093 (Incremental_inputs_entry_data::data_size): New field.
10094 (Incremental_inputs::report_command_line): New method.
10095 (Incremental_inputs::finalize): New method.
10096 (Incremental_inputs::create_incremental_inputs_data): New method.
10097 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10098 * incremental.h: New file.
10099 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10100 (Layout::finalize): Create incremental inputs section in
10101 incremental builds.
10102 (Layout::create_incremental_info_sections): New method.
10103 * layout.h (Layout::incremental_inputs): New method.
10104 (Layout::create_incremental_info_sections): New method.
10105 (Layout::incremental_inputs_): New field.
10106 * main.cc (main): Notify Incremental_input of the command line.
10108 2009-04-01 Ian Lance Taylor <iant@google.com>
10109 Mikolaj Zalewski <mikolajz@google.com>
10111 * gold.h (reserve_unordered_map): Define, three versions, one for
10112 each version of Unordered_map.
10113 * layout.cc (Layout::Layout): Remove options parameter. Add
10114 number_of_input_files parameter. Don't initialize options_.
10115 Initialize number_of_input_files_ and resized_signatures_. Move
10116 sections_are_attached_.
10117 (Layout::layout_group): Reserve space for group_signatures_.
10118 (Layout::find_or_add_kept_section): Change name parameter to be a
10119 reference. Resize signatures_ map when it gets large enough.
10120 (Layout::layout_eh_frame): Use parameters->options() instead of
10122 (Layout::make_output_section): Likewise.
10123 (Layout::attach_allocated_section_to_segment): Likewise.
10124 (Layout::finalize, Layout::create_executable_stack): Likewise.
10125 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10126 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10127 * layout.h (class Layout): Update declarations. Remove options_
10128 field. Add number_of_input_files_ and resized_signatures_
10129 fields. Move sections_are_attached_ field.
10130 * main.cc (main): Pass number of input files to Layout
10131 constructor. Don't pass options.
10133 2009-03-30 Ian Lance Taylor <iant@google.com>
10135 * ffsll.c (ffsll): Correct implementation.
10137 2009-03-27 Ian Lance Taylor <iant@google.com>
10139 * ffsll.c: New file.
10140 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10141 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10142 * ftruncate.c (ftruncate): Declare before definition.
10143 * mremap.c (mremap): Likewise.
10144 * pread.c (pread): Likewise.
10145 * configure, Makefile.in, config.in: Rebuild.
10147 * mremap.c: New file.
10148 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10149 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10150 (mremap): Declare if HAVE_MREMAP is not defined.
10151 * configure, Makefile.in, config.in: Rebuild.
10153 2009-03-27 Cary Coutant <ccoutant@google.com>
10155 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10156 position independent.
10157 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10158 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10160 2009-03-24 Cary Coutant <ccoutant@google.com>
10162 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10164 (needs_dynamic_reloc): Likewise.
10166 2009-03-24 Ian Lance Taylor <iant@google.com>
10168 * yyscript.y (file_cmd): Recognize EXTERN.
10169 (extern_name_list, extern_name_list_body): New nonterminals.
10170 * script.cc (script_add_extern): Define.
10171 * script-c.h (script_add_extern): Declare.
10173 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10175 * object.cc (is_elf_object): Define.
10176 * object.h (is_elf_object): Declare.
10177 * archive.cc (Archive::get_elf_object_for_member): Call
10179 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10181 2009-03-24 Elliott Hughes <enh@google.com>
10183 * output.cc (Output_file::map_anonymous): Define.
10184 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10185 try an anonymous one. Report the size if the mmap fails.
10186 * output.h (class Output_file): Declare map_anonymous.
10188 2009-03-24 Ian Lance Taylor <iant@google.com>
10190 * target-select.cc (instantiate_target): Don't acquire the lock if
10191 the instantiated_target_ field has already been set.
10193 2009-03-23 Ian Lance Taylor <iant@google.com>
10195 * gold-threads.h (class Initialize_lock): Define.
10196 * gold-threads.cc (class Initialize_lock_once): Define.
10197 (initialize_lock_control): New static variable.
10198 (initialize_lock_pointer): New static variable.
10199 (initialize_lock_once): New static function.
10200 (Initialize_lock::Initialize_lock): Define.
10201 (Initialize_lock::initialize): Define.
10202 * target-select.h: Include "gold-threads.h".
10203 (class Target_selector): Add lock_ and initialize_lock_ fields.
10204 Don't define instantiate_target, just declare it.
10205 * target-select.cc (Target_selector::Target_selector): Initialize
10207 (Target_selector::instantiate_target): Define.
10208 * descriptors.h: Include "gold-threads.h".
10209 (class Descriptors): Add initialize_lock_ field.
10210 * descriptors.cc (Descriptors::Descriptors): Initialize new
10212 (Descriptors::open): Use initialize_lock_ field
10213 * errors.h (class Errors): Add initialize_lock_ field.
10214 * errors.cc (Errors::Errors): Initialize new field.
10215 (Errors::initialize_lock): Use initialize_lock_ field.
10216 * powerpc.cc (class Target_selector_powerpc): Remove
10217 instantiated_target_ field. In do_recognize call
10218 instantiate_target rather than do_instantiate_target. In
10219 do_instantiate_target just allocate a new target.
10220 * sparc.cc (class Target_selector_sparc): Likewise.
10222 * freebsd.h: New file.
10223 * i386.cc: Include "freebsd.h".
10224 (Target_i386): Derive from Target_freebsd rather than
10226 (Target_selector_i386): Derive from Target_selector_freebsd rather
10227 than Target_selector.
10228 * x86_64.cc: Include "freebsd.h".
10229 (Target_x86_64): Derive from Target_freebsd rather than
10231 (Target_selector_x86_64): Derive from Target_selector_freebsd
10232 rather than Target_selector.
10233 * target.h (class Target): Add adjust_elf_header and
10234 do_adjust_elf_header.
10235 * output.cc (Output_file_header:: do_sized_write): Call target
10236 adjust_elf_header routine.
10237 * configure.tgt: Set targ_osabi.
10238 * configure.ac: Define GOLD_DEFAULT_OSABI.
10239 * parameters.cc (Parameters::default_target): Pass
10240 GOLD_DEFAULT_OSABI to select_target.
10241 * target-select.h (class Target_selector): Make instantiate_target
10242 protected rather than private.
10243 * Makefile.am (HFILES): Add freebsd.h.
10244 * configure, Makefile.in, config.in: Rebuild.
10246 * merge.cc (do_add_input_section): Correct pend value. Change
10247 message about last entry not being null terminated from error to
10250 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10252 * incremental.cc: New file.
10253 * Makefile.am (CCFILES): Add incremental.cc.
10254 * Makefile.in: Rebuild.
10256 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10258 * layout.cc (Layout::output_section_name): Preserve names
10259 of '.note.' sections.
10261 2009-03-19 Ian Lance Taylor <iant@google.com>
10263 * descriptors.cc (Descriptors::open): Check that the options are
10264 valid before using them.
10266 2009-03-18 Ian Lance Taylor <iant@google.com>
10268 * script-sections.h: Include <list>.
10269 (class Script_sections): Change Sections_elements from std::vector
10270 to std::list. Typedef public Elements_iterator. Add
10271 orphan_section_placement_, data_segment_align_start_, and
10272 saw_data_segment_align_ fields. Remove data_segment_align_index_
10274 * script-sections.cc (class Orphan_section_placement): New class.
10275 (class Sections_element): Add virtual functions is_relro and
10276 orphan_section_init. Remove virtual function place_orphan_here.
10277 (class Output_section_definition): Add is_relro and
10278 orphan_section_init. Remove place_orphan_here.
10279 (class Orphan_output_section): Likewise.
10280 (Script_sections::Script_sections): Update for field changes.
10281 (Script_sections::data_segment_align): Set saw_data_segment_align_
10282 and data_segment_align_start_, not data_segment_align_index.
10283 (Script_sections::data_segment_relro_end): Check
10284 saw_data_segment_align_. Use data_segment_align_start_ rather
10285 than data_segment_align_index_.
10286 (Script_sections::place_orphan): Rewrite to use
10287 Orphan_section_placement.
10289 2009-03-17 Ian Lance Taylor <iant@google.com>
10291 * archive.cc (Archive::add_symbols): Check for a version attached
10292 to the symbol name in the archive map.
10293 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10294 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10295 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10296 (ver_test_11.a): New target.
10297 * testsuite/Makefile.in: Rebuild.
10299 * configure.ac: Check for chsize and posix_fallocate. Replace
10301 * ftruncate.c: New file, from gnulib.
10302 * output.cc (posix_fallocate): Define dummy version if not
10303 HAVE_POSIX_FALLOCATE.
10304 (Output_file::map): Call posix_fallocate rather than lseek and
10306 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10307 * configure, Makefile.in, config.in: Rebuild.
10309 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10311 * layout.h (Layout::create_note): Add section_name parameter.
10312 * layout.cc (Layout::create_note): Likewise.
10313 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10315 2009-03-17 Ian Lance Taylor <iant@google.com>
10317 * descriptors.cc: Include "options.h".
10318 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10319 (Descriptors::open): Always use O_CLOEXEC when opening a new
10320 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10321 then set FD_CLOEXEC.
10323 * sparc.cc (class Target_sparc): Add has_got_section.
10324 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10325 make sure we have a GOT section.
10327 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10328 (Target_sparc::Scan::local): Likewise.
10329 (Target_sparc::Scan::global): Likewise.
10330 (Target_sparc::Relocate::relocate): Likewise.
10331 (Target_sparc::Relocate::relocate_tls): Likewise.
10333 * symtab.cc (Symbol_table::define_default_version): New function,
10334 broken out of add_from_object.
10335 (Symbol_table::add_from_object): Call define_default_version.
10336 (Symbol_table::define_special_symbol): Add resolve_oldsym
10337 parameter. Change all callers. If the version for a symbol comes
10338 from a version script, resolve it with the symbol with the same
10339 name with no version. Also add the symbol without a version if
10341 (do_define_in_output_data): If resolving with oldsym, don't delete
10343 (do_define_in_output_segment): Likewise.
10344 (do_define_as_constant): Likewise.
10345 * symtab.h (class Symbol_table): Update declarations.
10347 2009-03-13 Ian Lance Taylor <iant@google.com>
10349 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10350 (Read_symbols::requeue): New function.
10351 (Read_symbols::do_read_symbols): If make_elf_object fails because
10352 the target type is not configured, and the file was searched for,
10353 issue a warning and retry with the next directory.
10354 (Add_symbols::run): If the file has an incompatible format, and
10355 it was searched for, requeue the Read_symbols task. On error,
10356 release the object.
10357 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10358 dirindex parameter to constructor. Change all callers. Declare
10359 incompatible_warning and requeue.
10360 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10361 input_argument_ and input_group_ fields. Add them to
10362 constructor. Change all callers.
10363 (class Read_script): Add dirindex_ field. Add it to constructor.
10364 Change all callers.
10365 * archive.cc (Archive::setup): Remove input_objects parameter.
10366 Change all callers.
10367 (Archive::get_file_and_offset): Likewise.
10368 (Archive::read_all_symbols): Likewise.
10369 (Archive::read_symbols): Likewise.
10370 (Archive::get_elf_object_for_member): Remove input_objects
10371 parameter. Add punconfigured parameter. Change all callers.
10372 (Archive::add_symbols): Change return type to bool. Check return
10373 value of include_member.
10374 (Archive::include_all_members): Likewise.
10375 (Archive::include_member): Change return type to bool. Return
10376 false if first included object has incompatible target. Set
10377 included_member_ field.
10378 (Add_archive_symbols::run): If add_symbols returns false, requeue
10380 * archive.h (class Archive): Add included_member_ field.
10381 Initialize it in constructor. Add input_file and searched_for
10382 methods. Update declarations.
10383 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10384 input_argument_ fields. Add them to constructor. Change all
10386 * script.cc: Include "target-select.h".
10387 (class Parser_closure): Add skip_on_incompatible_target_ and
10388 found_incompatible_target_ fields. Add
10389 skip_on_incompatible_target parameter to constructor. Change all
10390 callers. Add methods skip_on_incompatible_target,
10391 clear_skip_on_incompatible_target, found_incompatible_target, and
10392 set_found_incompatible_target.
10393 (read_input_script): Add dirindex parameter. Change all callers.
10394 If parser finds an incompatible target, requeue Read_symbols
10396 (script_set_symbol): Clear skip_on_incompatible_target in
10398 (script_add_assertion, script_parse_option): Likewise.
10399 (script_start_sections, script_add_phdr): Likewise.
10400 (script_check_output_format): New function.
10401 * script.h (read_input_script): Update declaration.
10402 * script-c.h (script_check_output_format): Declare.
10403 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10404 (ignore_cmd): Remove OUTPUT_FORMAT.
10405 * fileread.cc (Input_file::Input_file): Add explicit this.
10406 (Input_file::will_search_for): New function.
10407 (Input_file::open): Add pindex parameter. Change all callers.
10408 * fileread.h (class Input_file): Add input_file_argument method.
10409 Declare will_search_for. Update declarations.
10410 * object.cc (make_elf_object): Add punconfigured parameter.
10411 Change all callers.
10412 * object.h (class Object): Make input_file public. Add
10413 searched_for method.
10414 (make_elf_object): Update declaration.
10415 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10417 * dirsearch.h (class Dirsearch): Update declaration.
10418 * options.h (class General_options): Add --warn-search-mismatch.
10419 * parameters.cc (Parameters::is_compatible_target): New function.
10420 * parameters.h (class Parameters): Declare is_compatible_target.
10421 * workqueue.cc (Workqueue::add_blocker): New function.
10422 * workqueue.h (class Workqueue): Declare add_blocker.
10424 * fileread.cc (Input_file::open): Remove options parameter.
10425 Change all callers.
10426 (Input_file::open_binary): Likewise.
10427 * script.cc (read_input_script): Likewise.
10428 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10429 options parameter from constructor. Change all callers.
10430 (class Read_script): Likewise.
10431 * fileread.h (class Input_file): Update declarations.
10432 * script.h (read_input_script): Update declaration.
10434 2009-03-10 Nick Clifton <nickc@redhat.com>
10436 * po/es.po: New Spanish translation.
10438 2009-03-06 Cary Coutant <ccoutant@google.com>
10440 * options.cc (parse_short_option): Keep dash_z from registering itself.
10442 2009-03-03 Ian Lance Taylor <iant@google.com>
10445 * target-reloc.h (relocate_section): Pass output_section to
10447 * i386.cc (Target_i386::should_apply_static_reloc): Add
10448 output_section parameter. Change all callers.
10449 (Target_i386::Relocate::relocate): Add output_section parameter.
10450 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10451 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10452 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10453 * testsuite/two_file_shared.sh: New script.
10454 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10455 (check_DATA): Add two_file_shared.dbg.
10456 (two_file_shared.dbg): New target.
10457 * testsuite/Makefile.in: Rebuild.
10459 2009-03-01 Ian Lance Taylor <iant@google.com>
10461 * configure.ac: Check for byteswap.h.
10462 * configure: Rebuild.
10463 * config.in: Rebuild.
10465 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10467 * layout.cc (Layout::find_or_add_kept_section): New function.
10468 (Layout::add_comdat): Removed.
10469 * layout.h (struct Kept_section): Move out of class Layout.
10470 Remove trailing underscores from field names. Add group_sections
10471 field. Rename group_ field to is_group. Change all uses.
10472 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10473 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10474 comdat_groups_ field.
10475 (Sized_relobj::include_section_group): Use
10476 find_or_add_kept_section and Kept_section::group_sections.
10477 (Sized_relobj::include_linkonce_section): Likewise.
10478 * object.cc (class Sized_relobj): Don't define Comdat_group or
10479 Comdat_group_table. Remove find_comdat_group and
10480 add_comdat_group. Remove comdat_groups_ field.
10481 * plugin.cc (include_comdat_group): Use
10482 Layout::find_or_add_kept_section.
10484 2009-02-28 Ian Lance Taylor <iant@google.com>
10486 * README: --gc-sections and map files are now supported. Document
10487 some build requirements.
10490 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10491 relocatable link set the value of the section symbol to zero.
10492 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10493 relocatable link don't include the section address in the local
10496 2009-02-27 Ian Lance Taylor <iant@google.com>
10499 * options.h (class Search_directory): Add is_system_directory.
10500 (class General_options): Declare is_in_system_directory.
10501 * options.cc (get_relative_sysroot): Make static.
10502 (get_default_sysroot): Make static.
10503 (General_optoins::is_in_system_directory): New function.
10504 * fileread.cc (Input_file::is_in_system_directory): New function.
10505 * fileread.h (class Input_file): Declare is_in_system_directory.
10506 * object.h (class Object): Add is_in_system_directory.
10507 (class Input_objects): Remove system_library_directory_ field.
10508 * object.cc (Input_objects::add_object): Don't set
10509 system_library_directory_.
10510 (input_objects::found_in_system_library_directory): Remove.
10511 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10512 parameter. Change all callers.
10513 (Symbol_table::sized_write_globals): Likewise.
10514 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10515 Call Object::is_in_system_directory.
10516 * symtab.h (class Symbol_table): Update declarations.
10519 * descriptors.h (Open_descriptor): Add is_on_stack field.
10520 * descriptors.cc (Descriptors::open): If the descriptor is on the
10521 top of the stack, remove it. Initialize is_on_stack field.
10522 (Descriptors::release): Only add pod to stack if it is not on the
10524 (Descriptors::close_some_descriptor): Clear stack_next and
10525 is_on_stack fields.
10528 * output.cc (Output_section::find_starting_output_address): Rename
10529 from starting_output_address; add PADDR parameter; change return
10531 * output.h (class Output_section): Declare
10532 find_starting_output_address instead of starting_output_address.
10533 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10534 section symbol for which we can't find a merge section.
10537 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10538 hidden or internal, force the symbol to be local.
10539 * resolve.cc (Symbol::override_visibility): Define.
10540 (Symbol::override_base): Use override_visibility.
10541 (Symbol_table::resolve): Likewise.
10542 (Symbol::override_base_with_special): Likewise.
10543 (Symbol_table::override_with_special): If the visibility is hidden
10544 or internal, force the symbol to be local.
10545 * symtab.h (class Symbol): Add set_visibility and
10546 override_visibility.
10547 * testsuite/ver_test_1.sh: New file.
10548 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10549 (check_DATA): Add ver_test_1.syms.
10550 (ver_test_1.syms): New target.
10551 * testsuite/Makefile.in: Rebuild.
10553 2009-02-25 Cary Coutant <ccoutant@google.com>
10555 * layout.cc (Layout::choose_output_section): Don't rename sections
10556 when using a linker script that has a SECTIONS clause.
10557 * Makefile.in: Regenerate.
10559 * testsuite/Makefile.am (script_test_5.sh): New test case.
10560 * testsuite/Makefile.in: Regenerate.
10561 * testsuite/script_test_5.cc: New file.
10562 * testsuite/script_test_5.sh: New file.
10563 * testsuite/script_test_5.t: New file.
10565 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10567 * archive.cc (Archive::include_member): Update calls to add_symbols.
10568 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10569 the Layout argument.
10570 * dynobj.h (do_add_symbols): Add the Layout argument.
10571 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10573 * object.h (Object::add_symbols): Add the Layout argument.
10574 (Object::do_add_symbols): Add the Layout argument.
10575 (Sized_relobj::do_add_symbols): Add the Layout argument.
10576 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10577 Unify the two versions.
10578 (Add_plugin_symbols): Remove.
10579 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10580 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10581 (Add_plugin_symbols): Remove.
10582 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10583 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10584 (Add_symbols::run): Make it work with Pulginobj.
10586 2009-02-06 Ian Lance Taylor <iant@google.com>
10588 * object.cc (Sized_relobj::do_layout): Make info message start
10589 with lower case letter.
10591 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10593 * binary.cc: Fix file comment.
10595 * options.h (enum Incremental_disposition): Define.
10596 (class General_options): Add new options: --incremental,
10597 --incremental_changed, --incremental_unchanged,
10598 --incremental_unknown. Add incremental_disposition_ and
10599 implicit_incremental_ fields.
10600 (General_options::incremental_disposition): New function.
10601 (class Position_dependent_options): Add incremental_disposition
10603 (Position_dependent_options::copy_from_options): Set incremental
10605 * options.cc (General_options::parse_incremental_changed): New
10607 (General_options::parse_incremental_unchanged): New function.
10608 (General_options::parse_incremental_unknown): New function.
10609 (General_options::General_options): Initialize new fields
10610 incremental_disposition_ and implicit_incremental_.
10611 (General_options::finalize): Check for uasge of --incremental-*
10612 without --incremental.
10614 2009-02-06 Chris Demetriou <cgd@google.com>
10616 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10617 pointer and to report location as the file name associated with
10619 (gold_undefined_symbol_at_location): New function to replace the
10620 old gold_undefined_symbol functionality.
10621 * target-reloc.h (relocate_section): Update to use
10622 gold_undefined_symbol_at_location.
10623 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10624 Call gold_undefined_symbol function rather than gold_error.
10625 * errors.h (Errors::undefined_symbol): Take location as a
10626 string, rather than calculating it from a relocation.
10627 * errors.cc (Errors::fatal): Print "fatal error:" before the
10629 (Errors::error, Errors::error_at_location): Print "error: "
10630 before the formatted message.
10631 (Errors::undefined_symbol): Take location as a string, rather
10632 than calculating it from a relocation.
10633 (gold_undefined_symbol_at_location): New function akin to
10634 old gold_undefined_symbol, calculates location from relocation.
10635 (gold_undefined_symbol): Change to take only a Symbol pointer
10636 and to report location as the file name associated with the symbol.
10637 * testsuite/debug_msg.sh: Update for changed error messages.
10638 * testsuite/undef_symbol.sh: Likewise.
10640 2009-02-04 Duncan Sands <baldrick@free.fr>
10643 * reduced_debug_output.h
10644 (Output_reduced_debug_abbrev_section::failed): Use format for
10646 (Output_reduced_debug_info_section::faild): Likewise.
10648 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10650 * script.cc (Lazy_demangler): New class.
10651 (Version_script_info::get_symbol_version_helper): Demangle a
10654 2009-01-29 Cary Coutant <ccoutant@google.com>
10656 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10658 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10660 2009-01-28 Ian Lance Taylor <iant@google.com>
10662 * version.cc (version_string): Bump to 1.9.
10664 * gold.h: Include <cstring> and <stdint.h>.
10665 * version.cc: Include <cstdio>.
10666 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10668 * reduced_debug_output.cc (insert_into_vector): Rename from
10669 Insert_into_vector; change all callers. Use Swap_unaligned to
10670 avoid aliasing issue; remove union since it is unnecessary.
10672 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10674 * Makefile.am (CCFILES): Add gc.cc.
10675 (HFILES): Add gc.h.
10676 * Makefile.in: Regenerate.
10677 * gold.cc (Gc_runner): New class.
10678 (queue_initial_tasks): Call garbage collection related tasks
10679 when corresponding options are invoked.
10680 (queue_middle_gc_tasks): New function.
10681 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10682 processed early before laying out sections during garbage collection.
10683 * gold.h (queue_middle_gc_tasks): New function.
10684 (is_prefix_of): Move from "layout.cc".
10685 * i386.cc (Target_i386::gc_process_relocs): New function.
10686 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10687 * main.cc (main): Create object of class "Garbage_collection".
10688 * object.cc (Relobj::copy_symbols_data): New function.
10689 (Relobj::is_section_name_included): New function.
10690 (Sized_relobj::do_layout): Allow this function to be called twice
10691 during garbage collection and defer layout of section during the
10693 * object.h (Relobj::get_symbols_data): New function.
10694 (Relobj::is_section_name_included): New function.
10695 (Relobj::copy_symbols_data): New function.
10696 (Relobj::set_symbols_data): New function.
10697 (Relobj::get_relocs_data): New function.
10698 (Relobj::set_relocs_data): New function.
10699 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10700 (Relobj::gc_process_relocs): New function.
10701 (Relobj::do_gc_process_relocs): New pure virtual function.
10702 (Relobj::sd_): New data member.
10703 (Sized_relobj::is_output_section_offset_invalid): New function.
10704 (Sized_relobj::do_gc_process_relocs): New function.
10705 * options.h (General_options::gc_sections): Modify to not be a no-op.
10706 (General_options::print_gc_sections): New option.
10707 * plugin.cc (Plugin_finish::run): Remove function call to
10708 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10709 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10710 * reloc.cc (Read_relocs::run): Add task to process relocs and
10711 determine unreferenced sections when doing garbage collection.
10712 (Gc_process_relocs): New class.
10713 (Sized_relobj::do_gc_process_relocs): New function.
10714 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10715 sections that are garbage collected.
10716 * reloc.h (Gc_process_relocs): New class.
10717 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10718 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10719 symbols whose corresponding sections are garbage collected.
10720 (Symbol_table::Symbol_table): Add new parameter for the garbage
10722 (Symbol_table::gc_mark_undef_symbols): New function.
10723 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10724 (Symbol_table::gc_mark_dyn_syms): New function.
10725 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10727 (Symbol_table::add_from_object): Likewise.
10728 (Symbol_table::add_from_relobj): When building shared objects, do not
10729 treat externally visible symbols as garbage.
10730 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10731 table information for static and relocatable links.
10732 * symtab.h (Symbol_table::set_gc): New function.
10733 (Symbol_table::gc): New function.
10734 (Symbol_table::gc_mark_undef_symbols): New function.
10735 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10736 (Symbol_table::gc_mark_dyn_syms): New function.
10737 (Symbol_table::gc_): New data member.
10738 * target.h (Sized_target::gc_process_relocs): New pure virtual
10740 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10741 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10743 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10745 * options.h (General_options::gc_sections): Define as a no-op for now.
10746 (General_options::no_keep_memory): Ditto.
10747 (General_options::Bshareable): Define.
10748 * options.cc (General_options::finalize): Honor -Bshareable.
10750 2009-01-20 Andreas Schwab <schwab@suse.de>
10752 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10753 read the value in the contents, since we don't use it. Use the
10754 template endianness when writing.
10755 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10757 2009-01-19 Andreas Schwab <schwab@suse.de>
10759 * configure.tgt (powerpc64-*): Fix targ_obj.
10761 2009-01-15 Ian Lance Taylor <iant@google.com>
10763 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10764 local symbols when stripping all symbols.
10766 2009-01-14 Cary Coutant <ccoutant@google.com>
10768 * output.cc (Output_reloc): Add explicit instantiations.
10770 2009-01-14 Cary Coutant <ccoutant@google.com>
10772 * archive.cc (Archive::get_elf_object_for_member): Remove call
10773 to File_read::claim_for_plugin.
10774 * descriptors.cc (Descriptors::open): Remove reference to
10776 (Descriptors::claim_for_plugin): Remove.
10777 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10778 (Descriptors::is_claimed): Remove.
10779 (claim_descriptor_for_plugin): Remove.
10780 * fileread.cc (File_read::claim_for_plugin): Remove.
10781 * fileread.h (File_read::claim_for_plugin): Remove.
10782 (File_read::descriptor): Reopen descriptor if necessary.
10783 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10784 (Plugin_manager::all_symbols_read): Add task parameter. Change
10786 (Plugin_manager::get_input_file): New function.
10787 (Plugin_manager::release_input_file): New function.
10788 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10789 corresponding data member.
10790 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10791 and pass to base constructor. Change all callers.
10792 (get_input_file, release_input_file): New functions.
10793 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10794 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10795 (Plugin_manager::all_symbols_read): Add task parameter.
10796 (Plugin_manager::get_input_file): New function.
10797 (Plugin_manager::release_input_file): New function.
10798 (Plugin_manager::task_): New data member.
10799 (Pluginobj::Pluginobj): Add filesize parameter.
10800 (Pluginobj::filename): New function.
10801 (Pluginobj::descriptor): New function.
10802 (Pluginobj::filesize): New function.
10803 (Pluginobj::filesize_): New data member.
10804 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10805 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10806 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10808 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10809 with archive libraries.
10810 * testsuite/Makefile.in: Regenerate.
10811 * testsuite/plugin_test.c (struct sym_info): New type.
10812 (get_input_file, release_input_file): New static variables.
10813 (onload): Capture new transfer vector entries.
10814 (claim_file_hook): Stop reading at end of file according to filesize.
10815 Factor out parsing of readelf output into separate function.
10816 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10817 APIs and get the source file name from the symbol table. Convert
10818 source file name to corresponding object file name. Print info
10819 message when adding new input files.
10820 (parse_readelf_line): New function.
10821 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10822 * testsuite/plugin_test_2.sh: Likewise.
10823 * testsuite/plugin_test_3.sh: Likewise.
10824 * testsuite/plugin_test_4.sh: New test case.
10826 2009-01-07 Ian Lance Taylor <iant@google.com>
10828 * version.cc (version_string): Bump to 1.8.
10830 2008-12-23 Cary Coutant <ccoutant@google.com>
10832 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10833 * plugin.cc (Plugin_manager::finish): Rename as
10834 layout_deferred_objects. Move cleanup to separate function.
10835 (Plugin_manager::cleanup): New function.
10836 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10838 * plugin.h (Plugin_manager::finish): Rename as
10839 layout_deferred_objects.
10840 (Plugin_manager::cleanup): New function.
10841 (Plugin_manager::cleanup_done): New field.
10843 2008-12-23 Cary Coutant <ccoutant@google.com>
10845 * plugin.cc (is_visible_from_outside): New function.
10846 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10847 so we don't return "IR only" status for exported symbols or -r links.
10849 * testsuite/Makefile.am (plugin_test_3): New test case.
10850 * testsuite/Makefile.in: Regenerate.
10851 * testsuite/plugin_test_3.sh: New file.
10853 2008-12-22 Cary Coutant <ccoutant@google.com>
10855 * object.cc (Sized_relobj::layout_section): New function.
10856 (Sized_relobj::do_layout): Defer layout of input sections until after
10857 plugin has provided replacement files.
10858 (Sized_relobj::do_layout_deferred_sections): New function.
10859 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10860 (Relobj::layout_deferred_sections): New function.
10861 (Relobj::do_layout_deferred_sections): New function.
10862 (Sized_relobj::do_layout_deferred_sections): New function.
10863 (Sized_relobj::layout_section): New function.
10864 (Sized_relobj::Deferred_layout): New structure.
10865 (Sized_relobj::deferred_layout_): New field.
10866 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10867 Change all callers. Layout deferred sections.
10868 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10870 (Plugin_hook::run): Move code from do_plugin_hook inline.
10871 (Plugin_hook::do_plugin_hook): Remove.
10872 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10873 (Plugin_manager::finish): Renamed, was cleanup.
10874 (Plugin_manager::should_defer_layout): New function.
10875 (Plugin_manager::add_deferred_layout_object): New function.
10876 (Plugin_manager::Deferred_layout_list): New type.
10877 (Plugin_manager::deferred_layout_objects_): New field.
10878 (Plugin_hook::do_plugin_hook): Remove.
10880 2008-12-17 Ian Lance Taylor <iant@google.com>
10882 * options.h (class General_options): Add --no case for
10885 2008-12-16 Cary Coutant <ccoutant@google.com>
10887 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10889 (Plugin_manager::claim_file): Create plugin object even if
10890 plugin did not call the add_symbols callback.
10891 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10892 asking for more symbols than were added.
10893 * testsuite/Makefile.am (plugin_test_1): Add test case with
10895 (empty.syms): New target.
10896 * testsuite/Makefile.in: Regenerate.
10897 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10898 message. Don't call add_symbols if no globals.
10899 (all_symbols_read_hook): Don't provide replacement for empty
10902 2008-12-12 Ian Lance Taylor <iant@google.com>
10904 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10905 r_type == 0 for a local symbol with r_sym == 0.
10906 (scan_relocatable_relocs): Pass r_sym to
10907 local_non_section_strategy.
10908 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10911 * configure.ac: Update test for TLS descriptors: they are
10912 supported as of glibc 2.9.
10913 * configure: Rebuild.
10915 2008-12-11 Ian Lance Taylor <iant@google.com>
10918 * target-reloc.h (Default_scan_relocatable_relocs): For each
10919 function, map r_type == 0 to RELOC_DISCARD.
10921 2008-12-10 Cary Coutant <ccoutant@google.com>
10923 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10924 object to override a kept COMDAT group from a plugin object.
10926 2008-12-09 Ian Lance Taylor <iant@google.com>
10929 * yyscript.y (file_cmd): Handle INPUT.
10931 * testsuite/initpri1.c: Change all declarations to be full
10932 prototypes by adding void, to avoid compiler warnings.
10934 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10936 * options.cc (General_options::parse_plugin_opt): New.
10937 (General_options::add_plugin): The argument now is just the filename.
10938 (General_options::add_plugin_option): New.
10939 * options.h (plugin_opt): New.
10940 (add_plugin): Change argument name.
10941 (add_plugin_option): New.
10942 * plugin.cc (Plugin::load): Don't parse the plugin option.
10943 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10944 (Plugin::add_option): New.
10945 (Plugin::args_): Change type.
10946 (Plugin::filename_): New.
10947 (Plugin_manager::add_plugin_option): New.
10948 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10949 * testsuite/Makefile.in: Regenerate.
10951 2008-12-05 Cary Coutant <ccoutant@google.com>
10953 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10954 Handle --strip-lto-sections option.
10955 * options.h (strip_lto_sections): New option.
10957 2008-12-01 Cary Coutant <ccoutant@google.com>
10959 * plugin.cc (ld_plugin_message): Change format parameter to const.
10960 Fix mismatch between new[] and delete.
10962 2008-11-14 Cary Coutant <ccoutant@google.com>
10964 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10967 2008-11-05 Craig Silverstein <csilvers@google.com>
10969 * options.cc (General_options::parse_dynamic_list): New function.
10970 * options.h (General_options): New flags dynamic_list,
10971 dynamic_list_data, dynamic_list_cpp_new, and
10972 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10973 (General_options::in_dynamic_list): New function.
10974 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10975 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10976 (Lex::can_continue_name): Likewise.
10978 (read_script_file): New parameter script_options.
10979 (read_dynamic_list): New function.
10980 (Script_options::define_dynamic_list): New function.
10981 (dynamic_list_keyword_parsecodes): New variable.
10982 (dynamic_list_keywords): New variable.
10983 * script.h (Script_options::define_dynamic_list): New function
10985 (read_dynamic_list): New function prototype.
10986 * symtab.cc (strprefix): New macro.
10987 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10988 dynamic_list_data, dynamic_list_cpp_new, and
10989 dynamic_list_cpp_typeinfo.
10990 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10991 (dynamic_list_expr): New rule.
10992 (dynamic_list_nodes): Likewise.
10993 (dynamic_list_node): Likewise.
10994 * testsuite/Makefile.am (dynamic_list): New test.
10995 * testsuite/Makefile.in: Regenerated.
10996 * testsuite/dynamic_list.t: New file.
10997 * testsuite/dynamic_list.sh: New file.
10999 2008-11-05 Craig Silverstein <csilvers@google.com>
11001 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11002 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11003 (t11_last): Likewise.
11004 * testsuite/ver_test_6.c (main): Likewise.
11006 2008-10-07 Cary Coutant <ccoutant@google.com>
11008 * options.c (General_options::finalize): Add check for -static and
11010 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11013 2008-10-02 Cary Coutant <ccoutant@google.com>
11015 * plugin.cc (make_sized_plugin_object): Fix conditional
11016 compilation to work when not all targets are enabled.
11018 2008-09-29 Cary Coutant <ccoutant@google.com>
11020 * archive.cc (Archive::get_file_and_offset): Use filename instead
11021 of name to get library path.
11022 (Archive::include_member): Unlock external member of a thin archive.
11024 * testsuite/Makefile.am (TEST_AR): New variable.
11025 (thin_archive_test_1): New test.
11026 (thin_archive_test_2): New test.
11027 * testsuite/Makefile.in: Regenerate.
11028 * testsuite/thin_archive_main.cc: New file.
11029 * testsuite/thin_archive_test_1.cc: New file.
11030 * testsuite/thin_archive_test_2.cc: New file.
11031 * testsuite/thin_archive_test_3.cc: New file.
11032 * testsuite/thin_archive_test_4.cc: New file.
11034 2008-09-29 Cary Coutant <ccoutant@google.com>
11036 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11037 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11039 (Sized_relobj::do_finalize_local_symbols): Likewise.
11040 (Sized_relobj::map_to_kept_section): Likewise.
11041 * object.h (Sized_relobj::invalid_address): New constant.
11042 (Sized_relobj::do_output_section_offset): Check for invalid_address
11044 * output.cc (Output_reloc::local_section_offset): Use constant
11045 invalid_address instead of -1U.
11046 (Output_reloc::get_address): Likewise.
11047 (Output_section::output_address): Change -1U to -1ULL.
11048 * output.h (Output_reloc::invalid_address): New constant.
11049 * reloc.cc (Sized_relobj::write_sections): Use constant
11050 invalid_address instead of -1U.
11051 (Sized_relobj::relocate_sections): Likewise.
11052 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11053 values for merge sections.
11054 * target-reloc.h (relocate_for_relocatable): Use constant
11055 invalid_address instead of -1U.
11057 2008-09-19 Cary Coutant <ccoutant@google.com>
11059 Add plugin functionality for link-time optimization (LTO).
11060 * configure.ac (plugins): Add --enable-plugins option.
11061 * configure: Regenerate.
11062 * config.in: Regenerate.
11063 * Makefile.am (LIBDL): New variable.
11064 (CCFILES): Add plugin.cc.
11065 (HFILES): Add plugin.h.
11066 (ldadd_var): Add LIBDL.
11067 * Makefile.in: Regenerate.
11069 * archive.cc: Include "plugin.h".
11070 (Archive::setup): Don't preread archive symbols when using a plugin.
11071 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11072 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11074 (Archive::include_member): Add symbols from plugin objects.
11075 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11076 * descriptors.cc (Descriptors::open): Check for file descriptors
11077 abandoned by plugins.
11078 (Descriptors::claim_for_plugin): New function.
11079 * descriptors.h (Descriptors::claim_for_plugin): New function.
11080 (Open_descriptor::is_claimed): New field.
11081 (claim_descriptor_for_plugin): New function.
11082 * fileread.cc (File_read::claim_for_plugin): New function.
11083 * fileread.h (File_read::claim_for_plugin): New function.
11084 (File_read::descriptor): New function.
11085 * gold.cc: Include "plugin.h".
11086 (queue_initial_tasks): Add task to call plugin hooks for generating
11088 * main.cc: Include "plugin.h".
11089 (main): Load plugin libraries.
11090 * object.h (Pluginobj): Declare.
11091 (Object::pluginobj): New function.
11092 (Object::do_pluginobj): New function.
11093 (Object::set_target): New function.
11094 * options.cc: Include "plugin.h".
11095 (General_options::parse_plugin): New function.
11096 (General_options::General_options): Initialize plugins_ field.
11097 (General_options::add_plugin): New function.
11098 * options.h (Plugin_manager): Declare.
11099 (General_options): Add --plugin option.
11100 (General_options::has_plugins): New function.
11101 (General_options::plugins): New function.
11102 (General_options::add_plugin): New function.
11103 (General_options::plugins_): New field.
11104 * plugin.cc: New file.
11105 * plugin.h: New file.
11106 * readsyms.cc: Include "plugin.h".
11107 (Read_symbols::do_read_symbols): Check for archive before checking
11108 for ELF file. Call plugin hooks to claim files.
11109 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11110 from a real object file; force override when processing replacement
11112 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11113 (Symbol::init_base_object): Likewise.
11114 (Symbol::init_base_output_data): Likewise.
11115 (Symbol::init_base_output_segment): Likewise.
11116 (Symbol::init_base_constant): Likewise.
11117 (Symbol::init_base_undefined): Likewise.
11118 (Symbol::output_section): Assert that object is not a plugin.
11119 (Symbol_table::add_from_pluginobj): New function.
11120 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11122 (Symbol_table::sized_write_globals): Likewise.
11123 (Symbol_table::add_from_pluginobj): Instantiate template.
11124 * symtab.h (Sized_pluginobj): Declare.
11125 (Symbol::in_real_elf): New function.
11126 (Symbol::set_in_real_elf): New function.
11127 (Symbol::in_real_elf_): New field.
11128 (Symbol_table::add_from_pluginobj): New function.
11130 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11131 (LIBDL): New variable.
11132 (LDADD): Add LIBDL.
11133 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11134 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11135 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11136 (MOSTLYCLEANFILES): Likewise.
11137 * testsuite/Makefile.in: Regenerate.
11138 * testsuite/plugin_test.c: New file.
11139 * testsuite/plugin_test_1.sh: New file.
11140 * testsuite/plugin_test_2.sh: New file.
11142 2008-09-16 Ian Lance Taylor <iant@google.com>
11144 * target-reloc.h (relocate_section): Check whether a symbol is
11145 defined by the ABI before reporting an undefined symbol error.
11146 * target.h (Target::is_defined_by_abi): Make parameter const.
11147 (Target::do_is_defined_by_abi): Likewise.
11148 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11149 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11150 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11151 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11152 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11153 * testsuite/Makefile.in: Rebuild.
11155 * fileread.cc (make_view): Add casts to avoid warning.
11157 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11159 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11160 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11162 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11164 * options.h (General_options::output_is_executable): New.
11165 (General_options::output_is_pie): New.
11166 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11167 for shared libraries.
11168 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11170 2008-09-11 Chris Demetriou <cgd@google.com>
11172 * options.h (origin): New -z option.
11173 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11174 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11177 2008-09-05 Cary Coutant <ccoutant@google.com>
11179 * fileread.cc (File_read::make_view): Add check for attempt to map
11180 beyond end of file.
11182 2008-09-05 Cary Coutant <ccoutant@google.com>
11184 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11185 explicit instantiations.
11187 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11190 * options.cc (General_options::finalize): Allow undefined symbols
11191 in shlibs if linking -shared.
11194 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11195 symbols as not needing a dynsym entry.
11197 2008-08-20 Craig Silverstein <csilvers@google.com>
11199 * fileread.cc (File_read::open): Do not lock the file unless it
11200 was successfully opened.
11202 2008-08-14 Cary Coutant <ccoutant@google.com>
11204 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11205 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11206 * testsuite/tls_test.cc (struct int128): 128-bit struct
11207 for testing TLS relocs with non-zero addend.
11208 (v12): New TLS variable.
11210 (t_last): Add check for v12.
11211 * testsuite/tls_test.h (t12): New function.
11212 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11214 2008-08-13 Ian Lance Taylor <iant@google.com>
11216 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11217 set tls_segment_ or relro_segment_.
11218 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11220 * output.h (Output_section::clear_is_relro): New function.
11221 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11222 sections specially even when output_data_ is empty.
11223 (Output_segment::maximum_alignment): When first section is relro,
11224 only force alignment for PT_LOAD segments.
11225 * script.cc (script_data_segment_align): New function.
11226 (script_data_segment_relro_end): New function.
11227 * script-c.h (script_data_segment_align): Declare.
11228 (script_data_segment_relro_end): Declare.
11229 * script-sections.h (class Script_sections): Declare
11230 data_segment_align and data_segment_relro_end. Add fields
11231 segment_align_index_ and saw_relro_end_.
11232 * script-sections.cc (class Sections_element): Add set_is_relro
11233 virtual function. Add new bool* parameter to place_orphan_here.
11234 Add get_output_section virtual function.
11235 (class Output_section_definition): Add set_is_relro. Add new
11236 bool* parameter to place_orphan_here. Add get_output_section.
11237 Add is_relro_ field.
11238 (Output_section_definition::Output_section_definition): Initialize
11239 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11240 and is_relro_ fields.
11241 (Output_section_definition::place_orphan_here): Add is_relro
11243 (Output_section_definition::set_section_addresses): Set relro for
11245 (Output_section_definition::alternate_constraint): Likewise.
11246 (class Orphan_output_section): Add new bool* parameter to
11247 place_orphan_here. Add get_output_section.
11248 (Orphan_output_section::place_orphan_here): Add is_relro
11250 (Script_sections::Script_sections): Initialize
11251 data_segment_align_index_ and saw_relro_end_.
11252 (Script_sections::data_segment_align): New function.
11253 (Script_sections::data_segment_relro_end): New function.
11254 (Script_sections::place_orphan): Set or clear is_relro.
11255 (Script_sections::set_section_addresses): Force alignment of first
11257 * yyscript.y (exp): Call script_data_segment_align and
11258 script_data_segment_relro_end.
11259 * testsuite/relro_script_test.t: New file.
11260 * testsuite/relro_test.cc (using_script): Declare.
11261 (t1, t2): Test using_script.
11262 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11263 (relro_script_test_SOURCES): Define.
11264 (relro_script_test_DEPENDENCIES): Define.
11265 (relro_script_test_LDFLAGS): Define.
11266 (relro_script_test_LDADD): Define.
11267 (relro_script_test.so): New target.
11268 * testsuite/Makefile.in: Rebuild.
11270 2008-08-06 Cary Coutant <ccoutant@google.com>
11272 * archive.cc (Archive::total_archives, Archive::total_members)
11273 (Archive::total_members_loaded): New variables.
11274 (Archive::setup): Add parameter. Add option to preread
11276 (Archive::read_armap): Add counter.
11277 (Archive::get_file_and_offset): New function.
11278 (Archive::get_elf_object_for_member): New function.
11279 (Archive::read_all_symbols): New function.
11280 (Archive::read_symbols): New function.
11281 (Archive::add_symbols): Add counters.
11282 (Archive::include_all_members): Use armap to find members if it's
11284 (Archive::include_member): Skip reading symbols if already read.
11285 Factored code into Archive::get_file_and_offset and
11286 Archive::get_elf_object_for_member. Changed call to
11287 Mapfile::report_include_archive_member.
11288 (Archive::print_stats): New function.
11289 * archive.h: Declare Object and Read_symbols_data classes.
11290 (Archive::Archive): Add initializers for new members.
11291 (Archive::setup): Add parameter.
11292 (Archive::print_stats): New function.
11293 (Archive::total_archives, Archive::total_members)
11294 (Archive::total_members_loaded): New variables.
11295 (Archive::get_file_and_offset): New function.
11296 (Archive::get_elf_object_for_member): New function.
11297 (Archive::read_all_symbols): New function.
11298 (Archive::read_symbols): New function.
11299 (Archive::Archive_member): New class.
11300 (Archive::members_): New member.
11301 (Archive::num_members_): New member.
11302 * main.cc: Include archive.h.
11303 (main): Call Archive::print_stats.
11304 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11305 archive parameter; member_name is now the fully-decorated name.
11306 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11307 * options.h: (General_options): Add --preread-archive-symbols option.
11308 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11311 2008-08-04 Ian Lance Taylor <iant@google.com>
11313 * symtab.h (Symbol::use_plt_offset): New function.
11314 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11315 * powerpc.cc (Relocate::relocate): Likewise.
11316 * sparc.cc (Relocate::relocate): Likewise.
11317 * x86_64.cc (Relocate::relocate): Likewise.
11318 * testsuite/weak_plt.sh: New test.
11319 * testsuite/weak_plt_main.cc: New test.
11320 * testsuite/weak_plt_shared.cc: New test.
11321 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11322 (check_PROGRAMS): Add weak_plt.
11323 (check_DATA): Add weak_plt_shared.so.
11324 (weak_plt_main_pic.o, weak_plt): New targets.
11325 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11326 * testsuite/Makefile.in: Rebuild.
11328 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11330 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11331 * testsuite/Makefile.in: Rebuild.
11333 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11335 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11336 * Makefile.in: Regenerate.
11337 * po/POTFILES.in: Regenerate.
11339 2008-07-29 Ian Lance Taylor <iant@google.com>
11341 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11342 symbols before other symbols.
11343 * testsuite/script_test_2.cc (test_addr): Declare.
11344 (test_addr_alias): Declare.
11345 (main): Check that test_addr and test_addr_alias have the right
11347 * testsuite/script_test_2.t: Define test_addr_alias and
11350 2008-07-24 Ian Lance Taylor <iant@google.com>
11353 * descriptors.cc: New file.
11354 * descriptors.h: New file.
11355 * gold-threads.h (class Hold_optional_lock): New class.
11356 * fileread.cc: Include "descriptors.h".
11357 (File_read::~File_read): Release descriptor rather than closing
11359 (File_read::open) [file]: Call open_descriptor rather than open.
11360 Set is_descriptor_opened_.
11361 (File_read::open) [memory]: Assert that descriptor is not open.
11362 (File_read::reopen_descriptor): New function.
11363 (File_read::release): Release descriptor.
11364 (File_read::do_read): Make non-const. Reopen descriptor.
11365 (File_read::read): Make non-const.
11366 (File_read::make_view): Reopen descriptor.
11367 (File_read::do_readv): Likewise.
11368 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11369 Update declarations.
11370 * layout.cc: Include "descriptors.h".
11371 (Layout::create_build_id): Use open_descriptor rather than open.
11372 * output.cc: Include "descriptors.h".
11373 (Output_file::open): Use open_descriptor rather than open.
11374 * archive.cc (Archive::const_iterator): Change Archive to be
11376 (Archive::begin, Archive::end): Make non-const.
11377 (Archive::count_members): Likewise.
11378 * archive.h (class Archive): Update declarations.
11379 * object.h (Object::read): Make non-const.
11380 * Makefile.am (CCFILES): Add descriptors.cc.
11381 (HFILES): Add descriptors.h.
11382 * Makefile.in: Rebuild.
11385 * gold.h: Always include <clocale>. Add Solaris workarounds
11386 following code in binutils/sysdep.h.
11389 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11390 this->eh_frame_hdr_ is NULL before using it.
11392 * dynobj.cc (Versions::Versions): Update comment.
11394 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11395 the base version name.
11397 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11398 array size plus one.
11399 (Stringpool_template::set_string_offsets): Subtract one from key
11400 before using it as an array index.
11401 (Stringpool_template::get_offset_with_length): Likewise.
11402 (Stringpool_template::write_to_buffer): Likewise.
11403 * stringpool.h (Stringpool_template::get_offset_from_key):
11406 2008-07-23 Ian Lance Taylor <iant@google.com>
11409 * object.h (Merged_symbol_value::value): Do our best to handle a
11413 * script.cc (Version_script_info::get_versions): Don't add empty
11414 version tag to return value.
11415 (Version_script_info::get_symbol_version_helper): Change return
11416 type to bool. Add pversion parameter. Change all callers.
11417 (script_register_vers_node): Don't require a non-NULL tag.
11418 * script.h (class Version_script_info): Update declarations.
11419 (Version_script_info::get_symbol_version): Change return type to
11420 bool. Add version parameter. Change all callers.
11421 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11422 handling. Handle an empty version from a version script.
11423 (Symbol_table::define_special_symbol): Likewise.
11424 * testsuite/ver_test_10.script: New file.
11425 * testsuite/ver_test_10.sh: New file.
11426 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11427 (check_DATA): Add ver_test_10.syms.
11428 (ver_test_10.syms, ver_test_10.so): New target.
11429 * testsuite/Makefile.in: Rebuild.
11431 2008-07-23 Simon Baldwin <simonb@google.com>
11433 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11434 to zero for undefined symbols from dynamic libraries.
11436 2008-07-23 Ian Lance Taylor <iant@google.com>
11438 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11439 Change all callers.
11440 * symtab.h (class Symbol_table): Update declaration.
11441 * testsuite/ver_test_9.cc: New file.
11442 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11443 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11444 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11445 (ver_test_9.so, ver_test_9.o): New targets.
11446 * testsuite/Makefile.in: Rebuild.
11448 2008-07-22 Ian Lance Taylor <iant@google.com>
11450 * options.h (class General_options): Define --check-sections.
11451 * layout.cc (Layout::set_segment_offsets): Handle
11454 * options.h (class General_options): Define -n/--nmagic and
11456 * options.cc (General_options::finalize): For -n/--nmagic or
11457 -N/--omagic, set -static.
11458 * layout.cc (Layout::attach_allocated_section_to_segment): If
11459 -N/--omagic, don't put read-only and read-write sections in
11460 different segments.
11461 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11462 finding a read-only segment.
11463 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11464 don't set the minimum segment alignment to the common page size,
11465 and don't set the file offset to the address modulo the page size.
11466 * script-sections.cc (Script_sections::create_segments): If
11467 -n/--omagic, don't put read-only and read-write sections in
11468 different segments.
11470 * cref.cc: New file.
11471 * cref.h: New file.
11472 * options.h (class General_options): Add --print-symbol-counts.
11473 * main.cc (main): Issue defined symbol report if requested.
11474 * archive.cc (Archive::interpret_header): Make into a const member
11476 (Archive::add_symbols): Call Input_objects::archive_start and
11478 (Archive::const_iterator): Define new class.
11479 (Archive::begin, Archive::end): New functions.
11480 (Archive::include_all_members): Rewrite to use iterator.
11481 (Archive::count_members): New function.
11482 * archive.h (class Archive): Update declarations.
11483 (Archive::filename): New function.
11484 * object.cc: Include "cref.h".
11485 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11486 (Sized_relobj::do_get_global_symbol_counts): New function.
11487 (Input_objects::add_object): Add object to cross-referencer.
11488 (Input_objects::archive_start): New function.
11489 (Input_objects::archive_stop): New function.
11490 (Input_objects::print_symbol_counts): New function.
11491 * object.h: Declare Cref and Archive.
11492 (Object::get_global_symbol_counts): New function.
11493 (Object::do_get_global_symbol_counts): New pure virtual function.
11494 (class Sized_relobj): Add defined_count_ field. Update
11496 (class Input_objects): Add cref_ field. Update constructor.
11497 Update declarations.
11498 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11500 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11502 (Sized_dynobj::do_get_global_symbol_counts): New function.
11503 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11504 defined_count_. Update declarations. Define Symbols typedef.
11505 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11506 parameter. Change all callers.
11507 (Symbol_table::add_from_dynobj): Add sympointers and defined
11508 parameters. Change all callers.
11509 * symtab.h (class Symbol_table): Update declarations.
11510 * Makefile.am (CCFILES): Add cref.cc.
11511 (HFILES): Add cref.h.
11512 * Makefile.in: Rebuild.
11514 2008-07-22 Simon Baldwin <simonb@google.com>
11516 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11517 to zero when writing undefined symbols.
11519 2008-07-22 Ian Lance Taylor <iant@google.com>
11521 * output.cc (Output_section::add_input_section): Don't try to
11522 merge empty merge sections.
11524 2008-07-21 Craig Silverstein <csilvers@google.com>
11526 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11527 Include symbol version in error message.
11529 2008-07-20 Chris Demetriou <cgd@google.com>
11531 * configure.ac (gold_cv_c_random_seed): New configured variable.
11532 (RANDOM_SEED_CFLAGS): New substituted variable.
11533 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11534 * configure: Rebuild.
11535 * Makefile.in: Likewise.
11536 * testsuite/Makefile.in: Likewise.
11538 2008-07-18 Ian Lance Taylor <iant@google.com>
11540 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11541 where we see NAME/NULL and NAME/VERSION as separate symbols.
11542 * testsuite/ver_test_main.cc (main): Call t4.
11543 (t4, t4_2a): Define.
11544 * testsuite/ver_test_2.cc (t4_2): Define.
11545 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11546 * testsuite/ver_test_4.cc (t4_2a): Define.
11547 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11548 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11550 2008-07-17 Ian Lance Taylor <iant@google.com>
11552 * dynobj.cc (Versions::add_def): If we give an error about a
11553 missing version, go ahead and create the version anyhow.
11555 2008-07-10 Ian Lance Taylor <iant@google.com>
11557 Handle output sections with more than 0x7fffffff bytes.
11558 * object.h (class Relobj): Change map_to_output_ to
11559 output_sections_, and just keep a section pointer. Change all
11560 uses. Move comdat group support to Sized_relobj.
11561 (Relobj::is_section_specially_mapped): Remove.
11562 (Relobj::output_section): Remove poff parameter. Change all
11564 (Relobj::output_section_offset): New function.
11565 (Relobj::set_section_offset): Rewrite.
11566 (Relobj::map_to_output): Remove.
11567 (Relobj::output_sections): New function.
11568 (Relobj::do_output_section_offset): New pure virtual function.
11569 (Relobj::do_set_section_offset): Likewise.
11570 (class Sized_relobj): Add section_offsets_ field. Add comdat
11571 group support from Relobj. Update declarations.
11572 (Sized_relobj::get_output_section_offset): New function.
11573 (Sized_relobj::do_output_section_offset): New function.
11574 (Sized_relobj::do_set_section_offset): New function.
11575 * object.cc (Relobj::output_section_address): Remove.
11576 (Sized_relobj::Sized_relobj): Initialize new fields.
11577 (Sized_relobj::include_section_group): Cast find_kept_object to
11579 (Sized_relobj::include_linkonce_section): Likewise.
11580 (Sized_relobj::do_layout): Use separate arrays for output section
11582 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11584 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11585 output_sections and section_offsets.
11586 (Sized_relobj::write_local_symbols): Likewise.
11587 (map_to_kept_section): Compute output address directly.
11588 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11589 output_sections and section_offsets.
11590 (Sized_relobj::write_sections): Likewise.
11591 (Sized_relobj::relocate_sections): Likewise.
11592 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11593 * output.h (class Output_reloc): Update declarations. Change
11594 u2_.relobj to Sized_relobj*.
11595 (class Output_data_reloc): Change add functions to use
11597 * output.cc (Output_reloc::Output_reloc): Change relobj to
11599 (Output_reloc::local_section_offset): Change return type to
11600 Elf_Addr. Use get_output_section_offset.
11601 (Output_reloc::get_address): Likewise.
11602 (Output_section::is_input_address_mapped): Don't call
11603 is_section_specially_mapped.
11604 (Output_section::output_offset): Likewise.
11605 (Output_section::output_address): Likewise.
11606 (Output_section::starting_output_address): Likewise.
11607 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11608 parameter to Sized_relobj*.
11609 (Copy_relocs::need_copy_reloc): Likewise.
11610 (Copy_relocs::save): Likewise.
11611 * copy-relocs.h (class Copy_relocs): Update declarations.
11612 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11613 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11614 * target-reloc.h (relocate_for_relocatable): Change
11615 offset_in_output_section type to Elf_Addr. Change code that uses
11617 * layout.cc (Layout::layout): Always set *off.
11618 * mapfile.cc (Mapfile::print_input_section): Use
11619 output_section_offset.
11620 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11622 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11623 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11624 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11626 2008-07-03 Ian Lance Taylor <iant@google.com>
11628 * layout.cc (Layout::include_section): Do not discard unrecognized
11629 SHT_STRTAB sections.
11631 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11633 * script.cc (Lex::can_continue_name): Make '?' allowable in
11634 version-script names.
11635 * testsuite/version_script.map: Change glob pattern to use '?'
11637 2008-06-30 Manish Singh <yosh@gimp.org>
11640 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11643 2008-06-30 Ian Lance Taylor <iant@google.com>
11647 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11648 versions]: Don't try to read the value in the contents, since we
11649 don't use it. Use the template endianness when writing.
11651 2008-06-25 Cary Coutant <ccoutant@google.com>
11653 * fileread.cc (File_read::make_view): Assert on zero-length view.
11654 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11655 symbol table when there are no symbols to read.
11657 2008-06-23 Craig Silverstein <csilvers@google.com>
11659 * version.cc (version_string): Bump to 1.7
11661 2008-06-18 Craig Silverstein <csilvers@google.com>
11663 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11664 constant 0xFFFF to type Valtype.
11665 (Powerpc_relocate_functions::rel16_ha): Likewise.
11667 2008-06-17 Ian Lance Taylor <iant@google.com>
11669 * output.h (Output_section::Input_section): Initialize p2align_ to
11670 zero for Output_section_data constructors.
11671 (Output_section::Input_section::addralign): If not an input
11672 section, return the alignment of the Output_section_data.
11673 * testsuite/copy_test.cc: New file.
11674 * testsuite/copy_test_1.cc: New file.
11675 * testsuite/copy_test_2.cc: New file.
11676 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11677 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11678 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11679 (copy_test_1_pic.o, copy_test_1.so): New targets.
11680 (copy_test_2_pic.o, copy_test_2.so): New targets.
11681 * testsuite/Makefile.in: Rebuild.
11683 * script-sections.cc (Script_sections::place_orphan): Initialize
11684 local variable exact.
11686 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11688 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11690 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11691 David S. Miller <davem@davemloft.net>
11693 * powerpc.cc: New file.
11694 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11695 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11696 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11697 * Makefile.in: Rebuild.
11699 2008-06-09 Ian Lance Taylor <iant@google.com>
11701 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11703 (throwing, orig_terminate): New static variables.
11704 (terminate_handler): New static function.
11705 (t2): Set terminate handler.
11707 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11710 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11713 2008-05-30 Cary Coutant <ccoutant@google.com>
11715 * archive.cc (Archive::include_all_members) Correct to step
11716 over symbol table and extended name table in thin archives.
11718 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11721 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11724 2008-05-28 Caleb Howe <cshowe@google.com>
11726 * reduced_debug_output.cc: New file.
11727 * reduced_debug_output.h: New file.
11728 * options.h (class General_options): Add --strip-debug-non-line.
11729 * options.cc (General_options::finalize): Add strip_debug_non_line
11730 to the strip heirarchy.
11731 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11733 * layout.cc: Include "reduced_debug_output.h".
11734 (Layout::Layout): Initialize new fields.
11735 (line_only_debug_sections): New static array.
11736 (is_lines_only_debug_sections): New static inline function.
11737 (Layout::include_section): Handle --strip-debug-non-line.
11738 (Layout::make_output_section): If --strip-debug-non-line, build
11739 new output sections for .debug_abbrev and .debug_info.
11740 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11741 gold. Warn about possible overflow.
11742 (read_signed_LEB_128): Likewise.
11743 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11744 (read_signed_LEB_128): Declare.
11745 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11746 (HFILES): Add reduced_debug_output.h.
11747 * Makefile.in: Rebuild.
11749 2008-05-21 Ian Lance Taylor <iant@google.com>
11751 * mapfile.cc: New file.
11752 * mapfile.h: New file.
11753 * options.h (class General_options): Add -M/--print-map and -Map.
11754 * options.cc (General_options::finalize): Make -M equivalent to
11756 * main.cc: Include <cstdio> and "mapfile.h".
11757 (main): Open mapfile if requested.
11758 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11759 constructor. Change caller.
11760 (queue_initial_tasks): Add mapfile parameter. Change caller.
11761 (queue_middle_tasks): Likewise.
11762 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11764 * archive.cc: Include "mapfile.h".
11765 (Archive::add_symbols): Add mapfile parameter. Change all
11766 callers. Pass mapfile, symbol, and reason to include_member.
11767 (Archive::include_all_members): Add mapfile parameter. Change all
11769 (Archive::include_member): Add mapfile, sym, and why parameters.
11770 Change all callers. Report inclusion to map file.
11771 * archive.h: Include "fileread.h".
11772 (class Archive): Update declarations.
11773 (Archive::file): New const method.
11774 (class Add_archive_symbols): Add mapfile_ field. Update
11775 constructor. Change all callers.
11776 * readsyms.h (class Read_symbols): Likewise.
11777 (class Finish_group): Likewise.
11778 (class Read_script): Likewise.
11779 * common.cc: Include "mapfile.h".
11780 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11782 (Symbol_table::do_allocate_commons): Likewise.
11783 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11784 symbol allocation to mapfile.
11785 * common.h (class Allocate_commons_task): Add mapfile_ field.
11786 Update constructor. Change all callers.
11787 * symtab.h (class Symbol_table): Update declarations.
11788 * layout.cc: Include "mapfile.h".
11789 (Layout_task_runner::run): Print information to mapfile.
11790 (Layout::create_gold_note): Change Output_data_fixed_space to
11791 Output_data_zero_fill.
11792 (Layout::create_build_id): Likewise.
11793 (Layout::print_to_mapfile): New function.
11794 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11795 constructor. Change caller.
11796 (class Layout): Declare print_to_mapfile.
11797 * output.cc (Output_section::Input_section::print_to_mapfile): New
11799 (Output_section::add_input_section): If producing a map, always
11800 add to input_sections_ list.
11801 (Output_section::do_print_to_mapfile): New function.
11802 (Output_segment::print_sections_to_mapfile): New function.
11803 (Output_segment::print_section_list_to_mapfile): New function.
11804 * output.h: Include "mapfile.h".
11805 (Output_data::print_to_mapfile): New function.
11806 (Output_data::do_print_to_mapfile): New virtual function.
11807 (Output_segment_headers::do_print_to_mapfile): New function.
11808 (Output_file_header::do_print_to_mapfile): New function.
11809 (Output_data_const::do_print_to_mapfile): New function.
11810 (class Output_data_const_buffer): Add map_name_ field. Update
11811 constructor. Change all callers. Add do_print_to_mapfile
11813 (class Output_data_fixed_space): Likewise.
11814 (class Output_data_space): Likewise.
11815 (class Output_data_zero_fill): New class.
11816 (Output_data_strtab::do_print_to_mapfile): New function.
11817 (Output_data_reloc_base::do_print_to_mapfile): New function.
11818 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11819 (Output_data_group::do_print_to_mapfile): New function.
11820 (Output_data_got::do_print_to_mapfile): New function.
11821 (Output_data_dynamic::do_print_to_mapfile): New function.
11822 (Output_symtab_xindex::do_print_to_mapfile): New function.
11823 (class Output_section): Declare do_print_to_mapflie. Declare
11824 print_to_mapfile in Input_section.
11825 (class Output_segment): Declare new functions.
11826 * object.h (Sized_relobj::symbol_count): New function.
11827 * script-sections.cc
11828 (Output_section_element_dot_assignment::set_section_addresses):
11829 Change Output_data_fixed_space to Output_data_zero_fill.
11830 (Output_data_expression::do_print_to_mapfile): New function.
11831 * script.cc (read_input_script): Add mapfile parameter. Change
11833 * script.h (read_input_script): Update declaration.
11834 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11835 (Eh_frame::do_print_to_mapfile): New function.
11836 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11837 (Output_merge_string::do_print_to_mapfile): New function.
11838 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11840 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11842 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11844 * Makefile.am (CCFILES): Add mapfile.cc.
11845 (HFILES): Add mapfile.h.
11846 * Makefile.in: Rebuild.
11848 2008-05-19 Ian Lance Taylor <iant@google.com>
11850 * options.h (class General_options): Add -z relro.
11851 * layout.cc (Layout::Layout): Initialize relro_segment_.
11852 (Layout::add_output_section_data): Return the output section.
11853 (Layout::make_output_section): Rcognize relro sections and mark
11854 them appropriately.
11855 (Layout::attach_allocated_section_to_segment): Put relro sections
11856 in a PT_GNU_RELRO segment.
11857 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11859 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11861 (Layout::linkonce_mapping): Map d.rel.ro.local to
11862 .data.rel.ro.local.
11863 (Layout::output_section_name): Us .data.rel.ro.local for any
11864 section which begins with that.
11865 * layout.h (class Layout): Update add_output_section_data
11866 declaration. Add relro_segment_ field.
11867 * output.cc (Output_section::Output_section): Initialize is_relro_
11868 and is_relro_local_ fields.
11869 (Output_segment::add_output_section): Group relro sections.
11870 (Output_segment::is_first_section_relro): New function.
11871 (Output_segment::maximum_alignment): If there is a relro section,
11872 align the segment to the common page size.
11873 (Output_segment::set_section_addresses): Track whether we are
11874 looking at relro sections. If the last section is a relro
11875 section, align to the common page size.
11876 (Output_segment::set_section_list_addresses): Add in_relro
11877 parameter. Change all callers. Align to the page size when
11878 moving from relro to non-relro section.
11879 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11881 * output.h (class Output_section): Add is_relro_ and
11882 is_relro_local_ fields.
11883 (Output_section::is_relro): New function.
11884 (Output_section::set_is_relro): New function.
11885 (Output_section::is_relro_local): New function.
11886 (Output_section::set_is_relro_local): New function.
11887 (class Output_segment): Update declarations.
11888 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11889 * sparc.cc (Target_sparc::got_section): Likewise.
11890 * x86_64.cc (Target_x86_64::got_section): Likewise.
11891 * testsuite/relro_test_main.cc: New file.
11892 * testsuite/relro_test.cc: New file.
11893 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11894 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11895 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11896 (relro_test.so, relro_test_pic.o): New targets.
11897 * testsuite/Makefile.in: Rebuild.
11899 2008-05-16 Ian Lance Taylor <iant@google.com>
11901 * output.cc (Output_segment::add_output_section): Remove front
11903 * output.h (class Output_segment): Remove
11904 add_initial_output_section and overloaded add_output_section.
11905 Update declaration of remaining add_output_section.
11906 * layout.cc (Layout::create_interp): Call add_output_section
11907 rather than add_initial_output_section.
11908 (Layout::finish_dynamic_section): Likewise.
11910 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11911 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11912 know the dynamic type.
11913 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11914 field. Initialize it in constructor.
11915 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11916 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11917 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11920 * output.cc (Output_reloc::get_address): Change return type to
11922 * output.h (class Output_reloc): Update get_address declaration.
11923 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11924 for section addresses.
11926 2008-05-09 Ian Lance Taylor <iant@google.com>
11929 * gold.cc (gold_nomem): Use return value of write.
11931 2008-05-08 Ian Lance Taylor <iant@google.com>
11933 * symtab.c (Symbol::init_base_output_data): Add version
11934 parameter. Change all callers.
11935 (Symbol::init_base_output_segment): Likewise.
11936 (Symbol::init_base_constant): Likewise.
11937 (Symbol::init_base_undefined): Likewise.
11938 (Sized_symbol::init_output_data): Likewise.
11939 (Sized_symbol::init_output_segment): Likewise.
11940 (Sized_symbol::init_constant): Likewise.
11941 (Sized_symbol::init_undefined): Likewise.
11942 (Symbol_table::do_define_in_output_data): If the new symbol has a
11943 version, mark it as the default.
11944 (Symbol_table::do_define_in_output_segment): Likewise.
11945 (Symbol_table::do_define_as_constant): Likewise.
11946 * symtab.h (class Symbol): Update declarations.
11947 (class Sized_symbol): Likewise.
11948 * resolve.cc (Symbol::override_version): New function.
11949 (Symbol::override_base): Call override_version.
11950 (Symbol::override_base_with_special): Likewise.
11951 * testsuite/ver_script_8.script: New file.
11952 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11953 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11954 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11955 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11957 2008-05-06 Ian Lance Taylor <iant@google.com>
11960 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11962 (class General_options): Remove existing --undefined, and add
11963 --no-undefined instead. Add new --undefined as synonym for -u.
11964 * archive.cc (Archive::add_symbols): Check whether symbol was
11966 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11967 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11968 all uses. Add IS_UNDEFINED. Update declarations to split
11969 different versions of init_base. Declare init_base_undefined.
11970 (Symbol::is_defined): Handle IS_UNDEFINED.
11971 (Symbol::is_undefined): Likewise.
11972 (Symbol::is_weak_undefined): Call is_undefined.
11973 (Symbol::is_absolute): Handle IS_CONSTANT.
11974 (class Sized_symbol): Update declarations to split different
11975 versions of init. Declare init_undefined.
11976 (class Symbol_table): Declare new functions.
11977 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11978 Change all callers.
11979 (Symbol::init_base_output_data): Likewise.
11980 (Symbol::init_base_output_segment): Likewise.
11981 (Symbol::init_base_constant): Likewise.
11982 (Symbol::init_base_undefined): New function.
11983 (Sized_symbol::init_object): Rename from init. Change all
11985 (Sized_symbol::init_output_data): Likewise.
11986 (Sized_symbol::init_output_segment): Likewise.
11987 (Sized_symbol::init_constant): Likewise.
11988 (Sized_symbol::init_undefined): New function.
11989 (Symbol_table::add_undefined_symbols_from_command_line): New
11991 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11993 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11994 (Symbol::output_section): Likewise.
11995 (Symbol::set_output_section): Likewise.
11996 (Symbol_table::sized_finalize_symbol): Likewise.
11997 (Symbol_table::sized_write_globals): Likewise.
11998 * resolve.cc (Symbol_table::should_override): Likewise.
11999 (Symbol::override_base_with_special): Likewise.
12001 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12002 symbol, change it to have default visibility.
12003 * testsuite/protected_1.cc: New file.
12004 * testsuite/protected_2.cc: New file.
12005 * testsuite/protected_3.cc: New file.
12006 * testsuite/protected_main_1.cc: New file.
12007 * testsuite/protected_main_2.cc: New file.
12008 * testsuite/protected_main_3.cc: New file.
12009 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12010 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12011 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12012 (protected_1.so): New target.
12013 (protected_1_pic.o, protected_2_pic.o): New targets.
12014 (protected_3_pic.o): New target.
12015 (check_PROGRAMS): Add protected_2.
12016 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12017 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12018 * testsuite/Makefile.in: Rebuild.
12020 * options.h (DEFINE_var): Add set_user_set_##varname__.
12021 (DEFINE_bool_alias): New macro.
12022 (class General_options): Define -Bstatic using DEFINE_bool_alias
12023 rather than DEFINE_special. Add --undefined as an alias for -z
12025 * options.cc (General_options::parse_Bstatic): Remove.
12027 * options.h (class General_options): Add --fatal-warnings.
12028 * main.cc (main): Implement --fatal-warnings.
12029 * errors.h (Errors::warning_count): New function.
12031 * options.h (class General_options): Add -Bsymbolic-functions.
12032 * symtab.h (Symbol::is_preemptible): Check for
12033 -Bsymbolic-functions.
12035 2008-05-05 Ian Lance Taylor <iant@google.com>
12037 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12038 as noVARNAME rather than no-VARNAME.
12039 (class General_options): Add option -z combreloc.
12040 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12042 (Output_reloc::sort_before) [SHT_REL]: New function.
12043 (Output_reloc::sort_before) [SHT_RELA]: New function.
12044 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12045 Sort_relocs_comparison.
12046 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12047 parameter. Change all callers.
12048 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12049 sort_relocs parameter. Change all callers.
12050 * output.cc (Output_reloc::get_address): New function, broken out
12052 (Output_reloc::write_rel): Call it.
12053 (Output_reloc::compare): New function.
12054 (Output_data_reloc_base::do_write): Optionally sort relocs.
12056 * configure.ac: If targ_extra_obj is set, link it in.
12057 * configure.tgt: Initialize all variables.
12058 (x86_64*): Set targ_extra_obj and targ_extra_size.
12059 * configure: Rebuild.
12061 * object.cc (Sized_relobj::include_section_group): Adjust section
12062 indexes read from group data. Build vector to pass to
12064 * layout.cc (Layout::layout_group): Add flags and shndxes
12065 parameters. Remove contents parameter. Change caller. Update
12066 explicit instantiations.
12067 * layout.h (class Layout): Update layout_group declaration.
12068 * output.cc (Output_data_group::Output_data_group): Add flags and
12069 input_shndxes parameters. Remove contents parameter. Change
12071 (Output_data_group::do_write): Change input_sections_ to
12073 * output.h (class Output_data_group): Update constructor
12074 declaration. Rename input_sections_ to input_shndxes_.
12075 * testsuite/many_sections_test.cc: Add template.
12077 2008-04-30 Cary Coutant <ccoutant@google.com>
12079 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12081 * layout.cc (Layout::include_section): Refactored check for debug
12083 (Layout::add_comdat): Add new parameters. Change type
12084 of signature parameter. Add object and shndx to signatures table.
12085 (Layout::find_kept_object): New function.
12086 * layout.h: Include <cstring>.
12087 (Layout::is_debug_info_section): New function.
12088 (Layout::add_comdat): Add new parameters.
12089 (Layout::find_kept_object): New function.
12090 (Layout::Kept_section): New struct.
12091 (Layout::Signatures): Change type of map range.
12092 * object.cc (Relobj::output_section_address): New function.
12093 (Sized_relobj::include_section_group): Add new parameters. Change
12094 calls to Layout::add_comdat. Change to build table of kept comdat
12095 groups and table mapping discarded sections to kept sections.
12096 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12097 (Sized_relobj::do_layout): Change calls to include_section_group and
12098 include_linkonce_section.
12099 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12100 value to zero when section is discarded.
12101 (Sized_relobj::map_to_kept_section): New function.
12102 * object.h (Relobj::output_section_address): New function.
12103 (Relobj::Comdat_group): New type.
12104 (Relobj::find_comdat_group): New function.
12105 (Relobj::Comdat_group_table): New type.
12106 (Relobj::Kept_comdat_section): New type.
12107 (Relobj::Kept_comdat_section_table): New type.
12108 (Relobj::add_comdat_group): New function.
12109 (Relobj::set_kept_comdat_section): New function.
12110 (Relobj::get_kept_comdat_section): New function.
12111 (Relobj::comdat_groups_): New field.
12112 (Relobj::kept_comdat_sections_): New field.
12113 (Symbol_value::input_value): Update comment.
12114 (Sized_relobj::map_to_kept_section) New function.
12115 (Sized_relobj::include_linkonce_section): Add new parameter.
12116 * target-reloc.h (Comdat_behavior): New type.
12117 (get_comdat_behavior): New function.
12118 (relocate_section): Add code to map a discarded section to the
12119 corresponding kept section when applying a relocation.
12121 2008-04-30 Craig Silverstein <csilvers@google.com>
12123 * dwarf_reader.cc (next_generation_count): New static var.
12124 (Addr2line_cache_entry): New struct.
12125 (addr2line_cache): New static var.
12126 (Dwarf_line_info::one_addr2line): Added caching.
12127 (Dwarf_line_info::clear_addr2line_cache): New function.
12128 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12129 cache-size parameter.
12130 (Dwarf_line_info::one_addr2line_cache): New function.
12131 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12132 new cache-size argument to one_addr2line(), and clear cache.
12134 2008-04-28 Cary Coutant <ccoutant@google.com>
12136 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12137 R_386_PC8 relocations.
12139 2008-04-23 Ian Lance Taylor <iant@google.com>
12141 * object.cc (Sized_relobj::include_section_group): Check for
12142 invalid section group.
12144 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12147 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12148 than read for file header.
12149 * archive.cc (Archive::include_member): Likewise.
12151 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12153 * aclocal.m4: Regenerate.
12154 * configure: Regenerate.
12156 2008-04-19 Ian Lance Taylor <iant@google.com>
12158 * version.cc (version_string): Bump to 1.6.
12160 * testsuite/Makefile.am (many_sections_r_test): New target.
12161 (many_sections_r_test_SOURCES): Remove.
12162 (many_sections_r_test_DEPENDENCIES): Remove.
12163 (many_sections_r_test_LDFLAGS): Remove.
12164 (many_sections_r_test_LDADD): Remove.
12166 * object.cc (Sized_relobj::do_add_symbols): Always pass
12167 local_symbol_count_ to add_from_relobj.
12169 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12170 every thousand variables.
12171 * testsuite/Makefile.in: Rebuild.
12173 * object.cc (Xindex::initialize_symtab_xindex): New function.
12174 (Xindex::read_symtab_xindex): New function.
12175 (Xindex::sym_xindex_to_shndx): New function.
12176 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12178 (Sized_relobj::do_initialize_xindex): New function.
12179 (Sized_relobj::do_read_symbols): Adjust section links.
12180 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12181 parameter. Change all callers.
12182 (Sized_relobj::include_section_group): Adjust section links and
12183 symbol section indexes.
12184 (Sized_relobj::do_layout): Adjust section links.
12185 (Sized_relobj::do_count_local_symbols): Adjust section links and
12186 symbol section indexes.
12187 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12188 ordinary and special symbols.
12189 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12190 dynsym_xindex parameters. Change all callers. Adjust section
12191 links. Use SHN_XINDEX when needed.
12192 (Sized_relobj::get_symbol_location_info): Adjust section links.
12193 Don't get fooled by special symbols.
12194 * object.h (class Xindex): Define.
12195 (class Object): Add xindex_ parameter. Declare virtual functoin
12196 do_initialize_xindex.
12197 (Object::adjust_sym_shndx): New function.
12198 (Object::set_xindex): New protected function.
12199 (class Symbol_value): Add is_ordinary_shndx_ field.
12200 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12201 (Symbol_value::value): Assert ordinary section.
12202 (Symbol_value::initialize_input_to_output_map): Likewise.
12203 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12204 Change all callers.
12205 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12207 (class Sized_relobj): Update declarations.
12208 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12209 parameter. Change all callers.
12210 (Sized_relobj::adjust_shndx): New function.
12211 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12213 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12214 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12215 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12216 (Sized_dynobj::read_dynsym_section): Adjust section links.
12217 (Sized_dynobj::read_dynamic): Likewise.
12218 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12220 (Sized_dynobj::do_initialize_xindex): New function.
12221 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12222 do_initialize_xindex.
12223 (Sized_dynobj::adjust_shndx): New function.
12224 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12225 dynsym_xindex_ fields.
12226 (Layout::finalize): Add a call to set_section_indexes before
12227 creating the symtab sections.
12228 (Layout::set_section_indexes): Don't do anything if the section
12229 already has a section index.
12230 (Layout::create_symtab_sections): Add shnum parameter. Change
12231 caller. Create .symtab_shndx section if needed.
12232 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12234 (Layout::allocated_output_section_count): New function.
12235 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12237 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12238 fields. Update declarations.
12239 (Layout::symtab_xindex): New function.
12240 (Layout::dynsym_xindex): New function.
12241 (class Write_symbols_task): Add layout_ field.
12242 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12244 * output.cc (Output_section_headers::Output_section_headers): Add
12245 shstrtab_section parameter. Change all callers.
12246 (Output_section_headers::do_sized_write): Store overflow values
12247 for section count and section string table section index in
12248 section header zero.
12249 (Output_file_header::do_sized_write): Check for overflow of
12250 section count and section string table section index.
12251 (Output_symtab_xindex::do_write): New function.
12252 (Output_symtab_xindex::endian_do_write): New function.
12253 * output.h (class Output_section_headers): Add shstrtab_section_.
12254 Update declarations.
12255 (class Output_symtab_xindex): Define.
12256 (Output_section::has_out_shndx): New function.
12257 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12259 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12260 Change all callers.
12261 (Sized_symbol::init): Likewise.
12262 (Symbol::output_section): Check for ordinary symbol.
12263 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12264 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12266 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12267 Change all callers. Simplify handling of symbols from sections
12268 not included in the link.
12269 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12271 (Weak_alias_sorter::operator()): Assert that symbols are
12273 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12275 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12276 parameters. Change all callers.
12277 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12278 symbol distinction. Use SHN_XINDEX when needed.
12279 (Symbol_table::write_section_symbol): Add symtab_xindex
12280 parameter. Change all callers.
12281 (Symbol_table::sized_write_section_symbol): Likewise. Use
12282 SHN_XINDEX when needed.
12283 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12285 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12286 (Symbol::is_defined): Check is_ordinary.
12287 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12288 (Symbol::is_absolute, Symbol::is_common): Likewise.
12289 (class Sized_symbol): Update declarations.
12290 (class Symbol_table): Update declarations.
12291 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12292 parameters. Change all callers.
12293 (Sized_symbol::override): Likewise.
12294 (Symbol_table::override): Likewise.
12295 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12296 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12297 is_ordinary, and orig_st_shndx parameters. Change all callers.
12298 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12299 to be in an ordinary section.
12300 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12301 object and is_ordinary parameters. Change all callers.
12302 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12303 Change all callers. Don't add undefined or non-ordinary symbols
12305 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12306 Change all callers.
12307 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12309 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12310 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12311 (Sized_relobj::relocate_sections): Likewise.
12312 * target-reloc.h (scan_relocs): Adjust section symbol index.
12313 (scan_relocatable_relocs): Likewise.
12314 * i386.cc (Scan::local): Check for ordinary symbols.
12315 * sparc.cc (Scan::local): Likewise.
12316 * x86_64.cc (Scan::local): Likewise.
12317 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12318 to symbol_section_and_value.
12319 * testsuite/many_sections_test.cc: New file.
12320 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12321 (check_PROGRAMS): Add many_sections_test.
12322 (many_sections_test_SOURCES): Define.
12323 (many_sections_test_DEPENDENCIES): Define.
12324 (many_sections_test_LDFLAGS): Define.
12325 (BUILT_SOURCES): Add many_sections_define.h.
12326 (many_sections_define.h): New target.
12327 (BUILT_SOURCES): Add many_sections_check.h.
12328 (many_sections_check.h): New target.
12329 (check_PROGRAMS): Add many_sections_r_test.
12330 (many_sections_r_test_SOURCES): Define.
12331 (many_sections_r_test_DEPENDENCIES): Define.
12332 (many_sections_r_test_LDFLAGS): Define.
12333 (many_sections_r_test_LDADD): Define.
12334 (many_sections_r_test.o): New target.
12335 * testsuite/Makefile.in: Rebuild.
12337 2008-04-17 Cary Coutant <ccoutant@google.com>
12339 * errors.cc (Errors::info): New function.
12340 (gold_info): New function.
12341 * errors.h (Errors::info): New function.
12342 * gold.h (gold_info): New function.
12343 * object.cc (Input_objects::add_object): Print trace output.
12344 * options.cc (options::parse_set): New function.
12345 (General_options::parse_wrap): Deleted.
12346 (General_options::General_options): Deleted initializer.
12347 * options.h (options::String_set): New typedef.
12348 (options::parse_set): New function.
12349 (DEFINE_set): New macro.
12350 (General_options::wrap): Changed to use DEFINE_set. Changed
12351 callers of any_wrap_symbols and is_wrap_symbol.
12352 (General_options::trace, General_options::trace_symbol):
12354 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12355 (General_options::wrap_symbols_): Deleted.
12356 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12358 2008-04-17 David S. Miller <davem@davemloft.net>
12360 * options.cc (General_options::parse_V): New function.
12361 * options.h: Add entries for -V and -Qy.
12363 2008-04-17 Ian Lance Taylor <iant@google.com>
12365 * common.cc (Symbol_table::allocate_commons): Remove options
12366 parameter. Change caller.
12367 (Symbol_table::do_allocate_commons): Remove options parameter.
12368 Change caller. Just call do_allocate_commons_list twice.
12369 (Symbol_table::do_allocate_commons_list): New function, broken out
12370 of do_allocate_commons.
12371 * common.h (class Allocate_commons_task): Remove options_ field.
12372 Update constructor.
12373 * symtab.cc (Symbol_table::Symbol_table): Initialize
12375 (Symbol_table::add_from_object): Put TLS common symbols on
12377 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12378 which are IN_OUTPUT_DATA.
12379 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12380 allocate_commons and do_allocate_commons declarations. Declare
12381 do_allocate_commons_list.
12382 * gold.cc (queue_middle_tasks): Update creation of
12383 Allocate_commons_task to not pass options.
12384 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12385 (TLS_TEST_C_FLAGS): New variable.
12386 (tls_test_c_pic.o): New target.
12387 (tls_test_shared.so): Link in tls_test_c_pic.o.
12388 (tls_test_c_pic_ie.o): New target.
12389 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12390 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12391 (tls_test_c.o): New target.
12392 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12393 (tls_pic_test_LDADD): Likewise.
12394 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12395 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12396 (tls_test_c_gnu2.o): New target.
12397 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12399 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12400 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12401 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12402 * testsuite/tls_test.cc: Include "config.h".
12403 (t_last): Call t11_last.
12404 * testsuite/tls_test.h (t11, t11_last): Declare.
12405 * testsuite/tls_test_c.c: New file.
12406 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12407 * configure.ac: Check for OpenMP support.
12408 * configure, config.in, Makefile.in: Rebuild.
12409 * testsuite/Makefile.in: Rebuild.
12411 2008-04-16 Cary Coutant <ccoutant@google.com>
12413 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12414 (Target_i386::tls_base_symbol_defined_): New field.
12415 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12416 (Target_i386::Scan::global): Likewise.
12417 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12418 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12419 (Target_x86_64::tls_base_symbol_defined_): New field.
12420 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12421 (Target_x86_64::Scan::global): Likewise.
12423 2008-04-16 Cary Coutant <ccoutant@google.com>
12425 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12426 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12427 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12428 building shared libraries.
12429 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12430 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12431 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12432 * testsuite/Makefile.in: Rebuild.
12433 * testsuite/weak_undef.h: New file.
12434 * testsuite/weak_undef_file1.cc: Add extra test cases.
12435 * testsuite/weak_undef_file2.cc: Likewise.
12436 * testsuite/weak_undef_test.cc: Likewise.
12438 2008-04-16 David S. Miller <davem@davemloft.net>
12440 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12441 Add issued_non_pic_error_ field. Declare check_non_pic.
12442 (Target_sparc::Scan::check_non_pic): New function.
12443 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12444 (Target_sparc::Scan::global): Likewise.
12446 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12447 * configure: Rebuild.
12449 * options.h (DEFINE_enable): New macro.
12450 (new_dtags): New enable option.
12451 (initfirst, interpose, loadfltr, nodefaultlib,
12452 nodelete, nodlopen, nodump): New -z options.
12453 * layout.cc (Layout:finish_dynamic_section): If new
12454 dtags enabled, emit DT_RUNPATH. Also, emit a
12455 DT_FLAGS_1 containing any specified -z flags.
12457 2008-04-16 Ian Lance Taylor <iant@google.com>
12459 * copy-relocs.cc: New file.
12460 * copy-relocs.h: New file.
12461 * reloc.cc: Remove Copy_relocs code.
12462 * reloc.h: Likewise.
12463 * reloc-types.h (struct Reloc_types) [both versions]: Add
12464 get_reloc_addend_noerror.
12465 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12466 variants of add_global which take an addend which must be zero.
12467 * i386.cc: Include "copy-relocs.h".
12468 (class Target_i386): Change type of copy_relocs_ to variable,
12469 update initializer.
12470 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12471 Change all callers.
12472 (Target_i386::do_finalize_sections): Change handling of
12474 * sparc.cc: Include "copy-relocs.h".
12475 (class Target_sparc): Change type of copy_relocs_ to variable,
12476 update initializer.
12477 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12478 Change all callers.
12479 (Target_sparc::do_finalize_sections): Change handling of
12481 * x86_64.cc: Include "copy-relocs.h".
12482 (class Target_x86_64): Change type of copy_relocs_ to variable,
12483 update initializer.
12484 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12485 class. Change all callers.
12486 (Target_x86_64::do_finalize_sections): Change handling of
12488 * Makefile.am (CCFILES): Add copy-relocs.cc.
12489 (HFILES): Add copy-relocs.h.
12491 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12493 * testsuite/script_test_4.sh: Permit leading zeroes.
12495 2008-04-15 Ian Lance Taylor <iant@google.com>
12497 * script-sections.cc (Script_sections::create_segments): Use
12498 header_size_adjustment even when there is enough room for the
12500 * testsuite/script_test_4.sh: New file.
12501 * testsuite/script_test_4.t: New file.
12502 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12503 (check_DATA): Add script_test_4.stdout.
12504 (MOSTLYCLEANFILES): Likewise.
12505 (script_test_4): New target.
12506 (script_test_4.stdout): New target.
12507 * testsuite/Makefile.in: Rebuild.
12509 * sparc.cc: Add definitions for Output_data_plt_sparc class
12512 2008-04-14 David S. Miller <davem@davemloft.net>
12514 * sparc.cc: New file.
12515 * Makefile.am (TARGETSOURCES): Add sparc.cc
12516 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12517 * configure.tgt: Document targ_extra_size and
12518 targ_extra_big_endian. Add entries for sparc-* and
12520 * configure.ac: Handle targ_extra_size and
12521 targ_extra_big_endian.
12522 * Makefile.in: Rebuild.
12523 * configure: Likewise.
12524 * po/POTFILES.in: Likewise.
12525 * po/gold.pot: Likewise.
12527 2008-04-14 Ian Lance Taylor <iant@google.com>
12529 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12530 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12531 in the name/type/flags to section mapping. Don't call
12532 allocate_output_section.
12533 (Layout::choose_output_section): Change parameter from adjust_name
12534 to is_input_section. Don't permit input sections after sections
12535 are attached to segments. Don't call allocate_output_section.
12536 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12537 not write_enable_output_section.
12538 (Layout::make_output_section): Don't push to
12539 unattached_section_list_ nor call attach_to_segment. Call
12540 attach_section_to_segment if sections are attached.
12541 (Layout::attach_sections_to_segments): New function.
12542 (Layout::attach_section_to_segment): New function.
12543 (Layout::attach_allocated_section_to_segment): Rename from
12544 attach_to_segment. Remove flags parameter.
12545 (Layout::allocate_output_section): Remove function.
12546 (Layout::write_enable_output_section): Remove function.
12547 * layout.h (class Layout): Update for above changes. Add new
12548 field sections_are_attached_.
12549 * output.h (Output_section::update_flags_for_input_section): New
12551 * output.cc (Output_section::add_input_section): Call
12552 update_flags_for_input_section.
12553 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12555 2008-04-11 Cary Coutant <ccoutant@google.com>
12557 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12558 thought unnecessary.
12559 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12561 2008-04-11 Ian Lance Taylor <iant@google.com>
12563 * output.h (class Output_section_data): Remove inline definition
12565 * output.cc (Output_section_data::set_addralign): New function.
12567 2008-04-11 Cary Coutant <ccoutant@google.com>
12569 Add support for TLS descriptors for i386 and x86_64.
12570 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12571 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12572 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12574 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12575 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12576 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12578 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12579 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12580 Fix problem with initial-exec relocations.
12581 (Target_i386::Relocate::relocate_tls): Likewise.
12582 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12584 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12585 support for section-plus-offset dynamic table entries.
12586 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12587 (Output_data_dynamic::Dynamic_entry): Add support for
12588 section-plus-offset dynamic table entries.
12589 (Output_data_dynamic::Classification): Likewise.
12590 (Output_data_dynamic::classification_): Renamed offset_.
12591 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12592 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12593 (Target_x86_64::make_plt_section): New function.
12594 (Target_x86_64::reserve_tlsdesc_entries): New function.
12595 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12596 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12597 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12598 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12599 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12600 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12601 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12602 add extra PLT entry for TLS descriptors.
12603 (Output_data_plt_x86_64::got_): New field.
12604 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12605 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12607 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12609 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12610 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12611 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12612 R_386_TLS_DESC_CALL relocations.
12613 (Target_x86_64::Scan::global): Likewise.
12614 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12615 for TLS descriptors.
12616 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12617 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12618 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12619 GD-to-IE relaxation.
12620 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12621 and TLS_DESCRIPTORS.
12622 * Makefile.in: Rebuild.
12623 * configure: Rebuild.
12624 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12625 (tls_test_shared2.so): New target.
12626 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12627 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12628 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12629 (tls_shared_gd_to_ie_test_LDADD): New variable.
12630 (tls_shared_gnu2_gd_to_ie_test): New target.
12631 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12633 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12634 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12635 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12636 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12637 (tls_shared_gnu2_test): New target.
12638 (tls_test_gnu2_shared.so): New target.
12639 (tls_shared_gnu2_test_SOURCES): New variable.
12640 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12641 (tls_shared_gnu2_test_LDFLAGS): New variable.
12642 (tls_shared_gnu2_test_LDADD): New variable.
12643 * testsuite/Makefile.in: Rebuild.
12644 * testsuite/Makefile.
12646 2008-04-11 Ian Lance Taylor <iant@google.com>
12648 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12650 * testsuite/Makefile.in: Rebuild.
12652 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12654 * testsuite/script_test_2.cc (main): Adjust test.
12656 2008-04-11 David S. Miller <davem@davemloft.net>
12657 Ian Lance Taylor <iant@google.com>
12659 * options.h (General_options): Add entries for '-Y' and
12661 * options.cc (General_options:finalize): If -Y was used, add those
12662 entries to the library path instead of the default "/lib" and
12665 2008-04-11 David S. Miller <davem@davemloft.net>
12667 * testsuite/justsyms.t: Start at 0x100.
12668 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12669 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12671 * testsuite/script_test_2.cc: Adjust string and section length
12674 2008-04-09 Ian Lance Taylor <iant@google.com>
12677 * script-sections.cc (Sections_element::allocate_to_segment): Add
12679 (Output_section_definition::allocate_to_segment): Likewise.
12680 (Orphan_output_section::allocate_to_segment): Likewise.
12681 (Script_sections::attach_sections_using_phdrs_clause): Don't
12682 propagate non-PT_LOAD segments to orphan sections.
12683 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12684 readelf rather than objdump.
12685 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12686 .interp section and PT_INTERP segment are the same size.
12687 * testsuite/Makefile.in: Rebuild.
12689 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12690 aliases for symbols defined in the same object.
12691 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12692 (weak_alias_test_SOURCES): New variable.
12693 (weak_alias_test_DEPENDENCIES): New variable.
12694 (weak_alias_test_LDFLAGS): New variable.
12695 (weak_alias_test_LDADD): New variable.
12696 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12697 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12698 (weak_alias_test_3.o): New target.
12699 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12700 * testsuite/weak_alias_test_main.cc: New file.
12701 * testsuite/weak_alias_test_1.cc: New file.
12702 * testsuite/weak_alias_test_2.cc: New file.
12703 * testsuite/weak_alias_test_3.cc: New file.
12705 2008-04-08 Ian Lance Taylor <iant@google.com>
12707 * options.h (class General_options): Add --noinhibit-exec option.
12708 * main.cc (main): Check --noinhibit-exec.
12710 * options.h (class General_options): Define --wrap as a special
12711 option. Add wrap_symbols_ field.
12712 (General_options::any_wrap_symbols): New function.
12713 (General_options::is_wrap_symbol): New function.
12714 * options.cc (General_options::parse_wrap): New function.
12715 (General_options::General_options): Initialize wrap_symbols_.
12716 * symtab.cc (Symbol_table::wrap_symbol): New function.
12717 (Symbol_table::add_from_object): Handle --wrap.
12718 * symtab.h (class Symbol_table): Declare wrap_symbol.
12719 * target.h (Target::wrap_char): New function.
12720 (Target::Target_info): Add wrap_char field.
12721 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12722 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12723 * testsuite/testfile.cc (Target_test::test_target_info):
12726 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12729 * layout.h (class Layout): Add added_eh_frame_data_ field.
12730 * layout.cc (Layout::Layout): Initialize new field.
12731 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12732 output section until we find a section we merged successfully.
12733 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12734 that the size be non-zero.
12736 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12739 2008-04-08 Craig Silverstein <csilvers@google.com>
12741 * configure.ac: Export new conditional variable HAVE_ZLIB.
12742 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12744 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12745 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12747 2008-04-07 Ian Lance Taylor <iant@google.com>
12749 * version.cc (version_string): Set to "1.5".
12751 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12752 Add issued_non_pic_error_ field. Declare check_non_pic.
12753 (Target_x86_64::Scan::check_non_pic): New function.
12754 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12755 (Target_x86_64::Scan::global): Likewise.
12757 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12758 addend parameter. Change caller. Handle merge sections.
12759 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12760 Address to Addend. Don't add in the result of
12761 local_section_offset, pass down the addend and use the returned
12763 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12764 Update declarations of local_section_offset and symbol_value.
12765 * testsuite/two_file_test_1.cc (t18): New function.
12766 * testsuite/two_file_test_2.cc (f18): New function.
12767 * testsuite/two_file_test_main.cc (main): Call t18.
12768 * testsuite/two_file_test.h (t18, f18): Declare.
12770 * configure.ac: Don't test for objdump, c++filt, or readelf.
12771 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12773 (TEST_READELF): New variable.
12774 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12775 (check_PROGRAMS): Add two_file_strip_test.
12776 (two_file_strip_test): New target.
12777 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12778 (two_file_same_shared_strip_test_SOURCES): New variable.
12779 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12780 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12781 (two_file_same_shared_strip_test_LDADD): New variable.
12782 (two_file_shared_strip.so): New target.
12783 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12784 (ver_test_5.syms, ver_test_7.syms): Likewise.
12785 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12786 (strip_test_3.stdout): Use TEST_OBJDUMP.
12787 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12789 2008-04-04 Cary Coutant <ccoutant@google.com>
12791 * symtab.h (Symbol::is_weak_undefined): New function.
12792 (Symbol::is_strong_undefined): New function.
12793 (Symbol::is_absolute): New function.
12794 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12795 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12797 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12798 (weak_undef_test): New target.
12799 * testsuite/Makefile.in: Rebuild.
12800 * testsuite/weak_undef_file1.cc: New file.
12801 * testsuite/weak_undef_file2.cc: New file.
12802 * testsuite/weak_undef_test.cc: New file.
12804 2008-04-03 Craig Silverstein <csilvers@google.com>
12806 * compressed_output.h (class Output_compressed_section): Use
12808 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12810 (zlib_compressed_suffix): Removed.
12811 (Output_compressed_section::set_final_data_size): Use unsigned
12813 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12814 Fix linker invocation.
12815 (flagstest_o_specialfile_and_compress_debug_sections):
12817 * testsuite/Makefile.in: Regenerated.
12819 2008-04-02 David S. Miller <davem@davemloft.net>
12821 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12822 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12824 2008-04-02 Craig Silverstein <csilvers@google.com>
12828 2008-04-02 Ian Lance Taylor <iant@google.com>
12830 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12831 parameters. Update for new key type to views_. Change all
12833 (File_read::read): Adjust for byteshift in returned view.
12834 (File_read::add_view): New function, broken out of
12835 find_and_make_view.
12836 (File_read::make_view): New function, broken out of
12837 find_and_make_view.
12838 (File_read::find_or_make_view): Add offset and aligned
12839 parameters. Rewrite accordingly. Change all callers.
12840 (File_read::get_view): Add offset and aligned parameters. Adjust
12841 for byteshift in return value.
12842 (File_read::get_lasting_view): Likewise.
12843 * fileread.h (class File_read): Update declarations.
12844 (class File_read::View): Add byteshift_ field. Add byteshift to
12845 constructor. Add byteshift method.
12846 * archive.h (Archive::clear_uncached_views): New function.
12847 (Archive::get_view): Add aligned parameter. Change all callers.
12848 * object.h (Object::get_view): Add aligned parameter. Change all
12850 (Object::get_lasting_view): Likewise.
12852 * fileread.cc (File_read::release): Don't call clear_views if
12853 there are multiple objects.
12854 * fileread.h (File_read::clear_uncached_views): New function.
12855 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12858 2008-03-31 Cary Coutant <ccoutant@google.com>
12860 Add thin archive support.
12861 * archive.cc (Archive::armagt): New const.
12862 (Archive::setup): Remove task parameter and calls to unlock.
12863 (Archive::unlock_nested_archives): New function.
12864 (Archive::read_header): Add nested_off parameter. Change
12866 (Archive::interpret_header): Likewise.
12867 (Archive::include_all_members): Change to handle thin
12869 (Archive::include_member): Likewise.
12870 * archive.h (Archive::Archive): Add new parameters and
12872 (Archive::armagt): New const.
12873 (Archive::setup): Remove task parameter.
12874 (Archive::unlock_nested_archives): New function.
12875 (Archive::read_header): Add nested_off parameter.
12876 (Archive::interpret_header): Likewise.
12877 (Archive::Nested_archive_table): New typedef.
12878 (Archive::is_thin_archive_): New field.
12879 (Archive::nested_archives_): New field.
12880 (Archive::options_): New field.
12881 (Archive::dirpath_): New field.
12882 (Archive::task_): New field.
12883 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12884 for thin archives. Pass additional parameters to
12885 Archive::Archive. Unlock the archive file after calling
12888 2008-03-29 Ian Lance Taylor <iant@google.com>
12890 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12891 version symbol to be local.
12892 * testsuite/ver_test_4.sh: New file.
12893 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12894 (check_DATA): Add ver_test_4.syms.
12895 (ver_test_4.syms): New target.
12896 * testsuite/Makefile.in: Rebuild.
12899 (Output_section::Input_section_sort_entry::has_priority): New
12901 (Output_section::Input_section_sort_entry::match_file_name): New
12903 (Output_section::Input_section_sort_entry::match_section_name):
12905 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12907 (Output_section::Input_section_sort_entry::match_section_file):
12909 (Output_section::Input_section_sort_compare::operator()): Rewrite
12910 using new Input_section_sort_entry functions. Sort crtbegin and
12911 crtend first. Sort sections with no priority before sections with
12913 * testsuite/initpri1.c (d3): Check j != 4.
12914 (cd5): New constructor/destructor function.
12915 (main): Check j != 2.
12917 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12918 new symbol when resolving, don't call set_is_default.
12919 * testsuite/ver_test_7.cc: New file.
12920 * testsuite/ver_test_7.sh: New file.
12921 * testsuite/Makefile.am (ver_test_7.so): New target.
12922 (ver_test_7.o): New target.
12923 (check_SCRIPTS): Add ver_test_7.sh.
12924 (check_DATA): Add ver_test_7.syms.
12925 (ver_test_7.syms): New target.
12927 2008-03-28 Ian Lance Taylor <iant@google.com>
12929 * layout.cc (Layout::layout): If we see an input section with a
12930 name that needs sorting, set the must_sort flag for the output
12932 (Layout::make_output_section): If the name of the output section
12933 indicates that it might require sorting, set the may_sort flag.
12934 * output.h (Output_section::may_sort_attached_input_sections): New
12936 (Output_section::set_may_sort_attached_input_sections): New
12938 (Output_section::must_sort_attached_input_sections): New
12940 (Output_section::set_must_sort_attached_input_sections): New
12942 (class Output_section): Declare Input_section_sort_entry. Define
12943 Input_section_sort_compare. Declare
12944 sort_attached_input_sections. Add new fields:
12945 may_sort_attached_input_sections_,
12946 must_sort_attached_input_sections_,
12947 attached_input_sections_are_sorted_.
12948 * output.cc (Output_section::Output_section): Initialize new
12950 (Output_section::add_input_section): Add an entry to
12951 input_sections_ if may_sort or must_sort are true.
12952 (Output_section::set_final_data_size): Call
12953 sort_attached_input_sections if necessary.
12954 (Output_section::Input_section_sort_entry): Define new class.
12955 (Output_section::Input_section_sort_compare::operator()): New
12957 (Output_section::sort_attached_input_sections): New function.
12958 * configure.ac: Check whether the compiler supports constructor
12959 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12960 * testsuite/initpri1.c: New file.
12961 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12962 CONSTRUCTOR_PRIORITY.
12963 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12964 (initpri1_LDFLAGS): New variable.
12965 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12967 2008-03-27 Ian Lance Taylor <iant@google.com>
12969 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12970 * testsuite/common_test_1.c: New file.
12971 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12972 (common_test_1_SOURCES): New variable.
12973 (common_test_1_DEPENDENCIES): New variable.
12974 (common_test_1_LDFLAGS): New variable.
12976 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12977 and commons_ correctly when NAME/VERSION does not override
12979 * testsuite/ver_test_6.c: New file.
12980 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12981 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12982 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12984 2008-03-26 Ian Lance Taylor <iant@google.com>
12986 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12987 of an undefined symbol from a version script.
12988 * testsuite/Makefile.am (ver_test_5.so): New target.
12989 (ver_test_5.o): New target.
12990 (check_SCRIPTS): Add ver_test_5.sh.
12991 (check_DATA): Add ver_test_5.syms.
12992 (ver_test_5.syms): New target.
12993 * testsuite/ver_test_5.cc: New file.
12994 * testsuite/ver_test_5.script: New file.
12995 * testsuite/ver_test_5.sh: New file.
12996 * Makefile.in, testsuite/Makefile.in: Rebuild.
12999 Fix problems building gold with gcc 4.3.0.
13000 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13001 (gold_error_at_location, gold_warning_at_location): Use it.
13002 * configure.ac: Check whether we can compile and use a template
13003 function with a printf attribute.
13004 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13005 when jumping over bytes.
13006 * object.cc: Instantiate Object::read_section_data.
13007 * debug.h: Include <cstring>
13008 * dwarf_reader.cc: Include <algorithm>
13009 * main.cc: Include <cstring>.
13010 * options.cc: Include <cstring>.
13011 * output.cc: Include <cstring>.
13012 * script.cc: Include <cstring>.
13013 * script.h: Include <string>.
13014 * symtab.cc: Include <cstring> and <algorithm>.
13015 * target-select.cc: Include <cstring>.
13016 * version.cc: Include <string>.
13017 * testsuite/testmain.cc: Include <cstdlib>.
13018 * configure, config.in: Rebuild.
13020 2008-03-25 Ian Lance Taylor <iant@google.com>
13022 * options.cc: Include "../bfd/bfdver.h".
13023 (options::help): Print bug reporting address.
13025 * version.cc (print_version): Adjust output for current value of
13026 BFD_VERSION_STRING.
13030 * options.cc (options::help): Print list of supported targets.
13031 * target-select.h: Include <vector>.
13032 (class Target_selector): Make machine_, size_, and is_big_endian_
13033 fields const. Add bfd_name_ and instantiated_target_ fields.
13034 (Target_selector::Target_selector): Add bfd_name parameter.
13035 (Target_selector::recognize): Make non-virtual, call
13037 (Target_selector::recognize_by_name): Make non-virtual, call
13038 do_recognize_by_name.
13039 (Target_selector::supported_names): New function.
13040 (Target_selector::bfd_name): New function.
13041 (Target_selector::do_instantiate_target): New pure virtual
13043 (Target_selector::do_recognize): New virtual function.
13044 (Target_selector::do_recognize_by_name): New virtual function.
13045 (Target_selector::instantiate_target): New private function.
13046 (supported_target_names): Declare.
13047 * target-select.cc (Target_selector::Target_selector): Update for
13048 new parameter and fields.
13049 (select_target_by_name): Check that the name matches before
13050 calling recognize_by_name.
13051 (supported_target_names): New function.
13052 * i386.cc (class Target_selector_i386): Update Target_selector
13053 constructor call. Remove recognize and recognize_by_name. Add
13054 do_instantiate_target.
13055 * x86_64.cc (class Target_selector_x86_64): Likewise.
13056 * testsuite/testfile.cc (class Target_selector_test): Update for
13057 changes to Target_selector.
13059 * README: Rewrite, with some notes on unsupported features.
13061 2008-03-24 Cary Coutant <ccoutant@google.com>
13063 * i386.cc (Target_i386::Got_type): New enum declaration.
13064 (Target_i386::Scan::local): Updated callers of Output_data_got
13066 (Target_i386::Scan::global): Likewise.
13067 (Target_i386::Relocate::relocate): Likewise.
13068 (Target_i386::Relocate::relocate_tls): Likewise.
13069 * object.h (Got_offset_list): New class.
13070 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13071 (Sized_relobj::local_got_offset): Likewise.
13072 (Sized_relobj::set_local_got_offset): Likewise.
13073 (Sized_relobj::local_has_tls_got_offset): Removed.
13074 (Sized_relobj::local_tls_got_offset): Removed.
13075 (Sized_relobj::set_local_tls_got_offset): Removed.
13076 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13077 * output.cc (Output_data_got::add_global): Added got_type parameter.
13078 (Output_data_got::add_global_with_rel): Likewise.
13079 (Output_data_got::add_global_with_rela): Likewise.
13080 (Output_data_got::add_global_pair_with_rel): New function.
13081 (Output_data_got::add_global_pair_with_rela): New function.
13082 (Output_data_got::add_local): Added got_type parameter.
13083 (Output_data_got::add_local_with_rel): Likewise.
13084 (Output_data_got::add_local_with_rela): Likewise.
13085 (Output_data_got::add_local_pair_with_rel): New function.
13086 (Output_data_got::add_local_pair_with_rela): New function.
13087 (Output_data_got::add_global_tls): Removed.
13088 (Output_data_got::add_global_tls_with_rel): Removed.
13089 (Output_data_got::add_global_tls_with_rela): Removed.
13090 (Output_data_got::add_local_tls): Removed.
13091 (Output_data_got::add_local_tls_with_rel): Removed.
13092 (Output_data_got::add_local_tls_with_rela): Removed.
13093 * output.h (Output_data_got::add_global): Added got_type parameter.
13094 (Output_data_got::add_global_with_rel): Likewise.
13095 (Output_data_got::add_global_with_rela): Likewise.
13096 (Output_data_got::add_global_pair_with_rel): New function.
13097 (Output_data_got::add_global_pair_with_rela): New function.
13098 (Output_data_got::add_local): Added got_type parameter.
13099 (Output_data_got::add_local_with_rel): Likewise.
13100 (Output_data_got::add_local_with_rela): Likewise.
13101 (Output_data_got::add_local_pair_with_rel): New function.
13102 (Output_data_got::add_local_pair_with_rela): New function.
13103 (Output_data_got::add_global_tls): Removed.
13104 (Output_data_got::add_global_tls_with_rel): Removed.
13105 (Output_data_got::add_global_tls_with_rela): Removed.
13106 (Output_data_got::add_local_tls): Removed.
13107 (Output_data_got::add_local_tls_with_rel): Removed.
13108 (Output_data_got::add_local_tls_with_rela): Removed.
13109 * resolve.cc (Symbol::override_base_with_special): Removed
13110 reference to has_got_offset_ field.
13111 * symtab.cc (Symbol::init_fields): Replaced initialization
13112 of got_offset_ with got_offsets_. Removed initialization
13114 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13115 (Symbol::got_offset): Likewise.
13116 (Symbol::set_got_offset): Likewise.
13117 (Symbol::has_tls_got_offset): Removed.
13118 (Symbol::tls_got_offset): Removed.
13119 (Symbol::set_tls_got_offset): Removed.
13120 (Symbol::got_offset_): Removed.
13121 (Symbol::tls_mod_got_offset_): Removed.
13122 (Symbol::tls_pair_got_offset_): Removed.
13123 (Symbol::got_offsets_): New field.
13124 (Symbol::has_got_offset): Removed.
13125 (Symbol::has_tls_mod_got_offset): Removed.
13126 (Symbol::has_tls_pair_got_offset): Removed.
13127 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13128 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13130 (Target_x86_64::Scan::global): Likewise.
13131 (Target_x86_64::Relocate::relocate): Likewise.
13132 (Target_x86_64::Relocate::relocate_tls): Likewise.
13134 2008-03-25 Ben Elliston <bje@au.ibm.com>
13136 * yyscript.y: Fix spelling error in comment.
13138 2008-03-24 Ian Lance Taylor <iant@google.com>
13140 * options.h (class General_options): Define build_id option.
13141 * layout.h (class Layout): Declare write_build_id, create_note,
13142 create_build_id. Add build_id_note_ member.
13143 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13144 "libiberty.h", "md5.h", "sha1.h".
13145 (Layout::Layout): Initialize eh_frame_data_,
13146 eh_frame_hdr_section_, and build_id_note_.
13147 (Layout::finalize): Call create_build_id.
13148 (Layout::create_note): New function, broken out of
13149 Layout::create_gold_note.
13150 (Layout::create_gold_note): Call create_note.
13151 (Layout::create_build_id): New function.
13152 (Layout::write_build_id): New function.
13153 (Close_task_runner::run): Call write_build_id.
13155 * x86_64.cc: Correct license to GPLv3.
13157 2008-03-23 Ian Lance Taylor <iant@google.com>
13159 * options.cc: Include "demangle.h".
13160 (parse_optional_string): New function.
13161 (parse_long_option): Handle takes_optional_argument.
13162 (parse_short_option): Update dash_z initializer. Handle
13163 takes_optional_argument.
13164 (General_options::General_options): Initialize do_demangle_.
13165 (General_options::finalize): Set do_demangle_. Handle demangling
13167 * options.h (parse_optional_string): Declare.
13168 (struct One_option): Add optional_arg field. Update constructor.
13169 Update call constructor calls. Add takes_optional_argument
13171 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13172 (DEFINE_optional_string): Define.
13173 (General_options::demangle): Change from DEFINE_bool to
13174 DEFINE_optional_string.
13175 (General_options::no_demangle): New function.
13176 (General_options::do_demangle): New function.
13177 (General_options::set_do_demangle): New function.
13178 (General_options::execstack_status_): Move definition to end of
13180 (General_options::static_): Likewise.
13181 (General_options::do_demangle_): New field.
13182 * object.cc (big_endian>::get_symbol_location_info): Call
13183 Options::do_demangle, not Options::demangle.
13184 * symtab.cc (demangle): Likewise.
13186 2008-03-22 Ian Lance Taylor <iant@google.com>
13188 * gold.h: Include <cstddef> and <sys/types.h>
13189 * options.h: Include <cstring>.
13191 2008-03-21 Ian Lance Taylor <iant@google.com>
13193 * Added source code to GNU binutils.