PR gold/14570
[binutils-gdb.git] / gold / ChangeLog
1 2012-09-12 Ian Lance Taylor <iant@google.com>
2
3 PR gold/14570
4 * output.cc: Rename Output_data_got template parameter from size
5 to got_size for all functions. Compile all variants of
6 Output_data_got.
7 (Output_data_got::Got_entry::write): Correct use of size for
8 symbol value. Use local_is_tls rather than casting to
9 Sized_relobj_file.
10 * object.h (class Object): Add local_is_tls and do_local_is_tls.
11 (class Sized_relobj_file): Add do_local_is_tls.
12 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
13
14 2012-09-11 Alan Modra <amodra@gmail.com>
15
16 PR gold/14566
17 * layout.cc (Layout::set_segment_offsets): When using
18 common-page-size alignment, ensure we are on a new max-page-size
19 page.
20 * output.cc (Output_segment::set_section_addresses): Use
21 abi_pagesize, not common_pagesize for relro boundary.
22 (Output_segment::set_offset): Likewise.
23
24 2012-09-11 Alan Modra <amodra@gmail.com>
25
26 * output.h (Output_data_got::add_global_tls, add_local_tls,
27 add_local_tls_pair): New functions.
28 (Output_data_got::add_local_pair_with_rel): Remove second
29 reloc param. Expand comment.
30 (Output_data_got::Got_entry): Rename use_plt_offset_ to
31 use_plt_or_tls_offset_, similarly for constructor param.
32 (Output_data_got::Got_entry::write): Add got_index param.
33 * output.cc (Output_data_got::add_global_tls, add_local_tls,
34 add_local_tls_pair): New functions.
35 (Output_data_got::Got_entry::write): Handle tls symbols
36 with use_plt_or_tls_offset_ set specially.
37 (Output_data_got::add_local_pair_with_rel): Only one reloc.
38 (Output_data_got::do_write): Replace iterator with index, pass
39 index to entry write function.
40 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
41 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
42 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
43 call.
44 * i386.cc (Target_i386::Scan::local): Likewise.
45 * sparc.cc (Target_sparc::Scan::local): Likewise.
46 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
47 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
48 do_tls_offset_for_global): New functions.
49 (Target_powerpc::Scan::local): Correct TLS relocations and got
50 entry values.
51 (Target_powerpc::Scan::global): Don't emit unnecessary
52 dynamic relocations on TLS GOT entries.
53
54 2012-09-10 Matthias Klose <doko@ubuntu.com>
55
56 * config.in: Disable sanity check for kfreebsd.
57
58 2012-09-10 Sterling Augustine <saugustine@google.com>
59
60 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
61 (Gdb_index::pubtypes_read): New parameter.
62 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
63 to calls.
64 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
65 pubtypes_object_.
66
67 2012-09-09 Alan Modra <amodra@gmail.com>
68
69 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
70 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
71 * gc.h (gc_process_relocs): Call target gc_add_reference.
72 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
73 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
74 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
75 unnecessary cast.
76 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
77 to cater for when we don't need code offset. Update use.
78 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
79 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
80 set_opd_valid): New functions.
81 (Target_powerpc::do_gc_add_reference): New function.
82 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
83 stashed refs.
84 (Target_powerpc::do_gc_mark_symbol): New function.
85
86 2012-09-06 Cary Coutant <ccoutant@google.com>
87
88 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
89 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
90 (Dwarf_die::skip_attributes): Likewise.
91 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
92 * testsuite/gdb_index_test.cc (inline_func_1): New function.
93 (main): Call it.
94 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
95
96 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
97
98 * testsuite/script_test_3.t: Add .got.plt output section
99 statement.
100 * testsuite/script_test_4.t: Likewise.
101
102 2012-09-05 Alan Modra <amodra@gmail.com>
103
104 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
105 update all uses and lose "enum" when using type.
106
107 2012-09-05 Alan Modra <amodra@gmail.com>
108
109 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
110 * configure: Regenerate.
111 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
112 (plugin_final_layout.stdout): Likewise.
113 (memory_test): Set page sizes to 0x1000.
114 * testsuite/Makefile.in: Regenerate.
115 * testsuite/discard_locals_test.sh: Add FIXME comment.
116 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
117 * testsuite/pr14265.t: Add .got output section statement.
118 * testsuite/script_test_2.t: Likewise.
119 * testsuite/script_test_3.t: Likewise.
120 * testsuite/script_test_4.t: Likewise.
121 * testsuite/script_test_5.t: Likewise.
122 * testsuite/script_test_6.t: Likewise.
123 * testsuite/script_test_7.t: Likewise.
124 * testsuite/script_test_9.t: Likewise.
125
126 2012-09-05 Alan Modra <amodra@gmail.com>
127
128 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
129 (Powerpc_relocate_functions::Status): New typedef.
130 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
131 (Target_powerpc::Scan::local): Handle REL64.
132 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
133 for REL32 and REL64.
134 (Target_powerpc::symval_for_branch): New function, extracted from..
135 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
136 checks. Report overflow errors.
137
138 2012-09-05 Alan Modra <amodra@gmail.com>
139
140 * object.h (Sized_relobj_file::emit_relocs): Delete.
141 (Sized_relobj_file::emit_relocs_reltype): Delete.
142 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
143 relocate_relocs for --emit-relocs.
144 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
145 * output.h: Update comment.
146 (Output_segment::first_section): New function.
147 (Output_segment::first_section_load_address): Use first_section.
148 * output.cc (Output_segment::first_section): New function extracted..
149 (Output_segment::first_section_load_address): ..from here. Delete.
150 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
151 * target.h (Sized_target::relocate_for_relocatable): Likewise.
152 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
153 adjust call to target.h function.
154 * i386.cc (Target_i386): Likewise.
155 * sparc.cc (Target_sparc): Likewise.
156 * x86_64.cc (Target_x86_64): Likewise.
157 * powerpc.cc (Target_powerpc): Likewise.
158 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
159 first tls section has section symbol for optimised local dynamic
160 output relocs.
161 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
162 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
163 optimised tls code.
164 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
165 Rename to relocate_relocs. Update error message.
166
167 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
168
169 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
170 --just-symbols.
171
172 2012-08-31 Alan Modra <amodra@gmail.com>
173
174 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
175 (Powerpc_relobj::toc_base_offset): New stub function.
176 (Target_powerpc): Add tp_offset, dtp_offset. Rename
177 got_mod_index_offset to tlsld_got_offset. Update all refs.
178 (Target_powerpc::Relocate::enum skip_tls): New.
179 (Target_powerpc::call_tls_get_addr_): New var.
180 (Target_powerpc::is_branch_reloc): Move to file scope.
181 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
182 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
183 New functions.
184 (Target_powerpc::enum Got_type): Delete old values, add new ones.
185 (powerpc_info): Correct common_pagesize for ppc64.
186 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
187 (Powerpc_relocate_functions): Add overflow check enums and functions.
188 Add non-shift version of rela, rela_ua. Delete all rel public
189 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
190 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
191 addr16_ha3, addr14 functions.
192 (Output_data_got_powerpc::add_constant_pair): New function.
193 (Output_data_got_powerpc::got_base_offset): Likewise.
194 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
195 (instruction constants): Sort, add some more.
196 (Output_data_glink::do_write): Add and use Address typedef. Use
197 object->toc_base_offset() stub for 64-bit.
198 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
199 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
200 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
201 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
202 Always treat .opd relocs as against locally defined symbol.
203 Correct condition for RELATIVE relocs.
204 (Target_powerpc::do_finalize_sections): Test for NULL sections.
205 (Target_powerpc::Relocate::relocate): Use plt call stub as value
206 for 32-bit syms with a plt entry. Correct ppc64 toc base
207 calculations. Handle TLS relocs, and more. Add overflow
208 checking and adjust for Powerpc_relocate_functions changes.
209 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
210 Reinstate --emit-relocs code with FIXME.
211
212 2012-08-30 Alan Modra <amodra@gmail.com>
213
214 * layout.cc (Layout::set_segment_offsets): Set p_align to
215 abi_pagesize, not common_pagesize.
216 (Layout::relaxation_loop_body): Similarly use abi_pagesize
217 to determine whether file header can go in segment.
218
219 2012-08-30 Alan Modra <amodra@gmail.com>
220
221 * output.h (Output_reloc::Output_reloc <output section>): Add
222 is_relative param. Adjust calls.
223 (Output_reloc::add_output_section_relative): New functions.
224 * output.cc (Output_reloc::Output_reloc <output section>): Handle
225 is_relative.
226 (Output_reloc::symbol_value): Handle SECTION_CODE.
227
228 2012-08-24 Sriraman Tallam <tmsriram@google.com>
229
230 * gold.cc (queue_middle_tasks): Call layout again when unique
231 segments for sections is desired.
232 * layout.cc (Layout::Layout): Initialize new members.
233 (Layout::get_output_section_flags): New function.
234 (Layout::choose_output_section): Call get_output_section_flags.
235 (Layout::layout): Make output section for mapping to a unique segment.
236 (Layout::insert_section_segment_map): New function.
237 (Layout::attach_allocated_section_to_segment): Make unique segment for
238 output sections marked so.
239 (Layout::segment_precedes): Check for unique segments when sorting.
240 * layout.h (Layout::Unique_segment_info): New struct.
241 (Layout::Section_segment_map): New typedef.
242 (Layout::insert_section_segment_map): New function.
243 (Layout::get_output_section_flags): New function.
244 (Layout::is_unique_segment_for_sections_specified): New function.
245 (Layout::set_unique_segment_for_sections_specified): New function.
246 (Layout::unique_segment_for_sections_specified_): New member.
247 (Layout::section_segment_map_): New member.
248 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
249 Rename is_gc_pass_one to is_pass_one.
250 Rename is_gc_pass_two to is_pass_two.
251 Rename is_gc_or_icf to is_two_pass.
252 Check for which pass based on whether symbols data is present.
253 Make it two pass when unique segments for sections is desired.
254 * output.cc (Output_section::Output_section): Initialize new
255 members.
256 * output.h (Output_section::is_unique_segment): New function.
257 (Output_section::set_is_unique_segment): New function.
258 (Output_section::is_unique_segment_): New member.
259 (Output_section::extra_segment_flags): New function.
260 (Output_section::set_extra_segment_flags): New function.
261 (Output_section::extra_segment_flags_): New member.
262 (Output_section::segment_alignment): New function.
263 (Output_section::set_segment_alignment): New function.
264 (Output_section::segment_alignment_): New member.
265 (Output_segment::Output_segment): Initialize is_unique_segment_.
266 (Output_segment::is_unique_segment): New function.
267 (Output_segment::set_is_unique_segment): New function.
268 (Output_segment::is_unique_segment_): New member.
269 * plugin.cc (allow_unique_segment_for_sections): New function.
270 (unique_segment_for_sections): New function.
271 (Plugin::load): Add new functions to transfer vector.
272 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
273 * Makefile.in: Regenerate.
274 * testsuite/plugin_final_layout.sh: Check if unique segment
275 functionality works.
276 * testsuite/plugin_section_order.c (onload): Check if new interfaces
277 are available.
278 (allow_unique_segment_for_sections): New global.
279 (unique_segment_for_sections): New global.
280 (claim_file_hook): Call allow_unique_segment_for_sections.
281 (all_symbols_read_hook): Call unique_segment_for_sections.
282
283 2012-08-22 Cary Coutant <ccoutant@google.com>
284
285 * layout.cc (Layout::include_section): Don't assert on GROUP
286 sections with --emit-relocs.
287
288 2012-08-21 Cary Coutant <ccoutant@google.com>
289
290 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
291 if --export-dynamic-symbol names an undef symbol.
292
293 2012-08-18 Alan Modra <amodra@gmail.com>
294
295 * powerpc.cc: Formatting and white space.
296 (Powerpc_relobj): Rename got2_section_ to special_.
297 Add opd_ent_shndx_ and opd_ent_off_ vectors.
298 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
299 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
300 (Target_powerpc): Add Address typedef and invalid_address. Use
301 throughout.
302 (Target_powerpc::is_branch_reloc): New function.
303 (Powerpc_relocate_functions): Add Address typedef, use throughout.
304 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
305 for dst_mask, value and addend.
306 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
307 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
308 (Output_data_glink::do_write): Correct toc base. Don't try to use
309 uint16_t for 24-bit offset. Use get_output_section_offset and
310 check return.
311 (Target_powerpc::Scan::local): Handle more relocs.
312 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
313 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
314 Plug in toc restoring insn after plt calls. Translate branches
315 to function descriptor symbols to corresponding entry point.
316 (Target_powerpc::relocate_for_relocatable): Check return from
317 get_output_section_offset.
318 * symtab.h: Comment typo.
319
320 2012-08-14 Ian Lance Taylor <iant@google.com>
321
322 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
323 unsupported_relocal_local to call unsupported_reloc_global.
324
325 2012-08-14 Nick Clifton <nickc@redhat.com>
326
327 PR ld/14265
328 * script-sections.cc (Sections_element::output_section_name): Add
329 keep return parameter.
330 (Output_section_element::match_name): Add keep return parameter.
331 Return the value of the keep_ member.
332 * script-sections.h (class Output_section): Update
333 output_section_name prototype.
334 * layout.cc (Layout::keep_input_section): New public member
335 function.
336 (Layout::choose_output_section): Pass keep parameter to
337 output_section_name.
338 * layout.h (class Layout): Add keep_input_section.
339 * object.cc (Sized_relobj_file::do_layout): Check for kept input
340 sections.
341 * testsuite/Makefile.am: Add a test.
342 * testsuite/Makefile.in: Regenerate.
343 * testsuite/pr14265.c: Source file for the test.
344 * testsuite/pr14265.t: Linker script for the test.
345 * testsuite/pr14265.sh: Shell script for the test.
346
347 2012-08-14 Alan Modra <amodra@gmail.com>
348
349 * target.h (Target::output_section_name): New function.
350 (Target::do_output_section_name): New function.
351 * layout.cc (Layout::choose_output_section): Call the above.
352 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
353
354 2012-08-14 Alan Modra <amodra@gmail.com>
355
356 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
357 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
358 for replace_constant call.
359 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
360 (Output_data_glink::do_print_to_mapfile): New function.
361 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
362 (Target_powerpc::Relocate::relocate): Likewise.
363
364 2012-08-14 Alan Modra <amodra@gmail.com>
365
366 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
367 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
368 (Output_data_glink::add_entry,find_entry): Remove shndx param.
369 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
370 all references to shndx_. Handle special case for R_PPC_PLTREL24
371 here.
372 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
373 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
374 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
375 here.
376 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
377 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
378
379 2012-08-12 Alan Modra <amodra@gmail.com>
380
381 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
382 (glink insn constants): Use uint32_t.
383 (Output_data_glink::add_entry): Use insert, not [] operator.
384
385 2012-08-11 Alan Modra <amodra@gmail.com>
386
387 * object.h (Sized_relobj_file::find_shdr): New function.
388 (Sized_relobj_file::find_special_sections): New function.
389 * object.cc (Sized_relobj_file::find_shdr): New function.
390 (Sized_relobj_file::find_eh_frame): Use find_shdr.
391 (Sized_relobj_file::find_special_sections): New function, split out..
392 (Sized_relobj_file::do_read_symbols): ..from here.
393 * output.h (Output_data_got::replace_constant): New function.
394 (Output_data_got::num_entries): New function.
395 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
396 (Output_data_got::got_offset): Protected rather than private.
397 (Output_data_got::replace_got_entry): New function.
398 * output.cc (Output_data_got::replace_got_entry): New function.
399 * powerpc.cc (class Powerpc_relobj): New.
400 (class Powerpc_relocate_functions): Delete all psymval variants or
401 convert to value,addend type. Delete pcrela, pcrela_unaligned.
402 Implement _ha functions using corresponding _hi function.
403 (Powerpc_relobj::find_special_sections): New function.
404 (Target_powerpc::do_make_elf_object): New function.
405 (class Output_data_got_powerpc): New.
406 (class Output_data_glink): New.
407 (class Powerpc_scan_relocatable_reloc): New.
408 Many more changes througout file.
409
410 2012-08-09 Nick Clifton <nickc@redhat.com>
411
412 * po/vi.po: Updated Vietnamese translation.
413
414 2012-08-07 Ian Lance Taylor <iant@google.com>
415
416 * layout.cc (Layout::add_target_dynamic_tags): If
417 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
418 plt_rel.
419
420 2012-07-30 Nick Clifton <nickc@redhat.com>
421
422 * po/gold.pot: Updated template.
423 * po/es.po: Updated Spanish translation.
424
425 2012-07-18 Cary Coutant <ccoutant@google.com>
426
427 PR gold/14344
428 * configure.ac: Add check for -gpubnames support.
429 * configure: Regenerate.
430 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
431 support; force -gno-pubnames.
432 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
433 support.
434 (gdb_index_test_4): New test.
435 * testsuite/Makefile.in: Regenerate.
436 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
437 * testsuite/gdb_index_test_2.sh: Likewise.
438 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
439 * testsuite/gdb_index_test_4.sh: New script.
440 * testsuite/gdb_index_test_comm.sh: New script with common code;
441 don't look for space after colon.
442
443 2012-07-16 Sriraman Tallam <tmsriram@google.com>
444
445 * gold.cc (queue_middle_tasks): Update function order only after
446 deferred objects due to plugins are processed.
447
448 2012-07-11 Ian Lance Taylor <iant@google.com>
449
450 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
451 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
452 (Target_arm::scan_reloc_for_stub): Likewise.
453 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
454 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
455 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
456 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
457 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
458
459 2012-07-10 Dodji Seketeli <dodji@redhat.com>
460 Ian Lance Taylor <iant@google.com>
461
462 PR gold/14309
463 * configure.ac: Test whether std::tr1::hash<off_t> works.
464 * gold.h: Add a specialization for std::tr1::hash<off_t> if
465 needed.
466 * output.h (class Output_fill): Add virtual destructor.
467 * configure, config.in: Rebuild.
468
469 2012-06-22 Roland McGrath <mcgrathr@google.com>
470
471 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
472
473 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
474
475 * plugin.cc (Plugin::load): Handle position independent executables.
476
477 2012-06-06 Cary Coutant <ccoutant@google.com>
478
479 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
480 add .debug_macro.
481 (lines_only_debug_sections): Likewise.
482 (gdb_fast_lookup_sections): New static array.
483 (is_gdb_debug_section): Rename formal parameter.
484 (is_lines_only_debug_section): Likewise.
485 (is_gdb_fast_lookup_section): New function.
486 (Layout::include_section): Check for ".zdebug_" prefix; pass
487 section name suffix to is_gdb_debug_section, et al.; check for
488 fast-lookup sections when building .gdb_index.
489 * options.h (--strip-debug-gdb): Update GDB version number.
490
491 2012-06-06 Cary Coutant <ccoutant@google.com>
492
493 * configure.ac: Add check for fallocate.
494 * configure: Regenerate.
495 * config.in: Regenerate.
496
497 * options.h (class General_options): Add --mmap-output-file and
498 --posix-fallocate options.
499 * output.cc: (posix_fallocate): Remove; replace with...
500 (gold_fallocate): New function.
501 (Output_file::map_no_anonymous): Call gold_fallocate.
502 (Output_file::map): Check --mmap-output-file option.
503
504 2012-06-05 Jing Yu <jingyu@google.com>
505
506 * gold.h (textdomain): Add do {} to empty while(0).
507 (bindtextdomain): Likewise.
508
509 2012-06-04 Cary Coutant <ccoutant@google.com>
510
511 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
512 has_dynsym_index.
513
514 2012-05-25 Sriraman Tallam <tmsriram@google.com>
515
516 * symtab.cc (Symbol_table::define_special_symbol):
517 Initialize *poldsym to prevent uninitialized variable errors.
518
519 2012-05-23 Cary Coutant <ccoutant@google.com>
520
521 * layout.cc (Layout::section_name_mapping): Add rules to handle
522 exact match on .data.rel.ro.local or .data.rel.ro.
523 (Layout::output_section_name): Check for exact matches.
524
525 2012-05-23 Cary Coutant <ccoutant@google.com>
526
527 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
528 more carefully.
529
530 2012-05-22 Cary Coutant <ccoutant@google.com>
531
532 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
533 object before exporting symbol.
534
535 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
536
537 * testsuite/tls_test.cc: Include "config.h" first.
538 * testsuite/tls_test_c.c: Likewise.
539
540 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
541 Nick Clifton <nickc@redhat.com>
542
543 PR 14072
544 * configure.in: Add check that sysdep.h has been included before
545 any system header files.
546 * configure: Regenerate.
547 * config.in: Regenerate.
548
549 2012-05-14 Cary Coutant <ccoutant@google.com>
550
551 * layout.cc (Layout::make_output_section): Mark .tdata section
552 as RELRO.
553 * testsuite/relro_test.cc: Add a TLS variable.
554
555 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
556
557 PR gold/14091
558 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
559 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
560 R_X86_64_64.
561
562 2012-05-08 Cary Coutant <ccoutant@google.com>
563
564 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
565 (lines_only_debug_sections): Likewise.
566
567 2012-05-02 Roland McGrath <mcgrathr@google.com>
568
569 * nacl.cc: New file.
570 * nacl.h: New file.
571 * Makefile.am (CCFILES, HFILES): Add them.
572 * Makefile.in: Regenerate.
573 * i386.cc (Output_data_plt_i386_nacl): New class.
574 (Output_data_plt_i386_nacl_exec): New class.
575 (Output_data_plt_i386_nacl_dyn): New class.
576 (Target_i386_nacl): New class.
577 (Target_selector_i386_nacl): New class.
578 (target_selector_i386): Use it instead of Target_selector_i386.
579 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
580 (Target_x86_64_nacl): New class.
581 (Target_selector_x86_64_nacl): New class.
582 (target_selector_x86_64, target_selector_x32): Use it instead of
583 Target_selector_x86_64.
584 * arm.cc (Output_data_plt_arm_nacl): New class.
585 (Target_arm_nacl): New class.
586 (Target_selector_arm_nacl): New class.
587 (target_selector_arm, target_selector_armbe): Use it instead of
588 Target_selector_arm.
589
590 * target-select.cc (select_target): Take new Input_file* and off_t
591 arguments, pass them on to recognize method of selector.
592 * object.cc (make_elf_sized_object): Update caller.
593 * parameters.cc (parameters_force_valid_target): Likewise.
594 * incremental.cc (make_sized_incremental_binary): Likewise.
595 * target-select.h: Update decl.
596 (Target_selector::recognize): Take new Input_file* argument,
597 pass it on to do_recognize.
598 (Target_selector::do_recognize): Take new Input_file* argument.
599 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
600 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
601 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
602 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
603
604 * target.h (Target::Target_info): New members isolate_execinstr
605 and rosegment_gap.
606 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
607 * arm.cc (Target_arm::arm_info): Update initializer.
608 * i386.cc (Target_i386::i386_info): Likewise.
609 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
610 * sparc.cc (Target_sparc::sparc_info): Likewise.
611 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
612 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
613 * layout.cc (Layout::attach_allocated_section_to_segment):
614 Take new const Target* argument. If target->isolate_execinstr(), act
615 like --rosegment.
616 (Layout::find_first_load_seg): Take new const Target* argument;
617 if target->isolate_execinstr(), reject PF_X segments.
618 (Layout::relaxation_loop_body): Update caller.
619 (Layout::set_segment_offsets): If target->isolate_execinstr(),
620 reset file offset to zero when we hit LOAD_SEG, and then do a second
621 loop over the segments before LOAD_SEG to reassign offsets after
622 addresses have been determined. Handle target->rosegment_gap().
623 (Layout::attach_section_to_segment): Take new const Target* argument;
624 pass it to attach_allocated_section_to_segment.
625 (Layout::make_output_section): Update caller.
626 (Layout::attach_sections_to_segments): Take new const Target* argument;
627 pass it to attach_section_to_segment.
628 * gold.cc (queue_middle_tasks): Update caller.
629 * layout.h (Layout): Update method decls with new arguments.
630
631 * arm.cc (Target_arm::Target_arm): Take optional argument for the
632 Target_info pointer to use.
633 (Target_arm::do_make_data_plt): New virtual method.
634 (Target_arm::make_data_plt): New method that calls it.
635 (Target_arm::make_plt_entry): Use it.
636 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
637 for the section alignment.
638 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
639 method.
640 (Output_data_plt_arm::first_plt_entry_offset): Call it.
641 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
642 method.
643 (Output_data_plt_arm::get_plt_entry_size): Call it.
644 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
645 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
646 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
647 method.
648 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
649 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
650 method instead of sizeof(plt_entry).
651 (Output_data_plt_arm::add_entry): Likewise.
652 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
653 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
654 than static method.
655 (Target_arm::plt_entry_size): Likewise.
656 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
657 Move to ...
658 (Output_data_plt_arm_standard): ... here, new class.
659 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
660 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
661 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
662
663 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
664 Take additional argument for the PLT entry size.
665 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
666 Use get_plt_entry_size method rather than plt_entry_size variable.
667 (Output_data_plt_x86_64::reserve_slot): Likewise.
668 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
669 (Output_data_plt_x86_64::add_entry): Likewise.
670 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
671 (Output_data_plt_x86_64::address_for_global): Likewise.
672 (Output_data_plt_x86_64::address_for_local): Likewise.
673 (Output_data_plt_x86_64::set_final_data_size): Likewise.
674 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
675 Make method non-static.
676 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
677 method.
678 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
679 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
680 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
681 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
682 virtual method.
683 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
684 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
685 virtual method.
686 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
687 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
688 virtual method.
689 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
690 (Output_data_plt_x86_64::plt_entry_size)
691 (Output_data_plt_x86_64::first_plt_entry)
692 (Output_data_plt_x86_64::plt_entry)
693 (Output_data_plt_x86_64::tlsdesc_plt_entry)
694 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
695 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
696 (Output_data_plt_x86_64_standard): ... here, new class.
697 (Target_x86_64::Target_x86_64): Take optional argument for the
698 Target_info pointer to use.
699 (Target_x86_64::do_make_data_plt): New virtual method.
700 (Target_x86_64::make_data_plt): New method to call it.
701 (Target_x86_64::init_got_plt_for_update): Use that.
702 Call this->plt_->add_eh_frame method here.
703 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
704 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
705 rather than static method.
706 (Target_x86_64::plt_entry_size): Likewise.
707 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
708 rather than plt_entry_size variable. Move guts of PLT filling to...
709 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
710 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
711 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
712
713 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
714 additional argument for the section alignment.
715 Don't do add_eh_frame_for_plt here.
716 (Output_data_plt_i386::first_plt_entry_offset): Make the method
717 non-static. Use get_plt_entry_size method rather than plt_entry_size
718 variable.
719 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
720 method.
721 (Output_data_plt_i386::get_plt_entry_size): Call it.
722 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
723 (Output_data_plt_i386::add_eh_frame): New method to call it.
724 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
725 method.
726 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
727 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
728 method.
729 (Output_data_plt_i386::fill_plt_entry): New method to call it.
730 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
731 method instead of plt_entry_size.
732 (Output_data_plt_i386::plt_entry_size)
733 (Output_data_plt_i386::plt_eh_frame_fde_size)
734 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
735 (Output_data_plt_i386_standard): ... here, new class.
736 (Output_data_plt_i386_exec): New class.
737 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
738 (Output_data_plt_i386_exec::first_plt_entry): ... here.
739 (Output_data_plt_i386::exec_plt_entry): Move to ...
740 (Output_data_plt_i386_exec::plt_entry): ... here.
741 (Output_data_plt_i386_dyn): New class.
742 (Output_data_plt_i386::first_plt_entry): Move to ...
743 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
744 (Output_data_plt_i386::dyn_plt_entry): Move to ...
745 (Output_data_plt_i386_dyn::plt_entry): ... here.
746 (Target_i386::Target_i386): Take optional argument for the Target_info
747 pointer to use.
748 (Target_i386::do_make_data_plt): New virtual method.
749 (Target_i386::make_data_plt): New method to call it.
750 (Target_i386::make_plt_section): Use that.
751 Call this->plt_->add_eh_frame method here.
752 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
753 rather than plt_entry_size variable.
754 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
755 (Output_data_plt_i386::address_for_local): Likewise.
756 (Output_data_plt_i386::do_write): Likewise.
757 Move guts of PLT filling to...
758 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
759 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
760 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
761 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
762
763 2012-05-01 Cary Coutant <ccoutant@google.com>
764
765 * dwarf_reader.cc (Dwarf_die::read_attributes)
766 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
767 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
768 * reduced_debug_output.cc
769 (Output_reduced_debug_info_section::get_die_end): Remove
770 DW_FORM_GNU_ref_index. Add default case.
771
772 2012-04-26 Mark Wielaard <mjw@redhat.com>
773
774 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
775 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
776 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
777 DW_AT_high_pc as offset from DW_AT_low_pc.
778
779 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
780 * testsuite/Makefile.in: Regenerate.
781 * testsuite/gdb_index_test_3.c: New test source file.
782 * testsuite/gdb_index_test_3.sh: New test source file.
783
784 2012-04-25 Ian Lance Taylor <iant@google.com>
785
786 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
787 pointer.
788 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
789 as a class, not a struct.
790 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
791 (Target_arm::apply_cortex_a8_workaround): Likewise.
792 * gc.h: Declare Reloc_types as a struct, not a class.
793 * object.h: Declare Symbols_data as a struct.
794 * reloc.h: Declare Read_relocs_data as a struct.
795 * target.h: Declare Relocate_info as a struct.
796
797 2012-04-24 David S. Miller <davem@davemloft.net>
798
799 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
800 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
801 and R_SPARC_WPLT30.
802
803 2012-04-24 Cary Coutant <ccoutant@google.com>
804
805 * incremental-dump.cc (find_input_containing_global): Replace
806 magic number with symbolic constant.
807 (dump_incremental_inputs): Update version number.
808 * incremental.cc (Output_section_incremental_inputs): Update version
809 number; import symbolic constants from Incremental_inputs_reader.
810 (Incremental_inputs::create_data_sections): Align relocations
811 section correctly for 64-bit targets.
812 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
813 constants; add padding.
814 (Output_section_incremental_inputs::write_header): Add assert for
815 header_size.
816 (Output_section_incremental_inputs::write_input_files): Add assert
817 for input_entry_size.
818 (Output_section_incremental_inputs::write_info_blocks): Add padding;
819 add assert for object_info_size, input_section_entry_size,
820 global_sym_entry_size.
821 * incremental.h (Incremental_inputs_reader): Add symbolic constants
822 for data structure sizes; use them.
823 (Incremental_input_entry_reader): Import symbolic constants from
824 Incremental_inputs_reader; use them.
825
826 2012-04-23 David S. Miller <davem@davemloft.net>
827
828 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
829 and elf_flags_set_.
830 (Target_sparc::Target_sparc): Initialize new fields.
831 (Target_sparc::do_make_elf_object): New function.
832 (Target_sparc::do_adjust_elf_header): New function.
833
834 2012-04-23 Cary Coutant <ccoutant@google.com>
835
836 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
837 CU range table of gdb index.
838
839 2012-04-20 David S. Miller <davem@davemloft.net>
840
841 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
842 instead of false.
843
844 2012-04-16 David S. Miller <davem@davemloft.net>
845
846 * sparc.cc (Target_sparc::got_address): New function.
847 (Sparc_relocate_functions::gdop_hix22): New function.
848 (Sparc_relocate_functions::gdop_lox10): New function.
849 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
850 relocs.
851 (Target_sparc::Scan::local): Likewise if the global symbol is not
852 preemptible and is not IFUNC.
853 (Target_sparc::Relocate::relocate): Perform GOTDATA code
854 transformations for local and non-preemptible non-IFUNC global
855 symbols.
856
857 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
858 writing out 64-bit part of ranges.
859
860 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
861 -fpic and -fpie respectively.
862 * Makefile.in: Regenerate.
863
864 * sparc.cc (class Target_sparc): Add rela_ifunc_.
865 (Target_sparc::Target_sparc): Initialize new field.
866 (Target_sparc::do_plt_section_for_global): New function.
867 (Target_sparc::do_plt_section_for_local): New function.
868 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
869 (Target_sparc::make_plt_section): New function, broken out of
870 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
871 (Target_sparc::make_plt_entry): Call make_plt_section.
872 (Target_sparc::make_local_ifunc_plt_entry): New function.
873 (Target_sparc::rela_ifunc_section): New function.
874 (Target_sparc::plt_section): Remove const.
875 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
876 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
877 and ifunc_count_ fields.
878 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
879 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
880 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
881 (Output_data_plt_sparc::rela_ifunc): New function.
882 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
883 (Output_data_plt_sparc::has_ifunc_section): New function.
884 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
885 (Output_data_plt_sparc::address_for_global): New function.
886 (Output_data_plt_sparc::address_for_local): New function.
887 (Output_data_plt_sparc::plt_index_to_offset): New function.
888 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
889 and entry_count.
890 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
891 entry_count.
892 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
893 R_SPARC_JMP_IREL to switch.
894 (Target_sparc::Scan::check_non_pic): Likewise.
895 (Target_sparc::Scan::local): Handle IFUNC symbols.
896 (Target_sparc::Scan::local): Likewise.
897 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
898 and plt_address_for_local.
899 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
900 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
901
902 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
903 (class Output_data_reloc): Adjust calls to Output_reloc_type.
904 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
905 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
906 global relocs too.
907 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
908 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
909 calls.
910 * sparc.cc (Target_sparc::Scan::global): Likewise.
911 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
912
913 2012-04-16 Cary Coutant <ccoutant@google.com>
914
915 * archive.cc (Library_base::should_include_member): Check for
916 --export-dynamic-symbol.
917 * options.h (class General_options): Add --export-dynamic-symbol.
918 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
919 --export-dynamic-symbol.
920 (Symbol_table::gc_mark_undef_symbols): Likewise.
921 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
922
923 2012-04-12 David S. Miller <davem@davemloft.net>
924
925 * sparc.cc (Reloc::wdisp10): New relocation method.
926 (Reloc::h34): Likewise.
927 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
928 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
929 R_SPARC_WDISP10.
930 (Target_sparc::Scan::local): Likewise.
931 (Target_sparc::Scan::global): Likewise.
932 (Target_sparc::Relocate::relocate): Likewise.
933
934 2012-04-09 Cary Coutant <ccoutant@google.com>
935
936 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
937 low_pc == 0.
938
939 2012-04-06 Ian Lance Taylor <iant@google.com>
940
941 * timer.cc: #include <unistd.h>.
942
943 2012-04-06 Roland McGrath <mcgrathr@google.com>
944
945 * configure.in (AC_CHECK_HEADERS): Add locale.h.
946 * config.in: Regenerate.
947 * configure: Regenerate.
948
949 2012-04-05 Nick Clifton <nickc@redhat.com>
950
951 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
952 (AM_LC_MESSAGES): Add.
953 * aclocal.m4: Regenerate.
954 * config.in: Regenerate.
955 * configure: Regenerate.
956
957 2012-03-21 Cary Coutant <ccoutant@google.com>
958
959 * Makefile.am: Add gdb-index.cc, gdb-index.h.
960 * Makefile.in: Regenerate.
961 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
962 (Sized_elf_reloc_mapper::symbol_section): New function.
963 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
964 (make_elf_reloc_mapper): New function.
965 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
966 (Dwarf_abbrev_table::do_read_abbrevs): New function.
967 (Dwarf_abbrev_table::do_get_abbrev): New function.
968 (Dwarf_ranges_table::read_ranges_table): New function.
969 (Dwarf_ranges_table::read_range_list): New function.
970 (Dwarf_pubnames_table::read_section): New function.
971 (Dwarf_pubnames_table::read_header): New function.
972 (Dwarf_pubnames_table::next_name): New function.
973 (Dwarf_die::Dwarf_die): New function.
974 (Dwarf_die::read_attributes): New function.
975 (Dwarf_die::skip_attributes): New function.
976 (Dwarf_die::set_name): New function.
977 (Dwarf_die::set_linkage_name): New function.
978 (Dwarf_die::attribute): New function.
979 (Dwarf_die::string_attribute): New function.
980 (Dwarf_die::int_attribute): New function.
981 (Dwarf_die::uint_attribute): New function.
982 (Dwarf_die::ref_attribute): New function.
983 (Dwarf_die::child_offset): New function.
984 (Dwarf_die::sibling_offset): New function.
985 (Dwarf_info_reader::check_buffer): New function.
986 (Dwarf_info_reader::parse): New function.
987 (Dwarf_info_reader::do_parse): New function.
988 (Dwarf_info_reader::do_read_string_table): New function.
989 (Dwarf_info_reader::lookup_reloc): New function.
990 (Dwarf_info_reader::get_string): New function.
991 (Dwarf_info_reader::visit_compilation_unit): New function.
992 (Dwarf_info_reader::visit_type_unit): New function.
993 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
994 Sized_elf_reloc_mapper.
995 (Sized_dwarf_line_info::symbol_section): Remove function.
996 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
997 (Sized_dwarf_line_info::read_line_mappings): Remove object
998 parameter, adjust callers.
999 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1000 * dwarf_reader.h: Include <sys/types.h>.
1001 (class Track_relocs): Remove forward declaration.
1002 (class Elf_reloc_mapper): New class.
1003 (class Sized_elf_reloc_mapper): New class.
1004 (class Dwarf_abbrev_table): New class.
1005 (class Dwarf_range_list): New class.
1006 (class Dwarf_ranges_table): New class.
1007 (class Dwarf_pubnames_table): New class.
1008 (class Dwarf_die): New class.
1009 (class Dwarf_info_reader): New class.
1010 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1011 (Sized_dwarf_line_info::symbol_section): Remove member function.
1012 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1013 base class.
1014 * gdb-index.cc: New source file.
1015 * gdb-index.h: New source file.
1016 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1017 and .debug_types sections, call Layout::add_to_gdb_index.
1018 (Sized_relobj_incr::do_section_name): Implement.
1019 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1020 return type; Implement.
1021 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1022 return type.
1023 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1024 parameter list and return type.
1025 (Sized_incr_dynobj::do_section_contents): Likewise.
1026 * layout.cc: Include gdb-index.h.
1027 (Layout::Layout): Initialize gdb_index_data_.
1028 (Layout::init_fixed_output_section): Check for .gdb_index section.
1029 (Layout::add_to_gdb_index): New function. Instantiate.
1030 * layout.h: Add forward declaration for class Gdb_index.
1031 (Layout::add_to_gdb_index): New member function.
1032 (Layout::gdb_index_data_): New data member.
1033 * main.cc: Include gdb-index.h.
1034 (main): Print statistics for gdb index.
1035 * object.cc (Object::section_contents): Move code into
1036 do_section_contents.
1037 (need_decompressed_section): Check for sections needed when building
1038 gdb index.
1039 (build_compressed_section_map): Likewise.
1040 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1041 gdb index.
1042 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1043 sections; call Layout::add_to_gdb_index.
1044 (Sized_relobj_file::do_decompressed_section_contents): Call
1045 do_section_contents directly.
1046 * object.h (Object::do_section_contents): Adjust parameter list and
1047 return type.
1048 (Object::do_decompressed_section_contents): Call do_section_contents
1049 directly.
1050 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1051 return type.
1052 * options.h (class General_options): Add --gdb-index option.
1053 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1054 list and return type.
1055 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1056 * reloc.h (Track_relocs::checkpoint): New function.
1057 (Track_relocs::reset): New function.
1058
1059 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1060 New test cases.
1061 * testsuite/Makefile.in: Regenerate.
1062 * testsuite/gdb_index_test.cc: New test source file.
1063 * testsuite/gdb_index_test_1.sh: New test source file.
1064 * testsuite/gdb_index_test_2.sh: New test source file.
1065
1066 2012-03-19 Doug Kwan <dougkwan@google.com>
1067
1068 * arm.cc (Target_arm::do_define_standard_symbols): New method.
1069 (Target_arm::do_finalize_sections): Remove code which defines
1070 __exidx_start and __exidx_end. Make symbol table parameter
1071 anonymous as it is not used.
1072 * gold.cc (queue_middle_tasks): Call target hook to define any
1073 target-specific symbols.
1074 * target.h (Target::define_standard_symbols): New method.
1075 (Target::do_define_standard_symbols): Same.
1076 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1077 * testsuite/Makefile.in: Regenerate.
1078 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1079 and __exidx_end.
1080 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1081 relocations are generated for __exidx_start and __exidx_end.
1082
1083 2012-03-16 Doug Kwan <dougkwan@google.com>
1084
1085 * testsuite/Makefile.am: Disable test initpri3b.
1086 * testsuite/Makefile.in: Regenerate.
1087
1088 2012-03-15 Doug Kwan <dougkwan@google.com>
1089
1090 * arm.cc (Target_arm::got_section): Make .got section read-only
1091 if -z now is given.
1092
1093 2012-03-15 Ian Lance Taylor <iant@google.com>
1094
1095 PR gold/13850
1096 * layout.cc (Layout::make_output_section): Correctly mark
1097 SHT_INIT_ARRAY, et. al., as relro.
1098
1099 2012-03-14 Doug Kwan <dougkwan@google.com>
1100
1101 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1102 dynamic relocations for protected symbols in shared objects.
1103
1104 2012-03-13 Ian Lance Taylor <iant@google.com>
1105
1106 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1107 keep the larger alignment.
1108
1109 2012-03-12 Cary Coutant <ccoutant@google.com>
1110
1111 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1112 handling of DW_LNE_define_file.
1113
1114 2012-03-12 Cary Coutant <ccoutant@google.com>
1115
1116 * reduced_debug_output.cc
1117 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1118 codes to switch.
1119
1120 2012-02-29 Cary Coutant <ccoutant@google.com>
1121
1122 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1123
1124 2012-02-29 Cary Coutant <ccoutant@google.com>
1125
1126 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1127 Call Object::decompressed_section_contents.
1128 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1129 New dtor.
1130 (Sized_dwarf_line_info::buffer_start_): New data member.
1131 * merge.cc (Output_merge_data::do_add_input_section): Call
1132 Object::decompressed_section_contents.
1133 (Output_merge_string::do_add_input_section): Likewise.
1134 * object.cc (need_decompressed_section): New function.
1135 (build_compressed_section_map): Decompress sections needed later.
1136 (Sized_relobj_file::do_decompressed_section_contents): New function.
1137 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1138 * object.h (Object::decompressed_section_contents): New function.
1139 (Object::discard_decompressed_sections): New function.
1140 (Object::do_decompressed_section_contents): New function.
1141 (Object::do_discard_decompressed_sections): New function.
1142 (Compressed_section_info): New type.
1143 (Compressed_section_map): Include decompressed section contents.
1144 (Sized_relobj_file::do_decompressed_section_contents): New function.
1145 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1146
1147 2012-02-16 Cary Coutant <ccoutant@google.com>
1148
1149 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1150 * testsuite/Makefile.in: Regenerate.
1151
1152 2012-02-14 Cary Coutant <ccoutant@google.com>
1153
1154 * options.cc (General_options::finalize): Disallow -pie and -static.
1155
1156 2012-02-03 Doug Kwan <dougkwan@google.com>
1157
1158 * arm.cc (Arm_relocate_functions::abs8,
1159 Arm_relocate_functions::abs16): Use
1160 Bits::has_signed_unsigned_overflow32.
1161 (Arm_relocate_functions::thm_abs8): Correct range of
1162 overflow check.
1163 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1164 in assertions.
1165
1166 2012-02-02 Doug Kwan <dougkwan@google.com>
1167
1168 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1169 position independent outputs, not just shared objects.
1170
1171 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1172
1173 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1174 * configure: Regenerated.
1175
1176 2012-01-27 Ian Lance Taylor <iant@google.com>
1177
1178 * reloc.h (Bits): New class with static functions, copied from
1179 namespace utils in arm.cc.
1180 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1181 instead.
1182
1183 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1184
1185 * incremental.cc (write_info_blocks): Correct relocation offset.
1186
1187 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1188
1189 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1190 (Relocate::tls_gd_to_le): Likewise.
1191
1192 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1193
1194 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1195
1196 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1197
1198 * configure.ac: Check if -mcmodel=medium works.
1199 * configure: Regenerated.
1200
1201 2012-01-24 Cary Coutant <ccoutant@google.com>
1202
1203 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1204 definition and ...
1205 (read_unsigned_LEB_128_x): ... this new function.
1206 (read_signed_LEB_128): Replaced with inline definition and ...
1207 (read_signed_LEB_128_x): ... this new function.
1208 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1209 (read_unsigned_LEB_128): Add inline definition.
1210 (read_signed_LEB_128_x): New function.
1211 (read_signed_LEB_128): Add inline definition.
1212 * testsuite/Makefile.am (leb128_unittest): New unit test.
1213 * testsuite/Makefile.in: Regenerate.
1214 * testsuite/leb128_unittest.cc: New unit test.
1215
1216 2012-01-23 Ian Lance Taylor <iant@google.com>
1217
1218 PR gold/13617
1219 * i386.cc (Target_i386::do_code_fill): When using a jmp
1220 instruction, pad with nop instructions.
1221 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1222
1223 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1224
1225 * x86_64.cc (gc_process_relocs): Add typename on types used in
1226 template.
1227 (scan_relocs): Likewise.
1228 (relocate_section): Likewise.
1229 (apply_relocation): Likewise.
1230
1231 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1232
1233 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1234 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1235 under x32.
1236
1237 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1238
1239 * x86_64.cc: Initial support for x32.
1240
1241 2012-01-03 Cary Coutant <ccoutant@google.com>
1242
1243 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1244 Use abstract base class for GOT.
1245 * gold/output.h (class Output_data_got_base): New abstract base class.
1246 (class Output_data_got): Derive from new base class, adjust ctors.
1247 (Output_data_got::reserve_slot): Make virtual; rename to
1248 do_reserve_slot; Adjust callers.
1249 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1250 pointer to abstract base class.
1251 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1252
1253 2011-12-18 Ian Lance Taylor <iant@google.com>
1254
1255 * object.h (Relobj::local_symbol_value): New function.
1256 (Relobj::local_plt_offset): New function.
1257 (Relobj::local_has_got_offset): New function.
1258 (Relobj::local_got_offset): New function.
1259 (Relobj::set_local_got_offset): New function.
1260 (Relobj::do_local_symbol_value): New pure virtual function.
1261 (Relobj::do_local_plt_offset): Likewise.
1262 (Relobj::do_local_has_got_offset): Likewise.
1263 (Relobj::do_local_got_offset): Likewise.
1264 (Relobj::do_set_local_got_offset): Likewise.
1265 (Sized_relobj::do_local_has_got_offset): Rename from
1266 local_has_got_offset.
1267 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1268 (Sized_relobj::do_set_local_got_offset): Rename from
1269 set_local_got_offset.
1270 (Sized_relobj_file::do_local_plt_offset): Rename from
1271 local_plt_offset.
1272 (Sized_relobj_file::do_local_symbol_value): New function.
1273 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1274 local_plt_offset.
1275 * output.cc (Output_data_got::Got_entry::write): Change object to
1276 Relobj. Use local_symbol_value.
1277 (Output_data_got::add_global_with_rel): Change rel_dyn to
1278 Output_data_reloc_generic*. Use add_global_generic.
1279 (Output_data_got::add_global_with_rela): Remove. Change all
1280 callers to use add_global_with_rel.
1281 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1282 Output_data_reloc_generic*. Use add_global_generic.
1283 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1284 callers to use add_global_pair_with_rel.
1285 (Output_data_got::add_local): Change object to Relobj*.
1286 (Output_data_got::add_local_plt): Likewise.
1287 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1288 change rel_dyn to Output_data_reloc_generic*. Use
1289 add_local_generic.
1290 (Output_data_got::add_local_with_rela): Remove. Change all
1291 callers to use all_local_with_rel.
1292 (Output_data_got::add_local_pair_with_rel): Change object to
1293 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1294 add_output_section_generic.
1295 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1296 callers to use add_local_pair_with_rel.
1297 (Output_data_got::reserve_local): Change object to Relobj*.
1298 * output.h: (class Output_data_reloc_generic): Add pure virtual
1299 declarations for add_global_generic, add_local_generic,
1300 add_output_section_generic.
1301 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1302 functions for Output_data_reloc_generic. Update declarations for
1303 changes listed in output.cc.
1304 (class Output_data_got): Change template parameter to got_size.
1305 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1306 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1307 function.
1308 (Sized_relobj_incr::do_local_plt_offset): New function.
1309 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1310 add_global_generic.
1311
1312 2011-12-17 Cary Coutant <ccoutant@google.com>
1313
1314 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1315 * resolve.cc (Symbol_table::resolve): Likewise.
1316 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1317 arrays.
1318 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1319
1320 2011-12-16 Ian Lance Taylor <iant@google.com>
1321
1322 * output.h (Output_data_reloc_generic::add): Only call
1323 add_dynamic_reloc if this is a dynamic reloc section.
1324
1325 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1326
1327 PR gold/13505
1328 * target-reloc.h (apply_relocation): Replace <64, false> with
1329 <size, big_endian>.
1330
1331 2011-11-25 Nick Clifton <nickc@redhat.com>
1332
1333 * po/it.po: New Italian translation.
1334
1335 2011-11-17 Sterling Augustine <saugustine@google.com>
1336
1337 * script.cc (script_include_directive): Implement.
1338 (read_script_file): New local variables name and search_path. Update
1339 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1340 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1341 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1342
1343 2011-11-11 Sterling Augustine <saugustine@google.com>
1344
1345 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1346 (file_or_sections_cmd): Likewise.
1347
1348 2011-11-11 Doug Kwan <dougkwan@google.com>
1349
1350 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1351 if --just-symbols is given.
1352
1353 2011-11-10 Doug Kwan <dougkwan@google.com>
1354
1355 PR gold/13362
1356 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1357 when processing data relocs.
1358 * reloc.h (Relocate_functions::rel_unaligned): New method.
1359 (Relocate_functions::pcrel_unaligned): Ditto.
1360 (Relocate_functions::rel32_unaligned): Ditto.
1361 (Relocate_functions::pcrel32_unaligned): Ditto.
1362
1363 2011-11-09 Doug Kwan <dougkwan@google.com>
1364
1365 PR gold/13362
1366 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1367 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1368 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1369 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1370 (Relocate_functions::rel_unaligned): New.
1371 (Relocate_functions::rel32_unaligned): New.
1372 * target-reloc.h (relocate_for_relocatable): Add code to handle
1373 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1374 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1375 arm_unaligned_reloc_r): New targets.
1376 * testsuite/Makefile.in: Regenerate.
1377 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1378 linking.
1379
1380 2011-11-02 Ian Lance Taylor <iant@google.com>
1381
1382 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1383 NATIVE_LINKER.
1384 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1385 * options.cc (General_options::finalize): Use library search path
1386 from configure script if specified. If not native and no sysroot,
1387 only search TOOLLIBDIR.
1388 * options.h (Search_directory::Search_directory): Change name to
1389 const std::string&.
1390 (General_options::add_to_library_path_with_sysroot): Change arg to
1391 const std::string&.
1392 * configure, Makefile.in, config.in: Rebuild.
1393
1394 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1395
1396 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1397 we are working around the ARM1176 Erratum.
1398 * options.h (General_options::fix_arm1176): Add option.
1399 * testsuite/Makefile.am: Add testcases, and keep current ones
1400 working.
1401 * testsuite/Makefile.in: Regenerate.
1402 * testsuite/arm_fix_1176.s: New file.
1403 * testsuite/arm_fix_1176.sh: Likewise.
1404
1405 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1406
1407 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1408 may_use_blx_.
1409 (Target_arm::may_use_blx): Remove method.
1410 (Target_arm::set_may_use_blx): Likewise.
1411 (Target_arm::may_use_v4t_interworking): New method.
1412 (Target_arm::may_use_v5t_interworking): Likewise.
1413 (Target_arm::may_use_blx_): Remove member variable.
1414 (Arm_relocate_functions::arm_branch_common): Check for v5T
1415 interworking.
1416 (Arm_relocate_functions::thumb_branch_common): Likewise.
1417 (Reloc_stub::stub_type_for_reloc): Likewise.
1418 (Target_arm::do_finalize_sections): Correct interworking checks.
1419 * testsuite/Makefile.am: Add new tests.
1420 * testsuite/Makefile.in: Regenerate.
1421 * testsuite/arm_farcall_arm_arm.s: New test.
1422 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1423 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1424 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1425 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1426 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1427 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1428 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1429
1430 2011-10-31 Cary Coutant <ccoutant@google.com>
1431
1432 PR gold/13023
1433 * expression.cc (Expression::eval_with_dot): Add
1434 is_section_dot_assignment parameter.
1435 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1436 absolute and assigning to dot within a section.
1437 * script-sections.cc
1438 (Output_section_element_assignment::set_section_addresses): Pass
1439 dot_section to set_if_absolute.
1440 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1441 as is_section_dot_assignment flag to eval_with_dot.
1442 (Output_section_element_dot_assignment::set_section_addresses):
1443 Likewise.
1444 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1445 parameter. Also set value if relative to dot_section; set the
1446 symbol's output_section.
1447 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1448 parameter. Adjust all callers.
1449 (Expression::eval_maybe_dot): Likewise.
1450 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1451 Adjust all callers.
1452 * testsuite/script_test_2.t: Test assignment of an absolute value
1453 to dot within an output section element.
1454
1455 2011-10-31 Cary Coutant <ccoutant@google.com>
1456
1457 * options.h (class General_options): Add --[no-]gnu-unique options.
1458 * symtab.cc (Symbol_table::sized_write_globals): Convert
1459 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1460
1461 2011-10-31 Cary Coutant <ccoutant@google.com>
1462
1463 PR gold/13359
1464 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1465 unnecessary assertion.
1466 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1467
1468 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1469
1470 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1471 gc_mark_symbol.
1472 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1473 gc_mark_symbol.
1474 Change to just keep the section associated with symbol.
1475 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1476 they are externally visible and --export-dynamic is turned on.
1477 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1478
1479 2011-10-19 Ian Lance Taylor <iant@google.com>
1480
1481 PR gold/13163
1482 * script-sections.cc
1483 (Output_section_element_dot_assignment::needs_output_section): New
1484 function.
1485
1486 2011-10-19 Ian Lance Taylor <iant@google.com>
1487
1488 PR gold/13204
1489 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1490 --section-start option was seen.
1491 * options.h (General_options::any_section_start): New function.
1492
1493 2011-10-18 David S. Miller <davem@davemloft.net>
1494
1495 PR binutils/13301
1496 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1497 member to track relocation locations that have moved during TLS
1498 reloc optimizations.
1499 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1500 (Target_sparc::Relocate::relocate): Adjust view down by 4
1501 bytes if it matches reloc_adjust_addr_.
1502 (Target_sparc::Relocate::relocate_tls): Always move the
1503 __tls_get_addr call delay slot instruction forward 4 bytes when
1504 performing relaxation.
1505
1506 2011-10-18 Cary Coutant <ccoutant@google.com>
1507
1508 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1509 (Output_file::map_no_anonymous): Check for non-zero
1510 return code from posix_fallocate.
1511
1512 2011-10-17 Cary Coutant <ccoutant@google.com>
1513
1514 PR gold/13245
1515 * plugin.cc (is_visible_from_outside): Check for symbols
1516 referenced from dynamic objects.
1517 * resolve.cc (Symbol_table::resolve): Don't count references
1518 from dynamic objects as references from real ELF files.
1519 * testsuite/plugin_test_2.sh: Adjust expected result.
1520
1521 2011-10-17 Cary Coutant <ccoutant@google.com>
1522
1523 * gold.cc: Include timer.h.
1524 (queue_middle_tasks): Stamp time.
1525 (queue_final_tasks): Likewise.
1526 * main.cc (main): Store timer in parameters. Print timers
1527 for each pass.
1528 * parameters.cc (Parameters::Parameters): Initialize timer_.
1529 (Parameters::set_timer): New function.
1530 (set_parameters_timer): New function.
1531 * parameters.h (Parameters::set_timer): New function.
1532 (Parameters::timer): New function.
1533 (Parameters::timer_): New data member.
1534 (set_parameters_timer): New function.
1535 * timer.cc (Timer::stamp): New function.
1536 (Timer::get_pass_time): New function.
1537 * timer.h (Timer::stamp): New function.
1538 (Timer::get_pass_time): New function.
1539 (Timer::pass_times_): New data member.
1540
1541 2011-10-17 Cary Coutant <ccoutant@google.com>
1542
1543 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1544 task for members of lib groups.
1545
1546 2011-10-17 Cary Coutant <ccoutant@google.com>
1547
1548 PR gold/13288
1549 * fileread.cc (File_read::find_view): Add assert.
1550 (File_read::make_view): Move bounds check (replace with assert)...
1551 (File_read::find_or_make_view): ... to here.
1552
1553 2011-10-12 Cary Coutant <ccoutant@google.com>
1554
1555 * output.cc (Output_file::open_base_file): Handle case where
1556 ::read returns less than requested size.
1557
1558 2011-10-10 Cary Coutant <ccoutant@google.com>
1559
1560 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1561 Initialize defined_count_.
1562 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1563 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1564 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1565 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1566 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1567 * incremental.h (Sized_relobj_incr::defined_count_): New data
1568 member.
1569 (Sized_incr_dynobj::defined_count_): New data member.
1570 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1571 Return zeroes instead of internal error.
1572
1573 2011-10-10 Cary Coutant <ccoutant@google.com>
1574
1575 PR gold/13249
1576 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1577 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1578 * output.h (class Output_reloc): Add use_plt_offset flag.
1579 (Output_reloc::type_): Adjust size of bit field.
1580 (Output_reloc::use_plt_offset_): New bit field.
1581 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1582 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1583 flag. Adjust all callers.
1584 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1585 creating RELATIVE relocations.
1586
1587 2011-10-10 Nick Clifton <nickc@redhat.com>
1588
1589 * po/es.po: Updated Spanish translation.
1590 * po/fi.po: Updated Finnish translation.
1591
1592 2011-10-03 Diego Novillo <dnovillo@google.com>
1593
1594 * options.cc (parse_uint): Fix dereference of RETVAL.
1595
1596 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1597
1598 * layout.h (section_order_map_): New member.
1599 (get_section_order_map): New member function.
1600 * output.cc (Output_section::add_input_section): Check for patterns
1601 only when --section-ordering-file is specified.
1602 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1603 output_sections have been formed.
1604 * layout.cc (Layout_Layout): Initialize section_order_map_.
1605 * plugin.cc (update_section_order): Store order in order_map. Do not
1606 update the order.
1607 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1608 * testsuite/Makefile.in: Regenerate.
1609 * testsuite/plugin_section_order.c: New file.
1610 * testsuite/plugin_final_layout.cc: New file.
1611 * testsuite/plugin_final_layout.sh: New file.
1612
1613 2011-09-29 Cary Coutant <ccoutant@google.com>
1614
1615 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1616 Check for NULL.
1617 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1618 symbols during incremental update.
1619 (Symbol_table::add_from_dynobj): Likewise.
1620
1621 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1622 Ian Lance Taylor <iant@google.com>
1623
1624 * symtab.cc (Symbol_table::define_special_symbol): Always
1625 canonicalize version string.
1626
1627 2011-09-26 Cary Coutant <ccoutant@google.com>
1628
1629 * gold.cc (queue_initial_tasks): Move option checks ...
1630 * options.cc (General_options::finalize): ... to here. Disable
1631 some options; make others fatal.
1632
1633 2011-09-26 Cary Coutant <ccoutant@google.com>
1634
1635 gcc PR lto/47247
1636 * plugin.cc (get_symbols_v2): New function.
1637 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1638 (is_referenced_from_outside): New function.
1639 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1640 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1641 (get_symbols): Pass version parameter.
1642 (get_symbols_v2): New function.
1643 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1644 parameter.
1645 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1646 (onload): Add LDPT_GET_SYMBOLS_V2.
1647 (all_symbols_read_hook): Use get_symbols_v2; check for
1648 LDPR_PREVAILING_DEF_IRONLY_EXP.
1649 * testsuite/plugin_test_3.sh: Update expected results.
1650
1651 2011-09-23 Simon Baldwin <simonb@google.com>
1652
1653 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1654 configuration options.
1655 * configure: Regenerate.
1656 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1657 * Makefile.in: Regenerate.
1658 * testsuite/Makefile.in: Regenerate.
1659
1660 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1661
1662 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1663
1664 2011-09-19 Cary Coutant <ccoutant@google.com>
1665
1666 * incremental.cc (can_incremental_update): Fix typo in comment.
1667 * incremental.h (can_incremental_update): Likewise.
1668
1669 2011-09-18 Cary Coutant <ccoutant@google.com>
1670
1671 * incremental.cc (can_incremental_update): New function.
1672 * incremental.h (can_incremental_update): New function.
1673 * layout.cc (Layout::init_fixed_output_section): Call it.
1674 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1675 * object.cc (Sized_relobj_file::do_layout): Call
1676 can_incremental_update.
1677
1678 2011-09-13 Cary Coutant <ccoutant@google.com>
1679
1680 * configure.ac: Check for glibc support for gnu_indirect_function
1681 support with static linking, setting automake conditional
1682 IFUNC_STATIC.
1683 * Makefile.in: Regenerate.
1684 * configure: Regenerate.
1685
1686 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1687 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1688 for IFUNC_STATIC.
1689 * testsuite/Makefile.in: Regenerate.
1690
1691 2011-09-13 Cary Coutant <ccoutant@google.com>
1692
1693 * incremental.cc (Sized_relobj_incr::do_layout): Call
1694 report_comdat_group for kept comdat sections.
1695 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1696 * testsuite/Makefile.in: Regenerate.
1697 * testsuite/incr_comdat_test_1.cc: New source file.
1698 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1699 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1700 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1701
1702 2011-09-13 Ian Lance Taylor <iant@google.com>
1703
1704 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1705 variable external_symbols_offset.
1706
1707 2011-09-12 Ian Lance Taylor <iant@google.com>
1708
1709 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1710 triggered if object has no symbols.
1711
1712 2011-09-09 David S. Miller <davem@davemloft.net>
1713
1714 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1715 (Output_fill_debug_line::do_write): Likewise.
1716
1717 2011-08-29 Cary Coutant <ccoutant@google.com>
1718
1719 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1720 casts to match formatting specs.
1721 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1722
1723 2011-08-26 Cary Coutant <ccoutant@google.com>
1724
1725 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1726 remaining hole size when allocating.
1727 (Layout::make_output_section): Set fill methods for debug sections.
1728 * layout.h (Free_list::Free_list_node): Move from private to
1729 public.
1730 (Free_list::set_min_hole_size): New function.
1731 (Free_list::begin, Free_list::end): New functions.
1732 (Free_list::min_hole_): New data member.
1733 * output.cc: Include dwarf.h.
1734 (Output_fill_debug_info::do_minimum_hole_size): New function.
1735 (Output_fill_debug_info::do_write): New function.
1736 (Output_fill_debug_line::do_minimum_hole_size): New function.
1737 (Output_fill_debug_line::do_write): New function.
1738 (Output_section::Output_section): Initialize new data member.
1739 (Output_section::set_final_data_size): Ensure patch space is larger
1740 than minimum hole size.
1741 (Output_section::do_write): Fill holes in debug sections.
1742 * output.h (Output_fill): New class.
1743 (Output_fill_debug_info): New class.
1744 (Output_fill_debug_line): New class.
1745 (Output_section::set_free_space_fill): New function.
1746 (Output_section::free_space_fill_): New data member.
1747 * testsuite/Makefile.am (incremental_test_3): Add
1748 --incremental-patch option.
1749 (incremental_test_4): Likewise.
1750 (incremental_test_5): Likewise.
1751 (incremental_test_6): Likewise.
1752 (incremental_copy_test): Likewise.
1753 (incremental_common_test_1): Likewise.
1754 * testsuite/Makefile.in: Regenerate.
1755
1756 2011-08-26 Nick Clifton <nickc@redhat.com>
1757
1758 * po/es.po: Updated Spanish translation.
1759
1760 2011-08-01 Cary Coutant <ccoutant@google.com>
1761
1762 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1763 * gold/testsuite/Makefile.in: Regenerate.
1764 * gold/testsuite/justsyms_exec.c: New source file.
1765 * gold/testsuite/justsyms_lib.c: New source file.
1766
1767 2011-08-01 Cary Coutant <ccoutant@google.com>
1768
1769 * layout.cc (Layout::set_segment_offsets): Don't realign text
1770 segment if -Ttext was specified.
1771 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1772 file type.
1773 * object.h (Sized_relobj_file::e_type): New function.
1774 (Sized_relobj_file::e_type_): New data member.
1775 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1776 base address for ET_EXEC files.
1777 * target.cc (Target::do_make_elf_object_implementation): Allow
1778 ET_EXEC files with --just-symbols option.
1779
1780 2011-07-28 Cary Coutant <ccoutant@google.com>
1781
1782 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1783 Add thread_number parameter.
1784 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1785 * workqueue-threads.cc
1786 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1787 current thread if its thread number is greater than desired thread
1788 count.
1789 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1790 Add thread_number parameter.
1791 (Workqueue::should_cancel_thread): Likewise.
1792 (Workqueue::find_runnable_or_wait): Pass thread_number to
1793 should_cancel_thread.
1794 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1795 parameter.
1796
1797 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1798
1799 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1800 only after checking if it cannot be forced local.
1801 * symtab.h (is_externally_visible): Check if the symbol is not forced
1802 local.
1803
1804 2011-07-15 Ian Lance Taylor <iant@google.com>
1805
1806 * options.h (class General_options): Add --print-output-format.
1807 Move -EL next to -EB, for better --help output.
1808 * target-select.cc: Include <cstdio>, "options.h", and
1809 "parameters.h".
1810 (Target_selector::do_target_bfd_name): New function.
1811 (print_output_format): New function.
1812 * target-select.h (class Target_selector): Update declarations.
1813 (Target_selector::target_bfd_name): New function.
1814 (print_output_format): Declare.
1815 * main.cc: Include "target-select.h".
1816 (main): Handle --print-output-format.
1817 * gold.cc: Include "target-select.h".
1818 (queue_initial_tasks): Handle --print-output-format when there are
1819 no input files.
1820 * parameters.cc (parameters_force_valid_target): Give a better
1821 error message if -EB/-EL does not match target.
1822 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1823 function.
1824
1825 2011-07-15 Ian Lance Taylor <iant@google.com>
1826
1827 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1828 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1829 (Output_data_plt_i386::do_write): Write address of .dynamic
1830 section to first entry in .got.plt section.
1831 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1832 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1833 Initialize layout_.
1834 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1835 section to first entry in .got.plt section.
1836 * layout.h (Layout::dynamic_section): New function.
1837
1838 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1839
1840 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1841 to claim_file call.
1842 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1843 input_section_position_, and input_section_glob_.
1844 (read_layout_from_file): Call function section_ordering_specified.
1845 * layout.h (is_section_ordering_specified): New function.
1846 (section_ordering_specified): New function.
1847 (section_ordering_specified_): New boolean member.
1848 * main.cc(main): Call load_plugins after layout object is defined.
1849 * output.cc (Output_section::add_input_section): Use
1850 function section_ordering_specified to check if section ordering is
1851 needed.
1852 * output.cc (Output_section::add_relaxed_input_section): Use
1853 function section_ordering_specified to check if section ordering is
1854 needed.
1855 (Output_section::update_section_layout): New function.
1856 (Output_section::sort_attached_input_sections): Check if input section
1857 must be reordered.
1858 * output.h (Output_section::update_section_layout): New function.
1859 * plugin.cc (get_section_count): New function.
1860 (get_section_type): New function.
1861 (get_section_name): New function.
1862 (get_section_contents): New function.
1863 (update_section_order): New function.
1864 (allow_section_ordering): New function.
1865 (Plugin::load): Add the new interfaces to the transfer vector.
1866 (Plugin_manager::load_plugins): New parameter.
1867 (Plugin_manager::all_symbols_read): New parameter.
1868 (Plugin_manager::claim_file): New parameter. Save the elf object for
1869 unclaimed objects.
1870 (Plugin_manager::get_elf_object): New function.
1871 (Plugin_manager::get_view): Change to directly use the bool to check
1872 if get_view is called from claim_file_hook.
1873 * plugin.h (input_objects): New function
1874 (Plugin__manager::load_plugins): New parameter.
1875 (Plugin_manager::claim_file): New parameter.
1876 (Plugin_manager::get_elf_object): New function.
1877 (Plugin_manager::in_claim_file_handler): New function.
1878 (Plugin_manager::in_claim_file_handler_): New member.
1879 (layout): New function.
1880 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1881 handler with an extra parameter. Make the elf object before calling
1882 claim_file handler.
1883 * testsuite/plugin_test.c (get_section_count): New function pointer.
1884 (get_section_type): New function pointer.
1885 (get_section_name): New function pointer.
1886 (get_section_contents): New function pointer.
1887 (update_section_order): New function pointer.
1888 (allow_section_ordering): New function pointer.
1889 (onload): Check if the new interfaces exist.
1890
1891 2011-07-13 Ian Lance Taylor <iant@google.com>
1892
1893 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1894 relro section.
1895 * x86_64.cc (Target_x86_64::got_section): Likewise.
1896 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1897 (relro_now_test_SOURCES): New variable.
1898 (relro_now_test_DEPENDENCIES): New variable.
1899 (relro_now_test_LDFLAGS): New variable.
1900 (relro_now_test_LDADD): New variable.
1901 (relro_now_test.so): New target.
1902 * testsuite/Makefile.in: Rebuild.
1903
1904 2011-07-12 Ian Lance Taylor <iant@google.com>
1905
1906 PR gold/12980
1907 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1908 GLOB_DAT relocation rather than a RELATIVE relocation for a
1909 protected symbol when creating a shared library.
1910 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1911 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1912 * testsuite/protected_main_1.cc (main): Test that protected
1913 function has same address.
1914
1915 2011-07-11 Ian Lance Taylor <iant@google.com>
1916
1917 PR gold/12979
1918 * options.h (class General_options): Add -Bgroup.
1919 * options.cc (General_options::finalize): If -Bgroup is set,
1920 default to --unresolved-symbols=report-all.
1921 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1922 * target-reloc.h (issue_undefined_symbol_error): Handle
1923 --unresolved-symbols=report-all.
1924
1925 2011-07-08 Ian Lance Taylor <iant@google.com>
1926
1927 PR gold/11985
1928 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1929 if linker script discards key sections.
1930 (Layout::create_dynamic_symtab): Likewise.
1931 (Layout::assign_local_dynsym_offsets): Likewise.
1932 (Layout::sized_create_version_sections): Likewise.
1933 (Layout::create_interp): Likewise.
1934 (Layout::finish_dynamic_section): Likewise.
1935 (Layout::set_dynamic_symbol_size): Likewise.
1936
1937 2011-07-08 Ian Lance Taylor <iant@google.com>
1938
1939 PR gold/12386
1940 * options.h (class General_options): Add --unresolved-symbols.
1941 * target-reloc.h (issue_undefined_symbol_error): Check
1942 --unresolved-symbols. Add comments.
1943
1944 2011-07-08 Ian Lance Taylor <iant@google.com>
1945
1946 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1947 expression more complex.
1948
1949 2011-07-08 Ian Lance Taylor <iant@google.com>
1950
1951 PR gold/11317
1952 * target-reloc.h (issue_undefined_symbol_error): New inline
1953 function, broken out of relocate_section.
1954 (relocate_section): Call issue_undefined_symbol_error.
1955 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1956 there is no TLS segment if we are about to issue an undefined
1957 symbol error.
1958 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1959
1960 2011-07-08 Ian Lance Taylor <iant@google.com>
1961
1962 PR gold/12279
1963 * resolve.cc (Symbol_table::should_override): Add fromtype
1964 parameter. Change all callers. Give error when linking together
1965 TLS and non-TLS symbol.
1966 (Symbol_table::should_override_with_special): Add fromtype
1967 parameter. Change all callers.
1968 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1969 there is no TLS segment if we have reported some errors.
1970 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1971
1972 2011-07-08 Ian Lance Taylor <iant@google.com>
1973
1974 PR gold/12372
1975 * target.h (Target::plt_address_for_global): New function.
1976 (Target::plt_address_for_local): New function.
1977 (Target::plt_section_for_global): Remove.
1978 (Target::plt_section_for_local): Remove.
1979 (Target::do_plt_address_for_global): New virtual function.
1980 (Target::do_plt_address_for_local): New virtual function.
1981 (Target::do_plt_section_for_global): Remove.
1982 (Target::do_plt_section_for_local): Remove.
1983 (Target::register_global_plt_entry): Add Symbol_table and Layout
1984 parameters.
1985 * output.cc (Output_data_got::Got_entry::write): Use
1986 plt_address_for_global and plt_address_for_local.
1987 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1988 address of output section.
1989 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1990 got_irelative_, and irelative_count_ fields. Update
1991 declarations.
1992 (Output_data_plt_i386::has_irelative_section): New function.
1993 (Output_data_plt_i386::entry_count): Add irelative_count_.
1994 (Output_data_plt_i386::set_final_data_size): Likewise.
1995 (class Target_i386): Add got_irelative_ and rel_irelative_
1996 fields. Update declarations.
1997 (Target_i386::Target_i386): Initialize new fields.
1998 (Target_i386::do_plt_address_for_global): New function replacing
1999 do_plt_section_for_global.
2000 (Target_i386::do_plt_address_for_local): New function replacing
2001 do_plt_section_for_local.
2002 (Target_i386::got_section): Create got_irelative_.
2003 (Target_i386::rel_irelative_section): New function.
2004 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2005 fields. Don't define __rel_iplt_{start,end}.
2006 (Output_data_plt_i386::add_entry): Add symtab and layout
2007 parameters. Change all callers. Use different PLT and GOT for
2008 IFUNC symbols.
2009 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2010 layout parameters. Change all callers. Use different PLT and
2011 GOT.
2012 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2013 (Output_data_plt_i386::rel_irelative): New function.
2014 (Output_data_plt_i386::address_for_global): New function.
2015 (Output_data_plt_i386::address_for_local): New function.
2016 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2017 IRELATIVE GOT when changing IFUNC GOT entries.
2018 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2019 reloc.
2020 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2021 if we didn't create an IRELATIVE GOT.
2022 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2023 plt_address_for_local.
2024 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2025 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2026 got_irelative_, and irelative_count_ fields. Update
2027 declarations.
2028 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2029 Initialize new fields. Remove symtab parameter. Change all
2030 callers.
2031 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2032 irelative_count_.
2033 (Output_data_plt_x86_64::has_irelative_section): New function.
2034 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2035 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2036 fields. Update declarations.
2037 (Target_x86_64::Target_x86_64): Initialize new fields.
2038 (Target_x86_64::do_plt_address_for_global): New function replacing
2039 do_plt_section_for_global.
2040 (Target_x86_64::do_plt_address_for_local): New function replacing
2041 do_plt_section_for_local.
2042 (Target_x86_64::got_section): Create got_irelative_.
2043 (Target_x86_64::rela_irelative_section): New function.
2044 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2045 all callers. Don't create __rel_iplt_{start,end}.
2046 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2047 parameters. Change all callers. Use different PLT and GOT for
2048 IFUNC symbols.
2049 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2050 layout parameters. Change all callers. Use different PLT and
2051 GOT.
2052 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2053 parameters. Change all callers. Use different PLT and GOT for
2054 IFUNC symbols.
2055 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2056 (Output_data_plt_x86_64::rela_irelative): New function.
2057 (Output_data_plt_x86_64::address_for_global): New function.
2058 (Output_data_plt_x86_64::address_for_local): New function.
2059 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2060 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2061 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2062 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2063 parameters.
2064 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2065 reloc.
2066 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2067 symbols if we didn't create an IRELATIVE GOT.
2068 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2069 plt_address_for_local.
2070 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2071 * testsuite/ifuncvar1.c: New test file.
2072 * testsuite/ifuncvar2.c: New test file.
2073 * testsuite/ifuncvar3.c: New test file.
2074 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2075 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2076 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2077 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2078 * testsuite/Makefile.in: Rebuild.
2079
2080 2011-07-07 Cary Coutant <ccoutant@google.com>
2081
2082 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2083 (two_file_test_1_ndebug.o): Likewise.
2084 (two_file_test_1b_ndebug.o): Likewise.
2085 (two_file_test_2_ndebug.o): Likewise.
2086 (two_file_test_main_ndebug.o): Likewise.
2087 (incremental_test_2): Link with no-debug versions.
2088
2089 2011-07-06 Cary Coutant <ccoutant@google.com>
2090
2091 * gold/incremental.cc
2092 (Output_section_incremental_inputs::write_info_blocks): Check for
2093 hidden and internal symbols.
2094
2095 2011-07-06 Cary Coutant <ccoutant@google.com>
2096
2097 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2098 Check disposition for startup file.
2099 (Incremental_inputs::report_command_line): Ignore
2100 --incremental-startup-unchanged option.
2101 * options.cc (General_options::parse_incremental_startup_unchanged):
2102 New function.
2103 (General_options::General_options): Initialize new data member.
2104 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2105 (General_options): Add --incremental-startup-unchanged option.
2106 (General_options::incremental_startup_disposition): New function.
2107 (General_options::incremental_startup_disposition_): New data member.
2108
2109 2011-07-06 Cary Coutant <ccoutant@google.com>
2110
2111 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2112 input file index to Script_info ctor.
2113 (Sized_incremental_binary::do_file_has_changed): Find the
2114 command-line argument for files named in scripts.
2115 * incremental.h (Script_info::Script_info): New ctor
2116 with input file index.
2117 (Script_info::input_file_index): New function.
2118 (Script_info::input_file_index_): New data member.
2119 (Incremental_binary::get_library): Add const.
2120 (Incremental_binary::get_script_info): Add const.
2121 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2122 * testsuite/Makefile.am (incremental_test_5): New test case.
2123 (incremental_test_6): New test case.
2124 * testsuite/Makefile.in: Regenerate.
2125
2126 2011-07-06 Cary Coutant <ccoutant@google.com>
2127
2128 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2129 debug output when command lines differ.
2130
2131 2011-07-06 Cary Coutant <ccoutant@google.com>
2132
2133 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2134 --incremental-patch option.
2135 * layout.cc (Free_list::allocate): Extend allocation beyond original
2136 end if enabled.
2137 (Layout::make_output_section): Mark sections that should get
2138 patch space.
2139 * options.cc (parse_percent): New function.
2140 * options.h (parse_percent): New function.
2141 (DEFINE_percent): New macro.
2142 (General_options): Add --incremental-patch option.
2143 * output.cc (Output_section::Output_section): Initialize new data
2144 members.
2145 (Output_section::add_input_section): Print section name when out
2146 of patch space.
2147 (Output_section::add_output_section_data): Likewise.
2148 (Output_section::set_final_data_size): Add patch space when
2149 doing --incremental-full.
2150 (Output_section::do_reset_address_and_file_offset): Remove patch
2151 space.
2152 (Output_segment::set_section_list_addresses): Print debug output
2153 only if --incremental-update.
2154 * output.h (Output_section::set_is_patch_space_allowed): New function.
2155 (Output_section::is_patch_space_allowed_): New data member.
2156 (Output_section::patch_space_): New data member.
2157 * parameters.cc (Parameters::incremental_full): New function.
2158 * parameters.h (Parameters::incremental_full): New function
2159 * testsuite/Makefile.am (incremental_test_2): Add test for
2160 --incremental-patch option.
2161 * testsuite/Makefile.in: Regenerate.
2162 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2163 (t18): Remove function body.
2164
2165 2011-07-05 Doug Kwan <dougkwan@google.com>
2166
2167 PR gold/12771
2168 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2169 Arm_Address type for relocation result.
2170 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2171 overflow check.
2172 (Arm_relocate_functions::abs32): Use unaligned access.
2173 (Arm_relocate_functions::rel32): Ditto.
2174 (Arm_relocate_functions::prel31): Ditto.
2175 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2176 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2177 static data relocations.
2178 * testsuite/Makefile.in: Regnerate.
2179 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2180
2181 2011-07-05 Ian Lance Taylor <iant@google.com>
2182
2183 PR gold/12392
2184 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2185 symbols if necessary.
2186 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2187
2188 2011-07-05 Ian Lance Taylor <iant@google.com>
2189
2190 PR gold/12952
2191 * resolve.cc (Symbol::override_base_with_special): Simply override
2192 version with special symbol version, ignoring previous version.
2193
2194 2011-07-05 Ian Lance Taylor <iant@google.com>
2195
2196 * object.cc (Sized_relobj_file::include_section_group): Add
2197 information to comment about signature location.
2198
2199 2011-07-02 Ian Lance Taylor <iant@google.com>
2200
2201 PR gold/12957
2202 * options.h (class General_options): Add -f and -F.
2203 * options.cc (General_options::finalize): Fatal error if -f/-F
2204 are used without -shared.
2205 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2206
2207 2011-07-02 Ian Lance Taylor <iant@google.com>
2208
2209 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2210
2211 2011-07-01 Ian Lance Taylor <iant@google.com>
2212
2213 PR gold/12525
2214 PR gold/12952
2215 * resolve.cc (Symbol::override_base_with_special): Don't override
2216 the version if the overriding symbol has a different name.
2217 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2218 all callers. If we give an error about an undefined version,
2219 define the base version if necessary.
2220 * dynobj.h (class Versions): Update declaration.
2221 * testsuite/weak_alias_test_5.cc: New file.
2222 * testsuite/weak_alias_test.script: New file.
2223 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2224 and versioned_alias have the right value, and call t2.
2225 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2226 weak_alias_test_5.so.
2227 (weak_alias_test_LDADD): Likewise.
2228 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2229 * testsuite/Makefile.in: Rebuild.
2230
2231 2011-07-01 Ian Lance Taylor <iant@google.com>
2232
2233 PR gold/12525
2234 * options.h (class General_options): Support -z notext.
2235 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2236 -Wl,-z,notext.
2237 (two_file_shared_nonpic.so): Likewise.
2238 (two_file_shared_mixed.so): Likewise.
2239 (two_file_shared_mixed_1.so): Likewise.
2240 (weak_undef_lib_nonpic.so): Likewise.
2241 (alt/weak_undef_lib_nonpic.so): Likewise.
2242 (tls_test_shared_nonpic.so): Likewise.
2243 * testsuite/Makefile.in: Rebuild.
2244
2245 2011-07-01 Ian Lance Taylor <iant@google.com>
2246
2247 PR gold/12525
2248 * configure.ac: Test whether static linking works, setting
2249 the automake conditional HAVE_STATIC.
2250 * testsuite/Makefile.am: Disable tests using -static if
2251 HAVE_STATIC is not true.
2252 * configure, testsuite/Makefile.in: Rebuild.
2253
2254 2011-07-01 Ian Lance Taylor <iant@google.com>
2255
2256 PR gold/12525
2257 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2258 Assert if we see DW_EH_PE_indirect.
2259 * target.h (Target::ehframe_datarel_base): New function.
2260 (Target::do_ehframe_datarel_base): New target function.
2261 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2262 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2263 function.
2264
2265 2011-07-01 Ian Lance Taylor <iant@google.com>
2266
2267 PR gold/12571
2268 * options.h (class General_options): Add
2269 --ld-generated-unwind-info.
2270 * ehframe.cc (Fde::write): Add address parameter. Change all
2271 callers. If associated with PLT, fill in address and size.
2272 (Cie::set_output_offset): Only add merge mapping if there is an
2273 object.
2274 (Cie::write): Add address parameter. Change all callers.
2275 (Eh_frame::add_ehframe_for_plt): New function.
2276 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2277 input_offset_ fields into union u_, with new plt field.
2278 (Fde::Fde): Adjust for new union field.
2279 (Fde::Fde) [Output_data version]: New constructor.
2280 (Fde::add_mapping): Only add merge mapping if there is an object.
2281 (class Cie): Update declarations.
2282 (class Eh_frame): Declare add_ehframe_for_plt.
2283 * layout.cc (Layout::layout_eh_frame): Break out code into
2284 make_eh_frame_section, and call it.
2285 (Layout::make_eh_frame_section): New function.
2286 (Layout::add_eh_frame_for_plt): New function.
2287 * layout.h (class Layout): Update declarations.
2288 * merge.cc (Merge_map::add_mapping): Add assertion.
2289 * i386.cc: Include "dwarf.h".
2290 (class Output_data_plt_i386): Make first_plt_entry,
2291 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2292 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2293 and plt_eh_frame_fde.
2294 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2295 boundary. Call add_eh_frame_for_plt if appropriate.
2296 * x86_64.cc: Include "dwarf.h".
2297 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2298 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2299 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2300 and plt_eh_frame_fde.
2301 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2302 appropriate.
2303
2304 2011-06-29 Ian Lance Taylor <iant@google.com>
2305
2306 PR gold/12629
2307 * object.cc (Sized_relobj_file::layout_section): Change shdr
2308 parameter to be const.
2309 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2310 out of do_layout.
2311 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2312 appropriate. Call layout_eh_frame_section.
2313 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2314 sections.
2315 * object.h (class Sized_relobj_file): Update declarations.
2316
2317 2011-06-29 Ian Lance Taylor <iant@google.com>
2318
2319 PR gold/12652
2320 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2321 modifier.
2322 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2323
2324 2011-06-29 Ian Lance Taylor <iant@google.com>
2325
2326 PR gold/12675
2327 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2328 SHT_X86_64_UNWIND.
2329 * layout.cc (Layout::layout_eh_frame): Likewise.
2330
2331 2011-06-29 Ian Lance Taylor <iant@google.com>
2332
2333 PR gold/12695
2334 * layout.cc (Layout::symtab_section_shndx): New function.
2335 * layout.h (class Layout): Declare symtab_section_shndx.
2336 * output.cc (Output_section::write_header): Call it.
2337
2338 2011-06-29 Ian Lance Taylor <iant@google.com>
2339
2340 PR gold/12818
2341 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2342 symbols which are not used in a relocation.
2343
2344 2011-06-28 Ian Lance Taylor <iant@google.com>
2345
2346 PR gold/12898
2347 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2348 script create indistinguishable segments.
2349 (Layout::set_segment_offsets): Use stable_sort when sorting
2350 segments. Pass this to Compare_segments constructor.
2351 * layout.h (class Layout): Make segment_precedes non-static.
2352 (class Compare_segments): Change from struct to class. Add
2353 layout_ field. Add constructor.
2354 * script-sections.cc
2355 (Script_sections::attach_sections_using_phdrs_clause): Rename
2356 local orphan to is_orphan. Don't report failure to put empty
2357 section in segment. On attachment failure, report name of
2358 section, and attach to first PT_LOAD segment.
2359
2360 2011-06-28 Ian Lance Taylor <iant@google.com>
2361
2362 PR gold/12934
2363 * target-select.cc (Target_selector::Target_selector): Add
2364 emulation parameter. Change all callers.
2365 (select_target_by_bfd_name): Rename from select_target_by_name.
2366 Change all callers.
2367 (select_target_by_emulation): New function.
2368 (supported_emulation_names): New function.
2369 * target-select.h (class Target_selector): Add emulation_ field.
2370 Update declarations.
2371 (Target_selector::recognize_by_bfd_name): Rename from
2372 recognize_by_name. Change all callers.
2373 (Target_selector::supported_bfd_names): Rename from
2374 supported_names. Change all callers.
2375 (Target_selector::recognize_by_emulation): New function.
2376 (Target_selector::supported_emulations): New function.
2377 (Target_selector::emulation): New function.
2378 (Target_selector::do_recognize_by_bfd_name): Rename from
2379 do_recognize_by_name. Change all callers.
2380 (Target_selector::do_supported_bfd_names): Rename from
2381 do_supported_names. Change all callers.
2382 (Target_selector::do_recognize_by_emulation): New function.
2383 (Target_selector::do_supported_emulations): New function.
2384 (select_target_by_bfd_name): Change name in declaration.
2385 (select_target_by_emulation): Declare.
2386 (supported_emulation_names): Declare.
2387 * parameters.cc (parameters_force_valid_target): Try to find
2388 target based on emulation from -m option.
2389 * options.h (class General_options): Change doc string for -m.
2390 * options.cc (help): Print emulations.
2391 (General_options::parse_V): Likewise.
2392 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2393 Add emulation parameter. Change all callers.
2394
2395 2011-06-28 Ian Lance Taylor <iant@google.com>
2396
2397 * target.h (class Target): Add osabi_ field.
2398 (Target::osabi): New function.
2399 (Target::set_osabi): New function.
2400 (Target::Target): Initialize osabi_.
2401 (Target::do_adjust_elf_header): Make pure virtual.
2402 (Sized_target::do_adjust_elf_header): Declare.
2403 * target.cc (Sized_target::do_adjust_elf_header): New function.
2404 (class Sized_target): Instantiate all versions.
2405 * freebsd.h (class Target_freebsd): Remove.
2406 (Target_selector_freebsd::do_recognize): Call set_osabi on
2407 Target.
2408 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2409 (Target_selector_freebsd::set_osabi): Remove.
2410 * i386.cc (class Target_i386): Inherit from Sized_target rather
2411 than Target_freebsd.
2412 * x86_64.cc (class Target_x86_64): Likewise.
2413
2414 2011-06-28 Ian Lance Taylor <iant@google.com>
2415
2416 * target.h (Target::can_check_for_function_pointers): Rewrite.
2417 Make non-virtual.
2418 (Target::can_icf_inline_merge_sections): Likewise.
2419 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2420 (Target::Target_info): Add can_icf_inline_merge_sections field.
2421 (Target::do_can_check_for_function_pointers): New virtual
2422 function.
2423 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2424 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2425 from can_check_for_function_pointers, move in file.
2426 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2427 section_may_have_icf_unsafe_poineters, move in file.
2428 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2429 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2430 Rename from can_check_for_function_pointers, move in file.
2431 (Target_i386::can_icf_inline_merge_sections): Remove.
2432 (Target_i386::i386_info): Initialize
2433 can_icf_inline_merge_sections.
2434 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2435 Initialize can_icf_inline_merge_sections.
2436 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2437 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2438 Rename from can_check_for_function_pointers, move in file.
2439 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2440 (Target_x86_64::x86_64_info): Initialize
2441 can_icf_inline_merge_sections.
2442 * testsuite/testfile.cc (Target_test::test_target_info):
2443 Likewise.
2444 * icf.cc (get_section_contents): Correct formatting.
2445
2446 2011-06-27 Ian Lance Taylor <iant@google.com>
2447
2448 * symtab.cc (Symbol::versioned_name): New function.
2449 (Symbol_table::add_to_final_symtab): Use versioned_name when
2450 appropriate.
2451 (Symbol_table::sized_write_symbol): Likewise.
2452 * symtab.h (class Symbol): Declare versioned_name.
2453 * stringpool.h (class Stringpool_template): Add variant of add
2454 which takes a std::basic_string.
2455 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2456 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2457 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2458 (ver_test_12.o): New target.
2459 * testsuite/Makefile.in: Rebuild.
2460
2461 2011-06-27 Doug Kwan <dougkwan@google.com>
2462
2463 * arm.cc (Arm_relocate_functions::thm_jump8,
2464 Arm_relocate_functions::thm_jump11): Use a wider signed
2465 type to compute offset.
2466 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2467 arm_thm_jump8.
2468 * testsuite/Makefile.in: Regenerate.
2469 * testsuite/arm_branch_in_range.sh: Check test results of
2470 arm_thm_jump11 and arm_thm_jump8.
2471 * testsuite/arm_thm_jump11.s: New test source file.
2472 * testsuite/arm_thm_jump11.t: New linker script.
2473 * testsuite/arm_thm_jump8.s: New test source file.
2474 * testsuite/arm_thm_jump8.t: New linker script.
2475
2476 2011-06-24 Ian Lance Taylor <iant@google.com>
2477
2478 * layout.cc: Include "object.h".
2479 (ctors_sections_in_init_array): New static variable.
2480 (Layout::is_ctors_in_init_array): New function.
2481 (Layout::layout): Add entry to ctors_sections_in_init_array if
2482 appropriate.
2483 * layout.h (class Layout): Declare is_ctors_in_init_array.
2484 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2485 is_ctors_reverse_view is set.
2486 (Sized_relobj_file::write_sections): Add layout parameter. Change
2487 all callers. Set is_ctors_reverse_view field of View_size.
2488 (Sized_relobj_file::reverse_words): New function.
2489 * object.h (Sized_relobj_file::View_size): Add
2490 is_ctors_reverse_view field.
2491 (class Sized_relobj_file): Update declarations.
2492 * testsuite/initpri3.c: New test.
2493 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2494 initpri3b.
2495 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2496 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2497 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2498 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2499 * testsuite/Makefile.in: Rebuild.
2500
2501 2011-06-24 Cary Coutant <ccoutant@google.com>
2502
2503 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2504 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2505 (debug_msg_cdebug.err): New targets.
2506 * testsuite/Makefile.in: Regenerate.
2507 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2508 Fix checks for link with shared library.
2509
2510 2011-06-24 Doug Kwan <dougkwan@google.com>
2511
2512 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2513 skip empty text sections.
2514 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2515
2516 2011-06-22 Ian Lance Taylor <iant@google.com>
2517
2518 PR gold/12910
2519 * options.h (class General_options): Add --ctors-in-init-array.
2520 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2521 friends as SHT_PROGBITS for merging sections.
2522 (Layout::layout): Remove special handling of .init_array and
2523 friends. Don't sort if doing relocatable link. Sort for .ctors
2524 and .dtors if ctors_in_init_array.
2525 (Layout::make_output_section): Force correct section types for
2526 .init_array and friends. Don't sort if doing relocatable link,
2527 Don't sort .ctors and .dtors if ctors_in_init_array.
2528 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2529 (Layout::output_section_name): Add relobj parameter. Change all
2530 callers. Handle .ctors. and .dtors. in code rather than table.
2531 Handle .ctors and .dtors if ctors_in_init_array.
2532 (Layout::match_file_name): New function, moved from output.cc.
2533 * layout.h (class Layout): Update declarations.
2534 * output.cc: Include "layout.h".
2535 (Input_section_sort_entry::get_priority): New function.
2536 (Input_section_sort_entry::match_file_name): Just call
2537 Layout::match_file_name.
2538 (Output_section::Input_section_sort_init_fini_compare::operator()):
2539 Handle .ctors and .dtors. Sort by explicit priority rather than
2540 by name.
2541 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2542 * testsuite/initpri2.c: New test.
2543 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2544 (check_PROGRAMS): Add initpri2.
2545 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2546 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2547 * configure, testsuite/Makefile.in: Rebuild.
2548
2549 2011-06-19 Ian Lance Taylor <iant@google.com>
2550
2551 PR gold/12880
2552 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2553 .interp section to a PT_INTERP segment even if we have seen a
2554 --dynamic-linker option. Don't do it if we have seen a PHDRS
2555 clause in a linker script.
2556 (Layout::finalize): Don't create a .interp section if we've
2557 already create a PT_INTERP segment.
2558 (Layout::create_interp): Always call choose_output_section (revert
2559 patch of 2011-06-17). Don't create PT_INTERP segment.
2560 * script-sections.cc
2561 (Script_sections::create_note_and_tls_segments): Add a .interp
2562 section to a PT_INTERP segment even if we have seen a
2563 --dynamic-linker option.
2564
2565 2011-06-18 Ian Lance Taylor <iant@google.com>
2566
2567 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2568 merely because a non-PT_LOAD segment has a dynamic reloc.
2569
2570 2011-06-18 Ian Lance Taylor <iant@google.com>
2571
2572 * layout.cc (Layout::finish_dynamic_section): Don't create
2573 DT_FLAGS entry if not needed.
2574
2575 2011-06-18 Ian Lance Taylor <iant@google.com>
2576
2577 PR gold/12745
2578 * layout.cc (Layout::layout_eh_frame): Correct handling of
2579 writable .eh_frame section.
2580
2581 2011-06-17 Ian Lance Taylor <iant@google.com>
2582
2583 PR gold/12893
2584 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2585 symbol is redefined with the exact same object and value.
2586
2587 2011-06-17 Ian Lance Taylor <iant@google.com>
2588
2589 PR gold/12880
2590 * layout.h (class Layout): Add interp_segment_ field.
2591 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2592 (Layout::attach_allocated_section_to_segment): If making shared
2593 library, put .interp section in PT_INTERP segment.
2594 (Layout::finalize): Also call create_interp if -dynamic-linker
2595 option was used.
2596 (Layout::create_interp): Assert that there is no PT_INTERP
2597 segment. If not using a SECTIONS clause, use make_output_section.
2598 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2599 * script-sections.cc
2600 (Script_sections::create_note_and_tls_segments): If making shared
2601 library, put .interp section in PT_INTERP segment.
2602
2603 2011-06-17 Ian Lance Taylor <iant@google.com>
2604
2605 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2606 when making a shared library.
2607
2608 2011-06-17 Ian Lance Taylor <iant@google.com>
2609
2610 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2611 parameter. Change all callers. Don't issue warning about PC32
2612 against locally defined symbol.
2613
2614 2011-06-16 Ian Lance Taylor <iant@google.com>
2615
2616 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2617 occurs in same object.
2618
2619 2011-06-14 Alan Modra <amodra@gmail.com>
2620
2621 * po/POTFILES.in: Regenerate.
2622
2623 2011-06-09 Ian Lance Taylor <iant@google.com>
2624
2625 * script-sections.cc
2626 (Orphan_output_section::set_section_addresses): For a relocatable
2627 link set address to 0.
2628
2629 2011-06-09 Cary Coutant <ccoutant@google.com>
2630
2631 PR gold/12804
2632 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2633 used with --compress-debug-sections.
2634 * gold/object.cc (Sized_relobj_file::do_layout): Report
2635 uncompressed size of compressed input sections.
2636
2637 2011-06-08 Cary Coutant <ccoutant@google.com>
2638
2639 PR gold/12804
2640 * testsuite/two_file_test_2_v1.cc: Change initialization of
2641 v2 to keep it in .data.
2642
2643 2011-06-07 Cary Coutant <ccoutant@google.com>
2644
2645 * common.cc (Symbol_table::do_allocate_commons_list): Call
2646 gold_fallback.
2647 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2648 (Errors::fallback): New function.
2649 (gold_fallback): New function.
2650 * errors.h (Errors::fallback): New function.
2651 * gold.cc (gold_exit): Change status parameter to enum; adjust
2652 all callers.
2653 (queue_initial_tasks): Call gold_fallback.
2654 * gold.h: Include cstdlib.
2655 (Exit_status): New enum type.
2656 (gold_exit): Change status parameter to enum.
2657 (gold_fallback): New function.
2658 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2659 (Layout::create_symtab_sections): Likewise.
2660 (Layout::create_shdrs): Likewise.
2661 * main.cc (main): Adjust call to gold_exit.
2662 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2663 (Output_data_got::add_got_entry_pair): Likewise.
2664 (Output_section::add_input_section): Likewise.
2665 (Output_section::add_output_section_data): Likewise.
2666 (Output_segment::set_section_list_addresses): Likewise.
2667 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2668
2669 2011-06-07 Cary Coutant <ccoutant@google.com>
2670
2671 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2672 for incremental links.
2673 * output.cc (Output_segment::set_section_list_addresses): Remove
2674 FIXME and test for TLS or BSS.
2675
2676 2011-06-07 Cary Coutant <ccoutant@google.com>
2677
2678 * testsuite/Makefile.am: Add incremental_copy_test,
2679 incremental_common_test_1.
2680 * testsuite/Makefile.in: Regenerate.
2681 * testsuite/common_test_1_v1.c: New source file.
2682 * testsuite/common_test_1_v2.c: New source file.
2683 * testsuite/copy_test_v1.cc: New source file.
2684
2685 2011-06-07 Cary Coutant <ccoutant@google.com>
2686
2687 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2688 update, allocate common from bss section's free list.
2689 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2690 linker-defined symbols.
2691 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2692 Skip GOT and PLT entries that are no longer referenced.
2693 (Output_section_incremental_inputs::write_info_blocks): Mark
2694 linker-defined symbols.
2695 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2696 * output.cc (Output_section::allocate): New function.
2697 * output.h (Output_section::allocate): New function.
2698 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2699 linker-defined symbols.
2700 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2701 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2702 (Symbol::init_base_output_data): Likewise.
2703 (Symbol::init_base_output_segment): Likewise.
2704 (Symbol::init_base_constant): Likewise.
2705 (Sized_symbol::init_output_data): Likewise.
2706 (Sized_symbol::init_output_segment): Likewise.
2707 (Sized_symbol::init_constant): Likewise.
2708 (Symbol_table::do_define_in_output_data): Likewise.
2709 (Symbol_table::do_define_in_output_segment): Likewise.
2710 (Symbol_table::do_define_as_constant): Likewise.
2711 * symtab.h (Symbol::is_predefined): New function.
2712 (Symbol::init_base_output_data): Add is_predefined parameter.
2713 (Symbol::init_base_output_segment): Likewise.
2714 (Symbol::init_base_constant): Likewise.
2715 (Symbol::is_predefined_): New data member.
2716 (Sized_symbol::init_output_data): Add is_predefined parameter.
2717 (Sized_symbol::init_output_segment): Likewise.
2718 (Sized_symbol::init_constant): Likewise.
2719 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2720
2721 2011-06-07 Cary Coutant <ccoutant@google.com>
2722
2723 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2724 instead of emit_copy_reloc.
2725 (Copy_relocs::emit_copy_reloc): Refactor.
2726 (Copy_relocs::make_copy_reloc): New function.
2727 (Copy_relocs::add_copy_reloc): Remove.
2728 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2729 section.
2730 (Copy_relocs::make_copy_reloc): New function.
2731 (Copy_relocs::add_copy_reloc): Remove.
2732 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2733 unchanged input files.
2734 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2735 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2736 Reserve BSS space for COPY relocations.
2737 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2738 (Output_section_incremental_inputs::write_info_blocks): Record
2739 whether a symbol is copied from a shared object.
2740 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2741 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2742 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2743 (Incremental_input_entry_reader::get_output_symbol_index): Add
2744 is_copy parameter.
2745 (Incremental_binary::emit_copy_relocs): New function.
2746 (Incremental_binary::do_emit_copy_relocs): New function.
2747 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2748 new data member.
2749 (Sized_incremental_binary::add_copy_reloc): New function.
2750 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2751 (Sized_incremental_binary::Copy_reloc): New struct.
2752 (Sized_incremental_binary::Copy_relocs): New typedef.
2753 (Sized_incremental_binary::copy_relocs_): New data member.
2754 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2755 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2756 * target.h (Sized_target::emit_copy_reloc): New function.
2757 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2758
2759 2011-06-02 Cary Coutant <ccoutant@google.com>
2760
2761 PR gold/12163
2762 * gold/archive.cc (Archive::Archive): Initialize new data member.
2763 (Archive::include_all_members): Return if archive has already been
2764 included.
2765 * gold/archive.h (Archive::include_all_members_): New data member.
2766
2767 2011-06-02 Nick Clifton <nickc@redhat.com>
2768
2769 * dynobj.h: Fix spelling mistake in comment.
2770 * output.cc: Likewise.
2771
2772 2011-05-31 Doug Kwan <dougkwan@google.com>
2773 Asier Llano
2774
2775 PR gold/12826
2776 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2777 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2778 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2779 redundant arm_exidx_test.so.
2780 * testsuite/Makefile.in: Regenerate.
2781 (check_SCRIPTS): Add pr12826.sh
2782 (check_DATA): Add pr12826.stdout
2783 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2784 * testsuite/pr12826.sh: New file.
2785 * testsuite/pr12826_1.s: Ditto.
2786 * testsuite/pr12826_1.s: Ditto.
2787
2788 2011-05-30 Ian Lance Taylor <iant@google.com>
2789
2790 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2791 sections.
2792
2793 2011-05-29 Ian Lance Taylor <iant@google.com>
2794
2795 PR gold/12804
2796 * testsuite/Makefile.am: Use different file name for two_file_test
2797 temporary file for each incremental test.
2798 * testsuite/Makefile.in: Rebuild.
2799
2800 2011-05-29 Ian Lance Taylor <iant@google.com>
2801
2802 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2803 binary input file is empty.
2804
2805 2011-05-27 Ian Lance Taylor <iant@google.com>
2806
2807 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2808 (ver_test_9.so): Likewise.
2809 * testsuite/Makefile.in: Rebuild.
2810
2811 2011-05-26 Cary Coutant <ccoutant@google.com>
2812
2813 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2814 * incremental.cc (Incremental_inputs::report_input_section): Fix
2815 comment, indentation.
2816 (Incremental_inputs::report_comdat_group): New function.
2817 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2818 of data for incremental input file entry.
2819 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2820 group count, COMDAT group signatures.
2821 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2822 an unchanged input file.
2823 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2824 Initialize new data member.
2825 (Incremental_object_entry::add_comdat_group): New function.
2826 (Incremental_object_entry::get_comdat_group_count): New function.
2827 (Incremental_object_entry::get_comdat_signature_key): New function.
2828 (Incremental_object_entry::groups_): New data member.
2829 (Incremental_inputs::report_comdat_group): New function.
2830 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2831 data for incremental input file entry.
2832 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2833 (Incremental_input_entry_reader::get_input_section): Adjust size of
2834 data for incremental input file entry.
2835 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2836 (Incremental_input_entry_reader::get_comdat_group_signature): New
2837 function.
2838 * object.cc (Sized_relobj::include_section_group): Report kept
2839 COMDAT groups for incremental links.
2840
2841 2011-05-24 David Meyer <pdox@google.com>
2842
2843 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2844 with name parameter. Add found_name parameter.
2845 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2846 * dirsearch.h (class Dirsearch): Update declaration.
2847
2848 2011-05-24 Ian Lance Taylor <iant@google.com>
2849
2850 * archive.cc (Library_base::should_include_member): Pull in object
2851 from archive if it defines the entry symbol.
2852 * parameters.cc (Parameters::entry): New function.
2853 * parameters.h (class Parameters): Declare entry.
2854 * output.h (class Output_file_header): Remove entry_ field.
2855 * output.cc (Output_file_header::Output_file_header): Remove entry
2856 parameter. Change all callers.
2857 (Output_file_header::entry): Use parameters->entry.
2858 * gold.cc (queue_middle_tasks): Likewise.
2859 * plugin.cc (Plugin_hook::run): Likewise.
2860
2861 2011-05-24 Cary Coutant <ccoutant@google.com>
2862
2863 * gold.cc (queue_initial_tasks): Pass incremental base filename
2864 to Output_file::open_base_file; don't print error message.
2865 * incremental-dump.cc (main): Adjust call to
2866 Output_file::open_for_modification.
2867 * incremental-dump.cc (main): Likewise.
2868 * incremental.cc (Incremental_inputs::report_command_line):
2869 Ignore --incremental-base option when comparing command lines.
2870 Ignore parameter when given as separate argument.
2871 * options.h (class General_options): Add --incremental-base.
2872 * output.cc (Output_file::Output_file):
2873 (Output_file::open_base_file): Add base_name and writable parameters;
2874 read base file into new file; print error message here.
2875 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2876 callers.
2877 * output.h (Output_file::open_for_modification): Rename to...
2878 (Output_file::open_base_file): ...this; add base_name and
2879 writable parameters; adjust all callers.
2880 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2881 callers.
2882 * testsuite/Makefile.am (incremental_test_4): Test
2883 --incremental-base.
2884 * testsuite/Makefile.in: Regenerate.
2885
2886 2011-05-24 Cary Coutant <ccoutant@google.com>
2887
2888 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2889 incremental_test_4.
2890 * testsuite/Makefile.in: Regenerate.
2891 * testsuite/two_file_test_1_v1.cc: New test source file.
2892 * testsuite/two_file_test_1b_v1.cc: New test source file.
2893 * testsuite/two_file_test_2_v1.cc: New test source file.
2894
2895 2011-05-24 Cary Coutant <ccoutant@google.com>
2896
2897 * dynobj.h (Dynobj::do_dynobj): New function.
2898 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2899 flag and soname for shared objects.
2900 * incremental.cc (Incremental_inputs::report_object): Make
2901 either Incremental_object_entry or Incremental_dynobj_entry; add
2902 soname to string table.
2903 (Incremental_inputs::report_input_section): Add assertion.
2904 (Output_section_incremental_inputs::set_final_data_size): Adjust
2905 type of input file entry for shared libraries; adjust size of
2906 shared library info entry.
2907 (Output_section_incremental_inputs::write_input_files): Write
2908 as_needed flag for shared libraries.
2909 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2910 of input file entry for shared libraries; write soname.
2911 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2912 soname from incremental info.
2913 * incremental.h (enum Incremental_input_flags): Add
2914 INCREMENTAL_INPUT_AS_NEEDED.
2915 (Incremental_input_entry::Incremental_input_entry): Initialize new
2916 data member.
2917 (Incremental_input_entry::set_as_needed): New function.
2918 (Incremental_input_entry::as_needed): New function.
2919 (Incremental_input_entry::do_dynobj_entry): New function.
2920 (Incremental_input_entry::as_needed_): New data member.
2921 (Incremental_object_entry::Incremental_object_entry): Don't check
2922 for shared library.
2923 (Incremental_object_entry::do_type): Likewise.
2924 (class Incremental_dynobj_entry): New class.
2925 (Incremental_input_entry_reader::as_needed): New function.
2926 (Incremental_input_entry_reader::get_soname): New function.
2927 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2928 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2929 size of shared library info entry.
2930 * layout.cc (Layout::finish_dynamic_section): Don't test for
2931 incremental link when adding DT_NEEDED entries.
2932 * object.h (Object::Object): Initialize new data member.
2933 (Object::dynobj): New function.
2934 (Object::set_as_needed): New function.
2935 (Object::as_needed): New function.
2936 (Object::do_dynobj): New function.
2937 (Object::as_needed_): New data member.
2938
2939 2011-05-24 Cary Coutant <ccoutant@google.com>
2940
2941 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2942 info; adjust display of GOT entries.
2943 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2944 vector of input objects; remove file_status_.
2945 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2946 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2947 got_plt reader; call target hooks to reserve GOT entries.
2948 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2949 of input file info header and GOT info entry.
2950 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2951 relocation info.
2952 (Got_plt_view_info::got_descriptor): Remove.
2953 (Got_plt_view_info::sym_index): New data member.
2954 (Got_plt_view_info::input_index): New data member.
2955 (Local_got_offset_visitor::visit): Write input file index.
2956 (Global_got_offset_visitor::visit): Write 0 for input file index.
2957 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2958 with sym_index and input_index.
2959 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2960 incremental info GOT entry; replace got_descriptor with input_index.
2961 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2962 map from input file index to object.
2963 (Sized_relobj_incr::do_layout): Replace direct data member reference
2964 with accessor function.
2965 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2966 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2967 Adjust size of input file info header.
2968 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2969 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2970 (Incremental_input_entry_reader::get_input_section): Adjust size of
2971 input file info header.
2972 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2973 of incremental info GOT entry.
2974 (Incremental_got_plt_reader::get_got_desc): Remove.
2975 (Incremental_got_plt_reader::get_got_symndx): New function.
2976 (Incremental_got_plt_reader::get_got_input_index): New function.
2977 (Sized_incremental_binary::Sized_incremental_binary): Remove
2978 file_status_; add input_objects_.
2979 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2980 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2981 (Sized_incremental_binary::file_is_unchanged): Remove.
2982 (Sized_incremental_binary::set_input_object): New function.
2983 (Sized_incremental_binary::input_object): New function.
2984 (Sized_incremental_binary::file_status_): Remove.
2985 (Sized_incremental_binary::input_objects_): New data member.
2986 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2987 references.
2988 (Sized_relobj_incr::invalid_address): Move to base class.
2989 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2990 class.
2991 (Sized_relobj_incr::do_output_section_offset): Likewise.
2992 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2993 (Sized_relobj_incr::section_offsets_): Likewise.
2994 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2995 function.
2996 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2997 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2998 with accessor function.
2999 (Sized_relobj_file::do_layout): Likewise.
3000 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3001 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3002 (Sized_relobj_file::compute_final_local_value): Replace refs to
3003 section_offsets_ with accessor function.
3004 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3005 * object.h (Relobj::Relobj): Initialize new data members.
3006 (Relobj::add_dyn_reloc): New function.
3007 (Relobj::first_dyn_reloc): New function.
3008 (Relobj::dyn_reloc_count): New function.
3009 (Relobj::first_dyn_reloc_): New data member.
3010 (Relobj::dyn_reloc_count_): New data member.
3011 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3012 references.
3013 (Sized_relobj::Address): New typedef.
3014 (Sized_relobj::invalid_address): Move here from child class.
3015 (Sized_relobj::Sized_relobj): Initialize new data members.
3016 (Sized_relobj::sized_relobj): New function.
3017 (Sized_relobj::is_output_section_offset_invalid): Move here from
3018 child class.
3019 (Sized_relobj::get_output_section_offset): Likewise.
3020 (Sized_relobj::local_has_got_offset): Likewise.
3021 (Sized_relobj::local_got_offset): Likewise.
3022 (Sized_relobj::set_local_got_offset): Likewise.
3023 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3024 (Sized_relobj::clear_got_offsets): New function.
3025 (Sized_relobj::section_offsets): Move here from child class.
3026 (Sized_relobj::do_output_section_offset): Likewise.
3027 (Sized_relobj::do_set_section_offset): Likewise.
3028 (Sized_relobj::Local_got_offsets): Likewise.
3029 (Sized_relobj::local_got_offsets_): Likewise.
3030 (Sized_relobj::section_offsets_): Likewise.
3031 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3032 references.
3033 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3034 class.
3035 (Sized_relobj_file::sized_relobj): New function
3036 (Sized_relobj_file::local_has_got_offset): Move to base class.
3037 (Sized_relobj_file::local_got_offset): Likewise.
3038 (Sized_relobj_file::set_local_got_offset): Likewise.
3039 (Sized_relobj_file::get_output_section_offset): Likewise.
3040 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3041 (Sized_relobj_file::do_output_section_offset): Likewise.
3042 (Sized_relobj_file::do_set_section_offset): Likewise.
3043 (Sized_relobj_file::Local_got_offsets): Likewise.
3044 (Sized_relobj_file::local_got_offsets_): Likewise.
3045 (Sized_relobj_file::section_offsets_): Likewise.
3046 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3047 (all constructors).
3048 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3049 (Output_reloc::get_symbol_index): Likewise.
3050 (Output_reloc::local_section_offset): Likewise.
3051 (Output_reloc::get_address): Likewise.
3052 (Output_reloc::symbol_value): Likewise.
3053 (Output_data_got::reserve_slot): Move to class definition.
3054 (Output_data_got::reserve_local): New function.
3055 (Output_data_got::reserve_slot_for_global): Remove.
3056 (Output_data_got::reserve_global): New function.
3057 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3058 (all constructors, two instantiations).
3059 (Output_reloc::get_relobj): New function (two instantiations).
3060 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3061 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3062 (Output_data_reloc::add_global): Adjust type of relobj.
3063 (Output_data_reloc::add_global_relative): Likewise.
3064 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3065 (Output_data_reloc::add_local): Likewise.
3066 (Output_data_reloc::add_local_relative): Likewise.
3067 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3068 (Output_data_reloc::add_local_section): Likewise.
3069 (Output_data_reloc::add_output_section): Likewise.
3070 (Output_data_reloc::add_absolute): Likewise.
3071 (Output_data_reloc::add_target_specific): Likewise.
3072 (Output_data_got::reserve_slot): Move definition here.
3073 (Output_data_got::reserve_local): New function.
3074 (Output_data_got::reserve_global): New function.
3075 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3076 section_offsets_ with accessor function.
3077 (Sized_relobj_file::write_sections): Likewise.
3078 (Sized_relobj_file::do_relocate_sections): Likewise.
3079 * target.h (Sized_target::reserve_local_got_entry): New function.
3080 (Sized_target::reserve_global_got_entry): New function.
3081 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3082 (Target_x86_64::reserve_global_got_entry): New function.
3083 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3084
3085 2011-05-23 Cary Coutant <ccoutant@google.com>
3086
3087 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3088 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3089 bit when checking got_type.
3090 * incremental.cc (Sized_incremental_binary::setup_readers):
3091 Store symbol table and string table locations; initialize bit vector
3092 of file status flags.
3093 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3094 unchanged files.
3095 (Sized_incremental_binary::do_process_got_plt): New function.
3096 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3097 (Output_section_incremental_inputs::set_final_data_size): Record
3098 file index for each input file.
3099 (Output_section_incremental_inputs::write_got_plt): Store file index
3100 instead of input entry offset for each GOT entry.
3101 * incremental.h
3102 (Incremental_input_entry::Incremental_input_entry): Initialize new
3103 data member.
3104 (Incremental_input_entry::set_offset): Store file index.
3105 (Incremental_input_entry::get_file_index): New function.
3106 (Incremental_input_entry::file_index_): New data member.
3107 (Incremental_binary::process_got_plt): New function.
3108 (Incremental_binary::do_process_got_plt): New function.
3109 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3110 data members.
3111 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3112 (Sized_incremental_binary::set_file_is_unchanged): New function.
3113 (Sized_incremental_binary::file_is_unchanged): New function.
3114 (Sized_incremental_binary::do_process_got_plt): New function.
3115 (Sized_incremental_binary::file_status_): New data member.
3116 (Sized_incremental_binary::main_symtab_loc_): New data member.
3117 (Sized_incremental_binary::main_strtab_loc_): New data member.
3118 * output.cc (Output_data_got::Got_entry::write): Add case
3119 RESERVED_CODE.
3120 (Output_data_got::add_global): Call add_got_entry.
3121 (Output_data_got::add_global_plt): Likewise.
3122 (Output_data_got::add_global_with_rel): Likewise.
3123 (Output_data_got::add_global_with_rela): Likewise.
3124 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3125 (Output_data_got::add_global_pair_with_rela): Likewise.
3126 (Output_data_got::add_local): Call add_got_entry.
3127 (Output_data_got::add_local_plt): Likewise.
3128 (Output_data_got::add_local_with_rel): Likewise.
3129 (Output_data_got::add_local_with_rela): Likewise.
3130 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3131 (Output_data_got::add_local_pair_with_rela): Likewise.
3132 (Output_data_got::reserve_slot): New function.
3133 (Output_data_got::reserve_slot_for_global): New function.
3134 (Output_data_got::add_got_entry): New function.
3135 (Output_data_got::add_got_entry_pair): New function.
3136 (Output_section::add_output_section_data): Edit FIXME.
3137 * output.h
3138 (Output_section_data_build::Output_section_data_build): New
3139 constructor with size parameter.
3140 (Output_data_space::Output_data_space): Likewise.
3141 (Output_data_got::Output_data_got): Initialize new data member; new
3142 constructor with size parameter.
3143 (Output_data_got::add_constant): Call add_got_entry.
3144 (Output_data_got::reserve_slot): New function.
3145 (Output_data_got::reserve_slot_for_global): New function.
3146 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3147 (Output_data_got::add_got_entry): New function.
3148 (Output_data_got::add_got_entry_pair): New function.
3149 (Output_data_got::free_list_): New data member.
3150 * target.h (Sized_target::init_got_plt_for_update): New function.
3151 (Sized_target::register_global_plt_entry): New function.
3152 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3153 Initialize new data member; call init; add constructor with PLT count.
3154 (Output_data_plt_x86_64::init): New function.
3155 (Output_data_plt_x86_64::add_relocation): New function.
3156 (Output_data_plt_x86_64::reserve_slot): New function.
3157 (Output_data_plt_x86_64::free_list_): New data member.
3158 (Target_x86_64::init_got_plt_for_update): New function.
3159 (Target_x86_64::register_global_plt_entry): New function.
3160 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3161 incremental updates.
3162 (Output_data_plt_x86_64::add_relocation): New function.
3163 * testsuite/object_unittest.cc (Object_test): Set default options.
3164
3165 2011-05-16 Ian Lance Taylor <iant@google.com>
3166
3167 * options.h (class General_options): Make -i a synonym for -r.
3168
3169 2011-05-16 Ian Lance Taylor <iant@google.com>
3170
3171 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3172
3173 2011-05-10 Cary Coutant <ccoutant@google.com>
3174
3175 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3176 strip_all (-s).
3177
3178 2011-05-06 Ian Lance Taylor <iant@google.com>
3179
3180 * layout.cc (Layout::layout): If the output section flags change,
3181 update the ordering.
3182
3183 2011-04-25 Cary Coutant <ccoutant@google.com>
3184
3185 * incremental-dump.cc (dump_incremental_inputs): Print local
3186 symbol info for each input file.
3187 * incremental.cc
3188 (Output_section_incremental_inputs::set_final_data_size): Add local
3189 symbol info to input file entries in incremental info.
3190 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3191 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3192 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3193 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3194 implementation.
3195 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3196 (Sized_incr_relobj::do_relocate): Write the local symbols.
3197 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3198 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3199 Adjust size of input file header.
3200 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3201 (Incremental_inputs_reader::get_local_symbol_count): New function.
3202 (Incremental_inputs_reader::get_input_section): Adjust size of input
3203 file header.
3204 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3205 (Sized_incr_relobj::This): New typedef.
3206 (Sized_incr_relobj::sym_size): New const data member.
3207 (Sized_incr_relobj::Local_symbol): New struct.
3208 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3209 (Sized_incr_relobj::do_local_symbol_offset): New function.
3210 (Sized_incr_relobj::local_symbol_count_): New data member.
3211 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3212 (Sized_incr_relobj::local_symbol_index_): New data member.
3213 (Sized_incr_relobj::local_symbol_offset_): New data member.
3214 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3215 (Sized_incr_relobj::local_symbols_): New data member.
3216 * object.h (Relobj::output_local_symbol_count): New function.
3217 (Relobj::local_symbol_offset): New function.
3218 (Relobj::do_output_local_symbol_count): New function.
3219 (Relobj::do_local_symbol_offset): New function.
3220 (Sized_relobj::do_output_local_symbol_count): New function.
3221 (Sized_relobj::do_local_symbol_offset): New function.
3222
3223 2011-04-22 Vladimir Simonov <sv@sw.ru>
3224
3225 * descriptors.cc (set_close_on_exec): New function.
3226 (Descriptors::open): Use set_close_on_exec.
3227 * output.cc (S_ISLNK): Define if not defined.
3228
3229 2011-04-22 Cary Coutant <ccoutant@google.com>
3230
3231 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3232 global symbol map.
3233 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3234 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3235 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3236 relocations.
3237 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3238 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3239 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3240 * incremental.h
3241 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3242 function.
3243 (Incremental_binary::apply_incremental_relocs): New function.
3244 (Incremental_binary::do_apply_incremental_relocs): New function.
3245 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3246 data member.
3247 (Sized_incremental_binary::add_global_symbol): New function.
3248 (Sized_incremental_binary::global_symbol): New function.
3249 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3250 (Sized_incremental_binary::symbol_map_): New data member.
3251 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3252 * target.h (Sized_target::apply_relocation): New function.
3253 * target-reloc.h (apply_relocation): New function.
3254 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3255
3256 2011-04-22 Doug Kwan <dougkwan@google.com>
3257
3258 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3259 flag of a SHT_ARM_EXIDX section.
3260 * testsuite/Makefile.am (arm_exidx_test): New test rules.
3261 * testsuite/Makefile.in: Regenerate.
3262 * testsuite/arm_exidx_test.s: New file.
3263 * testsuite/arm_exidx_test.sh: Same.
3264
3265 2011-04-20 Cary Coutant <ccoutant@google.com>
3266
3267 PR gold/12689
3268 * archive.h (Incremental_archive_entry::Archive_member):
3269 Initialize arg_serial_ (second constructor).
3270
3271 2011-04-17 Ian Lance Taylor <iant@google.com>
3272
3273 * object.cc (Relocate_info::location): Simplify location string.
3274 * errors.cc (Errors::error_at_location): Don't print program
3275 name.
3276 (Errors::warning_at_location): Likewise.
3277 (Errors::undefined_symbol): Likewise.
3278 * testsuite/debug_msg.sh: Update accordingly.
3279
3280 2011-04-14 Cary Coutant <ccoutant@google.com>
3281
3282 * gold/layout.cc (Layout::symtab_section_offset): New function.
3283 * gold/layout.h (Layout::symtab_section_offset): New function.
3284 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3285
3286 2011-04-12 Ian Lance Taylor <iant@google.com>
3287
3288 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3289 with MREMAP_MAYMOVE.
3290 * output.h (class Output_file): Add map_is_allocated_ field.
3291 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3292 not available, provide stubs. If mremap is not available, #define
3293 it to gold_mremap.
3294 (MREMAP_MAYMOVE): Define if not defined.
3295 (Output_file::Output_file): Initialize map_is_allocated_.
3296 (Output_file::resize): Check map_is_allocated_.
3297 (Output_file::map_anonymous): If mmap fails, use malloc.
3298 (Output_file::unmap): Don't do anything for an anonymous map.
3299 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3300 is not available, provide stubs.
3301 (File_read::View::~View): Use free rather than delete[].
3302 (File_read::make_view): Use malloc rather than new[]. If mmap
3303 fails, use malloc.
3304 (File_read::find_or_make_view): Use malloc rather than new[].
3305 * gold.h: Remove HAVE_REMAP code.
3306 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3307 exists. Rename mremap to gold_mremap. If mmap is not available
3308 don't do anything.
3309 * configure, config.in: Rebuild.
3310
3311 2011-04-11 Ian Lance Taylor <iant@google.com>
3312
3313 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3314 initialize local variable v.
3315
3316 2011-04-11 Cary Coutant <ccoutant@google.com>
3317
3318 * archive.cc (Archive::include_member): Adjust call to
3319 report_object.
3320 (Add_archive_symbols::run): Track argument serial numbers.
3321 (Lib_group::include_member): Likewise.
3322 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3323 * archive.h (Incremental_archive_entry::Archive_member):
3324 Initialize arg_serial_.
3325 (Archive_member::arg_serial_): New data member.
3326 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3327 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3328 incremental link.
3329 (Sized_dynobj::do_for_all_local_got_entries): New function.
3330 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3331 function.
3332 * fileread.cc (get_mtime): New function.
3333 * fileread.h (get_mtime): New function.
3334 * gold.cc (queue_initial_tasks): Check for incremental update.
3335 (process_incremental_input): New function.
3336 (queue_middle_tasks): Don't force valid target for incremental
3337 update.
3338 * incremental-dump.cc (find_input_containing_global): Adjust
3339 size of symbol info entry.
3340 (dump_incremental_inputs): Dump argument serial number and
3341 in_system_directory flag; bias shndx by 1; print symbol names
3342 when dumping per-file symbol lists; use new symbol info readers.
3343 * incremental.cc
3344 (Output_section_incremental_inputs:update_data_size): New function.
3345 (Sized_incremental_binary::setup_readers): Setup input readers
3346 for each input file; build maps for files added from libraries
3347 and scripts.
3348 (Sized_incremental_binary::check_input_args): New function.
3349 (Sized_incremental_binary::do_check_inputs): Build map of argument
3350 serial numbers to input arguments.
3351 (Sized_incremental_binary::do_file_has_changed): Rename
3352 do_file_is_unchanged to this; compare file modification times.
3353 (Sized_incremental_binary::do_init_layout): New function.
3354 (Sized_incremental_binary::do_reserve_layout): New function.
3355 (Sized_incremental_binary::do_get_input_reader): Remove.
3356 (Sized_incremental_binary::get_symtab_view): New function.
3357 (Incremental_checker::can_incrementally_link_output_file): Remove.
3358 (Incremental_inputs::report_command_line): Exclude --debug options.
3359 (Incremental_inputs::report_archive_begin): Add parameter; track
3360 argument serial numbers; don't put input file entry for archive
3361 before archive members.
3362 (Incremental_inputs::report_archive_end): Put input file entry
3363 for archive after archive members.
3364 (Incremental_inputs::report_object): Add parameter; track argument
3365 serial numbers and in_system_directory flag.
3366 (Incremental_inputs::report_script): Add parameter; track argument
3367 serial numbers.
3368 (Output_section_incremental_inputs::set_final_data_size): Adjust
3369 size of symbol info entry; check for forwarding symbols.
3370 (Output_section_incremental_inputs::write_input_files): Write
3371 in_system_directory flag and argument serial number.
3372 (Output_section_incremental_inputs::write_info_blocks): Map section
3373 indices between incremental info and original input file; store
3374 input section index for each symbol.
3375 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3376 change operator() to visit().
3377 (class Global_got_offset_visitor): Likewise.
3378 (class Global_symbol_visitor_got_plt):
3379 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3380 classes.
3381 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3382 (Sized_incr_relobj::do_read_symbols): New function.
3383 (Sized_incr_relobj::do_layout): New function.
3384 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3385 (Sized_incr_relobj::do_add_symbols): New function.
3386 (Sized_incr_relobj::do_should_include_member): New function.
3387 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3388 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3389 (Sized_incr_relobj::do_section_size): New function.
3390 (Sized_incr_relobj::do_section_name): New function.
3391 (Sized_incr_relobj::do_section_contents): New function.
3392 (Sized_incr_relobj::do_section_flags): New function.
3393 (Sized_incr_relobj::do_section_entsize): New function.
3394 (Sized_incr_relobj::do_section_address): New function.
3395 (Sized_incr_relobj::do_section_type): New function.
3396 (Sized_incr_relobj::do_section_link): New function.
3397 (Sized_incr_relobj::do_section_info): New function.
3398 (Sized_incr_relobj::do_section_addralign): New function.
3399 (Sized_incr_relobj::do_initialize_xindex): New function.
3400 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3401 (Sized_incr_relobj::do_read_relocs): New function.
3402 (Sized_incr_relobj::do_gc_process_relocs): New function.
3403 (Sized_incr_relobj::do_scan_relocs): New function.
3404 (Sized_incr_relobj::do_count_local_symbols): New function.
3405 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3406 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3407 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3408 (Sized_incr_relobj::do_relocate): New function.
3409 (Sized_incr_relobj::do_set_section_offset): New function.
3410 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3411 (Sized_incr_dynobj::do_read_symbols): New function.
3412 (Sized_incr_dynobj::do_layout): New function.
3413 (Sized_incr_dynobj::do_add_symbols): New function.
3414 (Sized_incr_dynobj::do_should_include_member): New function.
3415 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3416 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3417 (Sized_incr_dynobj::do_section_size): New function.
3418 (Sized_incr_dynobj::do_section_name): New function.
3419 (Sized_incr_dynobj::do_section_contents): New function.
3420 (Sized_incr_dynobj::do_section_flags): New function.
3421 (Sized_incr_dynobj::do_section_entsize): New function.
3422 (Sized_incr_dynobj::do_section_address): New function.
3423 (Sized_incr_dynobj::do_section_type): New function.
3424 (Sized_incr_dynobj::do_section_link): New function.
3425 (Sized_incr_dynobj::do_section_info): New function.
3426 (Sized_incr_dynobj::do_section_addralign): New function.
3427 (Sized_incr_dynobj::do_initialize_xindex): New function.
3428 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3429 (make_sized_incremental_object): New function.
3430 (Incremental_library::copy_unused_symbols): New function.
3431 (Incremental_library::do_for_all_unused_symbols): New function.
3432 * incremental.h (enum Incremental_input_flags): New type.
3433 (class Incremental_checker): Remove.
3434 (Incremental_input_entry::Incremental_input_entry): Add argument
3435 serial number.
3436 (Incremental_input_entry::arg_serial): New function.
3437 (Incremental_input_entry::set_is_in_system_directory): New function.
3438 (Incremental_input_entry::is_in_system_directory): New function.
3439 (Incremental_input_entry::arg_serial_): New data member.
3440 (Incremental_input_entry::is_in_system_directory_): New data member.
3441 (class Script_info): Move here from script.h.
3442 (Script_info::Script_info): Add filename parameter.
3443 (Script_info::filename): New function.
3444 (Script_info::filename_): New data member.
3445 (Incremental_script_entry::Incremental_script_entry): Add argument
3446 serial number.
3447 (Incremental_object_entry::Incremental_object_entry): Likewise.
3448 (Incremental_object_entry::add_input_section): Build list of input
3449 sections with map to original shndx.
3450 (Incremental_object_entry::get_input_section_index): New function.
3451 (Incremental_object_entry::shndx_): New data member.
3452 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3453 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3454 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3455 serial number.
3456 (Incremental_inputs::report_archive_begin): Likewise.
3457 (Incremental_inputs::report_object): Likewise.
3458 (Incremental_inputs::report_script): Likewise.
3459 (class Incremental_global_symbol_reader): New class.
3460 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3461 and store flags and input file type.
3462 (Incremental_input_entry_reader::arg_serial): New function.
3463 (Incremental_input_entry_reader::type): Extract type from flags.
3464 (Incremental_input_entry_reader::is_in_system_directory): New function.
3465 (Incremental_input_entry_reader::get_input_section_count): Call
3466 accessor function for type.
3467 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3468 function for type; adjust size of global symbol entry.
3469 (Incremental_input_entry_reader::get_global_symbol_count): Call
3470 accessor function for type.
3471 (Incremental_input_entry_reader::get_object_count): Likewise.
3472 (Incremental_input_entry_reader::get_object_offset): Likewise.
3473 (Incremental_input_entry_reader::get_member_count): Likewise.
3474 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3475 (Incremental_input_entry_reader::get_member_offset): Likewise.
3476 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3477 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3478 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3479 (Incremental_input_entry_reader::get_global_symbol_reader): New
3480 function.
3481 (Incremental_input_entry_reader::get_output_symbol_index): New
3482 function.
3483 (Incremental_input_entry_reader::type_): Remove.
3484 (Incremental_input_entry_reader::flags_): New data member.
3485 (Incremental_inputs_reader::input_file_offset): New function.
3486 (Incremental_inputs_reader::input_file_index): New function.
3487 (Incremental_inputs_reader::input_file): Call input_file_offset.
3488 (Incremental_inputs_reader::input_file_at_offset): New function.
3489 (Incremental_relocs_reader::get_r_type): Reformat.
3490 (Incremental_relocs_reader::get_r_shndx): Reformat.
3491 (Incremental_relocs_reader::get_r_offset): Reformat.
3492 (Incremental_relocs_reader::data): New function.
3493 (Incremental_binary::Incremental_binary): Initialize new data members.
3494 (Incremental_binary::check_inputs): Add cmdline parameter.
3495 (Incremental_binary::file_is_unchanged): Remove.
3496 (Input_reader::arg_serial): New function.
3497 (Input_reader::get_unused_symbol_count): New function.
3498 (Input_reader::get_unused_symbol): New function.
3499 (Input_reader::do_arg_serial): New function.
3500 (Input_reader::do_get_unused_symbol_count): New function.
3501 (Input_reader::do_get_unused_symbol): New function.
3502 (Incremental_binary::input_file_count): New function.
3503 (Incremental_binary::get_input_reader): Change signature to use
3504 index instead of filename.
3505 (Incremental_binary::file_has_changed): New function.
3506 (Incremental_binary::get_input_argument): New function.
3507 (Incremental_binary::get_library): New function.
3508 (Incremental_binary::get_script_info): New function.
3509 (Incremental_binary::init_layout): New function.
3510 (Incremental_binary::reserve_layout): New function.
3511 (Incremental_binary::output_file): New function.
3512 (Incremental_binary::do_check_inputs): New function.
3513 (Incremental_binary::do_file_is_unchanged): Remove.
3514 (Incremental_binary::do_file_has_changed): New function.
3515 (Incremental_binary::do_init_layout): New function.
3516 (Incremental_binary::do_reserve_layout): New function.
3517 (Incremental_binary::do_input_file_count): New function.
3518 (Incremental_binary::do_get_input_reader): Change signature.
3519 (Incremental_binary::input_args_map_): New data member.
3520 (Incremental_binary::library_map_): New data member.
3521 (Incremental_binary::script_map_): New data member.
3522 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3523 new data members.
3524 (Sized_incremental_binary::output_section): New function.
3525 (Sized_incremental_binary::inputs_reader): Add const.
3526 (Sized_incremental_binary::symtab_reader): Add const.
3527 (Sized_incremental_binary::relocs_reader): Add const.
3528 (Sized_incremental_binary::got_plt_reader): Add const.
3529 (Sized_incremental_binary::get_symtab_view): New function.
3530 (Sized_incremental_binary::Inputs_reader): New typedef.
3531 (Sized_incremental_binary::Input_entry_reader): New typedef.
3532 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3533 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3534 (Sized_incremental_binary::do_file_has_changed): New function.
3535 (Sized_incremental_binary::do_init_layout): New function.
3536 (Sized_incremental_binary::do_reserve_layout): New function.
3537 (Sized_input_reader::Inputs_reader): Remove.
3538 (Sized_input_reader::Input_entry_reader): Remove.
3539 (Sized_input_reader::do_arg_serial): New function.
3540 (Sized_input_reader::do_get_unused_symbol_count): New function.
3541 (Sized_input_reader::do_get_unused_symbol): New function.
3542 (Sized_incremental_binary::do_input_file_count): New function.
3543 (Sized_incremental_binary::do_get_input_reader): Change signature;
3544 use index instead of filename.
3545 (Sized_incremental_binary::section_map_): New data member.
3546 (Sized_incremental_binary::input_entry_readers_): New data member.
3547 (class Sized_incr_relobj): New class.
3548 (class Sized_incr_dynobj): New class.
3549 (make_sized_incremental_object): New function.
3550 (class Incremental_library): New class.
3551 * layout.cc (Free_list::num_lists): New static data member.
3552 (Free_list::num_nodes): New static data member.
3553 (Free_list::num_removes): New static data member.
3554 (Free_list::num_remove_visits): New static data member.
3555 (Free_list::num_allocates): New static data member.
3556 (Free_list::num_allocate_visits): New static data member.
3557 (Free_list::init): New function.
3558 (Free_list::remove): New function.
3559 (Free_list::allocate): New function.
3560 (Free_list::dump): New function.
3561 (Free_list::print_stats): New function.
3562 (Layout_task_runner::run): Resize output file for incremental updates.
3563 (Layout::Layout): Initialize new data members.
3564 (Layout::set_incremental_base): New function.
3565 (Layout::init_fixed_output_section): New function.
3566 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3567 incremental updates.
3568 (Layout::create_gold_note): Do not create gold note section for
3569 incremental updates.
3570 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3571 for incremental updates.
3572 (Layout::set_section_offsets): For incremental updates, allocate space
3573 from free list.
3574 (Layout::create_symtab_sections): Layout with offsets relative to
3575 start of section; for incremental updates, allocate space from free
3576 list.
3577 (Layout::create_shdrs): For incremental updates, allocate space from
3578 free list.
3579 (Layout::finish_dynamic_section): For incremental updates, do not
3580 check --as-needed (fixed in subsequent patch).
3581 * layout.h (class Free_list): New class.
3582 (Layout::set_incremental_base): New function.
3583 (Layout::incremental_base): New function.
3584 (Layout::init_fixed_output_section): New function.
3585 (Layout::allocate): New function.
3586 (Layout::incremental_base_): New data member.
3587 (Layout::free_list_): New data member.
3588 * main.cc (main): Print Free_list statistics.
3589 * object.cc (Relobj::finalize_incremental_relocs): Add
3590 clear_counts parameter; clear counts only when clear_counts is set.
3591 (Sized_relobj::Sized_relobj): Initialize new base class.
3592 (Sized_relobj::do_layout): Don't report special sections.
3593 (Sized_relobj::do_for_all_local_got_entries): New function.
3594 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3595 symtab_off to all symbol table offsets.
3596 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3597 * object.h (class Got_offset_list): Move to top of file.
3598 (Object::Object): Allow case where input_file == NULL.
3599 (Object::~Object): Likewise.
3600 (Object::input_file): Assert that input_file != NULL.
3601 (Object::lock): Allow case where input_file == NULL.
3602 (Object::unlock): Likewise.
3603 (Object::is_locked): Likewise.
3604 (Object::token): Likewise.
3605 (Object::release): Likewise.
3606 (Object::is_incremental): New function.
3607 (Object::get_mtime): New function.
3608 (Object::for_all_local_got_entries): New function.
3609 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3610 (Object::set_is_in_system_directory): New function.
3611 (Object::is_in_system_directory): New function.
3612 (Object::do_is_incremental): New function.
3613 (Object::do_get_mtime): New function.
3614 (Object::do_for_all_local_got_entries): New function.
3615 (Object::is_in_system_directory_): New data member.
3616 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3617 (class Sized_relobj_base): New class.
3618 (class Sized_relobj): Derive from Sized_relobj_base.
3619 (class Sized_relobj::Symbols): Redeclare from base class.
3620 (class Sized_relobj::local_got_offset_list): Remove.
3621 (class Sized_relobj::Output_sections): Redeclare from base class.
3622 (class Sized_relobj::do_for_all_local_got_entries): New function.
3623 (class Sized_relobj::write_local_symbols): Add offset parameter.
3624 (class Sized_relobj::local_symbol_offset_): Update comment.
3625 (class Sized_relobj::local_dynsym_offset_): Update comment.
3626 * options.cc (Input_arguments::add_file): Remove const.
3627 * options.h (Input_file_argument::Input_file_argument):
3628 Initialize arg_serial_ (all constructors).
3629 (Input_file_argument::set_arg_serial): New function.
3630 (Input_file_argument::arg_serial): New function.
3631 (Input_file_argument::arg_serial_): New data member.
3632 (Input_arguments::Input_arguments): Initialize file_count_.
3633 (Input_arguments::add_file): Remove const.
3634 (Input_arguments::number_of_input_files): New function.
3635 (Input_arguments::file_count_): New data member.
3636 (Command_line::number_of_input_files): Call
3637 Input_arguments::number_of_input_files.
3638 * output.cc (Output_segment_headers::Output_segment_headers):
3639 Set current size.
3640 (Output_section::Input_section::current_data_size): New function.
3641 (Output_section::Output_section): Initialize new data members.
3642 (Output_section::add_input_section): Don't do merge sections for
3643 an incremental link; allocate space from free list for an
3644 incremental update.
3645 (Output_section::add_output_section_data): Allocate space from
3646 free list for an incremental update.
3647 (Output_section::update_data_size): New function.
3648 (Output_section::set_fixed_layout): New function.
3649 (Output_section::reserve): New function.
3650 (Output_segment::set_section_addresses): Remove const.
3651 (Output_segment::set_section_list_addresses): Remove const; allocate
3652 space from free list for an incremental update.
3653 (Output_segment::set_offset): Adjust size of RELRO segment for an
3654 incremental update.
3655 * output.h (Output_data::current_data_size): Move here from
3656 child classes.
3657 (Output_data::pre_finalize_data_size): New function.
3658 (Output_data::update_data_size): New function.
3659 (Output_section_headers::update_data_size): new function.
3660 (Output_section_data_build::current_data_size): Move to Output_data.
3661 (Output_data_strtab::update_data_size): New function.
3662 (Output_section::current_data_size): Move to Output_data.
3663 (Output_section::set_fixed_layout): New function.
3664 (Output_section::has_fixed_layout): New function.
3665 (Output_section::reserve): New function.
3666 (Output_section::update_data_size): New function.
3667 (Output_section::has_fixed_layout_): New data member.
3668 (Output_section::free_list_): New data member.
3669 (Output_segment::set_section_addresses): Remove const.
3670 (Output_segment::set_section_list_addresses): Remove const.
3671 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3672 New function.
3673 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3674 New function.
3675 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3676 parameter when calling Add_symbols constructor; store argument
3677 serial number for members of a lib group.
3678 (Add_symbols::locks): Allow case where token == NULL.
3679 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3680 (Read_member::~Read_member): New function.
3681 (Read_member::is_runnable): New function.
3682 (Read_member::locks): New function.
3683 (Read_member::run): New function.
3684 (Check_script::~Check_script): New function.
3685 (Check_script::is_runnable): New function.
3686 (Check_script::locks): New function.
3687 (Check_script::run): New function.
3688 (Check_library::~Check_library): New function.
3689 (Check_library::is_runnable): New function.
3690 (Check_library::locks): New function.
3691 (Check_library::run): New function.
3692 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3693 (Add_symbols::library_): New data member.
3694 (class Read_member): New class.
3695 (class Check_script): New class.
3696 (class Check_library): New class.
3697 * reloc.cc (Read_relocs::is_runnable): Allow case where
3698 token == NULL.
3699 (Read_relocs::locks): Likewise.
3700 (Scan_relocs::locks): Likewise.
3701 (Relocate_task::locks): Likewise.
3702 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3703 to clear counters.
3704 (Sized_relobj::incremental_relocs_scan): Fix comment.
3705 (Sized_relobj::do_relocate): Pass output file offset to
3706 write_local_symbols.
3707 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3708 from class declaration.
3709 * script.cc (read_input_script): Allocate Script_info; pass
3710 argument serial number to report_script.
3711 * script.h (class Script_info): Move to incremental.h.
3712 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3713 * symtab.h (Symbol_table::add_from_incrobj): New function.
3714 (Symbol_table::set_file_offset): New function.
3715
3716 2011-04-05 Cary Coutant <ccoutant@google.com>
3717
3718 * incremental-dump.cc (dump_incremental_inputs): Change signature
3719 to take a Sized_incremental_binary; change caller. Use readers
3720 in Sized_incremental_binary.
3721 * incremental.cc
3722 (Sized_incremental_binary::find_incremental_inputs_sections):
3723 Rename do_find_incremental_inputs_sections to this.
3724 (Sized_incremental_binary::setup_readers): New function.
3725 (Sized_incremental_binary::do_check_inputs): Check
3726 has_incremental_info_ flag; move setup code to setup_readers;
3727 use input readers.
3728 (Sized_incremental_binary::do_file_is_unchanged): New function.
3729 (Sized_incremental_binary::do_get_input_reader): New function.
3730 * incremental.h (class Incremental_binary): Move to end of file.
3731 (Incremental_binary::file_is_unchanged): New function.
3732 (Incremental_binary::do_file_is_unchanged): New function.
3733 (Incremental_binary::Input_reader): New class.
3734 (Incremental_binary::get_input_reader): New function.
3735 (class Sized_incremental_binary): Move to end of file.
3736 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3737 input section reader classes.
3738 (Sized_incremental_binary::has_incremental_info): New function.
3739 (Sized_incremental_binary::inputs_reader): New function.
3740 (Sized_incremental_binary::symtab_reader): New function.
3741 (Sized_incremental_binary::relocs_reader): New function.
3742 (Sized_incremental_binary::got_plt_reader): New function.
3743 (Sized_incremental_binary::do_file_is_unchanged): New function.
3744 (Sized_incremental_binary::Sized_input_reader): New class.
3745 (Sized_incremental_binary::get_input_reader): New function.
3746 (Sized_incremental_binary::find_incremental_inputs_sections):
3747 Rename do_find_incremental_inputs_sections to this.
3748 (Sized_incremental_binary::setup_readers): New function.
3749 (Sized_incremental_binary::has_incremental_info_): New data member.
3750 (Sized_incremental_binary::inputs_reader_): New data member.
3751 (Sized_incremental_binary::symtab_reader_): New data member.
3752 (Sized_incremental_binary::relocs_reader_): New data member.
3753 (Sized_incremental_binary::got_plt_reader_): New data member.
3754 (Sized_incremental_binary::current_input_file_): New data member.
3755
3756 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3757
3758 PR gold/12640
3759 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3760 violation.
3761
3762 2011-03-30 Cary Coutant <ccoutant@google.com>
3763
3764 * archive.cc (Archive::include_member): Adjust call to report_object.
3765 (Add_archive_symbols::run): Add script_info to call to
3766 report_archive_begin.
3767 (Lib_group::include_member): Adjust call to report_object.
3768 (Add_lib_group_symbols::run): Adjust call to report_object.
3769 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3770 blocks. Add object count for script input files.
3771 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3772 script_info parameter; change all callers.
3773 (Incremental_inputs::report_object): Add script_info parameter;
3774 change all callers.
3775 (Incremental_inputs::report_script): Store backpointer to
3776 incremental info entry.
3777 (Output_section_incremental_inputs::set_final_data_size): Record
3778 additional information for scripts.
3779 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3780 * incremental.h (Incremental_script_entry::add_object): New function.
3781 (Incremental_script_entry::get_object_count): New function.
3782 (Incremental_script_entry::get_object): New function.
3783 (Incremental_script_entry::objects_): New data member; adjust
3784 constructor.
3785 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3786 (Incremental_inputs::report_object): Add script_info parameter.
3787 (Incremental_inputs_reader::get_object_count): New function.
3788 (Incremental_inputs_reader::get_object_offset): New function.
3789 * options.cc (Input_arguments::add_file): Return reference to
3790 new input argument.
3791 * options.h (Input_argument::set_script_info): New function.
3792 (Input_argument::script_info): New function.
3793 (Input_argument::script_info_): New data member; adjust all
3794 constructors.
3795 (Input_file_group::add_file): Return reference to new input argument.
3796 (Input_file_lib::add_file): Likewise.
3797 (Input_arguments::add_file): Likewise.
3798 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3799 * script.cc (Parser_closure::Parser_closure): Add script_info
3800 parameter; adjust all callers.
3801 (Parser_closure::script_info): New function.
3802 (Parser_closure::script_info_): New data member.
3803 (read_input_script): Report scripts earlier to incremental info.
3804 (script_add_file): Set script_info in Input_argument.
3805 (script_add_library): Likewise.
3806 * script.h (Script_options::Script_info): Rewrite class.
3807
3808 2011-03-29 Cary Coutant <ccoutant@google.com>
3809
3810 * archive.cc (Library_base::should_include_member): Move
3811 method here from class Archive.
3812 (Archive::Archive): Initialize base class.
3813 (Archive::should_include_member): Move to base class.
3814 (Archive::do_for_all_unused_symbols): New function.
3815 (Add_archive_symbols::run): Remove redundant access to
3816 incremental_inputs.
3817 (Lib_group::Lib_group): Initialize base class.
3818 (Lib_group::do_filename): New function.
3819 (Lib_group::include_member): Pass pointer to Lib_group to
3820 report_object.
3821 (Lib_group::do_for_all_unused_symbols): New function.
3822 (Add_lib_group_symbols::run): Report archive information for
3823 incremental links.
3824 * archive.h (class Library_base): New base class.
3825 (class Archive): Derive from Library_base.
3826 (Archive::filename): Move to base class.
3827 (Archive::set_incremental_info): Likewise.
3828 (Archive::incremental_info): Likewise.
3829 (Archive::Should_include): Likewise.
3830 (Archive::should_include_member): Likewise.
3831 (Archive::Armap_entry): Remove.
3832 (Archive::Unused_symbol_iterator): Remove.
3833 (Archive::unused_symbols_begin): Remove.
3834 (Archive::unused_symbols_end): Remove.
3835 (Archive::do_filename): New function.
3836 (Archive::do_get_mtime): New function.
3837 (Archive::do_for_all_unused_symbols): New function.
3838 (Archive::task_): Move to base class.
3839 (Archive::incremental_info_): Likewise.
3840 (class Lib_group): Derive from Library_base.
3841 (Lib_group::do_filename): New function.
3842 (Lib_group::do_get_mtime): New function.
3843 (Lib_group::do_for_all_unused_symbols): New function.
3844 (Lib_group::task_): Move to base class.
3845 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3846 function.
3847 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3848 function.
3849 * incremental.cc (Incremental_inputs::report_archive_begin):
3850 Use Library_base; call library's get_mtime; add incremental inputs
3851 entry before members.
3852 (class Unused_symbol_visitor): New class.
3853 (Incremental_inputs::report_archive_end): Use Library_base; use
3854 visitor class to record unused symbols; don't add incremental inputs
3855 entry after members.
3856 (Incremental_inputs::report_object): Use Library_base.
3857 * incremental.h
3858 (Incremental_archive_entry::Incremental_archive_entry): Remove
3859 unused Archive parameter.
3860 (Incremental_inputs::report_archive_begin): Use Library_base.
3861 (Incremental_inputs::report_archive_end): Likewise.
3862 (Incremental_inputs::report_object): Likewise.
3863 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3864 function.
3865 * object.h (Object::for_all_global_symbols): New function.
3866 (Object::do_for_all_global_symbols): New function.
3867 (Sized_relobj::do_for_all_global_symbols): New function.
3868 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3869 function.
3870 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3871 function.
3872
3873 2011-03-27 Ian Lance Taylor <iant@google.com>
3874
3875 * archive.cc (Archive::interpret_header): Return -1 if something
3876 goes wrong. Change callers accordingly.
3877
3878 2011-03-25 Cary Coutant <ccoutant@google.com>
3879
3880 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3881 * testsuite/Makefile.in: Regenerate.
3882
3883 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3884
3885 * plugin.cc (get_view): New.
3886 (Plugin::load): Pass get_view to the plugin.
3887 (Plugin_manager::get_view): New.
3888
3889 2011-03-21 Ian Lance Taylor <iant@google.com>
3890
3891 * testsuite/final_layout.sh: Rewrite to not use dc.
3892 * testsuite/relro_test.sh: Fail if dc is not present.
3893
3894 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3895
3896 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3897 Change == to -eq.
3898 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3899 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3900 Change == to -eq.
3901 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3902 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3903
3904 2011-03-14 Ian Lance Taylor <iant@google.com>
3905
3906 * script-sections.cc (Sort_output_sections::script_compare):
3907 Rename from is_before, change return type.
3908 (Sort_output_sections::operator()): Adjust accordingly.
3909
3910 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3911
3912 PR gold/12572
3913 * testsuite/odr_violation2.cc: Add comment to make all error line
3914 numbers double digits.
3915 * testsuite/debug_msg.sh: Adjust expected errors.
3916
3917 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3918
3919 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3920 but mark earlier ones as non-canonical
3921 (offset_to_iterator): Update search target and example
3922 (do_addr2line): Return extra lines in a vector*
3923 (format_file_lineno): Extract from do_addr2line
3924 (one_addr2line): Add vector* out-param
3925 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3926 when a lineno entry appeared last for its instruction
3927 (Dwarf_line_info): Add vector* out-param
3928 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3929 * symtab.cc (Odr_violation_compare): Include the lineno in the
3930 comparison again.
3931 (linenos_from_loc): New. Combine the canonical line for an
3932 address with its other lines.
3933 (True_if_intersect): New. Helper functor to make
3934 std::set_intersection a query.
3935 (detect_odr_violations): Compare sets of lines instead of just
3936 one line for each function. This became less deterministic, but
3937 has fewer false positives.
3938 * symtab.h: Declarations.
3939 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3940 mix an optimized and non-optimized object in the same binary
3941 (odr_violation2.so): Same.
3942 * testsuite/Makefile.in: Regenerate from Makefile.am.
3943 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3944 * testsuite/debug_msg.sh: Update line numbers and add
3945 assertions.
3946 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3947 non-optimized context.
3948 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3949 isn't inlined, and use OdrDerived in an optimized context.
3950 * testsuite/odr_header1.h: Defines OdrDerived, where
3951 optimization will change the
3952 first-instruction-in-the-destructor's file and line number.
3953 * testsuite/odr_header2.h: Defines OdrBase.
3954
3955 2011-03-09 Ian Lance Taylor <iant@google.com>
3956
3957 * fileread.cc (File_read::clear_views): Don't delete the whole
3958 file view.
3959
3960 2011-03-08 Ian Lance Taylor <iant@google.com>
3961
3962 PR gold/12525
3963 * fileread.cc: #include <climits>.
3964 (GOLD_IOV_MAX): Define.
3965 (File_read::read_multiple): Limit number of entries by iov_max.
3966 * fileread.h (class File_read): Always set max_readv_entries to
3967 128.
3968
3969 2011-03-07 Ian Lance Taylor <iant@google.com>
3970
3971 PR gold/12525
3972 * options.h (class General_options): Add -dy and -dn.
3973
3974 2011-03-02 Cary Coutant <ccoutant@google.com>
3975
3976 * testsuite/script_test_9.t: Add TLS segment.
3977
3978 2011-03-02 Simon Baldwin <simonb@google.com>
3979
3980 * configure.ac: Add check for gnu_indirect_function support in
3981 the toolchain building binutils.
3982 * configure: Rebuild.
3983
3984 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3985
3986 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3987 plugin only symbols.
3988 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3989 in plugin files as not needed in the symbol table.
3990
3991 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3992
3993 * output.cc (Output_section::add_input_section): Delay fill
3994 generation for section ordering.
3995
3996 2011-02-09 Ian Lance Taylor <iant@google.com>
3997
3998 PR gold/12316
3999 * object.h (class Sized_relobj): Remove clear_local_symbols.
4000 * reloc.cc (Sized_relobj::do_relocate): Don't call
4001 clear_local_symbols.
4002
4003 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
4004
4005 * plugin.cc (is_visible_from_outside): Return true for symbols
4006 in the -u option.
4007
4008 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4009
4010 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4011 filename.
4012
4013 2011-02-02 Sriraman Tallam <tmsriram@google.com>
4014
4015 * icf.h (is_section_foldable_candidate): Change type of parameter
4016 to std::string.
4017 * icf.cc (Icf::find_identical_sections): Change type of local variable
4018 section_name to be std::string.
4019 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4020
4021 2011-01-25 Ian Lance Taylor <iant@google.com>
4022
4023 * script.cc (script_add_extern): Rewrite to use
4024 add_symbol_reference.
4025
4026 2011-01-25 Doug Kwan <dougkwan@google.com>
4027
4028 * icf.cc (get_section_contents): Always lock section's object.
4029
4030 2011-01-24 Ian Lance Taylor <iant@google.com>
4031
4032 * options.h (class General_options): Accept
4033 --no-detect-odr-violations.
4034
4035 2011-01-24 Ian Lance Taylor <iant@google.com>
4036
4037 * version.cc (version_string): Bump to 1.11.
4038
4039 2011-01-24 Ian Lance Taylor <iant@google.com>
4040
4041 * plugin.cc (class Plugin_rescan): Define new class.
4042 (Plugin_manager::claim_file): Set any_claimed_.
4043 (Plugin_manager::save_archive): New function.
4044 (Plugin_manager::save_input_group): New function.
4045 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4046 necessary.
4047 (Plugin_manager::new_undefined_symbol): New function.
4048 (Plugin_manager::rescan): New function.
4049 (Plugin_manager::rescannable_defines): New function.
4050 (Plugin_manager::add_input_file): Set any_added_.
4051 * plugin.h (class Plugin_manager): define new fields rescannable_,
4052 undefined_symbols_, any_claimed_, and any_added_. Declare
4053 Plugin_rescan as friend. Declare new functions.
4054 (Plugin_manager::Rescannable): Define type.
4055 (Plugin_manager::Rescannable_list): Define type.
4056 (Plugin_manager::Undefined_symbol_list): Define type.
4057 (Plugin_manager::Plugin_manager): Initialize new fields.
4058 * archive.cc (Archive::defines_symbol): New function.
4059 (Add_archive_symbols::run): Pass archive to plugins if any.
4060 * archive.h (class Archive): Declare defines_symbol.
4061 * readsyms.cc (Input_group::~Input_group): New function.
4062 (Finish_group::run): Pass input_group to plugins if any.
4063 * readsyms.h (class Input_group): Declare destructor.
4064 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4065 any.
4066
4067 2011-01-10 Ian Lance Taylor <iant@google.com>
4068
4069 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4070 section as relro.
4071 (Layout::set_segment_offsets): Reset increase_relro before calling
4072 set_section_addresses a second time.
4073
4074 2011-01-04 Cary Coutant <ccoutant@google.com>
4075
4076 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4077 sections before NOBITS sections.
4078
4079 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4080
4081 * version.cc (print_version): Update copyright to 2011.
4082
4083 2010-12-23 Cary Coutant <ccoutant@google.com>
4084
4085 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4086 of OS to this->add. Add OD parameter to second form of the function.
4087
4088 2010-12-20 Ian Lance Taylor <iant@google.com>
4089
4090 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4091 second of two consecutive entries with same offset.
4092
4093 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4094
4095 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4096 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4097 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4098 to avoid unneeded links against $(LDADD).
4099 * testsuite/Makefile.in: Regenerate.
4100
4101 2010-12-15 Ian Lance Taylor <iant@google.com>
4102
4103 PR gold/12324
4104 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4105 for R_X86_64_32 and R_X86_64_PC32.
4106 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4107 ver_matching_def_pic.o.
4108 (ver_matching_def_pic.o): New target.
4109
4110 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4111
4112 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4113 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4114 Move definition before File_read::View member definitions.
4115 (File_read::View::~View): Initialize and hold lock before
4116 updating current_mapped_bytes.
4117
4118 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4119
4120 * dwarf_reader.cc: Remove outdated comment.
4121 * gold-threads.cc: Fix typo in error message.
4122 * archive.cc: Fix typos in comments.
4123 * archive.h: Likewise.
4124 * arm-reloc-property.cc: Likewise.
4125 * arm-reloc-property.h: Likewise.
4126 * arm-reloc.def: Likewise.
4127 * arm.cc: Likewise.
4128 * attributes.h: Likewise.
4129 * cref.cc: Likewise.
4130 * ehframe.cc: Likewise.
4131 * fileread.h: Likewise.
4132 * gold.h: Likewise.
4133 * i386.cc: Likewise.
4134 * icf.cc: Likewise.
4135 * incremental.h: Likewise.
4136 * int_encoding.cc: Likewise.
4137 * layout.h: Likewise.
4138 * main.cc: Likewise.
4139 * merge.h: Likewise.
4140 * object.cc: Likewise.
4141 * object.h: Likewise.
4142 * options.cc: Likewise.
4143 * readsyms.cc: Likewise.
4144 * reduced_debug_output.cc: Likewise.
4145 * reloc.cc: Likewise.
4146 * script-sections.cc: Likewise.
4147 * sparc.cc: Likewise.
4148 * symtab.h: Likewise.
4149 * target-reloc.h: Likewise.
4150 * target.cc: Likewise.
4151 * target.h: Likewise.
4152 * timer.cc: Likewise.
4153 * timer.h: Likewise.
4154 * x86_64.cc: Likewise.
4155
4156 2010-12-09 Cary Coutant <ccoutant@google.com>
4157
4158 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4159 stack.
4160 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4161 parameter; change all callers.
4162 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4163 * options.h (warn_execstack): New option.
4164
4165 2010-12-07 Doug Kwan <dougkwan@google.com>
4166
4167 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4168 like function call relocations.
4169
4170 2010-12-07 Ian Lance Taylor <iant@google.com>
4171
4172 * archive.cc (Archive::get_elf_object_for_member): Permit
4173 punconfigured to be NULL.
4174 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4175 (Archive::include_member): Pass NULL to get_elf_object_for_member
4176 if we searched for the archive and this is the first included
4177 object.
4178
4179 2010-12-01 Ian Lance Taylor <iant@google.com>
4180
4181 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4182 track_relocs_type_ field.
4183 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4184 Set track_relocs_type_.
4185 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4186 contents when using RELA relocs.
4187 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4188 reloc_map_.
4189 * reloc.cc (Track_relocs::next_addend): New function.
4190 * reloc.h (class Track_relocs): Declare next_addend.
4191
4192 2010-12-01 Ian Lance Taylor <iant@google.com>
4193
4194 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4195 virtual destructor.
4196
4197 2010-12-01 Ian Lance Taylor <iant@google.com>
4198
4199 * README: Update compilers known to work and fail.
4200
4201 2010-11-23 Matthias Klose <doko@ubuntu.com>
4202
4203 * configure.in: For --enable-gold, handle value `default' instead of
4204 `both*'. Always install ld as ld.bfd, install as ld if gold is
4205 not the default.
4206 * configure: Regenerate.
4207
4208 2010-11-18 Doug Kwan <dougkwan@google.com>
4209
4210 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4211 and right_alignment to be zero. Store result alignment only if it is
4212 greater than existing alignment.
4213
4214 2010-11-16 Cary Coutant <ccoutant@google.com>
4215
4216 PR gold/12220
4217 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4218 Check for ".zdebug_line".
4219
4220 2010-11-16 Doug Kwan <dougkwan@google.com>
4221 Cary Coutant <ccoutant@google.com>
4222
4223 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4224 by reference; adjust all callers.
4225 * output.cc (Output_segment::set_section_addresses): Adjust references
4226 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4227 list is empty.
4228 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4229 end at page boundary.
4230
4231 2010-11-16 Cary Coutant <ccoutant@google.com>
4232
4233 PR gold/12220
4234 * layout.cc (Layout::choose_output_section): Transform names of
4235 compressed sections even when using a script with a SECTIONS clause.
4236 (Layout::output_section_name): Remove code to transform
4237 compressed debug section names.
4238 * output.cc (Output_section::add_input_section): Use uncompressed
4239 section size when tracking input sections.
4240
4241 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4242
4243 * symtab.h (Symbol::NON_PIC_REF): Remove.
4244 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4245 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4246 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4247 (Symbol::use_plt_offset): Take a flags argument and pass it
4248 directly to needs_dynamic_reloc. Restrict check for undefined
4249 weak symbols to function calls.
4250 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4251 (Target_arm::Scan::global): Use it.
4252 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4253 (Target_arm::Relocate::relocate): Likewise.
4254 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4255 parameter with an r_type parameter. Use get_reference_flags
4256 to get the flags.
4257 (Target_arm::Relocate::relocate): Update accordingly.
4258 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4259 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4260 (Target_i386::Scan::global): Likewise.
4261 (Target_i386::Relocate::relocate): Likewise.
4262 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4263 parameter with an r_type parameter. Use get_reference_flags
4264 to get the flags.
4265 (Target_i386::Relocate::relocate): Update accordingly.
4266 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4267 (Target_powerpc::Scan::global): Use it.
4268 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4269 (Target_powerpc::Relocate::relocate): Likewise.
4270 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4271 (Target_sparc::Scan::global): Use it.
4272 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4273 (Target_sparc::Relocate::relocate): Likewise.
4274 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4275 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4276 (Target_x86_64::Scan::global): Likewise.
4277 (Target_x86_64::Relocate::relocate): Likewise.
4278
4279 2010-11-08 Doug Kwan <dougkwan@google.com>
4280 Cary Coutant <ccoutant@google.com>
4281
4282 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4283 (Arm_exidx_merge_section::section_contents_): New data member.
4284 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4285 (Arm_input_section::~Arm_input_section): De-allocate memory.
4286 (Arm_input_section::original_contents_): New data member.
4287 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4288 in parameters instead of calling Object::section_contents without
4289 locking.
4290 (Arm_output_section::group_section): New parameter TASK. Pass it
4291 to callees that need locking objects.
4292 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4293 to lock EXIDX input sections. Fix a formatting issue. Call
4294 Arm_exidx_merged_section::build_contents to create merged section
4295 contents.
4296 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4297 to lock object of stub table owner.
4298 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4299 TEXT_SIZE to initialize data member TEXT_SIZE_.
4300 (Arm_exidx_input_section::addralign): Fix typo in comment.
4301 (Arm_exidx_input_section::text_size): New method.
4302 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4303 that require locking objects. Lock objects before scanning for stubs
4304 and updating local symbols.
4305 (Arm_input_section<big_endian>::init): Copy contents of original
4306 input section.
4307 (Arm_input_section<big_endian>::do_write): Use saved contents of
4308 original input section instead of calling Object::section_contents
4309 without locking.
4310 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4311 size without calling Object::section_size().
4312 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4313 for size. Allocate a buffer for merged EXIDX entries.
4314 (Arm_exidx_merged_section::build_contents): New method.
4315 (Arm_exidx_merged_section::do_write): Move merge section contents
4316 building code to Arm_exidx_merged_section::build_contetns. Write
4317 out contetns in buffer instead of building it on the fly.
4318 (Arm_relobj::make_exidx_input_section): Also pass text section size
4319 to Arm_exidx_input_section constructor.
4320 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4321 (Arm_dynobj::do_read_symbols): Fix memory leak.
4322 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4323 * target.h: (class Task): Add forward declaration.
4324 (Target::relax): Add new parameter TASK and pass it to
4325 Target::do_relax().
4326 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4327
4328 2010-11-05 Cary Coutant <ccoutant@google.com>
4329
4330 PR gold/10708
4331 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4332 object when reading from the file.
4333 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4334 second layout pass.
4335 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4336 when reading section contents.
4337 (get_section_contents): Likewise.
4338 (icf::find_identical_sections): Likewise.
4339 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4340 object when reading from the file.
4341 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4342 the object when doing deferred section layout.
4343
4344 2010-11-03 Nick Clifton <nickc@redhat.com>
4345
4346 PR gold/12001
4347 * script.h (class Symbol_assignment: name): New member. Returns
4348 the name of the symbol.
4349 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4350 Returns true if the given symbol name is on the list of
4351 assignments wating to be processed.
4352 * archive.cc (should_incldue_member): If the symbol is undefined,
4353 check to see if it is on the list of symbols pending assignment.
4354
4355 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4356
4357 * script-sections.cc (Script_sections::find_memory_region): Check
4358 for a NULL output section pointer.
4359
4360 2010-10-29 Doug Kwan <dougkwan@google.com>
4361
4362 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4363 Output_section::add_relaxed_input_section.
4364 * output.cc (Output_section::add_relaxed_input_section): Add new
4365 arguments LAYOUT and NAME. Set section order index.
4366 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4367 Copy section order index.
4368 * output.h (Output_section::add_relaxed_input_section): Add new
4369 arguments LAYOUT and NAME.
4370
4371 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4372
4373 * testsuite/Makefile.am: Move gcctestdir/ld rule to
4374 NATIVE_OR_CROSS_LINKER.
4375 * testsuite/Makefile.in: Regenerate.
4376
4377 2010-10-20 Doug Kwan <dougkwan@google.com>
4378
4379 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4380 without SHF_LINK_ORDER flags.
4381 * layout.cc (Layout::choose_output_section): Do not filter
4382 SHF_LINK_ORDER flag in a relocatable link.
4383
4384 2010-10-17 Cary Coutant <ccoutant@google.com>
4385
4386 * output.h (Output_segment::set_section_addresses): Change function
4387 signature. Update all callers.
4388 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4389 sections.
4390 (Output_segment::set_section_addresses): Align after last TLS
4391 section. Add padding before last relro section instead of after.
4392
4393 2010-10-17 Doug Kwan <dougkwan@google.com>
4394
4395 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4396 GOT output section to be writable.
4397
4398 2010-10-14 Cary Coutant <ccoutant@google.com>
4399
4400 * debug.h (DEBUG_INCREMENTAL): New flag.
4401 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4402 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4403 mode.
4404 * incremental.cc (report_command_line): Ignore all forms of
4405 --incremental.
4406 * layout.cc (Layout::Layout): Check parameters for incremental link
4407 mode.
4408 * options.cc (General_options::parse_incremental): New function.
4409 (General_options::parse_no_incremental): New function.
4410 (General_options::parse_incremental_full): New function.
4411 (General_options::parse_incremental_update): New function.
4412 (General_options::incremental_mode_): New data member.
4413 (General_options::finalize): Check incremental_mode_.
4414 * options.h (General_options): Update help text for --incremental.
4415 Add --no-incremental, --incremental-full, --incremental-update.
4416 (General_options::Incremental_mode): New enum type.
4417 (General_options::incremental_mode): New function.
4418 (General_options::incremental_mode_): New data member.
4419 * parameters.cc (Parameters::incremental_mode_): New data member.
4420 (Parameters::set_options): Set incremental_mode_.
4421 (Parameters::set_incremental_full): New function.
4422 (Parameters::incremental): New function.
4423 (Parameters::incremental_update): New function.
4424 (set_parameters_incremental_full): New function.
4425 * parameters.h (Parameters::set_incremental_full): New function.
4426 (Parameters::incremental): New function.
4427 (Parameters::incremental_update): New function.
4428 (Parameters::incremental_mode_): New data member.
4429 (set_parameters_incremental_full): New function.
4430 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4431 incremental link mode.
4432 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4433 (Sized_relobj::do_relocate_sections): Likewise.
4434 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4435 option.
4436 * testsuite/Makefile.in: Regenerate.
4437 * testsuite/incremental_test.sh: Filter all forms of --incremental.
4438
4439 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4440
4441 * script-sections.h (class Script_sections): Make
4442 Sections_elements typedef public.
4443 * script-sections.cc (class Sort_output_sections): Add elements_
4444 field. Add constructor which sets it; change all callers.
4445 (Sort_output_sections::is_before): New function.
4446 (Sort_output_sections::operator()): Call is_before.
4447 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4448 conditional.
4449 * testsuite/script_test_10.sh: New test. Test script section
4450 order.
4451 * testsuite/script_test_10.t: Likewise.
4452 * testsuite/script_test_10.s: Likewise.
4453 * testsuite/Makefile.am: Wrap the cross linker tests and the
4454 common tests into NATIVE_OR_CROSS_LINKER.
4455 (check_SCRIPTS): Add script_test_10.sh.
4456 (check_DATA): Add script_test_10.stdout.
4457 (script_test_10.o, script_test_10): New targets.
4458 (script_test_10.stdout): New target.
4459 * configure, testsuite/Makefile.in: Regenerate.
4460
4461 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4462
4463 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4464 error for the deprecated relocations.
4465 (Target_arm::Scan::global): Likewise.
4466 (Target_arm::Relocate::relocate): Likewise.
4467
4468 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4469
4470 * fileread.cc (Input_file::find_file): Initialize *found_name
4471 and *namep when using the fallback search for case 4.
4472
4473 2010-10-11 Cary Coutant <ccoutant@google.com>
4474
4475 * options.h (class General_options): Redefine -z lazy as an alias for
4476 the negation of -z now.
4477
4478 2010-10-11 Ian Lance Taylor <iant@google.com>
4479
4480 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4481 binding.
4482
4483 2010-10-06 Nick Clifton <nickc@redhat.com>
4484
4485 * script-sections.cc(class Memory_region): Remove
4486 current_lma_offset_ field. Rename current_vma_offset_ to
4487 current_offset_. Add last_section_ field.
4488 (Memory_region::get_current_vma_address): Rename to
4489 get_current_address.
4490 (Memory_region::get_current_lma_address): Delete.
4491 (Memory_region::increment_vma_offset): Rename to
4492 increment_offset.
4493 (Memory_region::increment_lma_offset): Delete.
4494 (Memory_region::attributes_compatible): New method. Returns
4495 true if the provided section is compatible with the region.
4496 (Memory_region::get_last_section): New method. Returns the last
4497 section to use the region.
4498 (Memory_region::set_last_section): New method. Stores the last
4499 section to use the region.
4500 (Script_sections::block_in_region): New method. Returns true if
4501 a block of memory is contained within a region.
4502 (Script_sections::find_memory_region): New method. Locates a
4503 memory region to be used to set a VMA or LMA address.
4504 (Output_section_definition::set_section_addresses): Add code to
4505 check for addresses set by memory regions.
4506 (Output_segment::set_section_addresses): Remove memory region
4507 walking code.
4508 (Script_sections::create_segment): Add a warning if a header
4509 segment is created outside of any region.
4510 * script-sections.h (class Script_sections): Add prototypes for
4511 find_memory_region and block_in_region methods.
4512 * testsuite/memory_test.s: Use .long instead of .word.
4513 * testsuite/memory_test.t: Add some more output sections.
4514 * testsuite/memory_test.sh: Update expected output.
4515
4516 2010-10-02 Doug Kwan <dougkwan@google.com>
4517
4518 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4519 defintion to symtab.h
4520 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4521 declaration to defintion.
4522
4523 2010-10-01 Nick Clifton <nickc@redhat.com>
4524
4525 * expression.cc (eval): Replace dummy argument with NULL.
4526 (eval_maybe_dot): Check for a NULL result section pointer.
4527 (Symbol_expression::value): Likewise.
4528 (Dot_expression::value): Likewise.
4529 (BINARY_EXPRESSION): Likewise.
4530 (Max_expression::value): Likewise.
4531 (Min_expression::value): Likewise.
4532 (Absolute_expression::value): Likewise.
4533 (Addr_expression::value_from_output_section): Likewise.
4534 (Loaddddr_expression::value_from_output_section): Likewise.
4535 (Segment_start_expression::value): Likewise.
4536 * script-sections.cc
4537 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4538 argument with NULL.
4539 (Sections_elememt_dot_assignment::set_section_addresses):
4540 Likewise.
4541 (Output_data_expression::do_write_to_buffer): Likewise.
4542 (Output_section_definition::finalize_symbols): Likewise.
4543 (Output_section_definition::set_section_addresses): Likewise.
4544
4545 2010-09-30 Doug Kwan <dougkwan@google.com>
4546
4547 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4548
4549 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4550
4551 * target.h (Target::can_icf_inline_merge_sections): New virtual
4552 function.
4553 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4554 virtual function.
4555 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4556 virtual function.
4557 * icf.cc (get_section_contents): Inline merge sections only when
4558 target allows it.
4559
4560 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4561
4562 * configure: Regenerate.
4563
4564 2010-09-17 Ian Lance Taylor <iant@google.com>
4565
4566 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4567 * testsuite/Makefile.am (memory_test.o): New target.
4568 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4569 memory_test.t.
4570 * testsuite/Makefile.in: Rebuild.
4571
4572 2010-09-17 Doug Kwan <dougkwan@google.com>
4573
4574 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4575 defintion if relocation uses GOT entries of the symbol.
4576 * testsuite/icf_safe_test.sh: Fix test.
4577 * testsuite/icf_safe_so_test.sh: Fix test.
4578
4579 2010-09-16 Cary Coutant <ccoutant@google.com>
4580
4581 * script_sections.cc (class Memory_region): Remove "NULL" from
4582 vector initializations.
4583
4584 2010-09-15 Cary Coutant <ccoutant@google.com>
4585
4586 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4587 Resolve forwarding symbols.
4588
4589 2010-09-15 Doug Kwan <dougkwan@google.com>
4590
4591 * gold/testsuite/script_test_3.t: Add ARM special sections.
4592 * gold/testsuite/script_test_4.t: Same.
4593 * gold/testsuite/script_test_5.t: Same.
4594 * gold/testsuite/script_test_6.t: Same.
4595 * gold/testsuite/script_test_7.t: Same.
4596 * gold/testsuite/script_test_7.t: Same.
4597 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4598
4599 2010-09-14 Cary Coutant <ccoutant@google.com>
4600
4601 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4602 (Target_x86_64::Relocate::relocate_tls): Replace check for
4603 saw_tls_block_reloc_ with test for executable section.
4604
4605 2010-09-12 Cary Coutant <ccoutant@google.com>
4606
4607 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4608 position-independent executables to shared libraries need dynamic
4609 relocations.
4610 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4611 position-independent executables.
4612 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4613 * testsuite/Makefile.in: Regenerate.
4614
4615 2010-09-10 Nick Clifton <nickc@redhat.com>
4616
4617 PR gold/11997
4618 * testsuite/memory_test.t: Discard any sections that are not
4619 needed.
4620
4621 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4622
4623 PR gold/11996
4624 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4625 "This::" to work around a bug in gcc 4.2.
4626
4627 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4628
4629 2010-09-09 Rafael Espindola <espindola@google.com>
4630
4631 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4632 sections with different PF_X flags in the same segment.
4633 (Layout::find_first_load_seg): Search all segments to find the first
4634 one.
4635 * options.h (rosegment): New.
4636
4637 2010-09-08 Rafael Espindola <espindola@google.com>
4638
4639 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4640
4641 2010-09-08 Doug Kwan <dougkwan@google.com>
4642
4643 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4644 (Arm_relobj::do_relocate_sections): Add new parameter for output
4645 file to match the parent.
4646 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4647 of local symbols instead of input values. Update code to track
4648 changes in gold::relocate_section.
4649 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4650 (Sized_relobj::compute_final_local_value_internal): New methods.
4651 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4652 body into private version of Sized_relobj::compute_final_local_value.
4653 Call the inline method.
4654 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4655 merged symbol value if there is one.
4656 (Symbol_value::has_output_value): New method defintiion.
4657 (Sized_relobj::Compute_final_local_value_status): New enum type.
4658 (Sized_relobj::compute_final_local_value): New methods.
4659 (Sized_relobj::compute_final_local_value_internal): New methods.
4660 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4661 and arm_cortex_a8.sh.
4662 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4663 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4664 New tests.
4665 * Makefile.in: Regenerate.
4666 * testsuite/arm_bl_out_of_range.s: Update test.
4667 * testsuite/thumb_bl_out_of_range.s: Ditto.
4668 * testsuite/thumb_blx_out_of_range.s: Ditto.
4669 * testsuite/arm_branch_out_of_range.sh: New file.
4670 * testsuite/arm_cortex_a8.sh: Ditto.
4671 * testsuite/arm_cortex_a8_b.s: Ditto.
4672 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4673 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4674 * testsuite/arm_cortex_a8_bl.s: Ditto.
4675 * testsuite/arm_cortex_a8_blx.s: Ditto.
4676 * testsuite/arm_cortex_a8_local.s: Ditto.
4677 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4678 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4679
4680 2010-09-08 Rafael Espindola <espindola@google.com>
4681
4682 * Makefile.am (memory_test.stdout): Run readelf with -W.
4683 * Makefile.in: Regenerate.
4684 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4685 64 bit output.
4686
4687 2010-09-08 Rafael Espindola <espindola@google.com>
4688
4689 * script-sections.cc (Script_sections::add_memory_region): Convert
4690 field precision to int.
4691 * script.cc (script_set_section_region, script_set_section_region):
4692 Convert field precision to int.
4693
4694 2010-09-08 Rafael Espindola <espindola@google.com>
4695
4696 * arm.cc (do_finalize_sections): Create the __exidx_start and
4697 __exdix_end symbols even when the section is missing.
4698
4699 2010-09-08 Nick Clifton <nickc@redhat.com>
4700
4701 * README: Remove claim that MEMORY is not supported.
4702 * expression.cc (script_exp_function_origin)
4703 (script_exp_function_length): Move from here to ...
4704 * script.cc: ... here.
4705 (script_set_section_region, script_add_memory)
4706 (script_parse_memory_attr, script_include_directive): New
4707 functions.
4708 * script-sections.cc
4709 (class Memory_region): New class.
4710 (class Output_section_definition): Add set_memory_region,
4711 set_section_vma, set_section_lma and get_section_name methods.
4712 (class Script_Sections): Add add_memory_region,
4713 find_memory_region, find_memory_region_origin,
4714 find_memory_region_length and set_memory_region methods.
4715 Have set_section_addresses method walk the list of set memory
4716 regions.
4717 Extend the print methos to display memory regions.
4718 * script-sections.h: Add prototypes for new methods.
4719 Add enum for MEMORY region attributes.
4720 * yyscript.y: Add support for parsing MEMORY regions.
4721 * script-c.h: Add prototypes for new functions.
4722 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4723 * testsuite/Makefile.in: Regenerate.
4724 * testsuite/memory_test.sh: New script.
4725 * testsuite/memory_test.s: New assembler source file.
4726 * testsuite/memory_test.t: New linker script.
4727
4728 2010-08-27 Doug Kwan <dougkwan@google.com>
4729
4730 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4731 reference override an existing dynamic weak reference.
4732 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4733 * testsuite/Makefile.in: Regenerate.
4734 * testsuite/dyn_weak_ref.sh: New file.
4735 * testsuite/dyn_weak_ref_1.c: Ditto.
4736 * testsuite/dyn_weak_ref_2.c: Ditto.
4737
4738 2010-08-27 Ian Lance Taylor <iant@google.com>
4739
4740 * incremental.h (class Incremental_input_entry): Add virtual
4741 destructor.
4742
4743 2010-08-27 Ian Lance Taylor <iant@google.com>
4744
4745 * testsuite/start_lib_test_3.c: Mark t3 as used.
4746
4747 2010-08-27 Nick Clifton <nickc@redhat.com>
4748
4749 * options.cc (version_script): Fix small typo in previous
4750 whitespace tidyup.
4751
4752 2010-08-25 Nick Clifton <nickc@redhat.com>
4753
4754 * archive.cc: Formatting fixes: Remove whitespace between
4755 typename and following asterisk. Remove whitespace between
4756 function name and opening parenthesis.
4757 * archive.h: Likewise.
4758 * arm.cc: Likewise.
4759 * attributes.cc: Likewise.
4760 * attributes.h: Likewise.
4761 * common.cc: Likewise.
4762 * copy-relocs.cc: Likewise.
4763 * dirsearch.h: Likewise.
4764 * dynobj.cc: Likewise.
4765 * ehframe.cc: Likewise.
4766 * ehframe.h: Likewise.
4767 * expression.cc: Likewise.
4768 * fileread.cc: Likewise.
4769 * fileread.h: Likewise.
4770 * gc.h: Likewise.
4771 * gold-threads.cc: Likewise.
4772 * gold.cc: Likewise.
4773 * i386.cc: Likewise.
4774 * icf.h: Likewise.
4775 * incremental-dump.cc: Likewise.
4776 * incremental.cc: Likewise.
4777 * layout.cc: Likewise.
4778 * layout.h: Likewise.
4779 * main.cc: Likewise.
4780 * merge.cc: Likewise.
4781 * merge.h: Likewise.
4782 * object.cc: Likewise.
4783 * object.h: Likewise.
4784 * options.cc: Likewise.
4785 * options.h: Likewise.
4786 * output.cc: Likewise.
4787 * output.h: Likewise.
4788 * plugin.cc: Likewise.
4789 * plugin.h: Likewise.
4790 * powerpc.cc: Likewise.
4791 * reloc.cc: Likewise.
4792 * script-c.h: Likewise.
4793 * script-sections.cc: Likewise.
4794 * script.cc: Likewise.
4795 * stringpool.cc: Likewise.
4796 * symtab.cc: Likewise.
4797 * symtab.h: Likewise.
4798 * target.cc: Likewise.
4799 * timer.cc: Likewise.
4800 * timer.h: Likewise.
4801 * version.cc: Likewise.
4802 * x86_64.cc: Likewise.
4803
4804 2010-08-24 Nick Clifton <nickc@redhat.com>
4805
4806 PR 11899
4807 * layout.cc (segment_precedes): Sort segments by their physical
4808 addresses, if they have been set.
4809
4810 2010-08-23 Cary Coutant <ccoutant@google.com>
4811
4812 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4813 symbols data.
4814 (Lib_group::include_member): Unlock object after deleting its
4815 symbols data.
4816 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4817 the bug fixed here.
4818
4819 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4820 Cary Coutant <ccoutant@google.com>
4821
4822 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4823 constructor, and set_blocker.
4824 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4825 readsyms_blocker_.
4826 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4827 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4828 * testsuite/Makefile.am (start_lib_test): New test case.
4829 * testsuite/Makefile.in: Regenerate.
4830 * testsuite/start_lib_test_main.c: New file.
4831 * testsuite/start_lib_test_1.c: New file.
4832 * testsuite/start_lib_test_2.c: New file.
4833 * testsuite/start_lib_test_3.c: New file.
4834
4835 2010-08-19 Ian Lance Taylor <iant@google.com>
4836
4837 * Makefile.in: Rebuild with automake 1.11.1.
4838 * aclocal.m4: Likewise.
4839 * testsuite/Makefile.in: Likewise.
4840
4841 2010-08-19 Ian Lance Taylor <iant@google.com>
4842
4843 PR 10893
4844 * i386.cc (class Output_data_plt_i386): Update declarations.
4845 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4846 local_ifuncs_ fields.
4847 (Target_i386::do_plt_section_for_global): New function.
4848 (Target_i386::do_plt_section_for_local): New function.
4849 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4850 parameter; change all callers. Initialize global_ifuncs_ and
4851 local_ifuncs_. If doing a static link define __rel_iplt_start and
4852 __rel_iplt_end.
4853 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4854 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4855 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4856 symbols.
4857 (Target_i386::make_plt_section): New function, broken out of
4858 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4859 (Target_i386::make_plt_entry): Call make_plt_section.
4860 (Target_i386::make_local_ifunc_plt_entry): New function.
4861 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4862 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4863 R_386_IRELATIVE to switch.
4864 (Target_i386::Scan::global): Likewise.
4865 (Target_i386::Relocate::relocate): Likewise.
4866 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4867 switch.
4868 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4869 (Target_x86_64::do_plt_section_for_global): New function.
4870 (Target_x86_64::do_plt_section_for_local): New function.
4871 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4872 parameter; change all callers. If doing a static link define
4873 __rela_iplt_start and __rela_iplt_end.
4874 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4875 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4876 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4877 to point to .plt.
4878 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4879 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4880 switch.
4881 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4882 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4883 R_X86_64_IRELATIVE to switch.
4884 (Target_x86_64::Scan::global): Likewise.
4885 (Target_x86_64::Relocate::relocate): Likewise.
4886 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4887 switch.
4888 * target.h (class Target): Add plt_section_for_global and
4889 plt_section_for_local functions. Add do_plt_section_for_global
4890 and do_plt_section_for_local virtual functions.
4891 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4892 clarifying comments.
4893 (Symbol::use_plt_offset): Handle IFUNC symbol.
4894 * object.cc (Sized_relobj::Sized_relobj): Initialize
4895 local_plt_offsets_.
4896 (Sized_relobj::local_has_plt_offset): New function.
4897 (Sized_relobj::local_plt_offset): New function.
4898 (Sized_relobj::set_local_plt_offset): New function.
4899 (Sized_relobj::do_count): Handle IFUNC symbol.
4900 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4901 a bit away from input_shndx_ field. Add set_is_func_symbol and
4902 is_ifunc_symbol functions.
4903 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4904 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4905 local_plt_offsets_ field.
4906 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4907 * output.h (class Output_section_data): Add non-const
4908 output_section function.
4909 (class Output_data_got): Update declarations.
4910 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4911 Add use_plt_offset parameter to global and local constructors.
4912 Change all callers. Change local_sym_index_ field to 31 bits.
4913 Change GSYM_CODE and CONSTANT_CODE accordingly.
4914 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4915 doing a static link don't set sh_link field.
4916 (Output_data_got::Got_entry::write): Use PLT offset if
4917 appropriate.
4918 (Output_data_got::add_global_plt): New function.
4919 (Output_data_got::add_local_plt): New function.
4920 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4921 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4922 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4923 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4924 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4925 IFUNC conditional.
4926 * testsuite/ifunc-sel.h: New file.
4927 * testsuite/ifuncmain1.c: New file.
4928 * testsuite/ifuncmain1vis.c: New file.
4929 * testsuite/ifuncmod1.c: New file.
4930 * testsuite/ifuncdep2.c: New file.
4931 * testsuite/ifuncmain2.c: New file.
4932 * testsuite/ifuncmain3.c: New file.
4933 * testsuite/ifuncmod3.c: New file.
4934 * testsuite/ifuncmain4.c: New file.
4935 * testsuite/ifuncmain5.c: New file.
4936 * testsuite/ifuncmod5.c: New file.
4937 * testsuite/ifuncmain6pie.c: New file.
4938 * testsuite/ifuncmod6.c: New file.
4939 * testsuite/ifuncmain7.c: New file.
4940 * configure, testsuite/Makefile.in: Rebuild.
4941
4942 2010-08-18 Ian Lance Taylor <iant@google.com>
4943
4944 * incremental.cc
4945 (Output_section_incremental_inputs::write_input_files): Add cast
4946 to avoid signed/unsigned comparison warning.
4947 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4948
4949 2010-08-12 Cary Coutant <ccoutant@google.com>
4950
4951 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4952
4953 2010-08-13 Ian Lance Taylor <iant@google.com>
4954
4955 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4956
4957 2010-08-12 Cary Coutant <ccoutant@google.com>
4958 Doug Kwan <dougkwan@google.com>
4959
4960 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4961 defintion overrides non-weak undef, remember that the original undef
4962 is not weak.
4963 * symtab.cc (Symbol_table::sized_write_global): For undef without
4964 an original weak binding, set binding to global in output.
4965 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4966 * testsuite/Makefile.in: Regenerate.
4967 * testsuite/strong_ref_weak_def.sh: New file.
4968 * testsuite/strong_ref_weak_def_1.c: Ditto.
4969 * testsuite/strong_ref_weak_def_2.c: Ditto.
4970
4971 2010-08-12 Cary Coutant <ccoutant@google.com>
4972
4973 * testsuite/incremental_test.sh: Rewrite.
4974 * testsuite/incremental_test_1.c: Rewrite.
4975 * testsuite/incremental_test_2.c: Rewrite.
4976
4977 2010-08-12 Cary Coutant <ccoutant@google.com>
4978
4979 * arm.cc (Target_arm::got_size): Add const.
4980 (Target_arm::got_entry_count): New function.
4981 (Target_arm::plt_entry_count): New function.
4982 (Target_arm::first_plt_entry_offset): New function.
4983 (Target_arm::plt_entry_size): New function.
4984 (Output_data_plt_arm::entry_count): New function.
4985 (Output_data_plt_arm::first_plt_entry_offset): New function.
4986 (Output_data_plt_arm::get_plt_entry_size): New function.
4987 * i386.cc (Target_i386::got_size): Add const.
4988 (Target_i386::got_entry_count): New function.
4989 (Target_i386::plt_entry_count): New function.
4990 (Target_i386::first_plt_entry_offset): New function.
4991 (Target_i386::plt_entry_size): New function.
4992 (Output_data_plt_i386::entry_count): New function.
4993 (Output_data_plt_i386::first_plt_entry_offset): New function.
4994 (Output_data_plt_i386::get_plt_entry_size): New function.
4995 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4996 find_incremental_inputs_sections. Dump incremental_got_plt section.
4997 * incremental.cc: Include target.h.
4998 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4999 parameter. Adjust all callers. Find incremental_got_plt section.
5000 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5001 section.
5002 (Output_section_incremental_inputs::set_final_data_size): Calculate
5003 size of incremental_got_plt section.
5004 (Output_section_incremental_inputs::do_write): Write the
5005 incremental_got_plt section.
5006 (Got_plt_view_info): New struct.
5007 (Local_got_offset_visitor): New class.
5008 (Global_got_offset_visitor): New class.
5009 (Global_symbol_visitor_got_plt): New class.
5010 (Output_section_incremental_inputs::write_got_plt): New function.
5011 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5012 Add parameter. Adjust all callers.
5013 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5014 (Incremental_inputs::got_plt_section): New function.
5015 (Incremental_inputs::got_plt_section_): New data member.
5016 (Incremental_got_plt_reader): New class.
5017 * layout.cc (Layout::create_incremental_info_sections): Add the
5018 incremental_got_plt section.
5019 * object.h (Got_offset_list::get_list): New function.
5020 (Got offset_list::for_all_got_offsets): New function.
5021 (Sized_relobj::local_got_offset_list): New function.
5022 * powerpc.cc (Target_powerpc::got_size): Add const.
5023 (Target_powerpc::got_entry_count): New function.
5024 (Target_powerpc::plt_entry_count): New function.
5025 (Target_powerpc::first_plt_entry_offset): New function.
5026 (Target_powerpc::plt_entry_size): New function.
5027 (Output_data_plt_powerpc::entry_count): New function.
5028 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5029 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5030 * sparc.cc (Target_sparc::got_size): Add const.
5031 (Target_sparc::got_entry_count): New function.
5032 (Target_sparc::plt_entry_count): New function.
5033 (Target_sparc::first_plt_entry_offset): New function.
5034 (Target_sparc::plt_entry_size): New function.
5035 (Output_data_plt_sparc::entry_count): New function.
5036 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5037 (Output_data_plt_sparc::get_plt_entry_size): New function.
5038 * symtab.h (Symbol::got_offset_list): New function.
5039 (Symbol_table::for_all_symbols): New function.
5040 * target.h (Sized_target::got_entry_count): New function.
5041 (Sized_target::plt_entry_count): New function.
5042 (Sized_target::plt_entry_size): New function.
5043 * x86_64.cc (Target_x86_64::got_size): Add const.
5044 (Target_x86_64::got_entry_count): New function.
5045 (Target_x86_64::plt_entry_count): New function.
5046 (Target_x86_64::first_plt_entry_offset): New function.
5047 (Target_x86_64::plt_entry_size): New function.
5048 (Output_data_plt_x86_64::entry_count): New function.
5049 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5050 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5051
5052 2010-08-12 Cary Coutant <ccoutant@google.com>
5053
5054 * archive.cc: Include incremental.h.
5055 (Archive::Archive): Initialize incremental_info_.
5056 (Archive::include_member): Record archive members in incremental info.
5057 (Add_archive_symbols::run): Record begin and end of an archive in
5058 incremental info.
5059 (Lib_group::include_member): Record objects in incremental info.
5060 * archive.h (Incremental_archive_entry): Forward declaration.
5061 (Archive::set_incremental_info): New member function.
5062 (Archive::incremental_info): New member function.
5063 (Archive::Unused_symbol_iterator): New class.
5064 (Archive::unused_symbols_begin): New member function.
5065 (Archive::unused_symbols_end): New member function.
5066 (Archive::incremental_info_): New data member.
5067 * incremental-dump.cc (find_input_containing_global): New function.
5068 (dump_incremental_inputs): Dump new incremental info sections.
5069 * incremental.cc: Include symtab.h.
5070 (Output_section_incremental_inputs): New class.
5071 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5072 new incremental info sections.
5073 (Sized_incremental_binary::do_check_inputs): Likewise.
5074 (Incremental_inputs::report_archive): Remove.
5075 (Incremental_inputs::report_archive_begin): New function.
5076 (Incremental_inputs::report_archive_end): New function.
5077 (Incremental_inputs::report_object): New function.
5078 (Incremental_inputs::finalize_inputs): Remove.
5079 (Incremental_inputs::report_input_section): New function.
5080 (Incremental_inputs::report_script): Rewrite.
5081 (Incremental_inputs::finalize): Do nothing but finalize string table.
5082 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5083 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5084 (Incremental_inputs::create_data_sections): New function.
5085 (Incremental_inputs::relocs_entsize): New function.
5086 (Output_section_incremental_inputs::set_final_data_size): New function.
5087 (Output_section_incremental_inputs::do_write): New function.
5088 (Output_section_incremental_inputs::write_header): New function.
5089 (Output_section_incremental_inputs::write_input_files): New function.
5090 (Output_section_incremental_inputs::write_info_blocks): New function.
5091 (Output_section_incremental_inputs::write_symtab): New function.
5092 * incremental.h (Incremental_script_entry): Forward declaration.
5093 (Incremental_object_entry): Forward declaration.
5094 (Incremental_archive_entry): Forward declaration.
5095 (Incremental_inputs): Forward declaration.
5096 (Incremental_inputs_header_data): Remove.
5097 (Incremental_inputs_header): Remove.
5098 (Incremental_inputs_header_write): Remove.
5099 (Incremental_inputs_entry_data): Remove.
5100 (Incremental_inputs_entry): Remove.
5101 (Incremental_inputs_entry_write): Remove.
5102 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5103 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5104 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5105 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5106 Likewise.
5107 (Incremental_input_entry): New class.
5108 (Incremental_script_entry): New class.
5109 (Incremental_object_entry): New class.
5110 (Incremental_archive_entry): New class.
5111 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5112 (Incremental_inputs::report_inputs): Remove.
5113 (Incremental_inputs::report_archive): Remove.
5114 (Incremental_inputs::report_archive_begin): New function.
5115 (Incremental_inputs::report_archive_end): New function.
5116 (Incremental_inputs::report_object): Change prototype.
5117 (Incremental_inputs::report_input_section): New function.
5118 (Incremental_inputs::report_script): Change prototype.
5119 (Incremental_inputs::get_reloc_count): New function.
5120 (Incremental_inputs::set_reloc_count): New function.
5121 (Incremental_inputs::create_data_sections): New function.
5122 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5123 (Incremental_inputs::inputs_section): New function.
5124 (Incremental_inputs::symtab_section): New function.
5125 (Incremental_inputs::relocs_section): New function.
5126 (Incremental_inputs::get_stringpool): Add const.
5127 (Incremental_inputs::command_line): Add const.
5128 (Incremental_inputs::inputs): Remove.
5129 (Incremental_inputs::command_line_key): New function.
5130 (Incremental_inputs::input_file_count): New function.
5131 (Incremental_inputs::input_files): New function.
5132 (Incremental_inputs::relocs_entsize): New function.
5133 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5134 (Incremental_inputs::finalize_inputs): Remove.
5135 (Incremental_inputs::Input_info): Remove.
5136 (Incremental_inputs::lock_): Remove.
5137 (Incremental_inputs::inputs_): Change type.
5138 (Incremental_inputs::inputs_map_): Remove.
5139 (Incremental_inputs::current_object_entry_): New data member.
5140 (Incremental_inputs::inputs_section_): New data member.
5141 (Incremental_inputs::symtab_section_): New data member.
5142 (Incremental_inputs::relocs_section_): New data member.
5143 (Incremental_inputs::reloc_count_): New data member.
5144 (Incremental_inputs_reader): New class.
5145 (Incremental_symtab_reader): New class.
5146 (Incremental_relocs_reader): New class.
5147 * layout.cc (Layout::finalize): Move finalization of incremental info
5148 and creation of incremental info sections to follow finalization of
5149 symbol table. Set offsets for postprocessing sections.
5150 (Layout::create_incremental_info_sections): Call
5151 Incremental_inputs::create_data_sections. Add incremental symtab
5152 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5153 sections to layout after input sections.
5154 * layout.h (struct Timespec): Forward declaration.
5155 (Layout::incremental_inputs): Add const.
5156 (Layout::create_incremental_info_sections): Add parameter.
5157 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5158 * object.cc: Include incremental.h.
5159 (Relobj::finalize_incremental_relocs): New function.
5160 (Sized_relobj::do_layout): Record input sections in incremental info.
5161 * object.h (Object::output_section): New function.
5162 (Object::output_section_offset): Moved from Relobj.
5163 (Object::get_incremental_reloc_base): New function.
5164 (Object::get_incremental_reloc_count): New function.
5165 (Object::do_output_section): New function.
5166 (Object::do_output_section_offset): Moved from Relobj.
5167 (Object::do_get_incremental_reloc_base): New function.
5168 (Object::do_get_incremental_reloc_count): New function.
5169 (Object::Object): Initialize new data members.
5170 (Relobj::output_section): Renamed do_output_section and moved to
5171 protected.
5172 (Relobj::output_section_offset): Moved to Object.
5173 (Relobj::do_get_incremental_reloc_base): New function.
5174 (Relobj::do_get_incremental_reloc_count): New function.
5175 (Relobj::allocate_incremental_reloc_counts): New function.
5176 (Relobj::count_incremental_reloc): New function.
5177 (Relobj::finalize_incremental_relocs): New function.
5178 (Relobj::next_incremental_reloc_index): New function.
5179 (Relobj::reloc_counts_): New data member.
5180 (Relobj::reloc_bases_): New data member.
5181 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5182 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5183 (Sized_relobj::incremental_relocs_scan): New function.
5184 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5185 (Sized_relobj::incremental_relocs_write): New function.
5186 (Sized_relobj::incremental_relocs_write_reltype): New function.
5187 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5188 incremental link.
5189 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5190 archives and object files elsewhere.
5191 (Add_symbols::run): Report object files here.
5192 (Finish_group::run): Report end of archive at end of group.
5193 * reloc.cc: Include layout.h, incremental.h.
5194 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5195 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5196 (Sized_relobj::incremental_relocs_scan): New function.
5197 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5198 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5199 (Sized_relobj::incremental_relocs_write): New function.
5200 (Sized_relobj::incremental_relocs_write_reltype): New function.
5201 * script.cc (read_input_script): Rewrite test for incremental link.
5202 Change call to Incremental_inputs::report_script.
5203 * symtab.h (Symbol_table::first_global_index): New function.
5204 (Symbol_table::output_count): New function.
5205
5206 2010-08-12 Doug Kwan <dougkwan@google.com>
5207
5208 * arm.cc (Target_arm::merge_object_attributes): Check command line
5209 options --no-wchar-size-warning and --no-enum-size-warning.
5210 * options.h (General_options): Add ld-compatible options
5211 --no-enum-size-warning and --no-wchar-size-warning.
5212
5213 2010-08-04 Ian Lance Taylor <iant@google.com>
5214
5215 * x86_64.cc (Target_x86_64::Scan::local): Use
5216 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5217 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5218 (Target_x86_64::Scan::global): Likewise.
5219 (Target_x86_64::Relocate::relocate): Likewise.
5220 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5221 Likewise.
5222
5223 2010-08-03 Cary Coutant <ccoutant@google.com>
5224
5225 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5226 to reserve space in merged_strings vector. Keep total input size
5227 for stats.
5228 (Output_merge_string::do_print_merge_stats): Print total input size.
5229 * merge.h (Output_merge_string): Add input_size_ field.
5230 * stringpool.cc (Stringpool_template::string_length): Move
5231 implementations out of Stringpool_template class and place in
5232 stringpool.h.
5233 * stringpool.h (string_length): Move out of Stringpool_template.
5234
5235 2010-08-03 Ian Lance Taylor <iant@google.com>
5236
5237 PR 11712
5238 * layout.cc (relaxation_loop_body): If address of load segment is
5239 set, adjust address to include headers if possible.
5240
5241 2010-08-03 Ian Lance Taylor <iant@google.com>
5242
5243 * version.cc (version_string): Bump to 1.10.
5244
5245 2010-08-03 Ian Lance Taylor <iant@google.com>
5246
5247 PR 11805
5248 * layout.h (enum Output_section_order): Define.
5249 (class Layout): Update declarations.
5250 * layout.cc (Layout::get_output_section): Add order parameter.
5251 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5252 is_first_non_relro parameters. Change all callers.
5253 (Layout::choose_output_section): Likewise.
5254 (Layout::add_output_section_data): Likewise.
5255 (Layout::make_output_section): Likewise. Set order.
5256 (Layout::default_section_order): New function.
5257 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5258 * output.cc (Output_section::Output_section): Initialize order_.
5259 Don't initialize deleted fields.
5260 (Output_segment::Output_segment): Don't initialize deleted
5261 fields.
5262 (Output_segment::add_output_section_to_load): New function
5263 replacing add_output_section. Change all callers to call this or
5264 add_output_section_to_nonload.
5265 (Output_segment::add_output_section_to_nonload): New function.
5266 (Output_segment::remove_output_section): Rewrite.
5267 (Output_segment::add_initial_output_data): Likewise.
5268 (Output_segment::has_any_data_sections): Likewise.
5269 (Output_segment::is_first_section_relro): Likewise.
5270 (Output_segment::maximum_alignment): Likewise.
5271 (Output_segment::has_dynamic_reloc): New function replacing
5272 dynamic_reloc_count. Change all callers.
5273 (Output_segment::has_dynamic_reloc_list): New function replacing
5274 dynamic_reloc_count_list. Change all callers.
5275 (Output_segment::set_section_addresses): Rewrite.
5276 (Output_segment::set_offset): Rewrite.
5277 (Output_segment::find_first_and_last_list): Remove.
5278 (Output_segment::set_tls_offsets): Rewrite.
5279 (Output_segment::first_section_load_address): Likewise.
5280 (Output_segment::output_section_count): Likewise.
5281 (Output_segment::section_with_lowest_load_address): Likewise.
5282 (Output_segment::write_section_headers): Likewise.
5283 (Output_segment::print_sections_to_map): Likewise.
5284 * output.h (class Output_data): Remove dynamic_reloc_count_
5285 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5286 (Output_data::add_dynamic_reloc): Rewrite.
5287 (Output_data::has_dynamic_reloc): New function.
5288 (Output_data::dynamic_reloc_count): Remove.
5289 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5290 is_last_relro_, is_first_non_relro_, is_interp_,
5291 is_dynamic_linker_section_ fields. Add order and set_order
5292 functions. Remove is_relro_local, set_is_relro_local,
5293 is_last_relro, set_is_last_relro, is_first_non_relro,
5294 set_is_first_non_relro functions, is_interp, set_is_interp,
5295 is_dynamic_linker_section, and set_is_dynamic_linker_section
5296 functions.
5297 (class Output_segment): Change Output_data_list from std::list to
5298 std:;vector. Add output_lists_ field. Remove output_data_ and
5299 output_bss_ fields. Update declarations.
5300
5301 2010-08-02 Ian Lance Taylor <iant@google.com>
5302
5303 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5304 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5305 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5306
5307 2010-08-02 Ian Lance Taylor <iant@google.com>
5308
5309 PR 11855
5310 * script.cc (Script_options::Script_options): Initialize
5311 symbol_definitions_ and symbol_references_.
5312 (Script_options::add_symbol_assignment): Update
5313 symbol_definitions_ and symbol_references_.
5314 (Script_options::add_symbol_reference): New function.
5315 (script_symbol): New function.
5316 * script.h (class Script_options): Add symbol_definitions_ and
5317 symbol_references_ fields.
5318 (Script_options::referenced_const_iterator): New type.
5319 (Script_options::referenced_begin): New function.
5320 (Script_options::referenced_end): New function.
5321 (Script_options::is_referenced): New function.
5322 (Script_options::any_unreferenced): New function.
5323 * script-c.h (script_symbol): Declare.
5324 * yyscript.y (exp): Call script_symbol.
5325 * symtab.cc: Include "script.h".
5326 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5327 Change all callers. Check symbols referenced by scripts.
5328 (Symbol_table::add_undefined_symbols_from_command_line): Add
5329 layout parameter. Change all callers.
5330 (Symbol_table::do_add_undefined_symbols_from_command_line):
5331 Likewise. Break out loop body. Check symbols referenced by
5332 scripts.
5333 (Symbol_table::add_undefined_symbol_from_command_line): New
5334 function broken out of
5335 do_add_undefined_symbols_from_command_line.
5336 * symtab.h (class Symbol_table): Update declarations.
5337 * archive.cc: Include "layout.h".
5338 (Archive::should_include_member): Add layout parameter. Change
5339 all callers. Check for symbol mentioned in expression.
5340 * archive.h (class Archive): Update declaration.
5341 * object.cc (Sized_relobj::do_should_include_member): Add layout
5342 parameter.
5343 * object.h (Object::should_include_member): Add layout parameter.
5344 Change all callers.
5345 (Object::do_should_include_member): Add layout parameter.
5346 (class Sized_relobj): Update declaration.
5347 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5348 parameter.
5349 * dynobj.h (class Sized_dynobj): Update declaration.
5350 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5351 layout parameter.
5352 * plugin.h (class Sized_pluginobj): Update declaration.
5353
5354 2010-08-02 Ian Lance Taylor <iant@google.com>
5355
5356 PR 11866
5357 * output.cc (Output_segment::set_offset): Search for the first and
5358 last sections rather than assuming that the list is in order.
5359 (Output_segment::find_first_and_last_list): New function.
5360 * output.h (class Output_segment): Update declarations.
5361 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5362 (relro_strip_test_SOURCES): New variable.
5363 (relro_strip_test_DEPENDENCIES): New variable.
5364 (relro_strip_test_LDFLAGS): New variable.
5365 (relro_strip_test_LDADD): New variable.
5366 (relro_strip_test.so): New target.
5367
5368 2010-08-02 Ian Lance Taylor <iant@google.com>
5369
5370 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5371 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5372 (Target_i386::got_tlsdesc_section): New function.
5373 (Target_i386::got_section): Create space for GOT entries for
5374 TLSDESC relocations.
5375 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5376 R_386_TLS_GOTDESC.
5377 (Target_i386::Scan::global): Likewise.
5378 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5379 using TLSDESC GOT.
5380 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5381 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5382 (Target_x86_64::got_tlsdesc_section): New function.
5383 (Target_x86_64::got_section): Create space for GOT entries for
5384 TLSDESC relocations.
5385 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5386 R_386_TLS_GOTDESC.
5387 (Target_x86_64::Scan::global): Likewise.
5388 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5389 using TLSDESC GOT.
5390
5391 2010-08-02 Ian Lance Taylor <iant@google.com>
5392
5393 * testsuite/final_layout.sh: Use dc to convert from hex to
5394 decimal.
5395
5396 2010-07-29 Sriraman Tallam <tmsriram@google.com>
5397
5398 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5399 paramter to the call to gold::gc_process_relocs.
5400 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5401 paramter to the call to gold::gc_process_relocs.
5402 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5403 parameter to the call to gold::gc_process_relocs.
5404 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5405 template parameter to the call to gold::gc_process_relocs.
5406 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5407 paramter to the call to gold::gc_process_relocs.
5408 * gc.h (get_embedded_addend_size): New function.
5409 (gc_process_relocs): Save the size of the reloc for use by ICF.
5410 * icf.cc (get_section_contents): Get the addend from the text section
5411 for SHT_REL relocation sections.
5412 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5413 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5414 * int_encoding.h (read_from_pointer): New overloaded function.
5415 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5416 * testsuite/icf_sht_rel_addend_test.sh: New file.
5417 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5418 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5419
5420 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5421
5422 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5423 * Makefile.in: Regenerate.
5424 * testsuite/Makefile.in: Regenerate.
5425
5426 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5427
5428 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5429 * gold/testsuite/debug_msg.cc: Likewise.
5430 * gold/testsuite/odr_violation1.cc
5431 * gold/testsuite/odr_violation2.cc
5432
5433 2010-07-21 Cary Coutant <ccoutant@google.com>
5434
5435 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5436 string, and length fields.
5437 (Output_merge_string::Merged_strings_list): New type.
5438 (Output_merge_string::Merged_strings_lists): New typedef.
5439 (Output_merge_string): Replace merged_strings_ with
5440 merged_strings_lists_.
5441 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5442 Merged_strings_list per input object and section. Don't store pointer
5443 to the string. Don't store length with each merged string entry.
5444 (Output_merge_string::finalize_merged_data): Loop over list of merged
5445 strings lists. Recompute length of each merged string.
5446
5447 2010-07-15 Cary Coutant <ccoutant@google.com>
5448
5449 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5450 here.
5451
5452 2010-07-14 Ian Lance Taylor <iant@google.com>
5453
5454 * descriptors.cc (Descriptors::open): Report correct name in error
5455 message.
5456
5457 2010-07-13 Doug Kwan <dougkwan@google.com>
5458
5459 * arm.cc (Arm_input_section::Arm_input_section): For a
5460 SHT_ARM_EXIDX section, always keeps the input sections.
5461 (Arm_input_section::set_exidx_section_link): New method.
5462 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5463 has_errors_ to false.
5464 (Arm_exidx_input_section::has_errors,
5465 Arm_exidx_input_section::set_has_errors): New methods.
5466 (Arm_exidx_input_section::has_errors_): New data member.
5467 (Arm_relobj::get_exidx_shndx_list): New method.
5468 (Arm_output_section::append_text_sections_to_list): Do not skip
5469 section without SHF_EXECINSTR.
5470 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5471 errors.
5472 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5473 section header. Make error messages more verbose. Check for
5474 a non-executable section linked to an EXIDX section.
5475 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5476 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5477 check that there is no deferred EXIDX section if we exit early.
5478 Instead of not making an EXIDX section in case of an error, make one
5479 and set the has_errors flag of it.
5480 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5481 in a relocatable link.
5482 (Target_arm::do_relax): Look for the EXIDX output section instead of
5483 assuming that it is called .ARM.exidx.
5484 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5485 section list. Do not check for SHF_EXECINSTR section flags but
5486 skip any input section with errors.
5487 * output.cc (Output_section::Output_section): Initialize
5488 always_keeps_input_sections_ to false.
5489 (Output_section::add_input_section): Check for
5490 always_keeps_input_sections_.
5491 * output.h (Output_section::always_keeps_input_sections,
5492 Output_section::set_always_keeps_input_sections): New methods.
5493 (Output_section::always_keeps_input_sections): New data member.
5494
5495 2010-07-13 Rafael Espindola <espindola@google.com>
5496
5497 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5498 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5499
5500 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5501 Ian Lance Taylor <iant@google.com>
5502
5503 * output.h (Output_section_lookup_maps::add_merge_section):
5504 Correct check of whether value was inserted.
5505 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5506 (Output_section_lookup_maps::add_relaxed_input_section):
5507 Likewise.
5508 * arm.cc (Target_arm::got_section): Remove used local os.
5509 * i386.cc (Target_i386::got_section): Likewise.
5510 * x86_64.cc (Target_x86_64::got_section): Likewise.
5511 * sparc.cc (Target_sparc::got_section): Likewise.
5512 (Target_sparc::relocate): Remove unused local have_got_offset.
5513 * powerpc.cc (Target_powerpc::relocate): Likewise.
5514
5515 2010-07-13 Ian Lance Taylor <iant@google.com>
5516
5517 * compressed_output.cc (zlib_decompress): Fix signature in
5518 !HAVE_ZLIB_H case.
5519
5520 * archive.cc (Archive::include_member): Unlock an external member
5521 of a thin archive. Don't bother to delete an object we know is
5522 NULL.
5523
5524 2010-07-12 Cary Coutant <ccoutant@google.com>
5525
5526 * compressed_output.cc (zlib_decompress): New function.
5527 (get_uncompressed_size): New function.
5528 (decompress_input_section): New function.
5529 * compressed_output.h (get_uncompressed_size): New function.
5530 (decompress_input_section): New function.
5531 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5532 Handle compressed debug sections.
5533 * layout.cc (is_compressed_debug_section): New function.
5534 (Layout::output_section_name): Map compressed section names to
5535 canonical names.
5536 * layout.h (is_compressed_debug_section): New function.
5537 (is_debug_info_section): Recognize compressed debug sections.
5538 * merge.cc: Include compressed_output.h.
5539 (Output_merge_data::do_add_input_section): Handle compressed
5540 debug sections.
5541 (Output_merge_string::do_add_input_section): Handle compressed
5542 debug sections.
5543 * object.cc: Include compressed_output.h.
5544 (Sized_relobj::Sized_relobj): Initialize new data members.
5545 (build_compressed_section_map): New function.
5546 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5547 * object.h (Object::section_is_compressed): New method.
5548 (Object::do_section_is_compressed): New method.
5549 (Sized_relobj::Compressed_section_map): New type.
5550 (Sized_relobj::do_section_is_compressed): New method.
5551 (Sized_relobj::compressed_sections_): New data member.
5552 * output.cc (Output_section::add_input_section): Handle compressed
5553 debug sections.
5554 * reloc.cc: Include compressed_output.h.
5555 (Sized_relobj::write_sections): Handle compressed debug sections.
5556
5557 2010-07-08 Cary Coutant <ccoutant@google.com>
5558
5559 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5560 weak when resolving to a dynamic def.
5561 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5562 for weak undef/dynamic def cases. Adjust callers.
5563 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5564 undef_binding_weak_.
5565 (Symbol_table::sized_write_globals): Adjust symbol binding.
5566 (Symbol_table::sized_write_symbol): Add binding parameter.
5567 * symtab.h (Symbol::set_undef_binding): New method.
5568 (Symbol::is_undef_binding_weak): New method.
5569 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5570 (Symbol_table::should_override): Add new parameter.
5571 (Symbol_table::sized_write_symbol): Add new parameter.
5572
5573 * testsuite/weak_undef_file1.cc: Add new test case.
5574 * testsuite/weak_undef_file2.cc: Fix header comment.
5575 * testsuite/weak_undef_test.cc: Add new test case.
5576
5577 2010-06-29 Doug Kwan <dougkwan@google.com>
5578
5579 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5580 Initialize USE_SYMBOL_.
5581 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5582 definition.
5583 (Arm_reloc_property::uses_symbol_): New data member declaration.
5584 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5585 uses symbol value and symbol is undefined but not weakly undefined.
5586
5587 2010-06-28 Rafael Espindola <espindola@google.com>
5588
5589 * plugin.cc (Plugin::load): Use dlerror.
5590
5591 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5592
5593 * symtab.cc (detect_odr_violations): When reporting an ODR
5594 violation, report an object where the symbol is defined.
5595
5596 2010-06-25 Doug Kwan <dougkwan@google.com>
5597
5598 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5599 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5600 definition.
5601 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5602 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5603 target hook to detect function points.
5604 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5605 * icf.h (Icf::check_section_for_function_pointers): Change type of
5606 parameter SECTION_NAME to const reference to std::string. Use
5607 target hook to determine if section may have unsafe pointers.
5608 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5609 method definition.
5610
5611 2010-06-21 Rafael Espindola <espindola@google.com>
5612
5613 * fileread.cc (Input_file::find_fie): New
5614 (Input_file::open): Use Input_file::find_fie.
5615 * fileread.h (Input_file::find_fie): New
5616 * plugin.cc (set_extra_library_path): New.
5617 (Plugin::load): Add set_extra_library_path to the transfer vector.
5618 (Plugin_manager::set_extra_library_path): New.
5619 (Plugin_manager::add_input_file): Use the extra search path if set.
5620 (set_extra_library_path(): New.
5621 * plugin.h (Plugin_manager): Add set_extra_library_path and
5622 extra_search_path_.
5623
5624 2010-06-19 Cary Coutant <ccoutant@google.com>
5625
5626 * layout.cc (gdb_sections): Add .debug_types.
5627 (lines_only_debug_sections): Likewise.
5628
5629 2010-06-18 Rafael Espindola <espindola@google.com>
5630
5631 * plugin.cc (add_input_file,add_input_library)
5632 (Plugin_manager::add_input_file): Make filename arguments const.
5633 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5634 const.
5635
5636 2010-06-16 Doug Kwan <dougkwan@google.com>
5637
5638 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5639 .ARM.attributes section if we have not merged any input
5640 attributes sections.
5641
5642 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5643
5644 * arm.cc: Allow combining objects with no EABI version
5645 information.
5646
5647 2010-06-15 Rafael Espindola <espindola@google.com>
5648
5649 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5650
5651 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5652
5653 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5654 (struct iovec): Correct !HAVE_READV definition.
5655
5656 2010-06-10 Cary Coutant <ccoutant@google.com>
5657
5658 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5659 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5660 reloc sections.
5661 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5662
5663 PR 11683
5664 * symtab.h (Symbol::is_placeholder): New member function.
5665 * target-reloc.h (relocate_section): Check for placeholder symbols.
5666
5667 * testsuite/Makefile.am (plugin_test_8): New test.
5668 (plugin_test_9): New test.
5669 * testsuite/Makefile.in: Regenerate.
5670
5671 2010-06-09 Nick Clifton <nickc@redhat.com>
5672
5673 * yyscript.y (input_list_element): Allow strings prefixed with
5674 the '-' character. Treat these as libraries.
5675 * script.cc (script_add_library): New function. Adds a library
5676 specified by "-l<name>" found in an input script.
5677 * script-c.h: Add prototype for script_add_library.
5678
5679 2010-06-07 Doug Kwan <dougkwan@google.com>
5680
5681 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5682 Restrict stub-group size to be within long conditional branch
5683 range when working around cortex-A8 erratum.
5684
5685 2010-06-07 Damien Diederen <dd@crosstwine.com>
5686
5687 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5688 #ifdef typo.
5689
5690 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5691
5692 PR gold/11658
5693 * output.cc
5694 (Output_section::Input_section_sort_entry::compare_section_ordering):
5695 Change to return non-zero correctly.
5696 (Output_section::Input_section_sort_section_order_index_compare
5697 ::operator()): Change to fix ambiguity in comparisons.
5698
5699 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5700
5701 * gold.h (is_wildcard_string): New function.
5702 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5703 (Layout::layout_eh_frame): Ditto.
5704 (Layout::find_section_order_index): New method.
5705 (Layout::read_layout_from_file): New method.
5706 * layout.h (Layout::find_section_order_index): New method.
5707 (Layout::read_layout_from_file): New method.
5708 (Layout::input_section_position_): New private member.
5709 (Layout::input_section_glob_): New private member.
5710 * main.cc (main): Call read_layout_from_file here.
5711 * options.h (--section-ordering-file): New option.
5712 * output.cc (Output_section::input_section_order_specified_): New
5713 member.
5714 (Output_section::Output_section): Initialize new member.
5715 (Output_section::add_input_section): Add new parameter.
5716 Keep input sections when --section-ordering-file is used.
5717 (Output_section::set_final_data_size): Sort input sections when
5718 section ordering file is specified.
5719 (Output_section::Input_section_sort_entry): Add new parameter.
5720 Check sorting type.
5721 (Output_section::Input_section_sort_entry::compare_section_ordering):
5722 New method.
5723 (Output_section::Input_section_sort_compare::operator()): Change to
5724 consider section_order_index.
5725 (Output_section::Input_section_sort_init_fini_compare::operator()):
5726 Change to consider section_order_index.
5727 (Output_section::Input_section_sort_section_order_index_compare
5728 ::operator()): New method.
5729 (Output_section::sort_attached_input_sections): Change to sort
5730 according to section order when specified.
5731 (Output_section::add_input_section<32, true>): Add new parameter.
5732 (Output_section::add_input_section<64, true>): Add new parameter.
5733 (Output_section::add_input_section<32, false>): Add new parameter.
5734 (Output_section::add_input_section<64, false>): Add new parameter.
5735 * output.h (Output_section::add_input_section): Add new parameter.
5736 (Output_section::input_section_order_specified): New
5737 method.
5738 (Output_section::set_input_section_order_specified): New method.
5739 (Input_section::Input_section): Initialize section_order_index_.
5740 (Input_section::section_order_index): New method.
5741 (Input_section::set_section_order_index): New method.
5742 (Input_section::section_order_index_): New member.
5743 (Input_section::Input_section_sort_section_order_index_compare): New
5744 struct.
5745 (Output_section::input_section_order_specified_): New member.
5746 * script-sections.cc (is_wildcard_string): Delete and move modified
5747 method to gold.h.
5748 (Output_section_element_input::Output_section_element_input): Modify
5749 call to is_wildcard_string.
5750 (Output_section_element_input::Input_section_pattern
5751 ::Input_section_pattern): Ditto.
5752 (Output_section_element_input::Output_section_element_input): Ditto.
5753 * testsuite/Makefile.am (final_layout): New test case.
5754 * testsuite/Makefile.in: Regenerate.
5755 * testsuite/final_layout.cc: New file.
5756 * testsuite/final_layout.sh: New file.
5757
5758 2010-06-01 Rafael Espindola <espindola@google.com>
5759
5760 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5761
5762 2010-06-01 Rafael Espindola <espindola@google.com>
5763
5764 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5765 visibility of symbols.
5766
5767 2010-05-27 Doug Kwan <dougkwan@google.com>
5768
5769 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5770 from start of output section instead of address for a local symbol
5771 in a merged or relaxed section when doing a relocatable link.
5772
5773 2010-05-26 Rafael Espindola <espindola@google.com>
5774
5775 PR 11604
5776 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5777 adding sections the garbage collector removed.
5778 * gold/testsuite/Makefile.am: Add test.
5779 * gold/testsuite/Makefile.in: Regenerate.
5780 * gold/testsuite/plugin_test_7.sh: New.
5781 * gold/testsuite/plugin_test_7_1.c: New.
5782 * gold/testsuite/plugin_test_7_2.c: New.
5783
5784 2010-05-26 Rafael Espindola <espindola@google.com>
5785
5786 * script-sections.cc (Output_section_definition::set_section_addresses):
5787 Check for --section-start.
5788
5789 2010-05-26 Doug Kwan <dougkwan@google.com>
5790
5791 * arm.cc (Arm_scan_relocatable_relocs): New class.
5792 (Target_arm::relocate_special_relocatable): New method.
5793 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5794 (Arm_relocate_functions::thumb_branch_common): Same.
5795 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5796 instead of Default_scan_relocatable_relocs.
5797 * target-reloc.h (relocate_for_relocatable): Let target handle
5798 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5799 * target.h (Sized_target::relocate_special_relocatable): New method.
5800
5801 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5802
5803 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5804
5805 2010-05-23 Doug Kwan <dougkwan@google.com>
5806
5807 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5808 instead of a cast.
5809 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5810 with a direct branch, not a conditional branch, to a stub.
5811 * merge.cc (Output_merge_base::record_input_section): New method
5812 defintion.
5813 (Output_merge_data::do_add_input_section): Record input section if
5814 keeps-input-sections flag is set.
5815 (Output_merge_string::do_add_input_section): Ditto.
5816 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5817 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5818 INPUT_SECTIONS_.
5819 (Output_merge_base::keeps_input_sections,
5820 Output_merge_base::set_keeps_input_sections,
5821 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5822 method definitions.
5823 (Output_merge_base::Input_sections): New type declaration.
5824 (Output_merge_base::input_sections_begin,
5825 Output_merge_base::input_sections_end,
5826 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5827 (Output_merge_base::bool keeps_input_sections_,
5828 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5829 Output_merge_base::input_sections_): New data members.
5830 (Output_merge_data::do_set_keeps_input_sections): New method
5831 defintion.
5832 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5833 * output.cc (Output_section::Input_section::relobj): Move method
5834 defintion from class declaration to here and handle merge sections.
5835 (Output_section::Input_section::shndx): Ditto.
5836 (Output_section::Output_section): Remove initializations of removed
5837 data members and initialize new data member LOOKUP_MAPS_.
5838 (Output_section::add_input_section): Set keeps-input-sections flag
5839 for a newly created merge output section as appropriate. Adjust code
5840 to use Output_section_lookup_maps class.
5841 (Output_section::add_relaxed_input_section): Adjst code for lookup
5842 maps code refactoring.
5843 (Output_section::add_merge_input_section): Add a new parameter
5844 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5845 class. If adding input section to a newly created merge output
5846 section fails, remove the new merge section.
5847 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5848 Adjust code for use of the Output_section_lookup_maps class.
5849 (Output_section::find_merge_section): Ditto.
5850 (Output_section::build_lookup_maps): New method defintion.
5851 (Output_section::find_relaxed_input_section): Adjust code to use
5852 Output_section_lookup_maps class.
5853 (Output_section::get_input_sections): Export merge sections. Adjust
5854 code to use Output_section_lookup_maps class.
5855 (Output_section:::add_script_input_section): Adjust code to use
5856 Output_section_lookup_maps class. Update lookup maps for merge
5857 sections also.
5858 (Output_section::discard_states): Use Output_section_lookup_maps.
5859 (Output_section::restore_states): Same.
5860 * output.h (Merge_section_properties): Move class defintion out of
5861 Output_section.
5862 (Output_section_lookup_maps): New class.
5863 (Output_section::Input_section::is_merge_section): New method
5864 defintion.
5865 (Output_section::Input_section::relobj): Move defintion out of class
5866 defintion. Declare method only.
5867 (Output_section::Input_section::shndx): Ditto.
5868 (Output_section::Input_section::output_merge_base): New method defintion.
5869 (Output_section::Input_section::u2_.pomb): New union field.
5870 (Output_section::Merge_section_by_properties_map,
5871 Output_section::Output_section_data_by_input_section_map,
5872 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5873 Remove types.
5874 (Output_section::add_merge_input_section): Add new parameter
5875 KEEPS_INPUT_SECTIONS.
5876 (Output_section::build_lookup_maps): New method declaration.
5877 (Output_section::merge_section_map_,
5878 Output_section::merge_section_by_properties_map_,
5879 Output_section::relaxed_input_section_map_,
5880 Output_section::is_relaxed_input_section_map_valid_): Remove data
5881 members.
5882 (Output_section::lookup_maps_): New data member.
5883
5884 2010-05-21 Doug Kwan <dougkwan@google.com>
5885
5886 PR gold/11619
5887 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5888 avoid a compilation error.
5889
5890 2010-05-19 Rafael Espindola <espindola@google.com>
5891
5892 * script-sections.cc (Output_section_definition::allocate_to_segment):
5893 Update the phdrs_list even when the output section is NULL.
5894 * testsuite/Makefile.am: Add test.
5895 * testsuite/Makefile.in: Regenerate.
5896 * testsuite/script_test_9.cc: New.
5897 * testsuite/script_test_9.sh: New.
5898 * testsuite/script_test_9.t: New.
5899
5900 2010-05-19 Doug Kwan <dougkwan@google.com>
5901
5902 * arm.cc (Arm_input_section::original_size): New method.
5903 (Arm_input_section::do_addralign): Add a cast.
5904 (Arm_input_section::do_output_offset): Remove static cast.
5905 (Arm_input_section::original_addralign,
5906 Arm_input_section::original_size_): Change type to uint32_t.
5907 (Arm_input_section::init): Add safe casts for section alignment
5908 and size.
5909 (Arm_input_section::set_final_data_size): Do not set address and
5910 offset of stub table.
5911 (Arm_output_section::fix_exidx_coverage): Change use of of
5912 Output_section::Simple_input_section to that of
5913 Output_section::Input_section.
5914 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5915 except for the first pass.
5916 * output.cc (Output_section::get_input_sections): Change type of
5917 input_sections to std::list<Input_section>.
5918 (Output_section::add_script_input_section): Rename from
5919 Output_section::add_simple_input_section. Change type of SIS
5920 parameter from Simple_input_section to Input_section.
5921 * output.h (Output_section::Simple_input_section): Remove class.
5922 (Output_section::Input_section): Change class visibility to public.
5923 (Output_section::Input_section::addralign): Use stored alignments
5924 for special input sections if set.
5925 (Output_section::Input_section::set_addralign): New method.
5926 (Output_section::get_input_sections): Change parameter type from
5927 list of Simple_input_section to list of Input_section.
5928 (Output_section::add_script_input_section): Rename from
5929 Output_section::add_simple_input_section. Change first parameter's
5930 type from Simple_input_section to Input_section and remove the
5931 second and third parameters.
5932 * script-sections.cc (Input_section::Input_section_list): Change
5933 type to list of Output_section::Input_section/
5934 (Input_section_info::Input_section_info): Change parameter type of
5935 INPUT_SECTION to Output_section::Input_section.
5936 (Input_section_info::input_section): Change return type.
5937 (Input_section_info::input_section_): Change type to
5938 Output_section::Input_section.
5939 (Output_section_element_input::set_section_addresses): Adjust code
5940 to use Output_section::Input_section instead of
5941 Output_section::Simple_input_section. Adjust code for renaming
5942 of Output_section::add_simple_input_section.
5943 (Orphan_output_section::set_section_addresses): Ditto.
5944
5945 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5946
5947 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5948 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5949
5950 2010-05-18 Rafael Espindola <espindola@google.com>
5951
5952 * options.cc (General_options::finalize): Handle -nostdlib.
5953 * options.h (nostdlib): New option.
5954 * script.cc (script_add_search_dir): Handle -nostdlib.
5955
5956 2010-05-12 Doug Kwan <dougkwan@google.com>
5957
5958 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5959 attributes section only if there no attributes section after merging.
5960 (Target_arm::merge_object_attributes): Move value of
5961 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5962 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5963 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5964 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5965 and arm_attr_merge_7.stdout.
5966 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5967 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5968 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5969 arm_attr_merge_7b.o): New rules.
5970 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5971 arm_attr_merge_7
5972 * testsuite/Makefile.in: Regenerate.
5973 * testsuite/arm_attr_merge.sh: New file.
5974 * testsuite/arm_attr_merge_[67][ab].s: Same.
5975
5976 2010-05-05 Nick Clifton <nickc@redhat.com>
5977
5978 * po/es.po: Updated Spanish translation.
5979
5980 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5981
5982 * Makefile.am (install-exec-local): Properly install gold as
5983 default cross linker.
5984 * Makefile.in: Regenerated.
5985
5986 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5987 Nick Clifton <nickc@redhat.com>
5988
5989 * configure.ac (install_as_default): Define and set to false
5990 unless --enable-gold or --enable-gold=both/gold has been
5991 specified.
5992 * configure: Regenerate.
5993
5994 * Makefile.am (install-exec-local): Install the executable as
5995 'ld.gold'. If install_as_default is true then also install it as
5996 'ld'.
5997 * Makefile.in: Regenerated.
5998
5999 2010-04-24 Ian Lance Taylor <iant@google.com>
6000
6001 * layout.cc (Layout::layout_reloc): In relocatable link don't
6002 combine reloc sections for grouped sections.
6003
6004 2010-04-23 Sriraman Tallam <tmsriram@google.com>
6005
6006 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6007 sections that are not ordinary to icf.
6008 * icf.cc (get_section_contents): Handle relocation pointing to section
6009 with no object or shndx information.
6010 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6011 * testsuite/Makefile.in: Regenerate.
6012 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6013 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6014
6015 2010-04-22 Ian Lance Taylor <iant@google.com>
6016
6017 * expression.cc (Expression::Expression_eval_info): Add
6018 result_alignment_pointer field.
6019 (Expression::eval_with_dot): Add result_alignment_pointer
6020 parameter. Change all callers.
6021 (Expression::eval_maybe_dot): Likewise.
6022 (class Binary_expression): Add alignment_pointer parameter to
6023 left_value and right_value. Change all callers.
6024 (BINARY_EXPRESSION): Set result alignment.
6025 (class Trinary_expression): Add alignment_pointer parameter to
6026 arg2_value and arg3_value. Change all callers.
6027 (Trinary_cond::value): Set result alignment.
6028 (Max_expression::value, Min_expression::value): Likewise.
6029 (Align_expression::value): Likewise.
6030 * script-sections.cc (class Sections_element): Add dot_alignment
6031 parameter to set_section_addresses virtual function. Update
6032 instantiations.
6033 (class Output_section_element): Likewise.
6034 (Script_sections::create_segments): Add dot_alignment parameter.
6035 Change all callers.
6036 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6037 (Script_sections::set_phdrs_clause_addresses): Likewise.
6038 * script-sections.h: Update declarations.
6039 * script.h: Update declarations.
6040 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6041 min_p_align.
6042 * testsuite/script_test_3.t: Set large alignment.
6043 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6044 segment has expected alignment.
6045
6046 2010-04-22 Nick Clifton <nickc@redhat.com>
6047
6048 * po/gold.pot: Updated by the Translation project.
6049 * po/vi.po: Updated Vietnamese translation.
6050
6051 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6052
6053 * testsuite/Makefile.am (check_PROGRAMS): Add
6054 icf_virtual_function_folding_test.
6055 * testsuite/Makefile.in: Regenerated.
6056
6057 2010-04-15 Andrew Haley <aph@redhat.com>
6058
6059 * options.h (merge_exidx_entries): New option.
6060 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6061 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6062 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6063 (Target_arm::merge_exidx_entries): New function.
6064 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6065 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6066 to Arm_exidx_fixup constructor.
6067 Add new arg, merge_exidx_entries.
6068 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6069 Arm_output_section::fix_exidx_coverage.
6070
6071 2010-04-18 Sriraman Tallam <tmsriram@google.com>
6072
6073 * icf.cc (get_section_contents): Check for preemptible functions.
6074 Ignore addend when appropriate.
6075 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6076 section folded.
6077 (add_from_relobj): Check for section folded.
6078 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6079 * symtab.h (should_add_dynsym_entry): Add new parameter.
6080 * target-reloc.h (scan_relocs): Check for section folded.
6081 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6082 Check reloc types for function pointers in shared objects.
6083 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6084 case.
6085 (icf_preemptible_functions_test): New test case.
6086 (icf_string_merge_test): New test case.
6087 * testsuite.Makefile.in: Regenerate.
6088 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6089 bar_glob. Refactor code.
6090 * testsuite/icf_preemptible_functions_test.cc: New file.
6091 * testsuite/icf_preemptible_functions_test.sh: New file.
6092 * testsuite/icf_string_merge_test.cc: New file.
6093 * testsuite/icf_string_merge_test.sh: New file.
6094 * testsuite/icf_virtual_function_folding_test.cc: New file.
6095 * testsuite/icf_virtual_function_folding_test.sh: New file.
6096
6097 2010-04-14 Doug Kwan <dougkwan@google.com>
6098
6099 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6100 for local symbol recounting if we remove a section due to ICF.
6101 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6102 there are no regular objects in input.
6103
6104 2010-04-13 Doug Kwan <dougkwan@google.com>
6105
6106 * arm.cc (Arm_input_section::set_final_data_size): Compute
6107 accurate final data size instead of using current data size.
6108
6109 2010-04-09 Doug Kwan <dougkwan@google.com>
6110
6111 * layout.cc (Layout::choose_output_section): Handle script section
6112 types.
6113 (Layout::make_output_section_for_script): Add section type parameter.
6114 Handle script section types.
6115 * layout.h (Layout::make_output_section_for_script): Add section
6116 type parameter.
6117 * output.cc (Output_section::Output_section): Initialize data member
6118 is_noload_.
6119 (Output_section::do_reset_address_and_file_offset): Do not set address
6120 to 0 if section is a NOLOAD section.
6121 * output.h (Output_section::is_noload): New method.
6122 (Output_section::set_is_noload): Ditto.
6123 (Output_section::is_noload_): New data member.
6124 * script-c.h (Script_section_type): New enum type.
6125 (struct Parser_output_section_header): Add new file section_type.
6126 * script-sections.cc (Sections_element::output_section_name): Add
6127 parameter for returning script section type.
6128 (Output_section_definition::output_section_name): Ditto.
6129 (Output_section_definition::section_type)P; New method.
6130 (Output_section_definiton::script_section_type_name): Ditto.
6131 (Output_section_definition::script_section_type_): New data member.
6132 (Output_section_definition::Output_section_definition): Initialize
6133 data member Output_section_definition::script_section_type_.
6134 (Output_section_definition::create_sections): Pass script section type
6135 to Layout::make_output_section_for_script.
6136 (Output_section_definition::output_section_name): Return script
6137 section type to caller.
6138 (Output_section_definition::set_section_address): Do not advance
6139 dot value and load address if section type is NOLOAD. Set address
6140 of NOLOAD sections regardless of section flags.
6141 (Output_section_definition::print): Print section type if it is
6142 not SCRIPT_SECTION_TYPE_NONE.
6143 (Output_section_definition::section_type): New method.
6144 (Output_section_definition::script_section_type_name): Ditto.
6145 (Script_sections::output_section_name): Add new parameter
6146 PSECTION_TYPE for returning script section type. Pass it to
6147 section elements. Handle discard sections.
6148 (Sort_output_sections::operator()): Handle NOLOAD sections.
6149 * script-sections.h (Script_sections::Section_type): New enum type.
6150 (Script_sections::output_section_name): Add a new parameter for
6151 returning script section type.
6152 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6153 INFO and NOLOAD.
6154 * yyscript.y (union): Add new field SECTION_TYPE.
6155 (COPY, DSECT, INFO, NOLOAD): New tokens.
6156 (opt_address_and_section_type): Change type to output_section_header.
6157 (section_type): New non-terminal
6158 (section_header): Handle section type.
6159 (opt_address_and_section_type): Return section type value.
6160
6161 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6162
6163 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6164 * testsuite/plugin_common_test_2.c (foo): Likewise.
6165
6166 2010-04-08 Doug Kwan <dougkwan@google.com>
6167
6168 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6169 Output_merge_data.
6170 * output.cc (Output_section::add_merge_input_section): Simplify
6171 code and return status of Output_merge_base::add_input_section.
6172 Update merge section map only if Output_merge_base::add_input_section
6173 returns true.
6174
6175 2010-04-07 Doug Kwan <dougkwan@google.com>
6176
6177 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6178 if section is marked as containing instructions but has no mapping
6179 symbols.
6180 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6181 correct section index.
6182 (Arm_relobj::find_linked_text_section): Ditto.
6183
6184 2010-04-07 Cary Coutant <ccoutant@google.com>
6185
6186 * archive.cc (include_member): Destroy Read_symbols_data object before
6187 releasing file.
6188 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6189 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6190 (Read_symbols_data::~Read_symbols_data) New destructor.
6191 (Section_relocs::Section_relocs) New constructor.
6192 (Section_relocs::~Section_relocs) New destructor.
6193 (Read_relocs_data::Read_relocs_data) New constructor.
6194 (Read_relocs_data::~Read_relocs_data) New destructor.
6195 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6196 pointers to NULL after deleting.
6197
6198 2010-04-07 Doug Kwan <dougkwan@google.com>
6199
6200 * arm.cc: Replace "endianity" with "endianness" in comments.
6201 (Arm_exidx_cantunwind): Ditto.
6202 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6203 (Arm_relobj::merge_flags_and_attributes): New method.
6204 (Arm_relobj::merge_flags_and_attributes_): New data member.
6205 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6206 (Arm_relobj::scan_sections_for_stubs): Ditto.
6207 (Arm_relobj::do_read_symbols): Check to see if we really want to
6208 merge processor-specific flags and attributes. Exit early if
6209 an object is empty except for section names and the undefined symbol.
6210 (Target_arm::do_finalize_sections): Move check for ELF format to
6211 Arm_relobj::do_read_symbols. Merge processor specific flags and
6212 attributes from a regular object only when we have determined that
6213 it is aapropriate. Do not create an .ARM.attributes section in
6214 output if there is no regular input object.
6215 (Target_arm::merge_processor_specific_flags): Check
6216 --warn-mismatch before printing any error.
6217 (Target_arm::merge_object_attributes): Ditto.
6218 * gold.cc (queue_middle_tasks): Handle the case in which there is
6219 no regular object in input.
6220 * options.cc (General_options::parse_EB): New method.
6221 (General_options::parse_EL): Same.
6222 (General_options::General_options): Initialize endianness_.
6223 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6224 New options.
6225 (General_options::Endianness): New enum.
6226 (General_options::endianness): New method.
6227 (General_options::endianness_): New data member.
6228 * parameters.cc (Parameters::set_options): Check target endianness.
6229 (Parameters::set_target_once): Ditto.
6230 (Parameters::check_target_endianness): New method.
6231 (parameters_force_valid_target): If either -EL or -EB is specified,
6232 use it to define endianness of default target.
6233 * parameters.h (Parameters::check_target_endianness): New method
6234 declaration.
6235 * target.h (class Target): Change "endianity" to "endianness"
6236 in comments.
6237
6238 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6239
6240 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6241 * configure: Regenerate.
6242 * Makefile.in: Regenerate.
6243 * testsuite/Makefile.in: Regenerate.
6244
6245 2010-04-06 Cary Coutant <ccoutant@google.com>
6246
6247 gcc PR lto/42757
6248 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6249 prevailing definitions of common symbols.
6250 * testsuite/plugin_test_6.sh: New test case.
6251 * testsuite/plugin_common_test_1.c: New test case.
6252 * testsuite/plugin_common_test_2.c: New test case.
6253 * testsuite/Makefile.am (plugin_test_6): New test case.
6254 * testsuite/Makefile.in: Regenerate.
6255
6256 2010-04-06 Nick Clifton <nickc@redhat.com>
6257
6258 * po/vi.po: New Vietnamese translation.
6259
6260 2010-03-30 Doug Kwan <dougkwan@google.com>
6261
6262 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6263
6264 2010-03-25 Doug Kwan <dougkwan@google.com>
6265
6266 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6267 to avoid a conversion warning on a 32-bit host.
6268
6269 2010-03-24 Ian Lance Taylor <iant@google.com>
6270
6271 * testsuite/script_test_3.t: Add a TLS segment.
6272 * testsuite/Makefile.am (check_PROGRAMS): Add
6273 tls_phdrs_script_test.
6274 (tls_phdrs_script_test_SOURCES): Define.
6275 (tls_phdrs_script_test_DEPENDENCIES): Define.
6276 (tls_phdrs_script_test_LDFLAGS): Define.
6277 (tls_phdrs_script_test_LDADD): Define.
6278 * testsuite/Makefile.in: Rebuild.
6279
6280 2010-03-23 Cary Coutant <ccoutant@google.com>
6281
6282 * fileread.cc (find_or_make_view): Fix comment.
6283
6284 2010-03-23 Ian Lance Taylor <iant@google.com>
6285
6286 * script-sections.cc (class Orphan_section_placement): Define
6287 PLACE_TLS and PLACE_TLS_BSS.
6288 (Orphan_section_placement::Orphan_section_placement): Initialize
6289 new places.
6290 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6291 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6292 (tls_script_test_SOURCES): Define.
6293 (tls_script_test_DEPENDENCIES): Define.
6294 (tls_script_test_LDFLAGS): Define.
6295 (tls_script_test_LDADD): Define.
6296 * testsuite/Makefile.in: Rebuild.
6297
6298 2010-03-22 Doug Kwan <dougkwan@google.com>
6299
6300 * arm.cc (Arm_relocate_functions::abs8,
6301 Arm_relocate_functions::abs16): Use correct check for overflow
6302 specified in the ARM ELF specs.
6303 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6304 target of a BLX instruction specially.
6305 (Reloc_stub::stub_type_for_reloc): Ditto.
6306 (Relocate::relocate): Use symbolic names instead of numeric relocation
6307 codes to report error.
6308 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6309 workaround.
6310 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6311 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6312 thumb2_blx_out_of_range.stdout
6313 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6314 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6315 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6316 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6317 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6318 thumb2_blx_in_range, thumb2_blx_in_range.o,
6319 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6320 thumb2_blx_out_of_range.o): New rules.
6321 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
6322 thumb2_blx_in_range and thumb2_blx_out_of_range.
6323 * testsuite/Makefile.in: Regenerate.
6324 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6325 * testsuite/thumb_blx_in_range.s: New file.
6326 * testsuite/thumb_blx_out_of_range.s: New file.
6327
6328 2010-03-22 Rafael Espindola <espindola@google.com>
6329
6330 * archive.cc (Should_include): Move to archive.h.
6331 (should_include_member): Make it a member of Archive.
6332 (Lib_group): New.
6333 (Add_lib_group_symbols): New.
6334 * archive.h: Include options.h.
6335 (Archive_member): Moved from Archive.
6336 (Should_include): Moved from archive.cc.
6337 (Lib_group): New.
6338 (Add_lib_group_symbols): New.
6339 * dynobj.cc (do_should_include_member): New.
6340 * dynobj.h (do_should_include_member): New.
6341 * gold.cc (queue_initial_tasks): Update call to queue.
6342 * main.cc (main): Print lib group stats.
6343 * object.cc (do_should_include_member): New.
6344 * object.h: Include archive.h.
6345 (Object::should_include_member): New.
6346 (Object::do_should_include_member): New.
6347 (Sized_relobj::do_should_include_member): New.
6348 * options.cc (General_options::parse_start_lib): New.
6349 (General_options::parse_end_lib): New.
6350 (Input_arguments::add_file): Handle lib groups.
6351 (Input_arguments::start_group): Check we are not in a lib.
6352 (Input_arguments::start_lib): New.
6353 (Input_arguments::end_lib): New.
6354 * options.h (General_options): Add start_lib and end_lib.
6355 (Input_argument::lib_): New.
6356 (Input_argument::lib): New.
6357 (Input_argument::is_lib): New.
6358 (Input_file_lib): New.
6359 (Input_arguments::in_lib_): New.
6360 (Input_arguments::in_lib): New.
6361 (Input_arguments::start_lib): New.
6362 (Input_arguments::end_lib_): New.
6363 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6364 in unused members as preempted.
6365 (Sized_pluginobj::do_should_include_member): New.
6366 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6367 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6368 return the blocker.
6369 (Read_symbols::do_whole_lib_group): New.
6370 (Read_symbols::do_lib_group): New.
6371 (Read_symbols::do_read_symbols): Handle lib groups.
6372 (Read_symbols::get_name): Handle lib groups.
6373 * readsyms.h (Read_symbols): Add an archive member pointer.
6374 (Read_symbols::do_whole_lib_group): New.
6375 (Read_symbols::do_lib_group): New.
6376 (Read_symbols::member_): New.
6377 * script.cc (read_input_script): Update call to queue_soon.
6378
6379 2010-03-19 Doug Kwan <dougkwan@google.com>
6380
6381 * arm.cc (Stub_table::Stub_table): Initialize new data members
6382 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6383 (Stub_table::add_reloc_stub): Assign stub offset and update
6384 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6385 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6386 New data members.
6387 (Stub_table::update_data_size_and_addralign): Use
6388 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6389 instead of going over all reloc stubs.
6390 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
6391 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6392 Stringpool_template::offset_ to size of Stringpool_char.
6393 (Stringpool_template::new_key_offset): Remove code to initialize
6394 Stringpool_template::offset_.
6395 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6396 Stringpool_template::offset_ to zero.
6397
6398 2010-03-15 Doug Kwan <dougkwan@google.com>
6399
6400 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6401 offset_.
6402 (Stringpool_template::new_key_offset): New method.
6403 (Stringpool_template::add_string): Assign offsets when adding new
6404 strings.
6405 (Stringpool_template::set_string_offsets): Do not set string offsets
6406 when not optimizing.
6407 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6408 member size_.
6409 (Chunked_vector::clear): Clear size_.
6410 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6411 (Chunked_vector::size): Return size_.
6412 (Chunked_vector::push_back): Use size_ to find insert position.
6413 (Chunked_vector::size_): New data member.
6414 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6415 (Stringpool_template::new_key_offset): New method declaration.
6416 (Stringpool_template::offset_): New data member.
6417
6418 2010-03-15 Rafael Espindola <espindola@google.com>
6419
6420 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6421 Add_symbols' constructor.
6422 * readsyms.h (Add_symbols): Remove the input_group member.
6423
6424 2010-03-10 Ian Lance Taylor <iant@google.com>
6425
6426 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6427 target to ask whether a reference to a symbol requires a stack
6428 split.
6429 * target.h (Target::is_call_to_non_split): New function.
6430 (Target::do_is_call_to_non_split): Declare virtual function.
6431 * target.cc: Include "symtab.h".
6432 (Target::do_is_call_to_non_split): New function.
6433 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6434
6435 2010-03-10 Cary Coutant <ccoutant@google.com>
6436
6437 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6438 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6439 (File_read::open[2]): Add whole_file_view_ to list of views.
6440 (File_read::make_view): Remove test of whole_file_view_.
6441 (File_read::find_or_make_view): Create whole_file_view_ if
6442 necessary.
6443 (File_read::clear_views): Replace bool parameter with enum;
6444 adjust all callers. Don't delete views with permanent data;
6445 do delete cached views and views from archives if
6446 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6447 if clearing the corresponding view.
6448 * fileread.h (File_read::Clear_views_mode): New enum.
6449 (File_read::View::is_permanent_view): New method.
6450 (File_read::clear_views): Replace bool parameter
6451 with enum; adjust all callers.
6452 * options.h (General_options): Change keep_files_mapped option;
6453 add map_whole_files.
6454 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6455 releasing the file.
6456 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6457 the file.
6458
6459 2010-03-10 David S. Miller <davem@davemloft.net>
6460
6461 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6462
6463 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6464
6465 * icf.cc (get_section_contents): Add '@' marker after processing the
6466 merge reloc.
6467
6468 2010-03-08 Doug Kwan <dougkwan@google.com>
6469
6470 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6471 due to a conversion warning.
6472 (Arm_relobj::update_output_local_symbol_count): Check for local
6473 symbol with unset output index.
6474
6475 2010-03-05 Ian Lance Taylor <iant@google.com>
6476
6477 * options.h (class General_options): Add --spare-dynamic-tags.
6478 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6479 --spare-dynamic-tags.
6480
6481 2010-03-05 Ian Lance Taylor <iant@google.com>
6482
6483 * incremental.cc: Include "libiberty.h".
6484
6485 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6486
6487 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6488 function, is_info_ member.
6489 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6490 (Versions::Versions): Update caller.
6491 (Versions::define_base_version): Likewise.
6492 (Versions::add_def): Likewise.
6493
6494 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6495
6496 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6497 (Scan::possible_function_pointer_reloc): New function.
6498 (Scan::local_reloc_may_be_function_pointer): Change to call
6499 possible_function_pointer_reloc.
6500 (Scan::global_reloc_may_be_function_pointer): Ditto.
6501 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6502 relocations in ".data.rel.ro._ZTV" section.
6503 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6504 * testsuite/icf_safe_so_test.cc: Ditto.
6505 * testsuite/icf_safe_test.cc: Ditto.
6506 * testsuite/icf_safe_test.sh: Ditto.
6507
6508 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6509 Ian Lance Taylor <iant@google.com>
6510
6511 * target-reloc.h (relocate_section): Check the symbol table index
6512 for -1U before setting the local symbol index.
6513 (scan_relocatable_relocs): If copying the relocation, record that
6514 the local symbol is required.
6515 * object.h (Symbol_value::is_output_symtab_index_set): New
6516 function.
6517 (Symbol_value::may_be_discarded_from_output_symtab): New
6518 function.
6519 (Symbol_value::has_output_symtab_entry): New function.
6520 (Symbol_value::needs_output_symtab_entry): Remove.
6521 (Symbol_value::output_symtab_index): Make sure the symbol index is
6522 set.
6523 (Symbol_value::set_output_symtab_index): Make sure the symbol
6524 index is not set. Make sure the new index is valid.
6525 (Symbol_value::set_must_have_output_symtab_entry): New function.
6526 (Symbol_value::has_output_dynsym_entry): New function.
6527 (Symbol_value::set_output_dynsym_index): Make sure the new index
6528 is valid.
6529 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6530 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6531 local symbol if permitted.
6532 (Sized_relobj::do_finalize_local_symbols): Call
6533 is_output_symtab_index_set rather than needs_output_symtab_entry.
6534 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6535 rather than needs_output_symtab_entry. Call
6536 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6537 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6538 is_output_symtab_index_set rather than needs_output_symtab_entry.
6539 * testsuite/discard_locals_relocatable_test.c: New file.
6540 * testsuite/discard_locals_test.sh: Test -r.
6541 * testsuite/Makefile.am (check_DATA): Add
6542 discard_locals_relocatable_test1.syms,
6543 discard_local_relocatable_test2.syms.
6544 (MOSTLYCLEANFILES): Likewise. Also add
6545 discard_locals_relocatable_test1.lout and
6546 discard_locals_relocatable_test2.out.
6547 (discard_locals_relocatable_test1.syms): New target.
6548 (discard_locals_relocatable_test.o): New target.
6549 (discard_locals_relocatable_test1.out): New target.
6550 (discard_locals_relocatable_test2.syms): New target.
6551 (discard_locals_relocatable_test2.out): New target.
6552 (various): Add missing ../ld-new dependencies.
6553 * testsuite/Makefile.in: Rebuild.
6554
6555 2010-03-03 Nick Clifton <nickc@redhat.com>
6556
6557 * po/fi.po: New Finnish translation.
6558
6559 2010-03-01 Doug Kwan <dougkwan@google.com>
6560
6561 * layout.cc (Layout::Layout): Force section types of .init_array*,
6562 .preinit_array* and .fini_array* sections.
6563 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6564 Fix check of return value of std::string::find.().
6565 (Output_section::Input_section_sort_compare::operator()): Remove
6566 comment about .init_array.
6567 (Output_section::Input_section_sort_init_fini_compare::operator()):
6568 New method.
6569 (Output_section::sort_attached_input_sections): Handle .init_array
6570 and .fini_array specially.
6571 * output.h (Output_section::Inut_section_sort_compare): Update
6572 comment.
6573 (Output_section::Input_section_sort_init_fini_compare): New struct.
6574
6575 2010-02-26 Doug Kwan <dougkwan@google.com>
6576
6577 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6578 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6579 * testsuite/debug_msg.sh: Avoid matching source line number for
6580 use of global variable undef_int.
6581
6582 2010-02-26 Doug Kwan <dougkwan@google.com>
6583
6584 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6585 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6586 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6587 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6588 * options.cc (General_options::General_options): Initialize member
6589 fix_v4bx_.
6590 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6591 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6592 and rm_no_fix_v4bx.stdout
6593 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6594 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6595 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6596 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6597 and arm_no_fix_v4bx.
6598 * Makefile.in: Regenerate.
6599 * testsuite/arm_fix_v4bx.s: New file.
6600 * testsuite/arm_fix_v4bx.sh: Ditto.
6601
6602 2010-02-24 Doug Kwan <dougkwan@google.com>
6603
6604 * arm.cc (Target_arm::got_section): Make the .got section the first
6605 non RELRO section in the data segment.
6606 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6607 suffixes of section names.
6608
6609 2010-02-24 Doug Kwan <dougkwan@google.com>
6610
6611 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6612 flags and attributes merging if an input file is a binary file.
6613 * fileread.cc (Input_file::open): Record format of original file.
6614 * fileread.h (Input_file::Format): New enum type.
6615 (Input_file::Input_file): Initialize data member format_.
6616 (Input_file::format): New method definition.
6617 (Input_file::format_):: New data member.
6618
6619 2010-02-24 Doug Kwan <dougkwan@google.com>
6620
6621 * arm.cc (Arm_output_data_got): New class.
6622 (ARM_TCB_SIZE): New constant
6623 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6624 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6625 If user uses a script with a SECTIONS clause, issue only a warning
6626 for a misplaced EXIDX input section. Otherwise, issue an error.
6627 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6628 garbage collection.
6629 (Target_arm::got_mode_index_entry): Handle static linking.
6630 (Target_arm::Scan::local): Ditto.
6631 (Target_arm::Scan::global): Ditto.
6632 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6633 all incorrectly implemented relocations.
6634 (Target_arm::fix_exidx_coverage): Pass layout to
6635 Arm_output_section::fix_exidx_coverage.
6636 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6637 from ".ARM.exidx." and ".ARM.extab.".
6638
6639 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6640
6641 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6642 section if it does not already exist.
6643 * attributes.cc (Attributes_section_data::Attributes_section_data):
6644 Don't crash if size is zero.
6645
6646 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6647 Ian Lance Taylor <iant@google.com>
6648
6649 * gold.cc (queue_middle_tasks): If no input files were opened,
6650 exit.
6651 * workqueue.h (Task_function::Task_function): Assert that there is
6652 a blocker.
6653
6654 2010-02-22 Doug Kwan <dougkwan@google.com>
6655
6656 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6657 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6658 types to avoid warnings due to different uint64_t implementations
6659 on different hosts.
6660
6661 2010-02-21 Doug Kwan <dougkwan@google.com>
6662
6663 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6664 handling of the maximum backward branch offset.
6665 (Arm_relocate_functions::thumb_branch_common): Ditto.
6666 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6667 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6668 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6669 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6670 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6671 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6672 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6673 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6674 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6675 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6676 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6677 thumb2_bl_out_of_range.o): New rules.
6678 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6679 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6680 thumb2_bl_out_of_range
6681 * testsuite/Makefile.in: Regenerate.
6682 * testsuite/arm_bl_in_range.s: New file.
6683 * testsuite/arm_bl_out_of_range.s: Ditto.
6684 * testsuite/arm_branch_in_range.sh: Ditto.
6685 * testsuite/arm_branch_range.t: Ditto.
6686 * testsuite/thumb2_branch_range.t: Ditto.
6687 * testsuite/thumb_bl_in_range.s: Ditto.
6688 * testsuite/thumb_bl_out_of_range.s: Ditto.
6689 * testsuite/thumb_branch_range.t: Ditto.
6690
6691 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6692
6693 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6694 Add reloc offset information.
6695 * icf.cc (get_section_contents): Change iterators to point to the new
6696 vectors. Add reloc offset information to the contents.
6697 * icf.h (Icf::Sections_reachable_info): New typedef.
6698 (Icf::Sections_reachable_list): New typedef.
6699 (Icf::Offset_info): New typedef.
6700 (Icf::Reloc_info): New struct typedef.
6701 (Icf::Reloc_info_list): New typedef.
6702 (Icf::symbol_reloc_list): Delete method.
6703 (Icf::addend_reloc_list): Delete method.
6704 (Icf::section_reloc_list): Delete method.
6705 (Icf::reloc_info_list): New method.
6706 (Icf::reloc_info_list_): New member.
6707
6708 2010-02-19 Doug Kwan <dougkwan@google.com>
6709
6710 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6711 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6712 * arm.cc (Arm_relocation_functions): New forward declaration.
6713 (Target_arm::Target_arm): Initialize new data members
6714 got_mod_index_offset_ and tls_base_symbol_defined_.
6715 (Target_arm::Relocate::relocate_tls): New method.
6716 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6717 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6718 New methods.
6719 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6720 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6721 (Target_arm::got_mod_index_offset_,
6722 Target_arm::tls_base_symbol_defined_): New data members.
6723 (Target_arm::Scan::local, Target::Scan::global,
6724 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6725 relocations.
6726
6727 2010-02-18 Doug Kwan <dougkwan@google.com>
6728
6729 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6730 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6731 text section as a parameter becuase some broken tools may not set
6732 the link in section header.
6733 (Target_arm::has_got_section): New method.
6734 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6735 without any mapping symbol as data only. Remove warning.
6736 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6737 link in its section header, try to discover the link by inspecting the
6738 REL31 relocation at the beginning of the section.
6739 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6740 in error message.
6741 (Target_arm::Scan::global): Treat any reference to the symbol
6742 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6743
6744 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6745
6746 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6747 (Scan::global_reloc_may_be_function_pointer): New function.
6748 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6749 (Scan::global_reloc_may_be_function_pointer): New function.
6750 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6751 (Scan::global_reloc_may_be_function_pointer): New function.
6752 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6753 (Scan::global_reloc_may_be_function_pointer): New function.
6754 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6755 (Scan::global_reloc_may_be_function_pointer): New function.
6756 (Scan::possible_function_pointer_reloc): New function.
6757 (Target_x86_64::can_check_for_function_pointers): New function.
6758 * gc.h (gc_process_relocs): Scan relocation types to determine if
6759 function pointers were taken for targets that support it.
6760 * icf.cc (Icf::find_identical_sections): Include functions for
6761 folding in safe ICF whose pointer is not taken.
6762 * icf.h (Secn_fptr_taken_set): New typedef.
6763 (fptr_section_id_): New member.
6764 (section_has_function_pointers): New function.
6765 (set_section_has_function_pointers): New function.
6766 (check_section_for_function_pointers): New function.
6767 * options.h: Fix comment for safe ICF option.
6768 * target.h (can_check_for_function_pointers): New function.
6769 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6770 Modify icf_safe_test for X86-64.
6771 * testsuite/Makefile.in: Regenerate.
6772 * testsuite/icf_safe_so_test.cc: New file.
6773 * testsuite/icf_safe_so_test.sh: New file.
6774 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6775 (main): Change to take pointer to function kept_func_3.
6776 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6777 folding is done correctly for X86-64.
6778
6779 2010-02-12 David S. Miller <davem@davemloft.net>
6780
6781 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6782 is_symbolless parameter.
6783 (Output_reloc<SHT_REL>::is_symbolless): New.
6784 (Output_reloc<SHT_REL>::is_symbolless_): New.
6785 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6786 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6787 (Output_reloc<SHT_RELA>::is_symbolless): New.
6788 (Output_data_reloc::add_global): Handle is_symbolless.
6789 (Output_data_reloc::add_global_relative): Likewise.
6790 (Output_data_reloc::add_local): Likewise.
6791 (Output_data_reloc::add_local_relative): Likewise.
6792 (Output_data_reloc::add_symbolless_global_addend): New.
6793 (Output_data_reloc::add_symbolless_local_addend): New.
6794 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6795 is_symbolless.
6796 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6797 instead of ->is_relative_
6798 (Output_reloc::write): Likewise.
6799 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6800 (Output_reloc::write_rel): Simplify.
6801
6802 * sparc.cc (Target_sparc::Scan::local): Use
6803 ->add_symbolless_local_addend as needed.
6804 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6805 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6806 based upon relocation offset.
6807
6808 2010-02-11 Doug Kwan <dougkwan@google.com>
6809
6810 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6811 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6812 beginning of function.
6813 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6814 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6815 parameter is_32bit in calls to should_apply_static_reloc.
6816 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6817 (check_DATA): Add arm_abs_global.stdout.
6818 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6819 arm_abs_global.stdout): New rules.
6820 (MOSTLLYCLEANFILES): Add arm_abs_global
6821 * Makefile.in: Regenerate.
6822 * testsuite/arm_abs_global.s: New file.
6823 * testsuite/arm_abs_global.sh: Ditto.
6824 * testsuite/arm_abs_lib.s: Ditto.
6825
6826 2010-02-11 Ian Lance Taylor <iant@google.com>
6827
6828 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6829 Read_relocs task.
6830 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6831 Allocate_commons_task first.
6832 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6833 task, rather than symtab_lock_.
6834 (Gc_process_relocs::~Gc_process_relocs): New function.
6835 (Gc_process_relocs::is_runnable): Check this_blocker_.
6836 (Gc_process_relocs::locks): Use next_blocker_ rather than
6837 blocker_.
6838 (Scan_relocs::~Scan_relocs): New function.
6839 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6840 symtab_lock_.
6841 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6842 next_blocker_.
6843 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6844 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6845 constructor accordingly.
6846 (class Gc_process_relocs): Likewise.
6847 (class Scan_relocs): Likewise.
6848 * common.h (class Allocate_commons_task): Remove symtab_lock_
6849 field, and corresponding constructor parameter.
6850 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6851 symtab_lock_.
6852 (Allocate_commons_task::locks): Likewise.
6853
6854 2010-02-11 Ian Lance Taylor <iant@google.com>
6855
6856 * gold-threads.h (class Once): Define.
6857 (class Initialize_lock): Rewrite as child of Once.
6858 * gold-threads.cc (class Once_initialize): Define.
6859 (once_pointer_control): New static variable.
6860 (once_pointer, once_arg): New static variables.
6861 (c_run_once): New static function.
6862 (Once::Once, Once::run_once, Once::internal_run): New functions.
6863 (class Initialize_lock_once): Remove.
6864 (initialize_lock_control): Remove.
6865 (initialize_lock_pointer): Remove.
6866 (initialize_lock_once): Remove.
6867 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6868 (Initialize_lock::initialize): Rewrite.
6869 (Initialize_lock::do_run_once): New function.
6870 * archive.cc (Archive::interpret_header): Only clear name if it is
6871 not already empty.
6872 * fileread.cc: Include "gold-threads.h"
6873 (file_counts_lock): New static variable.
6874 (file_counts_initialize_lock): Likewise.
6875 (File_read::release): Only increment counts when using --stats.
6876 Use a lock around the increment.
6877 * parameters.cc (class Set_parameters_target_once): Define.
6878 (set_parameters_target_once): New static variable.
6879 (Parameters::Parameters): Move here from parameters.h.
6880 (Parameters::set_target): Rewrite.
6881 (Parameters::set_target_once): New function.
6882 (Parameters::clear_target): Move here and rewrite.
6883 * parameters.h (class Parameters): Update declarations. Add
6884 set_parameters_target_once_ field.
6885 (Parameters::Parameters): Move to parameters.cc.
6886 (Parameters::clear_target): Likewise.
6887 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6888 task.
6889 (Start_group::~Start_group): New function.
6890 (Start_group::is_runnable): New function.
6891 (Start_group::locks, Start_group::run): New functions.
6892 (Finish_group::run): Change saw_undefined to size_t.
6893 * readsyms.h (class Start_group): Define.
6894 (class Finish_group): Change saw_undefined_ field to size_t.
6895 (Finish_group::Finish_group): Remove saw_undefined and
6896 this_blocker parameters. Change all callers.
6897 (Finish_group::set_saw_undefined): New function.
6898 (Finish_group::set_blocker): New function.
6899 * symtab.h (class Symbol_table): Change saw_undefined to return
6900 size_t. Change saw_undefined_ field to size_t.
6901 * target-select.cc (Set_target_once::do_run_once): New function.
6902 (Target_selector::Target_selector): Initialize set_target_once_
6903 field. Don't initialize lock_ and initialize_lock_ fields.
6904 (Target_selector::instantiate_target): Rewrite.
6905 (Target_selector::set_target): New function.
6906 * target-select.h (class Set_target_once): Define.
6907 (class Target_selector): Update declarations. Make
6908 Set_target_once a friend. Remove lock_ and initialize_lock_
6909 fields. Add set_target_once_ field.
6910
6911 2010-02-10 Ian Lance Taylor <iant@google.com>
6912
6913 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6914 queueing any tasks.
6915 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6916 (queue_middle_tasks): Add all blockers before queueing any tasks.
6917 (queue_final_tasks): Likewise.
6918 * token.h (Task_token::add_blockers): New function.
6919 * object.h (Input_objects::number_of_relobjs): New function.
6920
6921 2010-02-10 Ian Lance Taylor <iant@google.com>
6922
6923 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6924 shared, not if not position independent.
6925 * x86_64.cc (Relocate::relocate_tls): Likewise.
6926 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6927 (tls_pie_pic_test): New target.
6928 * testsuite/Makefile.in: Rebuild.
6929
6930 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6931 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6932 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6933 * testsuite/Makefile.in: Rebuild.
6934
6935 2010-02-09 David S. Miller <davem@davemloft.net>
6936
6937 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6938 R_SPARC_RELATIVE using ->add_local_relative().
6939 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6940
6941 * output.h (Output_data_dynamic::add_section_size): New method
6942 that takes two Output_data objects.
6943 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6944 entry param. Handle it in initializers.
6945 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6946 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6947 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6948 arg.
6949 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6950 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6951 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6952 for dynrel_includes_plt.
6953 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6954 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6955 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6956 before .rela.plt
6957 (Target_sparc::do_finalize_sections): Update to pass true for
6958 dynrel_includes_plt.
6959 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6960 output before .rela.plt
6961 (Target_powerpc::do_finalize_sections): Update to pass true for
6962 dynrel_includes_plt when 32-bit.
6963
6964 2010-02-08 Doug Kwan <dougkwan@google.com>
6965
6966 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6967 method.
6968 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6969 Arm_relobj::scan_section_for_cortex_a8_stubs,
6970 Arm_relobj::do_relocation_section): Instead of calling
6971 Output_section::output_address, use faster
6972 Arm_relobj::simple_input_section_output_address.
6973
6974 2010-02-08 David S. Miller <davem@davemloft.net>
6975
6976 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6977 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6978 relocation helper function.
6979
6980 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6981 just like R_SPARC_GOT{10,13,22}.
6982 (Target_sparc::Scan::local): Likewise.
6983 (Target_sparc::Relocate:relocate): Likewise.
6984
6985 2010-02-06 Ian Lance Taylor <iant@google.com>
6986
6987 * configure.ac: Rewrite targetobjs duplicate removal code to use
6988 only shell constructs.
6989 * configure: Rebuild.
6990
6991 2010-02-05 Doug Kwan <dougkwan@google.com>
6992
6993 PR 11247
6994 * arm.cc (Arm_relobj::section_is_scannable): New method.
6995 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6996 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6997
6998 2010-02-04 Doug Kwan <dougkwan@google.com>
6999
7000 PR 11247
7001 * arm-reloc-property.cc (cstdio): Include.
7002 * configure.ac (targetobjs): Remove duplicates.
7003 * configure: Regenerate.
7004 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7005 big and little endian version for a given address size.
7006
7007 2010-02-03 Doug Kwan <dougkwan@google.com>
7008
7009 * arm-reloc-property.cc
7010 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7011 definition.
7012 * arm-reloc-property.h
7013 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7014 New method definition.
7015 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7016 declaration.
7017 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7018 overflow to N.
7019 (GOT_PREL): Change implemented to Y.
7020 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7021 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7022 (Arm_relocate_functions::movw_abs_nc): Remove method.
7023 (Arm_relocate_functions::movt_abs): Ditto.
7024 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7025 (Arm_relocate_functions::thm_movt_abs): Ditto.
7026 (Arm_relocate_functions::movw_rel_nc): Ditto.
7027 (Arm_relocate_functions::movw_rel): Ditto.
7028 (Arm_relocate_functions::movt_rel): Ditto.
7029 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7030 (Arm_relocate_functions:thm_movw_rel): Ditto.
7031 (Arm_relocate_functions:thm_movt_rel): Ditto.
7032 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7033 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7034 New method definitions.
7035 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7036 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7037 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7038 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7039 (Target_arm::Relocate::relocate): Check for non-static or
7040 unimplemented relocation code and exit early. Change calls to
7041 Target_arm::reloc_uses_thumb_bit and
7042 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7043 instead. Refactor code to handle similar relocations to increase
7044 code sharing. Remove check for unsupported relocation code in switch
7045 statement.
7046 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7047 relocation property table to find out size. Change error message to
7048 print out the name of a relocation code instead of the numeric value.
7049 (Target_arm::scan_reloc_for_stub): Use relocation property table
7050 instead of calling Target_arm::reloc_uses_thumb_bit().
7051
7052 2010-02-02 Doug Kwan <dougkwan@google.com>
7053
7054 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7055 types of relaxed input section.
7056
7057 2010-02-02 Doug Kwan <dougkwan@google.com>
7058
7059 * Makefile.am (HFILES): Add arm-reloc-property.h.
7060 (DEFFILES): New.
7061 (TARGETSOURCES): Add arm-reloc-property.cc
7062 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
7063 (libgold_a_SOURCES): $(DEFFILES)
7064 * Makefile.in: Regenerate.
7065 * arm-reloc-property.cc: New file.
7066 * arm-reloc-property.h: New file.
7067 * arm-reloc.def: New file.
7068 * arm.cc: Update comments.
7069 (arm-reloc-property.h): New included header.
7070 (arm_reloc_property_table): New global variable.
7071 (Target_arm::do_select_as_default_target): New method definition.
7072 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7073 arm-reloc-property to targ_extra_obj.
7074 * parameters.cc (set_parameters_target): Call
7075 Target::select_as_default_target().
7076 * target.h (Target::select_as_default_target): New method definition.
7077 (Target::do_select_as_default_target): Same.
7078
7079 2010-02-01 Doug Kwan <dougkwan@google.com>
7080
7081 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7082 first_output_text_section_.
7083 (Arm_exidx_fixup::first_output_text_section): New method definition.
7084 (Arm_exidx_fixup::first_output_text_section_): New data member.
7085 (Arm_exidx_fixup::process_exidx_section): Record the first text
7086 output section seen.
7087 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7088 and entsize in output section header.
7089
7090 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7091
7092 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7093 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7094 (Arm_relocate_functions::thm_alu11): New Method.
7095 (Arm_relocate_functions::thm_pc8): New Method.
7096 (Arm_relocate_functions::thm_pc12): New Method.
7097 (Target_arm::Scan::local): Handle the relocations.
7098 (Target_arm::Scan::global): Likewise.
7099 (Target_arm::Relocate::relocate): Likewise.
7100 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7101
7102 2010-01-29 Doug Kwan <dougkwan@google.com>
7103
7104 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7105 of relocation types as ld.
7106
7107 2010-01-29 Doug Kwan <dougkwan@google.com>
7108
7109 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7110 to public.
7111 (Arm_relocate_functions::thumb_branch_common): Ditto.
7112 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7113 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7114 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7115 Arm_relocate_functions::jump24): Remove.
7116 (Target_arm::Relocate::relocate): Adjust code to call
7117 Arm_relocation_functions::arm_branch_common and
7118 Arm_relocation_functions::thumb_branch_common instead of their removed
7119 wrappers. Merge switch-cases together to reduce source code size.
7120
7121 2010-01-29 Doug Kwan <dougkwan@google.com>
7122
7123 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7124 output_local_symbol_count_needs_update_.
7125 (Arm_relobj::output_local_symbol_count_needs_update,
7126 Arm_relobj::set_output_local_symbol_count_needs_update,
7127 Arm_relobj::update_output_local_symbol_count): New methods.
7128 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7129 member.
7130 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7131 of pointed function as in a R_ARM_PREL31 relocation.
7132 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7133 for output local symbol count updating.
7134 (Target_arm::do_relax): Update output local symbol counts in objects
7135 if necessary.
7136 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7137
7138 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7139
7140 * arm.cc: Added support for the ARM relocations:
7141 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7142 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7143 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7144 movw_prel_nc).
7145 (Arm_relocate_functions::movw_rel): New method.
7146 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7147 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7148 thm_movw_prel_nc).
7149 (Arm_relocate_functions::thm_movw_rel): New method.
7150 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7151 thm_movt_prel).
7152 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7153 relocations.
7154 (Target_arm::Scan::global): Likewise.
7155 (Target_arm::Relocate::relocate): Likewise.
7156 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7157 Likewise.
7158
7159 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7160
7161 * arm.cc: Added support for ARM group relocations.
7162 (Target_arm::reloc_needs_sym_origin): New method.
7163 (Arm_relocate_functions::calc_grp_kn): New method.
7164 (Arm_relocate_functions::calc_grp_residual): New method.
7165 (Arm_relocate_functions::calc_grp_gn): New method.
7166 (Arm_relocate_functions::arm_grp_alu): New Method.
7167 (Arm_relocate_functions::arm_grp_ldr): New Method.
7168 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7169 (Arm_relocate_functions::arm_grp_ldc): New Method.
7170 (Target_arm::Scan::local): Handle the ARM group relocations.
7171 (Target_arm::Scan::global): Likewise.
7172 (Target_arm::Relocate::relocate): Likewise.
7173 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7174 Likewise.
7175
7176 2010-01-26 Doug Kwan <dougkwan@google.com>
7177
7178 * arm.cc (set): Include.
7179 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7180 pointer type.
7181 (Arm_output_section::Text_section_list): New type.
7182 (Arm_output_section::append_text_sections_to_list): New method.
7183 (Arm_output_section::fix_exidx_coverage): Ditto.
7184 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
7185 (Arm_relobj::convert_input_section_to_relaxed_section): Use
7186 Relobj::set_section_offset() instead of
7187 Sized_relobj::invalidate_section_offset().
7188 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
7189 parameter for section headers. Ignore relocation sections for
7190 unallocated sections and EXIDX sections.
7191 (Target_arm::fix_exidx_coverage): New method.
7192 (Target_arm::output_section_address_less_than): New type.
7193 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7194 linked text section instead of the EXIDX section.
7195 (Arm_output_section::create_stub_group): Add an assertion to check
7196 that this is not an EXIDX output section.
7197 (Arm_output_section::append_text_sections_to_list): New method.
7198 (Arm_output_section::fix_exidx_coverage): Ditto.
7199 (Arm_relobj::scan_sections_for_stubs): Adjust call to
7200 Arm_relobj::section_needs_reloc_stub_scanning.
7201 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7202 first pass.
7203 (Target_arm::fix_exidx_coverage): New method.
7204 * object.h (Relobj::set_output_section): New method.
7205 (Sized_relobj::invalidate_section_offset): Remove method.
7206 (Sized_relobj::do_invalidate_section_offset): Remove method.
7207 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7208
7209 2010-01-25 Doug Kwan <dougkwan@google.com>
7210
7211 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7212 Fix warning due to signed and unsigned comparison on a 32-bit host.
7213
7214 2010-01-22 Doug Kwan <dougkwan@google.com>
7215
7216 * arm.cc (Target_arm::do_relax): Record an output section for section
7217 offset adjustment it contains any stub table that has changed.
7218 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7219 offsets in an output section if necessary.
7220 * output.cc (Output_section::Output_section): Initialize
7221 section_offsets_need_adjustments_.
7222 (Output_section::add_input_section_for_script): Renamed to
7223 Output_section::add_simple_input_section.
7224 (Output_section::save_states): Add a comment.
7225 (Output_section::discard_states): New method defintion.
7226 (Output_section::adjust_section_offsets): Same.
7227 * output.h (Output_section::add_input_section_for_script): Renamed to
7228 Output_section::add_simple_input_section.
7229 (Output_section::discard_states): New method declaration.
7230 (Output_section::adjust_section_offsets): Same.
7231 (Output_section::section_offsets_need_adjustment,
7232 Output_section::set_section_offsets_need_adjustment): New method
7233 definitions.
7234 (Output_section::section_offsets_need_adjustment_): New data member.
7235 * script-sections.cc
7236 (Output_section_element_input::set_section_address): Adjust code for
7237 renaming of Output_section::add_input_section_for_script.
7238 (Orphan_output_section::set_section_address): Same.
7239
7240 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7241
7242 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7243 Fix_v4bx enum values .
7244 * gold/options.h (General_options): New option definitions.
7245 (General_options::fix_v4bx): New method.
7246 (General_options::Fix_v4bx): New enum.
7247 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7248 (General_options::parse_fix_v4bx_interworking): New method.
7249
7250 2010-01-22 Doug Kwan <dougkwan@google.com>
7251
7252 * arm.cc (Arm_exidx_fixup): New class.
7253
7254 2010-01-21 Doug Kwan <dougkwan@google.com>
7255
7256 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7257 classes.
7258 (Arm_exidx_section_offset_map): New type.
7259
7260 2010-01-21 Doug Kwan <dougkwan@google.com>
7261
7262 * arm.cc (Arm_exidx_input_section): New class.
7263 (Arm_relobj::exidx_input_section_by_link,
7264 Arm_relobj::exidx_input_section_by_shndx,
7265 Arm_relobj::make_exidx_input_section): New methods.
7266 (read_arm_attributes_section): Remove.
7267 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7268 information about them.
7269 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7270 to here.
7271
7272 2010-01-20 Doug Kwan <dougkwan@google.com>
7273
7274 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7275 Input_section_specifier to Section_id.
7276 (Target_arm::new_arm_input_section: Adjust code for change of key
7277 type.
7278 (Target_arm::find_arm_input_section): Ditto.
7279 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7280 (Section_id): Remove.
7281 (Garbage_collection::Section_id_hash): Remove.
7282 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7283 (Section_id): Remove.
7284 (Icf::Section_id_hash): Remove.
7285 * object.h (Section_id, Const_section_id, Section_id_hash,
7286 Const_section_id_hash): New type definitions.
7287 * output.cc (Output_section::add_relaxed_input_section): Change to
7288 use Const_section_id instead of Input_section_specifier as key type.
7289 (Output_section::add_merge_input_section): Ditto.
7290 (Output_section::build_relaxation_map): Change to use Section_id
7291 instead of Input_section_specifier as key type.
7292 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7293 Ditto.
7294 (Output_section::convert_input_sections_to_relaxed_sections): Change
7295 to use Const_section_id instead of Input_section_specifier as key type.
7296 (Output_section::find_merge_section): Ditto.
7297 (Output_section::find_relaxed_input_section): Ditto.
7298 * output.h (Input_section_specifier): Remove class.
7299 (Output_section::Output_section_data_by_input_section_map): Change
7300 key type to Const_section_id.
7301 (Output_section::Output_relaxed_input_section_by_input_section_map):
7302 Ditto.
7303 (Output_section::Relaxation_map): Change key type to Section_id.
7304
7305 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7306
7307 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7308 (class Arm_v4bx_stub): New class.
7309 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7310 (Stub_factory::make_arm_v4bx_stub): New method.
7311 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7312 (Stub_table::empty): Handle v4bx stubs.
7313 (Stub_table::add_arm_v4bx_stub): New method.
7314 (Stub_table::find_arm_v4bx_stub): New method.
7315 (Arm_relocate_functions::v4bx): New method.
7316 (Target_arm::fix_v4bx): New method.
7317 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7318 (Stub_table::relocate_stubs): Likewise.
7319 (Stub_table::do_write): Likewise.
7320 (Stub_table::update_data_size_and_addralign): Likewise.
7321 (Stub_table::finalize_stubs): Likewise.
7322 (Target_arm::Scan::local): Likewise.
7323 (Target_arm::Scan::global): Likewise.
7324 (Target_arm::do_finalize_sections): Likewise.
7325 (Target_arm::Relocate::relocate): Likewise.
7326 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7327 Likewise.
7328 (Target_arm::scan_reloc_for_stub): Likewise.
7329 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7330
7331 2010-01-19 Ian Lance Taylor <iant@google.com>
7332
7333 * output.cc (Output_section_headers::do_sized_write): Write large
7334 segment count to sh_info field.
7335 (Output_file_header::do_sized_write): For large segment count,
7336 write PN_XNUM to e_phnum field.
7337
7338 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7339
7340 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7341 (Arm_relocate_functions::thm_jump8): New function.
7342 (Arm_relocate_functions::thm_jump11): New function.
7343 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7344 R_ARM_THM_JUMP11.
7345 (Target_arm::Scan::global): Likewise.
7346 (Target_arm::Relocate::relocate): Likewise.
7347 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7348 Likewise.
7349
7350 2010-01-14 Doug Kwan <dougkwan@google.com>
7351
7352 * arm.cc (map, utility): Include headers.
7353 (Target_arm::apply_cortex_a8_workaround): New method.
7354 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7355 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7356 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7357 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7358 the --[no-]fix-cortex-a8 command line options.
7359 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7360 (Target_arm::relocate_stub): Use addend in instruction template.
7361 * options.h (DEFINE_bool): Set the user-set flag.
7362 (General_options): Add --[no-]-fix-cortex options.
7363 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
7364 : Update fast look-up map after conversion.
7365
7366 2010-01-14 Sriraman Tallam <tmsriram@google.com>
7367
7368 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7369 in the first pass of do_layout.
7370
7371 2010-01-13 Doug Kwan <dougkwan@google.com>
7372
7373 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7374 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7375 apparent compiler problem of not folding static constant integral
7376 data members of elfcpp::Elf_sizes<32>.
7377
7378 2010-01-13 Doug Kwan <dougkwan@google.com>
7379
7380 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7381 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7382 Arm_relobj::scan_section_for_cortex_a8_erratum,
7383 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7384 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7385 sections to scan for relocation stubs into a new method
7386 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7387 relocation and Cortex-A8 stub scanning.
7388 (Target_arm::do_relax): Force stubs to be after stubbed sections
7389 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
7390 the beginning of a new relaxation pass. Update a comment.
7391 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7392
7393 2010-01-12 Ian Lance Taylor <iant@google.com>
7394
7395 * target-reloc.h (visibility_error): New inline function.
7396 (relocate_section): Call visibility_error.
7397 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7398 (MOSTLYCLEANFILES): Likewise.
7399 (protected_4_pic.o, protected_3.err): New targets.
7400 * testsuite/protected_4.cc: New file.
7401
7402 2010-01-12 Doug Kwan <dougkwan@google.com>
7403
7404 * arm.cc (Cortex_a8_reloc): New class.
7405 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7406 and cortex_a8_relocs_info_.
7407 (Target_arm::fix_cortex_a8): New method definition.
7408 (Target_arm::Cortex_a8_relocs_info): New type.
7409 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7410 New data member declarations.
7411 (Target_arm::scan_reloc_for_stub): Record information about
7412 relocations for THUMB branches that might be exempted from the
7413 Cortex-A8 workaround.
7414 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7415 at the beginning of a relaxation pass.
7416
7417 2010-01-12 Doug Kwan <dougkwan@google.com>
7418
7419 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7420 (Arm_relobj::Mapping_symbol_position,
7421 Arm_reloj::Mapping_symbol_position_less,
7422 Arm_relobj::Mapping_symbols_info): New types.
7423 (Target_arm::is_mapping_symbol_name): New method definition.
7424 (Arm_relobj::do_count_local_symbols): Save information about mapping
7425 symbols.
7426
7427 2010-01-11 Doug Kwan <dougkwan@google.com>
7428
7429 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7430 Arm_relocate_functions::thumb32_branch_upper,
7431 Arm_relocate_functions::thumb32_branch_lower,
7432 Arm_relocate_functions::thumb32_cond_branch_offset,
7433 Arm_relocate_functions::thumb32_cond_branch_upper,
7434 Arm_relocate_functions::thumb32_cond_branch_lower,
7435 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7436 branch offset encoding.
7437 (Arm_relocate_functions::thumb_branch_common): Use new branch
7438 offset encoding methods to avoid code duplication.
7439 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7440 (Stub_addend_reader::operator()): Use new branch encoding method
7441 to avoid code duplication.
7442
7443 2010-01-11 Doug Kwan <dougkwan@google.com>
7444
7445 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7446 (Target_arm::do_finalize_sections): Define special EXIDX section
7447 symbols only if referenced.
7448 * gc.h (Garbage_collection::add_reference): New method.
7449 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7450 code duplication.
7451
7452 2010-01-11 Ian Lance Taylor <iant@google.com>
7453
7454 * script.cc (Version_script_info::build_expression_list_lookup):
7455 Change complaing about duplicate wildcard match from error to
7456 warning.
7457
7458 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7459 of 2009-12-30.
7460 (Version_script_info::Version_script_info): Initialize globs_,
7461 default_version_, default_is_global_, and exact_. Don't
7462 initialize globals_ or locals_.
7463 (Version_script_info::build_lookup_tables): Build local symbols
7464 first.
7465 (Version_script_info::unquote): New function.
7466 (Version_script_info::add_exact_match): New function.
7467 (Version_script_info::build_expression_list_lookup): Remove lookup
7468 parameter. Add is_global parameter. Change all callers. Handle
7469 wildcard pattern specially. Unquote pattern. Call
7470 add_exact_match.
7471 (Version_script_info::get_name_to_match): New function.
7472 (Version_script_info::get_symbol_version): New function.
7473 (Version_script_info::get_symbol_version_helper): Remove.
7474 (Version_script_info::check_unmatched_names): Call unquote.
7475 * script.h (class Version_script_info): Change get_symbol_version
7476 to be non-inline and add is_global parameter; change all callers.
7477 Rewrite symbol_is_local. Update declarations. Define struct
7478 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7479 Remove globals_ and locals_ members. Add exact_, globs_,
7480 default_version_, is_global_.
7481 (Version_script_info::Glob): Remove pattern, add expression and
7482 is_global. Update constructor. Change all callers.
7483 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7484 default version.
7485 (Versions::symbol_section_contents): If a symbol is undefined, or
7486 defined in a dynamic object, set the version index to
7487 VER_NDX_LOCAL.
7488 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7489 symbol_is_local.
7490 (Symbol_table::add_from_pluginobj): Likewise.
7491 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7492
7493 2010-01-11 Doug Kwan <dougkwan@google.com>
7494
7495 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7496 (incremental_dump_LDADD): Add linking option for libintl.
7497 * Makefile.in: Regenerate.
7498
7499 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7500
7501 PR gold/11144
7502 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7503 instead of -Ds.
7504 * testsuite/Makefile.in: Regenerated.
7505
7506 2010-01-10 Doug Kwan <dougkwan@google.com>
7507
7508 * options.h (DEFINE_var): Use parentheses around argument varname__
7509 in macro body to avoid any unintended subsequent substitutions.
7510
7511 2010-01-10 Ian Lance Taylor <iant@google.com>
7512
7513 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7514 candidates before doing symbol resolution.
7515
7516 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7517 ODR candidates if only one is weak.
7518
7519 2010-01-08 Ian Lance Taylor <iant@google.com>
7520
7521 * script.cc (Version_script_info::build_expression_list_lookup):
7522 Don't warn about ambiguous version, just record the ambiguity.
7523 (Version_script_info::get_symbol_version_helper): Give error if
7524 version is ambiguous.
7525
7526 2010-01-08 Doug Kwan <dougkwan@google.com>
7527
7528 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7529 prev_data_size_ and prev_addralign_. Remove initializer for
7530 deleted data member has_been_changed_.
7531 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7532 to determine if the table is empty.
7533 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7534 Remove.
7535 (Stub_table::add_reloc_stub): Define method in class definition
7536 instead of just declaring it there.
7537 (Stub_table::add_cortex_a8_stub): New method definition.
7538 (Stub_table::update_data_size_and_addralign): Ditto.
7539 (Stub_table::finalize_stubs): Ditto.
7540 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7541 (Stub_table::do_addralign_): Return address alignment in the
7542 (Stub_table::do_reset_address_and_file_offset): Define method in
7543 class definition instead of declaring it there. Set current data
7544 size to be the data size of the previous pass.
7545 (Stub_table::set_final_data_size): Use current data size as the
7546 final data size.
7547 (Stub_table::relocate_stub): Change parameter type of stub from
7548 Reloc_stub pointer to Stub pointer.
7549 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7550 (Stub_table::Cortex_a8_stub_list): New typedef.
7551 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7552 Stub_table::prev_addralign_): New data member.
7553 (Arm_relobj::Arm_relobj): Initialize data member
7554 section_has_cortex_a8_workaround_.
7555 (Arm_relobj::section_has_cortex_a8_workaround,
7556 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7557 definitions.
7558 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7559 declarations.
7560 (Target_arm::relocate_stub): Change parameter type of stub from
7561 Reloc_stub pointer to Stub pointer.
7562 (Insn_template::size, Insn_template::alignment): Handle
7563 THUMB16_SPECIAL_TYPE.
7564 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7565 Stub_table::update_data_size_and_addralign,
7566 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7567 definitions.
7568 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7569 (Stub_table::do_write): Ditto.
7570 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7571
7572 2010-01-08 Ian Lance Taylor <iant@google.com>
7573
7574 PR 11108
7575 * symtab.h (class Symbol): Remove fields is_target_special_ and
7576 has_plt_offset_. Add field is_defined_in_discarded_section_.
7577 (Symbol::is_defined_in_discarded_section): New function.
7578 (Symbol::set_is_defined_in_discarded_section): New function.
7579 (Symbol::has_plt_offset): Rewrite.
7580 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7581 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7582 Don't initialize is_target_special_ or has_plt_offset_.
7583 Initialize is_defined_in_discarded_section_.
7584 (Symbol_table::add_from_relobj): If appropriate, set
7585 is_defined_in_discarded_section.
7586 * resolve.cc (Symbol::override_base_with_special): Don't test
7587 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7588 * target-reloc.h (relocate_section): Do special handling for
7589 symbols defined in discarded sections for global symbols as well
7590 as local symbols.
7591
7592 2010-01-08 Ian Lance Taylor <iant@google.com>
7593
7594 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7595 the SHT_SYMTAB case.
7596
7597 2010-01-08 Ian Lance Taylor <iant@google.com>
7598
7599 * object.cc (Sized_relobj::do_layout): Don't get confused if
7600 layout_eh_frame returns NULL.
7601
7602 2010-01-08 Ian Lance Taylor <iant@google.com>
7603
7604 PR 11084
7605 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7606 dynamic symbol table, use the normal symbol table.
7607 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7608 symbol table.
7609
7610 2010-01-08 Ian Lance Taylor <iant@google.com>
7611
7612 PR 11072
7613 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7614 sections.
7615
7616 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7617
7618 * version.cc (print_version): Change to "Copyright 2010".
7619
7620 2010-01-08 Ian Lance Taylor <iant@google.com>
7621
7622 PR 10287
7623 PR 11063
7624 * i386.cc (class Target_i386): Change return type of plt_section
7625 to be non-const.
7626 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7627 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7628 tls_desc_rel_ field.
7629 (Output_data_plt_i386::rel_tls_desc): New function.
7630 (Target_i386::rel_tls_desc_section): New function.
7631 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7632 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7633 R_386_TLS_DESC reloc in rel_tls_desc_section.
7634 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7635 Define struct Tlsdesc_info.
7636 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7637 (Target_x86_64::do_reloc_symbol_index): New function.
7638 (Target_x86_64::add_tlsdesc_info): New function.
7639 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7640 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7641 tlsdesc_rel_ field.
7642 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7643 all callers.
7644 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7645 (Target_x86_64::rela_tlsdesc_section): New function.
7646 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7647 handling.
7648 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7649 (Target_x86_64::do_reloc_addend): New function.
7650 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7651 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7652 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7653 (Output_reloc::type): New function.
7654 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7655 (Output_reloc::is_target_specific): New function.
7656 (Output_reloc::target_arg): New function.
7657 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7658 absolute relocs and target specific relocs.
7659 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7660 add_target_specific.
7661 (class Output_data_reloc) [SHT_RELA]: Likewise.
7662 * output.cc (Output_reloc::Output_reloc): Add four new versions
7663 for absolute relocs and target specific relocs.
7664 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7665 (Output_reloc::get_symbol_index): Likewise.
7666 (Output_reloc::local_section_offset): Check that local_sym_index_
7667 is not TARGET_CODE or 0.
7668 (Output_reloc::symbol_value): Likewise.
7669 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7670 reloc.
7671 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7672 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7673 functions.
7674 * layout.cc (add_target_dynamic_tags): Use output section for
7675 DT_PLTRELSZ and DT_JMPREL.
7676
7677 2010-01-07 Ian Lance Taylor <iant@google.com>
7678
7679 PR 11061
7680 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7681 function.
7682 (class Output_data_reloc_generic): Define.
7683 (class Output_data_reloc_base): Change base class to
7684 Output_data_reloc_generic. Change add() method to call
7685 bump_relative_reloc_count for a relative reloc. Remove
7686 sort_relocs_ field.
7687 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7688 to sort_relocs().
7689 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7690 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7691 appropriate.
7692 * layout.h (class Layout): Update declaration.
7693
7694 2010-01-07 Ian Lance Taylor <iant@google.com>
7695
7696 * output.h (class Output_data): Add const version of
7697 output_section and do_output_section.
7698 (class Output_section_data): Add const version of
7699 do_output_section.
7700 (class Output_section): Likewise.
7701 * layout.cc (Layout::add_target_dynamic_tags): New function.
7702 * layout.h (class Layout): Update declarations.
7703 * arm.cc (Target_arm::do_finalize_sections): Use
7704 add_target_dynamic_tags.
7705 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7706 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7707 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7708 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7709
7710 2010-01-07 Ian Lance Taylor <iant@google.com>
7711
7712 PR 11042
7713 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7714 object as needed.
7715
7716 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7717 Ian Lance Taylor <iant@google.com>
7718
7719 PR 11019
7720 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7721 Xindex::read_symtab_xindex.
7722
7723 2010-01-07 Doug Kwan <dougkwan@google.com>
7724
7725 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7726 (Insn_template::thumb16_bcond_insn): New method declaration.
7727 (Insn_template): Fix spelling.
7728 (Stub::thumb16_special): New method declaration.
7729 (Stub::do_write): Define virtual method which was previously pure
7730 virtual.
7731 (Stub::do_thumb16_special): New method declaration.
7732 (Stub::do_fixed_endian_write): New template member.
7733 (Reloc_stub::do_write): Remove.
7734 (Reloc_stub::do_fixed_endian_write): Remove.
7735 (Cortex_a8_stub): New class definition.
7736 (Stub_factory::make_cortex_a8_stub): New method definition.
7737 (Stub_factory::Stub_factory): Add missing static storage class
7738 qualifier for elf32_arm_stub_a8_veneer_blx.
7739
7740 2010-01-07 Ian Lance Taylor <iant@google.com>
7741
7742 PR 10980
7743 * options.h (class General_options): Add --warn-unresolved-symbols
7744 and --error-unresolved-symbols.
7745 * errors.cc (Errors::undefined_symbol): Implement
7746 --warn-unresolved-symbols.
7747
7748 * options.h (class General_options): Add -z text and -z textoff.
7749 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7750
7751 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7752
7753 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7754 (Garbage_collection::cident_sections): New function.
7755 (Garbage_collection::add_cident_section): New function.
7756 (Garbage_collection::cident_sections_): New member.
7757 (gc_process_relocs): Add references to sections whose names are C
7758 identifiers.
7759 * gold.h (cident_section_start_prefix): New constant.
7760 (cident_section_stop_prefix): New constant.
7761 (is_cident): New function.
7762 * layout.cc (Layout::define_section_symbols): Replace string constants
7763 with the newly defined constants.
7764 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7765 C identifiers.
7766 * testsuite/Makefile.am: Add gc_orphan_section_test.
7767 * testsuite/Makefile.in: Regenerate.
7768 * testsuite/gc_orphan_section_test.cc: New file.
7769 * testsuite/gc_orphan_section_test.sh: New file.
7770
7771 2010-01-06 Ian Lance Taylor <iant@google.com>
7772
7773 PR 10980
7774 * options.h (class General_options): Add --warn-shared-textrel.
7775 * layout.cc (Layout::finish_dynamic_section): Implement
7776 --warn-shared-textrel.
7777
7778 PR 10980
7779 * options.h (class General_options): Add --warn-multiple-gp.
7780
7781 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7782
7783 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7784 $(THREADSLIB) and $(LIBDL).
7785 * Makefile.in: Rebuild.
7786
7787 2010-01-06 Ian Lance Taylor <iant@google.com>
7788
7789 PR 10980
7790 * options.cc (General_options::parse_section_start): New function.
7791 (General_options::section_start): New function.
7792 (General_options::General_options): Initialize all members.
7793 * options.h: Include <map>
7794 (class General_options): Add --section-start. Add section_starts_
7795 member.
7796 * layout.cc (Layout::attach_allocated_section_to_segment): If
7797 --section-start was used, set the address of the segment. Remove
7798 local sort_sections.
7799 (Layout::relaxation_loop_body): If the address of the load segment
7800 has been set by --section-start, don't use it.
7801 * output.h (Output_segment::update_flags_for_output_section): New
7802 function.
7803 * output.cc (Output_segment::add_output_section): Call
7804 update_flags_for_output_section.
7805
7806 2010-01-05 Ian Lance Taylor <iant@google.com>
7807
7808 PR 10980
7809 * options.h (class General_options): Add --undefined-version.
7810 * script.cc (struct Version_expression): Add was_matched_by_symbol
7811 field.
7812 (Version_script_info::matched_symbol): New function.
7813 (Version_script_info::get_symbol_version_helper): Call
7814 matched_symbol.
7815 (Version_script_info::check_unmatched_names): New function.
7816 * script.h (class Version_script_info): Update declarations.
7817 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7818
7819 * options.h (class General_options): Use DEFINE_bool_alias for
7820 allow_multiple_definition.
7821 * resolve.cc (Symbol_table::should_override): Don't test
7822 allow_multiple_definition.
7823
7824 PR 10980
7825 * options.h (class General_options): Add --cref.
7826 * main.cc (main): Print cref table if --cref. Don't close mapfile
7827 until after printing cref table.
7828 * cref.cc: Include "symtab.h".
7829 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7830 (Cref_table_compare::operator()): New function.
7831 (Cref_inputs::gather_cref): New function.
7832 (filecol): New static const.
7833 (Cref_inputs::print_cref): New function.
7834 (Cref::print_cref): New function.
7835 * cref.h: Include <cstdio>.
7836 (class Cref): Update declarations.
7837 * mapfile.h (Mapfile::file): New function.
7838 * object.h (class Object): Define Symbols. Declare virtual
7839 do_get_global_symbols.
7840 (Object::get_global_symbols): New function.
7841 * object.cc (Input_objects::add_object): Pass object to cref_ if
7842 --cref.
7843 (Input_objects::archive_start): Likewise.
7844 (Input_objects::archive_stop): Likewise.
7845 (Input_objects::print_cref): New function.
7846 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7847 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7848 --cref.
7849 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7850 function.
7851 * plugin.h (class Sized_pluginobj): Update declarations.
7852
7853 2010-01-05 Ian Lance Taylor <iant@google.com>
7854
7855 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7856 to is_default_version. Rename insdef to insdefault.
7857 (Symbol_table::add_from_relobj): Rename def to is_default_version
7858 and local to is_forced_local.
7859 (Symbol_table::add_from_pluginobj): Likewise.
7860 (Symbol_table::add_from_dynobj): Likewise.
7861 (Symbol_table::define_special_symbol): Rename insdef to
7862 insdefault.
7863
7864 2010-01-04 Ian Lance Taylor <iant@google.com>
7865
7866 PR 10980
7867 * options.h (class General_options): Add
7868 --allow-multiple-definition and -z muldefs.
7869 * resolve.cc (Symbol_table::should_override): Don't warn about a
7870 multiple symbol definition if --allow-multiple-definition or -z
7871 muldefs.
7872
7873 PR 10980
7874 * options.h (class General_options): Add --add-needed and
7875 --copy-dt-needed-entries. Tweak --as-needed help entry.
7876 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7877 error if --copy-dt-needed-entries aka --add-needed is used and
7878 would cause a change in behaviour.
7879
7880 PR 10980
7881 * options.h (class General_options): Add -G as a short version of
7882 --shared. Add no-op options -assert, -g, and -i.
7883
7884 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7885
7886 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7887 check for .text or .gnu.linkonce.t sections.
7888 * icf.cc (Icf::find_identical_sections): Ditto.
7889 Change the detection for mangled function name within the section
7890 name.
7891 * icf.h (is_section_foldable_candidate): New function.
7892
7893 2009-12-30 Ian Lance Taylor <iant@google.com>
7894
7895 PR 10980
7896 * options.h (class General_options): Permit two dashes with
7897 --retain-symbols-file.
7898
7899 2009-12-30 Ian Lance Taylor <iant@google.com>
7900
7901 PR 10979
7902 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7903 don't put the file header and segment headers in the text
7904 segment.
7905
7906 PR 10979
7907 * common.cc (Sort_commons::operator()): Stabilize sort when both
7908 entries are NULL.
7909 (Symbol_table::do_allocate_commons_list): When allocating common
7910 symbols, skip a symbol which is no longer common.
7911 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7912 an object before checking its type.
7913 * testsuite/common_test_2.c: New file.
7914 * testsuite/common_test_3.c: New file.
7915 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7916 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7917 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7918 (common_test_2_pic.o, common_test_2.so): New targets.
7919 (common_test_3_pic.o, common_test_3.so): New targets.
7920 * testsuite/Makefile.in: Rebuild.
7921
7922 PR 10979
7923 * script.cc (read_input_script): If we see a new SECTIONS clause,
7924 and we have added an input section, give an error.
7925 * layout.h (class Layout): Add have_added_input_section function.
7926 Add have_added_input_section_ field.
7927 * layout.cc (Layout::Layout): Initialize
7928 have_added_input_section_.
7929 (Layout::layout): Set have_added_input_section_.
7930 (Layout::layout_eh_frame): Likewise.
7931
7932 2009-12-30 Ian Lance Taylor <iant@google.com>
7933
7934 PR 10931
7935 * options.h (class General_options): Add --sort-common option.
7936 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7937 * common.cc (Sort_common): Add sort_order parameter to
7938 constructor. Add sort_order_ field.
7939 (Sort_commons::operator): Check sort_order_.
7940 (Symbol_table::allocate_commons): Determine the sort order.
7941 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7942 Change all callers.
7943 (Symbol_table::do_allocate_commons_list): Likewise.
7944
7945 2009-12-30 Ian Lance Taylor <iant@google.com>
7946
7947 PR 10916
7948 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7949 symbols from this object, don't change the visibility of an
7950 undefined symbol.
7951 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7952
7953 2009-12-30 Ian Lance Taylor <iant@google.com>
7954
7955 PR 10861
7956 * script.h (class Version_script_info): Define Language enum.
7957 Update declarations. Define Glob, Exact, and Lookup types. Add
7958 new fields globals_, locals_, and is_finalized_.
7959 * script.cc: Various formatting fixes.
7960 (class Parser_closure): Change language_stack_ from a vector of
7961 std::string to one of Version_script_info::Language. Adjust all
7962 uses accordingly.
7963 (class Lazy_demangler): Remove.
7964 (struct Version_expression): Change language from std::string to
7965 Version_script_info::Language.
7966 (Version_script_info::Version_script_info): New function.
7967 (Version_script_info::~Version_script_info): Don't call clear.
7968 (Version_script_info::finalize): New function.
7969 (Version_script_info::build_lookup_tables): New function.
7970 (Version_script_info::build_expression_list_lookup): New
7971 function.
7972 (Version_script_info::get_symbol_version_helper): Rewrite to use
7973 lookup tables.
7974 (Version_script_info::print_expression_list): Adjust to use
7975 Version_script_info::Language.
7976 (script_push_lex_into_version_mode): Check that the version script
7977 has not been finalized.
7978 (version_script_push_lang): Change language string to
7979 Version_script_info::Language.
7980 * options.cc (Command_line::version_script): New function.
7981 * options.h (class General_options): Add finalize_dynamic_list
7982 function. Change version_script from declaration to definition.
7983 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7984 * testsuite/version_script.map: Remove duplicate def of foo.
7985 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7986 version_script.map.
7987 * testsuite/Makefile.in: Rebuild.
7988
7989 2009-12-30 Ian Lance Taylor <iant@google.com>
7990
7991 PR 10843
7992 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7993 if the input symbol index is 0, make the output symbol index 0.
7994
7995 2009-12-30 Ian Lance Taylor <iant@google.com>
7996
7997 PR 10670
7998 * options.h (class General_options): Add -x/--discard-all.
7999 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8000 --discard-all. If the local symbol needs a dynamic entry, check
8001 that before handling --discard-locals.
8002
8003 2009-12-30 Ian Lance Taylor <iant@google.com>
8004
8005 PR 10450
8006 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8007 flags to PF_R.
8008 (Output_segment::add_output_section): Don't change the flags if
8009 the type is PT_TLS.
8010
8011 PR 10450
8012 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8013 GNU hash table if they need a dynamic value. Otherwise, don't add
8014 them if they are defined in a dynamic object or are forced local.
8015
8016 2009-12-29 Ian Lance Taylor <iant@google.com>
8017
8018 PR 10450
8019 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8020 .gnu.hash table for a 32-bit target.
8021
8022 PR 10450
8023 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8024 regular and a dynamic object only needs a dynamic symbol table
8025 entry if it is externally visible.
8026
8027 PR 10450
8028 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8029 constructor. Add global_offset_table_ field.
8030 (Target_i386::got_section): Set global_offset_table_.
8031 (Target_i386::do_finalize_sections): Set global_offset_table_
8032 size.
8033 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8034 in constructor. Add global_offset_table_ field.
8035 (Target_x86_64::got_section): Set global_offset_table_.
8036 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8037 size.
8038
8039 * layout.cc (Layout::Layout): Initialize increase_relro_.
8040 (Layout::get_output_section): Add is_relro, is_last_relro, and
8041 is_first_non_relro parameters. Change all callers.
8042 (Layout::choose_output_section): Likewise.
8043 (Layout::add_output_section_data): Likewise.
8044 (Layout::make_output_section): Likewise.
8045 (Layout::set_segment_offsets): Clear increase_relro when using a
8046 linker script.
8047 * layout.h (class Layout): Add increase_relro method. Add
8048 increase_relro_ field. Update declarations.
8049 * output.cc (Output_section::Output_section): Initialize
8050 is_last_relro_ and is_first_non_relro_.
8051 (Output_segment::add_output_section): Group relro sections is
8052 do_sort is true. Handle is_last_relro and is_first_non_relro.
8053 (Output_segment::maximum_alignment): Remove relro handling.
8054 (Output_segment::set_section_addresses): Add increase_relro
8055 parameter. Change all callers. Add initial alignment to align
8056 relro sections on separate page. Remove old relro handling.
8057 (Output_segment::set_section_list_addresses): Remove in_relro
8058 parameter. Change all callers.
8059 (Output_segment::set_offset): Add increase parameter. Change all
8060 callers. Remove old relro handling.
8061 * output.h (class Output_section): Add new methods: is_last_relro,
8062 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8063 Add is_last_relro_ and is_first_non_relro_ fields.
8064 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8065 Create separate .got.plt section. Call increase_relro.
8066 * x86_64.cc (Target_x86_64::got_section): Likewise.
8067 * testsuite/relro_script_test.t: Add .got.plt.
8068
8069 PR 10450
8070 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8071 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8072 (Layout::finalize): Call set_dynamic_symbol_size.
8073 (Layout::set_dynamic_symbol_size): New function.
8074 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8075 set_dynamic_symbol_size.
8076
8077 PR 10450
8078 * output.h (class Output_section): Add is_entsize_zero_ field.
8079 * output.cc (Output_section::Output_section): Initialize
8080 is_entsize_zero_.
8081 (Output_section::set_entsize): If two different entsizes are
8082 requested, force it to zero.
8083 (Output_section::add_input_section): Set flags for .debug_str
8084 before updating section flags. Set entsize.
8085 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8086 and SHF_STRING if all input sections have those flags.
8087
8088 2009-12-29 Rafael Espindola <espindola@google.com>
8089
8090 * main.cc (main): Fix the sys time reporting.
8091 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8092 reporting.
8093
8094 2009-12-29 Sriraman Tallam <tmsriram@google.com>
8095
8096 * options.cc (General_options::parse_version): Allow -v to exit
8097 without an error if there is nothing to link.
8098
8099 2009-12-29 Ian Lance Taylor <iant@google.com>
8100
8101 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8102 using a version of gcc before 4.1.
8103 * configure: Rebuild.
8104
8105 2009-12-28 Chris Demetriou <cgd@google.com>
8106
8107 * attributes.cc (Output_attributes_section_data::do_write): Use
8108 std::vector::front rather than std::vector::data.
8109
8110 2009-12-28 Ian Lance Taylor <iant@google.com>
8111
8112 * symtab.h (class Symbol_table): Add enum Defined.
8113 * resolve.cc (Symbol_table::should_override): Add defined
8114 parameter. Change all callers. Test whether object is NULL
8115 before calling a method on it.
8116 (Symbol_table::report_resolve_problem): Add defined parameter.
8117 Change all callers.
8118 (Symbol_table::should_override_with_special): Likewise.
8119 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8120 parameter. Change all callers.
8121 (Symbol_table::do_define_in_output_data): Likewise.
8122 (Symbol_table::define_in_output_segment): Likewise.
8123 (Symbol_table::do_define_in_output_segment): Likewise.
8124 (Symbol_table::define_as_constant): Likewise.
8125 (Symbol_table::do_define_as_constant): Likewise.
8126 * script.h (class Symbol_assignment): Add is_defsym parameter to
8127 constructor; change all callers.
8128 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8129 parameter. Change all callers. Add is_defsym_ field.
8130 (class Parser_closure): Add parsing_defsym parameter to
8131 constructor; change all callers. Add parsing_defsym accessor
8132 function. Add parsing_defsym_ field.
8133
8134 2009-12-28 Ian Lance Taylor <iant@google.com>
8135
8136 * gold.cc (queue_middle_tasks): Fix formatting.
8137 * object.cc (Relobj::is_section_name_included): Likewise.
8138
8139 2009-12-23 Ian Lance Taylor <iant@google.com>
8140
8141 * i386.cc (Target_i386::do_calls_non_split): Recognize
8142 -fsplit-stack prologue for a function with a static chain.
8143 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8144 -fsplit-stack prologue when using %r11.
8145
8146 2009-12-21 Sriraman Tallam <tmsriram@google.com>
8147
8148 * options.cc (General_options::parse_version): Make -v continue and do
8149 the link like GNU ld does.
8150
8151 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
8152
8153 * Makefile.am (CCFILES): Add timer.cc.
8154 (HFILES): Add timer.h.
8155 * configure.ac: Check for sysconf and times.
8156 * main.cc: include timer.h.
8157 (main): Use Timer instead of get_run_time.
8158 * timer.cc: New.
8159 * timer.h: New.
8160 * workqueue.cc: include timer.h.
8161 (Workqueue::find_and_run_task):
8162 Report user, sys and wall time.
8163 * Makefile.in: Regenerate.
8164 * config.in: Regenerate.
8165 * configure: Regenerate.
8166
8167 2009-12-16 Doug Kwan <dougkwan@google.com>
8168
8169 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8170 sections.
8171 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8172 relaxed input sections.
8173 * output.cc (Output_section::find_relaxed_input_section): Change
8174 return type to Output_relaxed_input_section pointer. Adjust code
8175 for new type of relaxed_input_section_map_.
8176 * output.h (Output_section::find_relaxed_input_section): Change
8177 return type to Output_relaxed_input_section pointer.
8178 (Output_section::Output_relaxed_input_section_by_input_section_map):
8179 New type.
8180 (Output_section::relaxed_input_section_map_): Change type to
8181 Output_section::Output_relaxed_input_section_by_input_section_map.
8182 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8183 input section.
8184
8185 2009-12-15 Ian Lance Taylor <iant@google.com>
8186
8187 * layout.cc (Layout::create_shstrtab): Only write out after input
8188 sections if we are compressing debug sections.
8189
8190 2009-12-15 Ian Lance Taylor <iant@google.com>
8191
8192 * archive.cc (Archive::add_symbols): Only look up a symbol without
8193 a version if there is, in fact, a version.
8194
8195 2009-12-14 Ian Lance Taylor <iant@google.com>
8196
8197 Revert -Wshadow changes, all changes from:
8198 2009-12-11 Doug Kwan <dougkwan@google.com>
8199 2009-12-11 Nick Clifton <nickc@redhat.com>
8200 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8201
8202 2009-12-11 Doug Kwan <dougkwan@google.com>
8203
8204 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8205 due to -Wshadow.
8206 * attributes.cc (Object_attribute::size): Ditto.
8207 (Attributes_section_data::size): Ditto.
8208 (Attributes_section_data::Attributes_section_data): Ditto.
8209 (Output_attributes_section_data::do_write): Ditto.
8210 * attributes.h (Object_attribute::set_type): Ditto.
8211 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8212
8213 2009-12-11 Nick Clifton <nickc@redhat.com>
8214
8215 * archive.cc: Fix shadowed variable warnings.
8216 * arm.cc: Likewise.
8217 * compressed_output.cc: Likewise.
8218 * compressed_output.h: Likewise.
8219 * configure: Likewise.
8220 * dwarf_reader.cc: Likewise.
8221 * dynobj.cc: Likewise.
8222 * dynobj.h: Likewise.
8223 * ehframe.cc: Likewise.
8224 * ehframe.h: Likewise.
8225 * errors.cc: Likewise.
8226 * expression.cc: Likewise.
8227 * fileread.cc: Likewise.
8228 * fileread.h: Likewise.
8229 * freebsd.h: Likewise.
8230 * i386.cc: Likewise.
8231 * icf.cc: Likewise.
8232 * incremental.h: Likewise.
8233 * layout.cc: Likewise.
8234 * layout.h: Likewise.
8235 * mapfile.cc: Likewise.
8236 * merge.cc: Likewise.
8237 * merge.h: Likewise.
8238 * object.cc: Likewise.
8239 * object.h: Likewise.
8240 * options.h: Likewise.
8241 * output.cc: Likewise.
8242 * output.h: Likewise.
8243 * parameters.cc: Likewise.
8244 * plugin.cc: Likewise.
8245 * powerpc.cc: Likewise.
8246 * reduced_debug_output.cc: Likewise.
8247 * reduced_debug_output.h: Likewise.
8248 * reloc.cc: Likewise.
8249 * reloc.h: Likewise.
8250 * resolve.cc: Likewise.
8251 * script-sections.cc: Likewise.
8252 * script.cc: Likewise.
8253 * script.h: Likewise.
8254 * sparc.cc: Likewise.
8255 * symtab.cc: Likewise.
8256 * symtab.h: Likewise.
8257 * target-select.cc: Likewise.
8258 * target-select.h: Likewise.
8259 * token.h: Likewise.
8260 * workqueue.cc: Likewise.
8261 * workqueue.h: Likewise.
8262 * x86_64.cc: Likewise.
8263
8264 2009-12-10 Doug Kwan <dougkwan@google.com>
8265
8266 * arm.cc (attributes.h): New include.
8267 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8268 (Arm_relobj::~Arm_relobj): Delete object pointed by
8269 attributes_section_data_.
8270 (Arm_relobj::attributes_section_data): New method definition.
8271 (Arm_relobj::attributes_section_data_): New data member declaration.
8272 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8273 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8274 attributes_section_data_.
8275 (Arm_dynobj::attributes_section_data): New method definition.
8276 (Arm_dynobj::attributes_section_data_): New data member declaration.
8277 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8278 initialization value of may_use_blx_ to false.
8279 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
8280 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8281 object attributes to compute results instead of hard-coding.
8282 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8283 Target_arm::get_secondary_compatible_arch,
8284 Target_arm::set_secondary_compatible_arch
8285 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8286 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8287 New method declarations.
8288 (Target_arm::get_aeabi_object_attribute): New method definition.
8289 (Target_arm::attributes_section_data_): New data member declaration.
8290 (read_arm_attributes_section): New template definition.
8291 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8292 (Arm_dynobj::do_read_symbols): Ditto.
8293 (Target_arm::do_finalize_sections): Merge attributes sections from
8294 input. Check for BLX use after attributes section merging.
8295 Fix __exidx_start and __exidx_end visibility. Create an
8296 .ARM.attributes section if necessary.
8297 (Target_arm::get_secondary_compatible_arch,
8298 Target_arm::set_secondary_compatible_arch,
8299 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8300 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
8301 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
8302 New method definitions.
8303
8304 2009-12-09 Ian Lance Taylor <iant@google.com>
8305
8306 * plugin.cc (Plugin::load): Don't cast from void* to a function
8307 pointer.
8308
8309 2009-12-09 Ian Lance Taylor <iant@google.com>
8310
8311 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8312 information fields.
8313
8314 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8315
8316 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8317 Replace two_file_shared_1.so with two_file_shared_2.so.
8318 * testsuite/Makefile.in: Regenerated.
8319
8320 2009-12-08 Doug Kwan <dougkwan@google.com>
8321
8322 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8323 (HFILES): Add attributes.h and int_encoding.h.
8324 * Makefile.in: Regenerate.
8325 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8326 function definitions to int_encoding.cc
8327 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8328 prototypes to int_encoding.h
8329 * reduced_debug_output.cc (int_encoding.h): New include.
8330 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8331 function definitions to int_encoding.cc
8332 (insert_into_vector, read_from_pointer): Move template definitions to
8333 int_encoding.h
8334 * attributes.cc: New file.
8335 * attributes.h: New file.
8336 * int_encoding.cc: New file.
8337 * int_encoding.h: New file.
8338
8339 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
8340
8341 PR gold/11055
8342 * incremental-dump.cc (dump_incremental_inputs): New.
8343 (main): Use dump_incremental_inputs.
8344
8345 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8346
8347 PR gold/10893
8348 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8349 checking elfcpp::STT_FUNC.
8350 (Target_i386::Relocate::relocate): Likewise.
8351 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8352
8353 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8354 symbols from shared libraries into normal FUNC symbols.
8355
8356 * symtab.h (Symbol): Add is_func and use it.
8357
8358 2009-12-05 Doug Kwan <dougkwan@google.com>
8359
8360 * arm.cc (Target_arm::arm_info): Initialize new fields
8361 attributes_section and attributes_vendor.
8362 * i386.cc (Target_i386::i386_info): Same.
8363 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8364 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8365 fields attributes_section and attributes_vendor.
8366 * sparc.cc (Target_sparc::sparc_info): Same.
8367 * target.h (Target::attributes_section, Target::attributes_vendor,
8368 Target::is_attributes_section, Target::attribute_arg_type,
8369 Target::attributes_order): New method definitions.
8370 (Target::Target_info::attributes_section,
8371 Target::Target_info::attributes_vendor): New fields.
8372 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8373 virtual method definitions.
8374 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8375 attributes_section and attributes_vendor.
8376 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8377
8378 2009-12-05 Doug Kwan <dougkwan@google.com>
8379
8380 * arm.cc: Update comments about interworking and stub generation.
8381 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8382 considered as non-PIC.
8383 (Arm_relocate_functions::base_abs): Fix formatting.
8384 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8385 of function to use GOT entry address instead of offset.
8386 (Target_arm::Scan::global): Issue an error if a symbol would need a
8387 PLT does not get one because it is untyped. Remove code to create
8388 dynamic symbols for relative branches.
8389 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8390 takes unsigned integer instead of boolean.
8391
8392 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8393
8394 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8395 (two_file_test_LDADD): Likewise.
8396 (common_test_1_LDADD): Likewise.
8397 (exception_test_LDADD) Likewise.
8398 (weak_test_LDADD): Likewise.
8399 (many_sections_test_LDADD): Likewise.
8400 (initpri1_LDADD): Likewise.
8401 (script_test_1_LDADD): Likewise.
8402 (script_test_2_LDADD): Likewise.
8403 (justsyms_LDADD): Likewise.
8404 (binary_test_LDADD): Likewise.
8405 (large_LDADD): Likewise.
8406 * testsuite/Makefile.in: Regenerated.
8407
8408 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
8409
8410 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8411 (Symbol_table::override_with_special): Likewise.
8412 (Symbol_table::add_from_object): Likewise.
8413
8414 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8415
8416 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8417 Don't set the data_offset twice.
8418
8419 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8420
8421 * testsuite/Makefile.in: Regenerate.
8422
8423 2009-12-03 Doug Kwan <dougkwan@google.com>
8424
8425 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8426 (Target_arm::do_finalize_sections): Add parameter for symbol table
8427 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8428 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8429 parameter for symbol table pointer.
8430 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8431 an additional parameter for a pointer to symbol table.
8432 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8433 parameter for a symbol table pointer.
8434 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8435 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8436 Ditto.
8437 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8438 parameter for a symbol table pointer.
8439
8440 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
8441
8442 * incremental.cc (Incremental_inputs_header)
8443 (Incremental_inputs_header_write, Incremental_inputs_entry)
8444 (Incremental_inputs_entry_write): Move ...
8445 * incremental.h (Incremental_inputs_header)
8446 (Incremental_inputs_header_write, Incremental_inputs_entry)
8447 (Incremental_inputs_entry_write): here.
8448
8449 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8450
8451 * incremental.cc (make_sized_incremental_binary): Set the target.
8452 Error if it is incompatible.
8453 * output.h (Output_file): Add filename method.
8454
8455 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8456
8457 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8458 from the get_* methods.
8459
8460 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8461
8462 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8463 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8464 Write 0 for the data_offset of scripts.
8465
8466 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8467
8468 * testsuite/Makefile.am: Add the incremental_test.sh test.
8469 * testsuite/incremental_test.sh: New.
8470 * testsuite/incremental_test_1.c: New.
8471 * testsuite/incremental_test_2.c: New.
8472
8473 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8474
8475 * incremental-dump.cc (main): Fix typos.
8476
8477 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8478
8479 PR gold/11025
8480 * incremental-dump.cc (main): Use llu to print 64 bit values.
8481
8482 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8483 H.J. Lu <hongjiu.lu@intel.com>
8484
8485 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8486 $(LIBDL).
8487 (incremental_dump_LDADD): Likewise.
8488 * Makefile.in: Regenerated.
8489
8490 2009-11-25 Doug Kwan <dougkwan@google.com>
8491
8492 Revert:
8493
8494 2009-11-25 Doug Kwan <dougkwan@google.com>
8495
8496 * arm.cc (Target_arm::Target_arm): Move method definition
8497 outside of class definition. Add code to handle
8498 --target1-rel, --target1-abs and --target2= options.
8499 (Target_arm::get_reloc_reloc_type): Change method to be
8500 non-static and const.
8501 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8502 New data member declaration.
8503 (Target_arm::Scan::local, Target_arm::Scan::global,
8504 Target_arm::Relocate::relocate,
8505 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8506 Adjust call to Target_arm::get_real_reloc_type.
8507 (Target_arm::get_real_reloc_type): Use command line options
8508 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8509 * options.h (--target1-rel, --target1-abs, --target2): New
8510 ARM-only options.
8511
8512 2009-11-25 Doug Kwan <dougkwan@google.com>
8513
8514 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8515 class definition. Add code to handle --target1-rel, --target1-abs
8516 and --target2= options.
8517 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8518 and const.
8519 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8520 member declaration.
8521 (Target_arm::Scan::local, Target_arm::Scan::global,
8522 Target_arm::Relocate::relocate,
8523 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8524 call to Target_arm::get_real_reloc_type.
8525 (Target_arm::get_real_reloc_type): Use command line options to
8526 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8527 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8528 options.
8529
8530 2009-11-25 Doug Kwan <dougkwan@google.com>
8531
8532 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8533 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8534 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8535 formatting.
8536 (Arm_relocate_functions::thm_call): Replace body with a call to
8537 Arm_relocate_functions::thumb_branch_common.
8538 (Arm_relocate_functions::thm_jump24,
8539 Arm_relocate_functions::thm_xpc22): New method definitions.
8540 (Arm_relocate_functions::thumb_branch_common): New method definition.
8541 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8542 operator.
8543 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8544 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8545
8546 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8547
8548 * Makefile.am: Build incremental-dump
8549 * Makefile.in: Regenerate.
8550 * incremental-dump.cc: New.
8551 * incremental.cc (Incremental_inputs_header_data,
8552 Incremental_inputs_entry_data): Move to incremental.h
8553 * incremental.h: (Incremental_inputs_header_data,
8554 Incremental_inputs_entry_data): Move from incremental.cc
8555
8556 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8557
8558 * incremental.cc (Incremental_inputs_header,
8559 Incremental_inputs_header_write, Incremental_inputs_entry,
8560 Incremental_inputs_entry_write): Add a typedef with the data type.
8561
8562 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8563
8564 * incremental.cc (Incremental_inputs_header,
8565 Incremental_inputs_header_write, Incremental_inputs_entry,
8566 Incremental_inputs_entry_write): Update comment about which
8567 type has the filed descriptions.
8568
8569 2009-11-15 Doug Kwan <dougkwan@google.com>
8570
8571 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8572 (Arm_relocate_functions::arm_branch_common): Change method defintion
8573 in class definition to a method declaration and update list of formal
8574 parameters.
8575 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8576 Arm_relocation_functions::jump24): Adjust call to
8577 Arm_relocate_functions::arm_branch_common. Update list of formal
8578 parameters.
8579 (Arm_relocate_functions::xpc25): New method definition.
8580 (Arm_relocate_functions::arm_branch_common): Move method defintion
8581 out from class definition. Use stubs for mode-switching and extending
8582 branch ranges.
8583 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8584 specially. Change code to enable use of stubs in ARM branches.
8585
8586 2009-11-10 Doug Kwan <dougkwan@google.com>
8587
8588 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8589 in method declaration.
8590 (Target_arm::relocate_stub): New method declaration.
8591 (Target_arm::default_target): Change to return a pointer instead of
8592 a const reference.
8593 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8594 Target_arm::default_target.
8595 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8596 method definition.
8597 (Target_arm::relocate_section): Adjust view.
8598 (Target_arm::relocate_stub): New method definition.
8599
8600 2009-11-10 Doug Kwan <dougkwan@google.com>
8601
8602 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8603 a format warning.
8604 * incremental.cc (open_incremental_binary): Initialized local
8605 variables to avoid warnings.
8606 * object.cc (make_elf_object): Ditto.
8607 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8608 a format warning.
8609
8610 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8611
8612 PR gold/10930
8613 * testsuite/plugin_test.c: Include "config.h".
8614
8615 2009-11-09 Doug Kwan <dougkwan@google.com>
8616
8617 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8618 (arm_symbol_value): Remove.
8619 (Arm_relocate_functions::arm_branch_common,
8620 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8621 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8622 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8623 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8624 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8625 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8626 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8627 Arm_relocate_functions::thm_mobw_abs_nc,
8628 Arm_relocate_functions::thm_mov_abs,
8629 Arm_relocate_functions::movw_prel_nc,
8630 Arm_relocate_functions::thm_movt_abs,
8631 Arm_relocate_functions::movt_prel,
8632 Arm_relocate_functions::thm_movw_prel_nc,
8633 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8634 (Target_arm::Relocate::relocate): Only decompose address into two
8635 parts if relocation type uses the thumb-bit and pass the actual
8636 bit instead of a flag indicating that the thumb-bit is used. Adjust
8637 calls to methods in Arm_relocate_functions for this change.
8638
8639 2009-11-08 Ian Lance Taylor <iant@google.com>
8640
8641 PR 10925
8642 * reloc.cc: Instantiate
8643 Sized_relobj::initialize_input_to_output_maps and
8644 Sized_relobj:free_input_to_output_maps.
8645
8646 2009-11-06 Ian Lance Taylor <iant@google.com>
8647
8648 PR 10876
8649 * defstd.cc (in_segment): Set only_if_ref true for "end".
8650
8651 2009-11-06 Doug Kwan <dougkwan@google.com>
8652
8653 * arm.cc (class Reloc_stub): Correct a comment.
8654 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8655 (Target_arm::scan_section_for_stubs): New method declaration.
8656 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8657 Change methods from private to protected.
8658 (Target_arm::do_may_relax): New method definition.
8659 (Target_arm::do_relax, Target_arm::group_sections,
8660 Target_arm::scan_reloc_for_stub,
8661 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8662 (Target_arm::arm_input_section_map_): New data member declaration.
8663 (Target_arm::scan_reloc_for_stub,
8664 Target_arm::scan_reloc_section_for_stubs,
8665 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8666 Target_arm::do_relax): New method definitions.
8667
8668 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8669
8670 * configure.ac: Check for (struct stat)::st_mtim
8671 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8672 * config.in: Regenerate.
8673 * configure: Regenerate.
8674
8675 2009-11-05 Ian Lance Taylor <iant@google.com>
8676
8677 PR 10910
8678 * output.cc (Output_segment::add_output_section): Add missing
8679 return statement.
8680
8681 2009-11-04 Ian Lance Taylor <iant@google.com>
8682
8683 PR 10880
8684 * object.h (class Object): Add is_needed and set_is_needed
8685 methods. Add is_needed_ field. Make bool fields into bitfields.
8686 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8687 defined in a dynamic object and referenced by a regular object,
8688 set is_needed for the dynamic object.
8689 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8690 if the file is marked with as_needed and it is not needed.
8691
8692 2009-11-04 Ian Lance Taylor <iant@google.com>
8693
8694 PR 10887
8695 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8696 tags if data is discarded by linker script.
8697 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8698 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8699 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8700 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8701
8702 2009-11-04 Ian Lance Taylor <iant@google.com>
8703
8704 * layout.cc (Layout::get_output_section): Add is_interp and
8705 is_dynamic_linker_section parameters. Change all callers.
8706 (Layout::choose_output_section): Likewise.
8707 (Layout::make_output_section): Likewise.
8708 (Layout::add_output_section_data): Add is_dynamic_linker_section
8709 parameter. Change all callers.
8710 * layout.h (class Layout): Update declarations.
8711 * output.h (class Output_section): Add is_interp, set_is_interp,
8712 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8713 Add is_interp_, is_dynamic_linker_section_ fields. Change
8714 generate_code_fills_at_write_ to a bitfield.
8715 * output.cc (Output_section::Output_sections): Initialize new
8716 fields.
8717 (Output_segment::add_output_section): Add do_sort parameter.
8718 Change all callers.
8719
8720 2009-11-03 Ian Lance Taylor <iant@google.com>
8721
8722 PR 10860
8723 * options.h (class General_options): Add --warn-common.
8724 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8725 merging two common symbols.
8726 (Symbol_table::should_override): Handle --warn-common when merging
8727 a common symbol with a defined symbol. Use report_resolve_problem
8728 for multiple definitions.
8729 (Symbol_table::report_resolve_problem): New function.
8730 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8731
8732 2009-11-03 Doug Kwan <dougkwan@google.com>
8733
8734 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8735 stub_factory_.
8736 (Target_arm::stub_factory): New method definition.
8737 (Target_arm::new_arm_input_section,
8738 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8739 Target_arm::reloc_uses_thumb_bit): New method declarations.
8740 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8741 New type definitions.
8742 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8743 member declarations.
8744 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8745 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8746 New method definitions.
8747
8748 2009-11-03 Ian Lance Taylor <iant@google.com>
8749
8750 * options.h (class General_options): Add --warn_constructors.
8751
8752 2009-11-03 Ian Lance Taylor <iant@google.com>
8753
8754 PR 10893
8755 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8756 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8757
8758 2009-11-03 Ian Lance Taylor <iant@google.com>
8759
8760 PR 10895
8761 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8762 --msgid-bugs-address.
8763 (install-pdf): New target.
8764 (install-data_yes): Look up one directory to find mkinstalldirs.
8765
8766 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8767
8768 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8769 tree.
8770
8771 2009-10-30 Doug Kwan <dougkwan@google.com>
8772
8773 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8774
8775 2009-10-30 Doug Kwan <dougkwan@google.com>
8776
8777 * arm.cc (Stub_addend_reader): New struct template definition
8778 and partial specializations.
8779 (Stub_addend_reader::operator()): New method definition for a
8780 partially specialized template.
8781
8782 2009-10-30 Doug Kwan <dougkwan@google.com>
8783
8784 * arm.cc (Arm_relobj::processor_specific_flags): New method
8785 definition.
8786 (Arm_relobj::do_read_symbols): New method declaration.
8787 (Arm_relobj::processor_specific_flags_): New data member declaration.
8788 (Arm_dynobj): New class definition.
8789 (Target_arm::do_finalize_sections): Add input_objects parameter.
8790 (Target_arm::do_adjust_elf_header): New method declaration.
8791 (Target_arm::are_eabi_versions_compatible,
8792 (Target_arm::merge_processor_specific_flags): New method declaration.
8793 (Target_arm::do_make_elf_object): New overloaded method definitions
8794 and declaration.
8795 (Arm_relobj::do_read_symbols): New method definition.
8796 (Arm_dynobj::do_read_symbols): Ditto.
8797 (Target_arm::do_finalize_sections): Add input_objects parameters.
8798 Merge processor-specific flags from all input objects.
8799 (Target_arm::are_eabi_versions_compatible,
8800 Target_arm::merge_processor_specific_flags,
8801 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8802 New method definitions.
8803 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8804 Input_objects pointer type parameter.
8805 * layout.cc (Layout::finalize): Pass input objects to target's.
8806 finalize_sections function.
8807 * output.cc (Output_file_header::do_sized_write): Set ELF file
8808 header's processor-specific flags.
8809 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8810 Input_objects pointer type parameter.
8811 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8812 * target.h (Input_objects): New forward class declaration.
8813 (Target::processor_specific_flags,
8814 Target::are_processor_specific_flags_sect): New method definitions.
8815 (Target::finalize_sections): Add input_objects parameter.
8816 (Target::Target): Initialize processor_specific_flags_ and
8817 are_processor_specific_flags_set_.
8818 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8819 parameter.
8820 (Target::set_processor_specific_flags): New method definition.
8821 (Target::processor_specific_flags_,
8822 Target::are_processor_specific_flags_set_): New data member
8823 declarations.
8824 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8825 Input_objects pointer type parameter.
8826
8827 2009-10-30 Doug Kwan <dougkwan@google.com>
8828
8829 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8830
8831 2009-10-28 Ian Lance Taylor <iant@google.com>
8832
8833 * object.h (class Relobj): Drop options parameter from
8834 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8835 do_scan_relocs, do_relocate. Change all callers.
8836 (class Sized_relobj): Drop options parameters from
8837 do_gc_process_relocs, do_scan_relocs, do_relocate,
8838 do_relocate_sections, relocate_sections, emit_relocs_scan,
8839 emit_relocs_scan_reltype. Change all callers.
8840 (struct Relocate_info): Remove options field and all references to
8841 it.
8842 * reloc.h (class Read_relocs): Remove options constructor
8843 parameter and options_ field. Change all callers.
8844 (class Gc_process_relocs, class Scan_relocs): Likewise.
8845 (class Relocate_task): Likewise.
8846 * target-reloc.h (scan_relocs): Remove options parameter. Change
8847 all callers.
8848 (scan_relocatable_relocs): Likewise.
8849 * target.h (class Sized_target): Remove options parameter from
8850 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8851 all callers.
8852 * gc.h (gc_process_relocs): Remove options parameter. Change all
8853 callers.
8854 * arm.cc: Update functions to remove options parameters.
8855 * i386.cc: Likewise.
8856 * powerpc.cc: Likewise.
8857 * sparc.cc: Likewise.
8858 * x86_64.cc: Likewise.
8859 * testsuite/testfile.cc: Likewise.
8860
8861 2009-10-28 Doug Kwan <dougkwan@google.com>
8862
8863 * arm.cc (Arm_relobj): New class definition.
8864 (Arm_relobj::scan_sections_for_stubs,
8865 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8866 New method definitions.
8867
8868 2009-10-28 Cary Coutant <ccoutant@google.com>
8869
8870 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8871 (Plugin::cleanup_done_): New member.
8872 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8873 (Plugin_manager::cleanup_done_): Remove.
8874 (Plugin_manager::add_input_file): Edit error message.
8875 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8876 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8877
8878 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8879
8880 * fileread.cc: (File_read::View::~View): Use the new
8881 data_ownership_ filed.
8882 (File_read::~File_read): Dispose the new whole_file_view_.
8883 (File_read::open): Mmap the whole file if needed.
8884 (File_read::open): Use whole_file_view_ instead of contents_.
8885 (File_read::find_view): Use whole_file_view_ if applicable.
8886 (File_read::do_read): Use whole_file_view_ instead of contents_.
8887 (File_read::make_view): Use whole_file_view_ instead of contents_,
8888 update File_read::View::View call.
8889 (File_read::find_or_make_view): Update File_read::View::View
8890 call.
8891 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8892 remove contents_
8893 (File_read::View::Data_ownership): New enum.
8894 (File_read::View::View): Replace bool mapped_ with Data_ownership
8895 argument.
8896 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8897 (File_read::View::data_ownership_): New field.
8898 (File_read::contents_): Remove (replaced by whole_file_view_).
8899 (File_read::whole_file_view_): New field.
8900 * options.h (class General_options): Add --keep-files-mapped.
8901
8902 2009-10-27 Cary Coutant <ccoutant@google.com>
8903
8904 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8905 * testsuite/Makefile.am (plugin_test_5): New test case.
8906 * testsuite/Makefile.in: Regenerate.
8907
8908 2009-10-25 Doug Kwan <dougkwan@google.com>
8909
8910 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8911 from private to protected to allow access by child class.
8912 (Sized_relobj::do_relocate_sections): New method declaration.
8913 (Sized_relobj::relocate_sections): Virtualize.
8914 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8915 Sized_relobj::relocate_sections. Instantiate template explicitly
8916 for different target sizes and endianity.
8917
8918 2009-10-24 Doug Kwan <dougkwan@google.com>
8919
8920 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8921 (Arm_input_section::as_arm_input_section): New method.
8922 (Arm_output_section): New class definition.
8923 (Arm_output_section::create_stub_group,
8924 Arm_output_section::group_sections): New method definitions.
8925
8926 2009-10-22 Doug Kwan <dougkwan@google.com>
8927
8928 * arm.cc (Arm_input_section): New class definition.
8929 (Arm_input_section::init, Arm_input_section:do_write,
8930 Arm_input_section::set_final_data_size,
8931 Arm_input_section::do_reset_address_and_file_offset): New method
8932 definitions.
8933
8934 2009-10-21 Doug Kwan <dougkwan@google.com>
8935
8936 * arm.cc (Stub_table, Arm_input_section): New forward class
8937 declarations.
8938 (Stub_table): New class defintion.
8939 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8940 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8941 New method definition.
8942
8943 2009-10-21 Doug Kwan <dougkwan@google.com>
8944
8945 * arm.cc: Update copyright comments.
8946 (Target_arm): New forward class template declaration.
8947 (Arm_address): New type.
8948 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8949 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8950 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8951 constants.
8952 (Insn_template): Same.
8953 (DEF_STUBS): New macro.
8954 (Stub_type): New enum type.
8955 (Stub_template): New class definition.
8956 (Stub): Same.
8957 (Reloc_stub): Same.
8958 (Stub_factory): Same.
8959 (Target_arm::Target_arm): Initialize may_use_blx_ and
8960 should_force_pic_veneer_.
8961 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8962 Target_arm::should_force_pic_veneer,
8963 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8964 Target_arm::using_thumb_only, Target_arm:;default_target): New
8965 method defintions.
8966 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8967 New data member declarations.
8968 (Insn_template::size, Insn_template::alignment): New method defintions.
8969 (Stub_template::Stub_template): New method definition.
8970 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8971 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8972 (Stub_factory::Stub_factory): New method definition.
8973 * gold.h (string_hash): New template.
8974 * output.h (Input_section_specifier::hash_value): Use
8975 gold::string_hash.
8976 (Input_section_specifier::string_hash): Remove.
8977 * stringpool.cc (Stringpool_template::string_hash): Use
8978 gold::string_hash.
8979
8980 2009-10-20 Doug Kwan <dougkwan@google.com>
8981
8982 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8983 symbols of relaxed input sections.
8984 * output.h (Output_section::find_relaxed_input_section): Make
8985 method public.
8986
8987 2009-10-16 Doug Kwan <dougkwan@google.com>
8988
8989 * dynobj.cc (Versions::Versions): Initialize version_script_.
8990 Only insert base version symbol definition for a shared object
8991 if version script defines any version versions.
8992 (Versions::define_base_version): New method definition.
8993 (Versions::add_def): Check that base version is not needed.
8994 (Versions::add_need): Define base version lazily.
8995 * dynobj.h (Versions::define_base_version): New method declaration.
8996 (Versions::needs_base_version_): New data member declaration.
8997 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8998 (check_DATA): Add no_version_test.stdout.
8999 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9000 New make rules.
9001 * testsuite/Makefile.in: Regenerate.
9002 * testsuite/no_version_test.c: New file.
9003 * testsuite/no_version_test.sh: Ditto.
9004
9005 2009-10-16 Doug Kwan <dougkwan@google.com>
9006
9007 * expression.cc (class Segment_start_expression): New class definition.
9008 (Segment_start_expression::value): New method definition.
9009 (script_exp_function_segment_start): Return a new
9010 Segment_start_expression.
9011 * gold/script-c.h (script_saw_segment_start_expression): New function
9012 prototype.
9013 * script-sections.cc (Script_sections::Script_sections): Initialize
9014 SAW_SEGMENT_START_EXPRESSION_ to false.
9015 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9016 and -Tbbs options to specify section addresses if given in
9017 command line and no SEGMENT_START expression is seen in a script.
9018 * script-sections.h (Script_sections::saw_segment_start_expression,
9019 Script_sections::set_saw_segment_start_expression): New method
9020 definition.
9021 (Script_sections::saw_segment_start_expression_): New data member
9022 declaration.
9023 * script.cc (script_saw_segment_start_expression): New function.
9024 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9025 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9026 script_test_7.sh and script_test_8.sh.
9027 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9028 script_test_8.stdout.
9029 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9030 (script_test_6, script_test_6.stdout, script_test_7,
9031 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9032 * Makefile.in: Regenerate.
9033 * testsuite/script_test_6.sh: New file.
9034 * testsuite/script_test_6.t: Same.
9035 * testsuite/script_test_7.sh: Same.
9036 * testsuite/script_test_7.t: Same.
9037 * testsuite/script_test_8.sh: Same.
9038
9039 2009-10-16 Doug Kwan <dougkwan@google.com>
9040
9041 * output.cc (Output_segment::set_section_list_address): Cast
9042 expressions to unsigned long long type to avoid format warnings.
9043
9044 2009-10-15 Ian Lance Taylor <iant@google.com>
9045
9046 * script.cc (Script_options::add_symbol_assignment): Always add a
9047 dot assignment to script_sections_.
9048 * script-sections.cc (Script_sections::add_dot_assignment):
9049 Initialize if necessary.
9050
9051 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9052 program headers with no load segment if there is a linker script.
9053
9054 * layout.cc (Layout::set_segment_offsets): Align the file offset
9055 to the segment aligment for -N or -n with no load segment.
9056 * output.cc (Output_segment::add_output_section): Don't crash if
9057 the first section is a TLS section.
9058 (Output_segment::set_section_list_addresses): Print an error
9059 message if the address moves backward in a linker script.
9060 * script-sections.cc
9061 (Output_section_element_input::set_section_addresses): Don't
9062 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9063 (Orphan_output_section::set_section_addresses): Likewise.
9064
9065 2009-10-15 Doug Kwan <dougkwan@google.com>
9066
9067 * layout.cc (Layout::finish_dynamic_section): Generate tags
9068 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9069 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9070 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9071
9072 2009-10-14 Ian Lance Taylor <iant@google.com>
9073
9074 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9075 fields.
9076 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9077 data_shdr fields of relinfo.
9078 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9079 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9080 R_386_TLS_LDO_32, adjust based on section flags.
9081 (Target_i386::Relocate::fix_up_ldo): Remove.
9082
9083 2009-10-13 Ian Lance Taylor <iant@google.com>
9084
9085 Add support for -pie.
9086 * options.h (class General_options): Add -pie and
9087 --pic-executable.
9088 (General_options::output_is_position_independent): Test -pie.
9089 (General_options::output_is_executable): Return true if not shared
9090 and not relocatable.
9091 (General_options::output_is_pie): Remove.
9092 * options.cc (General_options::finalize): Reject incompatible uses
9093 of -pie.
9094 * gold.cc (queue_middle_tasks): A -pie link is not static.
9095 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9096 * symtab.cc (Symbol::final_value_is_known): Return false if
9097 output_is_position_independent.
9098 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9099 output_is_position_independent.
9100 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9101 output_is_position_independent.
9102 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9103 output_is_position_independent.
9104 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9105 two_file_pie_test.
9106 (basic_pie_test.o, basic_pie_test): New targets.
9107 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9108 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9109 (two_file_pie_test): New target.
9110 * testsuite/Makefile.in: Rebuild.
9111 * README: Remove note saying that -pie is not supported.
9112
9113 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9114
9115 * options.h (class General_options): Add -init and -fini.
9116 * layout.cc (Layout::finish_dynamic_section): Emit
9117 given init and fini functions.
9118
9119 2009-10-13 Sriraman Tallam <tmsriram@google.com>
9120
9121 * gc.h (gc_process_relocs): Check if icf is enabled using new
9122 function.
9123 * gold.cc (queue_initial_tasks): Likewise.
9124 (queue_middle_tasks): Likewise.
9125 * object.cc (do_layout): Likewise.
9126 * symtab.cc (is_section_folded): Likewise.
9127 * main.cc (main): Likewise.
9128 * reloc.cc (Read_relocs::run): Likewise.
9129 (Sized_relobj::do_scan_relocs): Likewise.
9130 * icf.cc (is_function_ctor_or_dtor): New function.
9131 (Icf::find_identical_sections): Check if function is ctor or dtor when
9132 safe icf is chosen.
9133 * options.h (General_options::icf): Change option to be an enum.
9134 (Icf_status): New enum.
9135 (icf_enabled): New method.
9136 (icf_safe_folding): New method.
9137 (set_icf_status): New method.
9138 (icf_status_): New variable.
9139 * (options.cc) (General_options::finalize): Set icf_status_.
9140 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9141 icf_test and icf_keep_unique_test to use the --icf enum flag.
9142 * testsuite/icf_safe_test.sh: New file.
9143 * testsuite/icf_safe_test.cc: New file.
9144
9145 2009-10-12 Sriraman Tallam <tmsriram@google.com>
9146
9147 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9148 includes to gc.h and icf.h.
9149 * arm.cc: Include gc.h.
9150 * gold.cc: Likewise.
9151 * i386.cc: Likewise.
9152 * powerpc.cc: Likewise.
9153 * sparc.cc: Likewise.
9154 * x86_64.cc: Likewise.
9155 * gc.h: Include icf.h.
9156
9157 2009-10-11 Ian Lance Taylor <iant@google.com>
9158
9159 * plugin.cc: Include "gold.h" before other header files.
9160
9161 2009-10-10 Chris Demetriou <cgd@google.com>
9162
9163 * options.h (Input_file_argument::Input_file_type): New enum.
9164 (Input_file_argument::is_lib_): Replace with...
9165 (Input_file_argument::type_): New member.
9166 (Input_file_argument::Input_file_argument): Take Input_file_type
9167 'type' rather than boolean 'is_lib' as second argument.
9168 (Input_file_argument::is_lib): Use type_.
9169 (Input_file_argument::is_searched_file): New function.
9170 (Input_file_argument::may_need_search): Handle is_searched_file.
9171 * options.cc (General_options::parse_library): Support -l:filename.
9172 (General_options::parse_just_symbols): Update for Input_file_argument
9173 changes.
9174 (Command_line::process): Likewise.
9175 * archive.cc (Archive::get_file_and_offset): Likewise.
9176 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9177 * script.cc (read_script_file, script_add_file): Likewise.
9178 * fileread.cc (Input_file::Input_file): Likewise.
9179 (Input_file::will_search_for): Handle is_searched_file.
9180 (Input_file::open): Likewise.
9181 * readsyms.cc (Read_symbols::get_name): Likewise.
9182 * testsuite/Makefile.am (searched_file_test): New test.
9183 * testsuite/Makefile.in: Regenerate.
9184 * testsuite/searched_file_test.cc: New file.
9185 * testsuite/searched_file_test_lib.cc: New file.
9186
9187 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9188 Ian Lance Taylor <iant@google.com>
9189
9190 * descriptor.cc: Include <cstdio> and "binary-io.h".
9191 (Descriptors::open): Open the files in binary mode always.
9192 * script.cc (Lex::get_token): Treat \r as whitespace.
9193
9194 2009-10-09 Ian Lance Taylor <iant@google.com>
9195
9196 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9197
9198 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9199 Ian Lance Taylor <iant@google.com>
9200
9201 * configure.ac: Check for readv function also.
9202 * fileread.cc (readv): Define if not HAVE_READV.
9203 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9204 does not exist.
9205 * config.in: Regenerate.
9206 * configure: Regenerate.
9207
9208 2009-10-09 Doug Kwan <dougkwan@google.com>
9209
9210 * layout.cc (Layout::make_output_section): Call target hook to make
9211 ordinary output section.
9212 (Layout::finalize): Adjust parameter list of call the
9213 Target::may_relax().
9214 * layout.h (class Layout::section_list): New method.
9215 * merge.h (Output_merge_base::entsize): Change visibility to public.
9216 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9217 New methods.
9218 (Output_merge_string::do_is_string): New method.
9219 * object.cc (Sized_relobj::do_setup): renamed from
9220 Sized_relobj::set_up.
9221 * object.h (Sized_relobj::adjust_shndx,
9222 Sized_relobj::initializ_input_to_output_maps,
9223 Sized_relobj::free_input_to_output_maps): Change visibilities to
9224 protected.
9225 (Sized_relobj::setup): Virtualize.
9226 (Sized_relobj::do_setup): New method declaration.
9227 (Sized_relobj::invalidate_section_offset,
9228 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9229 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9230 * options.cc (parse_int): New function.
9231 * options.h (parse_int): New declaration.
9232 (DEFINE_int): New macro.
9233 (stub_group_size): New option.
9234 * output.cc (Output_section::Output_section): Initialize memebers
9235 merge_section_map_, merge_section_by_properties_map_,
9236 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9237 (Output_section::add_input_section): Handled deferred code-fill
9238 generation and remove an old comment.
9239 (Output_section::add_relaxed_input_section): New method definition.
9240 (Output_section::add_merge_input_section): Use merge section by
9241 properties map to speed to search. Update merge section maps
9242 as appropriate.
9243 (Output_section::build_relaxation_map): New method definition.
9244 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9245 Same.
9246 (Output_section::relax_input_section): Renamed to
9247 Output_section::convert_input_sections_to_relaxed_sections and change
9248 interface to take a vector of pointers to relaxed sections.
9249 (Output_section::find_merge_section,
9250 Output_section::find_relaxed_input_section): New method definitions.
9251 (Output_section::is_input_address_mapped,
9252 Output_section::output_offset, Output_section::output_address):
9253 Use output section data maps to speed up searching.
9254 (Output_section::find_starting_output_address): Add comments.
9255 (Output_section::do_write,
9256 Output_section::write_to_postprocessing_buffer): Do code-fill
9257 generation as appropriate.
9258 (Output_section::get_input_sections): Invalidate relaxed input section
9259 map.
9260 (Output_section::restore_states): Adjust type of checkpoint .
9261 Invalidate relaxed input section map.
9262 * output.h (Output_merge_base): New class declaration.
9263 (Input_section_specifier): New class defintion.
9264 (class Output_relaxed_input_section) Change base class to
9265 Output_section_data_build.
9266 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9267 base class initializer.
9268 (Output_section::add_relaxed_input_section): New method declaration.
9269 (Output_section::Input_section): Change visibility to protected.
9270 (Output_section::Input_section::relobj,
9271 Output_section::Input_section::shndx): Handle relaxed input sections.
9272 Output_section::input_sections) Change visibility to protected. Also
9273 define overload to return a non-const pointer.
9274 (Output_section::Merge_section_properties): New class defintion.
9275 (Output_section::Merge_section_by_properties_map,
9276 Output_section::Output_section_data_by_input_section_map,
9277 Output_section::Relaxation_map): New types.
9278 (Output_section::relax_input_section): Rename method to
9279 Output_section::convert_input_sections_to_relaxed_sections and change
9280 interface to take a vector of relaxed section pointers.
9281 (Output_section::find_merge_section,
9282 Output_section::find_relaxed_input_section,
9283 Output_section::build_relaxation_map,
9284 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9285 New method declarations.
9286 (Output_section::merge_section_map_
9287 Output_section::merge_section_by_properties_map_,
9288 Output_section::relaxed_input_section_map_,
9289 Output_section::is_relaxed_input_section_map_valid_,
9290 Output_section::generate_code_fills_at_write_): New data members.
9291 * script-sections.cc
9292 (Output_section_element_input::set_section_addresses): Call
9293 current_data_size and addralign methods of relaxed input sections.
9294 (Orphan_output_section::set_section_addresses): Call current_data_size
9295 and addralign methods of relaxed input sections.
9296 * symtab.cc (Symbol_table::compute_final_value): Extract template
9297 from the body of Symbol_table::sized_finalize_symbol.
9298 (Symbol_table::sized_finalized_symbol): Call
9299 Symbol_table::compute_final_value.
9300 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9301 (Symbol_table::compute_final_value): New templated method declaration.
9302 * target.cc (Target::do_make_output_section): New method defintion.
9303 * target.h (Target::make_output_section): New method declaration.
9304 (Target::relax): Add more parameters for input objects, symbol table
9305 and layout. Adjust call to do_relax.
9306 (Target::do_make_output_section): New method declaration.
9307 (Target::do_relax): Add parameters for input objects, symbol table
9308 and layout.
9309
9310 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9311
9312 * pread.c: Include stdio.h.
9313
9314 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9315
9316 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9317 defined.
9318
9319 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9320
9321 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9322 Change read_shndx type to unsigned int.
9323 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9324 int.
9325 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9326 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9327 Change read_shndx type to unsigned int.
9328 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9329 int.
9330 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9331 * layout.cc (Layout::create_symtab_sections): Cast the result of
9332 local_symcount * symsize to off_t in the gold_assert.
9333
9334 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9335
9336 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9337 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9338 R_ARM_BASE_ABS.
9339 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9340 (Arm_relocate_functions::thm_abs5): New function.
9341 (Arm_relocate_functions::abs12): New function.
9342 (Arm_relocate_functions::abs16): New function.
9343 (Arm_relocate_functions::base_abs): New function.
9344 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9345 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9346 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9347 R_ARM_BASE_ABS.
9348 (Scan::global): Likewise.
9349 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9350 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9351 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9352 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9353 R_ARM_BASE_ABS.
9354
9355 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9356
9357 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9358 (Arm_relocate_functions::movt_prel): New function.
9359 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9360 (Arm_relocate_functions::thm_movt_prel): New function.
9361 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9362 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9363 (Scan::global, Relocate::relocate): Likewise.
9364 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9365
9366 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9367
9368 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9369 Incremental_checker.
9370 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9371 unsigned int.
9372 (class Incremental_inputs_header): New class.
9373 (Incremental_inputs_header_writer): Edit comment.
9374 (Incremental_inputs_entry): New class.
9375 (Incremental_inputs_entry_writer): Edit comment.
9376 (Sized_incremental_binary::do_find_incremental_inputs_section):
9377 Add *strtab_shndx parameter, fill it.
9378 (Sized_incremental_binary::do_check_inputs): New method.
9379 (Incremental_checker::can_incrementally_link_output_file): Use
9380 Sized_incremental_binary::check_inputs.
9381 (Incremental_inputs::report_command_line): Save command line in
9382 command_line_.
9383 * incremental.h:
9384 (Incremental_binary::find_incremental_inputs_section): New
9385 method.
9386 (Incremental_binary::do_find_incremental_inputs_section): Add
9387 strtab_shndx parameter.
9388 (Incremental_binary::do_check_inputs): New pure virtual method.
9389 (Sized_incremental_binary::do_check_inputs): Declare.
9390 (Incremental_checker::Incremental_checker): Add incremental_inputs
9391 parameter, use it to initialize incremental_inputs_.
9392 (Incremental_checker::incremental_inputs_): New field.
9393 (Incremental_checker::command_line): New method.
9394 (Incremental_checker::inputs): New method.
9395 (Incremental_checker::command_line_): New field.
9396
9397 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9398
9399 * incremental.cc: Include <cstdarg> and "target-select.h".
9400 (vexplain_no_incremental): New function.
9401 (explain_no_incremental): New function.
9402 (Incremental_binary::error): New method.
9403 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9404 method.
9405 (make_sized_incremental_binary): New function.
9406 (open_incremental_binary): New function.
9407 (can_incrementally_link_file): Add checks if output is ELF and has
9408 inputs section.
9409 * incremental.h: Include "elfcpp_file.h" and "output.h".
9410 (Incremental_binary): New class.
9411 (Sized_incremental_binary): New class.
9412 (open_incremental_binary): Declare.
9413 * object.cc (is_elf_object): Use
9414 elfcpp::Elf_recognizer::is_elf_file.
9415 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9416 * output.h (Output_file::filesize): New method.
9417
9418 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9419
9420 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9421 New function.
9422 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9423 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9424 function.
9425 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9426 function.
9427 (Arm_relocate_functions::movw_abs_nc): New function.
9428 (Arm_relocate_functions::movt_abs): New function.
9429 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9430 (Arm_relocate_functions::thm_movt_abs): New function.
9431 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9432 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9433 (Scan::global): Likewise.
9434 (Relocate::relocate): Likewise.
9435 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9436
9437 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9438
9439 * arm.cc (Arm_relocate_functions::got_prel) New function.
9440 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9441 (Relocate::relocate): Likewise.
9442 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9443
9444 2009-10-06 Ian Lance Taylor <iant@google.com>
9445
9446 * options.h (class General_options): Define
9447 split_stack_adjust_size parameter.
9448 * object.h (class Object): Add uses_split_stack_ and
9449 has_no_split_stack_ fields. Add uses_split_stack and
9450 has_no_split_stack accessor functions. Declare
9451 handle_split_stack_section.
9452 (class Reloc_symbol_changes): Define.
9453 (class Sized_relobj): Define Function_offsets. Declare
9454 split_stack_adjust, split_stack_adjust_reltype, and
9455 find_functions.
9456 * object.cc (Object::handle_split_stack_section): New function.
9457 (Sized_relobj::do_layout): Call handle_split_stack_section.
9458 * dynobj.cc (Sized_dynobj::do_layout): Call
9459 handle_split_stack_section.
9460 * reloc.cc (Sized_relobj::relocate_sections): Call
9461 split_stack_adjust for executable sections in split_stack
9462 objects. Pass reloc_map to relocate_section.
9463 (Sized_relobj::split_stack_adjust): New function.
9464 (Sized_relobj::split_stack_adjust_reltype): New function.
9465 (Sized_relobj::find_functions): New function.
9466 * target-reloc.h: Include "object.h".
9467 (relocate_section): Add reloc_symbol_changes parameter. Change
9468 all callers.
9469 * target.h (class Target): Add calls_non_split method. Declare
9470 do_calls_non_split virtual method. Declare match_view and
9471 set_view_to_nop.
9472 * target.cc: Include "elfcpp.h".
9473 (Target::do_calls_non_split): New function.
9474 (Target::match_view): New function.
9475 (Target::set_view_to_nop): New function.
9476 * gold.cc (queue_middle_tasks): Give an error if mixing
9477 split-stack and non-split-stack objects with -r.
9478 * i386.cc (Target_i386::relocate_section): Add
9479 reloc_symbol_changes parameter.
9480 (Target_i386::do_calls_non_split): New function.
9481 * x86_64.cc (Target_x86_64::relocate_section): Add
9482 reloc_symbol_changes parameter.
9483 (Target_x86_64::do_calls_non_split): New function.
9484 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9485 parameter.
9486 * powerpc.cc (Target_powerpc::relocate_section): Add
9487 reloc_symbol_changes parameter.
9488 * sparc.cc (Target_sparc::relocate_section): Add
9489 reloc_symbol_changes parameter.
9490 * configure.ac: Call AM_CONDITIONAL for the default target.
9491 * configure: Rebuild.
9492 * testsuite/Makefile.am (TEST_AS): New variable.
9493 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9494 (check_DATA): Add split_i386 and split_x86_64 files.
9495 (SPLIT_DEFSYMS): Define.
9496 (split_i386_[1234n].o): New targets.
9497 (split_i386_[124]): New targets.
9498 (split_i386_[1234r].stdout): New targets.
9499 (split_x86_64_[1234n].o): New targets.
9500 (split_x86_64_[124]): New targets.
9501 (split_x86_64_[1234r].stdout): New targets.
9502 (MOSTLYCLEANFILES): Add new executables.
9503 * testsuite/split_i386.sh: New file.
9504 * testsuite/split_x86_64.sh: New file.
9505 * testsuite/split_i386_1.s: New file.
9506 * testsuite/split_i386_2.s: New file.
9507 * testsuite/split_i386_3.s: New file.
9508 * testsuite/split_i386_4.s: New file.
9509 * testsuite/split_i386_n.s: New file.
9510 * testsuite/split_x86_64_1.s: New file.
9511 * testsuite/split_x86_64_2.s: New file.
9512 * testsuite/split_x86_64_3.s: New file.
9513 * testsuite/split_x86_64_4.s: New file.
9514 * testsuite/split_x86_64_n.s: New file.
9515 * testsuite/testfile.cc (Target_test): Update relocation_section
9516 function.
9517 * testsuite/Makefile.in: Rebuild.
9518
9519 2009-10-06 Ian Lance Taylor <iant@google.com>
9520
9521 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9522 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9523 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9524 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9525 the address on ldo_addrs_.
9526 (Target_i386::Relocate::fix_up_ldo): New function.
9527
9528 2009-10-06 Rafael Espindola <espindola@google.com>
9529
9530 * plugin.cc (add_input_library): New.
9531 (Plugin::load): Add add_input_library to tv.
9532 (Plugin_manager::add_input_file): Add the is_lib argument.
9533 (add_input_file): Update call to Plugin_manager::add_input_file.
9534 (add_input_library): New.
9535 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9536
9537 2009-09-30 Doug Kwan <dougkwan@google.com>
9538
9539 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9540 symbol and call Symbol::may_need_copy_reloc to determine if
9541 a copy reloc is needed.
9542 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9543 nocopyreloc is given in command line.
9544 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9545 given in command line.
9546 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9547 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9548 of the removed Target_i386::may_need_copy_reloc.
9549 * options.h (copyreloc): New option with default value false.
9550 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9551 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9552 instead of the removed Target_powerpc::may_need_copy_reloc.
9553 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9554 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9555 instead of the removed Target_sparc::may_need_copy_reloc.
9556 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9557 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9558 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9559 instead of the removed Target_x86_64::may_need_copy_reloc.
9560
9561 2009-09-30 Ian Lance Taylor <iant@google.com>
9562
9563 * object.h (class Object): Remove target_ field, and target,
9564 sized_target, and set_target methods.
9565 (Object::sized_target): Remove.
9566 (class Sized_relobj): Update declarations. Remove sized_target.
9567 * object.cc (Sized_relobj::setup): Remove target parameter.
9568 Change all callers.
9569 (Input_objects::add_object): Don't do anything with the target.
9570 (make_elf_sized_object): Add punconfigured parameter. Change all
9571 callers. Set or test parameter target.
9572 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9573 Change all callers.
9574 * parameters.cc (Parameters::set_target): Change parameter type to
9575 be non-const.
9576 (Parameters::default_target): Remove.
9577 (set_parameters_target): Change parameter type to be non-const.
9578 (parameters_force_valid_target): New function.
9579 (parameters_clear_target): New function.
9580 * parameters.h (class Parameters): Update declarations. Remove
9581 default_target method. Add sized_target and clear_target
9582 methods. Change target_ to be non-const.
9583 (set_parameters_target): Update declaration.
9584 (parameters_force_valid_target): Declare.
9585 (parameters_clear_target): Declare.
9586 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9587 as NULL if we aren't searching.
9588 (Add_symbols::run): Don't check for compatible target.
9589 * fileread.cc (Input_file::open_binary): Call
9590 parameters_force_valid_target.
9591 * gold.cc (queue_middle_tasks): Likewise.
9592 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9593 set_target on object.
9594 * dynobj.h (class Sized_dynobj): Update declarations.
9595 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9596 make_elf_object returns NULL.
9597 (Archive::include_member): Don't check whether object target is
9598 compatible.
9599 * output.cc (Output_section::add_input_section): Get target from
9600 parameters.
9601 (Output_section::relax_input_section): Likewise.
9602 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9603 parameters.
9604 (Sized_relobj::do_scan_relocs): Likewise.
9605 (Sized_relobj::relocate_sections): Likewise.
9606 * resolve.cc (Symbol_table::resolve): Likewise.
9607 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9608 parameter. Change all callers.
9609 (Symbol_table::add_from_object): Get target from parameters.
9610 (Symbol_table::add_from_relobj): Don't check object target.
9611 (Symbol_table::add_from_dynobj): Likewise.
9612 (Symbol_table::define_special_symbol): Get target from
9613 parameters.
9614 * symtab.h (class Symbol_table): Update declaration.
9615 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9616 parameter. Change all callers. Clear parameter target.
9617 (Binary_test): Test target here.
9618 * testsuite/object_unittest.cc (gold_testsuite): Remove
9619 target_test_pointer parameter. Change all callers.
9620 (Object_test): Test target here.
9621
9622 2009-09-26 Ian Lance Taylor <iant@google.com>
9623
9624 * testsuite/initpri1.c: Don't try to use constructor priorities if
9625 compiling with gcc before 4.3.
9626
9627 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9628
9629 * testsuite/retain_symbols_file_test.sh (check_present): Change
9630 output file name to retain_symbols_file_test.stdout.
9631 (check_absent): Likewise.
9632
9633 2009-09-18 Craig Silverstein <csilvers@google.com>
9634
9635 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9636 * options.cc: Include <cerrno> and <fstream>.
9637 (General_options::finalize): Parse -retain-symbols-file tag.
9638 * options.h: New flag.
9639 (General_options): New method should_retain_symbol, new
9640 variable symbols_to_retain.
9641 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9642 should_retain_symbol map.
9643 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9644 * testsuite/Makefile.in: Regenerate.
9645 * testsuite/retain_symbols_file_test.sh: New file.
9646
9647 2009-09-18 Nick Clifton <nickc@redhat.com>
9648
9649 * po/es.po: Updated Spanish translation.
9650
9651 2009-09-17 Doug Kwan <dougkwan@google.com>
9652
9653 * debug.h (DEBUG_RELAXATION): New constant.
9654 (DEBUG_ALL): Add DEBUG_RELAXATION.
9655 (debug_string_to_enum): Add relaxation debug option.
9656 * layout.cc
9657 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9658 Layout::Relaxation_debug_check::read_sections,
9659 Layout::Relaxation_debug_check::read_sections): New method definitions.
9660 (Layout::Layout): Initialize data members
9661 record_output_section_data_from_scrips_,
9662 script_output_section_data_list_ and relaxation_debug_check_.
9663 (Layout::save_segments, Layout::restore_segments,
9664 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9665 Layout::relaxation_loop_body): New method definitions.
9666 (Layout::finalize): Support relaxation. Move section layout code to
9667 Layout::relaxation_loop_body.
9668 (Layout::set_asection_address_from_script): Move code for orphan
9669 section placement out.
9670 (Layout::place_orphan_sections_in_script): New method definition.
9671 * layout.h (Output_segment_headers, Output_file_header):
9672 New forward class declarations.
9673 (Layout::~Layout): Define.
9674 (Layout::new_output_section_data_from_script): New method definition.
9675 (Layout::place_orphan_sections_in_script): New method declaration.
9676 (Layout::Segment_states): New type declaration.
9677 (Layout::save_segments, Layout::restore_segments,
9678 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9679 Layout::relaxation_loop_body): New method declarations.
9680 (Layout::Output_section_data_list): New type declaration.
9681 (Layout::Relaxation_debug_check): New class definition.
9682 (Layout::record_output_section_data_from_script_,
9683 Layout::script_output_section_data_list_, Layout::segment_states_,
9684 Layout::relaxation_debug_check_): New data members.
9685 * output.cc: (Output_section_headers::do_size): New method definition.
9686 (Output_section_headers::Output_section_headers): Move size
9687 computation to Output_section_headers::do_size.
9688 (Output_segment_headers::do_size): New method definition.
9689 (Output_file_header::Output_file_header): Move size computation to
9690 Output_file_header::do_size and call it.
9691 (Output_file_header::do_size): New method definition.
9692 (Output_data_group::Output_data_group): Adjust call to
9693 Output_section_data.
9694 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9695 (Output_symtab_xindex::do_write): Add array bound check.
9696 (Output_section::Input_section::print_to_mapfile): Handle
9697 RELAXED_INPUT_SECTION_CODE.
9698 (Output_section::Output_section): Initialize data member checkpoint_.
9699 (Output_section::~Output_section): Delete checkpoint object pointed
9700 by checkpoint_.
9701 (Output_section::add_input_section): Always add an Input_section if
9702 relaxing.
9703 (Output_section::add_merge_input_section): Add assert.
9704 (Output_section::relax_input_section): New method definition.
9705 (Output_section::set_final_data_size): Set load address to zero for
9706 an unallocated section.
9707 (Output_section::do_address_and_file_offset_have_reset_values):
9708 New method definition.
9709 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9710 Handle relaxed input section.
9711 (Output_section::sort_attached_input_sections): Checkpoint input
9712 section list lazily.
9713 (Output_section::get_input_sections): Change type of input_sections to
9714 list of Simple_input_section pointers. Checkpoint input section list
9715 lazily. Also handle relaxed input sections.
9716 (Output_section::add_input_section_for_script): Take a reference to
9717 a Simple_input_section object instead of Relobj pointer and section
9718 index as parameter. Handle relaxed input sections.
9719 (Output_section::save_states, Output_section::restore_states): New
9720 method definitions.
9721 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9722 (Output_data::is_data_size_fixed): New method definition.
9723 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9724 if it is fixed.
9725 (Output_data::address_and_file_offset_have_reset_values): New method
9726 definition.
9727 (Output_data::do_address_and_file_offset_have_reset_values): New method
9728 definition.
9729 (Output_data::set_data_size): Check that data size is not fixed.
9730 (Output_data::fix_data_size): New method definition.
9731 (Output_data::is_data_size_fixed_): New data member.
9732 (Output_section_headers::set_final_data_size): New method definition.
9733 (Output_section_headers::do_size): New method declaration.
9734 (Output_segment_headers::set_final_data_size): New method definition.
9735 (Output_segment_headers::do_size): New method declaration.
9736 (Output_file_header::set_final_data_size)::New method definition.
9737 (Output_file_header::do_size)::New method declaration.
9738 (Output_section_data::Output_section_data): Add new parameter
9739 is_data_size_fixed and use it to fix data size.
9740 (Output_data_const::Output_data_const): Adjust call to base class
9741 constructor and fix data size.
9742 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9743 base class constructor and fix data size.
9744 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9745 base class constructor and fix data size.
9746 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9747 class constructor and fix data size.
9748 (Output_data_group::set_final_data_size): New method definition.
9749 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9750 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9751 class constructor and fix data size.
9752 (Output_relaxed_input_section): New class definition.
9753 (Output_section::Simple_input_section): New class definition.
9754 (Output_section::get_input_sections): Adjust parameter list.
9755 (Output_section::add_input_section_for_script): Same.
9756 (Output_section::save_states, Output_section::restore_states,
9757 Output_section::do_address_and_file_offset_have_reset_values,
9758 (Output_section::Input_section::Input_section): Handle
9759 RELAXED_INPUT_SECTION_CODE. Add new overload for
9760 Output_relaxed_input_section.
9761 (Output_section::Input_section::is_input_section,
9762 Output_section::Input_section::set_output_section): Handle relaxed
9763 input section.
9764 (Output_section::Input_section::is_relaxed_input_section,
9765 Output_section::Input_section::output_section_data,
9766 Output_section::Input_section::relaxed_input_section): New method
9767 definitions.
9768 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9769 value.
9770 (Output_section::Input_section::u1_): Update comments.
9771 (Output_section::Input_section::u2_): Add new union member poris.
9772 (Output_section::Checkpoint_output_section): New classs definition.
9773 (Output_section::relax_input_section): New method declaration.
9774 (Output_section::checkpoint_): New data member.
9775 (Output_segment): Update comments.
9776 (Output_segment::Output_segment): Un-privatize copy constructor.
9777 (Output_segment::operator=): Un-privatize.
9778 * script-sections.cc (Output_section_element::Input_section_list):
9779 Change element type to Output_section::Simple_input_section.
9780 (Output_section_element_dot_assignment::set_section_addresses):
9781 Register output section data for relaxation clean up.
9782 (Output_data_exression::Output_data_expression): Adjust call to base
9783 constructor to fix data size.
9784 (Output_section_element_data::set_section_addresses): Register
9785 Output_data_expression object for relaxation clean up.
9786 (struct Input_section_info): Replace Relobj pointer and section index
9787 pair with Output_section::Simple_input_section and Convert struct to a
9788 class.
9789 (Input_section_sorter::operator()): Adjust access to
9790 Input_section_info data member to use accessors.
9791 (Output_section_element_input::set_section_addresses): Use layout
9792 parameter. Adjust code to use Output_section::Simple_input_section
9793 and Input_secction_info classes. Register filler for relaxation
9794 clean up.
9795 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9796 and section index pair with Output_section::Simple_input_section
9797 class. Adjust code accordingly.
9798 (Phdrs_element::release_segment): New method definition.
9799 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9800 segment list.
9801 (Script_sections::release_segments): New method definition.
9802 * gold/script-sections.h (Script_sections::release_segments): New
9803 method declaration.
9804 * gold/target.h (Target::may_relax, Target::relax,
9805 Target::do_may_relax, Target::do_relax): New method definitions.
9806
9807 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9808
9809 * arm.cc (has_signed_unsigned_overflow): New function.
9810 (Arm_relocate_functions::abs8): New function.
9811 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9812 (Target_arm::Scan::global): Likewise.
9813 (Target_arm::relocate::relocate): Likewise.
9814 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9815 Likewise.
9816
9817 2009-09-16 Cary Coutant <ccoutant@google.com>
9818
9819 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9820 * testsuite/Makefile.in: Regenerate.
9821
9822 2009-09-11 Nick Clifton <nickc@redhat.com>
9823
9824 * po/gold.pot: Updated by the Translation project.
9825
9826 2009-09-08 Cary Coutant <ccoutant@google.com>
9827
9828 * output.cc (Output_file::open): Add execute permission to empty file.
9829 * testsuite/Makefile.am (permission_test): New test.
9830 * testsuite/Makefile.in: Regenerate.
9831
9832 2009-09-02 Ian Lance Taylor <iant@google.com>
9833
9834 * output.cc (Output_file::resize): Call map_no_anonymous rather
9835 than map.
9836
9837 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9838
9839 * gold.cc: Include "incremental.h".
9840 (queue_initial_tasks): Call Incremental_checker methods.
9841 * incremental.cc: Include "output.h".
9842 (Incremental_checker::can_incrementally_link_output_file): New
9843 method.
9844 * incremental.h (Incremental_checker): New class.
9845
9846 * output.cc (Output_file::open_for_modification): New method.
9847 (Output_file::map_anonymous): Changed return type to bool. Record
9848 map in base_ field.
9849 (Output_file::map_no_anonymous): New method, broken out of map.
9850 (Output_file::map): Use map_no_anonymous and map_anonymous.
9851 * output.h (class Output_file): Update declarations.
9852
9853 2009-08-24 Cary Coutant <ccoutant@google.com>
9854
9855 * options.h (Command_line::Pre_options): New class.
9856 (Command_line::pre_options): New member.
9857 * options.cc (gold::options::ready_to_register): New variable.
9858 (One_option::register_option): Do nothing if not registering options.
9859 Assert if same short option registered twice.
9860 (General_options::General_options): Turn off option registration when
9861 done constructing.
9862 (Command_line::Pre_options::Pre_options): New constructor.
9863
9864 2009-08-24 Cary Coutant <ccoutant@google.com>
9865
9866 * options.h (General_options::no_keep_memory): Remove incorrect
9867 short option.
9868
9869 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9870
9871 * Makefile.am (am__skiplex, am__skipyacc): New.
9872 * Makefile.in: Regenerate.
9873
9874 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9875
9876 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9877 (INCLUDES): ... this.
9878 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9879 (AM_CPPFLAGS): Renamed from ...
9880 (INCLUDE): ... this.
9881 * Makefile.in, testsuite/Makefile.in: Regenerate.
9882
9883 * Makefile.in: Regenerate.
9884 * aclocal.m4: Likewise.
9885 * config.in: Likewise.
9886 * configure: Likewise.
9887 * testsuite/Makefile.in: Likewise.
9888
9889 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9890 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9891 * Makefile.in: Regenerate.
9892 * testsuite/Makefile.in: Regenerate.
9893
9894 2009-08-19 Cary Coutant <ccoutant@google.com>
9895
9896 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9897 symbols in shared libraries overridden by hidden or internal symbols
9898 in the main program.
9899
9900 2009-08-19 Chris Demetriou <cgd@google.com>
9901
9902 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9903 checking source file names in error messages.
9904
9905 2009-08-18 Doug Kwan <dougkwan@google.com>
9906
9907 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9908 an elcpp::Ehdr as parameter. Adjust call to set_target.
9909 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9910 an elfcpp::Ehdr as parameter.
9911 * object.cc (Object::set_target): Remove the version that looks up
9912 a target and sets it.
9913 (Sized_relobj::setup): Take a Target object instead of
9914 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9915 (make_elf_sized_object): Find target and ask target to
9916 make an ELF object.
9917 * object.h: (Object::set_target): Remove the version that looks up
9918 a target and sets it.
9919 (Sized_relobj::setup): Take a Target object instead of
9920 an elfcpp:Ehdr as parameter.
9921 * target.cc: Include dynobj.h.
9922 (Target::do_make_elf_object_implementation): New.
9923 (Target::do_make_elf_object): New.
9924 * target.h (Target::make_elf_object): New template declaration.
9925 (Target::do_make_elf_object): New method declarations.
9926 (Target::do_make_elf_object_implementation): New template declaration.
9927
9928 2009-08-14 Ian Lance Taylor <iant@google.com>
9929
9930 * gold.h (FUNCTION_NAME): Define.
9931 (gold_unreachable): Use FUNCTION_NAME.
9932
9933 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9934
9935 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9936 symbol in the --keep-unique list is not found.
9937
9938 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9939
9940 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9941 been maked as --keep-unique.
9942 (Icf::unfold_section): New function.
9943 * icf.h (Icf::unfold_section): New function.
9944 * options.h (General_options::keep_unique): New option.
9945 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9946 * testsuite/Makefile.in: Regenerate.
9947 * testsuite/icf_keep_unique_test.sh: New file.
9948 * testsuite/icf_keep_unique_test.cc: New file.
9949
9950 2009-08-12 Cary Coutant <ccoutant@google.com>
9951
9952 PR 10471
9953 * resolve.cc (Symbol_table::resolve): Check for references from
9954 dynamic objects to hidden and internal symbols.
9955 * testsuite/Makefile.am (hidden_test.sh): New test.
9956 * testsuite/Makefile.in: Regenerate.
9957 * testsuite/hidden_test.sh: New script.
9958 * testsuite/hidden_test_1.c: New test source.
9959 * testsuite/hidden_test_main.c: New test source.
9960
9961 2009-08-11 Doug Kwan <dougkwan@google.com>
9962
9963 * arm.cc: Update comments.
9964 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9965 segment to locate the .ARM.exidx section if present.
9966
9967 2009-08-09 Doug Kwan <dougkwan@google.com>
9968
9969 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9970 patch.
9971
9972 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9973 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9974 compiler warnings.
9975
9976 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9977
9978 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9979 valid tls_segment only for non-debug-section relocations.
9980 * testsuite/Makefile.am: Add gc_tls_test.
9981 * testsuite/Makefile.in: Regenerate.
9982 * testsuite/gc_tls_test.cc: New file.
9983 * testsuite/gc_tls_test.sh: New file.
9984
9985 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9986
9987 * icf.cc: New file.
9988 * icf.h: New file.
9989 * Makefile.am (CCFILES): Add icf.cc.
9990 (HFILES): Add icf.h
9991 * Makefile.in: Regenerate.
9992 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9993 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9994 section, symbol and addend information for the relocs.
9995 * gold.cc (queue_middle_tasks): Call identical code folding.
9996 * gold.h: Add defines for multimap.
9997 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9998 to the call of finalize_local_symbols.
9999 * main.cc (main): Create object of class Icf.
10000 * object.cc (Sized_relobj::do_layout): Allow this function to be
10001 called twice during icf.
10002 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10003 to sections marked as identical by icf.
10004 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10005 when available.
10006 (Sized_relobj::do_section_entsize): New function.
10007 * object.h (Object::section_entsize): New function.
10008 (Object::do_section_entsize): New pure virtual function.
10009 (Relobj::finalize_local_symbols): Add new parameter.
10010 (Relobj::do_section_entsize): New function.
10011 * options.h (General_options::icf): New option.
10012 (General_options::icf_iterations): New option.
10013 (General_options::print_icf_sections): New option.
10014 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10015 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10016 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10017 icf.
10018 * symtab.cc (Symbol_table::is_section_folded): New function.
10019 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10020 to sections marked as identical by icf.
10021 * symtab.h (Symbol_table::set_icf): New function.
10022 (Symbol_table::icf): New function.
10023 (Symbol_table::is_section_folded): New function.
10024 (Symbol_table::icf_): New data member.
10025 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10026 * testsuite/Makefile.am: Add commands to build icf_test.
10027 * testsuite/Makefile.in: Regenerate.
10028 * testsuite/icf_test.sh: New file.
10029 * testsuite/icf_test.cc: New file.
10030
10031 2009-07-24 Chris Demetriou <cgd@google.com>
10032
10033 * layout.cc (is_compressible_debug_section): Fix incorrect
10034 comment about compressed section names.
10035
10036 2009-07-20 Ian Lance Taylor <ian@airs.com>
10037
10038 PR 10419
10039 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10040
10041 2009-07-16 Ian Lance Taylor <iant@google.com>
10042
10043 PR 10400
10044 * layout.h: #include <map>.
10045 (class Kept_section): Change from struct to class. Add accessors
10046 and setters. Add section size to Comdat_group mapping. Change
10047 Comdat_group to std::map. Add is_comdat_ field. Add
10048 linkonce_size field in union.
10049 (class Layout): Update declaration of find_or_add_kept_section.
10050 Don't declare find_kept_object.
10051 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10052 parameter. Add object, shndx, is_comdat, and is_group_name
10053 parameters. Change all callers. Adjust for new Kept_section.
10054 (Layout::find_kept_object): Remove.
10055 * object.cc (Sized_relobj::include_section_group): Update use of
10056 Kept_section. Rename secnum to shndx. Only record
10057 Kept_comdat_section if sections are the same size.
10058 (Sized_relobj::include_linkonce_section): Update use of
10059 Kept_section. Only record Kept_comdat_section if sections are the
10060 same size. Set size of linkonce section.
10061 (Sized_relobj::map_to_kept_section): Update call to
10062 get_kept_comdat_section.
10063 * object.h (class Sized_relobj): Rename fields in
10064 Kept_comdat_section to drop trailing underscores; change object
10065 field to Relobj*. Change Kept_comdat_section_table to store
10066 struct rather than pointer.
10067 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10068 Add kept_object and kept_shndx parameters. Change all callers.
10069 (Sized_relobj::get_kept_comdat_section): Change return type to
10070 bool. Add kept_object and kept_shndx parameters. Change all
10071 callers.
10072 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10073 Layout::find_or_add_kept_section.
10074
10075 2009-07-09 Ian Lance Taylor <iant@google.com>
10076
10077 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10078 Reserve space in the hash table.
10079
10080 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10081
10082 * fileread.cc (File_read::get_mtime): New method.
10083 * fileread.h (Timespec): New structure.
10084 (File_read::get_mtime): New method.
10085 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10086 Renamed from timestamp_nsec.
10087 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10088 Elf_Xword.
10089 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
10090 timestamp_nsec.
10091 (Incremental_inputs::report_archive): Save mtime; style fix.
10092 (Incremental_inputs::report_obejct): Save mtime; style fix.
10093 (Incremental_inputs::report_script): Save mtime; style fix.
10094 (Incremental_inputs::finalize_inputs): Style fix.
10095 (Incremental_inputs::finalize): Style fix.
10096 (Incremental_inputs::create_input_section_data): Store inputs
10097 mtime.
10098 * incremental.h (Incremental_inputs::report_script): Add mtime
10099 argument.
10100 (Incremental_inputs::Input_info::Input_info): Intialize only one
10101 union member.
10102 (Incremental_inputs::Input_info::archive): Move to nameless
10103 union.
10104 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10105 (Incremental_inputs::Input_info::script): Move to nameless union.
10106 (Incremental_inputs::mtime): New field.
10107 * script.cc (read_input_script): Pass file mtime to
10108 Incremental_input.
10109 * script.h (Script_info::inputs): Style fix.
10110
10111 2009-07-01 Ian Lance Taylor <ian@airs.com>
10112
10113 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10114 instead of 32.
10115
10116 2009-06-24 Ian Lance Taylor <iant@google.com>
10117
10118 PR 10156
10119 * layout.cc (Layout::choose_output_section): If we find an
10120 existing section, update the flags.
10121 (Layout::create_notes): New function, broken out of
10122 Layout::finalize.
10123 (Layout::finalize): Don't create note sections.
10124 (Layout::create_note): Don't crash if linker script discards
10125 section.
10126 (Layout::create_gold_note): Likewise.
10127 (Layout::create_build_id): Likewise. Don't set
10128 after_input_sections on the section.
10129 (Layout::create_executable_stack_info): Remove target parameter.
10130 Change caller.
10131 * layout.h (class Layout): Declare create_notes. Update
10132 declaration of create_executable_stack_info.
10133 * gold.cc (queue_middle_tasks): Call create_notes.
10134 * output.cc (Output_section::update_flags_for_input_section): Move
10135 here from output.h. If SHF_ALLOC flag is newly set, mark address
10136 invalid.
10137 * output.h (Output_data::mark_address_invalid): New function.
10138 (class Output_section): Only declare, not define,
10139 update_flags_for_input_section. Remove set_flags.
10140
10141 2009-06-24 Ian Lance Taylor <iant@google.com>
10142
10143 * script-sections.cc (Output_section_definition::
10144 set_section_addresses): Rename shadowing local load_address to
10145 laddr.
10146
10147 2009-06-24 Ian Lance Taylor <iant@google.com>
10148
10149 PR 10244
10150 * reloc.cc (relocate_sections): Skip empty relocation sections.
10151
10152 2009-06-23 Ian Lance Taylor <iant@google.com>
10153
10154 PR 10156
10155 * layout.cc (Layout::create_note): Use choose_output_section
10156 rather than make_output_section.
10157
10158 2009-06-23 Ian Lance Taylor <iant@google.com>
10159
10160 PR 10237
10161 * options.cc (General_options::parse_V): Set printed_version_.
10162 (General_options::General_options): Initialize printed_version_.
10163 * options.h (class General_options): Add printed_version_ field.
10164 * gold.cc (queue_initial_tasks): If there are no input files,
10165 don't give a fatal error if we printed the version information.
10166 (queue_middle_tasks): If using -r with a shared object, give a
10167 fatal error rather than an ordinary error.
10168
10169 2009-06-23 Ian Lance Taylor <iant@google.com>
10170
10171 PR 10219
10172 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10173 (Layout::make_output_section): Set have_stabstr_section_ if we see
10174 a .stab*str section.
10175 (Layout::finalize): Call link_stabs_sections.
10176 (Layout::link_stabs_sections): New file.
10177 * layout.h (class Layout): Add have_stabstr_section_ field.
10178 Declare link_stabs_sections.
10179
10180 2009-06-23 Doug Kwan <dougkwan@google.com>
10181
10182 * Makefile.am (libgold_a_LIBADD): New.
10183 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
10184 * Makefile.in: Regenerate.
10185 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10186 * configure: Regenerate.
10187 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10188 * fileread.cc: Include sys/state.h
10189 * gold.h: Declare memmem and strndup if found missing.
10190 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10191
10192 2009-06-23 Ian Lance Taylor <iant@google.com>
10193
10194 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10195 * configure: Rebuild.
10196
10197 2009-06-23 Ian Lance Taylor <iant@google.com>
10198
10199 PR 10147
10200 * object.cc (Object::section_contents): Don't try to get a view if
10201 the section has length zero.
10202 (Object::handle_gnu_warning_section): If the section is empty, use
10203 the name of the section as the warning.
10204
10205 2009-06-23 Ian Lance Taylor <iant@google.com>
10206
10207 PR 10133
10208 * stringpool.h (class Stringpool_template): Add optimize_ field.
10209 (Stringpool_template::set_optimize): New function.
10210 * stringpool.cc (Stringpool_template::Stringpool_template):
10211 Initialize optimize_ field.
10212 (Stringpool_template::set_string_offsets): Test local optimize
10213 fild rather than parameter.
10214 * layout.cc (Layout::Layout): Call set_optimize on the section
10215 name stringpool.
10216
10217 2009-06-22 Ian Lance Taylor <iant@google.com>
10218
10219 PR 10030
10220 * yyscript.y: Parse TARGET.
10221 * script.cc (script_set_target): New function.
10222 * script-c.h (script_set_target): Declare.
10223 * options.cc (General_options::string_to_object_format): Rename
10224 from string_to_object_format in anonymous namespace. Change
10225 callers.
10226 * options.h (class General_options): Declare
10227 string_to_object_format.
10228
10229 2009-06-22 Ian Lance Taylor <iant@google.com>
10230
10231 * script-sections.cc (Script_sections::create_segments): Don't put
10232 program headers in a PT_LOAD segment if -n or -N.
10233
10234 2009-06-22 Ian Lance Taylor <iant@google.com>
10235
10236 PR 10141
10237 * options.h (class General_options): Add -z lazy and -z now. Sort
10238 -z options into alphabetical order.
10239 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10240
10241 2009-06-21 Ian Lance Taylor <iant@google.com>
10242
10243 * layout.cc (Layout::make_output_section): Call
10244 Target::new_output_section.
10245 (Layout::attach_allocated_section_to_segment): Put large section
10246 sections in a separate load segment with the large segment flag
10247 set.
10248 (Layout::segment_precedes): Sort large data segments after other
10249 load segments.
10250 (align_file_offset): New static function.
10251 (Layout::set_segment_offsets): Use align_file_offset.
10252 * output.h (class Output_section): Add is_small_section_ and
10253 is_large_section_ fields.
10254 (Output_section::is_small_section): New function.
10255 (Output_section::set_is_small_section): New function.
10256 (Output_section::is_large_section): New function.
10257 (Output_section::set_is_large_section): New function.
10258 (Output_section::is_large_data_section): New function.
10259 (class Output_segment): Add is_large_data_segment_ field.
10260 (Output_segment::is_large_data_segment): New function.
10261 (Output_segment::set_is_large_data_segment): New function.
10262 * output.cc (Output_section::Output_section): Initialize new
10263 fields.
10264 (Output_segment::Output_segment): Likewise.
10265 (Output_segment::add_output_section): Add assertion that large
10266 data sections always go in large data segments. Force small data
10267 sections to the end of the list of data sections. Force small BSS
10268 sections to the start of the list of BSS sections. For large BSS
10269 sections to the end of the list of BSS sections.
10270 * symtab.h (class Symbol): Declare is_common_shndx.
10271 (Symbol::is_defined): Check Symbol::is_common_shndx.
10272 (Symbol::is_common): Likewise.
10273 (class Symbol_table): Define enum Commons_section_type. Update
10274 declarations. Add small_commons_ and large_commons_ fields.
10275 * symtab.cc (Symbol::is_common_shndx): New function.
10276 (Symbol_table::Symbol_table): Initialize new fields.
10277 (Symbol_table::add_from_object): Put small and large common
10278 symbols in the right list.
10279 (Symbol_table::sized_finalized_symbol): Check
10280 Symbol::is_common_shndx.
10281 (Symbol_table::sized_write_globals): Likewise.
10282 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10283 common symbol lists. Don't call do_allocate_commons_list if the
10284 list is empty.
10285 (Symbol_table::do_allocate_commons_list): Remove is_tls
10286 parameter. Add comons_section_type parameter. Change all
10287 callers. Handle small and large common symbols.
10288 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10289 Symbol::is_common_shndx.
10290 * resolve.cc (symbol_to_bits): Likewise.
10291 * target.h (Target::small_common_shndx): New function.
10292 (Target::small_common_section_flags): New function.
10293 (Target::large_common_shndx): New function.
10294 (Target::large_common_section_flags): New function.
10295 (Target::new_output_section): New function.
10296 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10297 small_common_section_flags, and large_common_section_flags
10298 fields.
10299 (Target::do_new_output_section): New virtual function.
10300 * arm.cc (Target_arm::arm_info): Initialize new fields.
10301 * i386.cc (Target_i386::i386_info): Likewise.
10302 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10303 Likewise.
10304 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10305 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10306 (Target_x86_64::do_new_output_section): New function.
10307 * configure.ac: Define conditional MCMODEL_MEDIUM.
10308 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10309 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10310 (large_LDFLAGS): Define.
10311 * testsuite/large.c: New file.
10312 * testsuite/testfile.cc (Target_test::test_target_info):
10313 Initialize new fields.
10314 * configure, testsuite/Makefile.in: Rebuild.
10315
10316 2009-06-05 Doug Kwan <dougkwan@google.com>
10317
10318 * Makefile.am (CCFILES): Add target.cc.
10319 * Makefile.in: Regenerate.
10320 * i386.cc (class Target_i386): Define new virtual method to
10321 override do_is_local_label_name in parent.
10322 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10323 local symbols if --discard-locals or -X is given.
10324 * options.h (class General_options): Declare new options
10325 '--discard-locals' and '-X' for discarding locals.
10326 * target.h (class Target): Define new methods is_local_label_name.
10327 Declare new virtual method do_is_local_label_name.
10328 * target.cc: New file.
10329 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10330 (check_SCRIPTS): Add discard_locals_test.sh.
10331 (check_DATA): Add discard_local_tests.syms.
10332 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10333 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10334 * testsuite/Makefile.in: Regenerate.
10335 * testsuite/discard_locals_test.c: New file.
10336 * testsuite/discard_locals_test.sh: Same.
10337
10338 2009-06-05 Doug Kwan <dougkwan@google.com>
10339
10340 * object.cc (Sized_relobj::Sized_relobj): Initialize
10341 discarded_eh_frame_shndx_ to -1U.
10342 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10343 section.
10344 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10345 a discarded .eh_frame section.
10346 (Sized_relobj::do_finalize_local_symbols): Ditto.
10347 * object.h (class Sized_relobj): Declare new member
10348 discarded_eh_frame_shndx_.
10349 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10350 (local_labels_test.o, local_labels_test): New rules.
10351 * testsuite/Makefile.in: Regenerate.
10352
10353 2009-06-04 Doug Kwan <dougkwan@google.com>
10354
10355 * layout.cc (Layout::section_name_mapping): Add mapping for
10356 special ARM sections.
10357
10358 2009-06-03 Doug Kwan <dougkwan@google.com>
10359
10360 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10361 (utils::has_overflow): Same.
10362
10363 2009-06-03 Ian Lance Taylor <iant@google.com>
10364
10365 * layout.cc (Layout::section_name_mapping): New array, replacing
10366 Layout::linkonce_mapping.
10367 (Layout::section_name_mapping_count): New variable, replacing
10368 Layout::linkonce_mapping_count.
10369 (Layout::linkonce_output_name): Remove.
10370 (Layout::output_section_name): Rewrite.
10371 * layout.h (class Layout): Rename Linkonce_mapping to
10372 Section_name_mapping, linkonce_mapping to section_name_mapping,
10373 linkonce_mapping_count to section_name_mapping_count. Don't
10374 declare linkonce_output_name.
10375
10376 2009-06-03 Doug Kwan <dougkwan@google.com>
10377
10378 * gold/arm.cc (namespace utils): New.
10379 (Target_arm::reloc_is_non_pic): Define new method.
10380 (class Arm_relocate_functions): New.
10381 (Target_arm::Relocate::relocate): Handle relocation types used by
10382 Android.
10383
10384 2009-06-03 Ian Lance Taylor <iant@google.com>
10385
10386 * arm.cc (Target_arm::scan::global): Use || instead of |.
10387
10388 2009-06-02 Doug Kwan <dougkwan@google.com>
10389
10390 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10391 issued_non_pic_error_.
10392 (class Target_arm::Scan): Declare new method check_non_pic.
10393 Define new method symbol_needs_plt_entry.
10394 Declare new data member issued_non_pic_error_.
10395 (class Target_arm::Relocate): Declare new method
10396 should_apply_static_reloc.
10397 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10398 (Target_arm::Scan::check_non_pic): Define new method.
10399 (Target_arm::Scan::local): Handle a small subset of reloc types used
10400 by Android.
10401 (Target_arm::Scan::local): Same.
10402 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10403
10404 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10405
10406 * incremental.cc (Incremental_inputs::report_command_line): Filter
10407 out --incremental-* options.
10408
10409 2009-05-29 Doug Kwan <dougkwan@google.com>
10410
10411 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10412 template class.
10413 (class Target_arm): Update comment.
10414 (Target_arm::Target_arm): Initialize new data members GOT_,
10415 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10416 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10417 and Target_arm::rel_dyn_section.
10418 Declare new_enum Target_arm::Got_type.
10419 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10420 and DYNBSS_.
10421 Update commments for member do_dynsym_value.
10422 (Target_arm::got_size, Target_arm::plt_section,
10423 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10424 new methods inside class defintion.
10425 (Target_arm::got_section): Define new method.
10426 (Target_arm::rel_dyn_section): Same.
10427 (Output_data_plt_arm): New template class.
10428 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10429 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10430 (Output_data_plt_arm::add_entry): Same.
10431 (Output_data_plt_arm::first_plt_entry): Define new
10432 static data member for PLT instruction template.
10433 (Output_data_plt_arm::plt_entry): Same.
10434 (Output_data_plt_arm::do_write): Define new method.
10435 (Target_arm::make_plt_entry): Same.
10436 (Target_arm::do_finalize_sections): Same.
10437 (Target_arm::do_dynsym_value): Same.
10438
10439 2009-05-28 Doug Kwan <dougkwan@google.com>
10440
10441 * Makefile.am (TARGETSOURCES): Add arm.cc.
10442 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10443 * Makefile.in: Regenerate.
10444 * arm.cc: New file.
10445 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10446
10447 2009-05-26 Doug Kwan <dougkwan@google.com>
10448
10449 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10450 (General_options::check_excluded_libs): Strip off directories in
10451 archive name before matching like GNU ld does.
10452 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10453 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10454 (exclude_libs_test_LDFLAGS): Add linker option
10455 -Wl,--exclude-libs,libexclude_libs_test_3
10456 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10457 an explicit archive without using -l.
10458 (alt/libexclude_libs_test_3.a): New make rule.
10459 * testsuite/Makefile.in: Regenerate.
10460 * testsuite/exclude_libs_test.c : Declare lib3_default().
10461 (main): Call it.
10462 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10463 * exclude_libs_test_3.c: New file.
10464
10465 2009-05-26 Nick Clifton <nickc@redhat.com>
10466
10467 * po/id.po: New Indonesian translation.
10468 * po/gold.pot: Updated template file.
10469
10470 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10471
10472 * testsuite/Makefile.am: Add -ffunction-sections to compile
10473 gc_comdat_test files. Add -Wl,--gc-sections to build
10474 gc_comdat_test.
10475 * testsuite/Makefile.in: Regenerate.
10476 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10477
10478 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10479
10480 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10481 kept comdat section was garbage collected.
10482 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10483 * testsuite/Makefile.in: Regenerate.
10484 * testsuite/gc_comdat_test.sh: New file.
10485 * testsuite/gc_comdat_test_1.cc: New file.
10486 * testsuite/gc_comdat_test_2.cc: New file.
10487
10488 2009-05-19 Doug Kwan <dougkwan@google.com>
10489
10490 * archive.cc (Archive::Archive): Move constructor from archive.h
10491 to here. Initialize no_export_.
10492 (Archive::get_elf_object_for_member): Set no_export flag of object.
10493 * archive.h (Archive::Archive): Move constructor body to
10494 archive.cc.
10495 (Archive::no_export): New method.
10496 (Archive::no_export_): New field.
10497 * object.h (Object::Object): Initialize no_export_ to false.
10498 (Object::no_export, Object::set_no_export): New methods.
10499 (Object::no_export_): New field.
10500 * options.cc (General_options::parse_exclude_libs): New method.
10501 (General_options::check_excluded_libs) Same.
10502 * options.h (exclude_libs): New option.
10503 (General_options::check_excluded_libs): New method declaration.
10504 (General_options::excluded_libs_): New field.
10505 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10506 default or protected visibility if an object has no-export flag set.
10507 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10508 (check_SCRIPTS): Add exclude_libs_test.sh.
10509 (check_DATA): Add exclude_libs_test.syms.
10510 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10511 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10512 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10513 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10514 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10515 libexclude_libs_test_2.a): New rules.
10516 * testsuite/Makefile.in: Regenerate.
10517 * testsuite/exclude_libs_test.c: New file.
10518 * testsuite/exclude_libs_test.sh: Ditto.
10519 * testsuite/exclude_libs_test_1.c: Ditto.
10520 * testsuite/exclude_libs_test_2.c: Ditto.
10521
10522 2009-05-15 Ian Lance Taylor <iant@google.com>
10523
10524 * configure.ac: Check for declarations for cases where libiberty.h
10525 checks HAVE_DECL_xxx.
10526 * configure, config.in: Rebuild.
10527
10528 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10529
10530 * gold.h (Incremental_argument_list): Remove (invalid) forward
10531 declaration.
10532 * incremental.cc (Incremental_inputs::report_achive): New method.
10533 (Incremental_inputs::report_object): New method.
10534 (Incremental_inputs::report_script): New method.
10535 (Incremental_inputs::finalize_inputs): New method.
10536 (Incremental_inputs::finalize): Call finalize_inputs().
10537 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10538 Create inputs entries.
10539 * incremental.h (Incremental_input_type): New enum.
10540 (Incremental_inputs::Incremental_input): Initialize new fields.
10541 (Incremental_inputs::report_inputs): New method.
10542 (Incremental_inputs::report_achive): New method.
10543 (Incremental_inputs::report_object): New method.
10544 (Incremental_inputs::report_script): New method.
10545 (Incremental_inputs::finalize_inputs): New method.
10546 (Incremental_inputs::Input_info): New struct.
10547 (Incremental_inputs::Input_info_map): New typedef.
10548 (Incremental_inputs::lock_): New field.
10549 (Incremental_inputs::Inputs_): New field.
10550 (Incremental_inputs::Inputs_map): New field.
10551 * main.cc (main): Call Incremental_input::report_inputs.
10552 * options.h (Input_argument_list): Typedef moved from
10553 Input_arguments.
10554 (Input_file_group::Files): Remove, use ::Input_argument_list.
10555 (Input_file_group::Input_argument_list): Remove, use
10556 ::Input_argument_list.
10557 * plugin.cc (Plugin_manager::add_input_file): Add error in
10558 incremental build.
10559 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10560 functions.
10561 * script.cc (read_input_script): Call
10562 Incremental_input::report_script.
10563 * script.h (Script_info): New class.
10564
10565 2009-04-27 Ian Lance Taylor <iant@google.com>
10566
10567 * x86_64.cc (do_adjust_output_section): Set entsize to
10568 plt_entry_size.
10569
10570 2009-04-23 Elliott Hughes <enh@google.com>
10571
10572 * output.cc (Output_file::close): After short writes, continue
10573 writing from the correct offset in the buffer being written.
10574
10575 2009-04-23 Chris Demetriou <cgd@google.com>
10576
10577 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10578 * configure: Regenerate.
10579 * config.in: Regenerate.
10580 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10581 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10582
10583 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10584
10585 * incremental.cc (Incremental_inputs_header_data): Renamed from
10586 Incremental_input_header_data.
10587 (Incremental_inputs_header_data::data_size): New field.
10588 (Incremental_inputs_header_data::put_input_file_count): Renamed
10589 from input_file_count.
10590 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10591 from command_line_offset.
10592 (Incremental_inputs_header_data::put_reserved): Renamed from
10593 put_reserved.
10594 (Incremental_inputs_entry_data): Renamed from
10595 Incremental_input_entry_data.
10596 (Incremental_inputs_entry_data::data_size): New field.
10597 (Incremental_inputs::report_command_line): New method.
10598 (Incremental_inputs::finalize): New method.
10599 (Incremental_inputs::create_incremental_inputs_data): New method.
10600 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10601 * incremental.h: New file.
10602 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10603 (Layout::finalize): Create incremental inputs section in
10604 incremental builds.
10605 (Layout::create_incremental_info_sections): New method.
10606 * layout.h (Layout::incremental_inputs): New method.
10607 (Layout::create_incremental_info_sections): New method.
10608 (Layout::incremental_inputs_): New field.
10609 * main.cc (main): Notify Incremental_input of the command line.
10610
10611 2009-04-01 Ian Lance Taylor <iant@google.com>
10612 Mikolaj Zalewski <mikolajz@google.com>
10613
10614 * gold.h (reserve_unordered_map): Define, three versions, one for
10615 each version of Unordered_map.
10616 * layout.cc (Layout::Layout): Remove options parameter. Add
10617 number_of_input_files parameter. Don't initialize options_.
10618 Initialize number_of_input_files_ and resized_signatures_. Move
10619 sections_are_attached_.
10620 (Layout::layout_group): Reserve space for group_signatures_.
10621 (Layout::find_or_add_kept_section): Change name parameter to be a
10622 reference. Resize signatures_ map when it gets large enough.
10623 (Layout::layout_eh_frame): Use parameters->options() instead of
10624 this->options_.
10625 (Layout::make_output_section): Likewise.
10626 (Layout::attach_allocated_section_to_segment): Likewise.
10627 (Layout::finalize, Layout::create_executable_stack): Likewise.
10628 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10629 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10630 * layout.h (class Layout): Update declarations. Remove options_
10631 field. Add number_of_input_files_ and resized_signatures_
10632 fields. Move sections_are_attached_ field.
10633 * main.cc (main): Pass number of input files to Layout
10634 constructor. Don't pass options.
10635
10636 2009-03-30 Ian Lance Taylor <iant@google.com>
10637
10638 * ffsll.c (ffsll): Correct implementation.
10639
10640 2009-03-27 Ian Lance Taylor <iant@google.com>
10641
10642 * ffsll.c: New file.
10643 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10644 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10645 * ftruncate.c (ftruncate): Declare before definition.
10646 * mremap.c (mremap): Likewise.
10647 * pread.c (pread): Likewise.
10648 * configure, Makefile.in, config.in: Rebuild.
10649
10650 * mremap.c: New file.
10651 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10652 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10653 (mremap): Declare if HAVE_MREMAP is not defined.
10654 * configure, Makefile.in, config.in: Rebuild.
10655
10656 2009-03-27 Cary Coutant <ccoutant@google.com>
10657
10658 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10659 position independent.
10660 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10661 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10662
10663 2009-03-24 Cary Coutant <ccoutant@google.com>
10664
10665 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10666 an executable.
10667 (needs_dynamic_reloc): Likewise.
10668
10669 2009-03-24 Ian Lance Taylor <iant@google.com>
10670
10671 * yyscript.y (file_cmd): Recognize EXTERN.
10672 (extern_name_list, extern_name_list_body): New nonterminals.
10673 * script.cc (script_add_extern): Define.
10674 * script-c.h (script_add_extern): Declare.
10675
10676 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10677
10678 * object.cc (is_elf_object): Define.
10679 * object.h (is_elf_object): Declare.
10680 * archive.cc (Archive::get_elf_object_for_member): Call
10681 is_elf_object.
10682 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10683
10684 2009-03-24 Elliott Hughes <enh@google.com>
10685
10686 * output.cc (Output_file::map_anonymous): Define.
10687 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10688 try an anonymous one. Report the size if the mmap fails.
10689 * output.h (class Output_file): Declare map_anonymous.
10690
10691 2009-03-24 Ian Lance Taylor <iant@google.com>
10692
10693 * target-select.cc (instantiate_target): Don't acquire the lock if
10694 the instantiated_target_ field has already been set.
10695
10696 2009-03-23 Ian Lance Taylor <iant@google.com>
10697
10698 * gold-threads.h (class Initialize_lock): Define.
10699 * gold-threads.cc (class Initialize_lock_once): Define.
10700 (initialize_lock_control): New static variable.
10701 (initialize_lock_pointer): New static variable.
10702 (initialize_lock_once): New static function.
10703 (Initialize_lock::Initialize_lock): Define.
10704 (Initialize_lock::initialize): Define.
10705 * target-select.h: Include "gold-threads.h".
10706 (class Target_selector): Add lock_ and initialize_lock_ fields.
10707 Don't define instantiate_target, just declare it.
10708 * target-select.cc (Target_selector::Target_selector): Initialize
10709 new fields.
10710 (Target_selector::instantiate_target): Define.
10711 * descriptors.h: Include "gold-threads.h".
10712 (class Descriptors): Add initialize_lock_ field.
10713 * descriptors.cc (Descriptors::Descriptors): Initialize new
10714 field.
10715 (Descriptors::open): Use initialize_lock_ field
10716 * errors.h (class Errors): Add initialize_lock_ field.
10717 * errors.cc (Errors::Errors): Initialize new field.
10718 (Errors::initialize_lock): Use initialize_lock_ field.
10719 * powerpc.cc (class Target_selector_powerpc): Remove
10720 instantiated_target_ field. In do_recognize call
10721 instantiate_target rather than do_instantiate_target. In
10722 do_instantiate_target just allocate a new target.
10723 * sparc.cc (class Target_selector_sparc): Likewise.
10724
10725 * freebsd.h: New file.
10726 * i386.cc: Include "freebsd.h".
10727 (Target_i386): Derive from Target_freebsd rather than
10728 Sized_target.
10729 (Target_selector_i386): Derive from Target_selector_freebsd rather
10730 than Target_selector.
10731 * x86_64.cc: Include "freebsd.h".
10732 (Target_x86_64): Derive from Target_freebsd rather than
10733 Sized_target.
10734 (Target_selector_x86_64): Derive from Target_selector_freebsd
10735 rather than Target_selector.
10736 * target.h (class Target): Add adjust_elf_header and
10737 do_adjust_elf_header.
10738 * output.cc (Output_file_header:: do_sized_write): Call target
10739 adjust_elf_header routine.
10740 * configure.tgt: Set targ_osabi.
10741 * configure.ac: Define GOLD_DEFAULT_OSABI.
10742 * parameters.cc (Parameters::default_target): Pass
10743 GOLD_DEFAULT_OSABI to select_target.
10744 * target-select.h (class Target_selector): Make instantiate_target
10745 protected rather than private.
10746 * Makefile.am (HFILES): Add freebsd.h.
10747 * configure, Makefile.in, config.in: Rebuild.
10748
10749 * merge.cc (do_add_input_section): Correct pend value. Change
10750 message about last entry not being null terminated from error to
10751 warning.
10752
10753 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10754
10755 * incremental.cc: New file.
10756 * Makefile.am (CCFILES): Add incremental.cc.
10757 * Makefile.in: Rebuild.
10758
10759 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10760
10761 * layout.cc (Layout::output_section_name): Preserve names
10762 of '.note.' sections.
10763
10764 2009-03-19 Ian Lance Taylor <iant@google.com>
10765
10766 * descriptors.cc (Descriptors::open): Check that the options are
10767 valid before using them.
10768
10769 2009-03-18 Ian Lance Taylor <iant@google.com>
10770
10771 * script-sections.h: Include <list>.
10772 (class Script_sections): Change Sections_elements from std::vector
10773 to std::list. Typedef public Elements_iterator. Add
10774 orphan_section_placement_, data_segment_align_start_, and
10775 saw_data_segment_align_ fields. Remove data_segment_align_index_
10776 field.
10777 * script-sections.cc (class Orphan_section_placement): New class.
10778 (class Sections_element): Add virtual functions is_relro and
10779 orphan_section_init. Remove virtual function place_orphan_here.
10780 (class Output_section_definition): Add is_relro and
10781 orphan_section_init. Remove place_orphan_here.
10782 (class Orphan_output_section): Likewise.
10783 (Script_sections::Script_sections): Update for field changes.
10784 (Script_sections::data_segment_align): Set saw_data_segment_align_
10785 and data_segment_align_start_, not data_segment_align_index.
10786 (Script_sections::data_segment_relro_end): Check
10787 saw_data_segment_align_. Use data_segment_align_start_ rather
10788 than data_segment_align_index_.
10789 (Script_sections::place_orphan): Rewrite to use
10790 Orphan_section_placement.
10791
10792 2009-03-17 Ian Lance Taylor <iant@google.com>
10793
10794 * archive.cc (Archive::add_symbols): Check for a version attached
10795 to the symbol name in the archive map.
10796 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10797 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10798 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10799 (ver_test_11.a): New target.
10800 * testsuite/Makefile.in: Rebuild.
10801
10802 * configure.ac: Check for chsize and posix_fallocate. Replace
10803 ftruncate.
10804 * ftruncate.c: New file, from gnulib.
10805 * output.cc (posix_fallocate): Define dummy version if not
10806 HAVE_POSIX_FALLOCATE.
10807 (Output_file::map): Call posix_fallocate rather than lseek and
10808 write.
10809 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10810 * configure, Makefile.in, config.in: Rebuild.
10811
10812 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10813
10814 * layout.h (Layout::create_note): Add section_name parameter.
10815 * layout.cc (Layout::create_note): Likewise.
10816 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10817
10818 2009-03-17 Ian Lance Taylor <iant@google.com>
10819
10820 * descriptors.cc: Include "options.h".
10821 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10822 (Descriptors::open): Always use O_CLOEXEC when opening a new
10823 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10824 then set FD_CLOEXEC.
10825
10826 * sparc.cc (class Target_sparc): Add has_got_section.
10827 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10828 make sure we have a GOT section.
10829
10830 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10831 (Target_sparc::Scan::local): Likewise.
10832 (Target_sparc::Scan::global): Likewise.
10833 (Target_sparc::Relocate::relocate): Likewise.
10834 (Target_sparc::Relocate::relocate_tls): Likewise.
10835
10836 * symtab.cc (Symbol_table::define_default_version): New function,
10837 broken out of add_from_object.
10838 (Symbol_table::add_from_object): Call define_default_version.
10839 (Symbol_table::define_special_symbol): Add resolve_oldsym
10840 parameter. Change all callers. If the version for a symbol comes
10841 from a version script, resolve it with the symbol with the same
10842 name with no version. Also add the symbol without a version if
10843 appropriate.
10844 (do_define_in_output_data): If resolving with oldsym, don't delete
10845 sym.
10846 (do_define_in_output_segment): Likewise.
10847 (do_define_as_constant): Likewise.
10848 * symtab.h (class Symbol_table): Update declarations.
10849
10850 2009-03-13 Ian Lance Taylor <iant@google.com>
10851
10852 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10853 (Read_symbols::requeue): New function.
10854 (Read_symbols::do_read_symbols): If make_elf_object fails because
10855 the target type is not configured, and the file was searched for,
10856 issue a warning and retry with the next directory.
10857 (Add_symbols::run): If the file has an incompatible format, and
10858 it was searched for, requeue the Read_symbols task. On error,
10859 release the object.
10860 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10861 dirindex parameter to constructor. Change all callers. Declare
10862 incompatible_warning and requeue.
10863 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10864 input_argument_ and input_group_ fields. Add them to
10865 constructor. Change all callers.
10866 (class Read_script): Add dirindex_ field. Add it to constructor.
10867 Change all callers.
10868 * archive.cc (Archive::setup): Remove input_objects parameter.
10869 Change all callers.
10870 (Archive::get_file_and_offset): Likewise.
10871 (Archive::read_all_symbols): Likewise.
10872 (Archive::read_symbols): Likewise.
10873 (Archive::get_elf_object_for_member): Remove input_objects
10874 parameter. Add punconfigured parameter. Change all callers.
10875 (Archive::add_symbols): Change return type to bool. Check return
10876 value of include_member.
10877 (Archive::include_all_members): Likewise.
10878 (Archive::include_member): Change return type to bool. Return
10879 false if first included object has incompatible target. Set
10880 included_member_ field.
10881 (Add_archive_symbols::run): If add_symbols returns false, requeue
10882 Read_symbols task.
10883 * archive.h (class Archive): Add included_member_ field.
10884 Initialize it in constructor. Add input_file and searched_for
10885 methods. Update declarations.
10886 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10887 input_argument_ fields. Add them to constructor. Change all
10888 callers.
10889 * script.cc: Include "target-select.h".
10890 (class Parser_closure): Add skip_on_incompatible_target_ and
10891 found_incompatible_target_ fields. Add
10892 skip_on_incompatible_target parameter to constructor. Change all
10893 callers. Add methods skip_on_incompatible_target,
10894 clear_skip_on_incompatible_target, found_incompatible_target, and
10895 set_found_incompatible_target.
10896 (read_input_script): Add dirindex parameter. Change all callers.
10897 If parser finds an incompatible target, requeue Read_symbols
10898 task.
10899 (script_set_symbol): Clear skip_on_incompatible_target in
10900 closure.
10901 (script_add_assertion, script_parse_option): Likewise.
10902 (script_start_sections, script_add_phdr): Likewise.
10903 (script_check_output_format): New function.
10904 * script.h (read_input_script): Update declaration.
10905 * script-c.h (script_check_output_format): Declare.
10906 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10907 (ignore_cmd): Remove OUTPUT_FORMAT.
10908 * fileread.cc (Input_file::Input_file): Add explicit this.
10909 (Input_file::will_search_for): New function.
10910 (Input_file::open): Add pindex parameter. Change all callers.
10911 * fileread.h (class Input_file): Add input_file_argument method.
10912 Declare will_search_for. Update declarations.
10913 * object.cc (make_elf_object): Add punconfigured parameter.
10914 Change all callers.
10915 * object.h (class Object): Make input_file public. Add
10916 searched_for method.
10917 (make_elf_object): Update declaration.
10918 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10919 restart search.
10920 * dirsearch.h (class Dirsearch): Update declaration.
10921 * options.h (class General_options): Add --warn-search-mismatch.
10922 * parameters.cc (Parameters::is_compatible_target): New function.
10923 * parameters.h (class Parameters): Declare is_compatible_target.
10924 * workqueue.cc (Workqueue::add_blocker): New function.
10925 * workqueue.h (class Workqueue): Declare add_blocker.
10926
10927 * fileread.cc (Input_file::open): Remove options parameter.
10928 Change all callers.
10929 (Input_file::open_binary): Likewise.
10930 * script.cc (read_input_script): Likewise.
10931 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10932 options parameter from constructor. Change all callers.
10933 (class Read_script): Likewise.
10934 * fileread.h (class Input_file): Update declarations.
10935 * script.h (read_input_script): Update declaration.
10936
10937 2009-03-10 Nick Clifton <nickc@redhat.com>
10938
10939 * po/es.po: New Spanish translation.
10940
10941 2009-03-06 Cary Coutant <ccoutant@google.com>
10942
10943 * options.cc (parse_short_option): Keep dash_z from registering itself.
10944
10945 2009-03-03 Ian Lance Taylor <iant@google.com>
10946
10947 PR 9918
10948 * target-reloc.h (relocate_section): Pass output_section to
10949 relocate.
10950 * i386.cc (Target_i386::should_apply_static_reloc): Add
10951 output_section parameter. Change all callers.
10952 (Target_i386::Relocate::relocate): Add output_section parameter.
10953 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10954 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10955 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10956 * testsuite/two_file_shared.sh: New script.
10957 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10958 (check_DATA): Add two_file_shared.dbg.
10959 (two_file_shared.dbg): New target.
10960 * testsuite/Makefile.in: Rebuild.
10961
10962 2009-03-01 Ian Lance Taylor <iant@google.com>
10963
10964 * configure.ac: Check for byteswap.h.
10965 * configure: Rebuild.
10966 * config.in: Rebuild.
10967
10968 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10969
10970 * layout.cc (Layout::find_or_add_kept_section): New function.
10971 (Layout::add_comdat): Removed.
10972 * layout.h (struct Kept_section): Move out of class Layout.
10973 Remove trailing underscores from field names. Add group_sections
10974 field. Rename group_ field to is_group. Change all uses.
10975 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10976 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10977 comdat_groups_ field.
10978 (Sized_relobj::include_section_group): Use
10979 find_or_add_kept_section and Kept_section::group_sections.
10980 (Sized_relobj::include_linkonce_section): Likewise.
10981 * object.cc (class Sized_relobj): Don't define Comdat_group or
10982 Comdat_group_table. Remove find_comdat_group and
10983 add_comdat_group. Remove comdat_groups_ field.
10984 * plugin.cc (include_comdat_group): Use
10985 Layout::find_or_add_kept_section.
10986
10987 2009-02-28 Ian Lance Taylor <iant@google.com>
10988
10989 * README: --gc-sections and map files are now supported. Document
10990 some build requirements.
10991
10992 PR 6992
10993 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10994 relocatable link set the value of the section symbol to zero.
10995 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10996 relocatable link don't include the section address in the local
10997 symbol value.
10998
10999 2009-02-27 Ian Lance Taylor <iant@google.com>
11000
11001 PR 6811
11002 * options.h (class Search_directory): Add is_system_directory.
11003 (class General_options): Declare is_in_system_directory.
11004 * options.cc (get_relative_sysroot): Make static.
11005 (get_default_sysroot): Make static.
11006 (General_optoins::is_in_system_directory): New function.
11007 * fileread.cc (Input_file::is_in_system_directory): New function.
11008 * fileread.h (class Input_file): Declare is_in_system_directory.
11009 * object.h (class Object): Add is_in_system_directory.
11010 (class Input_objects): Remove system_library_directory_ field.
11011 * object.cc (Input_objects::add_object): Don't set
11012 system_library_directory_.
11013 (input_objects::found_in_system_library_directory): Remove.
11014 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11015 parameter. Change all callers.
11016 (Symbol_table::sized_write_globals): Likewise.
11017 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11018 Call Object::is_in_system_directory.
11019 * symtab.h (class Symbol_table): Update declarations.
11020
11021 PR 5990
11022 * descriptors.h (Open_descriptor): Add is_on_stack field.
11023 * descriptors.cc (Descriptors::open): If the descriptor is on the
11024 top of the stack, remove it. Initialize is_on_stack field.
11025 (Descriptors::release): Only add pod to stack if it is not on the
11026 stack already.
11027 (Descriptors::close_some_descriptor): Clear stack_next and
11028 is_on_stack fields.
11029
11030 PR 7091
11031 * output.cc (Output_section::find_starting_output_address): Rename
11032 from starting_output_address; add PADDR parameter; change return
11033 type.
11034 * output.h (class Output_section): Declare
11035 find_starting_output_address instead of starting_output_address.
11036 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11037 section symbol for which we can't find a merge section.
11038
11039 PR 9836
11040 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11041 hidden or internal, force the symbol to be local.
11042 * resolve.cc (Symbol::override_visibility): Define.
11043 (Symbol::override_base): Use override_visibility.
11044 (Symbol_table::resolve): Likewise.
11045 (Symbol::override_base_with_special): Likewise.
11046 (Symbol_table::override_with_special): If the visibility is hidden
11047 or internal, force the symbol to be local.
11048 * symtab.h (class Symbol): Add set_visibility and
11049 override_visibility.
11050 * testsuite/ver_test_1.sh: New file.
11051 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11052 (check_DATA): Add ver_test_1.syms.
11053 (ver_test_1.syms): New target.
11054 * testsuite/Makefile.in: Rebuild.
11055
11056 2009-02-25 Cary Coutant <ccoutant@google.com>
11057
11058 * layout.cc (Layout::choose_output_section): Don't rename sections
11059 when using a linker script that has a SECTIONS clause.
11060 * Makefile.in: Regenerate.
11061
11062 * testsuite/Makefile.am (script_test_5.sh): New test case.
11063 * testsuite/Makefile.in: Regenerate.
11064 * testsuite/script_test_5.cc: New file.
11065 * testsuite/script_test_5.sh: New file.
11066 * testsuite/script_test_5.t: New file.
11067
11068 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
11069
11070 * archive.cc (Archive::include_member): Update calls to add_symbols.
11071 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11072 the Layout argument.
11073 * dynobj.h (do_add_symbols): Add the Layout argument.
11074 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11075 Layout argument.
11076 * object.h (Object::add_symbols): Add the Layout argument.
11077 (Object::do_add_symbols): Add the Layout argument.
11078 (Sized_relobj::do_add_symbols): Add the Layout argument.
11079 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11080 Unify the two versions.
11081 (Add_plugin_symbols): Remove.
11082 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11083 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11084 (Add_plugin_symbols): Remove.
11085 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11086 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11087 (Add_symbols::run): Make it work with Pulginobj.
11088
11089 2009-02-06 Ian Lance Taylor <iant@google.com>
11090
11091 * object.cc (Sized_relobj::do_layout): Make info message start
11092 with lower case letter.
11093
11094 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11095
11096 * binary.cc: Fix file comment.
11097
11098 * options.h (enum Incremental_disposition): Define.
11099 (class General_options): Add new options: --incremental,
11100 --incremental_changed, --incremental_unchanged,
11101 --incremental_unknown. Add incremental_disposition_ and
11102 implicit_incremental_ fields.
11103 (General_options::incremental_disposition): New function.
11104 (class Position_dependent_options): Add incremental_disposition
11105 option.
11106 (Position_dependent_options::copy_from_options): Set incremental
11107 dispositions.
11108 * options.cc (General_options::parse_incremental_changed): New
11109 function.
11110 (General_options::parse_incremental_unchanged): New function.
11111 (General_options::parse_incremental_unknown): New function.
11112 (General_options::General_options): Initialize new fields
11113 incremental_disposition_ and implicit_incremental_.
11114 (General_options::finalize): Check for uasge of --incremental-*
11115 without --incremental.
11116
11117 2009-02-06 Chris Demetriou <cgd@google.com>
11118
11119 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11120 pointer and to report location as the file name associated with
11121 the symbol.
11122 (gold_undefined_symbol_at_location): New function to replace the
11123 old gold_undefined_symbol functionality.
11124 * target-reloc.h (relocate_section): Update to use
11125 gold_undefined_symbol_at_location.
11126 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11127 Call gold_undefined_symbol function rather than gold_error.
11128 * errors.h (Errors::undefined_symbol): Take location as a
11129 string, rather than calculating it from a relocation.
11130 * errors.cc (Errors::fatal): Print "fatal error:" before the
11131 formatted message.
11132 (Errors::error, Errors::error_at_location): Print "error: "
11133 before the formatted message.
11134 (Errors::undefined_symbol): Take location as a string, rather
11135 than calculating it from a relocation.
11136 (gold_undefined_symbol_at_location): New function akin to
11137 old gold_undefined_symbol, calculates location from relocation.
11138 (gold_undefined_symbol): Change to take only a Symbol pointer
11139 and to report location as the file name associated with the symbol.
11140 * testsuite/debug_msg.sh: Update for changed error messages.
11141 * testsuite/undef_symbol.sh: Likewise.
11142
11143 2009-02-04 Duncan Sands <baldrick@free.fr>
11144
11145 PR 9812
11146 * reduced_debug_output.h
11147 (Output_reduced_debug_abbrev_section::failed): Use format for
11148 gold_warning.
11149 (Output_reduced_debug_info_section::faild): Likewise.
11150
11151 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11152
11153 * script.cc (Lazy_demangler): New class.
11154 (Version_script_info::get_symbol_version_helper): Demangle a
11155 symbol only once.
11156
11157 2009-01-29 Cary Coutant <ccoutant@google.com>
11158
11159 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11160 to __tls_get_addr.
11161 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11162
11163 2009-01-28 Ian Lance Taylor <iant@google.com>
11164
11165 * version.cc (version_string): Bump to 1.9.
11166
11167 * gold.h: Include <cstring> and <stdint.h>.
11168 * version.cc: Include <cstdio>.
11169 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11170 warning.
11171 * reduced_debug_output.cc (insert_into_vector): Rename from
11172 Insert_into_vector; change all callers. Use Swap_unaligned to
11173 avoid aliasing issue; remove union since it is unnecessary.
11174
11175 2009-01-27 Sriraman Tallam <tmsriram@google.com>
11176
11177 * Makefile.am (CCFILES): Add gc.cc.
11178 (HFILES): Add gc.h.
11179 * Makefile.in: Regenerate.
11180 * gold.cc (Gc_runner): New class.
11181 (queue_initial_tasks): Call garbage collection related tasks
11182 when corresponding options are invoked.
11183 (queue_middle_gc_tasks): New function.
11184 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11185 processed early before laying out sections during garbage collection.
11186 * gold.h (queue_middle_gc_tasks): New function.
11187 (is_prefix_of): Move from "layout.cc".
11188 * i386.cc (Target_i386::gc_process_relocs): New function.
11189 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11190 * main.cc (main): Create object of class "Garbage_collection".
11191 * object.cc (Relobj::copy_symbols_data): New function.
11192 (Relobj::is_section_name_included): New function.
11193 (Sized_relobj::do_layout): Allow this function to be called twice
11194 during garbage collection and defer layout of section during the
11195 first call.
11196 * object.h (Relobj::get_symbols_data): New function.
11197 (Relobj::is_section_name_included): New function.
11198 (Relobj::copy_symbols_data): New function.
11199 (Relobj::set_symbols_data): New function.
11200 (Relobj::get_relocs_data): New function.
11201 (Relobj::set_relocs_data): New function.
11202 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11203 (Relobj::gc_process_relocs): New function.
11204 (Relobj::do_gc_process_relocs): New pure virtual function.
11205 (Relobj::sd_): New data member.
11206 (Sized_relobj::is_output_section_offset_invalid): New function.
11207 (Sized_relobj::do_gc_process_relocs): New function.
11208 * options.h (General_options::gc_sections): Modify to not be a no-op.
11209 (General_options::print_gc_sections): New option.
11210 * plugin.cc (Plugin_finish::run): Remove function call to
11211 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11212 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11213 * reloc.cc (Read_relocs::run): Add task to process relocs and
11214 determine unreferenced sections when doing garbage collection.
11215 (Gc_process_relocs): New class.
11216 (Sized_relobj::do_gc_process_relocs): New function.
11217 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11218 sections that are garbage collected.
11219 * reloc.h (Gc_process_relocs): New class.
11220 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11221 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11222 symbols whose corresponding sections are garbage collected.
11223 (Symbol_table::Symbol_table): Add new parameter for the garbage
11224 collection object.
11225 (Symbol_table::gc_mark_undef_symbols): New function.
11226 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11227 (Symbol_table::gc_mark_dyn_syms): New function.
11228 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11229 as garbage.
11230 (Symbol_table::add_from_object): Likewise.
11231 (Symbol_table::add_from_relobj): When building shared objects, do not
11232 treat externally visible symbols as garbage.
11233 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11234 table information for static and relocatable links.
11235 * symtab.h (Symbol_table::set_gc): New function.
11236 (Symbol_table::gc): New function.
11237 (Symbol_table::gc_mark_undef_symbols): New function.
11238 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11239 (Symbol_table::gc_mark_dyn_syms): New function.
11240 (Symbol_table::gc_): New data member.
11241 * target.h (Sized_target::gc_process_relocs): New pure virtual
11242 function.
11243 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11244 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11245
11246 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11247
11248 * options.h (General_options::gc_sections): Define as a no-op for now.
11249 (General_options::no_keep_memory): Ditto.
11250 (General_options::Bshareable): Define.
11251 * options.cc (General_options::finalize): Honor -Bshareable.
11252
11253 2009-01-20 Andreas Schwab <schwab@suse.de>
11254
11255 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11256 read the value in the contents, since we don't use it. Use the
11257 template endianness when writing.
11258 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11259
11260 2009-01-19 Andreas Schwab <schwab@suse.de>
11261
11262 * configure.tgt (powerpc64-*): Fix targ_obj.
11263
11264 2009-01-15 Ian Lance Taylor <iant@google.com>
11265
11266 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11267 local symbols when stripping all symbols.
11268
11269 2009-01-14 Cary Coutant <ccoutant@google.com>
11270
11271 * output.cc (Output_reloc): Add explicit instantiations.
11272
11273 2009-01-14 Cary Coutant <ccoutant@google.com>
11274
11275 * archive.cc (Archive::get_elf_object_for_member): Remove call
11276 to File_read::claim_for_plugin.
11277 * descriptors.cc (Descriptors::open): Remove reference to
11278 is_claimed.
11279 (Descriptors::claim_for_plugin): Remove.
11280 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11281 (Descriptors::is_claimed): Remove.
11282 (claim_descriptor_for_plugin): Remove.
11283 * fileread.cc (File_read::claim_for_plugin): Remove.
11284 * fileread.h (File_read::claim_for_plugin): Remove.
11285 (File_read::descriptor): Reopen descriptor if necessary.
11286 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11287 (Plugin_manager::all_symbols_read): Add task parameter. Change
11288 all callers.
11289 (Plugin_manager::get_input_file): New function.
11290 (Plugin_manager::release_input_file): New function.
11291 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11292 corresponding data member.
11293 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11294 and pass to base constructor. Change all callers.
11295 (get_input_file, release_input_file): New functions.
11296 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11297 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11298 (Plugin_manager::all_symbols_read): Add task parameter.
11299 (Plugin_manager::get_input_file): New function.
11300 (Plugin_manager::release_input_file): New function.
11301 (Plugin_manager::task_): New data member.
11302 (Pluginobj::Pluginobj): Add filesize parameter.
11303 (Pluginobj::filename): New function.
11304 (Pluginobj::descriptor): New function.
11305 (Pluginobj::filesize): New function.
11306 (Pluginobj::filesize_): New data member.
11307 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11308 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11309 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11310
11311 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11312 with archive libraries.
11313 * testsuite/Makefile.in: Regenerate.
11314 * testsuite/plugin_test.c (struct sym_info): New type.
11315 (get_input_file, release_input_file): New static variables.
11316 (onload): Capture new transfer vector entries.
11317 (claim_file_hook): Stop reading at end of file according to filesize.
11318 Factor out parsing of readelf output into separate function.
11319 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11320 APIs and get the source file name from the symbol table. Convert
11321 source file name to corresponding object file name. Print info
11322 message when adding new input files.
11323 (parse_readelf_line): New function.
11324 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11325 * testsuite/plugin_test_2.sh: Likewise.
11326 * testsuite/plugin_test_3.sh: Likewise.
11327 * testsuite/plugin_test_4.sh: New test case.
11328
11329 2009-01-07 Ian Lance Taylor <iant@google.com>
11330
11331 * version.cc (version_string): Bump to 1.8.
11332
11333 2008-12-23 Cary Coutant <ccoutant@google.com>
11334
11335 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11336 * plugin.cc (Plugin_manager::finish): Rename as
11337 layout_deferred_objects. Move cleanup to separate function.
11338 (Plugin_manager::cleanup): New function.
11339 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11340 separately.
11341 * plugin.h (Plugin_manager::finish): Rename as
11342 layout_deferred_objects.
11343 (Plugin_manager::cleanup): New function.
11344 (Plugin_manager::cleanup_done): New field.
11345
11346 2008-12-23 Cary Coutant <ccoutant@google.com>
11347
11348 * plugin.cc (is_visible_from_outside): New function.
11349 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11350 so we don't return "IR only" status for exported symbols or -r links.
11351
11352 * testsuite/Makefile.am (plugin_test_3): New test case.
11353 * testsuite/Makefile.in: Regenerate.
11354 * testsuite/plugin_test_3.sh: New file.
11355
11356 2008-12-22 Cary Coutant <ccoutant@google.com>
11357
11358 * object.cc (Sized_relobj::layout_section): New function.
11359 (Sized_relobj::do_layout): Defer layout of input sections until after
11360 plugin has provided replacement files.
11361 (Sized_relobj::do_layout_deferred_sections): New function.
11362 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11363 (Relobj::layout_deferred_sections): New function.
11364 (Relobj::do_layout_deferred_sections): New function.
11365 (Sized_relobj::do_layout_deferred_sections): New function.
11366 (Sized_relobj::layout_section): New function.
11367 (Sized_relobj::Deferred_layout): New structure.
11368 (Sized_relobj::deferred_layout_): New field.
11369 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11370 Change all callers. Layout deferred sections.
11371 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11372 references.
11373 (Plugin_hook::run): Move code from do_plugin_hook inline.
11374 (Plugin_hook::do_plugin_hook): Remove.
11375 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11376 (Plugin_manager::finish): Renamed, was cleanup.
11377 (Plugin_manager::should_defer_layout): New function.
11378 (Plugin_manager::add_deferred_layout_object): New function.
11379 (Plugin_manager::Deferred_layout_list): New type.
11380 (Plugin_manager::deferred_layout_objects_): New field.
11381 (Plugin_hook::do_plugin_hook): Remove.
11382
11383 2008-12-17 Ian Lance Taylor <iant@google.com>
11384
11385 * options.h (class General_options): Add --no case for
11386 --export-dynamic.
11387
11388 2008-12-16 Cary Coutant <ccoutant@google.com>
11389
11390 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11391 vector.
11392 (Plugin_manager::claim_file): Create plugin object even if
11393 plugin did not call the add_symbols callback.
11394 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11395 asking for more symbols than were added.
11396 * testsuite/Makefile.am (plugin_test_1): Add test case with
11397 no global symbols.
11398 (empty.syms): New target.
11399 * testsuite/Makefile.in: Regenerate.
11400 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11401 message. Don't call add_symbols if no globals.
11402 (all_symbols_read_hook): Don't provide replacement for empty
11403 claimed file.
11404
11405 2008-12-12 Ian Lance Taylor <iant@google.com>
11406
11407 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11408 r_type == 0 for a local symbol with r_sym == 0.
11409 (scan_relocatable_relocs): Pass r_sym to
11410 local_non_section_strategy.
11411 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11412 r_sym parameter.
11413
11414 * configure.ac: Update test for TLS descriptors: they are
11415 supported as of glibc 2.9.
11416 * configure: Rebuild.
11417
11418 2008-12-11 Ian Lance Taylor <iant@google.com>
11419
11420 PR 7091
11421 * target-reloc.h (Default_scan_relocatable_relocs): For each
11422 function, map r_type == 0 to RELOC_DISCARD.
11423
11424 2008-12-10 Cary Coutant <ccoutant@google.com>
11425
11426 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11427 object to override a kept COMDAT group from a plugin object.
11428
11429 2008-12-09 Ian Lance Taylor <iant@google.com>
11430
11431 PR 7088
11432 * yyscript.y (file_cmd): Handle INPUT.
11433
11434 * testsuite/initpri1.c: Change all declarations to be full
11435 prototypes by adding void, to avoid compiler warnings.
11436
11437 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
11438
11439 * options.cc (General_options::parse_plugin_opt): New.
11440 (General_options::add_plugin): The argument now is just the filename.
11441 (General_options::add_plugin_option): New.
11442 * options.h (plugin_opt): New.
11443 (add_plugin): Change argument name.
11444 (add_plugin_option): New.
11445 * plugin.cc (Plugin::load): Don't parse the plugin option.
11446 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11447 (Plugin::add_option): New.
11448 (Plugin::args_): Change type.
11449 (Plugin::filename_): New.
11450 (Plugin_manager::add_plugin_option): New.
11451 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11452 * testsuite/Makefile.in: Regenerate.
11453
11454 2008-12-05 Cary Coutant <ccoutant@google.com>
11455
11456 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11457 Handle --strip-lto-sections option.
11458 * options.h (strip_lto_sections): New option.
11459
11460 2008-12-01 Cary Coutant <ccoutant@google.com>
11461
11462 * plugin.cc (ld_plugin_message): Change format parameter to const.
11463 Fix mismatch between new[] and delete.
11464
11465 2008-11-14 Cary Coutant <ccoutant@google.com>
11466
11467 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11468 instead of -1U.
11469
11470 2008-11-05 Craig Silverstein <csilvers@google.com>
11471
11472 * options.cc (General_options::parse_dynamic_list): New function.
11473 * options.h (General_options): New flags dynamic_list,
11474 dynamic_list_data, dynamic_list_cpp_new, and
11475 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11476 (General_options::in_dynamic_list): New function.
11477 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11478 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11479 (Lex::can_continue_name): Likewise.
11480 (yylex): Likewise.
11481 (read_script_file): New parameter script_options.
11482 (read_dynamic_list): New function.
11483 (Script_options::define_dynamic_list): New function.
11484 (dynamic_list_keyword_parsecodes): New variable.
11485 (dynamic_list_keywords): New variable.
11486 * script.h (Script_options::define_dynamic_list): New function
11487 prototype.
11488 (read_dynamic_list): New function prototype.
11489 * symtab.cc (strprefix): New macro.
11490 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11491 dynamic_list_data, dynamic_list_cpp_new, and
11492 dynamic_list_cpp_typeinfo.
11493 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11494 (dynamic_list_expr): New rule.
11495 (dynamic_list_nodes): Likewise.
11496 (dynamic_list_node): Likewise.
11497 * testsuite/Makefile.am (dynamic_list): New test.
11498 * testsuite/Makefile.in: Regenerated.
11499 * testsuite/dynamic_list.t: New file.
11500 * testsuite/dynamic_list.sh: New file.
11501
11502 2008-11-05 Craig Silverstein <csilvers@google.com>
11503
11504 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11505 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11506 (t11_last): Likewise.
11507 * testsuite/ver_test_6.c (main): Likewise.
11508
11509 2008-10-07 Cary Coutant <ccoutant@google.com>
11510
11511 * options.c (General_options::finalize): Add check for -static and
11512 -shared.
11513 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11514 is not empty.
11515
11516 2008-10-02 Cary Coutant <ccoutant@google.com>
11517
11518 * plugin.cc (make_sized_plugin_object): Fix conditional
11519 compilation to work when not all targets are enabled.
11520
11521 2008-09-29 Cary Coutant <ccoutant@google.com>
11522
11523 * archive.cc (Archive::get_file_and_offset): Use filename instead
11524 of name to get library path.
11525 (Archive::include_member): Unlock external member of a thin archive.
11526
11527 * testsuite/Makefile.am (TEST_AR): New variable.
11528 (thin_archive_test_1): New test.
11529 (thin_archive_test_2): New test.
11530 * testsuite/Makefile.in: Regenerate.
11531 * testsuite/thin_archive_main.cc: New file.
11532 * testsuite/thin_archive_test_1.cc: New file.
11533 * testsuite/thin_archive_test_2.cc: New file.
11534 * testsuite/thin_archive_test_3.cc: New file.
11535 * testsuite/thin_archive_test_4.cc: New file.
11536
11537 2008-09-29 Cary Coutant <ccoutant@google.com>
11538
11539 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11540 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11541 instead of -1U.
11542 (Sized_relobj::do_finalize_local_symbols): Likewise.
11543 (Sized_relobj::map_to_kept_section): Likewise.
11544 * object.h (Sized_relobj::invalid_address): New constant.
11545 (Sized_relobj::do_output_section_offset): Check for invalid_address
11546 and return -1ULL.
11547 * output.cc (Output_reloc::local_section_offset): Use constant
11548 invalid_address instead of -1U.
11549 (Output_reloc::get_address): Likewise.
11550 (Output_section::output_address): Change -1U to -1ULL.
11551 * output.h (Output_reloc::invalid_address): New constant.
11552 * reloc.cc (Sized_relobj::write_sections): Use constant
11553 invalid_address instead of -1U.
11554 (Sized_relobj::relocate_sections): Likewise.
11555 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11556 values for merge sections.
11557 * target-reloc.h (relocate_for_relocatable): Use constant
11558 invalid_address instead of -1U.
11559
11560 2008-09-19 Cary Coutant <ccoutant@google.com>
11561
11562 Add plugin functionality for link-time optimization (LTO).
11563 * configure.ac (plugins): Add --enable-plugins option.
11564 * configure: Regenerate.
11565 * config.in: Regenerate.
11566 * Makefile.am (LIBDL): New variable.
11567 (CCFILES): Add plugin.cc.
11568 (HFILES): Add plugin.h.
11569 (ldadd_var): Add LIBDL.
11570 * Makefile.in: Regenerate.
11571
11572 * archive.cc: Include "plugin.h".
11573 (Archive::setup): Don't preread archive symbols when using a plugin.
11574 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11575 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11576 files.
11577 (Archive::include_member): Add symbols from plugin objects.
11578 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11579 * descriptors.cc (Descriptors::open): Check for file descriptors
11580 abandoned by plugins.
11581 (Descriptors::claim_for_plugin): New function.
11582 * descriptors.h (Descriptors::claim_for_plugin): New function.
11583 (Open_descriptor::is_claimed): New field.
11584 (claim_descriptor_for_plugin): New function.
11585 * fileread.cc (File_read::claim_for_plugin): New function.
11586 * fileread.h (File_read::claim_for_plugin): New function.
11587 (File_read::descriptor): New function.
11588 * gold.cc: Include "plugin.h".
11589 (queue_initial_tasks): Add task to call plugin hooks for generating
11590 new object files.
11591 * main.cc: Include "plugin.h".
11592 (main): Load plugin libraries.
11593 * object.h (Pluginobj): Declare.
11594 (Object::pluginobj): New function.
11595 (Object::do_pluginobj): New function.
11596 (Object::set_target): New function.
11597 * options.cc: Include "plugin.h".
11598 (General_options::parse_plugin): New function.
11599 (General_options::General_options): Initialize plugins_ field.
11600 (General_options::add_plugin): New function.
11601 * options.h (Plugin_manager): Declare.
11602 (General_options): Add --plugin option.
11603 (General_options::has_plugins): New function.
11604 (General_options::plugins): New function.
11605 (General_options::add_plugin): New function.
11606 (General_options::plugins_): New field.
11607 * plugin.cc: New file.
11608 * plugin.h: New file.
11609 * readsyms.cc: Include "plugin.h".
11610 (Read_symbols::do_read_symbols): Check for archive before checking
11611 for ELF file. Call plugin hooks to claim files.
11612 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11613 from a real object file; force override when processing replacement
11614 files.
11615 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11616 (Symbol::init_base_object): Likewise.
11617 (Symbol::init_base_output_data): Likewise.
11618 (Symbol::init_base_output_segment): Likewise.
11619 (Symbol::init_base_constant): Likewise.
11620 (Symbol::init_base_undefined): Likewise.
11621 (Symbol::output_section): Assert that object is not a plugin.
11622 (Symbol_table::add_from_pluginobj): New function.
11623 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11624 undefined.
11625 (Symbol_table::sized_write_globals): Likewise.
11626 (Symbol_table::add_from_pluginobj): Instantiate template.
11627 * symtab.h (Sized_pluginobj): Declare.
11628 (Symbol::in_real_elf): New function.
11629 (Symbol::set_in_real_elf): New function.
11630 (Symbol::in_real_elf_): New field.
11631 (Symbol_table::add_from_pluginobj): New function.
11632
11633 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11634 (LIBDL): New variable.
11635 (LDADD): Add LIBDL.
11636 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11637 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11638 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11639 (MOSTLYCLEANFILES): Likewise.
11640 * testsuite/Makefile.in: Regenerate.
11641 * testsuite/plugin_test.c: New file.
11642 * testsuite/plugin_test_1.sh: New file.
11643 * testsuite/plugin_test_2.sh: New file.
11644
11645 2008-09-16 Ian Lance Taylor <iant@google.com>
11646
11647 * target-reloc.h (relocate_section): Check whether a symbol is
11648 defined by the ABI before reporting an undefined symbol error.
11649 * target.h (Target::is_defined_by_abi): Make parameter const.
11650 (Target::do_is_defined_by_abi): Likewise.
11651 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11652 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11653 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11654 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11655 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11656 * testsuite/Makefile.in: Rebuild.
11657
11658 * fileread.cc (make_view): Add casts to avoid warning.
11659
11660 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11661
11662 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11663 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11664
11665 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11666
11667 * options.h (General_options::output_is_executable): New.
11668 (General_options::output_is_pie): New.
11669 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11670 for shared libraries.
11671 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11672
11673 2008-09-11 Chris Demetriou <cgd@google.com>
11674
11675 * options.h (origin): New -z option.
11676 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11677 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11678 in DT_FLAGS_1.
11679
11680 2008-09-05 Cary Coutant <ccoutant@google.com>
11681
11682 * fileread.cc (File_read::make_view): Add check for attempt to map
11683 beyond end of file.
11684
11685 2008-09-05 Cary Coutant <ccoutant@google.com>
11686
11687 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11688 explicit instantiations.
11689
11690 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11691
11692 PR gold/6858
11693 * options.cc (General_options::finalize): Allow undefined symbols
11694 in shlibs if linking -shared.
11695
11696 PR gold/6859
11697 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11698 symbols as not needing a dynsym entry.
11699
11700 2008-08-20 Craig Silverstein <csilvers@google.com>
11701
11702 * fileread.cc (File_read::open): Do not lock the file unless it
11703 was successfully opened.
11704
11705 2008-08-14 Cary Coutant <ccoutant@google.com>
11706
11707 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11708 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11709 * testsuite/tls_test.cc (struct int128): 128-bit struct
11710 for testing TLS relocs with non-zero addend.
11711 (v12): New TLS variable.
11712 (t12): New test.
11713 (t_last): Add check for v12.
11714 * testsuite/tls_test.h (t12): New function.
11715 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11716
11717 2008-08-13 Ian Lance Taylor <iant@google.com>
11718
11719 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11720 set tls_segment_ or relro_segment_.
11721 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11722 when appropriate.
11723 * output.h (Output_section::clear_is_relro): New function.
11724 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11725 sections specially even when output_data_ is empty.
11726 (Output_segment::maximum_alignment): When first section is relro,
11727 only force alignment for PT_LOAD segments.
11728 * script.cc (script_data_segment_align): New function.
11729 (script_data_segment_relro_end): New function.
11730 * script-c.h (script_data_segment_align): Declare.
11731 (script_data_segment_relro_end): Declare.
11732 * script-sections.h (class Script_sections): Declare
11733 data_segment_align and data_segment_relro_end. Add fields
11734 segment_align_index_ and saw_relro_end_.
11735 * script-sections.cc (class Sections_element): Add set_is_relro
11736 virtual function. Add new bool* parameter to place_orphan_here.
11737 Add get_output_section virtual function.
11738 (class Output_section_definition): Add set_is_relro. Add new
11739 bool* parameter to place_orphan_here. Add get_output_section.
11740 Add is_relro_ field.
11741 (Output_section_definition::Output_section_definition): Initialize
11742 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11743 and is_relro_ fields.
11744 (Output_section_definition::place_orphan_here): Add is_relro
11745 parameter.
11746 (Output_section_definition::set_section_addresses): Set relro for
11747 output section.
11748 (Output_section_definition::alternate_constraint): Likewise.
11749 (class Orphan_output_section): Add new bool* parameter to
11750 place_orphan_here. Add get_output_section.
11751 (Orphan_output_section::place_orphan_here): Add is_relro
11752 parameter.
11753 (Script_sections::Script_sections): Initialize
11754 data_segment_align_index_ and saw_relro_end_.
11755 (Script_sections::data_segment_align): New function.
11756 (Script_sections::data_segment_relro_end): New function.
11757 (Script_sections::place_orphan): Set or clear is_relro.
11758 (Script_sections::set_section_addresses): Force alignment of first
11759 TLS section.
11760 * yyscript.y (exp): Call script_data_segment_align and
11761 script_data_segment_relro_end.
11762 * testsuite/relro_script_test.t: New file.
11763 * testsuite/relro_test.cc (using_script): Declare.
11764 (t1, t2): Test using_script.
11765 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11766 (relro_script_test_SOURCES): Define.
11767 (relro_script_test_DEPENDENCIES): Define.
11768 (relro_script_test_LDFLAGS): Define.
11769 (relro_script_test_LDADD): Define.
11770 (relro_script_test.so): New target.
11771 * testsuite/Makefile.in: Rebuild.
11772
11773 2008-08-06 Cary Coutant <ccoutant@google.com>
11774
11775 * archive.cc (Archive::total_archives, Archive::total_members)
11776 (Archive::total_members_loaded): New variables.
11777 (Archive::setup): Add parameter. Add option to preread
11778 archive symbols.
11779 (Archive::read_armap): Add counter.
11780 (Archive::get_file_and_offset): New function.
11781 (Archive::get_elf_object_for_member): New function.
11782 (Archive::read_all_symbols): New function.
11783 (Archive::read_symbols): New function.
11784 (Archive::add_symbols): Add counters.
11785 (Archive::include_all_members): Use armap to find members if it's
11786 already built.
11787 (Archive::include_member): Skip reading symbols if already read.
11788 Factored code into Archive::get_file_and_offset and
11789 Archive::get_elf_object_for_member. Changed call to
11790 Mapfile::report_include_archive_member.
11791 (Archive::print_stats): New function.
11792 * archive.h: Declare Object and Read_symbols_data classes.
11793 (Archive::Archive): Add initializers for new members.
11794 (Archive::setup): Add parameter.
11795 (Archive::print_stats): New function.
11796 (Archive::total_archives, Archive::total_members)
11797 (Archive::total_members_loaded): New variables.
11798 (Archive::get_file_and_offset): New function.
11799 (Archive::get_elf_object_for_member): New function.
11800 (Archive::read_all_symbols): New function.
11801 (Archive::read_symbols): New function.
11802 (Archive::Archive_member): New class.
11803 (Archive::members_): New member.
11804 (Archive::num_members_): New member.
11805 * main.cc: Include archive.h.
11806 (main): Call Archive::print_stats.
11807 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11808 archive parameter; member_name is now the fully-decorated name.
11809 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11810 * options.h: (General_options): Add --preread-archive-symbols option.
11811 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11812 Archive::setup.
11813
11814 2008-08-04 Ian Lance Taylor <iant@google.com>
11815
11816 * symtab.h (Symbol::use_plt_offset): New function.
11817 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11818 * powerpc.cc (Relocate::relocate): Likewise.
11819 * sparc.cc (Relocate::relocate): Likewise.
11820 * x86_64.cc (Relocate::relocate): Likewise.
11821 * testsuite/weak_plt.sh: New test.
11822 * testsuite/weak_plt_main.cc: New test.
11823 * testsuite/weak_plt_shared.cc: New test.
11824 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11825 (check_PROGRAMS): Add weak_plt.
11826 (check_DATA): Add weak_plt_shared.so.
11827 (weak_plt_main_pic.o, weak_plt): New targets.
11828 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11829 * testsuite/Makefile.in: Rebuild.
11830
11831 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11832 gcctestdir/ld.
11833 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11834 * testsuite/Makefile.in: Rebuild.
11835
11836 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11837
11838 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11839 * Makefile.in: Regenerate.
11840 * po/POTFILES.in: Regenerate.
11841
11842 2008-07-29 Ian Lance Taylor <iant@google.com>
11843
11844 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11845 symbols before other symbols.
11846 * testsuite/script_test_2.cc (test_addr): Declare.
11847 (test_addr_alias): Declare.
11848 (main): Check that test_addr and test_addr_alias have the right
11849 values.
11850 * testsuite/script_test_2.t: Define test_addr_alias and
11851 test_addr.
11852
11853 2008-07-24 Ian Lance Taylor <iant@google.com>
11854
11855 PR 5990
11856 * descriptors.cc: New file.
11857 * descriptors.h: New file.
11858 * gold-threads.h (class Hold_optional_lock): New class.
11859 * fileread.cc: Include "descriptors.h".
11860 (File_read::~File_read): Release descriptor rather than closing
11861 it.
11862 (File_read::open) [file]: Call open_descriptor rather than open.
11863 Set is_descriptor_opened_.
11864 (File_read::open) [memory]: Assert that descriptor is not open.
11865 (File_read::reopen_descriptor): New function.
11866 (File_read::release): Release descriptor.
11867 (File_read::do_read): Make non-const. Reopen descriptor.
11868 (File_read::read): Make non-const.
11869 (File_read::make_view): Reopen descriptor.
11870 (File_read::do_readv): Likewise.
11871 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11872 Update declarations.
11873 * layout.cc: Include "descriptors.h".
11874 (Layout::create_build_id): Use open_descriptor rather than open.
11875 * output.cc: Include "descriptors.h".
11876 (Output_file::open): Use open_descriptor rather than open.
11877 * archive.cc (Archive::const_iterator): Change Archive to be
11878 non-const.
11879 (Archive::begin, Archive::end): Make non-const.
11880 (Archive::count_members): Likewise.
11881 * archive.h (class Archive): Update declarations.
11882 * object.h (Object::read): Make non-const.
11883 * Makefile.am (CCFILES): Add descriptors.cc.
11884 (HFILES): Add descriptors.h.
11885 * Makefile.in: Rebuild.
11886
11887 PR 6716
11888 * gold.h: Always include <clocale>. Add Solaris workarounds
11889 following code in binutils/sysdep.h.
11890
11891 PR 6048
11892 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11893 this->eh_frame_hdr_ is NULL before using it.
11894
11895 * dynobj.cc (Versions::Versions): Update comment.
11896
11897 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11898 the base version name.
11899
11900 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11901 array size plus one.
11902 (Stringpool_template::set_string_offsets): Subtract one from key
11903 before using it as an array index.
11904 (Stringpool_template::get_offset_with_length): Likewise.
11905 (Stringpool_template::write_to_buffer): Likewise.
11906 * stringpool.h (Stringpool_template::get_offset_from_key):
11907 Likewise.
11908
11909 2008-07-23 Ian Lance Taylor <iant@google.com>
11910
11911 PR 6658
11912 * object.h (Merged_symbol_value::value): Do our best to handle a
11913 negative addend.
11914
11915 PR 6647
11916 * script.cc (Version_script_info::get_versions): Don't add empty
11917 version tag to return value.
11918 (Version_script_info::get_symbol_version_helper): Change return
11919 type to bool. Add pversion parameter. Change all callers.
11920 (script_register_vers_node): Don't require a non-NULL tag.
11921 * script.h (class Version_script_info): Update declarations.
11922 (Version_script_info::get_symbol_version): Change return type to
11923 bool. Add version parameter. Change all callers.
11924 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11925 handling. Handle an empty version from a version script.
11926 (Symbol_table::define_special_symbol): Likewise.
11927 * testsuite/ver_test_10.script: New file.
11928 * testsuite/ver_test_10.sh: New file.
11929 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11930 (check_DATA): Add ver_test_10.syms.
11931 (ver_test_10.syms, ver_test_10.so): New target.
11932 * testsuite/Makefile.in: Rebuild.
11933
11934 2008-07-23 Simon Baldwin <simonb@google.com>
11935
11936 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11937 to zero for undefined symbols from dynamic libraries.
11938
11939 2008-07-23 Ian Lance Taylor <iant@google.com>
11940
11941 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11942 Change all callers.
11943 * symtab.h (class Symbol_table): Update declaration.
11944 * testsuite/ver_test_9.cc: New file.
11945 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11946 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11947 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11948 (ver_test_9.so, ver_test_9.o): New targets.
11949 * testsuite/Makefile.in: Rebuild.
11950
11951 2008-07-22 Ian Lance Taylor <iant@google.com>
11952
11953 * options.h (class General_options): Define --check-sections.
11954 * layout.cc (Layout::set_segment_offsets): Handle
11955 --check-sections.
11956
11957 * options.h (class General_options): Define -n/--nmagic and
11958 -N/--omagic.
11959 * options.cc (General_options::finalize): For -n/--nmagic or
11960 -N/--omagic, set -static.
11961 * layout.cc (Layout::attach_allocated_section_to_segment): If
11962 -N/--omagic, don't put read-only and read-write sections in
11963 different segments.
11964 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11965 finding a read-only segment.
11966 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11967 don't set the minimum segment alignment to the common page size,
11968 and don't set the file offset to the address modulo the page size.
11969 * script-sections.cc (Script_sections::create_segments): If
11970 -n/--omagic, don't put read-only and read-write sections in
11971 different segments.
11972
11973 * cref.cc: New file.
11974 * cref.h: New file.
11975 * options.h (class General_options): Add --print-symbol-counts.
11976 * main.cc (main): Issue defined symbol report if requested.
11977 * archive.cc (Archive::interpret_header): Make into a const member
11978 function.
11979 (Archive::add_symbols): Call Input_objects::archive_start and
11980 archive_stop.
11981 (Archive::const_iterator): Define new class.
11982 (Archive::begin, Archive::end): New functions.
11983 (Archive::include_all_members): Rewrite to use iterator.
11984 (Archive::count_members): New function.
11985 * archive.h (class Archive): Update declarations.
11986 (Archive::filename): New function.
11987 * object.cc: Include "cref.h".
11988 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11989 (Sized_relobj::do_get_global_symbol_counts): New function.
11990 (Input_objects::add_object): Add object to cross-referencer.
11991 (Input_objects::archive_start): New function.
11992 (Input_objects::archive_stop): New function.
11993 (Input_objects::print_symbol_counts): New function.
11994 * object.h: Declare Cref and Archive.
11995 (Object::get_global_symbol_counts): New function.
11996 (Object::do_get_global_symbol_counts): New pure virtual function.
11997 (class Sized_relobj): Add defined_count_ field. Update
11998 declarations.
11999 (class Input_objects): Add cref_ field. Update constructor.
12000 Update declarations.
12001 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12002 defined_count_.
12003 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12004 symbol counts.
12005 (Sized_dynobj::do_get_global_symbol_counts): New function.
12006 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12007 defined_count_. Update declarations. Define Symbols typedef.
12008 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12009 parameter. Change all callers.
12010 (Symbol_table::add_from_dynobj): Add sympointers and defined
12011 parameters. Change all callers.
12012 * symtab.h (class Symbol_table): Update declarations.
12013 * Makefile.am (CCFILES): Add cref.cc.
12014 (HFILES): Add cref.h.
12015 * Makefile.in: Rebuild.
12016
12017 2008-07-22 Simon Baldwin <simonb@google.com>
12018
12019 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12020 to zero when writing undefined symbols.
12021
12022 2008-07-22 Ian Lance Taylor <iant@google.com>
12023
12024 * output.cc (Output_section::add_input_section): Don't try to
12025 merge empty merge sections.
12026
12027 2008-07-21 Craig Silverstein <csilvers@google.com>
12028
12029 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12030 Include symbol version in error message.
12031
12032 2008-07-20 Chris Demetriou <cgd@google.com>
12033
12034 * configure.ac (gold_cv_c_random_seed): New configured variable.
12035 (RANDOM_SEED_CFLAGS): New substituted variable.
12036 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12037 * configure: Rebuild.
12038 * Makefile.in: Likewise.
12039 * testsuite/Makefile.in: Likewise.
12040
12041 2008-07-18 Ian Lance Taylor <iant@google.com>
12042
12043 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12044 where we see NAME/NULL and NAME/VERSION as separate symbols.
12045 * testsuite/ver_test_main.cc (main): Call t4.
12046 (t4, t4_2a): Define.
12047 * testsuite/ver_test_2.cc (t4_2): Define.
12048 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12049 * testsuite/ver_test_4.cc (t4_2a): Define.
12050 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12051 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12052
12053 2008-07-17 Ian Lance Taylor <iant@google.com>
12054
12055 * dynobj.cc (Versions::add_def): If we give an error about a
12056 missing version, go ahead and create the version anyhow.
12057
12058 2008-07-10 Ian Lance Taylor <iant@google.com>
12059
12060 Handle output sections with more than 0x7fffffff bytes.
12061 * object.h (class Relobj): Change map_to_output_ to
12062 output_sections_, and just keep a section pointer. Change all
12063 uses. Move comdat group support to Sized_relobj.
12064 (Relobj::is_section_specially_mapped): Remove.
12065 (Relobj::output_section): Remove poff parameter. Change all
12066 callers.
12067 (Relobj::output_section_offset): New function.
12068 (Relobj::set_section_offset): Rewrite.
12069 (Relobj::map_to_output): Remove.
12070 (Relobj::output_sections): New function.
12071 (Relobj::do_output_section_offset): New pure virtual function.
12072 (Relobj::do_set_section_offset): Likewise.
12073 (class Sized_relobj): Add section_offsets_ field. Add comdat
12074 group support from Relobj. Update declarations.
12075 (Sized_relobj::get_output_section_offset): New function.
12076 (Sized_relobj::do_output_section_offset): New function.
12077 (Sized_relobj::do_set_section_offset): New function.
12078 * object.cc (Relobj::output_section_address): Remove.
12079 (Sized_relobj::Sized_relobj): Initialize new fields.
12080 (Sized_relobj::include_section_group): Cast find_kept_object to
12081 Sized_relobj.
12082 (Sized_relobj::include_linkonce_section): Likewise.
12083 (Sized_relobj::do_layout): Use separate arrays for output section
12084 and output offset.
12085 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12086 output_sections.
12087 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12088 output_sections and section_offsets.
12089 (Sized_relobj::write_local_symbols): Likewise.
12090 (map_to_kept_section): Compute output address directly.
12091 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12092 output_sections and section_offsets.
12093 (Sized_relobj::write_sections): Likewise.
12094 (Sized_relobj::relocate_sections): Likewise.
12095 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12096 * output.h (class Output_reloc): Update declarations. Change
12097 u2_.relobj to Sized_relobj*.
12098 (class Output_data_reloc): Change add functions to use
12099 Sized_relobj*.
12100 * output.cc (Output_reloc::Output_reloc): Change relobj to
12101 Sized_relobj*.
12102 (Output_reloc::local_section_offset): Change return type to
12103 Elf_Addr. Use get_output_section_offset.
12104 (Output_reloc::get_address): Likewise.
12105 (Output_section::is_input_address_mapped): Don't call
12106 is_section_specially_mapped.
12107 (Output_section::output_offset): Likewise.
12108 (Output_section::output_address): Likewise.
12109 (Output_section::starting_output_address): Likewise.
12110 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12111 parameter to Sized_relobj*.
12112 (Copy_relocs::need_copy_reloc): Likewise.
12113 (Copy_relocs::save): Likewise.
12114 * copy-relocs.h (class Copy_relocs): Update declarations.
12115 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12116 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12117 * target-reloc.h (relocate_for_relocatable): Change
12118 offset_in_output_section type to Elf_Addr. Change code that uses
12119 it as well.
12120 * layout.cc (Layout::layout): Always set *off.
12121 * mapfile.cc (Mapfile::print_input_section): Use
12122 output_section_offset.
12123 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12124 Sized_relobj*.
12125 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12126 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12127 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12128
12129 2008-07-03 Ian Lance Taylor <iant@google.com>
12130
12131 * layout.cc (Layout::include_section): Do not discard unrecognized
12132 SHT_STRTAB sections.
12133
12134 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12135
12136 * script.cc (Lex::can_continue_name): Make '?' allowable in
12137 version-script names.
12138 * testsuite/version_script.map: Change glob pattern to use '?'
12139
12140 2008-06-30 Manish Singh <yosh@gimp.org>
12141
12142 PR 6585
12143 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12144 Correct typo.
12145
12146 2008-06-30 Ian Lance Taylor <iant@google.com>
12147
12148 PR 6660
12149 PR 6682
12150 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12151 versions]: Don't try to read the value in the contents, since we
12152 don't use it. Use the template endianness when writing.
12153
12154 2008-06-25 Cary Coutant <ccoutant@google.com>
12155
12156 * fileread.cc (File_read::make_view): Assert on zero-length view.
12157 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12158 symbol table when there are no symbols to read.
12159
12160 2008-06-23 Craig Silverstein <csilvers@google.com>
12161
12162 * version.cc (version_string): Bump to 1.7
12163
12164 2008-06-18 Craig Silverstein <csilvers@google.com>
12165
12166 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12167 constant 0xFFFF to type Valtype.
12168 (Powerpc_relocate_functions::rel16_ha): Likewise.
12169
12170 2008-06-17 Ian Lance Taylor <iant@google.com>
12171
12172 * output.h (Output_section::Input_section): Initialize p2align_ to
12173 zero for Output_section_data constructors.
12174 (Output_section::Input_section::addralign): If not an input
12175 section, return the alignment of the Output_section_data.
12176 * testsuite/copy_test.cc: New file.
12177 * testsuite/copy_test_1.cc: New file.
12178 * testsuite/copy_test_2.cc: New file.
12179 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12180 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12181 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12182 (copy_test_1_pic.o, copy_test_1.so): New targets.
12183 (copy_test_2_pic.o, copy_test_2.so): New targets.
12184 * testsuite/Makefile.in: Rebuild.
12185
12186 * script-sections.cc (Script_sections::place_orphan): Initialize
12187 local variable exact.
12188
12189 2008-06-13 David Edelsohn <edelsohn@gnu.org>
12190
12191 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12192
12193 2008-06-12 David Edelsohn <edelsohn@gnu.org>
12194 David S. Miller <davem@davemloft.net>
12195
12196 * powerpc.cc: New file.
12197 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12198 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12199 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12200 * Makefile.in: Rebuild.
12201
12202 2008-06-09 Ian Lance Taylor <iant@google.com>
12203
12204 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12205 <exception>.
12206 (throwing, orig_terminate): New static variables.
12207 (terminate_handler): New static function.
12208 (t2): Set terminate handler.
12209
12210 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12211
12212 PR 6584
12213 * binary.cc (Binary_to_elf::sized_convert): Fix .data
12214 alignment.
12215
12216 2008-05-30 Cary Coutant <ccoutant@google.com>
12217
12218 * archive.cc (Archive::include_all_members) Correct to step
12219 over symbol table and extended name table in thin archives.
12220
12221 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12222
12223 PR 6407
12224 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12225 calculation.
12226
12227 2008-05-28 Caleb Howe <cshowe@google.com>
12228
12229 * reduced_debug_output.cc: New file.
12230 * reduced_debug_output.h: New file.
12231 * options.h (class General_options): Add --strip-debug-non-line.
12232 * options.cc (General_options::finalize): Add strip_debug_non_line
12233 to the strip heirarchy.
12234 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12235 fields.
12236 * layout.cc: Include "reduced_debug_output.h".
12237 (Layout::Layout): Initialize new fields.
12238 (line_only_debug_sections): New static array.
12239 (is_lines_only_debug_sections): New static inline function.
12240 (Layout::include_section): Handle --strip-debug-non-line.
12241 (Layout::make_output_section): If --strip-debug-non-line, build
12242 new output sections for .debug_abbrev and .debug_info.
12243 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12244 gold. Warn about possible overflow.
12245 (read_signed_LEB_128): Likewise.
12246 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12247 (read_signed_LEB_128): Declare.
12248 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12249 (HFILES): Add reduced_debug_output.h.
12250 * Makefile.in: Rebuild.
12251
12252 2008-05-21 Ian Lance Taylor <iant@google.com>
12253
12254 * mapfile.cc: New file.
12255 * mapfile.h: New file.
12256 * options.h (class General_options): Add -M/--print-map and -Map.
12257 * options.cc (General_options::finalize): Make -M equivalent to
12258 -Map -.
12259 * main.cc: Include <cstdio> and "mapfile.h".
12260 (main): Open mapfile if requested.
12261 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12262 constructor. Change caller.
12263 (queue_initial_tasks): Add mapfile parameter. Change caller.
12264 (queue_middle_tasks): Likewise.
12265 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12266 declarations.
12267 * archive.cc: Include "mapfile.h".
12268 (Archive::add_symbols): Add mapfile parameter. Change all
12269 callers. Pass mapfile, symbol, and reason to include_member.
12270 (Archive::include_all_members): Add mapfile parameter. Change all
12271 callers.
12272 (Archive::include_member): Add mapfile, sym, and why parameters.
12273 Change all callers. Report inclusion to map file.
12274 * archive.h: Include "fileread.h".
12275 (class Archive): Update declarations.
12276 (Archive::file): New const method.
12277 (class Add_archive_symbols): Add mapfile_ field. Update
12278 constructor. Change all callers.
12279 * readsyms.h (class Read_symbols): Likewise.
12280 (class Finish_group): Likewise.
12281 (class Read_script): Likewise.
12282 * common.cc: Include "mapfile.h".
12283 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12284 all callers.
12285 (Symbol_table::do_allocate_commons): Likewise.
12286 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12287 symbol allocation to mapfile.
12288 * common.h (class Allocate_commons_task): Add mapfile_ field.
12289 Update constructor. Change all callers.
12290 * symtab.h (class Symbol_table): Update declarations.
12291 * layout.cc: Include "mapfile.h".
12292 (Layout_task_runner::run): Print information to mapfile.
12293 (Layout::create_gold_note): Change Output_data_fixed_space to
12294 Output_data_zero_fill.
12295 (Layout::create_build_id): Likewise.
12296 (Layout::print_to_mapfile): New function.
12297 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12298 constructor. Change caller.
12299 (class Layout): Declare print_to_mapfile.
12300 * output.cc (Output_section::Input_section::print_to_mapfile): New
12301 function.
12302 (Output_section::add_input_section): If producing a map, always
12303 add to input_sections_ list.
12304 (Output_section::do_print_to_mapfile): New function.
12305 (Output_segment::print_sections_to_mapfile): New function.
12306 (Output_segment::print_section_list_to_mapfile): New function.
12307 * output.h: Include "mapfile.h".
12308 (Output_data::print_to_mapfile): New function.
12309 (Output_data::do_print_to_mapfile): New virtual function.
12310 (Output_segment_headers::do_print_to_mapfile): New function.
12311 (Output_file_header::do_print_to_mapfile): New function.
12312 (Output_data_const::do_print_to_mapfile): New function.
12313 (class Output_data_const_buffer): Add map_name_ field. Update
12314 constructor. Change all callers. Add do_print_to_mapfile
12315 function.
12316 (class Output_data_fixed_space): Likewise.
12317 (class Output_data_space): Likewise.
12318 (class Output_data_zero_fill): New class.
12319 (Output_data_strtab::do_print_to_mapfile): New function.
12320 (Output_data_reloc_base::do_print_to_mapfile): New function.
12321 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12322 (Output_data_group::do_print_to_mapfile): New function.
12323 (Output_data_got::do_print_to_mapfile): New function.
12324 (Output_data_dynamic::do_print_to_mapfile): New function.
12325 (Output_symtab_xindex::do_print_to_mapfile): New function.
12326 (class Output_section): Declare do_print_to_mapflie. Declare
12327 print_to_mapfile in Input_section.
12328 (class Output_segment): Declare new functions.
12329 * object.h (Sized_relobj::symbol_count): New function.
12330 * script-sections.cc
12331 (Output_section_element_dot_assignment::set_section_addresses):
12332 Change Output_data_fixed_space to Output_data_zero_fill.
12333 (Output_data_expression::do_print_to_mapfile): New function.
12334 * script.cc (read_input_script): Add mapfile parameter. Change
12335 all callers.
12336 * script.h (read_input_script): Update declaration.
12337 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12338 (Eh_frame::do_print_to_mapfile): New function.
12339 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12340 (Output_merge_string::do_print_to_mapfile): New function.
12341 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12342 function.
12343 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12344 function.
12345 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12346 function.
12347 * Makefile.am (CCFILES): Add mapfile.cc.
12348 (HFILES): Add mapfile.h.
12349 * Makefile.in: Rebuild.
12350
12351 2008-05-19 Ian Lance Taylor <iant@google.com>
12352
12353 * options.h (class General_options): Add -z relro.
12354 * layout.cc (Layout::Layout): Initialize relro_segment_.
12355 (Layout::add_output_section_data): Return the output section.
12356 (Layout::make_output_section): Rcognize relro sections and mark
12357 them appropriately.
12358 (Layout::attach_allocated_section_to_segment): Put relro sections
12359 in a PT_GNU_RELRO segment.
12360 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12361 section as relro.
12362 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12363 PT_TLS segments.
12364 (Layout::linkonce_mapping): Map d.rel.ro.local to
12365 .data.rel.ro.local.
12366 (Layout::output_section_name): Us .data.rel.ro.local for any
12367 section which begins with that.
12368 * layout.h (class Layout): Update add_output_section_data
12369 declaration. Add relro_segment_ field.
12370 * output.cc (Output_section::Output_section): Initialize is_relro_
12371 and is_relro_local_ fields.
12372 (Output_segment::add_output_section): Group relro sections.
12373 (Output_segment::is_first_section_relro): New function.
12374 (Output_segment::maximum_alignment): If there is a relro section,
12375 align the segment to the common page size.
12376 (Output_segment::set_section_addresses): Track whether we are
12377 looking at relro sections. If the last section is a relro
12378 section, align to the common page size.
12379 (Output_segment::set_section_list_addresses): Add in_relro
12380 parameter. Change all callers. Align to the page size when
12381 moving from relro to non-relro section.
12382 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12383 segment.
12384 * output.h (class Output_section): Add is_relro_ and
12385 is_relro_local_ fields.
12386 (Output_section::is_relro): New function.
12387 (Output_section::set_is_relro): New function.
12388 (Output_section::is_relro_local): New function.
12389 (Output_section::set_is_relro_local): New function.
12390 (class Output_segment): Update declarations.
12391 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12392 * sparc.cc (Target_sparc::got_section): Likewise.
12393 * x86_64.cc (Target_x86_64::got_section): Likewise.
12394 * testsuite/relro_test_main.cc: New file.
12395 * testsuite/relro_test.cc: New file.
12396 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12397 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12398 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12399 (relro_test.so, relro_test_pic.o): New targets.
12400 * testsuite/Makefile.in: Rebuild.
12401
12402 2008-05-16 Ian Lance Taylor <iant@google.com>
12403
12404 * output.cc (Output_segment::add_output_section): Remove front
12405 parameter.
12406 * output.h (class Output_segment): Remove
12407 add_initial_output_section and overloaded add_output_section.
12408 Update declaration of remaining add_output_section.
12409 * layout.cc (Layout::create_interp): Call add_output_section
12410 rather than add_initial_output_section.
12411 (Layout::finish_dynamic_section): Likewise.
12412
12413 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12414 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12415 know the dynamic type.
12416 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12417 field. Initialize it in constructor.
12418 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12419 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12420 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12421 reloc.
12422
12423 * output.cc (Output_reloc::get_address): Change return type to
12424 Elf_Addr.
12425 * output.h (class Output_reloc): Update get_address declaration.
12426 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12427 for section addresses.
12428
12429 2008-05-09 Ian Lance Taylor <iant@google.com>
12430
12431 PR 6493
12432 * gold.cc (gold_nomem): Use return value of write.
12433
12434 2008-05-08 Ian Lance Taylor <iant@google.com>
12435
12436 * symtab.c (Symbol::init_base_output_data): Add version
12437 parameter. Change all callers.
12438 (Symbol::init_base_output_segment): Likewise.
12439 (Symbol::init_base_constant): Likewise.
12440 (Symbol::init_base_undefined): Likewise.
12441 (Sized_symbol::init_output_data): Likewise.
12442 (Sized_symbol::init_output_segment): Likewise.
12443 (Sized_symbol::init_constant): Likewise.
12444 (Sized_symbol::init_undefined): Likewise.
12445 (Symbol_table::do_define_in_output_data): If the new symbol has a
12446 version, mark it as the default.
12447 (Symbol_table::do_define_in_output_segment): Likewise.
12448 (Symbol_table::do_define_as_constant): Likewise.
12449 * symtab.h (class Symbol): Update declarations.
12450 (class Sized_symbol): Likewise.
12451 * resolve.cc (Symbol::override_version): New function.
12452 (Symbol::override_base): Call override_version.
12453 (Symbol::override_base_with_special): Likewise.
12454 * testsuite/ver_script_8.script: New file.
12455 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12456 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12457 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12458 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12459
12460 2008-05-06 Ian Lance Taylor <iant@google.com>
12461
12462 PR 6049
12463 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12464 functions.
12465 (class General_options): Remove existing --undefined, and add
12466 --no-undefined instead. Add new --undefined as synonym for -u.
12467 * archive.cc (Archive::add_symbols): Check whether symbol was
12468 named with -u.
12469 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12470 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12471 all uses. Add IS_UNDEFINED. Update declarations to split
12472 different versions of init_base. Declare init_base_undefined.
12473 (Symbol::is_defined): Handle IS_UNDEFINED.
12474 (Symbol::is_undefined): Likewise.
12475 (Symbol::is_weak_undefined): Call is_undefined.
12476 (Symbol::is_absolute): Handle IS_CONSTANT.
12477 (class Sized_symbol): Update declarations to split different
12478 versions of init. Declare init_undefined.
12479 (class Symbol_table): Declare new functions.
12480 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12481 Change all callers.
12482 (Symbol::init_base_output_data): Likewise.
12483 (Symbol::init_base_output_segment): Likewise.
12484 (Symbol::init_base_constant): Likewise.
12485 (Symbol::init_base_undefined): New function.
12486 (Sized_symbol::init_object): Rename from init. Change all
12487 callers.
12488 (Sized_symbol::init_output_data): Likewise.
12489 (Sized_symbol::init_output_segment): Likewise.
12490 (Sized_symbol::init_constant): Likewise.
12491 (Sized_symbol::init_undefined): New function.
12492 (Symbol_table::add_undefined_symbols_from_command_line): New
12493 function.
12494 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12495 function.
12496 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12497 (Symbol::output_section): Likewise.
12498 (Symbol::set_output_section): Likewise.
12499 (Symbol_table::sized_finalize_symbol): Likewise.
12500 (Symbol_table::sized_write_globals): Likewise.
12501 * resolve.cc (Symbol_table::should_override): Likewise.
12502 (Symbol::override_base_with_special): Likewise.
12503
12504 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12505 symbol, change it to have default visibility.
12506 * testsuite/protected_1.cc: New file.
12507 * testsuite/protected_2.cc: New file.
12508 * testsuite/protected_3.cc: New file.
12509 * testsuite/protected_main_1.cc: New file.
12510 * testsuite/protected_main_2.cc: New file.
12511 * testsuite/protected_main_3.cc: New file.
12512 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12513 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12514 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12515 (protected_1.so): New target.
12516 (protected_1_pic.o, protected_2_pic.o): New targets.
12517 (protected_3_pic.o): New target.
12518 (check_PROGRAMS): Add protected_2.
12519 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12520 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12521 * testsuite/Makefile.in: Rebuild.
12522
12523 * options.h (DEFINE_var): Add set_user_set_##varname__.
12524 (DEFINE_bool_alias): New macro.
12525 (class General_options): Define -Bstatic using DEFINE_bool_alias
12526 rather than DEFINE_special. Add --undefined as an alias for -z
12527 defs.
12528 * options.cc (General_options::parse_Bstatic): Remove.
12529
12530 * options.h (class General_options): Add --fatal-warnings.
12531 * main.cc (main): Implement --fatal-warnings.
12532 * errors.h (Errors::warning_count): New function.
12533
12534 * options.h (class General_options): Add -Bsymbolic-functions.
12535 * symtab.h (Symbol::is_preemptible): Check for
12536 -Bsymbolic-functions.
12537
12538 2008-05-05 Ian Lance Taylor <iant@google.com>
12539
12540 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12541 as noVARNAME rather than no-VARNAME.
12542 (class General_options): Add option -z combreloc.
12543 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12544 get_address.
12545 (Output_reloc::sort_before) [SHT_REL]: New function.
12546 (Output_reloc::sort_before) [SHT_RELA]: New function.
12547 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12548 Sort_relocs_comparison.
12549 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12550 parameter. Change all callers.
12551 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12552 sort_relocs parameter. Change all callers.
12553 * output.cc (Output_reloc::get_address): New function, broken out
12554 of write_rel.
12555 (Output_reloc::write_rel): Call it.
12556 (Output_reloc::compare): New function.
12557 (Output_data_reloc_base::do_write): Optionally sort relocs.
12558
12559 * configure.ac: If targ_extra_obj is set, link it in.
12560 * configure.tgt: Initialize all variables.
12561 (x86_64*): Set targ_extra_obj and targ_extra_size.
12562 * configure: Rebuild.
12563
12564 * object.cc (Sized_relobj::include_section_group): Adjust section
12565 indexes read from group data. Build vector to pass to
12566 layout_group.
12567 * layout.cc (Layout::layout_group): Add flags and shndxes
12568 parameters. Remove contents parameter. Change caller. Update
12569 explicit instantiations.
12570 * layout.h (class Layout): Update layout_group declaration.
12571 * output.cc (Output_data_group::Output_data_group): Add flags and
12572 input_shndxes parameters. Remove contents parameter. Change
12573 caller.
12574 (Output_data_group::do_write): Change input_sections_ to
12575 input_shndxes_.
12576 * output.h (class Output_data_group): Update constructor
12577 declaration. Rename input_sections_ to input_shndxes_.
12578 * testsuite/many_sections_test.cc: Add template.
12579
12580 2008-04-30 Cary Coutant <ccoutant@google.com>
12581
12582 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12583
12584 * layout.cc (Layout::include_section): Refactored check for debug
12585 info section.
12586 (Layout::add_comdat): Add new parameters. Change type
12587 of signature parameter. Add object and shndx to signatures table.
12588 (Layout::find_kept_object): New function.
12589 * layout.h: Include <cstring>.
12590 (Layout::is_debug_info_section): New function.
12591 (Layout::add_comdat): Add new parameters.
12592 (Layout::find_kept_object): New function.
12593 (Layout::Kept_section): New struct.
12594 (Layout::Signatures): Change type of map range.
12595 * object.cc (Relobj::output_section_address): New function.
12596 (Sized_relobj::include_section_group): Add new parameters. Change
12597 calls to Layout::add_comdat. Change to build table of kept comdat
12598 groups and table mapping discarded sections to kept sections.
12599 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12600 (Sized_relobj::do_layout): Change calls to include_section_group and
12601 include_linkonce_section.
12602 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12603 value to zero when section is discarded.
12604 (Sized_relobj::map_to_kept_section): New function.
12605 * object.h (Relobj::output_section_address): New function.
12606 (Relobj::Comdat_group): New type.
12607 (Relobj::find_comdat_group): New function.
12608 (Relobj::Comdat_group_table): New type.
12609 (Relobj::Kept_comdat_section): New type.
12610 (Relobj::Kept_comdat_section_table): New type.
12611 (Relobj::add_comdat_group): New function.
12612 (Relobj::set_kept_comdat_section): New function.
12613 (Relobj::get_kept_comdat_section): New function.
12614 (Relobj::comdat_groups_): New field.
12615 (Relobj::kept_comdat_sections_): New field.
12616 (Symbol_value::input_value): Update comment.
12617 (Sized_relobj::map_to_kept_section) New function.
12618 (Sized_relobj::include_linkonce_section): Add new parameter.
12619 * target-reloc.h (Comdat_behavior): New type.
12620 (get_comdat_behavior): New function.
12621 (relocate_section): Add code to map a discarded section to the
12622 corresponding kept section when applying a relocation.
12623
12624 2008-04-30 Craig Silverstein <csilvers@google.com>
12625
12626 * dwarf_reader.cc (next_generation_count): New static var.
12627 (Addr2line_cache_entry): New struct.
12628 (addr2line_cache): New static var.
12629 (Dwarf_line_info::one_addr2line): Added caching.
12630 (Dwarf_line_info::clear_addr2line_cache): New function.
12631 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12632 cache-size parameter.
12633 (Dwarf_line_info::one_addr2line_cache): New function.
12634 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12635 new cache-size argument to one_addr2line(), and clear cache.
12636
12637 2008-04-28 Cary Coutant <ccoutant@google.com>
12638
12639 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12640 R_386_PC8 relocations.
12641
12642 2008-04-23 Ian Lance Taylor <iant@google.com>
12643
12644 * object.cc (Sized_relobj::include_section_group): Check for
12645 invalid section group.
12646
12647 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12648 header size.
12649
12650 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12651 than read for file header.
12652 * archive.cc (Archive::include_member): Likewise.
12653
12654 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12655
12656 * aclocal.m4: Regenerate.
12657 * configure: Regenerate.
12658
12659 2008-04-19 Ian Lance Taylor <iant@google.com>
12660
12661 * version.cc (version_string): Bump to 1.6.
12662
12663 * testsuite/Makefile.am (many_sections_r_test): New target.
12664 (many_sections_r_test_SOURCES): Remove.
12665 (many_sections_r_test_DEPENDENCIES): Remove.
12666 (many_sections_r_test_LDFLAGS): Remove.
12667 (many_sections_r_test_LDADD): Remove.
12668
12669 * object.cc (Sized_relobj::do_add_symbols): Always pass
12670 local_symbol_count_ to add_from_relobj.
12671
12672 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12673 every thousand variables.
12674 * testsuite/Makefile.in: Rebuild.
12675
12676 * object.cc (Xindex::initialize_symtab_xindex): New function.
12677 (Xindex::read_symtab_xindex): New function.
12678 (Xindex::sym_xindex_to_shndx): New function.
12679 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12680 available.
12681 (Sized_relobj::do_initialize_xindex): New function.
12682 (Sized_relobj::do_read_symbols): Adjust section links.
12683 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12684 parameter. Change all callers.
12685 (Sized_relobj::include_section_group): Adjust section links and
12686 symbol section indexes.
12687 (Sized_relobj::do_layout): Adjust section links.
12688 (Sized_relobj::do_count_local_symbols): Adjust section links and
12689 symbol section indexes.
12690 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12691 ordinary and special symbols.
12692 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12693 dynsym_xindex parameters. Change all callers. Adjust section
12694 links. Use SHN_XINDEX when needed.
12695 (Sized_relobj::get_symbol_location_info): Adjust section links.
12696 Don't get fooled by special symbols.
12697 * object.h (class Xindex): Define.
12698 (class Object): Add xindex_ parameter. Declare virtual functoin
12699 do_initialize_xindex.
12700 (Object::adjust_sym_shndx): New function.
12701 (Object::set_xindex): New protected function.
12702 (class Symbol_value): Add is_ordinary_shndx_ field.
12703 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12704 (Symbol_value::value): Assert ordinary section.
12705 (Symbol_value::initialize_input_to_output_map): Likewise.
12706 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12707 Change all callers.
12708 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12709 all callers.
12710 (class Sized_relobj): Update declarations.
12711 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12712 parameter. Change all callers.
12713 (Sized_relobj::adjust_shndx): New function.
12714 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12715 field.
12716 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12717 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12718 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12719 (Sized_dynobj::read_dynsym_section): Adjust section links.
12720 (Sized_dynobj::read_dynamic): Likewise.
12721 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12722 section links.
12723 (Sized_dynobj::do_initialize_xindex): New function.
12724 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12725 do_initialize_xindex.
12726 (Sized_dynobj::adjust_shndx): New function.
12727 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12728 dynsym_xindex_ fields.
12729 (Layout::finalize): Add a call to set_section_indexes before
12730 creating the symtab sections.
12731 (Layout::set_section_indexes): Don't do anything if the section
12732 already has a section index.
12733 (Layout::create_symtab_sections): Add shnum parameter. Change
12734 caller. Create .symtab_shndx section if needed.
12735 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12736 caller.
12737 (Layout::allocated_output_section_count): New function.
12738 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12739 needed.
12740 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12741 fields. Update declarations.
12742 (Layout::symtab_xindex): New function.
12743 (Layout::dynsym_xindex): New function.
12744 (class Write_symbols_task): Add layout_ field.
12745 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12746 Change caller.
12747 * output.cc (Output_section_headers::Output_section_headers): Add
12748 shstrtab_section parameter. Change all callers.
12749 (Output_section_headers::do_sized_write): Store overflow values
12750 for section count and section string table section index in
12751 section header zero.
12752 (Output_file_header::do_sized_write): Check for overflow of
12753 section count and section string table section index.
12754 (Output_symtab_xindex::do_write): New function.
12755 (Output_symtab_xindex::endian_do_write): New function.
12756 * output.h (class Output_section_headers): Add shstrtab_section_.
12757 Update declarations.
12758 (class Output_symtab_xindex): Define.
12759 (Output_section::has_out_shndx): New function.
12760 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12761 field.
12762 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12763 Change all callers.
12764 (Sized_symbol::init): Likewise.
12765 (Symbol::output_section): Check for ordinary symbol.
12766 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12767 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12768 callers.
12769 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12770 Change all callers. Simplify handling of symbols from sections
12771 not included in the link.
12772 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12773 distinction.
12774 (Weak_alias_sorter::operator()): Assert that symbols are
12775 ordinary.
12776 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12777 distinction.
12778 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12779 parameters. Change all callers.
12780 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12781 symbol distinction. Use SHN_XINDEX when needed.
12782 (Symbol_table::write_section_symbol): Add symtab_xindex
12783 parameter. Change all callers.
12784 (Symbol_table::sized_write_section_symbol): Likewise. Use
12785 SHN_XINDEX when needed.
12786 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12787 declarations.
12788 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12789 (Symbol::is_defined): Check is_ordinary.
12790 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12791 (Symbol::is_absolute, Symbol::is_common): Likewise.
12792 (class Sized_symbol): Update declarations.
12793 (class Symbol_table): Update declarations.
12794 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12795 parameters. Change all callers.
12796 (Sized_symbol::override): Likewise.
12797 (Symbol_table::override): Likewise.
12798 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12799 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12800 is_ordinary, and orig_st_shndx parameters. Change all callers.
12801 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12802 to be in an ordinary section.
12803 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12804 object and is_ordinary parameters. Change all callers.
12805 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12806 Change all callers. Don't add undefined or non-ordinary symbols
12807 to reloc_map_.
12808 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12809 Change all callers.
12810 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12811 declarations.
12812 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12813 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12814 (Sized_relobj::relocate_sections): Likewise.
12815 * target-reloc.h (scan_relocs): Adjust section symbol index.
12816 (scan_relocatable_relocs): Likewise.
12817 * i386.cc (Scan::local): Check for ordinary symbols.
12818 * sparc.cc (Scan::local): Likewise.
12819 * x86_64.cc (Scan::local): Likewise.
12820 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12821 to symbol_section_and_value.
12822 * testsuite/many_sections_test.cc: New file.
12823 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12824 (check_PROGRAMS): Add many_sections_test.
12825 (many_sections_test_SOURCES): Define.
12826 (many_sections_test_DEPENDENCIES): Define.
12827 (many_sections_test_LDFLAGS): Define.
12828 (BUILT_SOURCES): Add many_sections_define.h.
12829 (many_sections_define.h): New target.
12830 (BUILT_SOURCES): Add many_sections_check.h.
12831 (many_sections_check.h): New target.
12832 (check_PROGRAMS): Add many_sections_r_test.
12833 (many_sections_r_test_SOURCES): Define.
12834 (many_sections_r_test_DEPENDENCIES): Define.
12835 (many_sections_r_test_LDFLAGS): Define.
12836 (many_sections_r_test_LDADD): Define.
12837 (many_sections_r_test.o): New target.
12838 * testsuite/Makefile.in: Rebuild.
12839
12840 2008-04-17 Cary Coutant <ccoutant@google.com>
12841
12842 * errors.cc (Errors::info): New function.
12843 (gold_info): New function.
12844 * errors.h (Errors::info): New function.
12845 * gold.h (gold_info): New function.
12846 * object.cc (Input_objects::add_object): Print trace output.
12847 * options.cc (options::parse_set): New function.
12848 (General_options::parse_wrap): Deleted.
12849 (General_options::General_options): Deleted initializer.
12850 * options.h (options::String_set): New typedef.
12851 (options::parse_set): New function.
12852 (DEFINE_set): New macro.
12853 (General_options::wrap): Changed to use DEFINE_set. Changed
12854 callers of any_wrap_symbols and is_wrap_symbol.
12855 (General_options::trace, General_options::trace_symbol):
12856 New options.
12857 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12858 (General_options::wrap_symbols_): Deleted.
12859 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12860
12861 2008-04-17 David S. Miller <davem@davemloft.net>
12862
12863 * options.cc (General_options::parse_V): New function.
12864 * options.h: Add entries for -V and -Qy.
12865
12866 2008-04-17 Ian Lance Taylor <iant@google.com>
12867
12868 * common.cc (Symbol_table::allocate_commons): Remove options
12869 parameter. Change caller.
12870 (Symbol_table::do_allocate_commons): Remove options parameter.
12871 Change caller. Just call do_allocate_commons_list twice.
12872 (Symbol_table::do_allocate_commons_list): New function, broken out
12873 of do_allocate_commons.
12874 * common.h (class Allocate_commons_task): Remove options_ field.
12875 Update constructor.
12876 * symtab.cc (Symbol_table::Symbol_table): Initialize
12877 tls_commons_.
12878 (Symbol_table::add_from_object): Put TLS common symbols on
12879 tls_commons_ list.
12880 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12881 which are IN_OUTPUT_DATA.
12882 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12883 allocate_commons and do_allocate_commons declarations. Declare
12884 do_allocate_commons_list.
12885 * gold.cc (queue_middle_tasks): Update creation of
12886 Allocate_commons_task to not pass options.
12887 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12888 (TLS_TEST_C_FLAGS): New variable.
12889 (tls_test_c_pic.o): New target.
12890 (tls_test_shared.so): Link in tls_test_c_pic.o.
12891 (tls_test_c_pic_ie.o): New target.
12892 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12893 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12894 (tls_test_c.o): New target.
12895 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12896 (tls_pic_test_LDADD): Likewise.
12897 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12898 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12899 (tls_test_c_gnu2.o): New target.
12900 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12901 tls_test_c_gnu2.o.
12902 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12903 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12904 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12905 * testsuite/tls_test.cc: Include "config.h".
12906 (t_last): Call t11_last.
12907 * testsuite/tls_test.h (t11, t11_last): Declare.
12908 * testsuite/tls_test_c.c: New file.
12909 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12910 * configure.ac: Check for OpenMP support.
12911 * configure, config.in, Makefile.in: Rebuild.
12912 * testsuite/Makefile.in: Rebuild.
12913
12914 2008-04-16 Cary Coutant <ccoutant@google.com>
12915
12916 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12917 (Target_i386::tls_base_symbol_defined_): New field.
12918 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12919 (Target_i386::Scan::global): Likewise.
12920 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12921 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12922 (Target_x86_64::tls_base_symbol_defined_): New field.
12923 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12924 (Target_x86_64::Scan::global): Likewise.
12925
12926 2008-04-16 Cary Coutant <ccoutant@google.com>
12927
12928 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12929 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12930 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12931 building shared libraries.
12932 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12933 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12934 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12935 * testsuite/Makefile.in: Rebuild.
12936 * testsuite/weak_undef.h: New file.
12937 * testsuite/weak_undef_file1.cc: Add extra test cases.
12938 * testsuite/weak_undef_file2.cc: Likewise.
12939 * testsuite/weak_undef_test.cc: Likewise.
12940
12941 2008-04-16 David S. Miller <davem@davemloft.net>
12942
12943 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12944 Add issued_non_pic_error_ field. Declare check_non_pic.
12945 (Target_sparc::Scan::check_non_pic): New function.
12946 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12947 (Target_sparc::Scan::global): Likewise.
12948
12949 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12950 * configure: Rebuild.
12951
12952 * options.h (DEFINE_enable): New macro.
12953 (new_dtags): New enable option.
12954 (initfirst, interpose, loadfltr, nodefaultlib,
12955 nodelete, nodlopen, nodump): New -z options.
12956 * layout.cc (Layout:finish_dynamic_section): If new
12957 dtags enabled, emit DT_RUNPATH. Also, emit a
12958 DT_FLAGS_1 containing any specified -z flags.
12959
12960 2008-04-16 Ian Lance Taylor <iant@google.com>
12961
12962 * copy-relocs.cc: New file.
12963 * copy-relocs.h: New file.
12964 * reloc.cc: Remove Copy_relocs code.
12965 * reloc.h: Likewise.
12966 * reloc-types.h (struct Reloc_types) [both versions]: Add
12967 get_reloc_addend_noerror.
12968 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12969 variants of add_global which take an addend which must be zero.
12970 * i386.cc: Include "copy-relocs.h".
12971 (class Target_i386): Change type of copy_relocs_ to variable,
12972 update initializer.
12973 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12974 Change all callers.
12975 (Target_i386::do_finalize_sections): Change handling of
12976 copy_relocs_.
12977 * sparc.cc: Include "copy-relocs.h".
12978 (class Target_sparc): Change type of copy_relocs_ to variable,
12979 update initializer.
12980 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12981 Change all callers.
12982 (Target_sparc::do_finalize_sections): Change handling of
12983 copy_relocs_.
12984 * x86_64.cc: Include "copy-relocs.h".
12985 (class Target_x86_64): Change type of copy_relocs_ to variable,
12986 update initializer.
12987 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12988 class. Change all callers.
12989 (Target_x86_64::do_finalize_sections): Change handling of
12990 copy_relocs_.
12991 * Makefile.am (CCFILES): Add copy-relocs.cc.
12992 (HFILES): Add copy-relocs.h.
12993
12994 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12995
12996 * testsuite/script_test_4.sh: Permit leading zeroes.
12997
12998 2008-04-15 Ian Lance Taylor <iant@google.com>
12999
13000 * script-sections.cc (Script_sections::create_segments): Use
13001 header_size_adjustment even when there is enough room for the
13002 headers.
13003 * testsuite/script_test_4.sh: New file.
13004 * testsuite/script_test_4.t: New file.
13005 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13006 (check_DATA): Add script_test_4.stdout.
13007 (MOSTLYCLEANFILES): Likewise.
13008 (script_test_4): New target.
13009 (script_test_4.stdout): New target.
13010 * testsuite/Makefile.in: Rebuild.
13011
13012 * sparc.cc: Add definitions for Output_data_plt_sparc class
13013 constants.
13014
13015 2008-04-14 David S. Miller <davem@davemloft.net>
13016
13017 * sparc.cc: New file.
13018 * Makefile.am (TARGETSOURCES): Add sparc.cc
13019 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13020 * configure.tgt: Document targ_extra_size and
13021 targ_extra_big_endian. Add entries for sparc-* and
13022 sparc64-*.
13023 * configure.ac: Handle targ_extra_size and
13024 targ_extra_big_endian.
13025 * Makefile.in: Rebuild.
13026 * configure: Likewise.
13027 * po/POTFILES.in: Likewise.
13028 * po/gold.pot: Likewise.
13029
13030 2008-04-14 Ian Lance Taylor <iant@google.com>
13031
13032 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13033 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13034 in the name/type/flags to section mapping. Don't call
13035 allocate_output_section.
13036 (Layout::choose_output_section): Change parameter from adjust_name
13037 to is_input_section. Don't permit input sections after sections
13038 are attached to segments. Don't call allocate_output_section.
13039 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13040 not write_enable_output_section.
13041 (Layout::make_output_section): Don't push to
13042 unattached_section_list_ nor call attach_to_segment. Call
13043 attach_section_to_segment if sections are attached.
13044 (Layout::attach_sections_to_segments): New function.
13045 (Layout::attach_section_to_segment): New function.
13046 (Layout::attach_allocated_section_to_segment): Rename from
13047 attach_to_segment. Remove flags parameter.
13048 (Layout::allocate_output_section): Remove function.
13049 (Layout::write_enable_output_section): Remove function.
13050 * layout.h (class Layout): Update for above changes. Add new
13051 field sections_are_attached_.
13052 * output.h (Output_section::update_flags_for_input_section): New
13053 function.
13054 * output.cc (Output_section::add_input_section): Call
13055 update_flags_for_input_section.
13056 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13057
13058 2008-04-11 Cary Coutant <ccoutant@google.com>
13059
13060 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13061 thought unnecessary.
13062 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13063
13064 2008-04-11 Ian Lance Taylor <iant@google.com>
13065
13066 * output.h (class Output_section_data): Remove inline definition
13067 of set_addralign.
13068 * output.cc (Output_section_data::set_addralign): New function.
13069
13070 2008-04-11 Cary Coutant <ccoutant@google.com>
13071
13072 Add support for TLS descriptors for i386 and x86_64.
13073 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13074 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13075 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13076 GOT_TYPE_TLS_DESC.
13077 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13078 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13079 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13080 relocations.
13081 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13082 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13083 Fix problem with initial-exec relocations.
13084 (Target_i386::Relocate::relocate_tls): Likewise.
13085 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13086 relaxation.
13087 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13088 support for section-plus-offset dynamic table entries.
13089 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13090 (Output_data_dynamic::Dynamic_entry): Add support for
13091 section-plus-offset dynamic table entries.
13092 (Output_data_dynamic::Classification): Likewise.
13093 (Output_data_dynamic::classification_): Renamed offset_.
13094 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13095 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13096 (Target_x86_64::make_plt_section): New function.
13097 (Target_x86_64::reserve_tlsdesc_entries): New function.
13098 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13099 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13100 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13101 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13102 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13103 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13104 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13105 add extra PLT entry for TLS descriptors.
13106 (Output_data_plt_x86_64::got_): New field.
13107 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13108 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13109 fields.
13110 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13111 descriptors.
13112 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13113 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13114 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13115 R_386_TLS_DESC_CALL relocations.
13116 (Target_x86_64::Scan::global): Likewise.
13117 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13118 for TLS descriptors.
13119 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13120 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13121 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13122 GD-to-IE relaxation.
13123 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13124 and TLS_DESCRIPTORS.
13125 * Makefile.in: Rebuild.
13126 * configure: Rebuild.
13127 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13128 (tls_test_shared2.so): New target.
13129 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13130 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13131 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13132 (tls_shared_gd_to_ie_test_LDADD): New variable.
13133 (tls_shared_gnu2_gd_to_ie_test): New target.
13134 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13135 New targets.
13136 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13137 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13138 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13139 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13140 (tls_shared_gnu2_test): New target.
13141 (tls_test_gnu2_shared.so): New target.
13142 (tls_shared_gnu2_test_SOURCES): New variable.
13143 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13144 (tls_shared_gnu2_test_LDFLAGS): New variable.
13145 (tls_shared_gnu2_test_LDADD): New variable.
13146 * testsuite/Makefile.in: Rebuild.
13147 * testsuite/Makefile.
13148
13149 2008-04-11 Ian Lance Taylor <iant@google.com>
13150
13151 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13152 justsyms.t.
13153 * testsuite/Makefile.in: Rebuild.
13154
13155 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13156 long.
13157 * testsuite/script_test_2.cc (main): Adjust test.
13158
13159 2008-04-11 David S. Miller <davem@davemloft.net>
13160 Ian Lance Taylor <iant@google.com>
13161
13162 * options.h (General_options): Add entries for '-Y' and
13163 '-relax'.
13164 * options.cc (General_options:finalize): If -Y was used, add those
13165 entries to the library path instead of the default "/lib" and
13166 "/usr/lib".
13167
13168 2008-04-11 David S. Miller <davem@davemloft.net>
13169
13170 * testsuite/justsyms.t: Start at 0x100.
13171 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
13172 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13173 long.
13174 * testsuite/script_test_2.cc: Adjust string and section length
13175 checks.
13176
13177 2008-04-09 Ian Lance Taylor <iant@google.com>
13178
13179 PR gold/5996
13180 * script-sections.cc (Sections_element::allocate_to_segment): Add
13181 orphan parameter.
13182 (Output_section_definition::allocate_to_segment): Likewise.
13183 (Orphan_output_section::allocate_to_segment): Likewise.
13184 (Script_sections::attach_sections_using_phdrs_clause): Don't
13185 propagate non-PT_LOAD segments to orphan sections.
13186 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13187 readelf rather than objdump.
13188 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13189 .interp section and PT_INTERP segment are the same size.
13190 * testsuite/Makefile.in: Rebuild.
13191
13192 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13193 aliases for symbols defined in the same object.
13194 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13195 (weak_alias_test_SOURCES): New variable.
13196 (weak_alias_test_DEPENDENCIES): New variable.
13197 (weak_alias_test_LDFLAGS): New variable.
13198 (weak_alias_test_LDADD): New variable.
13199 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13200 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13201 (weak_alias_test_3.o): New target.
13202 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13203 * testsuite/weak_alias_test_main.cc: New file.
13204 * testsuite/weak_alias_test_1.cc: New file.
13205 * testsuite/weak_alias_test_2.cc: New file.
13206 * testsuite/weak_alias_test_3.cc: New file.
13207
13208 2008-04-08 Ian Lance Taylor <iant@google.com>
13209
13210 * options.h (class General_options): Add --noinhibit-exec option.
13211 * main.cc (main): Check --noinhibit-exec.
13212
13213 * options.h (class General_options): Define --wrap as a special
13214 option. Add wrap_symbols_ field.
13215 (General_options::any_wrap_symbols): New function.
13216 (General_options::is_wrap_symbol): New function.
13217 * options.cc (General_options::parse_wrap): New function.
13218 (General_options::General_options): Initialize wrap_symbols_.
13219 * symtab.cc (Symbol_table::wrap_symbol): New function.
13220 (Symbol_table::add_from_object): Handle --wrap.
13221 * symtab.h (class Symbol_table): Declare wrap_symbol.
13222 * target.h (Target::wrap_char): New function.
13223 (Target::Target_info): Add wrap_char field.
13224 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13225 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13226 * testsuite/testfile.cc (Target_test::test_target_info):
13227 Likewise.
13228
13229 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13230 there is one.
13231
13232 * layout.h (class Layout): Add added_eh_frame_data_ field.
13233 * layout.cc (Layout::Layout): Initialize new field.
13234 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13235 output section until we find a section we merged successfully.
13236 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13237 that the size be non-zero.
13238
13239 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13240 qualifier.
13241
13242 2008-04-08 Craig Silverstein <csilvers@google.com>
13243
13244 * configure.ac: Export new conditional variable HAVE_ZLIB.
13245 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13246 on HAVE_ZLIB.
13247 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13248 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13249
13250 2008-04-07 Ian Lance Taylor <iant@google.com>
13251
13252 * version.cc (version_string): Set to "1.5".
13253
13254 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13255 Add issued_non_pic_error_ field. Declare check_non_pic.
13256 (Target_x86_64::Scan::check_non_pic): New function.
13257 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13258 (Target_x86_64::Scan::global): Likewise.
13259
13260 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13261 addend parameter. Change caller. Handle merge sections.
13262 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13263 Address to Addend. Don't add in the result of
13264 local_section_offset, pass down the addend and use the returned
13265 value.
13266 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13267 Update declarations of local_section_offset and symbol_value.
13268 * testsuite/two_file_test_1.cc (t18): New function.
13269 * testsuite/two_file_test_2.cc (f18): New function.
13270 * testsuite/two_file_test_main.cc (main): Call t18.
13271 * testsuite/two_file_test.h (t18, f18): Declare.
13272
13273 * configure.ac: Don't test for objdump, c++filt, or readelf.
13274 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13275 conditionals.
13276 (TEST_READELF): New variable.
13277 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13278 (check_PROGRAMS): Add two_file_strip_test.
13279 (two_file_strip_test): New target.
13280 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13281 (two_file_same_shared_strip_test_SOURCES): New variable.
13282 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13283 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13284 (two_file_same_shared_strip_test_LDADD): New variable.
13285 (two_file_shared_strip.so): New target.
13286 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13287 (ver_test_5.syms, ver_test_7.syms): Likewise.
13288 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13289 (strip_test_3.stdout): Use TEST_OBJDUMP.
13290 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13291
13292 2008-04-04 Cary Coutant <ccoutant@google.com>
13293
13294 * symtab.h (Symbol::is_weak_undefined): New function.
13295 (Symbol::is_strong_undefined): New function.
13296 (Symbol::is_absolute): New function.
13297 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13298 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13299 absolute symbols.
13300 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13301 (weak_undef_test): New target.
13302 * testsuite/Makefile.in: Rebuild.
13303 * testsuite/weak_undef_file1.cc: New file.
13304 * testsuite/weak_undef_file2.cc: New file.
13305 * testsuite/weak_undef_test.cc: New file.
13306
13307 2008-04-03 Craig Silverstein <csilvers@google.com>
13308
13309 * compressed_output.h (class Output_compressed_section): Use
13310 unsigned buffer.
13311 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13312 add zlib header.
13313 (zlib_compressed_suffix): Removed.
13314 (Output_compressed_section::set_final_data_size): Use unsigned
13315 buffers.
13316 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13317 Fix linker invocation.
13318 (flagstest_o_specialfile_and_compress_debug_sections):
13319 Likewise.
13320 * testsuite/Makefile.in: Regenerated.
13321
13322 2008-04-02 David S. Miller <davem@davemloft.net>
13323
13324 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13325 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13326
13327 2008-04-02 Craig Silverstein <csilvers@google.com>
13328
13329 * TODO: New file.
13330
13331 2008-04-02 Ian Lance Taylor <iant@google.com>
13332
13333 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13334 parameters. Update for new key type to views_. Change all
13335 callers.
13336 (File_read::read): Adjust for byteshift in returned view.
13337 (File_read::add_view): New function, broken out of
13338 find_and_make_view.
13339 (File_read::make_view): New function, broken out of
13340 find_and_make_view.
13341 (File_read::find_or_make_view): Add offset and aligned
13342 parameters. Rewrite accordingly. Change all callers.
13343 (File_read::get_view): Add offset and aligned parameters. Adjust
13344 for byteshift in return value.
13345 (File_read::get_lasting_view): Likewise.
13346 * fileread.h (class File_read): Update declarations.
13347 (class File_read::View): Add byteshift_ field. Add byteshift to
13348 constructor. Add byteshift method.
13349 * archive.h (Archive::clear_uncached_views): New function.
13350 (Archive::get_view): Add aligned parameter. Change all callers.
13351 * object.h (Object::get_view): Add aligned parameter. Change all
13352 callers.
13353 (Object::get_lasting_view): Likewise.
13354
13355 * fileread.cc (File_read::release): Don't call clear_views if
13356 there are multiple objects.
13357 * fileread.h (File_read::clear_uncached_views): New function.
13358 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13359 on the archive.
13360
13361 2008-03-31 Cary Coutant <ccoutant@google.com>
13362
13363 Add thin archive support.
13364 * archive.cc (Archive::armagt): New const.
13365 (Archive::setup): Remove task parameter and calls to unlock.
13366 (Archive::unlock_nested_archives): New function.
13367 (Archive::read_header): Add nested_off parameter. Change
13368 all callers.
13369 (Archive::interpret_header): Likewise.
13370 (Archive::include_all_members): Change to handle thin
13371 archives.
13372 (Archive::include_member): Likewise.
13373 * archive.h (Archive::Archive): Add new parameters and
13374 initializers.
13375 (Archive::armagt): New const.
13376 (Archive::setup): Remove task parameter.
13377 (Archive::unlock_nested_archives): New function.
13378 (Archive::read_header): Add nested_off parameter.
13379 (Archive::interpret_header): Likewise.
13380 (Archive::Nested_archive_table): New typedef.
13381 (Archive::is_thin_archive_): New field.
13382 (Archive::nested_archives_): New field.
13383 (Archive::options_): New field.
13384 (Archive::dirpath_): New field.
13385 (Archive::task_): New field.
13386 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13387 for thin archives. Pass additional parameters to
13388 Archive::Archive. Unlock the archive file after calling
13389 Archive::setup.
13390
13391 2008-03-29 Ian Lance Taylor <iant@google.com>
13392
13393 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13394 version symbol to be local.
13395 * testsuite/ver_test_4.sh: New file.
13396 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13397 (check_DATA): Add ver_test_4.syms.
13398 (ver_test_4.syms): New target.
13399 * testsuite/Makefile.in: Rebuild.
13400
13401 * output.cc
13402 (Output_section::Input_section_sort_entry::has_priority): New
13403 function.
13404 (Output_section::Input_section_sort_entry::match_file_name): New
13405 function.
13406 (Output_section::Input_section_sort_entry::match_section_name):
13407 Remove.
13408 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13409 Remove.
13410 (Output_section::Input_section_sort_entry::match_section_file):
13411 Remove.
13412 (Output_section::Input_section_sort_compare::operator()): Rewrite
13413 using new Input_section_sort_entry functions. Sort crtbegin and
13414 crtend first. Sort sections with no priority before sections with
13415 a priority.
13416 * testsuite/initpri1.c (d3): Check j != 4.
13417 (cd5): New constructor/destructor function.
13418 (main): Check j != 2.
13419
13420 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13421 new symbol when resolving, don't call set_is_default.
13422 * testsuite/ver_test_7.cc: New file.
13423 * testsuite/ver_test_7.sh: New file.
13424 * testsuite/Makefile.am (ver_test_7.so): New target.
13425 (ver_test_7.o): New target.
13426 (check_SCRIPTS): Add ver_test_7.sh.
13427 (check_DATA): Add ver_test_7.syms.
13428 (ver_test_7.syms): New target.
13429
13430 2008-03-28 Ian Lance Taylor <iant@google.com>
13431
13432 * layout.cc (Layout::layout): If we see an input section with a
13433 name that needs sorting, set the must_sort flag for the output
13434 section.
13435 (Layout::make_output_section): If the name of the output section
13436 indicates that it might require sorting, set the may_sort flag.
13437 * output.h (Output_section::may_sort_attached_input_sections): New
13438 function.
13439 (Output_section::set_may_sort_attached_input_sections): New
13440 function.
13441 (Output_section::must_sort_attached_input_sections): New
13442 function.
13443 (Output_section::set_must_sort_attached_input_sections): New
13444 function.
13445 (class Output_section): Declare Input_section_sort_entry. Define
13446 Input_section_sort_compare. Declare
13447 sort_attached_input_sections. Add new fields:
13448 may_sort_attached_input_sections_,
13449 must_sort_attached_input_sections_,
13450 attached_input_sections_are_sorted_.
13451 * output.cc (Output_section::Output_section): Initialize new
13452 fields.
13453 (Output_section::add_input_section): Add an entry to
13454 input_sections_ if may_sort or must_sort are true.
13455 (Output_section::set_final_data_size): Call
13456 sort_attached_input_sections if necessary.
13457 (Output_section::Input_section_sort_entry): Define new class.
13458 (Output_section::Input_section_sort_compare::operator()): New
13459 function.
13460 (Output_section::sort_attached_input_sections): New function.
13461 * configure.ac: Check whether the compiler supports constructor
13462 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13463 * testsuite/initpri1.c: New file.
13464 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13465 CONSTRUCTOR_PRIORITY.
13466 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13467 (initpri1_LDFLAGS): New variable.
13468 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13469
13470 2008-03-27 Ian Lance Taylor <iant@google.com>
13471
13472 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13473 * testsuite/common_test_1.c: New file.
13474 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13475 (common_test_1_SOURCES): New variable.
13476 (common_test_1_DEPENDENCIES): New variable.
13477 (common_test_1_LDFLAGS): New variable.
13478
13479 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13480 and commons_ correctly when NAME/VERSION does not override
13481 NAME/NULL.
13482 * testsuite/ver_test_6.c: New file.
13483 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13484 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13485 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13486
13487 2008-03-26 Ian Lance Taylor <iant@google.com>
13488
13489 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13490 of an undefined symbol from a version script.
13491 * testsuite/Makefile.am (ver_test_5.so): New target.
13492 (ver_test_5.o): New target.
13493 (check_SCRIPTS): Add ver_test_5.sh.
13494 (check_DATA): Add ver_test_5.syms.
13495 (ver_test_5.syms): New target.
13496 * testsuite/ver_test_5.cc: New file.
13497 * testsuite/ver_test_5.script: New file.
13498 * testsuite/ver_test_5.sh: New file.
13499 * Makefile.in, testsuite/Makefile.in: Rebuild.
13500
13501 PR gold/5986
13502 Fix problems building gold with gcc 4.3.0.
13503 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13504 (gold_error_at_location, gold_warning_at_location): Use it.
13505 * configure.ac: Check whether we can compile and use a template
13506 function with a printf attribute.
13507 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13508 when jumping over bytes.
13509 * object.cc: Instantiate Object::read_section_data.
13510 * debug.h: Include <cstring>
13511 * dwarf_reader.cc: Include <algorithm>
13512 * main.cc: Include <cstring>.
13513 * options.cc: Include <cstring>.
13514 * output.cc: Include <cstring>.
13515 * script.cc: Include <cstring>.
13516 * script.h: Include <string>.
13517 * symtab.cc: Include <cstring> and <algorithm>.
13518 * target-select.cc: Include <cstring>.
13519 * version.cc: Include <string>.
13520 * testsuite/testmain.cc: Include <cstdlib>.
13521 * configure, config.in: Rebuild.
13522
13523 2008-03-25 Ian Lance Taylor <iant@google.com>
13524
13525 * options.cc: Include "../bfd/bfdver.h".
13526 (options::help): Print bug reporting address.
13527
13528 * version.cc (print_version): Adjust output for current value of
13529 BFD_VERSION_STRING.
13530
13531 * NEWS: New file.
13532
13533 * options.cc (options::help): Print list of supported targets.
13534 * target-select.h: Include <vector>.
13535 (class Target_selector): Make machine_, size_, and is_big_endian_
13536 fields const. Add bfd_name_ and instantiated_target_ fields.
13537 (Target_selector::Target_selector): Add bfd_name parameter.
13538 (Target_selector::recognize): Make non-virtual, call
13539 do_recognize.
13540 (Target_selector::recognize_by_name): Make non-virtual, call
13541 do_recognize_by_name.
13542 (Target_selector::supported_names): New function.
13543 (Target_selector::bfd_name): New function.
13544 (Target_selector::do_instantiate_target): New pure virtual
13545 function.
13546 (Target_selector::do_recognize): New virtual function.
13547 (Target_selector::do_recognize_by_name): New virtual function.
13548 (Target_selector::instantiate_target): New private function.
13549 (supported_target_names): Declare.
13550 * target-select.cc (Target_selector::Target_selector): Update for
13551 new parameter and fields.
13552 (select_target_by_name): Check that the name matches before
13553 calling recognize_by_name.
13554 (supported_target_names): New function.
13555 * i386.cc (class Target_selector_i386): Update Target_selector
13556 constructor call. Remove recognize and recognize_by_name. Add
13557 do_instantiate_target.
13558 * x86_64.cc (class Target_selector_x86_64): Likewise.
13559 * testsuite/testfile.cc (class Target_selector_test): Update for
13560 changes to Target_selector.
13561
13562 * README: Rewrite, with some notes on unsupported features.
13563
13564 2008-03-24 Cary Coutant <ccoutant@google.com>
13565
13566 * i386.cc (Target_i386::Got_type): New enum declaration.
13567 (Target_i386::Scan::local): Updated callers of Output_data_got
13568 member functions.
13569 (Target_i386::Scan::global): Likewise.
13570 (Target_i386::Relocate::relocate): Likewise.
13571 (Target_i386::Relocate::relocate_tls): Likewise.
13572 * object.h (Got_offset_list): New class.
13573 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13574 (Sized_relobj::local_got_offset): Likewise.
13575 (Sized_relobj::set_local_got_offset): Likewise.
13576 (Sized_relobj::local_has_tls_got_offset): Removed.
13577 (Sized_relobj::local_tls_got_offset): Removed.
13578 (Sized_relobj::set_local_tls_got_offset): Removed.
13579 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13580 * output.cc (Output_data_got::add_global): Added got_type parameter.
13581 (Output_data_got::add_global_with_rel): Likewise.
13582 (Output_data_got::add_global_with_rela): Likewise.
13583 (Output_data_got::add_global_pair_with_rel): New function.
13584 (Output_data_got::add_global_pair_with_rela): New function.
13585 (Output_data_got::add_local): Added got_type parameter.
13586 (Output_data_got::add_local_with_rel): Likewise.
13587 (Output_data_got::add_local_with_rela): Likewise.
13588 (Output_data_got::add_local_pair_with_rel): New function.
13589 (Output_data_got::add_local_pair_with_rela): New function.
13590 (Output_data_got::add_global_tls): Removed.
13591 (Output_data_got::add_global_tls_with_rel): Removed.
13592 (Output_data_got::add_global_tls_with_rela): Removed.
13593 (Output_data_got::add_local_tls): Removed.
13594 (Output_data_got::add_local_tls_with_rel): Removed.
13595 (Output_data_got::add_local_tls_with_rela): Removed.
13596 * output.h (Output_data_got::add_global): Added got_type parameter.
13597 (Output_data_got::add_global_with_rel): Likewise.
13598 (Output_data_got::add_global_with_rela): Likewise.
13599 (Output_data_got::add_global_pair_with_rel): New function.
13600 (Output_data_got::add_global_pair_with_rela): New function.
13601 (Output_data_got::add_local): Added got_type parameter.
13602 (Output_data_got::add_local_with_rel): Likewise.
13603 (Output_data_got::add_local_with_rela): Likewise.
13604 (Output_data_got::add_local_pair_with_rel): New function.
13605 (Output_data_got::add_local_pair_with_rela): New function.
13606 (Output_data_got::add_global_tls): Removed.
13607 (Output_data_got::add_global_tls_with_rel): Removed.
13608 (Output_data_got::add_global_tls_with_rela): Removed.
13609 (Output_data_got::add_local_tls): Removed.
13610 (Output_data_got::add_local_tls_with_rel): Removed.
13611 (Output_data_got::add_local_tls_with_rela): Removed.
13612 * resolve.cc (Symbol::override_base_with_special): Removed
13613 reference to has_got_offset_ field.
13614 * symtab.cc (Symbol::init_fields): Replaced initialization
13615 of got_offset_ with got_offsets_. Removed initialization
13616 of has_got_offset_
13617 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13618 (Symbol::got_offset): Likewise.
13619 (Symbol::set_got_offset): Likewise.
13620 (Symbol::has_tls_got_offset): Removed.
13621 (Symbol::tls_got_offset): Removed.
13622 (Symbol::set_tls_got_offset): Removed.
13623 (Symbol::got_offset_): Removed.
13624 (Symbol::tls_mod_got_offset_): Removed.
13625 (Symbol::tls_pair_got_offset_): Removed.
13626 (Symbol::got_offsets_): New field.
13627 (Symbol::has_got_offset): Removed.
13628 (Symbol::has_tls_mod_got_offset): Removed.
13629 (Symbol::has_tls_pair_got_offset): Removed.
13630 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13631 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13632 member functions.
13633 (Target_x86_64::Scan::global): Likewise.
13634 (Target_x86_64::Relocate::relocate): Likewise.
13635 (Target_x86_64::Relocate::relocate_tls): Likewise.
13636
13637 2008-03-25 Ben Elliston <bje@au.ibm.com>
13638
13639 * yyscript.y: Fix spelling error in comment.
13640
13641 2008-03-24 Ian Lance Taylor <iant@google.com>
13642
13643 * options.h (class General_options): Define build_id option.
13644 * layout.h (class Layout): Declare write_build_id, create_note,
13645 create_build_id. Add build_id_note_ member.
13646 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13647 "libiberty.h", "md5.h", "sha1.h".
13648 (Layout::Layout): Initialize eh_frame_data_,
13649 eh_frame_hdr_section_, and build_id_note_.
13650 (Layout::finalize): Call create_build_id.
13651 (Layout::create_note): New function, broken out of
13652 Layout::create_gold_note.
13653 (Layout::create_gold_note): Call create_note.
13654 (Layout::create_build_id): New function.
13655 (Layout::write_build_id): New function.
13656 (Close_task_runner::run): Call write_build_id.
13657
13658 * x86_64.cc: Correct license to GPLv3.
13659
13660 2008-03-23 Ian Lance Taylor <iant@google.com>
13661
13662 * options.cc: Include "demangle.h".
13663 (parse_optional_string): New function.
13664 (parse_long_option): Handle takes_optional_argument.
13665 (parse_short_option): Update dash_z initializer. Handle
13666 takes_optional_argument.
13667 (General_options::General_options): Initialize do_demangle_.
13668 (General_options::finalize): Set do_demangle_. Handle demangling
13669 style.
13670 * options.h (parse_optional_string): Declare.
13671 (struct One_option): Add optional_arg field. Update constructor.
13672 Update call constructor calls. Add takes_optional_argument
13673 function.
13674 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13675 (DEFINE_optional_string): Define.
13676 (General_options::demangle): Change from DEFINE_bool to
13677 DEFINE_optional_string.
13678 (General_options::no_demangle): New function.
13679 (General_options::do_demangle): New function.
13680 (General_options::set_do_demangle): New function.
13681 (General_options::execstack_status_): Move definition to end of
13682 class definition.
13683 (General_options::static_): Likewise.
13684 (General_options::do_demangle_): New field.
13685 * object.cc (big_endian>::get_symbol_location_info): Call
13686 Options::do_demangle, not Options::demangle.
13687 * symtab.cc (demangle): Likewise.
13688
13689 2008-03-22 Ian Lance Taylor <iant@google.com>
13690
13691 * gold.h: Include <cstddef> and <sys/types.h>
13692 * options.h: Include <cstring>.
13693
13694 2008-03-21 Ian Lance Taylor <iant@google.com>
13695
13696 * Added source code to GNU binutils.