2013-07-22 Sterling Augustine <saugustine@google.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2013-07-22 Sterling Augustine <saugustine@google.com>
2
3 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
4 Convert parameter shndx to local variable. Add parameters symtab
5 and symtab_size. Scan over section names. Find relocation
6 section corresponding to current section. Create and initialize
7 reloc_mapper_ and reloc_type_.
8 (Dwarf_pubnames_table::read_header): Add assertion. Change
9 unit_length to off_t. Initialize member unit_length_. Fill in field
10 cu_offset_.
11 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
12 Initialize new fields unit_length_ and cu_offset_.
13 (Dwarf_pubnames_table::read_section): Update prototype.
14 (Dwarf_pubnames_table::cu_offset): New member function.
15 (Dwarf_pubnames_table::subsection_size): Likewise.
16 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
17 New fields.
18 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
19 member functions public.
20 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
21 Update comment. Rework logic. Move repeated parts to...
22 (Gdb_index_info_reader::read_pubtable): ...here. New function.
23 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
24 pubtypes_table_, and stmt_list_offset.
25 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
26 Gdb_index::find_pubtype_offset,
27 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
28 (Gdb_index::pubnames_read): Update prototype and rework logic.
29 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
30 Forward declare.
31 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
32 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
33 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
34 Gdb_index::map_pubtable_to_dies):
35 Declare functions.
36 (Gdb_index::pubnames_read): Update declaration.
37 (Gdb_index::Pubname_offset_map): New type.
38 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
39 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
40 Gdb_index::stmt_list_offset): Declare.
41 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
42 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
43 Gdb_index::pubtypes_offset_): Remove.
44
45 2013-07-19 Roland McGrath <mcgrathr@google.com>
46
47 * options.h (General_options): Add -Trodata-segment option.
48 * parameters.cc (Parameters::check_rodata_segment): New function.
49 (Parameters::set_target_once): Call it.
50 * parameters.h (Parameters): Declare it (private member function).
51 * layout.cc (load_seg_unusable_for_headers): New function, broken
52 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
53 then validate rodata segment rather than text segment.
54 (relaxation_loop_body): Call that.
55 (is_text_segment): New function. Don't admit a non-executable
56 segment if TARGET->isolate_execinstr().
57 (set_segment_offsets): Call it. Honor -Trodata-segment option.
58
59 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
60
61 PR gold/15070
62 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
63 * nacl.h (Sniff_file::View::View): Request aligned view.
64
65 2013-07-11 Cary Coutant <ccoutant@google.com>
66
67 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
68 correct BRLT entry size.
69
70 2013-07-03 Alan Modra <amodra@gmail.com>
71
72 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
73 comment.
74
75 2013-07-01 Cary Coutant <ccoutant@google.com>
76
77 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
78 reloc_type_.
79 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
80 (Dwarf_ranges_table::lookup_reloc): New function.
81 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
82 reloc_type_.
83 (Dwarf_ranges_table::lookup_reloc): New function.
84 (Dwarf_ranges_table::reloc_type_): New data member.
85
86 2013-06-27 Jing Yu <jingyu@google.com>
87
88 PR gold/15662
89 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
90 function.
91 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
92 (Target_powerpc::do_relax): Call the above.
93
94 2013-06-27 Cary Coutant <ccoutant@google.com>
95
96 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
97 on garbage collected .opd section.
98
99 2013-06-27 Alan Modra <amodra@gmail.com>
100
101 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
102 is non-zero.
103 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
104 (Target_powerpc::do_function_location): Likewise for loc->shndx.
105
106 2013-06-14 Cary Coutant <ccoutant@google.com>
107
108 * resolve.cc (Symbol::override_base): Don't override st_type
109 from plugin placeholder symbols.
110 (Symbol_table::resolve): Likewise.
111 (Symbol_table::should_override): Don't complain about TLS mismatch
112 if the TO symbol is a plugin placeholder.
113 * testsuite/Makefile.am (plugin_test_tls): New test.
114 * testsuite/Makefile.in: Regenerate.
115 * testsuite/plugin_test_tls.sh: New test script.
116 * testsuite/two_file_test_2_tls.cc: New test source.
117 * testsuite/two_file_test_tls.cc: New test source.
118
119 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
120
121 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
122 the maximum segment alignment is larger than the page size.
123 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
124 correctly aligns the symbols with large alignemnt.
125 * testsuite/Makefile.in: Regenerate.
126 * testsuite/large_symbol_alignment.cc: New file.
127
128 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
129 Sriraman Tallam <tmsriram@google.com>
130
131 * options.h (sort_section): New option.
132 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
133 Rename from Input_section_sort_section_name_special_ordering_compare.
134 (Input_section_sort_section_name_compare): New struct.
135 * output.cc (Output_section::Input_section_sort_section_name_compare::
136 operator()): New function.
137 (Output_section::sort_attached_input_sections): Use new sort function
138 for .text if --sort-section=name is specified.
139 * layout.cc (Layout::make_output_section):
140 Add sorting by name when --sort-section=name is specified.
141 * testsuite/Makefile.am (text_section_grouping): Test option
142 --sort-section=name.
143 * testsuite/Makefile.in: Regenerate.
144 * testsuite/section_sorting_name.cc: New file.
145 * testsuite/section_sorting_name.sh: New file.
146
147 2013-05-21 Cary Coutant <ccoutant@google.com>
148
149 * symtab.h (Symbol::is_cxx_vtable): New function.
150 * target-reloc.h (relocate_section): Check for vtable symbol.
151 * testsuite/Makefile.am (missing_key_func.sh): New test case.
152 * testsuite/Makefile.in: Regenerate.
153 * testsuite/missing_key_func.cc: New test source.
154 * testsuite/missing_key_func.sh: New test script.
155
156 2013-05-21 Cary Coutant <ccoutant@google.com>
157
158 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
159 type of enclosing symbol.
160 (Relocate_info::location): Check symbol type when describing symbol.
161 * object.h (Symbol_location_info): Remove unused line_number;
162 add enclosing_symbol_type.
163 * testsuite/debug_msg.sh: Adjust expected output.
164
165 2013-05-13 Cary Coutant <ccoutant@google.com>
166
167 * configure.ac: Export DEFAULT_TARGET.
168 * configure: Regenerate.
169 * Makefile.in: Regenerate.
170 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
171 * testsuite/Makefile.in: Regenerate.
172 * testsuite/debug_msg.sh: Delete duplicate tests.
173 Don't check undef_int error message match for powerpc where the
174 source file and line number aren't available.
175
176 2013-05-10 Roland McGrath <mcgrathr@google.com>
177
178 * options.h (General_options): Add --rosegment-gap option.
179 * options.cc (finalize): --rosegment-gap implies --rosegment.
180 * layout.cc (set_segment_offsets): Let user option override
181 target->rosegment_gap().
182
183 2013-05-10 Roland McGrath <mcgrathr@google.com>
184
185 * options.h (General_options): Remove leading space from help
186 messages for -nostdlib and --rosegment.
187
188 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
189
190 PR ld/15365
191 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
192
193 2013-05-03 Alan Modra <amodra@gmail.com>
194
195 * merge.cc (Output_merge_string::do_add_input_section): Correct
196 scan for number of strings. Rename vars to avoid shadowing.
197 Include missing terminator in input_size_.
198
199 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
200
201 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
202 Restore empty string handling.
203
204 2013-05-01 Cary Coutant <ccoutant@google.com>
205
206 * stringpool.cc (Stringpool_template::new_key_offset): Fix
207 uninitialized warning.
208
209 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
210
211 * output.cc (Output_section::add_merge_input_section): Allow
212 to merge sections if the alignment is more than character size.
213 * merge.h (Output_merge_string::Output_merge_string): Remove
214 assert.
215 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
216 only not-null strings. Check the alignment of strings.
217 * stringpool.h
218 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
219 alignment as the argument.
220 (Stringpool_template<Stringpool_char>::addralign_): New class member.
221 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
222 Align non-zero length strings according to the addralign_.
223 (Stringpool_template<Stringpool_char>::set_string_offsets):
224 Updating offsets according to the given alignment.
225 * testsuite/Makefile.am (text_section_grouping): Test if string
226 literals are getting merged.
227 * testsuite/Makefile.in: Regenerate.
228 * testsuite/merge_string_literals_1.c: New file.
229 * testsuite/merge_string_literals_2.c: Ditto.
230 * testsuite/merge_string_literals.sh: Ditto.
231
232 2013-04-26 Ian Lance Taylor <iant@google.com>
233
234 * target-reloc.h (relocate_section): If the reloc offset is out of
235 range, pass VIEW as NULL to relocate.relocate.
236 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
237 * i386.cc (Target_i386::Relocate::relocate): Likewise.
238 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
239 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
240 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
241 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
242
243 2013-04-26 Geoff Pike <gpike@chromium.org>
244
245 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
246 * layout.cc (Hash_task): New class.
247 (Layout::queue_build_id_tasks): New function.
248 (Layout::write_build_id): Handle single-thread portion of build ID
249 computation. (In some cases, all of it is single-threaded.) Replace
250 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
251 functionality in fewer lines of code.
252 * layout.h (Layout::queue_build_id_tasks): New function declaration.
253 * options.h (General_options): make "--build-id" default to tree
254 rather than sha1. Add two new options related to --build-id=tree:
255 --build-id-chunk-size-for-treehash and
256 --build-id-min-file-size-for-treehash.
257 * Makefile.am: add testing of --build-id=tree and related new options
258 (these tests will be invoked by "make check").
259 * Makefile.in: Regenerate.
260
261 2013-04-25 Alan Modra <amodra@gmail.com>
262
263 * configure.tgt: Add powerpcle and powerpc64le.
264
265 2013-04-22 Alan Modra <amodra@gmail.com>
266
267 PR gold/15355
268 * layout.cc (Layout::segment_precedes): Allow more than one
269 segment with the same type and flags.
270
271 2013-04-15 Cary Coutant <ccoutant@google.com>
272
273 * layout.cc (Layout::set_relocatable_section_offsets): Don't
274 allocate space in file for BSS sections.
275
276 2013-04-15 Cary Coutant <ccoutant@google.com>
277
278 * script-sections.cc (Orphan_output_section): Reset address
279 to zero after each orphaned section for relocatable links.
280
281 2013-04-15 Cary Coutant <ccoutant@google.com>
282
283 * symtab.cc (Symbol_table::sized_write_globals): Subtract
284 section starting address for relocatable link.
285 * testsuite/Makefile.am (script_test_11): New test.
286 * testsuite/Makefile.in: Regenerate.
287 * testsuite/script_test_11.c: New source file.
288 * testsuite/script_test_11.t: New linker script.
289
290 2013-04-13 Alan Modra <amodra@gmail.com>
291
292 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
293 owner when sections are not adjacent and exceed group size.
294 (Target_powerpc::group_sections): Handle corner case.
295 (Target_powerpc::Branch_info::make_stub): Handle case where
296 stub table doesn't exist due to branches in non-exec sections.
297 (Target_powerpc::Relocate::relocate): Likewise.
298
299 2013-04-11 Alan Modra <amodra@gmail.com>
300
301 PR gold/15354
302 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
303 .branch_lt to match bfd ld. Adjust comments throughout file.
304
305 2013-04-04 Ian Lance Taylor <iant@google.com>
306
307 GCC PR c++/56840
308 * object.cc (do_layout_deferred_sections): Handle .eh_frame
309 sections before checking whether they are included in the link.
310
311 2013-03-29 Sriraman Tallam <tmsriram@google.com>
312
313 * archive.cc (Archive::get_elf_object_for_member): Create the elf
314 object before calling the plugin claim_file handler. Pass the elf
315 object of the archive to the plugin. Delete the elf object if the
316 plugin claims the file.
317
318 2013-03-21 Alan Modra <amodra@gmail.com>
319
320 * layout.cc (Layout::set_segment_offsets): Accept writable .text
321 segment when omagic.
322
323 2013-03-21 Alan Modra <amodra@gmail.com>
324
325 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
326 comparison warning.
327 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
328 uninitialized" warning.
329
330 2013-03-20 Alan Modra <amodra@gmail.com>
331
332 * symtab.h (Symbol::clear_version): New function.
333 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
334 is_needed by weak references. Clear version for symbols defined
335 in as-needed objects that are not needed.
336
337 2013-03-15 Alan Modra <amodra@gmail.com>
338
339 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
340 static and public. Add report_err param. Return false for data refs.
341 (Target_powerpc::rela_dyn_section): New overloaded function.
342 (Target_powerpc::plt_, iplt_): Elucidate.
343 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
344 (Output_data_plt_powerpc::do_write): Don't write .iplt.
345 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
346 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
347 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
348 push_branch and make_plt_entry for ifunc syms when
349 reloc_needs_plt_for_ifunc.
350 (Target_powerpc::Relocate::relocate): Don't use plt entry value
351 for ifunc unless reloc_needs_plt_for_ifunc.
352
353 2013-03-15 Alan Modra <amodra@gmail.com>
354
355 * gc.h (gc_process_relocs): Don't look through function descriptors.
356 * icf.cc (get_section_contents): Do so here instead.
357
358 2013-03-13 Alan Modra <amodra@gmail.com>
359
360 * powerpc.cc (is_branch_reloc): Forward declare.
361 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
362 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
363 false for 64-bit, true for 32-bit non-branch relocs.
364 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
365 * testsuite/Makefile.am (icf_test): Use linker map file instead of
366 nm output.
367 (icf_safe_test): Generate linker map file as well as nm output.
368 (icf_safe_so_test): Likewise.
369 * testsuite/Makefile.in: Regenerate.
370 * testsuite/icf_test.sh: Parse linker map file to determine
371 section folding.
372 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
373 * testsuite/icf_safe_so_test.sh: Likewise.
374 (X86_32_or_ARM_specific_safe_fold): Merge into..
375 (arch_specific_safe_fold): ..this.
376 (X86_64_specific_safe_fold): Delete unused function.
377
378 2013-03-12 Alan Modra <amodra@gmail.com>
379
380 * gc.h (gc_process_relocs): Look through function descriptors
381 to determine shndx, symvalue and addend used by ICF. Tidy
382 variable duplication.
383
384 2013-03-11 Alan Modra <amodra@gmail.com>
385
386 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
387 * layout.cc (Layout_task_runner::run): ..to here.
388 * symtab.h (struct Symbol_location): Extract from..
389 (class Symbol_table): ..here.
390 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
391 * target.h (class Target): Add function_location and
392 do_function_location functions.
393 (class Sized_target): Add do_function_location.
394 * object.h (class Sized_relobj_file): Move find_shdr..
395 (class Object): ..to here.
396 * object.cc: Likewise. Update to suit. Instantiate.
397 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
398 * powerpc.cc (class Powerpc_dynobj): New.
399 (Target_powerpc::do_function_location): New function.
400 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
401 (Powerpc_dynobj::do_read_symbols): New function.
402 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
403
404 2013-03-08 Ian Lance Taylor <iant@google.com>
405
406 * options.cc (General_options::string_to_object_format): Accept
407 "default".
408
409 2013-03-08 Alan Modra <amodra@gmail.com>
410
411 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
412 pointer to Post_fde.
413 (struct Post_fde): Move definition to here..
414 * ehframe.cc (struct Post_fde): ..from here.
415 (Cie::write): Don't alloc Post_fde.
416 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
417
418 2013-03-07 Alan Modra <amodra@gmail.com>
419
420 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
421 relocation referencing .LC0.
422 * testsuite/discard_locals_test.sh: Remove FIXMEs.
423
424 2013-03-07 Alan Modra <amodra@gmail.com>
425
426 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
427 always_inline. Add assembly for powerpc to avoid GOT.
428
429 2013-03-07 Alan Modra <amodra@gmail.com>
430
431 * testsuite/script_test_10.sh: Don't test .bss section
432 header number.
433
434 2013-03-06 Alan Modra <amodra@gmail.com>
435
436 * powerpc.cc (class Powerpc_relobj): Move some member functions.
437 (Target_powerpc::symval_for_branch): Add symtab param. Update
438 all callers. Handle folded sections.
439 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
440 to Powerpc_relobj.
441 (Global_symbol_visitor_opd::operator()): Likewise.
442
443 2013-03-04 Alan Modra <amodra@gmail.com>
444
445 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
446 * testsuite/Makefile.in: Regenerate.
447
448 2013-03-01 Cary Coutant <ccoutant@google.com>
449
450 Add dwp support for v2 DWARF package file format.
451 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
452 tu_length parameter. Adjust all callers.
453 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
454 * dwp.cc: Include dwarf.h.
455 (Section_bounds): New struct type.
456 (Unit_set): New struct type.
457 (Dwo_file::Dwo_file): Initialize new data member.
458 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
459 Combine and rename to...
460 (Dwo_file::read_unit_index): ...this.
461 (Dwo_file::sized_read_compunit_index)
462 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
463 (Dwo_file::sized_read_unit_index): ...this.
464 (Dwo_file::copy_section): Remove section_name, is_str_offsets
465 parameters; add section_id parameter.
466 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
467 (Dwo_file::add_unit_set): ...this.
468 (Dwo_file::shndx_map_): Remove.
469 (Dwo_file::sect_offsets_): New data member.
470 (Dwp_output_file::Dwp_output_file): Initialize new data members.
471 (Dwp_output_file::add_section): Rename to...
472 (Dwp_output_file::add_contribution): ...this.
473 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
474 (Dwp_output_file::add_tu_set): Likewise.
475 (Dwp_output_file::Contribution): New type.
476 (Dwp_output_file::Section::contributions): New data member.
477 (Dwp_output_file::Cu_or_tu_set): Remove.
478 (Dwp_output_file::Section::Section): New ctor.
479 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
480 (Dwp_output_file::Dwp_index::Section_table): New type.
481 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
482 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
483 parameter.
484 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
485 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
486 (Dwp_output_file::Dwp_index::section_table): New member function.
487 (Dwp_output_file::Dwp_index::section_table_end): New member function.
488 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
489 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
490 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
491 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
492 (Dwp_output_file::Dwp_index::section_table_): New data member.
493 (Dwp_output_file::Dwp_index::section_mask_): New data member.
494 (Dwp_output_file::add_output_section): New member function.
495 (Dwp_output_file::write_new_section): New member function.
496 (Dwp_output_file::write_contributions): New member function.
497 (Dwp_output_file::section_id_map_): New data member.
498 (class Dwo_id_info_reader): Remove.
499 (class Unit_reader): New class.
500 (get_dwarf_section_name): New function.
501 (Dwo_file::read_executable): Adjust initializations of class data.
502 (Dwo_file::read): Add support for v2 package file format.
503 (Dwo_file::read_unit_index): Likewise.
504 (Dwo_file::sized_read_unit_index): Likewise.
505 (Dwo_file::copy_section): Likewise.
506 (Dwo_file::add_unit_set): Likewise.
507 (Dwp_output_file::add_output_section): Likewise.
508 (Dwp_output_file::add_contribution): Likewise.
509 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
510 for empty slot.
511 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
512 file format.
513 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
514 slot.
515 (Dwp_output_file::initialize): Remove unused function.
516 (Dwp_output_file::finalize): Add support for v2 package file format.
517 (Dwp_output_file::write_index): Likewise.
518 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
519 function prototype.
520
521 2013-03-01 Cary Coutant <ccoutant@google.com>
522
523 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
524 function into class definition in header file.
525 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
526 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
527 New function.
528 (Dwarf_info_reader::check_buffer): Move here from .cc file.
529
530 2013-02-28 Alan Modra <amodra@gmail.com>
531
532 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
533 * target.cc (Target::do_plt_fde_location): New function.
534 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
535 accessor function, and constructor param.
536 (struct Post_fde, Post_fdes): Declare.
537 (Cie::write): Add post_fdes param.
538 * ehframe.cc (Fde::write): Use plt_fde_location.
539 (struct Post_fde): Define.
540 (Cie::write): Stash FDEs added post merge mapping.
541 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
542 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
543 (Eh_frame::do_sized_write): Arrange to write post map FDES after
544 other FDEs.
545 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
546 (Target_powerpc::has_glink): New function.
547 (Target_powerpc::do_relax): Add eh_frame info for stubs.
548 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
549 glink_eh_frame_fde_32, default_fde): New data.
550 (Stub_table::eh_frame_added_): New var.
551 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
552 Make const.
553 (Stub_table::add_eh_frame): New function.
554 (Output_data_glink::add_eh_frame): New function.
555 (Target_powerpc::make_glink_section): Call add_eh_frame.
556
557 2013-02-15 Ian Lance Taylor <iant@google.com>
558
559 * options.h (DEFINE_uint64_alias): Define.
560 (class General_options): Add -Ttext-segment as an alias for
561 -Ttext.
562
563 2013-02-15 Alan Modra <amodra@gmail.com>
564
565 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
566 (Stub_table::do_write): ..here, two places.
567 (Stub_table::plt_call_size): Use it here too.
568
569 2013-02-11 Ian Lance Taylor <iant@google.com>
570
571 * descriptors.cc (Descriptors::close_all): New function.
572 * descriptors.h (class Descriptors): Declare close_all.
573 (close_all_descriptors): New inline function.
574 * plugin.cc: Include "descriptors.h".
575 (Plugin_manager::cleanup): Call close_all_descriptors.
576
577 2013-02-06 Alan Modra <amodra@gmail.com>
578
579 * README: Update coding style link.
580
581 2013-01-28 Cary Coutant <ccoutant@google.com>
582
583 * dwp.cc (File_list): New typedef.
584 (Dwo_name_info_reader): New class.
585 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
586 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
587 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
588 (Dwo_file::read_executable): New function.
589 (Dwo_file::read): Move common setup code to ...
590 (Dwo_file::make_object): ... here.
591 (dwp_options): Add --exec/-e.
592 (usage): Likewise.
593 (main): Likewise.
594
595 2013-01-24 Sriraman Tallam <tmsriram@google.com>
596
597 * layout.cc (Layout::layout): Check for option text_reorder.
598 (Layout::make_output_section): Ditto.
599 * options.h (text_reorder): New option.
600 * output.cc (Input_section_sort_compare): Remove special ordering
601 of section names.
602 (Output_section::
603 Input_section_sort_section_name_special_ordering_compare::
604 operator()): New function.
605 (Output_section::sort_attached_input_sections): Use new sort function
606 for .text.
607 * output.h (Input_section_sort_section_name_special_ordering_compare):
608 New struct.
609 * testsuite/Makefile.am (text_section_grouping): Test option
610 --no-text-reorder
611 * testsuite/Makefile.in: Regenerate.
612 * testsuite/text_section_grouping.sh: Check order of functions without
613 default text reordering.
614
615 2013-01-18 Mike Frysinger <vapier@gentoo.org>
616
617 * options.h (General_options): Change default to true for new_dtags.
618
619 2013-01-18 Mike Frysinger <vapier@gentoo.org>
620
621 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
622 when enable_new_dtags is false. Only add DT_RUNPATH when
623 enable_new_dtags is true.
624
625 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
626
627 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
628 used in declaration and definition consistent.
629 (Target_powerpc::symval_for_branch): Ditto.
630
631 2013-01-16 Sriraman Tallam <tmsriram@google.com>
632
633 * testsuite/plugin_final_layout.cc: Fix comment.
634
635 2013-01-16 Sriraman Tallam <tmsriram@google.com>
636
637 * layout.cc (Layout::layout): Do not do default sorting for
638 text sections when section ordering is specified.
639 (make_output_section): Ditto.
640 * testsuite/plugin_final_layout.cc: Name the function sections
641 to catch reordering issues.
642
643 2013-01-15 Alan Modra <amodra@gmail.com>
644
645 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
646 plt-thread-safe.
647
648 2013-01-15 Alan Modra <amodra@gmail.com>
649
650 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
651 * testsuite/Makefile.in: Regenerate.
652
653 2013-01-14 Alan Modra <amodra@gmail.com>
654
655 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
656 * testsuite/Makefile.in: Regenerate.
657
658 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
659
660 PR bfd/14430
661 Fix mingw gold build with plugins enabled
662 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
663 * configure.ac: Export DLOPEN_LIBS and add headers check.
664 * plugin.cc: Handle non-dlfcn case.
665 * Makefile.in: Regenerate.
666 * config.in: Regenerate.
667 * configure: Regenerate.
668 * testsuite/Makefile.in: Regenerate.
669
670 2013-01-09 Sriraman Tallam <tmsriram@google.com>
671
672 * output.h (sort_attached_input_sections): Change to be public.
673 * script-sections.cc
674 (Output_section_definition::set_section_addresses): Sort
675 attached input sections according to section order before linker
676 script assigns section addresses.
677 (Orphan_output_section::set_section_addresses): Sort
678 attached input sections according to section order before linker
679 script assigns section addresses.
680 * Makefile.am (final_layout.sh): Use a simple linker script to
681 check if section ordering still works.
682 * Makefile.in: Regenerate.
683
684 2013-01-09 Ben Cheng <bccheng@google.com>
685
686 * arm.cc (Target_arm::attributes_accept_div): New function.
687 (Target_arm::attributes_forbid_div): New function.
688 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
689 attribute using the same new functions as what bfd/elf32_arm.c
690 does.
691
692 2013-01-07 Cary Coutant <ccoutant@google.com>
693
694 PR gold/14993
695 * output.cc (Output_section::add_input_section): For incremental
696 updates, don't track input sections that are allocated from patch
697 space.
698
699 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
700 Ian Lance Taylor <iant@google.com>
701
702 PR gold/14897
703 * configure.ac (--enable-ld): Removed.
704 (install_as_default): Set to yes only for --enable-gold=default
705 or --disable-ld.
706 * configure: Regenerated.
707
708 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
709
710 * options.h (General_options): Add -fuse-ld= for GCC linker
711 option compatibility.
712
713 2013-01-04 Cary Coutant <ccoutant@google.com>
714
715 * configure.ac: Fix typo restoring CXXFLAGS.
716 * configure: Regenerate.
717
718 2013-01-04 Cary Coutant <ccoutant@google.com>
719
720 * testsuite/Makefile.am (CXXLINK_S): New macro.
721 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
722 * testsuite/Makefile.in: Regenerate.
723
724 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
725
726 * version.cc (print_version): Update copyright year to 2013.
727
728 2012-12-20 Ian Lance Taylor <iant@google.com>
729
730 * layout.cc (Layout::special_ordering_of_input_section): New
731 function.
732 (Layout::layout): If input section requires special ordering, must
733 sort input sections.
734 (Layout::make_output_section): May sort .text input sections.
735 (Layout::is_section_name_prefix_grouped): Remove.
736 * layout.h (class Layout): Declare
737 special_ordering_of_input_section. Don't declare
738 is_section_name_prefix_grouped.
739 * output.cc (Output_section::add_input_section): Revert last
740 change.
741 (Output_section::Input_section_sort::match_file_name): Don't crash
742 if called on output section data.
743 (Output_section::Input_section_sort_compare): Sort based on
744 special ordering.
745 (Output_section::Input_section_sort_section_order_index_compare):
746 Revert last patch.
747 (Output_section::sort_attached_input_sections): Likewise.
748
749 2012-12-18 Sriraman Tallam <tmsriram@google.com>
750
751 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
752 * layout.h (Layout::is_section_name_prefix_grouped): New function.
753 * output.cc (Output_section::add_input_section): Check if section
754 name contains special prefix. Keep input sections to sort such
755 sections.
756 (Output_section::Input_section_sort_section_order_index_compare
757 ::operator()): Group sections according to prefixes.
758 (Output_section::sort_attached_input_sections): Add condition to
759 Input_section_entry constructor call.
760 * testsuite/Makefile.am (text_section_grouping): New test.
761 * testsuite/Makefile.in: Regenerate.
762 * testsuite/text_section_grouping.cc: New file.
763 * testsuite/text_section_grouping.sh: New file.
764
765 2012-12-17 Nick Clifton <nickc@redhat.com>
766
767 * Makefile.am: Add copyright notice.
768 * NEWS: Likewise.
769 * README: Likewise.
770 * configure.ac: Likewise.
771 * ftruncate.c: Likewise.
772 * Makefile.in: Regenerate.
773
774 2012-12-14 Cary Coutant <ccoutant@google.com>
775
776 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
777 --no-as-needed flag.
778 (exception_separate_shared_12_test): Likewise.
779 (incremental_copy_test): Likewise.
780 * testsuite/Makefile.in: Regenerate.
781
782 2012-12-14 Cary Coutant <ccoutant@google.com>
783
784 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
785 (Dwp_output_file::Dwp_index::enter_set): Add assert.
786
787 2012-12-12 Alan Modra <amodra@gmail.com>
788
789 * powerpc.cc (class Track_tls): New.
790 (class Relocate, class Scan): Inherit Track_tls.
791 (Target_powerpc::Scan::local, global): Track tls optimization
792 and avoid creating plt entry for __tls_get_addr if all uses
793 are optimized away.
794 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
795
796 2012-12-12 Alan Modra <amodra@gmail.com>
797
798 * options.h (General_options): Add --toc-sort/--no-toc-sort.
799 Replace no_toc_optimize with toc_optimize.
800 * output.h (Output_section::input_sections): Provide non-const variant.
801 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
802 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
803 accessors.
804 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
805 (class Sort_toc_sections): New.
806 (Target_powerpc::do_finalize_sections): Sort toc sections.
807 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
808
809 2012-12-10 Roland McGrath <mcgrathr@google.com>
810
811 * testsuite/binary_unittest.cc (read_all): New function.
812 (Sized_binary_test): Use it instead of ::read.
813 * fileread.cc (do_read): Don't assume pread always reads the whole
814 amount in a single call.
815
816 2012-12-10 Alan Modra <amodra@gmail.com>
817
818 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
819 Set EM_PPC64 or EM_PPC here.
820 (Target_selector_powerpc::do_recognize): Delete.
821
822 2012-12-10 Alan Modra <amodra@gmail.com>
823
824 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
825 stub_table_.
826 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
827
828 2012-12-07 Roland McGrath <mcgrathr@google.com>
829
830 * testsuite/binary_unittest.cc (Sized_binary_test):
831 Use open_descriptor rather than ::open.
832
833 2012-12-07 Alan Modra <amodra@gmail.com>
834
835 * powerpc.cc (Stub_table::do_write): Delete redundant Address
836 typedef and invalid_address constant.
837 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
838 instantiate constants.
839
840 2012-12-06 Roland McGrath <mcgrathr@google.com>
841
842 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
843 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
844 * aclocal.m4: Regenerate.
845 * configure: Regenerate.
846 * Makefile.in: Regenerate.
847 * testsuite/Makefile.in: Regenerate.
848
849 2012-12-07 Alan Modra <amodra@gmail.com>
850
851 * options.h (General_options): Add no_toc_optimize.
852 * powerpc.cc (ok_lo_toc_insn): New function.
853 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
854
855 2012-12-06 Alan Modra <amodra@gmail.com>
856
857 * options.h (General_options): Add plt_align, plt_static_chain,
858 plt_thread_safe. Update stub_group_size help text.
859 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
860 for new plt_thread_safe_ var.
861 (use_plt_offset): Correct comments.
862 (Target_powerpc::do_relax): Look for thread creation symbols to
863 determine default plt_thread_safe value. Clear plt call stubs
864 as well as branch stubs each iteration.
865 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
866 insn constants.
867 (l, hi, ha, write_insn): Move earlier.
868 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
869 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
870 plt stubs too.
871 (Stub_table::update_size): Adjust.
872 (Stub_table::prev_size, set_prev_size): Delete.
873 (Stub_table::stub_align): Let --plt-align affect result.
874 (Stub_table::plt_call_size): Calculate sizes for various stubs.
875 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
876 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
877 (Stub_table::do_write): Support more stub variants.
878
879 2012-12-04 Alan Modra <amodra@gmail.com>
880
881 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
882 (Target_powerpc::do_define_standard_symbols): New function.
883
884 2012-12-03 Alan Modra <amodra@gmail.com>
885
886 * output.h: Formatting, whitespace.
887
888 2012-12-03 Alan Modra <amodra@gmail.com>
889
890 * layout.h (Layout::get_executable_sections): Declare.
891 * layout.cc (Layout::get_executable_sections): New function.
892 * arm.cc (Target_arm::group_sections): Use it.
893 (Arm_output_section::group_sections): Delete now redundant test.
894 * output.cc (Output_reloc::Output_reloc): Add is_relative.
895 param to handle relative relocs.
896 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
897 (Output_data_reloc::add_absolute): Adjust.
898 (Output_data_reloc::add_relative): New function.
899 (Output_data::reset_data_size): New function.
900 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
901 (Output_section::set_addralign): New function.
902 (Output_section::checkpoint_set_addralign): New function.
903 (Output_section::clear_section_offsets_need_adjustment): New function.
904 (Output_section::input_sections): Make public.
905 * powerpc.cc (class Output_data_brlt_powerpc): New.
906 (class Stub_table, class Stub_control): New.
907 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
908 stub_table_, set_stub_table, stub_table): New vectors and accessor
909 functions.
910 (Target_powerpc::do_may_relax, do_relax, push_branch,
911 new_stub_table, stub_tables, brlt_section, group_sections,
912 add_branch_lookup_table, find_branch_lookup_table,
913 write_branch_lookup_table, make_brlt_section): New functions.
914 (Target_powerpc::struct Sort_sections, class Branch_info): New.
915 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
916 branch_info_): New vars.
917 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
918 make call stubs here.
919 (Output_data_glink): Remove all call stub handling from this class.
920 (Target_powerpc::Scan::local, global): Save interesting branch
921 relocs and relocs for ifunc. Adjust calls to plt entry functions.
922 (Target_powerpc::do_finalize_sections): Only make reg save/restore
923 functions on final link.
924 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
925 Handle long branch destinations too.
926 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
927 do_plt_address_for_local): Adjust lookup of plt call stubs.
928
929 2012-11-30 Alan Modra <amodra@gmail.com>
930
931 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
932 relocs against protected symbols when building 32-bit shared libs.
933
934 2012-11-30 Alan Modra <amodra@gmail.com>
935
936 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
937 param. Call got_section() to make .got. Update all callers
938 and their callers and so on.
939
940 2012-11-30 Alan Modra <amodra@gmail.com>
941
942 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
943 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
944 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
945 value if it already exists.
946
947 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
948
949 PR gold/14858
950 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
951
952 2012-11-14 Roland McGrath <mcgrathr@google.com>
953
954 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
955 than bfc instruction for data sandboxing.
956
957 2012-11-08 Alan Modra <amodra@gmail.com>
958
959 * po/POTFILES.in: Regenerate.
960
961 2012-11-05 Alan Modra <amodra@gmail.com>
962
963 * configure.ac: Apply 2012-09-10 change to config.in here.
964 * configure: Regenerate.
965
966 2012-11-05 Alan Modra <amodra@gmail.com>
967
968 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
969 (struct Opd_ent): Use "Address" rather than "Offset".
970 (Output_data_got_powerpc::got_base_offset): Return Valtype.
971 (Target_powerpc::got_section): Make public.
972 (Target_powerpc::scan_relocs): Move code setting symbols..
973 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
974 Create _SDA_BASE_ only when referenced.
975
976 2012-11-02 Roland McGrath <mcgrathr@google.com>
977
978 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
979 from last change.
980
981 2012-11-01 Roland McGrath <mcgrathr@google.com>
982
983 * target.h (Sized_target::relocate_relocs): Use Elf_Off
984 for offset_in_output_section parameter.
985 (Sized_target::relocate_special_relocatable): Likewise.
986 * arm.cc (Target_arm::relocate_relocs): Likewise.
987 (Target_arm::relocate_special_relocatable): Likewise.
988 * i386.cc (Target_i386::relocate_relocs): Likewise.
989 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
990 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
991 * target-reloc.h (relocate_relocs): Likewise.
992 * testsuite/testfile.cc (Target_test): Likewise.
993 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
994 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
995
996 * system.h: Move inclusion of <clocale> to after <libintl.h> in
997 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
998
999 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1000 parameter, which is unused in the [!F_SETFD] case.
1001
1002 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1003 SYMNDX to off_t before comparing it to this->data_size().
1004 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1005 * incremental.cc (Output_section_incremental_inputs::do_write):
1006 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1007
1008 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1009
1010 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1011
1012 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1013 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1014 in EABI_VER5.
1015
1016 2012-10-29 Cary Coutant <ccoutant@google.com>
1017
1018 * dwp.cc (usage): Add file and exit status parameters;
1019 add --help and --version options.
1020 (print_version): New function.
1021 (main): Add --help and --version options.
1022
1023 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1024
1025 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1026 final_layout_sequence.txt.
1027 * testsuite/Makefile.in: Regenerated.
1028
1029 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1030
1031 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1032 COMPILE generated by automake.
1033 (LINK1): Likewise.
1034 (CXXCOMPILE1): Likewise.
1035 (CXXLINK1): Likewise.
1036 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1037 (LINK): Likewise.
1038 (CXXCOMPILE): Likewise.
1039 (CXXLINK): Likewise.
1040 * testsuite/Makefile.in: Regenerated.
1041
1042 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1043
1044 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1045 on bad fwrite return.
1046
1047 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1048
1049 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1050 on val.
1051
1052 2012-10-23 Cary Coutant <ccoutant@google.com>
1053
1054 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1055 * testsuite/Makefile.in: Regenerate.
1056 * testsuite/dwp_test.h: New source file.
1057 * testsuite/dwp_test_1.cc: New source file.
1058 * testsuite/dwp_test_1.s: New source file.
1059 * testsuite/dwp_test_1.sh: New source file.
1060 * testsuite/dwp_test_1b.cc: New source file.
1061 * testsuite/dwp_test_1b.s: New source file.
1062 * testsuite/dwp_test_2.cc: New source file.
1063 * testsuite/dwp_test_2.s: New source file.
1064 * testsuite/dwp_test_2.sh: New source file.
1065 * testsuite/dwp_test_main.cc: New source file.
1066 * testsuite/dwp_test_main.s: New source file.
1067
1068 2012-10-23 Cary Coutant <ccoutant@google.com>
1069
1070 * dwp.h: New header file.
1071 * dwp.cc: New source file.
1072 * gold.h: Move shared declarations to system.h.
1073 * system.h: New header file.
1074 * Makefile.am: Add dwp.
1075 * Makefile.in: Regenerate.
1076
1077 2012-10-23 Cary Coutant <ccoutant@google.com>
1078
1079 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1080 Dwarf_info_reader::read_from_pointer.
1081 (Dwarf_pubnames_table::read_header): Likewise.
1082 (Dwarf_pubnames_table::next_name): Likewise.
1083 (Dwarf_die::read_attributes): Likewise.
1084 (Dwarf_die::skip_attributes): Likewise.
1085 (Dwarf_info_reader::read_from_pointer): New function template.
1086 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1087 (Dwarf_pubnames_table): Likewise.
1088 (Dwarf_info_reader::read_from_pointer): New function template.
1089 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1090 Dwarf_pubnames_table ctor.
1091
1092 2012-10-23 Cary Coutant <ccoutant@google.com>
1093
1094 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1095 abbrev_shndx.
1096 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1097 abbrev_shndx_.
1098 (Dwarf_info_reader::set_abbrev_shndx): New method.
1099 (Dwarf_info_reader::abbrev_shndx_): New data member.
1100
1101 2012-10-23 Cary Coutant <ccoutant@google.com>
1102
1103 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1104 from object, not parameters.
1105 (Dwarf_info_reader::parse): Likewise.
1106 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1107 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1108 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1109 methods.
1110
1111 2012-10-23 Cary Coutant <ccoutant@google.com>
1112
1113 * fileread.cc (Input_file::Input_file): New constructor.
1114 * fileread.h (class Input_file): Add new constructor.
1115
1116 2012-10-18 Alan Modra <amodra@gmail.com>
1117
1118 PR gold/14727
1119 * object.cc (Relobj::is_section_name_included): Also match
1120 .sdata personality section.
1121
1122 2012-10-18 Alan Modra <amodra@gmail.com>
1123
1124 * target-reloc.h (class Default_comdat_behavior): New, package up..
1125 (get_comdat_behaviour): ..this.
1126 (relocate_section): Add Relocate_comdat_behavior template arg,
1127 adjust code to suit.
1128 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1129 (Target_arm::scan_reloc_section): Likewise.
1130 * i386.cc (Target_i386::relocate_section): Likewise.
1131 * sparc.cc (Target_sparc::relocate_section): Likewise.
1132 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1133 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1134 * powerpc.cc (class Relocate_comdat_behavior): New.
1135 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1136 gold::relocate_section with new template arg.
1137
1138 2012-10-18 Alan Modra <amodra@gmail.com>
1139
1140 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1141 dynamic relocs for GOT_TPREL got entries, without symbol if
1142 resolving locally.
1143 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1144 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1145 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1146
1147 2012-10-17 Alan Modra <amodra@gmail.com>
1148
1149 PR gold/14726
1150 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1151
1152 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1153
1154 * layout.cc (Layout::include_section): Keep sections marked
1155 SHF_EXCLUDE when doing relocatable links.
1156
1157 2012-10-16 Alan Modra <amodra@gmail.com>
1158
1159 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1160 (Target_powerpc::do_finalize_sections): Call it.
1161 (Output_data_save_res): New class and supporting functions.
1162 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1163 normal symbols defined in object files.
1164
1165 2012-10-12 Alan Modra <amodra@gmail.com>
1166
1167 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1168 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1169 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1170 section if scan_opd_relocs not yet called.
1171 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1172
1173 2012-10-12 Alan Modra <amodra@gmail.com>
1174
1175 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1176 add_local_ifunc_entry): Revert last change.
1177 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1178
1179 2012-10-05 Alan Modra <amodra@gmail.com>
1180
1181 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1182 do_plt_address_for_global): New functions.
1183 (Output_data_got_powerpc::do_write): Don't segfault when linking
1184 statically.
1185 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1186 add_local_ifunc_entry): Return true on adding entry..
1187 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1188 glink->add_entry call. Remove unused symtab param. Adjust calls.
1189 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1190 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1191 set up symbols here.
1192 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1193 syms here. Do so even when no .iplt. Don't segfault when linking
1194 statically.
1195 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1196 new variants without reloc param.
1197 (Glink_sym_ent::Glink_sym_ent): Likewise.
1198 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1199 reloc when refs will resolve to plt call stub.
1200 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1201 R_PPC_PLTREL24 to resolve locally.
1202 (Target_powerpc::Scan::global): Correct ifunc handling.
1203 (Target_powerpc::Relocate::relocate): Correct local sym glink
1204 lookup. Don't destroy "value" when we have a plt call stub,
1205 and when checking plt call validity.
1206 (Target_powerpc::do_dynsym_value): Simplify.
1207
1208 2012-10-05 Alan Modra <amodra@gmail.com>
1209
1210 * i386.cc (Output_data_plt_i386::address_for_global,
1211 address_for_local): Add plt offset to returned value. Adjust uses.
1212 * sparc.cc (Output_data_plt_sparc::address_for_global,
1213 address_for_local): Likewise.
1214 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1215 address_for_local): Likewise.
1216 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1217 address_for_local): Likewise.
1218 * target.h (Target::plt_address_for_global, plt_address_for_local):
1219 Update comment.
1220 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1221 (Output_data_got::Got_entry::write): Nor here.
1222 * output.h: Comment fix.
1223
1224 2012-10-02 Jiong Wang <jiwang@tilera.com>
1225
1226 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1227 global_offset_table_ value for larget got.
1228 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1229
1230 2012-09-29 Alan Modra <amodra@gmail.com>
1231
1232 * powerpc.cc (Target_powerpc::iplt_): New output section.
1233 (Target_powerpc::iplt_section, make_iplt_section,
1234 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1235 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1236 Target_powerpc::plt_entry_count): Count iplt entries too.
1237 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1238 reloc section in constructor. New params.
1239 (Target_powerpc::make_plt_section): Create reloc section here instead.
1240 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1241 functions.
1242 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1243 (Output_data_glink::add_entry, find_entry): New functions to
1244 deal with local syms.
1245 (Glink_sym_ent): Add support for local syms.
1246 (Output_data_glink::do_write): Handle ifunc plt entries.
1247 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1248 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1249 (Target_powerpc::Relocate::relocate): Likewise.
1250 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1251
1252 2012-09-25 Alan Modra <amodra@gmail.com>
1253
1254 * object.h (Sized_relobj_file::adjust_local_symbol,
1255 do_adjust_local_symbol): New functions.
1256 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1257 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1258 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1259 and irregular opd entry spacing.
1260 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1261 (Global_symbol_visitor_opd): New functor.
1262 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1263 on deleted opd entries.
1264
1265 2012-09-15 Jiong Wang <jiwang@tilera.com>
1266
1267 * tilegx.cc: New file.
1268 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1269 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1270 * configure.tgt: Add entries for tilegx*.
1271 * configure.ac: Likewise.
1272 * Makefile.in: Rebuild.
1273 * configure: Likewise.
1274 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1275 tilegx.
1276
1277 2012-09-13 Alan Modra <amodra@gmail.com>
1278
1279 * target-reloc.h (scan_relocs): Call scan.local for relocs
1280 against symbols in discarded sections. Pass is_discarded
1281 param.
1282 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1283 Add is_discarded param.
1284 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1285 is_discarded to flag opd entry as discarded. Don't emit dyn
1286 relocs on such entries.
1287 (Target_powerpc::Scan::global): Similarly detect and handle
1288 such opd entries.
1289 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1290 opd_ent_. Update all uses.
1291 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1292 (Target_powerpc::relocate_section): Zero out discarded opd
1293 entry relocs.
1294
1295 2012-09-12 Ian Lance Taylor <iant@google.com>
1296
1297 PR gold/14570
1298 * output.cc: Rename Output_data_got template parameter from size
1299 to got_size for all functions. Compile all variants of
1300 Output_data_got.
1301 (Output_data_got::Got_entry::write): Correct use of size for
1302 symbol value. Use local_is_tls rather than casting to
1303 Sized_relobj_file.
1304 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1305 (class Sized_relobj_file): Add do_local_is_tls.
1306 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1307
1308 2012-09-11 Alan Modra <amodra@gmail.com>
1309
1310 PR gold/14566
1311 * layout.cc (Layout::set_segment_offsets): When using
1312 common-page-size alignment, ensure we are on a new max-page-size
1313 page.
1314 * output.cc (Output_segment::set_section_addresses): Use
1315 abi_pagesize, not common_pagesize for relro boundary.
1316 (Output_segment::set_offset): Likewise.
1317
1318 2012-09-11 Alan Modra <amodra@gmail.com>
1319
1320 * output.h (Output_data_got::add_global_tls, add_local_tls,
1321 add_local_tls_pair): New functions.
1322 (Output_data_got::add_local_pair_with_rel): Remove second
1323 reloc param. Expand comment.
1324 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1325 use_plt_or_tls_offset_, similarly for constructor param.
1326 (Output_data_got::Got_entry::write): Add got_index param.
1327 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1328 add_local_tls_pair): New functions.
1329 (Output_data_got::Got_entry::write): Handle tls symbols
1330 with use_plt_or_tls_offset_ set specially.
1331 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1332 (Output_data_got::do_write): Replace iterator with index, pass
1333 index to entry write function.
1334 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1335 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1336 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1337 call.
1338 * i386.cc (Target_i386::Scan::local): Likewise.
1339 * sparc.cc (Target_sparc::Scan::local): Likewise.
1340 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1341 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1342 do_tls_offset_for_global): New functions.
1343 (Target_powerpc::Scan::local): Correct TLS relocations and got
1344 entry values.
1345 (Target_powerpc::Scan::global): Don't emit unnecessary
1346 dynamic relocations on TLS GOT entries.
1347
1348 2012-09-10 Matthias Klose <doko@ubuntu.com>
1349
1350 * config.in: Disable sanity check for kfreebsd.
1351
1352 2012-09-10 Sterling Augustine <saugustine@google.com>
1353
1354 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1355 (Gdb_index::pubtypes_read): New parameter.
1356 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1357 to calls.
1358 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1359 pubtypes_object_.
1360
1361 2012-09-09 Alan Modra <amodra@gmail.com>
1362
1363 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1364 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1365 * gc.h (gc_process_relocs): Call target gc_add_reference.
1366 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1367 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1368 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1369 unnecessary cast.
1370 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1371 to cater for when we don't need code offset. Update use.
1372 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1373 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1374 set_opd_valid): New functions.
1375 (Target_powerpc::do_gc_add_reference): New function.
1376 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1377 stashed refs.
1378 (Target_powerpc::do_gc_mark_symbol): New function.
1379
1380 2012-09-06 Cary Coutant <ccoutant@google.com>
1381
1382 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1383 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1384 (Dwarf_die::skip_attributes): Likewise.
1385 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1386 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1387 (main): Call it.
1388 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1389
1390 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1391
1392 * testsuite/script_test_3.t: Add .got.plt output section
1393 statement.
1394 * testsuite/script_test_4.t: Likewise.
1395
1396 2012-09-05 Alan Modra <amodra@gmail.com>
1397
1398 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1399 update all uses and lose "enum" when using type.
1400
1401 2012-09-05 Alan Modra <amodra@gmail.com>
1402
1403 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1404 * configure: Regenerate.
1405 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1406 (plugin_final_layout.stdout): Likewise.
1407 (memory_test): Set page sizes to 0x1000.
1408 * testsuite/Makefile.in: Regenerate.
1409 * testsuite/discard_locals_test.sh: Add FIXME comment.
1410 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1411 * testsuite/pr14265.t: Add .got output section statement.
1412 * testsuite/script_test_2.t: Likewise.
1413 * testsuite/script_test_3.t: Likewise.
1414 * testsuite/script_test_4.t: Likewise.
1415 * testsuite/script_test_5.t: Likewise.
1416 * testsuite/script_test_6.t: Likewise.
1417 * testsuite/script_test_7.t: Likewise.
1418 * testsuite/script_test_9.t: Likewise.
1419
1420 2012-09-05 Alan Modra <amodra@gmail.com>
1421
1422 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1423 (Powerpc_relocate_functions::Status): New typedef.
1424 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1425 (Target_powerpc::Scan::local): Handle REL64.
1426 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1427 for REL32 and REL64.
1428 (Target_powerpc::symval_for_branch): New function, extracted from..
1429 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1430 checks. Report overflow errors.
1431
1432 2012-09-05 Alan Modra <amodra@gmail.com>
1433
1434 * object.h (Sized_relobj_file::emit_relocs): Delete.
1435 (Sized_relobj_file::emit_relocs_reltype): Delete.
1436 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1437 relocate_relocs for --emit-relocs.
1438 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1439 * output.h: Update comment.
1440 (Output_segment::first_section): New function.
1441 (Output_segment::first_section_load_address): Use first_section.
1442 * output.cc (Output_segment::first_section): New function extracted..
1443 (Output_segment::first_section_load_address): ..from here. Delete.
1444 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1445 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1446 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1447 adjust call to target.h function.
1448 * i386.cc (Target_i386): Likewise.
1449 * sparc.cc (Target_sparc): Likewise.
1450 * x86_64.cc (Target_x86_64): Likewise.
1451 * powerpc.cc (Target_powerpc): Likewise.
1452 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1453 first tls section has section symbol for optimised local dynamic
1454 output relocs.
1455 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1456 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1457 optimised tls code.
1458 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1459 Rename to relocate_relocs. Update error message.
1460
1461 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1462
1463 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1464 --just-symbols.
1465
1466 2012-08-31 Alan Modra <amodra@gmail.com>
1467
1468 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1469 (Powerpc_relobj::toc_base_offset): New stub function.
1470 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1471 got_mod_index_offset to tlsld_got_offset. Update all refs.
1472 (Target_powerpc::Relocate::enum skip_tls): New.
1473 (Target_powerpc::call_tls_get_addr_): New var.
1474 (Target_powerpc::is_branch_reloc): Move to file scope.
1475 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1476 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1477 New functions.
1478 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1479 (powerpc_info): Correct common_pagesize for ppc64.
1480 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1481 (Powerpc_relocate_functions): Add overflow check enums and functions.
1482 Add non-shift version of rela, rela_ua. Delete all rel public
1483 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1484 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1485 addr16_ha3, addr14 functions.
1486 (Output_data_got_powerpc::add_constant_pair): New function.
1487 (Output_data_got_powerpc::got_base_offset): Likewise.
1488 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1489 (instruction constants): Sort, add some more.
1490 (Output_data_glink::do_write): Add and use Address typedef. Use
1491 object->toc_base_offset() stub for 64-bit.
1492 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1493 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1494 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1495 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1496 Always treat .opd relocs as against locally defined symbol.
1497 Correct condition for RELATIVE relocs.
1498 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1499 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1500 for 32-bit syms with a plt entry. Correct ppc64 toc base
1501 calculations. Handle TLS relocs, and more. Add overflow
1502 checking and adjust for Powerpc_relocate_functions changes.
1503 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1504 Reinstate --emit-relocs code with FIXME.
1505
1506 2012-08-30 Alan Modra <amodra@gmail.com>
1507
1508 * layout.cc (Layout::set_segment_offsets): Set p_align to
1509 abi_pagesize, not common_pagesize.
1510 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1511 to determine whether file header can go in segment.
1512
1513 2012-08-30 Alan Modra <amodra@gmail.com>
1514
1515 * output.h (Output_reloc::Output_reloc <output section>): Add
1516 is_relative param. Adjust calls.
1517 (Output_reloc::add_output_section_relative): New functions.
1518 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1519 is_relative.
1520 (Output_reloc::symbol_value): Handle SECTION_CODE.
1521
1522 2012-08-24 Sriraman Tallam <tmsriram@google.com>
1523
1524 * gold.cc (queue_middle_tasks): Call layout again when unique
1525 segments for sections is desired.
1526 * layout.cc (Layout::Layout): Initialize new members.
1527 (Layout::get_output_section_flags): New function.
1528 (Layout::choose_output_section): Call get_output_section_flags.
1529 (Layout::layout): Make output section for mapping to a unique segment.
1530 (Layout::insert_section_segment_map): New function.
1531 (Layout::attach_allocated_section_to_segment): Make unique segment for
1532 output sections marked so.
1533 (Layout::segment_precedes): Check for unique segments when sorting.
1534 * layout.h (Layout::Unique_segment_info): New struct.
1535 (Layout::Section_segment_map): New typedef.
1536 (Layout::insert_section_segment_map): New function.
1537 (Layout::get_output_section_flags): New function.
1538 (Layout::is_unique_segment_for_sections_specified): New function.
1539 (Layout::set_unique_segment_for_sections_specified): New function.
1540 (Layout::unique_segment_for_sections_specified_): New member.
1541 (Layout::section_segment_map_): New member.
1542 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1543 Rename is_gc_pass_one to is_pass_one.
1544 Rename is_gc_pass_two to is_pass_two.
1545 Rename is_gc_or_icf to is_two_pass.
1546 Check for which pass based on whether symbols data is present.
1547 Make it two pass when unique segments for sections is desired.
1548 * output.cc (Output_section::Output_section): Initialize new
1549 members.
1550 * output.h (Output_section::is_unique_segment): New function.
1551 (Output_section::set_is_unique_segment): New function.
1552 (Output_section::is_unique_segment_): New member.
1553 (Output_section::extra_segment_flags): New function.
1554 (Output_section::set_extra_segment_flags): New function.
1555 (Output_section::extra_segment_flags_): New member.
1556 (Output_section::segment_alignment): New function.
1557 (Output_section::set_segment_alignment): New function.
1558 (Output_section::segment_alignment_): New member.
1559 (Output_segment::Output_segment): Initialize is_unique_segment_.
1560 (Output_segment::is_unique_segment): New function.
1561 (Output_segment::set_is_unique_segment): New function.
1562 (Output_segment::is_unique_segment_): New member.
1563 * plugin.cc (allow_unique_segment_for_sections): New function.
1564 (unique_segment_for_sections): New function.
1565 (Plugin::load): Add new functions to transfer vector.
1566 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1567 * Makefile.in: Regenerate.
1568 * testsuite/plugin_final_layout.sh: Check if unique segment
1569 functionality works.
1570 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1571 are available.
1572 (allow_unique_segment_for_sections): New global.
1573 (unique_segment_for_sections): New global.
1574 (claim_file_hook): Call allow_unique_segment_for_sections.
1575 (all_symbols_read_hook): Call unique_segment_for_sections.
1576
1577 2012-08-22 Cary Coutant <ccoutant@google.com>
1578
1579 * layout.cc (Layout::include_section): Don't assert on GROUP
1580 sections with --emit-relocs.
1581
1582 2012-08-21 Cary Coutant <ccoutant@google.com>
1583
1584 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1585 if --export-dynamic-symbol names an undef symbol.
1586
1587 2012-08-18 Alan Modra <amodra@gmail.com>
1588
1589 * powerpc.cc: Formatting and white space.
1590 (Powerpc_relobj): Rename got2_section_ to special_.
1591 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1592 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1593 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1594 (Target_powerpc): Add Address typedef and invalid_address. Use
1595 throughout.
1596 (Target_powerpc::is_branch_reloc): New function.
1597 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1598 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1599 for dst_mask, value and addend.
1600 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1601 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1602 (Output_data_glink::do_write): Correct toc base. Don't try to use
1603 uint16_t for 24-bit offset. Use get_output_section_offset and
1604 check return.
1605 (Target_powerpc::Scan::local): Handle more relocs.
1606 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1607 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1608 Plug in toc restoring insn after plt calls. Translate branches
1609 to function descriptor symbols to corresponding entry point.
1610 (Target_powerpc::relocate_for_relocatable): Check return from
1611 get_output_section_offset.
1612 * symtab.h: Comment typo.
1613
1614 2012-08-14 Ian Lance Taylor <iant@google.com>
1615
1616 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1617 unsupported_relocal_local to call unsupported_reloc_global.
1618
1619 2012-08-14 Nick Clifton <nickc@redhat.com>
1620
1621 PR ld/14265
1622 * script-sections.cc (Sections_element::output_section_name): Add
1623 keep return parameter.
1624 (Output_section_element::match_name): Add keep return parameter.
1625 Return the value of the keep_ member.
1626 * script-sections.h (class Output_section): Update
1627 output_section_name prototype.
1628 * layout.cc (Layout::keep_input_section): New public member
1629 function.
1630 (Layout::choose_output_section): Pass keep parameter to
1631 output_section_name.
1632 * layout.h (class Layout): Add keep_input_section.
1633 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1634 sections.
1635 * testsuite/Makefile.am: Add a test.
1636 * testsuite/Makefile.in: Regenerate.
1637 * testsuite/pr14265.c: Source file for the test.
1638 * testsuite/pr14265.t: Linker script for the test.
1639 * testsuite/pr14265.sh: Shell script for the test.
1640
1641 2012-08-14 Alan Modra <amodra@gmail.com>
1642
1643 * target.h (Target::output_section_name): New function.
1644 (Target::do_output_section_name): New function.
1645 * layout.cc (Layout::choose_output_section): Call the above.
1646 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1647
1648 2012-08-14 Alan Modra <amodra@gmail.com>
1649
1650 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1651 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1652 for replace_constant call.
1653 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1654 (Output_data_glink::do_print_to_mapfile): New function.
1655 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1656 (Target_powerpc::Relocate::relocate): Likewise.
1657
1658 2012-08-14 Alan Modra <amodra@gmail.com>
1659
1660 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1661 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1662 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1663 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1664 all references to shndx_. Handle special case for R_PPC_PLTREL24
1665 here.
1666 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1667 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1668 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1669 here.
1670 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1671 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1672
1673 2012-08-12 Alan Modra <amodra@gmail.com>
1674
1675 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1676 (glink insn constants): Use uint32_t.
1677 (Output_data_glink::add_entry): Use insert, not [] operator.
1678
1679 2012-08-11 Alan Modra <amodra@gmail.com>
1680
1681 * object.h (Sized_relobj_file::find_shdr): New function.
1682 (Sized_relobj_file::find_special_sections): New function.
1683 * object.cc (Sized_relobj_file::find_shdr): New function.
1684 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1685 (Sized_relobj_file::find_special_sections): New function, split out..
1686 (Sized_relobj_file::do_read_symbols): ..from here.
1687 * output.h (Output_data_got::replace_constant): New function.
1688 (Output_data_got::num_entries): New function.
1689 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1690 (Output_data_got::got_offset): Protected rather than private.
1691 (Output_data_got::replace_got_entry): New function.
1692 * output.cc (Output_data_got::replace_got_entry): New function.
1693 * powerpc.cc (class Powerpc_relobj): New.
1694 (class Powerpc_relocate_functions): Delete all psymval variants or
1695 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1696 Implement _ha functions using corresponding _hi function.
1697 (Powerpc_relobj::find_special_sections): New function.
1698 (Target_powerpc::do_make_elf_object): New function.
1699 (class Output_data_got_powerpc): New.
1700 (class Output_data_glink): New.
1701 (class Powerpc_scan_relocatable_reloc): New.
1702 Many more changes througout file.
1703
1704 2012-08-09 Nick Clifton <nickc@redhat.com>
1705
1706 * po/vi.po: Updated Vietnamese translation.
1707
1708 2012-08-07 Ian Lance Taylor <iant@google.com>
1709
1710 * layout.cc (Layout::add_target_dynamic_tags): If
1711 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1712 plt_rel.
1713
1714 2012-07-30 Nick Clifton <nickc@redhat.com>
1715
1716 * po/gold.pot: Updated template.
1717 * po/es.po: Updated Spanish translation.
1718
1719 2012-07-18 Cary Coutant <ccoutant@google.com>
1720
1721 PR gold/14344
1722 * configure.ac: Add check for -gpubnames support.
1723 * configure: Regenerate.
1724 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1725 support; force -gno-pubnames.
1726 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1727 support.
1728 (gdb_index_test_4): New test.
1729 * testsuite/Makefile.in: Regenerate.
1730 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1731 * testsuite/gdb_index_test_2.sh: Likewise.
1732 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1733 * testsuite/gdb_index_test_4.sh: New script.
1734 * testsuite/gdb_index_test_comm.sh: New script with common code;
1735 don't look for space after colon.
1736
1737 2012-07-16 Sriraman Tallam <tmsriram@google.com>
1738
1739 * gold.cc (queue_middle_tasks): Update function order only after
1740 deferred objects due to plugins are processed.
1741
1742 2012-07-11 Ian Lance Taylor <iant@google.com>
1743
1744 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1745 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1746 (Target_arm::scan_reloc_for_stub): Likewise.
1747 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1748 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1749 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1750 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1751 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1752
1753 2012-07-10 Dodji Seketeli <dodji@redhat.com>
1754 Ian Lance Taylor <iant@google.com>
1755
1756 PR gold/14309
1757 * configure.ac: Test whether std::tr1::hash<off_t> works.
1758 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1759 needed.
1760 * output.h (class Output_fill): Add virtual destructor.
1761 * configure, config.in: Rebuild.
1762
1763 2012-06-22 Roland McGrath <mcgrathr@google.com>
1764
1765 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1766
1767 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1768
1769 * plugin.cc (Plugin::load): Handle position independent executables.
1770
1771 2012-06-06 Cary Coutant <ccoutant@google.com>
1772
1773 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1774 add .debug_macro.
1775 (lines_only_debug_sections): Likewise.
1776 (gdb_fast_lookup_sections): New static array.
1777 (is_gdb_debug_section): Rename formal parameter.
1778 (is_lines_only_debug_section): Likewise.
1779 (is_gdb_fast_lookup_section): New function.
1780 (Layout::include_section): Check for ".zdebug_" prefix; pass
1781 section name suffix to is_gdb_debug_section, et al.; check for
1782 fast-lookup sections when building .gdb_index.
1783 * options.h (--strip-debug-gdb): Update GDB version number.
1784
1785 2012-06-06 Cary Coutant <ccoutant@google.com>
1786
1787 * configure.ac: Add check for fallocate.
1788 * configure: Regenerate.
1789 * config.in: Regenerate.
1790
1791 * options.h (class General_options): Add --mmap-output-file and
1792 --posix-fallocate options.
1793 * output.cc: (posix_fallocate): Remove; replace with...
1794 (gold_fallocate): New function.
1795 (Output_file::map_no_anonymous): Call gold_fallocate.
1796 (Output_file::map): Check --mmap-output-file option.
1797
1798 2012-06-05 Jing Yu <jingyu@google.com>
1799
1800 * gold.h (textdomain): Add do {} to empty while(0).
1801 (bindtextdomain): Likewise.
1802
1803 2012-06-04 Cary Coutant <ccoutant@google.com>
1804
1805 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1806 has_dynsym_index.
1807
1808 2012-05-25 Sriraman Tallam <tmsriram@google.com>
1809
1810 * symtab.cc (Symbol_table::define_special_symbol):
1811 Initialize *poldsym to prevent uninitialized variable errors.
1812
1813 2012-05-23 Cary Coutant <ccoutant@google.com>
1814
1815 * layout.cc (Layout::section_name_mapping): Add rules to handle
1816 exact match on .data.rel.ro.local or .data.rel.ro.
1817 (Layout::output_section_name): Check for exact matches.
1818
1819 2012-05-23 Cary Coutant <ccoutant@google.com>
1820
1821 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1822 more carefully.
1823
1824 2012-05-22 Cary Coutant <ccoutant@google.com>
1825
1826 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1827 object before exporting symbol.
1828
1829 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1830
1831 * testsuite/tls_test.cc: Include "config.h" first.
1832 * testsuite/tls_test_c.c: Likewise.
1833
1834 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
1835 Nick Clifton <nickc@redhat.com>
1836
1837 PR 14072
1838 * configure.in: Add check that sysdep.h has been included before
1839 any system header files.
1840 * configure: Regenerate.
1841 * config.in: Regenerate.
1842
1843 2012-05-14 Cary Coutant <ccoutant@google.com>
1844
1845 * layout.cc (Layout::make_output_section): Mark .tdata section
1846 as RELRO.
1847 * testsuite/relro_test.cc: Add a TLS variable.
1848
1849 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1850
1851 PR gold/14091
1852 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1853 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1854 R_X86_64_64.
1855
1856 2012-05-08 Cary Coutant <ccoutant@google.com>
1857
1858 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1859 (lines_only_debug_sections): Likewise.
1860
1861 2012-05-02 Roland McGrath <mcgrathr@google.com>
1862
1863 * nacl.cc: New file.
1864 * nacl.h: New file.
1865 * Makefile.am (CCFILES, HFILES): Add them.
1866 * Makefile.in: Regenerate.
1867 * i386.cc (Output_data_plt_i386_nacl): New class.
1868 (Output_data_plt_i386_nacl_exec): New class.
1869 (Output_data_plt_i386_nacl_dyn): New class.
1870 (Target_i386_nacl): New class.
1871 (Target_selector_i386_nacl): New class.
1872 (target_selector_i386): Use it instead of Target_selector_i386.
1873 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1874 (Target_x86_64_nacl): New class.
1875 (Target_selector_x86_64_nacl): New class.
1876 (target_selector_x86_64, target_selector_x32): Use it instead of
1877 Target_selector_x86_64.
1878 * arm.cc (Output_data_plt_arm_nacl): New class.
1879 (Target_arm_nacl): New class.
1880 (Target_selector_arm_nacl): New class.
1881 (target_selector_arm, target_selector_armbe): Use it instead of
1882 Target_selector_arm.
1883
1884 * target-select.cc (select_target): Take new Input_file* and off_t
1885 arguments, pass them on to recognize method of selector.
1886 * object.cc (make_elf_sized_object): Update caller.
1887 * parameters.cc (parameters_force_valid_target): Likewise.
1888 * incremental.cc (make_sized_incremental_binary): Likewise.
1889 * target-select.h: Update decl.
1890 (Target_selector::recognize): Take new Input_file* argument,
1891 pass it on to do_recognize.
1892 (Target_selector::do_recognize): Take new Input_file* argument.
1893 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1894 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1895 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1896 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1897
1898 * target.h (Target::Target_info): New members isolate_execinstr
1899 and rosegment_gap.
1900 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1901 * arm.cc (Target_arm::arm_info): Update initializer.
1902 * i386.cc (Target_i386::i386_info): Likewise.
1903 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1904 * sparc.cc (Target_sparc::sparc_info): Likewise.
1905 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1906 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1907 * layout.cc (Layout::attach_allocated_section_to_segment):
1908 Take new const Target* argument. If target->isolate_execinstr(), act
1909 like --rosegment.
1910 (Layout::find_first_load_seg): Take new const Target* argument;
1911 if target->isolate_execinstr(), reject PF_X segments.
1912 (Layout::relaxation_loop_body): Update caller.
1913 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1914 reset file offset to zero when we hit LOAD_SEG, and then do a second
1915 loop over the segments before LOAD_SEG to reassign offsets after
1916 addresses have been determined. Handle target->rosegment_gap().
1917 (Layout::attach_section_to_segment): Take new const Target* argument;
1918 pass it to attach_allocated_section_to_segment.
1919 (Layout::make_output_section): Update caller.
1920 (Layout::attach_sections_to_segments): Take new const Target* argument;
1921 pass it to attach_section_to_segment.
1922 * gold.cc (queue_middle_tasks): Update caller.
1923 * layout.h (Layout): Update method decls with new arguments.
1924
1925 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1926 Target_info pointer to use.
1927 (Target_arm::do_make_data_plt): New virtual method.
1928 (Target_arm::make_data_plt): New method that calls it.
1929 (Target_arm::make_plt_entry): Use it.
1930 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1931 for the section alignment.
1932 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1933 method.
1934 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1935 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1936 method.
1937 (Output_data_plt_arm::get_plt_entry_size): Call it.
1938 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1939 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1940 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1941 method.
1942 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1943 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1944 method instead of sizeof(plt_entry).
1945 (Output_data_plt_arm::add_entry): Likewise.
1946 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1947 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1948 than static method.
1949 (Target_arm::plt_entry_size): Likewise.
1950 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1951 Move to ...
1952 (Output_data_plt_arm_standard): ... here, new class.
1953 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1954 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1955 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1956
1957 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1958 Take additional argument for the PLT entry size.
1959 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1960 Use get_plt_entry_size method rather than plt_entry_size variable.
1961 (Output_data_plt_x86_64::reserve_slot): Likewise.
1962 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1963 (Output_data_plt_x86_64::add_entry): Likewise.
1964 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1965 (Output_data_plt_x86_64::address_for_global): Likewise.
1966 (Output_data_plt_x86_64::address_for_local): Likewise.
1967 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1968 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1969 Make method non-static.
1970 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1971 method.
1972 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1973 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1974 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1975 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1976 virtual method.
1977 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1978 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1979 virtual method.
1980 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1981 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1982 virtual method.
1983 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1984 (Output_data_plt_x86_64::plt_entry_size)
1985 (Output_data_plt_x86_64::first_plt_entry)
1986 (Output_data_plt_x86_64::plt_entry)
1987 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1988 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1989 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1990 (Output_data_plt_x86_64_standard): ... here, new class.
1991 (Target_x86_64::Target_x86_64): Take optional argument for the
1992 Target_info pointer to use.
1993 (Target_x86_64::do_make_data_plt): New virtual method.
1994 (Target_x86_64::make_data_plt): New method to call it.
1995 (Target_x86_64::init_got_plt_for_update): Use that.
1996 Call this->plt_->add_eh_frame method here.
1997 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1998 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1999 rather than static method.
2000 (Target_x86_64::plt_entry_size): Likewise.
2001 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2002 rather than plt_entry_size variable. Move guts of PLT filling to...
2003 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2004 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2005 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2006
2007 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2008 additional argument for the section alignment.
2009 Don't do add_eh_frame_for_plt here.
2010 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2011 non-static. Use get_plt_entry_size method rather than plt_entry_size
2012 variable.
2013 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2014 method.
2015 (Output_data_plt_i386::get_plt_entry_size): Call it.
2016 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2017 (Output_data_plt_i386::add_eh_frame): New method to call it.
2018 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2019 method.
2020 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2021 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2022 method.
2023 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2024 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2025 method instead of plt_entry_size.
2026 (Output_data_plt_i386::plt_entry_size)
2027 (Output_data_plt_i386::plt_eh_frame_fde_size)
2028 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2029 (Output_data_plt_i386_standard): ... here, new class.
2030 (Output_data_plt_i386_exec): New class.
2031 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2032 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2033 (Output_data_plt_i386::exec_plt_entry): Move to ...
2034 (Output_data_plt_i386_exec::plt_entry): ... here.
2035 (Output_data_plt_i386_dyn): New class.
2036 (Output_data_plt_i386::first_plt_entry): Move to ...
2037 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2038 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2039 (Output_data_plt_i386_dyn::plt_entry): ... here.
2040 (Target_i386::Target_i386): Take optional argument for the Target_info
2041 pointer to use.
2042 (Target_i386::do_make_data_plt): New virtual method.
2043 (Target_i386::make_data_plt): New method to call it.
2044 (Target_i386::make_plt_section): Use that.
2045 Call this->plt_->add_eh_frame method here.
2046 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2047 rather than plt_entry_size variable.
2048 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2049 (Output_data_plt_i386::address_for_local): Likewise.
2050 (Output_data_plt_i386::do_write): Likewise.
2051 Move guts of PLT filling to...
2052 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2053 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2054 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2055 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2056
2057 2012-05-01 Cary Coutant <ccoutant@google.com>
2058
2059 * dwarf_reader.cc (Dwarf_die::read_attributes)
2060 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2061 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2062 * reduced_debug_output.cc
2063 (Output_reduced_debug_info_section::get_die_end): Remove
2064 DW_FORM_GNU_ref_index. Add default case.
2065
2066 2012-04-26 Mark Wielaard <mjw@redhat.com>
2067
2068 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2069 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2070 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2071 DW_AT_high_pc as offset from DW_AT_low_pc.
2072
2073 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2074 * testsuite/Makefile.in: Regenerate.
2075 * testsuite/gdb_index_test_3.c: New test source file.
2076 * testsuite/gdb_index_test_3.sh: New test source file.
2077
2078 2012-04-25 Ian Lance Taylor <iant@google.com>
2079
2080 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2081 pointer.
2082 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2083 as a class, not a struct.
2084 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2085 (Target_arm::apply_cortex_a8_workaround): Likewise.
2086 * gc.h: Declare Reloc_types as a struct, not a class.
2087 * object.h: Declare Symbols_data as a struct.
2088 * reloc.h: Declare Read_relocs_data as a struct.
2089 * target.h: Declare Relocate_info as a struct.
2090
2091 2012-04-24 David S. Miller <davem@davemloft.net>
2092
2093 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2094 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2095 and R_SPARC_WPLT30.
2096
2097 2012-04-24 Cary Coutant <ccoutant@google.com>
2098
2099 * incremental-dump.cc (find_input_containing_global): Replace
2100 magic number with symbolic constant.
2101 (dump_incremental_inputs): Update version number.
2102 * incremental.cc (Output_section_incremental_inputs): Update version
2103 number; import symbolic constants from Incremental_inputs_reader.
2104 (Incremental_inputs::create_data_sections): Align relocations
2105 section correctly for 64-bit targets.
2106 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2107 constants; add padding.
2108 (Output_section_incremental_inputs::write_header): Add assert for
2109 header_size.
2110 (Output_section_incremental_inputs::write_input_files): Add assert
2111 for input_entry_size.
2112 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2113 add assert for object_info_size, input_section_entry_size,
2114 global_sym_entry_size.
2115 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2116 for data structure sizes; use them.
2117 (Incremental_input_entry_reader): Import symbolic constants from
2118 Incremental_inputs_reader; use them.
2119
2120 2012-04-23 David S. Miller <davem@davemloft.net>
2121
2122 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2123 and elf_flags_set_.
2124 (Target_sparc::Target_sparc): Initialize new fields.
2125 (Target_sparc::do_make_elf_object): New function.
2126 (Target_sparc::do_adjust_elf_header): New function.
2127
2128 2012-04-23 Cary Coutant <ccoutant@google.com>
2129
2130 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2131 CU range table of gdb index.
2132
2133 2012-04-20 David S. Miller <davem@davemloft.net>
2134
2135 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2136 instead of false.
2137
2138 2012-04-16 David S. Miller <davem@davemloft.net>
2139
2140 * sparc.cc (Target_sparc::got_address): New function.
2141 (Sparc_relocate_functions::gdop_hix22): New function.
2142 (Sparc_relocate_functions::gdop_lox10): New function.
2143 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2144 relocs.
2145 (Target_sparc::Scan::local): Likewise if the global symbol is not
2146 preemptible and is not IFUNC.
2147 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2148 transformations for local and non-preemptible non-IFUNC global
2149 symbols.
2150
2151 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2152 writing out 64-bit part of ranges.
2153
2154 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2155 -fpic and -fpie respectively.
2156 * Makefile.in: Regenerate.
2157
2158 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2159 (Target_sparc::Target_sparc): Initialize new field.
2160 (Target_sparc::do_plt_section_for_global): New function.
2161 (Target_sparc::do_plt_section_for_local): New function.
2162 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2163 (Target_sparc::make_plt_section): New function, broken out of
2164 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2165 (Target_sparc::make_plt_entry): Call make_plt_section.
2166 (Target_sparc::make_local_ifunc_plt_entry): New function.
2167 (Target_sparc::rela_ifunc_section): New function.
2168 (Target_sparc::plt_section): Remove const.
2169 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2170 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2171 and ifunc_count_ fields.
2172 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2173 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2174 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2175 (Output_data_plt_sparc::rela_ifunc): New function.
2176 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2177 (Output_data_plt_sparc::has_ifunc_section): New function.
2178 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2179 (Output_data_plt_sparc::address_for_global): New function.
2180 (Output_data_plt_sparc::address_for_local): New function.
2181 (Output_data_plt_sparc::plt_index_to_offset): New function.
2182 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2183 and entry_count.
2184 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2185 entry_count.
2186 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2187 R_SPARC_JMP_IREL to switch.
2188 (Target_sparc::Scan::check_non_pic): Likewise.
2189 (Target_sparc::Scan::local): Handle IFUNC symbols.
2190 (Target_sparc::Scan::local): Likewise.
2191 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2192 and plt_address_for_local.
2193 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2194 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2195
2196 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2197 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2198 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2199 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2200 global relocs too.
2201 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2202 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2203 calls.
2204 * sparc.cc (Target_sparc::Scan::global): Likewise.
2205 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2206
2207 2012-04-16 Cary Coutant <ccoutant@google.com>
2208
2209 * archive.cc (Library_base::should_include_member): Check for
2210 --export-dynamic-symbol.
2211 * options.h (class General_options): Add --export-dynamic-symbol.
2212 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2213 --export-dynamic-symbol.
2214 (Symbol_table::gc_mark_undef_symbols): Likewise.
2215 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2216
2217 2012-04-12 David S. Miller <davem@davemloft.net>
2218
2219 * sparc.cc (Reloc::wdisp10): New relocation method.
2220 (Reloc::h34): Likewise.
2221 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2222 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2223 R_SPARC_WDISP10.
2224 (Target_sparc::Scan::local): Likewise.
2225 (Target_sparc::Scan::global): Likewise.
2226 (Target_sparc::Relocate::relocate): Likewise.
2227
2228 2012-04-09 Cary Coutant <ccoutant@google.com>
2229
2230 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2231 low_pc == 0.
2232
2233 2012-04-06 Ian Lance Taylor <iant@google.com>
2234
2235 * timer.cc: #include <unistd.h>.
2236
2237 2012-04-06 Roland McGrath <mcgrathr@google.com>
2238
2239 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2240 * config.in: Regenerate.
2241 * configure: Regenerate.
2242
2243 2012-04-05 Nick Clifton <nickc@redhat.com>
2244
2245 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2246 (AM_LC_MESSAGES): Add.
2247 * aclocal.m4: Regenerate.
2248 * config.in: Regenerate.
2249 * configure: Regenerate.
2250
2251 2012-03-21 Cary Coutant <ccoutant@google.com>
2252
2253 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2254 * Makefile.in: Regenerate.
2255 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2256 (Sized_elf_reloc_mapper::symbol_section): New function.
2257 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2258 (make_elf_reloc_mapper): New function.
2259 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2260 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2261 (Dwarf_abbrev_table::do_get_abbrev): New function.
2262 (Dwarf_ranges_table::read_ranges_table): New function.
2263 (Dwarf_ranges_table::read_range_list): New function.
2264 (Dwarf_pubnames_table::read_section): New function.
2265 (Dwarf_pubnames_table::read_header): New function.
2266 (Dwarf_pubnames_table::next_name): New function.
2267 (Dwarf_die::Dwarf_die): New function.
2268 (Dwarf_die::read_attributes): New function.
2269 (Dwarf_die::skip_attributes): New function.
2270 (Dwarf_die::set_name): New function.
2271 (Dwarf_die::set_linkage_name): New function.
2272 (Dwarf_die::attribute): New function.
2273 (Dwarf_die::string_attribute): New function.
2274 (Dwarf_die::int_attribute): New function.
2275 (Dwarf_die::uint_attribute): New function.
2276 (Dwarf_die::ref_attribute): New function.
2277 (Dwarf_die::child_offset): New function.
2278 (Dwarf_die::sibling_offset): New function.
2279 (Dwarf_info_reader::check_buffer): New function.
2280 (Dwarf_info_reader::parse): New function.
2281 (Dwarf_info_reader::do_parse): New function.
2282 (Dwarf_info_reader::do_read_string_table): New function.
2283 (Dwarf_info_reader::lookup_reloc): New function.
2284 (Dwarf_info_reader::get_string): New function.
2285 (Dwarf_info_reader::visit_compilation_unit): New function.
2286 (Dwarf_info_reader::visit_type_unit): New function.
2287 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2288 Sized_elf_reloc_mapper.
2289 (Sized_dwarf_line_info::symbol_section): Remove function.
2290 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2291 (Sized_dwarf_line_info::read_line_mappings): Remove object
2292 parameter, adjust callers.
2293 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2294 * dwarf_reader.h: Include <sys/types.h>.
2295 (class Track_relocs): Remove forward declaration.
2296 (class Elf_reloc_mapper): New class.
2297 (class Sized_elf_reloc_mapper): New class.
2298 (class Dwarf_abbrev_table): New class.
2299 (class Dwarf_range_list): New class.
2300 (class Dwarf_ranges_table): New class.
2301 (class Dwarf_pubnames_table): New class.
2302 (class Dwarf_die): New class.
2303 (class Dwarf_info_reader): New class.
2304 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2305 (Sized_dwarf_line_info::symbol_section): Remove member function.
2306 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2307 base class.
2308 * gdb-index.cc: New source file.
2309 * gdb-index.h: New source file.
2310 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2311 and .debug_types sections, call Layout::add_to_gdb_index.
2312 (Sized_relobj_incr::do_section_name): Implement.
2313 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2314 return type; Implement.
2315 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2316 return type.
2317 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2318 parameter list and return type.
2319 (Sized_incr_dynobj::do_section_contents): Likewise.
2320 * layout.cc: Include gdb-index.h.
2321 (Layout::Layout): Initialize gdb_index_data_.
2322 (Layout::init_fixed_output_section): Check for .gdb_index section.
2323 (Layout::add_to_gdb_index): New function. Instantiate.
2324 * layout.h: Add forward declaration for class Gdb_index.
2325 (Layout::add_to_gdb_index): New member function.
2326 (Layout::gdb_index_data_): New data member.
2327 * main.cc: Include gdb-index.h.
2328 (main): Print statistics for gdb index.
2329 * object.cc (Object::section_contents): Move code into
2330 do_section_contents.
2331 (need_decompressed_section): Check for sections needed when building
2332 gdb index.
2333 (build_compressed_section_map): Likewise.
2334 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2335 gdb index.
2336 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2337 sections; call Layout::add_to_gdb_index.
2338 (Sized_relobj_file::do_decompressed_section_contents): Call
2339 do_section_contents directly.
2340 * object.h (Object::do_section_contents): Adjust parameter list and
2341 return type.
2342 (Object::do_decompressed_section_contents): Call do_section_contents
2343 directly.
2344 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2345 return type.
2346 * options.h (class General_options): Add --gdb-index option.
2347 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2348 list and return type.
2349 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2350 * reloc.h (Track_relocs::checkpoint): New function.
2351 (Track_relocs::reset): New function.
2352
2353 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2354 New test cases.
2355 * testsuite/Makefile.in: Regenerate.
2356 * testsuite/gdb_index_test.cc: New test source file.
2357 * testsuite/gdb_index_test_1.sh: New test source file.
2358 * testsuite/gdb_index_test_2.sh: New test source file.
2359
2360 2012-03-19 Doug Kwan <dougkwan@google.com>
2361
2362 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2363 (Target_arm::do_finalize_sections): Remove code which defines
2364 __exidx_start and __exidx_end. Make symbol table parameter
2365 anonymous as it is not used.
2366 * gold.cc (queue_middle_tasks): Call target hook to define any
2367 target-specific symbols.
2368 * target.h (Target::define_standard_symbols): New method.
2369 (Target::do_define_standard_symbols): Same.
2370 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2371 * testsuite/Makefile.in: Regenerate.
2372 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2373 and __exidx_end.
2374 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2375 relocations are generated for __exidx_start and __exidx_end.
2376
2377 2012-03-16 Doug Kwan <dougkwan@google.com>
2378
2379 * testsuite/Makefile.am: Disable test initpri3b.
2380 * testsuite/Makefile.in: Regenerate.
2381
2382 2012-03-15 Doug Kwan <dougkwan@google.com>
2383
2384 * arm.cc (Target_arm::got_section): Make .got section read-only
2385 if -z now is given.
2386
2387 2012-03-15 Ian Lance Taylor <iant@google.com>
2388
2389 PR gold/13850
2390 * layout.cc (Layout::make_output_section): Correctly mark
2391 SHT_INIT_ARRAY, et. al., as relro.
2392
2393 2012-03-14 Doug Kwan <dougkwan@google.com>
2394
2395 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2396 dynamic relocations for protected symbols in shared objects.
2397
2398 2012-03-13 Ian Lance Taylor <iant@google.com>
2399
2400 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2401 keep the larger alignment.
2402
2403 2012-03-12 Cary Coutant <ccoutant@google.com>
2404
2405 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2406 handling of DW_LNE_define_file.
2407
2408 2012-03-12 Cary Coutant <ccoutant@google.com>
2409
2410 * reduced_debug_output.cc
2411 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2412 codes to switch.
2413
2414 2012-02-29 Cary Coutant <ccoutant@google.com>
2415
2416 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2417
2418 2012-02-29 Cary Coutant <ccoutant@google.com>
2419
2420 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2421 Call Object::decompressed_section_contents.
2422 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2423 New dtor.
2424 (Sized_dwarf_line_info::buffer_start_): New data member.
2425 * merge.cc (Output_merge_data::do_add_input_section): Call
2426 Object::decompressed_section_contents.
2427 (Output_merge_string::do_add_input_section): Likewise.
2428 * object.cc (need_decompressed_section): New function.
2429 (build_compressed_section_map): Decompress sections needed later.
2430 (Sized_relobj_file::do_decompressed_section_contents): New function.
2431 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2432 * object.h (Object::decompressed_section_contents): New function.
2433 (Object::discard_decompressed_sections): New function.
2434 (Object::do_decompressed_section_contents): New function.
2435 (Object::do_discard_decompressed_sections): New function.
2436 (Compressed_section_info): New type.
2437 (Compressed_section_map): Include decompressed section contents.
2438 (Sized_relobj_file::do_decompressed_section_contents): New function.
2439 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2440
2441 2012-02-16 Cary Coutant <ccoutant@google.com>
2442
2443 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2444 * testsuite/Makefile.in: Regenerate.
2445
2446 2012-02-14 Cary Coutant <ccoutant@google.com>
2447
2448 * options.cc (General_options::finalize): Disallow -pie and -static.
2449
2450 2012-02-03 Doug Kwan <dougkwan@google.com>
2451
2452 * arm.cc (Arm_relocate_functions::abs8,
2453 Arm_relocate_functions::abs16): Use
2454 Bits::has_signed_unsigned_overflow32.
2455 (Arm_relocate_functions::thm_abs8): Correct range of
2456 overflow check.
2457 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2458 in assertions.
2459
2460 2012-02-02 Doug Kwan <dougkwan@google.com>
2461
2462 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2463 position independent outputs, not just shared objects.
2464
2465 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2466
2467 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2468 * configure: Regenerated.
2469
2470 2012-01-27 Ian Lance Taylor <iant@google.com>
2471
2472 * reloc.h (Bits): New class with static functions, copied from
2473 namespace utils in arm.cc.
2474 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2475 instead.
2476
2477 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2478
2479 * incremental.cc (write_info_blocks): Correct relocation offset.
2480
2481 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2482
2483 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2484 (Relocate::tls_gd_to_le): Likewise.
2485
2486 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2487
2488 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2489
2490 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2491
2492 * configure.ac: Check if -mcmodel=medium works.
2493 * configure: Regenerated.
2494
2495 2012-01-24 Cary Coutant <ccoutant@google.com>
2496
2497 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2498 definition and ...
2499 (read_unsigned_LEB_128_x): ... this new function.
2500 (read_signed_LEB_128): Replaced with inline definition and ...
2501 (read_signed_LEB_128_x): ... this new function.
2502 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2503 (read_unsigned_LEB_128): Add inline definition.
2504 (read_signed_LEB_128_x): New function.
2505 (read_signed_LEB_128): Add inline definition.
2506 * testsuite/Makefile.am (leb128_unittest): New unit test.
2507 * testsuite/Makefile.in: Regenerate.
2508 * testsuite/leb128_unittest.cc: New unit test.
2509
2510 2012-01-23 Ian Lance Taylor <iant@google.com>
2511
2512 PR gold/13617
2513 * i386.cc (Target_i386::do_code_fill): When using a jmp
2514 instruction, pad with nop instructions.
2515 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2516
2517 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2518
2519 * x86_64.cc (gc_process_relocs): Add typename on types used in
2520 template.
2521 (scan_relocs): Likewise.
2522 (relocate_section): Likewise.
2523 (apply_relocation): Likewise.
2524
2525 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2526
2527 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2528 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2529 under x32.
2530
2531 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2532
2533 * x86_64.cc: Initial support for x32.
2534
2535 2012-01-03 Cary Coutant <ccoutant@google.com>
2536
2537 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2538 Use abstract base class for GOT.
2539 * gold/output.h (class Output_data_got_base): New abstract base class.
2540 (class Output_data_got): Derive from new base class, adjust ctors.
2541 (Output_data_got::reserve_slot): Make virtual; rename to
2542 do_reserve_slot; Adjust callers.
2543 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2544 pointer to abstract base class.
2545 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2546
2547 2011-12-18 Ian Lance Taylor <iant@google.com>
2548
2549 * object.h (Relobj::local_symbol_value): New function.
2550 (Relobj::local_plt_offset): New function.
2551 (Relobj::local_has_got_offset): New function.
2552 (Relobj::local_got_offset): New function.
2553 (Relobj::set_local_got_offset): New function.
2554 (Relobj::do_local_symbol_value): New pure virtual function.
2555 (Relobj::do_local_plt_offset): Likewise.
2556 (Relobj::do_local_has_got_offset): Likewise.
2557 (Relobj::do_local_got_offset): Likewise.
2558 (Relobj::do_set_local_got_offset): Likewise.
2559 (Sized_relobj::do_local_has_got_offset): Rename from
2560 local_has_got_offset.
2561 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2562 (Sized_relobj::do_set_local_got_offset): Rename from
2563 set_local_got_offset.
2564 (Sized_relobj_file::do_local_plt_offset): Rename from
2565 local_plt_offset.
2566 (Sized_relobj_file::do_local_symbol_value): New function.
2567 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2568 local_plt_offset.
2569 * output.cc (Output_data_got::Got_entry::write): Change object to
2570 Relobj. Use local_symbol_value.
2571 (Output_data_got::add_global_with_rel): Change rel_dyn to
2572 Output_data_reloc_generic*. Use add_global_generic.
2573 (Output_data_got::add_global_with_rela): Remove. Change all
2574 callers to use add_global_with_rel.
2575 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2576 Output_data_reloc_generic*. Use add_global_generic.
2577 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2578 callers to use add_global_pair_with_rel.
2579 (Output_data_got::add_local): Change object to Relobj*.
2580 (Output_data_got::add_local_plt): Likewise.
2581 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2582 change rel_dyn to Output_data_reloc_generic*. Use
2583 add_local_generic.
2584 (Output_data_got::add_local_with_rela): Remove. Change all
2585 callers to use all_local_with_rel.
2586 (Output_data_got::add_local_pair_with_rel): Change object to
2587 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2588 add_output_section_generic.
2589 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2590 callers to use add_local_pair_with_rel.
2591 (Output_data_got::reserve_local): Change object to Relobj*.
2592 * output.h: (class Output_data_reloc_generic): Add pure virtual
2593 declarations for add_global_generic, add_local_generic,
2594 add_output_section_generic.
2595 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2596 functions for Output_data_reloc_generic. Update declarations for
2597 changes listed in output.cc.
2598 (class Output_data_got): Change template parameter to got_size.
2599 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2600 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2601 function.
2602 (Sized_relobj_incr::do_local_plt_offset): New function.
2603 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2604 add_global_generic.
2605
2606 2011-12-17 Cary Coutant <ccoutant@google.com>
2607
2608 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2609 * resolve.cc (Symbol_table::resolve): Likewise.
2610 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2611 arrays.
2612 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2613
2614 2011-12-16 Ian Lance Taylor <iant@google.com>
2615
2616 * output.h (Output_data_reloc_generic::add): Only call
2617 add_dynamic_reloc if this is a dynamic reloc section.
2618
2619 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2620
2621 PR gold/13505
2622 * target-reloc.h (apply_relocation): Replace <64, false> with
2623 <size, big_endian>.
2624
2625 2011-11-25 Nick Clifton <nickc@redhat.com>
2626
2627 * po/it.po: New Italian translation.
2628
2629 2011-11-17 Sterling Augustine <saugustine@google.com>
2630
2631 * script.cc (script_include_directive): Implement.
2632 (read_script_file): New local variables name and search_path. Update
2633 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2634 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2635 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2636
2637 2011-11-11 Sterling Augustine <saugustine@google.com>
2638
2639 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2640 (file_or_sections_cmd): Likewise.
2641
2642 2011-11-11 Doug Kwan <dougkwan@google.com>
2643
2644 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2645 if --just-symbols is given.
2646
2647 2011-11-10 Doug Kwan <dougkwan@google.com>
2648
2649 PR gold/13362
2650 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2651 when processing data relocs.
2652 * reloc.h (Relocate_functions::rel_unaligned): New method.
2653 (Relocate_functions::pcrel_unaligned): Ditto.
2654 (Relocate_functions::rel32_unaligned): Ditto.
2655 (Relocate_functions::pcrel32_unaligned): Ditto.
2656
2657 2011-11-09 Doug Kwan <dougkwan@google.com>
2658
2659 PR gold/13362
2660 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2661 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2662 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2663 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2664 (Relocate_functions::rel_unaligned): New.
2665 (Relocate_functions::rel32_unaligned): New.
2666 * target-reloc.h (relocate_for_relocatable): Add code to handle
2667 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2668 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2669 arm_unaligned_reloc_r): New targets.
2670 * testsuite/Makefile.in: Regenerate.
2671 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2672 linking.
2673
2674 2011-11-02 Ian Lance Taylor <iant@google.com>
2675
2676 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2677 NATIVE_LINKER.
2678 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2679 * options.cc (General_options::finalize): Use library search path
2680 from configure script if specified. If not native and no sysroot,
2681 only search TOOLLIBDIR.
2682 * options.h (Search_directory::Search_directory): Change name to
2683 const std::string&.
2684 (General_options::add_to_library_path_with_sysroot): Change arg to
2685 const std::string&.
2686 * configure, Makefile.in, config.in: Rebuild.
2687
2688 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2689
2690 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2691 we are working around the ARM1176 Erratum.
2692 * options.h (General_options::fix_arm1176): Add option.
2693 * testsuite/Makefile.am: Add testcases, and keep current ones
2694 working.
2695 * testsuite/Makefile.in: Regenerate.
2696 * testsuite/arm_fix_1176.s: New file.
2697 * testsuite/arm_fix_1176.sh: Likewise.
2698
2699 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2700
2701 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2702 may_use_blx_.
2703 (Target_arm::may_use_blx): Remove method.
2704 (Target_arm::set_may_use_blx): Likewise.
2705 (Target_arm::may_use_v4t_interworking): New method.
2706 (Target_arm::may_use_v5t_interworking): Likewise.
2707 (Target_arm::may_use_blx_): Remove member variable.
2708 (Arm_relocate_functions::arm_branch_common): Check for v5T
2709 interworking.
2710 (Arm_relocate_functions::thumb_branch_common): Likewise.
2711 (Reloc_stub::stub_type_for_reloc): Likewise.
2712 (Target_arm::do_finalize_sections): Correct interworking checks.
2713 * testsuite/Makefile.am: Add new tests.
2714 * testsuite/Makefile.in: Regenerate.
2715 * testsuite/arm_farcall_arm_arm.s: New test.
2716 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2717 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2718 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2719 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2720 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2721 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2722 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2723
2724 2011-10-31 Cary Coutant <ccoutant@google.com>
2725
2726 PR gold/13023
2727 * expression.cc (Expression::eval_with_dot): Add
2728 is_section_dot_assignment parameter.
2729 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2730 absolute and assigning to dot within a section.
2731 * script-sections.cc
2732 (Output_section_element_assignment::set_section_addresses): Pass
2733 dot_section to set_if_absolute.
2734 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2735 as is_section_dot_assignment flag to eval_with_dot.
2736 (Output_section_element_dot_assignment::set_section_addresses):
2737 Likewise.
2738 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2739 parameter. Also set value if relative to dot_section; set the
2740 symbol's output_section.
2741 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2742 parameter. Adjust all callers.
2743 (Expression::eval_maybe_dot): Likewise.
2744 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2745 Adjust all callers.
2746 * testsuite/script_test_2.t: Test assignment of an absolute value
2747 to dot within an output section element.
2748
2749 2011-10-31 Cary Coutant <ccoutant@google.com>
2750
2751 * options.h (class General_options): Add --[no-]gnu-unique options.
2752 * symtab.cc (Symbol_table::sized_write_globals): Convert
2753 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2754
2755 2011-10-31 Cary Coutant <ccoutant@google.com>
2756
2757 PR gold/13359
2758 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2759 unnecessary assertion.
2760 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2761
2762 2011-10-31 Sriraman Tallam <tmsriram@google.com>
2763
2764 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2765 gc_mark_symbol.
2766 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2767 gc_mark_symbol.
2768 Change to just keep the section associated with symbol.
2769 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2770 they are externally visible and --export-dynamic is turned on.
2771 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2772
2773 2011-10-19 Ian Lance Taylor <iant@google.com>
2774
2775 PR gold/13163
2776 * script-sections.cc
2777 (Output_section_element_dot_assignment::needs_output_section): New
2778 function.
2779
2780 2011-10-19 Ian Lance Taylor <iant@google.com>
2781
2782 PR gold/13204
2783 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2784 --section-start option was seen.
2785 * options.h (General_options::any_section_start): New function.
2786
2787 2011-10-18 David S. Miller <davem@davemloft.net>
2788
2789 PR binutils/13301
2790 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2791 member to track relocation locations that have moved during TLS
2792 reloc optimizations.
2793 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2794 (Target_sparc::Relocate::relocate): Adjust view down by 4
2795 bytes if it matches reloc_adjust_addr_.
2796 (Target_sparc::Relocate::relocate_tls): Always move the
2797 __tls_get_addr call delay slot instruction forward 4 bytes when
2798 performing relaxation.
2799
2800 2011-10-18 Cary Coutant <ccoutant@google.com>
2801
2802 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2803 (Output_file::map_no_anonymous): Check for non-zero
2804 return code from posix_fallocate.
2805
2806 2011-10-17 Cary Coutant <ccoutant@google.com>
2807
2808 PR gold/13245
2809 * plugin.cc (is_visible_from_outside): Check for symbols
2810 referenced from dynamic objects.
2811 * resolve.cc (Symbol_table::resolve): Don't count references
2812 from dynamic objects as references from real ELF files.
2813 * testsuite/plugin_test_2.sh: Adjust expected result.
2814
2815 2011-10-17 Cary Coutant <ccoutant@google.com>
2816
2817 * gold.cc: Include timer.h.
2818 (queue_middle_tasks): Stamp time.
2819 (queue_final_tasks): Likewise.
2820 * main.cc (main): Store timer in parameters. Print timers
2821 for each pass.
2822 * parameters.cc (Parameters::Parameters): Initialize timer_.
2823 (Parameters::set_timer): New function.
2824 (set_parameters_timer): New function.
2825 * parameters.h (Parameters::set_timer): New function.
2826 (Parameters::timer): New function.
2827 (Parameters::timer_): New data member.
2828 (set_parameters_timer): New function.
2829 * timer.cc (Timer::stamp): New function.
2830 (Timer::get_pass_time): New function.
2831 * timer.h (Timer::stamp): New function.
2832 (Timer::get_pass_time): New function.
2833 (Timer::pass_times_): New data member.
2834
2835 2011-10-17 Cary Coutant <ccoutant@google.com>
2836
2837 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2838 task for members of lib groups.
2839
2840 2011-10-17 Cary Coutant <ccoutant@google.com>
2841
2842 PR gold/13288
2843 * fileread.cc (File_read::find_view): Add assert.
2844 (File_read::make_view): Move bounds check (replace with assert)...
2845 (File_read::find_or_make_view): ... to here.
2846
2847 2011-10-12 Cary Coutant <ccoutant@google.com>
2848
2849 * output.cc (Output_file::open_base_file): Handle case where
2850 ::read returns less than requested size.
2851
2852 2011-10-10 Cary Coutant <ccoutant@google.com>
2853
2854 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
2855 Initialize defined_count_.
2856 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2857 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2858 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2859 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2860 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
2861 * incremental.h (Sized_relobj_incr::defined_count_): New data
2862 member.
2863 (Sized_incr_dynobj::defined_count_): New data member.
2864 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
2865 Return zeroes instead of internal error.
2866
2867 2011-10-10 Cary Coutant <ccoutant@google.com>
2868
2869 PR gold/13249
2870 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
2871 (Output_reloc::symbol_value): Return PLT offset if flag is set.
2872 * output.h (class Output_reloc): Add use_plt_offset flag.
2873 (Output_reloc::type_): Adjust size of bit field.
2874 (Output_reloc::use_plt_offset_): New bit field.
2875 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2876 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2877 flag. Adjust all callers.
2878 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
2879 creating RELATIVE relocations.
2880
2881 2011-10-10 Nick Clifton <nickc@redhat.com>
2882
2883 * po/es.po: Updated Spanish translation.
2884 * po/fi.po: Updated Finnish translation.
2885
2886 2011-10-03 Diego Novillo <dnovillo@google.com>
2887
2888 * options.cc (parse_uint): Fix dereference of RETVAL.
2889
2890 2011-09-29 Sriraman Tallam <tmsriram@google.com>
2891
2892 * layout.h (section_order_map_): New member.
2893 (get_section_order_map): New member function.
2894 * output.cc (Output_section::add_input_section): Check for patterns
2895 only when --section-ordering-file is specified.
2896 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2897 output_sections have been formed.
2898 * layout.cc (Layout_Layout): Initialize section_order_map_.
2899 * plugin.cc (update_section_order): Store order in order_map. Do not
2900 update the order.
2901 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2902 * testsuite/Makefile.in: Regenerate.
2903 * testsuite/plugin_section_order.c: New file.
2904 * testsuite/plugin_final_layout.cc: New file.
2905 * testsuite/plugin_final_layout.sh: New file.
2906
2907 2011-09-29 Cary Coutant <ccoutant@google.com>
2908
2909 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2910 Check for NULL.
2911 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
2912 symbols during incremental update.
2913 (Symbol_table::add_from_dynobj): Likewise.
2914
2915 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2916 Ian Lance Taylor <iant@google.com>
2917
2918 * symtab.cc (Symbol_table::define_special_symbol): Always
2919 canonicalize version string.
2920
2921 2011-09-26 Cary Coutant <ccoutant@google.com>
2922
2923 * gold.cc (queue_initial_tasks): Move option checks ...
2924 * options.cc (General_options::finalize): ... to here. Disable
2925 some options; make others fatal.
2926
2927 2011-09-26 Cary Coutant <ccoutant@google.com>
2928
2929 gcc PR lto/47247
2930 * plugin.cc (get_symbols_v2): New function.
2931 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2932 (is_referenced_from_outside): New function.
2933 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2934 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2935 (get_symbols): Pass version parameter.
2936 (get_symbols_v2): New function.
2937 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2938 parameter.
2939 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2940 (onload): Add LDPT_GET_SYMBOLS_V2.
2941 (all_symbols_read_hook): Use get_symbols_v2; check for
2942 LDPR_PREVAILING_DEF_IRONLY_EXP.
2943 * testsuite/plugin_test_3.sh: Update expected results.
2944
2945 2011-09-23 Simon Baldwin <simonb@google.com>
2946
2947 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2948 configuration options.
2949 * configure: Regenerate.
2950 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2951 * Makefile.in: Regenerate.
2952 * testsuite/Makefile.in: Regenerate.
2953
2954 2011-09-19 Sriraman Tallam <tmsriram@google.com>
2955
2956 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2957
2958 2011-09-19 Cary Coutant <ccoutant@google.com>
2959
2960 * incremental.cc (can_incremental_update): Fix typo in comment.
2961 * incremental.h (can_incremental_update): Likewise.
2962
2963 2011-09-18 Cary Coutant <ccoutant@google.com>
2964
2965 * incremental.cc (can_incremental_update): New function.
2966 * incremental.h (can_incremental_update): New function.
2967 * layout.cc (Layout::init_fixed_output_section): Call it.
2968 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2969 * object.cc (Sized_relobj_file::do_layout): Call
2970 can_incremental_update.
2971
2972 2011-09-13 Cary Coutant <ccoutant@google.com>
2973
2974 * configure.ac: Check for glibc support for gnu_indirect_function
2975 support with static linking, setting automake conditional
2976 IFUNC_STATIC.
2977 * Makefile.in: Regenerate.
2978 * configure: Regenerate.
2979
2980 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2981 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2982 for IFUNC_STATIC.
2983 * testsuite/Makefile.in: Regenerate.
2984
2985 2011-09-13 Cary Coutant <ccoutant@google.com>
2986
2987 * incremental.cc (Sized_relobj_incr::do_layout): Call
2988 report_comdat_group for kept comdat sections.
2989 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2990 * testsuite/Makefile.in: Regenerate.
2991 * testsuite/incr_comdat_test_1.cc: New source file.
2992 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2993 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2994 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2995
2996 2011-09-13 Ian Lance Taylor <iant@google.com>
2997
2998 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2999 variable external_symbols_offset.
3000
3001 2011-09-12 Ian Lance Taylor <iant@google.com>
3002
3003 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3004 triggered if object has no symbols.
3005
3006 2011-09-09 David S. Miller <davem@davemloft.net>
3007
3008 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3009 (Output_fill_debug_line::do_write): Likewise.
3010
3011 2011-08-29 Cary Coutant <ccoutant@google.com>
3012
3013 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3014 casts to match formatting specs.
3015 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3016
3017 2011-08-26 Cary Coutant <ccoutant@google.com>
3018
3019 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3020 remaining hole size when allocating.
3021 (Layout::make_output_section): Set fill methods for debug sections.
3022 * layout.h (Free_list::Free_list_node): Move from private to
3023 public.
3024 (Free_list::set_min_hole_size): New function.
3025 (Free_list::begin, Free_list::end): New functions.
3026 (Free_list::min_hole_): New data member.
3027 * output.cc: Include dwarf.h.
3028 (Output_fill_debug_info::do_minimum_hole_size): New function.
3029 (Output_fill_debug_info::do_write): New function.
3030 (Output_fill_debug_line::do_minimum_hole_size): New function.
3031 (Output_fill_debug_line::do_write): New function.
3032 (Output_section::Output_section): Initialize new data member.
3033 (Output_section::set_final_data_size): Ensure patch space is larger
3034 than minimum hole size.
3035 (Output_section::do_write): Fill holes in debug sections.
3036 * output.h (Output_fill): New class.
3037 (Output_fill_debug_info): New class.
3038 (Output_fill_debug_line): New class.
3039 (Output_section::set_free_space_fill): New function.
3040 (Output_section::free_space_fill_): New data member.
3041 * testsuite/Makefile.am (incremental_test_3): Add
3042 --incremental-patch option.
3043 (incremental_test_4): Likewise.
3044 (incremental_test_5): Likewise.
3045 (incremental_test_6): Likewise.
3046 (incremental_copy_test): Likewise.
3047 (incremental_common_test_1): Likewise.
3048 * testsuite/Makefile.in: Regenerate.
3049
3050 2011-08-26 Nick Clifton <nickc@redhat.com>
3051
3052 * po/es.po: Updated Spanish translation.
3053
3054 2011-08-01 Cary Coutant <ccoutant@google.com>
3055
3056 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3057 * gold/testsuite/Makefile.in: Regenerate.
3058 * gold/testsuite/justsyms_exec.c: New source file.
3059 * gold/testsuite/justsyms_lib.c: New source file.
3060
3061 2011-08-01 Cary Coutant <ccoutant@google.com>
3062
3063 * layout.cc (Layout::set_segment_offsets): Don't realign text
3064 segment if -Ttext was specified.
3065 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3066 file type.
3067 * object.h (Sized_relobj_file::e_type): New function.
3068 (Sized_relobj_file::e_type_): New data member.
3069 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3070 base address for ET_EXEC files.
3071 * target.cc (Target::do_make_elf_object_implementation): Allow
3072 ET_EXEC files with --just-symbols option.
3073
3074 2011-07-28 Cary Coutant <ccoutant@google.com>
3075
3076 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3077 Add thread_number parameter.
3078 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3079 * workqueue-threads.cc
3080 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3081 current thread if its thread number is greater than desired thread
3082 count.
3083 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3084 Add thread_number parameter.
3085 (Workqueue::should_cancel_thread): Likewise.
3086 (Workqueue::find_runnable_or_wait): Pass thread_number to
3087 should_cancel_thread.
3088 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3089 parameter.
3090
3091 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3092
3093 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3094 only after checking if it cannot be forced local.
3095 * symtab.h (is_externally_visible): Check if the symbol is not forced
3096 local.
3097
3098 2011-07-15 Ian Lance Taylor <iant@google.com>
3099
3100 * options.h (class General_options): Add --print-output-format.
3101 Move -EL next to -EB, for better --help output.
3102 * target-select.cc: Include <cstdio>, "options.h", and
3103 "parameters.h".
3104 (Target_selector::do_target_bfd_name): New function.
3105 (print_output_format): New function.
3106 * target-select.h (class Target_selector): Update declarations.
3107 (Target_selector::target_bfd_name): New function.
3108 (print_output_format): Declare.
3109 * main.cc: Include "target-select.h".
3110 (main): Handle --print-output-format.
3111 * gold.cc: Include "target-select.h".
3112 (queue_initial_tasks): Handle --print-output-format when there are
3113 no input files.
3114 * parameters.cc (parameters_force_valid_target): Give a better
3115 error message if -EB/-EL does not match target.
3116 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3117 function.
3118
3119 2011-07-15 Ian Lance Taylor <iant@google.com>
3120
3121 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3122 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3123 (Output_data_plt_i386::do_write): Write address of .dynamic
3124 section to first entry in .got.plt section.
3125 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3126 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3127 Initialize layout_.
3128 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3129 section to first entry in .got.plt section.
3130 * layout.h (Layout::dynamic_section): New function.
3131
3132 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3133
3134 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3135 to claim_file call.
3136 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3137 input_section_position_, and input_section_glob_.
3138 (read_layout_from_file): Call function section_ordering_specified.
3139 * layout.h (is_section_ordering_specified): New function.
3140 (section_ordering_specified): New function.
3141 (section_ordering_specified_): New boolean member.
3142 * main.cc(main): Call load_plugins after layout object is defined.
3143 * output.cc (Output_section::add_input_section): Use
3144 function section_ordering_specified to check if section ordering is
3145 needed.
3146 * output.cc (Output_section::add_relaxed_input_section): Use
3147 function section_ordering_specified to check if section ordering is
3148 needed.
3149 (Output_section::update_section_layout): New function.
3150 (Output_section::sort_attached_input_sections): Check if input section
3151 must be reordered.
3152 * output.h (Output_section::update_section_layout): New function.
3153 * plugin.cc (get_section_count): New function.
3154 (get_section_type): New function.
3155 (get_section_name): New function.
3156 (get_section_contents): New function.
3157 (update_section_order): New function.
3158 (allow_section_ordering): New function.
3159 (Plugin::load): Add the new interfaces to the transfer vector.
3160 (Plugin_manager::load_plugins): New parameter.
3161 (Plugin_manager::all_symbols_read): New parameter.
3162 (Plugin_manager::claim_file): New parameter. Save the elf object for
3163 unclaimed objects.
3164 (Plugin_manager::get_elf_object): New function.
3165 (Plugin_manager::get_view): Change to directly use the bool to check
3166 if get_view is called from claim_file_hook.
3167 * plugin.h (input_objects): New function
3168 (Plugin__manager::load_plugins): New parameter.
3169 (Plugin_manager::claim_file): New parameter.
3170 (Plugin_manager::get_elf_object): New function.
3171 (Plugin_manager::in_claim_file_handler): New function.
3172 (Plugin_manager::in_claim_file_handler_): New member.
3173 (layout): New function.
3174 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3175 handler with an extra parameter. Make the elf object before calling
3176 claim_file handler.
3177 * testsuite/plugin_test.c (get_section_count): New function pointer.
3178 (get_section_type): New function pointer.
3179 (get_section_name): New function pointer.
3180 (get_section_contents): New function pointer.
3181 (update_section_order): New function pointer.
3182 (allow_section_ordering): New function pointer.
3183 (onload): Check if the new interfaces exist.
3184
3185 2011-07-13 Ian Lance Taylor <iant@google.com>
3186
3187 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3188 relro section.
3189 * x86_64.cc (Target_x86_64::got_section): Likewise.
3190 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3191 (relro_now_test_SOURCES): New variable.
3192 (relro_now_test_DEPENDENCIES): New variable.
3193 (relro_now_test_LDFLAGS): New variable.
3194 (relro_now_test_LDADD): New variable.
3195 (relro_now_test.so): New target.
3196 * testsuite/Makefile.in: Rebuild.
3197
3198 2011-07-12 Ian Lance Taylor <iant@google.com>
3199
3200 PR gold/12980
3201 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3202 GLOB_DAT relocation rather than a RELATIVE relocation for a
3203 protected symbol when creating a shared library.
3204 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3205 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3206 * testsuite/protected_main_1.cc (main): Test that protected
3207 function has same address.
3208
3209 2011-07-11 Ian Lance Taylor <iant@google.com>
3210
3211 PR gold/12979
3212 * options.h (class General_options): Add -Bgroup.
3213 * options.cc (General_options::finalize): If -Bgroup is set,
3214 default to --unresolved-symbols=report-all.
3215 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3216 * target-reloc.h (issue_undefined_symbol_error): Handle
3217 --unresolved-symbols=report-all.
3218
3219 2011-07-08 Ian Lance Taylor <iant@google.com>
3220
3221 PR gold/11985
3222 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3223 if linker script discards key sections.
3224 (Layout::create_dynamic_symtab): Likewise.
3225 (Layout::assign_local_dynsym_offsets): Likewise.
3226 (Layout::sized_create_version_sections): Likewise.
3227 (Layout::create_interp): Likewise.
3228 (Layout::finish_dynamic_section): Likewise.
3229 (Layout::set_dynamic_symbol_size): Likewise.
3230
3231 2011-07-08 Ian Lance Taylor <iant@google.com>
3232
3233 PR gold/12386
3234 * options.h (class General_options): Add --unresolved-symbols.
3235 * target-reloc.h (issue_undefined_symbol_error): Check
3236 --unresolved-symbols. Add comments.
3237
3238 2011-07-08 Ian Lance Taylor <iant@google.com>
3239
3240 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3241 expression more complex.
3242
3243 2011-07-08 Ian Lance Taylor <iant@google.com>
3244
3245 PR gold/11317
3246 * target-reloc.h (issue_undefined_symbol_error): New inline
3247 function, broken out of relocate_section.
3248 (relocate_section): Call issue_undefined_symbol_error.
3249 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3250 there is no TLS segment if we are about to issue an undefined
3251 symbol error.
3252 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3253
3254 2011-07-08 Ian Lance Taylor <iant@google.com>
3255
3256 PR gold/12279
3257 * resolve.cc (Symbol_table::should_override): Add fromtype
3258 parameter. Change all callers. Give error when linking together
3259 TLS and non-TLS symbol.
3260 (Symbol_table::should_override_with_special): Add fromtype
3261 parameter. Change all callers.
3262 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3263 there is no TLS segment if we have reported some errors.
3264 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3265
3266 2011-07-08 Ian Lance Taylor <iant@google.com>
3267
3268 PR gold/12372
3269 * target.h (Target::plt_address_for_global): New function.
3270 (Target::plt_address_for_local): New function.
3271 (Target::plt_section_for_global): Remove.
3272 (Target::plt_section_for_local): Remove.
3273 (Target::do_plt_address_for_global): New virtual function.
3274 (Target::do_plt_address_for_local): New virtual function.
3275 (Target::do_plt_section_for_global): Remove.
3276 (Target::do_plt_section_for_local): Remove.
3277 (Target::register_global_plt_entry): Add Symbol_table and Layout
3278 parameters.
3279 * output.cc (Output_data_got::Got_entry::write): Use
3280 plt_address_for_global and plt_address_for_local.
3281 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3282 address of output section.
3283 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3284 got_irelative_, and irelative_count_ fields. Update
3285 declarations.
3286 (Output_data_plt_i386::has_irelative_section): New function.
3287 (Output_data_plt_i386::entry_count): Add irelative_count_.
3288 (Output_data_plt_i386::set_final_data_size): Likewise.
3289 (class Target_i386): Add got_irelative_ and rel_irelative_
3290 fields. Update declarations.
3291 (Target_i386::Target_i386): Initialize new fields.
3292 (Target_i386::do_plt_address_for_global): New function replacing
3293 do_plt_section_for_global.
3294 (Target_i386::do_plt_address_for_local): New function replacing
3295 do_plt_section_for_local.
3296 (Target_i386::got_section): Create got_irelative_.
3297 (Target_i386::rel_irelative_section): New function.
3298 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3299 fields. Don't define __rel_iplt_{start,end}.
3300 (Output_data_plt_i386::add_entry): Add symtab and layout
3301 parameters. Change all callers. Use different PLT and GOT for
3302 IFUNC symbols.
3303 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3304 layout parameters. Change all callers. Use different PLT and
3305 GOT.
3306 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3307 (Output_data_plt_i386::rel_irelative): New function.
3308 (Output_data_plt_i386::address_for_global): New function.
3309 (Output_data_plt_i386::address_for_local): New function.
3310 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3311 IRELATIVE GOT when changing IFUNC GOT entries.
3312 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3313 reloc.
3314 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3315 if we didn't create an IRELATIVE GOT.
3316 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3317 plt_address_for_local.
3318 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3319 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3320 got_irelative_, and irelative_count_ fields. Update
3321 declarations.
3322 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3323 Initialize new fields. Remove symtab parameter. Change all
3324 callers.
3325 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3326 irelative_count_.
3327 (Output_data_plt_x86_64::has_irelative_section): New function.
3328 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3329 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3330 fields. Update declarations.
3331 (Target_x86_64::Target_x86_64): Initialize new fields.
3332 (Target_x86_64::do_plt_address_for_global): New function replacing
3333 do_plt_section_for_global.
3334 (Target_x86_64::do_plt_address_for_local): New function replacing
3335 do_plt_section_for_local.
3336 (Target_x86_64::got_section): Create got_irelative_.
3337 (Target_x86_64::rela_irelative_section): New function.
3338 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3339 all callers. Don't create __rel_iplt_{start,end}.
3340 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3341 parameters. Change all callers. Use different PLT and GOT for
3342 IFUNC symbols.
3343 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3344 layout parameters. Change all callers. Use different PLT and
3345 GOT.
3346 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3347 parameters. Change all callers. Use different PLT and GOT for
3348 IFUNC symbols.
3349 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3350 (Output_data_plt_x86_64::rela_irelative): New function.
3351 (Output_data_plt_x86_64::address_for_global): New function.
3352 (Output_data_plt_x86_64::address_for_local): New function.
3353 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3354 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3355 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3356 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3357 parameters.
3358 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3359 reloc.
3360 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3361 symbols if we didn't create an IRELATIVE GOT.
3362 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3363 plt_address_for_local.
3364 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3365 * testsuite/ifuncvar1.c: New test file.
3366 * testsuite/ifuncvar2.c: New test file.
3367 * testsuite/ifuncvar3.c: New test file.
3368 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3369 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3370 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3371 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3372 * testsuite/Makefile.in: Rebuild.
3373
3374 2011-07-07 Cary Coutant <ccoutant@google.com>
3375
3376 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3377 (two_file_test_1_ndebug.o): Likewise.
3378 (two_file_test_1b_ndebug.o): Likewise.
3379 (two_file_test_2_ndebug.o): Likewise.
3380 (two_file_test_main_ndebug.o): Likewise.
3381 (incremental_test_2): Link with no-debug versions.
3382
3383 2011-07-06 Cary Coutant <ccoutant@google.com>
3384
3385 * gold/incremental.cc
3386 (Output_section_incremental_inputs::write_info_blocks): Check for
3387 hidden and internal symbols.
3388
3389 2011-07-06 Cary Coutant <ccoutant@google.com>
3390
3391 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3392 Check disposition for startup file.
3393 (Incremental_inputs::report_command_line): Ignore
3394 --incremental-startup-unchanged option.
3395 * options.cc (General_options::parse_incremental_startup_unchanged):
3396 New function.
3397 (General_options::General_options): Initialize new data member.
3398 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3399 (General_options): Add --incremental-startup-unchanged option.
3400 (General_options::incremental_startup_disposition): New function.
3401 (General_options::incremental_startup_disposition_): New data member.
3402
3403 2011-07-06 Cary Coutant <ccoutant@google.com>
3404
3405 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3406 input file index to Script_info ctor.
3407 (Sized_incremental_binary::do_file_has_changed): Find the
3408 command-line argument for files named in scripts.
3409 * incremental.h (Script_info::Script_info): New ctor
3410 with input file index.
3411 (Script_info::input_file_index): New function.
3412 (Script_info::input_file_index_): New data member.
3413 (Incremental_binary::get_library): Add const.
3414 (Incremental_binary::get_script_info): Add const.
3415 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3416 * testsuite/Makefile.am (incremental_test_5): New test case.
3417 (incremental_test_6): New test case.
3418 * testsuite/Makefile.in: Regenerate.
3419
3420 2011-07-06 Cary Coutant <ccoutant@google.com>
3421
3422 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3423 debug output when command lines differ.
3424
3425 2011-07-06 Cary Coutant <ccoutant@google.com>
3426
3427 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3428 --incremental-patch option.
3429 * layout.cc (Free_list::allocate): Extend allocation beyond original
3430 end if enabled.
3431 (Layout::make_output_section): Mark sections that should get
3432 patch space.
3433 * options.cc (parse_percent): New function.
3434 * options.h (parse_percent): New function.
3435 (DEFINE_percent): New macro.
3436 (General_options): Add --incremental-patch option.
3437 * output.cc (Output_section::Output_section): Initialize new data
3438 members.
3439 (Output_section::add_input_section): Print section name when out
3440 of patch space.
3441 (Output_section::add_output_section_data): Likewise.
3442 (Output_section::set_final_data_size): Add patch space when
3443 doing --incremental-full.
3444 (Output_section::do_reset_address_and_file_offset): Remove patch
3445 space.
3446 (Output_segment::set_section_list_addresses): Print debug output
3447 only if --incremental-update.
3448 * output.h (Output_section::set_is_patch_space_allowed): New function.
3449 (Output_section::is_patch_space_allowed_): New data member.
3450 (Output_section::patch_space_): New data member.
3451 * parameters.cc (Parameters::incremental_full): New function.
3452 * parameters.h (Parameters::incremental_full): New function
3453 * testsuite/Makefile.am (incremental_test_2): Add test for
3454 --incremental-patch option.
3455 * testsuite/Makefile.in: Regenerate.
3456 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3457 (t18): Remove function body.
3458
3459 2011-07-05 Doug Kwan <dougkwan@google.com>
3460
3461 PR gold/12771
3462 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3463 Arm_Address type for relocation result.
3464 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3465 overflow check.
3466 (Arm_relocate_functions::abs32): Use unaligned access.
3467 (Arm_relocate_functions::rel32): Ditto.
3468 (Arm_relocate_functions::prel31): Ditto.
3469 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3470 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3471 static data relocations.
3472 * testsuite/Makefile.in: Regnerate.
3473 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3474
3475 2011-07-05 Ian Lance Taylor <iant@google.com>
3476
3477 PR gold/12392
3478 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3479 symbols if necessary.
3480 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3481
3482 2011-07-05 Ian Lance Taylor <iant@google.com>
3483
3484 PR gold/12952
3485 * resolve.cc (Symbol::override_base_with_special): Simply override
3486 version with special symbol version, ignoring previous version.
3487
3488 2011-07-05 Ian Lance Taylor <iant@google.com>
3489
3490 * object.cc (Sized_relobj_file::include_section_group): Add
3491 information to comment about signature location.
3492
3493 2011-07-02 Ian Lance Taylor <iant@google.com>
3494
3495 PR gold/12957
3496 * options.h (class General_options): Add -f and -F.
3497 * options.cc (General_options::finalize): Fatal error if -f/-F
3498 are used without -shared.
3499 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3500
3501 2011-07-02 Ian Lance Taylor <iant@google.com>
3502
3503 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3504
3505 2011-07-01 Ian Lance Taylor <iant@google.com>
3506
3507 PR gold/12525
3508 PR gold/12952
3509 * resolve.cc (Symbol::override_base_with_special): Don't override
3510 the version if the overriding symbol has a different name.
3511 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3512 all callers. If we give an error about an undefined version,
3513 define the base version if necessary.
3514 * dynobj.h (class Versions): Update declaration.
3515 * testsuite/weak_alias_test_5.cc: New file.
3516 * testsuite/weak_alias_test.script: New file.
3517 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3518 and versioned_alias have the right value, and call t2.
3519 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3520 weak_alias_test_5.so.
3521 (weak_alias_test_LDADD): Likewise.
3522 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3523 * testsuite/Makefile.in: Rebuild.
3524
3525 2011-07-01 Ian Lance Taylor <iant@google.com>
3526
3527 PR gold/12525
3528 * options.h (class General_options): Support -z notext.
3529 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3530 -Wl,-z,notext.
3531 (two_file_shared_nonpic.so): Likewise.
3532 (two_file_shared_mixed.so): Likewise.
3533 (two_file_shared_mixed_1.so): Likewise.
3534 (weak_undef_lib_nonpic.so): Likewise.
3535 (alt/weak_undef_lib_nonpic.so): Likewise.
3536 (tls_test_shared_nonpic.so): Likewise.
3537 * testsuite/Makefile.in: Rebuild.
3538
3539 2011-07-01 Ian Lance Taylor <iant@google.com>
3540
3541 PR gold/12525
3542 * configure.ac: Test whether static linking works, setting
3543 the automake conditional HAVE_STATIC.
3544 * testsuite/Makefile.am: Disable tests using -static if
3545 HAVE_STATIC is not true.
3546 * configure, testsuite/Makefile.in: Rebuild.
3547
3548 2011-07-01 Ian Lance Taylor <iant@google.com>
3549
3550 PR gold/12525
3551 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3552 Assert if we see DW_EH_PE_indirect.
3553 * target.h (Target::ehframe_datarel_base): New function.
3554 (Target::do_ehframe_datarel_base): New target function.
3555 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3556 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3557 function.
3558
3559 2011-07-01 Ian Lance Taylor <iant@google.com>
3560
3561 PR gold/12571
3562 * options.h (class General_options): Add
3563 --ld-generated-unwind-info.
3564 * ehframe.cc (Fde::write): Add address parameter. Change all
3565 callers. If associated with PLT, fill in address and size.
3566 (Cie::set_output_offset): Only add merge mapping if there is an
3567 object.
3568 (Cie::write): Add address parameter. Change all callers.
3569 (Eh_frame::add_ehframe_for_plt): New function.
3570 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3571 input_offset_ fields into union u_, with new plt field.
3572 (Fde::Fde): Adjust for new union field.
3573 (Fde::Fde) [Output_data version]: New constructor.
3574 (Fde::add_mapping): Only add merge mapping if there is an object.
3575 (class Cie): Update declarations.
3576 (class Eh_frame): Declare add_ehframe_for_plt.
3577 * layout.cc (Layout::layout_eh_frame): Break out code into
3578 make_eh_frame_section, and call it.
3579 (Layout::make_eh_frame_section): New function.
3580 (Layout::add_eh_frame_for_plt): New function.
3581 * layout.h (class Layout): Update declarations.
3582 * merge.cc (Merge_map::add_mapping): Add assertion.
3583 * i386.cc: Include "dwarf.h".
3584 (class Output_data_plt_i386): Make first_plt_entry,
3585 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3586 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3587 and plt_eh_frame_fde.
3588 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3589 boundary. Call add_eh_frame_for_plt if appropriate.
3590 * x86_64.cc: Include "dwarf.h".
3591 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3592 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3593 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3594 and plt_eh_frame_fde.
3595 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3596 appropriate.
3597
3598 2011-06-29 Ian Lance Taylor <iant@google.com>
3599
3600 PR gold/12629
3601 * object.cc (Sized_relobj_file::layout_section): Change shdr
3602 parameter to be const.
3603 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3604 out of do_layout.
3605 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3606 appropriate. Call layout_eh_frame_section.
3607 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3608 sections.
3609 * object.h (class Sized_relobj_file): Update declarations.
3610
3611 2011-06-29 Ian Lance Taylor <iant@google.com>
3612
3613 PR gold/12652
3614 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3615 modifier.
3616 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3617
3618 2011-06-29 Ian Lance Taylor <iant@google.com>
3619
3620 PR gold/12675
3621 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3622 SHT_X86_64_UNWIND.
3623 * layout.cc (Layout::layout_eh_frame): Likewise.
3624
3625 2011-06-29 Ian Lance Taylor <iant@google.com>
3626
3627 PR gold/12695
3628 * layout.cc (Layout::symtab_section_shndx): New function.
3629 * layout.h (class Layout): Declare symtab_section_shndx.
3630 * output.cc (Output_section::write_header): Call it.
3631
3632 2011-06-29 Ian Lance Taylor <iant@google.com>
3633
3634 PR gold/12818
3635 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3636 symbols which are not used in a relocation.
3637
3638 2011-06-28 Ian Lance Taylor <iant@google.com>
3639
3640 PR gold/12898
3641 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3642 script create indistinguishable segments.
3643 (Layout::set_segment_offsets): Use stable_sort when sorting
3644 segments. Pass this to Compare_segments constructor.
3645 * layout.h (class Layout): Make segment_precedes non-static.
3646 (class Compare_segments): Change from struct to class. Add
3647 layout_ field. Add constructor.
3648 * script-sections.cc
3649 (Script_sections::attach_sections_using_phdrs_clause): Rename
3650 local orphan to is_orphan. Don't report failure to put empty
3651 section in segment. On attachment failure, report name of
3652 section, and attach to first PT_LOAD segment.
3653
3654 2011-06-28 Ian Lance Taylor <iant@google.com>
3655
3656 PR gold/12934
3657 * target-select.cc (Target_selector::Target_selector): Add
3658 emulation parameter. Change all callers.
3659 (select_target_by_bfd_name): Rename from select_target_by_name.
3660 Change all callers.
3661 (select_target_by_emulation): New function.
3662 (supported_emulation_names): New function.
3663 * target-select.h (class Target_selector): Add emulation_ field.
3664 Update declarations.
3665 (Target_selector::recognize_by_bfd_name): Rename from
3666 recognize_by_name. Change all callers.
3667 (Target_selector::supported_bfd_names): Rename from
3668 supported_names. Change all callers.
3669 (Target_selector::recognize_by_emulation): New function.
3670 (Target_selector::supported_emulations): New function.
3671 (Target_selector::emulation): New function.
3672 (Target_selector::do_recognize_by_bfd_name): Rename from
3673 do_recognize_by_name. Change all callers.
3674 (Target_selector::do_supported_bfd_names): Rename from
3675 do_supported_names. Change all callers.
3676 (Target_selector::do_recognize_by_emulation): New function.
3677 (Target_selector::do_supported_emulations): New function.
3678 (select_target_by_bfd_name): Change name in declaration.
3679 (select_target_by_emulation): Declare.
3680 (supported_emulation_names): Declare.
3681 * parameters.cc (parameters_force_valid_target): Try to find
3682 target based on emulation from -m option.
3683 * options.h (class General_options): Change doc string for -m.
3684 * options.cc (help): Print emulations.
3685 (General_options::parse_V): Likewise.
3686 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3687 Add emulation parameter. Change all callers.
3688
3689 2011-06-28 Ian Lance Taylor <iant@google.com>
3690
3691 * target.h (class Target): Add osabi_ field.
3692 (Target::osabi): New function.
3693 (Target::set_osabi): New function.
3694 (Target::Target): Initialize osabi_.
3695 (Target::do_adjust_elf_header): Make pure virtual.
3696 (Sized_target::do_adjust_elf_header): Declare.
3697 * target.cc (Sized_target::do_adjust_elf_header): New function.
3698 (class Sized_target): Instantiate all versions.
3699 * freebsd.h (class Target_freebsd): Remove.
3700 (Target_selector_freebsd::do_recognize): Call set_osabi on
3701 Target.
3702 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3703 (Target_selector_freebsd::set_osabi): Remove.
3704 * i386.cc (class Target_i386): Inherit from Sized_target rather
3705 than Target_freebsd.
3706 * x86_64.cc (class Target_x86_64): Likewise.
3707
3708 2011-06-28 Ian Lance Taylor <iant@google.com>
3709
3710 * target.h (Target::can_check_for_function_pointers): Rewrite.
3711 Make non-virtual.
3712 (Target::can_icf_inline_merge_sections): Likewise.
3713 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3714 (Target::Target_info): Add can_icf_inline_merge_sections field.
3715 (Target::do_can_check_for_function_pointers): New virtual
3716 function.
3717 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3718 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3719 from can_check_for_function_pointers, move in file.
3720 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3721 section_may_have_icf_unsafe_poineters, move in file.
3722 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3723 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3724 Rename from can_check_for_function_pointers, move in file.
3725 (Target_i386::can_icf_inline_merge_sections): Remove.
3726 (Target_i386::i386_info): Initialize
3727 can_icf_inline_merge_sections.
3728 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3729 Initialize can_icf_inline_merge_sections.
3730 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3731 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3732 Rename from can_check_for_function_pointers, move in file.
3733 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3734 (Target_x86_64::x86_64_info): Initialize
3735 can_icf_inline_merge_sections.
3736 * testsuite/testfile.cc (Target_test::test_target_info):
3737 Likewise.
3738 * icf.cc (get_section_contents): Correct formatting.
3739
3740 2011-06-27 Ian Lance Taylor <iant@google.com>
3741
3742 * symtab.cc (Symbol::versioned_name): New function.
3743 (Symbol_table::add_to_final_symtab): Use versioned_name when
3744 appropriate.
3745 (Symbol_table::sized_write_symbol): Likewise.
3746 * symtab.h (class Symbol): Declare versioned_name.
3747 * stringpool.h (class Stringpool_template): Add variant of add
3748 which takes a std::basic_string.
3749 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3750 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3751 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3752 (ver_test_12.o): New target.
3753 * testsuite/Makefile.in: Rebuild.
3754
3755 2011-06-27 Doug Kwan <dougkwan@google.com>
3756
3757 * arm.cc (Arm_relocate_functions::thm_jump8,
3758 Arm_relocate_functions::thm_jump11): Use a wider signed
3759 type to compute offset.
3760 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3761 arm_thm_jump8.
3762 * testsuite/Makefile.in: Regenerate.
3763 * testsuite/arm_branch_in_range.sh: Check test results of
3764 arm_thm_jump11 and arm_thm_jump8.
3765 * testsuite/arm_thm_jump11.s: New test source file.
3766 * testsuite/arm_thm_jump11.t: New linker script.
3767 * testsuite/arm_thm_jump8.s: New test source file.
3768 * testsuite/arm_thm_jump8.t: New linker script.
3769
3770 2011-06-24 Ian Lance Taylor <iant@google.com>
3771
3772 * layout.cc: Include "object.h".
3773 (ctors_sections_in_init_array): New static variable.
3774 (Layout::is_ctors_in_init_array): New function.
3775 (Layout::layout): Add entry to ctors_sections_in_init_array if
3776 appropriate.
3777 * layout.h (class Layout): Declare is_ctors_in_init_array.
3778 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3779 is_ctors_reverse_view is set.
3780 (Sized_relobj_file::write_sections): Add layout parameter. Change
3781 all callers. Set is_ctors_reverse_view field of View_size.
3782 (Sized_relobj_file::reverse_words): New function.
3783 * object.h (Sized_relobj_file::View_size): Add
3784 is_ctors_reverse_view field.
3785 (class Sized_relobj_file): Update declarations.
3786 * testsuite/initpri3.c: New test.
3787 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3788 initpri3b.
3789 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3790 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3791 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3792 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3793 * testsuite/Makefile.in: Rebuild.
3794
3795 2011-06-24 Cary Coutant <ccoutant@google.com>
3796
3797 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3798 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3799 (debug_msg_cdebug.err): New targets.
3800 * testsuite/Makefile.in: Regenerate.
3801 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3802 Fix checks for link with shared library.
3803
3804 2011-06-24 Doug Kwan <dougkwan@google.com>
3805
3806 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3807 skip empty text sections.
3808 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3809
3810 2011-06-22 Ian Lance Taylor <iant@google.com>
3811
3812 PR gold/12910
3813 * options.h (class General_options): Add --ctors-in-init-array.
3814 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3815 friends as SHT_PROGBITS for merging sections.
3816 (Layout::layout): Remove special handling of .init_array and
3817 friends. Don't sort if doing relocatable link. Sort for .ctors
3818 and .dtors if ctors_in_init_array.
3819 (Layout::make_output_section): Force correct section types for
3820 .init_array and friends. Don't sort if doing relocatable link,
3821 Don't sort .ctors and .dtors if ctors_in_init_array.
3822 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3823 (Layout::output_section_name): Add relobj parameter. Change all
3824 callers. Handle .ctors. and .dtors. in code rather than table.
3825 Handle .ctors and .dtors if ctors_in_init_array.
3826 (Layout::match_file_name): New function, moved from output.cc.
3827 * layout.h (class Layout): Update declarations.
3828 * output.cc: Include "layout.h".
3829 (Input_section_sort_entry::get_priority): New function.
3830 (Input_section_sort_entry::match_file_name): Just call
3831 Layout::match_file_name.
3832 (Output_section::Input_section_sort_init_fini_compare::operator()):
3833 Handle .ctors and .dtors. Sort by explicit priority rather than
3834 by name.
3835 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3836 * testsuite/initpri2.c: New test.
3837 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3838 (check_PROGRAMS): Add initpri2.
3839 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3840 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3841 * configure, testsuite/Makefile.in: Rebuild.
3842
3843 2011-06-19 Ian Lance Taylor <iant@google.com>
3844
3845 PR gold/12880
3846 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3847 .interp section to a PT_INTERP segment even if we have seen a
3848 --dynamic-linker option. Don't do it if we have seen a PHDRS
3849 clause in a linker script.
3850 (Layout::finalize): Don't create a .interp section if we've
3851 already create a PT_INTERP segment.
3852 (Layout::create_interp): Always call choose_output_section (revert
3853 patch of 2011-06-17). Don't create PT_INTERP segment.
3854 * script-sections.cc
3855 (Script_sections::create_note_and_tls_segments): Add a .interp
3856 section to a PT_INTERP segment even if we have seen a
3857 --dynamic-linker option.
3858
3859 2011-06-18 Ian Lance Taylor <iant@google.com>
3860
3861 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3862 merely because a non-PT_LOAD segment has a dynamic reloc.
3863
3864 2011-06-18 Ian Lance Taylor <iant@google.com>
3865
3866 * layout.cc (Layout::finish_dynamic_section): Don't create
3867 DT_FLAGS entry if not needed.
3868
3869 2011-06-18 Ian Lance Taylor <iant@google.com>
3870
3871 PR gold/12745
3872 * layout.cc (Layout::layout_eh_frame): Correct handling of
3873 writable .eh_frame section.
3874
3875 2011-06-17 Ian Lance Taylor <iant@google.com>
3876
3877 PR gold/12893
3878 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3879 symbol is redefined with the exact same object and value.
3880
3881 2011-06-17 Ian Lance Taylor <iant@google.com>
3882
3883 PR gold/12880
3884 * layout.h (class Layout): Add interp_segment_ field.
3885 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3886 (Layout::attach_allocated_section_to_segment): If making shared
3887 library, put .interp section in PT_INTERP segment.
3888 (Layout::finalize): Also call create_interp if -dynamic-linker
3889 option was used.
3890 (Layout::create_interp): Assert that there is no PT_INTERP
3891 segment. If not using a SECTIONS clause, use make_output_section.
3892 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3893 * script-sections.cc
3894 (Script_sections::create_note_and_tls_segments): If making shared
3895 library, put .interp section in PT_INTERP segment.
3896
3897 2011-06-17 Ian Lance Taylor <iant@google.com>
3898
3899 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3900 when making a shared library.
3901
3902 2011-06-17 Ian Lance Taylor <iant@google.com>
3903
3904 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3905 parameter. Change all callers. Don't issue warning about PC32
3906 against locally defined symbol.
3907
3908 2011-06-16 Ian Lance Taylor <iant@google.com>
3909
3910 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3911 occurs in same object.
3912
3913 2011-06-14 Alan Modra <amodra@gmail.com>
3914
3915 * po/POTFILES.in: Regenerate.
3916
3917 2011-06-09 Ian Lance Taylor <iant@google.com>
3918
3919 * script-sections.cc
3920 (Orphan_output_section::set_section_addresses): For a relocatable
3921 link set address to 0.
3922
3923 2011-06-09 Cary Coutant <ccoutant@google.com>
3924
3925 PR gold/12804
3926 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3927 used with --compress-debug-sections.
3928 * gold/object.cc (Sized_relobj_file::do_layout): Report
3929 uncompressed size of compressed input sections.
3930
3931 2011-06-08 Cary Coutant <ccoutant@google.com>
3932
3933 PR gold/12804
3934 * testsuite/two_file_test_2_v1.cc: Change initialization of
3935 v2 to keep it in .data.
3936
3937 2011-06-07 Cary Coutant <ccoutant@google.com>
3938
3939 * common.cc (Symbol_table::do_allocate_commons_list): Call
3940 gold_fallback.
3941 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3942 (Errors::fallback): New function.
3943 (gold_fallback): New function.
3944 * errors.h (Errors::fallback): New function.
3945 * gold.cc (gold_exit): Change status parameter to enum; adjust
3946 all callers.
3947 (queue_initial_tasks): Call gold_fallback.
3948 * gold.h: Include cstdlib.
3949 (Exit_status): New enum type.
3950 (gold_exit): Change status parameter to enum.
3951 (gold_fallback): New function.
3952 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3953 (Layout::create_symtab_sections): Likewise.
3954 (Layout::create_shdrs): Likewise.
3955 * main.cc (main): Adjust call to gold_exit.
3956 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3957 (Output_data_got::add_got_entry_pair): Likewise.
3958 (Output_section::add_input_section): Likewise.
3959 (Output_section::add_output_section_data): Likewise.
3960 (Output_segment::set_section_list_addresses): Likewise.
3961 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3962
3963 2011-06-07 Cary Coutant <ccoutant@google.com>
3964
3965 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3966 for incremental links.
3967 * output.cc (Output_segment::set_section_list_addresses): Remove
3968 FIXME and test for TLS or BSS.
3969
3970 2011-06-07 Cary Coutant <ccoutant@google.com>
3971
3972 * testsuite/Makefile.am: Add incremental_copy_test,
3973 incremental_common_test_1.
3974 * testsuite/Makefile.in: Regenerate.
3975 * testsuite/common_test_1_v1.c: New source file.
3976 * testsuite/common_test_1_v2.c: New source file.
3977 * testsuite/copy_test_v1.cc: New source file.
3978
3979 2011-06-07 Cary Coutant <ccoutant@google.com>
3980
3981 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3982 update, allocate common from bss section's free list.
3983 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3984 linker-defined symbols.
3985 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3986 Skip GOT and PLT entries that are no longer referenced.
3987 (Output_section_incremental_inputs::write_info_blocks): Mark
3988 linker-defined symbols.
3989 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3990 * output.cc (Output_section::allocate): New function.
3991 * output.h (Output_section::allocate): New function.
3992 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3993 linker-defined symbols.
3994 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3995 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3996 (Symbol::init_base_output_data): Likewise.
3997 (Symbol::init_base_output_segment): Likewise.
3998 (Symbol::init_base_constant): Likewise.
3999 (Sized_symbol::init_output_data): Likewise.
4000 (Sized_symbol::init_output_segment): Likewise.
4001 (Sized_symbol::init_constant): Likewise.
4002 (Symbol_table::do_define_in_output_data): Likewise.
4003 (Symbol_table::do_define_in_output_segment): Likewise.
4004 (Symbol_table::do_define_as_constant): Likewise.
4005 * symtab.h (Symbol::is_predefined): New function.
4006 (Symbol::init_base_output_data): Add is_predefined parameter.
4007 (Symbol::init_base_output_segment): Likewise.
4008 (Symbol::init_base_constant): Likewise.
4009 (Symbol::is_predefined_): New data member.
4010 (Sized_symbol::init_output_data): Add is_predefined parameter.
4011 (Sized_symbol::init_output_segment): Likewise.
4012 (Sized_symbol::init_constant): Likewise.
4013 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4014
4015 2011-06-07 Cary Coutant <ccoutant@google.com>
4016
4017 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4018 instead of emit_copy_reloc.
4019 (Copy_relocs::emit_copy_reloc): Refactor.
4020 (Copy_relocs::make_copy_reloc): New function.
4021 (Copy_relocs::add_copy_reloc): Remove.
4022 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4023 section.
4024 (Copy_relocs::make_copy_reloc): New function.
4025 (Copy_relocs::add_copy_reloc): Remove.
4026 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4027 unchanged input files.
4028 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4029 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4030 Reserve BSS space for COPY relocations.
4031 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4032 (Output_section_incremental_inputs::write_info_blocks): Record
4033 whether a symbol is copied from a shared object.
4034 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4035 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4036 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4037 (Incremental_input_entry_reader::get_output_symbol_index): Add
4038 is_copy parameter.
4039 (Incremental_binary::emit_copy_relocs): New function.
4040 (Incremental_binary::do_emit_copy_relocs): New function.
4041 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4042 new data member.
4043 (Sized_incremental_binary::add_copy_reloc): New function.
4044 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4045 (Sized_incremental_binary::Copy_reloc): New struct.
4046 (Sized_incremental_binary::Copy_relocs): New typedef.
4047 (Sized_incremental_binary::copy_relocs_): New data member.
4048 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4049 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4050 * target.h (Sized_target::emit_copy_reloc): New function.
4051 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4052
4053 2011-06-02 Cary Coutant <ccoutant@google.com>
4054
4055 PR gold/12163
4056 * gold/archive.cc (Archive::Archive): Initialize new data member.
4057 (Archive::include_all_members): Return if archive has already been
4058 included.
4059 * gold/archive.h (Archive::include_all_members_): New data member.
4060
4061 2011-06-02 Nick Clifton <nickc@redhat.com>
4062
4063 * dynobj.h: Fix spelling mistake in comment.
4064 * output.cc: Likewise.
4065
4066 2011-05-31 Doug Kwan <dougkwan@google.com>
4067 Asier Llano
4068
4069 PR gold/12826
4070 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4071 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4072 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4073 redundant arm_exidx_test.so.
4074 * testsuite/Makefile.in: Regenerate.
4075 (check_SCRIPTS): Add pr12826.sh
4076 (check_DATA): Add pr12826.stdout
4077 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4078 * testsuite/pr12826.sh: New file.
4079 * testsuite/pr12826_1.s: Ditto.
4080 * testsuite/pr12826_1.s: Ditto.
4081
4082 2011-05-30 Ian Lance Taylor <iant@google.com>
4083
4084 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4085 sections.
4086
4087 2011-05-29 Ian Lance Taylor <iant@google.com>
4088
4089 PR gold/12804
4090 * testsuite/Makefile.am: Use different file name for two_file_test
4091 temporary file for each incremental test.
4092 * testsuite/Makefile.in: Rebuild.
4093
4094 2011-05-29 Ian Lance Taylor <iant@google.com>
4095
4096 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4097 binary input file is empty.
4098
4099 2011-05-27 Ian Lance Taylor <iant@google.com>
4100
4101 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4102 (ver_test_9.so): Likewise.
4103 * testsuite/Makefile.in: Rebuild.
4104
4105 2011-05-26 Cary Coutant <ccoutant@google.com>
4106
4107 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4108 * incremental.cc (Incremental_inputs::report_input_section): Fix
4109 comment, indentation.
4110 (Incremental_inputs::report_comdat_group): New function.
4111 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4112 of data for incremental input file entry.
4113 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4114 group count, COMDAT group signatures.
4115 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4116 an unchanged input file.
4117 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4118 Initialize new data member.
4119 (Incremental_object_entry::add_comdat_group): New function.
4120 (Incremental_object_entry::get_comdat_group_count): New function.
4121 (Incremental_object_entry::get_comdat_signature_key): New function.
4122 (Incremental_object_entry::groups_): New data member.
4123 (Incremental_inputs::report_comdat_group): New function.
4124 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4125 data for incremental input file entry.
4126 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4127 (Incremental_input_entry_reader::get_input_section): Adjust size of
4128 data for incremental input file entry.
4129 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4130 (Incremental_input_entry_reader::get_comdat_group_signature): New
4131 function.
4132 * object.cc (Sized_relobj::include_section_group): Report kept
4133 COMDAT groups for incremental links.
4134
4135 2011-05-24 David Meyer <pdox@google.com>
4136
4137 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4138 with name parameter. Add found_name parameter.
4139 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4140 * dirsearch.h (class Dirsearch): Update declaration.
4141
4142 2011-05-24 Ian Lance Taylor <iant@google.com>
4143
4144 * archive.cc (Library_base::should_include_member): Pull in object
4145 from archive if it defines the entry symbol.
4146 * parameters.cc (Parameters::entry): New function.
4147 * parameters.h (class Parameters): Declare entry.
4148 * output.h (class Output_file_header): Remove entry_ field.
4149 * output.cc (Output_file_header::Output_file_header): Remove entry
4150 parameter. Change all callers.
4151 (Output_file_header::entry): Use parameters->entry.
4152 * gold.cc (queue_middle_tasks): Likewise.
4153 * plugin.cc (Plugin_hook::run): Likewise.
4154
4155 2011-05-24 Cary Coutant <ccoutant@google.com>
4156
4157 * gold.cc (queue_initial_tasks): Pass incremental base filename
4158 to Output_file::open_base_file; don't print error message.
4159 * incremental-dump.cc (main): Adjust call to
4160 Output_file::open_for_modification.
4161 * incremental-dump.cc (main): Likewise.
4162 * incremental.cc (Incremental_inputs::report_command_line):
4163 Ignore --incremental-base option when comparing command lines.
4164 Ignore parameter when given as separate argument.
4165 * options.h (class General_options): Add --incremental-base.
4166 * output.cc (Output_file::Output_file):
4167 (Output_file::open_base_file): Add base_name and writable parameters;
4168 read base file into new file; print error message here.
4169 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4170 callers.
4171 * output.h (Output_file::open_for_modification): Rename to...
4172 (Output_file::open_base_file): ...this; add base_name and
4173 writable parameters; adjust all callers.
4174 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4175 callers.
4176 * testsuite/Makefile.am (incremental_test_4): Test
4177 --incremental-base.
4178 * testsuite/Makefile.in: Regenerate.
4179
4180 2011-05-24 Cary Coutant <ccoutant@google.com>
4181
4182 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4183 incremental_test_4.
4184 * testsuite/Makefile.in: Regenerate.
4185 * testsuite/two_file_test_1_v1.cc: New test source file.
4186 * testsuite/two_file_test_1b_v1.cc: New test source file.
4187 * testsuite/two_file_test_2_v1.cc: New test source file.
4188
4189 2011-05-24 Cary Coutant <ccoutant@google.com>
4190
4191 * dynobj.h (Dynobj::do_dynobj): New function.
4192 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4193 flag and soname for shared objects.
4194 * incremental.cc (Incremental_inputs::report_object): Make
4195 either Incremental_object_entry or Incremental_dynobj_entry; add
4196 soname to string table.
4197 (Incremental_inputs::report_input_section): Add assertion.
4198 (Output_section_incremental_inputs::set_final_data_size): Adjust
4199 type of input file entry for shared libraries; adjust size of
4200 shared library info entry.
4201 (Output_section_incremental_inputs::write_input_files): Write
4202 as_needed flag for shared libraries.
4203 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4204 of input file entry for shared libraries; write soname.
4205 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4206 soname from incremental info.
4207 * incremental.h (enum Incremental_input_flags): Add
4208 INCREMENTAL_INPUT_AS_NEEDED.
4209 (Incremental_input_entry::Incremental_input_entry): Initialize new
4210 data member.
4211 (Incremental_input_entry::set_as_needed): New function.
4212 (Incremental_input_entry::as_needed): New function.
4213 (Incremental_input_entry::do_dynobj_entry): New function.
4214 (Incremental_input_entry::as_needed_): New data member.
4215 (Incremental_object_entry::Incremental_object_entry): Don't check
4216 for shared library.
4217 (Incremental_object_entry::do_type): Likewise.
4218 (class Incremental_dynobj_entry): New class.
4219 (Incremental_input_entry_reader::as_needed): New function.
4220 (Incremental_input_entry_reader::get_soname): New function.
4221 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4222 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4223 size of shared library info entry.
4224 * layout.cc (Layout::finish_dynamic_section): Don't test for
4225 incremental link when adding DT_NEEDED entries.
4226 * object.h (Object::Object): Initialize new data member.
4227 (Object::dynobj): New function.
4228 (Object::set_as_needed): New function.
4229 (Object::as_needed): New function.
4230 (Object::do_dynobj): New function.
4231 (Object::as_needed_): New data member.
4232
4233 2011-05-24 Cary Coutant <ccoutant@google.com>
4234
4235 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4236 info; adjust display of GOT entries.
4237 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4238 vector of input objects; remove file_status_.
4239 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4240 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4241 got_plt reader; call target hooks to reserve GOT entries.
4242 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4243 of input file info header and GOT info entry.
4244 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4245 relocation info.
4246 (Got_plt_view_info::got_descriptor): Remove.
4247 (Got_plt_view_info::sym_index): New data member.
4248 (Got_plt_view_info::input_index): New data member.
4249 (Local_got_offset_visitor::visit): Write input file index.
4250 (Global_got_offset_visitor::visit): Write 0 for input file index.
4251 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4252 with sym_index and input_index.
4253 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4254 incremental info GOT entry; replace got_descriptor with input_index.
4255 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4256 map from input file index to object.
4257 (Sized_relobj_incr::do_layout): Replace direct data member reference
4258 with accessor function.
4259 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4260 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4261 Adjust size of input file info header.
4262 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4263 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4264 (Incremental_input_entry_reader::get_input_section): Adjust size of
4265 input file info header.
4266 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4267 of incremental info GOT entry.
4268 (Incremental_got_plt_reader::get_got_desc): Remove.
4269 (Incremental_got_plt_reader::get_got_symndx): New function.
4270 (Incremental_got_plt_reader::get_got_input_index): New function.
4271 (Sized_incremental_binary::Sized_incremental_binary): Remove
4272 file_status_; add input_objects_.
4273 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4274 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4275 (Sized_incremental_binary::file_is_unchanged): Remove.
4276 (Sized_incremental_binary::set_input_object): New function.
4277 (Sized_incremental_binary::input_object): New function.
4278 (Sized_incremental_binary::file_status_): Remove.
4279 (Sized_incremental_binary::input_objects_): New data member.
4280 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4281 references.
4282 (Sized_relobj_incr::invalid_address): Move to base class.
4283 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4284 class.
4285 (Sized_relobj_incr::do_output_section_offset): Likewise.
4286 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4287 (Sized_relobj_incr::section_offsets_): Likewise.
4288 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4289 function.
4290 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4291 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4292 with accessor function.
4293 (Sized_relobj_file::do_layout): Likewise.
4294 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4295 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4296 (Sized_relobj_file::compute_final_local_value): Replace refs to
4297 section_offsets_ with accessor function.
4298 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4299 * object.h (Relobj::Relobj): Initialize new data members.
4300 (Relobj::add_dyn_reloc): New function.
4301 (Relobj::first_dyn_reloc): New function.
4302 (Relobj::dyn_reloc_count): New function.
4303 (Relobj::first_dyn_reloc_): New data member.
4304 (Relobj::dyn_reloc_count_): New data member.
4305 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4306 references.
4307 (Sized_relobj::Address): New typedef.
4308 (Sized_relobj::invalid_address): Move here from child class.
4309 (Sized_relobj::Sized_relobj): Initialize new data members.
4310 (Sized_relobj::sized_relobj): New function.
4311 (Sized_relobj::is_output_section_offset_invalid): Move here from
4312 child class.
4313 (Sized_relobj::get_output_section_offset): Likewise.
4314 (Sized_relobj::local_has_got_offset): Likewise.
4315 (Sized_relobj::local_got_offset): Likewise.
4316 (Sized_relobj::set_local_got_offset): Likewise.
4317 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4318 (Sized_relobj::clear_got_offsets): New function.
4319 (Sized_relobj::section_offsets): Move here from child class.
4320 (Sized_relobj::do_output_section_offset): Likewise.
4321 (Sized_relobj::do_set_section_offset): Likewise.
4322 (Sized_relobj::Local_got_offsets): Likewise.
4323 (Sized_relobj::local_got_offsets_): Likewise.
4324 (Sized_relobj::section_offsets_): Likewise.
4325 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4326 references.
4327 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4328 class.
4329 (Sized_relobj_file::sized_relobj): New function
4330 (Sized_relobj_file::local_has_got_offset): Move to base class.
4331 (Sized_relobj_file::local_got_offset): Likewise.
4332 (Sized_relobj_file::set_local_got_offset): Likewise.
4333 (Sized_relobj_file::get_output_section_offset): Likewise.
4334 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4335 (Sized_relobj_file::do_output_section_offset): Likewise.
4336 (Sized_relobj_file::do_set_section_offset): Likewise.
4337 (Sized_relobj_file::Local_got_offsets): Likewise.
4338 (Sized_relobj_file::local_got_offsets_): Likewise.
4339 (Sized_relobj_file::section_offsets_): Likewise.
4340 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4341 (all constructors).
4342 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4343 (Output_reloc::get_symbol_index): Likewise.
4344 (Output_reloc::local_section_offset): Likewise.
4345 (Output_reloc::get_address): Likewise.
4346 (Output_reloc::symbol_value): Likewise.
4347 (Output_data_got::reserve_slot): Move to class definition.
4348 (Output_data_got::reserve_local): New function.
4349 (Output_data_got::reserve_slot_for_global): Remove.
4350 (Output_data_got::reserve_global): New function.
4351 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4352 (all constructors, two instantiations).
4353 (Output_reloc::get_relobj): New function (two instantiations).
4354 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4355 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4356 (Output_data_reloc::add_global): Adjust type of relobj.
4357 (Output_data_reloc::add_global_relative): Likewise.
4358 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4359 (Output_data_reloc::add_local): Likewise.
4360 (Output_data_reloc::add_local_relative): Likewise.
4361 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4362 (Output_data_reloc::add_local_section): Likewise.
4363 (Output_data_reloc::add_output_section): Likewise.
4364 (Output_data_reloc::add_absolute): Likewise.
4365 (Output_data_reloc::add_target_specific): Likewise.
4366 (Output_data_got::reserve_slot): Move definition here.
4367 (Output_data_got::reserve_local): New function.
4368 (Output_data_got::reserve_global): New function.
4369 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4370 section_offsets_ with accessor function.
4371 (Sized_relobj_file::write_sections): Likewise.
4372 (Sized_relobj_file::do_relocate_sections): Likewise.
4373 * target.h (Sized_target::reserve_local_got_entry): New function.
4374 (Sized_target::reserve_global_got_entry): New function.
4375 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4376 (Target_x86_64::reserve_global_got_entry): New function.
4377 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4378
4379 2011-05-23 Cary Coutant <ccoutant@google.com>
4380
4381 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4382 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4383 bit when checking got_type.
4384 * incremental.cc (Sized_incremental_binary::setup_readers):
4385 Store symbol table and string table locations; initialize bit vector
4386 of file status flags.
4387 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4388 unchanged files.
4389 (Sized_incremental_binary::do_process_got_plt): New function.
4390 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4391 (Output_section_incremental_inputs::set_final_data_size): Record
4392 file index for each input file.
4393 (Output_section_incremental_inputs::write_got_plt): Store file index
4394 instead of input entry offset for each GOT entry.
4395 * incremental.h
4396 (Incremental_input_entry::Incremental_input_entry): Initialize new
4397 data member.
4398 (Incremental_input_entry::set_offset): Store file index.
4399 (Incremental_input_entry::get_file_index): New function.
4400 (Incremental_input_entry::file_index_): New data member.
4401 (Incremental_binary::process_got_plt): New function.
4402 (Incremental_binary::do_process_got_plt): New function.
4403 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4404 data members.
4405 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4406 (Sized_incremental_binary::set_file_is_unchanged): New function.
4407 (Sized_incremental_binary::file_is_unchanged): New function.
4408 (Sized_incremental_binary::do_process_got_plt): New function.
4409 (Sized_incremental_binary::file_status_): New data member.
4410 (Sized_incremental_binary::main_symtab_loc_): New data member.
4411 (Sized_incremental_binary::main_strtab_loc_): New data member.
4412 * output.cc (Output_data_got::Got_entry::write): Add case
4413 RESERVED_CODE.
4414 (Output_data_got::add_global): Call add_got_entry.
4415 (Output_data_got::add_global_plt): Likewise.
4416 (Output_data_got::add_global_with_rel): Likewise.
4417 (Output_data_got::add_global_with_rela): Likewise.
4418 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4419 (Output_data_got::add_global_pair_with_rela): Likewise.
4420 (Output_data_got::add_local): Call add_got_entry.
4421 (Output_data_got::add_local_plt): Likewise.
4422 (Output_data_got::add_local_with_rel): Likewise.
4423 (Output_data_got::add_local_with_rela): Likewise.
4424 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4425 (Output_data_got::add_local_pair_with_rela): Likewise.
4426 (Output_data_got::reserve_slot): New function.
4427 (Output_data_got::reserve_slot_for_global): New function.
4428 (Output_data_got::add_got_entry): New function.
4429 (Output_data_got::add_got_entry_pair): New function.
4430 (Output_section::add_output_section_data): Edit FIXME.
4431 * output.h
4432 (Output_section_data_build::Output_section_data_build): New
4433 constructor with size parameter.
4434 (Output_data_space::Output_data_space): Likewise.
4435 (Output_data_got::Output_data_got): Initialize new data member; new
4436 constructor with size parameter.
4437 (Output_data_got::add_constant): Call add_got_entry.
4438 (Output_data_got::reserve_slot): New function.
4439 (Output_data_got::reserve_slot_for_global): New function.
4440 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4441 (Output_data_got::add_got_entry): New function.
4442 (Output_data_got::add_got_entry_pair): New function.
4443 (Output_data_got::free_list_): New data member.
4444 * target.h (Sized_target::init_got_plt_for_update): New function.
4445 (Sized_target::register_global_plt_entry): New function.
4446 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4447 Initialize new data member; call init; add constructor with PLT count.
4448 (Output_data_plt_x86_64::init): New function.
4449 (Output_data_plt_x86_64::add_relocation): New function.
4450 (Output_data_plt_x86_64::reserve_slot): New function.
4451 (Output_data_plt_x86_64::free_list_): New data member.
4452 (Target_x86_64::init_got_plt_for_update): New function.
4453 (Target_x86_64::register_global_plt_entry): New function.
4454 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4455 incremental updates.
4456 (Output_data_plt_x86_64::add_relocation): New function.
4457 * testsuite/object_unittest.cc (Object_test): Set default options.
4458
4459 2011-05-16 Ian Lance Taylor <iant@google.com>
4460
4461 * options.h (class General_options): Make -i a synonym for -r.
4462
4463 2011-05-16 Ian Lance Taylor <iant@google.com>
4464
4465 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4466
4467 2011-05-10 Cary Coutant <ccoutant@google.com>
4468
4469 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4470 strip_all (-s).
4471
4472 2011-05-06 Ian Lance Taylor <iant@google.com>
4473
4474 * layout.cc (Layout::layout): If the output section flags change,
4475 update the ordering.
4476
4477 2011-04-25 Cary Coutant <ccoutant@google.com>
4478
4479 * incremental-dump.cc (dump_incremental_inputs): Print local
4480 symbol info for each input file.
4481 * incremental.cc
4482 (Output_section_incremental_inputs::set_final_data_size): Add local
4483 symbol info to input file entries in incremental info.
4484 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4485 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4486 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4487 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4488 implementation.
4489 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4490 (Sized_incr_relobj::do_relocate): Write the local symbols.
4491 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4492 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4493 Adjust size of input file header.
4494 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4495 (Incremental_inputs_reader::get_local_symbol_count): New function.
4496 (Incremental_inputs_reader::get_input_section): Adjust size of input
4497 file header.
4498 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4499 (Sized_incr_relobj::This): New typedef.
4500 (Sized_incr_relobj::sym_size): New const data member.
4501 (Sized_incr_relobj::Local_symbol): New struct.
4502 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4503 (Sized_incr_relobj::do_local_symbol_offset): New function.
4504 (Sized_incr_relobj::local_symbol_count_): New data member.
4505 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4506 (Sized_incr_relobj::local_symbol_index_): New data member.
4507 (Sized_incr_relobj::local_symbol_offset_): New data member.
4508 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4509 (Sized_incr_relobj::local_symbols_): New data member.
4510 * object.h (Relobj::output_local_symbol_count): New function.
4511 (Relobj::local_symbol_offset): New function.
4512 (Relobj::do_output_local_symbol_count): New function.
4513 (Relobj::do_local_symbol_offset): New function.
4514 (Sized_relobj::do_output_local_symbol_count): New function.
4515 (Sized_relobj::do_local_symbol_offset): New function.
4516
4517 2011-04-22 Vladimir Simonov <sv@sw.ru>
4518
4519 * descriptors.cc (set_close_on_exec): New function.
4520 (Descriptors::open): Use set_close_on_exec.
4521 * output.cc (S_ISLNK): Define if not defined.
4522
4523 2011-04-22 Cary Coutant <ccoutant@google.com>
4524
4525 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4526 global symbol map.
4527 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4528 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4529 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4530 relocations.
4531 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4532 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4533 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4534 * incremental.h
4535 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4536 function.
4537 (Incremental_binary::apply_incremental_relocs): New function.
4538 (Incremental_binary::do_apply_incremental_relocs): New function.
4539 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4540 data member.
4541 (Sized_incremental_binary::add_global_symbol): New function.
4542 (Sized_incremental_binary::global_symbol): New function.
4543 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4544 (Sized_incremental_binary::symbol_map_): New data member.
4545 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4546 * target.h (Sized_target::apply_relocation): New function.
4547 * target-reloc.h (apply_relocation): New function.
4548 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4549
4550 2011-04-22 Doug Kwan <dougkwan@google.com>
4551
4552 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4553 flag of a SHT_ARM_EXIDX section.
4554 * testsuite/Makefile.am (arm_exidx_test): New test rules.
4555 * testsuite/Makefile.in: Regenerate.
4556 * testsuite/arm_exidx_test.s: New file.
4557 * testsuite/arm_exidx_test.sh: Same.
4558
4559 2011-04-20 Cary Coutant <ccoutant@google.com>
4560
4561 PR gold/12689
4562 * archive.h (Incremental_archive_entry::Archive_member):
4563 Initialize arg_serial_ (second constructor).
4564
4565 2011-04-17 Ian Lance Taylor <iant@google.com>
4566
4567 * object.cc (Relocate_info::location): Simplify location string.
4568 * errors.cc (Errors::error_at_location): Don't print program
4569 name.
4570 (Errors::warning_at_location): Likewise.
4571 (Errors::undefined_symbol): Likewise.
4572 * testsuite/debug_msg.sh: Update accordingly.
4573
4574 2011-04-14 Cary Coutant <ccoutant@google.com>
4575
4576 * gold/layout.cc (Layout::symtab_section_offset): New function.
4577 * gold/layout.h (Layout::symtab_section_offset): New function.
4578 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4579
4580 2011-04-12 Ian Lance Taylor <iant@google.com>
4581
4582 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4583 with MREMAP_MAYMOVE.
4584 * output.h (class Output_file): Add map_is_allocated_ field.
4585 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4586 not available, provide stubs. If mremap is not available, #define
4587 it to gold_mremap.
4588 (MREMAP_MAYMOVE): Define if not defined.
4589 (Output_file::Output_file): Initialize map_is_allocated_.
4590 (Output_file::resize): Check map_is_allocated_.
4591 (Output_file::map_anonymous): If mmap fails, use malloc.
4592 (Output_file::unmap): Don't do anything for an anonymous map.
4593 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4594 is not available, provide stubs.
4595 (File_read::View::~View): Use free rather than delete[].
4596 (File_read::make_view): Use malloc rather than new[]. If mmap
4597 fails, use malloc.
4598 (File_read::find_or_make_view): Use malloc rather than new[].
4599 * gold.h: Remove HAVE_REMAP code.
4600 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4601 exists. Rename mremap to gold_mremap. If mmap is not available
4602 don't do anything.
4603 * configure, config.in: Rebuild.
4604
4605 2011-04-11 Ian Lance Taylor <iant@google.com>
4606
4607 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4608 initialize local variable v.
4609
4610 2011-04-11 Cary Coutant <ccoutant@google.com>
4611
4612 * archive.cc (Archive::include_member): Adjust call to
4613 report_object.
4614 (Add_archive_symbols::run): Track argument serial numbers.
4615 (Lib_group::include_member): Likewise.
4616 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4617 * archive.h (Incremental_archive_entry::Archive_member):
4618 Initialize arg_serial_.
4619 (Archive_member::arg_serial_): New data member.
4620 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4621 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4622 incremental link.
4623 (Sized_dynobj::do_for_all_local_got_entries): New function.
4624 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4625 function.
4626 * fileread.cc (get_mtime): New function.
4627 * fileread.h (get_mtime): New function.
4628 * gold.cc (queue_initial_tasks): Check for incremental update.
4629 (process_incremental_input): New function.
4630 (queue_middle_tasks): Don't force valid target for incremental
4631 update.
4632 * incremental-dump.cc (find_input_containing_global): Adjust
4633 size of symbol info entry.
4634 (dump_incremental_inputs): Dump argument serial number and
4635 in_system_directory flag; bias shndx by 1; print symbol names
4636 when dumping per-file symbol lists; use new symbol info readers.
4637 * incremental.cc
4638 (Output_section_incremental_inputs:update_data_size): New function.
4639 (Sized_incremental_binary::setup_readers): Setup input readers
4640 for each input file; build maps for files added from libraries
4641 and scripts.
4642 (Sized_incremental_binary::check_input_args): New function.
4643 (Sized_incremental_binary::do_check_inputs): Build map of argument
4644 serial numbers to input arguments.
4645 (Sized_incremental_binary::do_file_has_changed): Rename
4646 do_file_is_unchanged to this; compare file modification times.
4647 (Sized_incremental_binary::do_init_layout): New function.
4648 (Sized_incremental_binary::do_reserve_layout): New function.
4649 (Sized_incremental_binary::do_get_input_reader): Remove.
4650 (Sized_incremental_binary::get_symtab_view): New function.
4651 (Incremental_checker::can_incrementally_link_output_file): Remove.
4652 (Incremental_inputs::report_command_line): Exclude --debug options.
4653 (Incremental_inputs::report_archive_begin): Add parameter; track
4654 argument serial numbers; don't put input file entry for archive
4655 before archive members.
4656 (Incremental_inputs::report_archive_end): Put input file entry
4657 for archive after archive members.
4658 (Incremental_inputs::report_object): Add parameter; track argument
4659 serial numbers and in_system_directory flag.
4660 (Incremental_inputs::report_script): Add parameter; track argument
4661 serial numbers.
4662 (Output_section_incremental_inputs::set_final_data_size): Adjust
4663 size of symbol info entry; check for forwarding symbols.
4664 (Output_section_incremental_inputs::write_input_files): Write
4665 in_system_directory flag and argument serial number.
4666 (Output_section_incremental_inputs::write_info_blocks): Map section
4667 indices between incremental info and original input file; store
4668 input section index for each symbol.
4669 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4670 change operator() to visit().
4671 (class Global_got_offset_visitor): Likewise.
4672 (class Global_symbol_visitor_got_plt):
4673 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4674 classes.
4675 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4676 (Sized_incr_relobj::do_read_symbols): New function.
4677 (Sized_incr_relobj::do_layout): New function.
4678 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4679 (Sized_incr_relobj::do_add_symbols): New function.
4680 (Sized_incr_relobj::do_should_include_member): New function.
4681 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4682 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4683 (Sized_incr_relobj::do_section_size): New function.
4684 (Sized_incr_relobj::do_section_name): New function.
4685 (Sized_incr_relobj::do_section_contents): New function.
4686 (Sized_incr_relobj::do_section_flags): New function.
4687 (Sized_incr_relobj::do_section_entsize): New function.
4688 (Sized_incr_relobj::do_section_address): New function.
4689 (Sized_incr_relobj::do_section_type): New function.
4690 (Sized_incr_relobj::do_section_link): New function.
4691 (Sized_incr_relobj::do_section_info): New function.
4692 (Sized_incr_relobj::do_section_addralign): New function.
4693 (Sized_incr_relobj::do_initialize_xindex): New function.
4694 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4695 (Sized_incr_relobj::do_read_relocs): New function.
4696 (Sized_incr_relobj::do_gc_process_relocs): New function.
4697 (Sized_incr_relobj::do_scan_relocs): New function.
4698 (Sized_incr_relobj::do_count_local_symbols): New function.
4699 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4700 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4701 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4702 (Sized_incr_relobj::do_relocate): New function.
4703 (Sized_incr_relobj::do_set_section_offset): New function.
4704 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4705 (Sized_incr_dynobj::do_read_symbols): New function.
4706 (Sized_incr_dynobj::do_layout): New function.
4707 (Sized_incr_dynobj::do_add_symbols): New function.
4708 (Sized_incr_dynobj::do_should_include_member): New function.
4709 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4710 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4711 (Sized_incr_dynobj::do_section_size): New function.
4712 (Sized_incr_dynobj::do_section_name): New function.
4713 (Sized_incr_dynobj::do_section_contents): New function.
4714 (Sized_incr_dynobj::do_section_flags): New function.
4715 (Sized_incr_dynobj::do_section_entsize): New function.
4716 (Sized_incr_dynobj::do_section_address): New function.
4717 (Sized_incr_dynobj::do_section_type): New function.
4718 (Sized_incr_dynobj::do_section_link): New function.
4719 (Sized_incr_dynobj::do_section_info): New function.
4720 (Sized_incr_dynobj::do_section_addralign): New function.
4721 (Sized_incr_dynobj::do_initialize_xindex): New function.
4722 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4723 (make_sized_incremental_object): New function.
4724 (Incremental_library::copy_unused_symbols): New function.
4725 (Incremental_library::do_for_all_unused_symbols): New function.
4726 * incremental.h (enum Incremental_input_flags): New type.
4727 (class Incremental_checker): Remove.
4728 (Incremental_input_entry::Incremental_input_entry): Add argument
4729 serial number.
4730 (Incremental_input_entry::arg_serial): New function.
4731 (Incremental_input_entry::set_is_in_system_directory): New function.
4732 (Incremental_input_entry::is_in_system_directory): New function.
4733 (Incremental_input_entry::arg_serial_): New data member.
4734 (Incremental_input_entry::is_in_system_directory_): New data member.
4735 (class Script_info): Move here from script.h.
4736 (Script_info::Script_info): Add filename parameter.
4737 (Script_info::filename): New function.
4738 (Script_info::filename_): New data member.
4739 (Incremental_script_entry::Incremental_script_entry): Add argument
4740 serial number.
4741 (Incremental_object_entry::Incremental_object_entry): Likewise.
4742 (Incremental_object_entry::add_input_section): Build list of input
4743 sections with map to original shndx.
4744 (Incremental_object_entry::get_input_section_index): New function.
4745 (Incremental_object_entry::shndx_): New data member.
4746 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4747 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4748 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4749 serial number.
4750 (Incremental_inputs::report_archive_begin): Likewise.
4751 (Incremental_inputs::report_object): Likewise.
4752 (Incremental_inputs::report_script): Likewise.
4753 (class Incremental_global_symbol_reader): New class.
4754 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4755 and store flags and input file type.
4756 (Incremental_input_entry_reader::arg_serial): New function.
4757 (Incremental_input_entry_reader::type): Extract type from flags.
4758 (Incremental_input_entry_reader::is_in_system_directory): New function.
4759 (Incremental_input_entry_reader::get_input_section_count): Call
4760 accessor function for type.
4761 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4762 function for type; adjust size of global symbol entry.
4763 (Incremental_input_entry_reader::get_global_symbol_count): Call
4764 accessor function for type.
4765 (Incremental_input_entry_reader::get_object_count): Likewise.
4766 (Incremental_input_entry_reader::get_object_offset): Likewise.
4767 (Incremental_input_entry_reader::get_member_count): Likewise.
4768 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4769 (Incremental_input_entry_reader::get_member_offset): Likewise.
4770 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4771 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4772 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4773 (Incremental_input_entry_reader::get_global_symbol_reader): New
4774 function.
4775 (Incremental_input_entry_reader::get_output_symbol_index): New
4776 function.
4777 (Incremental_input_entry_reader::type_): Remove.
4778 (Incremental_input_entry_reader::flags_): New data member.
4779 (Incremental_inputs_reader::input_file_offset): New function.
4780 (Incremental_inputs_reader::input_file_index): New function.
4781 (Incremental_inputs_reader::input_file): Call input_file_offset.
4782 (Incremental_inputs_reader::input_file_at_offset): New function.
4783 (Incremental_relocs_reader::get_r_type): Reformat.
4784 (Incremental_relocs_reader::get_r_shndx): Reformat.
4785 (Incremental_relocs_reader::get_r_offset): Reformat.
4786 (Incremental_relocs_reader::data): New function.
4787 (Incremental_binary::Incremental_binary): Initialize new data members.
4788 (Incremental_binary::check_inputs): Add cmdline parameter.
4789 (Incremental_binary::file_is_unchanged): Remove.
4790 (Input_reader::arg_serial): New function.
4791 (Input_reader::get_unused_symbol_count): New function.
4792 (Input_reader::get_unused_symbol): New function.
4793 (Input_reader::do_arg_serial): New function.
4794 (Input_reader::do_get_unused_symbol_count): New function.
4795 (Input_reader::do_get_unused_symbol): New function.
4796 (Incremental_binary::input_file_count): New function.
4797 (Incremental_binary::get_input_reader): Change signature to use
4798 index instead of filename.
4799 (Incremental_binary::file_has_changed): New function.
4800 (Incremental_binary::get_input_argument): New function.
4801 (Incremental_binary::get_library): New function.
4802 (Incremental_binary::get_script_info): New function.
4803 (Incremental_binary::init_layout): New function.
4804 (Incremental_binary::reserve_layout): New function.
4805 (Incremental_binary::output_file): New function.
4806 (Incremental_binary::do_check_inputs): New function.
4807 (Incremental_binary::do_file_is_unchanged): Remove.
4808 (Incremental_binary::do_file_has_changed): New function.
4809 (Incremental_binary::do_init_layout): New function.
4810 (Incremental_binary::do_reserve_layout): New function.
4811 (Incremental_binary::do_input_file_count): New function.
4812 (Incremental_binary::do_get_input_reader): Change signature.
4813 (Incremental_binary::input_args_map_): New data member.
4814 (Incremental_binary::library_map_): New data member.
4815 (Incremental_binary::script_map_): New data member.
4816 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4817 new data members.
4818 (Sized_incremental_binary::output_section): New function.
4819 (Sized_incremental_binary::inputs_reader): Add const.
4820 (Sized_incremental_binary::symtab_reader): Add const.
4821 (Sized_incremental_binary::relocs_reader): Add const.
4822 (Sized_incremental_binary::got_plt_reader): Add const.
4823 (Sized_incremental_binary::get_symtab_view): New function.
4824 (Sized_incremental_binary::Inputs_reader): New typedef.
4825 (Sized_incremental_binary::Input_entry_reader): New typedef.
4826 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4827 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4828 (Sized_incremental_binary::do_file_has_changed): New function.
4829 (Sized_incremental_binary::do_init_layout): New function.
4830 (Sized_incremental_binary::do_reserve_layout): New function.
4831 (Sized_input_reader::Inputs_reader): Remove.
4832 (Sized_input_reader::Input_entry_reader): Remove.
4833 (Sized_input_reader::do_arg_serial): New function.
4834 (Sized_input_reader::do_get_unused_symbol_count): New function.
4835 (Sized_input_reader::do_get_unused_symbol): New function.
4836 (Sized_incremental_binary::do_input_file_count): New function.
4837 (Sized_incremental_binary::do_get_input_reader): Change signature;
4838 use index instead of filename.
4839 (Sized_incremental_binary::section_map_): New data member.
4840 (Sized_incremental_binary::input_entry_readers_): New data member.
4841 (class Sized_incr_relobj): New class.
4842 (class Sized_incr_dynobj): New class.
4843 (make_sized_incremental_object): New function.
4844 (class Incremental_library): New class.
4845 * layout.cc (Free_list::num_lists): New static data member.
4846 (Free_list::num_nodes): New static data member.
4847 (Free_list::num_removes): New static data member.
4848 (Free_list::num_remove_visits): New static data member.
4849 (Free_list::num_allocates): New static data member.
4850 (Free_list::num_allocate_visits): New static data member.
4851 (Free_list::init): New function.
4852 (Free_list::remove): New function.
4853 (Free_list::allocate): New function.
4854 (Free_list::dump): New function.
4855 (Free_list::print_stats): New function.
4856 (Layout_task_runner::run): Resize output file for incremental updates.
4857 (Layout::Layout): Initialize new data members.
4858 (Layout::set_incremental_base): New function.
4859 (Layout::init_fixed_output_section): New function.
4860 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4861 incremental updates.
4862 (Layout::create_gold_note): Do not create gold note section for
4863 incremental updates.
4864 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4865 for incremental updates.
4866 (Layout::set_section_offsets): For incremental updates, allocate space
4867 from free list.
4868 (Layout::create_symtab_sections): Layout with offsets relative to
4869 start of section; for incremental updates, allocate space from free
4870 list.
4871 (Layout::create_shdrs): For incremental updates, allocate space from
4872 free list.
4873 (Layout::finish_dynamic_section): For incremental updates, do not
4874 check --as-needed (fixed in subsequent patch).
4875 * layout.h (class Free_list): New class.
4876 (Layout::set_incremental_base): New function.
4877 (Layout::incremental_base): New function.
4878 (Layout::init_fixed_output_section): New function.
4879 (Layout::allocate): New function.
4880 (Layout::incremental_base_): New data member.
4881 (Layout::free_list_): New data member.
4882 * main.cc (main): Print Free_list statistics.
4883 * object.cc (Relobj::finalize_incremental_relocs): Add
4884 clear_counts parameter; clear counts only when clear_counts is set.
4885 (Sized_relobj::Sized_relobj): Initialize new base class.
4886 (Sized_relobj::do_layout): Don't report special sections.
4887 (Sized_relobj::do_for_all_local_got_entries): New function.
4888 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4889 symtab_off to all symbol table offsets.
4890 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4891 * object.h (class Got_offset_list): Move to top of file.
4892 (Object::Object): Allow case where input_file == NULL.
4893 (Object::~Object): Likewise.
4894 (Object::input_file): Assert that input_file != NULL.
4895 (Object::lock): Allow case where input_file == NULL.
4896 (Object::unlock): Likewise.
4897 (Object::is_locked): Likewise.
4898 (Object::token): Likewise.
4899 (Object::release): Likewise.
4900 (Object::is_incremental): New function.
4901 (Object::get_mtime): New function.
4902 (Object::for_all_local_got_entries): New function.
4903 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4904 (Object::set_is_in_system_directory): New function.
4905 (Object::is_in_system_directory): New function.
4906 (Object::do_is_incremental): New function.
4907 (Object::do_get_mtime): New function.
4908 (Object::do_for_all_local_got_entries): New function.
4909 (Object::is_in_system_directory_): New data member.
4910 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4911 (class Sized_relobj_base): New class.
4912 (class Sized_relobj): Derive from Sized_relobj_base.
4913 (class Sized_relobj::Symbols): Redeclare from base class.
4914 (class Sized_relobj::local_got_offset_list): Remove.
4915 (class Sized_relobj::Output_sections): Redeclare from base class.
4916 (class Sized_relobj::do_for_all_local_got_entries): New function.
4917 (class Sized_relobj::write_local_symbols): Add offset parameter.
4918 (class Sized_relobj::local_symbol_offset_): Update comment.
4919 (class Sized_relobj::local_dynsym_offset_): Update comment.
4920 * options.cc (Input_arguments::add_file): Remove const.
4921 * options.h (Input_file_argument::Input_file_argument):
4922 Initialize arg_serial_ (all constructors).
4923 (Input_file_argument::set_arg_serial): New function.
4924 (Input_file_argument::arg_serial): New function.
4925 (Input_file_argument::arg_serial_): New data member.
4926 (Input_arguments::Input_arguments): Initialize file_count_.
4927 (Input_arguments::add_file): Remove const.
4928 (Input_arguments::number_of_input_files): New function.
4929 (Input_arguments::file_count_): New data member.
4930 (Command_line::number_of_input_files): Call
4931 Input_arguments::number_of_input_files.
4932 * output.cc (Output_segment_headers::Output_segment_headers):
4933 Set current size.
4934 (Output_section::Input_section::current_data_size): New function.
4935 (Output_section::Output_section): Initialize new data members.
4936 (Output_section::add_input_section): Don't do merge sections for
4937 an incremental link; allocate space from free list for an
4938 incremental update.
4939 (Output_section::add_output_section_data): Allocate space from
4940 free list for an incremental update.
4941 (Output_section::update_data_size): New function.
4942 (Output_section::set_fixed_layout): New function.
4943 (Output_section::reserve): New function.
4944 (Output_segment::set_section_addresses): Remove const.
4945 (Output_segment::set_section_list_addresses): Remove const; allocate
4946 space from free list for an incremental update.
4947 (Output_segment::set_offset): Adjust size of RELRO segment for an
4948 incremental update.
4949 * output.h (Output_data::current_data_size): Move here from
4950 child classes.
4951 (Output_data::pre_finalize_data_size): New function.
4952 (Output_data::update_data_size): New function.
4953 (Output_section_headers::update_data_size): new function.
4954 (Output_section_data_build::current_data_size): Move to Output_data.
4955 (Output_data_strtab::update_data_size): New function.
4956 (Output_section::current_data_size): Move to Output_data.
4957 (Output_section::set_fixed_layout): New function.
4958 (Output_section::has_fixed_layout): New function.
4959 (Output_section::reserve): New function.
4960 (Output_section::update_data_size): New function.
4961 (Output_section::has_fixed_layout_): New data member.
4962 (Output_section::free_list_): New data member.
4963 (Output_segment::set_section_addresses): Remove const.
4964 (Output_segment::set_section_list_addresses): Remove const.
4965 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4966 New function.
4967 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4968 New function.
4969 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4970 parameter when calling Add_symbols constructor; store argument
4971 serial number for members of a lib group.
4972 (Add_symbols::locks): Allow case where token == NULL.
4973 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4974 (Read_member::~Read_member): New function.
4975 (Read_member::is_runnable): New function.
4976 (Read_member::locks): New function.
4977 (Read_member::run): New function.
4978 (Check_script::~Check_script): New function.
4979 (Check_script::is_runnable): New function.
4980 (Check_script::locks): New function.
4981 (Check_script::run): New function.
4982 (Check_library::~Check_library): New function.
4983 (Check_library::is_runnable): New function.
4984 (Check_library::locks): New function.
4985 (Check_library::run): New function.
4986 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4987 (Add_symbols::library_): New data member.
4988 (class Read_member): New class.
4989 (class Check_script): New class.
4990 (class Check_library): New class.
4991 * reloc.cc (Read_relocs::is_runnable): Allow case where
4992 token == NULL.
4993 (Read_relocs::locks): Likewise.
4994 (Scan_relocs::locks): Likewise.
4995 (Relocate_task::locks): Likewise.
4996 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4997 to clear counters.
4998 (Sized_relobj::incremental_relocs_scan): Fix comment.
4999 (Sized_relobj::do_relocate): Pass output file offset to
5000 write_local_symbols.
5001 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5002 from class declaration.
5003 * script.cc (read_input_script): Allocate Script_info; pass
5004 argument serial number to report_script.
5005 * script.h (class Script_info): Move to incremental.h.
5006 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5007 * symtab.h (Symbol_table::add_from_incrobj): New function.
5008 (Symbol_table::set_file_offset): New function.
5009
5010 2011-04-05 Cary Coutant <ccoutant@google.com>
5011
5012 * incremental-dump.cc (dump_incremental_inputs): Change signature
5013 to take a Sized_incremental_binary; change caller. Use readers
5014 in Sized_incremental_binary.
5015 * incremental.cc
5016 (Sized_incremental_binary::find_incremental_inputs_sections):
5017 Rename do_find_incremental_inputs_sections to this.
5018 (Sized_incremental_binary::setup_readers): New function.
5019 (Sized_incremental_binary::do_check_inputs): Check
5020 has_incremental_info_ flag; move setup code to setup_readers;
5021 use input readers.
5022 (Sized_incremental_binary::do_file_is_unchanged): New function.
5023 (Sized_incremental_binary::do_get_input_reader): New function.
5024 * incremental.h (class Incremental_binary): Move to end of file.
5025 (Incremental_binary::file_is_unchanged): New function.
5026 (Incremental_binary::do_file_is_unchanged): New function.
5027 (Incremental_binary::Input_reader): New class.
5028 (Incremental_binary::get_input_reader): New function.
5029 (class Sized_incremental_binary): Move to end of file.
5030 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5031 input section reader classes.
5032 (Sized_incremental_binary::has_incremental_info): New function.
5033 (Sized_incremental_binary::inputs_reader): New function.
5034 (Sized_incremental_binary::symtab_reader): New function.
5035 (Sized_incremental_binary::relocs_reader): New function.
5036 (Sized_incremental_binary::got_plt_reader): New function.
5037 (Sized_incremental_binary::do_file_is_unchanged): New function.
5038 (Sized_incremental_binary::Sized_input_reader): New class.
5039 (Sized_incremental_binary::get_input_reader): New function.
5040 (Sized_incremental_binary::find_incremental_inputs_sections):
5041 Rename do_find_incremental_inputs_sections to this.
5042 (Sized_incremental_binary::setup_readers): New function.
5043 (Sized_incremental_binary::has_incremental_info_): New data member.
5044 (Sized_incremental_binary::inputs_reader_): New data member.
5045 (Sized_incremental_binary::symtab_reader_): New data member.
5046 (Sized_incremental_binary::relocs_reader_): New data member.
5047 (Sized_incremental_binary::got_plt_reader_): New data member.
5048 (Sized_incremental_binary::current_input_file_): New data member.
5049
5050 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5051
5052 PR gold/12640
5053 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5054 violation.
5055
5056 2011-03-30 Cary Coutant <ccoutant@google.com>
5057
5058 * archive.cc (Archive::include_member): Adjust call to report_object.
5059 (Add_archive_symbols::run): Add script_info to call to
5060 report_archive_begin.
5061 (Lib_group::include_member): Adjust call to report_object.
5062 (Add_lib_group_symbols::run): Adjust call to report_object.
5063 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5064 blocks. Add object count for script input files.
5065 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5066 script_info parameter; change all callers.
5067 (Incremental_inputs::report_object): Add script_info parameter;
5068 change all callers.
5069 (Incremental_inputs::report_script): Store backpointer to
5070 incremental info entry.
5071 (Output_section_incremental_inputs::set_final_data_size): Record
5072 additional information for scripts.
5073 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5074 * incremental.h (Incremental_script_entry::add_object): New function.
5075 (Incremental_script_entry::get_object_count): New function.
5076 (Incremental_script_entry::get_object): New function.
5077 (Incremental_script_entry::objects_): New data member; adjust
5078 constructor.
5079 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5080 (Incremental_inputs::report_object): Add script_info parameter.
5081 (Incremental_inputs_reader::get_object_count): New function.
5082 (Incremental_inputs_reader::get_object_offset): New function.
5083 * options.cc (Input_arguments::add_file): Return reference to
5084 new input argument.
5085 * options.h (Input_argument::set_script_info): New function.
5086 (Input_argument::script_info): New function.
5087 (Input_argument::script_info_): New data member; adjust all
5088 constructors.
5089 (Input_file_group::add_file): Return reference to new input argument.
5090 (Input_file_lib::add_file): Likewise.
5091 (Input_arguments::add_file): Likewise.
5092 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5093 * script.cc (Parser_closure::Parser_closure): Add script_info
5094 parameter; adjust all callers.
5095 (Parser_closure::script_info): New function.
5096 (Parser_closure::script_info_): New data member.
5097 (read_input_script): Report scripts earlier to incremental info.
5098 (script_add_file): Set script_info in Input_argument.
5099 (script_add_library): Likewise.
5100 * script.h (Script_options::Script_info): Rewrite class.
5101
5102 2011-03-29 Cary Coutant <ccoutant@google.com>
5103
5104 * archive.cc (Library_base::should_include_member): Move
5105 method here from class Archive.
5106 (Archive::Archive): Initialize base class.
5107 (Archive::should_include_member): Move to base class.
5108 (Archive::do_for_all_unused_symbols): New function.
5109 (Add_archive_symbols::run): Remove redundant access to
5110 incremental_inputs.
5111 (Lib_group::Lib_group): Initialize base class.
5112 (Lib_group::do_filename): New function.
5113 (Lib_group::include_member): Pass pointer to Lib_group to
5114 report_object.
5115 (Lib_group::do_for_all_unused_symbols): New function.
5116 (Add_lib_group_symbols::run): Report archive information for
5117 incremental links.
5118 * archive.h (class Library_base): New base class.
5119 (class Archive): Derive from Library_base.
5120 (Archive::filename): Move to base class.
5121 (Archive::set_incremental_info): Likewise.
5122 (Archive::incremental_info): Likewise.
5123 (Archive::Should_include): Likewise.
5124 (Archive::should_include_member): Likewise.
5125 (Archive::Armap_entry): Remove.
5126 (Archive::Unused_symbol_iterator): Remove.
5127 (Archive::unused_symbols_begin): Remove.
5128 (Archive::unused_symbols_end): Remove.
5129 (Archive::do_filename): New function.
5130 (Archive::do_get_mtime): New function.
5131 (Archive::do_for_all_unused_symbols): New function.
5132 (Archive::task_): Move to base class.
5133 (Archive::incremental_info_): Likewise.
5134 (class Lib_group): Derive from Library_base.
5135 (Lib_group::do_filename): New function.
5136 (Lib_group::do_get_mtime): New function.
5137 (Lib_group::do_for_all_unused_symbols): New function.
5138 (Lib_group::task_): Move to base class.
5139 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5140 function.
5141 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5142 function.
5143 * incremental.cc (Incremental_inputs::report_archive_begin):
5144 Use Library_base; call library's get_mtime; add incremental inputs
5145 entry before members.
5146 (class Unused_symbol_visitor): New class.
5147 (Incremental_inputs::report_archive_end): Use Library_base; use
5148 visitor class to record unused symbols; don't add incremental inputs
5149 entry after members.
5150 (Incremental_inputs::report_object): Use Library_base.
5151 * incremental.h
5152 (Incremental_archive_entry::Incremental_archive_entry): Remove
5153 unused Archive parameter.
5154 (Incremental_inputs::report_archive_begin): Use Library_base.
5155 (Incremental_inputs::report_archive_end): Likewise.
5156 (Incremental_inputs::report_object): Likewise.
5157 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5158 function.
5159 * object.h (Object::for_all_global_symbols): New function.
5160 (Object::do_for_all_global_symbols): New function.
5161 (Sized_relobj::do_for_all_global_symbols): New function.
5162 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5163 function.
5164 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5165 function.
5166
5167 2011-03-27 Ian Lance Taylor <iant@google.com>
5168
5169 * archive.cc (Archive::interpret_header): Return -1 if something
5170 goes wrong. Change callers accordingly.
5171
5172 2011-03-25 Cary Coutant <ccoutant@google.com>
5173
5174 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5175 * testsuite/Makefile.in: Regenerate.
5176
5177 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
5178
5179 * plugin.cc (get_view): New.
5180 (Plugin::load): Pass get_view to the plugin.
5181 (Plugin_manager::get_view): New.
5182
5183 2011-03-21 Ian Lance Taylor <iant@google.com>
5184
5185 * testsuite/final_layout.sh: Rewrite to not use dc.
5186 * testsuite/relro_test.sh: Fail if dc is not present.
5187
5188 2011-03-21 Sriraman Tallam <tmsriram@google.com>
5189
5190 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5191 Change == to -eq.
5192 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5193 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5194 Change == to -eq.
5195 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5196 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5197
5198 2011-03-14 Ian Lance Taylor <iant@google.com>
5199
5200 * script-sections.cc (Sort_output_sections::script_compare):
5201 Rename from is_before, change return type.
5202 (Sort_output_sections::operator()): Adjust accordingly.
5203
5204 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5205
5206 PR gold/12572
5207 * testsuite/odr_violation2.cc: Add comment to make all error line
5208 numbers double digits.
5209 * testsuite/debug_msg.sh: Adjust expected errors.
5210
5211 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5212
5213 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5214 but mark earlier ones as non-canonical
5215 (offset_to_iterator): Update search target and example
5216 (do_addr2line): Return extra lines in a vector*
5217 (format_file_lineno): Extract from do_addr2line
5218 (one_addr2line): Add vector* out-param
5219 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5220 when a lineno entry appeared last for its instruction
5221 (Dwarf_line_info): Add vector* out-param
5222 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5223 * symtab.cc (Odr_violation_compare): Include the lineno in the
5224 comparison again.
5225 (linenos_from_loc): New. Combine the canonical line for an
5226 address with its other lines.
5227 (True_if_intersect): New. Helper functor to make
5228 std::set_intersection a query.
5229 (detect_odr_violations): Compare sets of lines instead of just
5230 one line for each function. This became less deterministic, but
5231 has fewer false positives.
5232 * symtab.h: Declarations.
5233 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5234 mix an optimized and non-optimized object in the same binary
5235 (odr_violation2.so): Same.
5236 * testsuite/Makefile.in: Regenerate from Makefile.am.
5237 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5238 * testsuite/debug_msg.sh: Update line numbers and add
5239 assertions.
5240 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5241 non-optimized context.
5242 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5243 isn't inlined, and use OdrDerived in an optimized context.
5244 * testsuite/odr_header1.h: Defines OdrDerived, where
5245 optimization will change the
5246 first-instruction-in-the-destructor's file and line number.
5247 * testsuite/odr_header2.h: Defines OdrBase.
5248
5249 2011-03-09 Ian Lance Taylor <iant@google.com>
5250
5251 * fileread.cc (File_read::clear_views): Don't delete the whole
5252 file view.
5253
5254 2011-03-08 Ian Lance Taylor <iant@google.com>
5255
5256 PR gold/12525
5257 * fileread.cc: #include <climits>.
5258 (GOLD_IOV_MAX): Define.
5259 (File_read::read_multiple): Limit number of entries by iov_max.
5260 * fileread.h (class File_read): Always set max_readv_entries to
5261 128.
5262
5263 2011-03-07 Ian Lance Taylor <iant@google.com>
5264
5265 PR gold/12525
5266 * options.h (class General_options): Add -dy and -dn.
5267
5268 2011-03-02 Cary Coutant <ccoutant@google.com>
5269
5270 * testsuite/script_test_9.t: Add TLS segment.
5271
5272 2011-03-02 Simon Baldwin <simonb@google.com>
5273
5274 * configure.ac: Add check for gnu_indirect_function support in
5275 the toolchain building binutils.
5276 * configure: Rebuild.
5277
5278 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
5279
5280 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5281 plugin only symbols.
5282 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5283 in plugin files as not needed in the symbol table.
5284
5285 2011-02-11 Sriraman Tallam <tmsriram@google.com>
5286
5287 * output.cc (Output_section::add_input_section): Delay fill
5288 generation for section ordering.
5289
5290 2011-02-09 Ian Lance Taylor <iant@google.com>
5291
5292 PR gold/12316
5293 * object.h (class Sized_relobj): Remove clear_local_symbols.
5294 * reloc.cc (Sized_relobj::do_relocate): Don't call
5295 clear_local_symbols.
5296
5297 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
5298
5299 * plugin.cc (is_visible_from_outside): Return true for symbols
5300 in the -u option.
5301
5302 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5303
5304 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5305 filename.
5306
5307 2011-02-02 Sriraman Tallam <tmsriram@google.com>
5308
5309 * icf.h (is_section_foldable_candidate): Change type of parameter
5310 to std::string.
5311 * icf.cc (Icf::find_identical_sections): Change type of local variable
5312 section_name to be std::string.
5313 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5314
5315 2011-01-25 Ian Lance Taylor <iant@google.com>
5316
5317 * script.cc (script_add_extern): Rewrite to use
5318 add_symbol_reference.
5319
5320 2011-01-25 Doug Kwan <dougkwan@google.com>
5321
5322 * icf.cc (get_section_contents): Always lock section's object.
5323
5324 2011-01-24 Ian Lance Taylor <iant@google.com>
5325
5326 * options.h (class General_options): Accept
5327 --no-detect-odr-violations.
5328
5329 2011-01-24 Ian Lance Taylor <iant@google.com>
5330
5331 * version.cc (version_string): Bump to 1.11.
5332
5333 2011-01-24 Ian Lance Taylor <iant@google.com>
5334
5335 * plugin.cc (class Plugin_rescan): Define new class.
5336 (Plugin_manager::claim_file): Set any_claimed_.
5337 (Plugin_manager::save_archive): New function.
5338 (Plugin_manager::save_input_group): New function.
5339 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5340 necessary.
5341 (Plugin_manager::new_undefined_symbol): New function.
5342 (Plugin_manager::rescan): New function.
5343 (Plugin_manager::rescannable_defines): New function.
5344 (Plugin_manager::add_input_file): Set any_added_.
5345 * plugin.h (class Plugin_manager): define new fields rescannable_,
5346 undefined_symbols_, any_claimed_, and any_added_. Declare
5347 Plugin_rescan as friend. Declare new functions.
5348 (Plugin_manager::Rescannable): Define type.
5349 (Plugin_manager::Rescannable_list): Define type.
5350 (Plugin_manager::Undefined_symbol_list): Define type.
5351 (Plugin_manager::Plugin_manager): Initialize new fields.
5352 * archive.cc (Archive::defines_symbol): New function.
5353 (Add_archive_symbols::run): Pass archive to plugins if any.
5354 * archive.h (class Archive): Declare defines_symbol.
5355 * readsyms.cc (Input_group::~Input_group): New function.
5356 (Finish_group::run): Pass input_group to plugins if any.
5357 * readsyms.h (class Input_group): Declare destructor.
5358 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5359 any.
5360
5361 2011-01-10 Ian Lance Taylor <iant@google.com>
5362
5363 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5364 section as relro.
5365 (Layout::set_segment_offsets): Reset increase_relro before calling
5366 set_section_addresses a second time.
5367
5368 2011-01-04 Cary Coutant <ccoutant@google.com>
5369
5370 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5371 sections before NOBITS sections.
5372
5373 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5374
5375 * version.cc (print_version): Update copyright to 2011.
5376
5377 2010-12-23 Cary Coutant <ccoutant@google.com>
5378
5379 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5380 of OS to this->add. Add OD parameter to second form of the function.
5381
5382 2010-12-20 Ian Lance Taylor <iant@google.com>
5383
5384 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5385 second of two consecutive entries with same offset.
5386
5387 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5388
5389 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5390 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5391 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5392 to avoid unneeded links against $(LDADD).
5393 * testsuite/Makefile.in: Regenerate.
5394
5395 2010-12-15 Ian Lance Taylor <iant@google.com>
5396
5397 PR gold/12324
5398 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5399 for R_X86_64_32 and R_X86_64_PC32.
5400 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5401 ver_matching_def_pic.o.
5402 (ver_matching_def_pic.o): New target.
5403
5404 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5405
5406 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5407 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5408 Move definition before File_read::View member definitions.
5409 (File_read::View::~View): Initialize and hold lock before
5410 updating current_mapped_bytes.
5411
5412 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5413
5414 * dwarf_reader.cc: Remove outdated comment.
5415 * gold-threads.cc: Fix typo in error message.
5416 * archive.cc: Fix typos in comments.
5417 * archive.h: Likewise.
5418 * arm-reloc-property.cc: Likewise.
5419 * arm-reloc-property.h: Likewise.
5420 * arm-reloc.def: Likewise.
5421 * arm.cc: Likewise.
5422 * attributes.h: Likewise.
5423 * cref.cc: Likewise.
5424 * ehframe.cc: Likewise.
5425 * fileread.h: Likewise.
5426 * gold.h: Likewise.
5427 * i386.cc: Likewise.
5428 * icf.cc: Likewise.
5429 * incremental.h: Likewise.
5430 * int_encoding.cc: Likewise.
5431 * layout.h: Likewise.
5432 * main.cc: Likewise.
5433 * merge.h: Likewise.
5434 * object.cc: Likewise.
5435 * object.h: Likewise.
5436 * options.cc: Likewise.
5437 * readsyms.cc: Likewise.
5438 * reduced_debug_output.cc: Likewise.
5439 * reloc.cc: Likewise.
5440 * script-sections.cc: Likewise.
5441 * sparc.cc: Likewise.
5442 * symtab.h: Likewise.
5443 * target-reloc.h: Likewise.
5444 * target.cc: Likewise.
5445 * target.h: Likewise.
5446 * timer.cc: Likewise.
5447 * timer.h: Likewise.
5448 * x86_64.cc: Likewise.
5449
5450 2010-12-09 Cary Coutant <ccoutant@google.com>
5451
5452 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5453 stack.
5454 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5455 parameter; change all callers.
5456 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5457 * options.h (warn_execstack): New option.
5458
5459 2010-12-07 Doug Kwan <dougkwan@google.com>
5460
5461 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5462 like function call relocations.
5463
5464 2010-12-07 Ian Lance Taylor <iant@google.com>
5465
5466 * archive.cc (Archive::get_elf_object_for_member): Permit
5467 punconfigured to be NULL.
5468 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5469 (Archive::include_member): Pass NULL to get_elf_object_for_member
5470 if we searched for the archive and this is the first included
5471 object.
5472
5473 2010-12-01 Ian Lance Taylor <iant@google.com>
5474
5475 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5476 track_relocs_type_ field.
5477 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5478 Set track_relocs_type_.
5479 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5480 contents when using RELA relocs.
5481 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5482 reloc_map_.
5483 * reloc.cc (Track_relocs::next_addend): New function.
5484 * reloc.h (class Track_relocs): Declare next_addend.
5485
5486 2010-12-01 Ian Lance Taylor <iant@google.com>
5487
5488 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5489 virtual destructor.
5490
5491 2010-12-01 Ian Lance Taylor <iant@google.com>
5492
5493 * README: Update compilers known to work and fail.
5494
5495 2010-11-23 Matthias Klose <doko@ubuntu.com>
5496
5497 * configure.in: For --enable-gold, handle value `default' instead of
5498 `both*'. Always install ld as ld.bfd, install as ld if gold is
5499 not the default.
5500 * configure: Regenerate.
5501
5502 2010-11-18 Doug Kwan <dougkwan@google.com>
5503
5504 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5505 and right_alignment to be zero. Store result alignment only if it is
5506 greater than existing alignment.
5507
5508 2010-11-16 Cary Coutant <ccoutant@google.com>
5509
5510 PR gold/12220
5511 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5512 Check for ".zdebug_line".
5513
5514 2010-11-16 Doug Kwan <dougkwan@google.com>
5515 Cary Coutant <ccoutant@google.com>
5516
5517 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5518 by reference; adjust all callers.
5519 * output.cc (Output_segment::set_section_addresses): Adjust references
5520 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5521 list is empty.
5522 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5523 end at page boundary.
5524
5525 2010-11-16 Cary Coutant <ccoutant@google.com>
5526
5527 PR gold/12220
5528 * layout.cc (Layout::choose_output_section): Transform names of
5529 compressed sections even when using a script with a SECTIONS clause.
5530 (Layout::output_section_name): Remove code to transform
5531 compressed debug section names.
5532 * output.cc (Output_section::add_input_section): Use uncompressed
5533 section size when tracking input sections.
5534
5535 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5536
5537 * symtab.h (Symbol::NON_PIC_REF): Remove.
5538 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5539 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5540 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5541 (Symbol::use_plt_offset): Take a flags argument and pass it
5542 directly to needs_dynamic_reloc. Restrict check for undefined
5543 weak symbols to function calls.
5544 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5545 (Target_arm::Scan::global): Use it.
5546 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5547 (Target_arm::Relocate::relocate): Likewise.
5548 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5549 parameter with an r_type parameter. Use get_reference_flags
5550 to get the flags.
5551 (Target_arm::Relocate::relocate): Update accordingly.
5552 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5553 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5554 (Target_i386::Scan::global): Likewise.
5555 (Target_i386::Relocate::relocate): Likewise.
5556 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5557 parameter with an r_type parameter. Use get_reference_flags
5558 to get the flags.
5559 (Target_i386::Relocate::relocate): Update accordingly.
5560 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5561 (Target_powerpc::Scan::global): Use it.
5562 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5563 (Target_powerpc::Relocate::relocate): Likewise.
5564 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5565 (Target_sparc::Scan::global): Use it.
5566 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5567 (Target_sparc::Relocate::relocate): Likewise.
5568 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5569 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5570 (Target_x86_64::Scan::global): Likewise.
5571 (Target_x86_64::Relocate::relocate): Likewise.
5572
5573 2010-11-08 Doug Kwan <dougkwan@google.com>
5574 Cary Coutant <ccoutant@google.com>
5575
5576 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5577 (Arm_exidx_merge_section::section_contents_): New data member.
5578 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5579 (Arm_input_section::~Arm_input_section): De-allocate memory.
5580 (Arm_input_section::original_contents_): New data member.
5581 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5582 in parameters instead of calling Object::section_contents without
5583 locking.
5584 (Arm_output_section::group_section): New parameter TASK. Pass it
5585 to callees that need locking objects.
5586 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5587 to lock EXIDX input sections. Fix a formatting issue. Call
5588 Arm_exidx_merged_section::build_contents to create merged section
5589 contents.
5590 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5591 to lock object of stub table owner.
5592 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5593 TEXT_SIZE to initialize data member TEXT_SIZE_.
5594 (Arm_exidx_input_section::addralign): Fix typo in comment.
5595 (Arm_exidx_input_section::text_size): New method.
5596 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5597 that require locking objects. Lock objects before scanning for stubs
5598 and updating local symbols.
5599 (Arm_input_section<big_endian>::init): Copy contents of original
5600 input section.
5601 (Arm_input_section<big_endian>::do_write): Use saved contents of
5602 original input section instead of calling Object::section_contents
5603 without locking.
5604 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5605 size without calling Object::section_size().
5606 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5607 for size. Allocate a buffer for merged EXIDX entries.
5608 (Arm_exidx_merged_section::build_contents): New method.
5609 (Arm_exidx_merged_section::do_write): Move merge section contents
5610 building code to Arm_exidx_merged_section::build_contetns. Write
5611 out contetns in buffer instead of building it on the fly.
5612 (Arm_relobj::make_exidx_input_section): Also pass text section size
5613 to Arm_exidx_input_section constructor.
5614 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5615 (Arm_dynobj::do_read_symbols): Fix memory leak.
5616 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5617 * target.h: (class Task): Add forward declaration.
5618 (Target::relax): Add new parameter TASK and pass it to
5619 Target::do_relax().
5620 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5621
5622 2010-11-05 Cary Coutant <ccoutant@google.com>
5623
5624 PR gold/10708
5625 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5626 object when reading from the file.
5627 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5628 second layout pass.
5629 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5630 when reading section contents.
5631 (get_section_contents): Likewise.
5632 (icf::find_identical_sections): Likewise.
5633 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5634 object when reading from the file.
5635 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5636 the object when doing deferred section layout.
5637
5638 2010-11-03 Nick Clifton <nickc@redhat.com>
5639
5640 PR gold/12001
5641 * script.h (class Symbol_assignment: name): New member. Returns
5642 the name of the symbol.
5643 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5644 Returns true if the given symbol name is on the list of
5645 assignments wating to be processed.
5646 * archive.cc (should_incldue_member): If the symbol is undefined,
5647 check to see if it is on the list of symbols pending assignment.
5648
5649 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5650
5651 * script-sections.cc (Script_sections::find_memory_region): Check
5652 for a NULL output section pointer.
5653
5654 2010-10-29 Doug Kwan <dougkwan@google.com>
5655
5656 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5657 Output_section::add_relaxed_input_section.
5658 * output.cc (Output_section::add_relaxed_input_section): Add new
5659 arguments LAYOUT and NAME. Set section order index.
5660 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5661 Copy section order index.
5662 * output.h (Output_section::add_relaxed_input_section): Add new
5663 arguments LAYOUT and NAME.
5664
5665 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5666
5667 * testsuite/Makefile.am: Move gcctestdir/ld rule to
5668 NATIVE_OR_CROSS_LINKER.
5669 * testsuite/Makefile.in: Regenerate.
5670
5671 2010-10-20 Doug Kwan <dougkwan@google.com>
5672
5673 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5674 without SHF_LINK_ORDER flags.
5675 * layout.cc (Layout::choose_output_section): Do not filter
5676 SHF_LINK_ORDER flag in a relocatable link.
5677
5678 2010-10-17 Cary Coutant <ccoutant@google.com>
5679
5680 * output.h (Output_segment::set_section_addresses): Change function
5681 signature. Update all callers.
5682 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5683 sections.
5684 (Output_segment::set_section_addresses): Align after last TLS
5685 section. Add padding before last relro section instead of after.
5686
5687 2010-10-17 Doug Kwan <dougkwan@google.com>
5688
5689 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5690 GOT output section to be writable.
5691
5692 2010-10-14 Cary Coutant <ccoutant@google.com>
5693
5694 * debug.h (DEBUG_INCREMENTAL): New flag.
5695 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5696 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5697 mode.
5698 * incremental.cc (report_command_line): Ignore all forms of
5699 --incremental.
5700 * layout.cc (Layout::Layout): Check parameters for incremental link
5701 mode.
5702 * options.cc (General_options::parse_incremental): New function.
5703 (General_options::parse_no_incremental): New function.
5704 (General_options::parse_incremental_full): New function.
5705 (General_options::parse_incremental_update): New function.
5706 (General_options::incremental_mode_): New data member.
5707 (General_options::finalize): Check incremental_mode_.
5708 * options.h (General_options): Update help text for --incremental.
5709 Add --no-incremental, --incremental-full, --incremental-update.
5710 (General_options::Incremental_mode): New enum type.
5711 (General_options::incremental_mode): New function.
5712 (General_options::incremental_mode_): New data member.
5713 * parameters.cc (Parameters::incremental_mode_): New data member.
5714 (Parameters::set_options): Set incremental_mode_.
5715 (Parameters::set_incremental_full): New function.
5716 (Parameters::incremental): New function.
5717 (Parameters::incremental_update): New function.
5718 (set_parameters_incremental_full): New function.
5719 * parameters.h (Parameters::set_incremental_full): New function.
5720 (Parameters::incremental): New function.
5721 (Parameters::incremental_update): New function.
5722 (Parameters::incremental_mode_): New data member.
5723 (set_parameters_incremental_full): New function.
5724 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5725 incremental link mode.
5726 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5727 (Sized_relobj::do_relocate_sections): Likewise.
5728 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5729 option.
5730 * testsuite/Makefile.in: Regenerate.
5731 * testsuite/incremental_test.sh: Filter all forms of --incremental.
5732
5733 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5734
5735 * script-sections.h (class Script_sections): Make
5736 Sections_elements typedef public.
5737 * script-sections.cc (class Sort_output_sections): Add elements_
5738 field. Add constructor which sets it; change all callers.
5739 (Sort_output_sections::is_before): New function.
5740 (Sort_output_sections::operator()): Call is_before.
5741 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5742 conditional.
5743 * testsuite/script_test_10.sh: New test. Test script section
5744 order.
5745 * testsuite/script_test_10.t: Likewise.
5746 * testsuite/script_test_10.s: Likewise.
5747 * testsuite/Makefile.am: Wrap the cross linker tests and the
5748 common tests into NATIVE_OR_CROSS_LINKER.
5749 (check_SCRIPTS): Add script_test_10.sh.
5750 (check_DATA): Add script_test_10.stdout.
5751 (script_test_10.o, script_test_10): New targets.
5752 (script_test_10.stdout): New target.
5753 * configure, testsuite/Makefile.in: Regenerate.
5754
5755 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5756
5757 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5758 error for the deprecated relocations.
5759 (Target_arm::Scan::global): Likewise.
5760 (Target_arm::Relocate::relocate): Likewise.
5761
5762 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5763
5764 * fileread.cc (Input_file::find_file): Initialize *found_name
5765 and *namep when using the fallback search for case 4.
5766
5767 2010-10-11 Cary Coutant <ccoutant@google.com>
5768
5769 * options.h (class General_options): Redefine -z lazy as an alias for
5770 the negation of -z now.
5771
5772 2010-10-11 Ian Lance Taylor <iant@google.com>
5773
5774 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5775 binding.
5776
5777 2010-10-06 Nick Clifton <nickc@redhat.com>
5778
5779 * script-sections.cc(class Memory_region): Remove
5780 current_lma_offset_ field. Rename current_vma_offset_ to
5781 current_offset_. Add last_section_ field.
5782 (Memory_region::get_current_vma_address): Rename to
5783 get_current_address.
5784 (Memory_region::get_current_lma_address): Delete.
5785 (Memory_region::increment_vma_offset): Rename to
5786 increment_offset.
5787 (Memory_region::increment_lma_offset): Delete.
5788 (Memory_region::attributes_compatible): New method. Returns
5789 true if the provided section is compatible with the region.
5790 (Memory_region::get_last_section): New method. Returns the last
5791 section to use the region.
5792 (Memory_region::set_last_section): New method. Stores the last
5793 section to use the region.
5794 (Script_sections::block_in_region): New method. Returns true if
5795 a block of memory is contained within a region.
5796 (Script_sections::find_memory_region): New method. Locates a
5797 memory region to be used to set a VMA or LMA address.
5798 (Output_section_definition::set_section_addresses): Add code to
5799 check for addresses set by memory regions.
5800 (Output_segment::set_section_addresses): Remove memory region
5801 walking code.
5802 (Script_sections::create_segment): Add a warning if a header
5803 segment is created outside of any region.
5804 * script-sections.h (class Script_sections): Add prototypes for
5805 find_memory_region and block_in_region methods.
5806 * testsuite/memory_test.s: Use .long instead of .word.
5807 * testsuite/memory_test.t: Add some more output sections.
5808 * testsuite/memory_test.sh: Update expected output.
5809
5810 2010-10-02 Doug Kwan <dougkwan@google.com>
5811
5812 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5813 defintion to symtab.h
5814 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5815 declaration to defintion.
5816
5817 2010-10-01 Nick Clifton <nickc@redhat.com>
5818
5819 * expression.cc (eval): Replace dummy argument with NULL.
5820 (eval_maybe_dot): Check for a NULL result section pointer.
5821 (Symbol_expression::value): Likewise.
5822 (Dot_expression::value): Likewise.
5823 (BINARY_EXPRESSION): Likewise.
5824 (Max_expression::value): Likewise.
5825 (Min_expression::value): Likewise.
5826 (Absolute_expression::value): Likewise.
5827 (Addr_expression::value_from_output_section): Likewise.
5828 (Loaddddr_expression::value_from_output_section): Likewise.
5829 (Segment_start_expression::value): Likewise.
5830 * script-sections.cc
5831 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5832 argument with NULL.
5833 (Sections_elememt_dot_assignment::set_section_addresses):
5834 Likewise.
5835 (Output_data_expression::do_write_to_buffer): Likewise.
5836 (Output_section_definition::finalize_symbols): Likewise.
5837 (Output_section_definition::set_section_addresses): Likewise.
5838
5839 2010-09-30 Doug Kwan <dougkwan@google.com>
5840
5841 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5842
5843 2010-09-28 Sriraman Tallam <tmsriram@google.com>
5844
5845 * target.h (Target::can_icf_inline_merge_sections): New virtual
5846 function.
5847 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5848 virtual function.
5849 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5850 virtual function.
5851 * icf.cc (get_section_contents): Inline merge sections only when
5852 target allows it.
5853
5854 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5855
5856 * configure: Regenerate.
5857
5858 2010-09-17 Ian Lance Taylor <iant@google.com>
5859
5860 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
5861 * testsuite/Makefile.am (memory_test.o): New target.
5862 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5863 memory_test.t.
5864 * testsuite/Makefile.in: Rebuild.
5865
5866 2010-09-17 Doug Kwan <dougkwan@google.com>
5867
5868 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5869 defintion if relocation uses GOT entries of the symbol.
5870 * testsuite/icf_safe_test.sh: Fix test.
5871 * testsuite/icf_safe_so_test.sh: Fix test.
5872
5873 2010-09-16 Cary Coutant <ccoutant@google.com>
5874
5875 * script_sections.cc (class Memory_region): Remove "NULL" from
5876 vector initializations.
5877
5878 2010-09-15 Cary Coutant <ccoutant@google.com>
5879
5880 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5881 Resolve forwarding symbols.
5882
5883 2010-09-15 Doug Kwan <dougkwan@google.com>
5884
5885 * gold/testsuite/script_test_3.t: Add ARM special sections.
5886 * gold/testsuite/script_test_4.t: Same.
5887 * gold/testsuite/script_test_5.t: Same.
5888 * gold/testsuite/script_test_6.t: Same.
5889 * gold/testsuite/script_test_7.t: Same.
5890 * gold/testsuite/script_test_7.t: Same.
5891 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5892
5893 2010-09-14 Cary Coutant <ccoutant@google.com>
5894
5895 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5896 (Target_x86_64::Relocate::relocate_tls): Replace check for
5897 saw_tls_block_reloc_ with test for executable section.
5898
5899 2010-09-12 Cary Coutant <ccoutant@google.com>
5900
5901 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5902 position-independent executables to shared libraries need dynamic
5903 relocations.
5904 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5905 position-independent executables.
5906 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5907 * testsuite/Makefile.in: Regenerate.
5908
5909 2010-09-10 Nick Clifton <nickc@redhat.com>
5910
5911 PR gold/11997
5912 * testsuite/memory_test.t: Discard any sections that are not
5913 needed.
5914
5915 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5916
5917 PR gold/11996
5918 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5919 "This::" to work around a bug in gcc 4.2.
5920
5921 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5922
5923 2010-09-09 Rafael Espindola <espindola@google.com>
5924
5925 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5926 sections with different PF_X flags in the same segment.
5927 (Layout::find_first_load_seg): Search all segments to find the first
5928 one.
5929 * options.h (rosegment): New.
5930
5931 2010-09-08 Rafael Espindola <espindola@google.com>
5932
5933 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
5934
5935 2010-09-08 Doug Kwan <dougkwan@google.com>
5936
5937 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5938 (Arm_relobj::do_relocate_sections): Add new parameter for output
5939 file to match the parent.
5940 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5941 of local symbols instead of input values. Update code to track
5942 changes in gold::relocate_section.
5943 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5944 (Sized_relobj::compute_final_local_value_internal): New methods.
5945 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5946 body into private version of Sized_relobj::compute_final_local_value.
5947 Call the inline method.
5948 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5949 merged symbol value if there is one.
5950 (Symbol_value::has_output_value): New method defintiion.
5951 (Sized_relobj::Compute_final_local_value_status): New enum type.
5952 (Sized_relobj::compute_final_local_value): New methods.
5953 (Sized_relobj::compute_final_local_value_internal): New methods.
5954 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5955 and arm_cortex_a8.sh.
5956 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5957 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5958 New tests.
5959 * Makefile.in: Regenerate.
5960 * testsuite/arm_bl_out_of_range.s: Update test.
5961 * testsuite/thumb_bl_out_of_range.s: Ditto.
5962 * testsuite/thumb_blx_out_of_range.s: Ditto.
5963 * testsuite/arm_branch_out_of_range.sh: New file.
5964 * testsuite/arm_cortex_a8.sh: Ditto.
5965 * testsuite/arm_cortex_a8_b.s: Ditto.
5966 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5967 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5968 * testsuite/arm_cortex_a8_bl.s: Ditto.
5969 * testsuite/arm_cortex_a8_blx.s: Ditto.
5970 * testsuite/arm_cortex_a8_local.s: Ditto.
5971 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5972 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5973
5974 2010-09-08 Rafael Espindola <espindola@google.com>
5975
5976 * Makefile.am (memory_test.stdout): Run readelf with -W.
5977 * Makefile.in: Regenerate.
5978 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5979 64 bit output.
5980
5981 2010-09-08 Rafael Espindola <espindola@google.com>
5982
5983 * script-sections.cc (Script_sections::add_memory_region): Convert
5984 field precision to int.
5985 * script.cc (script_set_section_region, script_set_section_region):
5986 Convert field precision to int.
5987
5988 2010-09-08 Rafael Espindola <espindola@google.com>
5989
5990 * arm.cc (do_finalize_sections): Create the __exidx_start and
5991 __exdix_end symbols even when the section is missing.
5992
5993 2010-09-08 Nick Clifton <nickc@redhat.com>
5994
5995 * README: Remove claim that MEMORY is not supported.
5996 * expression.cc (script_exp_function_origin)
5997 (script_exp_function_length): Move from here to ...
5998 * script.cc: ... here.
5999 (script_set_section_region, script_add_memory)
6000 (script_parse_memory_attr, script_include_directive): New
6001 functions.
6002 * script-sections.cc
6003 (class Memory_region): New class.
6004 (class Output_section_definition): Add set_memory_region,
6005 set_section_vma, set_section_lma and get_section_name methods.
6006 (class Script_Sections): Add add_memory_region,
6007 find_memory_region, find_memory_region_origin,
6008 find_memory_region_length and set_memory_region methods.
6009 Have set_section_addresses method walk the list of set memory
6010 regions.
6011 Extend the print methos to display memory regions.
6012 * script-sections.h: Add prototypes for new methods.
6013 Add enum for MEMORY region attributes.
6014 * yyscript.y: Add support for parsing MEMORY regions.
6015 * script-c.h: Add prototypes for new functions.
6016 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6017 * testsuite/Makefile.in: Regenerate.
6018 * testsuite/memory_test.sh: New script.
6019 * testsuite/memory_test.s: New assembler source file.
6020 * testsuite/memory_test.t: New linker script.
6021
6022 2010-08-27 Doug Kwan <dougkwan@google.com>
6023
6024 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6025 reference override an existing dynamic weak reference.
6026 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6027 * testsuite/Makefile.in: Regenerate.
6028 * testsuite/dyn_weak_ref.sh: New file.
6029 * testsuite/dyn_weak_ref_1.c: Ditto.
6030 * testsuite/dyn_weak_ref_2.c: Ditto.
6031
6032 2010-08-27 Ian Lance Taylor <iant@google.com>
6033
6034 * incremental.h (class Incremental_input_entry): Add virtual
6035 destructor.
6036
6037 2010-08-27 Ian Lance Taylor <iant@google.com>
6038
6039 * testsuite/start_lib_test_3.c: Mark t3 as used.
6040
6041 2010-08-27 Nick Clifton <nickc@redhat.com>
6042
6043 * options.cc (version_script): Fix small typo in previous
6044 whitespace tidyup.
6045
6046 2010-08-25 Nick Clifton <nickc@redhat.com>
6047
6048 * archive.cc: Formatting fixes: Remove whitespace between
6049 typename and following asterisk. Remove whitespace between
6050 function name and opening parenthesis.
6051 * archive.h: Likewise.
6052 * arm.cc: Likewise.
6053 * attributes.cc: Likewise.
6054 * attributes.h: Likewise.
6055 * common.cc: Likewise.
6056 * copy-relocs.cc: Likewise.
6057 * dirsearch.h: Likewise.
6058 * dynobj.cc: Likewise.
6059 * ehframe.cc: Likewise.
6060 * ehframe.h: Likewise.
6061 * expression.cc: Likewise.
6062 * fileread.cc: Likewise.
6063 * fileread.h: Likewise.
6064 * gc.h: Likewise.
6065 * gold-threads.cc: Likewise.
6066 * gold.cc: Likewise.
6067 * i386.cc: Likewise.
6068 * icf.h: Likewise.
6069 * incremental-dump.cc: Likewise.
6070 * incremental.cc: Likewise.
6071 * layout.cc: Likewise.
6072 * layout.h: Likewise.
6073 * main.cc: Likewise.
6074 * merge.cc: Likewise.
6075 * merge.h: Likewise.
6076 * object.cc: Likewise.
6077 * object.h: Likewise.
6078 * options.cc: Likewise.
6079 * options.h: Likewise.
6080 * output.cc: Likewise.
6081 * output.h: Likewise.
6082 * plugin.cc: Likewise.
6083 * plugin.h: Likewise.
6084 * powerpc.cc: Likewise.
6085 * reloc.cc: Likewise.
6086 * script-c.h: Likewise.
6087 * script-sections.cc: Likewise.
6088 * script.cc: Likewise.
6089 * stringpool.cc: Likewise.
6090 * symtab.cc: Likewise.
6091 * symtab.h: Likewise.
6092 * target.cc: Likewise.
6093 * timer.cc: Likewise.
6094 * timer.h: Likewise.
6095 * version.cc: Likewise.
6096 * x86_64.cc: Likewise.
6097
6098 2010-08-24 Nick Clifton <nickc@redhat.com>
6099
6100 PR 11899
6101 * layout.cc (segment_precedes): Sort segments by their physical
6102 addresses, if they have been set.
6103
6104 2010-08-23 Cary Coutant <ccoutant@google.com>
6105
6106 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6107 symbols data.
6108 (Lib_group::include_member): Unlock object after deleting its
6109 symbols data.
6110 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6111 the bug fixed here.
6112
6113 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6114 Cary Coutant <ccoutant@google.com>
6115
6116 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6117 constructor, and set_blocker.
6118 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6119 readsyms_blocker_.
6120 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6121 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6122 * testsuite/Makefile.am (start_lib_test): New test case.
6123 * testsuite/Makefile.in: Regenerate.
6124 * testsuite/start_lib_test_main.c: New file.
6125 * testsuite/start_lib_test_1.c: New file.
6126 * testsuite/start_lib_test_2.c: New file.
6127 * testsuite/start_lib_test_3.c: New file.
6128
6129 2010-08-19 Ian Lance Taylor <iant@google.com>
6130
6131 * Makefile.in: Rebuild with automake 1.11.1.
6132 * aclocal.m4: Likewise.
6133 * testsuite/Makefile.in: Likewise.
6134
6135 2010-08-19 Ian Lance Taylor <iant@google.com>
6136
6137 PR 10893
6138 * i386.cc (class Output_data_plt_i386): Update declarations.
6139 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6140 local_ifuncs_ fields.
6141 (Target_i386::do_plt_section_for_global): New function.
6142 (Target_i386::do_plt_section_for_local): New function.
6143 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6144 parameter; change all callers. Initialize global_ifuncs_ and
6145 local_ifuncs_. If doing a static link define __rel_iplt_start and
6146 __rel_iplt_end.
6147 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6148 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6149 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6150 symbols.
6151 (Target_i386::make_plt_section): New function, broken out of
6152 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6153 (Target_i386::make_plt_entry): Call make_plt_section.
6154 (Target_i386::make_local_ifunc_plt_entry): New function.
6155 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6156 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6157 R_386_IRELATIVE to switch.
6158 (Target_i386::Scan::global): Likewise.
6159 (Target_i386::Relocate::relocate): Likewise.
6160 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6161 switch.
6162 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6163 (Target_x86_64::do_plt_section_for_global): New function.
6164 (Target_x86_64::do_plt_section_for_local): New function.
6165 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6166 parameter; change all callers. If doing a static link define
6167 __rela_iplt_start and __rela_iplt_end.
6168 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6169 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6170 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6171 to point to .plt.
6172 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6173 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6174 switch.
6175 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6176 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6177 R_X86_64_IRELATIVE to switch.
6178 (Target_x86_64::Scan::global): Likewise.
6179 (Target_x86_64::Relocate::relocate): Likewise.
6180 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6181 switch.
6182 * target.h (class Target): Add plt_section_for_global and
6183 plt_section_for_local functions. Add do_plt_section_for_global
6184 and do_plt_section_for_local virtual functions.
6185 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6186 clarifying comments.
6187 (Symbol::use_plt_offset): Handle IFUNC symbol.
6188 * object.cc (Sized_relobj::Sized_relobj): Initialize
6189 local_plt_offsets_.
6190 (Sized_relobj::local_has_plt_offset): New function.
6191 (Sized_relobj::local_plt_offset): New function.
6192 (Sized_relobj::set_local_plt_offset): New function.
6193 (Sized_relobj::do_count): Handle IFUNC symbol.
6194 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6195 a bit away from input_shndx_ field. Add set_is_func_symbol and
6196 is_ifunc_symbol functions.
6197 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6198 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6199 local_plt_offsets_ field.
6200 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6201 * output.h (class Output_section_data): Add non-const
6202 output_section function.
6203 (class Output_data_got): Update declarations.
6204 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6205 Add use_plt_offset parameter to global and local constructors.
6206 Change all callers. Change local_sym_index_ field to 31 bits.
6207 Change GSYM_CODE and CONSTANT_CODE accordingly.
6208 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6209 doing a static link don't set sh_link field.
6210 (Output_data_got::Got_entry::write): Use PLT offset if
6211 appropriate.
6212 (Output_data_got::add_global_plt): New function.
6213 (Output_data_got::add_local_plt): New function.
6214 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6215 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6216 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6217 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6218 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6219 IFUNC conditional.
6220 * testsuite/ifunc-sel.h: New file.
6221 * testsuite/ifuncmain1.c: New file.
6222 * testsuite/ifuncmain1vis.c: New file.
6223 * testsuite/ifuncmod1.c: New file.
6224 * testsuite/ifuncdep2.c: New file.
6225 * testsuite/ifuncmain2.c: New file.
6226 * testsuite/ifuncmain3.c: New file.
6227 * testsuite/ifuncmod3.c: New file.
6228 * testsuite/ifuncmain4.c: New file.
6229 * testsuite/ifuncmain5.c: New file.
6230 * testsuite/ifuncmod5.c: New file.
6231 * testsuite/ifuncmain6pie.c: New file.
6232 * testsuite/ifuncmod6.c: New file.
6233 * testsuite/ifuncmain7.c: New file.
6234 * configure, testsuite/Makefile.in: Rebuild.
6235
6236 2010-08-18 Ian Lance Taylor <iant@google.com>
6237
6238 * incremental.cc
6239 (Output_section_incremental_inputs::write_input_files): Add cast
6240 to avoid signed/unsigned comparison warning.
6241 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6242
6243 2010-08-12 Cary Coutant <ccoutant@google.com>
6244
6245 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6246
6247 2010-08-13 Ian Lance Taylor <iant@google.com>
6248
6249 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6250
6251 2010-08-12 Cary Coutant <ccoutant@google.com>
6252 Doug Kwan <dougkwan@google.com>
6253
6254 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6255 defintion overrides non-weak undef, remember that the original undef
6256 is not weak.
6257 * symtab.cc (Symbol_table::sized_write_global): For undef without
6258 an original weak binding, set binding to global in output.
6259 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6260 * testsuite/Makefile.in: Regenerate.
6261 * testsuite/strong_ref_weak_def.sh: New file.
6262 * testsuite/strong_ref_weak_def_1.c: Ditto.
6263 * testsuite/strong_ref_weak_def_2.c: Ditto.
6264
6265 2010-08-12 Cary Coutant <ccoutant@google.com>
6266
6267 * testsuite/incremental_test.sh: Rewrite.
6268 * testsuite/incremental_test_1.c: Rewrite.
6269 * testsuite/incremental_test_2.c: Rewrite.
6270
6271 2010-08-12 Cary Coutant <ccoutant@google.com>
6272
6273 * arm.cc (Target_arm::got_size): Add const.
6274 (Target_arm::got_entry_count): New function.
6275 (Target_arm::plt_entry_count): New function.
6276 (Target_arm::first_plt_entry_offset): New function.
6277 (Target_arm::plt_entry_size): New function.
6278 (Output_data_plt_arm::entry_count): New function.
6279 (Output_data_plt_arm::first_plt_entry_offset): New function.
6280 (Output_data_plt_arm::get_plt_entry_size): New function.
6281 * i386.cc (Target_i386::got_size): Add const.
6282 (Target_i386::got_entry_count): New function.
6283 (Target_i386::plt_entry_count): New function.
6284 (Target_i386::first_plt_entry_offset): New function.
6285 (Target_i386::plt_entry_size): New function.
6286 (Output_data_plt_i386::entry_count): New function.
6287 (Output_data_plt_i386::first_plt_entry_offset): New function.
6288 (Output_data_plt_i386::get_plt_entry_size): New function.
6289 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6290 find_incremental_inputs_sections. Dump incremental_got_plt section.
6291 * incremental.cc: Include target.h.
6292 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6293 parameter. Adjust all callers. Find incremental_got_plt section.
6294 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6295 section.
6296 (Output_section_incremental_inputs::set_final_data_size): Calculate
6297 size of incremental_got_plt section.
6298 (Output_section_incremental_inputs::do_write): Write the
6299 incremental_got_plt section.
6300 (Got_plt_view_info): New struct.
6301 (Local_got_offset_visitor): New class.
6302 (Global_got_offset_visitor): New class.
6303 (Global_symbol_visitor_got_plt): New class.
6304 (Output_section_incremental_inputs::write_got_plt): New function.
6305 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6306 Add parameter. Adjust all callers.
6307 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6308 (Incremental_inputs::got_plt_section): New function.
6309 (Incremental_inputs::got_plt_section_): New data member.
6310 (Incremental_got_plt_reader): New class.
6311 * layout.cc (Layout::create_incremental_info_sections): Add the
6312 incremental_got_plt section.
6313 * object.h (Got_offset_list::get_list): New function.
6314 (Got offset_list::for_all_got_offsets): New function.
6315 (Sized_relobj::local_got_offset_list): New function.
6316 * powerpc.cc (Target_powerpc::got_size): Add const.
6317 (Target_powerpc::got_entry_count): New function.
6318 (Target_powerpc::plt_entry_count): New function.
6319 (Target_powerpc::first_plt_entry_offset): New function.
6320 (Target_powerpc::plt_entry_size): New function.
6321 (Output_data_plt_powerpc::entry_count): New function.
6322 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6323 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6324 * sparc.cc (Target_sparc::got_size): Add const.
6325 (Target_sparc::got_entry_count): New function.
6326 (Target_sparc::plt_entry_count): New function.
6327 (Target_sparc::first_plt_entry_offset): New function.
6328 (Target_sparc::plt_entry_size): New function.
6329 (Output_data_plt_sparc::entry_count): New function.
6330 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6331 (Output_data_plt_sparc::get_plt_entry_size): New function.
6332 * symtab.h (Symbol::got_offset_list): New function.
6333 (Symbol_table::for_all_symbols): New function.
6334 * target.h (Sized_target::got_entry_count): New function.
6335 (Sized_target::plt_entry_count): New function.
6336 (Sized_target::plt_entry_size): New function.
6337 * x86_64.cc (Target_x86_64::got_size): Add const.
6338 (Target_x86_64::got_entry_count): New function.
6339 (Target_x86_64::plt_entry_count): New function.
6340 (Target_x86_64::first_plt_entry_offset): New function.
6341 (Target_x86_64::plt_entry_size): New function.
6342 (Output_data_plt_x86_64::entry_count): New function.
6343 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6344 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6345
6346 2010-08-12 Cary Coutant <ccoutant@google.com>
6347
6348 * archive.cc: Include incremental.h.
6349 (Archive::Archive): Initialize incremental_info_.
6350 (Archive::include_member): Record archive members in incremental info.
6351 (Add_archive_symbols::run): Record begin and end of an archive in
6352 incremental info.
6353 (Lib_group::include_member): Record objects in incremental info.
6354 * archive.h (Incremental_archive_entry): Forward declaration.
6355 (Archive::set_incremental_info): New member function.
6356 (Archive::incremental_info): New member function.
6357 (Archive::Unused_symbol_iterator): New class.
6358 (Archive::unused_symbols_begin): New member function.
6359 (Archive::unused_symbols_end): New member function.
6360 (Archive::incremental_info_): New data member.
6361 * incremental-dump.cc (find_input_containing_global): New function.
6362 (dump_incremental_inputs): Dump new incremental info sections.
6363 * incremental.cc: Include symtab.h.
6364 (Output_section_incremental_inputs): New class.
6365 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6366 new incremental info sections.
6367 (Sized_incremental_binary::do_check_inputs): Likewise.
6368 (Incremental_inputs::report_archive): Remove.
6369 (Incremental_inputs::report_archive_begin): New function.
6370 (Incremental_inputs::report_archive_end): New function.
6371 (Incremental_inputs::report_object): New function.
6372 (Incremental_inputs::finalize_inputs): Remove.
6373 (Incremental_inputs::report_input_section): New function.
6374 (Incremental_inputs::report_script): Rewrite.
6375 (Incremental_inputs::finalize): Do nothing but finalize string table.
6376 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6377 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6378 (Incremental_inputs::create_data_sections): New function.
6379 (Incremental_inputs::relocs_entsize): New function.
6380 (Output_section_incremental_inputs::set_final_data_size): New function.
6381 (Output_section_incremental_inputs::do_write): New function.
6382 (Output_section_incremental_inputs::write_header): New function.
6383 (Output_section_incremental_inputs::write_input_files): New function.
6384 (Output_section_incremental_inputs::write_info_blocks): New function.
6385 (Output_section_incremental_inputs::write_symtab): New function.
6386 * incremental.h (Incremental_script_entry): Forward declaration.
6387 (Incremental_object_entry): Forward declaration.
6388 (Incremental_archive_entry): Forward declaration.
6389 (Incremental_inputs): Forward declaration.
6390 (Incremental_inputs_header_data): Remove.
6391 (Incremental_inputs_header): Remove.
6392 (Incremental_inputs_header_write): Remove.
6393 (Incremental_inputs_entry_data): Remove.
6394 (Incremental_inputs_entry): Remove.
6395 (Incremental_inputs_entry_write): Remove.
6396 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6397 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6398 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6399 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6400 Likewise.
6401 (Incremental_input_entry): New class.
6402 (Incremental_script_entry): New class.
6403 (Incremental_object_entry): New class.
6404 (Incremental_archive_entry): New class.
6405 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6406 (Incremental_inputs::report_inputs): Remove.
6407 (Incremental_inputs::report_archive): Remove.
6408 (Incremental_inputs::report_archive_begin): New function.
6409 (Incremental_inputs::report_archive_end): New function.
6410 (Incremental_inputs::report_object): Change prototype.
6411 (Incremental_inputs::report_input_section): New function.
6412 (Incremental_inputs::report_script): Change prototype.
6413 (Incremental_inputs::get_reloc_count): New function.
6414 (Incremental_inputs::set_reloc_count): New function.
6415 (Incremental_inputs::create_data_sections): New function.
6416 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6417 (Incremental_inputs::inputs_section): New function.
6418 (Incremental_inputs::symtab_section): New function.
6419 (Incremental_inputs::relocs_section): New function.
6420 (Incremental_inputs::get_stringpool): Add const.
6421 (Incremental_inputs::command_line): Add const.
6422 (Incremental_inputs::inputs): Remove.
6423 (Incremental_inputs::command_line_key): New function.
6424 (Incremental_inputs::input_file_count): New function.
6425 (Incremental_inputs::input_files): New function.
6426 (Incremental_inputs::relocs_entsize): New function.
6427 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6428 (Incremental_inputs::finalize_inputs): Remove.
6429 (Incremental_inputs::Input_info): Remove.
6430 (Incremental_inputs::lock_): Remove.
6431 (Incremental_inputs::inputs_): Change type.
6432 (Incremental_inputs::inputs_map_): Remove.
6433 (Incremental_inputs::current_object_entry_): New data member.
6434 (Incremental_inputs::inputs_section_): New data member.
6435 (Incremental_inputs::symtab_section_): New data member.
6436 (Incremental_inputs::relocs_section_): New data member.
6437 (Incremental_inputs::reloc_count_): New data member.
6438 (Incremental_inputs_reader): New class.
6439 (Incremental_symtab_reader): New class.
6440 (Incremental_relocs_reader): New class.
6441 * layout.cc (Layout::finalize): Move finalization of incremental info
6442 and creation of incremental info sections to follow finalization of
6443 symbol table. Set offsets for postprocessing sections.
6444 (Layout::create_incremental_info_sections): Call
6445 Incremental_inputs::create_data_sections. Add incremental symtab
6446 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6447 sections to layout after input sections.
6448 * layout.h (struct Timespec): Forward declaration.
6449 (Layout::incremental_inputs): Add const.
6450 (Layout::create_incremental_info_sections): Add parameter.
6451 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6452 * object.cc: Include incremental.h.
6453 (Relobj::finalize_incremental_relocs): New function.
6454 (Sized_relobj::do_layout): Record input sections in incremental info.
6455 * object.h (Object::output_section): New function.
6456 (Object::output_section_offset): Moved from Relobj.
6457 (Object::get_incremental_reloc_base): New function.
6458 (Object::get_incremental_reloc_count): New function.
6459 (Object::do_output_section): New function.
6460 (Object::do_output_section_offset): Moved from Relobj.
6461 (Object::do_get_incremental_reloc_base): New function.
6462 (Object::do_get_incremental_reloc_count): New function.
6463 (Object::Object): Initialize new data members.
6464 (Relobj::output_section): Renamed do_output_section and moved to
6465 protected.
6466 (Relobj::output_section_offset): Moved to Object.
6467 (Relobj::do_get_incremental_reloc_base): New function.
6468 (Relobj::do_get_incremental_reloc_count): New function.
6469 (Relobj::allocate_incremental_reloc_counts): New function.
6470 (Relobj::count_incremental_reloc): New function.
6471 (Relobj::finalize_incremental_relocs): New function.
6472 (Relobj::next_incremental_reloc_index): New function.
6473 (Relobj::reloc_counts_): New data member.
6474 (Relobj::reloc_bases_): New data member.
6475 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6476 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6477 (Sized_relobj::incremental_relocs_scan): New function.
6478 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6479 (Sized_relobj::incremental_relocs_write): New function.
6480 (Sized_relobj::incremental_relocs_write_reltype): New function.
6481 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6482 incremental link.
6483 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6484 archives and object files elsewhere.
6485 (Add_symbols::run): Report object files here.
6486 (Finish_group::run): Report end of archive at end of group.
6487 * reloc.cc: Include layout.h, incremental.h.
6488 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6489 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6490 (Sized_relobj::incremental_relocs_scan): New function.
6491 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6492 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6493 (Sized_relobj::incremental_relocs_write): New function.
6494 (Sized_relobj::incremental_relocs_write_reltype): New function.
6495 * script.cc (read_input_script): Rewrite test for incremental link.
6496 Change call to Incremental_inputs::report_script.
6497 * symtab.h (Symbol_table::first_global_index): New function.
6498 (Symbol_table::output_count): New function.
6499
6500 2010-08-12 Doug Kwan <dougkwan@google.com>
6501
6502 * arm.cc (Target_arm::merge_object_attributes): Check command line
6503 options --no-wchar-size-warning and --no-enum-size-warning.
6504 * options.h (General_options): Add ld-compatible options
6505 --no-enum-size-warning and --no-wchar-size-warning.
6506
6507 2010-08-04 Ian Lance Taylor <iant@google.com>
6508
6509 * x86_64.cc (Target_x86_64::Scan::local): Use
6510 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6511 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6512 (Target_x86_64::Scan::global): Likewise.
6513 (Target_x86_64::Relocate::relocate): Likewise.
6514 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6515 Likewise.
6516
6517 2010-08-03 Cary Coutant <ccoutant@google.com>
6518
6519 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6520 to reserve space in merged_strings vector. Keep total input size
6521 for stats.
6522 (Output_merge_string::do_print_merge_stats): Print total input size.
6523 * merge.h (Output_merge_string): Add input_size_ field.
6524 * stringpool.cc (Stringpool_template::string_length): Move
6525 implementations out of Stringpool_template class and place in
6526 stringpool.h.
6527 * stringpool.h (string_length): Move out of Stringpool_template.
6528
6529 2010-08-03 Ian Lance Taylor <iant@google.com>
6530
6531 PR 11712
6532 * layout.cc (relaxation_loop_body): If address of load segment is
6533 set, adjust address to include headers if possible.
6534
6535 2010-08-03 Ian Lance Taylor <iant@google.com>
6536
6537 * version.cc (version_string): Bump to 1.10.
6538
6539 2010-08-03 Ian Lance Taylor <iant@google.com>
6540
6541 PR 11805
6542 * layout.h (enum Output_section_order): Define.
6543 (class Layout): Update declarations.
6544 * layout.cc (Layout::get_output_section): Add order parameter.
6545 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6546 is_first_non_relro parameters. Change all callers.
6547 (Layout::choose_output_section): Likewise.
6548 (Layout::add_output_section_data): Likewise.
6549 (Layout::make_output_section): Likewise. Set order.
6550 (Layout::default_section_order): New function.
6551 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6552 * output.cc (Output_section::Output_section): Initialize order_.
6553 Don't initialize deleted fields.
6554 (Output_segment::Output_segment): Don't initialize deleted
6555 fields.
6556 (Output_segment::add_output_section_to_load): New function
6557 replacing add_output_section. Change all callers to call this or
6558 add_output_section_to_nonload.
6559 (Output_segment::add_output_section_to_nonload): New function.
6560 (Output_segment::remove_output_section): Rewrite.
6561 (Output_segment::add_initial_output_data): Likewise.
6562 (Output_segment::has_any_data_sections): Likewise.
6563 (Output_segment::is_first_section_relro): Likewise.
6564 (Output_segment::maximum_alignment): Likewise.
6565 (Output_segment::has_dynamic_reloc): New function replacing
6566 dynamic_reloc_count. Change all callers.
6567 (Output_segment::has_dynamic_reloc_list): New function replacing
6568 dynamic_reloc_count_list. Change all callers.
6569 (Output_segment::set_section_addresses): Rewrite.
6570 (Output_segment::set_offset): Rewrite.
6571 (Output_segment::find_first_and_last_list): Remove.
6572 (Output_segment::set_tls_offsets): Rewrite.
6573 (Output_segment::first_section_load_address): Likewise.
6574 (Output_segment::output_section_count): Likewise.
6575 (Output_segment::section_with_lowest_load_address): Likewise.
6576 (Output_segment::write_section_headers): Likewise.
6577 (Output_segment::print_sections_to_map): Likewise.
6578 * output.h (class Output_data): Remove dynamic_reloc_count_
6579 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6580 (Output_data::add_dynamic_reloc): Rewrite.
6581 (Output_data::has_dynamic_reloc): New function.
6582 (Output_data::dynamic_reloc_count): Remove.
6583 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6584 is_last_relro_, is_first_non_relro_, is_interp_,
6585 is_dynamic_linker_section_ fields. Add order and set_order
6586 functions. Remove is_relro_local, set_is_relro_local,
6587 is_last_relro, set_is_last_relro, is_first_non_relro,
6588 set_is_first_non_relro functions, is_interp, set_is_interp,
6589 is_dynamic_linker_section, and set_is_dynamic_linker_section
6590 functions.
6591 (class Output_segment): Change Output_data_list from std::list to
6592 std:;vector. Add output_lists_ field. Remove output_data_ and
6593 output_bss_ fields. Update declarations.
6594
6595 2010-08-02 Ian Lance Taylor <iant@google.com>
6596
6597 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6598 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6599 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6600
6601 2010-08-02 Ian Lance Taylor <iant@google.com>
6602
6603 PR 11855
6604 * script.cc (Script_options::Script_options): Initialize
6605 symbol_definitions_ and symbol_references_.
6606 (Script_options::add_symbol_assignment): Update
6607 symbol_definitions_ and symbol_references_.
6608 (Script_options::add_symbol_reference): New function.
6609 (script_symbol): New function.
6610 * script.h (class Script_options): Add symbol_definitions_ and
6611 symbol_references_ fields.
6612 (Script_options::referenced_const_iterator): New type.
6613 (Script_options::referenced_begin): New function.
6614 (Script_options::referenced_end): New function.
6615 (Script_options::is_referenced): New function.
6616 (Script_options::any_unreferenced): New function.
6617 * script-c.h (script_symbol): Declare.
6618 * yyscript.y (exp): Call script_symbol.
6619 * symtab.cc: Include "script.h".
6620 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6621 Change all callers. Check symbols referenced by scripts.
6622 (Symbol_table::add_undefined_symbols_from_command_line): Add
6623 layout parameter. Change all callers.
6624 (Symbol_table::do_add_undefined_symbols_from_command_line):
6625 Likewise. Break out loop body. Check symbols referenced by
6626 scripts.
6627 (Symbol_table::add_undefined_symbol_from_command_line): New
6628 function broken out of
6629 do_add_undefined_symbols_from_command_line.
6630 * symtab.h (class Symbol_table): Update declarations.
6631 * archive.cc: Include "layout.h".
6632 (Archive::should_include_member): Add layout parameter. Change
6633 all callers. Check for symbol mentioned in expression.
6634 * archive.h (class Archive): Update declaration.
6635 * object.cc (Sized_relobj::do_should_include_member): Add layout
6636 parameter.
6637 * object.h (Object::should_include_member): Add layout parameter.
6638 Change all callers.
6639 (Object::do_should_include_member): Add layout parameter.
6640 (class Sized_relobj): Update declaration.
6641 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6642 parameter.
6643 * dynobj.h (class Sized_dynobj): Update declaration.
6644 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6645 layout parameter.
6646 * plugin.h (class Sized_pluginobj): Update declaration.
6647
6648 2010-08-02 Ian Lance Taylor <iant@google.com>
6649
6650 PR 11866
6651 * output.cc (Output_segment::set_offset): Search for the first and
6652 last sections rather than assuming that the list is in order.
6653 (Output_segment::find_first_and_last_list): New function.
6654 * output.h (class Output_segment): Update declarations.
6655 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6656 (relro_strip_test_SOURCES): New variable.
6657 (relro_strip_test_DEPENDENCIES): New variable.
6658 (relro_strip_test_LDFLAGS): New variable.
6659 (relro_strip_test_LDADD): New variable.
6660 (relro_strip_test.so): New target.
6661
6662 2010-08-02 Ian Lance Taylor <iant@google.com>
6663
6664 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6665 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6666 (Target_i386::got_tlsdesc_section): New function.
6667 (Target_i386::got_section): Create space for GOT entries for
6668 TLSDESC relocations.
6669 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6670 R_386_TLS_GOTDESC.
6671 (Target_i386::Scan::global): Likewise.
6672 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6673 using TLSDESC GOT.
6674 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6675 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6676 (Target_x86_64::got_tlsdesc_section): New function.
6677 (Target_x86_64::got_section): Create space for GOT entries for
6678 TLSDESC relocations.
6679 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6680 R_386_TLS_GOTDESC.
6681 (Target_x86_64::Scan::global): Likewise.
6682 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6683 using TLSDESC GOT.
6684
6685 2010-08-02 Ian Lance Taylor <iant@google.com>
6686
6687 * testsuite/final_layout.sh: Use dc to convert from hex to
6688 decimal.
6689
6690 2010-07-29 Sriraman Tallam <tmsriram@google.com>
6691
6692 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6693 paramter to the call to gold::gc_process_relocs.
6694 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6695 paramter to the call to gold::gc_process_relocs.
6696 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6697 parameter to the call to gold::gc_process_relocs.
6698 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6699 template parameter to the call to gold::gc_process_relocs.
6700 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6701 paramter to the call to gold::gc_process_relocs.
6702 * gc.h (get_embedded_addend_size): New function.
6703 (gc_process_relocs): Save the size of the reloc for use by ICF.
6704 * icf.cc (get_section_contents): Get the addend from the text section
6705 for SHT_REL relocation sections.
6706 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6707 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6708 * int_encoding.h (read_from_pointer): New overloaded function.
6709 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6710 * testsuite/icf_sht_rel_addend_test.sh: New file.
6711 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6712 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6713
6714 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6715
6716 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6717 * Makefile.in: Regenerate.
6718 * testsuite/Makefile.in: Regenerate.
6719
6720 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6721
6722 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6723 * gold/testsuite/debug_msg.cc: Likewise.
6724 * gold/testsuite/odr_violation1.cc
6725 * gold/testsuite/odr_violation2.cc
6726
6727 2010-07-21 Cary Coutant <ccoutant@google.com>
6728
6729 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6730 string, and length fields.
6731 (Output_merge_string::Merged_strings_list): New type.
6732 (Output_merge_string::Merged_strings_lists): New typedef.
6733 (Output_merge_string): Replace merged_strings_ with
6734 merged_strings_lists_.
6735 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6736 Merged_strings_list per input object and section. Don't store pointer
6737 to the string. Don't store length with each merged string entry.
6738 (Output_merge_string::finalize_merged_data): Loop over list of merged
6739 strings lists. Recompute length of each merged string.
6740
6741 2010-07-15 Cary Coutant <ccoutant@google.com>
6742
6743 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6744 here.
6745
6746 2010-07-14 Ian Lance Taylor <iant@google.com>
6747
6748 * descriptors.cc (Descriptors::open): Report correct name in error
6749 message.
6750
6751 2010-07-13 Doug Kwan <dougkwan@google.com>
6752
6753 * arm.cc (Arm_input_section::Arm_input_section): For a
6754 SHT_ARM_EXIDX section, always keeps the input sections.
6755 (Arm_input_section::set_exidx_section_link): New method.
6756 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6757 has_errors_ to false.
6758 (Arm_exidx_input_section::has_errors,
6759 Arm_exidx_input_section::set_has_errors): New methods.
6760 (Arm_exidx_input_section::has_errors_): New data member.
6761 (Arm_relobj::get_exidx_shndx_list): New method.
6762 (Arm_output_section::append_text_sections_to_list): Do not skip
6763 section without SHF_EXECINSTR.
6764 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6765 errors.
6766 (Arm_relobj::make_exidx_input_section): Add new parameter for text
6767 section header. Make error messages more verbose. Check for
6768 a non-executable section linked to an EXIDX section.
6769 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6770 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6771 check that there is no deferred EXIDX section if we exit early.
6772 Instead of not making an EXIDX section in case of an error, make one
6773 and set the has_errors flag of it.
6774 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6775 in a relocatable link.
6776 (Target_arm::do_relax): Look for the EXIDX output section instead of
6777 assuming that it is called .ARM.exidx.
6778 (Target_arm::fix_exidx_coverage): Add a new parameter for input
6779 section list. Do not check for SHF_EXECINSTR section flags but
6780 skip any input section with errors.
6781 * output.cc (Output_section::Output_section): Initialize
6782 always_keeps_input_sections_ to false.
6783 (Output_section::add_input_section): Check for
6784 always_keeps_input_sections_.
6785 * output.h (Output_section::always_keeps_input_sections,
6786 Output_section::set_always_keeps_input_sections): New methods.
6787 (Output_section::always_keeps_input_sections): New data member.
6788
6789 2010-07-13 Rafael Espindola <espindola@google.com>
6790
6791 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6792 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6793
6794 2010-07-13 Philip Herron <herron.philip@googlemail.com>
6795 Ian Lance Taylor <iant@google.com>
6796
6797 * output.h (Output_section_lookup_maps::add_merge_section):
6798 Correct check of whether value was inserted.
6799 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6800 (Output_section_lookup_maps::add_relaxed_input_section):
6801 Likewise.
6802 * arm.cc (Target_arm::got_section): Remove used local os.
6803 * i386.cc (Target_i386::got_section): Likewise.
6804 * x86_64.cc (Target_x86_64::got_section): Likewise.
6805 * sparc.cc (Target_sparc::got_section): Likewise.
6806 (Target_sparc::relocate): Remove unused local have_got_offset.
6807 * powerpc.cc (Target_powerpc::relocate): Likewise.
6808
6809 2010-07-13 Ian Lance Taylor <iant@google.com>
6810
6811 * compressed_output.cc (zlib_decompress): Fix signature in
6812 !HAVE_ZLIB_H case.
6813
6814 * archive.cc (Archive::include_member): Unlock an external member
6815 of a thin archive. Don't bother to delete an object we know is
6816 NULL.
6817
6818 2010-07-12 Cary Coutant <ccoutant@google.com>
6819
6820 * compressed_output.cc (zlib_decompress): New function.
6821 (get_uncompressed_size): New function.
6822 (decompress_input_section): New function.
6823 * compressed_output.h (get_uncompressed_size): New function.
6824 (decompress_input_section): New function.
6825 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6826 Handle compressed debug sections.
6827 * layout.cc (is_compressed_debug_section): New function.
6828 (Layout::output_section_name): Map compressed section names to
6829 canonical names.
6830 * layout.h (is_compressed_debug_section): New function.
6831 (is_debug_info_section): Recognize compressed debug sections.
6832 * merge.cc: Include compressed_output.h.
6833 (Output_merge_data::do_add_input_section): Handle compressed
6834 debug sections.
6835 (Output_merge_string::do_add_input_section): Handle compressed
6836 debug sections.
6837 * object.cc: Include compressed_output.h.
6838 (Sized_relobj::Sized_relobj): Initialize new data members.
6839 (build_compressed_section_map): New function.
6840 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6841 * object.h (Object::section_is_compressed): New method.
6842 (Object::do_section_is_compressed): New method.
6843 (Sized_relobj::Compressed_section_map): New type.
6844 (Sized_relobj::do_section_is_compressed): New method.
6845 (Sized_relobj::compressed_sections_): New data member.
6846 * output.cc (Output_section::add_input_section): Handle compressed
6847 debug sections.
6848 * reloc.cc: Include compressed_output.h.
6849 (Sized_relobj::write_sections): Handle compressed debug sections.
6850
6851 2010-07-08 Cary Coutant <ccoutant@google.com>
6852
6853 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6854 weak when resolving to a dynamic def.
6855 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6856 for weak undef/dynamic def cases. Adjust callers.
6857 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6858 undef_binding_weak_.
6859 (Symbol_table::sized_write_globals): Adjust symbol binding.
6860 (Symbol_table::sized_write_symbol): Add binding parameter.
6861 * symtab.h (Symbol::set_undef_binding): New method.
6862 (Symbol::is_undef_binding_weak): New method.
6863 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6864 (Symbol_table::should_override): Add new parameter.
6865 (Symbol_table::sized_write_symbol): Add new parameter.
6866
6867 * testsuite/weak_undef_file1.cc: Add new test case.
6868 * testsuite/weak_undef_file2.cc: Fix header comment.
6869 * testsuite/weak_undef_test.cc: Add new test case.
6870
6871 2010-06-29 Doug Kwan <dougkwan@google.com>
6872
6873 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6874 Initialize USE_SYMBOL_.
6875 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6876 definition.
6877 (Arm_reloc_property::uses_symbol_): New data member declaration.
6878 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6879 uses symbol value and symbol is undefined but not weakly undefined.
6880
6881 2010-06-28 Rafael Espindola <espindola@google.com>
6882
6883 * plugin.cc (Plugin::load): Use dlerror.
6884
6885 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6886
6887 * symtab.cc (detect_odr_violations): When reporting an ODR
6888 violation, report an object where the symbol is defined.
6889
6890 2010-06-25 Doug Kwan <dougkwan@google.com>
6891
6892 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6893 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6894 definition.
6895 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6896 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6897 target hook to detect function points.
6898 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6899 * icf.h (Icf::check_section_for_function_pointers): Change type of
6900 parameter SECTION_NAME to const reference to std::string. Use
6901 target hook to determine if section may have unsafe pointers.
6902 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6903 method definition.
6904
6905 2010-06-21 Rafael Espindola <espindola@google.com>
6906
6907 * fileread.cc (Input_file::find_fie): New
6908 (Input_file::open): Use Input_file::find_fie.
6909 * fileread.h (Input_file::find_fie): New
6910 * plugin.cc (set_extra_library_path): New.
6911 (Plugin::load): Add set_extra_library_path to the transfer vector.
6912 (Plugin_manager::set_extra_library_path): New.
6913 (Plugin_manager::add_input_file): Use the extra search path if set.
6914 (set_extra_library_path(): New.
6915 * plugin.h (Plugin_manager): Add set_extra_library_path and
6916 extra_search_path_.
6917
6918 2010-06-19 Cary Coutant <ccoutant@google.com>
6919
6920 * layout.cc (gdb_sections): Add .debug_types.
6921 (lines_only_debug_sections): Likewise.
6922
6923 2010-06-18 Rafael Espindola <espindola@google.com>
6924
6925 * plugin.cc (add_input_file,add_input_library)
6926 (Plugin_manager::add_input_file): Make filename arguments const.
6927 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6928 const.
6929
6930 2010-06-16 Doug Kwan <dougkwan@google.com>
6931
6932 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6933 .ARM.attributes section if we have not merged any input
6934 attributes sections.
6935
6936 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6937
6938 * arm.cc: Allow combining objects with no EABI version
6939 information.
6940
6941 2010-06-15 Rafael Espindola <espindola@google.com>
6942
6943 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6944
6945 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6946
6947 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6948 (struct iovec): Correct !HAVE_READV definition.
6949
6950 2010-06-10 Cary Coutant <ccoutant@google.com>
6951
6952 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6953 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6954 reloc sections.
6955 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6956
6957 PR 11683
6958 * symtab.h (Symbol::is_placeholder): New member function.
6959 * target-reloc.h (relocate_section): Check for placeholder symbols.
6960
6961 * testsuite/Makefile.am (plugin_test_8): New test.
6962 (plugin_test_9): New test.
6963 * testsuite/Makefile.in: Regenerate.
6964
6965 2010-06-09 Nick Clifton <nickc@redhat.com>
6966
6967 * yyscript.y (input_list_element): Allow strings prefixed with
6968 the '-' character. Treat these as libraries.
6969 * script.cc (script_add_library): New function. Adds a library
6970 specified by "-l<name>" found in an input script.
6971 * script-c.h: Add prototype for script_add_library.
6972
6973 2010-06-07 Doug Kwan <dougkwan@google.com>
6974
6975 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6976 Restrict stub-group size to be within long conditional branch
6977 range when working around cortex-A8 erratum.
6978
6979 2010-06-07 Damien Diederen <dd@crosstwine.com>
6980
6981 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6982 #ifdef typo.
6983
6984 2010-06-03 Sriraman Tallam <tmsriram@google.com>
6985
6986 PR gold/11658
6987 * output.cc
6988 (Output_section::Input_section_sort_entry::compare_section_ordering):
6989 Change to return non-zero correctly.
6990 (Output_section::Input_section_sort_section_order_index_compare
6991 ::operator()): Change to fix ambiguity in comparisons.
6992
6993 2010-06-01 Sriraman Tallam <tmsriram@google.com>
6994
6995 * gold.h (is_wildcard_string): New function.
6996 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6997 (Layout::layout_eh_frame): Ditto.
6998 (Layout::find_section_order_index): New method.
6999 (Layout::read_layout_from_file): New method.
7000 * layout.h (Layout::find_section_order_index): New method.
7001 (Layout::read_layout_from_file): New method.
7002 (Layout::input_section_position_): New private member.
7003 (Layout::input_section_glob_): New private member.
7004 * main.cc (main): Call read_layout_from_file here.
7005 * options.h (--section-ordering-file): New option.
7006 * output.cc (Output_section::input_section_order_specified_): New
7007 member.
7008 (Output_section::Output_section): Initialize new member.
7009 (Output_section::add_input_section): Add new parameter.
7010 Keep input sections when --section-ordering-file is used.
7011 (Output_section::set_final_data_size): Sort input sections when
7012 section ordering file is specified.
7013 (Output_section::Input_section_sort_entry): Add new parameter.
7014 Check sorting type.
7015 (Output_section::Input_section_sort_entry::compare_section_ordering):
7016 New method.
7017 (Output_section::Input_section_sort_compare::operator()): Change to
7018 consider section_order_index.
7019 (Output_section::Input_section_sort_init_fini_compare::operator()):
7020 Change to consider section_order_index.
7021 (Output_section::Input_section_sort_section_order_index_compare
7022 ::operator()): New method.
7023 (Output_section::sort_attached_input_sections): Change to sort
7024 according to section order when specified.
7025 (Output_section::add_input_section<32, true>): Add new parameter.
7026 (Output_section::add_input_section<64, true>): Add new parameter.
7027 (Output_section::add_input_section<32, false>): Add new parameter.
7028 (Output_section::add_input_section<64, false>): Add new parameter.
7029 * output.h (Output_section::add_input_section): Add new parameter.
7030 (Output_section::input_section_order_specified): New
7031 method.
7032 (Output_section::set_input_section_order_specified): New method.
7033 (Input_section::Input_section): Initialize section_order_index_.
7034 (Input_section::section_order_index): New method.
7035 (Input_section::set_section_order_index): New method.
7036 (Input_section::section_order_index_): New member.
7037 (Input_section::Input_section_sort_section_order_index_compare): New
7038 struct.
7039 (Output_section::input_section_order_specified_): New member.
7040 * script-sections.cc (is_wildcard_string): Delete and move modified
7041 method to gold.h.
7042 (Output_section_element_input::Output_section_element_input): Modify
7043 call to is_wildcard_string.
7044 (Output_section_element_input::Input_section_pattern
7045 ::Input_section_pattern): Ditto.
7046 (Output_section_element_input::Output_section_element_input): Ditto.
7047 * testsuite/Makefile.am (final_layout): New test case.
7048 * testsuite/Makefile.in: Regenerate.
7049 * testsuite/final_layout.cc: New file.
7050 * testsuite/final_layout.sh: New file.
7051
7052 2010-06-01 Rafael Espindola <espindola@google.com>
7053
7054 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7055
7056 2010-06-01 Rafael Espindola <espindola@google.com>
7057
7058 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7059 visibility of symbols.
7060
7061 2010-05-27 Doug Kwan <dougkwan@google.com>
7062
7063 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7064 from start of output section instead of address for a local symbol
7065 in a merged or relaxed section when doing a relocatable link.
7066
7067 2010-05-26 Rafael Espindola <espindola@google.com>
7068
7069 PR 11604
7070 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7071 adding sections the garbage collector removed.
7072 * gold/testsuite/Makefile.am: Add test.
7073 * gold/testsuite/Makefile.in: Regenerate.
7074 * gold/testsuite/plugin_test_7.sh: New.
7075 * gold/testsuite/plugin_test_7_1.c: New.
7076 * gold/testsuite/plugin_test_7_2.c: New.
7077
7078 2010-05-26 Rafael Espindola <espindola@google.com>
7079
7080 * script-sections.cc (Output_section_definition::set_section_addresses):
7081 Check for --section-start.
7082
7083 2010-05-26 Doug Kwan <dougkwan@google.com>
7084
7085 * arm.cc (Arm_scan_relocatable_relocs): New class.
7086 (Target_arm::relocate_special_relocatable): New method.
7087 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7088 (Arm_relocate_functions::thumb_branch_common): Same.
7089 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7090 instead of Default_scan_relocatable_relocs.
7091 * target-reloc.h (relocate_for_relocatable): Let target handle
7092 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7093 * target.h (Sized_target::relocate_special_relocatable): New method.
7094
7095 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7096
7097 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7098
7099 2010-05-23 Doug Kwan <dougkwan@google.com>
7100
7101 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7102 instead of a cast.
7103 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7104 with a direct branch, not a conditional branch, to a stub.
7105 * merge.cc (Output_merge_base::record_input_section): New method
7106 defintion.
7107 (Output_merge_data::do_add_input_section): Record input section if
7108 keeps-input-sections flag is set.
7109 (Output_merge_string::do_add_input_section): Ditto.
7110 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7111 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7112 INPUT_SECTIONS_.
7113 (Output_merge_base::keeps_input_sections,
7114 Output_merge_base::set_keeps_input_sections,
7115 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7116 method definitions.
7117 (Output_merge_base::Input_sections): New type declaration.
7118 (Output_merge_base::input_sections_begin,
7119 Output_merge_base::input_sections_end,
7120 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7121 (Output_merge_base::bool keeps_input_sections_,
7122 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7123 Output_merge_base::input_sections_): New data members.
7124 (Output_merge_data::do_set_keeps_input_sections): New method
7125 defintion.
7126 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7127 * output.cc (Output_section::Input_section::relobj): Move method
7128 defintion from class declaration to here and handle merge sections.
7129 (Output_section::Input_section::shndx): Ditto.
7130 (Output_section::Output_section): Remove initializations of removed
7131 data members and initialize new data member LOOKUP_MAPS_.
7132 (Output_section::add_input_section): Set keeps-input-sections flag
7133 for a newly created merge output section as appropriate. Adjust code
7134 to use Output_section_lookup_maps class.
7135 (Output_section::add_relaxed_input_section): Adjst code for lookup
7136 maps code refactoring.
7137 (Output_section::add_merge_input_section): Add a new parameter
7138 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7139 class. If adding input section to a newly created merge output
7140 section fails, remove the new merge section.
7141 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7142 Adjust code for use of the Output_section_lookup_maps class.
7143 (Output_section::find_merge_section): Ditto.
7144 (Output_section::build_lookup_maps): New method defintion.
7145 (Output_section::find_relaxed_input_section): Adjust code to use
7146 Output_section_lookup_maps class.
7147 (Output_section::get_input_sections): Export merge sections. Adjust
7148 code to use Output_section_lookup_maps class.
7149 (Output_section:::add_script_input_section): Adjust code to use
7150 Output_section_lookup_maps class. Update lookup maps for merge
7151 sections also.
7152 (Output_section::discard_states): Use Output_section_lookup_maps.
7153 (Output_section::restore_states): Same.
7154 * output.h (Merge_section_properties): Move class defintion out of
7155 Output_section.
7156 (Output_section_lookup_maps): New class.
7157 (Output_section::Input_section::is_merge_section): New method
7158 defintion.
7159 (Output_section::Input_section::relobj): Move defintion out of class
7160 defintion. Declare method only.
7161 (Output_section::Input_section::shndx): Ditto.
7162 (Output_section::Input_section::output_merge_base): New method defintion.
7163 (Output_section::Input_section::u2_.pomb): New union field.
7164 (Output_section::Merge_section_by_properties_map,
7165 Output_section::Output_section_data_by_input_section_map,
7166 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7167 Remove types.
7168 (Output_section::add_merge_input_section): Add new parameter
7169 KEEPS_INPUT_SECTIONS.
7170 (Output_section::build_lookup_maps): New method declaration.
7171 (Output_section::merge_section_map_,
7172 Output_section::merge_section_by_properties_map_,
7173 Output_section::relaxed_input_section_map_,
7174 Output_section::is_relaxed_input_section_map_valid_): Remove data
7175 members.
7176 (Output_section::lookup_maps_): New data member.
7177
7178 2010-05-21 Doug Kwan <dougkwan@google.com>
7179
7180 PR gold/11619
7181 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7182 avoid a compilation error.
7183
7184 2010-05-19 Rafael Espindola <espindola@google.com>
7185
7186 * script-sections.cc (Output_section_definition::allocate_to_segment):
7187 Update the phdrs_list even when the output section is NULL.
7188 * testsuite/Makefile.am: Add test.
7189 * testsuite/Makefile.in: Regenerate.
7190 * testsuite/script_test_9.cc: New.
7191 * testsuite/script_test_9.sh: New.
7192 * testsuite/script_test_9.t: New.
7193
7194 2010-05-19 Doug Kwan <dougkwan@google.com>
7195
7196 * arm.cc (Arm_input_section::original_size): New method.
7197 (Arm_input_section::do_addralign): Add a cast.
7198 (Arm_input_section::do_output_offset): Remove static cast.
7199 (Arm_input_section::original_addralign,
7200 Arm_input_section::original_size_): Change type to uint32_t.
7201 (Arm_input_section::init): Add safe casts for section alignment
7202 and size.
7203 (Arm_input_section::set_final_data_size): Do not set address and
7204 offset of stub table.
7205 (Arm_output_section::fix_exidx_coverage): Change use of of
7206 Output_section::Simple_input_section to that of
7207 Output_section::Input_section.
7208 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7209 except for the first pass.
7210 * output.cc (Output_section::get_input_sections): Change type of
7211 input_sections to std::list<Input_section>.
7212 (Output_section::add_script_input_section): Rename from
7213 Output_section::add_simple_input_section. Change type of SIS
7214 parameter from Simple_input_section to Input_section.
7215 * output.h (Output_section::Simple_input_section): Remove class.
7216 (Output_section::Input_section): Change class visibility to public.
7217 (Output_section::Input_section::addralign): Use stored alignments
7218 for special input sections if set.
7219 (Output_section::Input_section::set_addralign): New method.
7220 (Output_section::get_input_sections): Change parameter type from
7221 list of Simple_input_section to list of Input_section.
7222 (Output_section::add_script_input_section): Rename from
7223 Output_section::add_simple_input_section. Change first parameter's
7224 type from Simple_input_section to Input_section and remove the
7225 second and third parameters.
7226 * script-sections.cc (Input_section::Input_section_list): Change
7227 type to list of Output_section::Input_section/
7228 (Input_section_info::Input_section_info): Change parameter type of
7229 INPUT_SECTION to Output_section::Input_section.
7230 (Input_section_info::input_section): Change return type.
7231 (Input_section_info::input_section_): Change type to
7232 Output_section::Input_section.
7233 (Output_section_element_input::set_section_addresses): Adjust code
7234 to use Output_section::Input_section instead of
7235 Output_section::Simple_input_section. Adjust code for renaming
7236 of Output_section::add_simple_input_section.
7237 (Orphan_output_section::set_section_addresses): Ditto.
7238
7239 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7240
7241 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7242 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7243
7244 2010-05-18 Rafael Espindola <espindola@google.com>
7245
7246 * options.cc (General_options::finalize): Handle -nostdlib.
7247 * options.h (nostdlib): New option.
7248 * script.cc (script_add_search_dir): Handle -nostdlib.
7249
7250 2010-05-12 Doug Kwan <dougkwan@google.com>
7251
7252 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7253 attributes section only if there no attributes section after merging.
7254 (Target_arm::merge_object_attributes): Move value of
7255 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
7256 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7257 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7258 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7259 and arm_attr_merge_7.stdout.
7260 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7261 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7262 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7263 arm_attr_merge_7b.o): New rules.
7264 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7265 arm_attr_merge_7
7266 * testsuite/Makefile.in: Regenerate.
7267 * testsuite/arm_attr_merge.sh: New file.
7268 * testsuite/arm_attr_merge_[67][ab].s: Same.
7269
7270 2010-05-05 Nick Clifton <nickc@redhat.com>
7271
7272 * po/es.po: Updated Spanish translation.
7273
7274 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7275
7276 * Makefile.am (install-exec-local): Properly install gold as
7277 default cross linker.
7278 * Makefile.in: Regenerated.
7279
7280 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7281 Nick Clifton <nickc@redhat.com>
7282
7283 * configure.ac (install_as_default): Define and set to false
7284 unless --enable-gold or --enable-gold=both/gold has been
7285 specified.
7286 * configure: Regenerate.
7287
7288 * Makefile.am (install-exec-local): Install the executable as
7289 'ld.gold'. If install_as_default is true then also install it as
7290 'ld'.
7291 * Makefile.in: Regenerated.
7292
7293 2010-04-24 Ian Lance Taylor <iant@google.com>
7294
7295 * layout.cc (Layout::layout_reloc): In relocatable link don't
7296 combine reloc sections for grouped sections.
7297
7298 2010-04-23 Sriraman Tallam <tmsriram@google.com>
7299
7300 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7301 sections that are not ordinary to icf.
7302 * icf.cc (get_section_contents): Handle relocation pointing to section
7303 with no object or shndx information.
7304 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7305 * testsuite/Makefile.in: Regenerate.
7306 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7307 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7308
7309 2010-04-22 Ian Lance Taylor <iant@google.com>
7310
7311 * expression.cc (Expression::Expression_eval_info): Add
7312 result_alignment_pointer field.
7313 (Expression::eval_with_dot): Add result_alignment_pointer
7314 parameter. Change all callers.
7315 (Expression::eval_maybe_dot): Likewise.
7316 (class Binary_expression): Add alignment_pointer parameter to
7317 left_value and right_value. Change all callers.
7318 (BINARY_EXPRESSION): Set result alignment.
7319 (class Trinary_expression): Add alignment_pointer parameter to
7320 arg2_value and arg3_value. Change all callers.
7321 (Trinary_cond::value): Set result alignment.
7322 (Max_expression::value, Min_expression::value): Likewise.
7323 (Align_expression::value): Likewise.
7324 * script-sections.cc (class Sections_element): Add dot_alignment
7325 parameter to set_section_addresses virtual function. Update
7326 instantiations.
7327 (class Output_section_element): Likewise.
7328 (Script_sections::create_segments): Add dot_alignment parameter.
7329 Change all callers.
7330 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7331 (Script_sections::set_phdrs_clause_addresses): Likewise.
7332 * script-sections.h: Update declarations.
7333 * script.h: Update declarations.
7334 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7335 min_p_align.
7336 * testsuite/script_test_3.t: Set large alignment.
7337 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7338 segment has expected alignment.
7339
7340 2010-04-22 Nick Clifton <nickc@redhat.com>
7341
7342 * po/gold.pot: Updated by the Translation project.
7343 * po/vi.po: Updated Vietnamese translation.
7344
7345 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7346
7347 * testsuite/Makefile.am (check_PROGRAMS): Add
7348 icf_virtual_function_folding_test.
7349 * testsuite/Makefile.in: Regenerated.
7350
7351 2010-04-15 Andrew Haley <aph@redhat.com>
7352
7353 * options.h (merge_exidx_entries): New option.
7354 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7355 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7356 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7357 (Target_arm::merge_exidx_entries): New function.
7358 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7359 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7360 to Arm_exidx_fixup constructor.
7361 Add new arg, merge_exidx_entries.
7362 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7363 Arm_output_section::fix_exidx_coverage.
7364
7365 2010-04-18 Sriraman Tallam <tmsriram@google.com>
7366
7367 * icf.cc (get_section_contents): Check for preemptible functions.
7368 Ignore addend when appropriate.
7369 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7370 section folded.
7371 (add_from_relobj): Check for section folded.
7372 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7373 * symtab.h (should_add_dynsym_entry): Add new parameter.
7374 * target-reloc.h (scan_relocs): Check for section folded.
7375 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7376 Check reloc types for function pointers in shared objects.
7377 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7378 case.
7379 (icf_preemptible_functions_test): New test case.
7380 (icf_string_merge_test): New test case.
7381 * testsuite.Makefile.in: Regenerate.
7382 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7383 bar_glob. Refactor code.
7384 * testsuite/icf_preemptible_functions_test.cc: New file.
7385 * testsuite/icf_preemptible_functions_test.sh: New file.
7386 * testsuite/icf_string_merge_test.cc: New file.
7387 * testsuite/icf_string_merge_test.sh: New file.
7388 * testsuite/icf_virtual_function_folding_test.cc: New file.
7389 * testsuite/icf_virtual_function_folding_test.sh: New file.
7390
7391 2010-04-14 Doug Kwan <dougkwan@google.com>
7392
7393 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7394 for local symbol recounting if we remove a section due to ICF.
7395 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7396 there are no regular objects in input.
7397
7398 2010-04-13 Doug Kwan <dougkwan@google.com>
7399
7400 * arm.cc (Arm_input_section::set_final_data_size): Compute
7401 accurate final data size instead of using current data size.
7402
7403 2010-04-09 Doug Kwan <dougkwan@google.com>
7404
7405 * layout.cc (Layout::choose_output_section): Handle script section
7406 types.
7407 (Layout::make_output_section_for_script): Add section type parameter.
7408 Handle script section types.
7409 * layout.h (Layout::make_output_section_for_script): Add section
7410 type parameter.
7411 * output.cc (Output_section::Output_section): Initialize data member
7412 is_noload_.
7413 (Output_section::do_reset_address_and_file_offset): Do not set address
7414 to 0 if section is a NOLOAD section.
7415 * output.h (Output_section::is_noload): New method.
7416 (Output_section::set_is_noload): Ditto.
7417 (Output_section::is_noload_): New data member.
7418 * script-c.h (Script_section_type): New enum type.
7419 (struct Parser_output_section_header): Add new file section_type.
7420 * script-sections.cc (Sections_element::output_section_name): Add
7421 parameter for returning script section type.
7422 (Output_section_definition::output_section_name): Ditto.
7423 (Output_section_definition::section_type)P; New method.
7424 (Output_section_definiton::script_section_type_name): Ditto.
7425 (Output_section_definition::script_section_type_): New data member.
7426 (Output_section_definition::Output_section_definition): Initialize
7427 data member Output_section_definition::script_section_type_.
7428 (Output_section_definition::create_sections): Pass script section type
7429 to Layout::make_output_section_for_script.
7430 (Output_section_definition::output_section_name): Return script
7431 section type to caller.
7432 (Output_section_definition::set_section_address): Do not advance
7433 dot value and load address if section type is NOLOAD. Set address
7434 of NOLOAD sections regardless of section flags.
7435 (Output_section_definition::print): Print section type if it is
7436 not SCRIPT_SECTION_TYPE_NONE.
7437 (Output_section_definition::section_type): New method.
7438 (Output_section_definition::script_section_type_name): Ditto.
7439 (Script_sections::output_section_name): Add new parameter
7440 PSECTION_TYPE for returning script section type. Pass it to
7441 section elements. Handle discard sections.
7442 (Sort_output_sections::operator()): Handle NOLOAD sections.
7443 * script-sections.h (Script_sections::Section_type): New enum type.
7444 (Script_sections::output_section_name): Add a new parameter for
7445 returning script section type.
7446 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7447 INFO and NOLOAD.
7448 * yyscript.y (union): Add new field SECTION_TYPE.
7449 (COPY, DSECT, INFO, NOLOAD): New tokens.
7450 (opt_address_and_section_type): Change type to output_section_header.
7451 (section_type): New non-terminal
7452 (section_header): Handle section type.
7453 (opt_address_and_section_type): Return section type value.
7454
7455 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7456
7457 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7458 * testsuite/plugin_common_test_2.c (foo): Likewise.
7459
7460 2010-04-08 Doug Kwan <dougkwan@google.com>
7461
7462 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7463 Output_merge_data.
7464 * output.cc (Output_section::add_merge_input_section): Simplify
7465 code and return status of Output_merge_base::add_input_section.
7466 Update merge section map only if Output_merge_base::add_input_section
7467 returns true.
7468
7469 2010-04-07 Doug Kwan <dougkwan@google.com>
7470
7471 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7472 if section is marked as containing instructions but has no mapping
7473 symbols.
7474 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7475 correct section index.
7476 (Arm_relobj::find_linked_text_section): Ditto.
7477
7478 2010-04-07 Cary Coutant <ccoutant@google.com>
7479
7480 * archive.cc (include_member): Destroy Read_symbols_data object before
7481 releasing file.
7482 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7483 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7484 (Read_symbols_data::~Read_symbols_data) New destructor.
7485 (Section_relocs::Section_relocs) New constructor.
7486 (Section_relocs::~Section_relocs) New destructor.
7487 (Read_relocs_data::Read_relocs_data) New constructor.
7488 (Read_relocs_data::~Read_relocs_data) New destructor.
7489 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7490 pointers to NULL after deleting.
7491
7492 2010-04-07 Doug Kwan <dougkwan@google.com>
7493
7494 * arm.cc: Replace "endianity" with "endianness" in comments.
7495 (Arm_exidx_cantunwind): Ditto.
7496 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7497 (Arm_relobj::merge_flags_and_attributes): New method.
7498 (Arm_relobj::merge_flags_and_attributes_): New data member.
7499 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7500 (Arm_relobj::scan_sections_for_stubs): Ditto.
7501 (Arm_relobj::do_read_symbols): Check to see if we really want to
7502 merge processor-specific flags and attributes. Exit early if
7503 an object is empty except for section names and the undefined symbol.
7504 (Target_arm::do_finalize_sections): Move check for ELF format to
7505 Arm_relobj::do_read_symbols. Merge processor specific flags and
7506 attributes from a regular object only when we have determined that
7507 it is aapropriate. Do not create an .ARM.attributes section in
7508 output if there is no regular input object.
7509 (Target_arm::merge_processor_specific_flags): Check
7510 --warn-mismatch before printing any error.
7511 (Target_arm::merge_object_attributes): Ditto.
7512 * gold.cc (queue_middle_tasks): Handle the case in which there is
7513 no regular object in input.
7514 * options.cc (General_options::parse_EB): New method.
7515 (General_options::parse_EL): Same.
7516 (General_options::General_options): Initialize endianness_.
7517 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7518 New options.
7519 (General_options::Endianness): New enum.
7520 (General_options::endianness): New method.
7521 (General_options::endianness_): New data member.
7522 * parameters.cc (Parameters::set_options): Check target endianness.
7523 (Parameters::set_target_once): Ditto.
7524 (Parameters::check_target_endianness): New method.
7525 (parameters_force_valid_target): If either -EL or -EB is specified,
7526 use it to define endianness of default target.
7527 * parameters.h (Parameters::check_target_endianness): New method
7528 declaration.
7529 * target.h (class Target): Change "endianity" to "endianness"
7530 in comments.
7531
7532 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7533
7534 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7535 * configure: Regenerate.
7536 * Makefile.in: Regenerate.
7537 * testsuite/Makefile.in: Regenerate.
7538
7539 2010-04-06 Cary Coutant <ccoutant@google.com>
7540
7541 gcc PR lto/42757
7542 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7543 prevailing definitions of common symbols.
7544 * testsuite/plugin_test_6.sh: New test case.
7545 * testsuite/plugin_common_test_1.c: New test case.
7546 * testsuite/plugin_common_test_2.c: New test case.
7547 * testsuite/Makefile.am (plugin_test_6): New test case.
7548 * testsuite/Makefile.in: Regenerate.
7549
7550 2010-04-06 Nick Clifton <nickc@redhat.com>
7551
7552 * po/vi.po: New Vietnamese translation.
7553
7554 2010-03-30 Doug Kwan <dougkwan@google.com>
7555
7556 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7557
7558 2010-03-25 Doug Kwan <dougkwan@google.com>
7559
7560 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7561 to avoid a conversion warning on a 32-bit host.
7562
7563 2010-03-24 Ian Lance Taylor <iant@google.com>
7564
7565 * testsuite/script_test_3.t: Add a TLS segment.
7566 * testsuite/Makefile.am (check_PROGRAMS): Add
7567 tls_phdrs_script_test.
7568 (tls_phdrs_script_test_SOURCES): Define.
7569 (tls_phdrs_script_test_DEPENDENCIES): Define.
7570 (tls_phdrs_script_test_LDFLAGS): Define.
7571 (tls_phdrs_script_test_LDADD): Define.
7572 * testsuite/Makefile.in: Rebuild.
7573
7574 2010-03-23 Cary Coutant <ccoutant@google.com>
7575
7576 * fileread.cc (find_or_make_view): Fix comment.
7577
7578 2010-03-23 Ian Lance Taylor <iant@google.com>
7579
7580 * script-sections.cc (class Orphan_section_placement): Define
7581 PLACE_TLS and PLACE_TLS_BSS.
7582 (Orphan_section_placement::Orphan_section_placement): Initialize
7583 new places.
7584 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7585 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7586 (tls_script_test_SOURCES): Define.
7587 (tls_script_test_DEPENDENCIES): Define.
7588 (tls_script_test_LDFLAGS): Define.
7589 (tls_script_test_LDADD): Define.
7590 * testsuite/Makefile.in: Rebuild.
7591
7592 2010-03-22 Doug Kwan <dougkwan@google.com>
7593
7594 * arm.cc (Arm_relocate_functions::abs8,
7595 Arm_relocate_functions::abs16): Use correct check for overflow
7596 specified in the ARM ELF specs.
7597 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7598 target of a BLX instruction specially.
7599 (Reloc_stub::stub_type_for_reloc): Ditto.
7600 (Relocate::relocate): Use symbolic names instead of numeric relocation
7601 codes to report error.
7602 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7603 workaround.
7604 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7605 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7606 thumb2_blx_out_of_range.stdout
7607 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7608 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7609 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7610 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7611 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7612 thumb2_blx_in_range, thumb2_blx_in_range.o,
7613 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7614 thumb2_blx_out_of_range.o): New rules.
7615 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
7616 thumb2_blx_in_range and thumb2_blx_out_of_range.
7617 * testsuite/Makefile.in: Regenerate.
7618 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7619 * testsuite/thumb_blx_in_range.s: New file.
7620 * testsuite/thumb_blx_out_of_range.s: New file.
7621
7622 2010-03-22 Rafael Espindola <espindola@google.com>
7623
7624 * archive.cc (Should_include): Move to archive.h.
7625 (should_include_member): Make it a member of Archive.
7626 (Lib_group): New.
7627 (Add_lib_group_symbols): New.
7628 * archive.h: Include options.h.
7629 (Archive_member): Moved from Archive.
7630 (Should_include): Moved from archive.cc.
7631 (Lib_group): New.
7632 (Add_lib_group_symbols): New.
7633 * dynobj.cc (do_should_include_member): New.
7634 * dynobj.h (do_should_include_member): New.
7635 * gold.cc (queue_initial_tasks): Update call to queue.
7636 * main.cc (main): Print lib group stats.
7637 * object.cc (do_should_include_member): New.
7638 * object.h: Include archive.h.
7639 (Object::should_include_member): New.
7640 (Object::do_should_include_member): New.
7641 (Sized_relobj::do_should_include_member): New.
7642 * options.cc (General_options::parse_start_lib): New.
7643 (General_options::parse_end_lib): New.
7644 (Input_arguments::add_file): Handle lib groups.
7645 (Input_arguments::start_group): Check we are not in a lib.
7646 (Input_arguments::start_lib): New.
7647 (Input_arguments::end_lib): New.
7648 * options.h (General_options): Add start_lib and end_lib.
7649 (Input_argument::lib_): New.
7650 (Input_argument::lib): New.
7651 (Input_argument::is_lib): New.
7652 (Input_file_lib): New.
7653 (Input_arguments::in_lib_): New.
7654 (Input_arguments::in_lib): New.
7655 (Input_arguments::start_lib): New.
7656 (Input_arguments::end_lib_): New.
7657 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7658 in unused members as preempted.
7659 (Sized_pluginobj::do_should_include_member): New.
7660 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7661 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7662 return the blocker.
7663 (Read_symbols::do_whole_lib_group): New.
7664 (Read_symbols::do_lib_group): New.
7665 (Read_symbols::do_read_symbols): Handle lib groups.
7666 (Read_symbols::get_name): Handle lib groups.
7667 * readsyms.h (Read_symbols): Add an archive member pointer.
7668 (Read_symbols::do_whole_lib_group): New.
7669 (Read_symbols::do_lib_group): New.
7670 (Read_symbols::member_): New.
7671 * script.cc (read_input_script): Update call to queue_soon.
7672
7673 2010-03-19 Doug Kwan <dougkwan@google.com>
7674
7675 * arm.cc (Stub_table::Stub_table): Initialize new data members
7676 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7677 (Stub_table::add_reloc_stub): Assign stub offset and update
7678 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7679 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7680 New data members.
7681 (Stub_table::update_data_size_and_addralign): Use
7682 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7683 instead of going over all reloc stubs.
7684 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
7685 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7686 Stringpool_template::offset_ to size of Stringpool_char.
7687 (Stringpool_template::new_key_offset): Remove code to initialize
7688 Stringpool_template::offset_.
7689 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7690 Stringpool_template::offset_ to zero.
7691
7692 2010-03-15 Doug Kwan <dougkwan@google.com>
7693
7694 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7695 offset_.
7696 (Stringpool_template::new_key_offset): New method.
7697 (Stringpool_template::add_string): Assign offsets when adding new
7698 strings.
7699 (Stringpool_template::set_string_offsets): Do not set string offsets
7700 when not optimizing.
7701 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7702 member size_.
7703 (Chunked_vector::clear): Clear size_.
7704 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7705 (Chunked_vector::size): Return size_.
7706 (Chunked_vector::push_back): Use size_ to find insert position.
7707 (Chunked_vector::size_): New data member.
7708 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7709 (Stringpool_template::new_key_offset): New method declaration.
7710 (Stringpool_template::offset_): New data member.
7711
7712 2010-03-15 Rafael Espindola <espindola@google.com>
7713
7714 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7715 Add_symbols' constructor.
7716 * readsyms.h (Add_symbols): Remove the input_group member.
7717
7718 2010-03-10 Ian Lance Taylor <iant@google.com>
7719
7720 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7721 target to ask whether a reference to a symbol requires a stack
7722 split.
7723 * target.h (Target::is_call_to_non_split): New function.
7724 (Target::do_is_call_to_non_split): Declare virtual function.
7725 * target.cc: Include "symtab.h".
7726 (Target::do_is_call_to_non_split): New function.
7727 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7728
7729 2010-03-10 Cary Coutant <ccoutant@google.com>
7730
7731 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7732 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7733 (File_read::open[2]): Add whole_file_view_ to list of views.
7734 (File_read::make_view): Remove test of whole_file_view_.
7735 (File_read::find_or_make_view): Create whole_file_view_ if
7736 necessary.
7737 (File_read::clear_views): Replace bool parameter with enum;
7738 adjust all callers. Don't delete views with permanent data;
7739 do delete cached views and views from archives if
7740 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7741 if clearing the corresponding view.
7742 * fileread.h (File_read::Clear_views_mode): New enum.
7743 (File_read::View::is_permanent_view): New method.
7744 (File_read::clear_views): Replace bool parameter
7745 with enum; adjust all callers.
7746 * options.h (General_options): Change keep_files_mapped option;
7747 add map_whole_files.
7748 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7749 releasing the file.
7750 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7751 the file.
7752
7753 2010-03-10 David S. Miller <davem@davemloft.net>
7754
7755 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7756
7757 2010-03-09 Sriraman Tallam <tmsriram@google.com>
7758
7759 * icf.cc (get_section_contents): Add '@' marker after processing the
7760 merge reloc.
7761
7762 2010-03-08 Doug Kwan <dougkwan@google.com>
7763
7764 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7765 due to a conversion warning.
7766 (Arm_relobj::update_output_local_symbol_count): Check for local
7767 symbol with unset output index.
7768
7769 2010-03-05 Ian Lance Taylor <iant@google.com>
7770
7771 * options.h (class General_options): Add --spare-dynamic-tags.
7772 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7773 --spare-dynamic-tags.
7774
7775 2010-03-05 Ian Lance Taylor <iant@google.com>
7776
7777 * incremental.cc: Include "libiberty.h".
7778
7779 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7780
7781 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7782 function, is_info_ member.
7783 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7784 (Versions::Versions): Update caller.
7785 (Versions::define_base_version): Likewise.
7786 (Versions::add_def): Likewise.
7787
7788 2010-03-03 Sriraman Tallam <tmsriram@google.com>
7789
7790 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7791 (Scan::possible_function_pointer_reloc): New function.
7792 (Scan::local_reloc_may_be_function_pointer): Change to call
7793 possible_function_pointer_reloc.
7794 (Scan::global_reloc_may_be_function_pointer): Ditto.
7795 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7796 relocations in ".data.rel.ro._ZTV" section.
7797 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7798 * testsuite/icf_safe_so_test.cc: Ditto.
7799 * testsuite/icf_safe_test.cc: Ditto.
7800 * testsuite/icf_safe_test.sh: Ditto.
7801
7802 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7803 Ian Lance Taylor <iant@google.com>
7804
7805 * target-reloc.h (relocate_section): Check the symbol table index
7806 for -1U before setting the local symbol index.
7807 (scan_relocatable_relocs): If copying the relocation, record that
7808 the local symbol is required.
7809 * object.h (Symbol_value::is_output_symtab_index_set): New
7810 function.
7811 (Symbol_value::may_be_discarded_from_output_symtab): New
7812 function.
7813 (Symbol_value::has_output_symtab_entry): New function.
7814 (Symbol_value::needs_output_symtab_entry): Remove.
7815 (Symbol_value::output_symtab_index): Make sure the symbol index is
7816 set.
7817 (Symbol_value::set_output_symtab_index): Make sure the symbol
7818 index is not set. Make sure the new index is valid.
7819 (Symbol_value::set_must_have_output_symtab_entry): New function.
7820 (Symbol_value::has_output_dynsym_entry): New function.
7821 (Symbol_value::set_output_dynsym_index): Make sure the new index
7822 is valid.
7823 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7824 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7825 local symbol if permitted.
7826 (Sized_relobj::do_finalize_local_symbols): Call
7827 is_output_symtab_index_set rather than needs_output_symtab_entry.
7828 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7829 rather than needs_output_symtab_entry. Call
7830 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7831 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7832 is_output_symtab_index_set rather than needs_output_symtab_entry.
7833 * testsuite/discard_locals_relocatable_test.c: New file.
7834 * testsuite/discard_locals_test.sh: Test -r.
7835 * testsuite/Makefile.am (check_DATA): Add
7836 discard_locals_relocatable_test1.syms,
7837 discard_local_relocatable_test2.syms.
7838 (MOSTLYCLEANFILES): Likewise. Also add
7839 discard_locals_relocatable_test1.lout and
7840 discard_locals_relocatable_test2.out.
7841 (discard_locals_relocatable_test1.syms): New target.
7842 (discard_locals_relocatable_test.o): New target.
7843 (discard_locals_relocatable_test1.out): New target.
7844 (discard_locals_relocatable_test2.syms): New target.
7845 (discard_locals_relocatable_test2.out): New target.
7846 (various): Add missing ../ld-new dependencies.
7847 * testsuite/Makefile.in: Rebuild.
7848
7849 2010-03-03 Nick Clifton <nickc@redhat.com>
7850
7851 * po/fi.po: New Finnish translation.
7852
7853 2010-03-01 Doug Kwan <dougkwan@google.com>
7854
7855 * layout.cc (Layout::Layout): Force section types of .init_array*,
7856 .preinit_array* and .fini_array* sections.
7857 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7858 Fix check of return value of std::string::find.().
7859 (Output_section::Input_section_sort_compare::operator()): Remove
7860 comment about .init_array.
7861 (Output_section::Input_section_sort_init_fini_compare::operator()):
7862 New method.
7863 (Output_section::sort_attached_input_sections): Handle .init_array
7864 and .fini_array specially.
7865 * output.h (Output_section::Inut_section_sort_compare): Update
7866 comment.
7867 (Output_section::Input_section_sort_init_fini_compare): New struct.
7868
7869 2010-02-26 Doug Kwan <dougkwan@google.com>
7870
7871 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7872 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7873 * testsuite/debug_msg.sh: Avoid matching source line number for
7874 use of global variable undef_int.
7875
7876 2010-02-26 Doug Kwan <dougkwan@google.com>
7877
7878 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7879 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7880 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7881 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7882 * options.cc (General_options::General_options): Initialize member
7883 fix_v4bx_.
7884 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7885 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7886 and rm_no_fix_v4bx.stdout
7887 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7888 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7889 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7890 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7891 and arm_no_fix_v4bx.
7892 * Makefile.in: Regenerate.
7893 * testsuite/arm_fix_v4bx.s: New file.
7894 * testsuite/arm_fix_v4bx.sh: Ditto.
7895
7896 2010-02-24 Doug Kwan <dougkwan@google.com>
7897
7898 * arm.cc (Target_arm::got_section): Make the .got section the first
7899 non RELRO section in the data segment.
7900 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7901 suffixes of section names.
7902
7903 2010-02-24 Doug Kwan <dougkwan@google.com>
7904
7905 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7906 flags and attributes merging if an input file is a binary file.
7907 * fileread.cc (Input_file::open): Record format of original file.
7908 * fileread.h (Input_file::Format): New enum type.
7909 (Input_file::Input_file): Initialize data member format_.
7910 (Input_file::format): New method definition.
7911 (Input_file::format_):: New data member.
7912
7913 2010-02-24 Doug Kwan <dougkwan@google.com>
7914
7915 * arm.cc (Arm_output_data_got): New class.
7916 (ARM_TCB_SIZE): New constant
7917 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7918 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7919 If user uses a script with a SECTIONS clause, issue only a warning
7920 for a misplaced EXIDX input section. Otherwise, issue an error.
7921 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
7922 garbage collection.
7923 (Target_arm::got_mode_index_entry): Handle static linking.
7924 (Target_arm::Scan::local): Ditto.
7925 (Target_arm::Scan::global): Ditto.
7926 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7927 all incorrectly implemented relocations.
7928 (Target_arm::fix_exidx_coverage): Pass layout to
7929 Arm_output_section::fix_exidx_coverage.
7930 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7931 from ".ARM.exidx." and ".ARM.extab.".
7932
7933 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7934
7935 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7936 section if it does not already exist.
7937 * attributes.cc (Attributes_section_data::Attributes_section_data):
7938 Don't crash if size is zero.
7939
7940 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7941 Ian Lance Taylor <iant@google.com>
7942
7943 * gold.cc (queue_middle_tasks): If no input files were opened,
7944 exit.
7945 * workqueue.h (Task_function::Task_function): Assert that there is
7946 a blocker.
7947
7948 2010-02-22 Doug Kwan <dougkwan@google.com>
7949
7950 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7951 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7952 types to avoid warnings due to different uint64_t implementations
7953 on different hosts.
7954
7955 2010-02-21 Doug Kwan <dougkwan@google.com>
7956
7957 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7958 handling of the maximum backward branch offset.
7959 (Arm_relocate_functions::thumb_branch_common): Ditto.
7960 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7961 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
7962 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
7963 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7964 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7965 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7966 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7967 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7968 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7969 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7970 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7971 thumb2_bl_out_of_range.o): New rules.
7972 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7973 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7974 thumb2_bl_out_of_range
7975 * testsuite/Makefile.in: Regenerate.
7976 * testsuite/arm_bl_in_range.s: New file.
7977 * testsuite/arm_bl_out_of_range.s: Ditto.
7978 * testsuite/arm_branch_in_range.sh: Ditto.
7979 * testsuite/arm_branch_range.t: Ditto.
7980 * testsuite/thumb2_branch_range.t: Ditto.
7981 * testsuite/thumb_bl_in_range.s: Ditto.
7982 * testsuite/thumb_bl_out_of_range.s: Ditto.
7983 * testsuite/thumb_branch_range.t: Ditto.
7984
7985 2010-02-20 Sriraman Tallam <tmsriram@google.com>
7986
7987 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7988 Add reloc offset information.
7989 * icf.cc (get_section_contents): Change iterators to point to the new
7990 vectors. Add reloc offset information to the contents.
7991 * icf.h (Icf::Sections_reachable_info): New typedef.
7992 (Icf::Sections_reachable_list): New typedef.
7993 (Icf::Offset_info): New typedef.
7994 (Icf::Reloc_info): New struct typedef.
7995 (Icf::Reloc_info_list): New typedef.
7996 (Icf::symbol_reloc_list): Delete method.
7997 (Icf::addend_reloc_list): Delete method.
7998 (Icf::section_reloc_list): Delete method.
7999 (Icf::reloc_info_list): New method.
8000 (Icf::reloc_info_list_): New member.
8001
8002 2010-02-19 Doug Kwan <dougkwan@google.com>
8003
8004 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8005 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8006 * arm.cc (Arm_relocation_functions): New forward declaration.
8007 (Target_arm::Target_arm): Initialize new data members
8008 got_mod_index_offset_ and tls_base_symbol_defined_.
8009 (Target_arm::Relocate::relocate_tls): New method.
8010 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8011 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8012 New methods.
8013 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
8014 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8015 (Target_arm::got_mod_index_offset_,
8016 Target_arm::tls_base_symbol_defined_): New data members.
8017 (Target_arm::Scan::local, Target::Scan::global,
8018 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8019 relocations.
8020
8021 2010-02-18 Doug Kwan <dougkwan@google.com>
8022
8023 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8024 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8025 text section as a parameter becuase some broken tools may not set
8026 the link in section header.
8027 (Target_arm::has_got_section): New method.
8028 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8029 without any mapping symbol as data only. Remove warning.
8030 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8031 link in its section header, try to discover the link by inspecting the
8032 REL31 relocation at the beginning of the section.
8033 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8034 in error message.
8035 (Target_arm::Scan::global): Treat any reference to the symbol
8036 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8037
8038 2010-02-12 Sriraman Tallam <tmsriram@google.com>
8039
8040 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8041 (Scan::global_reloc_may_be_function_pointer): New function.
8042 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8043 (Scan::global_reloc_may_be_function_pointer): New function.
8044 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8045 (Scan::global_reloc_may_be_function_pointer): New function.
8046 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8047 (Scan::global_reloc_may_be_function_pointer): New function.
8048 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8049 (Scan::global_reloc_may_be_function_pointer): New function.
8050 (Scan::possible_function_pointer_reloc): New function.
8051 (Target_x86_64::can_check_for_function_pointers): New function.
8052 * gc.h (gc_process_relocs): Scan relocation types to determine if
8053 function pointers were taken for targets that support it.
8054 * icf.cc (Icf::find_identical_sections): Include functions for
8055 folding in safe ICF whose pointer is not taken.
8056 * icf.h (Secn_fptr_taken_set): New typedef.
8057 (fptr_section_id_): New member.
8058 (section_has_function_pointers): New function.
8059 (set_section_has_function_pointers): New function.
8060 (check_section_for_function_pointers): New function.
8061 * options.h: Fix comment for safe ICF option.
8062 * target.h (can_check_for_function_pointers): New function.
8063 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8064 Modify icf_safe_test for X86-64.
8065 * testsuite/Makefile.in: Regenerate.
8066 * testsuite/icf_safe_so_test.cc: New file.
8067 * testsuite/icf_safe_so_test.sh: New file.
8068 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8069 (main): Change to take pointer to function kept_func_3.
8070 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8071 folding is done correctly for X86-64.
8072
8073 2010-02-12 David S. Miller <davem@davemloft.net>
8074
8075 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8076 is_symbolless parameter.
8077 (Output_reloc<SHT_REL>::is_symbolless): New.
8078 (Output_reloc<SHT_REL>::is_symbolless_): New.
8079 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8080 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8081 (Output_reloc<SHT_RELA>::is_symbolless): New.
8082 (Output_data_reloc::add_global): Handle is_symbolless.
8083 (Output_data_reloc::add_global_relative): Likewise.
8084 (Output_data_reloc::add_local): Likewise.
8085 (Output_data_reloc::add_local_relative): Likewise.
8086 (Output_data_reloc::add_symbolless_global_addend): New.
8087 (Output_data_reloc::add_symbolless_local_addend): New.
8088 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8089 is_symbolless.
8090 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8091 instead of ->is_relative_
8092 (Output_reloc::write): Likewise.
8093 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8094 (Output_reloc::write_rel): Simplify.
8095
8096 * sparc.cc (Target_sparc::Scan::local): Use
8097 ->add_symbolless_local_addend as needed.
8098 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8099 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8100 based upon relocation offset.
8101
8102 2010-02-11 Doug Kwan <dougkwan@google.com>
8103
8104 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8105 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8106 beginning of function.
8107 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8108 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8109 parameter is_32bit in calls to should_apply_static_reloc.
8110 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8111 (check_DATA): Add arm_abs_global.stdout.
8112 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8113 arm_abs_global.stdout): New rules.
8114 (MOSTLLYCLEANFILES): Add arm_abs_global
8115 * Makefile.in: Regenerate.
8116 * testsuite/arm_abs_global.s: New file.
8117 * testsuite/arm_abs_global.sh: Ditto.
8118 * testsuite/arm_abs_lib.s: Ditto.
8119
8120 2010-02-11 Ian Lance Taylor <iant@google.com>
8121
8122 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8123 Read_relocs task.
8124 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8125 Allocate_commons_task first.
8126 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8127 task, rather than symtab_lock_.
8128 (Gc_process_relocs::~Gc_process_relocs): New function.
8129 (Gc_process_relocs::is_runnable): Check this_blocker_.
8130 (Gc_process_relocs::locks): Use next_blocker_ rather than
8131 blocker_.
8132 (Scan_relocs::~Scan_relocs): New function.
8133 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8134 symtab_lock_.
8135 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8136 next_blocker_.
8137 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8138 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8139 constructor accordingly.
8140 (class Gc_process_relocs): Likewise.
8141 (class Scan_relocs): Likewise.
8142 * common.h (class Allocate_commons_task): Remove symtab_lock_
8143 field, and corresponding constructor parameter.
8144 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8145 symtab_lock_.
8146 (Allocate_commons_task::locks): Likewise.
8147
8148 2010-02-11 Ian Lance Taylor <iant@google.com>
8149
8150 * gold-threads.h (class Once): Define.
8151 (class Initialize_lock): Rewrite as child of Once.
8152 * gold-threads.cc (class Once_initialize): Define.
8153 (once_pointer_control): New static variable.
8154 (once_pointer, once_arg): New static variables.
8155 (c_run_once): New static function.
8156 (Once::Once, Once::run_once, Once::internal_run): New functions.
8157 (class Initialize_lock_once): Remove.
8158 (initialize_lock_control): Remove.
8159 (initialize_lock_pointer): Remove.
8160 (initialize_lock_once): Remove.
8161 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8162 (Initialize_lock::initialize): Rewrite.
8163 (Initialize_lock::do_run_once): New function.
8164 * archive.cc (Archive::interpret_header): Only clear name if it is
8165 not already empty.
8166 * fileread.cc: Include "gold-threads.h"
8167 (file_counts_lock): New static variable.
8168 (file_counts_initialize_lock): Likewise.
8169 (File_read::release): Only increment counts when using --stats.
8170 Use a lock around the increment.
8171 * parameters.cc (class Set_parameters_target_once): Define.
8172 (set_parameters_target_once): New static variable.
8173 (Parameters::Parameters): Move here from parameters.h.
8174 (Parameters::set_target): Rewrite.
8175 (Parameters::set_target_once): New function.
8176 (Parameters::clear_target): Move here and rewrite.
8177 * parameters.h (class Parameters): Update declarations. Add
8178 set_parameters_target_once_ field.
8179 (Parameters::Parameters): Move to parameters.cc.
8180 (Parameters::clear_target): Likewise.
8181 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8182 task.
8183 (Start_group::~Start_group): New function.
8184 (Start_group::is_runnable): New function.
8185 (Start_group::locks, Start_group::run): New functions.
8186 (Finish_group::run): Change saw_undefined to size_t.
8187 * readsyms.h (class Start_group): Define.
8188 (class Finish_group): Change saw_undefined_ field to size_t.
8189 (Finish_group::Finish_group): Remove saw_undefined and
8190 this_blocker parameters. Change all callers.
8191 (Finish_group::set_saw_undefined): New function.
8192 (Finish_group::set_blocker): New function.
8193 * symtab.h (class Symbol_table): Change saw_undefined to return
8194 size_t. Change saw_undefined_ field to size_t.
8195 * target-select.cc (Set_target_once::do_run_once): New function.
8196 (Target_selector::Target_selector): Initialize set_target_once_
8197 field. Don't initialize lock_ and initialize_lock_ fields.
8198 (Target_selector::instantiate_target): Rewrite.
8199 (Target_selector::set_target): New function.
8200 * target-select.h (class Set_target_once): Define.
8201 (class Target_selector): Update declarations. Make
8202 Set_target_once a friend. Remove lock_ and initialize_lock_
8203 fields. Add set_target_once_ field.
8204
8205 2010-02-10 Ian Lance Taylor <iant@google.com>
8206
8207 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8208 queueing any tasks.
8209 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8210 (queue_middle_tasks): Add all blockers before queueing any tasks.
8211 (queue_final_tasks): Likewise.
8212 * token.h (Task_token::add_blockers): New function.
8213 * object.h (Input_objects::number_of_relobjs): New function.
8214
8215 2010-02-10 Ian Lance Taylor <iant@google.com>
8216
8217 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8218 shared, not if not position independent.
8219 * x86_64.cc (Relocate::relocate_tls): Likewise.
8220 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8221 (tls_pie_pic_test): New target.
8222 * testsuite/Makefile.in: Rebuild.
8223
8224 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8225 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8226 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8227 * testsuite/Makefile.in: Rebuild.
8228
8229 2010-02-09 David S. Miller <davem@davemloft.net>
8230
8231 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8232 R_SPARC_RELATIVE using ->add_local_relative().
8233 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8234
8235 * output.h (Output_data_dynamic::add_section_size): New method
8236 that takes two Output_data objects.
8237 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8238 entry param. Handle it in initializers.
8239 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8240 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8241 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8242 arg.
8243 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8244 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8245 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8246 for dynrel_includes_plt.
8247 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8248 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8249 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8250 before .rela.plt
8251 (Target_sparc::do_finalize_sections): Update to pass true for
8252 dynrel_includes_plt.
8253 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8254 output before .rela.plt
8255 (Target_powerpc::do_finalize_sections): Update to pass true for
8256 dynrel_includes_plt when 32-bit.
8257
8258 2010-02-08 Doug Kwan <dougkwan@google.com>
8259
8260 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8261 method.
8262 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8263 Arm_relobj::scan_section_for_cortex_a8_stubs,
8264 Arm_relobj::do_relocation_section): Instead of calling
8265 Output_section::output_address, use faster
8266 Arm_relobj::simple_input_section_output_address.
8267
8268 2010-02-08 David S. Miller <davem@davemloft.net>
8269
8270 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8271 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8272 relocation helper function.
8273
8274 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8275 just like R_SPARC_GOT{10,13,22}.
8276 (Target_sparc::Scan::local): Likewise.
8277 (Target_sparc::Relocate:relocate): Likewise.
8278
8279 2010-02-06 Ian Lance Taylor <iant@google.com>
8280
8281 * configure.ac: Rewrite targetobjs duplicate removal code to use
8282 only shell constructs.
8283 * configure: Rebuild.
8284
8285 2010-02-05 Doug Kwan <dougkwan@google.com>
8286
8287 PR 11247
8288 * arm.cc (Arm_relobj::section_is_scannable): New method.
8289 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8290 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8291
8292 2010-02-04 Doug Kwan <dougkwan@google.com>
8293
8294 PR 11247
8295 * arm-reloc-property.cc (cstdio): Include.
8296 * configure.ac (targetobjs): Remove duplicates.
8297 * configure: Regenerate.
8298 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8299 big and little endian version for a given address size.
8300
8301 2010-02-03 Doug Kwan <dougkwan@google.com>
8302
8303 * arm-reloc-property.cc
8304 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8305 definition.
8306 * arm-reloc-property.h
8307 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8308 New method definition.
8309 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8310 declaration.
8311 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8312 overflow to N.
8313 (GOT_PREL): Change implemented to Y.
8314 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8315 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8316 (Arm_relocate_functions::movw_abs_nc): Remove method.
8317 (Arm_relocate_functions::movt_abs): Ditto.
8318 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8319 (Arm_relocate_functions::thm_movt_abs): Ditto.
8320 (Arm_relocate_functions::movw_rel_nc): Ditto.
8321 (Arm_relocate_functions::movw_rel): Ditto.
8322 (Arm_relocate_functions::movt_rel): Ditto.
8323 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8324 (Arm_relocate_functions:thm_movw_rel): Ditto.
8325 (Arm_relocate_functions:thm_movt_rel): Ditto.
8326 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8327 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8328 New method definitions.
8329 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8330 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8331 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8332 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8333 (Target_arm::Relocate::relocate): Check for non-static or
8334 unimplemented relocation code and exit early. Change calls to
8335 Target_arm::reloc_uses_thumb_bit and
8336 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8337 instead. Refactor code to handle similar relocations to increase
8338 code sharing. Remove check for unsupported relocation code in switch
8339 statement.
8340 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8341 relocation property table to find out size. Change error message to
8342 print out the name of a relocation code instead of the numeric value.
8343 (Target_arm::scan_reloc_for_stub): Use relocation property table
8344 instead of calling Target_arm::reloc_uses_thumb_bit().
8345
8346 2010-02-02 Doug Kwan <dougkwan@google.com>
8347
8348 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8349 types of relaxed input section.
8350
8351 2010-02-02 Doug Kwan <dougkwan@google.com>
8352
8353 * Makefile.am (HFILES): Add arm-reloc-property.h.
8354 (DEFFILES): New.
8355 (TARGETSOURCES): Add arm-reloc-property.cc
8356 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
8357 (libgold_a_SOURCES): $(DEFFILES)
8358 * Makefile.in: Regenerate.
8359 * arm-reloc-property.cc: New file.
8360 * arm-reloc-property.h: New file.
8361 * arm-reloc.def: New file.
8362 * arm.cc: Update comments.
8363 (arm-reloc-property.h): New included header.
8364 (arm_reloc_property_table): New global variable.
8365 (Target_arm::do_select_as_default_target): New method definition.
8366 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8367 arm-reloc-property to targ_extra_obj.
8368 * parameters.cc (set_parameters_target): Call
8369 Target::select_as_default_target().
8370 * target.h (Target::select_as_default_target): New method definition.
8371 (Target::do_select_as_default_target): Same.
8372
8373 2010-02-01 Doug Kwan <dougkwan@google.com>
8374
8375 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8376 first_output_text_section_.
8377 (Arm_exidx_fixup::first_output_text_section): New method definition.
8378 (Arm_exidx_fixup::first_output_text_section_): New data member.
8379 (Arm_exidx_fixup::process_exidx_section): Record the first text
8380 output section seen.
8381 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8382 and entsize in output section header.
8383
8384 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8385
8386 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8387 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8388 (Arm_relocate_functions::thm_alu11): New Method.
8389 (Arm_relocate_functions::thm_pc8): New Method.
8390 (Arm_relocate_functions::thm_pc12): New Method.
8391 (Target_arm::Scan::local): Handle the relocations.
8392 (Target_arm::Scan::global): Likewise.
8393 (Target_arm::Relocate::relocate): Likewise.
8394 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8395
8396 2010-01-29 Doug Kwan <dougkwan@google.com>
8397
8398 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8399 of relocation types as ld.
8400
8401 2010-01-29 Doug Kwan <dougkwan@google.com>
8402
8403 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8404 to public.
8405 (Arm_relocate_functions::thumb_branch_common): Ditto.
8406 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8407 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8408 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8409 Arm_relocate_functions::jump24): Remove.
8410 (Target_arm::Relocate::relocate): Adjust code to call
8411 Arm_relocation_functions::arm_branch_common and
8412 Arm_relocation_functions::thumb_branch_common instead of their removed
8413 wrappers. Merge switch-cases together to reduce source code size.
8414
8415 2010-01-29 Doug Kwan <dougkwan@google.com>
8416
8417 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8418 output_local_symbol_count_needs_update_.
8419 (Arm_relobj::output_local_symbol_count_needs_update,
8420 Arm_relobj::set_output_local_symbol_count_needs_update,
8421 Arm_relobj::update_output_local_symbol_count): New methods.
8422 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8423 member.
8424 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8425 of pointed function as in a R_ARM_PREL31 relocation.
8426 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8427 for output local symbol count updating.
8428 (Target_arm::do_relax): Update output local symbol counts in objects
8429 if necessary.
8430 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8431
8432 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8433
8434 * arm.cc: Added support for the ARM relocations:
8435 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8436 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8437 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8438 movw_prel_nc).
8439 (Arm_relocate_functions::movw_rel): New method.
8440 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8441 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8442 thm_movw_prel_nc).
8443 (Arm_relocate_functions::thm_movw_rel): New method.
8444 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8445 thm_movt_prel).
8446 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8447 relocations.
8448 (Target_arm::Scan::global): Likewise.
8449 (Target_arm::Relocate::relocate): Likewise.
8450 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8451 Likewise.
8452
8453 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8454
8455 * arm.cc: Added support for ARM group relocations.
8456 (Target_arm::reloc_needs_sym_origin): New method.
8457 (Arm_relocate_functions::calc_grp_kn): New method.
8458 (Arm_relocate_functions::calc_grp_residual): New method.
8459 (Arm_relocate_functions::calc_grp_gn): New method.
8460 (Arm_relocate_functions::arm_grp_alu): New Method.
8461 (Arm_relocate_functions::arm_grp_ldr): New Method.
8462 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8463 (Arm_relocate_functions::arm_grp_ldc): New Method.
8464 (Target_arm::Scan::local): Handle the ARM group relocations.
8465 (Target_arm::Scan::global): Likewise.
8466 (Target_arm::Relocate::relocate): Likewise.
8467 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8468 Likewise.
8469
8470 2010-01-26 Doug Kwan <dougkwan@google.com>
8471
8472 * arm.cc (set): Include.
8473 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8474 pointer type.
8475 (Arm_output_section::Text_section_list): New type.
8476 (Arm_output_section::append_text_sections_to_list): New method.
8477 (Arm_output_section::fix_exidx_coverage): Ditto.
8478 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
8479 (Arm_relobj::convert_input_section_to_relaxed_section): Use
8480 Relobj::set_section_offset() instead of
8481 Sized_relobj::invalidate_section_offset().
8482 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
8483 parameter for section headers. Ignore relocation sections for
8484 unallocated sections and EXIDX sections.
8485 (Target_arm::fix_exidx_coverage): New method.
8486 (Target_arm::output_section_address_less_than): New type.
8487 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8488 linked text section instead of the EXIDX section.
8489 (Arm_output_section::create_stub_group): Add an assertion to check
8490 that this is not an EXIDX output section.
8491 (Arm_output_section::append_text_sections_to_list): New method.
8492 (Arm_output_section::fix_exidx_coverage): Ditto.
8493 (Arm_relobj::scan_sections_for_stubs): Adjust call to
8494 Arm_relobj::section_needs_reloc_stub_scanning.
8495 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8496 first pass.
8497 (Target_arm::fix_exidx_coverage): New method.
8498 * object.h (Relobj::set_output_section): New method.
8499 (Sized_relobj::invalidate_section_offset): Remove method.
8500 (Sized_relobj::do_invalidate_section_offset): Remove method.
8501 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8502
8503 2010-01-25 Doug Kwan <dougkwan@google.com>
8504
8505 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8506 Fix warning due to signed and unsigned comparison on a 32-bit host.
8507
8508 2010-01-22 Doug Kwan <dougkwan@google.com>
8509
8510 * arm.cc (Target_arm::do_relax): Record an output section for section
8511 offset adjustment it contains any stub table that has changed.
8512 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8513 offsets in an output section if necessary.
8514 * output.cc (Output_section::Output_section): Initialize
8515 section_offsets_need_adjustments_.
8516 (Output_section::add_input_section_for_script): Renamed to
8517 Output_section::add_simple_input_section.
8518 (Output_section::save_states): Add a comment.
8519 (Output_section::discard_states): New method defintion.
8520 (Output_section::adjust_section_offsets): Same.
8521 * output.h (Output_section::add_input_section_for_script): Renamed to
8522 Output_section::add_simple_input_section.
8523 (Output_section::discard_states): New method declaration.
8524 (Output_section::adjust_section_offsets): Same.
8525 (Output_section::section_offsets_need_adjustment,
8526 Output_section::set_section_offsets_need_adjustment): New method
8527 definitions.
8528 (Output_section::section_offsets_need_adjustment_): New data member.
8529 * script-sections.cc
8530 (Output_section_element_input::set_section_address): Adjust code for
8531 renaming of Output_section::add_input_section_for_script.
8532 (Orphan_output_section::set_section_address): Same.
8533
8534 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8535
8536 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8537 Fix_v4bx enum values .
8538 * gold/options.h (General_options): New option definitions.
8539 (General_options::fix_v4bx): New method.
8540 (General_options::Fix_v4bx): New enum.
8541 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8542 (General_options::parse_fix_v4bx_interworking): New method.
8543
8544 2010-01-22 Doug Kwan <dougkwan@google.com>
8545
8546 * arm.cc (Arm_exidx_fixup): New class.
8547
8548 2010-01-21 Doug Kwan <dougkwan@google.com>
8549
8550 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8551 classes.
8552 (Arm_exidx_section_offset_map): New type.
8553
8554 2010-01-21 Doug Kwan <dougkwan@google.com>
8555
8556 * arm.cc (Arm_exidx_input_section): New class.
8557 (Arm_relobj::exidx_input_section_by_link,
8558 Arm_relobj::exidx_input_section_by_shndx,
8559 Arm_relobj::make_exidx_input_section): New methods.
8560 (read_arm_attributes_section): Remove.
8561 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8562 information about them.
8563 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8564 to here.
8565
8566 2010-01-20 Doug Kwan <dougkwan@google.com>
8567
8568 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8569 Input_section_specifier to Section_id.
8570 (Target_arm::new_arm_input_section: Adjust code for change of key
8571 type.
8572 (Target_arm::find_arm_input_section): Ditto.
8573 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8574 (Section_id): Remove.
8575 (Garbage_collection::Section_id_hash): Remove.
8576 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8577 (Section_id): Remove.
8578 (Icf::Section_id_hash): Remove.
8579 * object.h (Section_id, Const_section_id, Section_id_hash,
8580 Const_section_id_hash): New type definitions.
8581 * output.cc (Output_section::add_relaxed_input_section): Change to
8582 use Const_section_id instead of Input_section_specifier as key type.
8583 (Output_section::add_merge_input_section): Ditto.
8584 (Output_section::build_relaxation_map): Change to use Section_id
8585 instead of Input_section_specifier as key type.
8586 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8587 Ditto.
8588 (Output_section::convert_input_sections_to_relaxed_sections): Change
8589 to use Const_section_id instead of Input_section_specifier as key type.
8590 (Output_section::find_merge_section): Ditto.
8591 (Output_section::find_relaxed_input_section): Ditto.
8592 * output.h (Input_section_specifier): Remove class.
8593 (Output_section::Output_section_data_by_input_section_map): Change
8594 key type to Const_section_id.
8595 (Output_section::Output_relaxed_input_section_by_input_section_map):
8596 Ditto.
8597 (Output_section::Relaxation_map): Change key type to Section_id.
8598
8599 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8600
8601 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8602 (class Arm_v4bx_stub): New class.
8603 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8604 (Stub_factory::make_arm_v4bx_stub): New method.
8605 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8606 (Stub_table::empty): Handle v4bx stubs.
8607 (Stub_table::add_arm_v4bx_stub): New method.
8608 (Stub_table::find_arm_v4bx_stub): New method.
8609 (Arm_relocate_functions::v4bx): New method.
8610 (Target_arm::fix_v4bx): New method.
8611 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8612 (Stub_table::relocate_stubs): Likewise.
8613 (Stub_table::do_write): Likewise.
8614 (Stub_table::update_data_size_and_addralign): Likewise.
8615 (Stub_table::finalize_stubs): Likewise.
8616 (Target_arm::Scan::local): Likewise.
8617 (Target_arm::Scan::global): Likewise.
8618 (Target_arm::do_finalize_sections): Likewise.
8619 (Target_arm::Relocate::relocate): Likewise.
8620 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8621 Likewise.
8622 (Target_arm::scan_reloc_for_stub): Likewise.
8623 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8624
8625 2010-01-19 Ian Lance Taylor <iant@google.com>
8626
8627 * output.cc (Output_section_headers::do_sized_write): Write large
8628 segment count to sh_info field.
8629 (Output_file_header::do_sized_write): For large segment count,
8630 write PN_XNUM to e_phnum field.
8631
8632 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8633
8634 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8635 (Arm_relocate_functions::thm_jump8): New function.
8636 (Arm_relocate_functions::thm_jump11): New function.
8637 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8638 R_ARM_THM_JUMP11.
8639 (Target_arm::Scan::global): Likewise.
8640 (Target_arm::Relocate::relocate): Likewise.
8641 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8642 Likewise.
8643
8644 2010-01-14 Doug Kwan <dougkwan@google.com>
8645
8646 * arm.cc (map, utility): Include headers.
8647 (Target_arm::apply_cortex_a8_workaround): New method.
8648 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8649 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8650 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8651 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8652 the --[no-]fix-cortex-a8 command line options.
8653 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8654 (Target_arm::relocate_stub): Use addend in instruction template.
8655 * options.h (DEFINE_bool): Set the user-set flag.
8656 (General_options): Add --[no-]-fix-cortex options.
8657 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
8658 : Update fast look-up map after conversion.
8659
8660 2010-01-14 Sriraman Tallam <tmsriram@google.com>
8661
8662 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8663 in the first pass of do_layout.
8664
8665 2010-01-13 Doug Kwan <dougkwan@google.com>
8666
8667 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8668 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8669 apparent compiler problem of not folding static constant integral
8670 data members of elfcpp::Elf_sizes<32>.
8671
8672 2010-01-13 Doug Kwan <dougkwan@google.com>
8673
8674 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8675 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8676 Arm_relobj::scan_section_for_cortex_a8_erratum,
8677 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8678 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8679 sections to scan for relocation stubs into a new method
8680 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8681 relocation and Cortex-A8 stub scanning.
8682 (Target_arm::do_relax): Force stubs to be after stubbed sections
8683 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
8684 the beginning of a new relaxation pass. Update a comment.
8685 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8686
8687 2010-01-12 Ian Lance Taylor <iant@google.com>
8688
8689 * target-reloc.h (visibility_error): New inline function.
8690 (relocate_section): Call visibility_error.
8691 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8692 (MOSTLYCLEANFILES): Likewise.
8693 (protected_4_pic.o, protected_3.err): New targets.
8694 * testsuite/protected_4.cc: New file.
8695
8696 2010-01-12 Doug Kwan <dougkwan@google.com>
8697
8698 * arm.cc (Cortex_a8_reloc): New class.
8699 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8700 and cortex_a8_relocs_info_.
8701 (Target_arm::fix_cortex_a8): New method definition.
8702 (Target_arm::Cortex_a8_relocs_info): New type.
8703 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8704 New data member declarations.
8705 (Target_arm::scan_reloc_for_stub): Record information about
8706 relocations for THUMB branches that might be exempted from the
8707 Cortex-A8 workaround.
8708 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8709 at the beginning of a relaxation pass.
8710
8711 2010-01-12 Doug Kwan <dougkwan@google.com>
8712
8713 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8714 (Arm_relobj::Mapping_symbol_position,
8715 Arm_reloj::Mapping_symbol_position_less,
8716 Arm_relobj::Mapping_symbols_info): New types.
8717 (Target_arm::is_mapping_symbol_name): New method definition.
8718 (Arm_relobj::do_count_local_symbols): Save information about mapping
8719 symbols.
8720
8721 2010-01-11 Doug Kwan <dougkwan@google.com>
8722
8723 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8724 Arm_relocate_functions::thumb32_branch_upper,
8725 Arm_relocate_functions::thumb32_branch_lower,
8726 Arm_relocate_functions::thumb32_cond_branch_offset,
8727 Arm_relocate_functions::thumb32_cond_branch_upper,
8728 Arm_relocate_functions::thumb32_cond_branch_lower,
8729 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8730 branch offset encoding.
8731 (Arm_relocate_functions::thumb_branch_common): Use new branch
8732 offset encoding methods to avoid code duplication.
8733 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8734 (Stub_addend_reader::operator()): Use new branch encoding method
8735 to avoid code duplication.
8736
8737 2010-01-11 Doug Kwan <dougkwan@google.com>
8738
8739 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8740 (Target_arm::do_finalize_sections): Define special EXIDX section
8741 symbols only if referenced.
8742 * gc.h (Garbage_collection::add_reference): New method.
8743 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8744 code duplication.
8745
8746 2010-01-11 Ian Lance Taylor <iant@google.com>
8747
8748 * script.cc (Version_script_info::build_expression_list_lookup):
8749 Change complaing about duplicate wildcard match from error to
8750 warning.
8751
8752 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8753 of 2009-12-30.
8754 (Version_script_info::Version_script_info): Initialize globs_,
8755 default_version_, default_is_global_, and exact_. Don't
8756 initialize globals_ or locals_.
8757 (Version_script_info::build_lookup_tables): Build local symbols
8758 first.
8759 (Version_script_info::unquote): New function.
8760 (Version_script_info::add_exact_match): New function.
8761 (Version_script_info::build_expression_list_lookup): Remove lookup
8762 parameter. Add is_global parameter. Change all callers. Handle
8763 wildcard pattern specially. Unquote pattern. Call
8764 add_exact_match.
8765 (Version_script_info::get_name_to_match): New function.
8766 (Version_script_info::get_symbol_version): New function.
8767 (Version_script_info::get_symbol_version_helper): Remove.
8768 (Version_script_info::check_unmatched_names): Call unquote.
8769 * script.h (class Version_script_info): Change get_symbol_version
8770 to be non-inline and add is_global parameter; change all callers.
8771 Rewrite symbol_is_local. Update declarations. Define struct
8772 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8773 Remove globals_ and locals_ members. Add exact_, globs_,
8774 default_version_, is_global_.
8775 (Version_script_info::Glob): Remove pattern, add expression and
8776 is_global. Update constructor. Change all callers.
8777 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8778 default version.
8779 (Versions::symbol_section_contents): If a symbol is undefined, or
8780 defined in a dynamic object, set the version index to
8781 VER_NDX_LOCAL.
8782 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8783 symbol_is_local.
8784 (Symbol_table::add_from_pluginobj): Likewise.
8785 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8786
8787 2010-01-11 Doug Kwan <dougkwan@google.com>
8788
8789 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8790 (incremental_dump_LDADD): Add linking option for libintl.
8791 * Makefile.in: Regenerate.
8792
8793 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8794
8795 PR gold/11144
8796 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8797 instead of -Ds.
8798 * testsuite/Makefile.in: Regenerated.
8799
8800 2010-01-10 Doug Kwan <dougkwan@google.com>
8801
8802 * options.h (DEFINE_var): Use parentheses around argument varname__
8803 in macro body to avoid any unintended subsequent substitutions.
8804
8805 2010-01-10 Ian Lance Taylor <iant@google.com>
8806
8807 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8808 candidates before doing symbol resolution.
8809
8810 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8811 ODR candidates if only one is weak.
8812
8813 2010-01-08 Ian Lance Taylor <iant@google.com>
8814
8815 * script.cc (Version_script_info::build_expression_list_lookup):
8816 Don't warn about ambiguous version, just record the ambiguity.
8817 (Version_script_info::get_symbol_version_helper): Give error if
8818 version is ambiguous.
8819
8820 2010-01-08 Doug Kwan <dougkwan@google.com>
8821
8822 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
8823 prev_data_size_ and prev_addralign_. Remove initializer for
8824 deleted data member has_been_changed_.
8825 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8826 to determine if the table is empty.
8827 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8828 Remove.
8829 (Stub_table::add_reloc_stub): Define method in class definition
8830 instead of just declaring it there.
8831 (Stub_table::add_cortex_a8_stub): New method definition.
8832 (Stub_table::update_data_size_and_addralign): Ditto.
8833 (Stub_table::finalize_stubs): Ditto.
8834 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8835 (Stub_table::do_addralign_): Return address alignment in the
8836 (Stub_table::do_reset_address_and_file_offset): Define method in
8837 class definition instead of declaring it there. Set current data
8838 size to be the data size of the previous pass.
8839 (Stub_table::set_final_data_size): Use current data size as the
8840 final data size.
8841 (Stub_table::relocate_stub): Change parameter type of stub from
8842 Reloc_stub pointer to Stub pointer.
8843 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8844 (Stub_table::Cortex_a8_stub_list): New typedef.
8845 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8846 Stub_table::prev_addralign_): New data member.
8847 (Arm_relobj::Arm_relobj): Initialize data member
8848 section_has_cortex_a8_workaround_.
8849 (Arm_relobj::section_has_cortex_a8_workaround,
8850 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8851 definitions.
8852 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8853 declarations.
8854 (Target_arm::relocate_stub): Change parameter type of stub from
8855 Reloc_stub pointer to Stub pointer.
8856 (Insn_template::size, Insn_template::alignment): Handle
8857 THUMB16_SPECIAL_TYPE.
8858 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8859 Stub_table::update_data_size_and_addralign,
8860 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8861 definitions.
8862 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8863 (Stub_table::do_write): Ditto.
8864 (Target_arm::do_relax): Adjust code for changes in Stub_table.
8865
8866 2010-01-08 Ian Lance Taylor <iant@google.com>
8867
8868 PR 11108
8869 * symtab.h (class Symbol): Remove fields is_target_special_ and
8870 has_plt_offset_. Add field is_defined_in_discarded_section_.
8871 (Symbol::is_defined_in_discarded_section): New function.
8872 (Symbol::set_is_defined_in_discarded_section): New function.
8873 (Symbol::has_plt_offset): Rewrite.
8874 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8875 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8876 Don't initialize is_target_special_ or has_plt_offset_.
8877 Initialize is_defined_in_discarded_section_.
8878 (Symbol_table::add_from_relobj): If appropriate, set
8879 is_defined_in_discarded_section.
8880 * resolve.cc (Symbol::override_base_with_special): Don't test
8881 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8882 * target-reloc.h (relocate_section): Do special handling for
8883 symbols defined in discarded sections for global symbols as well
8884 as local symbols.
8885
8886 2010-01-08 Ian Lance Taylor <iant@google.com>
8887
8888 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8889 the SHT_SYMTAB case.
8890
8891 2010-01-08 Ian Lance Taylor <iant@google.com>
8892
8893 * object.cc (Sized_relobj::do_layout): Don't get confused if
8894 layout_eh_frame returns NULL.
8895
8896 2010-01-08 Ian Lance Taylor <iant@google.com>
8897
8898 PR 11084
8899 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8900 dynamic symbol table, use the normal symbol table.
8901 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8902 symbol table.
8903
8904 2010-01-08 Ian Lance Taylor <iant@google.com>
8905
8906 PR 11072
8907 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8908 sections.
8909
8910 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8911
8912 * version.cc (print_version): Change to "Copyright 2010".
8913
8914 2010-01-08 Ian Lance Taylor <iant@google.com>
8915
8916 PR 10287
8917 PR 11063
8918 * i386.cc (class Target_i386): Change return type of plt_section
8919 to be non-const.
8920 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8921 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8922 tls_desc_rel_ field.
8923 (Output_data_plt_i386::rel_tls_desc): New function.
8924 (Target_i386::rel_tls_desc_section): New function.
8925 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8926 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8927 R_386_TLS_DESC reloc in rel_tls_desc_section.
8928 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8929 Define struct Tlsdesc_info.
8930 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8931 (Target_x86_64::do_reloc_symbol_index): New function.
8932 (Target_x86_64::add_tlsdesc_info): New function.
8933 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8934 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8935 tlsdesc_rel_ field.
8936 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8937 all callers.
8938 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8939 (Target_x86_64::rela_tlsdesc_section): New function.
8940 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8941 handling.
8942 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8943 (Target_x86_64::do_reloc_addend): New function.
8944 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8945 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8946 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8947 (Output_reloc::type): New function.
8948 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8949 (Output_reloc::is_target_specific): New function.
8950 (Output_reloc::target_arg): New function.
8951 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8952 absolute relocs and target specific relocs.
8953 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8954 add_target_specific.
8955 (class Output_data_reloc) [SHT_RELA]: Likewise.
8956 * output.cc (Output_reloc::Output_reloc): Add four new versions
8957 for absolute relocs and target specific relocs.
8958 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8959 (Output_reloc::get_symbol_index): Likewise.
8960 (Output_reloc::local_section_offset): Check that local_sym_index_
8961 is not TARGET_CODE or 0.
8962 (Output_reloc::symbol_value): Likewise.
8963 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8964 reloc.
8965 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8966 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8967 functions.
8968 * layout.cc (add_target_dynamic_tags): Use output section for
8969 DT_PLTRELSZ and DT_JMPREL.
8970
8971 2010-01-07 Ian Lance Taylor <iant@google.com>
8972
8973 PR 11061
8974 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8975 function.
8976 (class Output_data_reloc_generic): Define.
8977 (class Output_data_reloc_base): Change base class to
8978 Output_data_reloc_generic. Change add() method to call
8979 bump_relative_reloc_count for a relative reloc. Remove
8980 sort_relocs_ field.
8981 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8982 to sort_relocs().
8983 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8984 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8985 appropriate.
8986 * layout.h (class Layout): Update declaration.
8987
8988 2010-01-07 Ian Lance Taylor <iant@google.com>
8989
8990 * output.h (class Output_data): Add const version of
8991 output_section and do_output_section.
8992 (class Output_section_data): Add const version of
8993 do_output_section.
8994 (class Output_section): Likewise.
8995 * layout.cc (Layout::add_target_dynamic_tags): New function.
8996 * layout.h (class Layout): Update declarations.
8997 * arm.cc (Target_arm::do_finalize_sections): Use
8998 add_target_dynamic_tags.
8999 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9000 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9001 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9002 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9003
9004 2010-01-07 Ian Lance Taylor <iant@google.com>
9005
9006 PR 11042
9007 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9008 object as needed.
9009
9010 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9011 Ian Lance Taylor <iant@google.com>
9012
9013 PR 11019
9014 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9015 Xindex::read_symtab_xindex.
9016
9017 2010-01-07 Doug Kwan <dougkwan@google.com>
9018
9019 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9020 (Insn_template::thumb16_bcond_insn): New method declaration.
9021 (Insn_template): Fix spelling.
9022 (Stub::thumb16_special): New method declaration.
9023 (Stub::do_write): Define virtual method which was previously pure
9024 virtual.
9025 (Stub::do_thumb16_special): New method declaration.
9026 (Stub::do_fixed_endian_write): New template member.
9027 (Reloc_stub::do_write): Remove.
9028 (Reloc_stub::do_fixed_endian_write): Remove.
9029 (Cortex_a8_stub): New class definition.
9030 (Stub_factory::make_cortex_a8_stub): New method definition.
9031 (Stub_factory::Stub_factory): Add missing static storage class
9032 qualifier for elf32_arm_stub_a8_veneer_blx.
9033
9034 2010-01-07 Ian Lance Taylor <iant@google.com>
9035
9036 PR 10980
9037 * options.h (class General_options): Add --warn-unresolved-symbols
9038 and --error-unresolved-symbols.
9039 * errors.cc (Errors::undefined_symbol): Implement
9040 --warn-unresolved-symbols.
9041
9042 * options.h (class General_options): Add -z text and -z textoff.
9043 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9044
9045 2010-01-06 Sriraman Tallam <tmsriram@google.com>
9046
9047 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9048 (Garbage_collection::cident_sections): New function.
9049 (Garbage_collection::add_cident_section): New function.
9050 (Garbage_collection::cident_sections_): New member.
9051 (gc_process_relocs): Add references to sections whose names are C
9052 identifiers.
9053 * gold.h (cident_section_start_prefix): New constant.
9054 (cident_section_stop_prefix): New constant.
9055 (is_cident): New function.
9056 * layout.cc (Layout::define_section_symbols): Replace string constants
9057 with the newly defined constants.
9058 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9059 C identifiers.
9060 * testsuite/Makefile.am: Add gc_orphan_section_test.
9061 * testsuite/Makefile.in: Regenerate.
9062 * testsuite/gc_orphan_section_test.cc: New file.
9063 * testsuite/gc_orphan_section_test.sh: New file.
9064
9065 2010-01-06 Ian Lance Taylor <iant@google.com>
9066
9067 PR 10980
9068 * options.h (class General_options): Add --warn-shared-textrel.
9069 * layout.cc (Layout::finish_dynamic_section): Implement
9070 --warn-shared-textrel.
9071
9072 PR 10980
9073 * options.h (class General_options): Add --warn-multiple-gp.
9074
9075 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9076
9077 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9078 $(THREADSLIB) and $(LIBDL).
9079 * Makefile.in: Rebuild.
9080
9081 2010-01-06 Ian Lance Taylor <iant@google.com>
9082
9083 PR 10980
9084 * options.cc (General_options::parse_section_start): New function.
9085 (General_options::section_start): New function.
9086 (General_options::General_options): Initialize all members.
9087 * options.h: Include <map>
9088 (class General_options): Add --section-start. Add section_starts_
9089 member.
9090 * layout.cc (Layout::attach_allocated_section_to_segment): If
9091 --section-start was used, set the address of the segment. Remove
9092 local sort_sections.
9093 (Layout::relaxation_loop_body): If the address of the load segment
9094 has been set by --section-start, don't use it.
9095 * output.h (Output_segment::update_flags_for_output_section): New
9096 function.
9097 * output.cc (Output_segment::add_output_section): Call
9098 update_flags_for_output_section.
9099
9100 2010-01-05 Ian Lance Taylor <iant@google.com>
9101
9102 PR 10980
9103 * options.h (class General_options): Add --undefined-version.
9104 * script.cc (struct Version_expression): Add was_matched_by_symbol
9105 field.
9106 (Version_script_info::matched_symbol): New function.
9107 (Version_script_info::get_symbol_version_helper): Call
9108 matched_symbol.
9109 (Version_script_info::check_unmatched_names): New function.
9110 * script.h (class Version_script_info): Update declarations.
9111 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9112
9113 * options.h (class General_options): Use DEFINE_bool_alias for
9114 allow_multiple_definition.
9115 * resolve.cc (Symbol_table::should_override): Don't test
9116 allow_multiple_definition.
9117
9118 PR 10980
9119 * options.h (class General_options): Add --cref.
9120 * main.cc (main): Print cref table if --cref. Don't close mapfile
9121 until after printing cref table.
9122 * cref.cc: Include "symtab.h".
9123 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9124 (Cref_table_compare::operator()): New function.
9125 (Cref_inputs::gather_cref): New function.
9126 (filecol): New static const.
9127 (Cref_inputs::print_cref): New function.
9128 (Cref::print_cref): New function.
9129 * cref.h: Include <cstdio>.
9130 (class Cref): Update declarations.
9131 * mapfile.h (Mapfile::file): New function.
9132 * object.h (class Object): Define Symbols. Declare virtual
9133 do_get_global_symbols.
9134 (Object::get_global_symbols): New function.
9135 * object.cc (Input_objects::add_object): Pass object to cref_ if
9136 --cref.
9137 (Input_objects::archive_start): Likewise.
9138 (Input_objects::archive_stop): Likewise.
9139 (Input_objects::print_cref): New function.
9140 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9141 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9142 --cref.
9143 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9144 function.
9145 * plugin.h (class Sized_pluginobj): Update declarations.
9146
9147 2010-01-05 Ian Lance Taylor <iant@google.com>
9148
9149 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9150 to is_default_version. Rename insdef to insdefault.
9151 (Symbol_table::add_from_relobj): Rename def to is_default_version
9152 and local to is_forced_local.
9153 (Symbol_table::add_from_pluginobj): Likewise.
9154 (Symbol_table::add_from_dynobj): Likewise.
9155 (Symbol_table::define_special_symbol): Rename insdef to
9156 insdefault.
9157
9158 2010-01-04 Ian Lance Taylor <iant@google.com>
9159
9160 PR 10980
9161 * options.h (class General_options): Add
9162 --allow-multiple-definition and -z muldefs.
9163 * resolve.cc (Symbol_table::should_override): Don't warn about a
9164 multiple symbol definition if --allow-multiple-definition or -z
9165 muldefs.
9166
9167 PR 10980
9168 * options.h (class General_options): Add --add-needed and
9169 --copy-dt-needed-entries. Tweak --as-needed help entry.
9170 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9171 error if --copy-dt-needed-entries aka --add-needed is used and
9172 would cause a change in behaviour.
9173
9174 PR 10980
9175 * options.h (class General_options): Add -G as a short version of
9176 --shared. Add no-op options -assert, -g, and -i.
9177
9178 2010-01-04 Sriraman Tallam <tmsriram@google.com>
9179
9180 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9181 check for .text or .gnu.linkonce.t sections.
9182 * icf.cc (Icf::find_identical_sections): Ditto.
9183 Change the detection for mangled function name within the section
9184 name.
9185 * icf.h (is_section_foldable_candidate): New function.
9186
9187 2009-12-30 Ian Lance Taylor <iant@google.com>
9188
9189 PR 10980
9190 * options.h (class General_options): Permit two dashes with
9191 --retain-symbols-file.
9192
9193 2009-12-30 Ian Lance Taylor <iant@google.com>
9194
9195 PR 10979
9196 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9197 don't put the file header and segment headers in the text
9198 segment.
9199
9200 PR 10979
9201 * common.cc (Sort_commons::operator()): Stabilize sort when both
9202 entries are NULL.
9203 (Symbol_table::do_allocate_commons_list): When allocating common
9204 symbols, skip a symbol which is no longer common.
9205 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9206 an object before checking its type.
9207 * testsuite/common_test_2.c: New file.
9208 * testsuite/common_test_3.c: New file.
9209 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9210 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9211 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9212 (common_test_2_pic.o, common_test_2.so): New targets.
9213 (common_test_3_pic.o, common_test_3.so): New targets.
9214 * testsuite/Makefile.in: Rebuild.
9215
9216 PR 10979
9217 * script.cc (read_input_script): If we see a new SECTIONS clause,
9218 and we have added an input section, give an error.
9219 * layout.h (class Layout): Add have_added_input_section function.
9220 Add have_added_input_section_ field.
9221 * layout.cc (Layout::Layout): Initialize
9222 have_added_input_section_.
9223 (Layout::layout): Set have_added_input_section_.
9224 (Layout::layout_eh_frame): Likewise.
9225
9226 2009-12-30 Ian Lance Taylor <iant@google.com>
9227
9228 PR 10931
9229 * options.h (class General_options): Add --sort-common option.
9230 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9231 * common.cc (Sort_common): Add sort_order parameter to
9232 constructor. Add sort_order_ field.
9233 (Sort_commons::operator): Check sort_order_.
9234 (Symbol_table::allocate_commons): Determine the sort order.
9235 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9236 Change all callers.
9237 (Symbol_table::do_allocate_commons_list): Likewise.
9238
9239 2009-12-30 Ian Lance Taylor <iant@google.com>
9240
9241 PR 10916
9242 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9243 symbols from this object, don't change the visibility of an
9244 undefined symbol.
9245 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9246
9247 2009-12-30 Ian Lance Taylor <iant@google.com>
9248
9249 PR 10861
9250 * script.h (class Version_script_info): Define Language enum.
9251 Update declarations. Define Glob, Exact, and Lookup types. Add
9252 new fields globals_, locals_, and is_finalized_.
9253 * script.cc: Various formatting fixes.
9254 (class Parser_closure): Change language_stack_ from a vector of
9255 std::string to one of Version_script_info::Language. Adjust all
9256 uses accordingly.
9257 (class Lazy_demangler): Remove.
9258 (struct Version_expression): Change language from std::string to
9259 Version_script_info::Language.
9260 (Version_script_info::Version_script_info): New function.
9261 (Version_script_info::~Version_script_info): Don't call clear.
9262 (Version_script_info::finalize): New function.
9263 (Version_script_info::build_lookup_tables): New function.
9264 (Version_script_info::build_expression_list_lookup): New
9265 function.
9266 (Version_script_info::get_symbol_version_helper): Rewrite to use
9267 lookup tables.
9268 (Version_script_info::print_expression_list): Adjust to use
9269 Version_script_info::Language.
9270 (script_push_lex_into_version_mode): Check that the version script
9271 has not been finalized.
9272 (version_script_push_lang): Change language string to
9273 Version_script_info::Language.
9274 * options.cc (Command_line::version_script): New function.
9275 * options.h (class General_options): Add finalize_dynamic_list
9276 function. Change version_script from declaration to definition.
9277 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9278 * testsuite/version_script.map: Remove duplicate def of foo.
9279 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9280 version_script.map.
9281 * testsuite/Makefile.in: Rebuild.
9282
9283 2009-12-30 Ian Lance Taylor <iant@google.com>
9284
9285 PR 10843
9286 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9287 if the input symbol index is 0, make the output symbol index 0.
9288
9289 2009-12-30 Ian Lance Taylor <iant@google.com>
9290
9291 PR 10670
9292 * options.h (class General_options): Add -x/--discard-all.
9293 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9294 --discard-all. If the local symbol needs a dynamic entry, check
9295 that before handling --discard-locals.
9296
9297 2009-12-30 Ian Lance Taylor <iant@google.com>
9298
9299 PR 10450
9300 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9301 flags to PF_R.
9302 (Output_segment::add_output_section): Don't change the flags if
9303 the type is PT_TLS.
9304
9305 PR 10450
9306 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9307 GNU hash table if they need a dynamic value. Otherwise, don't add
9308 them if they are defined in a dynamic object or are forced local.
9309
9310 2009-12-29 Ian Lance Taylor <iant@google.com>
9311
9312 PR 10450
9313 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9314 .gnu.hash table for a 32-bit target.
9315
9316 PR 10450
9317 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9318 regular and a dynamic object only needs a dynamic symbol table
9319 entry if it is externally visible.
9320
9321 PR 10450
9322 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9323 constructor. Add global_offset_table_ field.
9324 (Target_i386::got_section): Set global_offset_table_.
9325 (Target_i386::do_finalize_sections): Set global_offset_table_
9326 size.
9327 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9328 in constructor. Add global_offset_table_ field.
9329 (Target_x86_64::got_section): Set global_offset_table_.
9330 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9331 size.
9332
9333 * layout.cc (Layout::Layout): Initialize increase_relro_.
9334 (Layout::get_output_section): Add is_relro, is_last_relro, and
9335 is_first_non_relro parameters. Change all callers.
9336 (Layout::choose_output_section): Likewise.
9337 (Layout::add_output_section_data): Likewise.
9338 (Layout::make_output_section): Likewise.
9339 (Layout::set_segment_offsets): Clear increase_relro when using a
9340 linker script.
9341 * layout.h (class Layout): Add increase_relro method. Add
9342 increase_relro_ field. Update declarations.
9343 * output.cc (Output_section::Output_section): Initialize
9344 is_last_relro_ and is_first_non_relro_.
9345 (Output_segment::add_output_section): Group relro sections is
9346 do_sort is true. Handle is_last_relro and is_first_non_relro.
9347 (Output_segment::maximum_alignment): Remove relro handling.
9348 (Output_segment::set_section_addresses): Add increase_relro
9349 parameter. Change all callers. Add initial alignment to align
9350 relro sections on separate page. Remove old relro handling.
9351 (Output_segment::set_section_list_addresses): Remove in_relro
9352 parameter. Change all callers.
9353 (Output_segment::set_offset): Add increase parameter. Change all
9354 callers. Remove old relro handling.
9355 * output.h (class Output_section): Add new methods: is_last_relro,
9356 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9357 Add is_last_relro_ and is_first_non_relro_ fields.
9358 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9359 Create separate .got.plt section. Call increase_relro.
9360 * x86_64.cc (Target_x86_64::got_section): Likewise.
9361 * testsuite/relro_script_test.t: Add .got.plt.
9362
9363 PR 10450
9364 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9365 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9366 (Layout::finalize): Call set_dynamic_symbol_size.
9367 (Layout::set_dynamic_symbol_size): New function.
9368 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9369 set_dynamic_symbol_size.
9370
9371 PR 10450
9372 * output.h (class Output_section): Add is_entsize_zero_ field.
9373 * output.cc (Output_section::Output_section): Initialize
9374 is_entsize_zero_.
9375 (Output_section::set_entsize): If two different entsizes are
9376 requested, force it to zero.
9377 (Output_section::add_input_section): Set flags for .debug_str
9378 before updating section flags. Set entsize.
9379 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9380 and SHF_STRING if all input sections have those flags.
9381
9382 2009-12-29 Rafael Espindola <espindola@google.com>
9383
9384 * main.cc (main): Fix the sys time reporting.
9385 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9386 reporting.
9387
9388 2009-12-29 Sriraman Tallam <tmsriram@google.com>
9389
9390 * options.cc (General_options::parse_version): Allow -v to exit
9391 without an error if there is nothing to link.
9392
9393 2009-12-29 Ian Lance Taylor <iant@google.com>
9394
9395 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9396 using a version of gcc before 4.1.
9397 * configure: Rebuild.
9398
9399 2009-12-28 Chris Demetriou <cgd@google.com>
9400
9401 * attributes.cc (Output_attributes_section_data::do_write): Use
9402 std::vector::front rather than std::vector::data.
9403
9404 2009-12-28 Ian Lance Taylor <iant@google.com>
9405
9406 * symtab.h (class Symbol_table): Add enum Defined.
9407 * resolve.cc (Symbol_table::should_override): Add defined
9408 parameter. Change all callers. Test whether object is NULL
9409 before calling a method on it.
9410 (Symbol_table::report_resolve_problem): Add defined parameter.
9411 Change all callers.
9412 (Symbol_table::should_override_with_special): Likewise.
9413 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9414 parameter. Change all callers.
9415 (Symbol_table::do_define_in_output_data): Likewise.
9416 (Symbol_table::define_in_output_segment): Likewise.
9417 (Symbol_table::do_define_in_output_segment): Likewise.
9418 (Symbol_table::define_as_constant): Likewise.
9419 (Symbol_table::do_define_as_constant): Likewise.
9420 * script.h (class Symbol_assignment): Add is_defsym parameter to
9421 constructor; change all callers.
9422 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9423 parameter. Change all callers. Add is_defsym_ field.
9424 (class Parser_closure): Add parsing_defsym parameter to
9425 constructor; change all callers. Add parsing_defsym accessor
9426 function. Add parsing_defsym_ field.
9427
9428 2009-12-28 Ian Lance Taylor <iant@google.com>
9429
9430 * gold.cc (queue_middle_tasks): Fix formatting.
9431 * object.cc (Relobj::is_section_name_included): Likewise.
9432
9433 2009-12-23 Ian Lance Taylor <iant@google.com>
9434
9435 * i386.cc (Target_i386::do_calls_non_split): Recognize
9436 -fsplit-stack prologue for a function with a static chain.
9437 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9438 -fsplit-stack prologue when using %r11.
9439
9440 2009-12-21 Sriraman Tallam <tmsriram@google.com>
9441
9442 * options.cc (General_options::parse_version): Make -v continue and do
9443 the link like GNU ld does.
9444
9445 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
9446
9447 * Makefile.am (CCFILES): Add timer.cc.
9448 (HFILES): Add timer.h.
9449 * configure.ac: Check for sysconf and times.
9450 * main.cc: include timer.h.
9451 (main): Use Timer instead of get_run_time.
9452 * timer.cc: New.
9453 * timer.h: New.
9454 * workqueue.cc: include timer.h.
9455 (Workqueue::find_and_run_task):
9456 Report user, sys and wall time.
9457 * Makefile.in: Regenerate.
9458 * config.in: Regenerate.
9459 * configure: Regenerate.
9460
9461 2009-12-16 Doug Kwan <dougkwan@google.com>
9462
9463 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9464 sections.
9465 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9466 relaxed input sections.
9467 * output.cc (Output_section::find_relaxed_input_section): Change
9468 return type to Output_relaxed_input_section pointer. Adjust code
9469 for new type of relaxed_input_section_map_.
9470 * output.h (Output_section::find_relaxed_input_section): Change
9471 return type to Output_relaxed_input_section pointer.
9472 (Output_section::Output_relaxed_input_section_by_input_section_map):
9473 New type.
9474 (Output_section::relaxed_input_section_map_): Change type to
9475 Output_section::Output_relaxed_input_section_by_input_section_map.
9476 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9477 input section.
9478
9479 2009-12-15 Ian Lance Taylor <iant@google.com>
9480
9481 * layout.cc (Layout::create_shstrtab): Only write out after input
9482 sections if we are compressing debug sections.
9483
9484 2009-12-15 Ian Lance Taylor <iant@google.com>
9485
9486 * archive.cc (Archive::add_symbols): Only look up a symbol without
9487 a version if there is, in fact, a version.
9488
9489 2009-12-14 Ian Lance Taylor <iant@google.com>
9490
9491 Revert -Wshadow changes, all changes from:
9492 2009-12-11 Doug Kwan <dougkwan@google.com>
9493 2009-12-11 Nick Clifton <nickc@redhat.com>
9494 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9495
9496 2009-12-11 Doug Kwan <dougkwan@google.com>
9497
9498 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9499 due to -Wshadow.
9500 * attributes.cc (Object_attribute::size): Ditto.
9501 (Attributes_section_data::size): Ditto.
9502 (Attributes_section_data::Attributes_section_data): Ditto.
9503 (Output_attributes_section_data::do_write): Ditto.
9504 * attributes.h (Object_attribute::set_type): Ditto.
9505 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9506
9507 2009-12-11 Nick Clifton <nickc@redhat.com>
9508
9509 * archive.cc: Fix shadowed variable warnings.
9510 * arm.cc: Likewise.
9511 * compressed_output.cc: Likewise.
9512 * compressed_output.h: Likewise.
9513 * configure: Likewise.
9514 * dwarf_reader.cc: Likewise.
9515 * dynobj.cc: Likewise.
9516 * dynobj.h: Likewise.
9517 * ehframe.cc: Likewise.
9518 * ehframe.h: Likewise.
9519 * errors.cc: Likewise.
9520 * expression.cc: Likewise.
9521 * fileread.cc: Likewise.
9522 * fileread.h: Likewise.
9523 * freebsd.h: Likewise.
9524 * i386.cc: Likewise.
9525 * icf.cc: Likewise.
9526 * incremental.h: Likewise.
9527 * layout.cc: Likewise.
9528 * layout.h: Likewise.
9529 * mapfile.cc: Likewise.
9530 * merge.cc: Likewise.
9531 * merge.h: Likewise.
9532 * object.cc: Likewise.
9533 * object.h: Likewise.
9534 * options.h: Likewise.
9535 * output.cc: Likewise.
9536 * output.h: Likewise.
9537 * parameters.cc: Likewise.
9538 * plugin.cc: Likewise.
9539 * powerpc.cc: Likewise.
9540 * reduced_debug_output.cc: Likewise.
9541 * reduced_debug_output.h: Likewise.
9542 * reloc.cc: Likewise.
9543 * reloc.h: Likewise.
9544 * resolve.cc: Likewise.
9545 * script-sections.cc: Likewise.
9546 * script.cc: Likewise.
9547 * script.h: Likewise.
9548 * sparc.cc: Likewise.
9549 * symtab.cc: Likewise.
9550 * symtab.h: Likewise.
9551 * target-select.cc: Likewise.
9552 * target-select.h: Likewise.
9553 * token.h: Likewise.
9554 * workqueue.cc: Likewise.
9555 * workqueue.h: Likewise.
9556 * x86_64.cc: Likewise.
9557
9558 2009-12-10 Doug Kwan <dougkwan@google.com>
9559
9560 * arm.cc (attributes.h): New include.
9561 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9562 (Arm_relobj::~Arm_relobj): Delete object pointed by
9563 attributes_section_data_.
9564 (Arm_relobj::attributes_section_data): New method definition.
9565 (Arm_relobj::attributes_section_data_): New data member declaration.
9566 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9567 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9568 attributes_section_data_.
9569 (Arm_dynobj::attributes_section_data): New method definition.
9570 (Arm_dynobj::attributes_section_data_): New data member declaration.
9571 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9572 initialization value of may_use_blx_ to false.
9573 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
9574 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9575 object attributes to compute results instead of hard-coding.
9576 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9577 Target_arm::get_secondary_compatible_arch,
9578 Target_arm::set_secondary_compatible_arch
9579 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9580 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9581 New method declarations.
9582 (Target_arm::get_aeabi_object_attribute): New method definition.
9583 (Target_arm::attributes_section_data_): New data member declaration.
9584 (read_arm_attributes_section): New template definition.
9585 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9586 (Arm_dynobj::do_read_symbols): Ditto.
9587 (Target_arm::do_finalize_sections): Merge attributes sections from
9588 input. Check for BLX use after attributes section merging.
9589 Fix __exidx_start and __exidx_end visibility. Create an
9590 .ARM.attributes section if necessary.
9591 (Target_arm::get_secondary_compatible_arch,
9592 Target_arm::set_secondary_compatible_arch,
9593 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9594 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
9595 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
9596 New method definitions.
9597
9598 2009-12-09 Ian Lance Taylor <iant@google.com>
9599
9600 * plugin.cc (Plugin::load): Don't cast from void* to a function
9601 pointer.
9602
9603 2009-12-09 Ian Lance Taylor <iant@google.com>
9604
9605 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9606 information fields.
9607
9608 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9609
9610 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9611 Replace two_file_shared_1.so with two_file_shared_2.so.
9612 * testsuite/Makefile.in: Regenerated.
9613
9614 2009-12-08 Doug Kwan <dougkwan@google.com>
9615
9616 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9617 (HFILES): Add attributes.h and int_encoding.h.
9618 * Makefile.in: Regenerate.
9619 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9620 function definitions to int_encoding.cc
9621 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9622 prototypes to int_encoding.h
9623 * reduced_debug_output.cc (int_encoding.h): New include.
9624 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9625 function definitions to int_encoding.cc
9626 (insert_into_vector, read_from_pointer): Move template definitions to
9627 int_encoding.h
9628 * attributes.cc: New file.
9629 * attributes.h: New file.
9630 * int_encoding.cc: New file.
9631 * int_encoding.h: New file.
9632
9633 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
9634
9635 PR gold/11055
9636 * incremental-dump.cc (dump_incremental_inputs): New.
9637 (main): Use dump_incremental_inputs.
9638
9639 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9640
9641 PR gold/10893
9642 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9643 checking elfcpp::STT_FUNC.
9644 (Target_i386::Relocate::relocate): Likewise.
9645 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9646
9647 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9648 symbols from shared libraries into normal FUNC symbols.
9649
9650 * symtab.h (Symbol): Add is_func and use it.
9651
9652 2009-12-05 Doug Kwan <dougkwan@google.com>
9653
9654 * arm.cc (Target_arm::arm_info): Initialize new fields
9655 attributes_section and attributes_vendor.
9656 * i386.cc (Target_i386::i386_info): Same.
9657 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9658 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9659 fields attributes_section and attributes_vendor.
9660 * sparc.cc (Target_sparc::sparc_info): Same.
9661 * target.h (Target::attributes_section, Target::attributes_vendor,
9662 Target::is_attributes_section, Target::attribute_arg_type,
9663 Target::attributes_order): New method definitions.
9664 (Target::Target_info::attributes_section,
9665 Target::Target_info::attributes_vendor): New fields.
9666 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9667 virtual method definitions.
9668 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9669 attributes_section and attributes_vendor.
9670 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9671
9672 2009-12-05 Doug Kwan <dougkwan@google.com>
9673
9674 * arm.cc: Update comments about interworking and stub generation.
9675 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9676 considered as non-PIC.
9677 (Arm_relocate_functions::base_abs): Fix formatting.
9678 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9679 of function to use GOT entry address instead of offset.
9680 (Target_arm::Scan::global): Issue an error if a symbol would need a
9681 PLT does not get one because it is untyped. Remove code to create
9682 dynamic symbols for relative branches.
9683 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9684 takes unsigned integer instead of boolean.
9685
9686 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9687
9688 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9689 (two_file_test_LDADD): Likewise.
9690 (common_test_1_LDADD): Likewise.
9691 (exception_test_LDADD) Likewise.
9692 (weak_test_LDADD): Likewise.
9693 (many_sections_test_LDADD): Likewise.
9694 (initpri1_LDADD): Likewise.
9695 (script_test_1_LDADD): Likewise.
9696 (script_test_2_LDADD): Likewise.
9697 (justsyms_LDADD): Likewise.
9698 (binary_test_LDADD): Likewise.
9699 (large_LDADD): Likewise.
9700 * testsuite/Makefile.in: Regenerated.
9701
9702 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
9703
9704 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9705 (Symbol_table::override_with_special): Likewise.
9706 (Symbol_table::add_from_object): Likewise.
9707
9708 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9709
9710 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9711 Don't set the data_offset twice.
9712
9713 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9714
9715 * testsuite/Makefile.in: Regenerate.
9716
9717 2009-12-03 Doug Kwan <dougkwan@google.com>
9718
9719 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9720 (Target_arm::do_finalize_sections): Add parameter for symbol table
9721 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9722 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9723 parameter for symbol table pointer.
9724 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9725 an additional parameter for a pointer to symbol table.
9726 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9727 parameter for a symbol table pointer.
9728 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9729 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9730 Ditto.
9731 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9732 parameter for a symbol table pointer.
9733
9734 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
9735
9736 * incremental.cc (Incremental_inputs_header)
9737 (Incremental_inputs_header_write, Incremental_inputs_entry)
9738 (Incremental_inputs_entry_write): Move ...
9739 * incremental.h (Incremental_inputs_header)
9740 (Incremental_inputs_header_write, Incremental_inputs_entry)
9741 (Incremental_inputs_entry_write): here.
9742
9743 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9744
9745 * incremental.cc (make_sized_incremental_binary): Set the target.
9746 Error if it is incompatible.
9747 * output.h (Output_file): Add filename method.
9748
9749 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9750
9751 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9752 from the get_* methods.
9753
9754 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9755
9756 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9757 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9758 Write 0 for the data_offset of scripts.
9759
9760 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9761
9762 * testsuite/Makefile.am: Add the incremental_test.sh test.
9763 * testsuite/incremental_test.sh: New.
9764 * testsuite/incremental_test_1.c: New.
9765 * testsuite/incremental_test_2.c: New.
9766
9767 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
9768
9769 * incremental-dump.cc (main): Fix typos.
9770
9771 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
9772
9773 PR gold/11025
9774 * incremental-dump.cc (main): Use llu to print 64 bit values.
9775
9776 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9777 H.J. Lu <hongjiu.lu@intel.com>
9778
9779 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9780 $(LIBDL).
9781 (incremental_dump_LDADD): Likewise.
9782 * Makefile.in: Regenerated.
9783
9784 2009-11-25 Doug Kwan <dougkwan@google.com>
9785
9786 Revert:
9787
9788 2009-11-25 Doug Kwan <dougkwan@google.com>
9789
9790 * arm.cc (Target_arm::Target_arm): Move method definition
9791 outside of class definition. Add code to handle
9792 --target1-rel, --target1-abs and --target2= options.
9793 (Target_arm::get_reloc_reloc_type): Change method to be
9794 non-static and const.
9795 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9796 New data member declaration.
9797 (Target_arm::Scan::local, Target_arm::Scan::global,
9798 Target_arm::Relocate::relocate,
9799 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9800 Adjust call to Target_arm::get_real_reloc_type.
9801 (Target_arm::get_real_reloc_type): Use command line options
9802 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9803 * options.h (--target1-rel, --target1-abs, --target2): New
9804 ARM-only options.
9805
9806 2009-11-25 Doug Kwan <dougkwan@google.com>
9807
9808 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9809 class definition. Add code to handle --target1-rel, --target1-abs
9810 and --target2= options.
9811 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9812 and const.
9813 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9814 member declaration.
9815 (Target_arm::Scan::local, Target_arm::Scan::global,
9816 Target_arm::Relocate::relocate,
9817 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9818 call to Target_arm::get_real_reloc_type.
9819 (Target_arm::get_real_reloc_type): Use command line options to
9820 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9821 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9822 options.
9823
9824 2009-11-25 Doug Kwan <dougkwan@google.com>
9825
9826 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9827 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9828 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9829 formatting.
9830 (Arm_relocate_functions::thm_call): Replace body with a call to
9831 Arm_relocate_functions::thumb_branch_common.
9832 (Arm_relocate_functions::thm_jump24,
9833 Arm_relocate_functions::thm_xpc22): New method definitions.
9834 (Arm_relocate_functions::thumb_branch_common): New method definition.
9835 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9836 operator.
9837 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9838 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9839
9840 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9841
9842 * Makefile.am: Build incremental-dump
9843 * Makefile.in: Regenerate.
9844 * incremental-dump.cc: New.
9845 * incremental.cc (Incremental_inputs_header_data,
9846 Incremental_inputs_entry_data): Move to incremental.h
9847 * incremental.h: (Incremental_inputs_header_data,
9848 Incremental_inputs_entry_data): Move from incremental.cc
9849
9850 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9851
9852 * incremental.cc (Incremental_inputs_header,
9853 Incremental_inputs_header_write, Incremental_inputs_entry,
9854 Incremental_inputs_entry_write): Add a typedef with the data type.
9855
9856 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9857
9858 * incremental.cc (Incremental_inputs_header,
9859 Incremental_inputs_header_write, Incremental_inputs_entry,
9860 Incremental_inputs_entry_write): Update comment about which
9861 type has the filed descriptions.
9862
9863 2009-11-15 Doug Kwan <dougkwan@google.com>
9864
9865 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9866 (Arm_relocate_functions::arm_branch_common): Change method defintion
9867 in class definition to a method declaration and update list of formal
9868 parameters.
9869 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9870 Arm_relocation_functions::jump24): Adjust call to
9871 Arm_relocate_functions::arm_branch_common. Update list of formal
9872 parameters.
9873 (Arm_relocate_functions::xpc25): New method definition.
9874 (Arm_relocate_functions::arm_branch_common): Move method defintion
9875 out from class definition. Use stubs for mode-switching and extending
9876 branch ranges.
9877 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9878 specially. Change code to enable use of stubs in ARM branches.
9879
9880 2009-11-10 Doug Kwan <dougkwan@google.com>
9881
9882 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9883 in method declaration.
9884 (Target_arm::relocate_stub): New method declaration.
9885 (Target_arm::default_target): Change to return a pointer instead of
9886 a const reference.
9887 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9888 Target_arm::default_target.
9889 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9890 method definition.
9891 (Target_arm::relocate_section): Adjust view.
9892 (Target_arm::relocate_stub): New method definition.
9893
9894 2009-11-10 Doug Kwan <dougkwan@google.com>
9895
9896 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9897 a format warning.
9898 * incremental.cc (open_incremental_binary): Initialized local
9899 variables to avoid warnings.
9900 * object.cc (make_elf_object): Ditto.
9901 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9902 a format warning.
9903
9904 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9905
9906 PR gold/10930
9907 * testsuite/plugin_test.c: Include "config.h".
9908
9909 2009-11-09 Doug Kwan <dougkwan@google.com>
9910
9911 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9912 (arm_symbol_value): Remove.
9913 (Arm_relocate_functions::arm_branch_common,
9914 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9915 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9916 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9917 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9918 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9919 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9920 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9921 Arm_relocate_functions::thm_mobw_abs_nc,
9922 Arm_relocate_functions::thm_mov_abs,
9923 Arm_relocate_functions::movw_prel_nc,
9924 Arm_relocate_functions::thm_movt_abs,
9925 Arm_relocate_functions::movt_prel,
9926 Arm_relocate_functions::thm_movw_prel_nc,
9927 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9928 (Target_arm::Relocate::relocate): Only decompose address into two
9929 parts if relocation type uses the thumb-bit and pass the actual
9930 bit instead of a flag indicating that the thumb-bit is used. Adjust
9931 calls to methods in Arm_relocate_functions for this change.
9932
9933 2009-11-08 Ian Lance Taylor <iant@google.com>
9934
9935 PR 10925
9936 * reloc.cc: Instantiate
9937 Sized_relobj::initialize_input_to_output_maps and
9938 Sized_relobj:free_input_to_output_maps.
9939
9940 2009-11-06 Ian Lance Taylor <iant@google.com>
9941
9942 PR 10876
9943 * defstd.cc (in_segment): Set only_if_ref true for "end".
9944
9945 2009-11-06 Doug Kwan <dougkwan@google.com>
9946
9947 * arm.cc (class Reloc_stub): Correct a comment.
9948 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9949 (Target_arm::scan_section_for_stubs): New method declaration.
9950 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9951 Change methods from private to protected.
9952 (Target_arm::do_may_relax): New method definition.
9953 (Target_arm::do_relax, Target_arm::group_sections,
9954 Target_arm::scan_reloc_for_stub,
9955 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9956 (Target_arm::arm_input_section_map_): New data member declaration.
9957 (Target_arm::scan_reloc_for_stub,
9958 Target_arm::scan_reloc_section_for_stubs,
9959 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9960 Target_arm::do_relax): New method definitions.
9961
9962 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9963
9964 * configure.ac: Check for (struct stat)::st_mtim
9965 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9966 * config.in: Regenerate.
9967 * configure: Regenerate.
9968
9969 2009-11-05 Ian Lance Taylor <iant@google.com>
9970
9971 PR 10910
9972 * output.cc (Output_segment::add_output_section): Add missing
9973 return statement.
9974
9975 2009-11-04 Ian Lance Taylor <iant@google.com>
9976
9977 PR 10880
9978 * object.h (class Object): Add is_needed and set_is_needed
9979 methods. Add is_needed_ field. Make bool fields into bitfields.
9980 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9981 defined in a dynamic object and referenced by a regular object,
9982 set is_needed for the dynamic object.
9983 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9984 if the file is marked with as_needed and it is not needed.
9985
9986 2009-11-04 Ian Lance Taylor <iant@google.com>
9987
9988 PR 10887
9989 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9990 tags if data is discarded by linker script.
9991 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9992 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9993 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9994 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9995
9996 2009-11-04 Ian Lance Taylor <iant@google.com>
9997
9998 * layout.cc (Layout::get_output_section): Add is_interp and
9999 is_dynamic_linker_section parameters. Change all callers.
10000 (Layout::choose_output_section): Likewise.
10001 (Layout::make_output_section): Likewise.
10002 (Layout::add_output_section_data): Add is_dynamic_linker_section
10003 parameter. Change all callers.
10004 * layout.h (class Layout): Update declarations.
10005 * output.h (class Output_section): Add is_interp, set_is_interp,
10006 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10007 Add is_interp_, is_dynamic_linker_section_ fields. Change
10008 generate_code_fills_at_write_ to a bitfield.
10009 * output.cc (Output_section::Output_sections): Initialize new
10010 fields.
10011 (Output_segment::add_output_section): Add do_sort parameter.
10012 Change all callers.
10013
10014 2009-11-03 Ian Lance Taylor <iant@google.com>
10015
10016 PR 10860
10017 * options.h (class General_options): Add --warn-common.
10018 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10019 merging two common symbols.
10020 (Symbol_table::should_override): Handle --warn-common when merging
10021 a common symbol with a defined symbol. Use report_resolve_problem
10022 for multiple definitions.
10023 (Symbol_table::report_resolve_problem): New function.
10024 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10025
10026 2009-11-03 Doug Kwan <dougkwan@google.com>
10027
10028 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10029 stub_factory_.
10030 (Target_arm::stub_factory): New method definition.
10031 (Target_arm::new_arm_input_section,
10032 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10033 Target_arm::reloc_uses_thumb_bit): New method declarations.
10034 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
10035 New type definitions.
10036 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10037 member declarations.
10038 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10039 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10040 New method definitions.
10041
10042 2009-11-03 Ian Lance Taylor <iant@google.com>
10043
10044 * options.h (class General_options): Add --warn_constructors.
10045
10046 2009-11-03 Ian Lance Taylor <iant@google.com>
10047
10048 PR 10893
10049 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10050 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10051
10052 2009-11-03 Ian Lance Taylor <iant@google.com>
10053
10054 PR 10895
10055 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10056 --msgid-bugs-address.
10057 (install-pdf): New target.
10058 (install-data_yes): Look up one directory to find mkinstalldirs.
10059
10060 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10061
10062 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10063 tree.
10064
10065 2009-10-30 Doug Kwan <dougkwan@google.com>
10066
10067 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10068
10069 2009-10-30 Doug Kwan <dougkwan@google.com>
10070
10071 * arm.cc (Stub_addend_reader): New struct template definition
10072 and partial specializations.
10073 (Stub_addend_reader::operator()): New method definition for a
10074 partially specialized template.
10075
10076 2009-10-30 Doug Kwan <dougkwan@google.com>
10077
10078 * arm.cc (Arm_relobj::processor_specific_flags): New method
10079 definition.
10080 (Arm_relobj::do_read_symbols): New method declaration.
10081 (Arm_relobj::processor_specific_flags_): New data member declaration.
10082 (Arm_dynobj): New class definition.
10083 (Target_arm::do_finalize_sections): Add input_objects parameter.
10084 (Target_arm::do_adjust_elf_header): New method declaration.
10085 (Target_arm::are_eabi_versions_compatible,
10086 (Target_arm::merge_processor_specific_flags): New method declaration.
10087 (Target_arm::do_make_elf_object): New overloaded method definitions
10088 and declaration.
10089 (Arm_relobj::do_read_symbols): New method definition.
10090 (Arm_dynobj::do_read_symbols): Ditto.
10091 (Target_arm::do_finalize_sections): Add input_objects parameters.
10092 Merge processor-specific flags from all input objects.
10093 (Target_arm::are_eabi_versions_compatible,
10094 Target_arm::merge_processor_specific_flags,
10095 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10096 New method definitions.
10097 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10098 Input_objects pointer type parameter.
10099 * layout.cc (Layout::finalize): Pass input objects to target's.
10100 finalize_sections function.
10101 * output.cc (Output_file_header::do_sized_write): Set ELF file
10102 header's processor-specific flags.
10103 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10104 Input_objects pointer type parameter.
10105 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10106 * target.h (Input_objects): New forward class declaration.
10107 (Target::processor_specific_flags,
10108 Target::are_processor_specific_flags_sect): New method definitions.
10109 (Target::finalize_sections): Add input_objects parameter.
10110 (Target::Target): Initialize processor_specific_flags_ and
10111 are_processor_specific_flags_set_.
10112 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10113 parameter.
10114 (Target::set_processor_specific_flags): New method definition.
10115 (Target::processor_specific_flags_,
10116 Target::are_processor_specific_flags_set_): New data member
10117 declarations.
10118 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10119 Input_objects pointer type parameter.
10120
10121 2009-10-30 Doug Kwan <dougkwan@google.com>
10122
10123 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10124
10125 2009-10-28 Ian Lance Taylor <iant@google.com>
10126
10127 * object.h (class Relobj): Drop options parameter from
10128 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10129 do_scan_relocs, do_relocate. Change all callers.
10130 (class Sized_relobj): Drop options parameters from
10131 do_gc_process_relocs, do_scan_relocs, do_relocate,
10132 do_relocate_sections, relocate_sections, emit_relocs_scan,
10133 emit_relocs_scan_reltype. Change all callers.
10134 (struct Relocate_info): Remove options field and all references to
10135 it.
10136 * reloc.h (class Read_relocs): Remove options constructor
10137 parameter and options_ field. Change all callers.
10138 (class Gc_process_relocs, class Scan_relocs): Likewise.
10139 (class Relocate_task): Likewise.
10140 * target-reloc.h (scan_relocs): Remove options parameter. Change
10141 all callers.
10142 (scan_relocatable_relocs): Likewise.
10143 * target.h (class Sized_target): Remove options parameter from
10144 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10145 all callers.
10146 * gc.h (gc_process_relocs): Remove options parameter. Change all
10147 callers.
10148 * arm.cc: Update functions to remove options parameters.
10149 * i386.cc: Likewise.
10150 * powerpc.cc: Likewise.
10151 * sparc.cc: Likewise.
10152 * x86_64.cc: Likewise.
10153 * testsuite/testfile.cc: Likewise.
10154
10155 2009-10-28 Doug Kwan <dougkwan@google.com>
10156
10157 * arm.cc (Arm_relobj): New class definition.
10158 (Arm_relobj::scan_sections_for_stubs,
10159 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10160 New method definitions.
10161
10162 2009-10-28 Cary Coutant <ccoutant@google.com>
10163
10164 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10165 (Plugin::cleanup_done_): New member.
10166 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10167 (Plugin_manager::cleanup_done_): Remove.
10168 (Plugin_manager::add_input_file): Edit error message.
10169 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10170 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10171
10172 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10173
10174 * fileread.cc: (File_read::View::~View): Use the new
10175 data_ownership_ filed.
10176 (File_read::~File_read): Dispose the new whole_file_view_.
10177 (File_read::open): Mmap the whole file if needed.
10178 (File_read::open): Use whole_file_view_ instead of contents_.
10179 (File_read::find_view): Use whole_file_view_ if applicable.
10180 (File_read::do_read): Use whole_file_view_ instead of contents_.
10181 (File_read::make_view): Use whole_file_view_ instead of contents_,
10182 update File_read::View::View call.
10183 (File_read::find_or_make_view): Update File_read::View::View
10184 call.
10185 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10186 remove contents_
10187 (File_read::View::Data_ownership): New enum.
10188 (File_read::View::View): Replace bool mapped_ with Data_ownership
10189 argument.
10190 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10191 (File_read::View::data_ownership_): New field.
10192 (File_read::contents_): Remove (replaced by whole_file_view_).
10193 (File_read::whole_file_view_): New field.
10194 * options.h (class General_options): Add --keep-files-mapped.
10195
10196 2009-10-27 Cary Coutant <ccoutant@google.com>
10197
10198 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10199 * testsuite/Makefile.am (plugin_test_5): New test case.
10200 * testsuite/Makefile.in: Regenerate.
10201
10202 2009-10-25 Doug Kwan <dougkwan@google.com>
10203
10204 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10205 from private to protected to allow access by child class.
10206 (Sized_relobj::do_relocate_sections): New method declaration.
10207 (Sized_relobj::relocate_sections): Virtualize.
10208 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
10209 Sized_relobj::relocate_sections. Instantiate template explicitly
10210 for different target sizes and endianity.
10211
10212 2009-10-24 Doug Kwan <dougkwan@google.com>
10213
10214 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10215 (Arm_input_section::as_arm_input_section): New method.
10216 (Arm_output_section): New class definition.
10217 (Arm_output_section::create_stub_group,
10218 Arm_output_section::group_sections): New method definitions.
10219
10220 2009-10-22 Doug Kwan <dougkwan@google.com>
10221
10222 * arm.cc (Arm_input_section): New class definition.
10223 (Arm_input_section::init, Arm_input_section:do_write,
10224 Arm_input_section::set_final_data_size,
10225 Arm_input_section::do_reset_address_and_file_offset): New method
10226 definitions.
10227
10228 2009-10-21 Doug Kwan <dougkwan@google.com>
10229
10230 * arm.cc (Stub_table, Arm_input_section): New forward class
10231 declarations.
10232 (Stub_table): New class defintion.
10233 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10234 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10235 New method definition.
10236
10237 2009-10-21 Doug Kwan <dougkwan@google.com>
10238
10239 * arm.cc: Update copyright comments.
10240 (Target_arm): New forward class template declaration.
10241 (Arm_address): New type.
10242 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10243 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10244 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10245 constants.
10246 (Insn_template): Same.
10247 (DEF_STUBS): New macro.
10248 (Stub_type): New enum type.
10249 (Stub_template): New class definition.
10250 (Stub): Same.
10251 (Reloc_stub): Same.
10252 (Stub_factory): Same.
10253 (Target_arm::Target_arm): Initialize may_use_blx_ and
10254 should_force_pic_veneer_.
10255 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10256 Target_arm::should_force_pic_veneer,
10257 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10258 Target_arm::using_thumb_only, Target_arm:;default_target): New
10259 method defintions.
10260 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10261 New data member declarations.
10262 (Insn_template::size, Insn_template::alignment): New method defintions.
10263 (Stub_template::Stub_template): New method definition.
10264 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10265 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10266 (Stub_factory::Stub_factory): New method definition.
10267 * gold.h (string_hash): New template.
10268 * output.h (Input_section_specifier::hash_value): Use
10269 gold::string_hash.
10270 (Input_section_specifier::string_hash): Remove.
10271 * stringpool.cc (Stringpool_template::string_hash): Use
10272 gold::string_hash.
10273
10274 2009-10-20 Doug Kwan <dougkwan@google.com>
10275
10276 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10277 symbols of relaxed input sections.
10278 * output.h (Output_section::find_relaxed_input_section): Make
10279 method public.
10280
10281 2009-10-16 Doug Kwan <dougkwan@google.com>
10282
10283 * dynobj.cc (Versions::Versions): Initialize version_script_.
10284 Only insert base version symbol definition for a shared object
10285 if version script defines any version versions.
10286 (Versions::define_base_version): New method definition.
10287 (Versions::add_def): Check that base version is not needed.
10288 (Versions::add_need): Define base version lazily.
10289 * dynobj.h (Versions::define_base_version): New method declaration.
10290 (Versions::needs_base_version_): New data member declaration.
10291 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10292 (check_DATA): Add no_version_test.stdout.
10293 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10294 New make rules.
10295 * testsuite/Makefile.in: Regenerate.
10296 * testsuite/no_version_test.c: New file.
10297 * testsuite/no_version_test.sh: Ditto.
10298
10299 2009-10-16 Doug Kwan <dougkwan@google.com>
10300
10301 * expression.cc (class Segment_start_expression): New class definition.
10302 (Segment_start_expression::value): New method definition.
10303 (script_exp_function_segment_start): Return a new
10304 Segment_start_expression.
10305 * gold/script-c.h (script_saw_segment_start_expression): New function
10306 prototype.
10307 * script-sections.cc (Script_sections::Script_sections): Initialize
10308 SAW_SEGMENT_START_EXPRESSION_ to false.
10309 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10310 and -Tbbs options to specify section addresses if given in
10311 command line and no SEGMENT_START expression is seen in a script.
10312 * script-sections.h (Script_sections::saw_segment_start_expression,
10313 Script_sections::set_saw_segment_start_expression): New method
10314 definition.
10315 (Script_sections::saw_segment_start_expression_): New data member
10316 declaration.
10317 * script.cc (script_saw_segment_start_expression): New function.
10318 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10319 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10320 script_test_7.sh and script_test_8.sh.
10321 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10322 script_test_8.stdout.
10323 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10324 (script_test_6, script_test_6.stdout, script_test_7,
10325 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10326 * Makefile.in: Regenerate.
10327 * testsuite/script_test_6.sh: New file.
10328 * testsuite/script_test_6.t: Same.
10329 * testsuite/script_test_7.sh: Same.
10330 * testsuite/script_test_7.t: Same.
10331 * testsuite/script_test_8.sh: Same.
10332
10333 2009-10-16 Doug Kwan <dougkwan@google.com>
10334
10335 * output.cc (Output_segment::set_section_list_address): Cast
10336 expressions to unsigned long long type to avoid format warnings.
10337
10338 2009-10-15 Ian Lance Taylor <iant@google.com>
10339
10340 * script.cc (Script_options::add_symbol_assignment): Always add a
10341 dot assignment to script_sections_.
10342 * script-sections.cc (Script_sections::add_dot_assignment):
10343 Initialize if necessary.
10344
10345 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10346 program headers with no load segment if there is a linker script.
10347
10348 * layout.cc (Layout::set_segment_offsets): Align the file offset
10349 to the segment aligment for -N or -n with no load segment.
10350 * output.cc (Output_segment::add_output_section): Don't crash if
10351 the first section is a TLS section.
10352 (Output_segment::set_section_list_addresses): Print an error
10353 message if the address moves backward in a linker script.
10354 * script-sections.cc
10355 (Output_section_element_input::set_section_addresses): Don't
10356 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10357 (Orphan_output_section::set_section_addresses): Likewise.
10358
10359 2009-10-15 Doug Kwan <dougkwan@google.com>
10360
10361 * layout.cc (Layout::finish_dynamic_section): Generate tags
10362 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10363 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10364 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10365
10366 2009-10-14 Ian Lance Taylor <iant@google.com>
10367
10368 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10369 fields.
10370 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10371 data_shdr fields of relinfo.
10372 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10373 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10374 R_386_TLS_LDO_32, adjust based on section flags.
10375 (Target_i386::Relocate::fix_up_ldo): Remove.
10376
10377 2009-10-13 Ian Lance Taylor <iant@google.com>
10378
10379 Add support for -pie.
10380 * options.h (class General_options): Add -pie and
10381 --pic-executable.
10382 (General_options::output_is_position_independent): Test -pie.
10383 (General_options::output_is_executable): Return true if not shared
10384 and not relocatable.
10385 (General_options::output_is_pie): Remove.
10386 * options.cc (General_options::finalize): Reject incompatible uses
10387 of -pie.
10388 * gold.cc (queue_middle_tasks): A -pie link is not static.
10389 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10390 * symtab.cc (Symbol::final_value_is_known): Return false if
10391 output_is_position_independent.
10392 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10393 output_is_position_independent.
10394 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10395 output_is_position_independent.
10396 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10397 output_is_position_independent.
10398 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10399 two_file_pie_test.
10400 (basic_pie_test.o, basic_pie_test): New targets.
10401 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10402 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10403 (two_file_pie_test): New target.
10404 * testsuite/Makefile.in: Rebuild.
10405 * README: Remove note saying that -pie is not supported.
10406
10407 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10408
10409 * options.h (class General_options): Add -init and -fini.
10410 * layout.cc (Layout::finish_dynamic_section): Emit
10411 given init and fini functions.
10412
10413 2009-10-13 Sriraman Tallam <tmsriram@google.com>
10414
10415 * gc.h (gc_process_relocs): Check if icf is enabled using new
10416 function.
10417 * gold.cc (queue_initial_tasks): Likewise.
10418 (queue_middle_tasks): Likewise.
10419 * object.cc (do_layout): Likewise.
10420 * symtab.cc (is_section_folded): Likewise.
10421 * main.cc (main): Likewise.
10422 * reloc.cc (Read_relocs::run): Likewise.
10423 (Sized_relobj::do_scan_relocs): Likewise.
10424 * icf.cc (is_function_ctor_or_dtor): New function.
10425 (Icf::find_identical_sections): Check if function is ctor or dtor when
10426 safe icf is chosen.
10427 * options.h (General_options::icf): Change option to be an enum.
10428 (Icf_status): New enum.
10429 (icf_enabled): New method.
10430 (icf_safe_folding): New method.
10431 (set_icf_status): New method.
10432 (icf_status_): New variable.
10433 * (options.cc) (General_options::finalize): Set icf_status_.
10434 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10435 icf_test and icf_keep_unique_test to use the --icf enum flag.
10436 * testsuite/icf_safe_test.sh: New file.
10437 * testsuite/icf_safe_test.cc: New file.
10438
10439 2009-10-12 Sriraman Tallam <tmsriram@google.com>
10440
10441 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10442 includes to gc.h and icf.h.
10443 * arm.cc: Include gc.h.
10444 * gold.cc: Likewise.
10445 * i386.cc: Likewise.
10446 * powerpc.cc: Likewise.
10447 * sparc.cc: Likewise.
10448 * x86_64.cc: Likewise.
10449 * gc.h: Include icf.h.
10450
10451 2009-10-11 Ian Lance Taylor <iant@google.com>
10452
10453 * plugin.cc: Include "gold.h" before other header files.
10454
10455 2009-10-10 Chris Demetriou <cgd@google.com>
10456
10457 * options.h (Input_file_argument::Input_file_type): New enum.
10458 (Input_file_argument::is_lib_): Replace with...
10459 (Input_file_argument::type_): New member.
10460 (Input_file_argument::Input_file_argument): Take Input_file_type
10461 'type' rather than boolean 'is_lib' as second argument.
10462 (Input_file_argument::is_lib): Use type_.
10463 (Input_file_argument::is_searched_file): New function.
10464 (Input_file_argument::may_need_search): Handle is_searched_file.
10465 * options.cc (General_options::parse_library): Support -l:filename.
10466 (General_options::parse_just_symbols): Update for Input_file_argument
10467 changes.
10468 (Command_line::process): Likewise.
10469 * archive.cc (Archive::get_file_and_offset): Likewise.
10470 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10471 * script.cc (read_script_file, script_add_file): Likewise.
10472 * fileread.cc (Input_file::Input_file): Likewise.
10473 (Input_file::will_search_for): Handle is_searched_file.
10474 (Input_file::open): Likewise.
10475 * readsyms.cc (Read_symbols::get_name): Likewise.
10476 * testsuite/Makefile.am (searched_file_test): New test.
10477 * testsuite/Makefile.in: Regenerate.
10478 * testsuite/searched_file_test.cc: New file.
10479 * testsuite/searched_file_test_lib.cc: New file.
10480
10481 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10482 Ian Lance Taylor <iant@google.com>
10483
10484 * descriptor.cc: Include <cstdio> and "binary-io.h".
10485 (Descriptors::open): Open the files in binary mode always.
10486 * script.cc (Lex::get_token): Treat \r as whitespace.
10487
10488 2009-10-09 Ian Lance Taylor <iant@google.com>
10489
10490 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10491
10492 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10493 Ian Lance Taylor <iant@google.com>
10494
10495 * configure.ac: Check for readv function also.
10496 * fileread.cc (readv): Define if not HAVE_READV.
10497 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10498 does not exist.
10499 * config.in: Regenerate.
10500 * configure: Regenerate.
10501
10502 2009-10-09 Doug Kwan <dougkwan@google.com>
10503
10504 * layout.cc (Layout::make_output_section): Call target hook to make
10505 ordinary output section.
10506 (Layout::finalize): Adjust parameter list of call the
10507 Target::may_relax().
10508 * layout.h (class Layout::section_list): New method.
10509 * merge.h (Output_merge_base::entsize): Change visibility to public.
10510 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10511 New methods.
10512 (Output_merge_string::do_is_string): New method.
10513 * object.cc (Sized_relobj::do_setup): renamed from
10514 Sized_relobj::set_up.
10515 * object.h (Sized_relobj::adjust_shndx,
10516 Sized_relobj::initializ_input_to_output_maps,
10517 Sized_relobj::free_input_to_output_maps): Change visibilities to
10518 protected.
10519 (Sized_relobj::setup): Virtualize.
10520 (Sized_relobj::do_setup): New method declaration.
10521 (Sized_relobj::invalidate_section_offset,
10522 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10523 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10524 * options.cc (parse_int): New function.
10525 * options.h (parse_int): New declaration.
10526 (DEFINE_int): New macro.
10527 (stub_group_size): New option.
10528 * output.cc (Output_section::Output_section): Initialize memebers
10529 merge_section_map_, merge_section_by_properties_map_,
10530 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10531 (Output_section::add_input_section): Handled deferred code-fill
10532 generation and remove an old comment.
10533 (Output_section::add_relaxed_input_section): New method definition.
10534 (Output_section::add_merge_input_section): Use merge section by
10535 properties map to speed to search. Update merge section maps
10536 as appropriate.
10537 (Output_section::build_relaxation_map): New method definition.
10538 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10539 Same.
10540 (Output_section::relax_input_section): Renamed to
10541 Output_section::convert_input_sections_to_relaxed_sections and change
10542 interface to take a vector of pointers to relaxed sections.
10543 (Output_section::find_merge_section,
10544 Output_section::find_relaxed_input_section): New method definitions.
10545 (Output_section::is_input_address_mapped,
10546 Output_section::output_offset, Output_section::output_address):
10547 Use output section data maps to speed up searching.
10548 (Output_section::find_starting_output_address): Add comments.
10549 (Output_section::do_write,
10550 Output_section::write_to_postprocessing_buffer): Do code-fill
10551 generation as appropriate.
10552 (Output_section::get_input_sections): Invalidate relaxed input section
10553 map.
10554 (Output_section::restore_states): Adjust type of checkpoint .
10555 Invalidate relaxed input section map.
10556 * output.h (Output_merge_base): New class declaration.
10557 (Input_section_specifier): New class defintion.
10558 (class Output_relaxed_input_section) Change base class to
10559 Output_section_data_build.
10560 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10561 base class initializer.
10562 (Output_section::add_relaxed_input_section): New method declaration.
10563 (Output_section::Input_section): Change visibility to protected.
10564 (Output_section::Input_section::relobj,
10565 Output_section::Input_section::shndx): Handle relaxed input sections.
10566 Output_section::input_sections) Change visibility to protected. Also
10567 define overload to return a non-const pointer.
10568 (Output_section::Merge_section_properties): New class defintion.
10569 (Output_section::Merge_section_by_properties_map,
10570 Output_section::Output_section_data_by_input_section_map,
10571 Output_section::Relaxation_map): New types.
10572 (Output_section::relax_input_section): Rename method to
10573 Output_section::convert_input_sections_to_relaxed_sections and change
10574 interface to take a vector of relaxed section pointers.
10575 (Output_section::find_merge_section,
10576 Output_section::find_relaxed_input_section,
10577 Output_section::build_relaxation_map,
10578 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10579 New method declarations.
10580 (Output_section::merge_section_map_
10581 Output_section::merge_section_by_properties_map_,
10582 Output_section::relaxed_input_section_map_,
10583 Output_section::is_relaxed_input_section_map_valid_,
10584 Output_section::generate_code_fills_at_write_): New data members.
10585 * script-sections.cc
10586 (Output_section_element_input::set_section_addresses): Call
10587 current_data_size and addralign methods of relaxed input sections.
10588 (Orphan_output_section::set_section_addresses): Call current_data_size
10589 and addralign methods of relaxed input sections.
10590 * symtab.cc (Symbol_table::compute_final_value): Extract template
10591 from the body of Symbol_table::sized_finalize_symbol.
10592 (Symbol_table::sized_finalized_symbol): Call
10593 Symbol_table::compute_final_value.
10594 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10595 (Symbol_table::compute_final_value): New templated method declaration.
10596 * target.cc (Target::do_make_output_section): New method defintion.
10597 * target.h (Target::make_output_section): New method declaration.
10598 (Target::relax): Add more parameters for input objects, symbol table
10599 and layout. Adjust call to do_relax.
10600 (Target::do_make_output_section): New method declaration.
10601 (Target::do_relax): Add parameters for input objects, symbol table
10602 and layout.
10603
10604 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10605
10606 * pread.c: Include stdio.h.
10607
10608 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10609
10610 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10611 defined.
10612
10613 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10614
10615 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10616 Change read_shndx type to unsigned int.
10617 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10618 int.
10619 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10620 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10621 Change read_shndx type to unsigned int.
10622 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10623 int.
10624 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10625 * layout.cc (Layout::create_symtab_sections): Cast the result of
10626 local_symcount * symsize to off_t in the gold_assert.
10627
10628 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10629
10630 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10631 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10632 R_ARM_BASE_ABS.
10633 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10634 (Arm_relocate_functions::thm_abs5): New function.
10635 (Arm_relocate_functions::abs12): New function.
10636 (Arm_relocate_functions::abs16): New function.
10637 (Arm_relocate_functions::base_abs): New function.
10638 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10639 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10640 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10641 R_ARM_BASE_ABS.
10642 (Scan::global): Likewise.
10643 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10644 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10645 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10646 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10647 R_ARM_BASE_ABS.
10648
10649 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10650
10651 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10652 (Arm_relocate_functions::movt_prel): New function.
10653 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10654 (Arm_relocate_functions::thm_movt_prel): New function.
10655 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10656 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10657 (Scan::global, Relocate::relocate): Likewise.
10658 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10659
10660 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10661
10662 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10663 Incremental_checker.
10664 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10665 unsigned int.
10666 (class Incremental_inputs_header): New class.
10667 (Incremental_inputs_header_writer): Edit comment.
10668 (Incremental_inputs_entry): New class.
10669 (Incremental_inputs_entry_writer): Edit comment.
10670 (Sized_incremental_binary::do_find_incremental_inputs_section):
10671 Add *strtab_shndx parameter, fill it.
10672 (Sized_incremental_binary::do_check_inputs): New method.
10673 (Incremental_checker::can_incrementally_link_output_file): Use
10674 Sized_incremental_binary::check_inputs.
10675 (Incremental_inputs::report_command_line): Save command line in
10676 command_line_.
10677 * incremental.h:
10678 (Incremental_binary::find_incremental_inputs_section): New
10679 method.
10680 (Incremental_binary::do_find_incremental_inputs_section): Add
10681 strtab_shndx parameter.
10682 (Incremental_binary::do_check_inputs): New pure virtual method.
10683 (Sized_incremental_binary::do_check_inputs): Declare.
10684 (Incremental_checker::Incremental_checker): Add incremental_inputs
10685 parameter, use it to initialize incremental_inputs_.
10686 (Incremental_checker::incremental_inputs_): New field.
10687 (Incremental_checker::command_line): New method.
10688 (Incremental_checker::inputs): New method.
10689 (Incremental_checker::command_line_): New field.
10690
10691 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10692
10693 * incremental.cc: Include <cstdarg> and "target-select.h".
10694 (vexplain_no_incremental): New function.
10695 (explain_no_incremental): New function.
10696 (Incremental_binary::error): New method.
10697 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10698 method.
10699 (make_sized_incremental_binary): New function.
10700 (open_incremental_binary): New function.
10701 (can_incrementally_link_file): Add checks if output is ELF and has
10702 inputs section.
10703 * incremental.h: Include "elfcpp_file.h" and "output.h".
10704 (Incremental_binary): New class.
10705 (Sized_incremental_binary): New class.
10706 (open_incremental_binary): Declare.
10707 * object.cc (is_elf_object): Use
10708 elfcpp::Elf_recognizer::is_elf_file.
10709 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10710 * output.h (Output_file::filesize): New method.
10711
10712 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10713
10714 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10715 New function.
10716 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10717 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10718 function.
10719 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10720 function.
10721 (Arm_relocate_functions::movw_abs_nc): New function.
10722 (Arm_relocate_functions::movt_abs): New function.
10723 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10724 (Arm_relocate_functions::thm_movt_abs): New function.
10725 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10726 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10727 (Scan::global): Likewise.
10728 (Relocate::relocate): Likewise.
10729 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10730
10731 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10732
10733 * arm.cc (Arm_relocate_functions::got_prel) New function.
10734 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10735 (Relocate::relocate): Likewise.
10736 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10737
10738 2009-10-06 Ian Lance Taylor <iant@google.com>
10739
10740 * options.h (class General_options): Define
10741 split_stack_adjust_size parameter.
10742 * object.h (class Object): Add uses_split_stack_ and
10743 has_no_split_stack_ fields. Add uses_split_stack and
10744 has_no_split_stack accessor functions. Declare
10745 handle_split_stack_section.
10746 (class Reloc_symbol_changes): Define.
10747 (class Sized_relobj): Define Function_offsets. Declare
10748 split_stack_adjust, split_stack_adjust_reltype, and
10749 find_functions.
10750 * object.cc (Object::handle_split_stack_section): New function.
10751 (Sized_relobj::do_layout): Call handle_split_stack_section.
10752 * dynobj.cc (Sized_dynobj::do_layout): Call
10753 handle_split_stack_section.
10754 * reloc.cc (Sized_relobj::relocate_sections): Call
10755 split_stack_adjust for executable sections in split_stack
10756 objects. Pass reloc_map to relocate_section.
10757 (Sized_relobj::split_stack_adjust): New function.
10758 (Sized_relobj::split_stack_adjust_reltype): New function.
10759 (Sized_relobj::find_functions): New function.
10760 * target-reloc.h: Include "object.h".
10761 (relocate_section): Add reloc_symbol_changes parameter. Change
10762 all callers.
10763 * target.h (class Target): Add calls_non_split method. Declare
10764 do_calls_non_split virtual method. Declare match_view and
10765 set_view_to_nop.
10766 * target.cc: Include "elfcpp.h".
10767 (Target::do_calls_non_split): New function.
10768 (Target::match_view): New function.
10769 (Target::set_view_to_nop): New function.
10770 * gold.cc (queue_middle_tasks): Give an error if mixing
10771 split-stack and non-split-stack objects with -r.
10772 * i386.cc (Target_i386::relocate_section): Add
10773 reloc_symbol_changes parameter.
10774 (Target_i386::do_calls_non_split): New function.
10775 * x86_64.cc (Target_x86_64::relocate_section): Add
10776 reloc_symbol_changes parameter.
10777 (Target_x86_64::do_calls_non_split): New function.
10778 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10779 parameter.
10780 * powerpc.cc (Target_powerpc::relocate_section): Add
10781 reloc_symbol_changes parameter.
10782 * sparc.cc (Target_sparc::relocate_section): Add
10783 reloc_symbol_changes parameter.
10784 * configure.ac: Call AM_CONDITIONAL for the default target.
10785 * configure: Rebuild.
10786 * testsuite/Makefile.am (TEST_AS): New variable.
10787 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10788 (check_DATA): Add split_i386 and split_x86_64 files.
10789 (SPLIT_DEFSYMS): Define.
10790 (split_i386_[1234n].o): New targets.
10791 (split_i386_[124]): New targets.
10792 (split_i386_[1234r].stdout): New targets.
10793 (split_x86_64_[1234n].o): New targets.
10794 (split_x86_64_[124]): New targets.
10795 (split_x86_64_[1234r].stdout): New targets.
10796 (MOSTLYCLEANFILES): Add new executables.
10797 * testsuite/split_i386.sh: New file.
10798 * testsuite/split_x86_64.sh: New file.
10799 * testsuite/split_i386_1.s: New file.
10800 * testsuite/split_i386_2.s: New file.
10801 * testsuite/split_i386_3.s: New file.
10802 * testsuite/split_i386_4.s: New file.
10803 * testsuite/split_i386_n.s: New file.
10804 * testsuite/split_x86_64_1.s: New file.
10805 * testsuite/split_x86_64_2.s: New file.
10806 * testsuite/split_x86_64_3.s: New file.
10807 * testsuite/split_x86_64_4.s: New file.
10808 * testsuite/split_x86_64_n.s: New file.
10809 * testsuite/testfile.cc (Target_test): Update relocation_section
10810 function.
10811 * testsuite/Makefile.in: Rebuild.
10812
10813 2009-10-06 Ian Lance Taylor <iant@google.com>
10814
10815 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10816 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10817 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10818 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10819 the address on ldo_addrs_.
10820 (Target_i386::Relocate::fix_up_ldo): New function.
10821
10822 2009-10-06 Rafael Espindola <espindola@google.com>
10823
10824 * plugin.cc (add_input_library): New.
10825 (Plugin::load): Add add_input_library to tv.
10826 (Plugin_manager::add_input_file): Add the is_lib argument.
10827 (add_input_file): Update call to Plugin_manager::add_input_file.
10828 (add_input_library): New.
10829 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10830
10831 2009-09-30 Doug Kwan <dougkwan@google.com>
10832
10833 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10834 symbol and call Symbol::may_need_copy_reloc to determine if
10835 a copy reloc is needed.
10836 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10837 nocopyreloc is given in command line.
10838 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10839 given in command line.
10840 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10841 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10842 of the removed Target_i386::may_need_copy_reloc.
10843 * options.h (copyreloc): New option with default value false.
10844 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10845 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10846 instead of the removed Target_powerpc::may_need_copy_reloc.
10847 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10848 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10849 instead of the removed Target_sparc::may_need_copy_reloc.
10850 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10851 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10852 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10853 instead of the removed Target_x86_64::may_need_copy_reloc.
10854
10855 2009-09-30 Ian Lance Taylor <iant@google.com>
10856
10857 * object.h (class Object): Remove target_ field, and target,
10858 sized_target, and set_target methods.
10859 (Object::sized_target): Remove.
10860 (class Sized_relobj): Update declarations. Remove sized_target.
10861 * object.cc (Sized_relobj::setup): Remove target parameter.
10862 Change all callers.
10863 (Input_objects::add_object): Don't do anything with the target.
10864 (make_elf_sized_object): Add punconfigured parameter. Change all
10865 callers. Set or test parameter target.
10866 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10867 Change all callers.
10868 * parameters.cc (Parameters::set_target): Change parameter type to
10869 be non-const.
10870 (Parameters::default_target): Remove.
10871 (set_parameters_target): Change parameter type to be non-const.
10872 (parameters_force_valid_target): New function.
10873 (parameters_clear_target): New function.
10874 * parameters.h (class Parameters): Update declarations. Remove
10875 default_target method. Add sized_target and clear_target
10876 methods. Change target_ to be non-const.
10877 (set_parameters_target): Update declaration.
10878 (parameters_force_valid_target): Declare.
10879 (parameters_clear_target): Declare.
10880 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10881 as NULL if we aren't searching.
10882 (Add_symbols::run): Don't check for compatible target.
10883 * fileread.cc (Input_file::open_binary): Call
10884 parameters_force_valid_target.
10885 * gold.cc (queue_middle_tasks): Likewise.
10886 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10887 set_target on object.
10888 * dynobj.h (class Sized_dynobj): Update declarations.
10889 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10890 make_elf_object returns NULL.
10891 (Archive::include_member): Don't check whether object target is
10892 compatible.
10893 * output.cc (Output_section::add_input_section): Get target from
10894 parameters.
10895 (Output_section::relax_input_section): Likewise.
10896 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10897 parameters.
10898 (Sized_relobj::do_scan_relocs): Likewise.
10899 (Sized_relobj::relocate_sections): Likewise.
10900 * resolve.cc (Symbol_table::resolve): Likewise.
10901 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10902 parameter. Change all callers.
10903 (Symbol_table::add_from_object): Get target from parameters.
10904 (Symbol_table::add_from_relobj): Don't check object target.
10905 (Symbol_table::add_from_dynobj): Likewise.
10906 (Symbol_table::define_special_symbol): Get target from
10907 parameters.
10908 * symtab.h (class Symbol_table): Update declaration.
10909 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10910 parameter. Change all callers. Clear parameter target.
10911 (Binary_test): Test target here.
10912 * testsuite/object_unittest.cc (gold_testsuite): Remove
10913 target_test_pointer parameter. Change all callers.
10914 (Object_test): Test target here.
10915
10916 2009-09-26 Ian Lance Taylor <iant@google.com>
10917
10918 * testsuite/initpri1.c: Don't try to use constructor priorities if
10919 compiling with gcc before 4.3.
10920
10921 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10922
10923 * testsuite/retain_symbols_file_test.sh (check_present): Change
10924 output file name to retain_symbols_file_test.stdout.
10925 (check_absent): Likewise.
10926
10927 2009-09-18 Craig Silverstein <csilvers@google.com>
10928
10929 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10930 * options.cc: Include <cerrno> and <fstream>.
10931 (General_options::finalize): Parse -retain-symbols-file tag.
10932 * options.h: New flag.
10933 (General_options): New method should_retain_symbol, new
10934 variable symbols_to_retain.
10935 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10936 should_retain_symbol map.
10937 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10938 * testsuite/Makefile.in: Regenerate.
10939 * testsuite/retain_symbols_file_test.sh: New file.
10940
10941 2009-09-18 Nick Clifton <nickc@redhat.com>
10942
10943 * po/es.po: Updated Spanish translation.
10944
10945 2009-09-17 Doug Kwan <dougkwan@google.com>
10946
10947 * debug.h (DEBUG_RELAXATION): New constant.
10948 (DEBUG_ALL): Add DEBUG_RELAXATION.
10949 (debug_string_to_enum): Add relaxation debug option.
10950 * layout.cc
10951 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10952 Layout::Relaxation_debug_check::read_sections,
10953 Layout::Relaxation_debug_check::read_sections): New method definitions.
10954 (Layout::Layout): Initialize data members
10955 record_output_section_data_from_scrips_,
10956 script_output_section_data_list_ and relaxation_debug_check_.
10957 (Layout::save_segments, Layout::restore_segments,
10958 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10959 Layout::relaxation_loop_body): New method definitions.
10960 (Layout::finalize): Support relaxation. Move section layout code to
10961 Layout::relaxation_loop_body.
10962 (Layout::set_asection_address_from_script): Move code for orphan
10963 section placement out.
10964 (Layout::place_orphan_sections_in_script): New method definition.
10965 * layout.h (Output_segment_headers, Output_file_header):
10966 New forward class declarations.
10967 (Layout::~Layout): Define.
10968 (Layout::new_output_section_data_from_script): New method definition.
10969 (Layout::place_orphan_sections_in_script): New method declaration.
10970 (Layout::Segment_states): New type declaration.
10971 (Layout::save_segments, Layout::restore_segments,
10972 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10973 Layout::relaxation_loop_body): New method declarations.
10974 (Layout::Output_section_data_list): New type declaration.
10975 (Layout::Relaxation_debug_check): New class definition.
10976 (Layout::record_output_section_data_from_script_,
10977 Layout::script_output_section_data_list_, Layout::segment_states_,
10978 Layout::relaxation_debug_check_): New data members.
10979 * output.cc: (Output_section_headers::do_size): New method definition.
10980 (Output_section_headers::Output_section_headers): Move size
10981 computation to Output_section_headers::do_size.
10982 (Output_segment_headers::do_size): New method definition.
10983 (Output_file_header::Output_file_header): Move size computation to
10984 Output_file_header::do_size and call it.
10985 (Output_file_header::do_size): New method definition.
10986 (Output_data_group::Output_data_group): Adjust call to
10987 Output_section_data.
10988 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10989 (Output_symtab_xindex::do_write): Add array bound check.
10990 (Output_section::Input_section::print_to_mapfile): Handle
10991 RELAXED_INPUT_SECTION_CODE.
10992 (Output_section::Output_section): Initialize data member checkpoint_.
10993 (Output_section::~Output_section): Delete checkpoint object pointed
10994 by checkpoint_.
10995 (Output_section::add_input_section): Always add an Input_section if
10996 relaxing.
10997 (Output_section::add_merge_input_section): Add assert.
10998 (Output_section::relax_input_section): New method definition.
10999 (Output_section::set_final_data_size): Set load address to zero for
11000 an unallocated section.
11001 (Output_section::do_address_and_file_offset_have_reset_values):
11002 New method definition.
11003 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11004 Handle relaxed input section.
11005 (Output_section::sort_attached_input_sections): Checkpoint input
11006 section list lazily.
11007 (Output_section::get_input_sections): Change type of input_sections to
11008 list of Simple_input_section pointers. Checkpoint input section list
11009 lazily. Also handle relaxed input sections.
11010 (Output_section::add_input_section_for_script): Take a reference to
11011 a Simple_input_section object instead of Relobj pointer and section
11012 index as parameter. Handle relaxed input sections.
11013 (Output_section::save_states, Output_section::restore_states): New
11014 method definitions.
11015 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11016 (Output_data::is_data_size_fixed): New method definition.
11017 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11018 if it is fixed.
11019 (Output_data::address_and_file_offset_have_reset_values): New method
11020 definition.
11021 (Output_data::do_address_and_file_offset_have_reset_values): New method
11022 definition.
11023 (Output_data::set_data_size): Check that data size is not fixed.
11024 (Output_data::fix_data_size): New method definition.
11025 (Output_data::is_data_size_fixed_): New data member.
11026 (Output_section_headers::set_final_data_size): New method definition.
11027 (Output_section_headers::do_size): New method declaration.
11028 (Output_segment_headers::set_final_data_size): New method definition.
11029 (Output_segment_headers::do_size): New method declaration.
11030 (Output_file_header::set_final_data_size)::New method definition.
11031 (Output_file_header::do_size)::New method declaration.
11032 (Output_section_data::Output_section_data): Add new parameter
11033 is_data_size_fixed and use it to fix data size.
11034 (Output_data_const::Output_data_const): Adjust call to base class
11035 constructor and fix data size.
11036 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11037 base class constructor and fix data size.
11038 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11039 base class constructor and fix data size.
11040 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11041 class constructor and fix data size.
11042 (Output_data_group::set_final_data_size): New method definition.
11043 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11044 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11045 class constructor and fix data size.
11046 (Output_relaxed_input_section): New class definition.
11047 (Output_section::Simple_input_section): New class definition.
11048 (Output_section::get_input_sections): Adjust parameter list.
11049 (Output_section::add_input_section_for_script): Same.
11050 (Output_section::save_states, Output_section::restore_states,
11051 Output_section::do_address_and_file_offset_have_reset_values,
11052 (Output_section::Input_section::Input_section): Handle
11053 RELAXED_INPUT_SECTION_CODE. Add new overload for
11054 Output_relaxed_input_section.
11055 (Output_section::Input_section::is_input_section,
11056 Output_section::Input_section::set_output_section): Handle relaxed
11057 input section.
11058 (Output_section::Input_section::is_relaxed_input_section,
11059 Output_section::Input_section::output_section_data,
11060 Output_section::Input_section::relaxed_input_section): New method
11061 definitions.
11062 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11063 value.
11064 (Output_section::Input_section::u1_): Update comments.
11065 (Output_section::Input_section::u2_): Add new union member poris.
11066 (Output_section::Checkpoint_output_section): New classs definition.
11067 (Output_section::relax_input_section): New method declaration.
11068 (Output_section::checkpoint_): New data member.
11069 (Output_segment): Update comments.
11070 (Output_segment::Output_segment): Un-privatize copy constructor.
11071 (Output_segment::operator=): Un-privatize.
11072 * script-sections.cc (Output_section_element::Input_section_list):
11073 Change element type to Output_section::Simple_input_section.
11074 (Output_section_element_dot_assignment::set_section_addresses):
11075 Register output section data for relaxation clean up.
11076 (Output_data_exression::Output_data_expression): Adjust call to base
11077 constructor to fix data size.
11078 (Output_section_element_data::set_section_addresses): Register
11079 Output_data_expression object for relaxation clean up.
11080 (struct Input_section_info): Replace Relobj pointer and section index
11081 pair with Output_section::Simple_input_section and Convert struct to a
11082 class.
11083 (Input_section_sorter::operator()): Adjust access to
11084 Input_section_info data member to use accessors.
11085 (Output_section_element_input::set_section_addresses): Use layout
11086 parameter. Adjust code to use Output_section::Simple_input_section
11087 and Input_secction_info classes. Register filler for relaxation
11088 clean up.
11089 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11090 and section index pair with Output_section::Simple_input_section
11091 class. Adjust code accordingly.
11092 (Phdrs_element::release_segment): New method definition.
11093 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11094 segment list.
11095 (Script_sections::release_segments): New method definition.
11096 * gold/script-sections.h (Script_sections::release_segments): New
11097 method declaration.
11098 * gold/target.h (Target::may_relax, Target::relax,
11099 Target::do_may_relax, Target::do_relax): New method definitions.
11100
11101 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11102
11103 * arm.cc (has_signed_unsigned_overflow): New function.
11104 (Arm_relocate_functions::abs8): New function.
11105 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11106 (Target_arm::Scan::global): Likewise.
11107 (Target_arm::relocate::relocate): Likewise.
11108 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11109 Likewise.
11110
11111 2009-09-16 Cary Coutant <ccoutant@google.com>
11112
11113 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11114 * testsuite/Makefile.in: Regenerate.
11115
11116 2009-09-11 Nick Clifton <nickc@redhat.com>
11117
11118 * po/gold.pot: Updated by the Translation project.
11119
11120 2009-09-08 Cary Coutant <ccoutant@google.com>
11121
11122 * output.cc (Output_file::open): Add execute permission to empty file.
11123 * testsuite/Makefile.am (permission_test): New test.
11124 * testsuite/Makefile.in: Regenerate.
11125
11126 2009-09-02 Ian Lance Taylor <iant@google.com>
11127
11128 * output.cc (Output_file::resize): Call map_no_anonymous rather
11129 than map.
11130
11131 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11132
11133 * gold.cc: Include "incremental.h".
11134 (queue_initial_tasks): Call Incremental_checker methods.
11135 * incremental.cc: Include "output.h".
11136 (Incremental_checker::can_incrementally_link_output_file): New
11137 method.
11138 * incremental.h (Incremental_checker): New class.
11139
11140 * output.cc (Output_file::open_for_modification): New method.
11141 (Output_file::map_anonymous): Changed return type to bool. Record
11142 map in base_ field.
11143 (Output_file::map_no_anonymous): New method, broken out of map.
11144 (Output_file::map): Use map_no_anonymous and map_anonymous.
11145 * output.h (class Output_file): Update declarations.
11146
11147 2009-08-24 Cary Coutant <ccoutant@google.com>
11148
11149 * options.h (Command_line::Pre_options): New class.
11150 (Command_line::pre_options): New member.
11151 * options.cc (gold::options::ready_to_register): New variable.
11152 (One_option::register_option): Do nothing if not registering options.
11153 Assert if same short option registered twice.
11154 (General_options::General_options): Turn off option registration when
11155 done constructing.
11156 (Command_line::Pre_options::Pre_options): New constructor.
11157
11158 2009-08-24 Cary Coutant <ccoutant@google.com>
11159
11160 * options.h (General_options::no_keep_memory): Remove incorrect
11161 short option.
11162
11163 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11164
11165 * Makefile.am (am__skiplex, am__skipyacc): New.
11166 * Makefile.in: Regenerate.
11167
11168 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11169
11170 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11171 (INCLUDES): ... this.
11172 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11173 (AM_CPPFLAGS): Renamed from ...
11174 (INCLUDE): ... this.
11175 * Makefile.in, testsuite/Makefile.in: Regenerate.
11176
11177 * Makefile.in: Regenerate.
11178 * aclocal.m4: Likewise.
11179 * config.in: Likewise.
11180 * configure: Likewise.
11181 * testsuite/Makefile.in: Likewise.
11182
11183 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11184 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11185 * Makefile.in: Regenerate.
11186 * testsuite/Makefile.in: Regenerate.
11187
11188 2009-08-19 Cary Coutant <ccoutant@google.com>
11189
11190 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11191 symbols in shared libraries overridden by hidden or internal symbols
11192 in the main program.
11193
11194 2009-08-19 Chris Demetriou <cgd@google.com>
11195
11196 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11197 checking source file names in error messages.
11198
11199 2009-08-18 Doug Kwan <dougkwan@google.com>
11200
11201 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11202 an elcpp::Ehdr as parameter. Adjust call to set_target.
11203 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11204 an elfcpp::Ehdr as parameter.
11205 * object.cc (Object::set_target): Remove the version that looks up
11206 a target and sets it.
11207 (Sized_relobj::setup): Take a Target object instead of
11208 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11209 (make_elf_sized_object): Find target and ask target to
11210 make an ELF object.
11211 * object.h: (Object::set_target): Remove the version that looks up
11212 a target and sets it.
11213 (Sized_relobj::setup): Take a Target object instead of
11214 an elfcpp:Ehdr as parameter.
11215 * target.cc: Include dynobj.h.
11216 (Target::do_make_elf_object_implementation): New.
11217 (Target::do_make_elf_object): New.
11218 * target.h (Target::make_elf_object): New template declaration.
11219 (Target::do_make_elf_object): New method declarations.
11220 (Target::do_make_elf_object_implementation): New template declaration.
11221
11222 2009-08-14 Ian Lance Taylor <iant@google.com>
11223
11224 * gold.h (FUNCTION_NAME): Define.
11225 (gold_unreachable): Use FUNCTION_NAME.
11226
11227 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11228
11229 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11230 symbol in the --keep-unique list is not found.
11231
11232 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11233
11234 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11235 been maked as --keep-unique.
11236 (Icf::unfold_section): New function.
11237 * icf.h (Icf::unfold_section): New function.
11238 * options.h (General_options::keep_unique): New option.
11239 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11240 * testsuite/Makefile.in: Regenerate.
11241 * testsuite/icf_keep_unique_test.sh: New file.
11242 * testsuite/icf_keep_unique_test.cc: New file.
11243
11244 2009-08-12 Cary Coutant <ccoutant@google.com>
11245
11246 PR 10471
11247 * resolve.cc (Symbol_table::resolve): Check for references from
11248 dynamic objects to hidden and internal symbols.
11249 * testsuite/Makefile.am (hidden_test.sh): New test.
11250 * testsuite/Makefile.in: Regenerate.
11251 * testsuite/hidden_test.sh: New script.
11252 * testsuite/hidden_test_1.c: New test source.
11253 * testsuite/hidden_test_main.c: New test source.
11254
11255 2009-08-11 Doug Kwan <dougkwan@google.com>
11256
11257 * arm.cc: Update comments.
11258 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11259 segment to locate the .ARM.exidx section if present.
11260
11261 2009-08-09 Doug Kwan <dougkwan@google.com>
11262
11263 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11264 patch.
11265
11266 2009-08-07 Sriraman Tallam <tmsriram@google.com>
11267 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11268 compiler warnings.
11269
11270 2009-08-06 Sriraman Tallam <tmsriram@google.com>
11271
11272 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11273 valid tls_segment only for non-debug-section relocations.
11274 * testsuite/Makefile.am: Add gc_tls_test.
11275 * testsuite/Makefile.in: Regenerate.
11276 * testsuite/gc_tls_test.cc: New file.
11277 * testsuite/gc_tls_test.sh: New file.
11278
11279 2009-08-05 Sriraman Tallam <tmsriram@google.com>
11280
11281 * icf.cc: New file.
11282 * icf.h: New file.
11283 * Makefile.am (CCFILES): Add icf.cc.
11284 (HFILES): Add icf.h
11285 * Makefile.in: Regenerate.
11286 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11287 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11288 section, symbol and addend information for the relocs.
11289 * gold.cc (queue_middle_tasks): Call identical code folding.
11290 * gold.h: Add defines for multimap.
11291 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11292 to the call of finalize_local_symbols.
11293 * main.cc (main): Create object of class Icf.
11294 * object.cc (Sized_relobj::do_layout): Allow this function to be
11295 called twice during icf.
11296 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11297 to sections marked as identical by icf.
11298 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11299 when available.
11300 (Sized_relobj::do_section_entsize): New function.
11301 * object.h (Object::section_entsize): New function.
11302 (Object::do_section_entsize): New pure virtual function.
11303 (Relobj::finalize_local_symbols): Add new parameter.
11304 (Relobj::do_section_entsize): New function.
11305 * options.h (General_options::icf): New option.
11306 (General_options::icf_iterations): New option.
11307 (General_options::print_icf_sections): New option.
11308 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11309 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11310 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11311 icf.
11312 * symtab.cc (Symbol_table::is_section_folded): New function.
11313 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11314 to sections marked as identical by icf.
11315 * symtab.h (Symbol_table::set_icf): New function.
11316 (Symbol_table::icf): New function.
11317 (Symbol_table::is_section_folded): New function.
11318 (Symbol_table::icf_): New data member.
11319 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11320 * testsuite/Makefile.am: Add commands to build icf_test.
11321 * testsuite/Makefile.in: Regenerate.
11322 * testsuite/icf_test.sh: New file.
11323 * testsuite/icf_test.cc: New file.
11324
11325 2009-07-24 Chris Demetriou <cgd@google.com>
11326
11327 * layout.cc (is_compressible_debug_section): Fix incorrect
11328 comment about compressed section names.
11329
11330 2009-07-20 Ian Lance Taylor <ian@airs.com>
11331
11332 PR 10419
11333 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11334
11335 2009-07-16 Ian Lance Taylor <iant@google.com>
11336
11337 PR 10400
11338 * layout.h: #include <map>.
11339 (class Kept_section): Change from struct to class. Add accessors
11340 and setters. Add section size to Comdat_group mapping. Change
11341 Comdat_group to std::map. Add is_comdat_ field. Add
11342 linkonce_size field in union.
11343 (class Layout): Update declaration of find_or_add_kept_section.
11344 Don't declare find_kept_object.
11345 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11346 parameter. Add object, shndx, is_comdat, and is_group_name
11347 parameters. Change all callers. Adjust for new Kept_section.
11348 (Layout::find_kept_object): Remove.
11349 * object.cc (Sized_relobj::include_section_group): Update use of
11350 Kept_section. Rename secnum to shndx. Only record
11351 Kept_comdat_section if sections are the same size.
11352 (Sized_relobj::include_linkonce_section): Update use of
11353 Kept_section. Only record Kept_comdat_section if sections are the
11354 same size. Set size of linkonce section.
11355 (Sized_relobj::map_to_kept_section): Update call to
11356 get_kept_comdat_section.
11357 * object.h (class Sized_relobj): Rename fields in
11358 Kept_comdat_section to drop trailing underscores; change object
11359 field to Relobj*. Change Kept_comdat_section_table to store
11360 struct rather than pointer.
11361 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11362 Add kept_object and kept_shndx parameters. Change all callers.
11363 (Sized_relobj::get_kept_comdat_section): Change return type to
11364 bool. Add kept_object and kept_shndx parameters. Change all
11365 callers.
11366 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11367 Layout::find_or_add_kept_section.
11368
11369 2009-07-09 Ian Lance Taylor <iant@google.com>
11370
11371 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11372 Reserve space in the hash table.
11373
11374 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11375
11376 * fileread.cc (File_read::get_mtime): New method.
11377 * fileread.h (Timespec): New structure.
11378 (File_read::get_mtime): New method.
11379 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11380 Renamed from timestamp_nsec.
11381 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11382 Elf_Xword.
11383 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
11384 timestamp_nsec.
11385 (Incremental_inputs::report_archive): Save mtime; style fix.
11386 (Incremental_inputs::report_obejct): Save mtime; style fix.
11387 (Incremental_inputs::report_script): Save mtime; style fix.
11388 (Incremental_inputs::finalize_inputs): Style fix.
11389 (Incremental_inputs::finalize): Style fix.
11390 (Incremental_inputs::create_input_section_data): Store inputs
11391 mtime.
11392 * incremental.h (Incremental_inputs::report_script): Add mtime
11393 argument.
11394 (Incremental_inputs::Input_info::Input_info): Intialize only one
11395 union member.
11396 (Incremental_inputs::Input_info::archive): Move to nameless
11397 union.
11398 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11399 (Incremental_inputs::Input_info::script): Move to nameless union.
11400 (Incremental_inputs::mtime): New field.
11401 * script.cc (read_input_script): Pass file mtime to
11402 Incremental_input.
11403 * script.h (Script_info::inputs): Style fix.
11404
11405 2009-07-01 Ian Lance Taylor <ian@airs.com>
11406
11407 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11408 instead of 32.
11409
11410 2009-06-24 Ian Lance Taylor <iant@google.com>
11411
11412 PR 10156
11413 * layout.cc (Layout::choose_output_section): If we find an
11414 existing section, update the flags.
11415 (Layout::create_notes): New function, broken out of
11416 Layout::finalize.
11417 (Layout::finalize): Don't create note sections.
11418 (Layout::create_note): Don't crash if linker script discards
11419 section.
11420 (Layout::create_gold_note): Likewise.
11421 (Layout::create_build_id): Likewise. Don't set
11422 after_input_sections on the section.
11423 (Layout::create_executable_stack_info): Remove target parameter.
11424 Change caller.
11425 * layout.h (class Layout): Declare create_notes. Update
11426 declaration of create_executable_stack_info.
11427 * gold.cc (queue_middle_tasks): Call create_notes.
11428 * output.cc (Output_section::update_flags_for_input_section): Move
11429 here from output.h. If SHF_ALLOC flag is newly set, mark address
11430 invalid.
11431 * output.h (Output_data::mark_address_invalid): New function.
11432 (class Output_section): Only declare, not define,
11433 update_flags_for_input_section. Remove set_flags.
11434
11435 2009-06-24 Ian Lance Taylor <iant@google.com>
11436
11437 * script-sections.cc (Output_section_definition::
11438 set_section_addresses): Rename shadowing local load_address to
11439 laddr.
11440
11441 2009-06-24 Ian Lance Taylor <iant@google.com>
11442
11443 PR 10244
11444 * reloc.cc (relocate_sections): Skip empty relocation sections.
11445
11446 2009-06-23 Ian Lance Taylor <iant@google.com>
11447
11448 PR 10156
11449 * layout.cc (Layout::create_note): Use choose_output_section
11450 rather than make_output_section.
11451
11452 2009-06-23 Ian Lance Taylor <iant@google.com>
11453
11454 PR 10237
11455 * options.cc (General_options::parse_V): Set printed_version_.
11456 (General_options::General_options): Initialize printed_version_.
11457 * options.h (class General_options): Add printed_version_ field.
11458 * gold.cc (queue_initial_tasks): If there are no input files,
11459 don't give a fatal error if we printed the version information.
11460 (queue_middle_tasks): If using -r with a shared object, give a
11461 fatal error rather than an ordinary error.
11462
11463 2009-06-23 Ian Lance Taylor <iant@google.com>
11464
11465 PR 10219
11466 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11467 (Layout::make_output_section): Set have_stabstr_section_ if we see
11468 a .stab*str section.
11469 (Layout::finalize): Call link_stabs_sections.
11470 (Layout::link_stabs_sections): New file.
11471 * layout.h (class Layout): Add have_stabstr_section_ field.
11472 Declare link_stabs_sections.
11473
11474 2009-06-23 Doug Kwan <dougkwan@google.com>
11475
11476 * Makefile.am (libgold_a_LIBADD): New.
11477 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
11478 * Makefile.in: Regenerate.
11479 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11480 * configure: Regenerate.
11481 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11482 * fileread.cc: Include sys/state.h
11483 * gold.h: Declare memmem and strndup if found missing.
11484 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11485
11486 2009-06-23 Ian Lance Taylor <iant@google.com>
11487
11488 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11489 * configure: Rebuild.
11490
11491 2009-06-23 Ian Lance Taylor <iant@google.com>
11492
11493 PR 10147
11494 * object.cc (Object::section_contents): Don't try to get a view if
11495 the section has length zero.
11496 (Object::handle_gnu_warning_section): If the section is empty, use
11497 the name of the section as the warning.
11498
11499 2009-06-23 Ian Lance Taylor <iant@google.com>
11500
11501 PR 10133
11502 * stringpool.h (class Stringpool_template): Add optimize_ field.
11503 (Stringpool_template::set_optimize): New function.
11504 * stringpool.cc (Stringpool_template::Stringpool_template):
11505 Initialize optimize_ field.
11506 (Stringpool_template::set_string_offsets): Test local optimize
11507 fild rather than parameter.
11508 * layout.cc (Layout::Layout): Call set_optimize on the section
11509 name stringpool.
11510
11511 2009-06-22 Ian Lance Taylor <iant@google.com>
11512
11513 PR 10030
11514 * yyscript.y: Parse TARGET.
11515 * script.cc (script_set_target): New function.
11516 * script-c.h (script_set_target): Declare.
11517 * options.cc (General_options::string_to_object_format): Rename
11518 from string_to_object_format in anonymous namespace. Change
11519 callers.
11520 * options.h (class General_options): Declare
11521 string_to_object_format.
11522
11523 2009-06-22 Ian Lance Taylor <iant@google.com>
11524
11525 * script-sections.cc (Script_sections::create_segments): Don't put
11526 program headers in a PT_LOAD segment if -n or -N.
11527
11528 2009-06-22 Ian Lance Taylor <iant@google.com>
11529
11530 PR 10141
11531 * options.h (class General_options): Add -z lazy and -z now. Sort
11532 -z options into alphabetical order.
11533 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11534
11535 2009-06-21 Ian Lance Taylor <iant@google.com>
11536
11537 * layout.cc (Layout::make_output_section): Call
11538 Target::new_output_section.
11539 (Layout::attach_allocated_section_to_segment): Put large section
11540 sections in a separate load segment with the large segment flag
11541 set.
11542 (Layout::segment_precedes): Sort large data segments after other
11543 load segments.
11544 (align_file_offset): New static function.
11545 (Layout::set_segment_offsets): Use align_file_offset.
11546 * output.h (class Output_section): Add is_small_section_ and
11547 is_large_section_ fields.
11548 (Output_section::is_small_section): New function.
11549 (Output_section::set_is_small_section): New function.
11550 (Output_section::is_large_section): New function.
11551 (Output_section::set_is_large_section): New function.
11552 (Output_section::is_large_data_section): New function.
11553 (class Output_segment): Add is_large_data_segment_ field.
11554 (Output_segment::is_large_data_segment): New function.
11555 (Output_segment::set_is_large_data_segment): New function.
11556 * output.cc (Output_section::Output_section): Initialize new
11557 fields.
11558 (Output_segment::Output_segment): Likewise.
11559 (Output_segment::add_output_section): Add assertion that large
11560 data sections always go in large data segments. Force small data
11561 sections to the end of the list of data sections. Force small BSS
11562 sections to the start of the list of BSS sections. For large BSS
11563 sections to the end of the list of BSS sections.
11564 * symtab.h (class Symbol): Declare is_common_shndx.
11565 (Symbol::is_defined): Check Symbol::is_common_shndx.
11566 (Symbol::is_common): Likewise.
11567 (class Symbol_table): Define enum Commons_section_type. Update
11568 declarations. Add small_commons_ and large_commons_ fields.
11569 * symtab.cc (Symbol::is_common_shndx): New function.
11570 (Symbol_table::Symbol_table): Initialize new fields.
11571 (Symbol_table::add_from_object): Put small and large common
11572 symbols in the right list.
11573 (Symbol_table::sized_finalized_symbol): Check
11574 Symbol::is_common_shndx.
11575 (Symbol_table::sized_write_globals): Likewise.
11576 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11577 common symbol lists. Don't call do_allocate_commons_list if the
11578 list is empty.
11579 (Symbol_table::do_allocate_commons_list): Remove is_tls
11580 parameter. Add comons_section_type parameter. Change all
11581 callers. Handle small and large common symbols.
11582 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11583 Symbol::is_common_shndx.
11584 * resolve.cc (symbol_to_bits): Likewise.
11585 * target.h (Target::small_common_shndx): New function.
11586 (Target::small_common_section_flags): New function.
11587 (Target::large_common_shndx): New function.
11588 (Target::large_common_section_flags): New function.
11589 (Target::new_output_section): New function.
11590 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11591 small_common_section_flags, and large_common_section_flags
11592 fields.
11593 (Target::do_new_output_section): New virtual function.
11594 * arm.cc (Target_arm::arm_info): Initialize new fields.
11595 * i386.cc (Target_i386::i386_info): Likewise.
11596 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11597 Likewise.
11598 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11599 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11600 (Target_x86_64::do_new_output_section): New function.
11601 * configure.ac: Define conditional MCMODEL_MEDIUM.
11602 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11603 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11604 (large_LDFLAGS): Define.
11605 * testsuite/large.c: New file.
11606 * testsuite/testfile.cc (Target_test::test_target_info):
11607 Initialize new fields.
11608 * configure, testsuite/Makefile.in: Rebuild.
11609
11610 2009-06-05 Doug Kwan <dougkwan@google.com>
11611
11612 * Makefile.am (CCFILES): Add target.cc.
11613 * Makefile.in: Regenerate.
11614 * i386.cc (class Target_i386): Define new virtual method to
11615 override do_is_local_label_name in parent.
11616 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11617 local symbols if --discard-locals or -X is given.
11618 * options.h (class General_options): Declare new options
11619 '--discard-locals' and '-X' for discarding locals.
11620 * target.h (class Target): Define new methods is_local_label_name.
11621 Declare new virtual method do_is_local_label_name.
11622 * target.cc: New file.
11623 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11624 (check_SCRIPTS): Add discard_locals_test.sh.
11625 (check_DATA): Add discard_local_tests.syms.
11626 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11627 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11628 * testsuite/Makefile.in: Regenerate.
11629 * testsuite/discard_locals_test.c: New file.
11630 * testsuite/discard_locals_test.sh: Same.
11631
11632 2009-06-05 Doug Kwan <dougkwan@google.com>
11633
11634 * object.cc (Sized_relobj::Sized_relobj): Initialize
11635 discarded_eh_frame_shndx_ to -1U.
11636 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11637 section.
11638 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11639 a discarded .eh_frame section.
11640 (Sized_relobj::do_finalize_local_symbols): Ditto.
11641 * object.h (class Sized_relobj): Declare new member
11642 discarded_eh_frame_shndx_.
11643 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11644 (local_labels_test.o, local_labels_test): New rules.
11645 * testsuite/Makefile.in: Regenerate.
11646
11647 2009-06-04 Doug Kwan <dougkwan@google.com>
11648
11649 * layout.cc (Layout::section_name_mapping): Add mapping for
11650 special ARM sections.
11651
11652 2009-06-03 Doug Kwan <dougkwan@google.com>
11653
11654 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11655 (utils::has_overflow): Same.
11656
11657 2009-06-03 Ian Lance Taylor <iant@google.com>
11658
11659 * layout.cc (Layout::section_name_mapping): New array, replacing
11660 Layout::linkonce_mapping.
11661 (Layout::section_name_mapping_count): New variable, replacing
11662 Layout::linkonce_mapping_count.
11663 (Layout::linkonce_output_name): Remove.
11664 (Layout::output_section_name): Rewrite.
11665 * layout.h (class Layout): Rename Linkonce_mapping to
11666 Section_name_mapping, linkonce_mapping to section_name_mapping,
11667 linkonce_mapping_count to section_name_mapping_count. Don't
11668 declare linkonce_output_name.
11669
11670 2009-06-03 Doug Kwan <dougkwan@google.com>
11671
11672 * gold/arm.cc (namespace utils): New.
11673 (Target_arm::reloc_is_non_pic): Define new method.
11674 (class Arm_relocate_functions): New.
11675 (Target_arm::Relocate::relocate): Handle relocation types used by
11676 Android.
11677
11678 2009-06-03 Ian Lance Taylor <iant@google.com>
11679
11680 * arm.cc (Target_arm::scan::global): Use || instead of |.
11681
11682 2009-06-02 Doug Kwan <dougkwan@google.com>
11683
11684 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11685 issued_non_pic_error_.
11686 (class Target_arm::Scan): Declare new method check_non_pic.
11687 Define new method symbol_needs_plt_entry.
11688 Declare new data member issued_non_pic_error_.
11689 (class Target_arm::Relocate): Declare new method
11690 should_apply_static_reloc.
11691 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11692 (Target_arm::Scan::check_non_pic): Define new method.
11693 (Target_arm::Scan::local): Handle a small subset of reloc types used
11694 by Android.
11695 (Target_arm::Scan::local): Same.
11696 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11697
11698 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11699
11700 * incremental.cc (Incremental_inputs::report_command_line): Filter
11701 out --incremental-* options.
11702
11703 2009-05-29 Doug Kwan <dougkwan@google.com>
11704
11705 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11706 template class.
11707 (class Target_arm): Update comment.
11708 (Target_arm::Target_arm): Initialize new data members GOT_,
11709 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11710 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11711 and Target_arm::rel_dyn_section.
11712 Declare new_enum Target_arm::Got_type.
11713 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11714 and DYNBSS_.
11715 Update commments for member do_dynsym_value.
11716 (Target_arm::got_size, Target_arm::plt_section,
11717 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11718 new methods inside class defintion.
11719 (Target_arm::got_section): Define new method.
11720 (Target_arm::rel_dyn_section): Same.
11721 (Output_data_plt_arm): New template class.
11722 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11723 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11724 (Output_data_plt_arm::add_entry): Same.
11725 (Output_data_plt_arm::first_plt_entry): Define new
11726 static data member for PLT instruction template.
11727 (Output_data_plt_arm::plt_entry): Same.
11728 (Output_data_plt_arm::do_write): Define new method.
11729 (Target_arm::make_plt_entry): Same.
11730 (Target_arm::do_finalize_sections): Same.
11731 (Target_arm::do_dynsym_value): Same.
11732
11733 2009-05-28 Doug Kwan <dougkwan@google.com>
11734
11735 * Makefile.am (TARGETSOURCES): Add arm.cc.
11736 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11737 * Makefile.in: Regenerate.
11738 * arm.cc: New file.
11739 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11740
11741 2009-05-26 Doug Kwan <dougkwan@google.com>
11742
11743 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11744 (General_options::check_excluded_libs): Strip off directories in
11745 archive name before matching like GNU ld does.
11746 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11747 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11748 (exclude_libs_test_LDFLAGS): Add linker option
11749 -Wl,--exclude-libs,libexclude_libs_test_3
11750 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11751 an explicit archive without using -l.
11752 (alt/libexclude_libs_test_3.a): New make rule.
11753 * testsuite/Makefile.in: Regenerate.
11754 * testsuite/exclude_libs_test.c : Declare lib3_default().
11755 (main): Call it.
11756 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11757 * exclude_libs_test_3.c: New file.
11758
11759 2009-05-26 Nick Clifton <nickc@redhat.com>
11760
11761 * po/id.po: New Indonesian translation.
11762 * po/gold.pot: Updated template file.
11763
11764 2009-05-22 Sriraman Tallam <tmsriram@google.com>
11765
11766 * testsuite/Makefile.am: Add -ffunction-sections to compile
11767 gc_comdat_test files. Add -Wl,--gc-sections to build
11768 gc_comdat_test.
11769 * testsuite/Makefile.in: Regenerate.
11770 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11771
11772 2009-05-21 Sriraman Tallam <tmsriram@google.com>
11773
11774 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11775 kept comdat section was garbage collected.
11776 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11777 * testsuite/Makefile.in: Regenerate.
11778 * testsuite/gc_comdat_test.sh: New file.
11779 * testsuite/gc_comdat_test_1.cc: New file.
11780 * testsuite/gc_comdat_test_2.cc: New file.
11781
11782 2009-05-19 Doug Kwan <dougkwan@google.com>
11783
11784 * archive.cc (Archive::Archive): Move constructor from archive.h
11785 to here. Initialize no_export_.
11786 (Archive::get_elf_object_for_member): Set no_export flag of object.
11787 * archive.h (Archive::Archive): Move constructor body to
11788 archive.cc.
11789 (Archive::no_export): New method.
11790 (Archive::no_export_): New field.
11791 * object.h (Object::Object): Initialize no_export_ to false.
11792 (Object::no_export, Object::set_no_export): New methods.
11793 (Object::no_export_): New field.
11794 * options.cc (General_options::parse_exclude_libs): New method.
11795 (General_options::check_excluded_libs) Same.
11796 * options.h (exclude_libs): New option.
11797 (General_options::check_excluded_libs): New method declaration.
11798 (General_options::excluded_libs_): New field.
11799 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11800 default or protected visibility if an object has no-export flag set.
11801 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11802 (check_SCRIPTS): Add exclude_libs_test.sh.
11803 (check_DATA): Add exclude_libs_test.syms.
11804 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11805 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11806 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11807 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11808 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11809 libexclude_libs_test_2.a): New rules.
11810 * testsuite/Makefile.in: Regenerate.
11811 * testsuite/exclude_libs_test.c: New file.
11812 * testsuite/exclude_libs_test.sh: Ditto.
11813 * testsuite/exclude_libs_test_1.c: Ditto.
11814 * testsuite/exclude_libs_test_2.c: Ditto.
11815
11816 2009-05-15 Ian Lance Taylor <iant@google.com>
11817
11818 * configure.ac: Check for declarations for cases where libiberty.h
11819 checks HAVE_DECL_xxx.
11820 * configure, config.in: Rebuild.
11821
11822 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11823
11824 * gold.h (Incremental_argument_list): Remove (invalid) forward
11825 declaration.
11826 * incremental.cc (Incremental_inputs::report_achive): New method.
11827 (Incremental_inputs::report_object): New method.
11828 (Incremental_inputs::report_script): New method.
11829 (Incremental_inputs::finalize_inputs): New method.
11830 (Incremental_inputs::finalize): Call finalize_inputs().
11831 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11832 Create inputs entries.
11833 * incremental.h (Incremental_input_type): New enum.
11834 (Incremental_inputs::Incremental_input): Initialize new fields.
11835 (Incremental_inputs::report_inputs): New method.
11836 (Incremental_inputs::report_achive): New method.
11837 (Incremental_inputs::report_object): New method.
11838 (Incremental_inputs::report_script): New method.
11839 (Incremental_inputs::finalize_inputs): New method.
11840 (Incremental_inputs::Input_info): New struct.
11841 (Incremental_inputs::Input_info_map): New typedef.
11842 (Incremental_inputs::lock_): New field.
11843 (Incremental_inputs::Inputs_): New field.
11844 (Incremental_inputs::Inputs_map): New field.
11845 * main.cc (main): Call Incremental_input::report_inputs.
11846 * options.h (Input_argument_list): Typedef moved from
11847 Input_arguments.
11848 (Input_file_group::Files): Remove, use ::Input_argument_list.
11849 (Input_file_group::Input_argument_list): Remove, use
11850 ::Input_argument_list.
11851 * plugin.cc (Plugin_manager::add_input_file): Add error in
11852 incremental build.
11853 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11854 functions.
11855 * script.cc (read_input_script): Call
11856 Incremental_input::report_script.
11857 * script.h (Script_info): New class.
11858
11859 2009-04-27 Ian Lance Taylor <iant@google.com>
11860
11861 * x86_64.cc (do_adjust_output_section): Set entsize to
11862 plt_entry_size.
11863
11864 2009-04-23 Elliott Hughes <enh@google.com>
11865
11866 * output.cc (Output_file::close): After short writes, continue
11867 writing from the correct offset in the buffer being written.
11868
11869 2009-04-23 Chris Demetriou <cgd@google.com>
11870
11871 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11872 * configure: Regenerate.
11873 * config.in: Regenerate.
11874 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11875 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11876
11877 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11878
11879 * incremental.cc (Incremental_inputs_header_data): Renamed from
11880 Incremental_input_header_data.
11881 (Incremental_inputs_header_data::data_size): New field.
11882 (Incremental_inputs_header_data::put_input_file_count): Renamed
11883 from input_file_count.
11884 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11885 from command_line_offset.
11886 (Incremental_inputs_header_data::put_reserved): Renamed from
11887 put_reserved.
11888 (Incremental_inputs_entry_data): Renamed from
11889 Incremental_input_entry_data.
11890 (Incremental_inputs_entry_data::data_size): New field.
11891 (Incremental_inputs::report_command_line): New method.
11892 (Incremental_inputs::finalize): New method.
11893 (Incremental_inputs::create_incremental_inputs_data): New method.
11894 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11895 * incremental.h: New file.
11896 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
11897 (Layout::finalize): Create incremental inputs section in
11898 incremental builds.
11899 (Layout::create_incremental_info_sections): New method.
11900 * layout.h (Layout::incremental_inputs): New method.
11901 (Layout::create_incremental_info_sections): New method.
11902 (Layout::incremental_inputs_): New field.
11903 * main.cc (main): Notify Incremental_input of the command line.
11904
11905 2009-04-01 Ian Lance Taylor <iant@google.com>
11906 Mikolaj Zalewski <mikolajz@google.com>
11907
11908 * gold.h (reserve_unordered_map): Define, three versions, one for
11909 each version of Unordered_map.
11910 * layout.cc (Layout::Layout): Remove options parameter. Add
11911 number_of_input_files parameter. Don't initialize options_.
11912 Initialize number_of_input_files_ and resized_signatures_. Move
11913 sections_are_attached_.
11914 (Layout::layout_group): Reserve space for group_signatures_.
11915 (Layout::find_or_add_kept_section): Change name parameter to be a
11916 reference. Resize signatures_ map when it gets large enough.
11917 (Layout::layout_eh_frame): Use parameters->options() instead of
11918 this->options_.
11919 (Layout::make_output_section): Likewise.
11920 (Layout::attach_allocated_section_to_segment): Likewise.
11921 (Layout::finalize, Layout::create_executable_stack): Likewise.
11922 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11923 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11924 * layout.h (class Layout): Update declarations. Remove options_
11925 field. Add number_of_input_files_ and resized_signatures_
11926 fields. Move sections_are_attached_ field.
11927 * main.cc (main): Pass number of input files to Layout
11928 constructor. Don't pass options.
11929
11930 2009-03-30 Ian Lance Taylor <iant@google.com>
11931
11932 * ffsll.c (ffsll): Correct implementation.
11933
11934 2009-03-27 Ian Lance Taylor <iant@google.com>
11935
11936 * ffsll.c: New file.
11937 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11938 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11939 * ftruncate.c (ftruncate): Declare before definition.
11940 * mremap.c (mremap): Likewise.
11941 * pread.c (pread): Likewise.
11942 * configure, Makefile.in, config.in: Rebuild.
11943
11944 * mremap.c: New file.
11945 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11946 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11947 (mremap): Declare if HAVE_MREMAP is not defined.
11948 * configure, Makefile.in, config.in: Rebuild.
11949
11950 2009-03-27 Cary Coutant <ccoutant@google.com>
11951
11952 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11953 position independent.
11954 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11955 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11956
11957 2009-03-24 Cary Coutant <ccoutant@google.com>
11958
11959 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11960 an executable.
11961 (needs_dynamic_reloc): Likewise.
11962
11963 2009-03-24 Ian Lance Taylor <iant@google.com>
11964
11965 * yyscript.y (file_cmd): Recognize EXTERN.
11966 (extern_name_list, extern_name_list_body): New nonterminals.
11967 * script.cc (script_add_extern): Define.
11968 * script-c.h (script_add_extern): Declare.
11969
11970 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
11971
11972 * object.cc (is_elf_object): Define.
11973 * object.h (is_elf_object): Declare.
11974 * archive.cc (Archive::get_elf_object_for_member): Call
11975 is_elf_object.
11976 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
11977
11978 2009-03-24 Elliott Hughes <enh@google.com>
11979
11980 * output.cc (Output_file::map_anonymous): Define.
11981 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11982 try an anonymous one. Report the size if the mmap fails.
11983 * output.h (class Output_file): Declare map_anonymous.
11984
11985 2009-03-24 Ian Lance Taylor <iant@google.com>
11986
11987 * target-select.cc (instantiate_target): Don't acquire the lock if
11988 the instantiated_target_ field has already been set.
11989
11990 2009-03-23 Ian Lance Taylor <iant@google.com>
11991
11992 * gold-threads.h (class Initialize_lock): Define.
11993 * gold-threads.cc (class Initialize_lock_once): Define.
11994 (initialize_lock_control): New static variable.
11995 (initialize_lock_pointer): New static variable.
11996 (initialize_lock_once): New static function.
11997 (Initialize_lock::Initialize_lock): Define.
11998 (Initialize_lock::initialize): Define.
11999 * target-select.h: Include "gold-threads.h".
12000 (class Target_selector): Add lock_ and initialize_lock_ fields.
12001 Don't define instantiate_target, just declare it.
12002 * target-select.cc (Target_selector::Target_selector): Initialize
12003 new fields.
12004 (Target_selector::instantiate_target): Define.
12005 * descriptors.h: Include "gold-threads.h".
12006 (class Descriptors): Add initialize_lock_ field.
12007 * descriptors.cc (Descriptors::Descriptors): Initialize new
12008 field.
12009 (Descriptors::open): Use initialize_lock_ field
12010 * errors.h (class Errors): Add initialize_lock_ field.
12011 * errors.cc (Errors::Errors): Initialize new field.
12012 (Errors::initialize_lock): Use initialize_lock_ field.
12013 * powerpc.cc (class Target_selector_powerpc): Remove
12014 instantiated_target_ field. In do_recognize call
12015 instantiate_target rather than do_instantiate_target. In
12016 do_instantiate_target just allocate a new target.
12017 * sparc.cc (class Target_selector_sparc): Likewise.
12018
12019 * freebsd.h: New file.
12020 * i386.cc: Include "freebsd.h".
12021 (Target_i386): Derive from Target_freebsd rather than
12022 Sized_target.
12023 (Target_selector_i386): Derive from Target_selector_freebsd rather
12024 than Target_selector.
12025 * x86_64.cc: Include "freebsd.h".
12026 (Target_x86_64): Derive from Target_freebsd rather than
12027 Sized_target.
12028 (Target_selector_x86_64): Derive from Target_selector_freebsd
12029 rather than Target_selector.
12030 * target.h (class Target): Add adjust_elf_header and
12031 do_adjust_elf_header.
12032 * output.cc (Output_file_header:: do_sized_write): Call target
12033 adjust_elf_header routine.
12034 * configure.tgt: Set targ_osabi.
12035 * configure.ac: Define GOLD_DEFAULT_OSABI.
12036 * parameters.cc (Parameters::default_target): Pass
12037 GOLD_DEFAULT_OSABI to select_target.
12038 * target-select.h (class Target_selector): Make instantiate_target
12039 protected rather than private.
12040 * Makefile.am (HFILES): Add freebsd.h.
12041 * configure, Makefile.in, config.in: Rebuild.
12042
12043 * merge.cc (do_add_input_section): Correct pend value. Change
12044 message about last entry not being null terminated from error to
12045 warning.
12046
12047 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12048
12049 * incremental.cc: New file.
12050 * Makefile.am (CCFILES): Add incremental.cc.
12051 * Makefile.in: Rebuild.
12052
12053 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12054
12055 * layout.cc (Layout::output_section_name): Preserve names
12056 of '.note.' sections.
12057
12058 2009-03-19 Ian Lance Taylor <iant@google.com>
12059
12060 * descriptors.cc (Descriptors::open): Check that the options are
12061 valid before using them.
12062
12063 2009-03-18 Ian Lance Taylor <iant@google.com>
12064
12065 * script-sections.h: Include <list>.
12066 (class Script_sections): Change Sections_elements from std::vector
12067 to std::list. Typedef public Elements_iterator. Add
12068 orphan_section_placement_, data_segment_align_start_, and
12069 saw_data_segment_align_ fields. Remove data_segment_align_index_
12070 field.
12071 * script-sections.cc (class Orphan_section_placement): New class.
12072 (class Sections_element): Add virtual functions is_relro and
12073 orphan_section_init. Remove virtual function place_orphan_here.
12074 (class Output_section_definition): Add is_relro and
12075 orphan_section_init. Remove place_orphan_here.
12076 (class Orphan_output_section): Likewise.
12077 (Script_sections::Script_sections): Update for field changes.
12078 (Script_sections::data_segment_align): Set saw_data_segment_align_
12079 and data_segment_align_start_, not data_segment_align_index.
12080 (Script_sections::data_segment_relro_end): Check
12081 saw_data_segment_align_. Use data_segment_align_start_ rather
12082 than data_segment_align_index_.
12083 (Script_sections::place_orphan): Rewrite to use
12084 Orphan_section_placement.
12085
12086 2009-03-17 Ian Lance Taylor <iant@google.com>
12087
12088 * archive.cc (Archive::add_symbols): Check for a version attached
12089 to the symbol name in the archive map.
12090 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12091 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12092 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12093 (ver_test_11.a): New target.
12094 * testsuite/Makefile.in: Rebuild.
12095
12096 * configure.ac: Check for chsize and posix_fallocate. Replace
12097 ftruncate.
12098 * ftruncate.c: New file, from gnulib.
12099 * output.cc (posix_fallocate): Define dummy version if not
12100 HAVE_POSIX_FALLOCATE.
12101 (Output_file::map): Call posix_fallocate rather than lseek and
12102 write.
12103 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12104 * configure, Makefile.in, config.in: Rebuild.
12105
12106 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12107
12108 * layout.h (Layout::create_note): Add section_name parameter.
12109 * layout.cc (Layout::create_note): Likewise.
12110 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12111
12112 2009-03-17 Ian Lance Taylor <iant@google.com>
12113
12114 * descriptors.cc: Include "options.h".
12115 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12116 (Descriptors::open): Always use O_CLOEXEC when opening a new
12117 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12118 then set FD_CLOEXEC.
12119
12120 * sparc.cc (class Target_sparc): Add has_got_section.
12121 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12122 make sure we have a GOT section.
12123
12124 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12125 (Target_sparc::Scan::local): Likewise.
12126 (Target_sparc::Scan::global): Likewise.
12127 (Target_sparc::Relocate::relocate): Likewise.
12128 (Target_sparc::Relocate::relocate_tls): Likewise.
12129
12130 * symtab.cc (Symbol_table::define_default_version): New function,
12131 broken out of add_from_object.
12132 (Symbol_table::add_from_object): Call define_default_version.
12133 (Symbol_table::define_special_symbol): Add resolve_oldsym
12134 parameter. Change all callers. If the version for a symbol comes
12135 from a version script, resolve it with the symbol with the same
12136 name with no version. Also add the symbol without a version if
12137 appropriate.
12138 (do_define_in_output_data): If resolving with oldsym, don't delete
12139 sym.
12140 (do_define_in_output_segment): Likewise.
12141 (do_define_as_constant): Likewise.
12142 * symtab.h (class Symbol_table): Update declarations.
12143
12144 2009-03-13 Ian Lance Taylor <iant@google.com>
12145
12146 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12147 (Read_symbols::requeue): New function.
12148 (Read_symbols::do_read_symbols): If make_elf_object fails because
12149 the target type is not configured, and the file was searched for,
12150 issue a warning and retry with the next directory.
12151 (Add_symbols::run): If the file has an incompatible format, and
12152 it was searched for, requeue the Read_symbols task. On error,
12153 release the object.
12154 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12155 dirindex parameter to constructor. Change all callers. Declare
12156 incompatible_warning and requeue.
12157 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12158 input_argument_ and input_group_ fields. Add them to
12159 constructor. Change all callers.
12160 (class Read_script): Add dirindex_ field. Add it to constructor.
12161 Change all callers.
12162 * archive.cc (Archive::setup): Remove input_objects parameter.
12163 Change all callers.
12164 (Archive::get_file_and_offset): Likewise.
12165 (Archive::read_all_symbols): Likewise.
12166 (Archive::read_symbols): Likewise.
12167 (Archive::get_elf_object_for_member): Remove input_objects
12168 parameter. Add punconfigured parameter. Change all callers.
12169 (Archive::add_symbols): Change return type to bool. Check return
12170 value of include_member.
12171 (Archive::include_all_members): Likewise.
12172 (Archive::include_member): Change return type to bool. Return
12173 false if first included object has incompatible target. Set
12174 included_member_ field.
12175 (Add_archive_symbols::run): If add_symbols returns false, requeue
12176 Read_symbols task.
12177 * archive.h (class Archive): Add included_member_ field.
12178 Initialize it in constructor. Add input_file and searched_for
12179 methods. Update declarations.
12180 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12181 input_argument_ fields. Add them to constructor. Change all
12182 callers.
12183 * script.cc: Include "target-select.h".
12184 (class Parser_closure): Add skip_on_incompatible_target_ and
12185 found_incompatible_target_ fields. Add
12186 skip_on_incompatible_target parameter to constructor. Change all
12187 callers. Add methods skip_on_incompatible_target,
12188 clear_skip_on_incompatible_target, found_incompatible_target, and
12189 set_found_incompatible_target.
12190 (read_input_script): Add dirindex parameter. Change all callers.
12191 If parser finds an incompatible target, requeue Read_symbols
12192 task.
12193 (script_set_symbol): Clear skip_on_incompatible_target in
12194 closure.
12195 (script_add_assertion, script_parse_option): Likewise.
12196 (script_start_sections, script_add_phdr): Likewise.
12197 (script_check_output_format): New function.
12198 * script.h (read_input_script): Update declaration.
12199 * script-c.h (script_check_output_format): Declare.
12200 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12201 (ignore_cmd): Remove OUTPUT_FORMAT.
12202 * fileread.cc (Input_file::Input_file): Add explicit this.
12203 (Input_file::will_search_for): New function.
12204 (Input_file::open): Add pindex parameter. Change all callers.
12205 * fileread.h (class Input_file): Add input_file_argument method.
12206 Declare will_search_for. Update declarations.
12207 * object.cc (make_elf_object): Add punconfigured parameter.
12208 Change all callers.
12209 * object.h (class Object): Make input_file public. Add
12210 searched_for method.
12211 (make_elf_object): Update declaration.
12212 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12213 restart search.
12214 * dirsearch.h (class Dirsearch): Update declaration.
12215 * options.h (class General_options): Add --warn-search-mismatch.
12216 * parameters.cc (Parameters::is_compatible_target): New function.
12217 * parameters.h (class Parameters): Declare is_compatible_target.
12218 * workqueue.cc (Workqueue::add_blocker): New function.
12219 * workqueue.h (class Workqueue): Declare add_blocker.
12220
12221 * fileread.cc (Input_file::open): Remove options parameter.
12222 Change all callers.
12223 (Input_file::open_binary): Likewise.
12224 * script.cc (read_input_script): Likewise.
12225 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12226 options parameter from constructor. Change all callers.
12227 (class Read_script): Likewise.
12228 * fileread.h (class Input_file): Update declarations.
12229 * script.h (read_input_script): Update declaration.
12230
12231 2009-03-10 Nick Clifton <nickc@redhat.com>
12232
12233 * po/es.po: New Spanish translation.
12234
12235 2009-03-06 Cary Coutant <ccoutant@google.com>
12236
12237 * options.cc (parse_short_option): Keep dash_z from registering itself.
12238
12239 2009-03-03 Ian Lance Taylor <iant@google.com>
12240
12241 PR 9918
12242 * target-reloc.h (relocate_section): Pass output_section to
12243 relocate.
12244 * i386.cc (Target_i386::should_apply_static_reloc): Add
12245 output_section parameter. Change all callers.
12246 (Target_i386::Relocate::relocate): Add output_section parameter.
12247 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12248 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12249 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12250 * testsuite/two_file_shared.sh: New script.
12251 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12252 (check_DATA): Add two_file_shared.dbg.
12253 (two_file_shared.dbg): New target.
12254 * testsuite/Makefile.in: Rebuild.
12255
12256 2009-03-01 Ian Lance Taylor <iant@google.com>
12257
12258 * configure.ac: Check for byteswap.h.
12259 * configure: Rebuild.
12260 * config.in: Rebuild.
12261
12262 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12263
12264 * layout.cc (Layout::find_or_add_kept_section): New function.
12265 (Layout::add_comdat): Removed.
12266 * layout.h (struct Kept_section): Move out of class Layout.
12267 Remove trailing underscores from field names. Add group_sections
12268 field. Rename group_ field to is_group. Change all uses.
12269 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12270 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12271 comdat_groups_ field.
12272 (Sized_relobj::include_section_group): Use
12273 find_or_add_kept_section and Kept_section::group_sections.
12274 (Sized_relobj::include_linkonce_section): Likewise.
12275 * object.cc (class Sized_relobj): Don't define Comdat_group or
12276 Comdat_group_table. Remove find_comdat_group and
12277 add_comdat_group. Remove comdat_groups_ field.
12278 * plugin.cc (include_comdat_group): Use
12279 Layout::find_or_add_kept_section.
12280
12281 2009-02-28 Ian Lance Taylor <iant@google.com>
12282
12283 * README: --gc-sections and map files are now supported. Document
12284 some build requirements.
12285
12286 PR 6992
12287 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12288 relocatable link set the value of the section symbol to zero.
12289 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12290 relocatable link don't include the section address in the local
12291 symbol value.
12292
12293 2009-02-27 Ian Lance Taylor <iant@google.com>
12294
12295 PR 6811
12296 * options.h (class Search_directory): Add is_system_directory.
12297 (class General_options): Declare is_in_system_directory.
12298 * options.cc (get_relative_sysroot): Make static.
12299 (get_default_sysroot): Make static.
12300 (General_optoins::is_in_system_directory): New function.
12301 * fileread.cc (Input_file::is_in_system_directory): New function.
12302 * fileread.h (class Input_file): Declare is_in_system_directory.
12303 * object.h (class Object): Add is_in_system_directory.
12304 (class Input_objects): Remove system_library_directory_ field.
12305 * object.cc (Input_objects::add_object): Don't set
12306 system_library_directory_.
12307 (input_objects::found_in_system_library_directory): Remove.
12308 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12309 parameter. Change all callers.
12310 (Symbol_table::sized_write_globals): Likewise.
12311 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12312 Call Object::is_in_system_directory.
12313 * symtab.h (class Symbol_table): Update declarations.
12314
12315 PR 5990
12316 * descriptors.h (Open_descriptor): Add is_on_stack field.
12317 * descriptors.cc (Descriptors::open): If the descriptor is on the
12318 top of the stack, remove it. Initialize is_on_stack field.
12319 (Descriptors::release): Only add pod to stack if it is not on the
12320 stack already.
12321 (Descriptors::close_some_descriptor): Clear stack_next and
12322 is_on_stack fields.
12323
12324 PR 7091
12325 * output.cc (Output_section::find_starting_output_address): Rename
12326 from starting_output_address; add PADDR parameter; change return
12327 type.
12328 * output.h (class Output_section): Declare
12329 find_starting_output_address instead of starting_output_address.
12330 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12331 section symbol for which we can't find a merge section.
12332
12333 PR 9836
12334 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12335 hidden or internal, force the symbol to be local.
12336 * resolve.cc (Symbol::override_visibility): Define.
12337 (Symbol::override_base): Use override_visibility.
12338 (Symbol_table::resolve): Likewise.
12339 (Symbol::override_base_with_special): Likewise.
12340 (Symbol_table::override_with_special): If the visibility is hidden
12341 or internal, force the symbol to be local.
12342 * symtab.h (class Symbol): Add set_visibility and
12343 override_visibility.
12344 * testsuite/ver_test_1.sh: New file.
12345 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12346 (check_DATA): Add ver_test_1.syms.
12347 (ver_test_1.syms): New target.
12348 * testsuite/Makefile.in: Rebuild.
12349
12350 2009-02-25 Cary Coutant <ccoutant@google.com>
12351
12352 * layout.cc (Layout::choose_output_section): Don't rename sections
12353 when using a linker script that has a SECTIONS clause.
12354 * Makefile.in: Regenerate.
12355
12356 * testsuite/Makefile.am (script_test_5.sh): New test case.
12357 * testsuite/Makefile.in: Regenerate.
12358 * testsuite/script_test_5.cc: New file.
12359 * testsuite/script_test_5.sh: New file.
12360 * testsuite/script_test_5.t: New file.
12361
12362 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
12363
12364 * archive.cc (Archive::include_member): Update calls to add_symbols.
12365 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12366 the Layout argument.
12367 * dynobj.h (do_add_symbols): Add the Layout argument.
12368 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12369 Layout argument.
12370 * object.h (Object::add_symbols): Add the Layout argument.
12371 (Object::do_add_symbols): Add the Layout argument.
12372 (Sized_relobj::do_add_symbols): Add the Layout argument.
12373 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12374 Unify the two versions.
12375 (Add_plugin_symbols): Remove.
12376 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12377 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12378 (Add_plugin_symbols): Remove.
12379 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12380 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12381 (Add_symbols::run): Make it work with Pulginobj.
12382
12383 2009-02-06 Ian Lance Taylor <iant@google.com>
12384
12385 * object.cc (Sized_relobj::do_layout): Make info message start
12386 with lower case letter.
12387
12388 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12389
12390 * binary.cc: Fix file comment.
12391
12392 * options.h (enum Incremental_disposition): Define.
12393 (class General_options): Add new options: --incremental,
12394 --incremental_changed, --incremental_unchanged,
12395 --incremental_unknown. Add incremental_disposition_ and
12396 implicit_incremental_ fields.
12397 (General_options::incremental_disposition): New function.
12398 (class Position_dependent_options): Add incremental_disposition
12399 option.
12400 (Position_dependent_options::copy_from_options): Set incremental
12401 dispositions.
12402 * options.cc (General_options::parse_incremental_changed): New
12403 function.
12404 (General_options::parse_incremental_unchanged): New function.
12405 (General_options::parse_incremental_unknown): New function.
12406 (General_options::General_options): Initialize new fields
12407 incremental_disposition_ and implicit_incremental_.
12408 (General_options::finalize): Check for uasge of --incremental-*
12409 without --incremental.
12410
12411 2009-02-06 Chris Demetriou <cgd@google.com>
12412
12413 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12414 pointer and to report location as the file name associated with
12415 the symbol.
12416 (gold_undefined_symbol_at_location): New function to replace the
12417 old gold_undefined_symbol functionality.
12418 * target-reloc.h (relocate_section): Update to use
12419 gold_undefined_symbol_at_location.
12420 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12421 Call gold_undefined_symbol function rather than gold_error.
12422 * errors.h (Errors::undefined_symbol): Take location as a
12423 string, rather than calculating it from a relocation.
12424 * errors.cc (Errors::fatal): Print "fatal error:" before the
12425 formatted message.
12426 (Errors::error, Errors::error_at_location): Print "error: "
12427 before the formatted message.
12428 (Errors::undefined_symbol): Take location as a string, rather
12429 than calculating it from a relocation.
12430 (gold_undefined_symbol_at_location): New function akin to
12431 old gold_undefined_symbol, calculates location from relocation.
12432 (gold_undefined_symbol): Change to take only a Symbol pointer
12433 and to report location as the file name associated with the symbol.
12434 * testsuite/debug_msg.sh: Update for changed error messages.
12435 * testsuite/undef_symbol.sh: Likewise.
12436
12437 2009-02-04 Duncan Sands <baldrick@free.fr>
12438
12439 PR 9812
12440 * reduced_debug_output.h
12441 (Output_reduced_debug_abbrev_section::failed): Use format for
12442 gold_warning.
12443 (Output_reduced_debug_info_section::faild): Likewise.
12444
12445 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12446
12447 * script.cc (Lazy_demangler): New class.
12448 (Version_script_info::get_symbol_version_helper): Demangle a
12449 symbol only once.
12450
12451 2009-01-29 Cary Coutant <ccoutant@google.com>
12452
12453 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12454 to __tls_get_addr.
12455 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12456
12457 2009-01-28 Ian Lance Taylor <iant@google.com>
12458
12459 * version.cc (version_string): Bump to 1.9.
12460
12461 * gold.h: Include <cstring> and <stdint.h>.
12462 * version.cc: Include <cstdio>.
12463 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12464 warning.
12465 * reduced_debug_output.cc (insert_into_vector): Rename from
12466 Insert_into_vector; change all callers. Use Swap_unaligned to
12467 avoid aliasing issue; remove union since it is unnecessary.
12468
12469 2009-01-27 Sriraman Tallam <tmsriram@google.com>
12470
12471 * Makefile.am (CCFILES): Add gc.cc.
12472 (HFILES): Add gc.h.
12473 * Makefile.in: Regenerate.
12474 * gold.cc (Gc_runner): New class.
12475 (queue_initial_tasks): Call garbage collection related tasks
12476 when corresponding options are invoked.
12477 (queue_middle_gc_tasks): New function.
12478 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12479 processed early before laying out sections during garbage collection.
12480 * gold.h (queue_middle_gc_tasks): New function.
12481 (is_prefix_of): Move from "layout.cc".
12482 * i386.cc (Target_i386::gc_process_relocs): New function.
12483 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12484 * main.cc (main): Create object of class "Garbage_collection".
12485 * object.cc (Relobj::copy_symbols_data): New function.
12486 (Relobj::is_section_name_included): New function.
12487 (Sized_relobj::do_layout): Allow this function to be called twice
12488 during garbage collection and defer layout of section during the
12489 first call.
12490 * object.h (Relobj::get_symbols_data): New function.
12491 (Relobj::is_section_name_included): New function.
12492 (Relobj::copy_symbols_data): New function.
12493 (Relobj::set_symbols_data): New function.
12494 (Relobj::get_relocs_data): New function.
12495 (Relobj::set_relocs_data): New function.
12496 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12497 (Relobj::gc_process_relocs): New function.
12498 (Relobj::do_gc_process_relocs): New pure virtual function.
12499 (Relobj::sd_): New data member.
12500 (Sized_relobj::is_output_section_offset_invalid): New function.
12501 (Sized_relobj::do_gc_process_relocs): New function.
12502 * options.h (General_options::gc_sections): Modify to not be a no-op.
12503 (General_options::print_gc_sections): New option.
12504 * plugin.cc (Plugin_finish::run): Remove function call to
12505 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12506 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12507 * reloc.cc (Read_relocs::run): Add task to process relocs and
12508 determine unreferenced sections when doing garbage collection.
12509 (Gc_process_relocs): New class.
12510 (Sized_relobj::do_gc_process_relocs): New function.
12511 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12512 sections that are garbage collected.
12513 * reloc.h (Gc_process_relocs): New class.
12514 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12515 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12516 symbols whose corresponding sections are garbage collected.
12517 (Symbol_table::Symbol_table): Add new parameter for the garbage
12518 collection object.
12519 (Symbol_table::gc_mark_undef_symbols): New function.
12520 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12521 (Symbol_table::gc_mark_dyn_syms): New function.
12522 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12523 as garbage.
12524 (Symbol_table::add_from_object): Likewise.
12525 (Symbol_table::add_from_relobj): When building shared objects, do not
12526 treat externally visible symbols as garbage.
12527 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12528 table information for static and relocatable links.
12529 * symtab.h (Symbol_table::set_gc): New function.
12530 (Symbol_table::gc): New function.
12531 (Symbol_table::gc_mark_undef_symbols): New function.
12532 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12533 (Symbol_table::gc_mark_dyn_syms): New function.
12534 (Symbol_table::gc_): New data member.
12535 * target.h (Sized_target::gc_process_relocs): New pure virtual
12536 function.
12537 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12538 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12539
12540 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12541
12542 * options.h (General_options::gc_sections): Define as a no-op for now.
12543 (General_options::no_keep_memory): Ditto.
12544 (General_options::Bshareable): Define.
12545 * options.cc (General_options::finalize): Honor -Bshareable.
12546
12547 2009-01-20 Andreas Schwab <schwab@suse.de>
12548
12549 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12550 read the value in the contents, since we don't use it. Use the
12551 template endianness when writing.
12552 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12553
12554 2009-01-19 Andreas Schwab <schwab@suse.de>
12555
12556 * configure.tgt (powerpc64-*): Fix targ_obj.
12557
12558 2009-01-15 Ian Lance Taylor <iant@google.com>
12559
12560 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12561 local symbols when stripping all symbols.
12562
12563 2009-01-14 Cary Coutant <ccoutant@google.com>
12564
12565 * output.cc (Output_reloc): Add explicit instantiations.
12566
12567 2009-01-14 Cary Coutant <ccoutant@google.com>
12568
12569 * archive.cc (Archive::get_elf_object_for_member): Remove call
12570 to File_read::claim_for_plugin.
12571 * descriptors.cc (Descriptors::open): Remove reference to
12572 is_claimed.
12573 (Descriptors::claim_for_plugin): Remove.
12574 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12575 (Descriptors::is_claimed): Remove.
12576 (claim_descriptor_for_plugin): Remove.
12577 * fileread.cc (File_read::claim_for_plugin): Remove.
12578 * fileread.h (File_read::claim_for_plugin): Remove.
12579 (File_read::descriptor): Reopen descriptor if necessary.
12580 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12581 (Plugin_manager::all_symbols_read): Add task parameter. Change
12582 all callers.
12583 (Plugin_manager::get_input_file): New function.
12584 (Plugin_manager::release_input_file): New function.
12585 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12586 corresponding data member.
12587 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12588 and pass to base constructor. Change all callers.
12589 (get_input_file, release_input_file): New functions.
12590 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12591 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12592 (Plugin_manager::all_symbols_read): Add task parameter.
12593 (Plugin_manager::get_input_file): New function.
12594 (Plugin_manager::release_input_file): New function.
12595 (Plugin_manager::task_): New data member.
12596 (Pluginobj::Pluginobj): Add filesize parameter.
12597 (Pluginobj::filename): New function.
12598 (Pluginobj::descriptor): New function.
12599 (Pluginobj::filesize): New function.
12600 (Pluginobj::filesize_): New data member.
12601 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12602 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12603 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12604
12605 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12606 with archive libraries.
12607 * testsuite/Makefile.in: Regenerate.
12608 * testsuite/plugin_test.c (struct sym_info): New type.
12609 (get_input_file, release_input_file): New static variables.
12610 (onload): Capture new transfer vector entries.
12611 (claim_file_hook): Stop reading at end of file according to filesize.
12612 Factor out parsing of readelf output into separate function.
12613 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12614 APIs and get the source file name from the symbol table. Convert
12615 source file name to corresponding object file name. Print info
12616 message when adding new input files.
12617 (parse_readelf_line): New function.
12618 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12619 * testsuite/plugin_test_2.sh: Likewise.
12620 * testsuite/plugin_test_3.sh: Likewise.
12621 * testsuite/plugin_test_4.sh: New test case.
12622
12623 2009-01-07 Ian Lance Taylor <iant@google.com>
12624
12625 * version.cc (version_string): Bump to 1.8.
12626
12627 2008-12-23 Cary Coutant <ccoutant@google.com>
12628
12629 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12630 * plugin.cc (Plugin_manager::finish): Rename as
12631 layout_deferred_objects. Move cleanup to separate function.
12632 (Plugin_manager::cleanup): New function.
12633 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12634 separately.
12635 * plugin.h (Plugin_manager::finish): Rename as
12636 layout_deferred_objects.
12637 (Plugin_manager::cleanup): New function.
12638 (Plugin_manager::cleanup_done): New field.
12639
12640 2008-12-23 Cary Coutant <ccoutant@google.com>
12641
12642 * plugin.cc (is_visible_from_outside): New function.
12643 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12644 so we don't return "IR only" status for exported symbols or -r links.
12645
12646 * testsuite/Makefile.am (plugin_test_3): New test case.
12647 * testsuite/Makefile.in: Regenerate.
12648 * testsuite/plugin_test_3.sh: New file.
12649
12650 2008-12-22 Cary Coutant <ccoutant@google.com>
12651
12652 * object.cc (Sized_relobj::layout_section): New function.
12653 (Sized_relobj::do_layout): Defer layout of input sections until after
12654 plugin has provided replacement files.
12655 (Sized_relobj::do_layout_deferred_sections): New function.
12656 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12657 (Relobj::layout_deferred_sections): New function.
12658 (Relobj::do_layout_deferred_sections): New function.
12659 (Sized_relobj::do_layout_deferred_sections): New function.
12660 (Sized_relobj::layout_section): New function.
12661 (Sized_relobj::Deferred_layout): New structure.
12662 (Sized_relobj::deferred_layout_): New field.
12663 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12664 Change all callers. Layout deferred sections.
12665 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12666 references.
12667 (Plugin_hook::run): Move code from do_plugin_hook inline.
12668 (Plugin_hook::do_plugin_hook): Remove.
12669 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12670 (Plugin_manager::finish): Renamed, was cleanup.
12671 (Plugin_manager::should_defer_layout): New function.
12672 (Plugin_manager::add_deferred_layout_object): New function.
12673 (Plugin_manager::Deferred_layout_list): New type.
12674 (Plugin_manager::deferred_layout_objects_): New field.
12675 (Plugin_hook::do_plugin_hook): Remove.
12676
12677 2008-12-17 Ian Lance Taylor <iant@google.com>
12678
12679 * options.h (class General_options): Add --no case for
12680 --export-dynamic.
12681
12682 2008-12-16 Cary Coutant <ccoutant@google.com>
12683
12684 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12685 vector.
12686 (Plugin_manager::claim_file): Create plugin object even if
12687 plugin did not call the add_symbols callback.
12688 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12689 asking for more symbols than were added.
12690 * testsuite/Makefile.am (plugin_test_1): Add test case with
12691 no global symbols.
12692 (empty.syms): New target.
12693 * testsuite/Makefile.in: Regenerate.
12694 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12695 message. Don't call add_symbols if no globals.
12696 (all_symbols_read_hook): Don't provide replacement for empty
12697 claimed file.
12698
12699 2008-12-12 Ian Lance Taylor <iant@google.com>
12700
12701 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12702 r_type == 0 for a local symbol with r_sym == 0.
12703 (scan_relocatable_relocs): Pass r_sym to
12704 local_non_section_strategy.
12705 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12706 r_sym parameter.
12707
12708 * configure.ac: Update test for TLS descriptors: they are
12709 supported as of glibc 2.9.
12710 * configure: Rebuild.
12711
12712 2008-12-11 Ian Lance Taylor <iant@google.com>
12713
12714 PR 7091
12715 * target-reloc.h (Default_scan_relocatable_relocs): For each
12716 function, map r_type == 0 to RELOC_DISCARD.
12717
12718 2008-12-10 Cary Coutant <ccoutant@google.com>
12719
12720 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12721 object to override a kept COMDAT group from a plugin object.
12722
12723 2008-12-09 Ian Lance Taylor <iant@google.com>
12724
12725 PR 7088
12726 * yyscript.y (file_cmd): Handle INPUT.
12727
12728 * testsuite/initpri1.c: Change all declarations to be full
12729 prototypes by adding void, to avoid compiler warnings.
12730
12731 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
12732
12733 * options.cc (General_options::parse_plugin_opt): New.
12734 (General_options::add_plugin): The argument now is just the filename.
12735 (General_options::add_plugin_option): New.
12736 * options.h (plugin_opt): New.
12737 (add_plugin): Change argument name.
12738 (add_plugin_option): New.
12739 * plugin.cc (Plugin::load): Don't parse the plugin option.
12740 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12741 (Plugin::add_option): New.
12742 (Plugin::args_): Change type.
12743 (Plugin::filename_): New.
12744 (Plugin_manager::add_plugin_option): New.
12745 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12746 * testsuite/Makefile.in: Regenerate.
12747
12748 2008-12-05 Cary Coutant <ccoutant@google.com>
12749
12750 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12751 Handle --strip-lto-sections option.
12752 * options.h (strip_lto_sections): New option.
12753
12754 2008-12-01 Cary Coutant <ccoutant@google.com>
12755
12756 * plugin.cc (ld_plugin_message): Change format parameter to const.
12757 Fix mismatch between new[] and delete.
12758
12759 2008-11-14 Cary Coutant <ccoutant@google.com>
12760
12761 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12762 instead of -1U.
12763
12764 2008-11-05 Craig Silverstein <csilvers@google.com>
12765
12766 * options.cc (General_options::parse_dynamic_list): New function.
12767 * options.h (General_options): New flags dynamic_list,
12768 dynamic_list_data, dynamic_list_cpp_new, and
12769 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12770 (General_options::in_dynamic_list): New function.
12771 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12772 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12773 (Lex::can_continue_name): Likewise.
12774 (yylex): Likewise.
12775 (read_script_file): New parameter script_options.
12776 (read_dynamic_list): New function.
12777 (Script_options::define_dynamic_list): New function.
12778 (dynamic_list_keyword_parsecodes): New variable.
12779 (dynamic_list_keywords): New variable.
12780 * script.h (Script_options::define_dynamic_list): New function
12781 prototype.
12782 (read_dynamic_list): New function prototype.
12783 * symtab.cc (strprefix): New macro.
12784 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12785 dynamic_list_data, dynamic_list_cpp_new, and
12786 dynamic_list_cpp_typeinfo.
12787 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12788 (dynamic_list_expr): New rule.
12789 (dynamic_list_nodes): Likewise.
12790 (dynamic_list_node): Likewise.
12791 * testsuite/Makefile.am (dynamic_list): New test.
12792 * testsuite/Makefile.in: Regenerated.
12793 * testsuite/dynamic_list.t: New file.
12794 * testsuite/dynamic_list.sh: New file.
12795
12796 2008-11-05 Craig Silverstein <csilvers@google.com>
12797
12798 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12799 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12800 (t11_last): Likewise.
12801 * testsuite/ver_test_6.c (main): Likewise.
12802
12803 2008-10-07 Cary Coutant <ccoutant@google.com>
12804
12805 * options.c (General_options::finalize): Add check for -static and
12806 -shared.
12807 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12808 is not empty.
12809
12810 2008-10-02 Cary Coutant <ccoutant@google.com>
12811
12812 * plugin.cc (make_sized_plugin_object): Fix conditional
12813 compilation to work when not all targets are enabled.
12814
12815 2008-09-29 Cary Coutant <ccoutant@google.com>
12816
12817 * archive.cc (Archive::get_file_and_offset): Use filename instead
12818 of name to get library path.
12819 (Archive::include_member): Unlock external member of a thin archive.
12820
12821 * testsuite/Makefile.am (TEST_AR): New variable.
12822 (thin_archive_test_1): New test.
12823 (thin_archive_test_2): New test.
12824 * testsuite/Makefile.in: Regenerate.
12825 * testsuite/thin_archive_main.cc: New file.
12826 * testsuite/thin_archive_test_1.cc: New file.
12827 * testsuite/thin_archive_test_2.cc: New file.
12828 * testsuite/thin_archive_test_3.cc: New file.
12829 * testsuite/thin_archive_test_4.cc: New file.
12830
12831 2008-09-29 Cary Coutant <ccoutant@google.com>
12832
12833 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12834 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12835 instead of -1U.
12836 (Sized_relobj::do_finalize_local_symbols): Likewise.
12837 (Sized_relobj::map_to_kept_section): Likewise.
12838 * object.h (Sized_relobj::invalid_address): New constant.
12839 (Sized_relobj::do_output_section_offset): Check for invalid_address
12840 and return -1ULL.
12841 * output.cc (Output_reloc::local_section_offset): Use constant
12842 invalid_address instead of -1U.
12843 (Output_reloc::get_address): Likewise.
12844 (Output_section::output_address): Change -1U to -1ULL.
12845 * output.h (Output_reloc::invalid_address): New constant.
12846 * reloc.cc (Sized_relobj::write_sections): Use constant
12847 invalid_address instead of -1U.
12848 (Sized_relobj::relocate_sections): Likewise.
12849 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12850 values for merge sections.
12851 * target-reloc.h (relocate_for_relocatable): Use constant
12852 invalid_address instead of -1U.
12853
12854 2008-09-19 Cary Coutant <ccoutant@google.com>
12855
12856 Add plugin functionality for link-time optimization (LTO).
12857 * configure.ac (plugins): Add --enable-plugins option.
12858 * configure: Regenerate.
12859 * config.in: Regenerate.
12860 * Makefile.am (LIBDL): New variable.
12861 (CCFILES): Add plugin.cc.
12862 (HFILES): Add plugin.h.
12863 (ldadd_var): Add LIBDL.
12864 * Makefile.in: Regenerate.
12865
12866 * archive.cc: Include "plugin.h".
12867 (Archive::setup): Don't preread archive symbols when using a plugin.
12868 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12869 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12870 files.
12871 (Archive::include_member): Add symbols from plugin objects.
12872 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12873 * descriptors.cc (Descriptors::open): Check for file descriptors
12874 abandoned by plugins.
12875 (Descriptors::claim_for_plugin): New function.
12876 * descriptors.h (Descriptors::claim_for_plugin): New function.
12877 (Open_descriptor::is_claimed): New field.
12878 (claim_descriptor_for_plugin): New function.
12879 * fileread.cc (File_read::claim_for_plugin): New function.
12880 * fileread.h (File_read::claim_for_plugin): New function.
12881 (File_read::descriptor): New function.
12882 * gold.cc: Include "plugin.h".
12883 (queue_initial_tasks): Add task to call plugin hooks for generating
12884 new object files.
12885 * main.cc: Include "plugin.h".
12886 (main): Load plugin libraries.
12887 * object.h (Pluginobj): Declare.
12888 (Object::pluginobj): New function.
12889 (Object::do_pluginobj): New function.
12890 (Object::set_target): New function.
12891 * options.cc: Include "plugin.h".
12892 (General_options::parse_plugin): New function.
12893 (General_options::General_options): Initialize plugins_ field.
12894 (General_options::add_plugin): New function.
12895 * options.h (Plugin_manager): Declare.
12896 (General_options): Add --plugin option.
12897 (General_options::has_plugins): New function.
12898 (General_options::plugins): New function.
12899 (General_options::add_plugin): New function.
12900 (General_options::plugins_): New field.
12901 * plugin.cc: New file.
12902 * plugin.h: New file.
12903 * readsyms.cc: Include "plugin.h".
12904 (Read_symbols::do_read_symbols): Check for archive before checking
12905 for ELF file. Call plugin hooks to claim files.
12906 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12907 from a real object file; force override when processing replacement
12908 files.
12909 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12910 (Symbol::init_base_object): Likewise.
12911 (Symbol::init_base_output_data): Likewise.
12912 (Symbol::init_base_output_segment): Likewise.
12913 (Symbol::init_base_constant): Likewise.
12914 (Symbol::init_base_undefined): Likewise.
12915 (Symbol::output_section): Assert that object is not a plugin.
12916 (Symbol_table::add_from_pluginobj): New function.
12917 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12918 undefined.
12919 (Symbol_table::sized_write_globals): Likewise.
12920 (Symbol_table::add_from_pluginobj): Instantiate template.
12921 * symtab.h (Sized_pluginobj): Declare.
12922 (Symbol::in_real_elf): New function.
12923 (Symbol::set_in_real_elf): New function.
12924 (Symbol::in_real_elf_): New field.
12925 (Symbol_table::add_from_pluginobj): New function.
12926
12927 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12928 (LIBDL): New variable.
12929 (LDADD): Add LIBDL.
12930 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12931 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12932 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12933 (MOSTLYCLEANFILES): Likewise.
12934 * testsuite/Makefile.in: Regenerate.
12935 * testsuite/plugin_test.c: New file.
12936 * testsuite/plugin_test_1.sh: New file.
12937 * testsuite/plugin_test_2.sh: New file.
12938
12939 2008-09-16 Ian Lance Taylor <iant@google.com>
12940
12941 * target-reloc.h (relocate_section): Check whether a symbol is
12942 defined by the ABI before reporting an undefined symbol error.
12943 * target.h (Target::is_defined_by_abi): Make parameter const.
12944 (Target::do_is_defined_by_abi): Likewise.
12945 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12946 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12947 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12948 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12949 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12950 * testsuite/Makefile.in: Rebuild.
12951
12952 * fileread.cc (make_view): Add casts to avoid warning.
12953
12954 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12955
12956 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12957 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12958
12959 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12960
12961 * options.h (General_options::output_is_executable): New.
12962 (General_options::output_is_pie): New.
12963 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12964 for shared libraries.
12965 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12966
12967 2008-09-11 Chris Demetriou <cgd@google.com>
12968
12969 * options.h (origin): New -z option.
12970 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12971 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12972 in DT_FLAGS_1.
12973
12974 2008-09-05 Cary Coutant <ccoutant@google.com>
12975
12976 * fileread.cc (File_read::make_view): Add check for attempt to map
12977 beyond end of file.
12978
12979 2008-09-05 Cary Coutant <ccoutant@google.com>
12980
12981 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12982 explicit instantiations.
12983
12984 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12985
12986 PR gold/6858
12987 * options.cc (General_options::finalize): Allow undefined symbols
12988 in shlibs if linking -shared.
12989
12990 PR gold/6859
12991 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12992 symbols as not needing a dynsym entry.
12993
12994 2008-08-20 Craig Silverstein <csilvers@google.com>
12995
12996 * fileread.cc (File_read::open): Do not lock the file unless it
12997 was successfully opened.
12998
12999 2008-08-14 Cary Coutant <ccoutant@google.com>
13000
13001 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13002 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13003 * testsuite/tls_test.cc (struct int128): 128-bit struct
13004 for testing TLS relocs with non-zero addend.
13005 (v12): New TLS variable.
13006 (t12): New test.
13007 (t_last): Add check for v12.
13008 * testsuite/tls_test.h (t12): New function.
13009 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13010
13011 2008-08-13 Ian Lance Taylor <iant@google.com>
13012
13013 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13014 set tls_segment_ or relro_segment_.
13015 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13016 when appropriate.
13017 * output.h (Output_section::clear_is_relro): New function.
13018 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13019 sections specially even when output_data_ is empty.
13020 (Output_segment::maximum_alignment): When first section is relro,
13021 only force alignment for PT_LOAD segments.
13022 * script.cc (script_data_segment_align): New function.
13023 (script_data_segment_relro_end): New function.
13024 * script-c.h (script_data_segment_align): Declare.
13025 (script_data_segment_relro_end): Declare.
13026 * script-sections.h (class Script_sections): Declare
13027 data_segment_align and data_segment_relro_end. Add fields
13028 segment_align_index_ and saw_relro_end_.
13029 * script-sections.cc (class Sections_element): Add set_is_relro
13030 virtual function. Add new bool* parameter to place_orphan_here.
13031 Add get_output_section virtual function.
13032 (class Output_section_definition): Add set_is_relro. Add new
13033 bool* parameter to place_orphan_here. Add get_output_section.
13034 Add is_relro_ field.
13035 (Output_section_definition::Output_section_definition): Initialize
13036 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13037 and is_relro_ fields.
13038 (Output_section_definition::place_orphan_here): Add is_relro
13039 parameter.
13040 (Output_section_definition::set_section_addresses): Set relro for
13041 output section.
13042 (Output_section_definition::alternate_constraint): Likewise.
13043 (class Orphan_output_section): Add new bool* parameter to
13044 place_orphan_here. Add get_output_section.
13045 (Orphan_output_section::place_orphan_here): Add is_relro
13046 parameter.
13047 (Script_sections::Script_sections): Initialize
13048 data_segment_align_index_ and saw_relro_end_.
13049 (Script_sections::data_segment_align): New function.
13050 (Script_sections::data_segment_relro_end): New function.
13051 (Script_sections::place_orphan): Set or clear is_relro.
13052 (Script_sections::set_section_addresses): Force alignment of first
13053 TLS section.
13054 * yyscript.y (exp): Call script_data_segment_align and
13055 script_data_segment_relro_end.
13056 * testsuite/relro_script_test.t: New file.
13057 * testsuite/relro_test.cc (using_script): Declare.
13058 (t1, t2): Test using_script.
13059 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13060 (relro_script_test_SOURCES): Define.
13061 (relro_script_test_DEPENDENCIES): Define.
13062 (relro_script_test_LDFLAGS): Define.
13063 (relro_script_test_LDADD): Define.
13064 (relro_script_test.so): New target.
13065 * testsuite/Makefile.in: Rebuild.
13066
13067 2008-08-06 Cary Coutant <ccoutant@google.com>
13068
13069 * archive.cc (Archive::total_archives, Archive::total_members)
13070 (Archive::total_members_loaded): New variables.
13071 (Archive::setup): Add parameter. Add option to preread
13072 archive symbols.
13073 (Archive::read_armap): Add counter.
13074 (Archive::get_file_and_offset): New function.
13075 (Archive::get_elf_object_for_member): New function.
13076 (Archive::read_all_symbols): New function.
13077 (Archive::read_symbols): New function.
13078 (Archive::add_symbols): Add counters.
13079 (Archive::include_all_members): Use armap to find members if it's
13080 already built.
13081 (Archive::include_member): Skip reading symbols if already read.
13082 Factored code into Archive::get_file_and_offset and
13083 Archive::get_elf_object_for_member. Changed call to
13084 Mapfile::report_include_archive_member.
13085 (Archive::print_stats): New function.
13086 * archive.h: Declare Object and Read_symbols_data classes.
13087 (Archive::Archive): Add initializers for new members.
13088 (Archive::setup): Add parameter.
13089 (Archive::print_stats): New function.
13090 (Archive::total_archives, Archive::total_members)
13091 (Archive::total_members_loaded): New variables.
13092 (Archive::get_file_and_offset): New function.
13093 (Archive::get_elf_object_for_member): New function.
13094 (Archive::read_all_symbols): New function.
13095 (Archive::read_symbols): New function.
13096 (Archive::Archive_member): New class.
13097 (Archive::members_): New member.
13098 (Archive::num_members_): New member.
13099 * main.cc: Include archive.h.
13100 (main): Call Archive::print_stats.
13101 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13102 archive parameter; member_name is now the fully-decorated name.
13103 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13104 * options.h: (General_options): Add --preread-archive-symbols option.
13105 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13106 Archive::setup.
13107
13108 2008-08-04 Ian Lance Taylor <iant@google.com>
13109
13110 * symtab.h (Symbol::use_plt_offset): New function.
13111 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13112 * powerpc.cc (Relocate::relocate): Likewise.
13113 * sparc.cc (Relocate::relocate): Likewise.
13114 * x86_64.cc (Relocate::relocate): Likewise.
13115 * testsuite/weak_plt.sh: New test.
13116 * testsuite/weak_plt_main.cc: New test.
13117 * testsuite/weak_plt_shared.cc: New test.
13118 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13119 (check_PROGRAMS): Add weak_plt.
13120 (check_DATA): Add weak_plt_shared.so.
13121 (weak_plt_main_pic.o, weak_plt): New targets.
13122 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13123 * testsuite/Makefile.in: Rebuild.
13124
13125 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13126 gcctestdir/ld.
13127 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13128 * testsuite/Makefile.in: Rebuild.
13129
13130 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13131
13132 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13133 * Makefile.in: Regenerate.
13134 * po/POTFILES.in: Regenerate.
13135
13136 2008-07-29 Ian Lance Taylor <iant@google.com>
13137
13138 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13139 symbols before other symbols.
13140 * testsuite/script_test_2.cc (test_addr): Declare.
13141 (test_addr_alias): Declare.
13142 (main): Check that test_addr and test_addr_alias have the right
13143 values.
13144 * testsuite/script_test_2.t: Define test_addr_alias and
13145 test_addr.
13146
13147 2008-07-24 Ian Lance Taylor <iant@google.com>
13148
13149 PR 5990
13150 * descriptors.cc: New file.
13151 * descriptors.h: New file.
13152 * gold-threads.h (class Hold_optional_lock): New class.
13153 * fileread.cc: Include "descriptors.h".
13154 (File_read::~File_read): Release descriptor rather than closing
13155 it.
13156 (File_read::open) [file]: Call open_descriptor rather than open.
13157 Set is_descriptor_opened_.
13158 (File_read::open) [memory]: Assert that descriptor is not open.
13159 (File_read::reopen_descriptor): New function.
13160 (File_read::release): Release descriptor.
13161 (File_read::do_read): Make non-const. Reopen descriptor.
13162 (File_read::read): Make non-const.
13163 (File_read::make_view): Reopen descriptor.
13164 (File_read::do_readv): Likewise.
13165 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13166 Update declarations.
13167 * layout.cc: Include "descriptors.h".
13168 (Layout::create_build_id): Use open_descriptor rather than open.
13169 * output.cc: Include "descriptors.h".
13170 (Output_file::open): Use open_descriptor rather than open.
13171 * archive.cc (Archive::const_iterator): Change Archive to be
13172 non-const.
13173 (Archive::begin, Archive::end): Make non-const.
13174 (Archive::count_members): Likewise.
13175 * archive.h (class Archive): Update declarations.
13176 * object.h (Object::read): Make non-const.
13177 * Makefile.am (CCFILES): Add descriptors.cc.
13178 (HFILES): Add descriptors.h.
13179 * Makefile.in: Rebuild.
13180
13181 PR 6716
13182 * gold.h: Always include <clocale>. Add Solaris workarounds
13183 following code in binutils/sysdep.h.
13184
13185 PR 6048
13186 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13187 this->eh_frame_hdr_ is NULL before using it.
13188
13189 * dynobj.cc (Versions::Versions): Update comment.
13190
13191 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13192 the base version name.
13193
13194 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13195 array size plus one.
13196 (Stringpool_template::set_string_offsets): Subtract one from key
13197 before using it as an array index.
13198 (Stringpool_template::get_offset_with_length): Likewise.
13199 (Stringpool_template::write_to_buffer): Likewise.
13200 * stringpool.h (Stringpool_template::get_offset_from_key):
13201 Likewise.
13202
13203 2008-07-23 Ian Lance Taylor <iant@google.com>
13204
13205 PR 6658
13206 * object.h (Merged_symbol_value::value): Do our best to handle a
13207 negative addend.
13208
13209 PR 6647
13210 * script.cc (Version_script_info::get_versions): Don't add empty
13211 version tag to return value.
13212 (Version_script_info::get_symbol_version_helper): Change return
13213 type to bool. Add pversion parameter. Change all callers.
13214 (script_register_vers_node): Don't require a non-NULL tag.
13215 * script.h (class Version_script_info): Update declarations.
13216 (Version_script_info::get_symbol_version): Change return type to
13217 bool. Add version parameter. Change all callers.
13218 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13219 handling. Handle an empty version from a version script.
13220 (Symbol_table::define_special_symbol): Likewise.
13221 * testsuite/ver_test_10.script: New file.
13222 * testsuite/ver_test_10.sh: New file.
13223 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13224 (check_DATA): Add ver_test_10.syms.
13225 (ver_test_10.syms, ver_test_10.so): New target.
13226 * testsuite/Makefile.in: Rebuild.
13227
13228 2008-07-23 Simon Baldwin <simonb@google.com>
13229
13230 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13231 to zero for undefined symbols from dynamic libraries.
13232
13233 2008-07-23 Ian Lance Taylor <iant@google.com>
13234
13235 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13236 Change all callers.
13237 * symtab.h (class Symbol_table): Update declaration.
13238 * testsuite/ver_test_9.cc: New file.
13239 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13240 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13241 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13242 (ver_test_9.so, ver_test_9.o): New targets.
13243 * testsuite/Makefile.in: Rebuild.
13244
13245 2008-07-22 Ian Lance Taylor <iant@google.com>
13246
13247 * options.h (class General_options): Define --check-sections.
13248 * layout.cc (Layout::set_segment_offsets): Handle
13249 --check-sections.
13250
13251 * options.h (class General_options): Define -n/--nmagic and
13252 -N/--omagic.
13253 * options.cc (General_options::finalize): For -n/--nmagic or
13254 -N/--omagic, set -static.
13255 * layout.cc (Layout::attach_allocated_section_to_segment): If
13256 -N/--omagic, don't put read-only and read-write sections in
13257 different segments.
13258 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13259 finding a read-only segment.
13260 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13261 don't set the minimum segment alignment to the common page size,
13262 and don't set the file offset to the address modulo the page size.
13263 * script-sections.cc (Script_sections::create_segments): If
13264 -n/--omagic, don't put read-only and read-write sections in
13265 different segments.
13266
13267 * cref.cc: New file.
13268 * cref.h: New file.
13269 * options.h (class General_options): Add --print-symbol-counts.
13270 * main.cc (main): Issue defined symbol report if requested.
13271 * archive.cc (Archive::interpret_header): Make into a const member
13272 function.
13273 (Archive::add_symbols): Call Input_objects::archive_start and
13274 archive_stop.
13275 (Archive::const_iterator): Define new class.
13276 (Archive::begin, Archive::end): New functions.
13277 (Archive::include_all_members): Rewrite to use iterator.
13278 (Archive::count_members): New function.
13279 * archive.h (class Archive): Update declarations.
13280 (Archive::filename): New function.
13281 * object.cc: Include "cref.h".
13282 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13283 (Sized_relobj::do_get_global_symbol_counts): New function.
13284 (Input_objects::add_object): Add object to cross-referencer.
13285 (Input_objects::archive_start): New function.
13286 (Input_objects::archive_stop): New function.
13287 (Input_objects::print_symbol_counts): New function.
13288 * object.h: Declare Cref and Archive.
13289 (Object::get_global_symbol_counts): New function.
13290 (Object::do_get_global_symbol_counts): New pure virtual function.
13291 (class Sized_relobj): Add defined_count_ field. Update
13292 declarations.
13293 (class Input_objects): Add cref_ field. Update constructor.
13294 Update declarations.
13295 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13296 defined_count_.
13297 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13298 symbol counts.
13299 (Sized_dynobj::do_get_global_symbol_counts): New function.
13300 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13301 defined_count_. Update declarations. Define Symbols typedef.
13302 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13303 parameter. Change all callers.
13304 (Symbol_table::add_from_dynobj): Add sympointers and defined
13305 parameters. Change all callers.
13306 * symtab.h (class Symbol_table): Update declarations.
13307 * Makefile.am (CCFILES): Add cref.cc.
13308 (HFILES): Add cref.h.
13309 * Makefile.in: Rebuild.
13310
13311 2008-07-22 Simon Baldwin <simonb@google.com>
13312
13313 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13314 to zero when writing undefined symbols.
13315
13316 2008-07-22 Ian Lance Taylor <iant@google.com>
13317
13318 * output.cc (Output_section::add_input_section): Don't try to
13319 merge empty merge sections.
13320
13321 2008-07-21 Craig Silverstein <csilvers@google.com>
13322
13323 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13324 Include symbol version in error message.
13325
13326 2008-07-20 Chris Demetriou <cgd@google.com>
13327
13328 * configure.ac (gold_cv_c_random_seed): New configured variable.
13329 (RANDOM_SEED_CFLAGS): New substituted variable.
13330 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13331 * configure: Rebuild.
13332 * Makefile.in: Likewise.
13333 * testsuite/Makefile.in: Likewise.
13334
13335 2008-07-18 Ian Lance Taylor <iant@google.com>
13336
13337 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13338 where we see NAME/NULL and NAME/VERSION as separate symbols.
13339 * testsuite/ver_test_main.cc (main): Call t4.
13340 (t4, t4_2a): Define.
13341 * testsuite/ver_test_2.cc (t4_2): Define.
13342 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13343 * testsuite/ver_test_4.cc (t4_2a): Define.
13344 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13345 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13346
13347 2008-07-17 Ian Lance Taylor <iant@google.com>
13348
13349 * dynobj.cc (Versions::add_def): If we give an error about a
13350 missing version, go ahead and create the version anyhow.
13351
13352 2008-07-10 Ian Lance Taylor <iant@google.com>
13353
13354 Handle output sections with more than 0x7fffffff bytes.
13355 * object.h (class Relobj): Change map_to_output_ to
13356 output_sections_, and just keep a section pointer. Change all
13357 uses. Move comdat group support to Sized_relobj.
13358 (Relobj::is_section_specially_mapped): Remove.
13359 (Relobj::output_section): Remove poff parameter. Change all
13360 callers.
13361 (Relobj::output_section_offset): New function.
13362 (Relobj::set_section_offset): Rewrite.
13363 (Relobj::map_to_output): Remove.
13364 (Relobj::output_sections): New function.
13365 (Relobj::do_output_section_offset): New pure virtual function.
13366 (Relobj::do_set_section_offset): Likewise.
13367 (class Sized_relobj): Add section_offsets_ field. Add comdat
13368 group support from Relobj. Update declarations.
13369 (Sized_relobj::get_output_section_offset): New function.
13370 (Sized_relobj::do_output_section_offset): New function.
13371 (Sized_relobj::do_set_section_offset): New function.
13372 * object.cc (Relobj::output_section_address): Remove.
13373 (Sized_relobj::Sized_relobj): Initialize new fields.
13374 (Sized_relobj::include_section_group): Cast find_kept_object to
13375 Sized_relobj.
13376 (Sized_relobj::include_linkonce_section): Likewise.
13377 (Sized_relobj::do_layout): Use separate arrays for output section
13378 and output offset.
13379 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13380 output_sections.
13381 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13382 output_sections and section_offsets.
13383 (Sized_relobj::write_local_symbols): Likewise.
13384 (map_to_kept_section): Compute output address directly.
13385 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13386 output_sections and section_offsets.
13387 (Sized_relobj::write_sections): Likewise.
13388 (Sized_relobj::relocate_sections): Likewise.
13389 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13390 * output.h (class Output_reloc): Update declarations. Change
13391 u2_.relobj to Sized_relobj*.
13392 (class Output_data_reloc): Change add functions to use
13393 Sized_relobj*.
13394 * output.cc (Output_reloc::Output_reloc): Change relobj to
13395 Sized_relobj*.
13396 (Output_reloc::local_section_offset): Change return type to
13397 Elf_Addr. Use get_output_section_offset.
13398 (Output_reloc::get_address): Likewise.
13399 (Output_section::is_input_address_mapped): Don't call
13400 is_section_specially_mapped.
13401 (Output_section::output_offset): Likewise.
13402 (Output_section::output_address): Likewise.
13403 (Output_section::starting_output_address): Likewise.
13404 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13405 parameter to Sized_relobj*.
13406 (Copy_relocs::need_copy_reloc): Likewise.
13407 (Copy_relocs::save): Likewise.
13408 * copy-relocs.h (class Copy_relocs): Update declarations.
13409 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13410 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13411 * target-reloc.h (relocate_for_relocatable): Change
13412 offset_in_output_section type to Elf_Addr. Change code that uses
13413 it as well.
13414 * layout.cc (Layout::layout): Always set *off.
13415 * mapfile.cc (Mapfile::print_input_section): Use
13416 output_section_offset.
13417 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13418 Sized_relobj*.
13419 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13420 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13421 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13422
13423 2008-07-03 Ian Lance Taylor <iant@google.com>
13424
13425 * layout.cc (Layout::include_section): Do not discard unrecognized
13426 SHT_STRTAB sections.
13427
13428 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13429
13430 * script.cc (Lex::can_continue_name): Make '?' allowable in
13431 version-script names.
13432 * testsuite/version_script.map: Change glob pattern to use '?'
13433
13434 2008-06-30 Manish Singh <yosh@gimp.org>
13435
13436 PR 6585
13437 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13438 Correct typo.
13439
13440 2008-06-30 Ian Lance Taylor <iant@google.com>
13441
13442 PR 6660
13443 PR 6682
13444 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13445 versions]: Don't try to read the value in the contents, since we
13446 don't use it. Use the template endianness when writing.
13447
13448 2008-06-25 Cary Coutant <ccoutant@google.com>
13449
13450 * fileread.cc (File_read::make_view): Assert on zero-length view.
13451 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13452 symbol table when there are no symbols to read.
13453
13454 2008-06-23 Craig Silverstein <csilvers@google.com>
13455
13456 * version.cc (version_string): Bump to 1.7
13457
13458 2008-06-18 Craig Silverstein <csilvers@google.com>
13459
13460 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13461 constant 0xFFFF to type Valtype.
13462 (Powerpc_relocate_functions::rel16_ha): Likewise.
13463
13464 2008-06-17 Ian Lance Taylor <iant@google.com>
13465
13466 * output.h (Output_section::Input_section): Initialize p2align_ to
13467 zero for Output_section_data constructors.
13468 (Output_section::Input_section::addralign): If not an input
13469 section, return the alignment of the Output_section_data.
13470 * testsuite/copy_test.cc: New file.
13471 * testsuite/copy_test_1.cc: New file.
13472 * testsuite/copy_test_2.cc: New file.
13473 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13474 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13475 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13476 (copy_test_1_pic.o, copy_test_1.so): New targets.
13477 (copy_test_2_pic.o, copy_test_2.so): New targets.
13478 * testsuite/Makefile.in: Rebuild.
13479
13480 * script-sections.cc (Script_sections::place_orphan): Initialize
13481 local variable exact.
13482
13483 2008-06-13 David Edelsohn <edelsohn@gnu.org>
13484
13485 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13486
13487 2008-06-12 David Edelsohn <edelsohn@gnu.org>
13488 David S. Miller <davem@davemloft.net>
13489
13490 * powerpc.cc: New file.
13491 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13492 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13493 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13494 * Makefile.in: Rebuild.
13495
13496 2008-06-09 Ian Lance Taylor <iant@google.com>
13497
13498 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13499 <exception>.
13500 (throwing, orig_terminate): New static variables.
13501 (terminate_handler): New static function.
13502 (t2): Set terminate handler.
13503
13504 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13505
13506 PR 6584
13507 * binary.cc (Binary_to_elf::sized_convert): Fix .data
13508 alignment.
13509
13510 2008-05-30 Cary Coutant <ccoutant@google.com>
13511
13512 * archive.cc (Archive::include_all_members) Correct to step
13513 over symbol table and extended name table in thin archives.
13514
13515 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13516
13517 PR 6407
13518 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13519 calculation.
13520
13521 2008-05-28 Caleb Howe <cshowe@google.com>
13522
13523 * reduced_debug_output.cc: New file.
13524 * reduced_debug_output.h: New file.
13525 * options.h (class General_options): Add --strip-debug-non-line.
13526 * options.cc (General_options::finalize): Add strip_debug_non_line
13527 to the strip heirarchy.
13528 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13529 fields.
13530 * layout.cc: Include "reduced_debug_output.h".
13531 (Layout::Layout): Initialize new fields.
13532 (line_only_debug_sections): New static array.
13533 (is_lines_only_debug_sections): New static inline function.
13534 (Layout::include_section): Handle --strip-debug-non-line.
13535 (Layout::make_output_section): If --strip-debug-non-line, build
13536 new output sections for .debug_abbrev and .debug_info.
13537 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13538 gold. Warn about possible overflow.
13539 (read_signed_LEB_128): Likewise.
13540 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13541 (read_signed_LEB_128): Declare.
13542 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13543 (HFILES): Add reduced_debug_output.h.
13544 * Makefile.in: Rebuild.
13545
13546 2008-05-21 Ian Lance Taylor <iant@google.com>
13547
13548 * mapfile.cc: New file.
13549 * mapfile.h: New file.
13550 * options.h (class General_options): Add -M/--print-map and -Map.
13551 * options.cc (General_options::finalize): Make -M equivalent to
13552 -Map -.
13553 * main.cc: Include <cstdio> and "mapfile.h".
13554 (main): Open mapfile if requested.
13555 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13556 constructor. Change caller.
13557 (queue_initial_tasks): Add mapfile parameter. Change caller.
13558 (queue_middle_tasks): Likewise.
13559 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13560 declarations.
13561 * archive.cc: Include "mapfile.h".
13562 (Archive::add_symbols): Add mapfile parameter. Change all
13563 callers. Pass mapfile, symbol, and reason to include_member.
13564 (Archive::include_all_members): Add mapfile parameter. Change all
13565 callers.
13566 (Archive::include_member): Add mapfile, sym, and why parameters.
13567 Change all callers. Report inclusion to map file.
13568 * archive.h: Include "fileread.h".
13569 (class Archive): Update declarations.
13570 (Archive::file): New const method.
13571 (class Add_archive_symbols): Add mapfile_ field. Update
13572 constructor. Change all callers.
13573 * readsyms.h (class Read_symbols): Likewise.
13574 (class Finish_group): Likewise.
13575 (class Read_script): Likewise.
13576 * common.cc: Include "mapfile.h".
13577 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13578 all callers.
13579 (Symbol_table::do_allocate_commons): Likewise.
13580 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13581 symbol allocation to mapfile.
13582 * common.h (class Allocate_commons_task): Add mapfile_ field.
13583 Update constructor. Change all callers.
13584 * symtab.h (class Symbol_table): Update declarations.
13585 * layout.cc: Include "mapfile.h".
13586 (Layout_task_runner::run): Print information to mapfile.
13587 (Layout::create_gold_note): Change Output_data_fixed_space to
13588 Output_data_zero_fill.
13589 (Layout::create_build_id): Likewise.
13590 (Layout::print_to_mapfile): New function.
13591 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13592 constructor. Change caller.
13593 (class Layout): Declare print_to_mapfile.
13594 * output.cc (Output_section::Input_section::print_to_mapfile): New
13595 function.
13596 (Output_section::add_input_section): If producing a map, always
13597 add to input_sections_ list.
13598 (Output_section::do_print_to_mapfile): New function.
13599 (Output_segment::print_sections_to_mapfile): New function.
13600 (Output_segment::print_section_list_to_mapfile): New function.
13601 * output.h: Include "mapfile.h".
13602 (Output_data::print_to_mapfile): New function.
13603 (Output_data::do_print_to_mapfile): New virtual function.
13604 (Output_segment_headers::do_print_to_mapfile): New function.
13605 (Output_file_header::do_print_to_mapfile): New function.
13606 (Output_data_const::do_print_to_mapfile): New function.
13607 (class Output_data_const_buffer): Add map_name_ field. Update
13608 constructor. Change all callers. Add do_print_to_mapfile
13609 function.
13610 (class Output_data_fixed_space): Likewise.
13611 (class Output_data_space): Likewise.
13612 (class Output_data_zero_fill): New class.
13613 (Output_data_strtab::do_print_to_mapfile): New function.
13614 (Output_data_reloc_base::do_print_to_mapfile): New function.
13615 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13616 (Output_data_group::do_print_to_mapfile): New function.
13617 (Output_data_got::do_print_to_mapfile): New function.
13618 (Output_data_dynamic::do_print_to_mapfile): New function.
13619 (Output_symtab_xindex::do_print_to_mapfile): New function.
13620 (class Output_section): Declare do_print_to_mapflie. Declare
13621 print_to_mapfile in Input_section.
13622 (class Output_segment): Declare new functions.
13623 * object.h (Sized_relobj::symbol_count): New function.
13624 * script-sections.cc
13625 (Output_section_element_dot_assignment::set_section_addresses):
13626 Change Output_data_fixed_space to Output_data_zero_fill.
13627 (Output_data_expression::do_print_to_mapfile): New function.
13628 * script.cc (read_input_script): Add mapfile parameter. Change
13629 all callers.
13630 * script.h (read_input_script): Update declaration.
13631 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13632 (Eh_frame::do_print_to_mapfile): New function.
13633 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13634 (Output_merge_string::do_print_to_mapfile): New function.
13635 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13636 function.
13637 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13638 function.
13639 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13640 function.
13641 * Makefile.am (CCFILES): Add mapfile.cc.
13642 (HFILES): Add mapfile.h.
13643 * Makefile.in: Rebuild.
13644
13645 2008-05-19 Ian Lance Taylor <iant@google.com>
13646
13647 * options.h (class General_options): Add -z relro.
13648 * layout.cc (Layout::Layout): Initialize relro_segment_.
13649 (Layout::add_output_section_data): Return the output section.
13650 (Layout::make_output_section): Rcognize relro sections and mark
13651 them appropriately.
13652 (Layout::attach_allocated_section_to_segment): Put relro sections
13653 in a PT_GNU_RELRO segment.
13654 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13655 section as relro.
13656 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13657 PT_TLS segments.
13658 (Layout::linkonce_mapping): Map d.rel.ro.local to
13659 .data.rel.ro.local.
13660 (Layout::output_section_name): Us .data.rel.ro.local for any
13661 section which begins with that.
13662 * layout.h (class Layout): Update add_output_section_data
13663 declaration. Add relro_segment_ field.
13664 * output.cc (Output_section::Output_section): Initialize is_relro_
13665 and is_relro_local_ fields.
13666 (Output_segment::add_output_section): Group relro sections.
13667 (Output_segment::is_first_section_relro): New function.
13668 (Output_segment::maximum_alignment): If there is a relro section,
13669 align the segment to the common page size.
13670 (Output_segment::set_section_addresses): Track whether we are
13671 looking at relro sections. If the last section is a relro
13672 section, align to the common page size.
13673 (Output_segment::set_section_list_addresses): Add in_relro
13674 parameter. Change all callers. Align to the page size when
13675 moving from relro to non-relro section.
13676 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13677 segment.
13678 * output.h (class Output_section): Add is_relro_ and
13679 is_relro_local_ fields.
13680 (Output_section::is_relro): New function.
13681 (Output_section::set_is_relro): New function.
13682 (Output_section::is_relro_local): New function.
13683 (Output_section::set_is_relro_local): New function.
13684 (class Output_segment): Update declarations.
13685 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13686 * sparc.cc (Target_sparc::got_section): Likewise.
13687 * x86_64.cc (Target_x86_64::got_section): Likewise.
13688 * testsuite/relro_test_main.cc: New file.
13689 * testsuite/relro_test.cc: New file.
13690 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13691 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13692 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13693 (relro_test.so, relro_test_pic.o): New targets.
13694 * testsuite/Makefile.in: Rebuild.
13695
13696 2008-05-16 Ian Lance Taylor <iant@google.com>
13697
13698 * output.cc (Output_segment::add_output_section): Remove front
13699 parameter.
13700 * output.h (class Output_segment): Remove
13701 add_initial_output_section and overloaded add_output_section.
13702 Update declaration of remaining add_output_section.
13703 * layout.cc (Layout::create_interp): Call add_output_section
13704 rather than add_initial_output_section.
13705 (Layout::finish_dynamic_section): Likewise.
13706
13707 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13708 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13709 know the dynamic type.
13710 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13711 field. Initialize it in constructor.
13712 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13713 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13714 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13715 reloc.
13716
13717 * output.cc (Output_reloc::get_address): Change return type to
13718 Elf_Addr.
13719 * output.h (class Output_reloc): Update get_address declaration.
13720 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13721 for section addresses.
13722
13723 2008-05-09 Ian Lance Taylor <iant@google.com>
13724
13725 PR 6493
13726 * gold.cc (gold_nomem): Use return value of write.
13727
13728 2008-05-08 Ian Lance Taylor <iant@google.com>
13729
13730 * symtab.c (Symbol::init_base_output_data): Add version
13731 parameter. Change all callers.
13732 (Symbol::init_base_output_segment): Likewise.
13733 (Symbol::init_base_constant): Likewise.
13734 (Symbol::init_base_undefined): Likewise.
13735 (Sized_symbol::init_output_data): Likewise.
13736 (Sized_symbol::init_output_segment): Likewise.
13737 (Sized_symbol::init_constant): Likewise.
13738 (Sized_symbol::init_undefined): Likewise.
13739 (Symbol_table::do_define_in_output_data): If the new symbol has a
13740 version, mark it as the default.
13741 (Symbol_table::do_define_in_output_segment): Likewise.
13742 (Symbol_table::do_define_as_constant): Likewise.
13743 * symtab.h (class Symbol): Update declarations.
13744 (class Sized_symbol): Likewise.
13745 * resolve.cc (Symbol::override_version): New function.
13746 (Symbol::override_base): Call override_version.
13747 (Symbol::override_base_with_special): Likewise.
13748 * testsuite/ver_script_8.script: New file.
13749 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13750 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13751 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13752 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13753
13754 2008-05-06 Ian Lance Taylor <iant@google.com>
13755
13756 PR 6049
13757 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13758 functions.
13759 (class General_options): Remove existing --undefined, and add
13760 --no-undefined instead. Add new --undefined as synonym for -u.
13761 * archive.cc (Archive::add_symbols): Check whether symbol was
13762 named with -u.
13763 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13764 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13765 all uses. Add IS_UNDEFINED. Update declarations to split
13766 different versions of init_base. Declare init_base_undefined.
13767 (Symbol::is_defined): Handle IS_UNDEFINED.
13768 (Symbol::is_undefined): Likewise.
13769 (Symbol::is_weak_undefined): Call is_undefined.
13770 (Symbol::is_absolute): Handle IS_CONSTANT.
13771 (class Sized_symbol): Update declarations to split different
13772 versions of init. Declare init_undefined.
13773 (class Symbol_table): Declare new functions.
13774 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13775 Change all callers.
13776 (Symbol::init_base_output_data): Likewise.
13777 (Symbol::init_base_output_segment): Likewise.
13778 (Symbol::init_base_constant): Likewise.
13779 (Symbol::init_base_undefined): New function.
13780 (Sized_symbol::init_object): Rename from init. Change all
13781 callers.
13782 (Sized_symbol::init_output_data): Likewise.
13783 (Sized_symbol::init_output_segment): Likewise.
13784 (Sized_symbol::init_constant): Likewise.
13785 (Sized_symbol::init_undefined): New function.
13786 (Symbol_table::add_undefined_symbols_from_command_line): New
13787 function.
13788 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13789 function.
13790 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13791 (Symbol::output_section): Likewise.
13792 (Symbol::set_output_section): Likewise.
13793 (Symbol_table::sized_finalize_symbol): Likewise.
13794 (Symbol_table::sized_write_globals): Likewise.
13795 * resolve.cc (Symbol_table::should_override): Likewise.
13796 (Symbol::override_base_with_special): Likewise.
13797
13798 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13799 symbol, change it to have default visibility.
13800 * testsuite/protected_1.cc: New file.
13801 * testsuite/protected_2.cc: New file.
13802 * testsuite/protected_3.cc: New file.
13803 * testsuite/protected_main_1.cc: New file.
13804 * testsuite/protected_main_2.cc: New file.
13805 * testsuite/protected_main_3.cc: New file.
13806 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13807 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13808 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13809 (protected_1.so): New target.
13810 (protected_1_pic.o, protected_2_pic.o): New targets.
13811 (protected_3_pic.o): New target.
13812 (check_PROGRAMS): Add protected_2.
13813 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13814 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13815 * testsuite/Makefile.in: Rebuild.
13816
13817 * options.h (DEFINE_var): Add set_user_set_##varname__.
13818 (DEFINE_bool_alias): New macro.
13819 (class General_options): Define -Bstatic using DEFINE_bool_alias
13820 rather than DEFINE_special. Add --undefined as an alias for -z
13821 defs.
13822 * options.cc (General_options::parse_Bstatic): Remove.
13823
13824 * options.h (class General_options): Add --fatal-warnings.
13825 * main.cc (main): Implement --fatal-warnings.
13826 * errors.h (Errors::warning_count): New function.
13827
13828 * options.h (class General_options): Add -Bsymbolic-functions.
13829 * symtab.h (Symbol::is_preemptible): Check for
13830 -Bsymbolic-functions.
13831
13832 2008-05-05 Ian Lance Taylor <iant@google.com>
13833
13834 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13835 as noVARNAME rather than no-VARNAME.
13836 (class General_options): Add option -z combreloc.
13837 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13838 get_address.
13839 (Output_reloc::sort_before) [SHT_REL]: New function.
13840 (Output_reloc::sort_before) [SHT_RELA]: New function.
13841 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13842 Sort_relocs_comparison.
13843 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13844 parameter. Change all callers.
13845 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13846 sort_relocs parameter. Change all callers.
13847 * output.cc (Output_reloc::get_address): New function, broken out
13848 of write_rel.
13849 (Output_reloc::write_rel): Call it.
13850 (Output_reloc::compare): New function.
13851 (Output_data_reloc_base::do_write): Optionally sort relocs.
13852
13853 * configure.ac: If targ_extra_obj is set, link it in.
13854 * configure.tgt: Initialize all variables.
13855 (x86_64*): Set targ_extra_obj and targ_extra_size.
13856 * configure: Rebuild.
13857
13858 * object.cc (Sized_relobj::include_section_group): Adjust section
13859 indexes read from group data. Build vector to pass to
13860 layout_group.
13861 * layout.cc (Layout::layout_group): Add flags and shndxes
13862 parameters. Remove contents parameter. Change caller. Update
13863 explicit instantiations.
13864 * layout.h (class Layout): Update layout_group declaration.
13865 * output.cc (Output_data_group::Output_data_group): Add flags and
13866 input_shndxes parameters. Remove contents parameter. Change
13867 caller.
13868 (Output_data_group::do_write): Change input_sections_ to
13869 input_shndxes_.
13870 * output.h (class Output_data_group): Update constructor
13871 declaration. Rename input_sections_ to input_shndxes_.
13872 * testsuite/many_sections_test.cc: Add template.
13873
13874 2008-04-30 Cary Coutant <ccoutant@google.com>
13875
13876 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13877
13878 * layout.cc (Layout::include_section): Refactored check for debug
13879 info section.
13880 (Layout::add_comdat): Add new parameters. Change type
13881 of signature parameter. Add object and shndx to signatures table.
13882 (Layout::find_kept_object): New function.
13883 * layout.h: Include <cstring>.
13884 (Layout::is_debug_info_section): New function.
13885 (Layout::add_comdat): Add new parameters.
13886 (Layout::find_kept_object): New function.
13887 (Layout::Kept_section): New struct.
13888 (Layout::Signatures): Change type of map range.
13889 * object.cc (Relobj::output_section_address): New function.
13890 (Sized_relobj::include_section_group): Add new parameters. Change
13891 calls to Layout::add_comdat. Change to build table of kept comdat
13892 groups and table mapping discarded sections to kept sections.
13893 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13894 (Sized_relobj::do_layout): Change calls to include_section_group and
13895 include_linkonce_section.
13896 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13897 value to zero when section is discarded.
13898 (Sized_relobj::map_to_kept_section): New function.
13899 * object.h (Relobj::output_section_address): New function.
13900 (Relobj::Comdat_group): New type.
13901 (Relobj::find_comdat_group): New function.
13902 (Relobj::Comdat_group_table): New type.
13903 (Relobj::Kept_comdat_section): New type.
13904 (Relobj::Kept_comdat_section_table): New type.
13905 (Relobj::add_comdat_group): New function.
13906 (Relobj::set_kept_comdat_section): New function.
13907 (Relobj::get_kept_comdat_section): New function.
13908 (Relobj::comdat_groups_): New field.
13909 (Relobj::kept_comdat_sections_): New field.
13910 (Symbol_value::input_value): Update comment.
13911 (Sized_relobj::map_to_kept_section) New function.
13912 (Sized_relobj::include_linkonce_section): Add new parameter.
13913 * target-reloc.h (Comdat_behavior): New type.
13914 (get_comdat_behavior): New function.
13915 (relocate_section): Add code to map a discarded section to the
13916 corresponding kept section when applying a relocation.
13917
13918 2008-04-30 Craig Silverstein <csilvers@google.com>
13919
13920 * dwarf_reader.cc (next_generation_count): New static var.
13921 (Addr2line_cache_entry): New struct.
13922 (addr2line_cache): New static var.
13923 (Dwarf_line_info::one_addr2line): Added caching.
13924 (Dwarf_line_info::clear_addr2line_cache): New function.
13925 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13926 cache-size parameter.
13927 (Dwarf_line_info::one_addr2line_cache): New function.
13928 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13929 new cache-size argument to one_addr2line(), and clear cache.
13930
13931 2008-04-28 Cary Coutant <ccoutant@google.com>
13932
13933 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13934 R_386_PC8 relocations.
13935
13936 2008-04-23 Ian Lance Taylor <iant@google.com>
13937
13938 * object.cc (Sized_relobj::include_section_group): Check for
13939 invalid section group.
13940
13941 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13942 header size.
13943
13944 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13945 than read for file header.
13946 * archive.cc (Archive::include_member): Likewise.
13947
13948 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
13949
13950 * aclocal.m4: Regenerate.
13951 * configure: Regenerate.
13952
13953 2008-04-19 Ian Lance Taylor <iant@google.com>
13954
13955 * version.cc (version_string): Bump to 1.6.
13956
13957 * testsuite/Makefile.am (many_sections_r_test): New target.
13958 (many_sections_r_test_SOURCES): Remove.
13959 (many_sections_r_test_DEPENDENCIES): Remove.
13960 (many_sections_r_test_LDFLAGS): Remove.
13961 (many_sections_r_test_LDADD): Remove.
13962
13963 * object.cc (Sized_relobj::do_add_symbols): Always pass
13964 local_symbol_count_ to add_from_relobj.
13965
13966 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13967 every thousand variables.
13968 * testsuite/Makefile.in: Rebuild.
13969
13970 * object.cc (Xindex::initialize_symtab_xindex): New function.
13971 (Xindex::read_symtab_xindex): New function.
13972 (Xindex::sym_xindex_to_shndx): New function.
13973 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13974 available.
13975 (Sized_relobj::do_initialize_xindex): New function.
13976 (Sized_relobj::do_read_symbols): Adjust section links.
13977 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13978 parameter. Change all callers.
13979 (Sized_relobj::include_section_group): Adjust section links and
13980 symbol section indexes.
13981 (Sized_relobj::do_layout): Adjust section links.
13982 (Sized_relobj::do_count_local_symbols): Adjust section links and
13983 symbol section indexes.
13984 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13985 ordinary and special symbols.
13986 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13987 dynsym_xindex parameters. Change all callers. Adjust section
13988 links. Use SHN_XINDEX when needed.
13989 (Sized_relobj::get_symbol_location_info): Adjust section links.
13990 Don't get fooled by special symbols.
13991 * object.h (class Xindex): Define.
13992 (class Object): Add xindex_ parameter. Declare virtual functoin
13993 do_initialize_xindex.
13994 (Object::adjust_sym_shndx): New function.
13995 (Object::set_xindex): New protected function.
13996 (class Symbol_value): Add is_ordinary_shndx_ field.
13997 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13998 (Symbol_value::value): Assert ordinary section.
13999 (Symbol_value::initialize_input_to_output_map): Likewise.
14000 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14001 Change all callers.
14002 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14003 all callers.
14004 (class Sized_relobj): Update declarations.
14005 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14006 parameter. Change all callers.
14007 (Sized_relobj::adjust_shndx): New function.
14008 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14009 field.
14010 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14011 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14012 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14013 (Sized_dynobj::read_dynsym_section): Adjust section links.
14014 (Sized_dynobj::read_dynamic): Likewise.
14015 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14016 section links.
14017 (Sized_dynobj::do_initialize_xindex): New function.
14018 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14019 do_initialize_xindex.
14020 (Sized_dynobj::adjust_shndx): New function.
14021 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14022 dynsym_xindex_ fields.
14023 (Layout::finalize): Add a call to set_section_indexes before
14024 creating the symtab sections.
14025 (Layout::set_section_indexes): Don't do anything if the section
14026 already has a section index.
14027 (Layout::create_symtab_sections): Add shnum parameter. Change
14028 caller. Create .symtab_shndx section if needed.
14029 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14030 caller.
14031 (Layout::allocated_output_section_count): New function.
14032 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14033 needed.
14034 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14035 fields. Update declarations.
14036 (Layout::symtab_xindex): New function.
14037 (Layout::dynsym_xindex): New function.
14038 (class Write_symbols_task): Add layout_ field.
14039 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14040 Change caller.
14041 * output.cc (Output_section_headers::Output_section_headers): Add
14042 shstrtab_section parameter. Change all callers.
14043 (Output_section_headers::do_sized_write): Store overflow values
14044 for section count and section string table section index in
14045 section header zero.
14046 (Output_file_header::do_sized_write): Check for overflow of
14047 section count and section string table section index.
14048 (Output_symtab_xindex::do_write): New function.
14049 (Output_symtab_xindex::endian_do_write): New function.
14050 * output.h (class Output_section_headers): Add shstrtab_section_.
14051 Update declarations.
14052 (class Output_symtab_xindex): Define.
14053 (Output_section::has_out_shndx): New function.
14054 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14055 field.
14056 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14057 Change all callers.
14058 (Sized_symbol::init): Likewise.
14059 (Symbol::output_section): Check for ordinary symbol.
14060 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14061 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14062 callers.
14063 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14064 Change all callers. Simplify handling of symbols from sections
14065 not included in the link.
14066 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14067 distinction.
14068 (Weak_alias_sorter::operator()): Assert that symbols are
14069 ordinary.
14070 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14071 distinction.
14072 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14073 parameters. Change all callers.
14074 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14075 symbol distinction. Use SHN_XINDEX when needed.
14076 (Symbol_table::write_section_symbol): Add symtab_xindex
14077 parameter. Change all callers.
14078 (Symbol_table::sized_write_section_symbol): Likewise. Use
14079 SHN_XINDEX when needed.
14080 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14081 declarations.
14082 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14083 (Symbol::is_defined): Check is_ordinary.
14084 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14085 (Symbol::is_absolute, Symbol::is_common): Likewise.
14086 (class Sized_symbol): Update declarations.
14087 (class Symbol_table): Update declarations.
14088 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14089 parameters. Change all callers.
14090 (Sized_symbol::override): Likewise.
14091 (Symbol_table::override): Likewise.
14092 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14093 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14094 is_ordinary, and orig_st_shndx parameters. Change all callers.
14095 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14096 to be in an ordinary section.
14097 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14098 object and is_ordinary parameters. Change all callers.
14099 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14100 Change all callers. Don't add undefined or non-ordinary symbols
14101 to reloc_map_.
14102 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14103 Change all callers.
14104 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14105 declarations.
14106 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14107 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14108 (Sized_relobj::relocate_sections): Likewise.
14109 * target-reloc.h (scan_relocs): Adjust section symbol index.
14110 (scan_relocatable_relocs): Likewise.
14111 * i386.cc (Scan::local): Check for ordinary symbols.
14112 * sparc.cc (Scan::local): Likewise.
14113 * x86_64.cc (Scan::local): Likewise.
14114 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14115 to symbol_section_and_value.
14116 * testsuite/many_sections_test.cc: New file.
14117 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14118 (check_PROGRAMS): Add many_sections_test.
14119 (many_sections_test_SOURCES): Define.
14120 (many_sections_test_DEPENDENCIES): Define.
14121 (many_sections_test_LDFLAGS): Define.
14122 (BUILT_SOURCES): Add many_sections_define.h.
14123 (many_sections_define.h): New target.
14124 (BUILT_SOURCES): Add many_sections_check.h.
14125 (many_sections_check.h): New target.
14126 (check_PROGRAMS): Add many_sections_r_test.
14127 (many_sections_r_test_SOURCES): Define.
14128 (many_sections_r_test_DEPENDENCIES): Define.
14129 (many_sections_r_test_LDFLAGS): Define.
14130 (many_sections_r_test_LDADD): Define.
14131 (many_sections_r_test.o): New target.
14132 * testsuite/Makefile.in: Rebuild.
14133
14134 2008-04-17 Cary Coutant <ccoutant@google.com>
14135
14136 * errors.cc (Errors::info): New function.
14137 (gold_info): New function.
14138 * errors.h (Errors::info): New function.
14139 * gold.h (gold_info): New function.
14140 * object.cc (Input_objects::add_object): Print trace output.
14141 * options.cc (options::parse_set): New function.
14142 (General_options::parse_wrap): Deleted.
14143 (General_options::General_options): Deleted initializer.
14144 * options.h (options::String_set): New typedef.
14145 (options::parse_set): New function.
14146 (DEFINE_set): New macro.
14147 (General_options::wrap): Changed to use DEFINE_set. Changed
14148 callers of any_wrap_symbols and is_wrap_symbol.
14149 (General_options::trace, General_options::trace_symbol):
14150 New options.
14151 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14152 (General_options::wrap_symbols_): Deleted.
14153 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14154
14155 2008-04-17 David S. Miller <davem@davemloft.net>
14156
14157 * options.cc (General_options::parse_V): New function.
14158 * options.h: Add entries for -V and -Qy.
14159
14160 2008-04-17 Ian Lance Taylor <iant@google.com>
14161
14162 * common.cc (Symbol_table::allocate_commons): Remove options
14163 parameter. Change caller.
14164 (Symbol_table::do_allocate_commons): Remove options parameter.
14165 Change caller. Just call do_allocate_commons_list twice.
14166 (Symbol_table::do_allocate_commons_list): New function, broken out
14167 of do_allocate_commons.
14168 * common.h (class Allocate_commons_task): Remove options_ field.
14169 Update constructor.
14170 * symtab.cc (Symbol_table::Symbol_table): Initialize
14171 tls_commons_.
14172 (Symbol_table::add_from_object): Put TLS common symbols on
14173 tls_commons_ list.
14174 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14175 which are IN_OUTPUT_DATA.
14176 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14177 allocate_commons and do_allocate_commons declarations. Declare
14178 do_allocate_commons_list.
14179 * gold.cc (queue_middle_tasks): Update creation of
14180 Allocate_commons_task to not pass options.
14181 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14182 (TLS_TEST_C_FLAGS): New variable.
14183 (tls_test_c_pic.o): New target.
14184 (tls_test_shared.so): Link in tls_test_c_pic.o.
14185 (tls_test_c_pic_ie.o): New target.
14186 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14187 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14188 (tls_test_c.o): New target.
14189 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14190 (tls_pic_test_LDADD): Likewise.
14191 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14192 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14193 (tls_test_c_gnu2.o): New target.
14194 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14195 tls_test_c_gnu2.o.
14196 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14197 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14198 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14199 * testsuite/tls_test.cc: Include "config.h".
14200 (t_last): Call t11_last.
14201 * testsuite/tls_test.h (t11, t11_last): Declare.
14202 * testsuite/tls_test_c.c: New file.
14203 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14204 * configure.ac: Check for OpenMP support.
14205 * configure, config.in, Makefile.in: Rebuild.
14206 * testsuite/Makefile.in: Rebuild.
14207
14208 2008-04-16 Cary Coutant <ccoutant@google.com>
14209
14210 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14211 (Target_i386::tls_base_symbol_defined_): New field.
14212 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14213 (Target_i386::Scan::global): Likewise.
14214 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14215 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14216 (Target_x86_64::tls_base_symbol_defined_): New field.
14217 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14218 (Target_x86_64::Scan::global): Likewise.
14219
14220 2008-04-16 Cary Coutant <ccoutant@google.com>
14221
14222 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14223 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14224 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14225 building shared libraries.
14226 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14227 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14228 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14229 * testsuite/Makefile.in: Rebuild.
14230 * testsuite/weak_undef.h: New file.
14231 * testsuite/weak_undef_file1.cc: Add extra test cases.
14232 * testsuite/weak_undef_file2.cc: Likewise.
14233 * testsuite/weak_undef_test.cc: Likewise.
14234
14235 2008-04-16 David S. Miller <davem@davemloft.net>
14236
14237 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14238 Add issued_non_pic_error_ field. Declare check_non_pic.
14239 (Target_sparc::Scan::check_non_pic): New function.
14240 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14241 (Target_sparc::Scan::global): Likewise.
14242
14243 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14244 * configure: Rebuild.
14245
14246 * options.h (DEFINE_enable): New macro.
14247 (new_dtags): New enable option.
14248 (initfirst, interpose, loadfltr, nodefaultlib,
14249 nodelete, nodlopen, nodump): New -z options.
14250 * layout.cc (Layout:finish_dynamic_section): If new
14251 dtags enabled, emit DT_RUNPATH. Also, emit a
14252 DT_FLAGS_1 containing any specified -z flags.
14253
14254 2008-04-16 Ian Lance Taylor <iant@google.com>
14255
14256 * copy-relocs.cc: New file.
14257 * copy-relocs.h: New file.
14258 * reloc.cc: Remove Copy_relocs code.
14259 * reloc.h: Likewise.
14260 * reloc-types.h (struct Reloc_types) [both versions]: Add
14261 get_reloc_addend_noerror.
14262 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14263 variants of add_global which take an addend which must be zero.
14264 * i386.cc: Include "copy-relocs.h".
14265 (class Target_i386): Change type of copy_relocs_ to variable,
14266 update initializer.
14267 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14268 Change all callers.
14269 (Target_i386::do_finalize_sections): Change handling of
14270 copy_relocs_.
14271 * sparc.cc: Include "copy-relocs.h".
14272 (class Target_sparc): Change type of copy_relocs_ to variable,
14273 update initializer.
14274 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14275 Change all callers.
14276 (Target_sparc::do_finalize_sections): Change handling of
14277 copy_relocs_.
14278 * x86_64.cc: Include "copy-relocs.h".
14279 (class Target_x86_64): Change type of copy_relocs_ to variable,
14280 update initializer.
14281 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14282 class. Change all callers.
14283 (Target_x86_64::do_finalize_sections): Change handling of
14284 copy_relocs_.
14285 * Makefile.am (CCFILES): Add copy-relocs.cc.
14286 (HFILES): Add copy-relocs.h.
14287
14288 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14289
14290 * testsuite/script_test_4.sh: Permit leading zeroes.
14291
14292 2008-04-15 Ian Lance Taylor <iant@google.com>
14293
14294 * script-sections.cc (Script_sections::create_segments): Use
14295 header_size_adjustment even when there is enough room for the
14296 headers.
14297 * testsuite/script_test_4.sh: New file.
14298 * testsuite/script_test_4.t: New file.
14299 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14300 (check_DATA): Add script_test_4.stdout.
14301 (MOSTLYCLEANFILES): Likewise.
14302 (script_test_4): New target.
14303 (script_test_4.stdout): New target.
14304 * testsuite/Makefile.in: Rebuild.
14305
14306 * sparc.cc: Add definitions for Output_data_plt_sparc class
14307 constants.
14308
14309 2008-04-14 David S. Miller <davem@davemloft.net>
14310
14311 * sparc.cc: New file.
14312 * Makefile.am (TARGETSOURCES): Add sparc.cc
14313 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14314 * configure.tgt: Document targ_extra_size and
14315 targ_extra_big_endian. Add entries for sparc-* and
14316 sparc64-*.
14317 * configure.ac: Handle targ_extra_size and
14318 targ_extra_big_endian.
14319 * Makefile.in: Rebuild.
14320 * configure: Likewise.
14321 * po/POTFILES.in: Likewise.
14322 * po/gold.pot: Likewise.
14323
14324 2008-04-14 Ian Lance Taylor <iant@google.com>
14325
14326 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14327 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14328 in the name/type/flags to section mapping. Don't call
14329 allocate_output_section.
14330 (Layout::choose_output_section): Change parameter from adjust_name
14331 to is_input_section. Don't permit input sections after sections
14332 are attached to segments. Don't call allocate_output_section.
14333 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14334 not write_enable_output_section.
14335 (Layout::make_output_section): Don't push to
14336 unattached_section_list_ nor call attach_to_segment. Call
14337 attach_section_to_segment if sections are attached.
14338 (Layout::attach_sections_to_segments): New function.
14339 (Layout::attach_section_to_segment): New function.
14340 (Layout::attach_allocated_section_to_segment): Rename from
14341 attach_to_segment. Remove flags parameter.
14342 (Layout::allocate_output_section): Remove function.
14343 (Layout::write_enable_output_section): Remove function.
14344 * layout.h (class Layout): Update for above changes. Add new
14345 field sections_are_attached_.
14346 * output.h (Output_section::update_flags_for_input_section): New
14347 function.
14348 * output.cc (Output_section::add_input_section): Call
14349 update_flags_for_input_section.
14350 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14351
14352 2008-04-11 Cary Coutant <ccoutant@google.com>
14353
14354 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14355 thought unnecessary.
14356 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14357
14358 2008-04-11 Ian Lance Taylor <iant@google.com>
14359
14360 * output.h (class Output_section_data): Remove inline definition
14361 of set_addralign.
14362 * output.cc (Output_section_data::set_addralign): New function.
14363
14364 2008-04-11 Cary Coutant <ccoutant@google.com>
14365
14366 Add support for TLS descriptors for i386 and x86_64.
14367 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14368 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14369 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14370 GOT_TYPE_TLS_DESC.
14371 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14372 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14373 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14374 relocations.
14375 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14376 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14377 Fix problem with initial-exec relocations.
14378 (Target_i386::Relocate::relocate_tls): Likewise.
14379 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14380 relaxation.
14381 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14382 support for section-plus-offset dynamic table entries.
14383 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14384 (Output_data_dynamic::Dynamic_entry): Add support for
14385 section-plus-offset dynamic table entries.
14386 (Output_data_dynamic::Classification): Likewise.
14387 (Output_data_dynamic::classification_): Renamed offset_.
14388 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14389 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14390 (Target_x86_64::make_plt_section): New function.
14391 (Target_x86_64::reserve_tlsdesc_entries): New function.
14392 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14393 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14394 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14395 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14396 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14397 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14398 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14399 add extra PLT entry for TLS descriptors.
14400 (Output_data_plt_x86_64::got_): New field.
14401 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14402 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14403 fields.
14404 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14405 descriptors.
14406 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14407 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14408 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14409 R_386_TLS_DESC_CALL relocations.
14410 (Target_x86_64::Scan::global): Likewise.
14411 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14412 for TLS descriptors.
14413 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14414 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14415 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14416 GD-to-IE relaxation.
14417 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14418 and TLS_DESCRIPTORS.
14419 * Makefile.in: Rebuild.
14420 * configure: Rebuild.
14421 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14422 (tls_test_shared2.so): New target.
14423 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14424 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14425 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14426 (tls_shared_gd_to_ie_test_LDADD): New variable.
14427 (tls_shared_gnu2_gd_to_ie_test): New target.
14428 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14429 New targets.
14430 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14431 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14432 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14433 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14434 (tls_shared_gnu2_test): New target.
14435 (tls_test_gnu2_shared.so): New target.
14436 (tls_shared_gnu2_test_SOURCES): New variable.
14437 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14438 (tls_shared_gnu2_test_LDFLAGS): New variable.
14439 (tls_shared_gnu2_test_LDADD): New variable.
14440 * testsuite/Makefile.in: Rebuild.
14441 * testsuite/Makefile.
14442
14443 2008-04-11 Ian Lance Taylor <iant@google.com>
14444
14445 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14446 justsyms.t.
14447 * testsuite/Makefile.in: Rebuild.
14448
14449 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14450 long.
14451 * testsuite/script_test_2.cc (main): Adjust test.
14452
14453 2008-04-11 David S. Miller <davem@davemloft.net>
14454 Ian Lance Taylor <iant@google.com>
14455
14456 * options.h (General_options): Add entries for '-Y' and
14457 '-relax'.
14458 * options.cc (General_options:finalize): If -Y was used, add those
14459 entries to the library path instead of the default "/lib" and
14460 "/usr/lib".
14461
14462 2008-04-11 David S. Miller <davem@davemloft.net>
14463
14464 * testsuite/justsyms.t: Start at 0x100.
14465 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
14466 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14467 long.
14468 * testsuite/script_test_2.cc: Adjust string and section length
14469 checks.
14470
14471 2008-04-09 Ian Lance Taylor <iant@google.com>
14472
14473 PR gold/5996
14474 * script-sections.cc (Sections_element::allocate_to_segment): Add
14475 orphan parameter.
14476 (Output_section_definition::allocate_to_segment): Likewise.
14477 (Orphan_output_section::allocate_to_segment): Likewise.
14478 (Script_sections::attach_sections_using_phdrs_clause): Don't
14479 propagate non-PT_LOAD segments to orphan sections.
14480 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14481 readelf rather than objdump.
14482 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14483 .interp section and PT_INTERP segment are the same size.
14484 * testsuite/Makefile.in: Rebuild.
14485
14486 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14487 aliases for symbols defined in the same object.
14488 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14489 (weak_alias_test_SOURCES): New variable.
14490 (weak_alias_test_DEPENDENCIES): New variable.
14491 (weak_alias_test_LDFLAGS): New variable.
14492 (weak_alias_test_LDADD): New variable.
14493 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14494 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14495 (weak_alias_test_3.o): New target.
14496 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14497 * testsuite/weak_alias_test_main.cc: New file.
14498 * testsuite/weak_alias_test_1.cc: New file.
14499 * testsuite/weak_alias_test_2.cc: New file.
14500 * testsuite/weak_alias_test_3.cc: New file.
14501
14502 2008-04-08 Ian Lance Taylor <iant@google.com>
14503
14504 * options.h (class General_options): Add --noinhibit-exec option.
14505 * main.cc (main): Check --noinhibit-exec.
14506
14507 * options.h (class General_options): Define --wrap as a special
14508 option. Add wrap_symbols_ field.
14509 (General_options::any_wrap_symbols): New function.
14510 (General_options::is_wrap_symbol): New function.
14511 * options.cc (General_options::parse_wrap): New function.
14512 (General_options::General_options): Initialize wrap_symbols_.
14513 * symtab.cc (Symbol_table::wrap_symbol): New function.
14514 (Symbol_table::add_from_object): Handle --wrap.
14515 * symtab.h (class Symbol_table): Declare wrap_symbol.
14516 * target.h (Target::wrap_char): New function.
14517 (Target::Target_info): Add wrap_char field.
14518 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14519 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14520 * testsuite/testfile.cc (Target_test::test_target_info):
14521 Likewise.
14522
14523 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14524 there is one.
14525
14526 * layout.h (class Layout): Add added_eh_frame_data_ field.
14527 * layout.cc (Layout::Layout): Initialize new field.
14528 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14529 output section until we find a section we merged successfully.
14530 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14531 that the size be non-zero.
14532
14533 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14534 qualifier.
14535
14536 2008-04-08 Craig Silverstein <csilvers@google.com>
14537
14538 * configure.ac: Export new conditional variable HAVE_ZLIB.
14539 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14540 on HAVE_ZLIB.
14541 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14542 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14543
14544 2008-04-07 Ian Lance Taylor <iant@google.com>
14545
14546 * version.cc (version_string): Set to "1.5".
14547
14548 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14549 Add issued_non_pic_error_ field. Declare check_non_pic.
14550 (Target_x86_64::Scan::check_non_pic): New function.
14551 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14552 (Target_x86_64::Scan::global): Likewise.
14553
14554 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14555 addend parameter. Change caller. Handle merge sections.
14556 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14557 Address to Addend. Don't add in the result of
14558 local_section_offset, pass down the addend and use the returned
14559 value.
14560 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14561 Update declarations of local_section_offset and symbol_value.
14562 * testsuite/two_file_test_1.cc (t18): New function.
14563 * testsuite/two_file_test_2.cc (f18): New function.
14564 * testsuite/two_file_test_main.cc (main): Call t18.
14565 * testsuite/two_file_test.h (t18, f18): Declare.
14566
14567 * configure.ac: Don't test for objdump, c++filt, or readelf.
14568 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14569 conditionals.
14570 (TEST_READELF): New variable.
14571 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14572 (check_PROGRAMS): Add two_file_strip_test.
14573 (two_file_strip_test): New target.
14574 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14575 (two_file_same_shared_strip_test_SOURCES): New variable.
14576 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14577 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14578 (two_file_same_shared_strip_test_LDADD): New variable.
14579 (two_file_shared_strip.so): New target.
14580 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14581 (ver_test_5.syms, ver_test_7.syms): Likewise.
14582 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14583 (strip_test_3.stdout): Use TEST_OBJDUMP.
14584 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14585
14586 2008-04-04 Cary Coutant <ccoutant@google.com>
14587
14588 * symtab.h (Symbol::is_weak_undefined): New function.
14589 (Symbol::is_strong_undefined): New function.
14590 (Symbol::is_absolute): New function.
14591 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14592 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14593 absolute symbols.
14594 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14595 (weak_undef_test): New target.
14596 * testsuite/Makefile.in: Rebuild.
14597 * testsuite/weak_undef_file1.cc: New file.
14598 * testsuite/weak_undef_file2.cc: New file.
14599 * testsuite/weak_undef_test.cc: New file.
14600
14601 2008-04-03 Craig Silverstein <csilvers@google.com>
14602
14603 * compressed_output.h (class Output_compressed_section): Use
14604 unsigned buffer.
14605 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14606 add zlib header.
14607 (zlib_compressed_suffix): Removed.
14608 (Output_compressed_section::set_final_data_size): Use unsigned
14609 buffers.
14610 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14611 Fix linker invocation.
14612 (flagstest_o_specialfile_and_compress_debug_sections):
14613 Likewise.
14614 * testsuite/Makefile.in: Regenerated.
14615
14616 2008-04-02 David S. Miller <davem@davemloft.net>
14617
14618 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14619 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14620
14621 2008-04-02 Craig Silverstein <csilvers@google.com>
14622
14623 * TODO: New file.
14624
14625 2008-04-02 Ian Lance Taylor <iant@google.com>
14626
14627 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14628 parameters. Update for new key type to views_. Change all
14629 callers.
14630 (File_read::read): Adjust for byteshift in returned view.
14631 (File_read::add_view): New function, broken out of
14632 find_and_make_view.
14633 (File_read::make_view): New function, broken out of
14634 find_and_make_view.
14635 (File_read::find_or_make_view): Add offset and aligned
14636 parameters. Rewrite accordingly. Change all callers.
14637 (File_read::get_view): Add offset and aligned parameters. Adjust
14638 for byteshift in return value.
14639 (File_read::get_lasting_view): Likewise.
14640 * fileread.h (class File_read): Update declarations.
14641 (class File_read::View): Add byteshift_ field. Add byteshift to
14642 constructor. Add byteshift method.
14643 * archive.h (Archive::clear_uncached_views): New function.
14644 (Archive::get_view): Add aligned parameter. Change all callers.
14645 * object.h (Object::get_view): Add aligned parameter. Change all
14646 callers.
14647 (Object::get_lasting_view): Likewise.
14648
14649 * fileread.cc (File_read::release): Don't call clear_views if
14650 there are multiple objects.
14651 * fileread.h (File_read::clear_uncached_views): New function.
14652 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14653 on the archive.
14654
14655 2008-03-31 Cary Coutant <ccoutant@google.com>
14656
14657 Add thin archive support.
14658 * archive.cc (Archive::armagt): New const.
14659 (Archive::setup): Remove task parameter and calls to unlock.
14660 (Archive::unlock_nested_archives): New function.
14661 (Archive::read_header): Add nested_off parameter. Change
14662 all callers.
14663 (Archive::interpret_header): Likewise.
14664 (Archive::include_all_members): Change to handle thin
14665 archives.
14666 (Archive::include_member): Likewise.
14667 * archive.h (Archive::Archive): Add new parameters and
14668 initializers.
14669 (Archive::armagt): New const.
14670 (Archive::setup): Remove task parameter.
14671 (Archive::unlock_nested_archives): New function.
14672 (Archive::read_header): Add nested_off parameter.
14673 (Archive::interpret_header): Likewise.
14674 (Archive::Nested_archive_table): New typedef.
14675 (Archive::is_thin_archive_): New field.
14676 (Archive::nested_archives_): New field.
14677 (Archive::options_): New field.
14678 (Archive::dirpath_): New field.
14679 (Archive::task_): New field.
14680 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14681 for thin archives. Pass additional parameters to
14682 Archive::Archive. Unlock the archive file after calling
14683 Archive::setup.
14684
14685 2008-03-29 Ian Lance Taylor <iant@google.com>
14686
14687 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14688 version symbol to be local.
14689 * testsuite/ver_test_4.sh: New file.
14690 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14691 (check_DATA): Add ver_test_4.syms.
14692 (ver_test_4.syms): New target.
14693 * testsuite/Makefile.in: Rebuild.
14694
14695 * output.cc
14696 (Output_section::Input_section_sort_entry::has_priority): New
14697 function.
14698 (Output_section::Input_section_sort_entry::match_file_name): New
14699 function.
14700 (Output_section::Input_section_sort_entry::match_section_name):
14701 Remove.
14702 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14703 Remove.
14704 (Output_section::Input_section_sort_entry::match_section_file):
14705 Remove.
14706 (Output_section::Input_section_sort_compare::operator()): Rewrite
14707 using new Input_section_sort_entry functions. Sort crtbegin and
14708 crtend first. Sort sections with no priority before sections with
14709 a priority.
14710 * testsuite/initpri1.c (d3): Check j != 4.
14711 (cd5): New constructor/destructor function.
14712 (main): Check j != 2.
14713
14714 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14715 new symbol when resolving, don't call set_is_default.
14716 * testsuite/ver_test_7.cc: New file.
14717 * testsuite/ver_test_7.sh: New file.
14718 * testsuite/Makefile.am (ver_test_7.so): New target.
14719 (ver_test_7.o): New target.
14720 (check_SCRIPTS): Add ver_test_7.sh.
14721 (check_DATA): Add ver_test_7.syms.
14722 (ver_test_7.syms): New target.
14723
14724 2008-03-28 Ian Lance Taylor <iant@google.com>
14725
14726 * layout.cc (Layout::layout): If we see an input section with a
14727 name that needs sorting, set the must_sort flag for the output
14728 section.
14729 (Layout::make_output_section): If the name of the output section
14730 indicates that it might require sorting, set the may_sort flag.
14731 * output.h (Output_section::may_sort_attached_input_sections): New
14732 function.
14733 (Output_section::set_may_sort_attached_input_sections): New
14734 function.
14735 (Output_section::must_sort_attached_input_sections): New
14736 function.
14737 (Output_section::set_must_sort_attached_input_sections): New
14738 function.
14739 (class Output_section): Declare Input_section_sort_entry. Define
14740 Input_section_sort_compare. Declare
14741 sort_attached_input_sections. Add new fields:
14742 may_sort_attached_input_sections_,
14743 must_sort_attached_input_sections_,
14744 attached_input_sections_are_sorted_.
14745 * output.cc (Output_section::Output_section): Initialize new
14746 fields.
14747 (Output_section::add_input_section): Add an entry to
14748 input_sections_ if may_sort or must_sort are true.
14749 (Output_section::set_final_data_size): Call
14750 sort_attached_input_sections if necessary.
14751 (Output_section::Input_section_sort_entry): Define new class.
14752 (Output_section::Input_section_sort_compare::operator()): New
14753 function.
14754 (Output_section::sort_attached_input_sections): New function.
14755 * configure.ac: Check whether the compiler supports constructor
14756 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14757 * testsuite/initpri1.c: New file.
14758 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14759 CONSTRUCTOR_PRIORITY.
14760 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14761 (initpri1_LDFLAGS): New variable.
14762 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14763
14764 2008-03-27 Ian Lance Taylor <iant@google.com>
14765
14766 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14767 * testsuite/common_test_1.c: New file.
14768 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14769 (common_test_1_SOURCES): New variable.
14770 (common_test_1_DEPENDENCIES): New variable.
14771 (common_test_1_LDFLAGS): New variable.
14772
14773 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14774 and commons_ correctly when NAME/VERSION does not override
14775 NAME/NULL.
14776 * testsuite/ver_test_6.c: New file.
14777 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14778 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14779 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14780
14781 2008-03-26 Ian Lance Taylor <iant@google.com>
14782
14783 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14784 of an undefined symbol from a version script.
14785 * testsuite/Makefile.am (ver_test_5.so): New target.
14786 (ver_test_5.o): New target.
14787 (check_SCRIPTS): Add ver_test_5.sh.
14788 (check_DATA): Add ver_test_5.syms.
14789 (ver_test_5.syms): New target.
14790 * testsuite/ver_test_5.cc: New file.
14791 * testsuite/ver_test_5.script: New file.
14792 * testsuite/ver_test_5.sh: New file.
14793 * Makefile.in, testsuite/Makefile.in: Rebuild.
14794
14795 PR gold/5986
14796 Fix problems building gold with gcc 4.3.0.
14797 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14798 (gold_error_at_location, gold_warning_at_location): Use it.
14799 * configure.ac: Check whether we can compile and use a template
14800 function with a printf attribute.
14801 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14802 when jumping over bytes.
14803 * object.cc: Instantiate Object::read_section_data.
14804 * debug.h: Include <cstring>
14805 * dwarf_reader.cc: Include <algorithm>
14806 * main.cc: Include <cstring>.
14807 * options.cc: Include <cstring>.
14808 * output.cc: Include <cstring>.
14809 * script.cc: Include <cstring>.
14810 * script.h: Include <string>.
14811 * symtab.cc: Include <cstring> and <algorithm>.
14812 * target-select.cc: Include <cstring>.
14813 * version.cc: Include <string>.
14814 * testsuite/testmain.cc: Include <cstdlib>.
14815 * configure, config.in: Rebuild.
14816
14817 2008-03-25 Ian Lance Taylor <iant@google.com>
14818
14819 * options.cc: Include "../bfd/bfdver.h".
14820 (options::help): Print bug reporting address.
14821
14822 * version.cc (print_version): Adjust output for current value of
14823 BFD_VERSION_STRING.
14824
14825 * NEWS: New file.
14826
14827 * options.cc (options::help): Print list of supported targets.
14828 * target-select.h: Include <vector>.
14829 (class Target_selector): Make machine_, size_, and is_big_endian_
14830 fields const. Add bfd_name_ and instantiated_target_ fields.
14831 (Target_selector::Target_selector): Add bfd_name parameter.
14832 (Target_selector::recognize): Make non-virtual, call
14833 do_recognize.
14834 (Target_selector::recognize_by_name): Make non-virtual, call
14835 do_recognize_by_name.
14836 (Target_selector::supported_names): New function.
14837 (Target_selector::bfd_name): New function.
14838 (Target_selector::do_instantiate_target): New pure virtual
14839 function.
14840 (Target_selector::do_recognize): New virtual function.
14841 (Target_selector::do_recognize_by_name): New virtual function.
14842 (Target_selector::instantiate_target): New private function.
14843 (supported_target_names): Declare.
14844 * target-select.cc (Target_selector::Target_selector): Update for
14845 new parameter and fields.
14846 (select_target_by_name): Check that the name matches before
14847 calling recognize_by_name.
14848 (supported_target_names): New function.
14849 * i386.cc (class Target_selector_i386): Update Target_selector
14850 constructor call. Remove recognize and recognize_by_name. Add
14851 do_instantiate_target.
14852 * x86_64.cc (class Target_selector_x86_64): Likewise.
14853 * testsuite/testfile.cc (class Target_selector_test): Update for
14854 changes to Target_selector.
14855
14856 * README: Rewrite, with some notes on unsupported features.
14857
14858 2008-03-24 Cary Coutant <ccoutant@google.com>
14859
14860 * i386.cc (Target_i386::Got_type): New enum declaration.
14861 (Target_i386::Scan::local): Updated callers of Output_data_got
14862 member functions.
14863 (Target_i386::Scan::global): Likewise.
14864 (Target_i386::Relocate::relocate): Likewise.
14865 (Target_i386::Relocate::relocate_tls): Likewise.
14866 * object.h (Got_offset_list): New class.
14867 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14868 (Sized_relobj::local_got_offset): Likewise.
14869 (Sized_relobj::set_local_got_offset): Likewise.
14870 (Sized_relobj::local_has_tls_got_offset): Removed.
14871 (Sized_relobj::local_tls_got_offset): Removed.
14872 (Sized_relobj::set_local_tls_got_offset): Removed.
14873 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14874 * output.cc (Output_data_got::add_global): Added got_type parameter.
14875 (Output_data_got::add_global_with_rel): Likewise.
14876 (Output_data_got::add_global_with_rela): Likewise.
14877 (Output_data_got::add_global_pair_with_rel): New function.
14878 (Output_data_got::add_global_pair_with_rela): New function.
14879 (Output_data_got::add_local): Added got_type parameter.
14880 (Output_data_got::add_local_with_rel): Likewise.
14881 (Output_data_got::add_local_with_rela): Likewise.
14882 (Output_data_got::add_local_pair_with_rel): New function.
14883 (Output_data_got::add_local_pair_with_rela): New function.
14884 (Output_data_got::add_global_tls): Removed.
14885 (Output_data_got::add_global_tls_with_rel): Removed.
14886 (Output_data_got::add_global_tls_with_rela): Removed.
14887 (Output_data_got::add_local_tls): Removed.
14888 (Output_data_got::add_local_tls_with_rel): Removed.
14889 (Output_data_got::add_local_tls_with_rela): Removed.
14890 * output.h (Output_data_got::add_global): Added got_type parameter.
14891 (Output_data_got::add_global_with_rel): Likewise.
14892 (Output_data_got::add_global_with_rela): Likewise.
14893 (Output_data_got::add_global_pair_with_rel): New function.
14894 (Output_data_got::add_global_pair_with_rela): New function.
14895 (Output_data_got::add_local): Added got_type parameter.
14896 (Output_data_got::add_local_with_rel): Likewise.
14897 (Output_data_got::add_local_with_rela): Likewise.
14898 (Output_data_got::add_local_pair_with_rel): New function.
14899 (Output_data_got::add_local_pair_with_rela): New function.
14900 (Output_data_got::add_global_tls): Removed.
14901 (Output_data_got::add_global_tls_with_rel): Removed.
14902 (Output_data_got::add_global_tls_with_rela): Removed.
14903 (Output_data_got::add_local_tls): Removed.
14904 (Output_data_got::add_local_tls_with_rel): Removed.
14905 (Output_data_got::add_local_tls_with_rela): Removed.
14906 * resolve.cc (Symbol::override_base_with_special): Removed
14907 reference to has_got_offset_ field.
14908 * symtab.cc (Symbol::init_fields): Replaced initialization
14909 of got_offset_ with got_offsets_. Removed initialization
14910 of has_got_offset_
14911 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
14912 (Symbol::got_offset): Likewise.
14913 (Symbol::set_got_offset): Likewise.
14914 (Symbol::has_tls_got_offset): Removed.
14915 (Symbol::tls_got_offset): Removed.
14916 (Symbol::set_tls_got_offset): Removed.
14917 (Symbol::got_offset_): Removed.
14918 (Symbol::tls_mod_got_offset_): Removed.
14919 (Symbol::tls_pair_got_offset_): Removed.
14920 (Symbol::got_offsets_): New field.
14921 (Symbol::has_got_offset): Removed.
14922 (Symbol::has_tls_mod_got_offset): Removed.
14923 (Symbol::has_tls_pair_got_offset): Removed.
14924 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14925 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14926 member functions.
14927 (Target_x86_64::Scan::global): Likewise.
14928 (Target_x86_64::Relocate::relocate): Likewise.
14929 (Target_x86_64::Relocate::relocate_tls): Likewise.
14930
14931 2008-03-25 Ben Elliston <bje@au.ibm.com>
14932
14933 * yyscript.y: Fix spelling error in comment.
14934
14935 2008-03-24 Ian Lance Taylor <iant@google.com>
14936
14937 * options.h (class General_options): Define build_id option.
14938 * layout.h (class Layout): Declare write_build_id, create_note,
14939 create_build_id. Add build_id_note_ member.
14940 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14941 "libiberty.h", "md5.h", "sha1.h".
14942 (Layout::Layout): Initialize eh_frame_data_,
14943 eh_frame_hdr_section_, and build_id_note_.
14944 (Layout::finalize): Call create_build_id.
14945 (Layout::create_note): New function, broken out of
14946 Layout::create_gold_note.
14947 (Layout::create_gold_note): Call create_note.
14948 (Layout::create_build_id): New function.
14949 (Layout::write_build_id): New function.
14950 (Close_task_runner::run): Call write_build_id.
14951
14952 * x86_64.cc: Correct license to GPLv3.
14953
14954 2008-03-23 Ian Lance Taylor <iant@google.com>
14955
14956 * options.cc: Include "demangle.h".
14957 (parse_optional_string): New function.
14958 (parse_long_option): Handle takes_optional_argument.
14959 (parse_short_option): Update dash_z initializer. Handle
14960 takes_optional_argument.
14961 (General_options::General_options): Initialize do_demangle_.
14962 (General_options::finalize): Set do_demangle_. Handle demangling
14963 style.
14964 * options.h (parse_optional_string): Declare.
14965 (struct One_option): Add optional_arg field. Update constructor.
14966 Update call constructor calls. Add takes_optional_argument
14967 function.
14968 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14969 (DEFINE_optional_string): Define.
14970 (General_options::demangle): Change from DEFINE_bool to
14971 DEFINE_optional_string.
14972 (General_options::no_demangle): New function.
14973 (General_options::do_demangle): New function.
14974 (General_options::set_do_demangle): New function.
14975 (General_options::execstack_status_): Move definition to end of
14976 class definition.
14977 (General_options::static_): Likewise.
14978 (General_options::do_demangle_): New field.
14979 * object.cc (big_endian>::get_symbol_location_info): Call
14980 Options::do_demangle, not Options::demangle.
14981 * symtab.cc (demangle): Likewise.
14982
14983 2008-03-22 Ian Lance Taylor <iant@google.com>
14984
14985 * gold.h: Include <cstddef> and <sys/types.h>
14986 * options.h: Include <cstring>.
14987
14988 2008-03-21 Ian Lance Taylor <iant@google.com>
14989
14990 * Added source code to GNU binutils.
14991 \f
14992 Copyright (C) 2008-2013 Free Software Foundation, Inc.
14993
14994 Copying and distribution of this file, with or without modification,
14995 are permitted in any medium without royalty provided the copyright
14996 notice and this notice are preserved.
14997
14998 Local Variables:
14999 mode: change-log
15000 left-margin: 8
15001 fill-column: 74
15002 version-control: never
15003 End:
This page took 0.339719 seconds and 5 git commands to generate.