Adjust the value of _GLOBAL_OFFSET_TABLE_ for got bigger than 0x8000
[binutils-gdb.git] / gold / ChangeLog
1 2012-10-02 Jiong Wang <jiwang@tilera.com>
2
3 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4 global_offset_table_ value for larget got.
5 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
6
7 2012-09-29 Alan Modra <amodra@gmail.com>
8
9 * powerpc.cc (Target_powerpc::iplt_): New output section.
10 (Target_powerpc::iplt_section, make_iplt_section,
11 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
12 (Target_powerpc::make_plt_entry): Handle ifunc syms.
13 Target_powerpc::plt_entry_count): Count iplt entries too.
14 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
15 reloc section in constructor. New params.
16 (Target_powerpc::make_plt_section): Create reloc section here instead.
17 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
18 functions.
19 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
20 (Output_data_glink::add_entry, find_entry): New functions to
21 deal with local syms.
22 (Glink_sym_ent): Add support for local syms.
23 (Output_data_glink::do_write): Handle ifunc plt entries.
24 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
25 (Target_powerpc::Scan::local, global): Handle ifunc syms.
26 (Target_powerpc::Relocate::relocate): Likewise.
27 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
28
29 2012-09-25 Alan Modra <amodra@gmail.com>
30
31 * object.h (Sized_relobj_file::adjust_local_symbol,
32 do_adjust_local_symbol): New functions.
33 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
34 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
35 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
36 and irregular opd entry spacing.
37 (Powerpc_relobj::do_read_relocs): Add opd size checks.
38 (Global_symbol_visitor_opd): New functor.
39 (Target_powerpc::do_finalize_sections): Omit global symbols defined
40 on deleted opd entries.
41
42 2012-09-15 Jiong Wang <jiwang@tilera.com>
43
44 * tilegx.cc: New file.
45 * Makefile.am (TARGETSOURCES): Add tilegx.cc
46 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
47 * configure.tgt: Add entries for tilegx*.
48 * configure.ac: Likewise.
49 * Makefile.in: Rebuild.
50 * configure: Likewise.
51 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
52 tilegx.
53
54 2012-09-13 Alan Modra <amodra@gmail.com>
55
56 * target-reloc.h (scan_relocs): Call scan.local for relocs
57 against symbols in discarded sections. Pass is_discarded
58 param.
59 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
60 Add is_discarded param.
61 * powerpc (Target_powerpc::Scan::local): Likewise. Use
62 is_discarded to flag opd entry as discarded. Don't emit dyn
63 relocs on such entries.
64 (Target_powerpc::Scan::global): Similarly detect and handle
65 such opd entries.
66 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
67 opd_ent_. Update all uses.
68 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
69 (Target_powerpc::relocate_section): Zero out discarded opd
70 entry relocs.
71
72 2012-09-12 Ian Lance Taylor <iant@google.com>
73
74 PR gold/14570
75 * output.cc: Rename Output_data_got template parameter from size
76 to got_size for all functions. Compile all variants of
77 Output_data_got.
78 (Output_data_got::Got_entry::write): Correct use of size for
79 symbol value. Use local_is_tls rather than casting to
80 Sized_relobj_file.
81 * object.h (class Object): Add local_is_tls and do_local_is_tls.
82 (class Sized_relobj_file): Add do_local_is_tls.
83 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
84
85 2012-09-11 Alan Modra <amodra@gmail.com>
86
87 PR gold/14566
88 * layout.cc (Layout::set_segment_offsets): When using
89 common-page-size alignment, ensure we are on a new max-page-size
90 page.
91 * output.cc (Output_segment::set_section_addresses): Use
92 abi_pagesize, not common_pagesize for relro boundary.
93 (Output_segment::set_offset): Likewise.
94
95 2012-09-11 Alan Modra <amodra@gmail.com>
96
97 * output.h (Output_data_got::add_global_tls, add_local_tls,
98 add_local_tls_pair): New functions.
99 (Output_data_got::add_local_pair_with_rel): Remove second
100 reloc param. Expand comment.
101 (Output_data_got::Got_entry): Rename use_plt_offset_ to
102 use_plt_or_tls_offset_, similarly for constructor param.
103 (Output_data_got::Got_entry::write): Add got_index param.
104 * output.cc (Output_data_got::add_global_tls, add_local_tls,
105 add_local_tls_pair): New functions.
106 (Output_data_got::Got_entry::write): Handle tls symbols
107 with use_plt_or_tls_offset_ set specially.
108 (Output_data_got::add_local_pair_with_rel): Only one reloc.
109 (Output_data_got::do_write): Replace iterator with index, pass
110 index to entry write function.
111 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
112 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
113 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
114 call.
115 * i386.cc (Target_i386::Scan::local): Likewise.
116 * sparc.cc (Target_sparc::Scan::local): Likewise.
117 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
118 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
119 do_tls_offset_for_global): New functions.
120 (Target_powerpc::Scan::local): Correct TLS relocations and got
121 entry values.
122 (Target_powerpc::Scan::global): Don't emit unnecessary
123 dynamic relocations on TLS GOT entries.
124
125 2012-09-10 Matthias Klose <doko@ubuntu.com>
126
127 * config.in: Disable sanity check for kfreebsd.
128
129 2012-09-10 Sterling Augustine <saugustine@google.com>
130
131 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
132 (Gdb_index::pubtypes_read): New parameter.
133 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
134 to calls.
135 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
136 pubtypes_object_.
137
138 2012-09-09 Alan Modra <amodra@gmail.com>
139
140 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
141 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
142 * gc.h (gc_process_relocs): Call target gc_add_reference.
143 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
144 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
145 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
146 unnecessary cast.
147 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
148 to cater for when we don't need code offset. Update use.
149 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
150 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
151 set_opd_valid): New functions.
152 (Target_powerpc::do_gc_add_reference): New function.
153 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
154 stashed refs.
155 (Target_powerpc::do_gc_mark_symbol): New function.
156
157 2012-09-06 Cary Coutant <ccoutant@google.com>
158
159 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
160 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
161 (Dwarf_die::skip_attributes): Likewise.
162 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
163 * testsuite/gdb_index_test.cc (inline_func_1): New function.
164 (main): Call it.
165 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
166
167 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
168
169 * testsuite/script_test_3.t: Add .got.plt output section
170 statement.
171 * testsuite/script_test_4.t: Likewise.
172
173 2012-09-05 Alan Modra <amodra@gmail.com>
174
175 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
176 update all uses and lose "enum" when using type.
177
178 2012-09-05 Alan Modra <amodra@gmail.com>
179
180 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
181 * configure: Regenerate.
182 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
183 (plugin_final_layout.stdout): Likewise.
184 (memory_test): Set page sizes to 0x1000.
185 * testsuite/Makefile.in: Regenerate.
186 * testsuite/discard_locals_test.sh: Add FIXME comment.
187 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
188 * testsuite/pr14265.t: Add .got output section statement.
189 * testsuite/script_test_2.t: Likewise.
190 * testsuite/script_test_3.t: Likewise.
191 * testsuite/script_test_4.t: Likewise.
192 * testsuite/script_test_5.t: Likewise.
193 * testsuite/script_test_6.t: Likewise.
194 * testsuite/script_test_7.t: Likewise.
195 * testsuite/script_test_9.t: Likewise.
196
197 2012-09-05 Alan Modra <amodra@gmail.com>
198
199 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
200 (Powerpc_relocate_functions::Status): New typedef.
201 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
202 (Target_powerpc::Scan::local): Handle REL64.
203 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
204 for REL32 and REL64.
205 (Target_powerpc::symval_for_branch): New function, extracted from..
206 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
207 checks. Report overflow errors.
208
209 2012-09-05 Alan Modra <amodra@gmail.com>
210
211 * object.h (Sized_relobj_file::emit_relocs): Delete.
212 (Sized_relobj_file::emit_relocs_reltype): Delete.
213 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
214 relocate_relocs for --emit-relocs.
215 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
216 * output.h: Update comment.
217 (Output_segment::first_section): New function.
218 (Output_segment::first_section_load_address): Use first_section.
219 * output.cc (Output_segment::first_section): New function extracted..
220 (Output_segment::first_section_load_address): ..from here. Delete.
221 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
222 * target.h (Sized_target::relocate_for_relocatable): Likewise.
223 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
224 adjust call to target.h function.
225 * i386.cc (Target_i386): Likewise.
226 * sparc.cc (Target_sparc): Likewise.
227 * x86_64.cc (Target_x86_64): Likewise.
228 * powerpc.cc (Target_powerpc): Likewise.
229 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
230 first tls section has section symbol for optimised local dynamic
231 output relocs.
232 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
233 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
234 optimised tls code.
235 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
236 Rename to relocate_relocs. Update error message.
237
238 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
239
240 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
241 --just-symbols.
242
243 2012-08-31 Alan Modra <amodra@gmail.com>
244
245 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
246 (Powerpc_relobj::toc_base_offset): New stub function.
247 (Target_powerpc): Add tp_offset, dtp_offset. Rename
248 got_mod_index_offset to tlsld_got_offset. Update all refs.
249 (Target_powerpc::Relocate::enum skip_tls): New.
250 (Target_powerpc::call_tls_get_addr_): New var.
251 (Target_powerpc::is_branch_reloc): Move to file scope.
252 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
253 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
254 New functions.
255 (Target_powerpc::enum Got_type): Delete old values, add new ones.
256 (powerpc_info): Correct common_pagesize for ppc64.
257 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
258 (Powerpc_relocate_functions): Add overflow check enums and functions.
259 Add non-shift version of rela, rela_ua. Delete all rel public
260 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
261 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
262 addr16_ha3, addr14 functions.
263 (Output_data_got_powerpc::add_constant_pair): New function.
264 (Output_data_got_powerpc::got_base_offset): Likewise.
265 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
266 (instruction constants): Sort, add some more.
267 (Output_data_glink::do_write): Add and use Address typedef. Use
268 object->toc_base_offset() stub for 64-bit.
269 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
270 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
271 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
272 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
273 Always treat .opd relocs as against locally defined symbol.
274 Correct condition for RELATIVE relocs.
275 (Target_powerpc::do_finalize_sections): Test for NULL sections.
276 (Target_powerpc::Relocate::relocate): Use plt call stub as value
277 for 32-bit syms with a plt entry. Correct ppc64 toc base
278 calculations. Handle TLS relocs, and more. Add overflow
279 checking and adjust for Powerpc_relocate_functions changes.
280 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
281 Reinstate --emit-relocs code with FIXME.
282
283 2012-08-30 Alan Modra <amodra@gmail.com>
284
285 * layout.cc (Layout::set_segment_offsets): Set p_align to
286 abi_pagesize, not common_pagesize.
287 (Layout::relaxation_loop_body): Similarly use abi_pagesize
288 to determine whether file header can go in segment.
289
290 2012-08-30 Alan Modra <amodra@gmail.com>
291
292 * output.h (Output_reloc::Output_reloc <output section>): Add
293 is_relative param. Adjust calls.
294 (Output_reloc::add_output_section_relative): New functions.
295 * output.cc (Output_reloc::Output_reloc <output section>): Handle
296 is_relative.
297 (Output_reloc::symbol_value): Handle SECTION_CODE.
298
299 2012-08-24 Sriraman Tallam <tmsriram@google.com>
300
301 * gold.cc (queue_middle_tasks): Call layout again when unique
302 segments for sections is desired.
303 * layout.cc (Layout::Layout): Initialize new members.
304 (Layout::get_output_section_flags): New function.
305 (Layout::choose_output_section): Call get_output_section_flags.
306 (Layout::layout): Make output section for mapping to a unique segment.
307 (Layout::insert_section_segment_map): New function.
308 (Layout::attach_allocated_section_to_segment): Make unique segment for
309 output sections marked so.
310 (Layout::segment_precedes): Check for unique segments when sorting.
311 * layout.h (Layout::Unique_segment_info): New struct.
312 (Layout::Section_segment_map): New typedef.
313 (Layout::insert_section_segment_map): New function.
314 (Layout::get_output_section_flags): New function.
315 (Layout::is_unique_segment_for_sections_specified): New function.
316 (Layout::set_unique_segment_for_sections_specified): New function.
317 (Layout::unique_segment_for_sections_specified_): New member.
318 (Layout::section_segment_map_): New member.
319 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
320 Rename is_gc_pass_one to is_pass_one.
321 Rename is_gc_pass_two to is_pass_two.
322 Rename is_gc_or_icf to is_two_pass.
323 Check for which pass based on whether symbols data is present.
324 Make it two pass when unique segments for sections is desired.
325 * output.cc (Output_section::Output_section): Initialize new
326 members.
327 * output.h (Output_section::is_unique_segment): New function.
328 (Output_section::set_is_unique_segment): New function.
329 (Output_section::is_unique_segment_): New member.
330 (Output_section::extra_segment_flags): New function.
331 (Output_section::set_extra_segment_flags): New function.
332 (Output_section::extra_segment_flags_): New member.
333 (Output_section::segment_alignment): New function.
334 (Output_section::set_segment_alignment): New function.
335 (Output_section::segment_alignment_): New member.
336 (Output_segment::Output_segment): Initialize is_unique_segment_.
337 (Output_segment::is_unique_segment): New function.
338 (Output_segment::set_is_unique_segment): New function.
339 (Output_segment::is_unique_segment_): New member.
340 * plugin.cc (allow_unique_segment_for_sections): New function.
341 (unique_segment_for_sections): New function.
342 (Plugin::load): Add new functions to transfer vector.
343 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
344 * Makefile.in: Regenerate.
345 * testsuite/plugin_final_layout.sh: Check if unique segment
346 functionality works.
347 * testsuite/plugin_section_order.c (onload): Check if new interfaces
348 are available.
349 (allow_unique_segment_for_sections): New global.
350 (unique_segment_for_sections): New global.
351 (claim_file_hook): Call allow_unique_segment_for_sections.
352 (all_symbols_read_hook): Call unique_segment_for_sections.
353
354 2012-08-22 Cary Coutant <ccoutant@google.com>
355
356 * layout.cc (Layout::include_section): Don't assert on GROUP
357 sections with --emit-relocs.
358
359 2012-08-21 Cary Coutant <ccoutant@google.com>
360
361 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
362 if --export-dynamic-symbol names an undef symbol.
363
364 2012-08-18 Alan Modra <amodra@gmail.com>
365
366 * powerpc.cc: Formatting and white space.
367 (Powerpc_relobj): Rename got2_section_ to special_.
368 Add opd_ent_shndx_ and opd_ent_off_ vectors.
369 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
370 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
371 (Target_powerpc): Add Address typedef and invalid_address. Use
372 throughout.
373 (Target_powerpc::is_branch_reloc): New function.
374 (Powerpc_relocate_functions): Add Address typedef, use throughout.
375 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
376 for dst_mask, value and addend.
377 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
378 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
379 (Output_data_glink::do_write): Correct toc base. Don't try to use
380 uint16_t for 24-bit offset. Use get_output_section_offset and
381 check return.
382 (Target_powerpc::Scan::local): Handle more relocs.
383 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
384 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
385 Plug in toc restoring insn after plt calls. Translate branches
386 to function descriptor symbols to corresponding entry point.
387 (Target_powerpc::relocate_for_relocatable): Check return from
388 get_output_section_offset.
389 * symtab.h: Comment typo.
390
391 2012-08-14 Ian Lance Taylor <iant@google.com>
392
393 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
394 unsupported_relocal_local to call unsupported_reloc_global.
395
396 2012-08-14 Nick Clifton <nickc@redhat.com>
397
398 PR ld/14265
399 * script-sections.cc (Sections_element::output_section_name): Add
400 keep return parameter.
401 (Output_section_element::match_name): Add keep return parameter.
402 Return the value of the keep_ member.
403 * script-sections.h (class Output_section): Update
404 output_section_name prototype.
405 * layout.cc (Layout::keep_input_section): New public member
406 function.
407 (Layout::choose_output_section): Pass keep parameter to
408 output_section_name.
409 * layout.h (class Layout): Add keep_input_section.
410 * object.cc (Sized_relobj_file::do_layout): Check for kept input
411 sections.
412 * testsuite/Makefile.am: Add a test.
413 * testsuite/Makefile.in: Regenerate.
414 * testsuite/pr14265.c: Source file for the test.
415 * testsuite/pr14265.t: Linker script for the test.
416 * testsuite/pr14265.sh: Shell script for the test.
417
418 2012-08-14 Alan Modra <amodra@gmail.com>
419
420 * target.h (Target::output_section_name): New function.
421 (Target::do_output_section_name): New function.
422 * layout.cc (Layout::choose_output_section): Call the above.
423 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
424
425 2012-08-14 Alan Modra <amodra@gmail.com>
426
427 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
428 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
429 for replace_constant call.
430 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
431 (Output_data_glink::do_print_to_mapfile): New function.
432 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
433 (Target_powerpc::Relocate::relocate): Likewise.
434
435 2012-08-14 Alan Modra <amodra@gmail.com>
436
437 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
438 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
439 (Output_data_glink::add_entry,find_entry): Remove shndx param.
440 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
441 all references to shndx_. Handle special case for R_PPC_PLTREL24
442 here.
443 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
444 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
445 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
446 here.
447 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
448 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
449
450 2012-08-12 Alan Modra <amodra@gmail.com>
451
452 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
453 (glink insn constants): Use uint32_t.
454 (Output_data_glink::add_entry): Use insert, not [] operator.
455
456 2012-08-11 Alan Modra <amodra@gmail.com>
457
458 * object.h (Sized_relobj_file::find_shdr): New function.
459 (Sized_relobj_file::find_special_sections): New function.
460 * object.cc (Sized_relobj_file::find_shdr): New function.
461 (Sized_relobj_file::find_eh_frame): Use find_shdr.
462 (Sized_relobj_file::find_special_sections): New function, split out..
463 (Sized_relobj_file::do_read_symbols): ..from here.
464 * output.h (Output_data_got::replace_constant): New function.
465 (Output_data_got::num_entries): New function.
466 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
467 (Output_data_got::got_offset): Protected rather than private.
468 (Output_data_got::replace_got_entry): New function.
469 * output.cc (Output_data_got::replace_got_entry): New function.
470 * powerpc.cc (class Powerpc_relobj): New.
471 (class Powerpc_relocate_functions): Delete all psymval variants or
472 convert to value,addend type. Delete pcrela, pcrela_unaligned.
473 Implement _ha functions using corresponding _hi function.
474 (Powerpc_relobj::find_special_sections): New function.
475 (Target_powerpc::do_make_elf_object): New function.
476 (class Output_data_got_powerpc): New.
477 (class Output_data_glink): New.
478 (class Powerpc_scan_relocatable_reloc): New.
479 Many more changes througout file.
480
481 2012-08-09 Nick Clifton <nickc@redhat.com>
482
483 * po/vi.po: Updated Vietnamese translation.
484
485 2012-08-07 Ian Lance Taylor <iant@google.com>
486
487 * layout.cc (Layout::add_target_dynamic_tags): If
488 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
489 plt_rel.
490
491 2012-07-30 Nick Clifton <nickc@redhat.com>
492
493 * po/gold.pot: Updated template.
494 * po/es.po: Updated Spanish translation.
495
496 2012-07-18 Cary Coutant <ccoutant@google.com>
497
498 PR gold/14344
499 * configure.ac: Add check for -gpubnames support.
500 * configure: Regenerate.
501 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
502 support; force -gno-pubnames.
503 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
504 support.
505 (gdb_index_test_4): New test.
506 * testsuite/Makefile.in: Regenerate.
507 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
508 * testsuite/gdb_index_test_2.sh: Likewise.
509 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
510 * testsuite/gdb_index_test_4.sh: New script.
511 * testsuite/gdb_index_test_comm.sh: New script with common code;
512 don't look for space after colon.
513
514 2012-07-16 Sriraman Tallam <tmsriram@google.com>
515
516 * gold.cc (queue_middle_tasks): Update function order only after
517 deferred objects due to plugins are processed.
518
519 2012-07-11 Ian Lance Taylor <iant@google.com>
520
521 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
522 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
523 (Target_arm::scan_reloc_for_stub): Likewise.
524 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
525 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
526 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
527 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
528 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
529
530 2012-07-10 Dodji Seketeli <dodji@redhat.com>
531 Ian Lance Taylor <iant@google.com>
532
533 PR gold/14309
534 * configure.ac: Test whether std::tr1::hash<off_t> works.
535 * gold.h: Add a specialization for std::tr1::hash<off_t> if
536 needed.
537 * output.h (class Output_fill): Add virtual destructor.
538 * configure, config.in: Rebuild.
539
540 2012-06-22 Roland McGrath <mcgrathr@google.com>
541
542 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
543
544 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
545
546 * plugin.cc (Plugin::load): Handle position independent executables.
547
548 2012-06-06 Cary Coutant <ccoutant@google.com>
549
550 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
551 add .debug_macro.
552 (lines_only_debug_sections): Likewise.
553 (gdb_fast_lookup_sections): New static array.
554 (is_gdb_debug_section): Rename formal parameter.
555 (is_lines_only_debug_section): Likewise.
556 (is_gdb_fast_lookup_section): New function.
557 (Layout::include_section): Check for ".zdebug_" prefix; pass
558 section name suffix to is_gdb_debug_section, et al.; check for
559 fast-lookup sections when building .gdb_index.
560 * options.h (--strip-debug-gdb): Update GDB version number.
561
562 2012-06-06 Cary Coutant <ccoutant@google.com>
563
564 * configure.ac: Add check for fallocate.
565 * configure: Regenerate.
566 * config.in: Regenerate.
567
568 * options.h (class General_options): Add --mmap-output-file and
569 --posix-fallocate options.
570 * output.cc: (posix_fallocate): Remove; replace with...
571 (gold_fallocate): New function.
572 (Output_file::map_no_anonymous): Call gold_fallocate.
573 (Output_file::map): Check --mmap-output-file option.
574
575 2012-06-05 Jing Yu <jingyu@google.com>
576
577 * gold.h (textdomain): Add do {} to empty while(0).
578 (bindtextdomain): Likewise.
579
580 2012-06-04 Cary Coutant <ccoutant@google.com>
581
582 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
583 has_dynsym_index.
584
585 2012-05-25 Sriraman Tallam <tmsriram@google.com>
586
587 * symtab.cc (Symbol_table::define_special_symbol):
588 Initialize *poldsym to prevent uninitialized variable errors.
589
590 2012-05-23 Cary Coutant <ccoutant@google.com>
591
592 * layout.cc (Layout::section_name_mapping): Add rules to handle
593 exact match on .data.rel.ro.local or .data.rel.ro.
594 (Layout::output_section_name): Check for exact matches.
595
596 2012-05-23 Cary Coutant <ccoutant@google.com>
597
598 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
599 more carefully.
600
601 2012-05-22 Cary Coutant <ccoutant@google.com>
602
603 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
604 object before exporting symbol.
605
606 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
607
608 * testsuite/tls_test.cc: Include "config.h" first.
609 * testsuite/tls_test_c.c: Likewise.
610
611 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
612 Nick Clifton <nickc@redhat.com>
613
614 PR 14072
615 * configure.in: Add check that sysdep.h has been included before
616 any system header files.
617 * configure: Regenerate.
618 * config.in: Regenerate.
619
620 2012-05-14 Cary Coutant <ccoutant@google.com>
621
622 * layout.cc (Layout::make_output_section): Mark .tdata section
623 as RELRO.
624 * testsuite/relro_test.cc: Add a TLS variable.
625
626 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
627
628 PR gold/14091
629 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
630 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
631 R_X86_64_64.
632
633 2012-05-08 Cary Coutant <ccoutant@google.com>
634
635 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
636 (lines_only_debug_sections): Likewise.
637
638 2012-05-02 Roland McGrath <mcgrathr@google.com>
639
640 * nacl.cc: New file.
641 * nacl.h: New file.
642 * Makefile.am (CCFILES, HFILES): Add them.
643 * Makefile.in: Regenerate.
644 * i386.cc (Output_data_plt_i386_nacl): New class.
645 (Output_data_plt_i386_nacl_exec): New class.
646 (Output_data_plt_i386_nacl_dyn): New class.
647 (Target_i386_nacl): New class.
648 (Target_selector_i386_nacl): New class.
649 (target_selector_i386): Use it instead of Target_selector_i386.
650 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
651 (Target_x86_64_nacl): New class.
652 (Target_selector_x86_64_nacl): New class.
653 (target_selector_x86_64, target_selector_x32): Use it instead of
654 Target_selector_x86_64.
655 * arm.cc (Output_data_plt_arm_nacl): New class.
656 (Target_arm_nacl): New class.
657 (Target_selector_arm_nacl): New class.
658 (target_selector_arm, target_selector_armbe): Use it instead of
659 Target_selector_arm.
660
661 * target-select.cc (select_target): Take new Input_file* and off_t
662 arguments, pass them on to recognize method of selector.
663 * object.cc (make_elf_sized_object): Update caller.
664 * parameters.cc (parameters_force_valid_target): Likewise.
665 * incremental.cc (make_sized_incremental_binary): Likewise.
666 * target-select.h: Update decl.
667 (Target_selector::recognize): Take new Input_file* argument,
668 pass it on to do_recognize.
669 (Target_selector::do_recognize): Take new Input_file* argument.
670 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
671 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
672 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
673 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
674
675 * target.h (Target::Target_info): New members isolate_execinstr
676 and rosegment_gap.
677 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
678 * arm.cc (Target_arm::arm_info): Update initializer.
679 * i386.cc (Target_i386::i386_info): Likewise.
680 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
681 * sparc.cc (Target_sparc::sparc_info): Likewise.
682 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
683 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
684 * layout.cc (Layout::attach_allocated_section_to_segment):
685 Take new const Target* argument. If target->isolate_execinstr(), act
686 like --rosegment.
687 (Layout::find_first_load_seg): Take new const Target* argument;
688 if target->isolate_execinstr(), reject PF_X segments.
689 (Layout::relaxation_loop_body): Update caller.
690 (Layout::set_segment_offsets): If target->isolate_execinstr(),
691 reset file offset to zero when we hit LOAD_SEG, and then do a second
692 loop over the segments before LOAD_SEG to reassign offsets after
693 addresses have been determined. Handle target->rosegment_gap().
694 (Layout::attach_section_to_segment): Take new const Target* argument;
695 pass it to attach_allocated_section_to_segment.
696 (Layout::make_output_section): Update caller.
697 (Layout::attach_sections_to_segments): Take new const Target* argument;
698 pass it to attach_section_to_segment.
699 * gold.cc (queue_middle_tasks): Update caller.
700 * layout.h (Layout): Update method decls with new arguments.
701
702 * arm.cc (Target_arm::Target_arm): Take optional argument for the
703 Target_info pointer to use.
704 (Target_arm::do_make_data_plt): New virtual method.
705 (Target_arm::make_data_plt): New method that calls it.
706 (Target_arm::make_plt_entry): Use it.
707 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
708 for the section alignment.
709 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
710 method.
711 (Output_data_plt_arm::first_plt_entry_offset): Call it.
712 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
713 method.
714 (Output_data_plt_arm::get_plt_entry_size): Call it.
715 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
716 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
717 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
718 method.
719 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
720 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
721 method instead of sizeof(plt_entry).
722 (Output_data_plt_arm::add_entry): Likewise.
723 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
724 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
725 than static method.
726 (Target_arm::plt_entry_size): Likewise.
727 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
728 Move to ...
729 (Output_data_plt_arm_standard): ... here, new class.
730 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
731 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
732 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
733
734 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
735 Take additional argument for the PLT entry size.
736 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
737 Use get_plt_entry_size method rather than plt_entry_size variable.
738 (Output_data_plt_x86_64::reserve_slot): Likewise.
739 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
740 (Output_data_plt_x86_64::add_entry): Likewise.
741 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
742 (Output_data_plt_x86_64::address_for_global): Likewise.
743 (Output_data_plt_x86_64::address_for_local): Likewise.
744 (Output_data_plt_x86_64::set_final_data_size): Likewise.
745 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
746 Make method non-static.
747 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
748 method.
749 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
750 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
751 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
752 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
753 virtual method.
754 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
755 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
756 virtual method.
757 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
758 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
759 virtual method.
760 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
761 (Output_data_plt_x86_64::plt_entry_size)
762 (Output_data_plt_x86_64::first_plt_entry)
763 (Output_data_plt_x86_64::plt_entry)
764 (Output_data_plt_x86_64::tlsdesc_plt_entry)
765 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
766 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
767 (Output_data_plt_x86_64_standard): ... here, new class.
768 (Target_x86_64::Target_x86_64): Take optional argument for the
769 Target_info pointer to use.
770 (Target_x86_64::do_make_data_plt): New virtual method.
771 (Target_x86_64::make_data_plt): New method to call it.
772 (Target_x86_64::init_got_plt_for_update): Use that.
773 Call this->plt_->add_eh_frame method here.
774 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
775 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
776 rather than static method.
777 (Target_x86_64::plt_entry_size): Likewise.
778 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
779 rather than plt_entry_size variable. Move guts of PLT filling to...
780 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
781 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
782 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
783
784 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
785 additional argument for the section alignment.
786 Don't do add_eh_frame_for_plt here.
787 (Output_data_plt_i386::first_plt_entry_offset): Make the method
788 non-static. Use get_plt_entry_size method rather than plt_entry_size
789 variable.
790 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
791 method.
792 (Output_data_plt_i386::get_plt_entry_size): Call it.
793 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
794 (Output_data_plt_i386::add_eh_frame): New method to call it.
795 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
796 method.
797 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
798 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
799 method.
800 (Output_data_plt_i386::fill_plt_entry): New method to call it.
801 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
802 method instead of plt_entry_size.
803 (Output_data_plt_i386::plt_entry_size)
804 (Output_data_plt_i386::plt_eh_frame_fde_size)
805 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
806 (Output_data_plt_i386_standard): ... here, new class.
807 (Output_data_plt_i386_exec): New class.
808 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
809 (Output_data_plt_i386_exec::first_plt_entry): ... here.
810 (Output_data_plt_i386::exec_plt_entry): Move to ...
811 (Output_data_plt_i386_exec::plt_entry): ... here.
812 (Output_data_plt_i386_dyn): New class.
813 (Output_data_plt_i386::first_plt_entry): Move to ...
814 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
815 (Output_data_plt_i386::dyn_plt_entry): Move to ...
816 (Output_data_plt_i386_dyn::plt_entry): ... here.
817 (Target_i386::Target_i386): Take optional argument for the Target_info
818 pointer to use.
819 (Target_i386::do_make_data_plt): New virtual method.
820 (Target_i386::make_data_plt): New method to call it.
821 (Target_i386::make_plt_section): Use that.
822 Call this->plt_->add_eh_frame method here.
823 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
824 rather than plt_entry_size variable.
825 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
826 (Output_data_plt_i386::address_for_local): Likewise.
827 (Output_data_plt_i386::do_write): Likewise.
828 Move guts of PLT filling to...
829 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
830 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
831 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
832 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
833
834 2012-05-01 Cary Coutant <ccoutant@google.com>
835
836 * dwarf_reader.cc (Dwarf_die::read_attributes)
837 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
838 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
839 * reduced_debug_output.cc
840 (Output_reduced_debug_info_section::get_die_end): Remove
841 DW_FORM_GNU_ref_index. Add default case.
842
843 2012-04-26 Mark Wielaard <mjw@redhat.com>
844
845 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
846 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
847 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
848 DW_AT_high_pc as offset from DW_AT_low_pc.
849
850 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
851 * testsuite/Makefile.in: Regenerate.
852 * testsuite/gdb_index_test_3.c: New test source file.
853 * testsuite/gdb_index_test_3.sh: New test source file.
854
855 2012-04-25 Ian Lance Taylor <iant@google.com>
856
857 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
858 pointer.
859 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
860 as a class, not a struct.
861 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
862 (Target_arm::apply_cortex_a8_workaround): Likewise.
863 * gc.h: Declare Reloc_types as a struct, not a class.
864 * object.h: Declare Symbols_data as a struct.
865 * reloc.h: Declare Read_relocs_data as a struct.
866 * target.h: Declare Relocate_info as a struct.
867
868 2012-04-24 David S. Miller <davem@davemloft.net>
869
870 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
871 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
872 and R_SPARC_WPLT30.
873
874 2012-04-24 Cary Coutant <ccoutant@google.com>
875
876 * incremental-dump.cc (find_input_containing_global): Replace
877 magic number with symbolic constant.
878 (dump_incremental_inputs): Update version number.
879 * incremental.cc (Output_section_incremental_inputs): Update version
880 number; import symbolic constants from Incremental_inputs_reader.
881 (Incremental_inputs::create_data_sections): Align relocations
882 section correctly for 64-bit targets.
883 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
884 constants; add padding.
885 (Output_section_incremental_inputs::write_header): Add assert for
886 header_size.
887 (Output_section_incremental_inputs::write_input_files): Add assert
888 for input_entry_size.
889 (Output_section_incremental_inputs::write_info_blocks): Add padding;
890 add assert for object_info_size, input_section_entry_size,
891 global_sym_entry_size.
892 * incremental.h (Incremental_inputs_reader): Add symbolic constants
893 for data structure sizes; use them.
894 (Incremental_input_entry_reader): Import symbolic constants from
895 Incremental_inputs_reader; use them.
896
897 2012-04-23 David S. Miller <davem@davemloft.net>
898
899 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
900 and elf_flags_set_.
901 (Target_sparc::Target_sparc): Initialize new fields.
902 (Target_sparc::do_make_elf_object): New function.
903 (Target_sparc::do_adjust_elf_header): New function.
904
905 2012-04-23 Cary Coutant <ccoutant@google.com>
906
907 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
908 CU range table of gdb index.
909
910 2012-04-20 David S. Miller <davem@davemloft.net>
911
912 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
913 instead of false.
914
915 2012-04-16 David S. Miller <davem@davemloft.net>
916
917 * sparc.cc (Target_sparc::got_address): New function.
918 (Sparc_relocate_functions::gdop_hix22): New function.
919 (Sparc_relocate_functions::gdop_lox10): New function.
920 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
921 relocs.
922 (Target_sparc::Scan::local): Likewise if the global symbol is not
923 preemptible and is not IFUNC.
924 (Target_sparc::Relocate::relocate): Perform GOTDATA code
925 transformations for local and non-preemptible non-IFUNC global
926 symbols.
927
928 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
929 writing out 64-bit part of ranges.
930
931 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
932 -fpic and -fpie respectively.
933 * Makefile.in: Regenerate.
934
935 * sparc.cc (class Target_sparc): Add rela_ifunc_.
936 (Target_sparc::Target_sparc): Initialize new field.
937 (Target_sparc::do_plt_section_for_global): New function.
938 (Target_sparc::do_plt_section_for_local): New function.
939 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
940 (Target_sparc::make_plt_section): New function, broken out of
941 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
942 (Target_sparc::make_plt_entry): Call make_plt_section.
943 (Target_sparc::make_local_ifunc_plt_entry): New function.
944 (Target_sparc::rela_ifunc_section): New function.
945 (Target_sparc::plt_section): Remove const.
946 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
947 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
948 and ifunc_count_ fields.
949 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
950 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
951 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
952 (Output_data_plt_sparc::rela_ifunc): New function.
953 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
954 (Output_data_plt_sparc::has_ifunc_section): New function.
955 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
956 (Output_data_plt_sparc::address_for_global): New function.
957 (Output_data_plt_sparc::address_for_local): New function.
958 (Output_data_plt_sparc::plt_index_to_offset): New function.
959 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
960 and entry_count.
961 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
962 entry_count.
963 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
964 R_SPARC_JMP_IREL to switch.
965 (Target_sparc::Scan::check_non_pic): Likewise.
966 (Target_sparc::Scan::local): Handle IFUNC symbols.
967 (Target_sparc::Scan::local): Likewise.
968 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
969 and plt_address_for_local.
970 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
971 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
972
973 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
974 (class Output_data_reloc): Adjust calls to Output_reloc_type.
975 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
976 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
977 global relocs too.
978 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
979 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
980 calls.
981 * sparc.cc (Target_sparc::Scan::global): Likewise.
982 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
983
984 2012-04-16 Cary Coutant <ccoutant@google.com>
985
986 * archive.cc (Library_base::should_include_member): Check for
987 --export-dynamic-symbol.
988 * options.h (class General_options): Add --export-dynamic-symbol.
989 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
990 --export-dynamic-symbol.
991 (Symbol_table::gc_mark_undef_symbols): Likewise.
992 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
993
994 2012-04-12 David S. Miller <davem@davemloft.net>
995
996 * sparc.cc (Reloc::wdisp10): New relocation method.
997 (Reloc::h34): Likewise.
998 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
999 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1000 R_SPARC_WDISP10.
1001 (Target_sparc::Scan::local): Likewise.
1002 (Target_sparc::Scan::global): Likewise.
1003 (Target_sparc::Relocate::relocate): Likewise.
1004
1005 2012-04-09 Cary Coutant <ccoutant@google.com>
1006
1007 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1008 low_pc == 0.
1009
1010 2012-04-06 Ian Lance Taylor <iant@google.com>
1011
1012 * timer.cc: #include <unistd.h>.
1013
1014 2012-04-06 Roland McGrath <mcgrathr@google.com>
1015
1016 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1017 * config.in: Regenerate.
1018 * configure: Regenerate.
1019
1020 2012-04-05 Nick Clifton <nickc@redhat.com>
1021
1022 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1023 (AM_LC_MESSAGES): Add.
1024 * aclocal.m4: Regenerate.
1025 * config.in: Regenerate.
1026 * configure: Regenerate.
1027
1028 2012-03-21 Cary Coutant <ccoutant@google.com>
1029
1030 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1031 * Makefile.in: Regenerate.
1032 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1033 (Sized_elf_reloc_mapper::symbol_section): New function.
1034 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1035 (make_elf_reloc_mapper): New function.
1036 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1037 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1038 (Dwarf_abbrev_table::do_get_abbrev): New function.
1039 (Dwarf_ranges_table::read_ranges_table): New function.
1040 (Dwarf_ranges_table::read_range_list): New function.
1041 (Dwarf_pubnames_table::read_section): New function.
1042 (Dwarf_pubnames_table::read_header): New function.
1043 (Dwarf_pubnames_table::next_name): New function.
1044 (Dwarf_die::Dwarf_die): New function.
1045 (Dwarf_die::read_attributes): New function.
1046 (Dwarf_die::skip_attributes): New function.
1047 (Dwarf_die::set_name): New function.
1048 (Dwarf_die::set_linkage_name): New function.
1049 (Dwarf_die::attribute): New function.
1050 (Dwarf_die::string_attribute): New function.
1051 (Dwarf_die::int_attribute): New function.
1052 (Dwarf_die::uint_attribute): New function.
1053 (Dwarf_die::ref_attribute): New function.
1054 (Dwarf_die::child_offset): New function.
1055 (Dwarf_die::sibling_offset): New function.
1056 (Dwarf_info_reader::check_buffer): New function.
1057 (Dwarf_info_reader::parse): New function.
1058 (Dwarf_info_reader::do_parse): New function.
1059 (Dwarf_info_reader::do_read_string_table): New function.
1060 (Dwarf_info_reader::lookup_reloc): New function.
1061 (Dwarf_info_reader::get_string): New function.
1062 (Dwarf_info_reader::visit_compilation_unit): New function.
1063 (Dwarf_info_reader::visit_type_unit): New function.
1064 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1065 Sized_elf_reloc_mapper.
1066 (Sized_dwarf_line_info::symbol_section): Remove function.
1067 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1068 (Sized_dwarf_line_info::read_line_mappings): Remove object
1069 parameter, adjust callers.
1070 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1071 * dwarf_reader.h: Include <sys/types.h>.
1072 (class Track_relocs): Remove forward declaration.
1073 (class Elf_reloc_mapper): New class.
1074 (class Sized_elf_reloc_mapper): New class.
1075 (class Dwarf_abbrev_table): New class.
1076 (class Dwarf_range_list): New class.
1077 (class Dwarf_ranges_table): New class.
1078 (class Dwarf_pubnames_table): New class.
1079 (class Dwarf_die): New class.
1080 (class Dwarf_info_reader): New class.
1081 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1082 (Sized_dwarf_line_info::symbol_section): Remove member function.
1083 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1084 base class.
1085 * gdb-index.cc: New source file.
1086 * gdb-index.h: New source file.
1087 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1088 and .debug_types sections, call Layout::add_to_gdb_index.
1089 (Sized_relobj_incr::do_section_name): Implement.
1090 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1091 return type; Implement.
1092 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1093 return type.
1094 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1095 parameter list and return type.
1096 (Sized_incr_dynobj::do_section_contents): Likewise.
1097 * layout.cc: Include gdb-index.h.
1098 (Layout::Layout): Initialize gdb_index_data_.
1099 (Layout::init_fixed_output_section): Check for .gdb_index section.
1100 (Layout::add_to_gdb_index): New function. Instantiate.
1101 * layout.h: Add forward declaration for class Gdb_index.
1102 (Layout::add_to_gdb_index): New member function.
1103 (Layout::gdb_index_data_): New data member.
1104 * main.cc: Include gdb-index.h.
1105 (main): Print statistics for gdb index.
1106 * object.cc (Object::section_contents): Move code into
1107 do_section_contents.
1108 (need_decompressed_section): Check for sections needed when building
1109 gdb index.
1110 (build_compressed_section_map): Likewise.
1111 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1112 gdb index.
1113 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1114 sections; call Layout::add_to_gdb_index.
1115 (Sized_relobj_file::do_decompressed_section_contents): Call
1116 do_section_contents directly.
1117 * object.h (Object::do_section_contents): Adjust parameter list and
1118 return type.
1119 (Object::do_decompressed_section_contents): Call do_section_contents
1120 directly.
1121 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1122 return type.
1123 * options.h (class General_options): Add --gdb-index option.
1124 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1125 list and return type.
1126 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1127 * reloc.h (Track_relocs::checkpoint): New function.
1128 (Track_relocs::reset): New function.
1129
1130 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1131 New test cases.
1132 * testsuite/Makefile.in: Regenerate.
1133 * testsuite/gdb_index_test.cc: New test source file.
1134 * testsuite/gdb_index_test_1.sh: New test source file.
1135 * testsuite/gdb_index_test_2.sh: New test source file.
1136
1137 2012-03-19 Doug Kwan <dougkwan@google.com>
1138
1139 * arm.cc (Target_arm::do_define_standard_symbols): New method.
1140 (Target_arm::do_finalize_sections): Remove code which defines
1141 __exidx_start and __exidx_end. Make symbol table parameter
1142 anonymous as it is not used.
1143 * gold.cc (queue_middle_tasks): Call target hook to define any
1144 target-specific symbols.
1145 * target.h (Target::define_standard_symbols): New method.
1146 (Target::do_define_standard_symbols): Same.
1147 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1148 * testsuite/Makefile.in: Regenerate.
1149 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1150 and __exidx_end.
1151 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1152 relocations are generated for __exidx_start and __exidx_end.
1153
1154 2012-03-16 Doug Kwan <dougkwan@google.com>
1155
1156 * testsuite/Makefile.am: Disable test initpri3b.
1157 * testsuite/Makefile.in: Regenerate.
1158
1159 2012-03-15 Doug Kwan <dougkwan@google.com>
1160
1161 * arm.cc (Target_arm::got_section): Make .got section read-only
1162 if -z now is given.
1163
1164 2012-03-15 Ian Lance Taylor <iant@google.com>
1165
1166 PR gold/13850
1167 * layout.cc (Layout::make_output_section): Correctly mark
1168 SHT_INIT_ARRAY, et. al., as relro.
1169
1170 2012-03-14 Doug Kwan <dougkwan@google.com>
1171
1172 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1173 dynamic relocations for protected symbols in shared objects.
1174
1175 2012-03-13 Ian Lance Taylor <iant@google.com>
1176
1177 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1178 keep the larger alignment.
1179
1180 2012-03-12 Cary Coutant <ccoutant@google.com>
1181
1182 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1183 handling of DW_LNE_define_file.
1184
1185 2012-03-12 Cary Coutant <ccoutant@google.com>
1186
1187 * reduced_debug_output.cc
1188 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1189 codes to switch.
1190
1191 2012-02-29 Cary Coutant <ccoutant@google.com>
1192
1193 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1194
1195 2012-02-29 Cary Coutant <ccoutant@google.com>
1196
1197 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1198 Call Object::decompressed_section_contents.
1199 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1200 New dtor.
1201 (Sized_dwarf_line_info::buffer_start_): New data member.
1202 * merge.cc (Output_merge_data::do_add_input_section): Call
1203 Object::decompressed_section_contents.
1204 (Output_merge_string::do_add_input_section): Likewise.
1205 * object.cc (need_decompressed_section): New function.
1206 (build_compressed_section_map): Decompress sections needed later.
1207 (Sized_relobj_file::do_decompressed_section_contents): New function.
1208 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1209 * object.h (Object::decompressed_section_contents): New function.
1210 (Object::discard_decompressed_sections): New function.
1211 (Object::do_decompressed_section_contents): New function.
1212 (Object::do_discard_decompressed_sections): New function.
1213 (Compressed_section_info): New type.
1214 (Compressed_section_map): Include decompressed section contents.
1215 (Sized_relobj_file::do_decompressed_section_contents): New function.
1216 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1217
1218 2012-02-16 Cary Coutant <ccoutant@google.com>
1219
1220 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1221 * testsuite/Makefile.in: Regenerate.
1222
1223 2012-02-14 Cary Coutant <ccoutant@google.com>
1224
1225 * options.cc (General_options::finalize): Disallow -pie and -static.
1226
1227 2012-02-03 Doug Kwan <dougkwan@google.com>
1228
1229 * arm.cc (Arm_relocate_functions::abs8,
1230 Arm_relocate_functions::abs16): Use
1231 Bits::has_signed_unsigned_overflow32.
1232 (Arm_relocate_functions::thm_abs8): Correct range of
1233 overflow check.
1234 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1235 in assertions.
1236
1237 2012-02-02 Doug Kwan <dougkwan@google.com>
1238
1239 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1240 position independent outputs, not just shared objects.
1241
1242 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1243
1244 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1245 * configure: Regenerated.
1246
1247 2012-01-27 Ian Lance Taylor <iant@google.com>
1248
1249 * reloc.h (Bits): New class with static functions, copied from
1250 namespace utils in arm.cc.
1251 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1252 instead.
1253
1254 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1255
1256 * incremental.cc (write_info_blocks): Correct relocation offset.
1257
1258 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1259
1260 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1261 (Relocate::tls_gd_to_le): Likewise.
1262
1263 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1264
1265 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1266
1267 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1268
1269 * configure.ac: Check if -mcmodel=medium works.
1270 * configure: Regenerated.
1271
1272 2012-01-24 Cary Coutant <ccoutant@google.com>
1273
1274 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1275 definition and ...
1276 (read_unsigned_LEB_128_x): ... this new function.
1277 (read_signed_LEB_128): Replaced with inline definition and ...
1278 (read_signed_LEB_128_x): ... this new function.
1279 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1280 (read_unsigned_LEB_128): Add inline definition.
1281 (read_signed_LEB_128_x): New function.
1282 (read_signed_LEB_128): Add inline definition.
1283 * testsuite/Makefile.am (leb128_unittest): New unit test.
1284 * testsuite/Makefile.in: Regenerate.
1285 * testsuite/leb128_unittest.cc: New unit test.
1286
1287 2012-01-23 Ian Lance Taylor <iant@google.com>
1288
1289 PR gold/13617
1290 * i386.cc (Target_i386::do_code_fill): When using a jmp
1291 instruction, pad with nop instructions.
1292 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1293
1294 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1295
1296 * x86_64.cc (gc_process_relocs): Add typename on types used in
1297 template.
1298 (scan_relocs): Likewise.
1299 (relocate_section): Likewise.
1300 (apply_relocation): Likewise.
1301
1302 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1303
1304 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1305 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1306 under x32.
1307
1308 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1309
1310 * x86_64.cc: Initial support for x32.
1311
1312 2012-01-03 Cary Coutant <ccoutant@google.com>
1313
1314 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1315 Use abstract base class for GOT.
1316 * gold/output.h (class Output_data_got_base): New abstract base class.
1317 (class Output_data_got): Derive from new base class, adjust ctors.
1318 (Output_data_got::reserve_slot): Make virtual; rename to
1319 do_reserve_slot; Adjust callers.
1320 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1321 pointer to abstract base class.
1322 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1323
1324 2011-12-18 Ian Lance Taylor <iant@google.com>
1325
1326 * object.h (Relobj::local_symbol_value): New function.
1327 (Relobj::local_plt_offset): New function.
1328 (Relobj::local_has_got_offset): New function.
1329 (Relobj::local_got_offset): New function.
1330 (Relobj::set_local_got_offset): New function.
1331 (Relobj::do_local_symbol_value): New pure virtual function.
1332 (Relobj::do_local_plt_offset): Likewise.
1333 (Relobj::do_local_has_got_offset): Likewise.
1334 (Relobj::do_local_got_offset): Likewise.
1335 (Relobj::do_set_local_got_offset): Likewise.
1336 (Sized_relobj::do_local_has_got_offset): Rename from
1337 local_has_got_offset.
1338 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1339 (Sized_relobj::do_set_local_got_offset): Rename from
1340 set_local_got_offset.
1341 (Sized_relobj_file::do_local_plt_offset): Rename from
1342 local_plt_offset.
1343 (Sized_relobj_file::do_local_symbol_value): New function.
1344 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1345 local_plt_offset.
1346 * output.cc (Output_data_got::Got_entry::write): Change object to
1347 Relobj. Use local_symbol_value.
1348 (Output_data_got::add_global_with_rel): Change rel_dyn to
1349 Output_data_reloc_generic*. Use add_global_generic.
1350 (Output_data_got::add_global_with_rela): Remove. Change all
1351 callers to use add_global_with_rel.
1352 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1353 Output_data_reloc_generic*. Use add_global_generic.
1354 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1355 callers to use add_global_pair_with_rel.
1356 (Output_data_got::add_local): Change object to Relobj*.
1357 (Output_data_got::add_local_plt): Likewise.
1358 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1359 change rel_dyn to Output_data_reloc_generic*. Use
1360 add_local_generic.
1361 (Output_data_got::add_local_with_rela): Remove. Change all
1362 callers to use all_local_with_rel.
1363 (Output_data_got::add_local_pair_with_rel): Change object to
1364 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1365 add_output_section_generic.
1366 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1367 callers to use add_local_pair_with_rel.
1368 (Output_data_got::reserve_local): Change object to Relobj*.
1369 * output.h: (class Output_data_reloc_generic): Add pure virtual
1370 declarations for add_global_generic, add_local_generic,
1371 add_output_section_generic.
1372 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1373 functions for Output_data_reloc_generic. Update declarations for
1374 changes listed in output.cc.
1375 (class Output_data_got): Change template parameter to got_size.
1376 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1377 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1378 function.
1379 (Sized_relobj_incr::do_local_plt_offset): New function.
1380 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1381 add_global_generic.
1382
1383 2011-12-17 Cary Coutant <ccoutant@google.com>
1384
1385 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1386 * resolve.cc (Symbol_table::resolve): Likewise.
1387 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1388 arrays.
1389 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1390
1391 2011-12-16 Ian Lance Taylor <iant@google.com>
1392
1393 * output.h (Output_data_reloc_generic::add): Only call
1394 add_dynamic_reloc if this is a dynamic reloc section.
1395
1396 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1397
1398 PR gold/13505
1399 * target-reloc.h (apply_relocation): Replace <64, false> with
1400 <size, big_endian>.
1401
1402 2011-11-25 Nick Clifton <nickc@redhat.com>
1403
1404 * po/it.po: New Italian translation.
1405
1406 2011-11-17 Sterling Augustine <saugustine@google.com>
1407
1408 * script.cc (script_include_directive): Implement.
1409 (read_script_file): New local variables name and search_path. Update
1410 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1411 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1412 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1413
1414 2011-11-11 Sterling Augustine <saugustine@google.com>
1415
1416 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1417 (file_or_sections_cmd): Likewise.
1418
1419 2011-11-11 Doug Kwan <dougkwan@google.com>
1420
1421 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1422 if --just-symbols is given.
1423
1424 2011-11-10 Doug Kwan <dougkwan@google.com>
1425
1426 PR gold/13362
1427 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1428 when processing data relocs.
1429 * reloc.h (Relocate_functions::rel_unaligned): New method.
1430 (Relocate_functions::pcrel_unaligned): Ditto.
1431 (Relocate_functions::rel32_unaligned): Ditto.
1432 (Relocate_functions::pcrel32_unaligned): Ditto.
1433
1434 2011-11-09 Doug Kwan <dougkwan@google.com>
1435
1436 PR gold/13362
1437 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1438 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1439 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1440 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1441 (Relocate_functions::rel_unaligned): New.
1442 (Relocate_functions::rel32_unaligned): New.
1443 * target-reloc.h (relocate_for_relocatable): Add code to handle
1444 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1445 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1446 arm_unaligned_reloc_r): New targets.
1447 * testsuite/Makefile.in: Regenerate.
1448 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1449 linking.
1450
1451 2011-11-02 Ian Lance Taylor <iant@google.com>
1452
1453 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1454 NATIVE_LINKER.
1455 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1456 * options.cc (General_options::finalize): Use library search path
1457 from configure script if specified. If not native and no sysroot,
1458 only search TOOLLIBDIR.
1459 * options.h (Search_directory::Search_directory): Change name to
1460 const std::string&.
1461 (General_options::add_to_library_path_with_sysroot): Change arg to
1462 const std::string&.
1463 * configure, Makefile.in, config.in: Rebuild.
1464
1465 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1466
1467 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1468 we are working around the ARM1176 Erratum.
1469 * options.h (General_options::fix_arm1176): Add option.
1470 * testsuite/Makefile.am: Add testcases, and keep current ones
1471 working.
1472 * testsuite/Makefile.in: Regenerate.
1473 * testsuite/arm_fix_1176.s: New file.
1474 * testsuite/arm_fix_1176.sh: Likewise.
1475
1476 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1477
1478 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1479 may_use_blx_.
1480 (Target_arm::may_use_blx): Remove method.
1481 (Target_arm::set_may_use_blx): Likewise.
1482 (Target_arm::may_use_v4t_interworking): New method.
1483 (Target_arm::may_use_v5t_interworking): Likewise.
1484 (Target_arm::may_use_blx_): Remove member variable.
1485 (Arm_relocate_functions::arm_branch_common): Check for v5T
1486 interworking.
1487 (Arm_relocate_functions::thumb_branch_common): Likewise.
1488 (Reloc_stub::stub_type_for_reloc): Likewise.
1489 (Target_arm::do_finalize_sections): Correct interworking checks.
1490 * testsuite/Makefile.am: Add new tests.
1491 * testsuite/Makefile.in: Regenerate.
1492 * testsuite/arm_farcall_arm_arm.s: New test.
1493 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1494 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1495 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1496 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1497 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1498 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1499 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1500
1501 2011-10-31 Cary Coutant <ccoutant@google.com>
1502
1503 PR gold/13023
1504 * expression.cc (Expression::eval_with_dot): Add
1505 is_section_dot_assignment parameter.
1506 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1507 absolute and assigning to dot within a section.
1508 * script-sections.cc
1509 (Output_section_element_assignment::set_section_addresses): Pass
1510 dot_section to set_if_absolute.
1511 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1512 as is_section_dot_assignment flag to eval_with_dot.
1513 (Output_section_element_dot_assignment::set_section_addresses):
1514 Likewise.
1515 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1516 parameter. Also set value if relative to dot_section; set the
1517 symbol's output_section.
1518 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1519 parameter. Adjust all callers.
1520 (Expression::eval_maybe_dot): Likewise.
1521 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1522 Adjust all callers.
1523 * testsuite/script_test_2.t: Test assignment of an absolute value
1524 to dot within an output section element.
1525
1526 2011-10-31 Cary Coutant <ccoutant@google.com>
1527
1528 * options.h (class General_options): Add --[no-]gnu-unique options.
1529 * symtab.cc (Symbol_table::sized_write_globals): Convert
1530 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1531
1532 2011-10-31 Cary Coutant <ccoutant@google.com>
1533
1534 PR gold/13359
1535 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1536 unnecessary assertion.
1537 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1538
1539 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1540
1541 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1542 gc_mark_symbol.
1543 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1544 gc_mark_symbol.
1545 Change to just keep the section associated with symbol.
1546 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1547 they are externally visible and --export-dynamic is turned on.
1548 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1549
1550 2011-10-19 Ian Lance Taylor <iant@google.com>
1551
1552 PR gold/13163
1553 * script-sections.cc
1554 (Output_section_element_dot_assignment::needs_output_section): New
1555 function.
1556
1557 2011-10-19 Ian Lance Taylor <iant@google.com>
1558
1559 PR gold/13204
1560 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1561 --section-start option was seen.
1562 * options.h (General_options::any_section_start): New function.
1563
1564 2011-10-18 David S. Miller <davem@davemloft.net>
1565
1566 PR binutils/13301
1567 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1568 member to track relocation locations that have moved during TLS
1569 reloc optimizations.
1570 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1571 (Target_sparc::Relocate::relocate): Adjust view down by 4
1572 bytes if it matches reloc_adjust_addr_.
1573 (Target_sparc::Relocate::relocate_tls): Always move the
1574 __tls_get_addr call delay slot instruction forward 4 bytes when
1575 performing relaxation.
1576
1577 2011-10-18 Cary Coutant <ccoutant@google.com>
1578
1579 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1580 (Output_file::map_no_anonymous): Check for non-zero
1581 return code from posix_fallocate.
1582
1583 2011-10-17 Cary Coutant <ccoutant@google.com>
1584
1585 PR gold/13245
1586 * plugin.cc (is_visible_from_outside): Check for symbols
1587 referenced from dynamic objects.
1588 * resolve.cc (Symbol_table::resolve): Don't count references
1589 from dynamic objects as references from real ELF files.
1590 * testsuite/plugin_test_2.sh: Adjust expected result.
1591
1592 2011-10-17 Cary Coutant <ccoutant@google.com>
1593
1594 * gold.cc: Include timer.h.
1595 (queue_middle_tasks): Stamp time.
1596 (queue_final_tasks): Likewise.
1597 * main.cc (main): Store timer in parameters. Print timers
1598 for each pass.
1599 * parameters.cc (Parameters::Parameters): Initialize timer_.
1600 (Parameters::set_timer): New function.
1601 (set_parameters_timer): New function.
1602 * parameters.h (Parameters::set_timer): New function.
1603 (Parameters::timer): New function.
1604 (Parameters::timer_): New data member.
1605 (set_parameters_timer): New function.
1606 * timer.cc (Timer::stamp): New function.
1607 (Timer::get_pass_time): New function.
1608 * timer.h (Timer::stamp): New function.
1609 (Timer::get_pass_time): New function.
1610 (Timer::pass_times_): New data member.
1611
1612 2011-10-17 Cary Coutant <ccoutant@google.com>
1613
1614 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1615 task for members of lib groups.
1616
1617 2011-10-17 Cary Coutant <ccoutant@google.com>
1618
1619 PR gold/13288
1620 * fileread.cc (File_read::find_view): Add assert.
1621 (File_read::make_view): Move bounds check (replace with assert)...
1622 (File_read::find_or_make_view): ... to here.
1623
1624 2011-10-12 Cary Coutant <ccoutant@google.com>
1625
1626 * output.cc (Output_file::open_base_file): Handle case where
1627 ::read returns less than requested size.
1628
1629 2011-10-10 Cary Coutant <ccoutant@google.com>
1630
1631 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1632 Initialize defined_count_.
1633 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1634 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1635 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1636 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1637 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1638 * incremental.h (Sized_relobj_incr::defined_count_): New data
1639 member.
1640 (Sized_incr_dynobj::defined_count_): New data member.
1641 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1642 Return zeroes instead of internal error.
1643
1644 2011-10-10 Cary Coutant <ccoutant@google.com>
1645
1646 PR gold/13249
1647 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1648 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1649 * output.h (class Output_reloc): Add use_plt_offset flag.
1650 (Output_reloc::type_): Adjust size of bit field.
1651 (Output_reloc::use_plt_offset_): New bit field.
1652 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1653 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1654 flag. Adjust all callers.
1655 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1656 creating RELATIVE relocations.
1657
1658 2011-10-10 Nick Clifton <nickc@redhat.com>
1659
1660 * po/es.po: Updated Spanish translation.
1661 * po/fi.po: Updated Finnish translation.
1662
1663 2011-10-03 Diego Novillo <dnovillo@google.com>
1664
1665 * options.cc (parse_uint): Fix dereference of RETVAL.
1666
1667 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1668
1669 * layout.h (section_order_map_): New member.
1670 (get_section_order_map): New member function.
1671 * output.cc (Output_section::add_input_section): Check for patterns
1672 only when --section-ordering-file is specified.
1673 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1674 output_sections have been formed.
1675 * layout.cc (Layout_Layout): Initialize section_order_map_.
1676 * plugin.cc (update_section_order): Store order in order_map. Do not
1677 update the order.
1678 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1679 * testsuite/Makefile.in: Regenerate.
1680 * testsuite/plugin_section_order.c: New file.
1681 * testsuite/plugin_final_layout.cc: New file.
1682 * testsuite/plugin_final_layout.sh: New file.
1683
1684 2011-09-29 Cary Coutant <ccoutant@google.com>
1685
1686 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1687 Check for NULL.
1688 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1689 symbols during incremental update.
1690 (Symbol_table::add_from_dynobj): Likewise.
1691
1692 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1693 Ian Lance Taylor <iant@google.com>
1694
1695 * symtab.cc (Symbol_table::define_special_symbol): Always
1696 canonicalize version string.
1697
1698 2011-09-26 Cary Coutant <ccoutant@google.com>
1699
1700 * gold.cc (queue_initial_tasks): Move option checks ...
1701 * options.cc (General_options::finalize): ... to here. Disable
1702 some options; make others fatal.
1703
1704 2011-09-26 Cary Coutant <ccoutant@google.com>
1705
1706 gcc PR lto/47247
1707 * plugin.cc (get_symbols_v2): New function.
1708 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1709 (is_referenced_from_outside): New function.
1710 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1711 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1712 (get_symbols): Pass version parameter.
1713 (get_symbols_v2): New function.
1714 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1715 parameter.
1716 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1717 (onload): Add LDPT_GET_SYMBOLS_V2.
1718 (all_symbols_read_hook): Use get_symbols_v2; check for
1719 LDPR_PREVAILING_DEF_IRONLY_EXP.
1720 * testsuite/plugin_test_3.sh: Update expected results.
1721
1722 2011-09-23 Simon Baldwin <simonb@google.com>
1723
1724 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1725 configuration options.
1726 * configure: Regenerate.
1727 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1728 * Makefile.in: Regenerate.
1729 * testsuite/Makefile.in: Regenerate.
1730
1731 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1732
1733 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1734
1735 2011-09-19 Cary Coutant <ccoutant@google.com>
1736
1737 * incremental.cc (can_incremental_update): Fix typo in comment.
1738 * incremental.h (can_incremental_update): Likewise.
1739
1740 2011-09-18 Cary Coutant <ccoutant@google.com>
1741
1742 * incremental.cc (can_incremental_update): New function.
1743 * incremental.h (can_incremental_update): New function.
1744 * layout.cc (Layout::init_fixed_output_section): Call it.
1745 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1746 * object.cc (Sized_relobj_file::do_layout): Call
1747 can_incremental_update.
1748
1749 2011-09-13 Cary Coutant <ccoutant@google.com>
1750
1751 * configure.ac: Check for glibc support for gnu_indirect_function
1752 support with static linking, setting automake conditional
1753 IFUNC_STATIC.
1754 * Makefile.in: Regenerate.
1755 * configure: Regenerate.
1756
1757 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1758 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1759 for IFUNC_STATIC.
1760 * testsuite/Makefile.in: Regenerate.
1761
1762 2011-09-13 Cary Coutant <ccoutant@google.com>
1763
1764 * incremental.cc (Sized_relobj_incr::do_layout): Call
1765 report_comdat_group for kept comdat sections.
1766 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1767 * testsuite/Makefile.in: Regenerate.
1768 * testsuite/incr_comdat_test_1.cc: New source file.
1769 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1770 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1771 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1772
1773 2011-09-13 Ian Lance Taylor <iant@google.com>
1774
1775 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1776 variable external_symbols_offset.
1777
1778 2011-09-12 Ian Lance Taylor <iant@google.com>
1779
1780 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1781 triggered if object has no symbols.
1782
1783 2011-09-09 David S. Miller <davem@davemloft.net>
1784
1785 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1786 (Output_fill_debug_line::do_write): Likewise.
1787
1788 2011-08-29 Cary Coutant <ccoutant@google.com>
1789
1790 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1791 casts to match formatting specs.
1792 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1793
1794 2011-08-26 Cary Coutant <ccoutant@google.com>
1795
1796 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1797 remaining hole size when allocating.
1798 (Layout::make_output_section): Set fill methods for debug sections.
1799 * layout.h (Free_list::Free_list_node): Move from private to
1800 public.
1801 (Free_list::set_min_hole_size): New function.
1802 (Free_list::begin, Free_list::end): New functions.
1803 (Free_list::min_hole_): New data member.
1804 * output.cc: Include dwarf.h.
1805 (Output_fill_debug_info::do_minimum_hole_size): New function.
1806 (Output_fill_debug_info::do_write): New function.
1807 (Output_fill_debug_line::do_minimum_hole_size): New function.
1808 (Output_fill_debug_line::do_write): New function.
1809 (Output_section::Output_section): Initialize new data member.
1810 (Output_section::set_final_data_size): Ensure patch space is larger
1811 than minimum hole size.
1812 (Output_section::do_write): Fill holes in debug sections.
1813 * output.h (Output_fill): New class.
1814 (Output_fill_debug_info): New class.
1815 (Output_fill_debug_line): New class.
1816 (Output_section::set_free_space_fill): New function.
1817 (Output_section::free_space_fill_): New data member.
1818 * testsuite/Makefile.am (incremental_test_3): Add
1819 --incremental-patch option.
1820 (incremental_test_4): Likewise.
1821 (incremental_test_5): Likewise.
1822 (incremental_test_6): Likewise.
1823 (incremental_copy_test): Likewise.
1824 (incremental_common_test_1): Likewise.
1825 * testsuite/Makefile.in: Regenerate.
1826
1827 2011-08-26 Nick Clifton <nickc@redhat.com>
1828
1829 * po/es.po: Updated Spanish translation.
1830
1831 2011-08-01 Cary Coutant <ccoutant@google.com>
1832
1833 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1834 * gold/testsuite/Makefile.in: Regenerate.
1835 * gold/testsuite/justsyms_exec.c: New source file.
1836 * gold/testsuite/justsyms_lib.c: New source file.
1837
1838 2011-08-01 Cary Coutant <ccoutant@google.com>
1839
1840 * layout.cc (Layout::set_segment_offsets): Don't realign text
1841 segment if -Ttext was specified.
1842 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1843 file type.
1844 * object.h (Sized_relobj_file::e_type): New function.
1845 (Sized_relobj_file::e_type_): New data member.
1846 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1847 base address for ET_EXEC files.
1848 * target.cc (Target::do_make_elf_object_implementation): Allow
1849 ET_EXEC files with --just-symbols option.
1850
1851 2011-07-28 Cary Coutant <ccoutant@google.com>
1852
1853 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1854 Add thread_number parameter.
1855 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1856 * workqueue-threads.cc
1857 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1858 current thread if its thread number is greater than desired thread
1859 count.
1860 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1861 Add thread_number parameter.
1862 (Workqueue::should_cancel_thread): Likewise.
1863 (Workqueue::find_runnable_or_wait): Pass thread_number to
1864 should_cancel_thread.
1865 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1866 parameter.
1867
1868 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1869
1870 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1871 only after checking if it cannot be forced local.
1872 * symtab.h (is_externally_visible): Check if the symbol is not forced
1873 local.
1874
1875 2011-07-15 Ian Lance Taylor <iant@google.com>
1876
1877 * options.h (class General_options): Add --print-output-format.
1878 Move -EL next to -EB, for better --help output.
1879 * target-select.cc: Include <cstdio>, "options.h", and
1880 "parameters.h".
1881 (Target_selector::do_target_bfd_name): New function.
1882 (print_output_format): New function.
1883 * target-select.h (class Target_selector): Update declarations.
1884 (Target_selector::target_bfd_name): New function.
1885 (print_output_format): Declare.
1886 * main.cc: Include "target-select.h".
1887 (main): Handle --print-output-format.
1888 * gold.cc: Include "target-select.h".
1889 (queue_initial_tasks): Handle --print-output-format when there are
1890 no input files.
1891 * parameters.cc (parameters_force_valid_target): Give a better
1892 error message if -EB/-EL does not match target.
1893 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1894 function.
1895
1896 2011-07-15 Ian Lance Taylor <iant@google.com>
1897
1898 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1899 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1900 (Output_data_plt_i386::do_write): Write address of .dynamic
1901 section to first entry in .got.plt section.
1902 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1903 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1904 Initialize layout_.
1905 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1906 section to first entry in .got.plt section.
1907 * layout.h (Layout::dynamic_section): New function.
1908
1909 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1910
1911 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1912 to claim_file call.
1913 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1914 input_section_position_, and input_section_glob_.
1915 (read_layout_from_file): Call function section_ordering_specified.
1916 * layout.h (is_section_ordering_specified): New function.
1917 (section_ordering_specified): New function.
1918 (section_ordering_specified_): New boolean member.
1919 * main.cc(main): Call load_plugins after layout object is defined.
1920 * output.cc (Output_section::add_input_section): Use
1921 function section_ordering_specified to check if section ordering is
1922 needed.
1923 * output.cc (Output_section::add_relaxed_input_section): Use
1924 function section_ordering_specified to check if section ordering is
1925 needed.
1926 (Output_section::update_section_layout): New function.
1927 (Output_section::sort_attached_input_sections): Check if input section
1928 must be reordered.
1929 * output.h (Output_section::update_section_layout): New function.
1930 * plugin.cc (get_section_count): New function.
1931 (get_section_type): New function.
1932 (get_section_name): New function.
1933 (get_section_contents): New function.
1934 (update_section_order): New function.
1935 (allow_section_ordering): New function.
1936 (Plugin::load): Add the new interfaces to the transfer vector.
1937 (Plugin_manager::load_plugins): New parameter.
1938 (Plugin_manager::all_symbols_read): New parameter.
1939 (Plugin_manager::claim_file): New parameter. Save the elf object for
1940 unclaimed objects.
1941 (Plugin_manager::get_elf_object): New function.
1942 (Plugin_manager::get_view): Change to directly use the bool to check
1943 if get_view is called from claim_file_hook.
1944 * plugin.h (input_objects): New function
1945 (Plugin__manager::load_plugins): New parameter.
1946 (Plugin_manager::claim_file): New parameter.
1947 (Plugin_manager::get_elf_object): New function.
1948 (Plugin_manager::in_claim_file_handler): New function.
1949 (Plugin_manager::in_claim_file_handler_): New member.
1950 (layout): New function.
1951 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1952 handler with an extra parameter. Make the elf object before calling
1953 claim_file handler.
1954 * testsuite/plugin_test.c (get_section_count): New function pointer.
1955 (get_section_type): New function pointer.
1956 (get_section_name): New function pointer.
1957 (get_section_contents): New function pointer.
1958 (update_section_order): New function pointer.
1959 (allow_section_ordering): New function pointer.
1960 (onload): Check if the new interfaces exist.
1961
1962 2011-07-13 Ian Lance Taylor <iant@google.com>
1963
1964 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1965 relro section.
1966 * x86_64.cc (Target_x86_64::got_section): Likewise.
1967 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1968 (relro_now_test_SOURCES): New variable.
1969 (relro_now_test_DEPENDENCIES): New variable.
1970 (relro_now_test_LDFLAGS): New variable.
1971 (relro_now_test_LDADD): New variable.
1972 (relro_now_test.so): New target.
1973 * testsuite/Makefile.in: Rebuild.
1974
1975 2011-07-12 Ian Lance Taylor <iant@google.com>
1976
1977 PR gold/12980
1978 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1979 GLOB_DAT relocation rather than a RELATIVE relocation for a
1980 protected symbol when creating a shared library.
1981 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1982 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1983 * testsuite/protected_main_1.cc (main): Test that protected
1984 function has same address.
1985
1986 2011-07-11 Ian Lance Taylor <iant@google.com>
1987
1988 PR gold/12979
1989 * options.h (class General_options): Add -Bgroup.
1990 * options.cc (General_options::finalize): If -Bgroup is set,
1991 default to --unresolved-symbols=report-all.
1992 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1993 * target-reloc.h (issue_undefined_symbol_error): Handle
1994 --unresolved-symbols=report-all.
1995
1996 2011-07-08 Ian Lance Taylor <iant@google.com>
1997
1998 PR gold/11985
1999 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2000 if linker script discards key sections.
2001 (Layout::create_dynamic_symtab): Likewise.
2002 (Layout::assign_local_dynsym_offsets): Likewise.
2003 (Layout::sized_create_version_sections): Likewise.
2004 (Layout::create_interp): Likewise.
2005 (Layout::finish_dynamic_section): Likewise.
2006 (Layout::set_dynamic_symbol_size): Likewise.
2007
2008 2011-07-08 Ian Lance Taylor <iant@google.com>
2009
2010 PR gold/12386
2011 * options.h (class General_options): Add --unresolved-symbols.
2012 * target-reloc.h (issue_undefined_symbol_error): Check
2013 --unresolved-symbols. Add comments.
2014
2015 2011-07-08 Ian Lance Taylor <iant@google.com>
2016
2017 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2018 expression more complex.
2019
2020 2011-07-08 Ian Lance Taylor <iant@google.com>
2021
2022 PR gold/11317
2023 * target-reloc.h (issue_undefined_symbol_error): New inline
2024 function, broken out of relocate_section.
2025 (relocate_section): Call issue_undefined_symbol_error.
2026 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2027 there is no TLS segment if we are about to issue an undefined
2028 symbol error.
2029 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2030
2031 2011-07-08 Ian Lance Taylor <iant@google.com>
2032
2033 PR gold/12279
2034 * resolve.cc (Symbol_table::should_override): Add fromtype
2035 parameter. Change all callers. Give error when linking together
2036 TLS and non-TLS symbol.
2037 (Symbol_table::should_override_with_special): Add fromtype
2038 parameter. Change all callers.
2039 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2040 there is no TLS segment if we have reported some errors.
2041 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2042
2043 2011-07-08 Ian Lance Taylor <iant@google.com>
2044
2045 PR gold/12372
2046 * target.h (Target::plt_address_for_global): New function.
2047 (Target::plt_address_for_local): New function.
2048 (Target::plt_section_for_global): Remove.
2049 (Target::plt_section_for_local): Remove.
2050 (Target::do_plt_address_for_global): New virtual function.
2051 (Target::do_plt_address_for_local): New virtual function.
2052 (Target::do_plt_section_for_global): Remove.
2053 (Target::do_plt_section_for_local): Remove.
2054 (Target::register_global_plt_entry): Add Symbol_table and Layout
2055 parameters.
2056 * output.cc (Output_data_got::Got_entry::write): Use
2057 plt_address_for_global and plt_address_for_local.
2058 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2059 address of output section.
2060 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2061 got_irelative_, and irelative_count_ fields. Update
2062 declarations.
2063 (Output_data_plt_i386::has_irelative_section): New function.
2064 (Output_data_plt_i386::entry_count): Add irelative_count_.
2065 (Output_data_plt_i386::set_final_data_size): Likewise.
2066 (class Target_i386): Add got_irelative_ and rel_irelative_
2067 fields. Update declarations.
2068 (Target_i386::Target_i386): Initialize new fields.
2069 (Target_i386::do_plt_address_for_global): New function replacing
2070 do_plt_section_for_global.
2071 (Target_i386::do_plt_address_for_local): New function replacing
2072 do_plt_section_for_local.
2073 (Target_i386::got_section): Create got_irelative_.
2074 (Target_i386::rel_irelative_section): New function.
2075 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2076 fields. Don't define __rel_iplt_{start,end}.
2077 (Output_data_plt_i386::add_entry): Add symtab and layout
2078 parameters. Change all callers. Use different PLT and GOT for
2079 IFUNC symbols.
2080 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2081 layout parameters. Change all callers. Use different PLT and
2082 GOT.
2083 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2084 (Output_data_plt_i386::rel_irelative): New function.
2085 (Output_data_plt_i386::address_for_global): New function.
2086 (Output_data_plt_i386::address_for_local): New function.
2087 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2088 IRELATIVE GOT when changing IFUNC GOT entries.
2089 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2090 reloc.
2091 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2092 if we didn't create an IRELATIVE GOT.
2093 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2094 plt_address_for_local.
2095 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2096 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2097 got_irelative_, and irelative_count_ fields. Update
2098 declarations.
2099 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2100 Initialize new fields. Remove symtab parameter. Change all
2101 callers.
2102 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2103 irelative_count_.
2104 (Output_data_plt_x86_64::has_irelative_section): New function.
2105 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2106 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2107 fields. Update declarations.
2108 (Target_x86_64::Target_x86_64): Initialize new fields.
2109 (Target_x86_64::do_plt_address_for_global): New function replacing
2110 do_plt_section_for_global.
2111 (Target_x86_64::do_plt_address_for_local): New function replacing
2112 do_plt_section_for_local.
2113 (Target_x86_64::got_section): Create got_irelative_.
2114 (Target_x86_64::rela_irelative_section): New function.
2115 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2116 all callers. Don't create __rel_iplt_{start,end}.
2117 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2118 parameters. Change all callers. Use different PLT and GOT for
2119 IFUNC symbols.
2120 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2121 layout parameters. Change all callers. Use different PLT and
2122 GOT.
2123 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2124 parameters. Change all callers. Use different PLT and GOT for
2125 IFUNC symbols.
2126 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2127 (Output_data_plt_x86_64::rela_irelative): New function.
2128 (Output_data_plt_x86_64::address_for_global): New function.
2129 (Output_data_plt_x86_64::address_for_local): New function.
2130 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2131 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2132 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2133 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2134 parameters.
2135 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2136 reloc.
2137 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2138 symbols if we didn't create an IRELATIVE GOT.
2139 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2140 plt_address_for_local.
2141 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2142 * testsuite/ifuncvar1.c: New test file.
2143 * testsuite/ifuncvar2.c: New test file.
2144 * testsuite/ifuncvar3.c: New test file.
2145 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2146 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2147 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2148 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2149 * testsuite/Makefile.in: Rebuild.
2150
2151 2011-07-07 Cary Coutant <ccoutant@google.com>
2152
2153 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2154 (two_file_test_1_ndebug.o): Likewise.
2155 (two_file_test_1b_ndebug.o): Likewise.
2156 (two_file_test_2_ndebug.o): Likewise.
2157 (two_file_test_main_ndebug.o): Likewise.
2158 (incremental_test_2): Link with no-debug versions.
2159
2160 2011-07-06 Cary Coutant <ccoutant@google.com>
2161
2162 * gold/incremental.cc
2163 (Output_section_incremental_inputs::write_info_blocks): Check for
2164 hidden and internal symbols.
2165
2166 2011-07-06 Cary Coutant <ccoutant@google.com>
2167
2168 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2169 Check disposition for startup file.
2170 (Incremental_inputs::report_command_line): Ignore
2171 --incremental-startup-unchanged option.
2172 * options.cc (General_options::parse_incremental_startup_unchanged):
2173 New function.
2174 (General_options::General_options): Initialize new data member.
2175 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2176 (General_options): Add --incremental-startup-unchanged option.
2177 (General_options::incremental_startup_disposition): New function.
2178 (General_options::incremental_startup_disposition_): New data member.
2179
2180 2011-07-06 Cary Coutant <ccoutant@google.com>
2181
2182 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2183 input file index to Script_info ctor.
2184 (Sized_incremental_binary::do_file_has_changed): Find the
2185 command-line argument for files named in scripts.
2186 * incremental.h (Script_info::Script_info): New ctor
2187 with input file index.
2188 (Script_info::input_file_index): New function.
2189 (Script_info::input_file_index_): New data member.
2190 (Incremental_binary::get_library): Add const.
2191 (Incremental_binary::get_script_info): Add const.
2192 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2193 * testsuite/Makefile.am (incremental_test_5): New test case.
2194 (incremental_test_6): New test case.
2195 * testsuite/Makefile.in: Regenerate.
2196
2197 2011-07-06 Cary Coutant <ccoutant@google.com>
2198
2199 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2200 debug output when command lines differ.
2201
2202 2011-07-06 Cary Coutant <ccoutant@google.com>
2203
2204 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2205 --incremental-patch option.
2206 * layout.cc (Free_list::allocate): Extend allocation beyond original
2207 end if enabled.
2208 (Layout::make_output_section): Mark sections that should get
2209 patch space.
2210 * options.cc (parse_percent): New function.
2211 * options.h (parse_percent): New function.
2212 (DEFINE_percent): New macro.
2213 (General_options): Add --incremental-patch option.
2214 * output.cc (Output_section::Output_section): Initialize new data
2215 members.
2216 (Output_section::add_input_section): Print section name when out
2217 of patch space.
2218 (Output_section::add_output_section_data): Likewise.
2219 (Output_section::set_final_data_size): Add patch space when
2220 doing --incremental-full.
2221 (Output_section::do_reset_address_and_file_offset): Remove patch
2222 space.
2223 (Output_segment::set_section_list_addresses): Print debug output
2224 only if --incremental-update.
2225 * output.h (Output_section::set_is_patch_space_allowed): New function.
2226 (Output_section::is_patch_space_allowed_): New data member.
2227 (Output_section::patch_space_): New data member.
2228 * parameters.cc (Parameters::incremental_full): New function.
2229 * parameters.h (Parameters::incremental_full): New function
2230 * testsuite/Makefile.am (incremental_test_2): Add test for
2231 --incremental-patch option.
2232 * testsuite/Makefile.in: Regenerate.
2233 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2234 (t18): Remove function body.
2235
2236 2011-07-05 Doug Kwan <dougkwan@google.com>
2237
2238 PR gold/12771
2239 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2240 Arm_Address type for relocation result.
2241 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2242 overflow check.
2243 (Arm_relocate_functions::abs32): Use unaligned access.
2244 (Arm_relocate_functions::rel32): Ditto.
2245 (Arm_relocate_functions::prel31): Ditto.
2246 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2247 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2248 static data relocations.
2249 * testsuite/Makefile.in: Regnerate.
2250 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2251
2252 2011-07-05 Ian Lance Taylor <iant@google.com>
2253
2254 PR gold/12392
2255 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2256 symbols if necessary.
2257 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2258
2259 2011-07-05 Ian Lance Taylor <iant@google.com>
2260
2261 PR gold/12952
2262 * resolve.cc (Symbol::override_base_with_special): Simply override
2263 version with special symbol version, ignoring previous version.
2264
2265 2011-07-05 Ian Lance Taylor <iant@google.com>
2266
2267 * object.cc (Sized_relobj_file::include_section_group): Add
2268 information to comment about signature location.
2269
2270 2011-07-02 Ian Lance Taylor <iant@google.com>
2271
2272 PR gold/12957
2273 * options.h (class General_options): Add -f and -F.
2274 * options.cc (General_options::finalize): Fatal error if -f/-F
2275 are used without -shared.
2276 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2277
2278 2011-07-02 Ian Lance Taylor <iant@google.com>
2279
2280 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2281
2282 2011-07-01 Ian Lance Taylor <iant@google.com>
2283
2284 PR gold/12525
2285 PR gold/12952
2286 * resolve.cc (Symbol::override_base_with_special): Don't override
2287 the version if the overriding symbol has a different name.
2288 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2289 all callers. If we give an error about an undefined version,
2290 define the base version if necessary.
2291 * dynobj.h (class Versions): Update declaration.
2292 * testsuite/weak_alias_test_5.cc: New file.
2293 * testsuite/weak_alias_test.script: New file.
2294 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2295 and versioned_alias have the right value, and call t2.
2296 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2297 weak_alias_test_5.so.
2298 (weak_alias_test_LDADD): Likewise.
2299 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2300 * testsuite/Makefile.in: Rebuild.
2301
2302 2011-07-01 Ian Lance Taylor <iant@google.com>
2303
2304 PR gold/12525
2305 * options.h (class General_options): Support -z notext.
2306 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2307 -Wl,-z,notext.
2308 (two_file_shared_nonpic.so): Likewise.
2309 (two_file_shared_mixed.so): Likewise.
2310 (two_file_shared_mixed_1.so): Likewise.
2311 (weak_undef_lib_nonpic.so): Likewise.
2312 (alt/weak_undef_lib_nonpic.so): Likewise.
2313 (tls_test_shared_nonpic.so): Likewise.
2314 * testsuite/Makefile.in: Rebuild.
2315
2316 2011-07-01 Ian Lance Taylor <iant@google.com>
2317
2318 PR gold/12525
2319 * configure.ac: Test whether static linking works, setting
2320 the automake conditional HAVE_STATIC.
2321 * testsuite/Makefile.am: Disable tests using -static if
2322 HAVE_STATIC is not true.
2323 * configure, testsuite/Makefile.in: Rebuild.
2324
2325 2011-07-01 Ian Lance Taylor <iant@google.com>
2326
2327 PR gold/12525
2328 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2329 Assert if we see DW_EH_PE_indirect.
2330 * target.h (Target::ehframe_datarel_base): New function.
2331 (Target::do_ehframe_datarel_base): New target function.
2332 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2333 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2334 function.
2335
2336 2011-07-01 Ian Lance Taylor <iant@google.com>
2337
2338 PR gold/12571
2339 * options.h (class General_options): Add
2340 --ld-generated-unwind-info.
2341 * ehframe.cc (Fde::write): Add address parameter. Change all
2342 callers. If associated with PLT, fill in address and size.
2343 (Cie::set_output_offset): Only add merge mapping if there is an
2344 object.
2345 (Cie::write): Add address parameter. Change all callers.
2346 (Eh_frame::add_ehframe_for_plt): New function.
2347 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2348 input_offset_ fields into union u_, with new plt field.
2349 (Fde::Fde): Adjust for new union field.
2350 (Fde::Fde) [Output_data version]: New constructor.
2351 (Fde::add_mapping): Only add merge mapping if there is an object.
2352 (class Cie): Update declarations.
2353 (class Eh_frame): Declare add_ehframe_for_plt.
2354 * layout.cc (Layout::layout_eh_frame): Break out code into
2355 make_eh_frame_section, and call it.
2356 (Layout::make_eh_frame_section): New function.
2357 (Layout::add_eh_frame_for_plt): New function.
2358 * layout.h (class Layout): Update declarations.
2359 * merge.cc (Merge_map::add_mapping): Add assertion.
2360 * i386.cc: Include "dwarf.h".
2361 (class Output_data_plt_i386): Make first_plt_entry,
2362 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2363 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2364 and plt_eh_frame_fde.
2365 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2366 boundary. Call add_eh_frame_for_plt if appropriate.
2367 * x86_64.cc: Include "dwarf.h".
2368 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2369 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2370 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2371 and plt_eh_frame_fde.
2372 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2373 appropriate.
2374
2375 2011-06-29 Ian Lance Taylor <iant@google.com>
2376
2377 PR gold/12629
2378 * object.cc (Sized_relobj_file::layout_section): Change shdr
2379 parameter to be const.
2380 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2381 out of do_layout.
2382 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2383 appropriate. Call layout_eh_frame_section.
2384 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2385 sections.
2386 * object.h (class Sized_relobj_file): Update declarations.
2387
2388 2011-06-29 Ian Lance Taylor <iant@google.com>
2389
2390 PR gold/12652
2391 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2392 modifier.
2393 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2394
2395 2011-06-29 Ian Lance Taylor <iant@google.com>
2396
2397 PR gold/12675
2398 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2399 SHT_X86_64_UNWIND.
2400 * layout.cc (Layout::layout_eh_frame): Likewise.
2401
2402 2011-06-29 Ian Lance Taylor <iant@google.com>
2403
2404 PR gold/12695
2405 * layout.cc (Layout::symtab_section_shndx): New function.
2406 * layout.h (class Layout): Declare symtab_section_shndx.
2407 * output.cc (Output_section::write_header): Call it.
2408
2409 2011-06-29 Ian Lance Taylor <iant@google.com>
2410
2411 PR gold/12818
2412 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2413 symbols which are not used in a relocation.
2414
2415 2011-06-28 Ian Lance Taylor <iant@google.com>
2416
2417 PR gold/12898
2418 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2419 script create indistinguishable segments.
2420 (Layout::set_segment_offsets): Use stable_sort when sorting
2421 segments. Pass this to Compare_segments constructor.
2422 * layout.h (class Layout): Make segment_precedes non-static.
2423 (class Compare_segments): Change from struct to class. Add
2424 layout_ field. Add constructor.
2425 * script-sections.cc
2426 (Script_sections::attach_sections_using_phdrs_clause): Rename
2427 local orphan to is_orphan. Don't report failure to put empty
2428 section in segment. On attachment failure, report name of
2429 section, and attach to first PT_LOAD segment.
2430
2431 2011-06-28 Ian Lance Taylor <iant@google.com>
2432
2433 PR gold/12934
2434 * target-select.cc (Target_selector::Target_selector): Add
2435 emulation parameter. Change all callers.
2436 (select_target_by_bfd_name): Rename from select_target_by_name.
2437 Change all callers.
2438 (select_target_by_emulation): New function.
2439 (supported_emulation_names): New function.
2440 * target-select.h (class Target_selector): Add emulation_ field.
2441 Update declarations.
2442 (Target_selector::recognize_by_bfd_name): Rename from
2443 recognize_by_name. Change all callers.
2444 (Target_selector::supported_bfd_names): Rename from
2445 supported_names. Change all callers.
2446 (Target_selector::recognize_by_emulation): New function.
2447 (Target_selector::supported_emulations): New function.
2448 (Target_selector::emulation): New function.
2449 (Target_selector::do_recognize_by_bfd_name): Rename from
2450 do_recognize_by_name. Change all callers.
2451 (Target_selector::do_supported_bfd_names): Rename from
2452 do_supported_names. Change all callers.
2453 (Target_selector::do_recognize_by_emulation): New function.
2454 (Target_selector::do_supported_emulations): New function.
2455 (select_target_by_bfd_name): Change name in declaration.
2456 (select_target_by_emulation): Declare.
2457 (supported_emulation_names): Declare.
2458 * parameters.cc (parameters_force_valid_target): Try to find
2459 target based on emulation from -m option.
2460 * options.h (class General_options): Change doc string for -m.
2461 * options.cc (help): Print emulations.
2462 (General_options::parse_V): Likewise.
2463 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2464 Add emulation parameter. Change all callers.
2465
2466 2011-06-28 Ian Lance Taylor <iant@google.com>
2467
2468 * target.h (class Target): Add osabi_ field.
2469 (Target::osabi): New function.
2470 (Target::set_osabi): New function.
2471 (Target::Target): Initialize osabi_.
2472 (Target::do_adjust_elf_header): Make pure virtual.
2473 (Sized_target::do_adjust_elf_header): Declare.
2474 * target.cc (Sized_target::do_adjust_elf_header): New function.
2475 (class Sized_target): Instantiate all versions.
2476 * freebsd.h (class Target_freebsd): Remove.
2477 (Target_selector_freebsd::do_recognize): Call set_osabi on
2478 Target.
2479 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2480 (Target_selector_freebsd::set_osabi): Remove.
2481 * i386.cc (class Target_i386): Inherit from Sized_target rather
2482 than Target_freebsd.
2483 * x86_64.cc (class Target_x86_64): Likewise.
2484
2485 2011-06-28 Ian Lance Taylor <iant@google.com>
2486
2487 * target.h (Target::can_check_for_function_pointers): Rewrite.
2488 Make non-virtual.
2489 (Target::can_icf_inline_merge_sections): Likewise.
2490 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2491 (Target::Target_info): Add can_icf_inline_merge_sections field.
2492 (Target::do_can_check_for_function_pointers): New virtual
2493 function.
2494 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2495 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2496 from can_check_for_function_pointers, move in file.
2497 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2498 section_may_have_icf_unsafe_poineters, move in file.
2499 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2500 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2501 Rename from can_check_for_function_pointers, move in file.
2502 (Target_i386::can_icf_inline_merge_sections): Remove.
2503 (Target_i386::i386_info): Initialize
2504 can_icf_inline_merge_sections.
2505 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2506 Initialize can_icf_inline_merge_sections.
2507 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2508 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2509 Rename from can_check_for_function_pointers, move in file.
2510 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2511 (Target_x86_64::x86_64_info): Initialize
2512 can_icf_inline_merge_sections.
2513 * testsuite/testfile.cc (Target_test::test_target_info):
2514 Likewise.
2515 * icf.cc (get_section_contents): Correct formatting.
2516
2517 2011-06-27 Ian Lance Taylor <iant@google.com>
2518
2519 * symtab.cc (Symbol::versioned_name): New function.
2520 (Symbol_table::add_to_final_symtab): Use versioned_name when
2521 appropriate.
2522 (Symbol_table::sized_write_symbol): Likewise.
2523 * symtab.h (class Symbol): Declare versioned_name.
2524 * stringpool.h (class Stringpool_template): Add variant of add
2525 which takes a std::basic_string.
2526 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2527 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2528 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2529 (ver_test_12.o): New target.
2530 * testsuite/Makefile.in: Rebuild.
2531
2532 2011-06-27 Doug Kwan <dougkwan@google.com>
2533
2534 * arm.cc (Arm_relocate_functions::thm_jump8,
2535 Arm_relocate_functions::thm_jump11): Use a wider signed
2536 type to compute offset.
2537 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2538 arm_thm_jump8.
2539 * testsuite/Makefile.in: Regenerate.
2540 * testsuite/arm_branch_in_range.sh: Check test results of
2541 arm_thm_jump11 and arm_thm_jump8.
2542 * testsuite/arm_thm_jump11.s: New test source file.
2543 * testsuite/arm_thm_jump11.t: New linker script.
2544 * testsuite/arm_thm_jump8.s: New test source file.
2545 * testsuite/arm_thm_jump8.t: New linker script.
2546
2547 2011-06-24 Ian Lance Taylor <iant@google.com>
2548
2549 * layout.cc: Include "object.h".
2550 (ctors_sections_in_init_array): New static variable.
2551 (Layout::is_ctors_in_init_array): New function.
2552 (Layout::layout): Add entry to ctors_sections_in_init_array if
2553 appropriate.
2554 * layout.h (class Layout): Declare is_ctors_in_init_array.
2555 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2556 is_ctors_reverse_view is set.
2557 (Sized_relobj_file::write_sections): Add layout parameter. Change
2558 all callers. Set is_ctors_reverse_view field of View_size.
2559 (Sized_relobj_file::reverse_words): New function.
2560 * object.h (Sized_relobj_file::View_size): Add
2561 is_ctors_reverse_view field.
2562 (class Sized_relobj_file): Update declarations.
2563 * testsuite/initpri3.c: New test.
2564 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2565 initpri3b.
2566 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2567 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2568 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2569 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2570 * testsuite/Makefile.in: Rebuild.
2571
2572 2011-06-24 Cary Coutant <ccoutant@google.com>
2573
2574 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2575 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2576 (debug_msg_cdebug.err): New targets.
2577 * testsuite/Makefile.in: Regenerate.
2578 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2579 Fix checks for link with shared library.
2580
2581 2011-06-24 Doug Kwan <dougkwan@google.com>
2582
2583 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2584 skip empty text sections.
2585 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2586
2587 2011-06-22 Ian Lance Taylor <iant@google.com>
2588
2589 PR gold/12910
2590 * options.h (class General_options): Add --ctors-in-init-array.
2591 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2592 friends as SHT_PROGBITS for merging sections.
2593 (Layout::layout): Remove special handling of .init_array and
2594 friends. Don't sort if doing relocatable link. Sort for .ctors
2595 and .dtors if ctors_in_init_array.
2596 (Layout::make_output_section): Force correct section types for
2597 .init_array and friends. Don't sort if doing relocatable link,
2598 Don't sort .ctors and .dtors if ctors_in_init_array.
2599 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2600 (Layout::output_section_name): Add relobj parameter. Change all
2601 callers. Handle .ctors. and .dtors. in code rather than table.
2602 Handle .ctors and .dtors if ctors_in_init_array.
2603 (Layout::match_file_name): New function, moved from output.cc.
2604 * layout.h (class Layout): Update declarations.
2605 * output.cc: Include "layout.h".
2606 (Input_section_sort_entry::get_priority): New function.
2607 (Input_section_sort_entry::match_file_name): Just call
2608 Layout::match_file_name.
2609 (Output_section::Input_section_sort_init_fini_compare::operator()):
2610 Handle .ctors and .dtors. Sort by explicit priority rather than
2611 by name.
2612 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2613 * testsuite/initpri2.c: New test.
2614 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2615 (check_PROGRAMS): Add initpri2.
2616 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2617 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2618 * configure, testsuite/Makefile.in: Rebuild.
2619
2620 2011-06-19 Ian Lance Taylor <iant@google.com>
2621
2622 PR gold/12880
2623 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2624 .interp section to a PT_INTERP segment even if we have seen a
2625 --dynamic-linker option. Don't do it if we have seen a PHDRS
2626 clause in a linker script.
2627 (Layout::finalize): Don't create a .interp section if we've
2628 already create a PT_INTERP segment.
2629 (Layout::create_interp): Always call choose_output_section (revert
2630 patch of 2011-06-17). Don't create PT_INTERP segment.
2631 * script-sections.cc
2632 (Script_sections::create_note_and_tls_segments): Add a .interp
2633 section to a PT_INTERP segment even if we have seen a
2634 --dynamic-linker option.
2635
2636 2011-06-18 Ian Lance Taylor <iant@google.com>
2637
2638 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2639 merely because a non-PT_LOAD segment has a dynamic reloc.
2640
2641 2011-06-18 Ian Lance Taylor <iant@google.com>
2642
2643 * layout.cc (Layout::finish_dynamic_section): Don't create
2644 DT_FLAGS entry if not needed.
2645
2646 2011-06-18 Ian Lance Taylor <iant@google.com>
2647
2648 PR gold/12745
2649 * layout.cc (Layout::layout_eh_frame): Correct handling of
2650 writable .eh_frame section.
2651
2652 2011-06-17 Ian Lance Taylor <iant@google.com>
2653
2654 PR gold/12893
2655 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2656 symbol is redefined with the exact same object and value.
2657
2658 2011-06-17 Ian Lance Taylor <iant@google.com>
2659
2660 PR gold/12880
2661 * layout.h (class Layout): Add interp_segment_ field.
2662 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2663 (Layout::attach_allocated_section_to_segment): If making shared
2664 library, put .interp section in PT_INTERP segment.
2665 (Layout::finalize): Also call create_interp if -dynamic-linker
2666 option was used.
2667 (Layout::create_interp): Assert that there is no PT_INTERP
2668 segment. If not using a SECTIONS clause, use make_output_section.
2669 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2670 * script-sections.cc
2671 (Script_sections::create_note_and_tls_segments): If making shared
2672 library, put .interp section in PT_INTERP segment.
2673
2674 2011-06-17 Ian Lance Taylor <iant@google.com>
2675
2676 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2677 when making a shared library.
2678
2679 2011-06-17 Ian Lance Taylor <iant@google.com>
2680
2681 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2682 parameter. Change all callers. Don't issue warning about PC32
2683 against locally defined symbol.
2684
2685 2011-06-16 Ian Lance Taylor <iant@google.com>
2686
2687 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2688 occurs in same object.
2689
2690 2011-06-14 Alan Modra <amodra@gmail.com>
2691
2692 * po/POTFILES.in: Regenerate.
2693
2694 2011-06-09 Ian Lance Taylor <iant@google.com>
2695
2696 * script-sections.cc
2697 (Orphan_output_section::set_section_addresses): For a relocatable
2698 link set address to 0.
2699
2700 2011-06-09 Cary Coutant <ccoutant@google.com>
2701
2702 PR gold/12804
2703 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2704 used with --compress-debug-sections.
2705 * gold/object.cc (Sized_relobj_file::do_layout): Report
2706 uncompressed size of compressed input sections.
2707
2708 2011-06-08 Cary Coutant <ccoutant@google.com>
2709
2710 PR gold/12804
2711 * testsuite/two_file_test_2_v1.cc: Change initialization of
2712 v2 to keep it in .data.
2713
2714 2011-06-07 Cary Coutant <ccoutant@google.com>
2715
2716 * common.cc (Symbol_table::do_allocate_commons_list): Call
2717 gold_fallback.
2718 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2719 (Errors::fallback): New function.
2720 (gold_fallback): New function.
2721 * errors.h (Errors::fallback): New function.
2722 * gold.cc (gold_exit): Change status parameter to enum; adjust
2723 all callers.
2724 (queue_initial_tasks): Call gold_fallback.
2725 * gold.h: Include cstdlib.
2726 (Exit_status): New enum type.
2727 (gold_exit): Change status parameter to enum.
2728 (gold_fallback): New function.
2729 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2730 (Layout::create_symtab_sections): Likewise.
2731 (Layout::create_shdrs): Likewise.
2732 * main.cc (main): Adjust call to gold_exit.
2733 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2734 (Output_data_got::add_got_entry_pair): Likewise.
2735 (Output_section::add_input_section): Likewise.
2736 (Output_section::add_output_section_data): Likewise.
2737 (Output_segment::set_section_list_addresses): Likewise.
2738 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2739
2740 2011-06-07 Cary Coutant <ccoutant@google.com>
2741
2742 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2743 for incremental links.
2744 * output.cc (Output_segment::set_section_list_addresses): Remove
2745 FIXME and test for TLS or BSS.
2746
2747 2011-06-07 Cary Coutant <ccoutant@google.com>
2748
2749 * testsuite/Makefile.am: Add incremental_copy_test,
2750 incremental_common_test_1.
2751 * testsuite/Makefile.in: Regenerate.
2752 * testsuite/common_test_1_v1.c: New source file.
2753 * testsuite/common_test_1_v2.c: New source file.
2754 * testsuite/copy_test_v1.cc: New source file.
2755
2756 2011-06-07 Cary Coutant <ccoutant@google.com>
2757
2758 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2759 update, allocate common from bss section's free list.
2760 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2761 linker-defined symbols.
2762 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2763 Skip GOT and PLT entries that are no longer referenced.
2764 (Output_section_incremental_inputs::write_info_blocks): Mark
2765 linker-defined symbols.
2766 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2767 * output.cc (Output_section::allocate): New function.
2768 * output.h (Output_section::allocate): New function.
2769 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2770 linker-defined symbols.
2771 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2772 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2773 (Symbol::init_base_output_data): Likewise.
2774 (Symbol::init_base_output_segment): Likewise.
2775 (Symbol::init_base_constant): Likewise.
2776 (Sized_symbol::init_output_data): Likewise.
2777 (Sized_symbol::init_output_segment): Likewise.
2778 (Sized_symbol::init_constant): Likewise.
2779 (Symbol_table::do_define_in_output_data): Likewise.
2780 (Symbol_table::do_define_in_output_segment): Likewise.
2781 (Symbol_table::do_define_as_constant): Likewise.
2782 * symtab.h (Symbol::is_predefined): New function.
2783 (Symbol::init_base_output_data): Add is_predefined parameter.
2784 (Symbol::init_base_output_segment): Likewise.
2785 (Symbol::init_base_constant): Likewise.
2786 (Symbol::is_predefined_): New data member.
2787 (Sized_symbol::init_output_data): Add is_predefined parameter.
2788 (Sized_symbol::init_output_segment): Likewise.
2789 (Sized_symbol::init_constant): Likewise.
2790 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2791
2792 2011-06-07 Cary Coutant <ccoutant@google.com>
2793
2794 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2795 instead of emit_copy_reloc.
2796 (Copy_relocs::emit_copy_reloc): Refactor.
2797 (Copy_relocs::make_copy_reloc): New function.
2798 (Copy_relocs::add_copy_reloc): Remove.
2799 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2800 section.
2801 (Copy_relocs::make_copy_reloc): New function.
2802 (Copy_relocs::add_copy_reloc): Remove.
2803 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2804 unchanged input files.
2805 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2806 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2807 Reserve BSS space for COPY relocations.
2808 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2809 (Output_section_incremental_inputs::write_info_blocks): Record
2810 whether a symbol is copied from a shared object.
2811 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2812 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2813 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2814 (Incremental_input_entry_reader::get_output_symbol_index): Add
2815 is_copy parameter.
2816 (Incremental_binary::emit_copy_relocs): New function.
2817 (Incremental_binary::do_emit_copy_relocs): New function.
2818 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2819 new data member.
2820 (Sized_incremental_binary::add_copy_reloc): New function.
2821 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2822 (Sized_incremental_binary::Copy_reloc): New struct.
2823 (Sized_incremental_binary::Copy_relocs): New typedef.
2824 (Sized_incremental_binary::copy_relocs_): New data member.
2825 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2826 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2827 * target.h (Sized_target::emit_copy_reloc): New function.
2828 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2829
2830 2011-06-02 Cary Coutant <ccoutant@google.com>
2831
2832 PR gold/12163
2833 * gold/archive.cc (Archive::Archive): Initialize new data member.
2834 (Archive::include_all_members): Return if archive has already been
2835 included.
2836 * gold/archive.h (Archive::include_all_members_): New data member.
2837
2838 2011-06-02 Nick Clifton <nickc@redhat.com>
2839
2840 * dynobj.h: Fix spelling mistake in comment.
2841 * output.cc: Likewise.
2842
2843 2011-05-31 Doug Kwan <dougkwan@google.com>
2844 Asier Llano
2845
2846 PR gold/12826
2847 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2848 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2849 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2850 redundant arm_exidx_test.so.
2851 * testsuite/Makefile.in: Regenerate.
2852 (check_SCRIPTS): Add pr12826.sh
2853 (check_DATA): Add pr12826.stdout
2854 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2855 * testsuite/pr12826.sh: New file.
2856 * testsuite/pr12826_1.s: Ditto.
2857 * testsuite/pr12826_1.s: Ditto.
2858
2859 2011-05-30 Ian Lance Taylor <iant@google.com>
2860
2861 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2862 sections.
2863
2864 2011-05-29 Ian Lance Taylor <iant@google.com>
2865
2866 PR gold/12804
2867 * testsuite/Makefile.am: Use different file name for two_file_test
2868 temporary file for each incremental test.
2869 * testsuite/Makefile.in: Rebuild.
2870
2871 2011-05-29 Ian Lance Taylor <iant@google.com>
2872
2873 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2874 binary input file is empty.
2875
2876 2011-05-27 Ian Lance Taylor <iant@google.com>
2877
2878 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2879 (ver_test_9.so): Likewise.
2880 * testsuite/Makefile.in: Rebuild.
2881
2882 2011-05-26 Cary Coutant <ccoutant@google.com>
2883
2884 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2885 * incremental.cc (Incremental_inputs::report_input_section): Fix
2886 comment, indentation.
2887 (Incremental_inputs::report_comdat_group): New function.
2888 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2889 of data for incremental input file entry.
2890 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2891 group count, COMDAT group signatures.
2892 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2893 an unchanged input file.
2894 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2895 Initialize new data member.
2896 (Incremental_object_entry::add_comdat_group): New function.
2897 (Incremental_object_entry::get_comdat_group_count): New function.
2898 (Incremental_object_entry::get_comdat_signature_key): New function.
2899 (Incremental_object_entry::groups_): New data member.
2900 (Incremental_inputs::report_comdat_group): New function.
2901 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2902 data for incremental input file entry.
2903 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2904 (Incremental_input_entry_reader::get_input_section): Adjust size of
2905 data for incremental input file entry.
2906 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2907 (Incremental_input_entry_reader::get_comdat_group_signature): New
2908 function.
2909 * object.cc (Sized_relobj::include_section_group): Report kept
2910 COMDAT groups for incremental links.
2911
2912 2011-05-24 David Meyer <pdox@google.com>
2913
2914 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2915 with name parameter. Add found_name parameter.
2916 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2917 * dirsearch.h (class Dirsearch): Update declaration.
2918
2919 2011-05-24 Ian Lance Taylor <iant@google.com>
2920
2921 * archive.cc (Library_base::should_include_member): Pull in object
2922 from archive if it defines the entry symbol.
2923 * parameters.cc (Parameters::entry): New function.
2924 * parameters.h (class Parameters): Declare entry.
2925 * output.h (class Output_file_header): Remove entry_ field.
2926 * output.cc (Output_file_header::Output_file_header): Remove entry
2927 parameter. Change all callers.
2928 (Output_file_header::entry): Use parameters->entry.
2929 * gold.cc (queue_middle_tasks): Likewise.
2930 * plugin.cc (Plugin_hook::run): Likewise.
2931
2932 2011-05-24 Cary Coutant <ccoutant@google.com>
2933
2934 * gold.cc (queue_initial_tasks): Pass incremental base filename
2935 to Output_file::open_base_file; don't print error message.
2936 * incremental-dump.cc (main): Adjust call to
2937 Output_file::open_for_modification.
2938 * incremental-dump.cc (main): Likewise.
2939 * incremental.cc (Incremental_inputs::report_command_line):
2940 Ignore --incremental-base option when comparing command lines.
2941 Ignore parameter when given as separate argument.
2942 * options.h (class General_options): Add --incremental-base.
2943 * output.cc (Output_file::Output_file):
2944 (Output_file::open_base_file): Add base_name and writable parameters;
2945 read base file into new file; print error message here.
2946 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2947 callers.
2948 * output.h (Output_file::open_for_modification): Rename to...
2949 (Output_file::open_base_file): ...this; add base_name and
2950 writable parameters; adjust all callers.
2951 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2952 callers.
2953 * testsuite/Makefile.am (incremental_test_4): Test
2954 --incremental-base.
2955 * testsuite/Makefile.in: Regenerate.
2956
2957 2011-05-24 Cary Coutant <ccoutant@google.com>
2958
2959 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2960 incremental_test_4.
2961 * testsuite/Makefile.in: Regenerate.
2962 * testsuite/two_file_test_1_v1.cc: New test source file.
2963 * testsuite/two_file_test_1b_v1.cc: New test source file.
2964 * testsuite/two_file_test_2_v1.cc: New test source file.
2965
2966 2011-05-24 Cary Coutant <ccoutant@google.com>
2967
2968 * dynobj.h (Dynobj::do_dynobj): New function.
2969 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2970 flag and soname for shared objects.
2971 * incremental.cc (Incremental_inputs::report_object): Make
2972 either Incremental_object_entry or Incremental_dynobj_entry; add
2973 soname to string table.
2974 (Incremental_inputs::report_input_section): Add assertion.
2975 (Output_section_incremental_inputs::set_final_data_size): Adjust
2976 type of input file entry for shared libraries; adjust size of
2977 shared library info entry.
2978 (Output_section_incremental_inputs::write_input_files): Write
2979 as_needed flag for shared libraries.
2980 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2981 of input file entry for shared libraries; write soname.
2982 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2983 soname from incremental info.
2984 * incremental.h (enum Incremental_input_flags): Add
2985 INCREMENTAL_INPUT_AS_NEEDED.
2986 (Incremental_input_entry::Incremental_input_entry): Initialize new
2987 data member.
2988 (Incremental_input_entry::set_as_needed): New function.
2989 (Incremental_input_entry::as_needed): New function.
2990 (Incremental_input_entry::do_dynobj_entry): New function.
2991 (Incremental_input_entry::as_needed_): New data member.
2992 (Incremental_object_entry::Incremental_object_entry): Don't check
2993 for shared library.
2994 (Incremental_object_entry::do_type): Likewise.
2995 (class Incremental_dynobj_entry): New class.
2996 (Incremental_input_entry_reader::as_needed): New function.
2997 (Incremental_input_entry_reader::get_soname): New function.
2998 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2999 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3000 size of shared library info entry.
3001 * layout.cc (Layout::finish_dynamic_section): Don't test for
3002 incremental link when adding DT_NEEDED entries.
3003 * object.h (Object::Object): Initialize new data member.
3004 (Object::dynobj): New function.
3005 (Object::set_as_needed): New function.
3006 (Object::as_needed): New function.
3007 (Object::do_dynobj): New function.
3008 (Object::as_needed_): New data member.
3009
3010 2011-05-24 Cary Coutant <ccoutant@google.com>
3011
3012 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3013 info; adjust display of GOT entries.
3014 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3015 vector of input objects; remove file_status_.
3016 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3017 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3018 got_plt reader; call target hooks to reserve GOT entries.
3019 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3020 of input file info header and GOT info entry.
3021 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3022 relocation info.
3023 (Got_plt_view_info::got_descriptor): Remove.
3024 (Got_plt_view_info::sym_index): New data member.
3025 (Got_plt_view_info::input_index): New data member.
3026 (Local_got_offset_visitor::visit): Write input file index.
3027 (Global_got_offset_visitor::visit): Write 0 for input file index.
3028 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3029 with sym_index and input_index.
3030 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3031 incremental info GOT entry; replace got_descriptor with input_index.
3032 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3033 map from input file index to object.
3034 (Sized_relobj_incr::do_layout): Replace direct data member reference
3035 with accessor function.
3036 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3037 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3038 Adjust size of input file info header.
3039 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3040 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3041 (Incremental_input_entry_reader::get_input_section): Adjust size of
3042 input file info header.
3043 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3044 of incremental info GOT entry.
3045 (Incremental_got_plt_reader::get_got_desc): Remove.
3046 (Incremental_got_plt_reader::get_got_symndx): New function.
3047 (Incremental_got_plt_reader::get_got_input_index): New function.
3048 (Sized_incremental_binary::Sized_incremental_binary): Remove
3049 file_status_; add input_objects_.
3050 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3051 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3052 (Sized_incremental_binary::file_is_unchanged): Remove.
3053 (Sized_incremental_binary::set_input_object): New function.
3054 (Sized_incremental_binary::input_object): New function.
3055 (Sized_incremental_binary::file_status_): Remove.
3056 (Sized_incremental_binary::input_objects_): New data member.
3057 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3058 references.
3059 (Sized_relobj_incr::invalid_address): Move to base class.
3060 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3061 class.
3062 (Sized_relobj_incr::do_output_section_offset): Likewise.
3063 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3064 (Sized_relobj_incr::section_offsets_): Likewise.
3065 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3066 function.
3067 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3068 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3069 with accessor function.
3070 (Sized_relobj_file::do_layout): Likewise.
3071 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3072 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3073 (Sized_relobj_file::compute_final_local_value): Replace refs to
3074 section_offsets_ with accessor function.
3075 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3076 * object.h (Relobj::Relobj): Initialize new data members.
3077 (Relobj::add_dyn_reloc): New function.
3078 (Relobj::first_dyn_reloc): New function.
3079 (Relobj::dyn_reloc_count): New function.
3080 (Relobj::first_dyn_reloc_): New data member.
3081 (Relobj::dyn_reloc_count_): New data member.
3082 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3083 references.
3084 (Sized_relobj::Address): New typedef.
3085 (Sized_relobj::invalid_address): Move here from child class.
3086 (Sized_relobj::Sized_relobj): Initialize new data members.
3087 (Sized_relobj::sized_relobj): New function.
3088 (Sized_relobj::is_output_section_offset_invalid): Move here from
3089 child class.
3090 (Sized_relobj::get_output_section_offset): Likewise.
3091 (Sized_relobj::local_has_got_offset): Likewise.
3092 (Sized_relobj::local_got_offset): Likewise.
3093 (Sized_relobj::set_local_got_offset): Likewise.
3094 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3095 (Sized_relobj::clear_got_offsets): New function.
3096 (Sized_relobj::section_offsets): Move here from child class.
3097 (Sized_relobj::do_output_section_offset): Likewise.
3098 (Sized_relobj::do_set_section_offset): Likewise.
3099 (Sized_relobj::Local_got_offsets): Likewise.
3100 (Sized_relobj::local_got_offsets_): Likewise.
3101 (Sized_relobj::section_offsets_): Likewise.
3102 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3103 references.
3104 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3105 class.
3106 (Sized_relobj_file::sized_relobj): New function
3107 (Sized_relobj_file::local_has_got_offset): Move to base class.
3108 (Sized_relobj_file::local_got_offset): Likewise.
3109 (Sized_relobj_file::set_local_got_offset): Likewise.
3110 (Sized_relobj_file::get_output_section_offset): Likewise.
3111 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3112 (Sized_relobj_file::do_output_section_offset): Likewise.
3113 (Sized_relobj_file::do_set_section_offset): Likewise.
3114 (Sized_relobj_file::Local_got_offsets): Likewise.
3115 (Sized_relobj_file::local_got_offsets_): Likewise.
3116 (Sized_relobj_file::section_offsets_): Likewise.
3117 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3118 (all constructors).
3119 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3120 (Output_reloc::get_symbol_index): Likewise.
3121 (Output_reloc::local_section_offset): Likewise.
3122 (Output_reloc::get_address): Likewise.
3123 (Output_reloc::symbol_value): Likewise.
3124 (Output_data_got::reserve_slot): Move to class definition.
3125 (Output_data_got::reserve_local): New function.
3126 (Output_data_got::reserve_slot_for_global): Remove.
3127 (Output_data_got::reserve_global): New function.
3128 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3129 (all constructors, two instantiations).
3130 (Output_reloc::get_relobj): New function (two instantiations).
3131 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3132 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3133 (Output_data_reloc::add_global): Adjust type of relobj.
3134 (Output_data_reloc::add_global_relative): Likewise.
3135 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3136 (Output_data_reloc::add_local): Likewise.
3137 (Output_data_reloc::add_local_relative): Likewise.
3138 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3139 (Output_data_reloc::add_local_section): Likewise.
3140 (Output_data_reloc::add_output_section): Likewise.
3141 (Output_data_reloc::add_absolute): Likewise.
3142 (Output_data_reloc::add_target_specific): Likewise.
3143 (Output_data_got::reserve_slot): Move definition here.
3144 (Output_data_got::reserve_local): New function.
3145 (Output_data_got::reserve_global): New function.
3146 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3147 section_offsets_ with accessor function.
3148 (Sized_relobj_file::write_sections): Likewise.
3149 (Sized_relobj_file::do_relocate_sections): Likewise.
3150 * target.h (Sized_target::reserve_local_got_entry): New function.
3151 (Sized_target::reserve_global_got_entry): New function.
3152 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3153 (Target_x86_64::reserve_global_got_entry): New function.
3154 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3155
3156 2011-05-23 Cary Coutant <ccoutant@google.com>
3157
3158 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3159 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3160 bit when checking got_type.
3161 * incremental.cc (Sized_incremental_binary::setup_readers):
3162 Store symbol table and string table locations; initialize bit vector
3163 of file status flags.
3164 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3165 unchanged files.
3166 (Sized_incremental_binary::do_process_got_plt): New function.
3167 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3168 (Output_section_incremental_inputs::set_final_data_size): Record
3169 file index for each input file.
3170 (Output_section_incremental_inputs::write_got_plt): Store file index
3171 instead of input entry offset for each GOT entry.
3172 * incremental.h
3173 (Incremental_input_entry::Incremental_input_entry): Initialize new
3174 data member.
3175 (Incremental_input_entry::set_offset): Store file index.
3176 (Incremental_input_entry::get_file_index): New function.
3177 (Incremental_input_entry::file_index_): New data member.
3178 (Incremental_binary::process_got_plt): New function.
3179 (Incremental_binary::do_process_got_plt): New function.
3180 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3181 data members.
3182 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3183 (Sized_incremental_binary::set_file_is_unchanged): New function.
3184 (Sized_incremental_binary::file_is_unchanged): New function.
3185 (Sized_incremental_binary::do_process_got_plt): New function.
3186 (Sized_incremental_binary::file_status_): New data member.
3187 (Sized_incremental_binary::main_symtab_loc_): New data member.
3188 (Sized_incremental_binary::main_strtab_loc_): New data member.
3189 * output.cc (Output_data_got::Got_entry::write): Add case
3190 RESERVED_CODE.
3191 (Output_data_got::add_global): Call add_got_entry.
3192 (Output_data_got::add_global_plt): Likewise.
3193 (Output_data_got::add_global_with_rel): Likewise.
3194 (Output_data_got::add_global_with_rela): Likewise.
3195 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3196 (Output_data_got::add_global_pair_with_rela): Likewise.
3197 (Output_data_got::add_local): Call add_got_entry.
3198 (Output_data_got::add_local_plt): Likewise.
3199 (Output_data_got::add_local_with_rel): Likewise.
3200 (Output_data_got::add_local_with_rela): Likewise.
3201 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3202 (Output_data_got::add_local_pair_with_rela): Likewise.
3203 (Output_data_got::reserve_slot): New function.
3204 (Output_data_got::reserve_slot_for_global): New function.
3205 (Output_data_got::add_got_entry): New function.
3206 (Output_data_got::add_got_entry_pair): New function.
3207 (Output_section::add_output_section_data): Edit FIXME.
3208 * output.h
3209 (Output_section_data_build::Output_section_data_build): New
3210 constructor with size parameter.
3211 (Output_data_space::Output_data_space): Likewise.
3212 (Output_data_got::Output_data_got): Initialize new data member; new
3213 constructor with size parameter.
3214 (Output_data_got::add_constant): Call add_got_entry.
3215 (Output_data_got::reserve_slot): New function.
3216 (Output_data_got::reserve_slot_for_global): New function.
3217 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3218 (Output_data_got::add_got_entry): New function.
3219 (Output_data_got::add_got_entry_pair): New function.
3220 (Output_data_got::free_list_): New data member.
3221 * target.h (Sized_target::init_got_plt_for_update): New function.
3222 (Sized_target::register_global_plt_entry): New function.
3223 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3224 Initialize new data member; call init; add constructor with PLT count.
3225 (Output_data_plt_x86_64::init): New function.
3226 (Output_data_plt_x86_64::add_relocation): New function.
3227 (Output_data_plt_x86_64::reserve_slot): New function.
3228 (Output_data_plt_x86_64::free_list_): New data member.
3229 (Target_x86_64::init_got_plt_for_update): New function.
3230 (Target_x86_64::register_global_plt_entry): New function.
3231 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3232 incremental updates.
3233 (Output_data_plt_x86_64::add_relocation): New function.
3234 * testsuite/object_unittest.cc (Object_test): Set default options.
3235
3236 2011-05-16 Ian Lance Taylor <iant@google.com>
3237
3238 * options.h (class General_options): Make -i a synonym for -r.
3239
3240 2011-05-16 Ian Lance Taylor <iant@google.com>
3241
3242 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3243
3244 2011-05-10 Cary Coutant <ccoutant@google.com>
3245
3246 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3247 strip_all (-s).
3248
3249 2011-05-06 Ian Lance Taylor <iant@google.com>
3250
3251 * layout.cc (Layout::layout): If the output section flags change,
3252 update the ordering.
3253
3254 2011-04-25 Cary Coutant <ccoutant@google.com>
3255
3256 * incremental-dump.cc (dump_incremental_inputs): Print local
3257 symbol info for each input file.
3258 * incremental.cc
3259 (Output_section_incremental_inputs::set_final_data_size): Add local
3260 symbol info to input file entries in incremental info.
3261 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3262 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3263 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3264 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3265 implementation.
3266 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3267 (Sized_incr_relobj::do_relocate): Write the local symbols.
3268 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3269 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3270 Adjust size of input file header.
3271 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3272 (Incremental_inputs_reader::get_local_symbol_count): New function.
3273 (Incremental_inputs_reader::get_input_section): Adjust size of input
3274 file header.
3275 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3276 (Sized_incr_relobj::This): New typedef.
3277 (Sized_incr_relobj::sym_size): New const data member.
3278 (Sized_incr_relobj::Local_symbol): New struct.
3279 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3280 (Sized_incr_relobj::do_local_symbol_offset): New function.
3281 (Sized_incr_relobj::local_symbol_count_): New data member.
3282 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3283 (Sized_incr_relobj::local_symbol_index_): New data member.
3284 (Sized_incr_relobj::local_symbol_offset_): New data member.
3285 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3286 (Sized_incr_relobj::local_symbols_): New data member.
3287 * object.h (Relobj::output_local_symbol_count): New function.
3288 (Relobj::local_symbol_offset): New function.
3289 (Relobj::do_output_local_symbol_count): New function.
3290 (Relobj::do_local_symbol_offset): New function.
3291 (Sized_relobj::do_output_local_symbol_count): New function.
3292 (Sized_relobj::do_local_symbol_offset): New function.
3293
3294 2011-04-22 Vladimir Simonov <sv@sw.ru>
3295
3296 * descriptors.cc (set_close_on_exec): New function.
3297 (Descriptors::open): Use set_close_on_exec.
3298 * output.cc (S_ISLNK): Define if not defined.
3299
3300 2011-04-22 Cary Coutant <ccoutant@google.com>
3301
3302 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3303 global symbol map.
3304 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3305 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3306 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3307 relocations.
3308 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3309 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3310 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3311 * incremental.h
3312 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3313 function.
3314 (Incremental_binary::apply_incremental_relocs): New function.
3315 (Incremental_binary::do_apply_incremental_relocs): New function.
3316 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3317 data member.
3318 (Sized_incremental_binary::add_global_symbol): New function.
3319 (Sized_incremental_binary::global_symbol): New function.
3320 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3321 (Sized_incremental_binary::symbol_map_): New data member.
3322 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3323 * target.h (Sized_target::apply_relocation): New function.
3324 * target-reloc.h (apply_relocation): New function.
3325 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3326
3327 2011-04-22 Doug Kwan <dougkwan@google.com>
3328
3329 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3330 flag of a SHT_ARM_EXIDX section.
3331 * testsuite/Makefile.am (arm_exidx_test): New test rules.
3332 * testsuite/Makefile.in: Regenerate.
3333 * testsuite/arm_exidx_test.s: New file.
3334 * testsuite/arm_exidx_test.sh: Same.
3335
3336 2011-04-20 Cary Coutant <ccoutant@google.com>
3337
3338 PR gold/12689
3339 * archive.h (Incremental_archive_entry::Archive_member):
3340 Initialize arg_serial_ (second constructor).
3341
3342 2011-04-17 Ian Lance Taylor <iant@google.com>
3343
3344 * object.cc (Relocate_info::location): Simplify location string.
3345 * errors.cc (Errors::error_at_location): Don't print program
3346 name.
3347 (Errors::warning_at_location): Likewise.
3348 (Errors::undefined_symbol): Likewise.
3349 * testsuite/debug_msg.sh: Update accordingly.
3350
3351 2011-04-14 Cary Coutant <ccoutant@google.com>
3352
3353 * gold/layout.cc (Layout::symtab_section_offset): New function.
3354 * gold/layout.h (Layout::symtab_section_offset): New function.
3355 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3356
3357 2011-04-12 Ian Lance Taylor <iant@google.com>
3358
3359 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3360 with MREMAP_MAYMOVE.
3361 * output.h (class Output_file): Add map_is_allocated_ field.
3362 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3363 not available, provide stubs. If mremap is not available, #define
3364 it to gold_mremap.
3365 (MREMAP_MAYMOVE): Define if not defined.
3366 (Output_file::Output_file): Initialize map_is_allocated_.
3367 (Output_file::resize): Check map_is_allocated_.
3368 (Output_file::map_anonymous): If mmap fails, use malloc.
3369 (Output_file::unmap): Don't do anything for an anonymous map.
3370 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3371 is not available, provide stubs.
3372 (File_read::View::~View): Use free rather than delete[].
3373 (File_read::make_view): Use malloc rather than new[]. If mmap
3374 fails, use malloc.
3375 (File_read::find_or_make_view): Use malloc rather than new[].
3376 * gold.h: Remove HAVE_REMAP code.
3377 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3378 exists. Rename mremap to gold_mremap. If mmap is not available
3379 don't do anything.
3380 * configure, config.in: Rebuild.
3381
3382 2011-04-11 Ian Lance Taylor <iant@google.com>
3383
3384 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3385 initialize local variable v.
3386
3387 2011-04-11 Cary Coutant <ccoutant@google.com>
3388
3389 * archive.cc (Archive::include_member): Adjust call to
3390 report_object.
3391 (Add_archive_symbols::run): Track argument serial numbers.
3392 (Lib_group::include_member): Likewise.
3393 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3394 * archive.h (Incremental_archive_entry::Archive_member):
3395 Initialize arg_serial_.
3396 (Archive_member::arg_serial_): New data member.
3397 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3398 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3399 incremental link.
3400 (Sized_dynobj::do_for_all_local_got_entries): New function.
3401 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3402 function.
3403 * fileread.cc (get_mtime): New function.
3404 * fileread.h (get_mtime): New function.
3405 * gold.cc (queue_initial_tasks): Check for incremental update.
3406 (process_incremental_input): New function.
3407 (queue_middle_tasks): Don't force valid target for incremental
3408 update.
3409 * incremental-dump.cc (find_input_containing_global): Adjust
3410 size of symbol info entry.
3411 (dump_incremental_inputs): Dump argument serial number and
3412 in_system_directory flag; bias shndx by 1; print symbol names
3413 when dumping per-file symbol lists; use new symbol info readers.
3414 * incremental.cc
3415 (Output_section_incremental_inputs:update_data_size): New function.
3416 (Sized_incremental_binary::setup_readers): Setup input readers
3417 for each input file; build maps for files added from libraries
3418 and scripts.
3419 (Sized_incremental_binary::check_input_args): New function.
3420 (Sized_incremental_binary::do_check_inputs): Build map of argument
3421 serial numbers to input arguments.
3422 (Sized_incremental_binary::do_file_has_changed): Rename
3423 do_file_is_unchanged to this; compare file modification times.
3424 (Sized_incremental_binary::do_init_layout): New function.
3425 (Sized_incremental_binary::do_reserve_layout): New function.
3426 (Sized_incremental_binary::do_get_input_reader): Remove.
3427 (Sized_incremental_binary::get_symtab_view): New function.
3428 (Incremental_checker::can_incrementally_link_output_file): Remove.
3429 (Incremental_inputs::report_command_line): Exclude --debug options.
3430 (Incremental_inputs::report_archive_begin): Add parameter; track
3431 argument serial numbers; don't put input file entry for archive
3432 before archive members.
3433 (Incremental_inputs::report_archive_end): Put input file entry
3434 for archive after archive members.
3435 (Incremental_inputs::report_object): Add parameter; track argument
3436 serial numbers and in_system_directory flag.
3437 (Incremental_inputs::report_script): Add parameter; track argument
3438 serial numbers.
3439 (Output_section_incremental_inputs::set_final_data_size): Adjust
3440 size of symbol info entry; check for forwarding symbols.
3441 (Output_section_incremental_inputs::write_input_files): Write
3442 in_system_directory flag and argument serial number.
3443 (Output_section_incremental_inputs::write_info_blocks): Map section
3444 indices between incremental info and original input file; store
3445 input section index for each symbol.
3446 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3447 change operator() to visit().
3448 (class Global_got_offset_visitor): Likewise.
3449 (class Global_symbol_visitor_got_plt):
3450 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3451 classes.
3452 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3453 (Sized_incr_relobj::do_read_symbols): New function.
3454 (Sized_incr_relobj::do_layout): New function.
3455 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3456 (Sized_incr_relobj::do_add_symbols): New function.
3457 (Sized_incr_relobj::do_should_include_member): New function.
3458 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3459 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3460 (Sized_incr_relobj::do_section_size): New function.
3461 (Sized_incr_relobj::do_section_name): New function.
3462 (Sized_incr_relobj::do_section_contents): New function.
3463 (Sized_incr_relobj::do_section_flags): New function.
3464 (Sized_incr_relobj::do_section_entsize): New function.
3465 (Sized_incr_relobj::do_section_address): New function.
3466 (Sized_incr_relobj::do_section_type): New function.
3467 (Sized_incr_relobj::do_section_link): New function.
3468 (Sized_incr_relobj::do_section_info): New function.
3469 (Sized_incr_relobj::do_section_addralign): New function.
3470 (Sized_incr_relobj::do_initialize_xindex): New function.
3471 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3472 (Sized_incr_relobj::do_read_relocs): New function.
3473 (Sized_incr_relobj::do_gc_process_relocs): New function.
3474 (Sized_incr_relobj::do_scan_relocs): New function.
3475 (Sized_incr_relobj::do_count_local_symbols): New function.
3476 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3477 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3478 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3479 (Sized_incr_relobj::do_relocate): New function.
3480 (Sized_incr_relobj::do_set_section_offset): New function.
3481 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3482 (Sized_incr_dynobj::do_read_symbols): New function.
3483 (Sized_incr_dynobj::do_layout): New function.
3484 (Sized_incr_dynobj::do_add_symbols): New function.
3485 (Sized_incr_dynobj::do_should_include_member): New function.
3486 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3487 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3488 (Sized_incr_dynobj::do_section_size): New function.
3489 (Sized_incr_dynobj::do_section_name): New function.
3490 (Sized_incr_dynobj::do_section_contents): New function.
3491 (Sized_incr_dynobj::do_section_flags): New function.
3492 (Sized_incr_dynobj::do_section_entsize): New function.
3493 (Sized_incr_dynobj::do_section_address): New function.
3494 (Sized_incr_dynobj::do_section_type): New function.
3495 (Sized_incr_dynobj::do_section_link): New function.
3496 (Sized_incr_dynobj::do_section_info): New function.
3497 (Sized_incr_dynobj::do_section_addralign): New function.
3498 (Sized_incr_dynobj::do_initialize_xindex): New function.
3499 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3500 (make_sized_incremental_object): New function.
3501 (Incremental_library::copy_unused_symbols): New function.
3502 (Incremental_library::do_for_all_unused_symbols): New function.
3503 * incremental.h (enum Incremental_input_flags): New type.
3504 (class Incremental_checker): Remove.
3505 (Incremental_input_entry::Incremental_input_entry): Add argument
3506 serial number.
3507 (Incremental_input_entry::arg_serial): New function.
3508 (Incremental_input_entry::set_is_in_system_directory): New function.
3509 (Incremental_input_entry::is_in_system_directory): New function.
3510 (Incremental_input_entry::arg_serial_): New data member.
3511 (Incremental_input_entry::is_in_system_directory_): New data member.
3512 (class Script_info): Move here from script.h.
3513 (Script_info::Script_info): Add filename parameter.
3514 (Script_info::filename): New function.
3515 (Script_info::filename_): New data member.
3516 (Incremental_script_entry::Incremental_script_entry): Add argument
3517 serial number.
3518 (Incremental_object_entry::Incremental_object_entry): Likewise.
3519 (Incremental_object_entry::add_input_section): Build list of input
3520 sections with map to original shndx.
3521 (Incremental_object_entry::get_input_section_index): New function.
3522 (Incremental_object_entry::shndx_): New data member.
3523 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3524 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3525 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3526 serial number.
3527 (Incremental_inputs::report_archive_begin): Likewise.
3528 (Incremental_inputs::report_object): Likewise.
3529 (Incremental_inputs::report_script): Likewise.
3530 (class Incremental_global_symbol_reader): New class.
3531 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3532 and store flags and input file type.
3533 (Incremental_input_entry_reader::arg_serial): New function.
3534 (Incremental_input_entry_reader::type): Extract type from flags.
3535 (Incremental_input_entry_reader::is_in_system_directory): New function.
3536 (Incremental_input_entry_reader::get_input_section_count): Call
3537 accessor function for type.
3538 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3539 function for type; adjust size of global symbol entry.
3540 (Incremental_input_entry_reader::get_global_symbol_count): Call
3541 accessor function for type.
3542 (Incremental_input_entry_reader::get_object_count): Likewise.
3543 (Incremental_input_entry_reader::get_object_offset): Likewise.
3544 (Incremental_input_entry_reader::get_member_count): Likewise.
3545 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3546 (Incremental_input_entry_reader::get_member_offset): Likewise.
3547 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3548 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3549 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3550 (Incremental_input_entry_reader::get_global_symbol_reader): New
3551 function.
3552 (Incremental_input_entry_reader::get_output_symbol_index): New
3553 function.
3554 (Incremental_input_entry_reader::type_): Remove.
3555 (Incremental_input_entry_reader::flags_): New data member.
3556 (Incremental_inputs_reader::input_file_offset): New function.
3557 (Incremental_inputs_reader::input_file_index): New function.
3558 (Incremental_inputs_reader::input_file): Call input_file_offset.
3559 (Incremental_inputs_reader::input_file_at_offset): New function.
3560 (Incremental_relocs_reader::get_r_type): Reformat.
3561 (Incremental_relocs_reader::get_r_shndx): Reformat.
3562 (Incremental_relocs_reader::get_r_offset): Reformat.
3563 (Incremental_relocs_reader::data): New function.
3564 (Incremental_binary::Incremental_binary): Initialize new data members.
3565 (Incremental_binary::check_inputs): Add cmdline parameter.
3566 (Incremental_binary::file_is_unchanged): Remove.
3567 (Input_reader::arg_serial): New function.
3568 (Input_reader::get_unused_symbol_count): New function.
3569 (Input_reader::get_unused_symbol): New function.
3570 (Input_reader::do_arg_serial): New function.
3571 (Input_reader::do_get_unused_symbol_count): New function.
3572 (Input_reader::do_get_unused_symbol): New function.
3573 (Incremental_binary::input_file_count): New function.
3574 (Incremental_binary::get_input_reader): Change signature to use
3575 index instead of filename.
3576 (Incremental_binary::file_has_changed): New function.
3577 (Incremental_binary::get_input_argument): New function.
3578 (Incremental_binary::get_library): New function.
3579 (Incremental_binary::get_script_info): New function.
3580 (Incremental_binary::init_layout): New function.
3581 (Incremental_binary::reserve_layout): New function.
3582 (Incremental_binary::output_file): New function.
3583 (Incremental_binary::do_check_inputs): New function.
3584 (Incremental_binary::do_file_is_unchanged): Remove.
3585 (Incremental_binary::do_file_has_changed): New function.
3586 (Incremental_binary::do_init_layout): New function.
3587 (Incremental_binary::do_reserve_layout): New function.
3588 (Incremental_binary::do_input_file_count): New function.
3589 (Incremental_binary::do_get_input_reader): Change signature.
3590 (Incremental_binary::input_args_map_): New data member.
3591 (Incremental_binary::library_map_): New data member.
3592 (Incremental_binary::script_map_): New data member.
3593 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3594 new data members.
3595 (Sized_incremental_binary::output_section): New function.
3596 (Sized_incremental_binary::inputs_reader): Add const.
3597 (Sized_incremental_binary::symtab_reader): Add const.
3598 (Sized_incremental_binary::relocs_reader): Add const.
3599 (Sized_incremental_binary::got_plt_reader): Add const.
3600 (Sized_incremental_binary::get_symtab_view): New function.
3601 (Sized_incremental_binary::Inputs_reader): New typedef.
3602 (Sized_incremental_binary::Input_entry_reader): New typedef.
3603 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3604 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3605 (Sized_incremental_binary::do_file_has_changed): New function.
3606 (Sized_incremental_binary::do_init_layout): New function.
3607 (Sized_incremental_binary::do_reserve_layout): New function.
3608 (Sized_input_reader::Inputs_reader): Remove.
3609 (Sized_input_reader::Input_entry_reader): Remove.
3610 (Sized_input_reader::do_arg_serial): New function.
3611 (Sized_input_reader::do_get_unused_symbol_count): New function.
3612 (Sized_input_reader::do_get_unused_symbol): New function.
3613 (Sized_incremental_binary::do_input_file_count): New function.
3614 (Sized_incremental_binary::do_get_input_reader): Change signature;
3615 use index instead of filename.
3616 (Sized_incremental_binary::section_map_): New data member.
3617 (Sized_incremental_binary::input_entry_readers_): New data member.
3618 (class Sized_incr_relobj): New class.
3619 (class Sized_incr_dynobj): New class.
3620 (make_sized_incremental_object): New function.
3621 (class Incremental_library): New class.
3622 * layout.cc (Free_list::num_lists): New static data member.
3623 (Free_list::num_nodes): New static data member.
3624 (Free_list::num_removes): New static data member.
3625 (Free_list::num_remove_visits): New static data member.
3626 (Free_list::num_allocates): New static data member.
3627 (Free_list::num_allocate_visits): New static data member.
3628 (Free_list::init): New function.
3629 (Free_list::remove): New function.
3630 (Free_list::allocate): New function.
3631 (Free_list::dump): New function.
3632 (Free_list::print_stats): New function.
3633 (Layout_task_runner::run): Resize output file for incremental updates.
3634 (Layout::Layout): Initialize new data members.
3635 (Layout::set_incremental_base): New function.
3636 (Layout::init_fixed_output_section): New function.
3637 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3638 incremental updates.
3639 (Layout::create_gold_note): Do not create gold note section for
3640 incremental updates.
3641 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3642 for incremental updates.
3643 (Layout::set_section_offsets): For incremental updates, allocate space
3644 from free list.
3645 (Layout::create_symtab_sections): Layout with offsets relative to
3646 start of section; for incremental updates, allocate space from free
3647 list.
3648 (Layout::create_shdrs): For incremental updates, allocate space from
3649 free list.
3650 (Layout::finish_dynamic_section): For incremental updates, do not
3651 check --as-needed (fixed in subsequent patch).
3652 * layout.h (class Free_list): New class.
3653 (Layout::set_incremental_base): New function.
3654 (Layout::incremental_base): New function.
3655 (Layout::init_fixed_output_section): New function.
3656 (Layout::allocate): New function.
3657 (Layout::incremental_base_): New data member.
3658 (Layout::free_list_): New data member.
3659 * main.cc (main): Print Free_list statistics.
3660 * object.cc (Relobj::finalize_incremental_relocs): Add
3661 clear_counts parameter; clear counts only when clear_counts is set.
3662 (Sized_relobj::Sized_relobj): Initialize new base class.
3663 (Sized_relobj::do_layout): Don't report special sections.
3664 (Sized_relobj::do_for_all_local_got_entries): New function.
3665 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3666 symtab_off to all symbol table offsets.
3667 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3668 * object.h (class Got_offset_list): Move to top of file.
3669 (Object::Object): Allow case where input_file == NULL.
3670 (Object::~Object): Likewise.
3671 (Object::input_file): Assert that input_file != NULL.
3672 (Object::lock): Allow case where input_file == NULL.
3673 (Object::unlock): Likewise.
3674 (Object::is_locked): Likewise.
3675 (Object::token): Likewise.
3676 (Object::release): Likewise.
3677 (Object::is_incremental): New function.
3678 (Object::get_mtime): New function.
3679 (Object::for_all_local_got_entries): New function.
3680 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3681 (Object::set_is_in_system_directory): New function.
3682 (Object::is_in_system_directory): New function.
3683 (Object::do_is_incremental): New function.
3684 (Object::do_get_mtime): New function.
3685 (Object::do_for_all_local_got_entries): New function.
3686 (Object::is_in_system_directory_): New data member.
3687 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3688 (class Sized_relobj_base): New class.
3689 (class Sized_relobj): Derive from Sized_relobj_base.
3690 (class Sized_relobj::Symbols): Redeclare from base class.
3691 (class Sized_relobj::local_got_offset_list): Remove.
3692 (class Sized_relobj::Output_sections): Redeclare from base class.
3693 (class Sized_relobj::do_for_all_local_got_entries): New function.
3694 (class Sized_relobj::write_local_symbols): Add offset parameter.
3695 (class Sized_relobj::local_symbol_offset_): Update comment.
3696 (class Sized_relobj::local_dynsym_offset_): Update comment.
3697 * options.cc (Input_arguments::add_file): Remove const.
3698 * options.h (Input_file_argument::Input_file_argument):
3699 Initialize arg_serial_ (all constructors).
3700 (Input_file_argument::set_arg_serial): New function.
3701 (Input_file_argument::arg_serial): New function.
3702 (Input_file_argument::arg_serial_): New data member.
3703 (Input_arguments::Input_arguments): Initialize file_count_.
3704 (Input_arguments::add_file): Remove const.
3705 (Input_arguments::number_of_input_files): New function.
3706 (Input_arguments::file_count_): New data member.
3707 (Command_line::number_of_input_files): Call
3708 Input_arguments::number_of_input_files.
3709 * output.cc (Output_segment_headers::Output_segment_headers):
3710 Set current size.
3711 (Output_section::Input_section::current_data_size): New function.
3712 (Output_section::Output_section): Initialize new data members.
3713 (Output_section::add_input_section): Don't do merge sections for
3714 an incremental link; allocate space from free list for an
3715 incremental update.
3716 (Output_section::add_output_section_data): Allocate space from
3717 free list for an incremental update.
3718 (Output_section::update_data_size): New function.
3719 (Output_section::set_fixed_layout): New function.
3720 (Output_section::reserve): New function.
3721 (Output_segment::set_section_addresses): Remove const.
3722 (Output_segment::set_section_list_addresses): Remove const; allocate
3723 space from free list for an incremental update.
3724 (Output_segment::set_offset): Adjust size of RELRO segment for an
3725 incremental update.
3726 * output.h (Output_data::current_data_size): Move here from
3727 child classes.
3728 (Output_data::pre_finalize_data_size): New function.
3729 (Output_data::update_data_size): New function.
3730 (Output_section_headers::update_data_size): new function.
3731 (Output_section_data_build::current_data_size): Move to Output_data.
3732 (Output_data_strtab::update_data_size): New function.
3733 (Output_section::current_data_size): Move to Output_data.
3734 (Output_section::set_fixed_layout): New function.
3735 (Output_section::has_fixed_layout): New function.
3736 (Output_section::reserve): New function.
3737 (Output_section::update_data_size): New function.
3738 (Output_section::has_fixed_layout_): New data member.
3739 (Output_section::free_list_): New data member.
3740 (Output_segment::set_section_addresses): Remove const.
3741 (Output_segment::set_section_list_addresses): Remove const.
3742 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3743 New function.
3744 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3745 New function.
3746 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3747 parameter when calling Add_symbols constructor; store argument
3748 serial number for members of a lib group.
3749 (Add_symbols::locks): Allow case where token == NULL.
3750 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3751 (Read_member::~Read_member): New function.
3752 (Read_member::is_runnable): New function.
3753 (Read_member::locks): New function.
3754 (Read_member::run): New function.
3755 (Check_script::~Check_script): New function.
3756 (Check_script::is_runnable): New function.
3757 (Check_script::locks): New function.
3758 (Check_script::run): New function.
3759 (Check_library::~Check_library): New function.
3760 (Check_library::is_runnable): New function.
3761 (Check_library::locks): New function.
3762 (Check_library::run): New function.
3763 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3764 (Add_symbols::library_): New data member.
3765 (class Read_member): New class.
3766 (class Check_script): New class.
3767 (class Check_library): New class.
3768 * reloc.cc (Read_relocs::is_runnable): Allow case where
3769 token == NULL.
3770 (Read_relocs::locks): Likewise.
3771 (Scan_relocs::locks): Likewise.
3772 (Relocate_task::locks): Likewise.
3773 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3774 to clear counters.
3775 (Sized_relobj::incremental_relocs_scan): Fix comment.
3776 (Sized_relobj::do_relocate): Pass output file offset to
3777 write_local_symbols.
3778 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3779 from class declaration.
3780 * script.cc (read_input_script): Allocate Script_info; pass
3781 argument serial number to report_script.
3782 * script.h (class Script_info): Move to incremental.h.
3783 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3784 * symtab.h (Symbol_table::add_from_incrobj): New function.
3785 (Symbol_table::set_file_offset): New function.
3786
3787 2011-04-05 Cary Coutant <ccoutant@google.com>
3788
3789 * incremental-dump.cc (dump_incremental_inputs): Change signature
3790 to take a Sized_incremental_binary; change caller. Use readers
3791 in Sized_incremental_binary.
3792 * incremental.cc
3793 (Sized_incremental_binary::find_incremental_inputs_sections):
3794 Rename do_find_incremental_inputs_sections to this.
3795 (Sized_incremental_binary::setup_readers): New function.
3796 (Sized_incremental_binary::do_check_inputs): Check
3797 has_incremental_info_ flag; move setup code to setup_readers;
3798 use input readers.
3799 (Sized_incremental_binary::do_file_is_unchanged): New function.
3800 (Sized_incremental_binary::do_get_input_reader): New function.
3801 * incremental.h (class Incremental_binary): Move to end of file.
3802 (Incremental_binary::file_is_unchanged): New function.
3803 (Incremental_binary::do_file_is_unchanged): New function.
3804 (Incremental_binary::Input_reader): New class.
3805 (Incremental_binary::get_input_reader): New function.
3806 (class Sized_incremental_binary): Move to end of file.
3807 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3808 input section reader classes.
3809 (Sized_incremental_binary::has_incremental_info): New function.
3810 (Sized_incremental_binary::inputs_reader): New function.
3811 (Sized_incremental_binary::symtab_reader): New function.
3812 (Sized_incremental_binary::relocs_reader): New function.
3813 (Sized_incremental_binary::got_plt_reader): New function.
3814 (Sized_incremental_binary::do_file_is_unchanged): New function.
3815 (Sized_incremental_binary::Sized_input_reader): New class.
3816 (Sized_incremental_binary::get_input_reader): New function.
3817 (Sized_incremental_binary::find_incremental_inputs_sections):
3818 Rename do_find_incremental_inputs_sections to this.
3819 (Sized_incremental_binary::setup_readers): New function.
3820 (Sized_incremental_binary::has_incremental_info_): New data member.
3821 (Sized_incremental_binary::inputs_reader_): New data member.
3822 (Sized_incremental_binary::symtab_reader_): New data member.
3823 (Sized_incremental_binary::relocs_reader_): New data member.
3824 (Sized_incremental_binary::got_plt_reader_): New data member.
3825 (Sized_incremental_binary::current_input_file_): New data member.
3826
3827 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3828
3829 PR gold/12640
3830 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3831 violation.
3832
3833 2011-03-30 Cary Coutant <ccoutant@google.com>
3834
3835 * archive.cc (Archive::include_member): Adjust call to report_object.
3836 (Add_archive_symbols::run): Add script_info to call to
3837 report_archive_begin.
3838 (Lib_group::include_member): Adjust call to report_object.
3839 (Add_lib_group_symbols::run): Adjust call to report_object.
3840 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3841 blocks. Add object count for script input files.
3842 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3843 script_info parameter; change all callers.
3844 (Incremental_inputs::report_object): Add script_info parameter;
3845 change all callers.
3846 (Incremental_inputs::report_script): Store backpointer to
3847 incremental info entry.
3848 (Output_section_incremental_inputs::set_final_data_size): Record
3849 additional information for scripts.
3850 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3851 * incremental.h (Incremental_script_entry::add_object): New function.
3852 (Incremental_script_entry::get_object_count): New function.
3853 (Incremental_script_entry::get_object): New function.
3854 (Incremental_script_entry::objects_): New data member; adjust
3855 constructor.
3856 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3857 (Incremental_inputs::report_object): Add script_info parameter.
3858 (Incremental_inputs_reader::get_object_count): New function.
3859 (Incremental_inputs_reader::get_object_offset): New function.
3860 * options.cc (Input_arguments::add_file): Return reference to
3861 new input argument.
3862 * options.h (Input_argument::set_script_info): New function.
3863 (Input_argument::script_info): New function.
3864 (Input_argument::script_info_): New data member; adjust all
3865 constructors.
3866 (Input_file_group::add_file): Return reference to new input argument.
3867 (Input_file_lib::add_file): Likewise.
3868 (Input_arguments::add_file): Likewise.
3869 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3870 * script.cc (Parser_closure::Parser_closure): Add script_info
3871 parameter; adjust all callers.
3872 (Parser_closure::script_info): New function.
3873 (Parser_closure::script_info_): New data member.
3874 (read_input_script): Report scripts earlier to incremental info.
3875 (script_add_file): Set script_info in Input_argument.
3876 (script_add_library): Likewise.
3877 * script.h (Script_options::Script_info): Rewrite class.
3878
3879 2011-03-29 Cary Coutant <ccoutant@google.com>
3880
3881 * archive.cc (Library_base::should_include_member): Move
3882 method here from class Archive.
3883 (Archive::Archive): Initialize base class.
3884 (Archive::should_include_member): Move to base class.
3885 (Archive::do_for_all_unused_symbols): New function.
3886 (Add_archive_symbols::run): Remove redundant access to
3887 incremental_inputs.
3888 (Lib_group::Lib_group): Initialize base class.
3889 (Lib_group::do_filename): New function.
3890 (Lib_group::include_member): Pass pointer to Lib_group to
3891 report_object.
3892 (Lib_group::do_for_all_unused_symbols): New function.
3893 (Add_lib_group_symbols::run): Report archive information for
3894 incremental links.
3895 * archive.h (class Library_base): New base class.
3896 (class Archive): Derive from Library_base.
3897 (Archive::filename): Move to base class.
3898 (Archive::set_incremental_info): Likewise.
3899 (Archive::incremental_info): Likewise.
3900 (Archive::Should_include): Likewise.
3901 (Archive::should_include_member): Likewise.
3902 (Archive::Armap_entry): Remove.
3903 (Archive::Unused_symbol_iterator): Remove.
3904 (Archive::unused_symbols_begin): Remove.
3905 (Archive::unused_symbols_end): Remove.
3906 (Archive::do_filename): New function.
3907 (Archive::do_get_mtime): New function.
3908 (Archive::do_for_all_unused_symbols): New function.
3909 (Archive::task_): Move to base class.
3910 (Archive::incremental_info_): Likewise.
3911 (class Lib_group): Derive from Library_base.
3912 (Lib_group::do_filename): New function.
3913 (Lib_group::do_get_mtime): New function.
3914 (Lib_group::do_for_all_unused_symbols): New function.
3915 (Lib_group::task_): Move to base class.
3916 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3917 function.
3918 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3919 function.
3920 * incremental.cc (Incremental_inputs::report_archive_begin):
3921 Use Library_base; call library's get_mtime; add incremental inputs
3922 entry before members.
3923 (class Unused_symbol_visitor): New class.
3924 (Incremental_inputs::report_archive_end): Use Library_base; use
3925 visitor class to record unused symbols; don't add incremental inputs
3926 entry after members.
3927 (Incremental_inputs::report_object): Use Library_base.
3928 * incremental.h
3929 (Incremental_archive_entry::Incremental_archive_entry): Remove
3930 unused Archive parameter.
3931 (Incremental_inputs::report_archive_begin): Use Library_base.
3932 (Incremental_inputs::report_archive_end): Likewise.
3933 (Incremental_inputs::report_object): Likewise.
3934 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3935 function.
3936 * object.h (Object::for_all_global_symbols): New function.
3937 (Object::do_for_all_global_symbols): New function.
3938 (Sized_relobj::do_for_all_global_symbols): New function.
3939 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3940 function.
3941 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3942 function.
3943
3944 2011-03-27 Ian Lance Taylor <iant@google.com>
3945
3946 * archive.cc (Archive::interpret_header): Return -1 if something
3947 goes wrong. Change callers accordingly.
3948
3949 2011-03-25 Cary Coutant <ccoutant@google.com>
3950
3951 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3952 * testsuite/Makefile.in: Regenerate.
3953
3954 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3955
3956 * plugin.cc (get_view): New.
3957 (Plugin::load): Pass get_view to the plugin.
3958 (Plugin_manager::get_view): New.
3959
3960 2011-03-21 Ian Lance Taylor <iant@google.com>
3961
3962 * testsuite/final_layout.sh: Rewrite to not use dc.
3963 * testsuite/relro_test.sh: Fail if dc is not present.
3964
3965 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3966
3967 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3968 Change == to -eq.
3969 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3970 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3971 Change == to -eq.
3972 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3973 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3974
3975 2011-03-14 Ian Lance Taylor <iant@google.com>
3976
3977 * script-sections.cc (Sort_output_sections::script_compare):
3978 Rename from is_before, change return type.
3979 (Sort_output_sections::operator()): Adjust accordingly.
3980
3981 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3982
3983 PR gold/12572
3984 * testsuite/odr_violation2.cc: Add comment to make all error line
3985 numbers double digits.
3986 * testsuite/debug_msg.sh: Adjust expected errors.
3987
3988 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3989
3990 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3991 but mark earlier ones as non-canonical
3992 (offset_to_iterator): Update search target and example
3993 (do_addr2line): Return extra lines in a vector*
3994 (format_file_lineno): Extract from do_addr2line
3995 (one_addr2line): Add vector* out-param
3996 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3997 when a lineno entry appeared last for its instruction
3998 (Dwarf_line_info): Add vector* out-param
3999 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4000 * symtab.cc (Odr_violation_compare): Include the lineno in the
4001 comparison again.
4002 (linenos_from_loc): New. Combine the canonical line for an
4003 address with its other lines.
4004 (True_if_intersect): New. Helper functor to make
4005 std::set_intersection a query.
4006 (detect_odr_violations): Compare sets of lines instead of just
4007 one line for each function. This became less deterministic, but
4008 has fewer false positives.
4009 * symtab.h: Declarations.
4010 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4011 mix an optimized and non-optimized object in the same binary
4012 (odr_violation2.so): Same.
4013 * testsuite/Makefile.in: Regenerate from Makefile.am.
4014 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4015 * testsuite/debug_msg.sh: Update line numbers and add
4016 assertions.
4017 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4018 non-optimized context.
4019 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4020 isn't inlined, and use OdrDerived in an optimized context.
4021 * testsuite/odr_header1.h: Defines OdrDerived, where
4022 optimization will change the
4023 first-instruction-in-the-destructor's file and line number.
4024 * testsuite/odr_header2.h: Defines OdrBase.
4025
4026 2011-03-09 Ian Lance Taylor <iant@google.com>
4027
4028 * fileread.cc (File_read::clear_views): Don't delete the whole
4029 file view.
4030
4031 2011-03-08 Ian Lance Taylor <iant@google.com>
4032
4033 PR gold/12525
4034 * fileread.cc: #include <climits>.
4035 (GOLD_IOV_MAX): Define.
4036 (File_read::read_multiple): Limit number of entries by iov_max.
4037 * fileread.h (class File_read): Always set max_readv_entries to
4038 128.
4039
4040 2011-03-07 Ian Lance Taylor <iant@google.com>
4041
4042 PR gold/12525
4043 * options.h (class General_options): Add -dy and -dn.
4044
4045 2011-03-02 Cary Coutant <ccoutant@google.com>
4046
4047 * testsuite/script_test_9.t: Add TLS segment.
4048
4049 2011-03-02 Simon Baldwin <simonb@google.com>
4050
4051 * configure.ac: Add check for gnu_indirect_function support in
4052 the toolchain building binutils.
4053 * configure: Rebuild.
4054
4055 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
4056
4057 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4058 plugin only symbols.
4059 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4060 in plugin files as not needed in the symbol table.
4061
4062 2011-02-11 Sriraman Tallam <tmsriram@google.com>
4063
4064 * output.cc (Output_section::add_input_section): Delay fill
4065 generation for section ordering.
4066
4067 2011-02-09 Ian Lance Taylor <iant@google.com>
4068
4069 PR gold/12316
4070 * object.h (class Sized_relobj): Remove clear_local_symbols.
4071 * reloc.cc (Sized_relobj::do_relocate): Don't call
4072 clear_local_symbols.
4073
4074 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
4075
4076 * plugin.cc (is_visible_from_outside): Return true for symbols
4077 in the -u option.
4078
4079 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4080
4081 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4082 filename.
4083
4084 2011-02-02 Sriraman Tallam <tmsriram@google.com>
4085
4086 * icf.h (is_section_foldable_candidate): Change type of parameter
4087 to std::string.
4088 * icf.cc (Icf::find_identical_sections): Change type of local variable
4089 section_name to be std::string.
4090 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4091
4092 2011-01-25 Ian Lance Taylor <iant@google.com>
4093
4094 * script.cc (script_add_extern): Rewrite to use
4095 add_symbol_reference.
4096
4097 2011-01-25 Doug Kwan <dougkwan@google.com>
4098
4099 * icf.cc (get_section_contents): Always lock section's object.
4100
4101 2011-01-24 Ian Lance Taylor <iant@google.com>
4102
4103 * options.h (class General_options): Accept
4104 --no-detect-odr-violations.
4105
4106 2011-01-24 Ian Lance Taylor <iant@google.com>
4107
4108 * version.cc (version_string): Bump to 1.11.
4109
4110 2011-01-24 Ian Lance Taylor <iant@google.com>
4111
4112 * plugin.cc (class Plugin_rescan): Define new class.
4113 (Plugin_manager::claim_file): Set any_claimed_.
4114 (Plugin_manager::save_archive): New function.
4115 (Plugin_manager::save_input_group): New function.
4116 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4117 necessary.
4118 (Plugin_manager::new_undefined_symbol): New function.
4119 (Plugin_manager::rescan): New function.
4120 (Plugin_manager::rescannable_defines): New function.
4121 (Plugin_manager::add_input_file): Set any_added_.
4122 * plugin.h (class Plugin_manager): define new fields rescannable_,
4123 undefined_symbols_, any_claimed_, and any_added_. Declare
4124 Plugin_rescan as friend. Declare new functions.
4125 (Plugin_manager::Rescannable): Define type.
4126 (Plugin_manager::Rescannable_list): Define type.
4127 (Plugin_manager::Undefined_symbol_list): Define type.
4128 (Plugin_manager::Plugin_manager): Initialize new fields.
4129 * archive.cc (Archive::defines_symbol): New function.
4130 (Add_archive_symbols::run): Pass archive to plugins if any.
4131 * archive.h (class Archive): Declare defines_symbol.
4132 * readsyms.cc (Input_group::~Input_group): New function.
4133 (Finish_group::run): Pass input_group to plugins if any.
4134 * readsyms.h (class Input_group): Declare destructor.
4135 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4136 any.
4137
4138 2011-01-10 Ian Lance Taylor <iant@google.com>
4139
4140 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4141 section as relro.
4142 (Layout::set_segment_offsets): Reset increase_relro before calling
4143 set_section_addresses a second time.
4144
4145 2011-01-04 Cary Coutant <ccoutant@google.com>
4146
4147 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4148 sections before NOBITS sections.
4149
4150 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4151
4152 * version.cc (print_version): Update copyright to 2011.
4153
4154 2010-12-23 Cary Coutant <ccoutant@google.com>
4155
4156 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4157 of OS to this->add. Add OD parameter to second form of the function.
4158
4159 2010-12-20 Ian Lance Taylor <iant@google.com>
4160
4161 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4162 second of two consecutive entries with same offset.
4163
4164 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4165
4166 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4167 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4168 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4169 to avoid unneeded links against $(LDADD).
4170 * testsuite/Makefile.in: Regenerate.
4171
4172 2010-12-15 Ian Lance Taylor <iant@google.com>
4173
4174 PR gold/12324
4175 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4176 for R_X86_64_32 and R_X86_64_PC32.
4177 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4178 ver_matching_def_pic.o.
4179 (ver_matching_def_pic.o): New target.
4180
4181 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4182
4183 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4184 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4185 Move definition before File_read::View member definitions.
4186 (File_read::View::~View): Initialize and hold lock before
4187 updating current_mapped_bytes.
4188
4189 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4190
4191 * dwarf_reader.cc: Remove outdated comment.
4192 * gold-threads.cc: Fix typo in error message.
4193 * archive.cc: Fix typos in comments.
4194 * archive.h: Likewise.
4195 * arm-reloc-property.cc: Likewise.
4196 * arm-reloc-property.h: Likewise.
4197 * arm-reloc.def: Likewise.
4198 * arm.cc: Likewise.
4199 * attributes.h: Likewise.
4200 * cref.cc: Likewise.
4201 * ehframe.cc: Likewise.
4202 * fileread.h: Likewise.
4203 * gold.h: Likewise.
4204 * i386.cc: Likewise.
4205 * icf.cc: Likewise.
4206 * incremental.h: Likewise.
4207 * int_encoding.cc: Likewise.
4208 * layout.h: Likewise.
4209 * main.cc: Likewise.
4210 * merge.h: Likewise.
4211 * object.cc: Likewise.
4212 * object.h: Likewise.
4213 * options.cc: Likewise.
4214 * readsyms.cc: Likewise.
4215 * reduced_debug_output.cc: Likewise.
4216 * reloc.cc: Likewise.
4217 * script-sections.cc: Likewise.
4218 * sparc.cc: Likewise.
4219 * symtab.h: Likewise.
4220 * target-reloc.h: Likewise.
4221 * target.cc: Likewise.
4222 * target.h: Likewise.
4223 * timer.cc: Likewise.
4224 * timer.h: Likewise.
4225 * x86_64.cc: Likewise.
4226
4227 2010-12-09 Cary Coutant <ccoutant@google.com>
4228
4229 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4230 stack.
4231 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4232 parameter; change all callers.
4233 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4234 * options.h (warn_execstack): New option.
4235
4236 2010-12-07 Doug Kwan <dougkwan@google.com>
4237
4238 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4239 like function call relocations.
4240
4241 2010-12-07 Ian Lance Taylor <iant@google.com>
4242
4243 * archive.cc (Archive::get_elf_object_for_member): Permit
4244 punconfigured to be NULL.
4245 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4246 (Archive::include_member): Pass NULL to get_elf_object_for_member
4247 if we searched for the archive and this is the first included
4248 object.
4249
4250 2010-12-01 Ian Lance Taylor <iant@google.com>
4251
4252 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4253 track_relocs_type_ field.
4254 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4255 Set track_relocs_type_.
4256 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4257 contents when using RELA relocs.
4258 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4259 reloc_map_.
4260 * reloc.cc (Track_relocs::next_addend): New function.
4261 * reloc.h (class Track_relocs): Declare next_addend.
4262
4263 2010-12-01 Ian Lance Taylor <iant@google.com>
4264
4265 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4266 virtual destructor.
4267
4268 2010-12-01 Ian Lance Taylor <iant@google.com>
4269
4270 * README: Update compilers known to work and fail.
4271
4272 2010-11-23 Matthias Klose <doko@ubuntu.com>
4273
4274 * configure.in: For --enable-gold, handle value `default' instead of
4275 `both*'. Always install ld as ld.bfd, install as ld if gold is
4276 not the default.
4277 * configure: Regenerate.
4278
4279 2010-11-18 Doug Kwan <dougkwan@google.com>
4280
4281 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4282 and right_alignment to be zero. Store result alignment only if it is
4283 greater than existing alignment.
4284
4285 2010-11-16 Cary Coutant <ccoutant@google.com>
4286
4287 PR gold/12220
4288 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4289 Check for ".zdebug_line".
4290
4291 2010-11-16 Doug Kwan <dougkwan@google.com>
4292 Cary Coutant <ccoutant@google.com>
4293
4294 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4295 by reference; adjust all callers.
4296 * output.cc (Output_segment::set_section_addresses): Adjust references
4297 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4298 list is empty.
4299 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4300 end at page boundary.
4301
4302 2010-11-16 Cary Coutant <ccoutant@google.com>
4303
4304 PR gold/12220
4305 * layout.cc (Layout::choose_output_section): Transform names of
4306 compressed sections even when using a script with a SECTIONS clause.
4307 (Layout::output_section_name): Remove code to transform
4308 compressed debug section names.
4309 * output.cc (Output_section::add_input_section): Use uncompressed
4310 section size when tracking input sections.
4311
4312 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4313
4314 * symtab.h (Symbol::NON_PIC_REF): Remove.
4315 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4316 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4317 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4318 (Symbol::use_plt_offset): Take a flags argument and pass it
4319 directly to needs_dynamic_reloc. Restrict check for undefined
4320 weak symbols to function calls.
4321 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4322 (Target_arm::Scan::global): Use it.
4323 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4324 (Target_arm::Relocate::relocate): Likewise.
4325 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4326 parameter with an r_type parameter. Use get_reference_flags
4327 to get the flags.
4328 (Target_arm::Relocate::relocate): Update accordingly.
4329 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4330 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4331 (Target_i386::Scan::global): Likewise.
4332 (Target_i386::Relocate::relocate): Likewise.
4333 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4334 parameter with an r_type parameter. Use get_reference_flags
4335 to get the flags.
4336 (Target_i386::Relocate::relocate): Update accordingly.
4337 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4338 (Target_powerpc::Scan::global): Use it.
4339 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4340 (Target_powerpc::Relocate::relocate): Likewise.
4341 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4342 (Target_sparc::Scan::global): Use it.
4343 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4344 (Target_sparc::Relocate::relocate): Likewise.
4345 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4346 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4347 (Target_x86_64::Scan::global): Likewise.
4348 (Target_x86_64::Relocate::relocate): Likewise.
4349
4350 2010-11-08 Doug Kwan <dougkwan@google.com>
4351 Cary Coutant <ccoutant@google.com>
4352
4353 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4354 (Arm_exidx_merge_section::section_contents_): New data member.
4355 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4356 (Arm_input_section::~Arm_input_section): De-allocate memory.
4357 (Arm_input_section::original_contents_): New data member.
4358 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4359 in parameters instead of calling Object::section_contents without
4360 locking.
4361 (Arm_output_section::group_section): New parameter TASK. Pass it
4362 to callees that need locking objects.
4363 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4364 to lock EXIDX input sections. Fix a formatting issue. Call
4365 Arm_exidx_merged_section::build_contents to create merged section
4366 contents.
4367 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4368 to lock object of stub table owner.
4369 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4370 TEXT_SIZE to initialize data member TEXT_SIZE_.
4371 (Arm_exidx_input_section::addralign): Fix typo in comment.
4372 (Arm_exidx_input_section::text_size): New method.
4373 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4374 that require locking objects. Lock objects before scanning for stubs
4375 and updating local symbols.
4376 (Arm_input_section<big_endian>::init): Copy contents of original
4377 input section.
4378 (Arm_input_section<big_endian>::do_write): Use saved contents of
4379 original input section instead of calling Object::section_contents
4380 without locking.
4381 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4382 size without calling Object::section_size().
4383 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4384 for size. Allocate a buffer for merged EXIDX entries.
4385 (Arm_exidx_merged_section::build_contents): New method.
4386 (Arm_exidx_merged_section::do_write): Move merge section contents
4387 building code to Arm_exidx_merged_section::build_contetns. Write
4388 out contetns in buffer instead of building it on the fly.
4389 (Arm_relobj::make_exidx_input_section): Also pass text section size
4390 to Arm_exidx_input_section constructor.
4391 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4392 (Arm_dynobj::do_read_symbols): Fix memory leak.
4393 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4394 * target.h: (class Task): Add forward declaration.
4395 (Target::relax): Add new parameter TASK and pass it to
4396 Target::do_relax().
4397 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4398
4399 2010-11-05 Cary Coutant <ccoutant@google.com>
4400
4401 PR gold/10708
4402 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4403 object when reading from the file.
4404 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4405 second layout pass.
4406 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4407 when reading section contents.
4408 (get_section_contents): Likewise.
4409 (icf::find_identical_sections): Likewise.
4410 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4411 object when reading from the file.
4412 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4413 the object when doing deferred section layout.
4414
4415 2010-11-03 Nick Clifton <nickc@redhat.com>
4416
4417 PR gold/12001
4418 * script.h (class Symbol_assignment: name): New member. Returns
4419 the name of the symbol.
4420 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4421 Returns true if the given symbol name is on the list of
4422 assignments wating to be processed.
4423 * archive.cc (should_incldue_member): If the symbol is undefined,
4424 check to see if it is on the list of symbols pending assignment.
4425
4426 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4427
4428 * script-sections.cc (Script_sections::find_memory_region): Check
4429 for a NULL output section pointer.
4430
4431 2010-10-29 Doug Kwan <dougkwan@google.com>
4432
4433 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4434 Output_section::add_relaxed_input_section.
4435 * output.cc (Output_section::add_relaxed_input_section): Add new
4436 arguments LAYOUT and NAME. Set section order index.
4437 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4438 Copy section order index.
4439 * output.h (Output_section::add_relaxed_input_section): Add new
4440 arguments LAYOUT and NAME.
4441
4442 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4443
4444 * testsuite/Makefile.am: Move gcctestdir/ld rule to
4445 NATIVE_OR_CROSS_LINKER.
4446 * testsuite/Makefile.in: Regenerate.
4447
4448 2010-10-20 Doug Kwan <dougkwan@google.com>
4449
4450 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4451 without SHF_LINK_ORDER flags.
4452 * layout.cc (Layout::choose_output_section): Do not filter
4453 SHF_LINK_ORDER flag in a relocatable link.
4454
4455 2010-10-17 Cary Coutant <ccoutant@google.com>
4456
4457 * output.h (Output_segment::set_section_addresses): Change function
4458 signature. Update all callers.
4459 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4460 sections.
4461 (Output_segment::set_section_addresses): Align after last TLS
4462 section. Add padding before last relro section instead of after.
4463
4464 2010-10-17 Doug Kwan <dougkwan@google.com>
4465
4466 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4467 GOT output section to be writable.
4468
4469 2010-10-14 Cary Coutant <ccoutant@google.com>
4470
4471 * debug.h (DEBUG_INCREMENTAL): New flag.
4472 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4473 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4474 mode.
4475 * incremental.cc (report_command_line): Ignore all forms of
4476 --incremental.
4477 * layout.cc (Layout::Layout): Check parameters for incremental link
4478 mode.
4479 * options.cc (General_options::parse_incremental): New function.
4480 (General_options::parse_no_incremental): New function.
4481 (General_options::parse_incremental_full): New function.
4482 (General_options::parse_incremental_update): New function.
4483 (General_options::incremental_mode_): New data member.
4484 (General_options::finalize): Check incremental_mode_.
4485 * options.h (General_options): Update help text for --incremental.
4486 Add --no-incremental, --incremental-full, --incremental-update.
4487 (General_options::Incremental_mode): New enum type.
4488 (General_options::incremental_mode): New function.
4489 (General_options::incremental_mode_): New data member.
4490 * parameters.cc (Parameters::incremental_mode_): New data member.
4491 (Parameters::set_options): Set incremental_mode_.
4492 (Parameters::set_incremental_full): New function.
4493 (Parameters::incremental): New function.
4494 (Parameters::incremental_update): New function.
4495 (set_parameters_incremental_full): New function.
4496 * parameters.h (Parameters::set_incremental_full): New function.
4497 (Parameters::incremental): New function.
4498 (Parameters::incremental_update): New function.
4499 (Parameters::incremental_mode_): New data member.
4500 (set_parameters_incremental_full): New function.
4501 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4502 incremental link mode.
4503 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4504 (Sized_relobj::do_relocate_sections): Likewise.
4505 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4506 option.
4507 * testsuite/Makefile.in: Regenerate.
4508 * testsuite/incremental_test.sh: Filter all forms of --incremental.
4509
4510 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4511
4512 * script-sections.h (class Script_sections): Make
4513 Sections_elements typedef public.
4514 * script-sections.cc (class Sort_output_sections): Add elements_
4515 field. Add constructor which sets it; change all callers.
4516 (Sort_output_sections::is_before): New function.
4517 (Sort_output_sections::operator()): Call is_before.
4518 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4519 conditional.
4520 * testsuite/script_test_10.sh: New test. Test script section
4521 order.
4522 * testsuite/script_test_10.t: Likewise.
4523 * testsuite/script_test_10.s: Likewise.
4524 * testsuite/Makefile.am: Wrap the cross linker tests and the
4525 common tests into NATIVE_OR_CROSS_LINKER.
4526 (check_SCRIPTS): Add script_test_10.sh.
4527 (check_DATA): Add script_test_10.stdout.
4528 (script_test_10.o, script_test_10): New targets.
4529 (script_test_10.stdout): New target.
4530 * configure, testsuite/Makefile.in: Regenerate.
4531
4532 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4533
4534 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4535 error for the deprecated relocations.
4536 (Target_arm::Scan::global): Likewise.
4537 (Target_arm::Relocate::relocate): Likewise.
4538
4539 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4540
4541 * fileread.cc (Input_file::find_file): Initialize *found_name
4542 and *namep when using the fallback search for case 4.
4543
4544 2010-10-11 Cary Coutant <ccoutant@google.com>
4545
4546 * options.h (class General_options): Redefine -z lazy as an alias for
4547 the negation of -z now.
4548
4549 2010-10-11 Ian Lance Taylor <iant@google.com>
4550
4551 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4552 binding.
4553
4554 2010-10-06 Nick Clifton <nickc@redhat.com>
4555
4556 * script-sections.cc(class Memory_region): Remove
4557 current_lma_offset_ field. Rename current_vma_offset_ to
4558 current_offset_. Add last_section_ field.
4559 (Memory_region::get_current_vma_address): Rename to
4560 get_current_address.
4561 (Memory_region::get_current_lma_address): Delete.
4562 (Memory_region::increment_vma_offset): Rename to
4563 increment_offset.
4564 (Memory_region::increment_lma_offset): Delete.
4565 (Memory_region::attributes_compatible): New method. Returns
4566 true if the provided section is compatible with the region.
4567 (Memory_region::get_last_section): New method. Returns the last
4568 section to use the region.
4569 (Memory_region::set_last_section): New method. Stores the last
4570 section to use the region.
4571 (Script_sections::block_in_region): New method. Returns true if
4572 a block of memory is contained within a region.
4573 (Script_sections::find_memory_region): New method. Locates a
4574 memory region to be used to set a VMA or LMA address.
4575 (Output_section_definition::set_section_addresses): Add code to
4576 check for addresses set by memory regions.
4577 (Output_segment::set_section_addresses): Remove memory region
4578 walking code.
4579 (Script_sections::create_segment): Add a warning if a header
4580 segment is created outside of any region.
4581 * script-sections.h (class Script_sections): Add prototypes for
4582 find_memory_region and block_in_region methods.
4583 * testsuite/memory_test.s: Use .long instead of .word.
4584 * testsuite/memory_test.t: Add some more output sections.
4585 * testsuite/memory_test.sh: Update expected output.
4586
4587 2010-10-02 Doug Kwan <dougkwan@google.com>
4588
4589 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4590 defintion to symtab.h
4591 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4592 declaration to defintion.
4593
4594 2010-10-01 Nick Clifton <nickc@redhat.com>
4595
4596 * expression.cc (eval): Replace dummy argument with NULL.
4597 (eval_maybe_dot): Check for a NULL result section pointer.
4598 (Symbol_expression::value): Likewise.
4599 (Dot_expression::value): Likewise.
4600 (BINARY_EXPRESSION): Likewise.
4601 (Max_expression::value): Likewise.
4602 (Min_expression::value): Likewise.
4603 (Absolute_expression::value): Likewise.
4604 (Addr_expression::value_from_output_section): Likewise.
4605 (Loaddddr_expression::value_from_output_section): Likewise.
4606 (Segment_start_expression::value): Likewise.
4607 * script-sections.cc
4608 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4609 argument with NULL.
4610 (Sections_elememt_dot_assignment::set_section_addresses):
4611 Likewise.
4612 (Output_data_expression::do_write_to_buffer): Likewise.
4613 (Output_section_definition::finalize_symbols): Likewise.
4614 (Output_section_definition::set_section_addresses): Likewise.
4615
4616 2010-09-30 Doug Kwan <dougkwan@google.com>
4617
4618 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4619
4620 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4621
4622 * target.h (Target::can_icf_inline_merge_sections): New virtual
4623 function.
4624 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4625 virtual function.
4626 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4627 virtual function.
4628 * icf.cc (get_section_contents): Inline merge sections only when
4629 target allows it.
4630
4631 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4632
4633 * configure: Regenerate.
4634
4635 2010-09-17 Ian Lance Taylor <iant@google.com>
4636
4637 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4638 * testsuite/Makefile.am (memory_test.o): New target.
4639 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4640 memory_test.t.
4641 * testsuite/Makefile.in: Rebuild.
4642
4643 2010-09-17 Doug Kwan <dougkwan@google.com>
4644
4645 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4646 defintion if relocation uses GOT entries of the symbol.
4647 * testsuite/icf_safe_test.sh: Fix test.
4648 * testsuite/icf_safe_so_test.sh: Fix test.
4649
4650 2010-09-16 Cary Coutant <ccoutant@google.com>
4651
4652 * script_sections.cc (class Memory_region): Remove "NULL" from
4653 vector initializations.
4654
4655 2010-09-15 Cary Coutant <ccoutant@google.com>
4656
4657 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4658 Resolve forwarding symbols.
4659
4660 2010-09-15 Doug Kwan <dougkwan@google.com>
4661
4662 * gold/testsuite/script_test_3.t: Add ARM special sections.
4663 * gold/testsuite/script_test_4.t: Same.
4664 * gold/testsuite/script_test_5.t: Same.
4665 * gold/testsuite/script_test_6.t: Same.
4666 * gold/testsuite/script_test_7.t: Same.
4667 * gold/testsuite/script_test_7.t: Same.
4668 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4669
4670 2010-09-14 Cary Coutant <ccoutant@google.com>
4671
4672 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4673 (Target_x86_64::Relocate::relocate_tls): Replace check for
4674 saw_tls_block_reloc_ with test for executable section.
4675
4676 2010-09-12 Cary Coutant <ccoutant@google.com>
4677
4678 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4679 position-independent executables to shared libraries need dynamic
4680 relocations.
4681 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4682 position-independent executables.
4683 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4684 * testsuite/Makefile.in: Regenerate.
4685
4686 2010-09-10 Nick Clifton <nickc@redhat.com>
4687
4688 PR gold/11997
4689 * testsuite/memory_test.t: Discard any sections that are not
4690 needed.
4691
4692 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4693
4694 PR gold/11996
4695 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4696 "This::" to work around a bug in gcc 4.2.
4697
4698 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4699
4700 2010-09-09 Rafael Espindola <espindola@google.com>
4701
4702 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4703 sections with different PF_X flags in the same segment.
4704 (Layout::find_first_load_seg): Search all segments to find the first
4705 one.
4706 * options.h (rosegment): New.
4707
4708 2010-09-08 Rafael Espindola <espindola@google.com>
4709
4710 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4711
4712 2010-09-08 Doug Kwan <dougkwan@google.com>
4713
4714 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4715 (Arm_relobj::do_relocate_sections): Add new parameter for output
4716 file to match the parent.
4717 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4718 of local symbols instead of input values. Update code to track
4719 changes in gold::relocate_section.
4720 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4721 (Sized_relobj::compute_final_local_value_internal): New methods.
4722 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4723 body into private version of Sized_relobj::compute_final_local_value.
4724 Call the inline method.
4725 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4726 merged symbol value if there is one.
4727 (Symbol_value::has_output_value): New method defintiion.
4728 (Sized_relobj::Compute_final_local_value_status): New enum type.
4729 (Sized_relobj::compute_final_local_value): New methods.
4730 (Sized_relobj::compute_final_local_value_internal): New methods.
4731 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4732 and arm_cortex_a8.sh.
4733 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4734 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4735 New tests.
4736 * Makefile.in: Regenerate.
4737 * testsuite/arm_bl_out_of_range.s: Update test.
4738 * testsuite/thumb_bl_out_of_range.s: Ditto.
4739 * testsuite/thumb_blx_out_of_range.s: Ditto.
4740 * testsuite/arm_branch_out_of_range.sh: New file.
4741 * testsuite/arm_cortex_a8.sh: Ditto.
4742 * testsuite/arm_cortex_a8_b.s: Ditto.
4743 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4744 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4745 * testsuite/arm_cortex_a8_bl.s: Ditto.
4746 * testsuite/arm_cortex_a8_blx.s: Ditto.
4747 * testsuite/arm_cortex_a8_local.s: Ditto.
4748 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4749 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4750
4751 2010-09-08 Rafael Espindola <espindola@google.com>
4752
4753 * Makefile.am (memory_test.stdout): Run readelf with -W.
4754 * Makefile.in: Regenerate.
4755 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4756 64 bit output.
4757
4758 2010-09-08 Rafael Espindola <espindola@google.com>
4759
4760 * script-sections.cc (Script_sections::add_memory_region): Convert
4761 field precision to int.
4762 * script.cc (script_set_section_region, script_set_section_region):
4763 Convert field precision to int.
4764
4765 2010-09-08 Rafael Espindola <espindola@google.com>
4766
4767 * arm.cc (do_finalize_sections): Create the __exidx_start and
4768 __exdix_end symbols even when the section is missing.
4769
4770 2010-09-08 Nick Clifton <nickc@redhat.com>
4771
4772 * README: Remove claim that MEMORY is not supported.
4773 * expression.cc (script_exp_function_origin)
4774 (script_exp_function_length): Move from here to ...
4775 * script.cc: ... here.
4776 (script_set_section_region, script_add_memory)
4777 (script_parse_memory_attr, script_include_directive): New
4778 functions.
4779 * script-sections.cc
4780 (class Memory_region): New class.
4781 (class Output_section_definition): Add set_memory_region,
4782 set_section_vma, set_section_lma and get_section_name methods.
4783 (class Script_Sections): Add add_memory_region,
4784 find_memory_region, find_memory_region_origin,
4785 find_memory_region_length and set_memory_region methods.
4786 Have set_section_addresses method walk the list of set memory
4787 regions.
4788 Extend the print methos to display memory regions.
4789 * script-sections.h: Add prototypes for new methods.
4790 Add enum for MEMORY region attributes.
4791 * yyscript.y: Add support for parsing MEMORY regions.
4792 * script-c.h: Add prototypes for new functions.
4793 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4794 * testsuite/Makefile.in: Regenerate.
4795 * testsuite/memory_test.sh: New script.
4796 * testsuite/memory_test.s: New assembler source file.
4797 * testsuite/memory_test.t: New linker script.
4798
4799 2010-08-27 Doug Kwan <dougkwan@google.com>
4800
4801 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4802 reference override an existing dynamic weak reference.
4803 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4804 * testsuite/Makefile.in: Regenerate.
4805 * testsuite/dyn_weak_ref.sh: New file.
4806 * testsuite/dyn_weak_ref_1.c: Ditto.
4807 * testsuite/dyn_weak_ref_2.c: Ditto.
4808
4809 2010-08-27 Ian Lance Taylor <iant@google.com>
4810
4811 * incremental.h (class Incremental_input_entry): Add virtual
4812 destructor.
4813
4814 2010-08-27 Ian Lance Taylor <iant@google.com>
4815
4816 * testsuite/start_lib_test_3.c: Mark t3 as used.
4817
4818 2010-08-27 Nick Clifton <nickc@redhat.com>
4819
4820 * options.cc (version_script): Fix small typo in previous
4821 whitespace tidyup.
4822
4823 2010-08-25 Nick Clifton <nickc@redhat.com>
4824
4825 * archive.cc: Formatting fixes: Remove whitespace between
4826 typename and following asterisk. Remove whitespace between
4827 function name and opening parenthesis.
4828 * archive.h: Likewise.
4829 * arm.cc: Likewise.
4830 * attributes.cc: Likewise.
4831 * attributes.h: Likewise.
4832 * common.cc: Likewise.
4833 * copy-relocs.cc: Likewise.
4834 * dirsearch.h: Likewise.
4835 * dynobj.cc: Likewise.
4836 * ehframe.cc: Likewise.
4837 * ehframe.h: Likewise.
4838 * expression.cc: Likewise.
4839 * fileread.cc: Likewise.
4840 * fileread.h: Likewise.
4841 * gc.h: Likewise.
4842 * gold-threads.cc: Likewise.
4843 * gold.cc: Likewise.
4844 * i386.cc: Likewise.
4845 * icf.h: Likewise.
4846 * incremental-dump.cc: Likewise.
4847 * incremental.cc: Likewise.
4848 * layout.cc: Likewise.
4849 * layout.h: Likewise.
4850 * main.cc: Likewise.
4851 * merge.cc: Likewise.
4852 * merge.h: Likewise.
4853 * object.cc: Likewise.
4854 * object.h: Likewise.
4855 * options.cc: Likewise.
4856 * options.h: Likewise.
4857 * output.cc: Likewise.
4858 * output.h: Likewise.
4859 * plugin.cc: Likewise.
4860 * plugin.h: Likewise.
4861 * powerpc.cc: Likewise.
4862 * reloc.cc: Likewise.
4863 * script-c.h: Likewise.
4864 * script-sections.cc: Likewise.
4865 * script.cc: Likewise.
4866 * stringpool.cc: Likewise.
4867 * symtab.cc: Likewise.
4868 * symtab.h: Likewise.
4869 * target.cc: Likewise.
4870 * timer.cc: Likewise.
4871 * timer.h: Likewise.
4872 * version.cc: Likewise.
4873 * x86_64.cc: Likewise.
4874
4875 2010-08-24 Nick Clifton <nickc@redhat.com>
4876
4877 PR 11899
4878 * layout.cc (segment_precedes): Sort segments by their physical
4879 addresses, if they have been set.
4880
4881 2010-08-23 Cary Coutant <ccoutant@google.com>
4882
4883 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4884 symbols data.
4885 (Lib_group::include_member): Unlock object after deleting its
4886 symbols data.
4887 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4888 the bug fixed here.
4889
4890 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4891 Cary Coutant <ccoutant@google.com>
4892
4893 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4894 constructor, and set_blocker.
4895 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4896 readsyms_blocker_.
4897 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4898 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4899 * testsuite/Makefile.am (start_lib_test): New test case.
4900 * testsuite/Makefile.in: Regenerate.
4901 * testsuite/start_lib_test_main.c: New file.
4902 * testsuite/start_lib_test_1.c: New file.
4903 * testsuite/start_lib_test_2.c: New file.
4904 * testsuite/start_lib_test_3.c: New file.
4905
4906 2010-08-19 Ian Lance Taylor <iant@google.com>
4907
4908 * Makefile.in: Rebuild with automake 1.11.1.
4909 * aclocal.m4: Likewise.
4910 * testsuite/Makefile.in: Likewise.
4911
4912 2010-08-19 Ian Lance Taylor <iant@google.com>
4913
4914 PR 10893
4915 * i386.cc (class Output_data_plt_i386): Update declarations.
4916 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4917 local_ifuncs_ fields.
4918 (Target_i386::do_plt_section_for_global): New function.
4919 (Target_i386::do_plt_section_for_local): New function.
4920 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4921 parameter; change all callers. Initialize global_ifuncs_ and
4922 local_ifuncs_. If doing a static link define __rel_iplt_start and
4923 __rel_iplt_end.
4924 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4925 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4926 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4927 symbols.
4928 (Target_i386::make_plt_section): New function, broken out of
4929 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4930 (Target_i386::make_plt_entry): Call make_plt_section.
4931 (Target_i386::make_local_ifunc_plt_entry): New function.
4932 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4933 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4934 R_386_IRELATIVE to switch.
4935 (Target_i386::Scan::global): Likewise.
4936 (Target_i386::Relocate::relocate): Likewise.
4937 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4938 switch.
4939 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4940 (Target_x86_64::do_plt_section_for_global): New function.
4941 (Target_x86_64::do_plt_section_for_local): New function.
4942 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4943 parameter; change all callers. If doing a static link define
4944 __rela_iplt_start and __rela_iplt_end.
4945 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4946 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4947 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4948 to point to .plt.
4949 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4950 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4951 switch.
4952 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4953 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4954 R_X86_64_IRELATIVE to switch.
4955 (Target_x86_64::Scan::global): Likewise.
4956 (Target_x86_64::Relocate::relocate): Likewise.
4957 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4958 switch.
4959 * target.h (class Target): Add plt_section_for_global and
4960 plt_section_for_local functions. Add do_plt_section_for_global
4961 and do_plt_section_for_local virtual functions.
4962 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4963 clarifying comments.
4964 (Symbol::use_plt_offset): Handle IFUNC symbol.
4965 * object.cc (Sized_relobj::Sized_relobj): Initialize
4966 local_plt_offsets_.
4967 (Sized_relobj::local_has_plt_offset): New function.
4968 (Sized_relobj::local_plt_offset): New function.
4969 (Sized_relobj::set_local_plt_offset): New function.
4970 (Sized_relobj::do_count): Handle IFUNC symbol.
4971 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4972 a bit away from input_shndx_ field. Add set_is_func_symbol and
4973 is_ifunc_symbol functions.
4974 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4975 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4976 local_plt_offsets_ field.
4977 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4978 * output.h (class Output_section_data): Add non-const
4979 output_section function.
4980 (class Output_data_got): Update declarations.
4981 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4982 Add use_plt_offset parameter to global and local constructors.
4983 Change all callers. Change local_sym_index_ field to 31 bits.
4984 Change GSYM_CODE and CONSTANT_CODE accordingly.
4985 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4986 doing a static link don't set sh_link field.
4987 (Output_data_got::Got_entry::write): Use PLT offset if
4988 appropriate.
4989 (Output_data_got::add_global_plt): New function.
4990 (Output_data_got::add_local_plt): New function.
4991 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4992 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4993 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4994 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4995 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4996 IFUNC conditional.
4997 * testsuite/ifunc-sel.h: New file.
4998 * testsuite/ifuncmain1.c: New file.
4999 * testsuite/ifuncmain1vis.c: New file.
5000 * testsuite/ifuncmod1.c: New file.
5001 * testsuite/ifuncdep2.c: New file.
5002 * testsuite/ifuncmain2.c: New file.
5003 * testsuite/ifuncmain3.c: New file.
5004 * testsuite/ifuncmod3.c: New file.
5005 * testsuite/ifuncmain4.c: New file.
5006 * testsuite/ifuncmain5.c: New file.
5007 * testsuite/ifuncmod5.c: New file.
5008 * testsuite/ifuncmain6pie.c: New file.
5009 * testsuite/ifuncmod6.c: New file.
5010 * testsuite/ifuncmain7.c: New file.
5011 * configure, testsuite/Makefile.in: Rebuild.
5012
5013 2010-08-18 Ian Lance Taylor <iant@google.com>
5014
5015 * incremental.cc
5016 (Output_section_incremental_inputs::write_input_files): Add cast
5017 to avoid signed/unsigned comparison warning.
5018 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5019
5020 2010-08-12 Cary Coutant <ccoutant@google.com>
5021
5022 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5023
5024 2010-08-13 Ian Lance Taylor <iant@google.com>
5025
5026 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5027
5028 2010-08-12 Cary Coutant <ccoutant@google.com>
5029 Doug Kwan <dougkwan@google.com>
5030
5031 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5032 defintion overrides non-weak undef, remember that the original undef
5033 is not weak.
5034 * symtab.cc (Symbol_table::sized_write_global): For undef without
5035 an original weak binding, set binding to global in output.
5036 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5037 * testsuite/Makefile.in: Regenerate.
5038 * testsuite/strong_ref_weak_def.sh: New file.
5039 * testsuite/strong_ref_weak_def_1.c: Ditto.
5040 * testsuite/strong_ref_weak_def_2.c: Ditto.
5041
5042 2010-08-12 Cary Coutant <ccoutant@google.com>
5043
5044 * testsuite/incremental_test.sh: Rewrite.
5045 * testsuite/incremental_test_1.c: Rewrite.
5046 * testsuite/incremental_test_2.c: Rewrite.
5047
5048 2010-08-12 Cary Coutant <ccoutant@google.com>
5049
5050 * arm.cc (Target_arm::got_size): Add const.
5051 (Target_arm::got_entry_count): New function.
5052 (Target_arm::plt_entry_count): New function.
5053 (Target_arm::first_plt_entry_offset): New function.
5054 (Target_arm::plt_entry_size): New function.
5055 (Output_data_plt_arm::entry_count): New function.
5056 (Output_data_plt_arm::first_plt_entry_offset): New function.
5057 (Output_data_plt_arm::get_plt_entry_size): New function.
5058 * i386.cc (Target_i386::got_size): Add const.
5059 (Target_i386::got_entry_count): New function.
5060 (Target_i386::plt_entry_count): New function.
5061 (Target_i386::first_plt_entry_offset): New function.
5062 (Target_i386::plt_entry_size): New function.
5063 (Output_data_plt_i386::entry_count): New function.
5064 (Output_data_plt_i386::first_plt_entry_offset): New function.
5065 (Output_data_plt_i386::get_plt_entry_size): New function.
5066 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5067 find_incremental_inputs_sections. Dump incremental_got_plt section.
5068 * incremental.cc: Include target.h.
5069 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5070 parameter. Adjust all callers. Find incremental_got_plt section.
5071 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5072 section.
5073 (Output_section_incremental_inputs::set_final_data_size): Calculate
5074 size of incremental_got_plt section.
5075 (Output_section_incremental_inputs::do_write): Write the
5076 incremental_got_plt section.
5077 (Got_plt_view_info): New struct.
5078 (Local_got_offset_visitor): New class.
5079 (Global_got_offset_visitor): New class.
5080 (Global_symbol_visitor_got_plt): New class.
5081 (Output_section_incremental_inputs::write_got_plt): New function.
5082 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5083 Add parameter. Adjust all callers.
5084 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5085 (Incremental_inputs::got_plt_section): New function.
5086 (Incremental_inputs::got_plt_section_): New data member.
5087 (Incremental_got_plt_reader): New class.
5088 * layout.cc (Layout::create_incremental_info_sections): Add the
5089 incremental_got_plt section.
5090 * object.h (Got_offset_list::get_list): New function.
5091 (Got offset_list::for_all_got_offsets): New function.
5092 (Sized_relobj::local_got_offset_list): New function.
5093 * powerpc.cc (Target_powerpc::got_size): Add const.
5094 (Target_powerpc::got_entry_count): New function.
5095 (Target_powerpc::plt_entry_count): New function.
5096 (Target_powerpc::first_plt_entry_offset): New function.
5097 (Target_powerpc::plt_entry_size): New function.
5098 (Output_data_plt_powerpc::entry_count): New function.
5099 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5100 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5101 * sparc.cc (Target_sparc::got_size): Add const.
5102 (Target_sparc::got_entry_count): New function.
5103 (Target_sparc::plt_entry_count): New function.
5104 (Target_sparc::first_plt_entry_offset): New function.
5105 (Target_sparc::plt_entry_size): New function.
5106 (Output_data_plt_sparc::entry_count): New function.
5107 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5108 (Output_data_plt_sparc::get_plt_entry_size): New function.
5109 * symtab.h (Symbol::got_offset_list): New function.
5110 (Symbol_table::for_all_symbols): New function.
5111 * target.h (Sized_target::got_entry_count): New function.
5112 (Sized_target::plt_entry_count): New function.
5113 (Sized_target::plt_entry_size): New function.
5114 * x86_64.cc (Target_x86_64::got_size): Add const.
5115 (Target_x86_64::got_entry_count): New function.
5116 (Target_x86_64::plt_entry_count): New function.
5117 (Target_x86_64::first_plt_entry_offset): New function.
5118 (Target_x86_64::plt_entry_size): New function.
5119 (Output_data_plt_x86_64::entry_count): New function.
5120 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5121 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5122
5123 2010-08-12 Cary Coutant <ccoutant@google.com>
5124
5125 * archive.cc: Include incremental.h.
5126 (Archive::Archive): Initialize incremental_info_.
5127 (Archive::include_member): Record archive members in incremental info.
5128 (Add_archive_symbols::run): Record begin and end of an archive in
5129 incremental info.
5130 (Lib_group::include_member): Record objects in incremental info.
5131 * archive.h (Incremental_archive_entry): Forward declaration.
5132 (Archive::set_incremental_info): New member function.
5133 (Archive::incremental_info): New member function.
5134 (Archive::Unused_symbol_iterator): New class.
5135 (Archive::unused_symbols_begin): New member function.
5136 (Archive::unused_symbols_end): New member function.
5137 (Archive::incremental_info_): New data member.
5138 * incremental-dump.cc (find_input_containing_global): New function.
5139 (dump_incremental_inputs): Dump new incremental info sections.
5140 * incremental.cc: Include symtab.h.
5141 (Output_section_incremental_inputs): New class.
5142 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5143 new incremental info sections.
5144 (Sized_incremental_binary::do_check_inputs): Likewise.
5145 (Incremental_inputs::report_archive): Remove.
5146 (Incremental_inputs::report_archive_begin): New function.
5147 (Incremental_inputs::report_archive_end): New function.
5148 (Incremental_inputs::report_object): New function.
5149 (Incremental_inputs::finalize_inputs): Remove.
5150 (Incremental_inputs::report_input_section): New function.
5151 (Incremental_inputs::report_script): Rewrite.
5152 (Incremental_inputs::finalize): Do nothing but finalize string table.
5153 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5154 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5155 (Incremental_inputs::create_data_sections): New function.
5156 (Incremental_inputs::relocs_entsize): New function.
5157 (Output_section_incremental_inputs::set_final_data_size): New function.
5158 (Output_section_incremental_inputs::do_write): New function.
5159 (Output_section_incremental_inputs::write_header): New function.
5160 (Output_section_incremental_inputs::write_input_files): New function.
5161 (Output_section_incremental_inputs::write_info_blocks): New function.
5162 (Output_section_incremental_inputs::write_symtab): New function.
5163 * incremental.h (Incremental_script_entry): Forward declaration.
5164 (Incremental_object_entry): Forward declaration.
5165 (Incremental_archive_entry): Forward declaration.
5166 (Incremental_inputs): Forward declaration.
5167 (Incremental_inputs_header_data): Remove.
5168 (Incremental_inputs_header): Remove.
5169 (Incremental_inputs_header_write): Remove.
5170 (Incremental_inputs_entry_data): Remove.
5171 (Incremental_inputs_entry): Remove.
5172 (Incremental_inputs_entry_write): Remove.
5173 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5174 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5175 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5176 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5177 Likewise.
5178 (Incremental_input_entry): New class.
5179 (Incremental_script_entry): New class.
5180 (Incremental_object_entry): New class.
5181 (Incremental_archive_entry): New class.
5182 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5183 (Incremental_inputs::report_inputs): Remove.
5184 (Incremental_inputs::report_archive): Remove.
5185 (Incremental_inputs::report_archive_begin): New function.
5186 (Incremental_inputs::report_archive_end): New function.
5187 (Incremental_inputs::report_object): Change prototype.
5188 (Incremental_inputs::report_input_section): New function.
5189 (Incremental_inputs::report_script): Change prototype.
5190 (Incremental_inputs::get_reloc_count): New function.
5191 (Incremental_inputs::set_reloc_count): New function.
5192 (Incremental_inputs::create_data_sections): New function.
5193 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5194 (Incremental_inputs::inputs_section): New function.
5195 (Incremental_inputs::symtab_section): New function.
5196 (Incremental_inputs::relocs_section): New function.
5197 (Incremental_inputs::get_stringpool): Add const.
5198 (Incremental_inputs::command_line): Add const.
5199 (Incremental_inputs::inputs): Remove.
5200 (Incremental_inputs::command_line_key): New function.
5201 (Incremental_inputs::input_file_count): New function.
5202 (Incremental_inputs::input_files): New function.
5203 (Incremental_inputs::relocs_entsize): New function.
5204 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5205 (Incremental_inputs::finalize_inputs): Remove.
5206 (Incremental_inputs::Input_info): Remove.
5207 (Incremental_inputs::lock_): Remove.
5208 (Incremental_inputs::inputs_): Change type.
5209 (Incremental_inputs::inputs_map_): Remove.
5210 (Incremental_inputs::current_object_entry_): New data member.
5211 (Incremental_inputs::inputs_section_): New data member.
5212 (Incremental_inputs::symtab_section_): New data member.
5213 (Incremental_inputs::relocs_section_): New data member.
5214 (Incremental_inputs::reloc_count_): New data member.
5215 (Incremental_inputs_reader): New class.
5216 (Incremental_symtab_reader): New class.
5217 (Incremental_relocs_reader): New class.
5218 * layout.cc (Layout::finalize): Move finalization of incremental info
5219 and creation of incremental info sections to follow finalization of
5220 symbol table. Set offsets for postprocessing sections.
5221 (Layout::create_incremental_info_sections): Call
5222 Incremental_inputs::create_data_sections. Add incremental symtab
5223 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5224 sections to layout after input sections.
5225 * layout.h (struct Timespec): Forward declaration.
5226 (Layout::incremental_inputs): Add const.
5227 (Layout::create_incremental_info_sections): Add parameter.
5228 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5229 * object.cc: Include incremental.h.
5230 (Relobj::finalize_incremental_relocs): New function.
5231 (Sized_relobj::do_layout): Record input sections in incremental info.
5232 * object.h (Object::output_section): New function.
5233 (Object::output_section_offset): Moved from Relobj.
5234 (Object::get_incremental_reloc_base): New function.
5235 (Object::get_incremental_reloc_count): New function.
5236 (Object::do_output_section): New function.
5237 (Object::do_output_section_offset): Moved from Relobj.
5238 (Object::do_get_incremental_reloc_base): New function.
5239 (Object::do_get_incremental_reloc_count): New function.
5240 (Object::Object): Initialize new data members.
5241 (Relobj::output_section): Renamed do_output_section and moved to
5242 protected.
5243 (Relobj::output_section_offset): Moved to Object.
5244 (Relobj::do_get_incremental_reloc_base): New function.
5245 (Relobj::do_get_incremental_reloc_count): New function.
5246 (Relobj::allocate_incremental_reloc_counts): New function.
5247 (Relobj::count_incremental_reloc): New function.
5248 (Relobj::finalize_incremental_relocs): New function.
5249 (Relobj::next_incremental_reloc_index): New function.
5250 (Relobj::reloc_counts_): New data member.
5251 (Relobj::reloc_bases_): New data member.
5252 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5253 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5254 (Sized_relobj::incremental_relocs_scan): New function.
5255 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5256 (Sized_relobj::incremental_relocs_write): New function.
5257 (Sized_relobj::incremental_relocs_write_reltype): New function.
5258 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5259 incremental link.
5260 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5261 archives and object files elsewhere.
5262 (Add_symbols::run): Report object files here.
5263 (Finish_group::run): Report end of archive at end of group.
5264 * reloc.cc: Include layout.h, incremental.h.
5265 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5266 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5267 (Sized_relobj::incremental_relocs_scan): New function.
5268 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5269 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5270 (Sized_relobj::incremental_relocs_write): New function.
5271 (Sized_relobj::incremental_relocs_write_reltype): New function.
5272 * script.cc (read_input_script): Rewrite test for incremental link.
5273 Change call to Incremental_inputs::report_script.
5274 * symtab.h (Symbol_table::first_global_index): New function.
5275 (Symbol_table::output_count): New function.
5276
5277 2010-08-12 Doug Kwan <dougkwan@google.com>
5278
5279 * arm.cc (Target_arm::merge_object_attributes): Check command line
5280 options --no-wchar-size-warning and --no-enum-size-warning.
5281 * options.h (General_options): Add ld-compatible options
5282 --no-enum-size-warning and --no-wchar-size-warning.
5283
5284 2010-08-04 Ian Lance Taylor <iant@google.com>
5285
5286 * x86_64.cc (Target_x86_64::Scan::local): Use
5287 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5288 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5289 (Target_x86_64::Scan::global): Likewise.
5290 (Target_x86_64::Relocate::relocate): Likewise.
5291 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5292 Likewise.
5293
5294 2010-08-03 Cary Coutant <ccoutant@google.com>
5295
5296 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5297 to reserve space in merged_strings vector. Keep total input size
5298 for stats.
5299 (Output_merge_string::do_print_merge_stats): Print total input size.
5300 * merge.h (Output_merge_string): Add input_size_ field.
5301 * stringpool.cc (Stringpool_template::string_length): Move
5302 implementations out of Stringpool_template class and place in
5303 stringpool.h.
5304 * stringpool.h (string_length): Move out of Stringpool_template.
5305
5306 2010-08-03 Ian Lance Taylor <iant@google.com>
5307
5308 PR 11712
5309 * layout.cc (relaxation_loop_body): If address of load segment is
5310 set, adjust address to include headers if possible.
5311
5312 2010-08-03 Ian Lance Taylor <iant@google.com>
5313
5314 * version.cc (version_string): Bump to 1.10.
5315
5316 2010-08-03 Ian Lance Taylor <iant@google.com>
5317
5318 PR 11805
5319 * layout.h (enum Output_section_order): Define.
5320 (class Layout): Update declarations.
5321 * layout.cc (Layout::get_output_section): Add order parameter.
5322 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5323 is_first_non_relro parameters. Change all callers.
5324 (Layout::choose_output_section): Likewise.
5325 (Layout::add_output_section_data): Likewise.
5326 (Layout::make_output_section): Likewise. Set order.
5327 (Layout::default_section_order): New function.
5328 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5329 * output.cc (Output_section::Output_section): Initialize order_.
5330 Don't initialize deleted fields.
5331 (Output_segment::Output_segment): Don't initialize deleted
5332 fields.
5333 (Output_segment::add_output_section_to_load): New function
5334 replacing add_output_section. Change all callers to call this or
5335 add_output_section_to_nonload.
5336 (Output_segment::add_output_section_to_nonload): New function.
5337 (Output_segment::remove_output_section): Rewrite.
5338 (Output_segment::add_initial_output_data): Likewise.
5339 (Output_segment::has_any_data_sections): Likewise.
5340 (Output_segment::is_first_section_relro): Likewise.
5341 (Output_segment::maximum_alignment): Likewise.
5342 (Output_segment::has_dynamic_reloc): New function replacing
5343 dynamic_reloc_count. Change all callers.
5344 (Output_segment::has_dynamic_reloc_list): New function replacing
5345 dynamic_reloc_count_list. Change all callers.
5346 (Output_segment::set_section_addresses): Rewrite.
5347 (Output_segment::set_offset): Rewrite.
5348 (Output_segment::find_first_and_last_list): Remove.
5349 (Output_segment::set_tls_offsets): Rewrite.
5350 (Output_segment::first_section_load_address): Likewise.
5351 (Output_segment::output_section_count): Likewise.
5352 (Output_segment::section_with_lowest_load_address): Likewise.
5353 (Output_segment::write_section_headers): Likewise.
5354 (Output_segment::print_sections_to_map): Likewise.
5355 * output.h (class Output_data): Remove dynamic_reloc_count_
5356 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5357 (Output_data::add_dynamic_reloc): Rewrite.
5358 (Output_data::has_dynamic_reloc): New function.
5359 (Output_data::dynamic_reloc_count): Remove.
5360 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5361 is_last_relro_, is_first_non_relro_, is_interp_,
5362 is_dynamic_linker_section_ fields. Add order and set_order
5363 functions. Remove is_relro_local, set_is_relro_local,
5364 is_last_relro, set_is_last_relro, is_first_non_relro,
5365 set_is_first_non_relro functions, is_interp, set_is_interp,
5366 is_dynamic_linker_section, and set_is_dynamic_linker_section
5367 functions.
5368 (class Output_segment): Change Output_data_list from std::list to
5369 std:;vector. Add output_lists_ field. Remove output_data_ and
5370 output_bss_ fields. Update declarations.
5371
5372 2010-08-02 Ian Lance Taylor <iant@google.com>
5373
5374 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5375 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5376 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5377
5378 2010-08-02 Ian Lance Taylor <iant@google.com>
5379
5380 PR 11855
5381 * script.cc (Script_options::Script_options): Initialize
5382 symbol_definitions_ and symbol_references_.
5383 (Script_options::add_symbol_assignment): Update
5384 symbol_definitions_ and symbol_references_.
5385 (Script_options::add_symbol_reference): New function.
5386 (script_symbol): New function.
5387 * script.h (class Script_options): Add symbol_definitions_ and
5388 symbol_references_ fields.
5389 (Script_options::referenced_const_iterator): New type.
5390 (Script_options::referenced_begin): New function.
5391 (Script_options::referenced_end): New function.
5392 (Script_options::is_referenced): New function.
5393 (Script_options::any_unreferenced): New function.
5394 * script-c.h (script_symbol): Declare.
5395 * yyscript.y (exp): Call script_symbol.
5396 * symtab.cc: Include "script.h".
5397 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5398 Change all callers. Check symbols referenced by scripts.
5399 (Symbol_table::add_undefined_symbols_from_command_line): Add
5400 layout parameter. Change all callers.
5401 (Symbol_table::do_add_undefined_symbols_from_command_line):
5402 Likewise. Break out loop body. Check symbols referenced by
5403 scripts.
5404 (Symbol_table::add_undefined_symbol_from_command_line): New
5405 function broken out of
5406 do_add_undefined_symbols_from_command_line.
5407 * symtab.h (class Symbol_table): Update declarations.
5408 * archive.cc: Include "layout.h".
5409 (Archive::should_include_member): Add layout parameter. Change
5410 all callers. Check for symbol mentioned in expression.
5411 * archive.h (class Archive): Update declaration.
5412 * object.cc (Sized_relobj::do_should_include_member): Add layout
5413 parameter.
5414 * object.h (Object::should_include_member): Add layout parameter.
5415 Change all callers.
5416 (Object::do_should_include_member): Add layout parameter.
5417 (class Sized_relobj): Update declaration.
5418 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5419 parameter.
5420 * dynobj.h (class Sized_dynobj): Update declaration.
5421 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5422 layout parameter.
5423 * plugin.h (class Sized_pluginobj): Update declaration.
5424
5425 2010-08-02 Ian Lance Taylor <iant@google.com>
5426
5427 PR 11866
5428 * output.cc (Output_segment::set_offset): Search for the first and
5429 last sections rather than assuming that the list is in order.
5430 (Output_segment::find_first_and_last_list): New function.
5431 * output.h (class Output_segment): Update declarations.
5432 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5433 (relro_strip_test_SOURCES): New variable.
5434 (relro_strip_test_DEPENDENCIES): New variable.
5435 (relro_strip_test_LDFLAGS): New variable.
5436 (relro_strip_test_LDADD): New variable.
5437 (relro_strip_test.so): New target.
5438
5439 2010-08-02 Ian Lance Taylor <iant@google.com>
5440
5441 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5442 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5443 (Target_i386::got_tlsdesc_section): New function.
5444 (Target_i386::got_section): Create space for GOT entries for
5445 TLSDESC relocations.
5446 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5447 R_386_TLS_GOTDESC.
5448 (Target_i386::Scan::global): Likewise.
5449 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5450 using TLSDESC GOT.
5451 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5452 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5453 (Target_x86_64::got_tlsdesc_section): New function.
5454 (Target_x86_64::got_section): Create space for GOT entries for
5455 TLSDESC relocations.
5456 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5457 R_386_TLS_GOTDESC.
5458 (Target_x86_64::Scan::global): Likewise.
5459 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5460 using TLSDESC GOT.
5461
5462 2010-08-02 Ian Lance Taylor <iant@google.com>
5463
5464 * testsuite/final_layout.sh: Use dc to convert from hex to
5465 decimal.
5466
5467 2010-07-29 Sriraman Tallam <tmsriram@google.com>
5468
5469 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5470 paramter to the call to gold::gc_process_relocs.
5471 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5472 paramter to the call to gold::gc_process_relocs.
5473 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5474 parameter to the call to gold::gc_process_relocs.
5475 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5476 template parameter to the call to gold::gc_process_relocs.
5477 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5478 paramter to the call to gold::gc_process_relocs.
5479 * gc.h (get_embedded_addend_size): New function.
5480 (gc_process_relocs): Save the size of the reloc for use by ICF.
5481 * icf.cc (get_section_contents): Get the addend from the text section
5482 for SHT_REL relocation sections.
5483 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5484 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5485 * int_encoding.h (read_from_pointer): New overloaded function.
5486 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5487 * testsuite/icf_sht_rel_addend_test.sh: New file.
5488 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5489 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5490
5491 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5492
5493 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5494 * Makefile.in: Regenerate.
5495 * testsuite/Makefile.in: Regenerate.
5496
5497 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5498
5499 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5500 * gold/testsuite/debug_msg.cc: Likewise.
5501 * gold/testsuite/odr_violation1.cc
5502 * gold/testsuite/odr_violation2.cc
5503
5504 2010-07-21 Cary Coutant <ccoutant@google.com>
5505
5506 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5507 string, and length fields.
5508 (Output_merge_string::Merged_strings_list): New type.
5509 (Output_merge_string::Merged_strings_lists): New typedef.
5510 (Output_merge_string): Replace merged_strings_ with
5511 merged_strings_lists_.
5512 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5513 Merged_strings_list per input object and section. Don't store pointer
5514 to the string. Don't store length with each merged string entry.
5515 (Output_merge_string::finalize_merged_data): Loop over list of merged
5516 strings lists. Recompute length of each merged string.
5517
5518 2010-07-15 Cary Coutant <ccoutant@google.com>
5519
5520 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5521 here.
5522
5523 2010-07-14 Ian Lance Taylor <iant@google.com>
5524
5525 * descriptors.cc (Descriptors::open): Report correct name in error
5526 message.
5527
5528 2010-07-13 Doug Kwan <dougkwan@google.com>
5529
5530 * arm.cc (Arm_input_section::Arm_input_section): For a
5531 SHT_ARM_EXIDX section, always keeps the input sections.
5532 (Arm_input_section::set_exidx_section_link): New method.
5533 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5534 has_errors_ to false.
5535 (Arm_exidx_input_section::has_errors,
5536 Arm_exidx_input_section::set_has_errors): New methods.
5537 (Arm_exidx_input_section::has_errors_): New data member.
5538 (Arm_relobj::get_exidx_shndx_list): New method.
5539 (Arm_output_section::append_text_sections_to_list): Do not skip
5540 section without SHF_EXECINSTR.
5541 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5542 errors.
5543 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5544 section header. Make error messages more verbose. Check for
5545 a non-executable section linked to an EXIDX section.
5546 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5547 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5548 check that there is no deferred EXIDX section if we exit early.
5549 Instead of not making an EXIDX section in case of an error, make one
5550 and set the has_errors flag of it.
5551 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5552 in a relocatable link.
5553 (Target_arm::do_relax): Look for the EXIDX output section instead of
5554 assuming that it is called .ARM.exidx.
5555 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5556 section list. Do not check for SHF_EXECINSTR section flags but
5557 skip any input section with errors.
5558 * output.cc (Output_section::Output_section): Initialize
5559 always_keeps_input_sections_ to false.
5560 (Output_section::add_input_section): Check for
5561 always_keeps_input_sections_.
5562 * output.h (Output_section::always_keeps_input_sections,
5563 Output_section::set_always_keeps_input_sections): New methods.
5564 (Output_section::always_keeps_input_sections): New data member.
5565
5566 2010-07-13 Rafael Espindola <espindola@google.com>
5567
5568 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5569 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5570
5571 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5572 Ian Lance Taylor <iant@google.com>
5573
5574 * output.h (Output_section_lookup_maps::add_merge_section):
5575 Correct check of whether value was inserted.
5576 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5577 (Output_section_lookup_maps::add_relaxed_input_section):
5578 Likewise.
5579 * arm.cc (Target_arm::got_section): Remove used local os.
5580 * i386.cc (Target_i386::got_section): Likewise.
5581 * x86_64.cc (Target_x86_64::got_section): Likewise.
5582 * sparc.cc (Target_sparc::got_section): Likewise.
5583 (Target_sparc::relocate): Remove unused local have_got_offset.
5584 * powerpc.cc (Target_powerpc::relocate): Likewise.
5585
5586 2010-07-13 Ian Lance Taylor <iant@google.com>
5587
5588 * compressed_output.cc (zlib_decompress): Fix signature in
5589 !HAVE_ZLIB_H case.
5590
5591 * archive.cc (Archive::include_member): Unlock an external member
5592 of a thin archive. Don't bother to delete an object we know is
5593 NULL.
5594
5595 2010-07-12 Cary Coutant <ccoutant@google.com>
5596
5597 * compressed_output.cc (zlib_decompress): New function.
5598 (get_uncompressed_size): New function.
5599 (decompress_input_section): New function.
5600 * compressed_output.h (get_uncompressed_size): New function.
5601 (decompress_input_section): New function.
5602 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5603 Handle compressed debug sections.
5604 * layout.cc (is_compressed_debug_section): New function.
5605 (Layout::output_section_name): Map compressed section names to
5606 canonical names.
5607 * layout.h (is_compressed_debug_section): New function.
5608 (is_debug_info_section): Recognize compressed debug sections.
5609 * merge.cc: Include compressed_output.h.
5610 (Output_merge_data::do_add_input_section): Handle compressed
5611 debug sections.
5612 (Output_merge_string::do_add_input_section): Handle compressed
5613 debug sections.
5614 * object.cc: Include compressed_output.h.
5615 (Sized_relobj::Sized_relobj): Initialize new data members.
5616 (build_compressed_section_map): New function.
5617 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5618 * object.h (Object::section_is_compressed): New method.
5619 (Object::do_section_is_compressed): New method.
5620 (Sized_relobj::Compressed_section_map): New type.
5621 (Sized_relobj::do_section_is_compressed): New method.
5622 (Sized_relobj::compressed_sections_): New data member.
5623 * output.cc (Output_section::add_input_section): Handle compressed
5624 debug sections.
5625 * reloc.cc: Include compressed_output.h.
5626 (Sized_relobj::write_sections): Handle compressed debug sections.
5627
5628 2010-07-08 Cary Coutant <ccoutant@google.com>
5629
5630 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5631 weak when resolving to a dynamic def.
5632 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5633 for weak undef/dynamic def cases. Adjust callers.
5634 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5635 undef_binding_weak_.
5636 (Symbol_table::sized_write_globals): Adjust symbol binding.
5637 (Symbol_table::sized_write_symbol): Add binding parameter.
5638 * symtab.h (Symbol::set_undef_binding): New method.
5639 (Symbol::is_undef_binding_weak): New method.
5640 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5641 (Symbol_table::should_override): Add new parameter.
5642 (Symbol_table::sized_write_symbol): Add new parameter.
5643
5644 * testsuite/weak_undef_file1.cc: Add new test case.
5645 * testsuite/weak_undef_file2.cc: Fix header comment.
5646 * testsuite/weak_undef_test.cc: Add new test case.
5647
5648 2010-06-29 Doug Kwan <dougkwan@google.com>
5649
5650 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5651 Initialize USE_SYMBOL_.
5652 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5653 definition.
5654 (Arm_reloc_property::uses_symbol_): New data member declaration.
5655 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5656 uses symbol value and symbol is undefined but not weakly undefined.
5657
5658 2010-06-28 Rafael Espindola <espindola@google.com>
5659
5660 * plugin.cc (Plugin::load): Use dlerror.
5661
5662 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5663
5664 * symtab.cc (detect_odr_violations): When reporting an ODR
5665 violation, report an object where the symbol is defined.
5666
5667 2010-06-25 Doug Kwan <dougkwan@google.com>
5668
5669 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5670 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5671 definition.
5672 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5673 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5674 target hook to detect function points.
5675 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5676 * icf.h (Icf::check_section_for_function_pointers): Change type of
5677 parameter SECTION_NAME to const reference to std::string. Use
5678 target hook to determine if section may have unsafe pointers.
5679 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5680 method definition.
5681
5682 2010-06-21 Rafael Espindola <espindola@google.com>
5683
5684 * fileread.cc (Input_file::find_fie): New
5685 (Input_file::open): Use Input_file::find_fie.
5686 * fileread.h (Input_file::find_fie): New
5687 * plugin.cc (set_extra_library_path): New.
5688 (Plugin::load): Add set_extra_library_path to the transfer vector.
5689 (Plugin_manager::set_extra_library_path): New.
5690 (Plugin_manager::add_input_file): Use the extra search path if set.
5691 (set_extra_library_path(): New.
5692 * plugin.h (Plugin_manager): Add set_extra_library_path and
5693 extra_search_path_.
5694
5695 2010-06-19 Cary Coutant <ccoutant@google.com>
5696
5697 * layout.cc (gdb_sections): Add .debug_types.
5698 (lines_only_debug_sections): Likewise.
5699
5700 2010-06-18 Rafael Espindola <espindola@google.com>
5701
5702 * plugin.cc (add_input_file,add_input_library)
5703 (Plugin_manager::add_input_file): Make filename arguments const.
5704 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5705 const.
5706
5707 2010-06-16 Doug Kwan <dougkwan@google.com>
5708
5709 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5710 .ARM.attributes section if we have not merged any input
5711 attributes sections.
5712
5713 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5714
5715 * arm.cc: Allow combining objects with no EABI version
5716 information.
5717
5718 2010-06-15 Rafael Espindola <espindola@google.com>
5719
5720 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5721
5722 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5723
5724 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5725 (struct iovec): Correct !HAVE_READV definition.
5726
5727 2010-06-10 Cary Coutant <ccoutant@google.com>
5728
5729 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5730 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5731 reloc sections.
5732 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5733
5734 PR 11683
5735 * symtab.h (Symbol::is_placeholder): New member function.
5736 * target-reloc.h (relocate_section): Check for placeholder symbols.
5737
5738 * testsuite/Makefile.am (plugin_test_8): New test.
5739 (plugin_test_9): New test.
5740 * testsuite/Makefile.in: Regenerate.
5741
5742 2010-06-09 Nick Clifton <nickc@redhat.com>
5743
5744 * yyscript.y (input_list_element): Allow strings prefixed with
5745 the '-' character. Treat these as libraries.
5746 * script.cc (script_add_library): New function. Adds a library
5747 specified by "-l<name>" found in an input script.
5748 * script-c.h: Add prototype for script_add_library.
5749
5750 2010-06-07 Doug Kwan <dougkwan@google.com>
5751
5752 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5753 Restrict stub-group size to be within long conditional branch
5754 range when working around cortex-A8 erratum.
5755
5756 2010-06-07 Damien Diederen <dd@crosstwine.com>
5757
5758 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5759 #ifdef typo.
5760
5761 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5762
5763 PR gold/11658
5764 * output.cc
5765 (Output_section::Input_section_sort_entry::compare_section_ordering):
5766 Change to return non-zero correctly.
5767 (Output_section::Input_section_sort_section_order_index_compare
5768 ::operator()): Change to fix ambiguity in comparisons.
5769
5770 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5771
5772 * gold.h (is_wildcard_string): New function.
5773 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5774 (Layout::layout_eh_frame): Ditto.
5775 (Layout::find_section_order_index): New method.
5776 (Layout::read_layout_from_file): New method.
5777 * layout.h (Layout::find_section_order_index): New method.
5778 (Layout::read_layout_from_file): New method.
5779 (Layout::input_section_position_): New private member.
5780 (Layout::input_section_glob_): New private member.
5781 * main.cc (main): Call read_layout_from_file here.
5782 * options.h (--section-ordering-file): New option.
5783 * output.cc (Output_section::input_section_order_specified_): New
5784 member.
5785 (Output_section::Output_section): Initialize new member.
5786 (Output_section::add_input_section): Add new parameter.
5787 Keep input sections when --section-ordering-file is used.
5788 (Output_section::set_final_data_size): Sort input sections when
5789 section ordering file is specified.
5790 (Output_section::Input_section_sort_entry): Add new parameter.
5791 Check sorting type.
5792 (Output_section::Input_section_sort_entry::compare_section_ordering):
5793 New method.
5794 (Output_section::Input_section_sort_compare::operator()): Change to
5795 consider section_order_index.
5796 (Output_section::Input_section_sort_init_fini_compare::operator()):
5797 Change to consider section_order_index.
5798 (Output_section::Input_section_sort_section_order_index_compare
5799 ::operator()): New method.
5800 (Output_section::sort_attached_input_sections): Change to sort
5801 according to section order when specified.
5802 (Output_section::add_input_section<32, true>): Add new parameter.
5803 (Output_section::add_input_section<64, true>): Add new parameter.
5804 (Output_section::add_input_section<32, false>): Add new parameter.
5805 (Output_section::add_input_section<64, false>): Add new parameter.
5806 * output.h (Output_section::add_input_section): Add new parameter.
5807 (Output_section::input_section_order_specified): New
5808 method.
5809 (Output_section::set_input_section_order_specified): New method.
5810 (Input_section::Input_section): Initialize section_order_index_.
5811 (Input_section::section_order_index): New method.
5812 (Input_section::set_section_order_index): New method.
5813 (Input_section::section_order_index_): New member.
5814 (Input_section::Input_section_sort_section_order_index_compare): New
5815 struct.
5816 (Output_section::input_section_order_specified_): New member.
5817 * script-sections.cc (is_wildcard_string): Delete and move modified
5818 method to gold.h.
5819 (Output_section_element_input::Output_section_element_input): Modify
5820 call to is_wildcard_string.
5821 (Output_section_element_input::Input_section_pattern
5822 ::Input_section_pattern): Ditto.
5823 (Output_section_element_input::Output_section_element_input): Ditto.
5824 * testsuite/Makefile.am (final_layout): New test case.
5825 * testsuite/Makefile.in: Regenerate.
5826 * testsuite/final_layout.cc: New file.
5827 * testsuite/final_layout.sh: New file.
5828
5829 2010-06-01 Rafael Espindola <espindola@google.com>
5830
5831 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5832
5833 2010-06-01 Rafael Espindola <espindola@google.com>
5834
5835 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5836 visibility of symbols.
5837
5838 2010-05-27 Doug Kwan <dougkwan@google.com>
5839
5840 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5841 from start of output section instead of address for a local symbol
5842 in a merged or relaxed section when doing a relocatable link.
5843
5844 2010-05-26 Rafael Espindola <espindola@google.com>
5845
5846 PR 11604
5847 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5848 adding sections the garbage collector removed.
5849 * gold/testsuite/Makefile.am: Add test.
5850 * gold/testsuite/Makefile.in: Regenerate.
5851 * gold/testsuite/plugin_test_7.sh: New.
5852 * gold/testsuite/plugin_test_7_1.c: New.
5853 * gold/testsuite/plugin_test_7_2.c: New.
5854
5855 2010-05-26 Rafael Espindola <espindola@google.com>
5856
5857 * script-sections.cc (Output_section_definition::set_section_addresses):
5858 Check for --section-start.
5859
5860 2010-05-26 Doug Kwan <dougkwan@google.com>
5861
5862 * arm.cc (Arm_scan_relocatable_relocs): New class.
5863 (Target_arm::relocate_special_relocatable): New method.
5864 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5865 (Arm_relocate_functions::thumb_branch_common): Same.
5866 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5867 instead of Default_scan_relocatable_relocs.
5868 * target-reloc.h (relocate_for_relocatable): Let target handle
5869 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5870 * target.h (Sized_target::relocate_special_relocatable): New method.
5871
5872 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5873
5874 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5875
5876 2010-05-23 Doug Kwan <dougkwan@google.com>
5877
5878 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5879 instead of a cast.
5880 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5881 with a direct branch, not a conditional branch, to a stub.
5882 * merge.cc (Output_merge_base::record_input_section): New method
5883 defintion.
5884 (Output_merge_data::do_add_input_section): Record input section if
5885 keeps-input-sections flag is set.
5886 (Output_merge_string::do_add_input_section): Ditto.
5887 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5888 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5889 INPUT_SECTIONS_.
5890 (Output_merge_base::keeps_input_sections,
5891 Output_merge_base::set_keeps_input_sections,
5892 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5893 method definitions.
5894 (Output_merge_base::Input_sections): New type declaration.
5895 (Output_merge_base::input_sections_begin,
5896 Output_merge_base::input_sections_end,
5897 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5898 (Output_merge_base::bool keeps_input_sections_,
5899 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5900 Output_merge_base::input_sections_): New data members.
5901 (Output_merge_data::do_set_keeps_input_sections): New method
5902 defintion.
5903 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5904 * output.cc (Output_section::Input_section::relobj): Move method
5905 defintion from class declaration to here and handle merge sections.
5906 (Output_section::Input_section::shndx): Ditto.
5907 (Output_section::Output_section): Remove initializations of removed
5908 data members and initialize new data member LOOKUP_MAPS_.
5909 (Output_section::add_input_section): Set keeps-input-sections flag
5910 for a newly created merge output section as appropriate. Adjust code
5911 to use Output_section_lookup_maps class.
5912 (Output_section::add_relaxed_input_section): Adjst code for lookup
5913 maps code refactoring.
5914 (Output_section::add_merge_input_section): Add a new parameter
5915 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5916 class. If adding input section to a newly created merge output
5917 section fails, remove the new merge section.
5918 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5919 Adjust code for use of the Output_section_lookup_maps class.
5920 (Output_section::find_merge_section): Ditto.
5921 (Output_section::build_lookup_maps): New method defintion.
5922 (Output_section::find_relaxed_input_section): Adjust code to use
5923 Output_section_lookup_maps class.
5924 (Output_section::get_input_sections): Export merge sections. Adjust
5925 code to use Output_section_lookup_maps class.
5926 (Output_section:::add_script_input_section): Adjust code to use
5927 Output_section_lookup_maps class. Update lookup maps for merge
5928 sections also.
5929 (Output_section::discard_states): Use Output_section_lookup_maps.
5930 (Output_section::restore_states): Same.
5931 * output.h (Merge_section_properties): Move class defintion out of
5932 Output_section.
5933 (Output_section_lookup_maps): New class.
5934 (Output_section::Input_section::is_merge_section): New method
5935 defintion.
5936 (Output_section::Input_section::relobj): Move defintion out of class
5937 defintion. Declare method only.
5938 (Output_section::Input_section::shndx): Ditto.
5939 (Output_section::Input_section::output_merge_base): New method defintion.
5940 (Output_section::Input_section::u2_.pomb): New union field.
5941 (Output_section::Merge_section_by_properties_map,
5942 Output_section::Output_section_data_by_input_section_map,
5943 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5944 Remove types.
5945 (Output_section::add_merge_input_section): Add new parameter
5946 KEEPS_INPUT_SECTIONS.
5947 (Output_section::build_lookup_maps): New method declaration.
5948 (Output_section::merge_section_map_,
5949 Output_section::merge_section_by_properties_map_,
5950 Output_section::relaxed_input_section_map_,
5951 Output_section::is_relaxed_input_section_map_valid_): Remove data
5952 members.
5953 (Output_section::lookup_maps_): New data member.
5954
5955 2010-05-21 Doug Kwan <dougkwan@google.com>
5956
5957 PR gold/11619
5958 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5959 avoid a compilation error.
5960
5961 2010-05-19 Rafael Espindola <espindola@google.com>
5962
5963 * script-sections.cc (Output_section_definition::allocate_to_segment):
5964 Update the phdrs_list even when the output section is NULL.
5965 * testsuite/Makefile.am: Add test.
5966 * testsuite/Makefile.in: Regenerate.
5967 * testsuite/script_test_9.cc: New.
5968 * testsuite/script_test_9.sh: New.
5969 * testsuite/script_test_9.t: New.
5970
5971 2010-05-19 Doug Kwan <dougkwan@google.com>
5972
5973 * arm.cc (Arm_input_section::original_size): New method.
5974 (Arm_input_section::do_addralign): Add a cast.
5975 (Arm_input_section::do_output_offset): Remove static cast.
5976 (Arm_input_section::original_addralign,
5977 Arm_input_section::original_size_): Change type to uint32_t.
5978 (Arm_input_section::init): Add safe casts for section alignment
5979 and size.
5980 (Arm_input_section::set_final_data_size): Do not set address and
5981 offset of stub table.
5982 (Arm_output_section::fix_exidx_coverage): Change use of of
5983 Output_section::Simple_input_section to that of
5984 Output_section::Input_section.
5985 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5986 except for the first pass.
5987 * output.cc (Output_section::get_input_sections): Change type of
5988 input_sections to std::list<Input_section>.
5989 (Output_section::add_script_input_section): Rename from
5990 Output_section::add_simple_input_section. Change type of SIS
5991 parameter from Simple_input_section to Input_section.
5992 * output.h (Output_section::Simple_input_section): Remove class.
5993 (Output_section::Input_section): Change class visibility to public.
5994 (Output_section::Input_section::addralign): Use stored alignments
5995 for special input sections if set.
5996 (Output_section::Input_section::set_addralign): New method.
5997 (Output_section::get_input_sections): Change parameter type from
5998 list of Simple_input_section to list of Input_section.
5999 (Output_section::add_script_input_section): Rename from
6000 Output_section::add_simple_input_section. Change first parameter's
6001 type from Simple_input_section to Input_section and remove the
6002 second and third parameters.
6003 * script-sections.cc (Input_section::Input_section_list): Change
6004 type to list of Output_section::Input_section/
6005 (Input_section_info::Input_section_info): Change parameter type of
6006 INPUT_SECTION to Output_section::Input_section.
6007 (Input_section_info::input_section): Change return type.
6008 (Input_section_info::input_section_): Change type to
6009 Output_section::Input_section.
6010 (Output_section_element_input::set_section_addresses): Adjust code
6011 to use Output_section::Input_section instead of
6012 Output_section::Simple_input_section. Adjust code for renaming
6013 of Output_section::add_simple_input_section.
6014 (Orphan_output_section::set_section_addresses): Ditto.
6015
6016 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6017
6018 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6019 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6020
6021 2010-05-18 Rafael Espindola <espindola@google.com>
6022
6023 * options.cc (General_options::finalize): Handle -nostdlib.
6024 * options.h (nostdlib): New option.
6025 * script.cc (script_add_search_dir): Handle -nostdlib.
6026
6027 2010-05-12 Doug Kwan <dougkwan@google.com>
6028
6029 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6030 attributes section only if there no attributes section after merging.
6031 (Target_arm::merge_object_attributes): Move value of
6032 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
6033 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6034 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6035 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6036 and arm_attr_merge_7.stdout.
6037 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6038 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6039 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6040 arm_attr_merge_7b.o): New rules.
6041 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6042 arm_attr_merge_7
6043 * testsuite/Makefile.in: Regenerate.
6044 * testsuite/arm_attr_merge.sh: New file.
6045 * testsuite/arm_attr_merge_[67][ab].s: Same.
6046
6047 2010-05-05 Nick Clifton <nickc@redhat.com>
6048
6049 * po/es.po: Updated Spanish translation.
6050
6051 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6052
6053 * Makefile.am (install-exec-local): Properly install gold as
6054 default cross linker.
6055 * Makefile.in: Regenerated.
6056
6057 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6058 Nick Clifton <nickc@redhat.com>
6059
6060 * configure.ac (install_as_default): Define and set to false
6061 unless --enable-gold or --enable-gold=both/gold has been
6062 specified.
6063 * configure: Regenerate.
6064
6065 * Makefile.am (install-exec-local): Install the executable as
6066 'ld.gold'. If install_as_default is true then also install it as
6067 'ld'.
6068 * Makefile.in: Regenerated.
6069
6070 2010-04-24 Ian Lance Taylor <iant@google.com>
6071
6072 * layout.cc (Layout::layout_reloc): In relocatable link don't
6073 combine reloc sections for grouped sections.
6074
6075 2010-04-23 Sriraman Tallam <tmsriram@google.com>
6076
6077 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6078 sections that are not ordinary to icf.
6079 * icf.cc (get_section_contents): Handle relocation pointing to section
6080 with no object or shndx information.
6081 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6082 * testsuite/Makefile.in: Regenerate.
6083 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6084 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6085
6086 2010-04-22 Ian Lance Taylor <iant@google.com>
6087
6088 * expression.cc (Expression::Expression_eval_info): Add
6089 result_alignment_pointer field.
6090 (Expression::eval_with_dot): Add result_alignment_pointer
6091 parameter. Change all callers.
6092 (Expression::eval_maybe_dot): Likewise.
6093 (class Binary_expression): Add alignment_pointer parameter to
6094 left_value and right_value. Change all callers.
6095 (BINARY_EXPRESSION): Set result alignment.
6096 (class Trinary_expression): Add alignment_pointer parameter to
6097 arg2_value and arg3_value. Change all callers.
6098 (Trinary_cond::value): Set result alignment.
6099 (Max_expression::value, Min_expression::value): Likewise.
6100 (Align_expression::value): Likewise.
6101 * script-sections.cc (class Sections_element): Add dot_alignment
6102 parameter to set_section_addresses virtual function. Update
6103 instantiations.
6104 (class Output_section_element): Likewise.
6105 (Script_sections::create_segments): Add dot_alignment parameter.
6106 Change all callers.
6107 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6108 (Script_sections::set_phdrs_clause_addresses): Likewise.
6109 * script-sections.h: Update declarations.
6110 * script.h: Update declarations.
6111 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6112 min_p_align.
6113 * testsuite/script_test_3.t: Set large alignment.
6114 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6115 segment has expected alignment.
6116
6117 2010-04-22 Nick Clifton <nickc@redhat.com>
6118
6119 * po/gold.pot: Updated by the Translation project.
6120 * po/vi.po: Updated Vietnamese translation.
6121
6122 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6123
6124 * testsuite/Makefile.am (check_PROGRAMS): Add
6125 icf_virtual_function_folding_test.
6126 * testsuite/Makefile.in: Regenerated.
6127
6128 2010-04-15 Andrew Haley <aph@redhat.com>
6129
6130 * options.h (merge_exidx_entries): New option.
6131 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6132 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6133 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6134 (Target_arm::merge_exidx_entries): New function.
6135 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6136 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6137 to Arm_exidx_fixup constructor.
6138 Add new arg, merge_exidx_entries.
6139 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6140 Arm_output_section::fix_exidx_coverage.
6141
6142 2010-04-18 Sriraman Tallam <tmsriram@google.com>
6143
6144 * icf.cc (get_section_contents): Check for preemptible functions.
6145 Ignore addend when appropriate.
6146 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6147 section folded.
6148 (add_from_relobj): Check for section folded.
6149 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6150 * symtab.h (should_add_dynsym_entry): Add new parameter.
6151 * target-reloc.h (scan_relocs): Check for section folded.
6152 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6153 Check reloc types for function pointers in shared objects.
6154 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6155 case.
6156 (icf_preemptible_functions_test): New test case.
6157 (icf_string_merge_test): New test case.
6158 * testsuite.Makefile.in: Regenerate.
6159 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6160 bar_glob. Refactor code.
6161 * testsuite/icf_preemptible_functions_test.cc: New file.
6162 * testsuite/icf_preemptible_functions_test.sh: New file.
6163 * testsuite/icf_string_merge_test.cc: New file.
6164 * testsuite/icf_string_merge_test.sh: New file.
6165 * testsuite/icf_virtual_function_folding_test.cc: New file.
6166 * testsuite/icf_virtual_function_folding_test.sh: New file.
6167
6168 2010-04-14 Doug Kwan <dougkwan@google.com>
6169
6170 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6171 for local symbol recounting if we remove a section due to ICF.
6172 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6173 there are no regular objects in input.
6174
6175 2010-04-13 Doug Kwan <dougkwan@google.com>
6176
6177 * arm.cc (Arm_input_section::set_final_data_size): Compute
6178 accurate final data size instead of using current data size.
6179
6180 2010-04-09 Doug Kwan <dougkwan@google.com>
6181
6182 * layout.cc (Layout::choose_output_section): Handle script section
6183 types.
6184 (Layout::make_output_section_for_script): Add section type parameter.
6185 Handle script section types.
6186 * layout.h (Layout::make_output_section_for_script): Add section
6187 type parameter.
6188 * output.cc (Output_section::Output_section): Initialize data member
6189 is_noload_.
6190 (Output_section::do_reset_address_and_file_offset): Do not set address
6191 to 0 if section is a NOLOAD section.
6192 * output.h (Output_section::is_noload): New method.
6193 (Output_section::set_is_noload): Ditto.
6194 (Output_section::is_noload_): New data member.
6195 * script-c.h (Script_section_type): New enum type.
6196 (struct Parser_output_section_header): Add new file section_type.
6197 * script-sections.cc (Sections_element::output_section_name): Add
6198 parameter for returning script section type.
6199 (Output_section_definition::output_section_name): Ditto.
6200 (Output_section_definition::section_type)P; New method.
6201 (Output_section_definiton::script_section_type_name): Ditto.
6202 (Output_section_definition::script_section_type_): New data member.
6203 (Output_section_definition::Output_section_definition): Initialize
6204 data member Output_section_definition::script_section_type_.
6205 (Output_section_definition::create_sections): Pass script section type
6206 to Layout::make_output_section_for_script.
6207 (Output_section_definition::output_section_name): Return script
6208 section type to caller.
6209 (Output_section_definition::set_section_address): Do not advance
6210 dot value and load address if section type is NOLOAD. Set address
6211 of NOLOAD sections regardless of section flags.
6212 (Output_section_definition::print): Print section type if it is
6213 not SCRIPT_SECTION_TYPE_NONE.
6214 (Output_section_definition::section_type): New method.
6215 (Output_section_definition::script_section_type_name): Ditto.
6216 (Script_sections::output_section_name): Add new parameter
6217 PSECTION_TYPE for returning script section type. Pass it to
6218 section elements. Handle discard sections.
6219 (Sort_output_sections::operator()): Handle NOLOAD sections.
6220 * script-sections.h (Script_sections::Section_type): New enum type.
6221 (Script_sections::output_section_name): Add a new parameter for
6222 returning script section type.
6223 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6224 INFO and NOLOAD.
6225 * yyscript.y (union): Add new field SECTION_TYPE.
6226 (COPY, DSECT, INFO, NOLOAD): New tokens.
6227 (opt_address_and_section_type): Change type to output_section_header.
6228 (section_type): New non-terminal
6229 (section_header): Handle section type.
6230 (opt_address_and_section_type): Return section type value.
6231
6232 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6233
6234 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6235 * testsuite/plugin_common_test_2.c (foo): Likewise.
6236
6237 2010-04-08 Doug Kwan <dougkwan@google.com>
6238
6239 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6240 Output_merge_data.
6241 * output.cc (Output_section::add_merge_input_section): Simplify
6242 code and return status of Output_merge_base::add_input_section.
6243 Update merge section map only if Output_merge_base::add_input_section
6244 returns true.
6245
6246 2010-04-07 Doug Kwan <dougkwan@google.com>
6247
6248 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6249 if section is marked as containing instructions but has no mapping
6250 symbols.
6251 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6252 correct section index.
6253 (Arm_relobj::find_linked_text_section): Ditto.
6254
6255 2010-04-07 Cary Coutant <ccoutant@google.com>
6256
6257 * archive.cc (include_member): Destroy Read_symbols_data object before
6258 releasing file.
6259 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6260 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6261 (Read_symbols_data::~Read_symbols_data) New destructor.
6262 (Section_relocs::Section_relocs) New constructor.
6263 (Section_relocs::~Section_relocs) New destructor.
6264 (Read_relocs_data::Read_relocs_data) New constructor.
6265 (Read_relocs_data::~Read_relocs_data) New destructor.
6266 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6267 pointers to NULL after deleting.
6268
6269 2010-04-07 Doug Kwan <dougkwan@google.com>
6270
6271 * arm.cc: Replace "endianity" with "endianness" in comments.
6272 (Arm_exidx_cantunwind): Ditto.
6273 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6274 (Arm_relobj::merge_flags_and_attributes): New method.
6275 (Arm_relobj::merge_flags_and_attributes_): New data member.
6276 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6277 (Arm_relobj::scan_sections_for_stubs): Ditto.
6278 (Arm_relobj::do_read_symbols): Check to see if we really want to
6279 merge processor-specific flags and attributes. Exit early if
6280 an object is empty except for section names and the undefined symbol.
6281 (Target_arm::do_finalize_sections): Move check for ELF format to
6282 Arm_relobj::do_read_symbols. Merge processor specific flags and
6283 attributes from a regular object only when we have determined that
6284 it is aapropriate. Do not create an .ARM.attributes section in
6285 output if there is no regular input object.
6286 (Target_arm::merge_processor_specific_flags): Check
6287 --warn-mismatch before printing any error.
6288 (Target_arm::merge_object_attributes): Ditto.
6289 * gold.cc (queue_middle_tasks): Handle the case in which there is
6290 no regular object in input.
6291 * options.cc (General_options::parse_EB): New method.
6292 (General_options::parse_EL): Same.
6293 (General_options::General_options): Initialize endianness_.
6294 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6295 New options.
6296 (General_options::Endianness): New enum.
6297 (General_options::endianness): New method.
6298 (General_options::endianness_): New data member.
6299 * parameters.cc (Parameters::set_options): Check target endianness.
6300 (Parameters::set_target_once): Ditto.
6301 (Parameters::check_target_endianness): New method.
6302 (parameters_force_valid_target): If either -EL or -EB is specified,
6303 use it to define endianness of default target.
6304 * parameters.h (Parameters::check_target_endianness): New method
6305 declaration.
6306 * target.h (class Target): Change "endianity" to "endianness"
6307 in comments.
6308
6309 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6310
6311 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6312 * configure: Regenerate.
6313 * Makefile.in: Regenerate.
6314 * testsuite/Makefile.in: Regenerate.
6315
6316 2010-04-06 Cary Coutant <ccoutant@google.com>
6317
6318 gcc PR lto/42757
6319 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6320 prevailing definitions of common symbols.
6321 * testsuite/plugin_test_6.sh: New test case.
6322 * testsuite/plugin_common_test_1.c: New test case.
6323 * testsuite/plugin_common_test_2.c: New test case.
6324 * testsuite/Makefile.am (plugin_test_6): New test case.
6325 * testsuite/Makefile.in: Regenerate.
6326
6327 2010-04-06 Nick Clifton <nickc@redhat.com>
6328
6329 * po/vi.po: New Vietnamese translation.
6330
6331 2010-03-30 Doug Kwan <dougkwan@google.com>
6332
6333 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6334
6335 2010-03-25 Doug Kwan <dougkwan@google.com>
6336
6337 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6338 to avoid a conversion warning on a 32-bit host.
6339
6340 2010-03-24 Ian Lance Taylor <iant@google.com>
6341
6342 * testsuite/script_test_3.t: Add a TLS segment.
6343 * testsuite/Makefile.am (check_PROGRAMS): Add
6344 tls_phdrs_script_test.
6345 (tls_phdrs_script_test_SOURCES): Define.
6346 (tls_phdrs_script_test_DEPENDENCIES): Define.
6347 (tls_phdrs_script_test_LDFLAGS): Define.
6348 (tls_phdrs_script_test_LDADD): Define.
6349 * testsuite/Makefile.in: Rebuild.
6350
6351 2010-03-23 Cary Coutant <ccoutant@google.com>
6352
6353 * fileread.cc (find_or_make_view): Fix comment.
6354
6355 2010-03-23 Ian Lance Taylor <iant@google.com>
6356
6357 * script-sections.cc (class Orphan_section_placement): Define
6358 PLACE_TLS and PLACE_TLS_BSS.
6359 (Orphan_section_placement::Orphan_section_placement): Initialize
6360 new places.
6361 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6362 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6363 (tls_script_test_SOURCES): Define.
6364 (tls_script_test_DEPENDENCIES): Define.
6365 (tls_script_test_LDFLAGS): Define.
6366 (tls_script_test_LDADD): Define.
6367 * testsuite/Makefile.in: Rebuild.
6368
6369 2010-03-22 Doug Kwan <dougkwan@google.com>
6370
6371 * arm.cc (Arm_relocate_functions::abs8,
6372 Arm_relocate_functions::abs16): Use correct check for overflow
6373 specified in the ARM ELF specs.
6374 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6375 target of a BLX instruction specially.
6376 (Reloc_stub::stub_type_for_reloc): Ditto.
6377 (Relocate::relocate): Use symbolic names instead of numeric relocation
6378 codes to report error.
6379 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6380 workaround.
6381 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6382 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6383 thumb2_blx_out_of_range.stdout
6384 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6385 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6386 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6387 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6388 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6389 thumb2_blx_in_range, thumb2_blx_in_range.o,
6390 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6391 thumb2_blx_out_of_range.o): New rules.
6392 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
6393 thumb2_blx_in_range and thumb2_blx_out_of_range.
6394 * testsuite/Makefile.in: Regenerate.
6395 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6396 * testsuite/thumb_blx_in_range.s: New file.
6397 * testsuite/thumb_blx_out_of_range.s: New file.
6398
6399 2010-03-22 Rafael Espindola <espindola@google.com>
6400
6401 * archive.cc (Should_include): Move to archive.h.
6402 (should_include_member): Make it a member of Archive.
6403 (Lib_group): New.
6404 (Add_lib_group_symbols): New.
6405 * archive.h: Include options.h.
6406 (Archive_member): Moved from Archive.
6407 (Should_include): Moved from archive.cc.
6408 (Lib_group): New.
6409 (Add_lib_group_symbols): New.
6410 * dynobj.cc (do_should_include_member): New.
6411 * dynobj.h (do_should_include_member): New.
6412 * gold.cc (queue_initial_tasks): Update call to queue.
6413 * main.cc (main): Print lib group stats.
6414 * object.cc (do_should_include_member): New.
6415 * object.h: Include archive.h.
6416 (Object::should_include_member): New.
6417 (Object::do_should_include_member): New.
6418 (Sized_relobj::do_should_include_member): New.
6419 * options.cc (General_options::parse_start_lib): New.
6420 (General_options::parse_end_lib): New.
6421 (Input_arguments::add_file): Handle lib groups.
6422 (Input_arguments::start_group): Check we are not in a lib.
6423 (Input_arguments::start_lib): New.
6424 (Input_arguments::end_lib): New.
6425 * options.h (General_options): Add start_lib and end_lib.
6426 (Input_argument::lib_): New.
6427 (Input_argument::lib): New.
6428 (Input_argument::is_lib): New.
6429 (Input_file_lib): New.
6430 (Input_arguments::in_lib_): New.
6431 (Input_arguments::in_lib): New.
6432 (Input_arguments::start_lib): New.
6433 (Input_arguments::end_lib_): New.
6434 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6435 in unused members as preempted.
6436 (Sized_pluginobj::do_should_include_member): New.
6437 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6438 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6439 return the blocker.
6440 (Read_symbols::do_whole_lib_group): New.
6441 (Read_symbols::do_lib_group): New.
6442 (Read_symbols::do_read_symbols): Handle lib groups.
6443 (Read_symbols::get_name): Handle lib groups.
6444 * readsyms.h (Read_symbols): Add an archive member pointer.
6445 (Read_symbols::do_whole_lib_group): New.
6446 (Read_symbols::do_lib_group): New.
6447 (Read_symbols::member_): New.
6448 * script.cc (read_input_script): Update call to queue_soon.
6449
6450 2010-03-19 Doug Kwan <dougkwan@google.com>
6451
6452 * arm.cc (Stub_table::Stub_table): Initialize new data members
6453 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6454 (Stub_table::add_reloc_stub): Assign stub offset and update
6455 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6456 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6457 New data members.
6458 (Stub_table::update_data_size_and_addralign): Use
6459 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6460 instead of going over all reloc stubs.
6461 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
6462 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6463 Stringpool_template::offset_ to size of Stringpool_char.
6464 (Stringpool_template::new_key_offset): Remove code to initialize
6465 Stringpool_template::offset_.
6466 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6467 Stringpool_template::offset_ to zero.
6468
6469 2010-03-15 Doug Kwan <dougkwan@google.com>
6470
6471 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6472 offset_.
6473 (Stringpool_template::new_key_offset): New method.
6474 (Stringpool_template::add_string): Assign offsets when adding new
6475 strings.
6476 (Stringpool_template::set_string_offsets): Do not set string offsets
6477 when not optimizing.
6478 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6479 member size_.
6480 (Chunked_vector::clear): Clear size_.
6481 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6482 (Chunked_vector::size): Return size_.
6483 (Chunked_vector::push_back): Use size_ to find insert position.
6484 (Chunked_vector::size_): New data member.
6485 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6486 (Stringpool_template::new_key_offset): New method declaration.
6487 (Stringpool_template::offset_): New data member.
6488
6489 2010-03-15 Rafael Espindola <espindola@google.com>
6490
6491 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6492 Add_symbols' constructor.
6493 * readsyms.h (Add_symbols): Remove the input_group member.
6494
6495 2010-03-10 Ian Lance Taylor <iant@google.com>
6496
6497 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6498 target to ask whether a reference to a symbol requires a stack
6499 split.
6500 * target.h (Target::is_call_to_non_split): New function.
6501 (Target::do_is_call_to_non_split): Declare virtual function.
6502 * target.cc: Include "symtab.h".
6503 (Target::do_is_call_to_non_split): New function.
6504 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6505
6506 2010-03-10 Cary Coutant <ccoutant@google.com>
6507
6508 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6509 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6510 (File_read::open[2]): Add whole_file_view_ to list of views.
6511 (File_read::make_view): Remove test of whole_file_view_.
6512 (File_read::find_or_make_view): Create whole_file_view_ if
6513 necessary.
6514 (File_read::clear_views): Replace bool parameter with enum;
6515 adjust all callers. Don't delete views with permanent data;
6516 do delete cached views and views from archives if
6517 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6518 if clearing the corresponding view.
6519 * fileread.h (File_read::Clear_views_mode): New enum.
6520 (File_read::View::is_permanent_view): New method.
6521 (File_read::clear_views): Replace bool parameter
6522 with enum; adjust all callers.
6523 * options.h (General_options): Change keep_files_mapped option;
6524 add map_whole_files.
6525 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6526 releasing the file.
6527 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6528 the file.
6529
6530 2010-03-10 David S. Miller <davem@davemloft.net>
6531
6532 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6533
6534 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6535
6536 * icf.cc (get_section_contents): Add '@' marker after processing the
6537 merge reloc.
6538
6539 2010-03-08 Doug Kwan <dougkwan@google.com>
6540
6541 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6542 due to a conversion warning.
6543 (Arm_relobj::update_output_local_symbol_count): Check for local
6544 symbol with unset output index.
6545
6546 2010-03-05 Ian Lance Taylor <iant@google.com>
6547
6548 * options.h (class General_options): Add --spare-dynamic-tags.
6549 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6550 --spare-dynamic-tags.
6551
6552 2010-03-05 Ian Lance Taylor <iant@google.com>
6553
6554 * incremental.cc: Include "libiberty.h".
6555
6556 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6557
6558 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6559 function, is_info_ member.
6560 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6561 (Versions::Versions): Update caller.
6562 (Versions::define_base_version): Likewise.
6563 (Versions::add_def): Likewise.
6564
6565 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6566
6567 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6568 (Scan::possible_function_pointer_reloc): New function.
6569 (Scan::local_reloc_may_be_function_pointer): Change to call
6570 possible_function_pointer_reloc.
6571 (Scan::global_reloc_may_be_function_pointer): Ditto.
6572 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6573 relocations in ".data.rel.ro._ZTV" section.
6574 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6575 * testsuite/icf_safe_so_test.cc: Ditto.
6576 * testsuite/icf_safe_test.cc: Ditto.
6577 * testsuite/icf_safe_test.sh: Ditto.
6578
6579 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6580 Ian Lance Taylor <iant@google.com>
6581
6582 * target-reloc.h (relocate_section): Check the symbol table index
6583 for -1U before setting the local symbol index.
6584 (scan_relocatable_relocs): If copying the relocation, record that
6585 the local symbol is required.
6586 * object.h (Symbol_value::is_output_symtab_index_set): New
6587 function.
6588 (Symbol_value::may_be_discarded_from_output_symtab): New
6589 function.
6590 (Symbol_value::has_output_symtab_entry): New function.
6591 (Symbol_value::needs_output_symtab_entry): Remove.
6592 (Symbol_value::output_symtab_index): Make sure the symbol index is
6593 set.
6594 (Symbol_value::set_output_symtab_index): Make sure the symbol
6595 index is not set. Make sure the new index is valid.
6596 (Symbol_value::set_must_have_output_symtab_entry): New function.
6597 (Symbol_value::has_output_dynsym_entry): New function.
6598 (Symbol_value::set_output_dynsym_index): Make sure the new index
6599 is valid.
6600 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6601 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6602 local symbol if permitted.
6603 (Sized_relobj::do_finalize_local_symbols): Call
6604 is_output_symtab_index_set rather than needs_output_symtab_entry.
6605 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6606 rather than needs_output_symtab_entry. Call
6607 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6608 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6609 is_output_symtab_index_set rather than needs_output_symtab_entry.
6610 * testsuite/discard_locals_relocatable_test.c: New file.
6611 * testsuite/discard_locals_test.sh: Test -r.
6612 * testsuite/Makefile.am (check_DATA): Add
6613 discard_locals_relocatable_test1.syms,
6614 discard_local_relocatable_test2.syms.
6615 (MOSTLYCLEANFILES): Likewise. Also add
6616 discard_locals_relocatable_test1.lout and
6617 discard_locals_relocatable_test2.out.
6618 (discard_locals_relocatable_test1.syms): New target.
6619 (discard_locals_relocatable_test.o): New target.
6620 (discard_locals_relocatable_test1.out): New target.
6621 (discard_locals_relocatable_test2.syms): New target.
6622 (discard_locals_relocatable_test2.out): New target.
6623 (various): Add missing ../ld-new dependencies.
6624 * testsuite/Makefile.in: Rebuild.
6625
6626 2010-03-03 Nick Clifton <nickc@redhat.com>
6627
6628 * po/fi.po: New Finnish translation.
6629
6630 2010-03-01 Doug Kwan <dougkwan@google.com>
6631
6632 * layout.cc (Layout::Layout): Force section types of .init_array*,
6633 .preinit_array* and .fini_array* sections.
6634 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6635 Fix check of return value of std::string::find.().
6636 (Output_section::Input_section_sort_compare::operator()): Remove
6637 comment about .init_array.
6638 (Output_section::Input_section_sort_init_fini_compare::operator()):
6639 New method.
6640 (Output_section::sort_attached_input_sections): Handle .init_array
6641 and .fini_array specially.
6642 * output.h (Output_section::Inut_section_sort_compare): Update
6643 comment.
6644 (Output_section::Input_section_sort_init_fini_compare): New struct.
6645
6646 2010-02-26 Doug Kwan <dougkwan@google.com>
6647
6648 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6649 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6650 * testsuite/debug_msg.sh: Avoid matching source line number for
6651 use of global variable undef_int.
6652
6653 2010-02-26 Doug Kwan <dougkwan@google.com>
6654
6655 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6656 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6657 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6658 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6659 * options.cc (General_options::General_options): Initialize member
6660 fix_v4bx_.
6661 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6662 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6663 and rm_no_fix_v4bx.stdout
6664 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6665 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6666 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6667 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6668 and arm_no_fix_v4bx.
6669 * Makefile.in: Regenerate.
6670 * testsuite/arm_fix_v4bx.s: New file.
6671 * testsuite/arm_fix_v4bx.sh: Ditto.
6672
6673 2010-02-24 Doug Kwan <dougkwan@google.com>
6674
6675 * arm.cc (Target_arm::got_section): Make the .got section the first
6676 non RELRO section in the data segment.
6677 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6678 suffixes of section names.
6679
6680 2010-02-24 Doug Kwan <dougkwan@google.com>
6681
6682 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6683 flags and attributes merging if an input file is a binary file.
6684 * fileread.cc (Input_file::open): Record format of original file.
6685 * fileread.h (Input_file::Format): New enum type.
6686 (Input_file::Input_file): Initialize data member format_.
6687 (Input_file::format): New method definition.
6688 (Input_file::format_):: New data member.
6689
6690 2010-02-24 Doug Kwan <dougkwan@google.com>
6691
6692 * arm.cc (Arm_output_data_got): New class.
6693 (ARM_TCB_SIZE): New constant
6694 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6695 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6696 If user uses a script with a SECTIONS clause, issue only a warning
6697 for a misplaced EXIDX input section. Otherwise, issue an error.
6698 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6699 garbage collection.
6700 (Target_arm::got_mode_index_entry): Handle static linking.
6701 (Target_arm::Scan::local): Ditto.
6702 (Target_arm::Scan::global): Ditto.
6703 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6704 all incorrectly implemented relocations.
6705 (Target_arm::fix_exidx_coverage): Pass layout to
6706 Arm_output_section::fix_exidx_coverage.
6707 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6708 from ".ARM.exidx." and ".ARM.extab.".
6709
6710 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6711
6712 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6713 section if it does not already exist.
6714 * attributes.cc (Attributes_section_data::Attributes_section_data):
6715 Don't crash if size is zero.
6716
6717 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6718 Ian Lance Taylor <iant@google.com>
6719
6720 * gold.cc (queue_middle_tasks): If no input files were opened,
6721 exit.
6722 * workqueue.h (Task_function::Task_function): Assert that there is
6723 a blocker.
6724
6725 2010-02-22 Doug Kwan <dougkwan@google.com>
6726
6727 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6728 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6729 types to avoid warnings due to different uint64_t implementations
6730 on different hosts.
6731
6732 2010-02-21 Doug Kwan <dougkwan@google.com>
6733
6734 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6735 handling of the maximum backward branch offset.
6736 (Arm_relocate_functions::thumb_branch_common): Ditto.
6737 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6738 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6739 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6740 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6741 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6742 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6743 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6744 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6745 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6746 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6747 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6748 thumb2_bl_out_of_range.o): New rules.
6749 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6750 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6751 thumb2_bl_out_of_range
6752 * testsuite/Makefile.in: Regenerate.
6753 * testsuite/arm_bl_in_range.s: New file.
6754 * testsuite/arm_bl_out_of_range.s: Ditto.
6755 * testsuite/arm_branch_in_range.sh: Ditto.
6756 * testsuite/arm_branch_range.t: Ditto.
6757 * testsuite/thumb2_branch_range.t: Ditto.
6758 * testsuite/thumb_bl_in_range.s: Ditto.
6759 * testsuite/thumb_bl_out_of_range.s: Ditto.
6760 * testsuite/thumb_branch_range.t: Ditto.
6761
6762 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6763
6764 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6765 Add reloc offset information.
6766 * icf.cc (get_section_contents): Change iterators to point to the new
6767 vectors. Add reloc offset information to the contents.
6768 * icf.h (Icf::Sections_reachable_info): New typedef.
6769 (Icf::Sections_reachable_list): New typedef.
6770 (Icf::Offset_info): New typedef.
6771 (Icf::Reloc_info): New struct typedef.
6772 (Icf::Reloc_info_list): New typedef.
6773 (Icf::symbol_reloc_list): Delete method.
6774 (Icf::addend_reloc_list): Delete method.
6775 (Icf::section_reloc_list): Delete method.
6776 (Icf::reloc_info_list): New method.
6777 (Icf::reloc_info_list_): New member.
6778
6779 2010-02-19 Doug Kwan <dougkwan@google.com>
6780
6781 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6782 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6783 * arm.cc (Arm_relocation_functions): New forward declaration.
6784 (Target_arm::Target_arm): Initialize new data members
6785 got_mod_index_offset_ and tls_base_symbol_defined_.
6786 (Target_arm::Relocate::relocate_tls): New method.
6787 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6788 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6789 New methods.
6790 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6791 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6792 (Target_arm::got_mod_index_offset_,
6793 Target_arm::tls_base_symbol_defined_): New data members.
6794 (Target_arm::Scan::local, Target::Scan::global,
6795 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6796 relocations.
6797
6798 2010-02-18 Doug Kwan <dougkwan@google.com>
6799
6800 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6801 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6802 text section as a parameter becuase some broken tools may not set
6803 the link in section header.
6804 (Target_arm::has_got_section): New method.
6805 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6806 without any mapping symbol as data only. Remove warning.
6807 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6808 link in its section header, try to discover the link by inspecting the
6809 REL31 relocation at the beginning of the section.
6810 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6811 in error message.
6812 (Target_arm::Scan::global): Treat any reference to the symbol
6813 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6814
6815 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6816
6817 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6818 (Scan::global_reloc_may_be_function_pointer): New function.
6819 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6820 (Scan::global_reloc_may_be_function_pointer): New function.
6821 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6822 (Scan::global_reloc_may_be_function_pointer): New function.
6823 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6824 (Scan::global_reloc_may_be_function_pointer): New function.
6825 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6826 (Scan::global_reloc_may_be_function_pointer): New function.
6827 (Scan::possible_function_pointer_reloc): New function.
6828 (Target_x86_64::can_check_for_function_pointers): New function.
6829 * gc.h (gc_process_relocs): Scan relocation types to determine if
6830 function pointers were taken for targets that support it.
6831 * icf.cc (Icf::find_identical_sections): Include functions for
6832 folding in safe ICF whose pointer is not taken.
6833 * icf.h (Secn_fptr_taken_set): New typedef.
6834 (fptr_section_id_): New member.
6835 (section_has_function_pointers): New function.
6836 (set_section_has_function_pointers): New function.
6837 (check_section_for_function_pointers): New function.
6838 * options.h: Fix comment for safe ICF option.
6839 * target.h (can_check_for_function_pointers): New function.
6840 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6841 Modify icf_safe_test for X86-64.
6842 * testsuite/Makefile.in: Regenerate.
6843 * testsuite/icf_safe_so_test.cc: New file.
6844 * testsuite/icf_safe_so_test.sh: New file.
6845 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6846 (main): Change to take pointer to function kept_func_3.
6847 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6848 folding is done correctly for X86-64.
6849
6850 2010-02-12 David S. Miller <davem@davemloft.net>
6851
6852 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6853 is_symbolless parameter.
6854 (Output_reloc<SHT_REL>::is_symbolless): New.
6855 (Output_reloc<SHT_REL>::is_symbolless_): New.
6856 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6857 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6858 (Output_reloc<SHT_RELA>::is_symbolless): New.
6859 (Output_data_reloc::add_global): Handle is_symbolless.
6860 (Output_data_reloc::add_global_relative): Likewise.
6861 (Output_data_reloc::add_local): Likewise.
6862 (Output_data_reloc::add_local_relative): Likewise.
6863 (Output_data_reloc::add_symbolless_global_addend): New.
6864 (Output_data_reloc::add_symbolless_local_addend): New.
6865 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6866 is_symbolless.
6867 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6868 instead of ->is_relative_
6869 (Output_reloc::write): Likewise.
6870 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6871 (Output_reloc::write_rel): Simplify.
6872
6873 * sparc.cc (Target_sparc::Scan::local): Use
6874 ->add_symbolless_local_addend as needed.
6875 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6876 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6877 based upon relocation offset.
6878
6879 2010-02-11 Doug Kwan <dougkwan@google.com>
6880
6881 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6882 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6883 beginning of function.
6884 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6885 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6886 parameter is_32bit in calls to should_apply_static_reloc.
6887 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6888 (check_DATA): Add arm_abs_global.stdout.
6889 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6890 arm_abs_global.stdout): New rules.
6891 (MOSTLLYCLEANFILES): Add arm_abs_global
6892 * Makefile.in: Regenerate.
6893 * testsuite/arm_abs_global.s: New file.
6894 * testsuite/arm_abs_global.sh: Ditto.
6895 * testsuite/arm_abs_lib.s: Ditto.
6896
6897 2010-02-11 Ian Lance Taylor <iant@google.com>
6898
6899 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6900 Read_relocs task.
6901 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6902 Allocate_commons_task first.
6903 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6904 task, rather than symtab_lock_.
6905 (Gc_process_relocs::~Gc_process_relocs): New function.
6906 (Gc_process_relocs::is_runnable): Check this_blocker_.
6907 (Gc_process_relocs::locks): Use next_blocker_ rather than
6908 blocker_.
6909 (Scan_relocs::~Scan_relocs): New function.
6910 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6911 symtab_lock_.
6912 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6913 next_blocker_.
6914 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6915 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6916 constructor accordingly.
6917 (class Gc_process_relocs): Likewise.
6918 (class Scan_relocs): Likewise.
6919 * common.h (class Allocate_commons_task): Remove symtab_lock_
6920 field, and corresponding constructor parameter.
6921 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6922 symtab_lock_.
6923 (Allocate_commons_task::locks): Likewise.
6924
6925 2010-02-11 Ian Lance Taylor <iant@google.com>
6926
6927 * gold-threads.h (class Once): Define.
6928 (class Initialize_lock): Rewrite as child of Once.
6929 * gold-threads.cc (class Once_initialize): Define.
6930 (once_pointer_control): New static variable.
6931 (once_pointer, once_arg): New static variables.
6932 (c_run_once): New static function.
6933 (Once::Once, Once::run_once, Once::internal_run): New functions.
6934 (class Initialize_lock_once): Remove.
6935 (initialize_lock_control): Remove.
6936 (initialize_lock_pointer): Remove.
6937 (initialize_lock_once): Remove.
6938 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6939 (Initialize_lock::initialize): Rewrite.
6940 (Initialize_lock::do_run_once): New function.
6941 * archive.cc (Archive::interpret_header): Only clear name if it is
6942 not already empty.
6943 * fileread.cc: Include "gold-threads.h"
6944 (file_counts_lock): New static variable.
6945 (file_counts_initialize_lock): Likewise.
6946 (File_read::release): Only increment counts when using --stats.
6947 Use a lock around the increment.
6948 * parameters.cc (class Set_parameters_target_once): Define.
6949 (set_parameters_target_once): New static variable.
6950 (Parameters::Parameters): Move here from parameters.h.
6951 (Parameters::set_target): Rewrite.
6952 (Parameters::set_target_once): New function.
6953 (Parameters::clear_target): Move here and rewrite.
6954 * parameters.h (class Parameters): Update declarations. Add
6955 set_parameters_target_once_ field.
6956 (Parameters::Parameters): Move to parameters.cc.
6957 (Parameters::clear_target): Likewise.
6958 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6959 task.
6960 (Start_group::~Start_group): New function.
6961 (Start_group::is_runnable): New function.
6962 (Start_group::locks, Start_group::run): New functions.
6963 (Finish_group::run): Change saw_undefined to size_t.
6964 * readsyms.h (class Start_group): Define.
6965 (class Finish_group): Change saw_undefined_ field to size_t.
6966 (Finish_group::Finish_group): Remove saw_undefined and
6967 this_blocker parameters. Change all callers.
6968 (Finish_group::set_saw_undefined): New function.
6969 (Finish_group::set_blocker): New function.
6970 * symtab.h (class Symbol_table): Change saw_undefined to return
6971 size_t. Change saw_undefined_ field to size_t.
6972 * target-select.cc (Set_target_once::do_run_once): New function.
6973 (Target_selector::Target_selector): Initialize set_target_once_
6974 field. Don't initialize lock_ and initialize_lock_ fields.
6975 (Target_selector::instantiate_target): Rewrite.
6976 (Target_selector::set_target): New function.
6977 * target-select.h (class Set_target_once): Define.
6978 (class Target_selector): Update declarations. Make
6979 Set_target_once a friend. Remove lock_ and initialize_lock_
6980 fields. Add set_target_once_ field.
6981
6982 2010-02-10 Ian Lance Taylor <iant@google.com>
6983
6984 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6985 queueing any tasks.
6986 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6987 (queue_middle_tasks): Add all blockers before queueing any tasks.
6988 (queue_final_tasks): Likewise.
6989 * token.h (Task_token::add_blockers): New function.
6990 * object.h (Input_objects::number_of_relobjs): New function.
6991
6992 2010-02-10 Ian Lance Taylor <iant@google.com>
6993
6994 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6995 shared, not if not position independent.
6996 * x86_64.cc (Relocate::relocate_tls): Likewise.
6997 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6998 (tls_pie_pic_test): New target.
6999 * testsuite/Makefile.in: Rebuild.
7000
7001 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7002 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7003 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7004 * testsuite/Makefile.in: Rebuild.
7005
7006 2010-02-09 David S. Miller <davem@davemloft.net>
7007
7008 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7009 R_SPARC_RELATIVE using ->add_local_relative().
7010 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7011
7012 * output.h (Output_data_dynamic::add_section_size): New method
7013 that takes two Output_data objects.
7014 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7015 entry param. Handle it in initializers.
7016 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7017 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7018 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7019 arg.
7020 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7021 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7022 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7023 for dynrel_includes_plt.
7024 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7025 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7026 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7027 before .rela.plt
7028 (Target_sparc::do_finalize_sections): Update to pass true for
7029 dynrel_includes_plt.
7030 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7031 output before .rela.plt
7032 (Target_powerpc::do_finalize_sections): Update to pass true for
7033 dynrel_includes_plt when 32-bit.
7034
7035 2010-02-08 Doug Kwan <dougkwan@google.com>
7036
7037 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7038 method.
7039 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7040 Arm_relobj::scan_section_for_cortex_a8_stubs,
7041 Arm_relobj::do_relocation_section): Instead of calling
7042 Output_section::output_address, use faster
7043 Arm_relobj::simple_input_section_output_address.
7044
7045 2010-02-08 David S. Miller <davem@davemloft.net>
7046
7047 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7048 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7049 relocation helper function.
7050
7051 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7052 just like R_SPARC_GOT{10,13,22}.
7053 (Target_sparc::Scan::local): Likewise.
7054 (Target_sparc::Relocate:relocate): Likewise.
7055
7056 2010-02-06 Ian Lance Taylor <iant@google.com>
7057
7058 * configure.ac: Rewrite targetobjs duplicate removal code to use
7059 only shell constructs.
7060 * configure: Rebuild.
7061
7062 2010-02-05 Doug Kwan <dougkwan@google.com>
7063
7064 PR 11247
7065 * arm.cc (Arm_relobj::section_is_scannable): New method.
7066 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7067 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7068
7069 2010-02-04 Doug Kwan <dougkwan@google.com>
7070
7071 PR 11247
7072 * arm-reloc-property.cc (cstdio): Include.
7073 * configure.ac (targetobjs): Remove duplicates.
7074 * configure: Regenerate.
7075 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7076 big and little endian version for a given address size.
7077
7078 2010-02-03 Doug Kwan <dougkwan@google.com>
7079
7080 * arm-reloc-property.cc
7081 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7082 definition.
7083 * arm-reloc-property.h
7084 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7085 New method definition.
7086 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7087 declaration.
7088 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7089 overflow to N.
7090 (GOT_PREL): Change implemented to Y.
7091 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7092 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7093 (Arm_relocate_functions::movw_abs_nc): Remove method.
7094 (Arm_relocate_functions::movt_abs): Ditto.
7095 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7096 (Arm_relocate_functions::thm_movt_abs): Ditto.
7097 (Arm_relocate_functions::movw_rel_nc): Ditto.
7098 (Arm_relocate_functions::movw_rel): Ditto.
7099 (Arm_relocate_functions::movt_rel): Ditto.
7100 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7101 (Arm_relocate_functions:thm_movw_rel): Ditto.
7102 (Arm_relocate_functions:thm_movt_rel): Ditto.
7103 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7104 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7105 New method definitions.
7106 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7107 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7108 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7109 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7110 (Target_arm::Relocate::relocate): Check for non-static or
7111 unimplemented relocation code and exit early. Change calls to
7112 Target_arm::reloc_uses_thumb_bit and
7113 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7114 instead. Refactor code to handle similar relocations to increase
7115 code sharing. Remove check for unsupported relocation code in switch
7116 statement.
7117 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7118 relocation property table to find out size. Change error message to
7119 print out the name of a relocation code instead of the numeric value.
7120 (Target_arm::scan_reloc_for_stub): Use relocation property table
7121 instead of calling Target_arm::reloc_uses_thumb_bit().
7122
7123 2010-02-02 Doug Kwan <dougkwan@google.com>
7124
7125 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7126 types of relaxed input section.
7127
7128 2010-02-02 Doug Kwan <dougkwan@google.com>
7129
7130 * Makefile.am (HFILES): Add arm-reloc-property.h.
7131 (DEFFILES): New.
7132 (TARGETSOURCES): Add arm-reloc-property.cc
7133 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
7134 (libgold_a_SOURCES): $(DEFFILES)
7135 * Makefile.in: Regenerate.
7136 * arm-reloc-property.cc: New file.
7137 * arm-reloc-property.h: New file.
7138 * arm-reloc.def: New file.
7139 * arm.cc: Update comments.
7140 (arm-reloc-property.h): New included header.
7141 (arm_reloc_property_table): New global variable.
7142 (Target_arm::do_select_as_default_target): New method definition.
7143 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7144 arm-reloc-property to targ_extra_obj.
7145 * parameters.cc (set_parameters_target): Call
7146 Target::select_as_default_target().
7147 * target.h (Target::select_as_default_target): New method definition.
7148 (Target::do_select_as_default_target): Same.
7149
7150 2010-02-01 Doug Kwan <dougkwan@google.com>
7151
7152 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7153 first_output_text_section_.
7154 (Arm_exidx_fixup::first_output_text_section): New method definition.
7155 (Arm_exidx_fixup::first_output_text_section_): New data member.
7156 (Arm_exidx_fixup::process_exidx_section): Record the first text
7157 output section seen.
7158 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7159 and entsize in output section header.
7160
7161 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7162
7163 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7164 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7165 (Arm_relocate_functions::thm_alu11): New Method.
7166 (Arm_relocate_functions::thm_pc8): New Method.
7167 (Arm_relocate_functions::thm_pc12): New Method.
7168 (Target_arm::Scan::local): Handle the relocations.
7169 (Target_arm::Scan::global): Likewise.
7170 (Target_arm::Relocate::relocate): Likewise.
7171 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7172
7173 2010-01-29 Doug Kwan <dougkwan@google.com>
7174
7175 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7176 of relocation types as ld.
7177
7178 2010-01-29 Doug Kwan <dougkwan@google.com>
7179
7180 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7181 to public.
7182 (Arm_relocate_functions::thumb_branch_common): Ditto.
7183 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7184 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7185 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7186 Arm_relocate_functions::jump24): Remove.
7187 (Target_arm::Relocate::relocate): Adjust code to call
7188 Arm_relocation_functions::arm_branch_common and
7189 Arm_relocation_functions::thumb_branch_common instead of their removed
7190 wrappers. Merge switch-cases together to reduce source code size.
7191
7192 2010-01-29 Doug Kwan <dougkwan@google.com>
7193
7194 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7195 output_local_symbol_count_needs_update_.
7196 (Arm_relobj::output_local_symbol_count_needs_update,
7197 Arm_relobj::set_output_local_symbol_count_needs_update,
7198 Arm_relobj::update_output_local_symbol_count): New methods.
7199 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7200 member.
7201 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7202 of pointed function as in a R_ARM_PREL31 relocation.
7203 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7204 for output local symbol count updating.
7205 (Target_arm::do_relax): Update output local symbol counts in objects
7206 if necessary.
7207 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7208
7209 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7210
7211 * arm.cc: Added support for the ARM relocations:
7212 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7213 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7214 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7215 movw_prel_nc).
7216 (Arm_relocate_functions::movw_rel): New method.
7217 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7218 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7219 thm_movw_prel_nc).
7220 (Arm_relocate_functions::thm_movw_rel): New method.
7221 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7222 thm_movt_prel).
7223 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7224 relocations.
7225 (Target_arm::Scan::global): Likewise.
7226 (Target_arm::Relocate::relocate): Likewise.
7227 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7228 Likewise.
7229
7230 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7231
7232 * arm.cc: Added support for ARM group relocations.
7233 (Target_arm::reloc_needs_sym_origin): New method.
7234 (Arm_relocate_functions::calc_grp_kn): New method.
7235 (Arm_relocate_functions::calc_grp_residual): New method.
7236 (Arm_relocate_functions::calc_grp_gn): New method.
7237 (Arm_relocate_functions::arm_grp_alu): New Method.
7238 (Arm_relocate_functions::arm_grp_ldr): New Method.
7239 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7240 (Arm_relocate_functions::arm_grp_ldc): New Method.
7241 (Target_arm::Scan::local): Handle the ARM group relocations.
7242 (Target_arm::Scan::global): Likewise.
7243 (Target_arm::Relocate::relocate): Likewise.
7244 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7245 Likewise.
7246
7247 2010-01-26 Doug Kwan <dougkwan@google.com>
7248
7249 * arm.cc (set): Include.
7250 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7251 pointer type.
7252 (Arm_output_section::Text_section_list): New type.
7253 (Arm_output_section::append_text_sections_to_list): New method.
7254 (Arm_output_section::fix_exidx_coverage): Ditto.
7255 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
7256 (Arm_relobj::convert_input_section_to_relaxed_section): Use
7257 Relobj::set_section_offset() instead of
7258 Sized_relobj::invalidate_section_offset().
7259 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
7260 parameter for section headers. Ignore relocation sections for
7261 unallocated sections and EXIDX sections.
7262 (Target_arm::fix_exidx_coverage): New method.
7263 (Target_arm::output_section_address_less_than): New type.
7264 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7265 linked text section instead of the EXIDX section.
7266 (Arm_output_section::create_stub_group): Add an assertion to check
7267 that this is not an EXIDX output section.
7268 (Arm_output_section::append_text_sections_to_list): New method.
7269 (Arm_output_section::fix_exidx_coverage): Ditto.
7270 (Arm_relobj::scan_sections_for_stubs): Adjust call to
7271 Arm_relobj::section_needs_reloc_stub_scanning.
7272 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7273 first pass.
7274 (Target_arm::fix_exidx_coverage): New method.
7275 * object.h (Relobj::set_output_section): New method.
7276 (Sized_relobj::invalidate_section_offset): Remove method.
7277 (Sized_relobj::do_invalidate_section_offset): Remove method.
7278 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7279
7280 2010-01-25 Doug Kwan <dougkwan@google.com>
7281
7282 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7283 Fix warning due to signed and unsigned comparison on a 32-bit host.
7284
7285 2010-01-22 Doug Kwan <dougkwan@google.com>
7286
7287 * arm.cc (Target_arm::do_relax): Record an output section for section
7288 offset adjustment it contains any stub table that has changed.
7289 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7290 offsets in an output section if necessary.
7291 * output.cc (Output_section::Output_section): Initialize
7292 section_offsets_need_adjustments_.
7293 (Output_section::add_input_section_for_script): Renamed to
7294 Output_section::add_simple_input_section.
7295 (Output_section::save_states): Add a comment.
7296 (Output_section::discard_states): New method defintion.
7297 (Output_section::adjust_section_offsets): Same.
7298 * output.h (Output_section::add_input_section_for_script): Renamed to
7299 Output_section::add_simple_input_section.
7300 (Output_section::discard_states): New method declaration.
7301 (Output_section::adjust_section_offsets): Same.
7302 (Output_section::section_offsets_need_adjustment,
7303 Output_section::set_section_offsets_need_adjustment): New method
7304 definitions.
7305 (Output_section::section_offsets_need_adjustment_): New data member.
7306 * script-sections.cc
7307 (Output_section_element_input::set_section_address): Adjust code for
7308 renaming of Output_section::add_input_section_for_script.
7309 (Orphan_output_section::set_section_address): Same.
7310
7311 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7312
7313 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7314 Fix_v4bx enum values .
7315 * gold/options.h (General_options): New option definitions.
7316 (General_options::fix_v4bx): New method.
7317 (General_options::Fix_v4bx): New enum.
7318 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7319 (General_options::parse_fix_v4bx_interworking): New method.
7320
7321 2010-01-22 Doug Kwan <dougkwan@google.com>
7322
7323 * arm.cc (Arm_exidx_fixup): New class.
7324
7325 2010-01-21 Doug Kwan <dougkwan@google.com>
7326
7327 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7328 classes.
7329 (Arm_exidx_section_offset_map): New type.
7330
7331 2010-01-21 Doug Kwan <dougkwan@google.com>
7332
7333 * arm.cc (Arm_exidx_input_section): New class.
7334 (Arm_relobj::exidx_input_section_by_link,
7335 Arm_relobj::exidx_input_section_by_shndx,
7336 Arm_relobj::make_exidx_input_section): New methods.
7337 (read_arm_attributes_section): Remove.
7338 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7339 information about them.
7340 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7341 to here.
7342
7343 2010-01-20 Doug Kwan <dougkwan@google.com>
7344
7345 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7346 Input_section_specifier to Section_id.
7347 (Target_arm::new_arm_input_section: Adjust code for change of key
7348 type.
7349 (Target_arm::find_arm_input_section): Ditto.
7350 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7351 (Section_id): Remove.
7352 (Garbage_collection::Section_id_hash): Remove.
7353 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7354 (Section_id): Remove.
7355 (Icf::Section_id_hash): Remove.
7356 * object.h (Section_id, Const_section_id, Section_id_hash,
7357 Const_section_id_hash): New type definitions.
7358 * output.cc (Output_section::add_relaxed_input_section): Change to
7359 use Const_section_id instead of Input_section_specifier as key type.
7360 (Output_section::add_merge_input_section): Ditto.
7361 (Output_section::build_relaxation_map): Change to use Section_id
7362 instead of Input_section_specifier as key type.
7363 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7364 Ditto.
7365 (Output_section::convert_input_sections_to_relaxed_sections): Change
7366 to use Const_section_id instead of Input_section_specifier as key type.
7367 (Output_section::find_merge_section): Ditto.
7368 (Output_section::find_relaxed_input_section): Ditto.
7369 * output.h (Input_section_specifier): Remove class.
7370 (Output_section::Output_section_data_by_input_section_map): Change
7371 key type to Const_section_id.
7372 (Output_section::Output_relaxed_input_section_by_input_section_map):
7373 Ditto.
7374 (Output_section::Relaxation_map): Change key type to Section_id.
7375
7376 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7377
7378 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7379 (class Arm_v4bx_stub): New class.
7380 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7381 (Stub_factory::make_arm_v4bx_stub): New method.
7382 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7383 (Stub_table::empty): Handle v4bx stubs.
7384 (Stub_table::add_arm_v4bx_stub): New method.
7385 (Stub_table::find_arm_v4bx_stub): New method.
7386 (Arm_relocate_functions::v4bx): New method.
7387 (Target_arm::fix_v4bx): New method.
7388 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7389 (Stub_table::relocate_stubs): Likewise.
7390 (Stub_table::do_write): Likewise.
7391 (Stub_table::update_data_size_and_addralign): Likewise.
7392 (Stub_table::finalize_stubs): Likewise.
7393 (Target_arm::Scan::local): Likewise.
7394 (Target_arm::Scan::global): Likewise.
7395 (Target_arm::do_finalize_sections): Likewise.
7396 (Target_arm::Relocate::relocate): Likewise.
7397 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7398 Likewise.
7399 (Target_arm::scan_reloc_for_stub): Likewise.
7400 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7401
7402 2010-01-19 Ian Lance Taylor <iant@google.com>
7403
7404 * output.cc (Output_section_headers::do_sized_write): Write large
7405 segment count to sh_info field.
7406 (Output_file_header::do_sized_write): For large segment count,
7407 write PN_XNUM to e_phnum field.
7408
7409 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7410
7411 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7412 (Arm_relocate_functions::thm_jump8): New function.
7413 (Arm_relocate_functions::thm_jump11): New function.
7414 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7415 R_ARM_THM_JUMP11.
7416 (Target_arm::Scan::global): Likewise.
7417 (Target_arm::Relocate::relocate): Likewise.
7418 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7419 Likewise.
7420
7421 2010-01-14 Doug Kwan <dougkwan@google.com>
7422
7423 * arm.cc (map, utility): Include headers.
7424 (Target_arm::apply_cortex_a8_workaround): New method.
7425 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7426 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7427 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7428 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7429 the --[no-]fix-cortex-a8 command line options.
7430 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7431 (Target_arm::relocate_stub): Use addend in instruction template.
7432 * options.h (DEFINE_bool): Set the user-set flag.
7433 (General_options): Add --[no-]-fix-cortex options.
7434 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
7435 : Update fast look-up map after conversion.
7436
7437 2010-01-14 Sriraman Tallam <tmsriram@google.com>
7438
7439 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7440 in the first pass of do_layout.
7441
7442 2010-01-13 Doug Kwan <dougkwan@google.com>
7443
7444 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7445 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7446 apparent compiler problem of not folding static constant integral
7447 data members of elfcpp::Elf_sizes<32>.
7448
7449 2010-01-13 Doug Kwan <dougkwan@google.com>
7450
7451 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7452 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7453 Arm_relobj::scan_section_for_cortex_a8_erratum,
7454 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7455 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7456 sections to scan for relocation stubs into a new method
7457 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7458 relocation and Cortex-A8 stub scanning.
7459 (Target_arm::do_relax): Force stubs to be after stubbed sections
7460 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
7461 the beginning of a new relaxation pass. Update a comment.
7462 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7463
7464 2010-01-12 Ian Lance Taylor <iant@google.com>
7465
7466 * target-reloc.h (visibility_error): New inline function.
7467 (relocate_section): Call visibility_error.
7468 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7469 (MOSTLYCLEANFILES): Likewise.
7470 (protected_4_pic.o, protected_3.err): New targets.
7471 * testsuite/protected_4.cc: New file.
7472
7473 2010-01-12 Doug Kwan <dougkwan@google.com>
7474
7475 * arm.cc (Cortex_a8_reloc): New class.
7476 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7477 and cortex_a8_relocs_info_.
7478 (Target_arm::fix_cortex_a8): New method definition.
7479 (Target_arm::Cortex_a8_relocs_info): New type.
7480 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7481 New data member declarations.
7482 (Target_arm::scan_reloc_for_stub): Record information about
7483 relocations for THUMB branches that might be exempted from the
7484 Cortex-A8 workaround.
7485 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7486 at the beginning of a relaxation pass.
7487
7488 2010-01-12 Doug Kwan <dougkwan@google.com>
7489
7490 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7491 (Arm_relobj::Mapping_symbol_position,
7492 Arm_reloj::Mapping_symbol_position_less,
7493 Arm_relobj::Mapping_symbols_info): New types.
7494 (Target_arm::is_mapping_symbol_name): New method definition.
7495 (Arm_relobj::do_count_local_symbols): Save information about mapping
7496 symbols.
7497
7498 2010-01-11 Doug Kwan <dougkwan@google.com>
7499
7500 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7501 Arm_relocate_functions::thumb32_branch_upper,
7502 Arm_relocate_functions::thumb32_branch_lower,
7503 Arm_relocate_functions::thumb32_cond_branch_offset,
7504 Arm_relocate_functions::thumb32_cond_branch_upper,
7505 Arm_relocate_functions::thumb32_cond_branch_lower,
7506 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7507 branch offset encoding.
7508 (Arm_relocate_functions::thumb_branch_common): Use new branch
7509 offset encoding methods to avoid code duplication.
7510 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7511 (Stub_addend_reader::operator()): Use new branch encoding method
7512 to avoid code duplication.
7513
7514 2010-01-11 Doug Kwan <dougkwan@google.com>
7515
7516 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7517 (Target_arm::do_finalize_sections): Define special EXIDX section
7518 symbols only if referenced.
7519 * gc.h (Garbage_collection::add_reference): New method.
7520 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7521 code duplication.
7522
7523 2010-01-11 Ian Lance Taylor <iant@google.com>
7524
7525 * script.cc (Version_script_info::build_expression_list_lookup):
7526 Change complaing about duplicate wildcard match from error to
7527 warning.
7528
7529 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7530 of 2009-12-30.
7531 (Version_script_info::Version_script_info): Initialize globs_,
7532 default_version_, default_is_global_, and exact_. Don't
7533 initialize globals_ or locals_.
7534 (Version_script_info::build_lookup_tables): Build local symbols
7535 first.
7536 (Version_script_info::unquote): New function.
7537 (Version_script_info::add_exact_match): New function.
7538 (Version_script_info::build_expression_list_lookup): Remove lookup
7539 parameter. Add is_global parameter. Change all callers. Handle
7540 wildcard pattern specially. Unquote pattern. Call
7541 add_exact_match.
7542 (Version_script_info::get_name_to_match): New function.
7543 (Version_script_info::get_symbol_version): New function.
7544 (Version_script_info::get_symbol_version_helper): Remove.
7545 (Version_script_info::check_unmatched_names): Call unquote.
7546 * script.h (class Version_script_info): Change get_symbol_version
7547 to be non-inline and add is_global parameter; change all callers.
7548 Rewrite symbol_is_local. Update declarations. Define struct
7549 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7550 Remove globals_ and locals_ members. Add exact_, globs_,
7551 default_version_, is_global_.
7552 (Version_script_info::Glob): Remove pattern, add expression and
7553 is_global. Update constructor. Change all callers.
7554 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7555 default version.
7556 (Versions::symbol_section_contents): If a symbol is undefined, or
7557 defined in a dynamic object, set the version index to
7558 VER_NDX_LOCAL.
7559 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7560 symbol_is_local.
7561 (Symbol_table::add_from_pluginobj): Likewise.
7562 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7563
7564 2010-01-11 Doug Kwan <dougkwan@google.com>
7565
7566 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7567 (incremental_dump_LDADD): Add linking option for libintl.
7568 * Makefile.in: Regenerate.
7569
7570 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7571
7572 PR gold/11144
7573 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7574 instead of -Ds.
7575 * testsuite/Makefile.in: Regenerated.
7576
7577 2010-01-10 Doug Kwan <dougkwan@google.com>
7578
7579 * options.h (DEFINE_var): Use parentheses around argument varname__
7580 in macro body to avoid any unintended subsequent substitutions.
7581
7582 2010-01-10 Ian Lance Taylor <iant@google.com>
7583
7584 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7585 candidates before doing symbol resolution.
7586
7587 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7588 ODR candidates if only one is weak.
7589
7590 2010-01-08 Ian Lance Taylor <iant@google.com>
7591
7592 * script.cc (Version_script_info::build_expression_list_lookup):
7593 Don't warn about ambiguous version, just record the ambiguity.
7594 (Version_script_info::get_symbol_version_helper): Give error if
7595 version is ambiguous.
7596
7597 2010-01-08 Doug Kwan <dougkwan@google.com>
7598
7599 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7600 prev_data_size_ and prev_addralign_. Remove initializer for
7601 deleted data member has_been_changed_.
7602 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7603 to determine if the table is empty.
7604 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7605 Remove.
7606 (Stub_table::add_reloc_stub): Define method in class definition
7607 instead of just declaring it there.
7608 (Stub_table::add_cortex_a8_stub): New method definition.
7609 (Stub_table::update_data_size_and_addralign): Ditto.
7610 (Stub_table::finalize_stubs): Ditto.
7611 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7612 (Stub_table::do_addralign_): Return address alignment in the
7613 (Stub_table::do_reset_address_and_file_offset): Define method in
7614 class definition instead of declaring it there. Set current data
7615 size to be the data size of the previous pass.
7616 (Stub_table::set_final_data_size): Use current data size as the
7617 final data size.
7618 (Stub_table::relocate_stub): Change parameter type of stub from
7619 Reloc_stub pointer to Stub pointer.
7620 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7621 (Stub_table::Cortex_a8_stub_list): New typedef.
7622 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7623 Stub_table::prev_addralign_): New data member.
7624 (Arm_relobj::Arm_relobj): Initialize data member
7625 section_has_cortex_a8_workaround_.
7626 (Arm_relobj::section_has_cortex_a8_workaround,
7627 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7628 definitions.
7629 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7630 declarations.
7631 (Target_arm::relocate_stub): Change parameter type of stub from
7632 Reloc_stub pointer to Stub pointer.
7633 (Insn_template::size, Insn_template::alignment): Handle
7634 THUMB16_SPECIAL_TYPE.
7635 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7636 Stub_table::update_data_size_and_addralign,
7637 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7638 definitions.
7639 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7640 (Stub_table::do_write): Ditto.
7641 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7642
7643 2010-01-08 Ian Lance Taylor <iant@google.com>
7644
7645 PR 11108
7646 * symtab.h (class Symbol): Remove fields is_target_special_ and
7647 has_plt_offset_. Add field is_defined_in_discarded_section_.
7648 (Symbol::is_defined_in_discarded_section): New function.
7649 (Symbol::set_is_defined_in_discarded_section): New function.
7650 (Symbol::has_plt_offset): Rewrite.
7651 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7652 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7653 Don't initialize is_target_special_ or has_plt_offset_.
7654 Initialize is_defined_in_discarded_section_.
7655 (Symbol_table::add_from_relobj): If appropriate, set
7656 is_defined_in_discarded_section.
7657 * resolve.cc (Symbol::override_base_with_special): Don't test
7658 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7659 * target-reloc.h (relocate_section): Do special handling for
7660 symbols defined in discarded sections for global symbols as well
7661 as local symbols.
7662
7663 2010-01-08 Ian Lance Taylor <iant@google.com>
7664
7665 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7666 the SHT_SYMTAB case.
7667
7668 2010-01-08 Ian Lance Taylor <iant@google.com>
7669
7670 * object.cc (Sized_relobj::do_layout): Don't get confused if
7671 layout_eh_frame returns NULL.
7672
7673 2010-01-08 Ian Lance Taylor <iant@google.com>
7674
7675 PR 11084
7676 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7677 dynamic symbol table, use the normal symbol table.
7678 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7679 symbol table.
7680
7681 2010-01-08 Ian Lance Taylor <iant@google.com>
7682
7683 PR 11072
7684 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7685 sections.
7686
7687 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7688
7689 * version.cc (print_version): Change to "Copyright 2010".
7690
7691 2010-01-08 Ian Lance Taylor <iant@google.com>
7692
7693 PR 10287
7694 PR 11063
7695 * i386.cc (class Target_i386): Change return type of plt_section
7696 to be non-const.
7697 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7698 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7699 tls_desc_rel_ field.
7700 (Output_data_plt_i386::rel_tls_desc): New function.
7701 (Target_i386::rel_tls_desc_section): New function.
7702 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7703 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7704 R_386_TLS_DESC reloc in rel_tls_desc_section.
7705 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7706 Define struct Tlsdesc_info.
7707 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7708 (Target_x86_64::do_reloc_symbol_index): New function.
7709 (Target_x86_64::add_tlsdesc_info): New function.
7710 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7711 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7712 tlsdesc_rel_ field.
7713 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7714 all callers.
7715 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7716 (Target_x86_64::rela_tlsdesc_section): New function.
7717 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7718 handling.
7719 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7720 (Target_x86_64::do_reloc_addend): New function.
7721 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7722 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7723 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7724 (Output_reloc::type): New function.
7725 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7726 (Output_reloc::is_target_specific): New function.
7727 (Output_reloc::target_arg): New function.
7728 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7729 absolute relocs and target specific relocs.
7730 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7731 add_target_specific.
7732 (class Output_data_reloc) [SHT_RELA]: Likewise.
7733 * output.cc (Output_reloc::Output_reloc): Add four new versions
7734 for absolute relocs and target specific relocs.
7735 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7736 (Output_reloc::get_symbol_index): Likewise.
7737 (Output_reloc::local_section_offset): Check that local_sym_index_
7738 is not TARGET_CODE or 0.
7739 (Output_reloc::symbol_value): Likewise.
7740 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7741 reloc.
7742 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7743 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7744 functions.
7745 * layout.cc (add_target_dynamic_tags): Use output section for
7746 DT_PLTRELSZ and DT_JMPREL.
7747
7748 2010-01-07 Ian Lance Taylor <iant@google.com>
7749
7750 PR 11061
7751 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7752 function.
7753 (class Output_data_reloc_generic): Define.
7754 (class Output_data_reloc_base): Change base class to
7755 Output_data_reloc_generic. Change add() method to call
7756 bump_relative_reloc_count for a relative reloc. Remove
7757 sort_relocs_ field.
7758 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7759 to sort_relocs().
7760 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7761 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7762 appropriate.
7763 * layout.h (class Layout): Update declaration.
7764
7765 2010-01-07 Ian Lance Taylor <iant@google.com>
7766
7767 * output.h (class Output_data): Add const version of
7768 output_section and do_output_section.
7769 (class Output_section_data): Add const version of
7770 do_output_section.
7771 (class Output_section): Likewise.
7772 * layout.cc (Layout::add_target_dynamic_tags): New function.
7773 * layout.h (class Layout): Update declarations.
7774 * arm.cc (Target_arm::do_finalize_sections): Use
7775 add_target_dynamic_tags.
7776 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7777 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7778 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7779 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7780
7781 2010-01-07 Ian Lance Taylor <iant@google.com>
7782
7783 PR 11042
7784 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7785 object as needed.
7786
7787 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7788 Ian Lance Taylor <iant@google.com>
7789
7790 PR 11019
7791 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7792 Xindex::read_symtab_xindex.
7793
7794 2010-01-07 Doug Kwan <dougkwan@google.com>
7795
7796 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7797 (Insn_template::thumb16_bcond_insn): New method declaration.
7798 (Insn_template): Fix spelling.
7799 (Stub::thumb16_special): New method declaration.
7800 (Stub::do_write): Define virtual method which was previously pure
7801 virtual.
7802 (Stub::do_thumb16_special): New method declaration.
7803 (Stub::do_fixed_endian_write): New template member.
7804 (Reloc_stub::do_write): Remove.
7805 (Reloc_stub::do_fixed_endian_write): Remove.
7806 (Cortex_a8_stub): New class definition.
7807 (Stub_factory::make_cortex_a8_stub): New method definition.
7808 (Stub_factory::Stub_factory): Add missing static storage class
7809 qualifier for elf32_arm_stub_a8_veneer_blx.
7810
7811 2010-01-07 Ian Lance Taylor <iant@google.com>
7812
7813 PR 10980
7814 * options.h (class General_options): Add --warn-unresolved-symbols
7815 and --error-unresolved-symbols.
7816 * errors.cc (Errors::undefined_symbol): Implement
7817 --warn-unresolved-symbols.
7818
7819 * options.h (class General_options): Add -z text and -z textoff.
7820 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7821
7822 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7823
7824 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7825 (Garbage_collection::cident_sections): New function.
7826 (Garbage_collection::add_cident_section): New function.
7827 (Garbage_collection::cident_sections_): New member.
7828 (gc_process_relocs): Add references to sections whose names are C
7829 identifiers.
7830 * gold.h (cident_section_start_prefix): New constant.
7831 (cident_section_stop_prefix): New constant.
7832 (is_cident): New function.
7833 * layout.cc (Layout::define_section_symbols): Replace string constants
7834 with the newly defined constants.
7835 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7836 C identifiers.
7837 * testsuite/Makefile.am: Add gc_orphan_section_test.
7838 * testsuite/Makefile.in: Regenerate.
7839 * testsuite/gc_orphan_section_test.cc: New file.
7840 * testsuite/gc_orphan_section_test.sh: New file.
7841
7842 2010-01-06 Ian Lance Taylor <iant@google.com>
7843
7844 PR 10980
7845 * options.h (class General_options): Add --warn-shared-textrel.
7846 * layout.cc (Layout::finish_dynamic_section): Implement
7847 --warn-shared-textrel.
7848
7849 PR 10980
7850 * options.h (class General_options): Add --warn-multiple-gp.
7851
7852 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7853
7854 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7855 $(THREADSLIB) and $(LIBDL).
7856 * Makefile.in: Rebuild.
7857
7858 2010-01-06 Ian Lance Taylor <iant@google.com>
7859
7860 PR 10980
7861 * options.cc (General_options::parse_section_start): New function.
7862 (General_options::section_start): New function.
7863 (General_options::General_options): Initialize all members.
7864 * options.h: Include <map>
7865 (class General_options): Add --section-start. Add section_starts_
7866 member.
7867 * layout.cc (Layout::attach_allocated_section_to_segment): If
7868 --section-start was used, set the address of the segment. Remove
7869 local sort_sections.
7870 (Layout::relaxation_loop_body): If the address of the load segment
7871 has been set by --section-start, don't use it.
7872 * output.h (Output_segment::update_flags_for_output_section): New
7873 function.
7874 * output.cc (Output_segment::add_output_section): Call
7875 update_flags_for_output_section.
7876
7877 2010-01-05 Ian Lance Taylor <iant@google.com>
7878
7879 PR 10980
7880 * options.h (class General_options): Add --undefined-version.
7881 * script.cc (struct Version_expression): Add was_matched_by_symbol
7882 field.
7883 (Version_script_info::matched_symbol): New function.
7884 (Version_script_info::get_symbol_version_helper): Call
7885 matched_symbol.
7886 (Version_script_info::check_unmatched_names): New function.
7887 * script.h (class Version_script_info): Update declarations.
7888 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7889
7890 * options.h (class General_options): Use DEFINE_bool_alias for
7891 allow_multiple_definition.
7892 * resolve.cc (Symbol_table::should_override): Don't test
7893 allow_multiple_definition.
7894
7895 PR 10980
7896 * options.h (class General_options): Add --cref.
7897 * main.cc (main): Print cref table if --cref. Don't close mapfile
7898 until after printing cref table.
7899 * cref.cc: Include "symtab.h".
7900 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7901 (Cref_table_compare::operator()): New function.
7902 (Cref_inputs::gather_cref): New function.
7903 (filecol): New static const.
7904 (Cref_inputs::print_cref): New function.
7905 (Cref::print_cref): New function.
7906 * cref.h: Include <cstdio>.
7907 (class Cref): Update declarations.
7908 * mapfile.h (Mapfile::file): New function.
7909 * object.h (class Object): Define Symbols. Declare virtual
7910 do_get_global_symbols.
7911 (Object::get_global_symbols): New function.
7912 * object.cc (Input_objects::add_object): Pass object to cref_ if
7913 --cref.
7914 (Input_objects::archive_start): Likewise.
7915 (Input_objects::archive_stop): Likewise.
7916 (Input_objects::print_cref): New function.
7917 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7918 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7919 --cref.
7920 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7921 function.
7922 * plugin.h (class Sized_pluginobj): Update declarations.
7923
7924 2010-01-05 Ian Lance Taylor <iant@google.com>
7925
7926 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7927 to is_default_version. Rename insdef to insdefault.
7928 (Symbol_table::add_from_relobj): Rename def to is_default_version
7929 and local to is_forced_local.
7930 (Symbol_table::add_from_pluginobj): Likewise.
7931 (Symbol_table::add_from_dynobj): Likewise.
7932 (Symbol_table::define_special_symbol): Rename insdef to
7933 insdefault.
7934
7935 2010-01-04 Ian Lance Taylor <iant@google.com>
7936
7937 PR 10980
7938 * options.h (class General_options): Add
7939 --allow-multiple-definition and -z muldefs.
7940 * resolve.cc (Symbol_table::should_override): Don't warn about a
7941 multiple symbol definition if --allow-multiple-definition or -z
7942 muldefs.
7943
7944 PR 10980
7945 * options.h (class General_options): Add --add-needed and
7946 --copy-dt-needed-entries. Tweak --as-needed help entry.
7947 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7948 error if --copy-dt-needed-entries aka --add-needed is used and
7949 would cause a change in behaviour.
7950
7951 PR 10980
7952 * options.h (class General_options): Add -G as a short version of
7953 --shared. Add no-op options -assert, -g, and -i.
7954
7955 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7956
7957 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7958 check for .text or .gnu.linkonce.t sections.
7959 * icf.cc (Icf::find_identical_sections): Ditto.
7960 Change the detection for mangled function name within the section
7961 name.
7962 * icf.h (is_section_foldable_candidate): New function.
7963
7964 2009-12-30 Ian Lance Taylor <iant@google.com>
7965
7966 PR 10980
7967 * options.h (class General_options): Permit two dashes with
7968 --retain-symbols-file.
7969
7970 2009-12-30 Ian Lance Taylor <iant@google.com>
7971
7972 PR 10979
7973 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7974 don't put the file header and segment headers in the text
7975 segment.
7976
7977 PR 10979
7978 * common.cc (Sort_commons::operator()): Stabilize sort when both
7979 entries are NULL.
7980 (Symbol_table::do_allocate_commons_list): When allocating common
7981 symbols, skip a symbol which is no longer common.
7982 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7983 an object before checking its type.
7984 * testsuite/common_test_2.c: New file.
7985 * testsuite/common_test_3.c: New file.
7986 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7987 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7988 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7989 (common_test_2_pic.o, common_test_2.so): New targets.
7990 (common_test_3_pic.o, common_test_3.so): New targets.
7991 * testsuite/Makefile.in: Rebuild.
7992
7993 PR 10979
7994 * script.cc (read_input_script): If we see a new SECTIONS clause,
7995 and we have added an input section, give an error.
7996 * layout.h (class Layout): Add have_added_input_section function.
7997 Add have_added_input_section_ field.
7998 * layout.cc (Layout::Layout): Initialize
7999 have_added_input_section_.
8000 (Layout::layout): Set have_added_input_section_.
8001 (Layout::layout_eh_frame): Likewise.
8002
8003 2009-12-30 Ian Lance Taylor <iant@google.com>
8004
8005 PR 10931
8006 * options.h (class General_options): Add --sort-common option.
8007 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8008 * common.cc (Sort_common): Add sort_order parameter to
8009 constructor. Add sort_order_ field.
8010 (Sort_commons::operator): Check sort_order_.
8011 (Symbol_table::allocate_commons): Determine the sort order.
8012 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8013 Change all callers.
8014 (Symbol_table::do_allocate_commons_list): Likewise.
8015
8016 2009-12-30 Ian Lance Taylor <iant@google.com>
8017
8018 PR 10916
8019 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8020 symbols from this object, don't change the visibility of an
8021 undefined symbol.
8022 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8023
8024 2009-12-30 Ian Lance Taylor <iant@google.com>
8025
8026 PR 10861
8027 * script.h (class Version_script_info): Define Language enum.
8028 Update declarations. Define Glob, Exact, and Lookup types. Add
8029 new fields globals_, locals_, and is_finalized_.
8030 * script.cc: Various formatting fixes.
8031 (class Parser_closure): Change language_stack_ from a vector of
8032 std::string to one of Version_script_info::Language. Adjust all
8033 uses accordingly.
8034 (class Lazy_demangler): Remove.
8035 (struct Version_expression): Change language from std::string to
8036 Version_script_info::Language.
8037 (Version_script_info::Version_script_info): New function.
8038 (Version_script_info::~Version_script_info): Don't call clear.
8039 (Version_script_info::finalize): New function.
8040 (Version_script_info::build_lookup_tables): New function.
8041 (Version_script_info::build_expression_list_lookup): New
8042 function.
8043 (Version_script_info::get_symbol_version_helper): Rewrite to use
8044 lookup tables.
8045 (Version_script_info::print_expression_list): Adjust to use
8046 Version_script_info::Language.
8047 (script_push_lex_into_version_mode): Check that the version script
8048 has not been finalized.
8049 (version_script_push_lang): Change language string to
8050 Version_script_info::Language.
8051 * options.cc (Command_line::version_script): New function.
8052 * options.h (class General_options): Add finalize_dynamic_list
8053 function. Change version_script from declaration to definition.
8054 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8055 * testsuite/version_script.map: Remove duplicate def of foo.
8056 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8057 version_script.map.
8058 * testsuite/Makefile.in: Rebuild.
8059
8060 2009-12-30 Ian Lance Taylor <iant@google.com>
8061
8062 PR 10843
8063 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8064 if the input symbol index is 0, make the output symbol index 0.
8065
8066 2009-12-30 Ian Lance Taylor <iant@google.com>
8067
8068 PR 10670
8069 * options.h (class General_options): Add -x/--discard-all.
8070 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8071 --discard-all. If the local symbol needs a dynamic entry, check
8072 that before handling --discard-locals.
8073
8074 2009-12-30 Ian Lance Taylor <iant@google.com>
8075
8076 PR 10450
8077 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8078 flags to PF_R.
8079 (Output_segment::add_output_section): Don't change the flags if
8080 the type is PT_TLS.
8081
8082 PR 10450
8083 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8084 GNU hash table if they need a dynamic value. Otherwise, don't add
8085 them if they are defined in a dynamic object or are forced local.
8086
8087 2009-12-29 Ian Lance Taylor <iant@google.com>
8088
8089 PR 10450
8090 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8091 .gnu.hash table for a 32-bit target.
8092
8093 PR 10450
8094 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8095 regular and a dynamic object only needs a dynamic symbol table
8096 entry if it is externally visible.
8097
8098 PR 10450
8099 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8100 constructor. Add global_offset_table_ field.
8101 (Target_i386::got_section): Set global_offset_table_.
8102 (Target_i386::do_finalize_sections): Set global_offset_table_
8103 size.
8104 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8105 in constructor. Add global_offset_table_ field.
8106 (Target_x86_64::got_section): Set global_offset_table_.
8107 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8108 size.
8109
8110 * layout.cc (Layout::Layout): Initialize increase_relro_.
8111 (Layout::get_output_section): Add is_relro, is_last_relro, and
8112 is_first_non_relro parameters. Change all callers.
8113 (Layout::choose_output_section): Likewise.
8114 (Layout::add_output_section_data): Likewise.
8115 (Layout::make_output_section): Likewise.
8116 (Layout::set_segment_offsets): Clear increase_relro when using a
8117 linker script.
8118 * layout.h (class Layout): Add increase_relro method. Add
8119 increase_relro_ field. Update declarations.
8120 * output.cc (Output_section::Output_section): Initialize
8121 is_last_relro_ and is_first_non_relro_.
8122 (Output_segment::add_output_section): Group relro sections is
8123 do_sort is true. Handle is_last_relro and is_first_non_relro.
8124 (Output_segment::maximum_alignment): Remove relro handling.
8125 (Output_segment::set_section_addresses): Add increase_relro
8126 parameter. Change all callers. Add initial alignment to align
8127 relro sections on separate page. Remove old relro handling.
8128 (Output_segment::set_section_list_addresses): Remove in_relro
8129 parameter. Change all callers.
8130 (Output_segment::set_offset): Add increase parameter. Change all
8131 callers. Remove old relro handling.
8132 * output.h (class Output_section): Add new methods: is_last_relro,
8133 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8134 Add is_last_relro_ and is_first_non_relro_ fields.
8135 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8136 Create separate .got.plt section. Call increase_relro.
8137 * x86_64.cc (Target_x86_64::got_section): Likewise.
8138 * testsuite/relro_script_test.t: Add .got.plt.
8139
8140 PR 10450
8141 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8142 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8143 (Layout::finalize): Call set_dynamic_symbol_size.
8144 (Layout::set_dynamic_symbol_size): New function.
8145 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8146 set_dynamic_symbol_size.
8147
8148 PR 10450
8149 * output.h (class Output_section): Add is_entsize_zero_ field.
8150 * output.cc (Output_section::Output_section): Initialize
8151 is_entsize_zero_.
8152 (Output_section::set_entsize): If two different entsizes are
8153 requested, force it to zero.
8154 (Output_section::add_input_section): Set flags for .debug_str
8155 before updating section flags. Set entsize.
8156 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8157 and SHF_STRING if all input sections have those flags.
8158
8159 2009-12-29 Rafael Espindola <espindola@google.com>
8160
8161 * main.cc (main): Fix the sys time reporting.
8162 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8163 reporting.
8164
8165 2009-12-29 Sriraman Tallam <tmsriram@google.com>
8166
8167 * options.cc (General_options::parse_version): Allow -v to exit
8168 without an error if there is nothing to link.
8169
8170 2009-12-29 Ian Lance Taylor <iant@google.com>
8171
8172 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8173 using a version of gcc before 4.1.
8174 * configure: Rebuild.
8175
8176 2009-12-28 Chris Demetriou <cgd@google.com>
8177
8178 * attributes.cc (Output_attributes_section_data::do_write): Use
8179 std::vector::front rather than std::vector::data.
8180
8181 2009-12-28 Ian Lance Taylor <iant@google.com>
8182
8183 * symtab.h (class Symbol_table): Add enum Defined.
8184 * resolve.cc (Symbol_table::should_override): Add defined
8185 parameter. Change all callers. Test whether object is NULL
8186 before calling a method on it.
8187 (Symbol_table::report_resolve_problem): Add defined parameter.
8188 Change all callers.
8189 (Symbol_table::should_override_with_special): Likewise.
8190 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8191 parameter. Change all callers.
8192 (Symbol_table::do_define_in_output_data): Likewise.
8193 (Symbol_table::define_in_output_segment): Likewise.
8194 (Symbol_table::do_define_in_output_segment): Likewise.
8195 (Symbol_table::define_as_constant): Likewise.
8196 (Symbol_table::do_define_as_constant): Likewise.
8197 * script.h (class Symbol_assignment): Add is_defsym parameter to
8198 constructor; change all callers.
8199 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8200 parameter. Change all callers. Add is_defsym_ field.
8201 (class Parser_closure): Add parsing_defsym parameter to
8202 constructor; change all callers. Add parsing_defsym accessor
8203 function. Add parsing_defsym_ field.
8204
8205 2009-12-28 Ian Lance Taylor <iant@google.com>
8206
8207 * gold.cc (queue_middle_tasks): Fix formatting.
8208 * object.cc (Relobj::is_section_name_included): Likewise.
8209
8210 2009-12-23 Ian Lance Taylor <iant@google.com>
8211
8212 * i386.cc (Target_i386::do_calls_non_split): Recognize
8213 -fsplit-stack prologue for a function with a static chain.
8214 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8215 -fsplit-stack prologue when using %r11.
8216
8217 2009-12-21 Sriraman Tallam <tmsriram@google.com>
8218
8219 * options.cc (General_options::parse_version): Make -v continue and do
8220 the link like GNU ld does.
8221
8222 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
8223
8224 * Makefile.am (CCFILES): Add timer.cc.
8225 (HFILES): Add timer.h.
8226 * configure.ac: Check for sysconf and times.
8227 * main.cc: include timer.h.
8228 (main): Use Timer instead of get_run_time.
8229 * timer.cc: New.
8230 * timer.h: New.
8231 * workqueue.cc: include timer.h.
8232 (Workqueue::find_and_run_task):
8233 Report user, sys and wall time.
8234 * Makefile.in: Regenerate.
8235 * config.in: Regenerate.
8236 * configure: Regenerate.
8237
8238 2009-12-16 Doug Kwan <dougkwan@google.com>
8239
8240 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8241 sections.
8242 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8243 relaxed input sections.
8244 * output.cc (Output_section::find_relaxed_input_section): Change
8245 return type to Output_relaxed_input_section pointer. Adjust code
8246 for new type of relaxed_input_section_map_.
8247 * output.h (Output_section::find_relaxed_input_section): Change
8248 return type to Output_relaxed_input_section pointer.
8249 (Output_section::Output_relaxed_input_section_by_input_section_map):
8250 New type.
8251 (Output_section::relaxed_input_section_map_): Change type to
8252 Output_section::Output_relaxed_input_section_by_input_section_map.
8253 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8254 input section.
8255
8256 2009-12-15 Ian Lance Taylor <iant@google.com>
8257
8258 * layout.cc (Layout::create_shstrtab): Only write out after input
8259 sections if we are compressing debug sections.
8260
8261 2009-12-15 Ian Lance Taylor <iant@google.com>
8262
8263 * archive.cc (Archive::add_symbols): Only look up a symbol without
8264 a version if there is, in fact, a version.
8265
8266 2009-12-14 Ian Lance Taylor <iant@google.com>
8267
8268 Revert -Wshadow changes, all changes from:
8269 2009-12-11 Doug Kwan <dougkwan@google.com>
8270 2009-12-11 Nick Clifton <nickc@redhat.com>
8271 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8272
8273 2009-12-11 Doug Kwan <dougkwan@google.com>
8274
8275 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8276 due to -Wshadow.
8277 * attributes.cc (Object_attribute::size): Ditto.
8278 (Attributes_section_data::size): Ditto.
8279 (Attributes_section_data::Attributes_section_data): Ditto.
8280 (Output_attributes_section_data::do_write): Ditto.
8281 * attributes.h (Object_attribute::set_type): Ditto.
8282 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8283
8284 2009-12-11 Nick Clifton <nickc@redhat.com>
8285
8286 * archive.cc: Fix shadowed variable warnings.
8287 * arm.cc: Likewise.
8288 * compressed_output.cc: Likewise.
8289 * compressed_output.h: Likewise.
8290 * configure: Likewise.
8291 * dwarf_reader.cc: Likewise.
8292 * dynobj.cc: Likewise.
8293 * dynobj.h: Likewise.
8294 * ehframe.cc: Likewise.
8295 * ehframe.h: Likewise.
8296 * errors.cc: Likewise.
8297 * expression.cc: Likewise.
8298 * fileread.cc: Likewise.
8299 * fileread.h: Likewise.
8300 * freebsd.h: Likewise.
8301 * i386.cc: Likewise.
8302 * icf.cc: Likewise.
8303 * incremental.h: Likewise.
8304 * layout.cc: Likewise.
8305 * layout.h: Likewise.
8306 * mapfile.cc: Likewise.
8307 * merge.cc: Likewise.
8308 * merge.h: Likewise.
8309 * object.cc: Likewise.
8310 * object.h: Likewise.
8311 * options.h: Likewise.
8312 * output.cc: Likewise.
8313 * output.h: Likewise.
8314 * parameters.cc: Likewise.
8315 * plugin.cc: Likewise.
8316 * powerpc.cc: Likewise.
8317 * reduced_debug_output.cc: Likewise.
8318 * reduced_debug_output.h: Likewise.
8319 * reloc.cc: Likewise.
8320 * reloc.h: Likewise.
8321 * resolve.cc: Likewise.
8322 * script-sections.cc: Likewise.
8323 * script.cc: Likewise.
8324 * script.h: Likewise.
8325 * sparc.cc: Likewise.
8326 * symtab.cc: Likewise.
8327 * symtab.h: Likewise.
8328 * target-select.cc: Likewise.
8329 * target-select.h: Likewise.
8330 * token.h: Likewise.
8331 * workqueue.cc: Likewise.
8332 * workqueue.h: Likewise.
8333 * x86_64.cc: Likewise.
8334
8335 2009-12-10 Doug Kwan <dougkwan@google.com>
8336
8337 * arm.cc (attributes.h): New include.
8338 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8339 (Arm_relobj::~Arm_relobj): Delete object pointed by
8340 attributes_section_data_.
8341 (Arm_relobj::attributes_section_data): New method definition.
8342 (Arm_relobj::attributes_section_data_): New data member declaration.
8343 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8344 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8345 attributes_section_data_.
8346 (Arm_dynobj::attributes_section_data): New method definition.
8347 (Arm_dynobj::attributes_section_data_): New data member declaration.
8348 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8349 initialization value of may_use_blx_ to false.
8350 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
8351 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8352 object attributes to compute results instead of hard-coding.
8353 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8354 Target_arm::get_secondary_compatible_arch,
8355 Target_arm::set_secondary_compatible_arch
8356 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8357 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8358 New method declarations.
8359 (Target_arm::get_aeabi_object_attribute): New method definition.
8360 (Target_arm::attributes_section_data_): New data member declaration.
8361 (read_arm_attributes_section): New template definition.
8362 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8363 (Arm_dynobj::do_read_symbols): Ditto.
8364 (Target_arm::do_finalize_sections): Merge attributes sections from
8365 input. Check for BLX use after attributes section merging.
8366 Fix __exidx_start and __exidx_end visibility. Create an
8367 .ARM.attributes section if necessary.
8368 (Target_arm::get_secondary_compatible_arch,
8369 Target_arm::set_secondary_compatible_arch,
8370 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8371 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
8372 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
8373 New method definitions.
8374
8375 2009-12-09 Ian Lance Taylor <iant@google.com>
8376
8377 * plugin.cc (Plugin::load): Don't cast from void* to a function
8378 pointer.
8379
8380 2009-12-09 Ian Lance Taylor <iant@google.com>
8381
8382 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8383 information fields.
8384
8385 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8386
8387 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8388 Replace two_file_shared_1.so with two_file_shared_2.so.
8389 * testsuite/Makefile.in: Regenerated.
8390
8391 2009-12-08 Doug Kwan <dougkwan@google.com>
8392
8393 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8394 (HFILES): Add attributes.h and int_encoding.h.
8395 * Makefile.in: Regenerate.
8396 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8397 function definitions to int_encoding.cc
8398 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8399 prototypes to int_encoding.h
8400 * reduced_debug_output.cc (int_encoding.h): New include.
8401 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8402 function definitions to int_encoding.cc
8403 (insert_into_vector, read_from_pointer): Move template definitions to
8404 int_encoding.h
8405 * attributes.cc: New file.
8406 * attributes.h: New file.
8407 * int_encoding.cc: New file.
8408 * int_encoding.h: New file.
8409
8410 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
8411
8412 PR gold/11055
8413 * incremental-dump.cc (dump_incremental_inputs): New.
8414 (main): Use dump_incremental_inputs.
8415
8416 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8417
8418 PR gold/10893
8419 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8420 checking elfcpp::STT_FUNC.
8421 (Target_i386::Relocate::relocate): Likewise.
8422 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8423
8424 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8425 symbols from shared libraries into normal FUNC symbols.
8426
8427 * symtab.h (Symbol): Add is_func and use it.
8428
8429 2009-12-05 Doug Kwan <dougkwan@google.com>
8430
8431 * arm.cc (Target_arm::arm_info): Initialize new fields
8432 attributes_section and attributes_vendor.
8433 * i386.cc (Target_i386::i386_info): Same.
8434 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8435 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8436 fields attributes_section and attributes_vendor.
8437 * sparc.cc (Target_sparc::sparc_info): Same.
8438 * target.h (Target::attributes_section, Target::attributes_vendor,
8439 Target::is_attributes_section, Target::attribute_arg_type,
8440 Target::attributes_order): New method definitions.
8441 (Target::Target_info::attributes_section,
8442 Target::Target_info::attributes_vendor): New fields.
8443 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8444 virtual method definitions.
8445 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8446 attributes_section and attributes_vendor.
8447 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8448
8449 2009-12-05 Doug Kwan <dougkwan@google.com>
8450
8451 * arm.cc: Update comments about interworking and stub generation.
8452 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8453 considered as non-PIC.
8454 (Arm_relocate_functions::base_abs): Fix formatting.
8455 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8456 of function to use GOT entry address instead of offset.
8457 (Target_arm::Scan::global): Issue an error if a symbol would need a
8458 PLT does not get one because it is untyped. Remove code to create
8459 dynamic symbols for relative branches.
8460 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8461 takes unsigned integer instead of boolean.
8462
8463 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8464
8465 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8466 (two_file_test_LDADD): Likewise.
8467 (common_test_1_LDADD): Likewise.
8468 (exception_test_LDADD) Likewise.
8469 (weak_test_LDADD): Likewise.
8470 (many_sections_test_LDADD): Likewise.
8471 (initpri1_LDADD): Likewise.
8472 (script_test_1_LDADD): Likewise.
8473 (script_test_2_LDADD): Likewise.
8474 (justsyms_LDADD): Likewise.
8475 (binary_test_LDADD): Likewise.
8476 (large_LDADD): Likewise.
8477 * testsuite/Makefile.in: Regenerated.
8478
8479 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
8480
8481 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8482 (Symbol_table::override_with_special): Likewise.
8483 (Symbol_table::add_from_object): Likewise.
8484
8485 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8486
8487 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8488 Don't set the data_offset twice.
8489
8490 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8491
8492 * testsuite/Makefile.in: Regenerate.
8493
8494 2009-12-03 Doug Kwan <dougkwan@google.com>
8495
8496 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8497 (Target_arm::do_finalize_sections): Add parameter for symbol table
8498 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8499 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8500 parameter for symbol table pointer.
8501 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8502 an additional parameter for a pointer to symbol table.
8503 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8504 parameter for a symbol table pointer.
8505 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8506 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8507 Ditto.
8508 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8509 parameter for a symbol table pointer.
8510
8511 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
8512
8513 * incremental.cc (Incremental_inputs_header)
8514 (Incremental_inputs_header_write, Incremental_inputs_entry)
8515 (Incremental_inputs_entry_write): Move ...
8516 * incremental.h (Incremental_inputs_header)
8517 (Incremental_inputs_header_write, Incremental_inputs_entry)
8518 (Incremental_inputs_entry_write): here.
8519
8520 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8521
8522 * incremental.cc (make_sized_incremental_binary): Set the target.
8523 Error if it is incompatible.
8524 * output.h (Output_file): Add filename method.
8525
8526 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8527
8528 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8529 from the get_* methods.
8530
8531 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8532
8533 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8534 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8535 Write 0 for the data_offset of scripts.
8536
8537 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8538
8539 * testsuite/Makefile.am: Add the incremental_test.sh test.
8540 * testsuite/incremental_test.sh: New.
8541 * testsuite/incremental_test_1.c: New.
8542 * testsuite/incremental_test_2.c: New.
8543
8544 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8545
8546 * incremental-dump.cc (main): Fix typos.
8547
8548 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8549
8550 PR gold/11025
8551 * incremental-dump.cc (main): Use llu to print 64 bit values.
8552
8553 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8554 H.J. Lu <hongjiu.lu@intel.com>
8555
8556 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8557 $(LIBDL).
8558 (incremental_dump_LDADD): Likewise.
8559 * Makefile.in: Regenerated.
8560
8561 2009-11-25 Doug Kwan <dougkwan@google.com>
8562
8563 Revert:
8564
8565 2009-11-25 Doug Kwan <dougkwan@google.com>
8566
8567 * arm.cc (Target_arm::Target_arm): Move method definition
8568 outside of class definition. Add code to handle
8569 --target1-rel, --target1-abs and --target2= options.
8570 (Target_arm::get_reloc_reloc_type): Change method to be
8571 non-static and const.
8572 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8573 New data member declaration.
8574 (Target_arm::Scan::local, Target_arm::Scan::global,
8575 Target_arm::Relocate::relocate,
8576 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8577 Adjust call to Target_arm::get_real_reloc_type.
8578 (Target_arm::get_real_reloc_type): Use command line options
8579 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8580 * options.h (--target1-rel, --target1-abs, --target2): New
8581 ARM-only options.
8582
8583 2009-11-25 Doug Kwan <dougkwan@google.com>
8584
8585 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8586 class definition. Add code to handle --target1-rel, --target1-abs
8587 and --target2= options.
8588 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8589 and const.
8590 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8591 member declaration.
8592 (Target_arm::Scan::local, Target_arm::Scan::global,
8593 Target_arm::Relocate::relocate,
8594 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8595 call to Target_arm::get_real_reloc_type.
8596 (Target_arm::get_real_reloc_type): Use command line options to
8597 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8598 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8599 options.
8600
8601 2009-11-25 Doug Kwan <dougkwan@google.com>
8602
8603 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8604 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8605 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8606 formatting.
8607 (Arm_relocate_functions::thm_call): Replace body with a call to
8608 Arm_relocate_functions::thumb_branch_common.
8609 (Arm_relocate_functions::thm_jump24,
8610 Arm_relocate_functions::thm_xpc22): New method definitions.
8611 (Arm_relocate_functions::thumb_branch_common): New method definition.
8612 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8613 operator.
8614 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8615 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8616
8617 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8618
8619 * Makefile.am: Build incremental-dump
8620 * Makefile.in: Regenerate.
8621 * incremental-dump.cc: New.
8622 * incremental.cc (Incremental_inputs_header_data,
8623 Incremental_inputs_entry_data): Move to incremental.h
8624 * incremental.h: (Incremental_inputs_header_data,
8625 Incremental_inputs_entry_data): Move from incremental.cc
8626
8627 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8628
8629 * incremental.cc (Incremental_inputs_header,
8630 Incremental_inputs_header_write, Incremental_inputs_entry,
8631 Incremental_inputs_entry_write): Add a typedef with the data type.
8632
8633 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8634
8635 * incremental.cc (Incremental_inputs_header,
8636 Incremental_inputs_header_write, Incremental_inputs_entry,
8637 Incremental_inputs_entry_write): Update comment about which
8638 type has the filed descriptions.
8639
8640 2009-11-15 Doug Kwan <dougkwan@google.com>
8641
8642 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8643 (Arm_relocate_functions::arm_branch_common): Change method defintion
8644 in class definition to a method declaration and update list of formal
8645 parameters.
8646 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8647 Arm_relocation_functions::jump24): Adjust call to
8648 Arm_relocate_functions::arm_branch_common. Update list of formal
8649 parameters.
8650 (Arm_relocate_functions::xpc25): New method definition.
8651 (Arm_relocate_functions::arm_branch_common): Move method defintion
8652 out from class definition. Use stubs for mode-switching and extending
8653 branch ranges.
8654 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8655 specially. Change code to enable use of stubs in ARM branches.
8656
8657 2009-11-10 Doug Kwan <dougkwan@google.com>
8658
8659 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8660 in method declaration.
8661 (Target_arm::relocate_stub): New method declaration.
8662 (Target_arm::default_target): Change to return a pointer instead of
8663 a const reference.
8664 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8665 Target_arm::default_target.
8666 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8667 method definition.
8668 (Target_arm::relocate_section): Adjust view.
8669 (Target_arm::relocate_stub): New method definition.
8670
8671 2009-11-10 Doug Kwan <dougkwan@google.com>
8672
8673 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8674 a format warning.
8675 * incremental.cc (open_incremental_binary): Initialized local
8676 variables to avoid warnings.
8677 * object.cc (make_elf_object): Ditto.
8678 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8679 a format warning.
8680
8681 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8682
8683 PR gold/10930
8684 * testsuite/plugin_test.c: Include "config.h".
8685
8686 2009-11-09 Doug Kwan <dougkwan@google.com>
8687
8688 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8689 (arm_symbol_value): Remove.
8690 (Arm_relocate_functions::arm_branch_common,
8691 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8692 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8693 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8694 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8695 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8696 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8697 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8698 Arm_relocate_functions::thm_mobw_abs_nc,
8699 Arm_relocate_functions::thm_mov_abs,
8700 Arm_relocate_functions::movw_prel_nc,
8701 Arm_relocate_functions::thm_movt_abs,
8702 Arm_relocate_functions::movt_prel,
8703 Arm_relocate_functions::thm_movw_prel_nc,
8704 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8705 (Target_arm::Relocate::relocate): Only decompose address into two
8706 parts if relocation type uses the thumb-bit and pass the actual
8707 bit instead of a flag indicating that the thumb-bit is used. Adjust
8708 calls to methods in Arm_relocate_functions for this change.
8709
8710 2009-11-08 Ian Lance Taylor <iant@google.com>
8711
8712 PR 10925
8713 * reloc.cc: Instantiate
8714 Sized_relobj::initialize_input_to_output_maps and
8715 Sized_relobj:free_input_to_output_maps.
8716
8717 2009-11-06 Ian Lance Taylor <iant@google.com>
8718
8719 PR 10876
8720 * defstd.cc (in_segment): Set only_if_ref true for "end".
8721
8722 2009-11-06 Doug Kwan <dougkwan@google.com>
8723
8724 * arm.cc (class Reloc_stub): Correct a comment.
8725 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8726 (Target_arm::scan_section_for_stubs): New method declaration.
8727 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8728 Change methods from private to protected.
8729 (Target_arm::do_may_relax): New method definition.
8730 (Target_arm::do_relax, Target_arm::group_sections,
8731 Target_arm::scan_reloc_for_stub,
8732 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8733 (Target_arm::arm_input_section_map_): New data member declaration.
8734 (Target_arm::scan_reloc_for_stub,
8735 Target_arm::scan_reloc_section_for_stubs,
8736 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8737 Target_arm::do_relax): New method definitions.
8738
8739 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8740
8741 * configure.ac: Check for (struct stat)::st_mtim
8742 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8743 * config.in: Regenerate.
8744 * configure: Regenerate.
8745
8746 2009-11-05 Ian Lance Taylor <iant@google.com>
8747
8748 PR 10910
8749 * output.cc (Output_segment::add_output_section): Add missing
8750 return statement.
8751
8752 2009-11-04 Ian Lance Taylor <iant@google.com>
8753
8754 PR 10880
8755 * object.h (class Object): Add is_needed and set_is_needed
8756 methods. Add is_needed_ field. Make bool fields into bitfields.
8757 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8758 defined in a dynamic object and referenced by a regular object,
8759 set is_needed for the dynamic object.
8760 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8761 if the file is marked with as_needed and it is not needed.
8762
8763 2009-11-04 Ian Lance Taylor <iant@google.com>
8764
8765 PR 10887
8766 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8767 tags if data is discarded by linker script.
8768 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8769 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8770 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8771 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8772
8773 2009-11-04 Ian Lance Taylor <iant@google.com>
8774
8775 * layout.cc (Layout::get_output_section): Add is_interp and
8776 is_dynamic_linker_section parameters. Change all callers.
8777 (Layout::choose_output_section): Likewise.
8778 (Layout::make_output_section): Likewise.
8779 (Layout::add_output_section_data): Add is_dynamic_linker_section
8780 parameter. Change all callers.
8781 * layout.h (class Layout): Update declarations.
8782 * output.h (class Output_section): Add is_interp, set_is_interp,
8783 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8784 Add is_interp_, is_dynamic_linker_section_ fields. Change
8785 generate_code_fills_at_write_ to a bitfield.
8786 * output.cc (Output_section::Output_sections): Initialize new
8787 fields.
8788 (Output_segment::add_output_section): Add do_sort parameter.
8789 Change all callers.
8790
8791 2009-11-03 Ian Lance Taylor <iant@google.com>
8792
8793 PR 10860
8794 * options.h (class General_options): Add --warn-common.
8795 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8796 merging two common symbols.
8797 (Symbol_table::should_override): Handle --warn-common when merging
8798 a common symbol with a defined symbol. Use report_resolve_problem
8799 for multiple definitions.
8800 (Symbol_table::report_resolve_problem): New function.
8801 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8802
8803 2009-11-03 Doug Kwan <dougkwan@google.com>
8804
8805 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8806 stub_factory_.
8807 (Target_arm::stub_factory): New method definition.
8808 (Target_arm::new_arm_input_section,
8809 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8810 Target_arm::reloc_uses_thumb_bit): New method declarations.
8811 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8812 New type definitions.
8813 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8814 member declarations.
8815 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8816 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8817 New method definitions.
8818
8819 2009-11-03 Ian Lance Taylor <iant@google.com>
8820
8821 * options.h (class General_options): Add --warn_constructors.
8822
8823 2009-11-03 Ian Lance Taylor <iant@google.com>
8824
8825 PR 10893
8826 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8827 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8828
8829 2009-11-03 Ian Lance Taylor <iant@google.com>
8830
8831 PR 10895
8832 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8833 --msgid-bugs-address.
8834 (install-pdf): New target.
8835 (install-data_yes): Look up one directory to find mkinstalldirs.
8836
8837 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8838
8839 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8840 tree.
8841
8842 2009-10-30 Doug Kwan <dougkwan@google.com>
8843
8844 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8845
8846 2009-10-30 Doug Kwan <dougkwan@google.com>
8847
8848 * arm.cc (Stub_addend_reader): New struct template definition
8849 and partial specializations.
8850 (Stub_addend_reader::operator()): New method definition for a
8851 partially specialized template.
8852
8853 2009-10-30 Doug Kwan <dougkwan@google.com>
8854
8855 * arm.cc (Arm_relobj::processor_specific_flags): New method
8856 definition.
8857 (Arm_relobj::do_read_symbols): New method declaration.
8858 (Arm_relobj::processor_specific_flags_): New data member declaration.
8859 (Arm_dynobj): New class definition.
8860 (Target_arm::do_finalize_sections): Add input_objects parameter.
8861 (Target_arm::do_adjust_elf_header): New method declaration.
8862 (Target_arm::are_eabi_versions_compatible,
8863 (Target_arm::merge_processor_specific_flags): New method declaration.
8864 (Target_arm::do_make_elf_object): New overloaded method definitions
8865 and declaration.
8866 (Arm_relobj::do_read_symbols): New method definition.
8867 (Arm_dynobj::do_read_symbols): Ditto.
8868 (Target_arm::do_finalize_sections): Add input_objects parameters.
8869 Merge processor-specific flags from all input objects.
8870 (Target_arm::are_eabi_versions_compatible,
8871 Target_arm::merge_processor_specific_flags,
8872 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8873 New method definitions.
8874 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8875 Input_objects pointer type parameter.
8876 * layout.cc (Layout::finalize): Pass input objects to target's.
8877 finalize_sections function.
8878 * output.cc (Output_file_header::do_sized_write): Set ELF file
8879 header's processor-specific flags.
8880 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8881 Input_objects pointer type parameter.
8882 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8883 * target.h (Input_objects): New forward class declaration.
8884 (Target::processor_specific_flags,
8885 Target::are_processor_specific_flags_sect): New method definitions.
8886 (Target::finalize_sections): Add input_objects parameter.
8887 (Target::Target): Initialize processor_specific_flags_ and
8888 are_processor_specific_flags_set_.
8889 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8890 parameter.
8891 (Target::set_processor_specific_flags): New method definition.
8892 (Target::processor_specific_flags_,
8893 Target::are_processor_specific_flags_set_): New data member
8894 declarations.
8895 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8896 Input_objects pointer type parameter.
8897
8898 2009-10-30 Doug Kwan <dougkwan@google.com>
8899
8900 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8901
8902 2009-10-28 Ian Lance Taylor <iant@google.com>
8903
8904 * object.h (class Relobj): Drop options parameter from
8905 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8906 do_scan_relocs, do_relocate. Change all callers.
8907 (class Sized_relobj): Drop options parameters from
8908 do_gc_process_relocs, do_scan_relocs, do_relocate,
8909 do_relocate_sections, relocate_sections, emit_relocs_scan,
8910 emit_relocs_scan_reltype. Change all callers.
8911 (struct Relocate_info): Remove options field and all references to
8912 it.
8913 * reloc.h (class Read_relocs): Remove options constructor
8914 parameter and options_ field. Change all callers.
8915 (class Gc_process_relocs, class Scan_relocs): Likewise.
8916 (class Relocate_task): Likewise.
8917 * target-reloc.h (scan_relocs): Remove options parameter. Change
8918 all callers.
8919 (scan_relocatable_relocs): Likewise.
8920 * target.h (class Sized_target): Remove options parameter from
8921 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8922 all callers.
8923 * gc.h (gc_process_relocs): Remove options parameter. Change all
8924 callers.
8925 * arm.cc: Update functions to remove options parameters.
8926 * i386.cc: Likewise.
8927 * powerpc.cc: Likewise.
8928 * sparc.cc: Likewise.
8929 * x86_64.cc: Likewise.
8930 * testsuite/testfile.cc: Likewise.
8931
8932 2009-10-28 Doug Kwan <dougkwan@google.com>
8933
8934 * arm.cc (Arm_relobj): New class definition.
8935 (Arm_relobj::scan_sections_for_stubs,
8936 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8937 New method definitions.
8938
8939 2009-10-28 Cary Coutant <ccoutant@google.com>
8940
8941 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8942 (Plugin::cleanup_done_): New member.
8943 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8944 (Plugin_manager::cleanup_done_): Remove.
8945 (Plugin_manager::add_input_file): Edit error message.
8946 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8947 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8948
8949 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8950
8951 * fileread.cc: (File_read::View::~View): Use the new
8952 data_ownership_ filed.
8953 (File_read::~File_read): Dispose the new whole_file_view_.
8954 (File_read::open): Mmap the whole file if needed.
8955 (File_read::open): Use whole_file_view_ instead of contents_.
8956 (File_read::find_view): Use whole_file_view_ if applicable.
8957 (File_read::do_read): Use whole_file_view_ instead of contents_.
8958 (File_read::make_view): Use whole_file_view_ instead of contents_,
8959 update File_read::View::View call.
8960 (File_read::find_or_make_view): Update File_read::View::View
8961 call.
8962 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8963 remove contents_
8964 (File_read::View::Data_ownership): New enum.
8965 (File_read::View::View): Replace bool mapped_ with Data_ownership
8966 argument.
8967 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8968 (File_read::View::data_ownership_): New field.
8969 (File_read::contents_): Remove (replaced by whole_file_view_).
8970 (File_read::whole_file_view_): New field.
8971 * options.h (class General_options): Add --keep-files-mapped.
8972
8973 2009-10-27 Cary Coutant <ccoutant@google.com>
8974
8975 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8976 * testsuite/Makefile.am (plugin_test_5): New test case.
8977 * testsuite/Makefile.in: Regenerate.
8978
8979 2009-10-25 Doug Kwan <dougkwan@google.com>
8980
8981 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8982 from private to protected to allow access by child class.
8983 (Sized_relobj::do_relocate_sections): New method declaration.
8984 (Sized_relobj::relocate_sections): Virtualize.
8985 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8986 Sized_relobj::relocate_sections. Instantiate template explicitly
8987 for different target sizes and endianity.
8988
8989 2009-10-24 Doug Kwan <dougkwan@google.com>
8990
8991 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8992 (Arm_input_section::as_arm_input_section): New method.
8993 (Arm_output_section): New class definition.
8994 (Arm_output_section::create_stub_group,
8995 Arm_output_section::group_sections): New method definitions.
8996
8997 2009-10-22 Doug Kwan <dougkwan@google.com>
8998
8999 * arm.cc (Arm_input_section): New class definition.
9000 (Arm_input_section::init, Arm_input_section:do_write,
9001 Arm_input_section::set_final_data_size,
9002 Arm_input_section::do_reset_address_and_file_offset): New method
9003 definitions.
9004
9005 2009-10-21 Doug Kwan <dougkwan@google.com>
9006
9007 * arm.cc (Stub_table, Arm_input_section): New forward class
9008 declarations.
9009 (Stub_table): New class defintion.
9010 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9011 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9012 New method definition.
9013
9014 2009-10-21 Doug Kwan <dougkwan@google.com>
9015
9016 * arm.cc: Update copyright comments.
9017 (Target_arm): New forward class template declaration.
9018 (Arm_address): New type.
9019 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9020 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9021 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9022 constants.
9023 (Insn_template): Same.
9024 (DEF_STUBS): New macro.
9025 (Stub_type): New enum type.
9026 (Stub_template): New class definition.
9027 (Stub): Same.
9028 (Reloc_stub): Same.
9029 (Stub_factory): Same.
9030 (Target_arm::Target_arm): Initialize may_use_blx_ and
9031 should_force_pic_veneer_.
9032 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9033 Target_arm::should_force_pic_veneer,
9034 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9035 Target_arm::using_thumb_only, Target_arm:;default_target): New
9036 method defintions.
9037 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9038 New data member declarations.
9039 (Insn_template::size, Insn_template::alignment): New method defintions.
9040 (Stub_template::Stub_template): New method definition.
9041 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9042 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9043 (Stub_factory::Stub_factory): New method definition.
9044 * gold.h (string_hash): New template.
9045 * output.h (Input_section_specifier::hash_value): Use
9046 gold::string_hash.
9047 (Input_section_specifier::string_hash): Remove.
9048 * stringpool.cc (Stringpool_template::string_hash): Use
9049 gold::string_hash.
9050
9051 2009-10-20 Doug Kwan <dougkwan@google.com>
9052
9053 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9054 symbols of relaxed input sections.
9055 * output.h (Output_section::find_relaxed_input_section): Make
9056 method public.
9057
9058 2009-10-16 Doug Kwan <dougkwan@google.com>
9059
9060 * dynobj.cc (Versions::Versions): Initialize version_script_.
9061 Only insert base version symbol definition for a shared object
9062 if version script defines any version versions.
9063 (Versions::define_base_version): New method definition.
9064 (Versions::add_def): Check that base version is not needed.
9065 (Versions::add_need): Define base version lazily.
9066 * dynobj.h (Versions::define_base_version): New method declaration.
9067 (Versions::needs_base_version_): New data member declaration.
9068 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9069 (check_DATA): Add no_version_test.stdout.
9070 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9071 New make rules.
9072 * testsuite/Makefile.in: Regenerate.
9073 * testsuite/no_version_test.c: New file.
9074 * testsuite/no_version_test.sh: Ditto.
9075
9076 2009-10-16 Doug Kwan <dougkwan@google.com>
9077
9078 * expression.cc (class Segment_start_expression): New class definition.
9079 (Segment_start_expression::value): New method definition.
9080 (script_exp_function_segment_start): Return a new
9081 Segment_start_expression.
9082 * gold/script-c.h (script_saw_segment_start_expression): New function
9083 prototype.
9084 * script-sections.cc (Script_sections::Script_sections): Initialize
9085 SAW_SEGMENT_START_EXPRESSION_ to false.
9086 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9087 and -Tbbs options to specify section addresses if given in
9088 command line and no SEGMENT_START expression is seen in a script.
9089 * script-sections.h (Script_sections::saw_segment_start_expression,
9090 Script_sections::set_saw_segment_start_expression): New method
9091 definition.
9092 (Script_sections::saw_segment_start_expression_): New data member
9093 declaration.
9094 * script.cc (script_saw_segment_start_expression): New function.
9095 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9096 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9097 script_test_7.sh and script_test_8.sh.
9098 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9099 script_test_8.stdout.
9100 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9101 (script_test_6, script_test_6.stdout, script_test_7,
9102 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9103 * Makefile.in: Regenerate.
9104 * testsuite/script_test_6.sh: New file.
9105 * testsuite/script_test_6.t: Same.
9106 * testsuite/script_test_7.sh: Same.
9107 * testsuite/script_test_7.t: Same.
9108 * testsuite/script_test_8.sh: Same.
9109
9110 2009-10-16 Doug Kwan <dougkwan@google.com>
9111
9112 * output.cc (Output_segment::set_section_list_address): Cast
9113 expressions to unsigned long long type to avoid format warnings.
9114
9115 2009-10-15 Ian Lance Taylor <iant@google.com>
9116
9117 * script.cc (Script_options::add_symbol_assignment): Always add a
9118 dot assignment to script_sections_.
9119 * script-sections.cc (Script_sections::add_dot_assignment):
9120 Initialize if necessary.
9121
9122 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9123 program headers with no load segment if there is a linker script.
9124
9125 * layout.cc (Layout::set_segment_offsets): Align the file offset
9126 to the segment aligment for -N or -n with no load segment.
9127 * output.cc (Output_segment::add_output_section): Don't crash if
9128 the first section is a TLS section.
9129 (Output_segment::set_section_list_addresses): Print an error
9130 message if the address moves backward in a linker script.
9131 * script-sections.cc
9132 (Output_section_element_input::set_section_addresses): Don't
9133 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9134 (Orphan_output_section::set_section_addresses): Likewise.
9135
9136 2009-10-15 Doug Kwan <dougkwan@google.com>
9137
9138 * layout.cc (Layout::finish_dynamic_section): Generate tags
9139 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9140 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9141 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9142
9143 2009-10-14 Ian Lance Taylor <iant@google.com>
9144
9145 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9146 fields.
9147 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9148 data_shdr fields of relinfo.
9149 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9150 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9151 R_386_TLS_LDO_32, adjust based on section flags.
9152 (Target_i386::Relocate::fix_up_ldo): Remove.
9153
9154 2009-10-13 Ian Lance Taylor <iant@google.com>
9155
9156 Add support for -pie.
9157 * options.h (class General_options): Add -pie and
9158 --pic-executable.
9159 (General_options::output_is_position_independent): Test -pie.
9160 (General_options::output_is_executable): Return true if not shared
9161 and not relocatable.
9162 (General_options::output_is_pie): Remove.
9163 * options.cc (General_options::finalize): Reject incompatible uses
9164 of -pie.
9165 * gold.cc (queue_middle_tasks): A -pie link is not static.
9166 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9167 * symtab.cc (Symbol::final_value_is_known): Return false if
9168 output_is_position_independent.
9169 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9170 output_is_position_independent.
9171 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9172 output_is_position_independent.
9173 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9174 output_is_position_independent.
9175 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9176 two_file_pie_test.
9177 (basic_pie_test.o, basic_pie_test): New targets.
9178 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9179 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9180 (two_file_pie_test): New target.
9181 * testsuite/Makefile.in: Rebuild.
9182 * README: Remove note saying that -pie is not supported.
9183
9184 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9185
9186 * options.h (class General_options): Add -init and -fini.
9187 * layout.cc (Layout::finish_dynamic_section): Emit
9188 given init and fini functions.
9189
9190 2009-10-13 Sriraman Tallam <tmsriram@google.com>
9191
9192 * gc.h (gc_process_relocs): Check if icf is enabled using new
9193 function.
9194 * gold.cc (queue_initial_tasks): Likewise.
9195 (queue_middle_tasks): Likewise.
9196 * object.cc (do_layout): Likewise.
9197 * symtab.cc (is_section_folded): Likewise.
9198 * main.cc (main): Likewise.
9199 * reloc.cc (Read_relocs::run): Likewise.
9200 (Sized_relobj::do_scan_relocs): Likewise.
9201 * icf.cc (is_function_ctor_or_dtor): New function.
9202 (Icf::find_identical_sections): Check if function is ctor or dtor when
9203 safe icf is chosen.
9204 * options.h (General_options::icf): Change option to be an enum.
9205 (Icf_status): New enum.
9206 (icf_enabled): New method.
9207 (icf_safe_folding): New method.
9208 (set_icf_status): New method.
9209 (icf_status_): New variable.
9210 * (options.cc) (General_options::finalize): Set icf_status_.
9211 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9212 icf_test and icf_keep_unique_test to use the --icf enum flag.
9213 * testsuite/icf_safe_test.sh: New file.
9214 * testsuite/icf_safe_test.cc: New file.
9215
9216 2009-10-12 Sriraman Tallam <tmsriram@google.com>
9217
9218 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9219 includes to gc.h and icf.h.
9220 * arm.cc: Include gc.h.
9221 * gold.cc: Likewise.
9222 * i386.cc: Likewise.
9223 * powerpc.cc: Likewise.
9224 * sparc.cc: Likewise.
9225 * x86_64.cc: Likewise.
9226 * gc.h: Include icf.h.
9227
9228 2009-10-11 Ian Lance Taylor <iant@google.com>
9229
9230 * plugin.cc: Include "gold.h" before other header files.
9231
9232 2009-10-10 Chris Demetriou <cgd@google.com>
9233
9234 * options.h (Input_file_argument::Input_file_type): New enum.
9235 (Input_file_argument::is_lib_): Replace with...
9236 (Input_file_argument::type_): New member.
9237 (Input_file_argument::Input_file_argument): Take Input_file_type
9238 'type' rather than boolean 'is_lib' as second argument.
9239 (Input_file_argument::is_lib): Use type_.
9240 (Input_file_argument::is_searched_file): New function.
9241 (Input_file_argument::may_need_search): Handle is_searched_file.
9242 * options.cc (General_options::parse_library): Support -l:filename.
9243 (General_options::parse_just_symbols): Update for Input_file_argument
9244 changes.
9245 (Command_line::process): Likewise.
9246 * archive.cc (Archive::get_file_and_offset): Likewise.
9247 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9248 * script.cc (read_script_file, script_add_file): Likewise.
9249 * fileread.cc (Input_file::Input_file): Likewise.
9250 (Input_file::will_search_for): Handle is_searched_file.
9251 (Input_file::open): Likewise.
9252 * readsyms.cc (Read_symbols::get_name): Likewise.
9253 * testsuite/Makefile.am (searched_file_test): New test.
9254 * testsuite/Makefile.in: Regenerate.
9255 * testsuite/searched_file_test.cc: New file.
9256 * testsuite/searched_file_test_lib.cc: New file.
9257
9258 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9259 Ian Lance Taylor <iant@google.com>
9260
9261 * descriptor.cc: Include <cstdio> and "binary-io.h".
9262 (Descriptors::open): Open the files in binary mode always.
9263 * script.cc (Lex::get_token): Treat \r as whitespace.
9264
9265 2009-10-09 Ian Lance Taylor <iant@google.com>
9266
9267 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9268
9269 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9270 Ian Lance Taylor <iant@google.com>
9271
9272 * configure.ac: Check for readv function also.
9273 * fileread.cc (readv): Define if not HAVE_READV.
9274 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9275 does not exist.
9276 * config.in: Regenerate.
9277 * configure: Regenerate.
9278
9279 2009-10-09 Doug Kwan <dougkwan@google.com>
9280
9281 * layout.cc (Layout::make_output_section): Call target hook to make
9282 ordinary output section.
9283 (Layout::finalize): Adjust parameter list of call the
9284 Target::may_relax().
9285 * layout.h (class Layout::section_list): New method.
9286 * merge.h (Output_merge_base::entsize): Change visibility to public.
9287 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9288 New methods.
9289 (Output_merge_string::do_is_string): New method.
9290 * object.cc (Sized_relobj::do_setup): renamed from
9291 Sized_relobj::set_up.
9292 * object.h (Sized_relobj::adjust_shndx,
9293 Sized_relobj::initializ_input_to_output_maps,
9294 Sized_relobj::free_input_to_output_maps): Change visibilities to
9295 protected.
9296 (Sized_relobj::setup): Virtualize.
9297 (Sized_relobj::do_setup): New method declaration.
9298 (Sized_relobj::invalidate_section_offset,
9299 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9300 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9301 * options.cc (parse_int): New function.
9302 * options.h (parse_int): New declaration.
9303 (DEFINE_int): New macro.
9304 (stub_group_size): New option.
9305 * output.cc (Output_section::Output_section): Initialize memebers
9306 merge_section_map_, merge_section_by_properties_map_,
9307 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9308 (Output_section::add_input_section): Handled deferred code-fill
9309 generation and remove an old comment.
9310 (Output_section::add_relaxed_input_section): New method definition.
9311 (Output_section::add_merge_input_section): Use merge section by
9312 properties map to speed to search. Update merge section maps
9313 as appropriate.
9314 (Output_section::build_relaxation_map): New method definition.
9315 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9316 Same.
9317 (Output_section::relax_input_section): Renamed to
9318 Output_section::convert_input_sections_to_relaxed_sections and change
9319 interface to take a vector of pointers to relaxed sections.
9320 (Output_section::find_merge_section,
9321 Output_section::find_relaxed_input_section): New method definitions.
9322 (Output_section::is_input_address_mapped,
9323 Output_section::output_offset, Output_section::output_address):
9324 Use output section data maps to speed up searching.
9325 (Output_section::find_starting_output_address): Add comments.
9326 (Output_section::do_write,
9327 Output_section::write_to_postprocessing_buffer): Do code-fill
9328 generation as appropriate.
9329 (Output_section::get_input_sections): Invalidate relaxed input section
9330 map.
9331 (Output_section::restore_states): Adjust type of checkpoint .
9332 Invalidate relaxed input section map.
9333 * output.h (Output_merge_base): New class declaration.
9334 (Input_section_specifier): New class defintion.
9335 (class Output_relaxed_input_section) Change base class to
9336 Output_section_data_build.
9337 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9338 base class initializer.
9339 (Output_section::add_relaxed_input_section): New method declaration.
9340 (Output_section::Input_section): Change visibility to protected.
9341 (Output_section::Input_section::relobj,
9342 Output_section::Input_section::shndx): Handle relaxed input sections.
9343 Output_section::input_sections) Change visibility to protected. Also
9344 define overload to return a non-const pointer.
9345 (Output_section::Merge_section_properties): New class defintion.
9346 (Output_section::Merge_section_by_properties_map,
9347 Output_section::Output_section_data_by_input_section_map,
9348 Output_section::Relaxation_map): New types.
9349 (Output_section::relax_input_section): Rename method to
9350 Output_section::convert_input_sections_to_relaxed_sections and change
9351 interface to take a vector of relaxed section pointers.
9352 (Output_section::find_merge_section,
9353 Output_section::find_relaxed_input_section,
9354 Output_section::build_relaxation_map,
9355 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9356 New method declarations.
9357 (Output_section::merge_section_map_
9358 Output_section::merge_section_by_properties_map_,
9359 Output_section::relaxed_input_section_map_,
9360 Output_section::is_relaxed_input_section_map_valid_,
9361 Output_section::generate_code_fills_at_write_): New data members.
9362 * script-sections.cc
9363 (Output_section_element_input::set_section_addresses): Call
9364 current_data_size and addralign methods of relaxed input sections.
9365 (Orphan_output_section::set_section_addresses): Call current_data_size
9366 and addralign methods of relaxed input sections.
9367 * symtab.cc (Symbol_table::compute_final_value): Extract template
9368 from the body of Symbol_table::sized_finalize_symbol.
9369 (Symbol_table::sized_finalized_symbol): Call
9370 Symbol_table::compute_final_value.
9371 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9372 (Symbol_table::compute_final_value): New templated method declaration.
9373 * target.cc (Target::do_make_output_section): New method defintion.
9374 * target.h (Target::make_output_section): New method declaration.
9375 (Target::relax): Add more parameters for input objects, symbol table
9376 and layout. Adjust call to do_relax.
9377 (Target::do_make_output_section): New method declaration.
9378 (Target::do_relax): Add parameters for input objects, symbol table
9379 and layout.
9380
9381 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9382
9383 * pread.c: Include stdio.h.
9384
9385 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9386
9387 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9388 defined.
9389
9390 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9391
9392 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9393 Change read_shndx type to unsigned int.
9394 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9395 int.
9396 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9397 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9398 Change read_shndx type to unsigned int.
9399 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9400 int.
9401 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9402 * layout.cc (Layout::create_symtab_sections): Cast the result of
9403 local_symcount * symsize to off_t in the gold_assert.
9404
9405 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9406
9407 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9408 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9409 R_ARM_BASE_ABS.
9410 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9411 (Arm_relocate_functions::thm_abs5): New function.
9412 (Arm_relocate_functions::abs12): New function.
9413 (Arm_relocate_functions::abs16): New function.
9414 (Arm_relocate_functions::base_abs): New function.
9415 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9416 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9417 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9418 R_ARM_BASE_ABS.
9419 (Scan::global): Likewise.
9420 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9421 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9422 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9423 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9424 R_ARM_BASE_ABS.
9425
9426 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9427
9428 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9429 (Arm_relocate_functions::movt_prel): New function.
9430 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9431 (Arm_relocate_functions::thm_movt_prel): New function.
9432 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9433 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9434 (Scan::global, Relocate::relocate): Likewise.
9435 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9436
9437 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9438
9439 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9440 Incremental_checker.
9441 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9442 unsigned int.
9443 (class Incremental_inputs_header): New class.
9444 (Incremental_inputs_header_writer): Edit comment.
9445 (Incremental_inputs_entry): New class.
9446 (Incremental_inputs_entry_writer): Edit comment.
9447 (Sized_incremental_binary::do_find_incremental_inputs_section):
9448 Add *strtab_shndx parameter, fill it.
9449 (Sized_incremental_binary::do_check_inputs): New method.
9450 (Incremental_checker::can_incrementally_link_output_file): Use
9451 Sized_incremental_binary::check_inputs.
9452 (Incremental_inputs::report_command_line): Save command line in
9453 command_line_.
9454 * incremental.h:
9455 (Incremental_binary::find_incremental_inputs_section): New
9456 method.
9457 (Incremental_binary::do_find_incremental_inputs_section): Add
9458 strtab_shndx parameter.
9459 (Incremental_binary::do_check_inputs): New pure virtual method.
9460 (Sized_incremental_binary::do_check_inputs): Declare.
9461 (Incremental_checker::Incremental_checker): Add incremental_inputs
9462 parameter, use it to initialize incremental_inputs_.
9463 (Incremental_checker::incremental_inputs_): New field.
9464 (Incremental_checker::command_line): New method.
9465 (Incremental_checker::inputs): New method.
9466 (Incremental_checker::command_line_): New field.
9467
9468 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9469
9470 * incremental.cc: Include <cstdarg> and "target-select.h".
9471 (vexplain_no_incremental): New function.
9472 (explain_no_incremental): New function.
9473 (Incremental_binary::error): New method.
9474 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9475 method.
9476 (make_sized_incremental_binary): New function.
9477 (open_incremental_binary): New function.
9478 (can_incrementally_link_file): Add checks if output is ELF and has
9479 inputs section.
9480 * incremental.h: Include "elfcpp_file.h" and "output.h".
9481 (Incremental_binary): New class.
9482 (Sized_incremental_binary): New class.
9483 (open_incremental_binary): Declare.
9484 * object.cc (is_elf_object): Use
9485 elfcpp::Elf_recognizer::is_elf_file.
9486 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9487 * output.h (Output_file::filesize): New method.
9488
9489 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9490
9491 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9492 New function.
9493 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9494 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9495 function.
9496 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9497 function.
9498 (Arm_relocate_functions::movw_abs_nc): New function.
9499 (Arm_relocate_functions::movt_abs): New function.
9500 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9501 (Arm_relocate_functions::thm_movt_abs): New function.
9502 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9503 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9504 (Scan::global): Likewise.
9505 (Relocate::relocate): Likewise.
9506 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9507
9508 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9509
9510 * arm.cc (Arm_relocate_functions::got_prel) New function.
9511 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9512 (Relocate::relocate): Likewise.
9513 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9514
9515 2009-10-06 Ian Lance Taylor <iant@google.com>
9516
9517 * options.h (class General_options): Define
9518 split_stack_adjust_size parameter.
9519 * object.h (class Object): Add uses_split_stack_ and
9520 has_no_split_stack_ fields. Add uses_split_stack and
9521 has_no_split_stack accessor functions. Declare
9522 handle_split_stack_section.
9523 (class Reloc_symbol_changes): Define.
9524 (class Sized_relobj): Define Function_offsets. Declare
9525 split_stack_adjust, split_stack_adjust_reltype, and
9526 find_functions.
9527 * object.cc (Object::handle_split_stack_section): New function.
9528 (Sized_relobj::do_layout): Call handle_split_stack_section.
9529 * dynobj.cc (Sized_dynobj::do_layout): Call
9530 handle_split_stack_section.
9531 * reloc.cc (Sized_relobj::relocate_sections): Call
9532 split_stack_adjust for executable sections in split_stack
9533 objects. Pass reloc_map to relocate_section.
9534 (Sized_relobj::split_stack_adjust): New function.
9535 (Sized_relobj::split_stack_adjust_reltype): New function.
9536 (Sized_relobj::find_functions): New function.
9537 * target-reloc.h: Include "object.h".
9538 (relocate_section): Add reloc_symbol_changes parameter. Change
9539 all callers.
9540 * target.h (class Target): Add calls_non_split method. Declare
9541 do_calls_non_split virtual method. Declare match_view and
9542 set_view_to_nop.
9543 * target.cc: Include "elfcpp.h".
9544 (Target::do_calls_non_split): New function.
9545 (Target::match_view): New function.
9546 (Target::set_view_to_nop): New function.
9547 * gold.cc (queue_middle_tasks): Give an error if mixing
9548 split-stack and non-split-stack objects with -r.
9549 * i386.cc (Target_i386::relocate_section): Add
9550 reloc_symbol_changes parameter.
9551 (Target_i386::do_calls_non_split): New function.
9552 * x86_64.cc (Target_x86_64::relocate_section): Add
9553 reloc_symbol_changes parameter.
9554 (Target_x86_64::do_calls_non_split): New function.
9555 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9556 parameter.
9557 * powerpc.cc (Target_powerpc::relocate_section): Add
9558 reloc_symbol_changes parameter.
9559 * sparc.cc (Target_sparc::relocate_section): Add
9560 reloc_symbol_changes parameter.
9561 * configure.ac: Call AM_CONDITIONAL for the default target.
9562 * configure: Rebuild.
9563 * testsuite/Makefile.am (TEST_AS): New variable.
9564 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9565 (check_DATA): Add split_i386 and split_x86_64 files.
9566 (SPLIT_DEFSYMS): Define.
9567 (split_i386_[1234n].o): New targets.
9568 (split_i386_[124]): New targets.
9569 (split_i386_[1234r].stdout): New targets.
9570 (split_x86_64_[1234n].o): New targets.
9571 (split_x86_64_[124]): New targets.
9572 (split_x86_64_[1234r].stdout): New targets.
9573 (MOSTLYCLEANFILES): Add new executables.
9574 * testsuite/split_i386.sh: New file.
9575 * testsuite/split_x86_64.sh: New file.
9576 * testsuite/split_i386_1.s: New file.
9577 * testsuite/split_i386_2.s: New file.
9578 * testsuite/split_i386_3.s: New file.
9579 * testsuite/split_i386_4.s: New file.
9580 * testsuite/split_i386_n.s: New file.
9581 * testsuite/split_x86_64_1.s: New file.
9582 * testsuite/split_x86_64_2.s: New file.
9583 * testsuite/split_x86_64_3.s: New file.
9584 * testsuite/split_x86_64_4.s: New file.
9585 * testsuite/split_x86_64_n.s: New file.
9586 * testsuite/testfile.cc (Target_test): Update relocation_section
9587 function.
9588 * testsuite/Makefile.in: Rebuild.
9589
9590 2009-10-06 Ian Lance Taylor <iant@google.com>
9591
9592 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9593 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9594 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9595 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9596 the address on ldo_addrs_.
9597 (Target_i386::Relocate::fix_up_ldo): New function.
9598
9599 2009-10-06 Rafael Espindola <espindola@google.com>
9600
9601 * plugin.cc (add_input_library): New.
9602 (Plugin::load): Add add_input_library to tv.
9603 (Plugin_manager::add_input_file): Add the is_lib argument.
9604 (add_input_file): Update call to Plugin_manager::add_input_file.
9605 (add_input_library): New.
9606 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9607
9608 2009-09-30 Doug Kwan <dougkwan@google.com>
9609
9610 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9611 symbol and call Symbol::may_need_copy_reloc to determine if
9612 a copy reloc is needed.
9613 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9614 nocopyreloc is given in command line.
9615 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9616 given in command line.
9617 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9618 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9619 of the removed Target_i386::may_need_copy_reloc.
9620 * options.h (copyreloc): New option with default value false.
9621 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9622 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9623 instead of the removed Target_powerpc::may_need_copy_reloc.
9624 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9625 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9626 instead of the removed Target_sparc::may_need_copy_reloc.
9627 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9628 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9629 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9630 instead of the removed Target_x86_64::may_need_copy_reloc.
9631
9632 2009-09-30 Ian Lance Taylor <iant@google.com>
9633
9634 * object.h (class Object): Remove target_ field, and target,
9635 sized_target, and set_target methods.
9636 (Object::sized_target): Remove.
9637 (class Sized_relobj): Update declarations. Remove sized_target.
9638 * object.cc (Sized_relobj::setup): Remove target parameter.
9639 Change all callers.
9640 (Input_objects::add_object): Don't do anything with the target.
9641 (make_elf_sized_object): Add punconfigured parameter. Change all
9642 callers. Set or test parameter target.
9643 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9644 Change all callers.
9645 * parameters.cc (Parameters::set_target): Change parameter type to
9646 be non-const.
9647 (Parameters::default_target): Remove.
9648 (set_parameters_target): Change parameter type to be non-const.
9649 (parameters_force_valid_target): New function.
9650 (parameters_clear_target): New function.
9651 * parameters.h (class Parameters): Update declarations. Remove
9652 default_target method. Add sized_target and clear_target
9653 methods. Change target_ to be non-const.
9654 (set_parameters_target): Update declaration.
9655 (parameters_force_valid_target): Declare.
9656 (parameters_clear_target): Declare.
9657 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9658 as NULL if we aren't searching.
9659 (Add_symbols::run): Don't check for compatible target.
9660 * fileread.cc (Input_file::open_binary): Call
9661 parameters_force_valid_target.
9662 * gold.cc (queue_middle_tasks): Likewise.
9663 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9664 set_target on object.
9665 * dynobj.h (class Sized_dynobj): Update declarations.
9666 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9667 make_elf_object returns NULL.
9668 (Archive::include_member): Don't check whether object target is
9669 compatible.
9670 * output.cc (Output_section::add_input_section): Get target from
9671 parameters.
9672 (Output_section::relax_input_section): Likewise.
9673 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9674 parameters.
9675 (Sized_relobj::do_scan_relocs): Likewise.
9676 (Sized_relobj::relocate_sections): Likewise.
9677 * resolve.cc (Symbol_table::resolve): Likewise.
9678 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9679 parameter. Change all callers.
9680 (Symbol_table::add_from_object): Get target from parameters.
9681 (Symbol_table::add_from_relobj): Don't check object target.
9682 (Symbol_table::add_from_dynobj): Likewise.
9683 (Symbol_table::define_special_symbol): Get target from
9684 parameters.
9685 * symtab.h (class Symbol_table): Update declaration.
9686 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9687 parameter. Change all callers. Clear parameter target.
9688 (Binary_test): Test target here.
9689 * testsuite/object_unittest.cc (gold_testsuite): Remove
9690 target_test_pointer parameter. Change all callers.
9691 (Object_test): Test target here.
9692
9693 2009-09-26 Ian Lance Taylor <iant@google.com>
9694
9695 * testsuite/initpri1.c: Don't try to use constructor priorities if
9696 compiling with gcc before 4.3.
9697
9698 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9699
9700 * testsuite/retain_symbols_file_test.sh (check_present): Change
9701 output file name to retain_symbols_file_test.stdout.
9702 (check_absent): Likewise.
9703
9704 2009-09-18 Craig Silverstein <csilvers@google.com>
9705
9706 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9707 * options.cc: Include <cerrno> and <fstream>.
9708 (General_options::finalize): Parse -retain-symbols-file tag.
9709 * options.h: New flag.
9710 (General_options): New method should_retain_symbol, new
9711 variable symbols_to_retain.
9712 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9713 should_retain_symbol map.
9714 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9715 * testsuite/Makefile.in: Regenerate.
9716 * testsuite/retain_symbols_file_test.sh: New file.
9717
9718 2009-09-18 Nick Clifton <nickc@redhat.com>
9719
9720 * po/es.po: Updated Spanish translation.
9721
9722 2009-09-17 Doug Kwan <dougkwan@google.com>
9723
9724 * debug.h (DEBUG_RELAXATION): New constant.
9725 (DEBUG_ALL): Add DEBUG_RELAXATION.
9726 (debug_string_to_enum): Add relaxation debug option.
9727 * layout.cc
9728 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9729 Layout::Relaxation_debug_check::read_sections,
9730 Layout::Relaxation_debug_check::read_sections): New method definitions.
9731 (Layout::Layout): Initialize data members
9732 record_output_section_data_from_scrips_,
9733 script_output_section_data_list_ and relaxation_debug_check_.
9734 (Layout::save_segments, Layout::restore_segments,
9735 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9736 Layout::relaxation_loop_body): New method definitions.
9737 (Layout::finalize): Support relaxation. Move section layout code to
9738 Layout::relaxation_loop_body.
9739 (Layout::set_asection_address_from_script): Move code for orphan
9740 section placement out.
9741 (Layout::place_orphan_sections_in_script): New method definition.
9742 * layout.h (Output_segment_headers, Output_file_header):
9743 New forward class declarations.
9744 (Layout::~Layout): Define.
9745 (Layout::new_output_section_data_from_script): New method definition.
9746 (Layout::place_orphan_sections_in_script): New method declaration.
9747 (Layout::Segment_states): New type declaration.
9748 (Layout::save_segments, Layout::restore_segments,
9749 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9750 Layout::relaxation_loop_body): New method declarations.
9751 (Layout::Output_section_data_list): New type declaration.
9752 (Layout::Relaxation_debug_check): New class definition.
9753 (Layout::record_output_section_data_from_script_,
9754 Layout::script_output_section_data_list_, Layout::segment_states_,
9755 Layout::relaxation_debug_check_): New data members.
9756 * output.cc: (Output_section_headers::do_size): New method definition.
9757 (Output_section_headers::Output_section_headers): Move size
9758 computation to Output_section_headers::do_size.
9759 (Output_segment_headers::do_size): New method definition.
9760 (Output_file_header::Output_file_header): Move size computation to
9761 Output_file_header::do_size and call it.
9762 (Output_file_header::do_size): New method definition.
9763 (Output_data_group::Output_data_group): Adjust call to
9764 Output_section_data.
9765 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9766 (Output_symtab_xindex::do_write): Add array bound check.
9767 (Output_section::Input_section::print_to_mapfile): Handle
9768 RELAXED_INPUT_SECTION_CODE.
9769 (Output_section::Output_section): Initialize data member checkpoint_.
9770 (Output_section::~Output_section): Delete checkpoint object pointed
9771 by checkpoint_.
9772 (Output_section::add_input_section): Always add an Input_section if
9773 relaxing.
9774 (Output_section::add_merge_input_section): Add assert.
9775 (Output_section::relax_input_section): New method definition.
9776 (Output_section::set_final_data_size): Set load address to zero for
9777 an unallocated section.
9778 (Output_section::do_address_and_file_offset_have_reset_values):
9779 New method definition.
9780 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9781 Handle relaxed input section.
9782 (Output_section::sort_attached_input_sections): Checkpoint input
9783 section list lazily.
9784 (Output_section::get_input_sections): Change type of input_sections to
9785 list of Simple_input_section pointers. Checkpoint input section list
9786 lazily. Also handle relaxed input sections.
9787 (Output_section::add_input_section_for_script): Take a reference to
9788 a Simple_input_section object instead of Relobj pointer and section
9789 index as parameter. Handle relaxed input sections.
9790 (Output_section::save_states, Output_section::restore_states): New
9791 method definitions.
9792 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9793 (Output_data::is_data_size_fixed): New method definition.
9794 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9795 if it is fixed.
9796 (Output_data::address_and_file_offset_have_reset_values): New method
9797 definition.
9798 (Output_data::do_address_and_file_offset_have_reset_values): New method
9799 definition.
9800 (Output_data::set_data_size): Check that data size is not fixed.
9801 (Output_data::fix_data_size): New method definition.
9802 (Output_data::is_data_size_fixed_): New data member.
9803 (Output_section_headers::set_final_data_size): New method definition.
9804 (Output_section_headers::do_size): New method declaration.
9805 (Output_segment_headers::set_final_data_size): New method definition.
9806 (Output_segment_headers::do_size): New method declaration.
9807 (Output_file_header::set_final_data_size)::New method definition.
9808 (Output_file_header::do_size)::New method declaration.
9809 (Output_section_data::Output_section_data): Add new parameter
9810 is_data_size_fixed and use it to fix data size.
9811 (Output_data_const::Output_data_const): Adjust call to base class
9812 constructor and fix data size.
9813 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9814 base class constructor and fix data size.
9815 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9816 base class constructor and fix data size.
9817 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9818 class constructor and fix data size.
9819 (Output_data_group::set_final_data_size): New method definition.
9820 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9821 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9822 class constructor and fix data size.
9823 (Output_relaxed_input_section): New class definition.
9824 (Output_section::Simple_input_section): New class definition.
9825 (Output_section::get_input_sections): Adjust parameter list.
9826 (Output_section::add_input_section_for_script): Same.
9827 (Output_section::save_states, Output_section::restore_states,
9828 Output_section::do_address_and_file_offset_have_reset_values,
9829 (Output_section::Input_section::Input_section): Handle
9830 RELAXED_INPUT_SECTION_CODE. Add new overload for
9831 Output_relaxed_input_section.
9832 (Output_section::Input_section::is_input_section,
9833 Output_section::Input_section::set_output_section): Handle relaxed
9834 input section.
9835 (Output_section::Input_section::is_relaxed_input_section,
9836 Output_section::Input_section::output_section_data,
9837 Output_section::Input_section::relaxed_input_section): New method
9838 definitions.
9839 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9840 value.
9841 (Output_section::Input_section::u1_): Update comments.
9842 (Output_section::Input_section::u2_): Add new union member poris.
9843 (Output_section::Checkpoint_output_section): New classs definition.
9844 (Output_section::relax_input_section): New method declaration.
9845 (Output_section::checkpoint_): New data member.
9846 (Output_segment): Update comments.
9847 (Output_segment::Output_segment): Un-privatize copy constructor.
9848 (Output_segment::operator=): Un-privatize.
9849 * script-sections.cc (Output_section_element::Input_section_list):
9850 Change element type to Output_section::Simple_input_section.
9851 (Output_section_element_dot_assignment::set_section_addresses):
9852 Register output section data for relaxation clean up.
9853 (Output_data_exression::Output_data_expression): Adjust call to base
9854 constructor to fix data size.
9855 (Output_section_element_data::set_section_addresses): Register
9856 Output_data_expression object for relaxation clean up.
9857 (struct Input_section_info): Replace Relobj pointer and section index
9858 pair with Output_section::Simple_input_section and Convert struct to a
9859 class.
9860 (Input_section_sorter::operator()): Adjust access to
9861 Input_section_info data member to use accessors.
9862 (Output_section_element_input::set_section_addresses): Use layout
9863 parameter. Adjust code to use Output_section::Simple_input_section
9864 and Input_secction_info classes. Register filler for relaxation
9865 clean up.
9866 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9867 and section index pair with Output_section::Simple_input_section
9868 class. Adjust code accordingly.
9869 (Phdrs_element::release_segment): New method definition.
9870 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9871 segment list.
9872 (Script_sections::release_segments): New method definition.
9873 * gold/script-sections.h (Script_sections::release_segments): New
9874 method declaration.
9875 * gold/target.h (Target::may_relax, Target::relax,
9876 Target::do_may_relax, Target::do_relax): New method definitions.
9877
9878 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9879
9880 * arm.cc (has_signed_unsigned_overflow): New function.
9881 (Arm_relocate_functions::abs8): New function.
9882 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9883 (Target_arm::Scan::global): Likewise.
9884 (Target_arm::relocate::relocate): Likewise.
9885 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9886 Likewise.
9887
9888 2009-09-16 Cary Coutant <ccoutant@google.com>
9889
9890 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9891 * testsuite/Makefile.in: Regenerate.
9892
9893 2009-09-11 Nick Clifton <nickc@redhat.com>
9894
9895 * po/gold.pot: Updated by the Translation project.
9896
9897 2009-09-08 Cary Coutant <ccoutant@google.com>
9898
9899 * output.cc (Output_file::open): Add execute permission to empty file.
9900 * testsuite/Makefile.am (permission_test): New test.
9901 * testsuite/Makefile.in: Regenerate.
9902
9903 2009-09-02 Ian Lance Taylor <iant@google.com>
9904
9905 * output.cc (Output_file::resize): Call map_no_anonymous rather
9906 than map.
9907
9908 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9909
9910 * gold.cc: Include "incremental.h".
9911 (queue_initial_tasks): Call Incremental_checker methods.
9912 * incremental.cc: Include "output.h".
9913 (Incremental_checker::can_incrementally_link_output_file): New
9914 method.
9915 * incremental.h (Incremental_checker): New class.
9916
9917 * output.cc (Output_file::open_for_modification): New method.
9918 (Output_file::map_anonymous): Changed return type to bool. Record
9919 map in base_ field.
9920 (Output_file::map_no_anonymous): New method, broken out of map.
9921 (Output_file::map): Use map_no_anonymous and map_anonymous.
9922 * output.h (class Output_file): Update declarations.
9923
9924 2009-08-24 Cary Coutant <ccoutant@google.com>
9925
9926 * options.h (Command_line::Pre_options): New class.
9927 (Command_line::pre_options): New member.
9928 * options.cc (gold::options::ready_to_register): New variable.
9929 (One_option::register_option): Do nothing if not registering options.
9930 Assert if same short option registered twice.
9931 (General_options::General_options): Turn off option registration when
9932 done constructing.
9933 (Command_line::Pre_options::Pre_options): New constructor.
9934
9935 2009-08-24 Cary Coutant <ccoutant@google.com>
9936
9937 * options.h (General_options::no_keep_memory): Remove incorrect
9938 short option.
9939
9940 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9941
9942 * Makefile.am (am__skiplex, am__skipyacc): New.
9943 * Makefile.in: Regenerate.
9944
9945 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9946
9947 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9948 (INCLUDES): ... this.
9949 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9950 (AM_CPPFLAGS): Renamed from ...
9951 (INCLUDE): ... this.
9952 * Makefile.in, testsuite/Makefile.in: Regenerate.
9953
9954 * Makefile.in: Regenerate.
9955 * aclocal.m4: Likewise.
9956 * config.in: Likewise.
9957 * configure: Likewise.
9958 * testsuite/Makefile.in: Likewise.
9959
9960 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9961 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9962 * Makefile.in: Regenerate.
9963 * testsuite/Makefile.in: Regenerate.
9964
9965 2009-08-19 Cary Coutant <ccoutant@google.com>
9966
9967 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9968 symbols in shared libraries overridden by hidden or internal symbols
9969 in the main program.
9970
9971 2009-08-19 Chris Demetriou <cgd@google.com>
9972
9973 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9974 checking source file names in error messages.
9975
9976 2009-08-18 Doug Kwan <dougkwan@google.com>
9977
9978 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9979 an elcpp::Ehdr as parameter. Adjust call to set_target.
9980 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9981 an elfcpp::Ehdr as parameter.
9982 * object.cc (Object::set_target): Remove the version that looks up
9983 a target and sets it.
9984 (Sized_relobj::setup): Take a Target object instead of
9985 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9986 (make_elf_sized_object): Find target and ask target to
9987 make an ELF object.
9988 * object.h: (Object::set_target): Remove the version that looks up
9989 a target and sets it.
9990 (Sized_relobj::setup): Take a Target object instead of
9991 an elfcpp:Ehdr as parameter.
9992 * target.cc: Include dynobj.h.
9993 (Target::do_make_elf_object_implementation): New.
9994 (Target::do_make_elf_object): New.
9995 * target.h (Target::make_elf_object): New template declaration.
9996 (Target::do_make_elf_object): New method declarations.
9997 (Target::do_make_elf_object_implementation): New template declaration.
9998
9999 2009-08-14 Ian Lance Taylor <iant@google.com>
10000
10001 * gold.h (FUNCTION_NAME): Define.
10002 (gold_unreachable): Use FUNCTION_NAME.
10003
10004 2009-08-12 Sriraman Tallam <tmsriram@google.com>
10005
10006 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10007 symbol in the --keep-unique list is not found.
10008
10009 2009-08-12 Sriraman Tallam <tmsriram@google.com>
10010
10011 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10012 been maked as --keep-unique.
10013 (Icf::unfold_section): New function.
10014 * icf.h (Icf::unfold_section): New function.
10015 * options.h (General_options::keep_unique): New option.
10016 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10017 * testsuite/Makefile.in: Regenerate.
10018 * testsuite/icf_keep_unique_test.sh: New file.
10019 * testsuite/icf_keep_unique_test.cc: New file.
10020
10021 2009-08-12 Cary Coutant <ccoutant@google.com>
10022
10023 PR 10471
10024 * resolve.cc (Symbol_table::resolve): Check for references from
10025 dynamic objects to hidden and internal symbols.
10026 * testsuite/Makefile.am (hidden_test.sh): New test.
10027 * testsuite/Makefile.in: Regenerate.
10028 * testsuite/hidden_test.sh: New script.
10029 * testsuite/hidden_test_1.c: New test source.
10030 * testsuite/hidden_test_main.c: New test source.
10031
10032 2009-08-11 Doug Kwan <dougkwan@google.com>
10033
10034 * arm.cc: Update comments.
10035 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10036 segment to locate the .ARM.exidx section if present.
10037
10038 2009-08-09 Doug Kwan <dougkwan@google.com>
10039
10040 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10041 patch.
10042
10043 2009-08-07 Sriraman Tallam <tmsriram@google.com>
10044 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10045 compiler warnings.
10046
10047 2009-08-06 Sriraman Tallam <tmsriram@google.com>
10048
10049 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10050 valid tls_segment only for non-debug-section relocations.
10051 * testsuite/Makefile.am: Add gc_tls_test.
10052 * testsuite/Makefile.in: Regenerate.
10053 * testsuite/gc_tls_test.cc: New file.
10054 * testsuite/gc_tls_test.sh: New file.
10055
10056 2009-08-05 Sriraman Tallam <tmsriram@google.com>
10057
10058 * icf.cc: New file.
10059 * icf.h: New file.
10060 * Makefile.am (CCFILES): Add icf.cc.
10061 (HFILES): Add icf.h
10062 * Makefile.in: Regenerate.
10063 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10064 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10065 section, symbol and addend information for the relocs.
10066 * gold.cc (queue_middle_tasks): Call identical code folding.
10067 * gold.h: Add defines for multimap.
10068 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10069 to the call of finalize_local_symbols.
10070 * main.cc (main): Create object of class Icf.
10071 * object.cc (Sized_relobj::do_layout): Allow this function to be
10072 called twice during icf.
10073 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10074 to sections marked as identical by icf.
10075 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10076 when available.
10077 (Sized_relobj::do_section_entsize): New function.
10078 * object.h (Object::section_entsize): New function.
10079 (Object::do_section_entsize): New pure virtual function.
10080 (Relobj::finalize_local_symbols): Add new parameter.
10081 (Relobj::do_section_entsize): New function.
10082 * options.h (General_options::icf): New option.
10083 (General_options::icf_iterations): New option.
10084 (General_options::print_icf_sections): New option.
10085 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10086 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10087 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10088 icf.
10089 * symtab.cc (Symbol_table::is_section_folded): New function.
10090 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10091 to sections marked as identical by icf.
10092 * symtab.h (Symbol_table::set_icf): New function.
10093 (Symbol_table::icf): New function.
10094 (Symbol_table::is_section_folded): New function.
10095 (Symbol_table::icf_): New data member.
10096 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10097 * testsuite/Makefile.am: Add commands to build icf_test.
10098 * testsuite/Makefile.in: Regenerate.
10099 * testsuite/icf_test.sh: New file.
10100 * testsuite/icf_test.cc: New file.
10101
10102 2009-07-24 Chris Demetriou <cgd@google.com>
10103
10104 * layout.cc (is_compressible_debug_section): Fix incorrect
10105 comment about compressed section names.
10106
10107 2009-07-20 Ian Lance Taylor <ian@airs.com>
10108
10109 PR 10419
10110 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10111
10112 2009-07-16 Ian Lance Taylor <iant@google.com>
10113
10114 PR 10400
10115 * layout.h: #include <map>.
10116 (class Kept_section): Change from struct to class. Add accessors
10117 and setters. Add section size to Comdat_group mapping. Change
10118 Comdat_group to std::map. Add is_comdat_ field. Add
10119 linkonce_size field in union.
10120 (class Layout): Update declaration of find_or_add_kept_section.
10121 Don't declare find_kept_object.
10122 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10123 parameter. Add object, shndx, is_comdat, and is_group_name
10124 parameters. Change all callers. Adjust for new Kept_section.
10125 (Layout::find_kept_object): Remove.
10126 * object.cc (Sized_relobj::include_section_group): Update use of
10127 Kept_section. Rename secnum to shndx. Only record
10128 Kept_comdat_section if sections are the same size.
10129 (Sized_relobj::include_linkonce_section): Update use of
10130 Kept_section. Only record Kept_comdat_section if sections are the
10131 same size. Set size of linkonce section.
10132 (Sized_relobj::map_to_kept_section): Update call to
10133 get_kept_comdat_section.
10134 * object.h (class Sized_relobj): Rename fields in
10135 Kept_comdat_section to drop trailing underscores; change object
10136 field to Relobj*. Change Kept_comdat_section_table to store
10137 struct rather than pointer.
10138 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10139 Add kept_object and kept_shndx parameters. Change all callers.
10140 (Sized_relobj::get_kept_comdat_section): Change return type to
10141 bool. Add kept_object and kept_shndx parameters. Change all
10142 callers.
10143 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10144 Layout::find_or_add_kept_section.
10145
10146 2009-07-09 Ian Lance Taylor <iant@google.com>
10147
10148 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10149 Reserve space in the hash table.
10150
10151 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10152
10153 * fileread.cc (File_read::get_mtime): New method.
10154 * fileread.h (Timespec): New structure.
10155 (File_read::get_mtime): New method.
10156 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10157 Renamed from timestamp_nsec.
10158 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10159 Elf_Xword.
10160 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
10161 timestamp_nsec.
10162 (Incremental_inputs::report_archive): Save mtime; style fix.
10163 (Incremental_inputs::report_obejct): Save mtime; style fix.
10164 (Incremental_inputs::report_script): Save mtime; style fix.
10165 (Incremental_inputs::finalize_inputs): Style fix.
10166 (Incremental_inputs::finalize): Style fix.
10167 (Incremental_inputs::create_input_section_data): Store inputs
10168 mtime.
10169 * incremental.h (Incremental_inputs::report_script): Add mtime
10170 argument.
10171 (Incremental_inputs::Input_info::Input_info): Intialize only one
10172 union member.
10173 (Incremental_inputs::Input_info::archive): Move to nameless
10174 union.
10175 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10176 (Incremental_inputs::Input_info::script): Move to nameless union.
10177 (Incremental_inputs::mtime): New field.
10178 * script.cc (read_input_script): Pass file mtime to
10179 Incremental_input.
10180 * script.h (Script_info::inputs): Style fix.
10181
10182 2009-07-01 Ian Lance Taylor <ian@airs.com>
10183
10184 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10185 instead of 32.
10186
10187 2009-06-24 Ian Lance Taylor <iant@google.com>
10188
10189 PR 10156
10190 * layout.cc (Layout::choose_output_section): If we find an
10191 existing section, update the flags.
10192 (Layout::create_notes): New function, broken out of
10193 Layout::finalize.
10194 (Layout::finalize): Don't create note sections.
10195 (Layout::create_note): Don't crash if linker script discards
10196 section.
10197 (Layout::create_gold_note): Likewise.
10198 (Layout::create_build_id): Likewise. Don't set
10199 after_input_sections on the section.
10200 (Layout::create_executable_stack_info): Remove target parameter.
10201 Change caller.
10202 * layout.h (class Layout): Declare create_notes. Update
10203 declaration of create_executable_stack_info.
10204 * gold.cc (queue_middle_tasks): Call create_notes.
10205 * output.cc (Output_section::update_flags_for_input_section): Move
10206 here from output.h. If SHF_ALLOC flag is newly set, mark address
10207 invalid.
10208 * output.h (Output_data::mark_address_invalid): New function.
10209 (class Output_section): Only declare, not define,
10210 update_flags_for_input_section. Remove set_flags.
10211
10212 2009-06-24 Ian Lance Taylor <iant@google.com>
10213
10214 * script-sections.cc (Output_section_definition::
10215 set_section_addresses): Rename shadowing local load_address to
10216 laddr.
10217
10218 2009-06-24 Ian Lance Taylor <iant@google.com>
10219
10220 PR 10244
10221 * reloc.cc (relocate_sections): Skip empty relocation sections.
10222
10223 2009-06-23 Ian Lance Taylor <iant@google.com>
10224
10225 PR 10156
10226 * layout.cc (Layout::create_note): Use choose_output_section
10227 rather than make_output_section.
10228
10229 2009-06-23 Ian Lance Taylor <iant@google.com>
10230
10231 PR 10237
10232 * options.cc (General_options::parse_V): Set printed_version_.
10233 (General_options::General_options): Initialize printed_version_.
10234 * options.h (class General_options): Add printed_version_ field.
10235 * gold.cc (queue_initial_tasks): If there are no input files,
10236 don't give a fatal error if we printed the version information.
10237 (queue_middle_tasks): If using -r with a shared object, give a
10238 fatal error rather than an ordinary error.
10239
10240 2009-06-23 Ian Lance Taylor <iant@google.com>
10241
10242 PR 10219
10243 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10244 (Layout::make_output_section): Set have_stabstr_section_ if we see
10245 a .stab*str section.
10246 (Layout::finalize): Call link_stabs_sections.
10247 (Layout::link_stabs_sections): New file.
10248 * layout.h (class Layout): Add have_stabstr_section_ field.
10249 Declare link_stabs_sections.
10250
10251 2009-06-23 Doug Kwan <dougkwan@google.com>
10252
10253 * Makefile.am (libgold_a_LIBADD): New.
10254 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
10255 * Makefile.in: Regenerate.
10256 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10257 * configure: Regenerate.
10258 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10259 * fileread.cc: Include sys/state.h
10260 * gold.h: Declare memmem and strndup if found missing.
10261 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10262
10263 2009-06-23 Ian Lance Taylor <iant@google.com>
10264
10265 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10266 * configure: Rebuild.
10267
10268 2009-06-23 Ian Lance Taylor <iant@google.com>
10269
10270 PR 10147
10271 * object.cc (Object::section_contents): Don't try to get a view if
10272 the section has length zero.
10273 (Object::handle_gnu_warning_section): If the section is empty, use
10274 the name of the section as the warning.
10275
10276 2009-06-23 Ian Lance Taylor <iant@google.com>
10277
10278 PR 10133
10279 * stringpool.h (class Stringpool_template): Add optimize_ field.
10280 (Stringpool_template::set_optimize): New function.
10281 * stringpool.cc (Stringpool_template::Stringpool_template):
10282 Initialize optimize_ field.
10283 (Stringpool_template::set_string_offsets): Test local optimize
10284 fild rather than parameter.
10285 * layout.cc (Layout::Layout): Call set_optimize on the section
10286 name stringpool.
10287
10288 2009-06-22 Ian Lance Taylor <iant@google.com>
10289
10290 PR 10030
10291 * yyscript.y: Parse TARGET.
10292 * script.cc (script_set_target): New function.
10293 * script-c.h (script_set_target): Declare.
10294 * options.cc (General_options::string_to_object_format): Rename
10295 from string_to_object_format in anonymous namespace. Change
10296 callers.
10297 * options.h (class General_options): Declare
10298 string_to_object_format.
10299
10300 2009-06-22 Ian Lance Taylor <iant@google.com>
10301
10302 * script-sections.cc (Script_sections::create_segments): Don't put
10303 program headers in a PT_LOAD segment if -n or -N.
10304
10305 2009-06-22 Ian Lance Taylor <iant@google.com>
10306
10307 PR 10141
10308 * options.h (class General_options): Add -z lazy and -z now. Sort
10309 -z options into alphabetical order.
10310 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10311
10312 2009-06-21 Ian Lance Taylor <iant@google.com>
10313
10314 * layout.cc (Layout::make_output_section): Call
10315 Target::new_output_section.
10316 (Layout::attach_allocated_section_to_segment): Put large section
10317 sections in a separate load segment with the large segment flag
10318 set.
10319 (Layout::segment_precedes): Sort large data segments after other
10320 load segments.
10321 (align_file_offset): New static function.
10322 (Layout::set_segment_offsets): Use align_file_offset.
10323 * output.h (class Output_section): Add is_small_section_ and
10324 is_large_section_ fields.
10325 (Output_section::is_small_section): New function.
10326 (Output_section::set_is_small_section): New function.
10327 (Output_section::is_large_section): New function.
10328 (Output_section::set_is_large_section): New function.
10329 (Output_section::is_large_data_section): New function.
10330 (class Output_segment): Add is_large_data_segment_ field.
10331 (Output_segment::is_large_data_segment): New function.
10332 (Output_segment::set_is_large_data_segment): New function.
10333 * output.cc (Output_section::Output_section): Initialize new
10334 fields.
10335 (Output_segment::Output_segment): Likewise.
10336 (Output_segment::add_output_section): Add assertion that large
10337 data sections always go in large data segments. Force small data
10338 sections to the end of the list of data sections. Force small BSS
10339 sections to the start of the list of BSS sections. For large BSS
10340 sections to the end of the list of BSS sections.
10341 * symtab.h (class Symbol): Declare is_common_shndx.
10342 (Symbol::is_defined): Check Symbol::is_common_shndx.
10343 (Symbol::is_common): Likewise.
10344 (class Symbol_table): Define enum Commons_section_type. Update
10345 declarations. Add small_commons_ and large_commons_ fields.
10346 * symtab.cc (Symbol::is_common_shndx): New function.
10347 (Symbol_table::Symbol_table): Initialize new fields.
10348 (Symbol_table::add_from_object): Put small and large common
10349 symbols in the right list.
10350 (Symbol_table::sized_finalized_symbol): Check
10351 Symbol::is_common_shndx.
10352 (Symbol_table::sized_write_globals): Likewise.
10353 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10354 common symbol lists. Don't call do_allocate_commons_list if the
10355 list is empty.
10356 (Symbol_table::do_allocate_commons_list): Remove is_tls
10357 parameter. Add comons_section_type parameter. Change all
10358 callers. Handle small and large common symbols.
10359 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10360 Symbol::is_common_shndx.
10361 * resolve.cc (symbol_to_bits): Likewise.
10362 * target.h (Target::small_common_shndx): New function.
10363 (Target::small_common_section_flags): New function.
10364 (Target::large_common_shndx): New function.
10365 (Target::large_common_section_flags): New function.
10366 (Target::new_output_section): New function.
10367 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10368 small_common_section_flags, and large_common_section_flags
10369 fields.
10370 (Target::do_new_output_section): New virtual function.
10371 * arm.cc (Target_arm::arm_info): Initialize new fields.
10372 * i386.cc (Target_i386::i386_info): Likewise.
10373 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10374 Likewise.
10375 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10376 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10377 (Target_x86_64::do_new_output_section): New function.
10378 * configure.ac: Define conditional MCMODEL_MEDIUM.
10379 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10380 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10381 (large_LDFLAGS): Define.
10382 * testsuite/large.c: New file.
10383 * testsuite/testfile.cc (Target_test::test_target_info):
10384 Initialize new fields.
10385 * configure, testsuite/Makefile.in: Rebuild.
10386
10387 2009-06-05 Doug Kwan <dougkwan@google.com>
10388
10389 * Makefile.am (CCFILES): Add target.cc.
10390 * Makefile.in: Regenerate.
10391 * i386.cc (class Target_i386): Define new virtual method to
10392 override do_is_local_label_name in parent.
10393 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10394 local symbols if --discard-locals or -X is given.
10395 * options.h (class General_options): Declare new options
10396 '--discard-locals' and '-X' for discarding locals.
10397 * target.h (class Target): Define new methods is_local_label_name.
10398 Declare new virtual method do_is_local_label_name.
10399 * target.cc: New file.
10400 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10401 (check_SCRIPTS): Add discard_locals_test.sh.
10402 (check_DATA): Add discard_local_tests.syms.
10403 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10404 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10405 * testsuite/Makefile.in: Regenerate.
10406 * testsuite/discard_locals_test.c: New file.
10407 * testsuite/discard_locals_test.sh: Same.
10408
10409 2009-06-05 Doug Kwan <dougkwan@google.com>
10410
10411 * object.cc (Sized_relobj::Sized_relobj): Initialize
10412 discarded_eh_frame_shndx_ to -1U.
10413 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10414 section.
10415 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10416 a discarded .eh_frame section.
10417 (Sized_relobj::do_finalize_local_symbols): Ditto.
10418 * object.h (class Sized_relobj): Declare new member
10419 discarded_eh_frame_shndx_.
10420 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10421 (local_labels_test.o, local_labels_test): New rules.
10422 * testsuite/Makefile.in: Regenerate.
10423
10424 2009-06-04 Doug Kwan <dougkwan@google.com>
10425
10426 * layout.cc (Layout::section_name_mapping): Add mapping for
10427 special ARM sections.
10428
10429 2009-06-03 Doug Kwan <dougkwan@google.com>
10430
10431 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10432 (utils::has_overflow): Same.
10433
10434 2009-06-03 Ian Lance Taylor <iant@google.com>
10435
10436 * layout.cc (Layout::section_name_mapping): New array, replacing
10437 Layout::linkonce_mapping.
10438 (Layout::section_name_mapping_count): New variable, replacing
10439 Layout::linkonce_mapping_count.
10440 (Layout::linkonce_output_name): Remove.
10441 (Layout::output_section_name): Rewrite.
10442 * layout.h (class Layout): Rename Linkonce_mapping to
10443 Section_name_mapping, linkonce_mapping to section_name_mapping,
10444 linkonce_mapping_count to section_name_mapping_count. Don't
10445 declare linkonce_output_name.
10446
10447 2009-06-03 Doug Kwan <dougkwan@google.com>
10448
10449 * gold/arm.cc (namespace utils): New.
10450 (Target_arm::reloc_is_non_pic): Define new method.
10451 (class Arm_relocate_functions): New.
10452 (Target_arm::Relocate::relocate): Handle relocation types used by
10453 Android.
10454
10455 2009-06-03 Ian Lance Taylor <iant@google.com>
10456
10457 * arm.cc (Target_arm::scan::global): Use || instead of |.
10458
10459 2009-06-02 Doug Kwan <dougkwan@google.com>
10460
10461 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10462 issued_non_pic_error_.
10463 (class Target_arm::Scan): Declare new method check_non_pic.
10464 Define new method symbol_needs_plt_entry.
10465 Declare new data member issued_non_pic_error_.
10466 (class Target_arm::Relocate): Declare new method
10467 should_apply_static_reloc.
10468 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10469 (Target_arm::Scan::check_non_pic): Define new method.
10470 (Target_arm::Scan::local): Handle a small subset of reloc types used
10471 by Android.
10472 (Target_arm::Scan::local): Same.
10473 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10474
10475 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10476
10477 * incremental.cc (Incremental_inputs::report_command_line): Filter
10478 out --incremental-* options.
10479
10480 2009-05-29 Doug Kwan <dougkwan@google.com>
10481
10482 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10483 template class.
10484 (class Target_arm): Update comment.
10485 (Target_arm::Target_arm): Initialize new data members GOT_,
10486 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10487 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10488 and Target_arm::rel_dyn_section.
10489 Declare new_enum Target_arm::Got_type.
10490 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10491 and DYNBSS_.
10492 Update commments for member do_dynsym_value.
10493 (Target_arm::got_size, Target_arm::plt_section,
10494 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10495 new methods inside class defintion.
10496 (Target_arm::got_section): Define new method.
10497 (Target_arm::rel_dyn_section): Same.
10498 (Output_data_plt_arm): New template class.
10499 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10500 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10501 (Output_data_plt_arm::add_entry): Same.
10502 (Output_data_plt_arm::first_plt_entry): Define new
10503 static data member for PLT instruction template.
10504 (Output_data_plt_arm::plt_entry): Same.
10505 (Output_data_plt_arm::do_write): Define new method.
10506 (Target_arm::make_plt_entry): Same.
10507 (Target_arm::do_finalize_sections): Same.
10508 (Target_arm::do_dynsym_value): Same.
10509
10510 2009-05-28 Doug Kwan <dougkwan@google.com>
10511
10512 * Makefile.am (TARGETSOURCES): Add arm.cc.
10513 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10514 * Makefile.in: Regenerate.
10515 * arm.cc: New file.
10516 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10517
10518 2009-05-26 Doug Kwan <dougkwan@google.com>
10519
10520 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10521 (General_options::check_excluded_libs): Strip off directories in
10522 archive name before matching like GNU ld does.
10523 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10524 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10525 (exclude_libs_test_LDFLAGS): Add linker option
10526 -Wl,--exclude-libs,libexclude_libs_test_3
10527 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10528 an explicit archive without using -l.
10529 (alt/libexclude_libs_test_3.a): New make rule.
10530 * testsuite/Makefile.in: Regenerate.
10531 * testsuite/exclude_libs_test.c : Declare lib3_default().
10532 (main): Call it.
10533 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10534 * exclude_libs_test_3.c: New file.
10535
10536 2009-05-26 Nick Clifton <nickc@redhat.com>
10537
10538 * po/id.po: New Indonesian translation.
10539 * po/gold.pot: Updated template file.
10540
10541 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10542
10543 * testsuite/Makefile.am: Add -ffunction-sections to compile
10544 gc_comdat_test files. Add -Wl,--gc-sections to build
10545 gc_comdat_test.
10546 * testsuite/Makefile.in: Regenerate.
10547 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10548
10549 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10550
10551 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10552 kept comdat section was garbage collected.
10553 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10554 * testsuite/Makefile.in: Regenerate.
10555 * testsuite/gc_comdat_test.sh: New file.
10556 * testsuite/gc_comdat_test_1.cc: New file.
10557 * testsuite/gc_comdat_test_2.cc: New file.
10558
10559 2009-05-19 Doug Kwan <dougkwan@google.com>
10560
10561 * archive.cc (Archive::Archive): Move constructor from archive.h
10562 to here. Initialize no_export_.
10563 (Archive::get_elf_object_for_member): Set no_export flag of object.
10564 * archive.h (Archive::Archive): Move constructor body to
10565 archive.cc.
10566 (Archive::no_export): New method.
10567 (Archive::no_export_): New field.
10568 * object.h (Object::Object): Initialize no_export_ to false.
10569 (Object::no_export, Object::set_no_export): New methods.
10570 (Object::no_export_): New field.
10571 * options.cc (General_options::parse_exclude_libs): New method.
10572 (General_options::check_excluded_libs) Same.
10573 * options.h (exclude_libs): New option.
10574 (General_options::check_excluded_libs): New method declaration.
10575 (General_options::excluded_libs_): New field.
10576 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10577 default or protected visibility if an object has no-export flag set.
10578 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10579 (check_SCRIPTS): Add exclude_libs_test.sh.
10580 (check_DATA): Add exclude_libs_test.syms.
10581 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10582 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10583 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10584 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10585 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10586 libexclude_libs_test_2.a): New rules.
10587 * testsuite/Makefile.in: Regenerate.
10588 * testsuite/exclude_libs_test.c: New file.
10589 * testsuite/exclude_libs_test.sh: Ditto.
10590 * testsuite/exclude_libs_test_1.c: Ditto.
10591 * testsuite/exclude_libs_test_2.c: Ditto.
10592
10593 2009-05-15 Ian Lance Taylor <iant@google.com>
10594
10595 * configure.ac: Check for declarations for cases where libiberty.h
10596 checks HAVE_DECL_xxx.
10597 * configure, config.in: Rebuild.
10598
10599 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10600
10601 * gold.h (Incremental_argument_list): Remove (invalid) forward
10602 declaration.
10603 * incremental.cc (Incremental_inputs::report_achive): New method.
10604 (Incremental_inputs::report_object): New method.
10605 (Incremental_inputs::report_script): New method.
10606 (Incremental_inputs::finalize_inputs): New method.
10607 (Incremental_inputs::finalize): Call finalize_inputs().
10608 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10609 Create inputs entries.
10610 * incremental.h (Incremental_input_type): New enum.
10611 (Incremental_inputs::Incremental_input): Initialize new fields.
10612 (Incremental_inputs::report_inputs): New method.
10613 (Incremental_inputs::report_achive): New method.
10614 (Incremental_inputs::report_object): New method.
10615 (Incremental_inputs::report_script): New method.
10616 (Incremental_inputs::finalize_inputs): New method.
10617 (Incremental_inputs::Input_info): New struct.
10618 (Incremental_inputs::Input_info_map): New typedef.
10619 (Incremental_inputs::lock_): New field.
10620 (Incremental_inputs::Inputs_): New field.
10621 (Incremental_inputs::Inputs_map): New field.
10622 * main.cc (main): Call Incremental_input::report_inputs.
10623 * options.h (Input_argument_list): Typedef moved from
10624 Input_arguments.
10625 (Input_file_group::Files): Remove, use ::Input_argument_list.
10626 (Input_file_group::Input_argument_list): Remove, use
10627 ::Input_argument_list.
10628 * plugin.cc (Plugin_manager::add_input_file): Add error in
10629 incremental build.
10630 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10631 functions.
10632 * script.cc (read_input_script): Call
10633 Incremental_input::report_script.
10634 * script.h (Script_info): New class.
10635
10636 2009-04-27 Ian Lance Taylor <iant@google.com>
10637
10638 * x86_64.cc (do_adjust_output_section): Set entsize to
10639 plt_entry_size.
10640
10641 2009-04-23 Elliott Hughes <enh@google.com>
10642
10643 * output.cc (Output_file::close): After short writes, continue
10644 writing from the correct offset in the buffer being written.
10645
10646 2009-04-23 Chris Demetriou <cgd@google.com>
10647
10648 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10649 * configure: Regenerate.
10650 * config.in: Regenerate.
10651 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10652 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10653
10654 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10655
10656 * incremental.cc (Incremental_inputs_header_data): Renamed from
10657 Incremental_input_header_data.
10658 (Incremental_inputs_header_data::data_size): New field.
10659 (Incremental_inputs_header_data::put_input_file_count): Renamed
10660 from input_file_count.
10661 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10662 from command_line_offset.
10663 (Incremental_inputs_header_data::put_reserved): Renamed from
10664 put_reserved.
10665 (Incremental_inputs_entry_data): Renamed from
10666 Incremental_input_entry_data.
10667 (Incremental_inputs_entry_data::data_size): New field.
10668 (Incremental_inputs::report_command_line): New method.
10669 (Incremental_inputs::finalize): New method.
10670 (Incremental_inputs::create_incremental_inputs_data): New method.
10671 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10672 * incremental.h: New file.
10673 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10674 (Layout::finalize): Create incremental inputs section in
10675 incremental builds.
10676 (Layout::create_incremental_info_sections): New method.
10677 * layout.h (Layout::incremental_inputs): New method.
10678 (Layout::create_incremental_info_sections): New method.
10679 (Layout::incremental_inputs_): New field.
10680 * main.cc (main): Notify Incremental_input of the command line.
10681
10682 2009-04-01 Ian Lance Taylor <iant@google.com>
10683 Mikolaj Zalewski <mikolajz@google.com>
10684
10685 * gold.h (reserve_unordered_map): Define, three versions, one for
10686 each version of Unordered_map.
10687 * layout.cc (Layout::Layout): Remove options parameter. Add
10688 number_of_input_files parameter. Don't initialize options_.
10689 Initialize number_of_input_files_ and resized_signatures_. Move
10690 sections_are_attached_.
10691 (Layout::layout_group): Reserve space for group_signatures_.
10692 (Layout::find_or_add_kept_section): Change name parameter to be a
10693 reference. Resize signatures_ map when it gets large enough.
10694 (Layout::layout_eh_frame): Use parameters->options() instead of
10695 this->options_.
10696 (Layout::make_output_section): Likewise.
10697 (Layout::attach_allocated_section_to_segment): Likewise.
10698 (Layout::finalize, Layout::create_executable_stack): Likewise.
10699 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10700 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10701 * layout.h (class Layout): Update declarations. Remove options_
10702 field. Add number_of_input_files_ and resized_signatures_
10703 fields. Move sections_are_attached_ field.
10704 * main.cc (main): Pass number of input files to Layout
10705 constructor. Don't pass options.
10706
10707 2009-03-30 Ian Lance Taylor <iant@google.com>
10708
10709 * ffsll.c (ffsll): Correct implementation.
10710
10711 2009-03-27 Ian Lance Taylor <iant@google.com>
10712
10713 * ffsll.c: New file.
10714 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10715 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10716 * ftruncate.c (ftruncate): Declare before definition.
10717 * mremap.c (mremap): Likewise.
10718 * pread.c (pread): Likewise.
10719 * configure, Makefile.in, config.in: Rebuild.
10720
10721 * mremap.c: New file.
10722 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10723 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10724 (mremap): Declare if HAVE_MREMAP is not defined.
10725 * configure, Makefile.in, config.in: Rebuild.
10726
10727 2009-03-27 Cary Coutant <ccoutant@google.com>
10728
10729 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10730 position independent.
10731 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10732 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10733
10734 2009-03-24 Cary Coutant <ccoutant@google.com>
10735
10736 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10737 an executable.
10738 (needs_dynamic_reloc): Likewise.
10739
10740 2009-03-24 Ian Lance Taylor <iant@google.com>
10741
10742 * yyscript.y (file_cmd): Recognize EXTERN.
10743 (extern_name_list, extern_name_list_body): New nonterminals.
10744 * script.cc (script_add_extern): Define.
10745 * script-c.h (script_add_extern): Declare.
10746
10747 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10748
10749 * object.cc (is_elf_object): Define.
10750 * object.h (is_elf_object): Declare.
10751 * archive.cc (Archive::get_elf_object_for_member): Call
10752 is_elf_object.
10753 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10754
10755 2009-03-24 Elliott Hughes <enh@google.com>
10756
10757 * output.cc (Output_file::map_anonymous): Define.
10758 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10759 try an anonymous one. Report the size if the mmap fails.
10760 * output.h (class Output_file): Declare map_anonymous.
10761
10762 2009-03-24 Ian Lance Taylor <iant@google.com>
10763
10764 * target-select.cc (instantiate_target): Don't acquire the lock if
10765 the instantiated_target_ field has already been set.
10766
10767 2009-03-23 Ian Lance Taylor <iant@google.com>
10768
10769 * gold-threads.h (class Initialize_lock): Define.
10770 * gold-threads.cc (class Initialize_lock_once): Define.
10771 (initialize_lock_control): New static variable.
10772 (initialize_lock_pointer): New static variable.
10773 (initialize_lock_once): New static function.
10774 (Initialize_lock::Initialize_lock): Define.
10775 (Initialize_lock::initialize): Define.
10776 * target-select.h: Include "gold-threads.h".
10777 (class Target_selector): Add lock_ and initialize_lock_ fields.
10778 Don't define instantiate_target, just declare it.
10779 * target-select.cc (Target_selector::Target_selector): Initialize
10780 new fields.
10781 (Target_selector::instantiate_target): Define.
10782 * descriptors.h: Include "gold-threads.h".
10783 (class Descriptors): Add initialize_lock_ field.
10784 * descriptors.cc (Descriptors::Descriptors): Initialize new
10785 field.
10786 (Descriptors::open): Use initialize_lock_ field
10787 * errors.h (class Errors): Add initialize_lock_ field.
10788 * errors.cc (Errors::Errors): Initialize new field.
10789 (Errors::initialize_lock): Use initialize_lock_ field.
10790 * powerpc.cc (class Target_selector_powerpc): Remove
10791 instantiated_target_ field. In do_recognize call
10792 instantiate_target rather than do_instantiate_target. In
10793 do_instantiate_target just allocate a new target.
10794 * sparc.cc (class Target_selector_sparc): Likewise.
10795
10796 * freebsd.h: New file.
10797 * i386.cc: Include "freebsd.h".
10798 (Target_i386): Derive from Target_freebsd rather than
10799 Sized_target.
10800 (Target_selector_i386): Derive from Target_selector_freebsd rather
10801 than Target_selector.
10802 * x86_64.cc: Include "freebsd.h".
10803 (Target_x86_64): Derive from Target_freebsd rather than
10804 Sized_target.
10805 (Target_selector_x86_64): Derive from Target_selector_freebsd
10806 rather than Target_selector.
10807 * target.h (class Target): Add adjust_elf_header and
10808 do_adjust_elf_header.
10809 * output.cc (Output_file_header:: do_sized_write): Call target
10810 adjust_elf_header routine.
10811 * configure.tgt: Set targ_osabi.
10812 * configure.ac: Define GOLD_DEFAULT_OSABI.
10813 * parameters.cc (Parameters::default_target): Pass
10814 GOLD_DEFAULT_OSABI to select_target.
10815 * target-select.h (class Target_selector): Make instantiate_target
10816 protected rather than private.
10817 * Makefile.am (HFILES): Add freebsd.h.
10818 * configure, Makefile.in, config.in: Rebuild.
10819
10820 * merge.cc (do_add_input_section): Correct pend value. Change
10821 message about last entry not being null terminated from error to
10822 warning.
10823
10824 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10825
10826 * incremental.cc: New file.
10827 * Makefile.am (CCFILES): Add incremental.cc.
10828 * Makefile.in: Rebuild.
10829
10830 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10831
10832 * layout.cc (Layout::output_section_name): Preserve names
10833 of '.note.' sections.
10834
10835 2009-03-19 Ian Lance Taylor <iant@google.com>
10836
10837 * descriptors.cc (Descriptors::open): Check that the options are
10838 valid before using them.
10839
10840 2009-03-18 Ian Lance Taylor <iant@google.com>
10841
10842 * script-sections.h: Include <list>.
10843 (class Script_sections): Change Sections_elements from std::vector
10844 to std::list. Typedef public Elements_iterator. Add
10845 orphan_section_placement_, data_segment_align_start_, and
10846 saw_data_segment_align_ fields. Remove data_segment_align_index_
10847 field.
10848 * script-sections.cc (class Orphan_section_placement): New class.
10849 (class Sections_element): Add virtual functions is_relro and
10850 orphan_section_init. Remove virtual function place_orphan_here.
10851 (class Output_section_definition): Add is_relro and
10852 orphan_section_init. Remove place_orphan_here.
10853 (class Orphan_output_section): Likewise.
10854 (Script_sections::Script_sections): Update for field changes.
10855 (Script_sections::data_segment_align): Set saw_data_segment_align_
10856 and data_segment_align_start_, not data_segment_align_index.
10857 (Script_sections::data_segment_relro_end): Check
10858 saw_data_segment_align_. Use data_segment_align_start_ rather
10859 than data_segment_align_index_.
10860 (Script_sections::place_orphan): Rewrite to use
10861 Orphan_section_placement.
10862
10863 2009-03-17 Ian Lance Taylor <iant@google.com>
10864
10865 * archive.cc (Archive::add_symbols): Check for a version attached
10866 to the symbol name in the archive map.
10867 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10868 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10869 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10870 (ver_test_11.a): New target.
10871 * testsuite/Makefile.in: Rebuild.
10872
10873 * configure.ac: Check for chsize and posix_fallocate. Replace
10874 ftruncate.
10875 * ftruncate.c: New file, from gnulib.
10876 * output.cc (posix_fallocate): Define dummy version if not
10877 HAVE_POSIX_FALLOCATE.
10878 (Output_file::map): Call posix_fallocate rather than lseek and
10879 write.
10880 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10881 * configure, Makefile.in, config.in: Rebuild.
10882
10883 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10884
10885 * layout.h (Layout::create_note): Add section_name parameter.
10886 * layout.cc (Layout::create_note): Likewise.
10887 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10888
10889 2009-03-17 Ian Lance Taylor <iant@google.com>
10890
10891 * descriptors.cc: Include "options.h".
10892 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10893 (Descriptors::open): Always use O_CLOEXEC when opening a new
10894 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10895 then set FD_CLOEXEC.
10896
10897 * sparc.cc (class Target_sparc): Add has_got_section.
10898 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10899 make sure we have a GOT section.
10900
10901 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10902 (Target_sparc::Scan::local): Likewise.
10903 (Target_sparc::Scan::global): Likewise.
10904 (Target_sparc::Relocate::relocate): Likewise.
10905 (Target_sparc::Relocate::relocate_tls): Likewise.
10906
10907 * symtab.cc (Symbol_table::define_default_version): New function,
10908 broken out of add_from_object.
10909 (Symbol_table::add_from_object): Call define_default_version.
10910 (Symbol_table::define_special_symbol): Add resolve_oldsym
10911 parameter. Change all callers. If the version for a symbol comes
10912 from a version script, resolve it with the symbol with the same
10913 name with no version. Also add the symbol without a version if
10914 appropriate.
10915 (do_define_in_output_data): If resolving with oldsym, don't delete
10916 sym.
10917 (do_define_in_output_segment): Likewise.
10918 (do_define_as_constant): Likewise.
10919 * symtab.h (class Symbol_table): Update declarations.
10920
10921 2009-03-13 Ian Lance Taylor <iant@google.com>
10922
10923 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10924 (Read_symbols::requeue): New function.
10925 (Read_symbols::do_read_symbols): If make_elf_object fails because
10926 the target type is not configured, and the file was searched for,
10927 issue a warning and retry with the next directory.
10928 (Add_symbols::run): If the file has an incompatible format, and
10929 it was searched for, requeue the Read_symbols task. On error,
10930 release the object.
10931 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10932 dirindex parameter to constructor. Change all callers. Declare
10933 incompatible_warning and requeue.
10934 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10935 input_argument_ and input_group_ fields. Add them to
10936 constructor. Change all callers.
10937 (class Read_script): Add dirindex_ field. Add it to constructor.
10938 Change all callers.
10939 * archive.cc (Archive::setup): Remove input_objects parameter.
10940 Change all callers.
10941 (Archive::get_file_and_offset): Likewise.
10942 (Archive::read_all_symbols): Likewise.
10943 (Archive::read_symbols): Likewise.
10944 (Archive::get_elf_object_for_member): Remove input_objects
10945 parameter. Add punconfigured parameter. Change all callers.
10946 (Archive::add_symbols): Change return type to bool. Check return
10947 value of include_member.
10948 (Archive::include_all_members): Likewise.
10949 (Archive::include_member): Change return type to bool. Return
10950 false if first included object has incompatible target. Set
10951 included_member_ field.
10952 (Add_archive_symbols::run): If add_symbols returns false, requeue
10953 Read_symbols task.
10954 * archive.h (class Archive): Add included_member_ field.
10955 Initialize it in constructor. Add input_file and searched_for
10956 methods. Update declarations.
10957 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10958 input_argument_ fields. Add them to constructor. Change all
10959 callers.
10960 * script.cc: Include "target-select.h".
10961 (class Parser_closure): Add skip_on_incompatible_target_ and
10962 found_incompatible_target_ fields. Add
10963 skip_on_incompatible_target parameter to constructor. Change all
10964 callers. Add methods skip_on_incompatible_target,
10965 clear_skip_on_incompatible_target, found_incompatible_target, and
10966 set_found_incompatible_target.
10967 (read_input_script): Add dirindex parameter. Change all callers.
10968 If parser finds an incompatible target, requeue Read_symbols
10969 task.
10970 (script_set_symbol): Clear skip_on_incompatible_target in
10971 closure.
10972 (script_add_assertion, script_parse_option): Likewise.
10973 (script_start_sections, script_add_phdr): Likewise.
10974 (script_check_output_format): New function.
10975 * script.h (read_input_script): Update declaration.
10976 * script-c.h (script_check_output_format): Declare.
10977 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10978 (ignore_cmd): Remove OUTPUT_FORMAT.
10979 * fileread.cc (Input_file::Input_file): Add explicit this.
10980 (Input_file::will_search_for): New function.
10981 (Input_file::open): Add pindex parameter. Change all callers.
10982 * fileread.h (class Input_file): Add input_file_argument method.
10983 Declare will_search_for. Update declarations.
10984 * object.cc (make_elf_object): Add punconfigured parameter.
10985 Change all callers.
10986 * object.h (class Object): Make input_file public. Add
10987 searched_for method.
10988 (make_elf_object): Update declaration.
10989 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10990 restart search.
10991 * dirsearch.h (class Dirsearch): Update declaration.
10992 * options.h (class General_options): Add --warn-search-mismatch.
10993 * parameters.cc (Parameters::is_compatible_target): New function.
10994 * parameters.h (class Parameters): Declare is_compatible_target.
10995 * workqueue.cc (Workqueue::add_blocker): New function.
10996 * workqueue.h (class Workqueue): Declare add_blocker.
10997
10998 * fileread.cc (Input_file::open): Remove options parameter.
10999 Change all callers.
11000 (Input_file::open_binary): Likewise.
11001 * script.cc (read_input_script): Likewise.
11002 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11003 options parameter from constructor. Change all callers.
11004 (class Read_script): Likewise.
11005 * fileread.h (class Input_file): Update declarations.
11006 * script.h (read_input_script): Update declaration.
11007
11008 2009-03-10 Nick Clifton <nickc@redhat.com>
11009
11010 * po/es.po: New Spanish translation.
11011
11012 2009-03-06 Cary Coutant <ccoutant@google.com>
11013
11014 * options.cc (parse_short_option): Keep dash_z from registering itself.
11015
11016 2009-03-03 Ian Lance Taylor <iant@google.com>
11017
11018 PR 9918
11019 * target-reloc.h (relocate_section): Pass output_section to
11020 relocate.
11021 * i386.cc (Target_i386::should_apply_static_reloc): Add
11022 output_section parameter. Change all callers.
11023 (Target_i386::Relocate::relocate): Add output_section parameter.
11024 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11025 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11026 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11027 * testsuite/two_file_shared.sh: New script.
11028 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11029 (check_DATA): Add two_file_shared.dbg.
11030 (two_file_shared.dbg): New target.
11031 * testsuite/Makefile.in: Rebuild.
11032
11033 2009-03-01 Ian Lance Taylor <iant@google.com>
11034
11035 * configure.ac: Check for byteswap.h.
11036 * configure: Rebuild.
11037 * config.in: Rebuild.
11038
11039 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11040
11041 * layout.cc (Layout::find_or_add_kept_section): New function.
11042 (Layout::add_comdat): Removed.
11043 * layout.h (struct Kept_section): Move out of class Layout.
11044 Remove trailing underscores from field names. Add group_sections
11045 field. Rename group_ field to is_group. Change all uses.
11046 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11047 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11048 comdat_groups_ field.
11049 (Sized_relobj::include_section_group): Use
11050 find_or_add_kept_section and Kept_section::group_sections.
11051 (Sized_relobj::include_linkonce_section): Likewise.
11052 * object.cc (class Sized_relobj): Don't define Comdat_group or
11053 Comdat_group_table. Remove find_comdat_group and
11054 add_comdat_group. Remove comdat_groups_ field.
11055 * plugin.cc (include_comdat_group): Use
11056 Layout::find_or_add_kept_section.
11057
11058 2009-02-28 Ian Lance Taylor <iant@google.com>
11059
11060 * README: --gc-sections and map files are now supported. Document
11061 some build requirements.
11062
11063 PR 6992
11064 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11065 relocatable link set the value of the section symbol to zero.
11066 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11067 relocatable link don't include the section address in the local
11068 symbol value.
11069
11070 2009-02-27 Ian Lance Taylor <iant@google.com>
11071
11072 PR 6811
11073 * options.h (class Search_directory): Add is_system_directory.
11074 (class General_options): Declare is_in_system_directory.
11075 * options.cc (get_relative_sysroot): Make static.
11076 (get_default_sysroot): Make static.
11077 (General_optoins::is_in_system_directory): New function.
11078 * fileread.cc (Input_file::is_in_system_directory): New function.
11079 * fileread.h (class Input_file): Declare is_in_system_directory.
11080 * object.h (class Object): Add is_in_system_directory.
11081 (class Input_objects): Remove system_library_directory_ field.
11082 * object.cc (Input_objects::add_object): Don't set
11083 system_library_directory_.
11084 (input_objects::found_in_system_library_directory): Remove.
11085 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11086 parameter. Change all callers.
11087 (Symbol_table::sized_write_globals): Likewise.
11088 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11089 Call Object::is_in_system_directory.
11090 * symtab.h (class Symbol_table): Update declarations.
11091
11092 PR 5990
11093 * descriptors.h (Open_descriptor): Add is_on_stack field.
11094 * descriptors.cc (Descriptors::open): If the descriptor is on the
11095 top of the stack, remove it. Initialize is_on_stack field.
11096 (Descriptors::release): Only add pod to stack if it is not on the
11097 stack already.
11098 (Descriptors::close_some_descriptor): Clear stack_next and
11099 is_on_stack fields.
11100
11101 PR 7091
11102 * output.cc (Output_section::find_starting_output_address): Rename
11103 from starting_output_address; add PADDR parameter; change return
11104 type.
11105 * output.h (class Output_section): Declare
11106 find_starting_output_address instead of starting_output_address.
11107 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11108 section symbol for which we can't find a merge section.
11109
11110 PR 9836
11111 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11112 hidden or internal, force the symbol to be local.
11113 * resolve.cc (Symbol::override_visibility): Define.
11114 (Symbol::override_base): Use override_visibility.
11115 (Symbol_table::resolve): Likewise.
11116 (Symbol::override_base_with_special): Likewise.
11117 (Symbol_table::override_with_special): If the visibility is hidden
11118 or internal, force the symbol to be local.
11119 * symtab.h (class Symbol): Add set_visibility and
11120 override_visibility.
11121 * testsuite/ver_test_1.sh: New file.
11122 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11123 (check_DATA): Add ver_test_1.syms.
11124 (ver_test_1.syms): New target.
11125 * testsuite/Makefile.in: Rebuild.
11126
11127 2009-02-25 Cary Coutant <ccoutant@google.com>
11128
11129 * layout.cc (Layout::choose_output_section): Don't rename sections
11130 when using a linker script that has a SECTIONS clause.
11131 * Makefile.in: Regenerate.
11132
11133 * testsuite/Makefile.am (script_test_5.sh): New test case.
11134 * testsuite/Makefile.in: Regenerate.
11135 * testsuite/script_test_5.cc: New file.
11136 * testsuite/script_test_5.sh: New file.
11137 * testsuite/script_test_5.t: New file.
11138
11139 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
11140
11141 * archive.cc (Archive::include_member): Update calls to add_symbols.
11142 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11143 the Layout argument.
11144 * dynobj.h (do_add_symbols): Add the Layout argument.
11145 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11146 Layout argument.
11147 * object.h (Object::add_symbols): Add the Layout argument.
11148 (Object::do_add_symbols): Add the Layout argument.
11149 (Sized_relobj::do_add_symbols): Add the Layout argument.
11150 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11151 Unify the two versions.
11152 (Add_plugin_symbols): Remove.
11153 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11154 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11155 (Add_plugin_symbols): Remove.
11156 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11157 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11158 (Add_symbols::run): Make it work with Pulginobj.
11159
11160 2009-02-06 Ian Lance Taylor <iant@google.com>
11161
11162 * object.cc (Sized_relobj::do_layout): Make info message start
11163 with lower case letter.
11164
11165 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11166
11167 * binary.cc: Fix file comment.
11168
11169 * options.h (enum Incremental_disposition): Define.
11170 (class General_options): Add new options: --incremental,
11171 --incremental_changed, --incremental_unchanged,
11172 --incremental_unknown. Add incremental_disposition_ and
11173 implicit_incremental_ fields.
11174 (General_options::incremental_disposition): New function.
11175 (class Position_dependent_options): Add incremental_disposition
11176 option.
11177 (Position_dependent_options::copy_from_options): Set incremental
11178 dispositions.
11179 * options.cc (General_options::parse_incremental_changed): New
11180 function.
11181 (General_options::parse_incremental_unchanged): New function.
11182 (General_options::parse_incremental_unknown): New function.
11183 (General_options::General_options): Initialize new fields
11184 incremental_disposition_ and implicit_incremental_.
11185 (General_options::finalize): Check for uasge of --incremental-*
11186 without --incremental.
11187
11188 2009-02-06 Chris Demetriou <cgd@google.com>
11189
11190 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11191 pointer and to report location as the file name associated with
11192 the symbol.
11193 (gold_undefined_symbol_at_location): New function to replace the
11194 old gold_undefined_symbol functionality.
11195 * target-reloc.h (relocate_section): Update to use
11196 gold_undefined_symbol_at_location.
11197 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11198 Call gold_undefined_symbol function rather than gold_error.
11199 * errors.h (Errors::undefined_symbol): Take location as a
11200 string, rather than calculating it from a relocation.
11201 * errors.cc (Errors::fatal): Print "fatal error:" before the
11202 formatted message.
11203 (Errors::error, Errors::error_at_location): Print "error: "
11204 before the formatted message.
11205 (Errors::undefined_symbol): Take location as a string, rather
11206 than calculating it from a relocation.
11207 (gold_undefined_symbol_at_location): New function akin to
11208 old gold_undefined_symbol, calculates location from relocation.
11209 (gold_undefined_symbol): Change to take only a Symbol pointer
11210 and to report location as the file name associated with the symbol.
11211 * testsuite/debug_msg.sh: Update for changed error messages.
11212 * testsuite/undef_symbol.sh: Likewise.
11213
11214 2009-02-04 Duncan Sands <baldrick@free.fr>
11215
11216 PR 9812
11217 * reduced_debug_output.h
11218 (Output_reduced_debug_abbrev_section::failed): Use format for
11219 gold_warning.
11220 (Output_reduced_debug_info_section::faild): Likewise.
11221
11222 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11223
11224 * script.cc (Lazy_demangler): New class.
11225 (Version_script_info::get_symbol_version_helper): Demangle a
11226 symbol only once.
11227
11228 2009-01-29 Cary Coutant <ccoutant@google.com>
11229
11230 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11231 to __tls_get_addr.
11232 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11233
11234 2009-01-28 Ian Lance Taylor <iant@google.com>
11235
11236 * version.cc (version_string): Bump to 1.9.
11237
11238 * gold.h: Include <cstring> and <stdint.h>.
11239 * version.cc: Include <cstdio>.
11240 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11241 warning.
11242 * reduced_debug_output.cc (insert_into_vector): Rename from
11243 Insert_into_vector; change all callers. Use Swap_unaligned to
11244 avoid aliasing issue; remove union since it is unnecessary.
11245
11246 2009-01-27 Sriraman Tallam <tmsriram@google.com>
11247
11248 * Makefile.am (CCFILES): Add gc.cc.
11249 (HFILES): Add gc.h.
11250 * Makefile.in: Regenerate.
11251 * gold.cc (Gc_runner): New class.
11252 (queue_initial_tasks): Call garbage collection related tasks
11253 when corresponding options are invoked.
11254 (queue_middle_gc_tasks): New function.
11255 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11256 processed early before laying out sections during garbage collection.
11257 * gold.h (queue_middle_gc_tasks): New function.
11258 (is_prefix_of): Move from "layout.cc".
11259 * i386.cc (Target_i386::gc_process_relocs): New function.
11260 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11261 * main.cc (main): Create object of class "Garbage_collection".
11262 * object.cc (Relobj::copy_symbols_data): New function.
11263 (Relobj::is_section_name_included): New function.
11264 (Sized_relobj::do_layout): Allow this function to be called twice
11265 during garbage collection and defer layout of section during the
11266 first call.
11267 * object.h (Relobj::get_symbols_data): New function.
11268 (Relobj::is_section_name_included): New function.
11269 (Relobj::copy_symbols_data): New function.
11270 (Relobj::set_symbols_data): New function.
11271 (Relobj::get_relocs_data): New function.
11272 (Relobj::set_relocs_data): New function.
11273 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11274 (Relobj::gc_process_relocs): New function.
11275 (Relobj::do_gc_process_relocs): New pure virtual function.
11276 (Relobj::sd_): New data member.
11277 (Sized_relobj::is_output_section_offset_invalid): New function.
11278 (Sized_relobj::do_gc_process_relocs): New function.
11279 * options.h (General_options::gc_sections): Modify to not be a no-op.
11280 (General_options::print_gc_sections): New option.
11281 * plugin.cc (Plugin_finish::run): Remove function call to
11282 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11283 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11284 * reloc.cc (Read_relocs::run): Add task to process relocs and
11285 determine unreferenced sections when doing garbage collection.
11286 (Gc_process_relocs): New class.
11287 (Sized_relobj::do_gc_process_relocs): New function.
11288 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11289 sections that are garbage collected.
11290 * reloc.h (Gc_process_relocs): New class.
11291 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11292 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11293 symbols whose corresponding sections are garbage collected.
11294 (Symbol_table::Symbol_table): Add new parameter for the garbage
11295 collection object.
11296 (Symbol_table::gc_mark_undef_symbols): New function.
11297 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11298 (Symbol_table::gc_mark_dyn_syms): New function.
11299 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11300 as garbage.
11301 (Symbol_table::add_from_object): Likewise.
11302 (Symbol_table::add_from_relobj): When building shared objects, do not
11303 treat externally visible symbols as garbage.
11304 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11305 table information for static and relocatable links.
11306 * symtab.h (Symbol_table::set_gc): New function.
11307 (Symbol_table::gc): New function.
11308 (Symbol_table::gc_mark_undef_symbols): New function.
11309 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11310 (Symbol_table::gc_mark_dyn_syms): New function.
11311 (Symbol_table::gc_): New data member.
11312 * target.h (Sized_target::gc_process_relocs): New pure virtual
11313 function.
11314 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11315 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11316
11317 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11318
11319 * options.h (General_options::gc_sections): Define as a no-op for now.
11320 (General_options::no_keep_memory): Ditto.
11321 (General_options::Bshareable): Define.
11322 * options.cc (General_options::finalize): Honor -Bshareable.
11323
11324 2009-01-20 Andreas Schwab <schwab@suse.de>
11325
11326 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11327 read the value in the contents, since we don't use it. Use the
11328 template endianness when writing.
11329 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11330
11331 2009-01-19 Andreas Schwab <schwab@suse.de>
11332
11333 * configure.tgt (powerpc64-*): Fix targ_obj.
11334
11335 2009-01-15 Ian Lance Taylor <iant@google.com>
11336
11337 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11338 local symbols when stripping all symbols.
11339
11340 2009-01-14 Cary Coutant <ccoutant@google.com>
11341
11342 * output.cc (Output_reloc): Add explicit instantiations.
11343
11344 2009-01-14 Cary Coutant <ccoutant@google.com>
11345
11346 * archive.cc (Archive::get_elf_object_for_member): Remove call
11347 to File_read::claim_for_plugin.
11348 * descriptors.cc (Descriptors::open): Remove reference to
11349 is_claimed.
11350 (Descriptors::claim_for_plugin): Remove.
11351 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11352 (Descriptors::is_claimed): Remove.
11353 (claim_descriptor_for_plugin): Remove.
11354 * fileread.cc (File_read::claim_for_plugin): Remove.
11355 * fileread.h (File_read::claim_for_plugin): Remove.
11356 (File_read::descriptor): Reopen descriptor if necessary.
11357 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11358 (Plugin_manager::all_symbols_read): Add task parameter. Change
11359 all callers.
11360 (Plugin_manager::get_input_file): New function.
11361 (Plugin_manager::release_input_file): New function.
11362 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11363 corresponding data member.
11364 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11365 and pass to base constructor. Change all callers.
11366 (get_input_file, release_input_file): New functions.
11367 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11368 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11369 (Plugin_manager::all_symbols_read): Add task parameter.
11370 (Plugin_manager::get_input_file): New function.
11371 (Plugin_manager::release_input_file): New function.
11372 (Plugin_manager::task_): New data member.
11373 (Pluginobj::Pluginobj): Add filesize parameter.
11374 (Pluginobj::filename): New function.
11375 (Pluginobj::descriptor): New function.
11376 (Pluginobj::filesize): New function.
11377 (Pluginobj::filesize_): New data member.
11378 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11379 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11380 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11381
11382 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11383 with archive libraries.
11384 * testsuite/Makefile.in: Regenerate.
11385 * testsuite/plugin_test.c (struct sym_info): New type.
11386 (get_input_file, release_input_file): New static variables.
11387 (onload): Capture new transfer vector entries.
11388 (claim_file_hook): Stop reading at end of file according to filesize.
11389 Factor out parsing of readelf output into separate function.
11390 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11391 APIs and get the source file name from the symbol table. Convert
11392 source file name to corresponding object file name. Print info
11393 message when adding new input files.
11394 (parse_readelf_line): New function.
11395 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11396 * testsuite/plugin_test_2.sh: Likewise.
11397 * testsuite/plugin_test_3.sh: Likewise.
11398 * testsuite/plugin_test_4.sh: New test case.
11399
11400 2009-01-07 Ian Lance Taylor <iant@google.com>
11401
11402 * version.cc (version_string): Bump to 1.8.
11403
11404 2008-12-23 Cary Coutant <ccoutant@google.com>
11405
11406 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11407 * plugin.cc (Plugin_manager::finish): Rename as
11408 layout_deferred_objects. Move cleanup to separate function.
11409 (Plugin_manager::cleanup): New function.
11410 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11411 separately.
11412 * plugin.h (Plugin_manager::finish): Rename as
11413 layout_deferred_objects.
11414 (Plugin_manager::cleanup): New function.
11415 (Plugin_manager::cleanup_done): New field.
11416
11417 2008-12-23 Cary Coutant <ccoutant@google.com>
11418
11419 * plugin.cc (is_visible_from_outside): New function.
11420 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11421 so we don't return "IR only" status for exported symbols or -r links.
11422
11423 * testsuite/Makefile.am (plugin_test_3): New test case.
11424 * testsuite/Makefile.in: Regenerate.
11425 * testsuite/plugin_test_3.sh: New file.
11426
11427 2008-12-22 Cary Coutant <ccoutant@google.com>
11428
11429 * object.cc (Sized_relobj::layout_section): New function.
11430 (Sized_relobj::do_layout): Defer layout of input sections until after
11431 plugin has provided replacement files.
11432 (Sized_relobj::do_layout_deferred_sections): New function.
11433 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11434 (Relobj::layout_deferred_sections): New function.
11435 (Relobj::do_layout_deferred_sections): New function.
11436 (Sized_relobj::do_layout_deferred_sections): New function.
11437 (Sized_relobj::layout_section): New function.
11438 (Sized_relobj::Deferred_layout): New structure.
11439 (Sized_relobj::deferred_layout_): New field.
11440 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11441 Change all callers. Layout deferred sections.
11442 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11443 references.
11444 (Plugin_hook::run): Move code from do_plugin_hook inline.
11445 (Plugin_hook::do_plugin_hook): Remove.
11446 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11447 (Plugin_manager::finish): Renamed, was cleanup.
11448 (Plugin_manager::should_defer_layout): New function.
11449 (Plugin_manager::add_deferred_layout_object): New function.
11450 (Plugin_manager::Deferred_layout_list): New type.
11451 (Plugin_manager::deferred_layout_objects_): New field.
11452 (Plugin_hook::do_plugin_hook): Remove.
11453
11454 2008-12-17 Ian Lance Taylor <iant@google.com>
11455
11456 * options.h (class General_options): Add --no case for
11457 --export-dynamic.
11458
11459 2008-12-16 Cary Coutant <ccoutant@google.com>
11460
11461 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11462 vector.
11463 (Plugin_manager::claim_file): Create plugin object even if
11464 plugin did not call the add_symbols callback.
11465 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11466 asking for more symbols than were added.
11467 * testsuite/Makefile.am (plugin_test_1): Add test case with
11468 no global symbols.
11469 (empty.syms): New target.
11470 * testsuite/Makefile.in: Regenerate.
11471 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11472 message. Don't call add_symbols if no globals.
11473 (all_symbols_read_hook): Don't provide replacement for empty
11474 claimed file.
11475
11476 2008-12-12 Ian Lance Taylor <iant@google.com>
11477
11478 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11479 r_type == 0 for a local symbol with r_sym == 0.
11480 (scan_relocatable_relocs): Pass r_sym to
11481 local_non_section_strategy.
11482 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11483 r_sym parameter.
11484
11485 * configure.ac: Update test for TLS descriptors: they are
11486 supported as of glibc 2.9.
11487 * configure: Rebuild.
11488
11489 2008-12-11 Ian Lance Taylor <iant@google.com>
11490
11491 PR 7091
11492 * target-reloc.h (Default_scan_relocatable_relocs): For each
11493 function, map r_type == 0 to RELOC_DISCARD.
11494
11495 2008-12-10 Cary Coutant <ccoutant@google.com>
11496
11497 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11498 object to override a kept COMDAT group from a plugin object.
11499
11500 2008-12-09 Ian Lance Taylor <iant@google.com>
11501
11502 PR 7088
11503 * yyscript.y (file_cmd): Handle INPUT.
11504
11505 * testsuite/initpri1.c: Change all declarations to be full
11506 prototypes by adding void, to avoid compiler warnings.
11507
11508 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
11509
11510 * options.cc (General_options::parse_plugin_opt): New.
11511 (General_options::add_plugin): The argument now is just the filename.
11512 (General_options::add_plugin_option): New.
11513 * options.h (plugin_opt): New.
11514 (add_plugin): Change argument name.
11515 (add_plugin_option): New.
11516 * plugin.cc (Plugin::load): Don't parse the plugin option.
11517 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11518 (Plugin::add_option): New.
11519 (Plugin::args_): Change type.
11520 (Plugin::filename_): New.
11521 (Plugin_manager::add_plugin_option): New.
11522 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11523 * testsuite/Makefile.in: Regenerate.
11524
11525 2008-12-05 Cary Coutant <ccoutant@google.com>
11526
11527 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11528 Handle --strip-lto-sections option.
11529 * options.h (strip_lto_sections): New option.
11530
11531 2008-12-01 Cary Coutant <ccoutant@google.com>
11532
11533 * plugin.cc (ld_plugin_message): Change format parameter to const.
11534 Fix mismatch between new[] and delete.
11535
11536 2008-11-14 Cary Coutant <ccoutant@google.com>
11537
11538 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11539 instead of -1U.
11540
11541 2008-11-05 Craig Silverstein <csilvers@google.com>
11542
11543 * options.cc (General_options::parse_dynamic_list): New function.
11544 * options.h (General_options): New flags dynamic_list,
11545 dynamic_list_data, dynamic_list_cpp_new, and
11546 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11547 (General_options::in_dynamic_list): New function.
11548 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11549 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11550 (Lex::can_continue_name): Likewise.
11551 (yylex): Likewise.
11552 (read_script_file): New parameter script_options.
11553 (read_dynamic_list): New function.
11554 (Script_options::define_dynamic_list): New function.
11555 (dynamic_list_keyword_parsecodes): New variable.
11556 (dynamic_list_keywords): New variable.
11557 * script.h (Script_options::define_dynamic_list): New function
11558 prototype.
11559 (read_dynamic_list): New function prototype.
11560 * symtab.cc (strprefix): New macro.
11561 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11562 dynamic_list_data, dynamic_list_cpp_new, and
11563 dynamic_list_cpp_typeinfo.
11564 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11565 (dynamic_list_expr): New rule.
11566 (dynamic_list_nodes): Likewise.
11567 (dynamic_list_node): Likewise.
11568 * testsuite/Makefile.am (dynamic_list): New test.
11569 * testsuite/Makefile.in: Regenerated.
11570 * testsuite/dynamic_list.t: New file.
11571 * testsuite/dynamic_list.sh: New file.
11572
11573 2008-11-05 Craig Silverstein <csilvers@google.com>
11574
11575 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11576 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11577 (t11_last): Likewise.
11578 * testsuite/ver_test_6.c (main): Likewise.
11579
11580 2008-10-07 Cary Coutant <ccoutant@google.com>
11581
11582 * options.c (General_options::finalize): Add check for -static and
11583 -shared.
11584 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11585 is not empty.
11586
11587 2008-10-02 Cary Coutant <ccoutant@google.com>
11588
11589 * plugin.cc (make_sized_plugin_object): Fix conditional
11590 compilation to work when not all targets are enabled.
11591
11592 2008-09-29 Cary Coutant <ccoutant@google.com>
11593
11594 * archive.cc (Archive::get_file_and_offset): Use filename instead
11595 of name to get library path.
11596 (Archive::include_member): Unlock external member of a thin archive.
11597
11598 * testsuite/Makefile.am (TEST_AR): New variable.
11599 (thin_archive_test_1): New test.
11600 (thin_archive_test_2): New test.
11601 * testsuite/Makefile.in: Regenerate.
11602 * testsuite/thin_archive_main.cc: New file.
11603 * testsuite/thin_archive_test_1.cc: New file.
11604 * testsuite/thin_archive_test_2.cc: New file.
11605 * testsuite/thin_archive_test_3.cc: New file.
11606 * testsuite/thin_archive_test_4.cc: New file.
11607
11608 2008-09-29 Cary Coutant <ccoutant@google.com>
11609
11610 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11611 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11612 instead of -1U.
11613 (Sized_relobj::do_finalize_local_symbols): Likewise.
11614 (Sized_relobj::map_to_kept_section): Likewise.
11615 * object.h (Sized_relobj::invalid_address): New constant.
11616 (Sized_relobj::do_output_section_offset): Check for invalid_address
11617 and return -1ULL.
11618 * output.cc (Output_reloc::local_section_offset): Use constant
11619 invalid_address instead of -1U.
11620 (Output_reloc::get_address): Likewise.
11621 (Output_section::output_address): Change -1U to -1ULL.
11622 * output.h (Output_reloc::invalid_address): New constant.
11623 * reloc.cc (Sized_relobj::write_sections): Use constant
11624 invalid_address instead of -1U.
11625 (Sized_relobj::relocate_sections): Likewise.
11626 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11627 values for merge sections.
11628 * target-reloc.h (relocate_for_relocatable): Use constant
11629 invalid_address instead of -1U.
11630
11631 2008-09-19 Cary Coutant <ccoutant@google.com>
11632
11633 Add plugin functionality for link-time optimization (LTO).
11634 * configure.ac (plugins): Add --enable-plugins option.
11635 * configure: Regenerate.
11636 * config.in: Regenerate.
11637 * Makefile.am (LIBDL): New variable.
11638 (CCFILES): Add plugin.cc.
11639 (HFILES): Add plugin.h.
11640 (ldadd_var): Add LIBDL.
11641 * Makefile.in: Regenerate.
11642
11643 * archive.cc: Include "plugin.h".
11644 (Archive::setup): Don't preread archive symbols when using a plugin.
11645 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11646 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11647 files.
11648 (Archive::include_member): Add symbols from plugin objects.
11649 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11650 * descriptors.cc (Descriptors::open): Check for file descriptors
11651 abandoned by plugins.
11652 (Descriptors::claim_for_plugin): New function.
11653 * descriptors.h (Descriptors::claim_for_plugin): New function.
11654 (Open_descriptor::is_claimed): New field.
11655 (claim_descriptor_for_plugin): New function.
11656 * fileread.cc (File_read::claim_for_plugin): New function.
11657 * fileread.h (File_read::claim_for_plugin): New function.
11658 (File_read::descriptor): New function.
11659 * gold.cc: Include "plugin.h".
11660 (queue_initial_tasks): Add task to call plugin hooks for generating
11661 new object files.
11662 * main.cc: Include "plugin.h".
11663 (main): Load plugin libraries.
11664 * object.h (Pluginobj): Declare.
11665 (Object::pluginobj): New function.
11666 (Object::do_pluginobj): New function.
11667 (Object::set_target): New function.
11668 * options.cc: Include "plugin.h".
11669 (General_options::parse_plugin): New function.
11670 (General_options::General_options): Initialize plugins_ field.
11671 (General_options::add_plugin): New function.
11672 * options.h (Plugin_manager): Declare.
11673 (General_options): Add --plugin option.
11674 (General_options::has_plugins): New function.
11675 (General_options::plugins): New function.
11676 (General_options::add_plugin): New function.
11677 (General_options::plugins_): New field.
11678 * plugin.cc: New file.
11679 * plugin.h: New file.
11680 * readsyms.cc: Include "plugin.h".
11681 (Read_symbols::do_read_symbols): Check for archive before checking
11682 for ELF file. Call plugin hooks to claim files.
11683 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11684 from a real object file; force override when processing replacement
11685 files.
11686 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11687 (Symbol::init_base_object): Likewise.
11688 (Symbol::init_base_output_data): Likewise.
11689 (Symbol::init_base_output_segment): Likewise.
11690 (Symbol::init_base_constant): Likewise.
11691 (Symbol::init_base_undefined): Likewise.
11692 (Symbol::output_section): Assert that object is not a plugin.
11693 (Symbol_table::add_from_pluginobj): New function.
11694 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11695 undefined.
11696 (Symbol_table::sized_write_globals): Likewise.
11697 (Symbol_table::add_from_pluginobj): Instantiate template.
11698 * symtab.h (Sized_pluginobj): Declare.
11699 (Symbol::in_real_elf): New function.
11700 (Symbol::set_in_real_elf): New function.
11701 (Symbol::in_real_elf_): New field.
11702 (Symbol_table::add_from_pluginobj): New function.
11703
11704 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11705 (LIBDL): New variable.
11706 (LDADD): Add LIBDL.
11707 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11708 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11709 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11710 (MOSTLYCLEANFILES): Likewise.
11711 * testsuite/Makefile.in: Regenerate.
11712 * testsuite/plugin_test.c: New file.
11713 * testsuite/plugin_test_1.sh: New file.
11714 * testsuite/plugin_test_2.sh: New file.
11715
11716 2008-09-16 Ian Lance Taylor <iant@google.com>
11717
11718 * target-reloc.h (relocate_section): Check whether a symbol is
11719 defined by the ABI before reporting an undefined symbol error.
11720 * target.h (Target::is_defined_by_abi): Make parameter const.
11721 (Target::do_is_defined_by_abi): Likewise.
11722 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11723 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11724 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11725 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11726 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11727 * testsuite/Makefile.in: Rebuild.
11728
11729 * fileread.cc (make_view): Add casts to avoid warning.
11730
11731 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11732
11733 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11734 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11735
11736 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11737
11738 * options.h (General_options::output_is_executable): New.
11739 (General_options::output_is_pie): New.
11740 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11741 for shared libraries.
11742 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11743
11744 2008-09-11 Chris Demetriou <cgd@google.com>
11745
11746 * options.h (origin): New -z option.
11747 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11748 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11749 in DT_FLAGS_1.
11750
11751 2008-09-05 Cary Coutant <ccoutant@google.com>
11752
11753 * fileread.cc (File_read::make_view): Add check for attempt to map
11754 beyond end of file.
11755
11756 2008-09-05 Cary Coutant <ccoutant@google.com>
11757
11758 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11759 explicit instantiations.
11760
11761 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11762
11763 PR gold/6858
11764 * options.cc (General_options::finalize): Allow undefined symbols
11765 in shlibs if linking -shared.
11766
11767 PR gold/6859
11768 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11769 symbols as not needing a dynsym entry.
11770
11771 2008-08-20 Craig Silverstein <csilvers@google.com>
11772
11773 * fileread.cc (File_read::open): Do not lock the file unless it
11774 was successfully opened.
11775
11776 2008-08-14 Cary Coutant <ccoutant@google.com>
11777
11778 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11779 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11780 * testsuite/tls_test.cc (struct int128): 128-bit struct
11781 for testing TLS relocs with non-zero addend.
11782 (v12): New TLS variable.
11783 (t12): New test.
11784 (t_last): Add check for v12.
11785 * testsuite/tls_test.h (t12): New function.
11786 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11787
11788 2008-08-13 Ian Lance Taylor <iant@google.com>
11789
11790 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11791 set tls_segment_ or relro_segment_.
11792 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11793 when appropriate.
11794 * output.h (Output_section::clear_is_relro): New function.
11795 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11796 sections specially even when output_data_ is empty.
11797 (Output_segment::maximum_alignment): When first section is relro,
11798 only force alignment for PT_LOAD segments.
11799 * script.cc (script_data_segment_align): New function.
11800 (script_data_segment_relro_end): New function.
11801 * script-c.h (script_data_segment_align): Declare.
11802 (script_data_segment_relro_end): Declare.
11803 * script-sections.h (class Script_sections): Declare
11804 data_segment_align and data_segment_relro_end. Add fields
11805 segment_align_index_ and saw_relro_end_.
11806 * script-sections.cc (class Sections_element): Add set_is_relro
11807 virtual function. Add new bool* parameter to place_orphan_here.
11808 Add get_output_section virtual function.
11809 (class Output_section_definition): Add set_is_relro. Add new
11810 bool* parameter to place_orphan_here. Add get_output_section.
11811 Add is_relro_ field.
11812 (Output_section_definition::Output_section_definition): Initialize
11813 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11814 and is_relro_ fields.
11815 (Output_section_definition::place_orphan_here): Add is_relro
11816 parameter.
11817 (Output_section_definition::set_section_addresses): Set relro for
11818 output section.
11819 (Output_section_definition::alternate_constraint): Likewise.
11820 (class Orphan_output_section): Add new bool* parameter to
11821 place_orphan_here. Add get_output_section.
11822 (Orphan_output_section::place_orphan_here): Add is_relro
11823 parameter.
11824 (Script_sections::Script_sections): Initialize
11825 data_segment_align_index_ and saw_relro_end_.
11826 (Script_sections::data_segment_align): New function.
11827 (Script_sections::data_segment_relro_end): New function.
11828 (Script_sections::place_orphan): Set or clear is_relro.
11829 (Script_sections::set_section_addresses): Force alignment of first
11830 TLS section.
11831 * yyscript.y (exp): Call script_data_segment_align and
11832 script_data_segment_relro_end.
11833 * testsuite/relro_script_test.t: New file.
11834 * testsuite/relro_test.cc (using_script): Declare.
11835 (t1, t2): Test using_script.
11836 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11837 (relro_script_test_SOURCES): Define.
11838 (relro_script_test_DEPENDENCIES): Define.
11839 (relro_script_test_LDFLAGS): Define.
11840 (relro_script_test_LDADD): Define.
11841 (relro_script_test.so): New target.
11842 * testsuite/Makefile.in: Rebuild.
11843
11844 2008-08-06 Cary Coutant <ccoutant@google.com>
11845
11846 * archive.cc (Archive::total_archives, Archive::total_members)
11847 (Archive::total_members_loaded): New variables.
11848 (Archive::setup): Add parameter. Add option to preread
11849 archive symbols.
11850 (Archive::read_armap): Add counter.
11851 (Archive::get_file_and_offset): New function.
11852 (Archive::get_elf_object_for_member): New function.
11853 (Archive::read_all_symbols): New function.
11854 (Archive::read_symbols): New function.
11855 (Archive::add_symbols): Add counters.
11856 (Archive::include_all_members): Use armap to find members if it's
11857 already built.
11858 (Archive::include_member): Skip reading symbols if already read.
11859 Factored code into Archive::get_file_and_offset and
11860 Archive::get_elf_object_for_member. Changed call to
11861 Mapfile::report_include_archive_member.
11862 (Archive::print_stats): New function.
11863 * archive.h: Declare Object and Read_symbols_data classes.
11864 (Archive::Archive): Add initializers for new members.
11865 (Archive::setup): Add parameter.
11866 (Archive::print_stats): New function.
11867 (Archive::total_archives, Archive::total_members)
11868 (Archive::total_members_loaded): New variables.
11869 (Archive::get_file_and_offset): New function.
11870 (Archive::get_elf_object_for_member): New function.
11871 (Archive::read_all_symbols): New function.
11872 (Archive::read_symbols): New function.
11873 (Archive::Archive_member): New class.
11874 (Archive::members_): New member.
11875 (Archive::num_members_): New member.
11876 * main.cc: Include archive.h.
11877 (main): Call Archive::print_stats.
11878 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11879 archive parameter; member_name is now the fully-decorated name.
11880 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11881 * options.h: (General_options): Add --preread-archive-symbols option.
11882 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11883 Archive::setup.
11884
11885 2008-08-04 Ian Lance Taylor <iant@google.com>
11886
11887 * symtab.h (Symbol::use_plt_offset): New function.
11888 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11889 * powerpc.cc (Relocate::relocate): Likewise.
11890 * sparc.cc (Relocate::relocate): Likewise.
11891 * x86_64.cc (Relocate::relocate): Likewise.
11892 * testsuite/weak_plt.sh: New test.
11893 * testsuite/weak_plt_main.cc: New test.
11894 * testsuite/weak_plt_shared.cc: New test.
11895 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11896 (check_PROGRAMS): Add weak_plt.
11897 (check_DATA): Add weak_plt_shared.so.
11898 (weak_plt_main_pic.o, weak_plt): New targets.
11899 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11900 * testsuite/Makefile.in: Rebuild.
11901
11902 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11903 gcctestdir/ld.
11904 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11905 * testsuite/Makefile.in: Rebuild.
11906
11907 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11908
11909 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11910 * Makefile.in: Regenerate.
11911 * po/POTFILES.in: Regenerate.
11912
11913 2008-07-29 Ian Lance Taylor <iant@google.com>
11914
11915 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11916 symbols before other symbols.
11917 * testsuite/script_test_2.cc (test_addr): Declare.
11918 (test_addr_alias): Declare.
11919 (main): Check that test_addr and test_addr_alias have the right
11920 values.
11921 * testsuite/script_test_2.t: Define test_addr_alias and
11922 test_addr.
11923
11924 2008-07-24 Ian Lance Taylor <iant@google.com>
11925
11926 PR 5990
11927 * descriptors.cc: New file.
11928 * descriptors.h: New file.
11929 * gold-threads.h (class Hold_optional_lock): New class.
11930 * fileread.cc: Include "descriptors.h".
11931 (File_read::~File_read): Release descriptor rather than closing
11932 it.
11933 (File_read::open) [file]: Call open_descriptor rather than open.
11934 Set is_descriptor_opened_.
11935 (File_read::open) [memory]: Assert that descriptor is not open.
11936 (File_read::reopen_descriptor): New function.
11937 (File_read::release): Release descriptor.
11938 (File_read::do_read): Make non-const. Reopen descriptor.
11939 (File_read::read): Make non-const.
11940 (File_read::make_view): Reopen descriptor.
11941 (File_read::do_readv): Likewise.
11942 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11943 Update declarations.
11944 * layout.cc: Include "descriptors.h".
11945 (Layout::create_build_id): Use open_descriptor rather than open.
11946 * output.cc: Include "descriptors.h".
11947 (Output_file::open): Use open_descriptor rather than open.
11948 * archive.cc (Archive::const_iterator): Change Archive to be
11949 non-const.
11950 (Archive::begin, Archive::end): Make non-const.
11951 (Archive::count_members): Likewise.
11952 * archive.h (class Archive): Update declarations.
11953 * object.h (Object::read): Make non-const.
11954 * Makefile.am (CCFILES): Add descriptors.cc.
11955 (HFILES): Add descriptors.h.
11956 * Makefile.in: Rebuild.
11957
11958 PR 6716
11959 * gold.h: Always include <clocale>. Add Solaris workarounds
11960 following code in binutils/sysdep.h.
11961
11962 PR 6048
11963 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11964 this->eh_frame_hdr_ is NULL before using it.
11965
11966 * dynobj.cc (Versions::Versions): Update comment.
11967
11968 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11969 the base version name.
11970
11971 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11972 array size plus one.
11973 (Stringpool_template::set_string_offsets): Subtract one from key
11974 before using it as an array index.
11975 (Stringpool_template::get_offset_with_length): Likewise.
11976 (Stringpool_template::write_to_buffer): Likewise.
11977 * stringpool.h (Stringpool_template::get_offset_from_key):
11978 Likewise.
11979
11980 2008-07-23 Ian Lance Taylor <iant@google.com>
11981
11982 PR 6658
11983 * object.h (Merged_symbol_value::value): Do our best to handle a
11984 negative addend.
11985
11986 PR 6647
11987 * script.cc (Version_script_info::get_versions): Don't add empty
11988 version tag to return value.
11989 (Version_script_info::get_symbol_version_helper): Change return
11990 type to bool. Add pversion parameter. Change all callers.
11991 (script_register_vers_node): Don't require a non-NULL tag.
11992 * script.h (class Version_script_info): Update declarations.
11993 (Version_script_info::get_symbol_version): Change return type to
11994 bool. Add version parameter. Change all callers.
11995 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11996 handling. Handle an empty version from a version script.
11997 (Symbol_table::define_special_symbol): Likewise.
11998 * testsuite/ver_test_10.script: New file.
11999 * testsuite/ver_test_10.sh: New file.
12000 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12001 (check_DATA): Add ver_test_10.syms.
12002 (ver_test_10.syms, ver_test_10.so): New target.
12003 * testsuite/Makefile.in: Rebuild.
12004
12005 2008-07-23 Simon Baldwin <simonb@google.com>
12006
12007 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12008 to zero for undefined symbols from dynamic libraries.
12009
12010 2008-07-23 Ian Lance Taylor <iant@google.com>
12011
12012 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12013 Change all callers.
12014 * symtab.h (class Symbol_table): Update declaration.
12015 * testsuite/ver_test_9.cc: New file.
12016 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12017 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12018 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12019 (ver_test_9.so, ver_test_9.o): New targets.
12020 * testsuite/Makefile.in: Rebuild.
12021
12022 2008-07-22 Ian Lance Taylor <iant@google.com>
12023
12024 * options.h (class General_options): Define --check-sections.
12025 * layout.cc (Layout::set_segment_offsets): Handle
12026 --check-sections.
12027
12028 * options.h (class General_options): Define -n/--nmagic and
12029 -N/--omagic.
12030 * options.cc (General_options::finalize): For -n/--nmagic or
12031 -N/--omagic, set -static.
12032 * layout.cc (Layout::attach_allocated_section_to_segment): If
12033 -N/--omagic, don't put read-only and read-write sections in
12034 different segments.
12035 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12036 finding a read-only segment.
12037 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12038 don't set the minimum segment alignment to the common page size,
12039 and don't set the file offset to the address modulo the page size.
12040 * script-sections.cc (Script_sections::create_segments): If
12041 -n/--omagic, don't put read-only and read-write sections in
12042 different segments.
12043
12044 * cref.cc: New file.
12045 * cref.h: New file.
12046 * options.h (class General_options): Add --print-symbol-counts.
12047 * main.cc (main): Issue defined symbol report if requested.
12048 * archive.cc (Archive::interpret_header): Make into a const member
12049 function.
12050 (Archive::add_symbols): Call Input_objects::archive_start and
12051 archive_stop.
12052 (Archive::const_iterator): Define new class.
12053 (Archive::begin, Archive::end): New functions.
12054 (Archive::include_all_members): Rewrite to use iterator.
12055 (Archive::count_members): New function.
12056 * archive.h (class Archive): Update declarations.
12057 (Archive::filename): New function.
12058 * object.cc: Include "cref.h".
12059 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12060 (Sized_relobj::do_get_global_symbol_counts): New function.
12061 (Input_objects::add_object): Add object to cross-referencer.
12062 (Input_objects::archive_start): New function.
12063 (Input_objects::archive_stop): New function.
12064 (Input_objects::print_symbol_counts): New function.
12065 * object.h: Declare Cref and Archive.
12066 (Object::get_global_symbol_counts): New function.
12067 (Object::do_get_global_symbol_counts): New pure virtual function.
12068 (class Sized_relobj): Add defined_count_ field. Update
12069 declarations.
12070 (class Input_objects): Add cref_ field. Update constructor.
12071 Update declarations.
12072 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12073 defined_count_.
12074 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12075 symbol counts.
12076 (Sized_dynobj::do_get_global_symbol_counts): New function.
12077 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12078 defined_count_. Update declarations. Define Symbols typedef.
12079 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12080 parameter. Change all callers.
12081 (Symbol_table::add_from_dynobj): Add sympointers and defined
12082 parameters. Change all callers.
12083 * symtab.h (class Symbol_table): Update declarations.
12084 * Makefile.am (CCFILES): Add cref.cc.
12085 (HFILES): Add cref.h.
12086 * Makefile.in: Rebuild.
12087
12088 2008-07-22 Simon Baldwin <simonb@google.com>
12089
12090 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12091 to zero when writing undefined symbols.
12092
12093 2008-07-22 Ian Lance Taylor <iant@google.com>
12094
12095 * output.cc (Output_section::add_input_section): Don't try to
12096 merge empty merge sections.
12097
12098 2008-07-21 Craig Silverstein <csilvers@google.com>
12099
12100 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12101 Include symbol version in error message.
12102
12103 2008-07-20 Chris Demetriou <cgd@google.com>
12104
12105 * configure.ac (gold_cv_c_random_seed): New configured variable.
12106 (RANDOM_SEED_CFLAGS): New substituted variable.
12107 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12108 * configure: Rebuild.
12109 * Makefile.in: Likewise.
12110 * testsuite/Makefile.in: Likewise.
12111
12112 2008-07-18 Ian Lance Taylor <iant@google.com>
12113
12114 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12115 where we see NAME/NULL and NAME/VERSION as separate symbols.
12116 * testsuite/ver_test_main.cc (main): Call t4.
12117 (t4, t4_2a): Define.
12118 * testsuite/ver_test_2.cc (t4_2): Define.
12119 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12120 * testsuite/ver_test_4.cc (t4_2a): Define.
12121 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12122 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12123
12124 2008-07-17 Ian Lance Taylor <iant@google.com>
12125
12126 * dynobj.cc (Versions::add_def): If we give an error about a
12127 missing version, go ahead and create the version anyhow.
12128
12129 2008-07-10 Ian Lance Taylor <iant@google.com>
12130
12131 Handle output sections with more than 0x7fffffff bytes.
12132 * object.h (class Relobj): Change map_to_output_ to
12133 output_sections_, and just keep a section pointer. Change all
12134 uses. Move comdat group support to Sized_relobj.
12135 (Relobj::is_section_specially_mapped): Remove.
12136 (Relobj::output_section): Remove poff parameter. Change all
12137 callers.
12138 (Relobj::output_section_offset): New function.
12139 (Relobj::set_section_offset): Rewrite.
12140 (Relobj::map_to_output): Remove.
12141 (Relobj::output_sections): New function.
12142 (Relobj::do_output_section_offset): New pure virtual function.
12143 (Relobj::do_set_section_offset): Likewise.
12144 (class Sized_relobj): Add section_offsets_ field. Add comdat
12145 group support from Relobj. Update declarations.
12146 (Sized_relobj::get_output_section_offset): New function.
12147 (Sized_relobj::do_output_section_offset): New function.
12148 (Sized_relobj::do_set_section_offset): New function.
12149 * object.cc (Relobj::output_section_address): Remove.
12150 (Sized_relobj::Sized_relobj): Initialize new fields.
12151 (Sized_relobj::include_section_group): Cast find_kept_object to
12152 Sized_relobj.
12153 (Sized_relobj::include_linkonce_section): Likewise.
12154 (Sized_relobj::do_layout): Use separate arrays for output section
12155 and output offset.
12156 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12157 output_sections.
12158 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12159 output_sections and section_offsets.
12160 (Sized_relobj::write_local_symbols): Likewise.
12161 (map_to_kept_section): Compute output address directly.
12162 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12163 output_sections and section_offsets.
12164 (Sized_relobj::write_sections): Likewise.
12165 (Sized_relobj::relocate_sections): Likewise.
12166 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12167 * output.h (class Output_reloc): Update declarations. Change
12168 u2_.relobj to Sized_relobj*.
12169 (class Output_data_reloc): Change add functions to use
12170 Sized_relobj*.
12171 * output.cc (Output_reloc::Output_reloc): Change relobj to
12172 Sized_relobj*.
12173 (Output_reloc::local_section_offset): Change return type to
12174 Elf_Addr. Use get_output_section_offset.
12175 (Output_reloc::get_address): Likewise.
12176 (Output_section::is_input_address_mapped): Don't call
12177 is_section_specially_mapped.
12178 (Output_section::output_offset): Likewise.
12179 (Output_section::output_address): Likewise.
12180 (Output_section::starting_output_address): Likewise.
12181 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12182 parameter to Sized_relobj*.
12183 (Copy_relocs::need_copy_reloc): Likewise.
12184 (Copy_relocs::save): Likewise.
12185 * copy-relocs.h (class Copy_relocs): Update declarations.
12186 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12187 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12188 * target-reloc.h (relocate_for_relocatable): Change
12189 offset_in_output_section type to Elf_Addr. Change code that uses
12190 it as well.
12191 * layout.cc (Layout::layout): Always set *off.
12192 * mapfile.cc (Mapfile::print_input_section): Use
12193 output_section_offset.
12194 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12195 Sized_relobj*.
12196 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12197 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12198 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12199
12200 2008-07-03 Ian Lance Taylor <iant@google.com>
12201
12202 * layout.cc (Layout::include_section): Do not discard unrecognized
12203 SHT_STRTAB sections.
12204
12205 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12206
12207 * script.cc (Lex::can_continue_name): Make '?' allowable in
12208 version-script names.
12209 * testsuite/version_script.map: Change glob pattern to use '?'
12210
12211 2008-06-30 Manish Singh <yosh@gimp.org>
12212
12213 PR 6585
12214 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12215 Correct typo.
12216
12217 2008-06-30 Ian Lance Taylor <iant@google.com>
12218
12219 PR 6660
12220 PR 6682
12221 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12222 versions]: Don't try to read the value in the contents, since we
12223 don't use it. Use the template endianness when writing.
12224
12225 2008-06-25 Cary Coutant <ccoutant@google.com>
12226
12227 * fileread.cc (File_read::make_view): Assert on zero-length view.
12228 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12229 symbol table when there are no symbols to read.
12230
12231 2008-06-23 Craig Silverstein <csilvers@google.com>
12232
12233 * version.cc (version_string): Bump to 1.7
12234
12235 2008-06-18 Craig Silverstein <csilvers@google.com>
12236
12237 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12238 constant 0xFFFF to type Valtype.
12239 (Powerpc_relocate_functions::rel16_ha): Likewise.
12240
12241 2008-06-17 Ian Lance Taylor <iant@google.com>
12242
12243 * output.h (Output_section::Input_section): Initialize p2align_ to
12244 zero for Output_section_data constructors.
12245 (Output_section::Input_section::addralign): If not an input
12246 section, return the alignment of the Output_section_data.
12247 * testsuite/copy_test.cc: New file.
12248 * testsuite/copy_test_1.cc: New file.
12249 * testsuite/copy_test_2.cc: New file.
12250 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12251 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12252 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12253 (copy_test_1_pic.o, copy_test_1.so): New targets.
12254 (copy_test_2_pic.o, copy_test_2.so): New targets.
12255 * testsuite/Makefile.in: Rebuild.
12256
12257 * script-sections.cc (Script_sections::place_orphan): Initialize
12258 local variable exact.
12259
12260 2008-06-13 David Edelsohn <edelsohn@gnu.org>
12261
12262 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12263
12264 2008-06-12 David Edelsohn <edelsohn@gnu.org>
12265 David S. Miller <davem@davemloft.net>
12266
12267 * powerpc.cc: New file.
12268 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12269 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12270 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12271 * Makefile.in: Rebuild.
12272
12273 2008-06-09 Ian Lance Taylor <iant@google.com>
12274
12275 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12276 <exception>.
12277 (throwing, orig_terminate): New static variables.
12278 (terminate_handler): New static function.
12279 (t2): Set terminate handler.
12280
12281 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12282
12283 PR 6584
12284 * binary.cc (Binary_to_elf::sized_convert): Fix .data
12285 alignment.
12286
12287 2008-05-30 Cary Coutant <ccoutant@google.com>
12288
12289 * archive.cc (Archive::include_all_members) Correct to step
12290 over symbol table and extended name table in thin archives.
12291
12292 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12293
12294 PR 6407
12295 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12296 calculation.
12297
12298 2008-05-28 Caleb Howe <cshowe@google.com>
12299
12300 * reduced_debug_output.cc: New file.
12301 * reduced_debug_output.h: New file.
12302 * options.h (class General_options): Add --strip-debug-non-line.
12303 * options.cc (General_options::finalize): Add strip_debug_non_line
12304 to the strip heirarchy.
12305 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12306 fields.
12307 * layout.cc: Include "reduced_debug_output.h".
12308 (Layout::Layout): Initialize new fields.
12309 (line_only_debug_sections): New static array.
12310 (is_lines_only_debug_sections): New static inline function.
12311 (Layout::include_section): Handle --strip-debug-non-line.
12312 (Layout::make_output_section): If --strip-debug-non-line, build
12313 new output sections for .debug_abbrev and .debug_info.
12314 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12315 gold. Warn about possible overflow.
12316 (read_signed_LEB_128): Likewise.
12317 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12318 (read_signed_LEB_128): Declare.
12319 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12320 (HFILES): Add reduced_debug_output.h.
12321 * Makefile.in: Rebuild.
12322
12323 2008-05-21 Ian Lance Taylor <iant@google.com>
12324
12325 * mapfile.cc: New file.
12326 * mapfile.h: New file.
12327 * options.h (class General_options): Add -M/--print-map and -Map.
12328 * options.cc (General_options::finalize): Make -M equivalent to
12329 -Map -.
12330 * main.cc: Include <cstdio> and "mapfile.h".
12331 (main): Open mapfile if requested.
12332 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12333 constructor. Change caller.
12334 (queue_initial_tasks): Add mapfile parameter. Change caller.
12335 (queue_middle_tasks): Likewise.
12336 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12337 declarations.
12338 * archive.cc: Include "mapfile.h".
12339 (Archive::add_symbols): Add mapfile parameter. Change all
12340 callers. Pass mapfile, symbol, and reason to include_member.
12341 (Archive::include_all_members): Add mapfile parameter. Change all
12342 callers.
12343 (Archive::include_member): Add mapfile, sym, and why parameters.
12344 Change all callers. Report inclusion to map file.
12345 * archive.h: Include "fileread.h".
12346 (class Archive): Update declarations.
12347 (Archive::file): New const method.
12348 (class Add_archive_symbols): Add mapfile_ field. Update
12349 constructor. Change all callers.
12350 * readsyms.h (class Read_symbols): Likewise.
12351 (class Finish_group): Likewise.
12352 (class Read_script): Likewise.
12353 * common.cc: Include "mapfile.h".
12354 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12355 all callers.
12356 (Symbol_table::do_allocate_commons): Likewise.
12357 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12358 symbol allocation to mapfile.
12359 * common.h (class Allocate_commons_task): Add mapfile_ field.
12360 Update constructor. Change all callers.
12361 * symtab.h (class Symbol_table): Update declarations.
12362 * layout.cc: Include "mapfile.h".
12363 (Layout_task_runner::run): Print information to mapfile.
12364 (Layout::create_gold_note): Change Output_data_fixed_space to
12365 Output_data_zero_fill.
12366 (Layout::create_build_id): Likewise.
12367 (Layout::print_to_mapfile): New function.
12368 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12369 constructor. Change caller.
12370 (class Layout): Declare print_to_mapfile.
12371 * output.cc (Output_section::Input_section::print_to_mapfile): New
12372 function.
12373 (Output_section::add_input_section): If producing a map, always
12374 add to input_sections_ list.
12375 (Output_section::do_print_to_mapfile): New function.
12376 (Output_segment::print_sections_to_mapfile): New function.
12377 (Output_segment::print_section_list_to_mapfile): New function.
12378 * output.h: Include "mapfile.h".
12379 (Output_data::print_to_mapfile): New function.
12380 (Output_data::do_print_to_mapfile): New virtual function.
12381 (Output_segment_headers::do_print_to_mapfile): New function.
12382 (Output_file_header::do_print_to_mapfile): New function.
12383 (Output_data_const::do_print_to_mapfile): New function.
12384 (class Output_data_const_buffer): Add map_name_ field. Update
12385 constructor. Change all callers. Add do_print_to_mapfile
12386 function.
12387 (class Output_data_fixed_space): Likewise.
12388 (class Output_data_space): Likewise.
12389 (class Output_data_zero_fill): New class.
12390 (Output_data_strtab::do_print_to_mapfile): New function.
12391 (Output_data_reloc_base::do_print_to_mapfile): New function.
12392 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12393 (Output_data_group::do_print_to_mapfile): New function.
12394 (Output_data_got::do_print_to_mapfile): New function.
12395 (Output_data_dynamic::do_print_to_mapfile): New function.
12396 (Output_symtab_xindex::do_print_to_mapfile): New function.
12397 (class Output_section): Declare do_print_to_mapflie. Declare
12398 print_to_mapfile in Input_section.
12399 (class Output_segment): Declare new functions.
12400 * object.h (Sized_relobj::symbol_count): New function.
12401 * script-sections.cc
12402 (Output_section_element_dot_assignment::set_section_addresses):
12403 Change Output_data_fixed_space to Output_data_zero_fill.
12404 (Output_data_expression::do_print_to_mapfile): New function.
12405 * script.cc (read_input_script): Add mapfile parameter. Change
12406 all callers.
12407 * script.h (read_input_script): Update declaration.
12408 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12409 (Eh_frame::do_print_to_mapfile): New function.
12410 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12411 (Output_merge_string::do_print_to_mapfile): New function.
12412 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12413 function.
12414 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12415 function.
12416 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12417 function.
12418 * Makefile.am (CCFILES): Add mapfile.cc.
12419 (HFILES): Add mapfile.h.
12420 * Makefile.in: Rebuild.
12421
12422 2008-05-19 Ian Lance Taylor <iant@google.com>
12423
12424 * options.h (class General_options): Add -z relro.
12425 * layout.cc (Layout::Layout): Initialize relro_segment_.
12426 (Layout::add_output_section_data): Return the output section.
12427 (Layout::make_output_section): Rcognize relro sections and mark
12428 them appropriately.
12429 (Layout::attach_allocated_section_to_segment): Put relro sections
12430 in a PT_GNU_RELRO segment.
12431 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12432 section as relro.
12433 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12434 PT_TLS segments.
12435 (Layout::linkonce_mapping): Map d.rel.ro.local to
12436 .data.rel.ro.local.
12437 (Layout::output_section_name): Us .data.rel.ro.local for any
12438 section which begins with that.
12439 * layout.h (class Layout): Update add_output_section_data
12440 declaration. Add relro_segment_ field.
12441 * output.cc (Output_section::Output_section): Initialize is_relro_
12442 and is_relro_local_ fields.
12443 (Output_segment::add_output_section): Group relro sections.
12444 (Output_segment::is_first_section_relro): New function.
12445 (Output_segment::maximum_alignment): If there is a relro section,
12446 align the segment to the common page size.
12447 (Output_segment::set_section_addresses): Track whether we are
12448 looking at relro sections. If the last section is a relro
12449 section, align to the common page size.
12450 (Output_segment::set_section_list_addresses): Add in_relro
12451 parameter. Change all callers. Align to the page size when
12452 moving from relro to non-relro section.
12453 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12454 segment.
12455 * output.h (class Output_section): Add is_relro_ and
12456 is_relro_local_ fields.
12457 (Output_section::is_relro): New function.
12458 (Output_section::set_is_relro): New function.
12459 (Output_section::is_relro_local): New function.
12460 (Output_section::set_is_relro_local): New function.
12461 (class Output_segment): Update declarations.
12462 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12463 * sparc.cc (Target_sparc::got_section): Likewise.
12464 * x86_64.cc (Target_x86_64::got_section): Likewise.
12465 * testsuite/relro_test_main.cc: New file.
12466 * testsuite/relro_test.cc: New file.
12467 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12468 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12469 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12470 (relro_test.so, relro_test_pic.o): New targets.
12471 * testsuite/Makefile.in: Rebuild.
12472
12473 2008-05-16 Ian Lance Taylor <iant@google.com>
12474
12475 * output.cc (Output_segment::add_output_section): Remove front
12476 parameter.
12477 * output.h (class Output_segment): Remove
12478 add_initial_output_section and overloaded add_output_section.
12479 Update declaration of remaining add_output_section.
12480 * layout.cc (Layout::create_interp): Call add_output_section
12481 rather than add_initial_output_section.
12482 (Layout::finish_dynamic_section): Likewise.
12483
12484 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12485 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12486 know the dynamic type.
12487 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12488 field. Initialize it in constructor.
12489 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12490 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12491 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12492 reloc.
12493
12494 * output.cc (Output_reloc::get_address): Change return type to
12495 Elf_Addr.
12496 * output.h (class Output_reloc): Update get_address declaration.
12497 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12498 for section addresses.
12499
12500 2008-05-09 Ian Lance Taylor <iant@google.com>
12501
12502 PR 6493
12503 * gold.cc (gold_nomem): Use return value of write.
12504
12505 2008-05-08 Ian Lance Taylor <iant@google.com>
12506
12507 * symtab.c (Symbol::init_base_output_data): Add version
12508 parameter. Change all callers.
12509 (Symbol::init_base_output_segment): Likewise.
12510 (Symbol::init_base_constant): Likewise.
12511 (Symbol::init_base_undefined): Likewise.
12512 (Sized_symbol::init_output_data): Likewise.
12513 (Sized_symbol::init_output_segment): Likewise.
12514 (Sized_symbol::init_constant): Likewise.
12515 (Sized_symbol::init_undefined): Likewise.
12516 (Symbol_table::do_define_in_output_data): If the new symbol has a
12517 version, mark it as the default.
12518 (Symbol_table::do_define_in_output_segment): Likewise.
12519 (Symbol_table::do_define_as_constant): Likewise.
12520 * symtab.h (class Symbol): Update declarations.
12521 (class Sized_symbol): Likewise.
12522 * resolve.cc (Symbol::override_version): New function.
12523 (Symbol::override_base): Call override_version.
12524 (Symbol::override_base_with_special): Likewise.
12525 * testsuite/ver_script_8.script: New file.
12526 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12527 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12528 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12529 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12530
12531 2008-05-06 Ian Lance Taylor <iant@google.com>
12532
12533 PR 6049
12534 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12535 functions.
12536 (class General_options): Remove existing --undefined, and add
12537 --no-undefined instead. Add new --undefined as synonym for -u.
12538 * archive.cc (Archive::add_symbols): Check whether symbol was
12539 named with -u.
12540 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12541 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12542 all uses. Add IS_UNDEFINED. Update declarations to split
12543 different versions of init_base. Declare init_base_undefined.
12544 (Symbol::is_defined): Handle IS_UNDEFINED.
12545 (Symbol::is_undefined): Likewise.
12546 (Symbol::is_weak_undefined): Call is_undefined.
12547 (Symbol::is_absolute): Handle IS_CONSTANT.
12548 (class Sized_symbol): Update declarations to split different
12549 versions of init. Declare init_undefined.
12550 (class Symbol_table): Declare new functions.
12551 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12552 Change all callers.
12553 (Symbol::init_base_output_data): Likewise.
12554 (Symbol::init_base_output_segment): Likewise.
12555 (Symbol::init_base_constant): Likewise.
12556 (Symbol::init_base_undefined): New function.
12557 (Sized_symbol::init_object): Rename from init. Change all
12558 callers.
12559 (Sized_symbol::init_output_data): Likewise.
12560 (Sized_symbol::init_output_segment): Likewise.
12561 (Sized_symbol::init_constant): Likewise.
12562 (Sized_symbol::init_undefined): New function.
12563 (Symbol_table::add_undefined_symbols_from_command_line): New
12564 function.
12565 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12566 function.
12567 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12568 (Symbol::output_section): Likewise.
12569 (Symbol::set_output_section): Likewise.
12570 (Symbol_table::sized_finalize_symbol): Likewise.
12571 (Symbol_table::sized_write_globals): Likewise.
12572 * resolve.cc (Symbol_table::should_override): Likewise.
12573 (Symbol::override_base_with_special): Likewise.
12574
12575 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12576 symbol, change it to have default visibility.
12577 * testsuite/protected_1.cc: New file.
12578 * testsuite/protected_2.cc: New file.
12579 * testsuite/protected_3.cc: New file.
12580 * testsuite/protected_main_1.cc: New file.
12581 * testsuite/protected_main_2.cc: New file.
12582 * testsuite/protected_main_3.cc: New file.
12583 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12584 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12585 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12586 (protected_1.so): New target.
12587 (protected_1_pic.o, protected_2_pic.o): New targets.
12588 (protected_3_pic.o): New target.
12589 (check_PROGRAMS): Add protected_2.
12590 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12591 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12592 * testsuite/Makefile.in: Rebuild.
12593
12594 * options.h (DEFINE_var): Add set_user_set_##varname__.
12595 (DEFINE_bool_alias): New macro.
12596 (class General_options): Define -Bstatic using DEFINE_bool_alias
12597 rather than DEFINE_special. Add --undefined as an alias for -z
12598 defs.
12599 * options.cc (General_options::parse_Bstatic): Remove.
12600
12601 * options.h (class General_options): Add --fatal-warnings.
12602 * main.cc (main): Implement --fatal-warnings.
12603 * errors.h (Errors::warning_count): New function.
12604
12605 * options.h (class General_options): Add -Bsymbolic-functions.
12606 * symtab.h (Symbol::is_preemptible): Check for
12607 -Bsymbolic-functions.
12608
12609 2008-05-05 Ian Lance Taylor <iant@google.com>
12610
12611 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12612 as noVARNAME rather than no-VARNAME.
12613 (class General_options): Add option -z combreloc.
12614 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12615 get_address.
12616 (Output_reloc::sort_before) [SHT_REL]: New function.
12617 (Output_reloc::sort_before) [SHT_RELA]: New function.
12618 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12619 Sort_relocs_comparison.
12620 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12621 parameter. Change all callers.
12622 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12623 sort_relocs parameter. Change all callers.
12624 * output.cc (Output_reloc::get_address): New function, broken out
12625 of write_rel.
12626 (Output_reloc::write_rel): Call it.
12627 (Output_reloc::compare): New function.
12628 (Output_data_reloc_base::do_write): Optionally sort relocs.
12629
12630 * configure.ac: If targ_extra_obj is set, link it in.
12631 * configure.tgt: Initialize all variables.
12632 (x86_64*): Set targ_extra_obj and targ_extra_size.
12633 * configure: Rebuild.
12634
12635 * object.cc (Sized_relobj::include_section_group): Adjust section
12636 indexes read from group data. Build vector to pass to
12637 layout_group.
12638 * layout.cc (Layout::layout_group): Add flags and shndxes
12639 parameters. Remove contents parameter. Change caller. Update
12640 explicit instantiations.
12641 * layout.h (class Layout): Update layout_group declaration.
12642 * output.cc (Output_data_group::Output_data_group): Add flags and
12643 input_shndxes parameters. Remove contents parameter. Change
12644 caller.
12645 (Output_data_group::do_write): Change input_sections_ to
12646 input_shndxes_.
12647 * output.h (class Output_data_group): Update constructor
12648 declaration. Rename input_sections_ to input_shndxes_.
12649 * testsuite/many_sections_test.cc: Add template.
12650
12651 2008-04-30 Cary Coutant <ccoutant@google.com>
12652
12653 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12654
12655 * layout.cc (Layout::include_section): Refactored check for debug
12656 info section.
12657 (Layout::add_comdat): Add new parameters. Change type
12658 of signature parameter. Add object and shndx to signatures table.
12659 (Layout::find_kept_object): New function.
12660 * layout.h: Include <cstring>.
12661 (Layout::is_debug_info_section): New function.
12662 (Layout::add_comdat): Add new parameters.
12663 (Layout::find_kept_object): New function.
12664 (Layout::Kept_section): New struct.
12665 (Layout::Signatures): Change type of map range.
12666 * object.cc (Relobj::output_section_address): New function.
12667 (Sized_relobj::include_section_group): Add new parameters. Change
12668 calls to Layout::add_comdat. Change to build table of kept comdat
12669 groups and table mapping discarded sections to kept sections.
12670 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12671 (Sized_relobj::do_layout): Change calls to include_section_group and
12672 include_linkonce_section.
12673 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12674 value to zero when section is discarded.
12675 (Sized_relobj::map_to_kept_section): New function.
12676 * object.h (Relobj::output_section_address): New function.
12677 (Relobj::Comdat_group): New type.
12678 (Relobj::find_comdat_group): New function.
12679 (Relobj::Comdat_group_table): New type.
12680 (Relobj::Kept_comdat_section): New type.
12681 (Relobj::Kept_comdat_section_table): New type.
12682 (Relobj::add_comdat_group): New function.
12683 (Relobj::set_kept_comdat_section): New function.
12684 (Relobj::get_kept_comdat_section): New function.
12685 (Relobj::comdat_groups_): New field.
12686 (Relobj::kept_comdat_sections_): New field.
12687 (Symbol_value::input_value): Update comment.
12688 (Sized_relobj::map_to_kept_section) New function.
12689 (Sized_relobj::include_linkonce_section): Add new parameter.
12690 * target-reloc.h (Comdat_behavior): New type.
12691 (get_comdat_behavior): New function.
12692 (relocate_section): Add code to map a discarded section to the
12693 corresponding kept section when applying a relocation.
12694
12695 2008-04-30 Craig Silverstein <csilvers@google.com>
12696
12697 * dwarf_reader.cc (next_generation_count): New static var.
12698 (Addr2line_cache_entry): New struct.
12699 (addr2line_cache): New static var.
12700 (Dwarf_line_info::one_addr2line): Added caching.
12701 (Dwarf_line_info::clear_addr2line_cache): New function.
12702 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12703 cache-size parameter.
12704 (Dwarf_line_info::one_addr2line_cache): New function.
12705 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12706 new cache-size argument to one_addr2line(), and clear cache.
12707
12708 2008-04-28 Cary Coutant <ccoutant@google.com>
12709
12710 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12711 R_386_PC8 relocations.
12712
12713 2008-04-23 Ian Lance Taylor <iant@google.com>
12714
12715 * object.cc (Sized_relobj::include_section_group): Check for
12716 invalid section group.
12717
12718 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12719 header size.
12720
12721 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12722 than read for file header.
12723 * archive.cc (Archive::include_member): Likewise.
12724
12725 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12726
12727 * aclocal.m4: Regenerate.
12728 * configure: Regenerate.
12729
12730 2008-04-19 Ian Lance Taylor <iant@google.com>
12731
12732 * version.cc (version_string): Bump to 1.6.
12733
12734 * testsuite/Makefile.am (many_sections_r_test): New target.
12735 (many_sections_r_test_SOURCES): Remove.
12736 (many_sections_r_test_DEPENDENCIES): Remove.
12737 (many_sections_r_test_LDFLAGS): Remove.
12738 (many_sections_r_test_LDADD): Remove.
12739
12740 * object.cc (Sized_relobj::do_add_symbols): Always pass
12741 local_symbol_count_ to add_from_relobj.
12742
12743 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12744 every thousand variables.
12745 * testsuite/Makefile.in: Rebuild.
12746
12747 * object.cc (Xindex::initialize_symtab_xindex): New function.
12748 (Xindex::read_symtab_xindex): New function.
12749 (Xindex::sym_xindex_to_shndx): New function.
12750 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12751 available.
12752 (Sized_relobj::do_initialize_xindex): New function.
12753 (Sized_relobj::do_read_symbols): Adjust section links.
12754 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12755 parameter. Change all callers.
12756 (Sized_relobj::include_section_group): Adjust section links and
12757 symbol section indexes.
12758 (Sized_relobj::do_layout): Adjust section links.
12759 (Sized_relobj::do_count_local_symbols): Adjust section links and
12760 symbol section indexes.
12761 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12762 ordinary and special symbols.
12763 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12764 dynsym_xindex parameters. Change all callers. Adjust section
12765 links. Use SHN_XINDEX when needed.
12766 (Sized_relobj::get_symbol_location_info): Adjust section links.
12767 Don't get fooled by special symbols.
12768 * object.h (class Xindex): Define.
12769 (class Object): Add xindex_ parameter. Declare virtual functoin
12770 do_initialize_xindex.
12771 (Object::adjust_sym_shndx): New function.
12772 (Object::set_xindex): New protected function.
12773 (class Symbol_value): Add is_ordinary_shndx_ field.
12774 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12775 (Symbol_value::value): Assert ordinary section.
12776 (Symbol_value::initialize_input_to_output_map): Likewise.
12777 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12778 Change all callers.
12779 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12780 all callers.
12781 (class Sized_relobj): Update declarations.
12782 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12783 parameter. Change all callers.
12784 (Sized_relobj::adjust_shndx): New function.
12785 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12786 field.
12787 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12788 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12789 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12790 (Sized_dynobj::read_dynsym_section): Adjust section links.
12791 (Sized_dynobj::read_dynamic): Likewise.
12792 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12793 section links.
12794 (Sized_dynobj::do_initialize_xindex): New function.
12795 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12796 do_initialize_xindex.
12797 (Sized_dynobj::adjust_shndx): New function.
12798 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12799 dynsym_xindex_ fields.
12800 (Layout::finalize): Add a call to set_section_indexes before
12801 creating the symtab sections.
12802 (Layout::set_section_indexes): Don't do anything if the section
12803 already has a section index.
12804 (Layout::create_symtab_sections): Add shnum parameter. Change
12805 caller. Create .symtab_shndx section if needed.
12806 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12807 caller.
12808 (Layout::allocated_output_section_count): New function.
12809 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12810 needed.
12811 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12812 fields. Update declarations.
12813 (Layout::symtab_xindex): New function.
12814 (Layout::dynsym_xindex): New function.
12815 (class Write_symbols_task): Add layout_ field.
12816 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12817 Change caller.
12818 * output.cc (Output_section_headers::Output_section_headers): Add
12819 shstrtab_section parameter. Change all callers.
12820 (Output_section_headers::do_sized_write): Store overflow values
12821 for section count and section string table section index in
12822 section header zero.
12823 (Output_file_header::do_sized_write): Check for overflow of
12824 section count and section string table section index.
12825 (Output_symtab_xindex::do_write): New function.
12826 (Output_symtab_xindex::endian_do_write): New function.
12827 * output.h (class Output_section_headers): Add shstrtab_section_.
12828 Update declarations.
12829 (class Output_symtab_xindex): Define.
12830 (Output_section::has_out_shndx): New function.
12831 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12832 field.
12833 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12834 Change all callers.
12835 (Sized_symbol::init): Likewise.
12836 (Symbol::output_section): Check for ordinary symbol.
12837 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12838 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12839 callers.
12840 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12841 Change all callers. Simplify handling of symbols from sections
12842 not included in the link.
12843 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12844 distinction.
12845 (Weak_alias_sorter::operator()): Assert that symbols are
12846 ordinary.
12847 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12848 distinction.
12849 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12850 parameters. Change all callers.
12851 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12852 symbol distinction. Use SHN_XINDEX when needed.
12853 (Symbol_table::write_section_symbol): Add symtab_xindex
12854 parameter. Change all callers.
12855 (Symbol_table::sized_write_section_symbol): Likewise. Use
12856 SHN_XINDEX when needed.
12857 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12858 declarations.
12859 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12860 (Symbol::is_defined): Check is_ordinary.
12861 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12862 (Symbol::is_absolute, Symbol::is_common): Likewise.
12863 (class Sized_symbol): Update declarations.
12864 (class Symbol_table): Update declarations.
12865 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12866 parameters. Change all callers.
12867 (Sized_symbol::override): Likewise.
12868 (Symbol_table::override): Likewise.
12869 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12870 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12871 is_ordinary, and orig_st_shndx parameters. Change all callers.
12872 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12873 to be in an ordinary section.
12874 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12875 object and is_ordinary parameters. Change all callers.
12876 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12877 Change all callers. Don't add undefined or non-ordinary symbols
12878 to reloc_map_.
12879 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12880 Change all callers.
12881 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12882 declarations.
12883 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12884 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12885 (Sized_relobj::relocate_sections): Likewise.
12886 * target-reloc.h (scan_relocs): Adjust section symbol index.
12887 (scan_relocatable_relocs): Likewise.
12888 * i386.cc (Scan::local): Check for ordinary symbols.
12889 * sparc.cc (Scan::local): Likewise.
12890 * x86_64.cc (Scan::local): Likewise.
12891 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12892 to symbol_section_and_value.
12893 * testsuite/many_sections_test.cc: New file.
12894 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12895 (check_PROGRAMS): Add many_sections_test.
12896 (many_sections_test_SOURCES): Define.
12897 (many_sections_test_DEPENDENCIES): Define.
12898 (many_sections_test_LDFLAGS): Define.
12899 (BUILT_SOURCES): Add many_sections_define.h.
12900 (many_sections_define.h): New target.
12901 (BUILT_SOURCES): Add many_sections_check.h.
12902 (many_sections_check.h): New target.
12903 (check_PROGRAMS): Add many_sections_r_test.
12904 (many_sections_r_test_SOURCES): Define.
12905 (many_sections_r_test_DEPENDENCIES): Define.
12906 (many_sections_r_test_LDFLAGS): Define.
12907 (many_sections_r_test_LDADD): Define.
12908 (many_sections_r_test.o): New target.
12909 * testsuite/Makefile.in: Rebuild.
12910
12911 2008-04-17 Cary Coutant <ccoutant@google.com>
12912
12913 * errors.cc (Errors::info): New function.
12914 (gold_info): New function.
12915 * errors.h (Errors::info): New function.
12916 * gold.h (gold_info): New function.
12917 * object.cc (Input_objects::add_object): Print trace output.
12918 * options.cc (options::parse_set): New function.
12919 (General_options::parse_wrap): Deleted.
12920 (General_options::General_options): Deleted initializer.
12921 * options.h (options::String_set): New typedef.
12922 (options::parse_set): New function.
12923 (DEFINE_set): New macro.
12924 (General_options::wrap): Changed to use DEFINE_set. Changed
12925 callers of any_wrap_symbols and is_wrap_symbol.
12926 (General_options::trace, General_options::trace_symbol):
12927 New options.
12928 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12929 (General_options::wrap_symbols_): Deleted.
12930 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12931
12932 2008-04-17 David S. Miller <davem@davemloft.net>
12933
12934 * options.cc (General_options::parse_V): New function.
12935 * options.h: Add entries for -V and -Qy.
12936
12937 2008-04-17 Ian Lance Taylor <iant@google.com>
12938
12939 * common.cc (Symbol_table::allocate_commons): Remove options
12940 parameter. Change caller.
12941 (Symbol_table::do_allocate_commons): Remove options parameter.
12942 Change caller. Just call do_allocate_commons_list twice.
12943 (Symbol_table::do_allocate_commons_list): New function, broken out
12944 of do_allocate_commons.
12945 * common.h (class Allocate_commons_task): Remove options_ field.
12946 Update constructor.
12947 * symtab.cc (Symbol_table::Symbol_table): Initialize
12948 tls_commons_.
12949 (Symbol_table::add_from_object): Put TLS common symbols on
12950 tls_commons_ list.
12951 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12952 which are IN_OUTPUT_DATA.
12953 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12954 allocate_commons and do_allocate_commons declarations. Declare
12955 do_allocate_commons_list.
12956 * gold.cc (queue_middle_tasks): Update creation of
12957 Allocate_commons_task to not pass options.
12958 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12959 (TLS_TEST_C_FLAGS): New variable.
12960 (tls_test_c_pic.o): New target.
12961 (tls_test_shared.so): Link in tls_test_c_pic.o.
12962 (tls_test_c_pic_ie.o): New target.
12963 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12964 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12965 (tls_test_c.o): New target.
12966 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12967 (tls_pic_test_LDADD): Likewise.
12968 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12969 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12970 (tls_test_c_gnu2.o): New target.
12971 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12972 tls_test_c_gnu2.o.
12973 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12974 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12975 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12976 * testsuite/tls_test.cc: Include "config.h".
12977 (t_last): Call t11_last.
12978 * testsuite/tls_test.h (t11, t11_last): Declare.
12979 * testsuite/tls_test_c.c: New file.
12980 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12981 * configure.ac: Check for OpenMP support.
12982 * configure, config.in, Makefile.in: Rebuild.
12983 * testsuite/Makefile.in: Rebuild.
12984
12985 2008-04-16 Cary Coutant <ccoutant@google.com>
12986
12987 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12988 (Target_i386::tls_base_symbol_defined_): New field.
12989 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12990 (Target_i386::Scan::global): Likewise.
12991 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12992 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12993 (Target_x86_64::tls_base_symbol_defined_): New field.
12994 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12995 (Target_x86_64::Scan::global): Likewise.
12996
12997 2008-04-16 Cary Coutant <ccoutant@google.com>
12998
12999 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13000 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13001 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13002 building shared libraries.
13003 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13004 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13005 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13006 * testsuite/Makefile.in: Rebuild.
13007 * testsuite/weak_undef.h: New file.
13008 * testsuite/weak_undef_file1.cc: Add extra test cases.
13009 * testsuite/weak_undef_file2.cc: Likewise.
13010 * testsuite/weak_undef_test.cc: Likewise.
13011
13012 2008-04-16 David S. Miller <davem@davemloft.net>
13013
13014 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13015 Add issued_non_pic_error_ field. Declare check_non_pic.
13016 (Target_sparc::Scan::check_non_pic): New function.
13017 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13018 (Target_sparc::Scan::global): Likewise.
13019
13020 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13021 * configure: Rebuild.
13022
13023 * options.h (DEFINE_enable): New macro.
13024 (new_dtags): New enable option.
13025 (initfirst, interpose, loadfltr, nodefaultlib,
13026 nodelete, nodlopen, nodump): New -z options.
13027 * layout.cc (Layout:finish_dynamic_section): If new
13028 dtags enabled, emit DT_RUNPATH. Also, emit a
13029 DT_FLAGS_1 containing any specified -z flags.
13030
13031 2008-04-16 Ian Lance Taylor <iant@google.com>
13032
13033 * copy-relocs.cc: New file.
13034 * copy-relocs.h: New file.
13035 * reloc.cc: Remove Copy_relocs code.
13036 * reloc.h: Likewise.
13037 * reloc-types.h (struct Reloc_types) [both versions]: Add
13038 get_reloc_addend_noerror.
13039 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13040 variants of add_global which take an addend which must be zero.
13041 * i386.cc: Include "copy-relocs.h".
13042 (class Target_i386): Change type of copy_relocs_ to variable,
13043 update initializer.
13044 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13045 Change all callers.
13046 (Target_i386::do_finalize_sections): Change handling of
13047 copy_relocs_.
13048 * sparc.cc: Include "copy-relocs.h".
13049 (class Target_sparc): Change type of copy_relocs_ to variable,
13050 update initializer.
13051 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13052 Change all callers.
13053 (Target_sparc::do_finalize_sections): Change handling of
13054 copy_relocs_.
13055 * x86_64.cc: Include "copy-relocs.h".
13056 (class Target_x86_64): Change type of copy_relocs_ to variable,
13057 update initializer.
13058 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13059 class. Change all callers.
13060 (Target_x86_64::do_finalize_sections): Change handling of
13061 copy_relocs_.
13062 * Makefile.am (CCFILES): Add copy-relocs.cc.
13063 (HFILES): Add copy-relocs.h.
13064
13065 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13066
13067 * testsuite/script_test_4.sh: Permit leading zeroes.
13068
13069 2008-04-15 Ian Lance Taylor <iant@google.com>
13070
13071 * script-sections.cc (Script_sections::create_segments): Use
13072 header_size_adjustment even when there is enough room for the
13073 headers.
13074 * testsuite/script_test_4.sh: New file.
13075 * testsuite/script_test_4.t: New file.
13076 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13077 (check_DATA): Add script_test_4.stdout.
13078 (MOSTLYCLEANFILES): Likewise.
13079 (script_test_4): New target.
13080 (script_test_4.stdout): New target.
13081 * testsuite/Makefile.in: Rebuild.
13082
13083 * sparc.cc: Add definitions for Output_data_plt_sparc class
13084 constants.
13085
13086 2008-04-14 David S. Miller <davem@davemloft.net>
13087
13088 * sparc.cc: New file.
13089 * Makefile.am (TARGETSOURCES): Add sparc.cc
13090 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13091 * configure.tgt: Document targ_extra_size and
13092 targ_extra_big_endian. Add entries for sparc-* and
13093 sparc64-*.
13094 * configure.ac: Handle targ_extra_size and
13095 targ_extra_big_endian.
13096 * Makefile.in: Rebuild.
13097 * configure: Likewise.
13098 * po/POTFILES.in: Likewise.
13099 * po/gold.pot: Likewise.
13100
13101 2008-04-14 Ian Lance Taylor <iant@google.com>
13102
13103 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13104 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13105 in the name/type/flags to section mapping. Don't call
13106 allocate_output_section.
13107 (Layout::choose_output_section): Change parameter from adjust_name
13108 to is_input_section. Don't permit input sections after sections
13109 are attached to segments. Don't call allocate_output_section.
13110 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13111 not write_enable_output_section.
13112 (Layout::make_output_section): Don't push to
13113 unattached_section_list_ nor call attach_to_segment. Call
13114 attach_section_to_segment if sections are attached.
13115 (Layout::attach_sections_to_segments): New function.
13116 (Layout::attach_section_to_segment): New function.
13117 (Layout::attach_allocated_section_to_segment): Rename from
13118 attach_to_segment. Remove flags parameter.
13119 (Layout::allocate_output_section): Remove function.
13120 (Layout::write_enable_output_section): Remove function.
13121 * layout.h (class Layout): Update for above changes. Add new
13122 field sections_are_attached_.
13123 * output.h (Output_section::update_flags_for_input_section): New
13124 function.
13125 * output.cc (Output_section::add_input_section): Call
13126 update_flags_for_input_section.
13127 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13128
13129 2008-04-11 Cary Coutant <ccoutant@google.com>
13130
13131 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13132 thought unnecessary.
13133 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13134
13135 2008-04-11 Ian Lance Taylor <iant@google.com>
13136
13137 * output.h (class Output_section_data): Remove inline definition
13138 of set_addralign.
13139 * output.cc (Output_section_data::set_addralign): New function.
13140
13141 2008-04-11 Cary Coutant <ccoutant@google.com>
13142
13143 Add support for TLS descriptors for i386 and x86_64.
13144 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13145 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13146 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13147 GOT_TYPE_TLS_DESC.
13148 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13149 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13150 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13151 relocations.
13152 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13153 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13154 Fix problem with initial-exec relocations.
13155 (Target_i386::Relocate::relocate_tls): Likewise.
13156 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13157 relaxation.
13158 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13159 support for section-plus-offset dynamic table entries.
13160 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13161 (Output_data_dynamic::Dynamic_entry): Add support for
13162 section-plus-offset dynamic table entries.
13163 (Output_data_dynamic::Classification): Likewise.
13164 (Output_data_dynamic::classification_): Renamed offset_.
13165 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13166 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13167 (Target_x86_64::make_plt_section): New function.
13168 (Target_x86_64::reserve_tlsdesc_entries): New function.
13169 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13170 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13171 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13172 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13173 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13174 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13175 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13176 add extra PLT entry for TLS descriptors.
13177 (Output_data_plt_x86_64::got_): New field.
13178 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13179 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13180 fields.
13181 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13182 descriptors.
13183 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13184 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13185 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13186 R_386_TLS_DESC_CALL relocations.
13187 (Target_x86_64::Scan::global): Likewise.
13188 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13189 for TLS descriptors.
13190 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13191 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13192 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13193 GD-to-IE relaxation.
13194 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13195 and TLS_DESCRIPTORS.
13196 * Makefile.in: Rebuild.
13197 * configure: Rebuild.
13198 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13199 (tls_test_shared2.so): New target.
13200 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13201 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13202 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13203 (tls_shared_gd_to_ie_test_LDADD): New variable.
13204 (tls_shared_gnu2_gd_to_ie_test): New target.
13205 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13206 New targets.
13207 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13208 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13209 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13210 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13211 (tls_shared_gnu2_test): New target.
13212 (tls_test_gnu2_shared.so): New target.
13213 (tls_shared_gnu2_test_SOURCES): New variable.
13214 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13215 (tls_shared_gnu2_test_LDFLAGS): New variable.
13216 (tls_shared_gnu2_test_LDADD): New variable.
13217 * testsuite/Makefile.in: Rebuild.
13218 * testsuite/Makefile.
13219
13220 2008-04-11 Ian Lance Taylor <iant@google.com>
13221
13222 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13223 justsyms.t.
13224 * testsuite/Makefile.in: Rebuild.
13225
13226 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13227 long.
13228 * testsuite/script_test_2.cc (main): Adjust test.
13229
13230 2008-04-11 David S. Miller <davem@davemloft.net>
13231 Ian Lance Taylor <iant@google.com>
13232
13233 * options.h (General_options): Add entries for '-Y' and
13234 '-relax'.
13235 * options.cc (General_options:finalize): If -Y was used, add those
13236 entries to the library path instead of the default "/lib" and
13237 "/usr/lib".
13238
13239 2008-04-11 David S. Miller <davem@davemloft.net>
13240
13241 * testsuite/justsyms.t: Start at 0x100.
13242 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
13243 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13244 long.
13245 * testsuite/script_test_2.cc: Adjust string and section length
13246 checks.
13247
13248 2008-04-09 Ian Lance Taylor <iant@google.com>
13249
13250 PR gold/5996
13251 * script-sections.cc (Sections_element::allocate_to_segment): Add
13252 orphan parameter.
13253 (Output_section_definition::allocate_to_segment): Likewise.
13254 (Orphan_output_section::allocate_to_segment): Likewise.
13255 (Script_sections::attach_sections_using_phdrs_clause): Don't
13256 propagate non-PT_LOAD segments to orphan sections.
13257 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13258 readelf rather than objdump.
13259 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13260 .interp section and PT_INTERP segment are the same size.
13261 * testsuite/Makefile.in: Rebuild.
13262
13263 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13264 aliases for symbols defined in the same object.
13265 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13266 (weak_alias_test_SOURCES): New variable.
13267 (weak_alias_test_DEPENDENCIES): New variable.
13268 (weak_alias_test_LDFLAGS): New variable.
13269 (weak_alias_test_LDADD): New variable.
13270 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13271 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13272 (weak_alias_test_3.o): New target.
13273 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13274 * testsuite/weak_alias_test_main.cc: New file.
13275 * testsuite/weak_alias_test_1.cc: New file.
13276 * testsuite/weak_alias_test_2.cc: New file.
13277 * testsuite/weak_alias_test_3.cc: New file.
13278
13279 2008-04-08 Ian Lance Taylor <iant@google.com>
13280
13281 * options.h (class General_options): Add --noinhibit-exec option.
13282 * main.cc (main): Check --noinhibit-exec.
13283
13284 * options.h (class General_options): Define --wrap as a special
13285 option. Add wrap_symbols_ field.
13286 (General_options::any_wrap_symbols): New function.
13287 (General_options::is_wrap_symbol): New function.
13288 * options.cc (General_options::parse_wrap): New function.
13289 (General_options::General_options): Initialize wrap_symbols_.
13290 * symtab.cc (Symbol_table::wrap_symbol): New function.
13291 (Symbol_table::add_from_object): Handle --wrap.
13292 * symtab.h (class Symbol_table): Declare wrap_symbol.
13293 * target.h (Target::wrap_char): New function.
13294 (Target::Target_info): Add wrap_char field.
13295 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13296 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13297 * testsuite/testfile.cc (Target_test::test_target_info):
13298 Likewise.
13299
13300 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13301 there is one.
13302
13303 * layout.h (class Layout): Add added_eh_frame_data_ field.
13304 * layout.cc (Layout::Layout): Initialize new field.
13305 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13306 output section until we find a section we merged successfully.
13307 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13308 that the size be non-zero.
13309
13310 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13311 qualifier.
13312
13313 2008-04-08 Craig Silverstein <csilvers@google.com>
13314
13315 * configure.ac: Export new conditional variable HAVE_ZLIB.
13316 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13317 on HAVE_ZLIB.
13318 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13319 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13320
13321 2008-04-07 Ian Lance Taylor <iant@google.com>
13322
13323 * version.cc (version_string): Set to "1.5".
13324
13325 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13326 Add issued_non_pic_error_ field. Declare check_non_pic.
13327 (Target_x86_64::Scan::check_non_pic): New function.
13328 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13329 (Target_x86_64::Scan::global): Likewise.
13330
13331 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13332 addend parameter. Change caller. Handle merge sections.
13333 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13334 Address to Addend. Don't add in the result of
13335 local_section_offset, pass down the addend and use the returned
13336 value.
13337 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13338 Update declarations of local_section_offset and symbol_value.
13339 * testsuite/two_file_test_1.cc (t18): New function.
13340 * testsuite/two_file_test_2.cc (f18): New function.
13341 * testsuite/two_file_test_main.cc (main): Call t18.
13342 * testsuite/two_file_test.h (t18, f18): Declare.
13343
13344 * configure.ac: Don't test for objdump, c++filt, or readelf.
13345 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13346 conditionals.
13347 (TEST_READELF): New variable.
13348 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13349 (check_PROGRAMS): Add two_file_strip_test.
13350 (two_file_strip_test): New target.
13351 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13352 (two_file_same_shared_strip_test_SOURCES): New variable.
13353 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13354 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13355 (two_file_same_shared_strip_test_LDADD): New variable.
13356 (two_file_shared_strip.so): New target.
13357 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13358 (ver_test_5.syms, ver_test_7.syms): Likewise.
13359 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13360 (strip_test_3.stdout): Use TEST_OBJDUMP.
13361 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13362
13363 2008-04-04 Cary Coutant <ccoutant@google.com>
13364
13365 * symtab.h (Symbol::is_weak_undefined): New function.
13366 (Symbol::is_strong_undefined): New function.
13367 (Symbol::is_absolute): New function.
13368 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13369 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13370 absolute symbols.
13371 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13372 (weak_undef_test): New target.
13373 * testsuite/Makefile.in: Rebuild.
13374 * testsuite/weak_undef_file1.cc: New file.
13375 * testsuite/weak_undef_file2.cc: New file.
13376 * testsuite/weak_undef_test.cc: New file.
13377
13378 2008-04-03 Craig Silverstein <csilvers@google.com>
13379
13380 * compressed_output.h (class Output_compressed_section): Use
13381 unsigned buffer.
13382 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13383 add zlib header.
13384 (zlib_compressed_suffix): Removed.
13385 (Output_compressed_section::set_final_data_size): Use unsigned
13386 buffers.
13387 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13388 Fix linker invocation.
13389 (flagstest_o_specialfile_and_compress_debug_sections):
13390 Likewise.
13391 * testsuite/Makefile.in: Regenerated.
13392
13393 2008-04-02 David S. Miller <davem@davemloft.net>
13394
13395 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13396 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13397
13398 2008-04-02 Craig Silverstein <csilvers@google.com>
13399
13400 * TODO: New file.
13401
13402 2008-04-02 Ian Lance Taylor <iant@google.com>
13403
13404 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13405 parameters. Update for new key type to views_. Change all
13406 callers.
13407 (File_read::read): Adjust for byteshift in returned view.
13408 (File_read::add_view): New function, broken out of
13409 find_and_make_view.
13410 (File_read::make_view): New function, broken out of
13411 find_and_make_view.
13412 (File_read::find_or_make_view): Add offset and aligned
13413 parameters. Rewrite accordingly. Change all callers.
13414 (File_read::get_view): Add offset and aligned parameters. Adjust
13415 for byteshift in return value.
13416 (File_read::get_lasting_view): Likewise.
13417 * fileread.h (class File_read): Update declarations.
13418 (class File_read::View): Add byteshift_ field. Add byteshift to
13419 constructor. Add byteshift method.
13420 * archive.h (Archive::clear_uncached_views): New function.
13421 (Archive::get_view): Add aligned parameter. Change all callers.
13422 * object.h (Object::get_view): Add aligned parameter. Change all
13423 callers.
13424 (Object::get_lasting_view): Likewise.
13425
13426 * fileread.cc (File_read::release): Don't call clear_views if
13427 there are multiple objects.
13428 * fileread.h (File_read::clear_uncached_views): New function.
13429 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13430 on the archive.
13431
13432 2008-03-31 Cary Coutant <ccoutant@google.com>
13433
13434 Add thin archive support.
13435 * archive.cc (Archive::armagt): New const.
13436 (Archive::setup): Remove task parameter and calls to unlock.
13437 (Archive::unlock_nested_archives): New function.
13438 (Archive::read_header): Add nested_off parameter. Change
13439 all callers.
13440 (Archive::interpret_header): Likewise.
13441 (Archive::include_all_members): Change to handle thin
13442 archives.
13443 (Archive::include_member): Likewise.
13444 * archive.h (Archive::Archive): Add new parameters and
13445 initializers.
13446 (Archive::armagt): New const.
13447 (Archive::setup): Remove task parameter.
13448 (Archive::unlock_nested_archives): New function.
13449 (Archive::read_header): Add nested_off parameter.
13450 (Archive::interpret_header): Likewise.
13451 (Archive::Nested_archive_table): New typedef.
13452 (Archive::is_thin_archive_): New field.
13453 (Archive::nested_archives_): New field.
13454 (Archive::options_): New field.
13455 (Archive::dirpath_): New field.
13456 (Archive::task_): New field.
13457 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13458 for thin archives. Pass additional parameters to
13459 Archive::Archive. Unlock the archive file after calling
13460 Archive::setup.
13461
13462 2008-03-29 Ian Lance Taylor <iant@google.com>
13463
13464 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13465 version symbol to be local.
13466 * testsuite/ver_test_4.sh: New file.
13467 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13468 (check_DATA): Add ver_test_4.syms.
13469 (ver_test_4.syms): New target.
13470 * testsuite/Makefile.in: Rebuild.
13471
13472 * output.cc
13473 (Output_section::Input_section_sort_entry::has_priority): New
13474 function.
13475 (Output_section::Input_section_sort_entry::match_file_name): New
13476 function.
13477 (Output_section::Input_section_sort_entry::match_section_name):
13478 Remove.
13479 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13480 Remove.
13481 (Output_section::Input_section_sort_entry::match_section_file):
13482 Remove.
13483 (Output_section::Input_section_sort_compare::operator()): Rewrite
13484 using new Input_section_sort_entry functions. Sort crtbegin and
13485 crtend first. Sort sections with no priority before sections with
13486 a priority.
13487 * testsuite/initpri1.c (d3): Check j != 4.
13488 (cd5): New constructor/destructor function.
13489 (main): Check j != 2.
13490
13491 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13492 new symbol when resolving, don't call set_is_default.
13493 * testsuite/ver_test_7.cc: New file.
13494 * testsuite/ver_test_7.sh: New file.
13495 * testsuite/Makefile.am (ver_test_7.so): New target.
13496 (ver_test_7.o): New target.
13497 (check_SCRIPTS): Add ver_test_7.sh.
13498 (check_DATA): Add ver_test_7.syms.
13499 (ver_test_7.syms): New target.
13500
13501 2008-03-28 Ian Lance Taylor <iant@google.com>
13502
13503 * layout.cc (Layout::layout): If we see an input section with a
13504 name that needs sorting, set the must_sort flag for the output
13505 section.
13506 (Layout::make_output_section): If the name of the output section
13507 indicates that it might require sorting, set the may_sort flag.
13508 * output.h (Output_section::may_sort_attached_input_sections): New
13509 function.
13510 (Output_section::set_may_sort_attached_input_sections): New
13511 function.
13512 (Output_section::must_sort_attached_input_sections): New
13513 function.
13514 (Output_section::set_must_sort_attached_input_sections): New
13515 function.
13516 (class Output_section): Declare Input_section_sort_entry. Define
13517 Input_section_sort_compare. Declare
13518 sort_attached_input_sections. Add new fields:
13519 may_sort_attached_input_sections_,
13520 must_sort_attached_input_sections_,
13521 attached_input_sections_are_sorted_.
13522 * output.cc (Output_section::Output_section): Initialize new
13523 fields.
13524 (Output_section::add_input_section): Add an entry to
13525 input_sections_ if may_sort or must_sort are true.
13526 (Output_section::set_final_data_size): Call
13527 sort_attached_input_sections if necessary.
13528 (Output_section::Input_section_sort_entry): Define new class.
13529 (Output_section::Input_section_sort_compare::operator()): New
13530 function.
13531 (Output_section::sort_attached_input_sections): New function.
13532 * configure.ac: Check whether the compiler supports constructor
13533 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13534 * testsuite/initpri1.c: New file.
13535 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13536 CONSTRUCTOR_PRIORITY.
13537 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13538 (initpri1_LDFLAGS): New variable.
13539 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13540
13541 2008-03-27 Ian Lance Taylor <iant@google.com>
13542
13543 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13544 * testsuite/common_test_1.c: New file.
13545 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13546 (common_test_1_SOURCES): New variable.
13547 (common_test_1_DEPENDENCIES): New variable.
13548 (common_test_1_LDFLAGS): New variable.
13549
13550 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13551 and commons_ correctly when NAME/VERSION does not override
13552 NAME/NULL.
13553 * testsuite/ver_test_6.c: New file.
13554 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13555 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13556 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13557
13558 2008-03-26 Ian Lance Taylor <iant@google.com>
13559
13560 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13561 of an undefined symbol from a version script.
13562 * testsuite/Makefile.am (ver_test_5.so): New target.
13563 (ver_test_5.o): New target.
13564 (check_SCRIPTS): Add ver_test_5.sh.
13565 (check_DATA): Add ver_test_5.syms.
13566 (ver_test_5.syms): New target.
13567 * testsuite/ver_test_5.cc: New file.
13568 * testsuite/ver_test_5.script: New file.
13569 * testsuite/ver_test_5.sh: New file.
13570 * Makefile.in, testsuite/Makefile.in: Rebuild.
13571
13572 PR gold/5986
13573 Fix problems building gold with gcc 4.3.0.
13574 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13575 (gold_error_at_location, gold_warning_at_location): Use it.
13576 * configure.ac: Check whether we can compile and use a template
13577 function with a printf attribute.
13578 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13579 when jumping over bytes.
13580 * object.cc: Instantiate Object::read_section_data.
13581 * debug.h: Include <cstring>
13582 * dwarf_reader.cc: Include <algorithm>
13583 * main.cc: Include <cstring>.
13584 * options.cc: Include <cstring>.
13585 * output.cc: Include <cstring>.
13586 * script.cc: Include <cstring>.
13587 * script.h: Include <string>.
13588 * symtab.cc: Include <cstring> and <algorithm>.
13589 * target-select.cc: Include <cstring>.
13590 * version.cc: Include <string>.
13591 * testsuite/testmain.cc: Include <cstdlib>.
13592 * configure, config.in: Rebuild.
13593
13594 2008-03-25 Ian Lance Taylor <iant@google.com>
13595
13596 * options.cc: Include "../bfd/bfdver.h".
13597 (options::help): Print bug reporting address.
13598
13599 * version.cc (print_version): Adjust output for current value of
13600 BFD_VERSION_STRING.
13601
13602 * NEWS: New file.
13603
13604 * options.cc (options::help): Print list of supported targets.
13605 * target-select.h: Include <vector>.
13606 (class Target_selector): Make machine_, size_, and is_big_endian_
13607 fields const. Add bfd_name_ and instantiated_target_ fields.
13608 (Target_selector::Target_selector): Add bfd_name parameter.
13609 (Target_selector::recognize): Make non-virtual, call
13610 do_recognize.
13611 (Target_selector::recognize_by_name): Make non-virtual, call
13612 do_recognize_by_name.
13613 (Target_selector::supported_names): New function.
13614 (Target_selector::bfd_name): New function.
13615 (Target_selector::do_instantiate_target): New pure virtual
13616 function.
13617 (Target_selector::do_recognize): New virtual function.
13618 (Target_selector::do_recognize_by_name): New virtual function.
13619 (Target_selector::instantiate_target): New private function.
13620 (supported_target_names): Declare.
13621 * target-select.cc (Target_selector::Target_selector): Update for
13622 new parameter and fields.
13623 (select_target_by_name): Check that the name matches before
13624 calling recognize_by_name.
13625 (supported_target_names): New function.
13626 * i386.cc (class Target_selector_i386): Update Target_selector
13627 constructor call. Remove recognize and recognize_by_name. Add
13628 do_instantiate_target.
13629 * x86_64.cc (class Target_selector_x86_64): Likewise.
13630 * testsuite/testfile.cc (class Target_selector_test): Update for
13631 changes to Target_selector.
13632
13633 * README: Rewrite, with some notes on unsupported features.
13634
13635 2008-03-24 Cary Coutant <ccoutant@google.com>
13636
13637 * i386.cc (Target_i386::Got_type): New enum declaration.
13638 (Target_i386::Scan::local): Updated callers of Output_data_got
13639 member functions.
13640 (Target_i386::Scan::global): Likewise.
13641 (Target_i386::Relocate::relocate): Likewise.
13642 (Target_i386::Relocate::relocate_tls): Likewise.
13643 * object.h (Got_offset_list): New class.
13644 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13645 (Sized_relobj::local_got_offset): Likewise.
13646 (Sized_relobj::set_local_got_offset): Likewise.
13647 (Sized_relobj::local_has_tls_got_offset): Removed.
13648 (Sized_relobj::local_tls_got_offset): Removed.
13649 (Sized_relobj::set_local_tls_got_offset): Removed.
13650 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13651 * output.cc (Output_data_got::add_global): Added got_type parameter.
13652 (Output_data_got::add_global_with_rel): Likewise.
13653 (Output_data_got::add_global_with_rela): Likewise.
13654 (Output_data_got::add_global_pair_with_rel): New function.
13655 (Output_data_got::add_global_pair_with_rela): New function.
13656 (Output_data_got::add_local): Added got_type parameter.
13657 (Output_data_got::add_local_with_rel): Likewise.
13658 (Output_data_got::add_local_with_rela): Likewise.
13659 (Output_data_got::add_local_pair_with_rel): New function.
13660 (Output_data_got::add_local_pair_with_rela): New function.
13661 (Output_data_got::add_global_tls): Removed.
13662 (Output_data_got::add_global_tls_with_rel): Removed.
13663 (Output_data_got::add_global_tls_with_rela): Removed.
13664 (Output_data_got::add_local_tls): Removed.
13665 (Output_data_got::add_local_tls_with_rel): Removed.
13666 (Output_data_got::add_local_tls_with_rela): Removed.
13667 * output.h (Output_data_got::add_global): Added got_type parameter.
13668 (Output_data_got::add_global_with_rel): Likewise.
13669 (Output_data_got::add_global_with_rela): Likewise.
13670 (Output_data_got::add_global_pair_with_rel): New function.
13671 (Output_data_got::add_global_pair_with_rela): New function.
13672 (Output_data_got::add_local): Added got_type parameter.
13673 (Output_data_got::add_local_with_rel): Likewise.
13674 (Output_data_got::add_local_with_rela): Likewise.
13675 (Output_data_got::add_local_pair_with_rel): New function.
13676 (Output_data_got::add_local_pair_with_rela): New function.
13677 (Output_data_got::add_global_tls): Removed.
13678 (Output_data_got::add_global_tls_with_rel): Removed.
13679 (Output_data_got::add_global_tls_with_rela): Removed.
13680 (Output_data_got::add_local_tls): Removed.
13681 (Output_data_got::add_local_tls_with_rel): Removed.
13682 (Output_data_got::add_local_tls_with_rela): Removed.
13683 * resolve.cc (Symbol::override_base_with_special): Removed
13684 reference to has_got_offset_ field.
13685 * symtab.cc (Symbol::init_fields): Replaced initialization
13686 of got_offset_ with got_offsets_. Removed initialization
13687 of has_got_offset_
13688 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13689 (Symbol::got_offset): Likewise.
13690 (Symbol::set_got_offset): Likewise.
13691 (Symbol::has_tls_got_offset): Removed.
13692 (Symbol::tls_got_offset): Removed.
13693 (Symbol::set_tls_got_offset): Removed.
13694 (Symbol::got_offset_): Removed.
13695 (Symbol::tls_mod_got_offset_): Removed.
13696 (Symbol::tls_pair_got_offset_): Removed.
13697 (Symbol::got_offsets_): New field.
13698 (Symbol::has_got_offset): Removed.
13699 (Symbol::has_tls_mod_got_offset): Removed.
13700 (Symbol::has_tls_pair_got_offset): Removed.
13701 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13702 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13703 member functions.
13704 (Target_x86_64::Scan::global): Likewise.
13705 (Target_x86_64::Relocate::relocate): Likewise.
13706 (Target_x86_64::Relocate::relocate_tls): Likewise.
13707
13708 2008-03-25 Ben Elliston <bje@au.ibm.com>
13709
13710 * yyscript.y: Fix spelling error in comment.
13711
13712 2008-03-24 Ian Lance Taylor <iant@google.com>
13713
13714 * options.h (class General_options): Define build_id option.
13715 * layout.h (class Layout): Declare write_build_id, create_note,
13716 create_build_id. Add build_id_note_ member.
13717 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13718 "libiberty.h", "md5.h", "sha1.h".
13719 (Layout::Layout): Initialize eh_frame_data_,
13720 eh_frame_hdr_section_, and build_id_note_.
13721 (Layout::finalize): Call create_build_id.
13722 (Layout::create_note): New function, broken out of
13723 Layout::create_gold_note.
13724 (Layout::create_gold_note): Call create_note.
13725 (Layout::create_build_id): New function.
13726 (Layout::write_build_id): New function.
13727 (Close_task_runner::run): Call write_build_id.
13728
13729 * x86_64.cc: Correct license to GPLv3.
13730
13731 2008-03-23 Ian Lance Taylor <iant@google.com>
13732
13733 * options.cc: Include "demangle.h".
13734 (parse_optional_string): New function.
13735 (parse_long_option): Handle takes_optional_argument.
13736 (parse_short_option): Update dash_z initializer. Handle
13737 takes_optional_argument.
13738 (General_options::General_options): Initialize do_demangle_.
13739 (General_options::finalize): Set do_demangle_. Handle demangling
13740 style.
13741 * options.h (parse_optional_string): Declare.
13742 (struct One_option): Add optional_arg field. Update constructor.
13743 Update call constructor calls. Add takes_optional_argument
13744 function.
13745 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13746 (DEFINE_optional_string): Define.
13747 (General_options::demangle): Change from DEFINE_bool to
13748 DEFINE_optional_string.
13749 (General_options::no_demangle): New function.
13750 (General_options::do_demangle): New function.
13751 (General_options::set_do_demangle): New function.
13752 (General_options::execstack_status_): Move definition to end of
13753 class definition.
13754 (General_options::static_): Likewise.
13755 (General_options::do_demangle_): New field.
13756 * object.cc (big_endian>::get_symbol_location_info): Call
13757 Options::do_demangle, not Options::demangle.
13758 * symtab.cc (demangle): Likewise.
13759
13760 2008-03-22 Ian Lance Taylor <iant@google.com>
13761
13762 * gold.h: Include <cstddef> and <sys/types.h>
13763 * options.h: Include <cstring>.
13764
13765 2008-03-21 Ian Lance Taylor <iant@google.com>
13766
13767 * Added source code to GNU binutils.