* testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
[binutils-gdb.git] / gold / ChangeLog
1 2013-01-15 Alan Modra <amodra@gmail.com>
2
3 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
4 * testsuite/Makefile.in: Regenerate.
5
6 2013-01-14 Alan Modra <amodra@gmail.com>
7
8 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
9 * testsuite/Makefile.in: Regenerate.
10
11 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
12
13 Fix mingw gold build with plugins enabled
14 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
15 * configure.ac: Export DLOPEN_LIBS and add headers check.
16 * plugin.cc: Handle non-dlfcn case.
17 * Makefile.in: Regenerate.
18 * config.in: Regenerate.
19 * configure: Regenerate.
20 * testsuite/Makefile.in: Regenerate.
21
22 2013-01-09 Sriraman Tallam <tmsriram@google.com>
23
24 * output.h (sort_attached_input_sections): Change to be public.
25 * script-sections.cc
26 (Output_section_definition::set_section_addresses): Sort
27 attached input sections according to section order before linker
28 script assigns section addresses.
29 (Orphan_output_section::set_section_addresses): Sort
30 attached input sections according to section order before linker
31 script assigns section addresses.
32 * Makefile.am (final_layout.sh): Use a simple linker script to
33 check if section ordering still works.
34 * Makefile.in: Regenerate.
35
36 2013-01-09 Ben Cheng <bccheng@google.com>
37
38 * arm.cc (Target_arm::attributes_accept_div): New function.
39 (Target_arm::attributes_forbid_div): New function.
40 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
41 attribute using the same new functions as what bfd/elf32_arm.c
42 does.
43
44 2013-01-07 Cary Coutant <ccoutant@google.com>
45
46 PR gold/14993
47 * output.cc (Output_section::add_input_section): For incremental
48 updates, don't track input sections that are allocated from patch
49 space.
50
51 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
52 Ian Lance Taylor <iant@google.com>
53
54 PR gold/14897
55 * configure.ac (--enable-ld): Removed.
56 (install_as_default): Set to yes only for --enable-gold=default
57 or --disable-ld.
58 * configure: Regenerated.
59
60 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
61
62 * options.h (General_options): Add -fuse-ld= for GCC linker
63 option compatibility.
64
65 2013-01-04 Cary Coutant <ccoutant@google.com>
66
67 * configure.ac: Fix typo restoring CXXFLAGS.
68 * configure: Regenerate.
69
70 2013-01-04 Cary Coutant <ccoutant@google.com>
71
72 * testsuite/Makefile.am (CXXLINK_S): New macro.
73 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
74 * testsuite/Makefile.in: Regenerate.
75
76 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
77
78 * version.cc (print_version): Update copyright year to 2013.
79
80 2012-12-20 Ian Lance Taylor <iant@google.com>
81
82 * layout.cc (Layout::special_ordering_of_input_section): New
83 function.
84 (Layout::layout): If input section requires special ordering, must
85 sort input sections.
86 (Layout::make_output_section): May sort .text input sections.
87 (Layout::is_section_name_prefix_grouped): Remove.
88 * layout.h (class Layout): Declare
89 special_ordering_of_input_section. Don't declare
90 is_section_name_prefix_grouped.
91 * output.cc (Output_section::add_input_section): Revert last
92 change.
93 (Output_section::Input_section_sort::match_file_name): Don't crash
94 if called on output section data.
95 (Output_section::Input_section_sort_compare): Sort based on
96 special ordering.
97 (Output_section::Input_section_sort_section_order_index_compare):
98 Revert last patch.
99 (Output_section::sort_attached_input_sections): Likewise.
100
101 2012-12-18 Sriraman Tallam <tmsriram@google.com>
102
103 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
104 * layout.h (Layout::is_section_name_prefix_grouped): New function.
105 * output.cc (Output_section::add_input_section): Check if section
106 name contains special prefix. Keep input sections to sort such
107 sections.
108 (Output_section::Input_section_sort_section_order_index_compare
109 ::operator()): Group sections according to prefixes.
110 (Output_section::sort_attached_input_sections): Add condition to
111 Input_section_entry constructor call.
112 * testsuite/Makefile.am (text_section_grouping): New test.
113 * testsuite/Makefile.in: Regenerate.
114 * testsuite/text_section_grouping.cc: New file.
115 * testsuite/text_section_grouping.sh: New file.
116
117 2012-12-17 Nick Clifton <nickc@redhat.com>
118
119 * Makefile.am: Add copyright notice.
120 * NEWS: Likewise.
121 * README: Likewise.
122 * configure.ac: Likewise.
123 * ftruncate.c: Likewise.
124 * Makefile.in: Regenerate.
125
126 2012-12-14 Cary Coutant <ccoutant@google.com>
127
128 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
129 --no-as-needed flag.
130 (exception_separate_shared_12_test): Likewise.
131 (incremental_copy_test): Likewise.
132 * testsuite/Makefile.in: Regenerate.
133
134 2012-12-14 Cary Coutant <ccoutant@google.com>
135
136 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
137 (Dwp_output_file::Dwp_index::enter_set): Add assert.
138
139 2012-12-12 Alan Modra <amodra@gmail.com>
140
141 * powerpc.cc (class Track_tls): New.
142 (class Relocate, class Scan): Inherit Track_tls.
143 (Target_powerpc::Scan::local, global): Track tls optimization
144 and avoid creating plt entry for __tls_get_addr if all uses
145 are optimized away.
146 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
147
148 2012-12-12 Alan Modra <amodra@gmail.com>
149
150 * options.h (General_options): Add --toc-sort/--no-toc-sort.
151 Replace no_toc_optimize with toc_optimize.
152 * output.h (Output_section::input_sections): Provide non-const variant.
153 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
154 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
155 accessors.
156 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
157 (class Sort_toc_sections): New.
158 (Target_powerpc::do_finalize_sections): Sort toc sections.
159 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
160
161 2012-12-10 Roland McGrath <mcgrathr@google.com>
162
163 * testsuite/binary_unittest.cc (read_all): New function.
164 (Sized_binary_test): Use it instead of ::read.
165 * fileread.cc (do_read): Don't assume pread always reads the whole
166 amount in a single call.
167
168 2012-12-10 Alan Modra <amodra@gmail.com>
169
170 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
171 Set EM_PPC64 or EM_PPC here.
172 (Target_selector_powerpc::do_recognize): Delete.
173
174 2012-12-10 Alan Modra <amodra@gmail.com>
175
176 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
177 stub_table_.
178 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
179
180 2012-12-07 Roland McGrath <mcgrathr@google.com>
181
182 * testsuite/binary_unittest.cc (Sized_binary_test):
183 Use open_descriptor rather than ::open.
184
185 2012-12-07 Alan Modra <amodra@gmail.com>
186
187 * powerpc.cc (Stub_table::do_write): Delete redundant Address
188 typedef and invalid_address constant.
189 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
190 instantiate constants.
191
192 2012-12-06 Roland McGrath <mcgrathr@google.com>
193
194 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
195 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
196 * aclocal.m4: Regenerate.
197 * configure: Regenerate.
198 * Makefile.in: Regenerate.
199 * testsuite/Makefile.in: Regenerate.
200
201 2012-12-07 Alan Modra <amodra@gmail.com>
202
203 * options.h (General_options): Add no_toc_optimize.
204 * powerpc.cc (ok_lo_toc_insn): New function.
205 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
206
207 2012-12-06 Alan Modra <amodra@gmail.com>
208
209 * options.h (General_options): Add plt_align, plt_static_chain,
210 plt_thread_safe. Update stub_group_size help text.
211 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
212 for new plt_thread_safe_ var.
213 (use_plt_offset): Correct comments.
214 (Target_powerpc::do_relax): Look for thread creation symbols to
215 determine default plt_thread_safe value. Clear plt call stubs
216 as well as branch stubs each iteration.
217 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
218 insn constants.
219 (l, hi, ha, write_insn): Move earlier.
220 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
221 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
222 plt stubs too.
223 (Stub_table::update_size): Adjust.
224 (Stub_table::prev_size, set_prev_size): Delete.
225 (Stub_table::stub_align): Let --plt-align affect result.
226 (Stub_table::plt_call_size): Calculate sizes for various stubs.
227 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
228 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
229 (Stub_table::do_write): Support more stub variants.
230
231 2012-12-04 Alan Modra <amodra@gmail.com>
232
233 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
234 (Target_powerpc::do_define_standard_symbols): New function.
235
236 2012-12-03 Alan Modra <amodra@gmail.com>
237
238 * output.h: Formatting, whitespace.
239
240 2012-12-03 Alan Modra <amodra@gmail.com>
241
242 * layout.h (Layout::get_executable_sections): Declare.
243 * layout.cc (Layout::get_executable_sections): New function.
244 * arm.cc (Target_arm::group_sections): Use it.
245 (Arm_output_section::group_sections): Delete now redundant test.
246 * output.cc (Output_reloc::Output_reloc): Add is_relative.
247 param to handle relative relocs.
248 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
249 (Output_data_reloc::add_absolute): Adjust.
250 (Output_data_reloc::add_relative): New function.
251 (Output_data::reset_data_size): New function.
252 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
253 (Output_section::set_addralign): New function.
254 (Output_section::checkpoint_set_addralign): New function.
255 (Output_section::clear_section_offsets_need_adjustment): New function.
256 (Output_section::input_sections): Make public.
257 * powerpc.cc (class Output_data_brlt_powerpc): New.
258 (class Stub_table, class Stub_control): New.
259 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
260 stub_table_, set_stub_table, stub_table): New vectors and accessor
261 functions.
262 (Target_powerpc::do_may_relax, do_relax, push_branch,
263 new_stub_table, stub_tables, brlt_section, group_sections,
264 add_branch_lookup_table, find_branch_lookup_table,
265 write_branch_lookup_table, make_brlt_section): New functions.
266 (Target_powerpc::struct Sort_sections, class Branch_info): New.
267 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
268 branch_info_): New vars.
269 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
270 make call stubs here.
271 (Output_data_glink): Remove all call stub handling from this class.
272 (Target_powerpc::Scan::local, global): Save interesting branch
273 relocs and relocs for ifunc. Adjust calls to plt entry functions.
274 (Target_powerpc::do_finalize_sections): Only make reg save/restore
275 functions on final link.
276 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
277 Handle long branch destinations too.
278 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
279 do_plt_address_for_local): Adjust lookup of plt call stubs.
280
281 2012-11-30 Alan Modra <amodra@gmail.com>
282
283 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
284 relocs against protected symbols when building 32-bit shared libs.
285
286 2012-11-30 Alan Modra <amodra@gmail.com>
287
288 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
289 param. Call got_section() to make .got. Update all callers
290 and their callers and so on.
291
292 2012-11-30 Alan Modra <amodra@gmail.com>
293
294 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
295 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
296 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
297 value if it already exists.
298
299 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
300
301 PR gold/14858
302 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
303
304 2012-11-14 Roland McGrath <mcgrathr@google.com>
305
306 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
307 than bfc instruction for data sandboxing.
308
309 2012-11-08 Alan Modra <amodra@gmail.com>
310
311 * po/POTFILES.in: Regenerate.
312
313 2012-11-05 Alan Modra <amodra@gmail.com>
314
315 * configure.ac: Apply 2012-09-10 change to config.in here.
316 * configure: Regenerate.
317
318 2012-11-05 Alan Modra <amodra@gmail.com>
319
320 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
321 (struct Opd_ent): Use "Address" rather than "Offset".
322 (Output_data_got_powerpc::got_base_offset): Return Valtype.
323 (Target_powerpc::got_section): Make public.
324 (Target_powerpc::scan_relocs): Move code setting symbols..
325 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
326 Create _SDA_BASE_ only when referenced.
327
328 2012-11-02 Roland McGrath <mcgrathr@google.com>
329
330 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
331 from last change.
332
333 2012-11-01 Roland McGrath <mcgrathr@google.com>
334
335 * target.h (Sized_target::relocate_relocs): Use Elf_Off
336 for offset_in_output_section parameter.
337 (Sized_target::relocate_special_relocatable): Likewise.
338 * arm.cc (Target_arm::relocate_relocs): Likewise.
339 (Target_arm::relocate_special_relocatable): Likewise.
340 * i386.cc (Target_i386::relocate_relocs): Likewise.
341 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
342 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
343 * target-reloc.h (relocate_relocs): Likewise.
344 * testsuite/testfile.cc (Target_test): Likewise.
345 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
346 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
347
348 * system.h: Move inclusion of <clocale> to after <libintl.h> in
349 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
350
351 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
352 parameter, which is unused in the [!F_SETFD] case.
353
354 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
355 SYMNDX to off_t before comparing it to this->data_size().
356 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
357 * incremental.cc (Output_section_incremental_inputs::do_write):
358 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
359
360 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
361
362 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
363
364 * gold.cc (Target_arm::do_adjust_elf_header): Add the
365 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
366 in EABI_VER5.
367
368 2012-10-29 Cary Coutant <ccoutant@google.com>
369
370 * dwp.cc (usage): Add file and exit status parameters;
371 add --help and --version options.
372 (print_version): New function.
373 (main): Add --help and --version options.
374
375 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
376
377 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
378 final_layout_sequence.txt.
379 * testsuite/Makefile.in: Regenerated.
380
381 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
382
383 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
384 COMPILE generated by automake.
385 (LINK1): Likewise.
386 (CXXCOMPILE1): Likewise.
387 (CXXLINK1): Likewise.
388 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
389 (LINK): Likewise.
390 (CXXCOMPILE): Likewise.
391 (CXXLINK): Likewise.
392 * testsuite/Makefile.in: Regenerated.
393
394 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
395
396 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
397 on bad fwrite return.
398
399 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
400
401 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
402 on val.
403
404 2012-10-23 Cary Coutant <ccoutant@google.com>
405
406 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
407 * testsuite/Makefile.in: Regenerate.
408 * testsuite/dwp_test.h: New source file.
409 * testsuite/dwp_test_1.cc: New source file.
410 * testsuite/dwp_test_1.s: New source file.
411 * testsuite/dwp_test_1.sh: New source file.
412 * testsuite/dwp_test_1b.cc: New source file.
413 * testsuite/dwp_test_1b.s: New source file.
414 * testsuite/dwp_test_2.cc: New source file.
415 * testsuite/dwp_test_2.s: New source file.
416 * testsuite/dwp_test_2.sh: New source file.
417 * testsuite/dwp_test_main.cc: New source file.
418 * testsuite/dwp_test_main.s: New source file.
419
420 2012-10-23 Cary Coutant <ccoutant@google.com>
421
422 * dwp.h: New header file.
423 * dwp.cc: New source file.
424 * gold.h: Move shared declarations to system.h.
425 * system.h: New header file.
426 * Makefile.am: Add dwp.
427 * Makefile.in: Regenerate.
428
429 2012-10-23 Cary Coutant <ccoutant@google.com>
430
431 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
432 Dwarf_info_reader::read_from_pointer.
433 (Dwarf_pubnames_table::read_header): Likewise.
434 (Dwarf_pubnames_table::next_name): Likewise.
435 (Dwarf_die::read_attributes): Likewise.
436 (Dwarf_die::skip_attributes): Likewise.
437 (Dwarf_info_reader::read_from_pointer): New function template.
438 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
439 (Dwarf_pubnames_table): Likewise.
440 (Dwarf_info_reader::read_from_pointer): New function template.
441 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
442 Dwarf_pubnames_table ctor.
443
444 2012-10-23 Cary Coutant <ccoutant@google.com>
445
446 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
447 abbrev_shndx.
448 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
449 abbrev_shndx_.
450 (Dwarf_info_reader::set_abbrev_shndx): New method.
451 (Dwarf_info_reader::abbrev_shndx_): New data member.
452
453 2012-10-23 Cary Coutant <ccoutant@google.com>
454
455 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
456 from object, not parameters.
457 (Dwarf_info_reader::parse): Likewise.
458 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
459 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
460 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
461 methods.
462
463 2012-10-23 Cary Coutant <ccoutant@google.com>
464
465 * fileread.cc (Input_file::Input_file): New constructor.
466 * fileread.h (class Input_file): Add new constructor.
467
468 2012-10-18 Alan Modra <amodra@gmail.com>
469
470 PR gold/14727
471 * object.cc (Relobj::is_section_name_included): Also match
472 .sdata personality section.
473
474 2012-10-18 Alan Modra <amodra@gmail.com>
475
476 * target-reloc.h (class Default_comdat_behavior): New, package up..
477 (get_comdat_behaviour): ..this.
478 (relocate_section): Add Relocate_comdat_behavior template arg,
479 adjust code to suit.
480 * arm.cc (Target_arm::relocate_section): Adjust to suit.
481 (Target_arm::scan_reloc_section): Likewise.
482 * i386.cc (Target_i386::relocate_section): Likewise.
483 * sparc.cc (Target_sparc::relocate_section): Likewise.
484 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
485 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
486 * powerpc.cc (class Relocate_comdat_behavior): New.
487 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
488 gold::relocate_section with new template arg.
489
490 2012-10-18 Alan Modra <amodra@gmail.com>
491
492 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
493 dynamic relocs for GOT_TPREL got entries, without symbol if
494 resolving locally.
495 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
496 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
497 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
498
499 2012-10-17 Alan Modra <amodra@gmail.com>
500
501 PR gold/14726
502 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
503
504 2012-10-16 Sriraman Tallam <tmsriram@google.com>
505
506 * layout.cc (Layout::include_section): Keep sections marked
507 SHF_EXCLUDE when doing relocatable links.
508
509 2012-10-16 Alan Modra <amodra@gmail.com>
510
511 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
512 (Target_powerpc::do_finalize_sections): Call it.
513 (Output_data_save_res): New class and supporting functions.
514 (Target_powerpc::symval_for_branch): Only look up .opd entry for
515 normal symbols defined in object files.
516
517 2012-10-12 Alan Modra <amodra@gmail.com>
518
519 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
520 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
521 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
522 section if scan_opd_relocs not yet called.
523 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
524
525 2012-10-12 Alan Modra <amodra@gmail.com>
526
527 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
528 add_local_ifunc_entry): Revert last change.
529 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
530
531 2012-10-05 Alan Modra <amodra@gmail.com>
532
533 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
534 do_plt_address_for_global): New functions.
535 (Output_data_got_powerpc::do_write): Don't segfault when linking
536 statically.
537 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
538 add_local_ifunc_entry): Return true on adding entry..
539 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
540 glink->add_entry call. Remove unused symtab param. Adjust calls.
541 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
542 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
543 set up symbols here.
544 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
545 syms here. Do so even when no .iplt. Don't segfault when linking
546 statically.
547 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
548 new variants without reloc param.
549 (Glink_sym_ent::Glink_sym_ent): Likewise.
550 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
551 reloc when refs will resolve to plt call stub.
552 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
553 R_PPC_PLTREL24 to resolve locally.
554 (Target_powerpc::Scan::global): Correct ifunc handling.
555 (Target_powerpc::Relocate::relocate): Correct local sym glink
556 lookup. Don't destroy "value" when we have a plt call stub,
557 and when checking plt call validity.
558 (Target_powerpc::do_dynsym_value): Simplify.
559
560 2012-10-05 Alan Modra <amodra@gmail.com>
561
562 * i386.cc (Output_data_plt_i386::address_for_global,
563 address_for_local): Add plt offset to returned value. Adjust uses.
564 * sparc.cc (Output_data_plt_sparc::address_for_global,
565 address_for_local): Likewise.
566 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
567 address_for_local): Likewise.
568 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
569 address_for_local): Likewise.
570 * target.h (Target::plt_address_for_global, plt_address_for_local):
571 Update comment.
572 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
573 (Output_data_got::Got_entry::write): Nor here.
574 * output.h: Comment fix.
575
576 2012-10-02 Jiong Wang <jiwang@tilera.com>
577
578 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
579 global_offset_table_ value for larget got.
580 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
581
582 2012-09-29 Alan Modra <amodra@gmail.com>
583
584 * powerpc.cc (Target_powerpc::iplt_): New output section.
585 (Target_powerpc::iplt_section, make_iplt_section,
586 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
587 (Target_powerpc::make_plt_entry): Handle ifunc syms.
588 Target_powerpc::plt_entry_count): Count iplt entries too.
589 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
590 reloc section in constructor. New params.
591 (Target_powerpc::make_plt_section): Create reloc section here instead.
592 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
593 functions.
594 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
595 (Output_data_glink::add_entry, find_entry): New functions to
596 deal with local syms.
597 (Glink_sym_ent): Add support for local syms.
598 (Output_data_glink::do_write): Handle ifunc plt entries.
599 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
600 (Target_powerpc::Scan::local, global): Handle ifunc syms.
601 (Target_powerpc::Relocate::relocate): Likewise.
602 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
603
604 2012-09-25 Alan Modra <amodra@gmail.com>
605
606 * object.h (Sized_relobj_file::adjust_local_symbol,
607 do_adjust_local_symbol): New functions.
608 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
609 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
610 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
611 and irregular opd entry spacing.
612 (Powerpc_relobj::do_read_relocs): Add opd size checks.
613 (Global_symbol_visitor_opd): New functor.
614 (Target_powerpc::do_finalize_sections): Omit global symbols defined
615 on deleted opd entries.
616
617 2012-09-15 Jiong Wang <jiwang@tilera.com>
618
619 * tilegx.cc: New file.
620 * Makefile.am (TARGETSOURCES): Add tilegx.cc
621 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
622 * configure.tgt: Add entries for tilegx*.
623 * configure.ac: Likewise.
624 * Makefile.in: Rebuild.
625 * configure: Likewise.
626 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
627 tilegx.
628
629 2012-09-13 Alan Modra <amodra@gmail.com>
630
631 * target-reloc.h (scan_relocs): Call scan.local for relocs
632 against symbols in discarded sections. Pass is_discarded
633 param.
634 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
635 Add is_discarded param.
636 * powerpc (Target_powerpc::Scan::local): Likewise. Use
637 is_discarded to flag opd entry as discarded. Don't emit dyn
638 relocs on such entries.
639 (Target_powerpc::Scan::global): Similarly detect and handle
640 such opd entries.
641 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
642 opd_ent_. Update all uses.
643 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
644 (Target_powerpc::relocate_section): Zero out discarded opd
645 entry relocs.
646
647 2012-09-12 Ian Lance Taylor <iant@google.com>
648
649 PR gold/14570
650 * output.cc: Rename Output_data_got template parameter from size
651 to got_size for all functions. Compile all variants of
652 Output_data_got.
653 (Output_data_got::Got_entry::write): Correct use of size for
654 symbol value. Use local_is_tls rather than casting to
655 Sized_relobj_file.
656 * object.h (class Object): Add local_is_tls and do_local_is_tls.
657 (class Sized_relobj_file): Add do_local_is_tls.
658 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
659
660 2012-09-11 Alan Modra <amodra@gmail.com>
661
662 PR gold/14566
663 * layout.cc (Layout::set_segment_offsets): When using
664 common-page-size alignment, ensure we are on a new max-page-size
665 page.
666 * output.cc (Output_segment::set_section_addresses): Use
667 abi_pagesize, not common_pagesize for relro boundary.
668 (Output_segment::set_offset): Likewise.
669
670 2012-09-11 Alan Modra <amodra@gmail.com>
671
672 * output.h (Output_data_got::add_global_tls, add_local_tls,
673 add_local_tls_pair): New functions.
674 (Output_data_got::add_local_pair_with_rel): Remove second
675 reloc param. Expand comment.
676 (Output_data_got::Got_entry): Rename use_plt_offset_ to
677 use_plt_or_tls_offset_, similarly for constructor param.
678 (Output_data_got::Got_entry::write): Add got_index param.
679 * output.cc (Output_data_got::add_global_tls, add_local_tls,
680 add_local_tls_pair): New functions.
681 (Output_data_got::Got_entry::write): Handle tls symbols
682 with use_plt_or_tls_offset_ set specially.
683 (Output_data_got::add_local_pair_with_rel): Only one reloc.
684 (Output_data_got::do_write): Replace iterator with index, pass
685 index to entry write function.
686 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
687 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
688 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
689 call.
690 * i386.cc (Target_i386::Scan::local): Likewise.
691 * sparc.cc (Target_sparc::Scan::local): Likewise.
692 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
693 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
694 do_tls_offset_for_global): New functions.
695 (Target_powerpc::Scan::local): Correct TLS relocations and got
696 entry values.
697 (Target_powerpc::Scan::global): Don't emit unnecessary
698 dynamic relocations on TLS GOT entries.
699
700 2012-09-10 Matthias Klose <doko@ubuntu.com>
701
702 * config.in: Disable sanity check for kfreebsd.
703
704 2012-09-10 Sterling Augustine <saugustine@google.com>
705
706 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
707 (Gdb_index::pubtypes_read): New parameter.
708 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
709 to calls.
710 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
711 pubtypes_object_.
712
713 2012-09-09 Alan Modra <amodra@gmail.com>
714
715 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
716 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
717 * gc.h (gc_process_relocs): Call target gc_add_reference.
718 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
719 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
720 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
721 unnecessary cast.
722 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
723 to cater for when we don't need code offset. Update use.
724 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
725 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
726 set_opd_valid): New functions.
727 (Target_powerpc::do_gc_add_reference): New function.
728 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
729 stashed refs.
730 (Target_powerpc::do_gc_mark_symbol): New function.
731
732 2012-09-06 Cary Coutant <ccoutant@google.com>
733
734 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
735 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
736 (Dwarf_die::skip_attributes): Likewise.
737 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
738 * testsuite/gdb_index_test.cc (inline_func_1): New function.
739 (main): Call it.
740 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
741
742 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
743
744 * testsuite/script_test_3.t: Add .got.plt output section
745 statement.
746 * testsuite/script_test_4.t: Likewise.
747
748 2012-09-05 Alan Modra <amodra@gmail.com>
749
750 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
751 update all uses and lose "enum" when using type.
752
753 2012-09-05 Alan Modra <amodra@gmail.com>
754
755 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
756 * configure: Regenerate.
757 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
758 (plugin_final_layout.stdout): Likewise.
759 (memory_test): Set page sizes to 0x1000.
760 * testsuite/Makefile.in: Regenerate.
761 * testsuite/discard_locals_test.sh: Add FIXME comment.
762 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
763 * testsuite/pr14265.t: Add .got output section statement.
764 * testsuite/script_test_2.t: Likewise.
765 * testsuite/script_test_3.t: Likewise.
766 * testsuite/script_test_4.t: Likewise.
767 * testsuite/script_test_5.t: Likewise.
768 * testsuite/script_test_6.t: Likewise.
769 * testsuite/script_test_7.t: Likewise.
770 * testsuite/script_test_9.t: Likewise.
771
772 2012-09-05 Alan Modra <amodra@gmail.com>
773
774 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
775 (Powerpc_relocate_functions::Status): New typedef.
776 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
777 (Target_powerpc::Scan::local): Handle REL64.
778 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
779 for REL32 and REL64.
780 (Target_powerpc::symval_for_branch): New function, extracted from..
781 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
782 checks. Report overflow errors.
783
784 2012-09-05 Alan Modra <amodra@gmail.com>
785
786 * object.h (Sized_relobj_file::emit_relocs): Delete.
787 (Sized_relobj_file::emit_relocs_reltype): Delete.
788 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
789 relocate_relocs for --emit-relocs.
790 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
791 * output.h: Update comment.
792 (Output_segment::first_section): New function.
793 (Output_segment::first_section_load_address): Use first_section.
794 * output.cc (Output_segment::first_section): New function extracted..
795 (Output_segment::first_section_load_address): ..from here. Delete.
796 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
797 * target.h (Sized_target::relocate_for_relocatable): Likewise.
798 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
799 adjust call to target.h function.
800 * i386.cc (Target_i386): Likewise.
801 * sparc.cc (Target_sparc): Likewise.
802 * x86_64.cc (Target_x86_64): Likewise.
803 * powerpc.cc (Target_powerpc): Likewise.
804 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
805 first tls section has section symbol for optimised local dynamic
806 output relocs.
807 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
808 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
809 optimised tls code.
810 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
811 Rename to relocate_relocs. Update error message.
812
813 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
814
815 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
816 --just-symbols.
817
818 2012-08-31 Alan Modra <amodra@gmail.com>
819
820 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
821 (Powerpc_relobj::toc_base_offset): New stub function.
822 (Target_powerpc): Add tp_offset, dtp_offset. Rename
823 got_mod_index_offset to tlsld_got_offset. Update all refs.
824 (Target_powerpc::Relocate::enum skip_tls): New.
825 (Target_powerpc::call_tls_get_addr_): New var.
826 (Target_powerpc::is_branch_reloc): Move to file scope.
827 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
828 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
829 New functions.
830 (Target_powerpc::enum Got_type): Delete old values, add new ones.
831 (powerpc_info): Correct common_pagesize for ppc64.
832 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
833 (Powerpc_relocate_functions): Add overflow check enums and functions.
834 Add non-shift version of rela, rela_ua. Delete all rel public
835 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
836 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
837 addr16_ha3, addr14 functions.
838 (Output_data_got_powerpc::add_constant_pair): New function.
839 (Output_data_got_powerpc::got_base_offset): Likewise.
840 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
841 (instruction constants): Sort, add some more.
842 (Output_data_glink::do_write): Add and use Address typedef. Use
843 object->toc_base_offset() stub for 64-bit.
844 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
845 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
846 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
847 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
848 Always treat .opd relocs as against locally defined symbol.
849 Correct condition for RELATIVE relocs.
850 (Target_powerpc::do_finalize_sections): Test for NULL sections.
851 (Target_powerpc::Relocate::relocate): Use plt call stub as value
852 for 32-bit syms with a plt entry. Correct ppc64 toc base
853 calculations. Handle TLS relocs, and more. Add overflow
854 checking and adjust for Powerpc_relocate_functions changes.
855 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
856 Reinstate --emit-relocs code with FIXME.
857
858 2012-08-30 Alan Modra <amodra@gmail.com>
859
860 * layout.cc (Layout::set_segment_offsets): Set p_align to
861 abi_pagesize, not common_pagesize.
862 (Layout::relaxation_loop_body): Similarly use abi_pagesize
863 to determine whether file header can go in segment.
864
865 2012-08-30 Alan Modra <amodra@gmail.com>
866
867 * output.h (Output_reloc::Output_reloc <output section>): Add
868 is_relative param. Adjust calls.
869 (Output_reloc::add_output_section_relative): New functions.
870 * output.cc (Output_reloc::Output_reloc <output section>): Handle
871 is_relative.
872 (Output_reloc::symbol_value): Handle SECTION_CODE.
873
874 2012-08-24 Sriraman Tallam <tmsriram@google.com>
875
876 * gold.cc (queue_middle_tasks): Call layout again when unique
877 segments for sections is desired.
878 * layout.cc (Layout::Layout): Initialize new members.
879 (Layout::get_output_section_flags): New function.
880 (Layout::choose_output_section): Call get_output_section_flags.
881 (Layout::layout): Make output section for mapping to a unique segment.
882 (Layout::insert_section_segment_map): New function.
883 (Layout::attach_allocated_section_to_segment): Make unique segment for
884 output sections marked so.
885 (Layout::segment_precedes): Check for unique segments when sorting.
886 * layout.h (Layout::Unique_segment_info): New struct.
887 (Layout::Section_segment_map): New typedef.
888 (Layout::insert_section_segment_map): New function.
889 (Layout::get_output_section_flags): New function.
890 (Layout::is_unique_segment_for_sections_specified): New function.
891 (Layout::set_unique_segment_for_sections_specified): New function.
892 (Layout::unique_segment_for_sections_specified_): New member.
893 (Layout::section_segment_map_): New member.
894 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
895 Rename is_gc_pass_one to is_pass_one.
896 Rename is_gc_pass_two to is_pass_two.
897 Rename is_gc_or_icf to is_two_pass.
898 Check for which pass based on whether symbols data is present.
899 Make it two pass when unique segments for sections is desired.
900 * output.cc (Output_section::Output_section): Initialize new
901 members.
902 * output.h (Output_section::is_unique_segment): New function.
903 (Output_section::set_is_unique_segment): New function.
904 (Output_section::is_unique_segment_): New member.
905 (Output_section::extra_segment_flags): New function.
906 (Output_section::set_extra_segment_flags): New function.
907 (Output_section::extra_segment_flags_): New member.
908 (Output_section::segment_alignment): New function.
909 (Output_section::set_segment_alignment): New function.
910 (Output_section::segment_alignment_): New member.
911 (Output_segment::Output_segment): Initialize is_unique_segment_.
912 (Output_segment::is_unique_segment): New function.
913 (Output_segment::set_is_unique_segment): New function.
914 (Output_segment::is_unique_segment_): New member.
915 * plugin.cc (allow_unique_segment_for_sections): New function.
916 (unique_segment_for_sections): New function.
917 (Plugin::load): Add new functions to transfer vector.
918 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
919 * Makefile.in: Regenerate.
920 * testsuite/plugin_final_layout.sh: Check if unique segment
921 functionality works.
922 * testsuite/plugin_section_order.c (onload): Check if new interfaces
923 are available.
924 (allow_unique_segment_for_sections): New global.
925 (unique_segment_for_sections): New global.
926 (claim_file_hook): Call allow_unique_segment_for_sections.
927 (all_symbols_read_hook): Call unique_segment_for_sections.
928
929 2012-08-22 Cary Coutant <ccoutant@google.com>
930
931 * layout.cc (Layout::include_section): Don't assert on GROUP
932 sections with --emit-relocs.
933
934 2012-08-21 Cary Coutant <ccoutant@google.com>
935
936 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
937 if --export-dynamic-symbol names an undef symbol.
938
939 2012-08-18 Alan Modra <amodra@gmail.com>
940
941 * powerpc.cc: Formatting and white space.
942 (Powerpc_relobj): Rename got2_section_ to special_.
943 Add opd_ent_shndx_ and opd_ent_off_ vectors.
944 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
945 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
946 (Target_powerpc): Add Address typedef and invalid_address. Use
947 throughout.
948 (Target_powerpc::is_branch_reloc): New function.
949 (Powerpc_relocate_functions): Add Address typedef, use throughout.
950 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
951 for dst_mask, value and addend.
952 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
953 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
954 (Output_data_glink::do_write): Correct toc base. Don't try to use
955 uint16_t for 24-bit offset. Use get_output_section_offset and
956 check return.
957 (Target_powerpc::Scan::local): Handle more relocs.
958 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
959 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
960 Plug in toc restoring insn after plt calls. Translate branches
961 to function descriptor symbols to corresponding entry point.
962 (Target_powerpc::relocate_for_relocatable): Check return from
963 get_output_section_offset.
964 * symtab.h: Comment typo.
965
966 2012-08-14 Ian Lance Taylor <iant@google.com>
967
968 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
969 unsupported_relocal_local to call unsupported_reloc_global.
970
971 2012-08-14 Nick Clifton <nickc@redhat.com>
972
973 PR ld/14265
974 * script-sections.cc (Sections_element::output_section_name): Add
975 keep return parameter.
976 (Output_section_element::match_name): Add keep return parameter.
977 Return the value of the keep_ member.
978 * script-sections.h (class Output_section): Update
979 output_section_name prototype.
980 * layout.cc (Layout::keep_input_section): New public member
981 function.
982 (Layout::choose_output_section): Pass keep parameter to
983 output_section_name.
984 * layout.h (class Layout): Add keep_input_section.
985 * object.cc (Sized_relobj_file::do_layout): Check for kept input
986 sections.
987 * testsuite/Makefile.am: Add a test.
988 * testsuite/Makefile.in: Regenerate.
989 * testsuite/pr14265.c: Source file for the test.
990 * testsuite/pr14265.t: Linker script for the test.
991 * testsuite/pr14265.sh: Shell script for the test.
992
993 2012-08-14 Alan Modra <amodra@gmail.com>
994
995 * target.h (Target::output_section_name): New function.
996 (Target::do_output_section_name): New function.
997 * layout.cc (Layout::choose_output_section): Call the above.
998 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
999
1000 2012-08-14 Alan Modra <amodra@gmail.com>
1001
1002 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1003 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1004 for replace_constant call.
1005 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1006 (Output_data_glink::do_print_to_mapfile): New function.
1007 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1008 (Target_powerpc::Relocate::relocate): Likewise.
1009
1010 2012-08-14 Alan Modra <amodra@gmail.com>
1011
1012 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1013 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1014 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1015 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1016 all references to shndx_. Handle special case for R_PPC_PLTREL24
1017 here.
1018 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1019 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1020 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1021 here.
1022 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1023 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1024
1025 2012-08-12 Alan Modra <amodra@gmail.com>
1026
1027 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1028 (glink insn constants): Use uint32_t.
1029 (Output_data_glink::add_entry): Use insert, not [] operator.
1030
1031 2012-08-11 Alan Modra <amodra@gmail.com>
1032
1033 * object.h (Sized_relobj_file::find_shdr): New function.
1034 (Sized_relobj_file::find_special_sections): New function.
1035 * object.cc (Sized_relobj_file::find_shdr): New function.
1036 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1037 (Sized_relobj_file::find_special_sections): New function, split out..
1038 (Sized_relobj_file::do_read_symbols): ..from here.
1039 * output.h (Output_data_got::replace_constant): New function.
1040 (Output_data_got::num_entries): New function.
1041 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1042 (Output_data_got::got_offset): Protected rather than private.
1043 (Output_data_got::replace_got_entry): New function.
1044 * output.cc (Output_data_got::replace_got_entry): New function.
1045 * powerpc.cc (class Powerpc_relobj): New.
1046 (class Powerpc_relocate_functions): Delete all psymval variants or
1047 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1048 Implement _ha functions using corresponding _hi function.
1049 (Powerpc_relobj::find_special_sections): New function.
1050 (Target_powerpc::do_make_elf_object): New function.
1051 (class Output_data_got_powerpc): New.
1052 (class Output_data_glink): New.
1053 (class Powerpc_scan_relocatable_reloc): New.
1054 Many more changes througout file.
1055
1056 2012-08-09 Nick Clifton <nickc@redhat.com>
1057
1058 * po/vi.po: Updated Vietnamese translation.
1059
1060 2012-08-07 Ian Lance Taylor <iant@google.com>
1061
1062 * layout.cc (Layout::add_target_dynamic_tags): If
1063 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1064 plt_rel.
1065
1066 2012-07-30 Nick Clifton <nickc@redhat.com>
1067
1068 * po/gold.pot: Updated template.
1069 * po/es.po: Updated Spanish translation.
1070
1071 2012-07-18 Cary Coutant <ccoutant@google.com>
1072
1073 PR gold/14344
1074 * configure.ac: Add check for -gpubnames support.
1075 * configure: Regenerate.
1076 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1077 support; force -gno-pubnames.
1078 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1079 support.
1080 (gdb_index_test_4): New test.
1081 * testsuite/Makefile.in: Regenerate.
1082 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1083 * testsuite/gdb_index_test_2.sh: Likewise.
1084 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1085 * testsuite/gdb_index_test_4.sh: New script.
1086 * testsuite/gdb_index_test_comm.sh: New script with common code;
1087 don't look for space after colon.
1088
1089 2012-07-16 Sriraman Tallam <tmsriram@google.com>
1090
1091 * gold.cc (queue_middle_tasks): Update function order only after
1092 deferred objects due to plugins are processed.
1093
1094 2012-07-11 Ian Lance Taylor <iant@google.com>
1095
1096 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1097 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1098 (Target_arm::scan_reloc_for_stub): Likewise.
1099 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1100 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1101 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1102 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1103 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1104
1105 2012-07-10 Dodji Seketeli <dodji@redhat.com>
1106 Ian Lance Taylor <iant@google.com>
1107
1108 PR gold/14309
1109 * configure.ac: Test whether std::tr1::hash<off_t> works.
1110 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1111 needed.
1112 * output.h (class Output_fill): Add virtual destructor.
1113 * configure, config.in: Rebuild.
1114
1115 2012-06-22 Roland McGrath <mcgrathr@google.com>
1116
1117 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1118
1119 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1120
1121 * plugin.cc (Plugin::load): Handle position independent executables.
1122
1123 2012-06-06 Cary Coutant <ccoutant@google.com>
1124
1125 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1126 add .debug_macro.
1127 (lines_only_debug_sections): Likewise.
1128 (gdb_fast_lookup_sections): New static array.
1129 (is_gdb_debug_section): Rename formal parameter.
1130 (is_lines_only_debug_section): Likewise.
1131 (is_gdb_fast_lookup_section): New function.
1132 (Layout::include_section): Check for ".zdebug_" prefix; pass
1133 section name suffix to is_gdb_debug_section, et al.; check for
1134 fast-lookup sections when building .gdb_index.
1135 * options.h (--strip-debug-gdb): Update GDB version number.
1136
1137 2012-06-06 Cary Coutant <ccoutant@google.com>
1138
1139 * configure.ac: Add check for fallocate.
1140 * configure: Regenerate.
1141 * config.in: Regenerate.
1142
1143 * options.h (class General_options): Add --mmap-output-file and
1144 --posix-fallocate options.
1145 * output.cc: (posix_fallocate): Remove; replace with...
1146 (gold_fallocate): New function.
1147 (Output_file::map_no_anonymous): Call gold_fallocate.
1148 (Output_file::map): Check --mmap-output-file option.
1149
1150 2012-06-05 Jing Yu <jingyu@google.com>
1151
1152 * gold.h (textdomain): Add do {} to empty while(0).
1153 (bindtextdomain): Likewise.
1154
1155 2012-06-04 Cary Coutant <ccoutant@google.com>
1156
1157 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1158 has_dynsym_index.
1159
1160 2012-05-25 Sriraman Tallam <tmsriram@google.com>
1161
1162 * symtab.cc (Symbol_table::define_special_symbol):
1163 Initialize *poldsym to prevent uninitialized variable errors.
1164
1165 2012-05-23 Cary Coutant <ccoutant@google.com>
1166
1167 * layout.cc (Layout::section_name_mapping): Add rules to handle
1168 exact match on .data.rel.ro.local or .data.rel.ro.
1169 (Layout::output_section_name): Check for exact matches.
1170
1171 2012-05-23 Cary Coutant <ccoutant@google.com>
1172
1173 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1174 more carefully.
1175
1176 2012-05-22 Cary Coutant <ccoutant@google.com>
1177
1178 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1179 object before exporting symbol.
1180
1181 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1182
1183 * testsuite/tls_test.cc: Include "config.h" first.
1184 * testsuite/tls_test_c.c: Likewise.
1185
1186 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
1187 Nick Clifton <nickc@redhat.com>
1188
1189 PR 14072
1190 * configure.in: Add check that sysdep.h has been included before
1191 any system header files.
1192 * configure: Regenerate.
1193 * config.in: Regenerate.
1194
1195 2012-05-14 Cary Coutant <ccoutant@google.com>
1196
1197 * layout.cc (Layout::make_output_section): Mark .tdata section
1198 as RELRO.
1199 * testsuite/relro_test.cc: Add a TLS variable.
1200
1201 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1202
1203 PR gold/14091
1204 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1205 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1206 R_X86_64_64.
1207
1208 2012-05-08 Cary Coutant <ccoutant@google.com>
1209
1210 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1211 (lines_only_debug_sections): Likewise.
1212
1213 2012-05-02 Roland McGrath <mcgrathr@google.com>
1214
1215 * nacl.cc: New file.
1216 * nacl.h: New file.
1217 * Makefile.am (CCFILES, HFILES): Add them.
1218 * Makefile.in: Regenerate.
1219 * i386.cc (Output_data_plt_i386_nacl): New class.
1220 (Output_data_plt_i386_nacl_exec): New class.
1221 (Output_data_plt_i386_nacl_dyn): New class.
1222 (Target_i386_nacl): New class.
1223 (Target_selector_i386_nacl): New class.
1224 (target_selector_i386): Use it instead of Target_selector_i386.
1225 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1226 (Target_x86_64_nacl): New class.
1227 (Target_selector_x86_64_nacl): New class.
1228 (target_selector_x86_64, target_selector_x32): Use it instead of
1229 Target_selector_x86_64.
1230 * arm.cc (Output_data_plt_arm_nacl): New class.
1231 (Target_arm_nacl): New class.
1232 (Target_selector_arm_nacl): New class.
1233 (target_selector_arm, target_selector_armbe): Use it instead of
1234 Target_selector_arm.
1235
1236 * target-select.cc (select_target): Take new Input_file* and off_t
1237 arguments, pass them on to recognize method of selector.
1238 * object.cc (make_elf_sized_object): Update caller.
1239 * parameters.cc (parameters_force_valid_target): Likewise.
1240 * incremental.cc (make_sized_incremental_binary): Likewise.
1241 * target-select.h: Update decl.
1242 (Target_selector::recognize): Take new Input_file* argument,
1243 pass it on to do_recognize.
1244 (Target_selector::do_recognize): Take new Input_file* argument.
1245 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1246 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1247 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1248 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1249
1250 * target.h (Target::Target_info): New members isolate_execinstr
1251 and rosegment_gap.
1252 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1253 * arm.cc (Target_arm::arm_info): Update initializer.
1254 * i386.cc (Target_i386::i386_info): Likewise.
1255 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1256 * sparc.cc (Target_sparc::sparc_info): Likewise.
1257 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1258 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1259 * layout.cc (Layout::attach_allocated_section_to_segment):
1260 Take new const Target* argument. If target->isolate_execinstr(), act
1261 like --rosegment.
1262 (Layout::find_first_load_seg): Take new const Target* argument;
1263 if target->isolate_execinstr(), reject PF_X segments.
1264 (Layout::relaxation_loop_body): Update caller.
1265 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1266 reset file offset to zero when we hit LOAD_SEG, and then do a second
1267 loop over the segments before LOAD_SEG to reassign offsets after
1268 addresses have been determined. Handle target->rosegment_gap().
1269 (Layout::attach_section_to_segment): Take new const Target* argument;
1270 pass it to attach_allocated_section_to_segment.
1271 (Layout::make_output_section): Update caller.
1272 (Layout::attach_sections_to_segments): Take new const Target* argument;
1273 pass it to attach_section_to_segment.
1274 * gold.cc (queue_middle_tasks): Update caller.
1275 * layout.h (Layout): Update method decls with new arguments.
1276
1277 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1278 Target_info pointer to use.
1279 (Target_arm::do_make_data_plt): New virtual method.
1280 (Target_arm::make_data_plt): New method that calls it.
1281 (Target_arm::make_plt_entry): Use it.
1282 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1283 for the section alignment.
1284 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1285 method.
1286 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1287 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1288 method.
1289 (Output_data_plt_arm::get_plt_entry_size): Call it.
1290 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1291 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1292 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1293 method.
1294 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1295 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1296 method instead of sizeof(plt_entry).
1297 (Output_data_plt_arm::add_entry): Likewise.
1298 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1299 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1300 than static method.
1301 (Target_arm::plt_entry_size): Likewise.
1302 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1303 Move to ...
1304 (Output_data_plt_arm_standard): ... here, new class.
1305 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1306 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1307 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1308
1309 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1310 Take additional argument for the PLT entry size.
1311 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1312 Use get_plt_entry_size method rather than plt_entry_size variable.
1313 (Output_data_plt_x86_64::reserve_slot): Likewise.
1314 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1315 (Output_data_plt_x86_64::add_entry): Likewise.
1316 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1317 (Output_data_plt_x86_64::address_for_global): Likewise.
1318 (Output_data_plt_x86_64::address_for_local): Likewise.
1319 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1320 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1321 Make method non-static.
1322 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1323 method.
1324 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1325 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1326 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1327 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1328 virtual method.
1329 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1330 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1331 virtual method.
1332 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1333 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1334 virtual method.
1335 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1336 (Output_data_plt_x86_64::plt_entry_size)
1337 (Output_data_plt_x86_64::first_plt_entry)
1338 (Output_data_plt_x86_64::plt_entry)
1339 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1340 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1341 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1342 (Output_data_plt_x86_64_standard): ... here, new class.
1343 (Target_x86_64::Target_x86_64): Take optional argument for the
1344 Target_info pointer to use.
1345 (Target_x86_64::do_make_data_plt): New virtual method.
1346 (Target_x86_64::make_data_plt): New method to call it.
1347 (Target_x86_64::init_got_plt_for_update): Use that.
1348 Call this->plt_->add_eh_frame method here.
1349 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1350 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1351 rather than static method.
1352 (Target_x86_64::plt_entry_size): Likewise.
1353 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1354 rather than plt_entry_size variable. Move guts of PLT filling to...
1355 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1356 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1357 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1358
1359 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1360 additional argument for the section alignment.
1361 Don't do add_eh_frame_for_plt here.
1362 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1363 non-static. Use get_plt_entry_size method rather than plt_entry_size
1364 variable.
1365 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1366 method.
1367 (Output_data_plt_i386::get_plt_entry_size): Call it.
1368 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1369 (Output_data_plt_i386::add_eh_frame): New method to call it.
1370 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1371 method.
1372 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1373 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1374 method.
1375 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1376 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1377 method instead of plt_entry_size.
1378 (Output_data_plt_i386::plt_entry_size)
1379 (Output_data_plt_i386::plt_eh_frame_fde_size)
1380 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1381 (Output_data_plt_i386_standard): ... here, new class.
1382 (Output_data_plt_i386_exec): New class.
1383 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1384 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1385 (Output_data_plt_i386::exec_plt_entry): Move to ...
1386 (Output_data_plt_i386_exec::plt_entry): ... here.
1387 (Output_data_plt_i386_dyn): New class.
1388 (Output_data_plt_i386::first_plt_entry): Move to ...
1389 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1390 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1391 (Output_data_plt_i386_dyn::plt_entry): ... here.
1392 (Target_i386::Target_i386): Take optional argument for the Target_info
1393 pointer to use.
1394 (Target_i386::do_make_data_plt): New virtual method.
1395 (Target_i386::make_data_plt): New method to call it.
1396 (Target_i386::make_plt_section): Use that.
1397 Call this->plt_->add_eh_frame method here.
1398 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1399 rather than plt_entry_size variable.
1400 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1401 (Output_data_plt_i386::address_for_local): Likewise.
1402 (Output_data_plt_i386::do_write): Likewise.
1403 Move guts of PLT filling to...
1404 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1405 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1406 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1407 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1408
1409 2012-05-01 Cary Coutant <ccoutant@google.com>
1410
1411 * dwarf_reader.cc (Dwarf_die::read_attributes)
1412 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1413 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1414 * reduced_debug_output.cc
1415 (Output_reduced_debug_info_section::get_die_end): Remove
1416 DW_FORM_GNU_ref_index. Add default case.
1417
1418 2012-04-26 Mark Wielaard <mjw@redhat.com>
1419
1420 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1421 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1422 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1423 DW_AT_high_pc as offset from DW_AT_low_pc.
1424
1425 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1426 * testsuite/Makefile.in: Regenerate.
1427 * testsuite/gdb_index_test_3.c: New test source file.
1428 * testsuite/gdb_index_test_3.sh: New test source file.
1429
1430 2012-04-25 Ian Lance Taylor <iant@google.com>
1431
1432 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1433 pointer.
1434 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1435 as a class, not a struct.
1436 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1437 (Target_arm::apply_cortex_a8_workaround): Likewise.
1438 * gc.h: Declare Reloc_types as a struct, not a class.
1439 * object.h: Declare Symbols_data as a struct.
1440 * reloc.h: Declare Read_relocs_data as a struct.
1441 * target.h: Declare Relocate_info as a struct.
1442
1443 2012-04-24 David S. Miller <davem@davemloft.net>
1444
1445 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1446 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1447 and R_SPARC_WPLT30.
1448
1449 2012-04-24 Cary Coutant <ccoutant@google.com>
1450
1451 * incremental-dump.cc (find_input_containing_global): Replace
1452 magic number with symbolic constant.
1453 (dump_incremental_inputs): Update version number.
1454 * incremental.cc (Output_section_incremental_inputs): Update version
1455 number; import symbolic constants from Incremental_inputs_reader.
1456 (Incremental_inputs::create_data_sections): Align relocations
1457 section correctly for 64-bit targets.
1458 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1459 constants; add padding.
1460 (Output_section_incremental_inputs::write_header): Add assert for
1461 header_size.
1462 (Output_section_incremental_inputs::write_input_files): Add assert
1463 for input_entry_size.
1464 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1465 add assert for object_info_size, input_section_entry_size,
1466 global_sym_entry_size.
1467 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1468 for data structure sizes; use them.
1469 (Incremental_input_entry_reader): Import symbolic constants from
1470 Incremental_inputs_reader; use them.
1471
1472 2012-04-23 David S. Miller <davem@davemloft.net>
1473
1474 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1475 and elf_flags_set_.
1476 (Target_sparc::Target_sparc): Initialize new fields.
1477 (Target_sparc::do_make_elf_object): New function.
1478 (Target_sparc::do_adjust_elf_header): New function.
1479
1480 2012-04-23 Cary Coutant <ccoutant@google.com>
1481
1482 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1483 CU range table of gdb index.
1484
1485 2012-04-20 David S. Miller <davem@davemloft.net>
1486
1487 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1488 instead of false.
1489
1490 2012-04-16 David S. Miller <davem@davemloft.net>
1491
1492 * sparc.cc (Target_sparc::got_address): New function.
1493 (Sparc_relocate_functions::gdop_hix22): New function.
1494 (Sparc_relocate_functions::gdop_lox10): New function.
1495 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1496 relocs.
1497 (Target_sparc::Scan::local): Likewise if the global symbol is not
1498 preemptible and is not IFUNC.
1499 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1500 transformations for local and non-preemptible non-IFUNC global
1501 symbols.
1502
1503 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1504 writing out 64-bit part of ranges.
1505
1506 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1507 -fpic and -fpie respectively.
1508 * Makefile.in: Regenerate.
1509
1510 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1511 (Target_sparc::Target_sparc): Initialize new field.
1512 (Target_sparc::do_plt_section_for_global): New function.
1513 (Target_sparc::do_plt_section_for_local): New function.
1514 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1515 (Target_sparc::make_plt_section): New function, broken out of
1516 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1517 (Target_sparc::make_plt_entry): Call make_plt_section.
1518 (Target_sparc::make_local_ifunc_plt_entry): New function.
1519 (Target_sparc::rela_ifunc_section): New function.
1520 (Target_sparc::plt_section): Remove const.
1521 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1522 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1523 and ifunc_count_ fields.
1524 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1525 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1526 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1527 (Output_data_plt_sparc::rela_ifunc): New function.
1528 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1529 (Output_data_plt_sparc::has_ifunc_section): New function.
1530 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1531 (Output_data_plt_sparc::address_for_global): New function.
1532 (Output_data_plt_sparc::address_for_local): New function.
1533 (Output_data_plt_sparc::plt_index_to_offset): New function.
1534 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1535 and entry_count.
1536 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1537 entry_count.
1538 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1539 R_SPARC_JMP_IREL to switch.
1540 (Target_sparc::Scan::check_non_pic): Likewise.
1541 (Target_sparc::Scan::local): Handle IFUNC symbols.
1542 (Target_sparc::Scan::local): Likewise.
1543 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1544 and plt_address_for_local.
1545 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1546 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1547
1548 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1549 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1550 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1551 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1552 global relocs too.
1553 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1554 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1555 calls.
1556 * sparc.cc (Target_sparc::Scan::global): Likewise.
1557 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1558
1559 2012-04-16 Cary Coutant <ccoutant@google.com>
1560
1561 * archive.cc (Library_base::should_include_member): Check for
1562 --export-dynamic-symbol.
1563 * options.h (class General_options): Add --export-dynamic-symbol.
1564 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1565 --export-dynamic-symbol.
1566 (Symbol_table::gc_mark_undef_symbols): Likewise.
1567 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1568
1569 2012-04-12 David S. Miller <davem@davemloft.net>
1570
1571 * sparc.cc (Reloc::wdisp10): New relocation method.
1572 (Reloc::h34): Likewise.
1573 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1574 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1575 R_SPARC_WDISP10.
1576 (Target_sparc::Scan::local): Likewise.
1577 (Target_sparc::Scan::global): Likewise.
1578 (Target_sparc::Relocate::relocate): Likewise.
1579
1580 2012-04-09 Cary Coutant <ccoutant@google.com>
1581
1582 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1583 low_pc == 0.
1584
1585 2012-04-06 Ian Lance Taylor <iant@google.com>
1586
1587 * timer.cc: #include <unistd.h>.
1588
1589 2012-04-06 Roland McGrath <mcgrathr@google.com>
1590
1591 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1592 * config.in: Regenerate.
1593 * configure: Regenerate.
1594
1595 2012-04-05 Nick Clifton <nickc@redhat.com>
1596
1597 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1598 (AM_LC_MESSAGES): Add.
1599 * aclocal.m4: Regenerate.
1600 * config.in: Regenerate.
1601 * configure: Regenerate.
1602
1603 2012-03-21 Cary Coutant <ccoutant@google.com>
1604
1605 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1606 * Makefile.in: Regenerate.
1607 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1608 (Sized_elf_reloc_mapper::symbol_section): New function.
1609 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1610 (make_elf_reloc_mapper): New function.
1611 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1612 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1613 (Dwarf_abbrev_table::do_get_abbrev): New function.
1614 (Dwarf_ranges_table::read_ranges_table): New function.
1615 (Dwarf_ranges_table::read_range_list): New function.
1616 (Dwarf_pubnames_table::read_section): New function.
1617 (Dwarf_pubnames_table::read_header): New function.
1618 (Dwarf_pubnames_table::next_name): New function.
1619 (Dwarf_die::Dwarf_die): New function.
1620 (Dwarf_die::read_attributes): New function.
1621 (Dwarf_die::skip_attributes): New function.
1622 (Dwarf_die::set_name): New function.
1623 (Dwarf_die::set_linkage_name): New function.
1624 (Dwarf_die::attribute): New function.
1625 (Dwarf_die::string_attribute): New function.
1626 (Dwarf_die::int_attribute): New function.
1627 (Dwarf_die::uint_attribute): New function.
1628 (Dwarf_die::ref_attribute): New function.
1629 (Dwarf_die::child_offset): New function.
1630 (Dwarf_die::sibling_offset): New function.
1631 (Dwarf_info_reader::check_buffer): New function.
1632 (Dwarf_info_reader::parse): New function.
1633 (Dwarf_info_reader::do_parse): New function.
1634 (Dwarf_info_reader::do_read_string_table): New function.
1635 (Dwarf_info_reader::lookup_reloc): New function.
1636 (Dwarf_info_reader::get_string): New function.
1637 (Dwarf_info_reader::visit_compilation_unit): New function.
1638 (Dwarf_info_reader::visit_type_unit): New function.
1639 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1640 Sized_elf_reloc_mapper.
1641 (Sized_dwarf_line_info::symbol_section): Remove function.
1642 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1643 (Sized_dwarf_line_info::read_line_mappings): Remove object
1644 parameter, adjust callers.
1645 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1646 * dwarf_reader.h: Include <sys/types.h>.
1647 (class Track_relocs): Remove forward declaration.
1648 (class Elf_reloc_mapper): New class.
1649 (class Sized_elf_reloc_mapper): New class.
1650 (class Dwarf_abbrev_table): New class.
1651 (class Dwarf_range_list): New class.
1652 (class Dwarf_ranges_table): New class.
1653 (class Dwarf_pubnames_table): New class.
1654 (class Dwarf_die): New class.
1655 (class Dwarf_info_reader): New class.
1656 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1657 (Sized_dwarf_line_info::symbol_section): Remove member function.
1658 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1659 base class.
1660 * gdb-index.cc: New source file.
1661 * gdb-index.h: New source file.
1662 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1663 and .debug_types sections, call Layout::add_to_gdb_index.
1664 (Sized_relobj_incr::do_section_name): Implement.
1665 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1666 return type; Implement.
1667 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1668 return type.
1669 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1670 parameter list and return type.
1671 (Sized_incr_dynobj::do_section_contents): Likewise.
1672 * layout.cc: Include gdb-index.h.
1673 (Layout::Layout): Initialize gdb_index_data_.
1674 (Layout::init_fixed_output_section): Check for .gdb_index section.
1675 (Layout::add_to_gdb_index): New function. Instantiate.
1676 * layout.h: Add forward declaration for class Gdb_index.
1677 (Layout::add_to_gdb_index): New member function.
1678 (Layout::gdb_index_data_): New data member.
1679 * main.cc: Include gdb-index.h.
1680 (main): Print statistics for gdb index.
1681 * object.cc (Object::section_contents): Move code into
1682 do_section_contents.
1683 (need_decompressed_section): Check for sections needed when building
1684 gdb index.
1685 (build_compressed_section_map): Likewise.
1686 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1687 gdb index.
1688 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1689 sections; call Layout::add_to_gdb_index.
1690 (Sized_relobj_file::do_decompressed_section_contents): Call
1691 do_section_contents directly.
1692 * object.h (Object::do_section_contents): Adjust parameter list and
1693 return type.
1694 (Object::do_decompressed_section_contents): Call do_section_contents
1695 directly.
1696 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1697 return type.
1698 * options.h (class General_options): Add --gdb-index option.
1699 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1700 list and return type.
1701 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1702 * reloc.h (Track_relocs::checkpoint): New function.
1703 (Track_relocs::reset): New function.
1704
1705 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1706 New test cases.
1707 * testsuite/Makefile.in: Regenerate.
1708 * testsuite/gdb_index_test.cc: New test source file.
1709 * testsuite/gdb_index_test_1.sh: New test source file.
1710 * testsuite/gdb_index_test_2.sh: New test source file.
1711
1712 2012-03-19 Doug Kwan <dougkwan@google.com>
1713
1714 * arm.cc (Target_arm::do_define_standard_symbols): New method.
1715 (Target_arm::do_finalize_sections): Remove code which defines
1716 __exidx_start and __exidx_end. Make symbol table parameter
1717 anonymous as it is not used.
1718 * gold.cc (queue_middle_tasks): Call target hook to define any
1719 target-specific symbols.
1720 * target.h (Target::define_standard_symbols): New method.
1721 (Target::do_define_standard_symbols): Same.
1722 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1723 * testsuite/Makefile.in: Regenerate.
1724 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1725 and __exidx_end.
1726 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1727 relocations are generated for __exidx_start and __exidx_end.
1728
1729 2012-03-16 Doug Kwan <dougkwan@google.com>
1730
1731 * testsuite/Makefile.am: Disable test initpri3b.
1732 * testsuite/Makefile.in: Regenerate.
1733
1734 2012-03-15 Doug Kwan <dougkwan@google.com>
1735
1736 * arm.cc (Target_arm::got_section): Make .got section read-only
1737 if -z now is given.
1738
1739 2012-03-15 Ian Lance Taylor <iant@google.com>
1740
1741 PR gold/13850
1742 * layout.cc (Layout::make_output_section): Correctly mark
1743 SHT_INIT_ARRAY, et. al., as relro.
1744
1745 2012-03-14 Doug Kwan <dougkwan@google.com>
1746
1747 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1748 dynamic relocations for protected symbols in shared objects.
1749
1750 2012-03-13 Ian Lance Taylor <iant@google.com>
1751
1752 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1753 keep the larger alignment.
1754
1755 2012-03-12 Cary Coutant <ccoutant@google.com>
1756
1757 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1758 handling of DW_LNE_define_file.
1759
1760 2012-03-12 Cary Coutant <ccoutant@google.com>
1761
1762 * reduced_debug_output.cc
1763 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1764 codes to switch.
1765
1766 2012-02-29 Cary Coutant <ccoutant@google.com>
1767
1768 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1769
1770 2012-02-29 Cary Coutant <ccoutant@google.com>
1771
1772 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1773 Call Object::decompressed_section_contents.
1774 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1775 New dtor.
1776 (Sized_dwarf_line_info::buffer_start_): New data member.
1777 * merge.cc (Output_merge_data::do_add_input_section): Call
1778 Object::decompressed_section_contents.
1779 (Output_merge_string::do_add_input_section): Likewise.
1780 * object.cc (need_decompressed_section): New function.
1781 (build_compressed_section_map): Decompress sections needed later.
1782 (Sized_relobj_file::do_decompressed_section_contents): New function.
1783 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1784 * object.h (Object::decompressed_section_contents): New function.
1785 (Object::discard_decompressed_sections): New function.
1786 (Object::do_decompressed_section_contents): New function.
1787 (Object::do_discard_decompressed_sections): New function.
1788 (Compressed_section_info): New type.
1789 (Compressed_section_map): Include decompressed section contents.
1790 (Sized_relobj_file::do_decompressed_section_contents): New function.
1791 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1792
1793 2012-02-16 Cary Coutant <ccoutant@google.com>
1794
1795 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1796 * testsuite/Makefile.in: Regenerate.
1797
1798 2012-02-14 Cary Coutant <ccoutant@google.com>
1799
1800 * options.cc (General_options::finalize): Disallow -pie and -static.
1801
1802 2012-02-03 Doug Kwan <dougkwan@google.com>
1803
1804 * arm.cc (Arm_relocate_functions::abs8,
1805 Arm_relocate_functions::abs16): Use
1806 Bits::has_signed_unsigned_overflow32.
1807 (Arm_relocate_functions::thm_abs8): Correct range of
1808 overflow check.
1809 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1810 in assertions.
1811
1812 2012-02-02 Doug Kwan <dougkwan@google.com>
1813
1814 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1815 position independent outputs, not just shared objects.
1816
1817 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1818
1819 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1820 * configure: Regenerated.
1821
1822 2012-01-27 Ian Lance Taylor <iant@google.com>
1823
1824 * reloc.h (Bits): New class with static functions, copied from
1825 namespace utils in arm.cc.
1826 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1827 instead.
1828
1829 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1830
1831 * incremental.cc (write_info_blocks): Correct relocation offset.
1832
1833 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1834
1835 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1836 (Relocate::tls_gd_to_le): Likewise.
1837
1838 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1839
1840 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1841
1842 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1843
1844 * configure.ac: Check if -mcmodel=medium works.
1845 * configure: Regenerated.
1846
1847 2012-01-24 Cary Coutant <ccoutant@google.com>
1848
1849 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1850 definition and ...
1851 (read_unsigned_LEB_128_x): ... this new function.
1852 (read_signed_LEB_128): Replaced with inline definition and ...
1853 (read_signed_LEB_128_x): ... this new function.
1854 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1855 (read_unsigned_LEB_128): Add inline definition.
1856 (read_signed_LEB_128_x): New function.
1857 (read_signed_LEB_128): Add inline definition.
1858 * testsuite/Makefile.am (leb128_unittest): New unit test.
1859 * testsuite/Makefile.in: Regenerate.
1860 * testsuite/leb128_unittest.cc: New unit test.
1861
1862 2012-01-23 Ian Lance Taylor <iant@google.com>
1863
1864 PR gold/13617
1865 * i386.cc (Target_i386::do_code_fill): When using a jmp
1866 instruction, pad with nop instructions.
1867 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1868
1869 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1870
1871 * x86_64.cc (gc_process_relocs): Add typename on types used in
1872 template.
1873 (scan_relocs): Likewise.
1874 (relocate_section): Likewise.
1875 (apply_relocation): Likewise.
1876
1877 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1878
1879 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1880 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1881 under x32.
1882
1883 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1884
1885 * x86_64.cc: Initial support for x32.
1886
1887 2012-01-03 Cary Coutant <ccoutant@google.com>
1888
1889 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1890 Use abstract base class for GOT.
1891 * gold/output.h (class Output_data_got_base): New abstract base class.
1892 (class Output_data_got): Derive from new base class, adjust ctors.
1893 (Output_data_got::reserve_slot): Make virtual; rename to
1894 do_reserve_slot; Adjust callers.
1895 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1896 pointer to abstract base class.
1897 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1898
1899 2011-12-18 Ian Lance Taylor <iant@google.com>
1900
1901 * object.h (Relobj::local_symbol_value): New function.
1902 (Relobj::local_plt_offset): New function.
1903 (Relobj::local_has_got_offset): New function.
1904 (Relobj::local_got_offset): New function.
1905 (Relobj::set_local_got_offset): New function.
1906 (Relobj::do_local_symbol_value): New pure virtual function.
1907 (Relobj::do_local_plt_offset): Likewise.
1908 (Relobj::do_local_has_got_offset): Likewise.
1909 (Relobj::do_local_got_offset): Likewise.
1910 (Relobj::do_set_local_got_offset): Likewise.
1911 (Sized_relobj::do_local_has_got_offset): Rename from
1912 local_has_got_offset.
1913 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1914 (Sized_relobj::do_set_local_got_offset): Rename from
1915 set_local_got_offset.
1916 (Sized_relobj_file::do_local_plt_offset): Rename from
1917 local_plt_offset.
1918 (Sized_relobj_file::do_local_symbol_value): New function.
1919 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1920 local_plt_offset.
1921 * output.cc (Output_data_got::Got_entry::write): Change object to
1922 Relobj. Use local_symbol_value.
1923 (Output_data_got::add_global_with_rel): Change rel_dyn to
1924 Output_data_reloc_generic*. Use add_global_generic.
1925 (Output_data_got::add_global_with_rela): Remove. Change all
1926 callers to use add_global_with_rel.
1927 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1928 Output_data_reloc_generic*. Use add_global_generic.
1929 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1930 callers to use add_global_pair_with_rel.
1931 (Output_data_got::add_local): Change object to Relobj*.
1932 (Output_data_got::add_local_plt): Likewise.
1933 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1934 change rel_dyn to Output_data_reloc_generic*. Use
1935 add_local_generic.
1936 (Output_data_got::add_local_with_rela): Remove. Change all
1937 callers to use all_local_with_rel.
1938 (Output_data_got::add_local_pair_with_rel): Change object to
1939 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1940 add_output_section_generic.
1941 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1942 callers to use add_local_pair_with_rel.
1943 (Output_data_got::reserve_local): Change object to Relobj*.
1944 * output.h: (class Output_data_reloc_generic): Add pure virtual
1945 declarations for add_global_generic, add_local_generic,
1946 add_output_section_generic.
1947 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1948 functions for Output_data_reloc_generic. Update declarations for
1949 changes listed in output.cc.
1950 (class Output_data_got): Change template parameter to got_size.
1951 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1952 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1953 function.
1954 (Sized_relobj_incr::do_local_plt_offset): New function.
1955 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1956 add_global_generic.
1957
1958 2011-12-17 Cary Coutant <ccoutant@google.com>
1959
1960 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1961 * resolve.cc (Symbol_table::resolve): Likewise.
1962 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1963 arrays.
1964 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1965
1966 2011-12-16 Ian Lance Taylor <iant@google.com>
1967
1968 * output.h (Output_data_reloc_generic::add): Only call
1969 add_dynamic_reloc if this is a dynamic reloc section.
1970
1971 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1972
1973 PR gold/13505
1974 * target-reloc.h (apply_relocation): Replace <64, false> with
1975 <size, big_endian>.
1976
1977 2011-11-25 Nick Clifton <nickc@redhat.com>
1978
1979 * po/it.po: New Italian translation.
1980
1981 2011-11-17 Sterling Augustine <saugustine@google.com>
1982
1983 * script.cc (script_include_directive): Implement.
1984 (read_script_file): New local variables name and search_path. Update
1985 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1986 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1987 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1988
1989 2011-11-11 Sterling Augustine <saugustine@google.com>
1990
1991 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1992 (file_or_sections_cmd): Likewise.
1993
1994 2011-11-11 Doug Kwan <dougkwan@google.com>
1995
1996 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1997 if --just-symbols is given.
1998
1999 2011-11-10 Doug Kwan <dougkwan@google.com>
2000
2001 PR gold/13362
2002 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2003 when processing data relocs.
2004 * reloc.h (Relocate_functions::rel_unaligned): New method.
2005 (Relocate_functions::pcrel_unaligned): Ditto.
2006 (Relocate_functions::rel32_unaligned): Ditto.
2007 (Relocate_functions::pcrel32_unaligned): Ditto.
2008
2009 2011-11-09 Doug Kwan <dougkwan@google.com>
2010
2011 PR gold/13362
2012 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2013 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2014 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2015 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2016 (Relocate_functions::rel_unaligned): New.
2017 (Relocate_functions::rel32_unaligned): New.
2018 * target-reloc.h (relocate_for_relocatable): Add code to handle
2019 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2020 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2021 arm_unaligned_reloc_r): New targets.
2022 * testsuite/Makefile.in: Regenerate.
2023 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2024 linking.
2025
2026 2011-11-02 Ian Lance Taylor <iant@google.com>
2027
2028 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2029 NATIVE_LINKER.
2030 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2031 * options.cc (General_options::finalize): Use library search path
2032 from configure script if specified. If not native and no sysroot,
2033 only search TOOLLIBDIR.
2034 * options.h (Search_directory::Search_directory): Change name to
2035 const std::string&.
2036 (General_options::add_to_library_path_with_sysroot): Change arg to
2037 const std::string&.
2038 * configure, Makefile.in, config.in: Rebuild.
2039
2040 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2041
2042 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2043 we are working around the ARM1176 Erratum.
2044 * options.h (General_options::fix_arm1176): Add option.
2045 * testsuite/Makefile.am: Add testcases, and keep current ones
2046 working.
2047 * testsuite/Makefile.in: Regenerate.
2048 * testsuite/arm_fix_1176.s: New file.
2049 * testsuite/arm_fix_1176.sh: Likewise.
2050
2051 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2052
2053 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2054 may_use_blx_.
2055 (Target_arm::may_use_blx): Remove method.
2056 (Target_arm::set_may_use_blx): Likewise.
2057 (Target_arm::may_use_v4t_interworking): New method.
2058 (Target_arm::may_use_v5t_interworking): Likewise.
2059 (Target_arm::may_use_blx_): Remove member variable.
2060 (Arm_relocate_functions::arm_branch_common): Check for v5T
2061 interworking.
2062 (Arm_relocate_functions::thumb_branch_common): Likewise.
2063 (Reloc_stub::stub_type_for_reloc): Likewise.
2064 (Target_arm::do_finalize_sections): Correct interworking checks.
2065 * testsuite/Makefile.am: Add new tests.
2066 * testsuite/Makefile.in: Regenerate.
2067 * testsuite/arm_farcall_arm_arm.s: New test.
2068 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2069 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2070 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2071 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2072 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2073 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2074 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2075
2076 2011-10-31 Cary Coutant <ccoutant@google.com>
2077
2078 PR gold/13023
2079 * expression.cc (Expression::eval_with_dot): Add
2080 is_section_dot_assignment parameter.
2081 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2082 absolute and assigning to dot within a section.
2083 * script-sections.cc
2084 (Output_section_element_assignment::set_section_addresses): Pass
2085 dot_section to set_if_absolute.
2086 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2087 as is_section_dot_assignment flag to eval_with_dot.
2088 (Output_section_element_dot_assignment::set_section_addresses):
2089 Likewise.
2090 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2091 parameter. Also set value if relative to dot_section; set the
2092 symbol's output_section.
2093 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2094 parameter. Adjust all callers.
2095 (Expression::eval_maybe_dot): Likewise.
2096 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2097 Adjust all callers.
2098 * testsuite/script_test_2.t: Test assignment of an absolute value
2099 to dot within an output section element.
2100
2101 2011-10-31 Cary Coutant <ccoutant@google.com>
2102
2103 * options.h (class General_options): Add --[no-]gnu-unique options.
2104 * symtab.cc (Symbol_table::sized_write_globals): Convert
2105 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2106
2107 2011-10-31 Cary Coutant <ccoutant@google.com>
2108
2109 PR gold/13359
2110 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2111 unnecessary assertion.
2112 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2113
2114 2011-10-31 Sriraman Tallam <tmsriram@google.com>
2115
2116 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2117 gc_mark_symbol.
2118 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2119 gc_mark_symbol.
2120 Change to just keep the section associated with symbol.
2121 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2122 they are externally visible and --export-dynamic is turned on.
2123 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2124
2125 2011-10-19 Ian Lance Taylor <iant@google.com>
2126
2127 PR gold/13163
2128 * script-sections.cc
2129 (Output_section_element_dot_assignment::needs_output_section): New
2130 function.
2131
2132 2011-10-19 Ian Lance Taylor <iant@google.com>
2133
2134 PR gold/13204
2135 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2136 --section-start option was seen.
2137 * options.h (General_options::any_section_start): New function.
2138
2139 2011-10-18 David S. Miller <davem@davemloft.net>
2140
2141 PR binutils/13301
2142 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2143 member to track relocation locations that have moved during TLS
2144 reloc optimizations.
2145 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2146 (Target_sparc::Relocate::relocate): Adjust view down by 4
2147 bytes if it matches reloc_adjust_addr_.
2148 (Target_sparc::Relocate::relocate_tls): Always move the
2149 __tls_get_addr call delay slot instruction forward 4 bytes when
2150 performing relaxation.
2151
2152 2011-10-18 Cary Coutant <ccoutant@google.com>
2153
2154 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2155 (Output_file::map_no_anonymous): Check for non-zero
2156 return code from posix_fallocate.
2157
2158 2011-10-17 Cary Coutant <ccoutant@google.com>
2159
2160 PR gold/13245
2161 * plugin.cc (is_visible_from_outside): Check for symbols
2162 referenced from dynamic objects.
2163 * resolve.cc (Symbol_table::resolve): Don't count references
2164 from dynamic objects as references from real ELF files.
2165 * testsuite/plugin_test_2.sh: Adjust expected result.
2166
2167 2011-10-17 Cary Coutant <ccoutant@google.com>
2168
2169 * gold.cc: Include timer.h.
2170 (queue_middle_tasks): Stamp time.
2171 (queue_final_tasks): Likewise.
2172 * main.cc (main): Store timer in parameters. Print timers
2173 for each pass.
2174 * parameters.cc (Parameters::Parameters): Initialize timer_.
2175 (Parameters::set_timer): New function.
2176 (set_parameters_timer): New function.
2177 * parameters.h (Parameters::set_timer): New function.
2178 (Parameters::timer): New function.
2179 (Parameters::timer_): New data member.
2180 (set_parameters_timer): New function.
2181 * timer.cc (Timer::stamp): New function.
2182 (Timer::get_pass_time): New function.
2183 * timer.h (Timer::stamp): New function.
2184 (Timer::get_pass_time): New function.
2185 (Timer::pass_times_): New data member.
2186
2187 2011-10-17 Cary Coutant <ccoutant@google.com>
2188
2189 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2190 task for members of lib groups.
2191
2192 2011-10-17 Cary Coutant <ccoutant@google.com>
2193
2194 PR gold/13288
2195 * fileread.cc (File_read::find_view): Add assert.
2196 (File_read::make_view): Move bounds check (replace with assert)...
2197 (File_read::find_or_make_view): ... to here.
2198
2199 2011-10-12 Cary Coutant <ccoutant@google.com>
2200
2201 * output.cc (Output_file::open_base_file): Handle case where
2202 ::read returns less than requested size.
2203
2204 2011-10-10 Cary Coutant <ccoutant@google.com>
2205
2206 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
2207 Initialize defined_count_.
2208 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2209 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2210 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2211 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2212 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
2213 * incremental.h (Sized_relobj_incr::defined_count_): New data
2214 member.
2215 (Sized_incr_dynobj::defined_count_): New data member.
2216 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
2217 Return zeroes instead of internal error.
2218
2219 2011-10-10 Cary Coutant <ccoutant@google.com>
2220
2221 PR gold/13249
2222 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
2223 (Output_reloc::symbol_value): Return PLT offset if flag is set.
2224 * output.h (class Output_reloc): Add use_plt_offset flag.
2225 (Output_reloc::type_): Adjust size of bit field.
2226 (Output_reloc::use_plt_offset_): New bit field.
2227 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2228 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2229 flag. Adjust all callers.
2230 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
2231 creating RELATIVE relocations.
2232
2233 2011-10-10 Nick Clifton <nickc@redhat.com>
2234
2235 * po/es.po: Updated Spanish translation.
2236 * po/fi.po: Updated Finnish translation.
2237
2238 2011-10-03 Diego Novillo <dnovillo@google.com>
2239
2240 * options.cc (parse_uint): Fix dereference of RETVAL.
2241
2242 2011-09-29 Sriraman Tallam <tmsriram@google.com>
2243
2244 * layout.h (section_order_map_): New member.
2245 (get_section_order_map): New member function.
2246 * output.cc (Output_section::add_input_section): Check for patterns
2247 only when --section-ordering-file is specified.
2248 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2249 output_sections have been formed.
2250 * layout.cc (Layout_Layout): Initialize section_order_map_.
2251 * plugin.cc (update_section_order): Store order in order_map. Do not
2252 update the order.
2253 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2254 * testsuite/Makefile.in: Regenerate.
2255 * testsuite/plugin_section_order.c: New file.
2256 * testsuite/plugin_final_layout.cc: New file.
2257 * testsuite/plugin_final_layout.sh: New file.
2258
2259 2011-09-29 Cary Coutant <ccoutant@google.com>
2260
2261 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2262 Check for NULL.
2263 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
2264 symbols during incremental update.
2265 (Symbol_table::add_from_dynobj): Likewise.
2266
2267 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2268 Ian Lance Taylor <iant@google.com>
2269
2270 * symtab.cc (Symbol_table::define_special_symbol): Always
2271 canonicalize version string.
2272
2273 2011-09-26 Cary Coutant <ccoutant@google.com>
2274
2275 * gold.cc (queue_initial_tasks): Move option checks ...
2276 * options.cc (General_options::finalize): ... to here. Disable
2277 some options; make others fatal.
2278
2279 2011-09-26 Cary Coutant <ccoutant@google.com>
2280
2281 gcc PR lto/47247
2282 * plugin.cc (get_symbols_v2): New function.
2283 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2284 (is_referenced_from_outside): New function.
2285 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2286 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2287 (get_symbols): Pass version parameter.
2288 (get_symbols_v2): New function.
2289 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2290 parameter.
2291 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2292 (onload): Add LDPT_GET_SYMBOLS_V2.
2293 (all_symbols_read_hook): Use get_symbols_v2; check for
2294 LDPR_PREVAILING_DEF_IRONLY_EXP.
2295 * testsuite/plugin_test_3.sh: Update expected results.
2296
2297 2011-09-23 Simon Baldwin <simonb@google.com>
2298
2299 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2300 configuration options.
2301 * configure: Regenerate.
2302 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2303 * Makefile.in: Regenerate.
2304 * testsuite/Makefile.in: Regenerate.
2305
2306 2011-09-19 Sriraman Tallam <tmsriram@google.com>
2307
2308 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2309
2310 2011-09-19 Cary Coutant <ccoutant@google.com>
2311
2312 * incremental.cc (can_incremental_update): Fix typo in comment.
2313 * incremental.h (can_incremental_update): Likewise.
2314
2315 2011-09-18 Cary Coutant <ccoutant@google.com>
2316
2317 * incremental.cc (can_incremental_update): New function.
2318 * incremental.h (can_incremental_update): New function.
2319 * layout.cc (Layout::init_fixed_output_section): Call it.
2320 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2321 * object.cc (Sized_relobj_file::do_layout): Call
2322 can_incremental_update.
2323
2324 2011-09-13 Cary Coutant <ccoutant@google.com>
2325
2326 * configure.ac: Check for glibc support for gnu_indirect_function
2327 support with static linking, setting automake conditional
2328 IFUNC_STATIC.
2329 * Makefile.in: Regenerate.
2330 * configure: Regenerate.
2331
2332 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2333 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2334 for IFUNC_STATIC.
2335 * testsuite/Makefile.in: Regenerate.
2336
2337 2011-09-13 Cary Coutant <ccoutant@google.com>
2338
2339 * incremental.cc (Sized_relobj_incr::do_layout): Call
2340 report_comdat_group for kept comdat sections.
2341 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2342 * testsuite/Makefile.in: Regenerate.
2343 * testsuite/incr_comdat_test_1.cc: New source file.
2344 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2345 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2346 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2347
2348 2011-09-13 Ian Lance Taylor <iant@google.com>
2349
2350 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2351 variable external_symbols_offset.
2352
2353 2011-09-12 Ian Lance Taylor <iant@google.com>
2354
2355 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2356 triggered if object has no symbols.
2357
2358 2011-09-09 David S. Miller <davem@davemloft.net>
2359
2360 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2361 (Output_fill_debug_line::do_write): Likewise.
2362
2363 2011-08-29 Cary Coutant <ccoutant@google.com>
2364
2365 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2366 casts to match formatting specs.
2367 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2368
2369 2011-08-26 Cary Coutant <ccoutant@google.com>
2370
2371 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2372 remaining hole size when allocating.
2373 (Layout::make_output_section): Set fill methods for debug sections.
2374 * layout.h (Free_list::Free_list_node): Move from private to
2375 public.
2376 (Free_list::set_min_hole_size): New function.
2377 (Free_list::begin, Free_list::end): New functions.
2378 (Free_list::min_hole_): New data member.
2379 * output.cc: Include dwarf.h.
2380 (Output_fill_debug_info::do_minimum_hole_size): New function.
2381 (Output_fill_debug_info::do_write): New function.
2382 (Output_fill_debug_line::do_minimum_hole_size): New function.
2383 (Output_fill_debug_line::do_write): New function.
2384 (Output_section::Output_section): Initialize new data member.
2385 (Output_section::set_final_data_size): Ensure patch space is larger
2386 than minimum hole size.
2387 (Output_section::do_write): Fill holes in debug sections.
2388 * output.h (Output_fill): New class.
2389 (Output_fill_debug_info): New class.
2390 (Output_fill_debug_line): New class.
2391 (Output_section::set_free_space_fill): New function.
2392 (Output_section::free_space_fill_): New data member.
2393 * testsuite/Makefile.am (incremental_test_3): Add
2394 --incremental-patch option.
2395 (incremental_test_4): Likewise.
2396 (incremental_test_5): Likewise.
2397 (incremental_test_6): Likewise.
2398 (incremental_copy_test): Likewise.
2399 (incremental_common_test_1): Likewise.
2400 * testsuite/Makefile.in: Regenerate.
2401
2402 2011-08-26 Nick Clifton <nickc@redhat.com>
2403
2404 * po/es.po: Updated Spanish translation.
2405
2406 2011-08-01 Cary Coutant <ccoutant@google.com>
2407
2408 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2409 * gold/testsuite/Makefile.in: Regenerate.
2410 * gold/testsuite/justsyms_exec.c: New source file.
2411 * gold/testsuite/justsyms_lib.c: New source file.
2412
2413 2011-08-01 Cary Coutant <ccoutant@google.com>
2414
2415 * layout.cc (Layout::set_segment_offsets): Don't realign text
2416 segment if -Ttext was specified.
2417 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2418 file type.
2419 * object.h (Sized_relobj_file::e_type): New function.
2420 (Sized_relobj_file::e_type_): New data member.
2421 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2422 base address for ET_EXEC files.
2423 * target.cc (Target::do_make_elf_object_implementation): Allow
2424 ET_EXEC files with --just-symbols option.
2425
2426 2011-07-28 Cary Coutant <ccoutant@google.com>
2427
2428 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2429 Add thread_number parameter.
2430 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2431 * workqueue-threads.cc
2432 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2433 current thread if its thread number is greater than desired thread
2434 count.
2435 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2436 Add thread_number parameter.
2437 (Workqueue::should_cancel_thread): Likewise.
2438 (Workqueue::find_runnable_or_wait): Pass thread_number to
2439 should_cancel_thread.
2440 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2441 parameter.
2442
2443 2011-07-22 Sriraman Tallam <tmsriram@google.com>
2444
2445 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2446 only after checking if it cannot be forced local.
2447 * symtab.h (is_externally_visible): Check if the symbol is not forced
2448 local.
2449
2450 2011-07-15 Ian Lance Taylor <iant@google.com>
2451
2452 * options.h (class General_options): Add --print-output-format.
2453 Move -EL next to -EB, for better --help output.
2454 * target-select.cc: Include <cstdio>, "options.h", and
2455 "parameters.h".
2456 (Target_selector::do_target_bfd_name): New function.
2457 (print_output_format): New function.
2458 * target-select.h (class Target_selector): Update declarations.
2459 (Target_selector::target_bfd_name): New function.
2460 (print_output_format): Declare.
2461 * main.cc: Include "target-select.h".
2462 (main): Handle --print-output-format.
2463 * gold.cc: Include "target-select.h".
2464 (queue_initial_tasks): Handle --print-output-format when there are
2465 no input files.
2466 * parameters.cc (parameters_force_valid_target): Give a better
2467 error message if -EB/-EL does not match target.
2468 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2469 function.
2470
2471 2011-07-15 Ian Lance Taylor <iant@google.com>
2472
2473 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2474 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2475 (Output_data_plt_i386::do_write): Write address of .dynamic
2476 section to first entry in .got.plt section.
2477 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2478 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2479 Initialize layout_.
2480 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2481 section to first entry in .got.plt section.
2482 * layout.h (Layout::dynamic_section): New function.
2483
2484 2011-07-13 Sriraman Tallam <tmsriram@google.com>
2485
2486 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2487 to claim_file call.
2488 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2489 input_section_position_, and input_section_glob_.
2490 (read_layout_from_file): Call function section_ordering_specified.
2491 * layout.h (is_section_ordering_specified): New function.
2492 (section_ordering_specified): New function.
2493 (section_ordering_specified_): New boolean member.
2494 * main.cc(main): Call load_plugins after layout object is defined.
2495 * output.cc (Output_section::add_input_section): Use
2496 function section_ordering_specified to check if section ordering is
2497 needed.
2498 * output.cc (Output_section::add_relaxed_input_section): Use
2499 function section_ordering_specified to check if section ordering is
2500 needed.
2501 (Output_section::update_section_layout): New function.
2502 (Output_section::sort_attached_input_sections): Check if input section
2503 must be reordered.
2504 * output.h (Output_section::update_section_layout): New function.
2505 * plugin.cc (get_section_count): New function.
2506 (get_section_type): New function.
2507 (get_section_name): New function.
2508 (get_section_contents): New function.
2509 (update_section_order): New function.
2510 (allow_section_ordering): New function.
2511 (Plugin::load): Add the new interfaces to the transfer vector.
2512 (Plugin_manager::load_plugins): New parameter.
2513 (Plugin_manager::all_symbols_read): New parameter.
2514 (Plugin_manager::claim_file): New parameter. Save the elf object for
2515 unclaimed objects.
2516 (Plugin_manager::get_elf_object): New function.
2517 (Plugin_manager::get_view): Change to directly use the bool to check
2518 if get_view is called from claim_file_hook.
2519 * plugin.h (input_objects): New function
2520 (Plugin__manager::load_plugins): New parameter.
2521 (Plugin_manager::claim_file): New parameter.
2522 (Plugin_manager::get_elf_object): New function.
2523 (Plugin_manager::in_claim_file_handler): New function.
2524 (Plugin_manager::in_claim_file_handler_): New member.
2525 (layout): New function.
2526 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2527 handler with an extra parameter. Make the elf object before calling
2528 claim_file handler.
2529 * testsuite/plugin_test.c (get_section_count): New function pointer.
2530 (get_section_type): New function pointer.
2531 (get_section_name): New function pointer.
2532 (get_section_contents): New function pointer.
2533 (update_section_order): New function pointer.
2534 (allow_section_ordering): New function pointer.
2535 (onload): Check if the new interfaces exist.
2536
2537 2011-07-13 Ian Lance Taylor <iant@google.com>
2538
2539 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2540 relro section.
2541 * x86_64.cc (Target_x86_64::got_section): Likewise.
2542 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2543 (relro_now_test_SOURCES): New variable.
2544 (relro_now_test_DEPENDENCIES): New variable.
2545 (relro_now_test_LDFLAGS): New variable.
2546 (relro_now_test_LDADD): New variable.
2547 (relro_now_test.so): New target.
2548 * testsuite/Makefile.in: Rebuild.
2549
2550 2011-07-12 Ian Lance Taylor <iant@google.com>
2551
2552 PR gold/12980
2553 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2554 GLOB_DAT relocation rather than a RELATIVE relocation for a
2555 protected symbol when creating a shared library.
2556 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2557 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2558 * testsuite/protected_main_1.cc (main): Test that protected
2559 function has same address.
2560
2561 2011-07-11 Ian Lance Taylor <iant@google.com>
2562
2563 PR gold/12979
2564 * options.h (class General_options): Add -Bgroup.
2565 * options.cc (General_options::finalize): If -Bgroup is set,
2566 default to --unresolved-symbols=report-all.
2567 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2568 * target-reloc.h (issue_undefined_symbol_error): Handle
2569 --unresolved-symbols=report-all.
2570
2571 2011-07-08 Ian Lance Taylor <iant@google.com>
2572
2573 PR gold/11985
2574 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2575 if linker script discards key sections.
2576 (Layout::create_dynamic_symtab): Likewise.
2577 (Layout::assign_local_dynsym_offsets): Likewise.
2578 (Layout::sized_create_version_sections): Likewise.
2579 (Layout::create_interp): Likewise.
2580 (Layout::finish_dynamic_section): Likewise.
2581 (Layout::set_dynamic_symbol_size): Likewise.
2582
2583 2011-07-08 Ian Lance Taylor <iant@google.com>
2584
2585 PR gold/12386
2586 * options.h (class General_options): Add --unresolved-symbols.
2587 * target-reloc.h (issue_undefined_symbol_error): Check
2588 --unresolved-symbols. Add comments.
2589
2590 2011-07-08 Ian Lance Taylor <iant@google.com>
2591
2592 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2593 expression more complex.
2594
2595 2011-07-08 Ian Lance Taylor <iant@google.com>
2596
2597 PR gold/11317
2598 * target-reloc.h (issue_undefined_symbol_error): New inline
2599 function, broken out of relocate_section.
2600 (relocate_section): Call issue_undefined_symbol_error.
2601 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2602 there is no TLS segment if we are about to issue an undefined
2603 symbol error.
2604 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2605
2606 2011-07-08 Ian Lance Taylor <iant@google.com>
2607
2608 PR gold/12279
2609 * resolve.cc (Symbol_table::should_override): Add fromtype
2610 parameter. Change all callers. Give error when linking together
2611 TLS and non-TLS symbol.
2612 (Symbol_table::should_override_with_special): Add fromtype
2613 parameter. Change all callers.
2614 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2615 there is no TLS segment if we have reported some errors.
2616 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2617
2618 2011-07-08 Ian Lance Taylor <iant@google.com>
2619
2620 PR gold/12372
2621 * target.h (Target::plt_address_for_global): New function.
2622 (Target::plt_address_for_local): New function.
2623 (Target::plt_section_for_global): Remove.
2624 (Target::plt_section_for_local): Remove.
2625 (Target::do_plt_address_for_global): New virtual function.
2626 (Target::do_plt_address_for_local): New virtual function.
2627 (Target::do_plt_section_for_global): Remove.
2628 (Target::do_plt_section_for_local): Remove.
2629 (Target::register_global_plt_entry): Add Symbol_table and Layout
2630 parameters.
2631 * output.cc (Output_data_got::Got_entry::write): Use
2632 plt_address_for_global and plt_address_for_local.
2633 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2634 address of output section.
2635 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2636 got_irelative_, and irelative_count_ fields. Update
2637 declarations.
2638 (Output_data_plt_i386::has_irelative_section): New function.
2639 (Output_data_plt_i386::entry_count): Add irelative_count_.
2640 (Output_data_plt_i386::set_final_data_size): Likewise.
2641 (class Target_i386): Add got_irelative_ and rel_irelative_
2642 fields. Update declarations.
2643 (Target_i386::Target_i386): Initialize new fields.
2644 (Target_i386::do_plt_address_for_global): New function replacing
2645 do_plt_section_for_global.
2646 (Target_i386::do_plt_address_for_local): New function replacing
2647 do_plt_section_for_local.
2648 (Target_i386::got_section): Create got_irelative_.
2649 (Target_i386::rel_irelative_section): New function.
2650 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2651 fields. Don't define __rel_iplt_{start,end}.
2652 (Output_data_plt_i386::add_entry): Add symtab and layout
2653 parameters. Change all callers. Use different PLT and GOT for
2654 IFUNC symbols.
2655 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2656 layout parameters. Change all callers. Use different PLT and
2657 GOT.
2658 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2659 (Output_data_plt_i386::rel_irelative): New function.
2660 (Output_data_plt_i386::address_for_global): New function.
2661 (Output_data_plt_i386::address_for_local): New function.
2662 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2663 IRELATIVE GOT when changing IFUNC GOT entries.
2664 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2665 reloc.
2666 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2667 if we didn't create an IRELATIVE GOT.
2668 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2669 plt_address_for_local.
2670 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2671 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2672 got_irelative_, and irelative_count_ fields. Update
2673 declarations.
2674 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2675 Initialize new fields. Remove symtab parameter. Change all
2676 callers.
2677 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2678 irelative_count_.
2679 (Output_data_plt_x86_64::has_irelative_section): New function.
2680 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2681 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2682 fields. Update declarations.
2683 (Target_x86_64::Target_x86_64): Initialize new fields.
2684 (Target_x86_64::do_plt_address_for_global): New function replacing
2685 do_plt_section_for_global.
2686 (Target_x86_64::do_plt_address_for_local): New function replacing
2687 do_plt_section_for_local.
2688 (Target_x86_64::got_section): Create got_irelative_.
2689 (Target_x86_64::rela_irelative_section): New function.
2690 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2691 all callers. Don't create __rel_iplt_{start,end}.
2692 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2693 parameters. Change all callers. Use different PLT and GOT for
2694 IFUNC symbols.
2695 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2696 layout parameters. Change all callers. Use different PLT and
2697 GOT.
2698 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2699 parameters. Change all callers. Use different PLT and GOT for
2700 IFUNC symbols.
2701 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2702 (Output_data_plt_x86_64::rela_irelative): New function.
2703 (Output_data_plt_x86_64::address_for_global): New function.
2704 (Output_data_plt_x86_64::address_for_local): New function.
2705 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2706 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2707 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2708 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2709 parameters.
2710 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2711 reloc.
2712 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2713 symbols if we didn't create an IRELATIVE GOT.
2714 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2715 plt_address_for_local.
2716 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2717 * testsuite/ifuncvar1.c: New test file.
2718 * testsuite/ifuncvar2.c: New test file.
2719 * testsuite/ifuncvar3.c: New test file.
2720 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2721 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2722 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2723 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2724 * testsuite/Makefile.in: Rebuild.
2725
2726 2011-07-07 Cary Coutant <ccoutant@google.com>
2727
2728 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2729 (two_file_test_1_ndebug.o): Likewise.
2730 (two_file_test_1b_ndebug.o): Likewise.
2731 (two_file_test_2_ndebug.o): Likewise.
2732 (two_file_test_main_ndebug.o): Likewise.
2733 (incremental_test_2): Link with no-debug versions.
2734
2735 2011-07-06 Cary Coutant <ccoutant@google.com>
2736
2737 * gold/incremental.cc
2738 (Output_section_incremental_inputs::write_info_blocks): Check for
2739 hidden and internal symbols.
2740
2741 2011-07-06 Cary Coutant <ccoutant@google.com>
2742
2743 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2744 Check disposition for startup file.
2745 (Incremental_inputs::report_command_line): Ignore
2746 --incremental-startup-unchanged option.
2747 * options.cc (General_options::parse_incremental_startup_unchanged):
2748 New function.
2749 (General_options::General_options): Initialize new data member.
2750 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2751 (General_options): Add --incremental-startup-unchanged option.
2752 (General_options::incremental_startup_disposition): New function.
2753 (General_options::incremental_startup_disposition_): New data member.
2754
2755 2011-07-06 Cary Coutant <ccoutant@google.com>
2756
2757 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2758 input file index to Script_info ctor.
2759 (Sized_incremental_binary::do_file_has_changed): Find the
2760 command-line argument for files named in scripts.
2761 * incremental.h (Script_info::Script_info): New ctor
2762 with input file index.
2763 (Script_info::input_file_index): New function.
2764 (Script_info::input_file_index_): New data member.
2765 (Incremental_binary::get_library): Add const.
2766 (Incremental_binary::get_script_info): Add const.
2767 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2768 * testsuite/Makefile.am (incremental_test_5): New test case.
2769 (incremental_test_6): New test case.
2770 * testsuite/Makefile.in: Regenerate.
2771
2772 2011-07-06 Cary Coutant <ccoutant@google.com>
2773
2774 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2775 debug output when command lines differ.
2776
2777 2011-07-06 Cary Coutant <ccoutant@google.com>
2778
2779 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2780 --incremental-patch option.
2781 * layout.cc (Free_list::allocate): Extend allocation beyond original
2782 end if enabled.
2783 (Layout::make_output_section): Mark sections that should get
2784 patch space.
2785 * options.cc (parse_percent): New function.
2786 * options.h (parse_percent): New function.
2787 (DEFINE_percent): New macro.
2788 (General_options): Add --incremental-patch option.
2789 * output.cc (Output_section::Output_section): Initialize new data
2790 members.
2791 (Output_section::add_input_section): Print section name when out
2792 of patch space.
2793 (Output_section::add_output_section_data): Likewise.
2794 (Output_section::set_final_data_size): Add patch space when
2795 doing --incremental-full.
2796 (Output_section::do_reset_address_and_file_offset): Remove patch
2797 space.
2798 (Output_segment::set_section_list_addresses): Print debug output
2799 only if --incremental-update.
2800 * output.h (Output_section::set_is_patch_space_allowed): New function.
2801 (Output_section::is_patch_space_allowed_): New data member.
2802 (Output_section::patch_space_): New data member.
2803 * parameters.cc (Parameters::incremental_full): New function.
2804 * parameters.h (Parameters::incremental_full): New function
2805 * testsuite/Makefile.am (incremental_test_2): Add test for
2806 --incremental-patch option.
2807 * testsuite/Makefile.in: Regenerate.
2808 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2809 (t18): Remove function body.
2810
2811 2011-07-05 Doug Kwan <dougkwan@google.com>
2812
2813 PR gold/12771
2814 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2815 Arm_Address type for relocation result.
2816 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2817 overflow check.
2818 (Arm_relocate_functions::abs32): Use unaligned access.
2819 (Arm_relocate_functions::rel32): Ditto.
2820 (Arm_relocate_functions::prel31): Ditto.
2821 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2822 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2823 static data relocations.
2824 * testsuite/Makefile.in: Regnerate.
2825 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2826
2827 2011-07-05 Ian Lance Taylor <iant@google.com>
2828
2829 PR gold/12392
2830 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2831 symbols if necessary.
2832 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2833
2834 2011-07-05 Ian Lance Taylor <iant@google.com>
2835
2836 PR gold/12952
2837 * resolve.cc (Symbol::override_base_with_special): Simply override
2838 version with special symbol version, ignoring previous version.
2839
2840 2011-07-05 Ian Lance Taylor <iant@google.com>
2841
2842 * object.cc (Sized_relobj_file::include_section_group): Add
2843 information to comment about signature location.
2844
2845 2011-07-02 Ian Lance Taylor <iant@google.com>
2846
2847 PR gold/12957
2848 * options.h (class General_options): Add -f and -F.
2849 * options.cc (General_options::finalize): Fatal error if -f/-F
2850 are used without -shared.
2851 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2852
2853 2011-07-02 Ian Lance Taylor <iant@google.com>
2854
2855 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2856
2857 2011-07-01 Ian Lance Taylor <iant@google.com>
2858
2859 PR gold/12525
2860 PR gold/12952
2861 * resolve.cc (Symbol::override_base_with_special): Don't override
2862 the version if the overriding symbol has a different name.
2863 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2864 all callers. If we give an error about an undefined version,
2865 define the base version if necessary.
2866 * dynobj.h (class Versions): Update declaration.
2867 * testsuite/weak_alias_test_5.cc: New file.
2868 * testsuite/weak_alias_test.script: New file.
2869 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2870 and versioned_alias have the right value, and call t2.
2871 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2872 weak_alias_test_5.so.
2873 (weak_alias_test_LDADD): Likewise.
2874 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2875 * testsuite/Makefile.in: Rebuild.
2876
2877 2011-07-01 Ian Lance Taylor <iant@google.com>
2878
2879 PR gold/12525
2880 * options.h (class General_options): Support -z notext.
2881 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2882 -Wl,-z,notext.
2883 (two_file_shared_nonpic.so): Likewise.
2884 (two_file_shared_mixed.so): Likewise.
2885 (two_file_shared_mixed_1.so): Likewise.
2886 (weak_undef_lib_nonpic.so): Likewise.
2887 (alt/weak_undef_lib_nonpic.so): Likewise.
2888 (tls_test_shared_nonpic.so): Likewise.
2889 * testsuite/Makefile.in: Rebuild.
2890
2891 2011-07-01 Ian Lance Taylor <iant@google.com>
2892
2893 PR gold/12525
2894 * configure.ac: Test whether static linking works, setting
2895 the automake conditional HAVE_STATIC.
2896 * testsuite/Makefile.am: Disable tests using -static if
2897 HAVE_STATIC is not true.
2898 * configure, testsuite/Makefile.in: Rebuild.
2899
2900 2011-07-01 Ian Lance Taylor <iant@google.com>
2901
2902 PR gold/12525
2903 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2904 Assert if we see DW_EH_PE_indirect.
2905 * target.h (Target::ehframe_datarel_base): New function.
2906 (Target::do_ehframe_datarel_base): New target function.
2907 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2908 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2909 function.
2910
2911 2011-07-01 Ian Lance Taylor <iant@google.com>
2912
2913 PR gold/12571
2914 * options.h (class General_options): Add
2915 --ld-generated-unwind-info.
2916 * ehframe.cc (Fde::write): Add address parameter. Change all
2917 callers. If associated with PLT, fill in address and size.
2918 (Cie::set_output_offset): Only add merge mapping if there is an
2919 object.
2920 (Cie::write): Add address parameter. Change all callers.
2921 (Eh_frame::add_ehframe_for_plt): New function.
2922 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2923 input_offset_ fields into union u_, with new plt field.
2924 (Fde::Fde): Adjust for new union field.
2925 (Fde::Fde) [Output_data version]: New constructor.
2926 (Fde::add_mapping): Only add merge mapping if there is an object.
2927 (class Cie): Update declarations.
2928 (class Eh_frame): Declare add_ehframe_for_plt.
2929 * layout.cc (Layout::layout_eh_frame): Break out code into
2930 make_eh_frame_section, and call it.
2931 (Layout::make_eh_frame_section): New function.
2932 (Layout::add_eh_frame_for_plt): New function.
2933 * layout.h (class Layout): Update declarations.
2934 * merge.cc (Merge_map::add_mapping): Add assertion.
2935 * i386.cc: Include "dwarf.h".
2936 (class Output_data_plt_i386): Make first_plt_entry,
2937 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2938 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2939 and plt_eh_frame_fde.
2940 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2941 boundary. Call add_eh_frame_for_plt if appropriate.
2942 * x86_64.cc: Include "dwarf.h".
2943 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2944 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2945 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2946 and plt_eh_frame_fde.
2947 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2948 appropriate.
2949
2950 2011-06-29 Ian Lance Taylor <iant@google.com>
2951
2952 PR gold/12629
2953 * object.cc (Sized_relobj_file::layout_section): Change shdr
2954 parameter to be const.
2955 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2956 out of do_layout.
2957 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2958 appropriate. Call layout_eh_frame_section.
2959 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2960 sections.
2961 * object.h (class Sized_relobj_file): Update declarations.
2962
2963 2011-06-29 Ian Lance Taylor <iant@google.com>
2964
2965 PR gold/12652
2966 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2967 modifier.
2968 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2969
2970 2011-06-29 Ian Lance Taylor <iant@google.com>
2971
2972 PR gold/12675
2973 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2974 SHT_X86_64_UNWIND.
2975 * layout.cc (Layout::layout_eh_frame): Likewise.
2976
2977 2011-06-29 Ian Lance Taylor <iant@google.com>
2978
2979 PR gold/12695
2980 * layout.cc (Layout::symtab_section_shndx): New function.
2981 * layout.h (class Layout): Declare symtab_section_shndx.
2982 * output.cc (Output_section::write_header): Call it.
2983
2984 2011-06-29 Ian Lance Taylor <iant@google.com>
2985
2986 PR gold/12818
2987 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2988 symbols which are not used in a relocation.
2989
2990 2011-06-28 Ian Lance Taylor <iant@google.com>
2991
2992 PR gold/12898
2993 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2994 script create indistinguishable segments.
2995 (Layout::set_segment_offsets): Use stable_sort when sorting
2996 segments. Pass this to Compare_segments constructor.
2997 * layout.h (class Layout): Make segment_precedes non-static.
2998 (class Compare_segments): Change from struct to class. Add
2999 layout_ field. Add constructor.
3000 * script-sections.cc
3001 (Script_sections::attach_sections_using_phdrs_clause): Rename
3002 local orphan to is_orphan. Don't report failure to put empty
3003 section in segment. On attachment failure, report name of
3004 section, and attach to first PT_LOAD segment.
3005
3006 2011-06-28 Ian Lance Taylor <iant@google.com>
3007
3008 PR gold/12934
3009 * target-select.cc (Target_selector::Target_selector): Add
3010 emulation parameter. Change all callers.
3011 (select_target_by_bfd_name): Rename from select_target_by_name.
3012 Change all callers.
3013 (select_target_by_emulation): New function.
3014 (supported_emulation_names): New function.
3015 * target-select.h (class Target_selector): Add emulation_ field.
3016 Update declarations.
3017 (Target_selector::recognize_by_bfd_name): Rename from
3018 recognize_by_name. Change all callers.
3019 (Target_selector::supported_bfd_names): Rename from
3020 supported_names. Change all callers.
3021 (Target_selector::recognize_by_emulation): New function.
3022 (Target_selector::supported_emulations): New function.
3023 (Target_selector::emulation): New function.
3024 (Target_selector::do_recognize_by_bfd_name): Rename from
3025 do_recognize_by_name. Change all callers.
3026 (Target_selector::do_supported_bfd_names): Rename from
3027 do_supported_names. Change all callers.
3028 (Target_selector::do_recognize_by_emulation): New function.
3029 (Target_selector::do_supported_emulations): New function.
3030 (select_target_by_bfd_name): Change name in declaration.
3031 (select_target_by_emulation): Declare.
3032 (supported_emulation_names): Declare.
3033 * parameters.cc (parameters_force_valid_target): Try to find
3034 target based on emulation from -m option.
3035 * options.h (class General_options): Change doc string for -m.
3036 * options.cc (help): Print emulations.
3037 (General_options::parse_V): Likewise.
3038 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3039 Add emulation parameter. Change all callers.
3040
3041 2011-06-28 Ian Lance Taylor <iant@google.com>
3042
3043 * target.h (class Target): Add osabi_ field.
3044 (Target::osabi): New function.
3045 (Target::set_osabi): New function.
3046 (Target::Target): Initialize osabi_.
3047 (Target::do_adjust_elf_header): Make pure virtual.
3048 (Sized_target::do_adjust_elf_header): Declare.
3049 * target.cc (Sized_target::do_adjust_elf_header): New function.
3050 (class Sized_target): Instantiate all versions.
3051 * freebsd.h (class Target_freebsd): Remove.
3052 (Target_selector_freebsd::do_recognize): Call set_osabi on
3053 Target.
3054 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3055 (Target_selector_freebsd::set_osabi): Remove.
3056 * i386.cc (class Target_i386): Inherit from Sized_target rather
3057 than Target_freebsd.
3058 * x86_64.cc (class Target_x86_64): Likewise.
3059
3060 2011-06-28 Ian Lance Taylor <iant@google.com>
3061
3062 * target.h (Target::can_check_for_function_pointers): Rewrite.
3063 Make non-virtual.
3064 (Target::can_icf_inline_merge_sections): Likewise.
3065 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3066 (Target::Target_info): Add can_icf_inline_merge_sections field.
3067 (Target::do_can_check_for_function_pointers): New virtual
3068 function.
3069 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3070 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3071 from can_check_for_function_pointers, move in file.
3072 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3073 section_may_have_icf_unsafe_poineters, move in file.
3074 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3075 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3076 Rename from can_check_for_function_pointers, move in file.
3077 (Target_i386::can_icf_inline_merge_sections): Remove.
3078 (Target_i386::i386_info): Initialize
3079 can_icf_inline_merge_sections.
3080 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3081 Initialize can_icf_inline_merge_sections.
3082 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3083 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3084 Rename from can_check_for_function_pointers, move in file.
3085 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3086 (Target_x86_64::x86_64_info): Initialize
3087 can_icf_inline_merge_sections.
3088 * testsuite/testfile.cc (Target_test::test_target_info):
3089 Likewise.
3090 * icf.cc (get_section_contents): Correct formatting.
3091
3092 2011-06-27 Ian Lance Taylor <iant@google.com>
3093
3094 * symtab.cc (Symbol::versioned_name): New function.
3095 (Symbol_table::add_to_final_symtab): Use versioned_name when
3096 appropriate.
3097 (Symbol_table::sized_write_symbol): Likewise.
3098 * symtab.h (class Symbol): Declare versioned_name.
3099 * stringpool.h (class Stringpool_template): Add variant of add
3100 which takes a std::basic_string.
3101 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3102 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3103 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3104 (ver_test_12.o): New target.
3105 * testsuite/Makefile.in: Rebuild.
3106
3107 2011-06-27 Doug Kwan <dougkwan@google.com>
3108
3109 * arm.cc (Arm_relocate_functions::thm_jump8,
3110 Arm_relocate_functions::thm_jump11): Use a wider signed
3111 type to compute offset.
3112 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3113 arm_thm_jump8.
3114 * testsuite/Makefile.in: Regenerate.
3115 * testsuite/arm_branch_in_range.sh: Check test results of
3116 arm_thm_jump11 and arm_thm_jump8.
3117 * testsuite/arm_thm_jump11.s: New test source file.
3118 * testsuite/arm_thm_jump11.t: New linker script.
3119 * testsuite/arm_thm_jump8.s: New test source file.
3120 * testsuite/arm_thm_jump8.t: New linker script.
3121
3122 2011-06-24 Ian Lance Taylor <iant@google.com>
3123
3124 * layout.cc: Include "object.h".
3125 (ctors_sections_in_init_array): New static variable.
3126 (Layout::is_ctors_in_init_array): New function.
3127 (Layout::layout): Add entry to ctors_sections_in_init_array if
3128 appropriate.
3129 * layout.h (class Layout): Declare is_ctors_in_init_array.
3130 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3131 is_ctors_reverse_view is set.
3132 (Sized_relobj_file::write_sections): Add layout parameter. Change
3133 all callers. Set is_ctors_reverse_view field of View_size.
3134 (Sized_relobj_file::reverse_words): New function.
3135 * object.h (Sized_relobj_file::View_size): Add
3136 is_ctors_reverse_view field.
3137 (class Sized_relobj_file): Update declarations.
3138 * testsuite/initpri3.c: New test.
3139 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3140 initpri3b.
3141 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3142 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3143 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3144 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3145 * testsuite/Makefile.in: Rebuild.
3146
3147 2011-06-24 Cary Coutant <ccoutant@google.com>
3148
3149 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3150 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3151 (debug_msg_cdebug.err): New targets.
3152 * testsuite/Makefile.in: Regenerate.
3153 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3154 Fix checks for link with shared library.
3155
3156 2011-06-24 Doug Kwan <dougkwan@google.com>
3157
3158 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3159 skip empty text sections.
3160 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3161
3162 2011-06-22 Ian Lance Taylor <iant@google.com>
3163
3164 PR gold/12910
3165 * options.h (class General_options): Add --ctors-in-init-array.
3166 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3167 friends as SHT_PROGBITS for merging sections.
3168 (Layout::layout): Remove special handling of .init_array and
3169 friends. Don't sort if doing relocatable link. Sort for .ctors
3170 and .dtors if ctors_in_init_array.
3171 (Layout::make_output_section): Force correct section types for
3172 .init_array and friends. Don't sort if doing relocatable link,
3173 Don't sort .ctors and .dtors if ctors_in_init_array.
3174 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3175 (Layout::output_section_name): Add relobj parameter. Change all
3176 callers. Handle .ctors. and .dtors. in code rather than table.
3177 Handle .ctors and .dtors if ctors_in_init_array.
3178 (Layout::match_file_name): New function, moved from output.cc.
3179 * layout.h (class Layout): Update declarations.
3180 * output.cc: Include "layout.h".
3181 (Input_section_sort_entry::get_priority): New function.
3182 (Input_section_sort_entry::match_file_name): Just call
3183 Layout::match_file_name.
3184 (Output_section::Input_section_sort_init_fini_compare::operator()):
3185 Handle .ctors and .dtors. Sort by explicit priority rather than
3186 by name.
3187 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3188 * testsuite/initpri2.c: New test.
3189 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3190 (check_PROGRAMS): Add initpri2.
3191 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3192 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3193 * configure, testsuite/Makefile.in: Rebuild.
3194
3195 2011-06-19 Ian Lance Taylor <iant@google.com>
3196
3197 PR gold/12880
3198 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3199 .interp section to a PT_INTERP segment even if we have seen a
3200 --dynamic-linker option. Don't do it if we have seen a PHDRS
3201 clause in a linker script.
3202 (Layout::finalize): Don't create a .interp section if we've
3203 already create a PT_INTERP segment.
3204 (Layout::create_interp): Always call choose_output_section (revert
3205 patch of 2011-06-17). Don't create PT_INTERP segment.
3206 * script-sections.cc
3207 (Script_sections::create_note_and_tls_segments): Add a .interp
3208 section to a PT_INTERP segment even if we have seen a
3209 --dynamic-linker option.
3210
3211 2011-06-18 Ian Lance Taylor <iant@google.com>
3212
3213 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3214 merely because a non-PT_LOAD segment has a dynamic reloc.
3215
3216 2011-06-18 Ian Lance Taylor <iant@google.com>
3217
3218 * layout.cc (Layout::finish_dynamic_section): Don't create
3219 DT_FLAGS entry if not needed.
3220
3221 2011-06-18 Ian Lance Taylor <iant@google.com>
3222
3223 PR gold/12745
3224 * layout.cc (Layout::layout_eh_frame): Correct handling of
3225 writable .eh_frame section.
3226
3227 2011-06-17 Ian Lance Taylor <iant@google.com>
3228
3229 PR gold/12893
3230 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3231 symbol is redefined with the exact same object and value.
3232
3233 2011-06-17 Ian Lance Taylor <iant@google.com>
3234
3235 PR gold/12880
3236 * layout.h (class Layout): Add interp_segment_ field.
3237 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3238 (Layout::attach_allocated_section_to_segment): If making shared
3239 library, put .interp section in PT_INTERP segment.
3240 (Layout::finalize): Also call create_interp if -dynamic-linker
3241 option was used.
3242 (Layout::create_interp): Assert that there is no PT_INTERP
3243 segment. If not using a SECTIONS clause, use make_output_section.
3244 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3245 * script-sections.cc
3246 (Script_sections::create_note_and_tls_segments): If making shared
3247 library, put .interp section in PT_INTERP segment.
3248
3249 2011-06-17 Ian Lance Taylor <iant@google.com>
3250
3251 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3252 when making a shared library.
3253
3254 2011-06-17 Ian Lance Taylor <iant@google.com>
3255
3256 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3257 parameter. Change all callers. Don't issue warning about PC32
3258 against locally defined symbol.
3259
3260 2011-06-16 Ian Lance Taylor <iant@google.com>
3261
3262 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3263 occurs in same object.
3264
3265 2011-06-14 Alan Modra <amodra@gmail.com>
3266
3267 * po/POTFILES.in: Regenerate.
3268
3269 2011-06-09 Ian Lance Taylor <iant@google.com>
3270
3271 * script-sections.cc
3272 (Orphan_output_section::set_section_addresses): For a relocatable
3273 link set address to 0.
3274
3275 2011-06-09 Cary Coutant <ccoutant@google.com>
3276
3277 PR gold/12804
3278 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3279 used with --compress-debug-sections.
3280 * gold/object.cc (Sized_relobj_file::do_layout): Report
3281 uncompressed size of compressed input sections.
3282
3283 2011-06-08 Cary Coutant <ccoutant@google.com>
3284
3285 PR gold/12804
3286 * testsuite/two_file_test_2_v1.cc: Change initialization of
3287 v2 to keep it in .data.
3288
3289 2011-06-07 Cary Coutant <ccoutant@google.com>
3290
3291 * common.cc (Symbol_table::do_allocate_commons_list): Call
3292 gold_fallback.
3293 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3294 (Errors::fallback): New function.
3295 (gold_fallback): New function.
3296 * errors.h (Errors::fallback): New function.
3297 * gold.cc (gold_exit): Change status parameter to enum; adjust
3298 all callers.
3299 (queue_initial_tasks): Call gold_fallback.
3300 * gold.h: Include cstdlib.
3301 (Exit_status): New enum type.
3302 (gold_exit): Change status parameter to enum.
3303 (gold_fallback): New function.
3304 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3305 (Layout::create_symtab_sections): Likewise.
3306 (Layout::create_shdrs): Likewise.
3307 * main.cc (main): Adjust call to gold_exit.
3308 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3309 (Output_data_got::add_got_entry_pair): Likewise.
3310 (Output_section::add_input_section): Likewise.
3311 (Output_section::add_output_section_data): Likewise.
3312 (Output_segment::set_section_list_addresses): Likewise.
3313 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3314
3315 2011-06-07 Cary Coutant <ccoutant@google.com>
3316
3317 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3318 for incremental links.
3319 * output.cc (Output_segment::set_section_list_addresses): Remove
3320 FIXME and test for TLS or BSS.
3321
3322 2011-06-07 Cary Coutant <ccoutant@google.com>
3323
3324 * testsuite/Makefile.am: Add incremental_copy_test,
3325 incremental_common_test_1.
3326 * testsuite/Makefile.in: Regenerate.
3327 * testsuite/common_test_1_v1.c: New source file.
3328 * testsuite/common_test_1_v2.c: New source file.
3329 * testsuite/copy_test_v1.cc: New source file.
3330
3331 2011-06-07 Cary Coutant <ccoutant@google.com>
3332
3333 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3334 update, allocate common from bss section's free list.
3335 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3336 linker-defined symbols.
3337 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3338 Skip GOT and PLT entries that are no longer referenced.
3339 (Output_section_incremental_inputs::write_info_blocks): Mark
3340 linker-defined symbols.
3341 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3342 * output.cc (Output_section::allocate): New function.
3343 * output.h (Output_section::allocate): New function.
3344 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3345 linker-defined symbols.
3346 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3347 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3348 (Symbol::init_base_output_data): Likewise.
3349 (Symbol::init_base_output_segment): Likewise.
3350 (Symbol::init_base_constant): Likewise.
3351 (Sized_symbol::init_output_data): Likewise.
3352 (Sized_symbol::init_output_segment): Likewise.
3353 (Sized_symbol::init_constant): Likewise.
3354 (Symbol_table::do_define_in_output_data): Likewise.
3355 (Symbol_table::do_define_in_output_segment): Likewise.
3356 (Symbol_table::do_define_as_constant): Likewise.
3357 * symtab.h (Symbol::is_predefined): New function.
3358 (Symbol::init_base_output_data): Add is_predefined parameter.
3359 (Symbol::init_base_output_segment): Likewise.
3360 (Symbol::init_base_constant): Likewise.
3361 (Symbol::is_predefined_): New data member.
3362 (Sized_symbol::init_output_data): Add is_predefined parameter.
3363 (Sized_symbol::init_output_segment): Likewise.
3364 (Sized_symbol::init_constant): Likewise.
3365 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3366
3367 2011-06-07 Cary Coutant <ccoutant@google.com>
3368
3369 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3370 instead of emit_copy_reloc.
3371 (Copy_relocs::emit_copy_reloc): Refactor.
3372 (Copy_relocs::make_copy_reloc): New function.
3373 (Copy_relocs::add_copy_reloc): Remove.
3374 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3375 section.
3376 (Copy_relocs::make_copy_reloc): New function.
3377 (Copy_relocs::add_copy_reloc): Remove.
3378 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3379 unchanged input files.
3380 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3381 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3382 Reserve BSS space for COPY relocations.
3383 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3384 (Output_section_incremental_inputs::write_info_blocks): Record
3385 whether a symbol is copied from a shared object.
3386 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3387 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3388 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3389 (Incremental_input_entry_reader::get_output_symbol_index): Add
3390 is_copy parameter.
3391 (Incremental_binary::emit_copy_relocs): New function.
3392 (Incremental_binary::do_emit_copy_relocs): New function.
3393 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3394 new data member.
3395 (Sized_incremental_binary::add_copy_reloc): New function.
3396 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3397 (Sized_incremental_binary::Copy_reloc): New struct.
3398 (Sized_incremental_binary::Copy_relocs): New typedef.
3399 (Sized_incremental_binary::copy_relocs_): New data member.
3400 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3401 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3402 * target.h (Sized_target::emit_copy_reloc): New function.
3403 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3404
3405 2011-06-02 Cary Coutant <ccoutant@google.com>
3406
3407 PR gold/12163
3408 * gold/archive.cc (Archive::Archive): Initialize new data member.
3409 (Archive::include_all_members): Return if archive has already been
3410 included.
3411 * gold/archive.h (Archive::include_all_members_): New data member.
3412
3413 2011-06-02 Nick Clifton <nickc@redhat.com>
3414
3415 * dynobj.h: Fix spelling mistake in comment.
3416 * output.cc: Likewise.
3417
3418 2011-05-31 Doug Kwan <dougkwan@google.com>
3419 Asier Llano
3420
3421 PR gold/12826
3422 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
3423 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3424 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3425 redundant arm_exidx_test.so.
3426 * testsuite/Makefile.in: Regenerate.
3427 (check_SCRIPTS): Add pr12826.sh
3428 (check_DATA): Add pr12826.stdout
3429 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3430 * testsuite/pr12826.sh: New file.
3431 * testsuite/pr12826_1.s: Ditto.
3432 * testsuite/pr12826_1.s: Ditto.
3433
3434 2011-05-30 Ian Lance Taylor <iant@google.com>
3435
3436 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3437 sections.
3438
3439 2011-05-29 Ian Lance Taylor <iant@google.com>
3440
3441 PR gold/12804
3442 * testsuite/Makefile.am: Use different file name for two_file_test
3443 temporary file for each incremental test.
3444 * testsuite/Makefile.in: Rebuild.
3445
3446 2011-05-29 Ian Lance Taylor <iant@google.com>
3447
3448 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3449 binary input file is empty.
3450
3451 2011-05-27 Ian Lance Taylor <iant@google.com>
3452
3453 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3454 (ver_test_9.so): Likewise.
3455 * testsuite/Makefile.in: Rebuild.
3456
3457 2011-05-26 Cary Coutant <ccoutant@google.com>
3458
3459 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3460 * incremental.cc (Incremental_inputs::report_input_section): Fix
3461 comment, indentation.
3462 (Incremental_inputs::report_comdat_group): New function.
3463 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3464 of data for incremental input file entry.
3465 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3466 group count, COMDAT group signatures.
3467 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3468 an unchanged input file.
3469 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3470 Initialize new data member.
3471 (Incremental_object_entry::add_comdat_group): New function.
3472 (Incremental_object_entry::get_comdat_group_count): New function.
3473 (Incremental_object_entry::get_comdat_signature_key): New function.
3474 (Incremental_object_entry::groups_): New data member.
3475 (Incremental_inputs::report_comdat_group): New function.
3476 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3477 data for incremental input file entry.
3478 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3479 (Incremental_input_entry_reader::get_input_section): Adjust size of
3480 data for incremental input file entry.
3481 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3482 (Incremental_input_entry_reader::get_comdat_group_signature): New
3483 function.
3484 * object.cc (Sized_relobj::include_section_group): Report kept
3485 COMDAT groups for incremental links.
3486
3487 2011-05-24 David Meyer <pdox@google.com>
3488
3489 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3490 with name parameter. Add found_name parameter.
3491 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3492 * dirsearch.h (class Dirsearch): Update declaration.
3493
3494 2011-05-24 Ian Lance Taylor <iant@google.com>
3495
3496 * archive.cc (Library_base::should_include_member): Pull in object
3497 from archive if it defines the entry symbol.
3498 * parameters.cc (Parameters::entry): New function.
3499 * parameters.h (class Parameters): Declare entry.
3500 * output.h (class Output_file_header): Remove entry_ field.
3501 * output.cc (Output_file_header::Output_file_header): Remove entry
3502 parameter. Change all callers.
3503 (Output_file_header::entry): Use parameters->entry.
3504 * gold.cc (queue_middle_tasks): Likewise.
3505 * plugin.cc (Plugin_hook::run): Likewise.
3506
3507 2011-05-24 Cary Coutant <ccoutant@google.com>
3508
3509 * gold.cc (queue_initial_tasks): Pass incremental base filename
3510 to Output_file::open_base_file; don't print error message.
3511 * incremental-dump.cc (main): Adjust call to
3512 Output_file::open_for_modification.
3513 * incremental-dump.cc (main): Likewise.
3514 * incremental.cc (Incremental_inputs::report_command_line):
3515 Ignore --incremental-base option when comparing command lines.
3516 Ignore parameter when given as separate argument.
3517 * options.h (class General_options): Add --incremental-base.
3518 * output.cc (Output_file::Output_file):
3519 (Output_file::open_base_file): Add base_name and writable parameters;
3520 read base file into new file; print error message here.
3521 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3522 callers.
3523 * output.h (Output_file::open_for_modification): Rename to...
3524 (Output_file::open_base_file): ...this; add base_name and
3525 writable parameters; adjust all callers.
3526 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3527 callers.
3528 * testsuite/Makefile.am (incremental_test_4): Test
3529 --incremental-base.
3530 * testsuite/Makefile.in: Regenerate.
3531
3532 2011-05-24 Cary Coutant <ccoutant@google.com>
3533
3534 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3535 incremental_test_4.
3536 * testsuite/Makefile.in: Regenerate.
3537 * testsuite/two_file_test_1_v1.cc: New test source file.
3538 * testsuite/two_file_test_1b_v1.cc: New test source file.
3539 * testsuite/two_file_test_2_v1.cc: New test source file.
3540
3541 2011-05-24 Cary Coutant <ccoutant@google.com>
3542
3543 * dynobj.h (Dynobj::do_dynobj): New function.
3544 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3545 flag and soname for shared objects.
3546 * incremental.cc (Incremental_inputs::report_object): Make
3547 either Incremental_object_entry or Incremental_dynobj_entry; add
3548 soname to string table.
3549 (Incremental_inputs::report_input_section): Add assertion.
3550 (Output_section_incremental_inputs::set_final_data_size): Adjust
3551 type of input file entry for shared libraries; adjust size of
3552 shared library info entry.
3553 (Output_section_incremental_inputs::write_input_files): Write
3554 as_needed flag for shared libraries.
3555 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3556 of input file entry for shared libraries; write soname.
3557 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3558 soname from incremental info.
3559 * incremental.h (enum Incremental_input_flags): Add
3560 INCREMENTAL_INPUT_AS_NEEDED.
3561 (Incremental_input_entry::Incremental_input_entry): Initialize new
3562 data member.
3563 (Incremental_input_entry::set_as_needed): New function.
3564 (Incremental_input_entry::as_needed): New function.
3565 (Incremental_input_entry::do_dynobj_entry): New function.
3566 (Incremental_input_entry::as_needed_): New data member.
3567 (Incremental_object_entry::Incremental_object_entry): Don't check
3568 for shared library.
3569 (Incremental_object_entry::do_type): Likewise.
3570 (class Incremental_dynobj_entry): New class.
3571 (Incremental_input_entry_reader::as_needed): New function.
3572 (Incremental_input_entry_reader::get_soname): New function.
3573 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3574 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3575 size of shared library info entry.
3576 * layout.cc (Layout::finish_dynamic_section): Don't test for
3577 incremental link when adding DT_NEEDED entries.
3578 * object.h (Object::Object): Initialize new data member.
3579 (Object::dynobj): New function.
3580 (Object::set_as_needed): New function.
3581 (Object::as_needed): New function.
3582 (Object::do_dynobj): New function.
3583 (Object::as_needed_): New data member.
3584
3585 2011-05-24 Cary Coutant <ccoutant@google.com>
3586
3587 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3588 info; adjust display of GOT entries.
3589 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3590 vector of input objects; remove file_status_.
3591 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3592 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3593 got_plt reader; call target hooks to reserve GOT entries.
3594 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3595 of input file info header and GOT info entry.
3596 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3597 relocation info.
3598 (Got_plt_view_info::got_descriptor): Remove.
3599 (Got_plt_view_info::sym_index): New data member.
3600 (Got_plt_view_info::input_index): New data member.
3601 (Local_got_offset_visitor::visit): Write input file index.
3602 (Global_got_offset_visitor::visit): Write 0 for input file index.
3603 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3604 with sym_index and input_index.
3605 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3606 incremental info GOT entry; replace got_descriptor with input_index.
3607 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3608 map from input file index to object.
3609 (Sized_relobj_incr::do_layout): Replace direct data member reference
3610 with accessor function.
3611 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3612 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3613 Adjust size of input file info header.
3614 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3615 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3616 (Incremental_input_entry_reader::get_input_section): Adjust size of
3617 input file info header.
3618 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3619 of incremental info GOT entry.
3620 (Incremental_got_plt_reader::get_got_desc): Remove.
3621 (Incremental_got_plt_reader::get_got_symndx): New function.
3622 (Incremental_got_plt_reader::get_got_input_index): New function.
3623 (Sized_incremental_binary::Sized_incremental_binary): Remove
3624 file_status_; add input_objects_.
3625 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3626 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3627 (Sized_incremental_binary::file_is_unchanged): Remove.
3628 (Sized_incremental_binary::set_input_object): New function.
3629 (Sized_incremental_binary::input_object): New function.
3630 (Sized_incremental_binary::file_status_): Remove.
3631 (Sized_incremental_binary::input_objects_): New data member.
3632 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3633 references.
3634 (Sized_relobj_incr::invalid_address): Move to base class.
3635 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3636 class.
3637 (Sized_relobj_incr::do_output_section_offset): Likewise.
3638 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3639 (Sized_relobj_incr::section_offsets_): Likewise.
3640 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3641 function.
3642 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3643 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3644 with accessor function.
3645 (Sized_relobj_file::do_layout): Likewise.
3646 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3647 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3648 (Sized_relobj_file::compute_final_local_value): Replace refs to
3649 section_offsets_ with accessor function.
3650 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3651 * object.h (Relobj::Relobj): Initialize new data members.
3652 (Relobj::add_dyn_reloc): New function.
3653 (Relobj::first_dyn_reloc): New function.
3654 (Relobj::dyn_reloc_count): New function.
3655 (Relobj::first_dyn_reloc_): New data member.
3656 (Relobj::dyn_reloc_count_): New data member.
3657 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3658 references.
3659 (Sized_relobj::Address): New typedef.
3660 (Sized_relobj::invalid_address): Move here from child class.
3661 (Sized_relobj::Sized_relobj): Initialize new data members.
3662 (Sized_relobj::sized_relobj): New function.
3663 (Sized_relobj::is_output_section_offset_invalid): Move here from
3664 child class.
3665 (Sized_relobj::get_output_section_offset): Likewise.
3666 (Sized_relobj::local_has_got_offset): Likewise.
3667 (Sized_relobj::local_got_offset): Likewise.
3668 (Sized_relobj::set_local_got_offset): Likewise.
3669 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3670 (Sized_relobj::clear_got_offsets): New function.
3671 (Sized_relobj::section_offsets): Move here from child class.
3672 (Sized_relobj::do_output_section_offset): Likewise.
3673 (Sized_relobj::do_set_section_offset): Likewise.
3674 (Sized_relobj::Local_got_offsets): Likewise.
3675 (Sized_relobj::local_got_offsets_): Likewise.
3676 (Sized_relobj::section_offsets_): Likewise.
3677 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3678 references.
3679 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3680 class.
3681 (Sized_relobj_file::sized_relobj): New function
3682 (Sized_relobj_file::local_has_got_offset): Move to base class.
3683 (Sized_relobj_file::local_got_offset): Likewise.
3684 (Sized_relobj_file::set_local_got_offset): Likewise.
3685 (Sized_relobj_file::get_output_section_offset): Likewise.
3686 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3687 (Sized_relobj_file::do_output_section_offset): Likewise.
3688 (Sized_relobj_file::do_set_section_offset): Likewise.
3689 (Sized_relobj_file::Local_got_offsets): Likewise.
3690 (Sized_relobj_file::local_got_offsets_): Likewise.
3691 (Sized_relobj_file::section_offsets_): Likewise.
3692 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3693 (all constructors).
3694 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3695 (Output_reloc::get_symbol_index): Likewise.
3696 (Output_reloc::local_section_offset): Likewise.
3697 (Output_reloc::get_address): Likewise.
3698 (Output_reloc::symbol_value): Likewise.
3699 (Output_data_got::reserve_slot): Move to class definition.
3700 (Output_data_got::reserve_local): New function.
3701 (Output_data_got::reserve_slot_for_global): Remove.
3702 (Output_data_got::reserve_global): New function.
3703 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3704 (all constructors, two instantiations).
3705 (Output_reloc::get_relobj): New function (two instantiations).
3706 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3707 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3708 (Output_data_reloc::add_global): Adjust type of relobj.
3709 (Output_data_reloc::add_global_relative): Likewise.
3710 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3711 (Output_data_reloc::add_local): Likewise.
3712 (Output_data_reloc::add_local_relative): Likewise.
3713 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3714 (Output_data_reloc::add_local_section): Likewise.
3715 (Output_data_reloc::add_output_section): Likewise.
3716 (Output_data_reloc::add_absolute): Likewise.
3717 (Output_data_reloc::add_target_specific): Likewise.
3718 (Output_data_got::reserve_slot): Move definition here.
3719 (Output_data_got::reserve_local): New function.
3720 (Output_data_got::reserve_global): New function.
3721 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3722 section_offsets_ with accessor function.
3723 (Sized_relobj_file::write_sections): Likewise.
3724 (Sized_relobj_file::do_relocate_sections): Likewise.
3725 * target.h (Sized_target::reserve_local_got_entry): New function.
3726 (Sized_target::reserve_global_got_entry): New function.
3727 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3728 (Target_x86_64::reserve_global_got_entry): New function.
3729 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3730
3731 2011-05-23 Cary Coutant <ccoutant@google.com>
3732
3733 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3734 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3735 bit when checking got_type.
3736 * incremental.cc (Sized_incremental_binary::setup_readers):
3737 Store symbol table and string table locations; initialize bit vector
3738 of file status flags.
3739 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3740 unchanged files.
3741 (Sized_incremental_binary::do_process_got_plt): New function.
3742 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3743 (Output_section_incremental_inputs::set_final_data_size): Record
3744 file index for each input file.
3745 (Output_section_incremental_inputs::write_got_plt): Store file index
3746 instead of input entry offset for each GOT entry.
3747 * incremental.h
3748 (Incremental_input_entry::Incremental_input_entry): Initialize new
3749 data member.
3750 (Incremental_input_entry::set_offset): Store file index.
3751 (Incremental_input_entry::get_file_index): New function.
3752 (Incremental_input_entry::file_index_): New data member.
3753 (Incremental_binary::process_got_plt): New function.
3754 (Incremental_binary::do_process_got_plt): New function.
3755 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3756 data members.
3757 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3758 (Sized_incremental_binary::set_file_is_unchanged): New function.
3759 (Sized_incremental_binary::file_is_unchanged): New function.
3760 (Sized_incremental_binary::do_process_got_plt): New function.
3761 (Sized_incremental_binary::file_status_): New data member.
3762 (Sized_incremental_binary::main_symtab_loc_): New data member.
3763 (Sized_incremental_binary::main_strtab_loc_): New data member.
3764 * output.cc (Output_data_got::Got_entry::write): Add case
3765 RESERVED_CODE.
3766 (Output_data_got::add_global): Call add_got_entry.
3767 (Output_data_got::add_global_plt): Likewise.
3768 (Output_data_got::add_global_with_rel): Likewise.
3769 (Output_data_got::add_global_with_rela): Likewise.
3770 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3771 (Output_data_got::add_global_pair_with_rela): Likewise.
3772 (Output_data_got::add_local): Call add_got_entry.
3773 (Output_data_got::add_local_plt): Likewise.
3774 (Output_data_got::add_local_with_rel): Likewise.
3775 (Output_data_got::add_local_with_rela): Likewise.
3776 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3777 (Output_data_got::add_local_pair_with_rela): Likewise.
3778 (Output_data_got::reserve_slot): New function.
3779 (Output_data_got::reserve_slot_for_global): New function.
3780 (Output_data_got::add_got_entry): New function.
3781 (Output_data_got::add_got_entry_pair): New function.
3782 (Output_section::add_output_section_data): Edit FIXME.
3783 * output.h
3784 (Output_section_data_build::Output_section_data_build): New
3785 constructor with size parameter.
3786 (Output_data_space::Output_data_space): Likewise.
3787 (Output_data_got::Output_data_got): Initialize new data member; new
3788 constructor with size parameter.
3789 (Output_data_got::add_constant): Call add_got_entry.
3790 (Output_data_got::reserve_slot): New function.
3791 (Output_data_got::reserve_slot_for_global): New function.
3792 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3793 (Output_data_got::add_got_entry): New function.
3794 (Output_data_got::add_got_entry_pair): New function.
3795 (Output_data_got::free_list_): New data member.
3796 * target.h (Sized_target::init_got_plt_for_update): New function.
3797 (Sized_target::register_global_plt_entry): New function.
3798 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3799 Initialize new data member; call init; add constructor with PLT count.
3800 (Output_data_plt_x86_64::init): New function.
3801 (Output_data_plt_x86_64::add_relocation): New function.
3802 (Output_data_plt_x86_64::reserve_slot): New function.
3803 (Output_data_plt_x86_64::free_list_): New data member.
3804 (Target_x86_64::init_got_plt_for_update): New function.
3805 (Target_x86_64::register_global_plt_entry): New function.
3806 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3807 incremental updates.
3808 (Output_data_plt_x86_64::add_relocation): New function.
3809 * testsuite/object_unittest.cc (Object_test): Set default options.
3810
3811 2011-05-16 Ian Lance Taylor <iant@google.com>
3812
3813 * options.h (class General_options): Make -i a synonym for -r.
3814
3815 2011-05-16 Ian Lance Taylor <iant@google.com>
3816
3817 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3818
3819 2011-05-10 Cary Coutant <ccoutant@google.com>
3820
3821 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3822 strip_all (-s).
3823
3824 2011-05-06 Ian Lance Taylor <iant@google.com>
3825
3826 * layout.cc (Layout::layout): If the output section flags change,
3827 update the ordering.
3828
3829 2011-04-25 Cary Coutant <ccoutant@google.com>
3830
3831 * incremental-dump.cc (dump_incremental_inputs): Print local
3832 symbol info for each input file.
3833 * incremental.cc
3834 (Output_section_incremental_inputs::set_final_data_size): Add local
3835 symbol info to input file entries in incremental info.
3836 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3837 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3838 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3839 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3840 implementation.
3841 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3842 (Sized_incr_relobj::do_relocate): Write the local symbols.
3843 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3844 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3845 Adjust size of input file header.
3846 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3847 (Incremental_inputs_reader::get_local_symbol_count): New function.
3848 (Incremental_inputs_reader::get_input_section): Adjust size of input
3849 file header.
3850 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3851 (Sized_incr_relobj::This): New typedef.
3852 (Sized_incr_relobj::sym_size): New const data member.
3853 (Sized_incr_relobj::Local_symbol): New struct.
3854 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3855 (Sized_incr_relobj::do_local_symbol_offset): New function.
3856 (Sized_incr_relobj::local_symbol_count_): New data member.
3857 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3858 (Sized_incr_relobj::local_symbol_index_): New data member.
3859 (Sized_incr_relobj::local_symbol_offset_): New data member.
3860 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3861 (Sized_incr_relobj::local_symbols_): New data member.
3862 * object.h (Relobj::output_local_symbol_count): New function.
3863 (Relobj::local_symbol_offset): New function.
3864 (Relobj::do_output_local_symbol_count): New function.
3865 (Relobj::do_local_symbol_offset): New function.
3866 (Sized_relobj::do_output_local_symbol_count): New function.
3867 (Sized_relobj::do_local_symbol_offset): New function.
3868
3869 2011-04-22 Vladimir Simonov <sv@sw.ru>
3870
3871 * descriptors.cc (set_close_on_exec): New function.
3872 (Descriptors::open): Use set_close_on_exec.
3873 * output.cc (S_ISLNK): Define if not defined.
3874
3875 2011-04-22 Cary Coutant <ccoutant@google.com>
3876
3877 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3878 global symbol map.
3879 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3880 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3881 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3882 relocations.
3883 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3884 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3885 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3886 * incremental.h
3887 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3888 function.
3889 (Incremental_binary::apply_incremental_relocs): New function.
3890 (Incremental_binary::do_apply_incremental_relocs): New function.
3891 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3892 data member.
3893 (Sized_incremental_binary::add_global_symbol): New function.
3894 (Sized_incremental_binary::global_symbol): New function.
3895 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3896 (Sized_incremental_binary::symbol_map_): New data member.
3897 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3898 * target.h (Sized_target::apply_relocation): New function.
3899 * target-reloc.h (apply_relocation): New function.
3900 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3901
3902 2011-04-22 Doug Kwan <dougkwan@google.com>
3903
3904 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3905 flag of a SHT_ARM_EXIDX section.
3906 * testsuite/Makefile.am (arm_exidx_test): New test rules.
3907 * testsuite/Makefile.in: Regenerate.
3908 * testsuite/arm_exidx_test.s: New file.
3909 * testsuite/arm_exidx_test.sh: Same.
3910
3911 2011-04-20 Cary Coutant <ccoutant@google.com>
3912
3913 PR gold/12689
3914 * archive.h (Incremental_archive_entry::Archive_member):
3915 Initialize arg_serial_ (second constructor).
3916
3917 2011-04-17 Ian Lance Taylor <iant@google.com>
3918
3919 * object.cc (Relocate_info::location): Simplify location string.
3920 * errors.cc (Errors::error_at_location): Don't print program
3921 name.
3922 (Errors::warning_at_location): Likewise.
3923 (Errors::undefined_symbol): Likewise.
3924 * testsuite/debug_msg.sh: Update accordingly.
3925
3926 2011-04-14 Cary Coutant <ccoutant@google.com>
3927
3928 * gold/layout.cc (Layout::symtab_section_offset): New function.
3929 * gold/layout.h (Layout::symtab_section_offset): New function.
3930 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3931
3932 2011-04-12 Ian Lance Taylor <iant@google.com>
3933
3934 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3935 with MREMAP_MAYMOVE.
3936 * output.h (class Output_file): Add map_is_allocated_ field.
3937 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3938 not available, provide stubs. If mremap is not available, #define
3939 it to gold_mremap.
3940 (MREMAP_MAYMOVE): Define if not defined.
3941 (Output_file::Output_file): Initialize map_is_allocated_.
3942 (Output_file::resize): Check map_is_allocated_.
3943 (Output_file::map_anonymous): If mmap fails, use malloc.
3944 (Output_file::unmap): Don't do anything for an anonymous map.
3945 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3946 is not available, provide stubs.
3947 (File_read::View::~View): Use free rather than delete[].
3948 (File_read::make_view): Use malloc rather than new[]. If mmap
3949 fails, use malloc.
3950 (File_read::find_or_make_view): Use malloc rather than new[].
3951 * gold.h: Remove HAVE_REMAP code.
3952 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3953 exists. Rename mremap to gold_mremap. If mmap is not available
3954 don't do anything.
3955 * configure, config.in: Rebuild.
3956
3957 2011-04-11 Ian Lance Taylor <iant@google.com>
3958
3959 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3960 initialize local variable v.
3961
3962 2011-04-11 Cary Coutant <ccoutant@google.com>
3963
3964 * archive.cc (Archive::include_member): Adjust call to
3965 report_object.
3966 (Add_archive_symbols::run): Track argument serial numbers.
3967 (Lib_group::include_member): Likewise.
3968 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3969 * archive.h (Incremental_archive_entry::Archive_member):
3970 Initialize arg_serial_.
3971 (Archive_member::arg_serial_): New data member.
3972 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3973 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3974 incremental link.
3975 (Sized_dynobj::do_for_all_local_got_entries): New function.
3976 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3977 function.
3978 * fileread.cc (get_mtime): New function.
3979 * fileread.h (get_mtime): New function.
3980 * gold.cc (queue_initial_tasks): Check for incremental update.
3981 (process_incremental_input): New function.
3982 (queue_middle_tasks): Don't force valid target for incremental
3983 update.
3984 * incremental-dump.cc (find_input_containing_global): Adjust
3985 size of symbol info entry.
3986 (dump_incremental_inputs): Dump argument serial number and
3987 in_system_directory flag; bias shndx by 1; print symbol names
3988 when dumping per-file symbol lists; use new symbol info readers.
3989 * incremental.cc
3990 (Output_section_incremental_inputs:update_data_size): New function.
3991 (Sized_incremental_binary::setup_readers): Setup input readers
3992 for each input file; build maps for files added from libraries
3993 and scripts.
3994 (Sized_incremental_binary::check_input_args): New function.
3995 (Sized_incremental_binary::do_check_inputs): Build map of argument
3996 serial numbers to input arguments.
3997 (Sized_incremental_binary::do_file_has_changed): Rename
3998 do_file_is_unchanged to this; compare file modification times.
3999 (Sized_incremental_binary::do_init_layout): New function.
4000 (Sized_incremental_binary::do_reserve_layout): New function.
4001 (Sized_incremental_binary::do_get_input_reader): Remove.
4002 (Sized_incremental_binary::get_symtab_view): New function.
4003 (Incremental_checker::can_incrementally_link_output_file): Remove.
4004 (Incremental_inputs::report_command_line): Exclude --debug options.
4005 (Incremental_inputs::report_archive_begin): Add parameter; track
4006 argument serial numbers; don't put input file entry for archive
4007 before archive members.
4008 (Incremental_inputs::report_archive_end): Put input file entry
4009 for archive after archive members.
4010 (Incremental_inputs::report_object): Add parameter; track argument
4011 serial numbers and in_system_directory flag.
4012 (Incremental_inputs::report_script): Add parameter; track argument
4013 serial numbers.
4014 (Output_section_incremental_inputs::set_final_data_size): Adjust
4015 size of symbol info entry; check for forwarding symbols.
4016 (Output_section_incremental_inputs::write_input_files): Write
4017 in_system_directory flag and argument serial number.
4018 (Output_section_incremental_inputs::write_info_blocks): Map section
4019 indices between incremental info and original input file; store
4020 input section index for each symbol.
4021 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4022 change operator() to visit().
4023 (class Global_got_offset_visitor): Likewise.
4024 (class Global_symbol_visitor_got_plt):
4025 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4026 classes.
4027 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4028 (Sized_incr_relobj::do_read_symbols): New function.
4029 (Sized_incr_relobj::do_layout): New function.
4030 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4031 (Sized_incr_relobj::do_add_symbols): New function.
4032 (Sized_incr_relobj::do_should_include_member): New function.
4033 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4034 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4035 (Sized_incr_relobj::do_section_size): New function.
4036 (Sized_incr_relobj::do_section_name): New function.
4037 (Sized_incr_relobj::do_section_contents): New function.
4038 (Sized_incr_relobj::do_section_flags): New function.
4039 (Sized_incr_relobj::do_section_entsize): New function.
4040 (Sized_incr_relobj::do_section_address): New function.
4041 (Sized_incr_relobj::do_section_type): New function.
4042 (Sized_incr_relobj::do_section_link): New function.
4043 (Sized_incr_relobj::do_section_info): New function.
4044 (Sized_incr_relobj::do_section_addralign): New function.
4045 (Sized_incr_relobj::do_initialize_xindex): New function.
4046 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4047 (Sized_incr_relobj::do_read_relocs): New function.
4048 (Sized_incr_relobj::do_gc_process_relocs): New function.
4049 (Sized_incr_relobj::do_scan_relocs): New function.
4050 (Sized_incr_relobj::do_count_local_symbols): New function.
4051 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4052 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4053 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4054 (Sized_incr_relobj::do_relocate): New function.
4055 (Sized_incr_relobj::do_set_section_offset): New function.
4056 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4057 (Sized_incr_dynobj::do_read_symbols): New function.
4058 (Sized_incr_dynobj::do_layout): New function.
4059 (Sized_incr_dynobj::do_add_symbols): New function.
4060 (Sized_incr_dynobj::do_should_include_member): New function.
4061 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4062 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4063 (Sized_incr_dynobj::do_section_size): New function.
4064 (Sized_incr_dynobj::do_section_name): New function.
4065 (Sized_incr_dynobj::do_section_contents): New function.
4066 (Sized_incr_dynobj::do_section_flags): New function.
4067 (Sized_incr_dynobj::do_section_entsize): New function.
4068 (Sized_incr_dynobj::do_section_address): New function.
4069 (Sized_incr_dynobj::do_section_type): New function.
4070 (Sized_incr_dynobj::do_section_link): New function.
4071 (Sized_incr_dynobj::do_section_info): New function.
4072 (Sized_incr_dynobj::do_section_addralign): New function.
4073 (Sized_incr_dynobj::do_initialize_xindex): New function.
4074 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4075 (make_sized_incremental_object): New function.
4076 (Incremental_library::copy_unused_symbols): New function.
4077 (Incremental_library::do_for_all_unused_symbols): New function.
4078 * incremental.h (enum Incremental_input_flags): New type.
4079 (class Incremental_checker): Remove.
4080 (Incremental_input_entry::Incremental_input_entry): Add argument
4081 serial number.
4082 (Incremental_input_entry::arg_serial): New function.
4083 (Incremental_input_entry::set_is_in_system_directory): New function.
4084 (Incremental_input_entry::is_in_system_directory): New function.
4085 (Incremental_input_entry::arg_serial_): New data member.
4086 (Incremental_input_entry::is_in_system_directory_): New data member.
4087 (class Script_info): Move here from script.h.
4088 (Script_info::Script_info): Add filename parameter.
4089 (Script_info::filename): New function.
4090 (Script_info::filename_): New data member.
4091 (Incremental_script_entry::Incremental_script_entry): Add argument
4092 serial number.
4093 (Incremental_object_entry::Incremental_object_entry): Likewise.
4094 (Incremental_object_entry::add_input_section): Build list of input
4095 sections with map to original shndx.
4096 (Incremental_object_entry::get_input_section_index): New function.
4097 (Incremental_object_entry::shndx_): New data member.
4098 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4099 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4100 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4101 serial number.
4102 (Incremental_inputs::report_archive_begin): Likewise.
4103 (Incremental_inputs::report_object): Likewise.
4104 (Incremental_inputs::report_script): Likewise.
4105 (class Incremental_global_symbol_reader): New class.
4106 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4107 and store flags and input file type.
4108 (Incremental_input_entry_reader::arg_serial): New function.
4109 (Incremental_input_entry_reader::type): Extract type from flags.
4110 (Incremental_input_entry_reader::is_in_system_directory): New function.
4111 (Incremental_input_entry_reader::get_input_section_count): Call
4112 accessor function for type.
4113 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4114 function for type; adjust size of global symbol entry.
4115 (Incremental_input_entry_reader::get_global_symbol_count): Call
4116 accessor function for type.
4117 (Incremental_input_entry_reader::get_object_count): Likewise.
4118 (Incremental_input_entry_reader::get_object_offset): Likewise.
4119 (Incremental_input_entry_reader::get_member_count): Likewise.
4120 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4121 (Incremental_input_entry_reader::get_member_offset): Likewise.
4122 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4123 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4124 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4125 (Incremental_input_entry_reader::get_global_symbol_reader): New
4126 function.
4127 (Incremental_input_entry_reader::get_output_symbol_index): New
4128 function.
4129 (Incremental_input_entry_reader::type_): Remove.
4130 (Incremental_input_entry_reader::flags_): New data member.
4131 (Incremental_inputs_reader::input_file_offset): New function.
4132 (Incremental_inputs_reader::input_file_index): New function.
4133 (Incremental_inputs_reader::input_file): Call input_file_offset.
4134 (Incremental_inputs_reader::input_file_at_offset): New function.
4135 (Incremental_relocs_reader::get_r_type): Reformat.
4136 (Incremental_relocs_reader::get_r_shndx): Reformat.
4137 (Incremental_relocs_reader::get_r_offset): Reformat.
4138 (Incremental_relocs_reader::data): New function.
4139 (Incremental_binary::Incremental_binary): Initialize new data members.
4140 (Incremental_binary::check_inputs): Add cmdline parameter.
4141 (Incremental_binary::file_is_unchanged): Remove.
4142 (Input_reader::arg_serial): New function.
4143 (Input_reader::get_unused_symbol_count): New function.
4144 (Input_reader::get_unused_symbol): New function.
4145 (Input_reader::do_arg_serial): New function.
4146 (Input_reader::do_get_unused_symbol_count): New function.
4147 (Input_reader::do_get_unused_symbol): New function.
4148 (Incremental_binary::input_file_count): New function.
4149 (Incremental_binary::get_input_reader): Change signature to use
4150 index instead of filename.
4151 (Incremental_binary::file_has_changed): New function.
4152 (Incremental_binary::get_input_argument): New function.
4153 (Incremental_binary::get_library): New function.
4154 (Incremental_binary::get_script_info): New function.
4155 (Incremental_binary::init_layout): New function.
4156 (Incremental_binary::reserve_layout): New function.
4157 (Incremental_binary::output_file): New function.
4158 (Incremental_binary::do_check_inputs): New function.
4159 (Incremental_binary::do_file_is_unchanged): Remove.
4160 (Incremental_binary::do_file_has_changed): New function.
4161 (Incremental_binary::do_init_layout): New function.
4162 (Incremental_binary::do_reserve_layout): New function.
4163 (Incremental_binary::do_input_file_count): New function.
4164 (Incremental_binary::do_get_input_reader): Change signature.
4165 (Incremental_binary::input_args_map_): New data member.
4166 (Incremental_binary::library_map_): New data member.
4167 (Incremental_binary::script_map_): New data member.
4168 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4169 new data members.
4170 (Sized_incremental_binary::output_section): New function.
4171 (Sized_incremental_binary::inputs_reader): Add const.
4172 (Sized_incremental_binary::symtab_reader): Add const.
4173 (Sized_incremental_binary::relocs_reader): Add const.
4174 (Sized_incremental_binary::got_plt_reader): Add const.
4175 (Sized_incremental_binary::get_symtab_view): New function.
4176 (Sized_incremental_binary::Inputs_reader): New typedef.
4177 (Sized_incremental_binary::Input_entry_reader): New typedef.
4178 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4179 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4180 (Sized_incremental_binary::do_file_has_changed): New function.
4181 (Sized_incremental_binary::do_init_layout): New function.
4182 (Sized_incremental_binary::do_reserve_layout): New function.
4183 (Sized_input_reader::Inputs_reader): Remove.
4184 (Sized_input_reader::Input_entry_reader): Remove.
4185 (Sized_input_reader::do_arg_serial): New function.
4186 (Sized_input_reader::do_get_unused_symbol_count): New function.
4187 (Sized_input_reader::do_get_unused_symbol): New function.
4188 (Sized_incremental_binary::do_input_file_count): New function.
4189 (Sized_incremental_binary::do_get_input_reader): Change signature;
4190 use index instead of filename.
4191 (Sized_incremental_binary::section_map_): New data member.
4192 (Sized_incremental_binary::input_entry_readers_): New data member.
4193 (class Sized_incr_relobj): New class.
4194 (class Sized_incr_dynobj): New class.
4195 (make_sized_incremental_object): New function.
4196 (class Incremental_library): New class.
4197 * layout.cc (Free_list::num_lists): New static data member.
4198 (Free_list::num_nodes): New static data member.
4199 (Free_list::num_removes): New static data member.
4200 (Free_list::num_remove_visits): New static data member.
4201 (Free_list::num_allocates): New static data member.
4202 (Free_list::num_allocate_visits): New static data member.
4203 (Free_list::init): New function.
4204 (Free_list::remove): New function.
4205 (Free_list::allocate): New function.
4206 (Free_list::dump): New function.
4207 (Free_list::print_stats): New function.
4208 (Layout_task_runner::run): Resize output file for incremental updates.
4209 (Layout::Layout): Initialize new data members.
4210 (Layout::set_incremental_base): New function.
4211 (Layout::init_fixed_output_section): New function.
4212 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4213 incremental updates.
4214 (Layout::create_gold_note): Do not create gold note section for
4215 incremental updates.
4216 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4217 for incremental updates.
4218 (Layout::set_section_offsets): For incremental updates, allocate space
4219 from free list.
4220 (Layout::create_symtab_sections): Layout with offsets relative to
4221 start of section; for incremental updates, allocate space from free
4222 list.
4223 (Layout::create_shdrs): For incremental updates, allocate space from
4224 free list.
4225 (Layout::finish_dynamic_section): For incremental updates, do not
4226 check --as-needed (fixed in subsequent patch).
4227 * layout.h (class Free_list): New class.
4228 (Layout::set_incremental_base): New function.
4229 (Layout::incremental_base): New function.
4230 (Layout::init_fixed_output_section): New function.
4231 (Layout::allocate): New function.
4232 (Layout::incremental_base_): New data member.
4233 (Layout::free_list_): New data member.
4234 * main.cc (main): Print Free_list statistics.
4235 * object.cc (Relobj::finalize_incremental_relocs): Add
4236 clear_counts parameter; clear counts only when clear_counts is set.
4237 (Sized_relobj::Sized_relobj): Initialize new base class.
4238 (Sized_relobj::do_layout): Don't report special sections.
4239 (Sized_relobj::do_for_all_local_got_entries): New function.
4240 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4241 symtab_off to all symbol table offsets.
4242 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4243 * object.h (class Got_offset_list): Move to top of file.
4244 (Object::Object): Allow case where input_file == NULL.
4245 (Object::~Object): Likewise.
4246 (Object::input_file): Assert that input_file != NULL.
4247 (Object::lock): Allow case where input_file == NULL.
4248 (Object::unlock): Likewise.
4249 (Object::is_locked): Likewise.
4250 (Object::token): Likewise.
4251 (Object::release): Likewise.
4252 (Object::is_incremental): New function.
4253 (Object::get_mtime): New function.
4254 (Object::for_all_local_got_entries): New function.
4255 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4256 (Object::set_is_in_system_directory): New function.
4257 (Object::is_in_system_directory): New function.
4258 (Object::do_is_incremental): New function.
4259 (Object::do_get_mtime): New function.
4260 (Object::do_for_all_local_got_entries): New function.
4261 (Object::is_in_system_directory_): New data member.
4262 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4263 (class Sized_relobj_base): New class.
4264 (class Sized_relobj): Derive from Sized_relobj_base.
4265 (class Sized_relobj::Symbols): Redeclare from base class.
4266 (class Sized_relobj::local_got_offset_list): Remove.
4267 (class Sized_relobj::Output_sections): Redeclare from base class.
4268 (class Sized_relobj::do_for_all_local_got_entries): New function.
4269 (class Sized_relobj::write_local_symbols): Add offset parameter.
4270 (class Sized_relobj::local_symbol_offset_): Update comment.
4271 (class Sized_relobj::local_dynsym_offset_): Update comment.
4272 * options.cc (Input_arguments::add_file): Remove const.
4273 * options.h (Input_file_argument::Input_file_argument):
4274 Initialize arg_serial_ (all constructors).
4275 (Input_file_argument::set_arg_serial): New function.
4276 (Input_file_argument::arg_serial): New function.
4277 (Input_file_argument::arg_serial_): New data member.
4278 (Input_arguments::Input_arguments): Initialize file_count_.
4279 (Input_arguments::add_file): Remove const.
4280 (Input_arguments::number_of_input_files): New function.
4281 (Input_arguments::file_count_): New data member.
4282 (Command_line::number_of_input_files): Call
4283 Input_arguments::number_of_input_files.
4284 * output.cc (Output_segment_headers::Output_segment_headers):
4285 Set current size.
4286 (Output_section::Input_section::current_data_size): New function.
4287 (Output_section::Output_section): Initialize new data members.
4288 (Output_section::add_input_section): Don't do merge sections for
4289 an incremental link; allocate space from free list for an
4290 incremental update.
4291 (Output_section::add_output_section_data): Allocate space from
4292 free list for an incremental update.
4293 (Output_section::update_data_size): New function.
4294 (Output_section::set_fixed_layout): New function.
4295 (Output_section::reserve): New function.
4296 (Output_segment::set_section_addresses): Remove const.
4297 (Output_segment::set_section_list_addresses): Remove const; allocate
4298 space from free list for an incremental update.
4299 (Output_segment::set_offset): Adjust size of RELRO segment for an
4300 incremental update.
4301 * output.h (Output_data::current_data_size): Move here from
4302 child classes.
4303 (Output_data::pre_finalize_data_size): New function.
4304 (Output_data::update_data_size): New function.
4305 (Output_section_headers::update_data_size): new function.
4306 (Output_section_data_build::current_data_size): Move to Output_data.
4307 (Output_data_strtab::update_data_size): New function.
4308 (Output_section::current_data_size): Move to Output_data.
4309 (Output_section::set_fixed_layout): New function.
4310 (Output_section::has_fixed_layout): New function.
4311 (Output_section::reserve): New function.
4312 (Output_section::update_data_size): New function.
4313 (Output_section::has_fixed_layout_): New data member.
4314 (Output_section::free_list_): New data member.
4315 (Output_segment::set_section_addresses): Remove const.
4316 (Output_segment::set_section_list_addresses): Remove const.
4317 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4318 New function.
4319 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4320 New function.
4321 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4322 parameter when calling Add_symbols constructor; store argument
4323 serial number for members of a lib group.
4324 (Add_symbols::locks): Allow case where token == NULL.
4325 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4326 (Read_member::~Read_member): New function.
4327 (Read_member::is_runnable): New function.
4328 (Read_member::locks): New function.
4329 (Read_member::run): New function.
4330 (Check_script::~Check_script): New function.
4331 (Check_script::is_runnable): New function.
4332 (Check_script::locks): New function.
4333 (Check_script::run): New function.
4334 (Check_library::~Check_library): New function.
4335 (Check_library::is_runnable): New function.
4336 (Check_library::locks): New function.
4337 (Check_library::run): New function.
4338 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4339 (Add_symbols::library_): New data member.
4340 (class Read_member): New class.
4341 (class Check_script): New class.
4342 (class Check_library): New class.
4343 * reloc.cc (Read_relocs::is_runnable): Allow case where
4344 token == NULL.
4345 (Read_relocs::locks): Likewise.
4346 (Scan_relocs::locks): Likewise.
4347 (Relocate_task::locks): Likewise.
4348 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4349 to clear counters.
4350 (Sized_relobj::incremental_relocs_scan): Fix comment.
4351 (Sized_relobj::do_relocate): Pass output file offset to
4352 write_local_symbols.
4353 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4354 from class declaration.
4355 * script.cc (read_input_script): Allocate Script_info; pass
4356 argument serial number to report_script.
4357 * script.h (class Script_info): Move to incremental.h.
4358 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4359 * symtab.h (Symbol_table::add_from_incrobj): New function.
4360 (Symbol_table::set_file_offset): New function.
4361
4362 2011-04-05 Cary Coutant <ccoutant@google.com>
4363
4364 * incremental-dump.cc (dump_incremental_inputs): Change signature
4365 to take a Sized_incremental_binary; change caller. Use readers
4366 in Sized_incremental_binary.
4367 * incremental.cc
4368 (Sized_incremental_binary::find_incremental_inputs_sections):
4369 Rename do_find_incremental_inputs_sections to this.
4370 (Sized_incremental_binary::setup_readers): New function.
4371 (Sized_incremental_binary::do_check_inputs): Check
4372 has_incremental_info_ flag; move setup code to setup_readers;
4373 use input readers.
4374 (Sized_incremental_binary::do_file_is_unchanged): New function.
4375 (Sized_incremental_binary::do_get_input_reader): New function.
4376 * incremental.h (class Incremental_binary): Move to end of file.
4377 (Incremental_binary::file_is_unchanged): New function.
4378 (Incremental_binary::do_file_is_unchanged): New function.
4379 (Incremental_binary::Input_reader): New class.
4380 (Incremental_binary::get_input_reader): New function.
4381 (class Sized_incremental_binary): Move to end of file.
4382 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4383 input section reader classes.
4384 (Sized_incremental_binary::has_incremental_info): New function.
4385 (Sized_incremental_binary::inputs_reader): New function.
4386 (Sized_incremental_binary::symtab_reader): New function.
4387 (Sized_incremental_binary::relocs_reader): New function.
4388 (Sized_incremental_binary::got_plt_reader): New function.
4389 (Sized_incremental_binary::do_file_is_unchanged): New function.
4390 (Sized_incremental_binary::Sized_input_reader): New class.
4391 (Sized_incremental_binary::get_input_reader): New function.
4392 (Sized_incremental_binary::find_incremental_inputs_sections):
4393 Rename do_find_incremental_inputs_sections to this.
4394 (Sized_incremental_binary::setup_readers): New function.
4395 (Sized_incremental_binary::has_incremental_info_): New data member.
4396 (Sized_incremental_binary::inputs_reader_): New data member.
4397 (Sized_incremental_binary::symtab_reader_): New data member.
4398 (Sized_incremental_binary::relocs_reader_): New data member.
4399 (Sized_incremental_binary::got_plt_reader_): New data member.
4400 (Sized_incremental_binary::current_input_file_): New data member.
4401
4402 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4403
4404 PR gold/12640
4405 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4406 violation.
4407
4408 2011-03-30 Cary Coutant <ccoutant@google.com>
4409
4410 * archive.cc (Archive::include_member): Adjust call to report_object.
4411 (Add_archive_symbols::run): Add script_info to call to
4412 report_archive_begin.
4413 (Lib_group::include_member): Adjust call to report_object.
4414 (Add_lib_group_symbols::run): Adjust call to report_object.
4415 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4416 blocks. Add object count for script input files.
4417 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4418 script_info parameter; change all callers.
4419 (Incremental_inputs::report_object): Add script_info parameter;
4420 change all callers.
4421 (Incremental_inputs::report_script): Store backpointer to
4422 incremental info entry.
4423 (Output_section_incremental_inputs::set_final_data_size): Record
4424 additional information for scripts.
4425 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4426 * incremental.h (Incremental_script_entry::add_object): New function.
4427 (Incremental_script_entry::get_object_count): New function.
4428 (Incremental_script_entry::get_object): New function.
4429 (Incremental_script_entry::objects_): New data member; adjust
4430 constructor.
4431 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4432 (Incremental_inputs::report_object): Add script_info parameter.
4433 (Incremental_inputs_reader::get_object_count): New function.
4434 (Incremental_inputs_reader::get_object_offset): New function.
4435 * options.cc (Input_arguments::add_file): Return reference to
4436 new input argument.
4437 * options.h (Input_argument::set_script_info): New function.
4438 (Input_argument::script_info): New function.
4439 (Input_argument::script_info_): New data member; adjust all
4440 constructors.
4441 (Input_file_group::add_file): Return reference to new input argument.
4442 (Input_file_lib::add_file): Likewise.
4443 (Input_arguments::add_file): Likewise.
4444 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4445 * script.cc (Parser_closure::Parser_closure): Add script_info
4446 parameter; adjust all callers.
4447 (Parser_closure::script_info): New function.
4448 (Parser_closure::script_info_): New data member.
4449 (read_input_script): Report scripts earlier to incremental info.
4450 (script_add_file): Set script_info in Input_argument.
4451 (script_add_library): Likewise.
4452 * script.h (Script_options::Script_info): Rewrite class.
4453
4454 2011-03-29 Cary Coutant <ccoutant@google.com>
4455
4456 * archive.cc (Library_base::should_include_member): Move
4457 method here from class Archive.
4458 (Archive::Archive): Initialize base class.
4459 (Archive::should_include_member): Move to base class.
4460 (Archive::do_for_all_unused_symbols): New function.
4461 (Add_archive_symbols::run): Remove redundant access to
4462 incremental_inputs.
4463 (Lib_group::Lib_group): Initialize base class.
4464 (Lib_group::do_filename): New function.
4465 (Lib_group::include_member): Pass pointer to Lib_group to
4466 report_object.
4467 (Lib_group::do_for_all_unused_symbols): New function.
4468 (Add_lib_group_symbols::run): Report archive information for
4469 incremental links.
4470 * archive.h (class Library_base): New base class.
4471 (class Archive): Derive from Library_base.
4472 (Archive::filename): Move to base class.
4473 (Archive::set_incremental_info): Likewise.
4474 (Archive::incremental_info): Likewise.
4475 (Archive::Should_include): Likewise.
4476 (Archive::should_include_member): Likewise.
4477 (Archive::Armap_entry): Remove.
4478 (Archive::Unused_symbol_iterator): Remove.
4479 (Archive::unused_symbols_begin): Remove.
4480 (Archive::unused_symbols_end): Remove.
4481 (Archive::do_filename): New function.
4482 (Archive::do_get_mtime): New function.
4483 (Archive::do_for_all_unused_symbols): New function.
4484 (Archive::task_): Move to base class.
4485 (Archive::incremental_info_): Likewise.
4486 (class Lib_group): Derive from Library_base.
4487 (Lib_group::do_filename): New function.
4488 (Lib_group::do_get_mtime): New function.
4489 (Lib_group::do_for_all_unused_symbols): New function.
4490 (Lib_group::task_): Move to base class.
4491 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4492 function.
4493 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4494 function.
4495 * incremental.cc (Incremental_inputs::report_archive_begin):
4496 Use Library_base; call library's get_mtime; add incremental inputs
4497 entry before members.
4498 (class Unused_symbol_visitor): New class.
4499 (Incremental_inputs::report_archive_end): Use Library_base; use
4500 visitor class to record unused symbols; don't add incremental inputs
4501 entry after members.
4502 (Incremental_inputs::report_object): Use Library_base.
4503 * incremental.h
4504 (Incremental_archive_entry::Incremental_archive_entry): Remove
4505 unused Archive parameter.
4506 (Incremental_inputs::report_archive_begin): Use Library_base.
4507 (Incremental_inputs::report_archive_end): Likewise.
4508 (Incremental_inputs::report_object): Likewise.
4509 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4510 function.
4511 * object.h (Object::for_all_global_symbols): New function.
4512 (Object::do_for_all_global_symbols): New function.
4513 (Sized_relobj::do_for_all_global_symbols): New function.
4514 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4515 function.
4516 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4517 function.
4518
4519 2011-03-27 Ian Lance Taylor <iant@google.com>
4520
4521 * archive.cc (Archive::interpret_header): Return -1 if something
4522 goes wrong. Change callers accordingly.
4523
4524 2011-03-25 Cary Coutant <ccoutant@google.com>
4525
4526 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4527 * testsuite/Makefile.in: Regenerate.
4528
4529 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
4530
4531 * plugin.cc (get_view): New.
4532 (Plugin::load): Pass get_view to the plugin.
4533 (Plugin_manager::get_view): New.
4534
4535 2011-03-21 Ian Lance Taylor <iant@google.com>
4536
4537 * testsuite/final_layout.sh: Rewrite to not use dc.
4538 * testsuite/relro_test.sh: Fail if dc is not present.
4539
4540 2011-03-21 Sriraman Tallam <tmsriram@google.com>
4541
4542 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4543 Change == to -eq.
4544 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4545 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4546 Change == to -eq.
4547 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4548 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4549
4550 2011-03-14 Ian Lance Taylor <iant@google.com>
4551
4552 * script-sections.cc (Sort_output_sections::script_compare):
4553 Rename from is_before, change return type.
4554 (Sort_output_sections::operator()): Adjust accordingly.
4555
4556 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4557
4558 PR gold/12572
4559 * testsuite/odr_violation2.cc: Add comment to make all error line
4560 numbers double digits.
4561 * testsuite/debug_msg.sh: Adjust expected errors.
4562
4563 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4564
4565 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4566 but mark earlier ones as non-canonical
4567 (offset_to_iterator): Update search target and example
4568 (do_addr2line): Return extra lines in a vector*
4569 (format_file_lineno): Extract from do_addr2line
4570 (one_addr2line): Add vector* out-param
4571 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4572 when a lineno entry appeared last for its instruction
4573 (Dwarf_line_info): Add vector* out-param
4574 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4575 * symtab.cc (Odr_violation_compare): Include the lineno in the
4576 comparison again.
4577 (linenos_from_loc): New. Combine the canonical line for an
4578 address with its other lines.
4579 (True_if_intersect): New. Helper functor to make
4580 std::set_intersection a query.
4581 (detect_odr_violations): Compare sets of lines instead of just
4582 one line for each function. This became less deterministic, but
4583 has fewer false positives.
4584 * symtab.h: Declarations.
4585 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4586 mix an optimized and non-optimized object in the same binary
4587 (odr_violation2.so): Same.
4588 * testsuite/Makefile.in: Regenerate from Makefile.am.
4589 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4590 * testsuite/debug_msg.sh: Update line numbers and add
4591 assertions.
4592 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4593 non-optimized context.
4594 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4595 isn't inlined, and use OdrDerived in an optimized context.
4596 * testsuite/odr_header1.h: Defines OdrDerived, where
4597 optimization will change the
4598 first-instruction-in-the-destructor's file and line number.
4599 * testsuite/odr_header2.h: Defines OdrBase.
4600
4601 2011-03-09 Ian Lance Taylor <iant@google.com>
4602
4603 * fileread.cc (File_read::clear_views): Don't delete the whole
4604 file view.
4605
4606 2011-03-08 Ian Lance Taylor <iant@google.com>
4607
4608 PR gold/12525
4609 * fileread.cc: #include <climits>.
4610 (GOLD_IOV_MAX): Define.
4611 (File_read::read_multiple): Limit number of entries by iov_max.
4612 * fileread.h (class File_read): Always set max_readv_entries to
4613 128.
4614
4615 2011-03-07 Ian Lance Taylor <iant@google.com>
4616
4617 PR gold/12525
4618 * options.h (class General_options): Add -dy and -dn.
4619
4620 2011-03-02 Cary Coutant <ccoutant@google.com>
4621
4622 * testsuite/script_test_9.t: Add TLS segment.
4623
4624 2011-03-02 Simon Baldwin <simonb@google.com>
4625
4626 * configure.ac: Add check for gnu_indirect_function support in
4627 the toolchain building binutils.
4628 * configure: Rebuild.
4629
4630 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
4631
4632 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4633 plugin only symbols.
4634 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4635 in plugin files as not needed in the symbol table.
4636
4637 2011-02-11 Sriraman Tallam <tmsriram@google.com>
4638
4639 * output.cc (Output_section::add_input_section): Delay fill
4640 generation for section ordering.
4641
4642 2011-02-09 Ian Lance Taylor <iant@google.com>
4643
4644 PR gold/12316
4645 * object.h (class Sized_relobj): Remove clear_local_symbols.
4646 * reloc.cc (Sized_relobj::do_relocate): Don't call
4647 clear_local_symbols.
4648
4649 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
4650
4651 * plugin.cc (is_visible_from_outside): Return true for symbols
4652 in the -u option.
4653
4654 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4655
4656 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4657 filename.
4658
4659 2011-02-02 Sriraman Tallam <tmsriram@google.com>
4660
4661 * icf.h (is_section_foldable_candidate): Change type of parameter
4662 to std::string.
4663 * icf.cc (Icf::find_identical_sections): Change type of local variable
4664 section_name to be std::string.
4665 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4666
4667 2011-01-25 Ian Lance Taylor <iant@google.com>
4668
4669 * script.cc (script_add_extern): Rewrite to use
4670 add_symbol_reference.
4671
4672 2011-01-25 Doug Kwan <dougkwan@google.com>
4673
4674 * icf.cc (get_section_contents): Always lock section's object.
4675
4676 2011-01-24 Ian Lance Taylor <iant@google.com>
4677
4678 * options.h (class General_options): Accept
4679 --no-detect-odr-violations.
4680
4681 2011-01-24 Ian Lance Taylor <iant@google.com>
4682
4683 * version.cc (version_string): Bump to 1.11.
4684
4685 2011-01-24 Ian Lance Taylor <iant@google.com>
4686
4687 * plugin.cc (class Plugin_rescan): Define new class.
4688 (Plugin_manager::claim_file): Set any_claimed_.
4689 (Plugin_manager::save_archive): New function.
4690 (Plugin_manager::save_input_group): New function.
4691 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4692 necessary.
4693 (Plugin_manager::new_undefined_symbol): New function.
4694 (Plugin_manager::rescan): New function.
4695 (Plugin_manager::rescannable_defines): New function.
4696 (Plugin_manager::add_input_file): Set any_added_.
4697 * plugin.h (class Plugin_manager): define new fields rescannable_,
4698 undefined_symbols_, any_claimed_, and any_added_. Declare
4699 Plugin_rescan as friend. Declare new functions.
4700 (Plugin_manager::Rescannable): Define type.
4701 (Plugin_manager::Rescannable_list): Define type.
4702 (Plugin_manager::Undefined_symbol_list): Define type.
4703 (Plugin_manager::Plugin_manager): Initialize new fields.
4704 * archive.cc (Archive::defines_symbol): New function.
4705 (Add_archive_symbols::run): Pass archive to plugins if any.
4706 * archive.h (class Archive): Declare defines_symbol.
4707 * readsyms.cc (Input_group::~Input_group): New function.
4708 (Finish_group::run): Pass input_group to plugins if any.
4709 * readsyms.h (class Input_group): Declare destructor.
4710 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4711 any.
4712
4713 2011-01-10 Ian Lance Taylor <iant@google.com>
4714
4715 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4716 section as relro.
4717 (Layout::set_segment_offsets): Reset increase_relro before calling
4718 set_section_addresses a second time.
4719
4720 2011-01-04 Cary Coutant <ccoutant@google.com>
4721
4722 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4723 sections before NOBITS sections.
4724
4725 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4726
4727 * version.cc (print_version): Update copyright to 2011.
4728
4729 2010-12-23 Cary Coutant <ccoutant@google.com>
4730
4731 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4732 of OS to this->add. Add OD parameter to second form of the function.
4733
4734 2010-12-20 Ian Lance Taylor <iant@google.com>
4735
4736 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4737 second of two consecutive entries with same offset.
4738
4739 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4740
4741 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4742 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4743 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4744 to avoid unneeded links against $(LDADD).
4745 * testsuite/Makefile.in: Regenerate.
4746
4747 2010-12-15 Ian Lance Taylor <iant@google.com>
4748
4749 PR gold/12324
4750 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4751 for R_X86_64_32 and R_X86_64_PC32.
4752 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4753 ver_matching_def_pic.o.
4754 (ver_matching_def_pic.o): New target.
4755
4756 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4757
4758 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4759 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4760 Move definition before File_read::View member definitions.
4761 (File_read::View::~View): Initialize and hold lock before
4762 updating current_mapped_bytes.
4763
4764 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4765
4766 * dwarf_reader.cc: Remove outdated comment.
4767 * gold-threads.cc: Fix typo in error message.
4768 * archive.cc: Fix typos in comments.
4769 * archive.h: Likewise.
4770 * arm-reloc-property.cc: Likewise.
4771 * arm-reloc-property.h: Likewise.
4772 * arm-reloc.def: Likewise.
4773 * arm.cc: Likewise.
4774 * attributes.h: Likewise.
4775 * cref.cc: Likewise.
4776 * ehframe.cc: Likewise.
4777 * fileread.h: Likewise.
4778 * gold.h: Likewise.
4779 * i386.cc: Likewise.
4780 * icf.cc: Likewise.
4781 * incremental.h: Likewise.
4782 * int_encoding.cc: Likewise.
4783 * layout.h: Likewise.
4784 * main.cc: Likewise.
4785 * merge.h: Likewise.
4786 * object.cc: Likewise.
4787 * object.h: Likewise.
4788 * options.cc: Likewise.
4789 * readsyms.cc: Likewise.
4790 * reduced_debug_output.cc: Likewise.
4791 * reloc.cc: Likewise.
4792 * script-sections.cc: Likewise.
4793 * sparc.cc: Likewise.
4794 * symtab.h: Likewise.
4795 * target-reloc.h: Likewise.
4796 * target.cc: Likewise.
4797 * target.h: Likewise.
4798 * timer.cc: Likewise.
4799 * timer.h: Likewise.
4800 * x86_64.cc: Likewise.
4801
4802 2010-12-09 Cary Coutant <ccoutant@google.com>
4803
4804 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4805 stack.
4806 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4807 parameter; change all callers.
4808 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4809 * options.h (warn_execstack): New option.
4810
4811 2010-12-07 Doug Kwan <dougkwan@google.com>
4812
4813 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4814 like function call relocations.
4815
4816 2010-12-07 Ian Lance Taylor <iant@google.com>
4817
4818 * archive.cc (Archive::get_elf_object_for_member): Permit
4819 punconfigured to be NULL.
4820 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4821 (Archive::include_member): Pass NULL to get_elf_object_for_member
4822 if we searched for the archive and this is the first included
4823 object.
4824
4825 2010-12-01 Ian Lance Taylor <iant@google.com>
4826
4827 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4828 track_relocs_type_ field.
4829 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4830 Set track_relocs_type_.
4831 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4832 contents when using RELA relocs.
4833 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4834 reloc_map_.
4835 * reloc.cc (Track_relocs::next_addend): New function.
4836 * reloc.h (class Track_relocs): Declare next_addend.
4837
4838 2010-12-01 Ian Lance Taylor <iant@google.com>
4839
4840 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4841 virtual destructor.
4842
4843 2010-12-01 Ian Lance Taylor <iant@google.com>
4844
4845 * README: Update compilers known to work and fail.
4846
4847 2010-11-23 Matthias Klose <doko@ubuntu.com>
4848
4849 * configure.in: For --enable-gold, handle value `default' instead of
4850 `both*'. Always install ld as ld.bfd, install as ld if gold is
4851 not the default.
4852 * configure: Regenerate.
4853
4854 2010-11-18 Doug Kwan <dougkwan@google.com>
4855
4856 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4857 and right_alignment to be zero. Store result alignment only if it is
4858 greater than existing alignment.
4859
4860 2010-11-16 Cary Coutant <ccoutant@google.com>
4861
4862 PR gold/12220
4863 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4864 Check for ".zdebug_line".
4865
4866 2010-11-16 Doug Kwan <dougkwan@google.com>
4867 Cary Coutant <ccoutant@google.com>
4868
4869 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4870 by reference; adjust all callers.
4871 * output.cc (Output_segment::set_section_addresses): Adjust references
4872 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4873 list is empty.
4874 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4875 end at page boundary.
4876
4877 2010-11-16 Cary Coutant <ccoutant@google.com>
4878
4879 PR gold/12220
4880 * layout.cc (Layout::choose_output_section): Transform names of
4881 compressed sections even when using a script with a SECTIONS clause.
4882 (Layout::output_section_name): Remove code to transform
4883 compressed debug section names.
4884 * output.cc (Output_section::add_input_section): Use uncompressed
4885 section size when tracking input sections.
4886
4887 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4888
4889 * symtab.h (Symbol::NON_PIC_REF): Remove.
4890 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4891 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4892 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4893 (Symbol::use_plt_offset): Take a flags argument and pass it
4894 directly to needs_dynamic_reloc. Restrict check for undefined
4895 weak symbols to function calls.
4896 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4897 (Target_arm::Scan::global): Use it.
4898 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4899 (Target_arm::Relocate::relocate): Likewise.
4900 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4901 parameter with an r_type parameter. Use get_reference_flags
4902 to get the flags.
4903 (Target_arm::Relocate::relocate): Update accordingly.
4904 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4905 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4906 (Target_i386::Scan::global): Likewise.
4907 (Target_i386::Relocate::relocate): Likewise.
4908 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4909 parameter with an r_type parameter. Use get_reference_flags
4910 to get the flags.
4911 (Target_i386::Relocate::relocate): Update accordingly.
4912 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4913 (Target_powerpc::Scan::global): Use it.
4914 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4915 (Target_powerpc::Relocate::relocate): Likewise.
4916 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4917 (Target_sparc::Scan::global): Use it.
4918 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4919 (Target_sparc::Relocate::relocate): Likewise.
4920 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4921 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4922 (Target_x86_64::Scan::global): Likewise.
4923 (Target_x86_64::Relocate::relocate): Likewise.
4924
4925 2010-11-08 Doug Kwan <dougkwan@google.com>
4926 Cary Coutant <ccoutant@google.com>
4927
4928 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4929 (Arm_exidx_merge_section::section_contents_): New data member.
4930 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4931 (Arm_input_section::~Arm_input_section): De-allocate memory.
4932 (Arm_input_section::original_contents_): New data member.
4933 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4934 in parameters instead of calling Object::section_contents without
4935 locking.
4936 (Arm_output_section::group_section): New parameter TASK. Pass it
4937 to callees that need locking objects.
4938 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4939 to lock EXIDX input sections. Fix a formatting issue. Call
4940 Arm_exidx_merged_section::build_contents to create merged section
4941 contents.
4942 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4943 to lock object of stub table owner.
4944 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4945 TEXT_SIZE to initialize data member TEXT_SIZE_.
4946 (Arm_exidx_input_section::addralign): Fix typo in comment.
4947 (Arm_exidx_input_section::text_size): New method.
4948 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4949 that require locking objects. Lock objects before scanning for stubs
4950 and updating local symbols.
4951 (Arm_input_section<big_endian>::init): Copy contents of original
4952 input section.
4953 (Arm_input_section<big_endian>::do_write): Use saved contents of
4954 original input section instead of calling Object::section_contents
4955 without locking.
4956 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4957 size without calling Object::section_size().
4958 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4959 for size. Allocate a buffer for merged EXIDX entries.
4960 (Arm_exidx_merged_section::build_contents): New method.
4961 (Arm_exidx_merged_section::do_write): Move merge section contents
4962 building code to Arm_exidx_merged_section::build_contetns. Write
4963 out contetns in buffer instead of building it on the fly.
4964 (Arm_relobj::make_exidx_input_section): Also pass text section size
4965 to Arm_exidx_input_section constructor.
4966 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4967 (Arm_dynobj::do_read_symbols): Fix memory leak.
4968 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4969 * target.h: (class Task): Add forward declaration.
4970 (Target::relax): Add new parameter TASK and pass it to
4971 Target::do_relax().
4972 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4973
4974 2010-11-05 Cary Coutant <ccoutant@google.com>
4975
4976 PR gold/10708
4977 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4978 object when reading from the file.
4979 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4980 second layout pass.
4981 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4982 when reading section contents.
4983 (get_section_contents): Likewise.
4984 (icf::find_identical_sections): Likewise.
4985 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4986 object when reading from the file.
4987 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4988 the object when doing deferred section layout.
4989
4990 2010-11-03 Nick Clifton <nickc@redhat.com>
4991
4992 PR gold/12001
4993 * script.h (class Symbol_assignment: name): New member. Returns
4994 the name of the symbol.
4995 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4996 Returns true if the given symbol name is on the list of
4997 assignments wating to be processed.
4998 * archive.cc (should_incldue_member): If the symbol is undefined,
4999 check to see if it is on the list of symbols pending assignment.
5000
5001 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5002
5003 * script-sections.cc (Script_sections::find_memory_region): Check
5004 for a NULL output section pointer.
5005
5006 2010-10-29 Doug Kwan <dougkwan@google.com>
5007
5008 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5009 Output_section::add_relaxed_input_section.
5010 * output.cc (Output_section::add_relaxed_input_section): Add new
5011 arguments LAYOUT and NAME. Set section order index.
5012 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5013 Copy section order index.
5014 * output.h (Output_section::add_relaxed_input_section): Add new
5015 arguments LAYOUT and NAME.
5016
5017 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5018
5019 * testsuite/Makefile.am: Move gcctestdir/ld rule to
5020 NATIVE_OR_CROSS_LINKER.
5021 * testsuite/Makefile.in: Regenerate.
5022
5023 2010-10-20 Doug Kwan <dougkwan@google.com>
5024
5025 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5026 without SHF_LINK_ORDER flags.
5027 * layout.cc (Layout::choose_output_section): Do not filter
5028 SHF_LINK_ORDER flag in a relocatable link.
5029
5030 2010-10-17 Cary Coutant <ccoutant@google.com>
5031
5032 * output.h (Output_segment::set_section_addresses): Change function
5033 signature. Update all callers.
5034 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5035 sections.
5036 (Output_segment::set_section_addresses): Align after last TLS
5037 section. Add padding before last relro section instead of after.
5038
5039 2010-10-17 Doug Kwan <dougkwan@google.com>
5040
5041 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5042 GOT output section to be writable.
5043
5044 2010-10-14 Cary Coutant <ccoutant@google.com>
5045
5046 * debug.h (DEBUG_INCREMENTAL): New flag.
5047 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5048 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5049 mode.
5050 * incremental.cc (report_command_line): Ignore all forms of
5051 --incremental.
5052 * layout.cc (Layout::Layout): Check parameters for incremental link
5053 mode.
5054 * options.cc (General_options::parse_incremental): New function.
5055 (General_options::parse_no_incremental): New function.
5056 (General_options::parse_incremental_full): New function.
5057 (General_options::parse_incremental_update): New function.
5058 (General_options::incremental_mode_): New data member.
5059 (General_options::finalize): Check incremental_mode_.
5060 * options.h (General_options): Update help text for --incremental.
5061 Add --no-incremental, --incremental-full, --incremental-update.
5062 (General_options::Incremental_mode): New enum type.
5063 (General_options::incremental_mode): New function.
5064 (General_options::incremental_mode_): New data member.
5065 * parameters.cc (Parameters::incremental_mode_): New data member.
5066 (Parameters::set_options): Set incremental_mode_.
5067 (Parameters::set_incremental_full): New function.
5068 (Parameters::incremental): New function.
5069 (Parameters::incremental_update): New function.
5070 (set_parameters_incremental_full): New function.
5071 * parameters.h (Parameters::set_incremental_full): New function.
5072 (Parameters::incremental): New function.
5073 (Parameters::incremental_update): New function.
5074 (Parameters::incremental_mode_): New data member.
5075 (set_parameters_incremental_full): New function.
5076 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5077 incremental link mode.
5078 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5079 (Sized_relobj::do_relocate_sections): Likewise.
5080 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5081 option.
5082 * testsuite/Makefile.in: Regenerate.
5083 * testsuite/incremental_test.sh: Filter all forms of --incremental.
5084
5085 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5086
5087 * script-sections.h (class Script_sections): Make
5088 Sections_elements typedef public.
5089 * script-sections.cc (class Sort_output_sections): Add elements_
5090 field. Add constructor which sets it; change all callers.
5091 (Sort_output_sections::is_before): New function.
5092 (Sort_output_sections::operator()): Call is_before.
5093 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5094 conditional.
5095 * testsuite/script_test_10.sh: New test. Test script section
5096 order.
5097 * testsuite/script_test_10.t: Likewise.
5098 * testsuite/script_test_10.s: Likewise.
5099 * testsuite/Makefile.am: Wrap the cross linker tests and the
5100 common tests into NATIVE_OR_CROSS_LINKER.
5101 (check_SCRIPTS): Add script_test_10.sh.
5102 (check_DATA): Add script_test_10.stdout.
5103 (script_test_10.o, script_test_10): New targets.
5104 (script_test_10.stdout): New target.
5105 * configure, testsuite/Makefile.in: Regenerate.
5106
5107 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5108
5109 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5110 error for the deprecated relocations.
5111 (Target_arm::Scan::global): Likewise.
5112 (Target_arm::Relocate::relocate): Likewise.
5113
5114 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5115
5116 * fileread.cc (Input_file::find_file): Initialize *found_name
5117 and *namep when using the fallback search for case 4.
5118
5119 2010-10-11 Cary Coutant <ccoutant@google.com>
5120
5121 * options.h (class General_options): Redefine -z lazy as an alias for
5122 the negation of -z now.
5123
5124 2010-10-11 Ian Lance Taylor <iant@google.com>
5125
5126 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5127 binding.
5128
5129 2010-10-06 Nick Clifton <nickc@redhat.com>
5130
5131 * script-sections.cc(class Memory_region): Remove
5132 current_lma_offset_ field. Rename current_vma_offset_ to
5133 current_offset_. Add last_section_ field.
5134 (Memory_region::get_current_vma_address): Rename to
5135 get_current_address.
5136 (Memory_region::get_current_lma_address): Delete.
5137 (Memory_region::increment_vma_offset): Rename to
5138 increment_offset.
5139 (Memory_region::increment_lma_offset): Delete.
5140 (Memory_region::attributes_compatible): New method. Returns
5141 true if the provided section is compatible with the region.
5142 (Memory_region::get_last_section): New method. Returns the last
5143 section to use the region.
5144 (Memory_region::set_last_section): New method. Stores the last
5145 section to use the region.
5146 (Script_sections::block_in_region): New method. Returns true if
5147 a block of memory is contained within a region.
5148 (Script_sections::find_memory_region): New method. Locates a
5149 memory region to be used to set a VMA or LMA address.
5150 (Output_section_definition::set_section_addresses): Add code to
5151 check for addresses set by memory regions.
5152 (Output_segment::set_section_addresses): Remove memory region
5153 walking code.
5154 (Script_sections::create_segment): Add a warning if a header
5155 segment is created outside of any region.
5156 * script-sections.h (class Script_sections): Add prototypes for
5157 find_memory_region and block_in_region methods.
5158 * testsuite/memory_test.s: Use .long instead of .word.
5159 * testsuite/memory_test.t: Add some more output sections.
5160 * testsuite/memory_test.sh: Update expected output.
5161
5162 2010-10-02 Doug Kwan <dougkwan@google.com>
5163
5164 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5165 defintion to symtab.h
5166 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5167 declaration to defintion.
5168
5169 2010-10-01 Nick Clifton <nickc@redhat.com>
5170
5171 * expression.cc (eval): Replace dummy argument with NULL.
5172 (eval_maybe_dot): Check for a NULL result section pointer.
5173 (Symbol_expression::value): Likewise.
5174 (Dot_expression::value): Likewise.
5175 (BINARY_EXPRESSION): Likewise.
5176 (Max_expression::value): Likewise.
5177 (Min_expression::value): Likewise.
5178 (Absolute_expression::value): Likewise.
5179 (Addr_expression::value_from_output_section): Likewise.
5180 (Loaddddr_expression::value_from_output_section): Likewise.
5181 (Segment_start_expression::value): Likewise.
5182 * script-sections.cc
5183 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5184 argument with NULL.
5185 (Sections_elememt_dot_assignment::set_section_addresses):
5186 Likewise.
5187 (Output_data_expression::do_write_to_buffer): Likewise.
5188 (Output_section_definition::finalize_symbols): Likewise.
5189 (Output_section_definition::set_section_addresses): Likewise.
5190
5191 2010-09-30 Doug Kwan <dougkwan@google.com>
5192
5193 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5194
5195 2010-09-28 Sriraman Tallam <tmsriram@google.com>
5196
5197 * target.h (Target::can_icf_inline_merge_sections): New virtual
5198 function.
5199 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5200 virtual function.
5201 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5202 virtual function.
5203 * icf.cc (get_section_contents): Inline merge sections only when
5204 target allows it.
5205
5206 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5207
5208 * configure: Regenerate.
5209
5210 2010-09-17 Ian Lance Taylor <iant@google.com>
5211
5212 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
5213 * testsuite/Makefile.am (memory_test.o): New target.
5214 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5215 memory_test.t.
5216 * testsuite/Makefile.in: Rebuild.
5217
5218 2010-09-17 Doug Kwan <dougkwan@google.com>
5219
5220 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5221 defintion if relocation uses GOT entries of the symbol.
5222 * testsuite/icf_safe_test.sh: Fix test.
5223 * testsuite/icf_safe_so_test.sh: Fix test.
5224
5225 2010-09-16 Cary Coutant <ccoutant@google.com>
5226
5227 * script_sections.cc (class Memory_region): Remove "NULL" from
5228 vector initializations.
5229
5230 2010-09-15 Cary Coutant <ccoutant@google.com>
5231
5232 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5233 Resolve forwarding symbols.
5234
5235 2010-09-15 Doug Kwan <dougkwan@google.com>
5236
5237 * gold/testsuite/script_test_3.t: Add ARM special sections.
5238 * gold/testsuite/script_test_4.t: Same.
5239 * gold/testsuite/script_test_5.t: Same.
5240 * gold/testsuite/script_test_6.t: Same.
5241 * gold/testsuite/script_test_7.t: Same.
5242 * gold/testsuite/script_test_7.t: Same.
5243 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5244
5245 2010-09-14 Cary Coutant <ccoutant@google.com>
5246
5247 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5248 (Target_x86_64::Relocate::relocate_tls): Replace check for
5249 saw_tls_block_reloc_ with test for executable section.
5250
5251 2010-09-12 Cary Coutant <ccoutant@google.com>
5252
5253 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5254 position-independent executables to shared libraries need dynamic
5255 relocations.
5256 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5257 position-independent executables.
5258 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5259 * testsuite/Makefile.in: Regenerate.
5260
5261 2010-09-10 Nick Clifton <nickc@redhat.com>
5262
5263 PR gold/11997
5264 * testsuite/memory_test.t: Discard any sections that are not
5265 needed.
5266
5267 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5268
5269 PR gold/11996
5270 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5271 "This::" to work around a bug in gcc 4.2.
5272
5273 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5274
5275 2010-09-09 Rafael Espindola <espindola@google.com>
5276
5277 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5278 sections with different PF_X flags in the same segment.
5279 (Layout::find_first_load_seg): Search all segments to find the first
5280 one.
5281 * options.h (rosegment): New.
5282
5283 2010-09-08 Rafael Espindola <espindola@google.com>
5284
5285 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
5286
5287 2010-09-08 Doug Kwan <dougkwan@google.com>
5288
5289 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5290 (Arm_relobj::do_relocate_sections): Add new parameter for output
5291 file to match the parent.
5292 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5293 of local symbols instead of input values. Update code to track
5294 changes in gold::relocate_section.
5295 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5296 (Sized_relobj::compute_final_local_value_internal): New methods.
5297 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5298 body into private version of Sized_relobj::compute_final_local_value.
5299 Call the inline method.
5300 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5301 merged symbol value if there is one.
5302 (Symbol_value::has_output_value): New method defintiion.
5303 (Sized_relobj::Compute_final_local_value_status): New enum type.
5304 (Sized_relobj::compute_final_local_value): New methods.
5305 (Sized_relobj::compute_final_local_value_internal): New methods.
5306 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5307 and arm_cortex_a8.sh.
5308 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5309 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5310 New tests.
5311 * Makefile.in: Regenerate.
5312 * testsuite/arm_bl_out_of_range.s: Update test.
5313 * testsuite/thumb_bl_out_of_range.s: Ditto.
5314 * testsuite/thumb_blx_out_of_range.s: Ditto.
5315 * testsuite/arm_branch_out_of_range.sh: New file.
5316 * testsuite/arm_cortex_a8.sh: Ditto.
5317 * testsuite/arm_cortex_a8_b.s: Ditto.
5318 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5319 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5320 * testsuite/arm_cortex_a8_bl.s: Ditto.
5321 * testsuite/arm_cortex_a8_blx.s: Ditto.
5322 * testsuite/arm_cortex_a8_local.s: Ditto.
5323 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5324 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5325
5326 2010-09-08 Rafael Espindola <espindola@google.com>
5327
5328 * Makefile.am (memory_test.stdout): Run readelf with -W.
5329 * Makefile.in: Regenerate.
5330 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5331 64 bit output.
5332
5333 2010-09-08 Rafael Espindola <espindola@google.com>
5334
5335 * script-sections.cc (Script_sections::add_memory_region): Convert
5336 field precision to int.
5337 * script.cc (script_set_section_region, script_set_section_region):
5338 Convert field precision to int.
5339
5340 2010-09-08 Rafael Espindola <espindola@google.com>
5341
5342 * arm.cc (do_finalize_sections): Create the __exidx_start and
5343 __exdix_end symbols even when the section is missing.
5344
5345 2010-09-08 Nick Clifton <nickc@redhat.com>
5346
5347 * README: Remove claim that MEMORY is not supported.
5348 * expression.cc (script_exp_function_origin)
5349 (script_exp_function_length): Move from here to ...
5350 * script.cc: ... here.
5351 (script_set_section_region, script_add_memory)
5352 (script_parse_memory_attr, script_include_directive): New
5353 functions.
5354 * script-sections.cc
5355 (class Memory_region): New class.
5356 (class Output_section_definition): Add set_memory_region,
5357 set_section_vma, set_section_lma and get_section_name methods.
5358 (class Script_Sections): Add add_memory_region,
5359 find_memory_region, find_memory_region_origin,
5360 find_memory_region_length and set_memory_region methods.
5361 Have set_section_addresses method walk the list of set memory
5362 regions.
5363 Extend the print methos to display memory regions.
5364 * script-sections.h: Add prototypes for new methods.
5365 Add enum for MEMORY region attributes.
5366 * yyscript.y: Add support for parsing MEMORY regions.
5367 * script-c.h: Add prototypes for new functions.
5368 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5369 * testsuite/Makefile.in: Regenerate.
5370 * testsuite/memory_test.sh: New script.
5371 * testsuite/memory_test.s: New assembler source file.
5372 * testsuite/memory_test.t: New linker script.
5373
5374 2010-08-27 Doug Kwan <dougkwan@google.com>
5375
5376 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5377 reference override an existing dynamic weak reference.
5378 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5379 * testsuite/Makefile.in: Regenerate.
5380 * testsuite/dyn_weak_ref.sh: New file.
5381 * testsuite/dyn_weak_ref_1.c: Ditto.
5382 * testsuite/dyn_weak_ref_2.c: Ditto.
5383
5384 2010-08-27 Ian Lance Taylor <iant@google.com>
5385
5386 * incremental.h (class Incremental_input_entry): Add virtual
5387 destructor.
5388
5389 2010-08-27 Ian Lance Taylor <iant@google.com>
5390
5391 * testsuite/start_lib_test_3.c: Mark t3 as used.
5392
5393 2010-08-27 Nick Clifton <nickc@redhat.com>
5394
5395 * options.cc (version_script): Fix small typo in previous
5396 whitespace tidyup.
5397
5398 2010-08-25 Nick Clifton <nickc@redhat.com>
5399
5400 * archive.cc: Formatting fixes: Remove whitespace between
5401 typename and following asterisk. Remove whitespace between
5402 function name and opening parenthesis.
5403 * archive.h: Likewise.
5404 * arm.cc: Likewise.
5405 * attributes.cc: Likewise.
5406 * attributes.h: Likewise.
5407 * common.cc: Likewise.
5408 * copy-relocs.cc: Likewise.
5409 * dirsearch.h: Likewise.
5410 * dynobj.cc: Likewise.
5411 * ehframe.cc: Likewise.
5412 * ehframe.h: Likewise.
5413 * expression.cc: Likewise.
5414 * fileread.cc: Likewise.
5415 * fileread.h: Likewise.
5416 * gc.h: Likewise.
5417 * gold-threads.cc: Likewise.
5418 * gold.cc: Likewise.
5419 * i386.cc: Likewise.
5420 * icf.h: Likewise.
5421 * incremental-dump.cc: Likewise.
5422 * incremental.cc: Likewise.
5423 * layout.cc: Likewise.
5424 * layout.h: Likewise.
5425 * main.cc: Likewise.
5426 * merge.cc: Likewise.
5427 * merge.h: Likewise.
5428 * object.cc: Likewise.
5429 * object.h: Likewise.
5430 * options.cc: Likewise.
5431 * options.h: Likewise.
5432 * output.cc: Likewise.
5433 * output.h: Likewise.
5434 * plugin.cc: Likewise.
5435 * plugin.h: Likewise.
5436 * powerpc.cc: Likewise.
5437 * reloc.cc: Likewise.
5438 * script-c.h: Likewise.
5439 * script-sections.cc: Likewise.
5440 * script.cc: Likewise.
5441 * stringpool.cc: Likewise.
5442 * symtab.cc: Likewise.
5443 * symtab.h: Likewise.
5444 * target.cc: Likewise.
5445 * timer.cc: Likewise.
5446 * timer.h: Likewise.
5447 * version.cc: Likewise.
5448 * x86_64.cc: Likewise.
5449
5450 2010-08-24 Nick Clifton <nickc@redhat.com>
5451
5452 PR 11899
5453 * layout.cc (segment_precedes): Sort segments by their physical
5454 addresses, if they have been set.
5455
5456 2010-08-23 Cary Coutant <ccoutant@google.com>
5457
5458 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5459 symbols data.
5460 (Lib_group::include_member): Unlock object after deleting its
5461 symbols data.
5462 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5463 the bug fixed here.
5464
5465 2010-08-19 Neil Vachharajani <nvachhar@google.com>
5466 Cary Coutant <ccoutant@google.com>
5467
5468 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5469 constructor, and set_blocker.
5470 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5471 readsyms_blocker_.
5472 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5473 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5474 * testsuite/Makefile.am (start_lib_test): New test case.
5475 * testsuite/Makefile.in: Regenerate.
5476 * testsuite/start_lib_test_main.c: New file.
5477 * testsuite/start_lib_test_1.c: New file.
5478 * testsuite/start_lib_test_2.c: New file.
5479 * testsuite/start_lib_test_3.c: New file.
5480
5481 2010-08-19 Ian Lance Taylor <iant@google.com>
5482
5483 * Makefile.in: Rebuild with automake 1.11.1.
5484 * aclocal.m4: Likewise.
5485 * testsuite/Makefile.in: Likewise.
5486
5487 2010-08-19 Ian Lance Taylor <iant@google.com>
5488
5489 PR 10893
5490 * i386.cc (class Output_data_plt_i386): Update declarations.
5491 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5492 local_ifuncs_ fields.
5493 (Target_i386::do_plt_section_for_global): New function.
5494 (Target_i386::do_plt_section_for_local): New function.
5495 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5496 parameter; change all callers. Initialize global_ifuncs_ and
5497 local_ifuncs_. If doing a static link define __rel_iplt_start and
5498 __rel_iplt_end.
5499 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5500 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5501 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5502 symbols.
5503 (Target_i386::make_plt_section): New function, broken out of
5504 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5505 (Target_i386::make_plt_entry): Call make_plt_section.
5506 (Target_i386::make_local_ifunc_plt_entry): New function.
5507 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5508 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5509 R_386_IRELATIVE to switch.
5510 (Target_i386::Scan::global): Likewise.
5511 (Target_i386::Relocate::relocate): Likewise.
5512 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5513 switch.
5514 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5515 (Target_x86_64::do_plt_section_for_global): New function.
5516 (Target_x86_64::do_plt_section_for_local): New function.
5517 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5518 parameter; change all callers. If doing a static link define
5519 __rela_iplt_start and __rela_iplt_end.
5520 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5521 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5522 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5523 to point to .plt.
5524 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5525 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5526 switch.
5527 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5528 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5529 R_X86_64_IRELATIVE to switch.
5530 (Target_x86_64::Scan::global): Likewise.
5531 (Target_x86_64::Relocate::relocate): Likewise.
5532 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5533 switch.
5534 * target.h (class Target): Add plt_section_for_global and
5535 plt_section_for_local functions. Add do_plt_section_for_global
5536 and do_plt_section_for_local virtual functions.
5537 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5538 clarifying comments.
5539 (Symbol::use_plt_offset): Handle IFUNC symbol.
5540 * object.cc (Sized_relobj::Sized_relobj): Initialize
5541 local_plt_offsets_.
5542 (Sized_relobj::local_has_plt_offset): New function.
5543 (Sized_relobj::local_plt_offset): New function.
5544 (Sized_relobj::set_local_plt_offset): New function.
5545 (Sized_relobj::do_count): Handle IFUNC symbol.
5546 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5547 a bit away from input_shndx_ field. Add set_is_func_symbol and
5548 is_ifunc_symbol functions.
5549 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5550 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5551 local_plt_offsets_ field.
5552 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5553 * output.h (class Output_section_data): Add non-const
5554 output_section function.
5555 (class Output_data_got): Update declarations.
5556 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5557 Add use_plt_offset parameter to global and local constructors.
5558 Change all callers. Change local_sym_index_ field to 31 bits.
5559 Change GSYM_CODE and CONSTANT_CODE accordingly.
5560 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5561 doing a static link don't set sh_link field.
5562 (Output_data_got::Got_entry::write): Use PLT offset if
5563 appropriate.
5564 (Output_data_got::add_global_plt): New function.
5565 (Output_data_got::add_local_plt): New function.
5566 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5567 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5568 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5569 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5570 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5571 IFUNC conditional.
5572 * testsuite/ifunc-sel.h: New file.
5573 * testsuite/ifuncmain1.c: New file.
5574 * testsuite/ifuncmain1vis.c: New file.
5575 * testsuite/ifuncmod1.c: New file.
5576 * testsuite/ifuncdep2.c: New file.
5577 * testsuite/ifuncmain2.c: New file.
5578 * testsuite/ifuncmain3.c: New file.
5579 * testsuite/ifuncmod3.c: New file.
5580 * testsuite/ifuncmain4.c: New file.
5581 * testsuite/ifuncmain5.c: New file.
5582 * testsuite/ifuncmod5.c: New file.
5583 * testsuite/ifuncmain6pie.c: New file.
5584 * testsuite/ifuncmod6.c: New file.
5585 * testsuite/ifuncmain7.c: New file.
5586 * configure, testsuite/Makefile.in: Rebuild.
5587
5588 2010-08-18 Ian Lance Taylor <iant@google.com>
5589
5590 * incremental.cc
5591 (Output_section_incremental_inputs::write_input_files): Add cast
5592 to avoid signed/unsigned comparison warning.
5593 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5594
5595 2010-08-12 Cary Coutant <ccoutant@google.com>
5596
5597 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5598
5599 2010-08-13 Ian Lance Taylor <iant@google.com>
5600
5601 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5602
5603 2010-08-12 Cary Coutant <ccoutant@google.com>
5604 Doug Kwan <dougkwan@google.com>
5605
5606 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5607 defintion overrides non-weak undef, remember that the original undef
5608 is not weak.
5609 * symtab.cc (Symbol_table::sized_write_global): For undef without
5610 an original weak binding, set binding to global in output.
5611 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5612 * testsuite/Makefile.in: Regenerate.
5613 * testsuite/strong_ref_weak_def.sh: New file.
5614 * testsuite/strong_ref_weak_def_1.c: Ditto.
5615 * testsuite/strong_ref_weak_def_2.c: Ditto.
5616
5617 2010-08-12 Cary Coutant <ccoutant@google.com>
5618
5619 * testsuite/incremental_test.sh: Rewrite.
5620 * testsuite/incremental_test_1.c: Rewrite.
5621 * testsuite/incremental_test_2.c: Rewrite.
5622
5623 2010-08-12 Cary Coutant <ccoutant@google.com>
5624
5625 * arm.cc (Target_arm::got_size): Add const.
5626 (Target_arm::got_entry_count): New function.
5627 (Target_arm::plt_entry_count): New function.
5628 (Target_arm::first_plt_entry_offset): New function.
5629 (Target_arm::plt_entry_size): New function.
5630 (Output_data_plt_arm::entry_count): New function.
5631 (Output_data_plt_arm::first_plt_entry_offset): New function.
5632 (Output_data_plt_arm::get_plt_entry_size): New function.
5633 * i386.cc (Target_i386::got_size): Add const.
5634 (Target_i386::got_entry_count): New function.
5635 (Target_i386::plt_entry_count): New function.
5636 (Target_i386::first_plt_entry_offset): New function.
5637 (Target_i386::plt_entry_size): New function.
5638 (Output_data_plt_i386::entry_count): New function.
5639 (Output_data_plt_i386::first_plt_entry_offset): New function.
5640 (Output_data_plt_i386::get_plt_entry_size): New function.
5641 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5642 find_incremental_inputs_sections. Dump incremental_got_plt section.
5643 * incremental.cc: Include target.h.
5644 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5645 parameter. Adjust all callers. Find incremental_got_plt section.
5646 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5647 section.
5648 (Output_section_incremental_inputs::set_final_data_size): Calculate
5649 size of incremental_got_plt section.
5650 (Output_section_incremental_inputs::do_write): Write the
5651 incremental_got_plt section.
5652 (Got_plt_view_info): New struct.
5653 (Local_got_offset_visitor): New class.
5654 (Global_got_offset_visitor): New class.
5655 (Global_symbol_visitor_got_plt): New class.
5656 (Output_section_incremental_inputs::write_got_plt): New function.
5657 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5658 Add parameter. Adjust all callers.
5659 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5660 (Incremental_inputs::got_plt_section): New function.
5661 (Incremental_inputs::got_plt_section_): New data member.
5662 (Incremental_got_plt_reader): New class.
5663 * layout.cc (Layout::create_incremental_info_sections): Add the
5664 incremental_got_plt section.
5665 * object.h (Got_offset_list::get_list): New function.
5666 (Got offset_list::for_all_got_offsets): New function.
5667 (Sized_relobj::local_got_offset_list): New function.
5668 * powerpc.cc (Target_powerpc::got_size): Add const.
5669 (Target_powerpc::got_entry_count): New function.
5670 (Target_powerpc::plt_entry_count): New function.
5671 (Target_powerpc::first_plt_entry_offset): New function.
5672 (Target_powerpc::plt_entry_size): New function.
5673 (Output_data_plt_powerpc::entry_count): New function.
5674 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5675 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5676 * sparc.cc (Target_sparc::got_size): Add const.
5677 (Target_sparc::got_entry_count): New function.
5678 (Target_sparc::plt_entry_count): New function.
5679 (Target_sparc::first_plt_entry_offset): New function.
5680 (Target_sparc::plt_entry_size): New function.
5681 (Output_data_plt_sparc::entry_count): New function.
5682 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5683 (Output_data_plt_sparc::get_plt_entry_size): New function.
5684 * symtab.h (Symbol::got_offset_list): New function.
5685 (Symbol_table::for_all_symbols): New function.
5686 * target.h (Sized_target::got_entry_count): New function.
5687 (Sized_target::plt_entry_count): New function.
5688 (Sized_target::plt_entry_size): New function.
5689 * x86_64.cc (Target_x86_64::got_size): Add const.
5690 (Target_x86_64::got_entry_count): New function.
5691 (Target_x86_64::plt_entry_count): New function.
5692 (Target_x86_64::first_plt_entry_offset): New function.
5693 (Target_x86_64::plt_entry_size): New function.
5694 (Output_data_plt_x86_64::entry_count): New function.
5695 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5696 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5697
5698 2010-08-12 Cary Coutant <ccoutant@google.com>
5699
5700 * archive.cc: Include incremental.h.
5701 (Archive::Archive): Initialize incremental_info_.
5702 (Archive::include_member): Record archive members in incremental info.
5703 (Add_archive_symbols::run): Record begin and end of an archive in
5704 incremental info.
5705 (Lib_group::include_member): Record objects in incremental info.
5706 * archive.h (Incremental_archive_entry): Forward declaration.
5707 (Archive::set_incremental_info): New member function.
5708 (Archive::incremental_info): New member function.
5709 (Archive::Unused_symbol_iterator): New class.
5710 (Archive::unused_symbols_begin): New member function.
5711 (Archive::unused_symbols_end): New member function.
5712 (Archive::incremental_info_): New data member.
5713 * incremental-dump.cc (find_input_containing_global): New function.
5714 (dump_incremental_inputs): Dump new incremental info sections.
5715 * incremental.cc: Include symtab.h.
5716 (Output_section_incremental_inputs): New class.
5717 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5718 new incremental info sections.
5719 (Sized_incremental_binary::do_check_inputs): Likewise.
5720 (Incremental_inputs::report_archive): Remove.
5721 (Incremental_inputs::report_archive_begin): New function.
5722 (Incremental_inputs::report_archive_end): New function.
5723 (Incremental_inputs::report_object): New function.
5724 (Incremental_inputs::finalize_inputs): Remove.
5725 (Incremental_inputs::report_input_section): New function.
5726 (Incremental_inputs::report_script): Rewrite.
5727 (Incremental_inputs::finalize): Do nothing but finalize string table.
5728 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5729 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5730 (Incremental_inputs::create_data_sections): New function.
5731 (Incremental_inputs::relocs_entsize): New function.
5732 (Output_section_incremental_inputs::set_final_data_size): New function.
5733 (Output_section_incremental_inputs::do_write): New function.
5734 (Output_section_incremental_inputs::write_header): New function.
5735 (Output_section_incremental_inputs::write_input_files): New function.
5736 (Output_section_incremental_inputs::write_info_blocks): New function.
5737 (Output_section_incremental_inputs::write_symtab): New function.
5738 * incremental.h (Incremental_script_entry): Forward declaration.
5739 (Incremental_object_entry): Forward declaration.
5740 (Incremental_archive_entry): Forward declaration.
5741 (Incremental_inputs): Forward declaration.
5742 (Incremental_inputs_header_data): Remove.
5743 (Incremental_inputs_header): Remove.
5744 (Incremental_inputs_header_write): Remove.
5745 (Incremental_inputs_entry_data): Remove.
5746 (Incremental_inputs_entry): Remove.
5747 (Incremental_inputs_entry_write): Remove.
5748 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5749 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5750 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5751 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5752 Likewise.
5753 (Incremental_input_entry): New class.
5754 (Incremental_script_entry): New class.
5755 (Incremental_object_entry): New class.
5756 (Incremental_archive_entry): New class.
5757 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5758 (Incremental_inputs::report_inputs): Remove.
5759 (Incremental_inputs::report_archive): Remove.
5760 (Incremental_inputs::report_archive_begin): New function.
5761 (Incremental_inputs::report_archive_end): New function.
5762 (Incremental_inputs::report_object): Change prototype.
5763 (Incremental_inputs::report_input_section): New function.
5764 (Incremental_inputs::report_script): Change prototype.
5765 (Incremental_inputs::get_reloc_count): New function.
5766 (Incremental_inputs::set_reloc_count): New function.
5767 (Incremental_inputs::create_data_sections): New function.
5768 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5769 (Incremental_inputs::inputs_section): New function.
5770 (Incremental_inputs::symtab_section): New function.
5771 (Incremental_inputs::relocs_section): New function.
5772 (Incremental_inputs::get_stringpool): Add const.
5773 (Incremental_inputs::command_line): Add const.
5774 (Incremental_inputs::inputs): Remove.
5775 (Incremental_inputs::command_line_key): New function.
5776 (Incremental_inputs::input_file_count): New function.
5777 (Incremental_inputs::input_files): New function.
5778 (Incremental_inputs::relocs_entsize): New function.
5779 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5780 (Incremental_inputs::finalize_inputs): Remove.
5781 (Incremental_inputs::Input_info): Remove.
5782 (Incremental_inputs::lock_): Remove.
5783 (Incremental_inputs::inputs_): Change type.
5784 (Incremental_inputs::inputs_map_): Remove.
5785 (Incremental_inputs::current_object_entry_): New data member.
5786 (Incremental_inputs::inputs_section_): New data member.
5787 (Incremental_inputs::symtab_section_): New data member.
5788 (Incremental_inputs::relocs_section_): New data member.
5789 (Incremental_inputs::reloc_count_): New data member.
5790 (Incremental_inputs_reader): New class.
5791 (Incremental_symtab_reader): New class.
5792 (Incremental_relocs_reader): New class.
5793 * layout.cc (Layout::finalize): Move finalization of incremental info
5794 and creation of incremental info sections to follow finalization of
5795 symbol table. Set offsets for postprocessing sections.
5796 (Layout::create_incremental_info_sections): Call
5797 Incremental_inputs::create_data_sections. Add incremental symtab
5798 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5799 sections to layout after input sections.
5800 * layout.h (struct Timespec): Forward declaration.
5801 (Layout::incremental_inputs): Add const.
5802 (Layout::create_incremental_info_sections): Add parameter.
5803 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5804 * object.cc: Include incremental.h.
5805 (Relobj::finalize_incremental_relocs): New function.
5806 (Sized_relobj::do_layout): Record input sections in incremental info.
5807 * object.h (Object::output_section): New function.
5808 (Object::output_section_offset): Moved from Relobj.
5809 (Object::get_incremental_reloc_base): New function.
5810 (Object::get_incremental_reloc_count): New function.
5811 (Object::do_output_section): New function.
5812 (Object::do_output_section_offset): Moved from Relobj.
5813 (Object::do_get_incremental_reloc_base): New function.
5814 (Object::do_get_incremental_reloc_count): New function.
5815 (Object::Object): Initialize new data members.
5816 (Relobj::output_section): Renamed do_output_section and moved to
5817 protected.
5818 (Relobj::output_section_offset): Moved to Object.
5819 (Relobj::do_get_incremental_reloc_base): New function.
5820 (Relobj::do_get_incremental_reloc_count): New function.
5821 (Relobj::allocate_incremental_reloc_counts): New function.
5822 (Relobj::count_incremental_reloc): New function.
5823 (Relobj::finalize_incremental_relocs): New function.
5824 (Relobj::next_incremental_reloc_index): New function.
5825 (Relobj::reloc_counts_): New data member.
5826 (Relobj::reloc_bases_): New data member.
5827 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5828 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5829 (Sized_relobj::incremental_relocs_scan): New function.
5830 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5831 (Sized_relobj::incremental_relocs_write): New function.
5832 (Sized_relobj::incremental_relocs_write_reltype): New function.
5833 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5834 incremental link.
5835 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5836 archives and object files elsewhere.
5837 (Add_symbols::run): Report object files here.
5838 (Finish_group::run): Report end of archive at end of group.
5839 * reloc.cc: Include layout.h, incremental.h.
5840 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5841 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5842 (Sized_relobj::incremental_relocs_scan): New function.
5843 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5844 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5845 (Sized_relobj::incremental_relocs_write): New function.
5846 (Sized_relobj::incremental_relocs_write_reltype): New function.
5847 * script.cc (read_input_script): Rewrite test for incremental link.
5848 Change call to Incremental_inputs::report_script.
5849 * symtab.h (Symbol_table::first_global_index): New function.
5850 (Symbol_table::output_count): New function.
5851
5852 2010-08-12 Doug Kwan <dougkwan@google.com>
5853
5854 * arm.cc (Target_arm::merge_object_attributes): Check command line
5855 options --no-wchar-size-warning and --no-enum-size-warning.
5856 * options.h (General_options): Add ld-compatible options
5857 --no-enum-size-warning and --no-wchar-size-warning.
5858
5859 2010-08-04 Ian Lance Taylor <iant@google.com>
5860
5861 * x86_64.cc (Target_x86_64::Scan::local): Use
5862 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5863 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5864 (Target_x86_64::Scan::global): Likewise.
5865 (Target_x86_64::Relocate::relocate): Likewise.
5866 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5867 Likewise.
5868
5869 2010-08-03 Cary Coutant <ccoutant@google.com>
5870
5871 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5872 to reserve space in merged_strings vector. Keep total input size
5873 for stats.
5874 (Output_merge_string::do_print_merge_stats): Print total input size.
5875 * merge.h (Output_merge_string): Add input_size_ field.
5876 * stringpool.cc (Stringpool_template::string_length): Move
5877 implementations out of Stringpool_template class and place in
5878 stringpool.h.
5879 * stringpool.h (string_length): Move out of Stringpool_template.
5880
5881 2010-08-03 Ian Lance Taylor <iant@google.com>
5882
5883 PR 11712
5884 * layout.cc (relaxation_loop_body): If address of load segment is
5885 set, adjust address to include headers if possible.
5886
5887 2010-08-03 Ian Lance Taylor <iant@google.com>
5888
5889 * version.cc (version_string): Bump to 1.10.
5890
5891 2010-08-03 Ian Lance Taylor <iant@google.com>
5892
5893 PR 11805
5894 * layout.h (enum Output_section_order): Define.
5895 (class Layout): Update declarations.
5896 * layout.cc (Layout::get_output_section): Add order parameter.
5897 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5898 is_first_non_relro parameters. Change all callers.
5899 (Layout::choose_output_section): Likewise.
5900 (Layout::add_output_section_data): Likewise.
5901 (Layout::make_output_section): Likewise. Set order.
5902 (Layout::default_section_order): New function.
5903 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5904 * output.cc (Output_section::Output_section): Initialize order_.
5905 Don't initialize deleted fields.
5906 (Output_segment::Output_segment): Don't initialize deleted
5907 fields.
5908 (Output_segment::add_output_section_to_load): New function
5909 replacing add_output_section. Change all callers to call this or
5910 add_output_section_to_nonload.
5911 (Output_segment::add_output_section_to_nonload): New function.
5912 (Output_segment::remove_output_section): Rewrite.
5913 (Output_segment::add_initial_output_data): Likewise.
5914 (Output_segment::has_any_data_sections): Likewise.
5915 (Output_segment::is_first_section_relro): Likewise.
5916 (Output_segment::maximum_alignment): Likewise.
5917 (Output_segment::has_dynamic_reloc): New function replacing
5918 dynamic_reloc_count. Change all callers.
5919 (Output_segment::has_dynamic_reloc_list): New function replacing
5920 dynamic_reloc_count_list. Change all callers.
5921 (Output_segment::set_section_addresses): Rewrite.
5922 (Output_segment::set_offset): Rewrite.
5923 (Output_segment::find_first_and_last_list): Remove.
5924 (Output_segment::set_tls_offsets): Rewrite.
5925 (Output_segment::first_section_load_address): Likewise.
5926 (Output_segment::output_section_count): Likewise.
5927 (Output_segment::section_with_lowest_load_address): Likewise.
5928 (Output_segment::write_section_headers): Likewise.
5929 (Output_segment::print_sections_to_map): Likewise.
5930 * output.h (class Output_data): Remove dynamic_reloc_count_
5931 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5932 (Output_data::add_dynamic_reloc): Rewrite.
5933 (Output_data::has_dynamic_reloc): New function.
5934 (Output_data::dynamic_reloc_count): Remove.
5935 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5936 is_last_relro_, is_first_non_relro_, is_interp_,
5937 is_dynamic_linker_section_ fields. Add order and set_order
5938 functions. Remove is_relro_local, set_is_relro_local,
5939 is_last_relro, set_is_last_relro, is_first_non_relro,
5940 set_is_first_non_relro functions, is_interp, set_is_interp,
5941 is_dynamic_linker_section, and set_is_dynamic_linker_section
5942 functions.
5943 (class Output_segment): Change Output_data_list from std::list to
5944 std:;vector. Add output_lists_ field. Remove output_data_ and
5945 output_bss_ fields. Update declarations.
5946
5947 2010-08-02 Ian Lance Taylor <iant@google.com>
5948
5949 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5950 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5951 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5952
5953 2010-08-02 Ian Lance Taylor <iant@google.com>
5954
5955 PR 11855
5956 * script.cc (Script_options::Script_options): Initialize
5957 symbol_definitions_ and symbol_references_.
5958 (Script_options::add_symbol_assignment): Update
5959 symbol_definitions_ and symbol_references_.
5960 (Script_options::add_symbol_reference): New function.
5961 (script_symbol): New function.
5962 * script.h (class Script_options): Add symbol_definitions_ and
5963 symbol_references_ fields.
5964 (Script_options::referenced_const_iterator): New type.
5965 (Script_options::referenced_begin): New function.
5966 (Script_options::referenced_end): New function.
5967 (Script_options::is_referenced): New function.
5968 (Script_options::any_unreferenced): New function.
5969 * script-c.h (script_symbol): Declare.
5970 * yyscript.y (exp): Call script_symbol.
5971 * symtab.cc: Include "script.h".
5972 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5973 Change all callers. Check symbols referenced by scripts.
5974 (Symbol_table::add_undefined_symbols_from_command_line): Add
5975 layout parameter. Change all callers.
5976 (Symbol_table::do_add_undefined_symbols_from_command_line):
5977 Likewise. Break out loop body. Check symbols referenced by
5978 scripts.
5979 (Symbol_table::add_undefined_symbol_from_command_line): New
5980 function broken out of
5981 do_add_undefined_symbols_from_command_line.
5982 * symtab.h (class Symbol_table): Update declarations.
5983 * archive.cc: Include "layout.h".
5984 (Archive::should_include_member): Add layout parameter. Change
5985 all callers. Check for symbol mentioned in expression.
5986 * archive.h (class Archive): Update declaration.
5987 * object.cc (Sized_relobj::do_should_include_member): Add layout
5988 parameter.
5989 * object.h (Object::should_include_member): Add layout parameter.
5990 Change all callers.
5991 (Object::do_should_include_member): Add layout parameter.
5992 (class Sized_relobj): Update declaration.
5993 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5994 parameter.
5995 * dynobj.h (class Sized_dynobj): Update declaration.
5996 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5997 layout parameter.
5998 * plugin.h (class Sized_pluginobj): Update declaration.
5999
6000 2010-08-02 Ian Lance Taylor <iant@google.com>
6001
6002 PR 11866
6003 * output.cc (Output_segment::set_offset): Search for the first and
6004 last sections rather than assuming that the list is in order.
6005 (Output_segment::find_first_and_last_list): New function.
6006 * output.h (class Output_segment): Update declarations.
6007 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6008 (relro_strip_test_SOURCES): New variable.
6009 (relro_strip_test_DEPENDENCIES): New variable.
6010 (relro_strip_test_LDFLAGS): New variable.
6011 (relro_strip_test_LDADD): New variable.
6012 (relro_strip_test.so): New target.
6013
6014 2010-08-02 Ian Lance Taylor <iant@google.com>
6015
6016 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6017 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6018 (Target_i386::got_tlsdesc_section): New function.
6019 (Target_i386::got_section): Create space for GOT entries for
6020 TLSDESC relocations.
6021 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6022 R_386_TLS_GOTDESC.
6023 (Target_i386::Scan::global): Likewise.
6024 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6025 using TLSDESC GOT.
6026 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6027 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6028 (Target_x86_64::got_tlsdesc_section): New function.
6029 (Target_x86_64::got_section): Create space for GOT entries for
6030 TLSDESC relocations.
6031 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6032 R_386_TLS_GOTDESC.
6033 (Target_x86_64::Scan::global): Likewise.
6034 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6035 using TLSDESC GOT.
6036
6037 2010-08-02 Ian Lance Taylor <iant@google.com>
6038
6039 * testsuite/final_layout.sh: Use dc to convert from hex to
6040 decimal.
6041
6042 2010-07-29 Sriraman Tallam <tmsriram@google.com>
6043
6044 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6045 paramter to the call to gold::gc_process_relocs.
6046 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6047 paramter to the call to gold::gc_process_relocs.
6048 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6049 parameter to the call to gold::gc_process_relocs.
6050 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6051 template parameter to the call to gold::gc_process_relocs.
6052 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6053 paramter to the call to gold::gc_process_relocs.
6054 * gc.h (get_embedded_addend_size): New function.
6055 (gc_process_relocs): Save the size of the reloc for use by ICF.
6056 * icf.cc (get_section_contents): Get the addend from the text section
6057 for SHT_REL relocation sections.
6058 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6059 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6060 * int_encoding.h (read_from_pointer): New overloaded function.
6061 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6062 * testsuite/icf_sht_rel_addend_test.sh: New file.
6063 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6064 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6065
6066 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6067
6068 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6069 * Makefile.in: Regenerate.
6070 * testsuite/Makefile.in: Regenerate.
6071
6072 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6073
6074 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6075 * gold/testsuite/debug_msg.cc: Likewise.
6076 * gold/testsuite/odr_violation1.cc
6077 * gold/testsuite/odr_violation2.cc
6078
6079 2010-07-21 Cary Coutant <ccoutant@google.com>
6080
6081 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6082 string, and length fields.
6083 (Output_merge_string::Merged_strings_list): New type.
6084 (Output_merge_string::Merged_strings_lists): New typedef.
6085 (Output_merge_string): Replace merged_strings_ with
6086 merged_strings_lists_.
6087 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6088 Merged_strings_list per input object and section. Don't store pointer
6089 to the string. Don't store length with each merged string entry.
6090 (Output_merge_string::finalize_merged_data): Loop over list of merged
6091 strings lists. Recompute length of each merged string.
6092
6093 2010-07-15 Cary Coutant <ccoutant@google.com>
6094
6095 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6096 here.
6097
6098 2010-07-14 Ian Lance Taylor <iant@google.com>
6099
6100 * descriptors.cc (Descriptors::open): Report correct name in error
6101 message.
6102
6103 2010-07-13 Doug Kwan <dougkwan@google.com>
6104
6105 * arm.cc (Arm_input_section::Arm_input_section): For a
6106 SHT_ARM_EXIDX section, always keeps the input sections.
6107 (Arm_input_section::set_exidx_section_link): New method.
6108 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6109 has_errors_ to false.
6110 (Arm_exidx_input_section::has_errors,
6111 Arm_exidx_input_section::set_has_errors): New methods.
6112 (Arm_exidx_input_section::has_errors_): New data member.
6113 (Arm_relobj::get_exidx_shndx_list): New method.
6114 (Arm_output_section::append_text_sections_to_list): Do not skip
6115 section without SHF_EXECINSTR.
6116 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6117 errors.
6118 (Arm_relobj::make_exidx_input_section): Add new parameter for text
6119 section header. Make error messages more verbose. Check for
6120 a non-executable section linked to an EXIDX section.
6121 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6122 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6123 check that there is no deferred EXIDX section if we exit early.
6124 Instead of not making an EXIDX section in case of an error, make one
6125 and set the has_errors flag of it.
6126 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6127 in a relocatable link.
6128 (Target_arm::do_relax): Look for the EXIDX output section instead of
6129 assuming that it is called .ARM.exidx.
6130 (Target_arm::fix_exidx_coverage): Add a new parameter for input
6131 section list. Do not check for SHF_EXECINSTR section flags but
6132 skip any input section with errors.
6133 * output.cc (Output_section::Output_section): Initialize
6134 always_keeps_input_sections_ to false.
6135 (Output_section::add_input_section): Check for
6136 always_keeps_input_sections_.
6137 * output.h (Output_section::always_keeps_input_sections,
6138 Output_section::set_always_keeps_input_sections): New methods.
6139 (Output_section::always_keeps_input_sections): New data member.
6140
6141 2010-07-13 Rafael Espindola <espindola@google.com>
6142
6143 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6144 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6145
6146 2010-07-13 Philip Herron <herron.philip@googlemail.com>
6147 Ian Lance Taylor <iant@google.com>
6148
6149 * output.h (Output_section_lookup_maps::add_merge_section):
6150 Correct check of whether value was inserted.
6151 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6152 (Output_section_lookup_maps::add_relaxed_input_section):
6153 Likewise.
6154 * arm.cc (Target_arm::got_section): Remove used local os.
6155 * i386.cc (Target_i386::got_section): Likewise.
6156 * x86_64.cc (Target_x86_64::got_section): Likewise.
6157 * sparc.cc (Target_sparc::got_section): Likewise.
6158 (Target_sparc::relocate): Remove unused local have_got_offset.
6159 * powerpc.cc (Target_powerpc::relocate): Likewise.
6160
6161 2010-07-13 Ian Lance Taylor <iant@google.com>
6162
6163 * compressed_output.cc (zlib_decompress): Fix signature in
6164 !HAVE_ZLIB_H case.
6165
6166 * archive.cc (Archive::include_member): Unlock an external member
6167 of a thin archive. Don't bother to delete an object we know is
6168 NULL.
6169
6170 2010-07-12 Cary Coutant <ccoutant@google.com>
6171
6172 * compressed_output.cc (zlib_decompress): New function.
6173 (get_uncompressed_size): New function.
6174 (decompress_input_section): New function.
6175 * compressed_output.h (get_uncompressed_size): New function.
6176 (decompress_input_section): New function.
6177 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6178 Handle compressed debug sections.
6179 * layout.cc (is_compressed_debug_section): New function.
6180 (Layout::output_section_name): Map compressed section names to
6181 canonical names.
6182 * layout.h (is_compressed_debug_section): New function.
6183 (is_debug_info_section): Recognize compressed debug sections.
6184 * merge.cc: Include compressed_output.h.
6185 (Output_merge_data::do_add_input_section): Handle compressed
6186 debug sections.
6187 (Output_merge_string::do_add_input_section): Handle compressed
6188 debug sections.
6189 * object.cc: Include compressed_output.h.
6190 (Sized_relobj::Sized_relobj): Initialize new data members.
6191 (build_compressed_section_map): New function.
6192 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6193 * object.h (Object::section_is_compressed): New method.
6194 (Object::do_section_is_compressed): New method.
6195 (Sized_relobj::Compressed_section_map): New type.
6196 (Sized_relobj::do_section_is_compressed): New method.
6197 (Sized_relobj::compressed_sections_): New data member.
6198 * output.cc (Output_section::add_input_section): Handle compressed
6199 debug sections.
6200 * reloc.cc: Include compressed_output.h.
6201 (Sized_relobj::write_sections): Handle compressed debug sections.
6202
6203 2010-07-08 Cary Coutant <ccoutant@google.com>
6204
6205 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6206 weak when resolving to a dynamic def.
6207 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6208 for weak undef/dynamic def cases. Adjust callers.
6209 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6210 undef_binding_weak_.
6211 (Symbol_table::sized_write_globals): Adjust symbol binding.
6212 (Symbol_table::sized_write_symbol): Add binding parameter.
6213 * symtab.h (Symbol::set_undef_binding): New method.
6214 (Symbol::is_undef_binding_weak): New method.
6215 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6216 (Symbol_table::should_override): Add new parameter.
6217 (Symbol_table::sized_write_symbol): Add new parameter.
6218
6219 * testsuite/weak_undef_file1.cc: Add new test case.
6220 * testsuite/weak_undef_file2.cc: Fix header comment.
6221 * testsuite/weak_undef_test.cc: Add new test case.
6222
6223 2010-06-29 Doug Kwan <dougkwan@google.com>
6224
6225 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6226 Initialize USE_SYMBOL_.
6227 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6228 definition.
6229 (Arm_reloc_property::uses_symbol_): New data member declaration.
6230 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6231 uses symbol value and symbol is undefined but not weakly undefined.
6232
6233 2010-06-28 Rafael Espindola <espindola@google.com>
6234
6235 * plugin.cc (Plugin::load): Use dlerror.
6236
6237 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6238
6239 * symtab.cc (detect_odr_violations): When reporting an ODR
6240 violation, report an object where the symbol is defined.
6241
6242 2010-06-25 Doug Kwan <dougkwan@google.com>
6243
6244 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6245 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6246 definition.
6247 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6248 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6249 target hook to detect function points.
6250 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6251 * icf.h (Icf::check_section_for_function_pointers): Change type of
6252 parameter SECTION_NAME to const reference to std::string. Use
6253 target hook to determine if section may have unsafe pointers.
6254 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6255 method definition.
6256
6257 2010-06-21 Rafael Espindola <espindola@google.com>
6258
6259 * fileread.cc (Input_file::find_fie): New
6260 (Input_file::open): Use Input_file::find_fie.
6261 * fileread.h (Input_file::find_fie): New
6262 * plugin.cc (set_extra_library_path): New.
6263 (Plugin::load): Add set_extra_library_path to the transfer vector.
6264 (Plugin_manager::set_extra_library_path): New.
6265 (Plugin_manager::add_input_file): Use the extra search path if set.
6266 (set_extra_library_path(): New.
6267 * plugin.h (Plugin_manager): Add set_extra_library_path and
6268 extra_search_path_.
6269
6270 2010-06-19 Cary Coutant <ccoutant@google.com>
6271
6272 * layout.cc (gdb_sections): Add .debug_types.
6273 (lines_only_debug_sections): Likewise.
6274
6275 2010-06-18 Rafael Espindola <espindola@google.com>
6276
6277 * plugin.cc (add_input_file,add_input_library)
6278 (Plugin_manager::add_input_file): Make filename arguments const.
6279 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6280 const.
6281
6282 2010-06-16 Doug Kwan <dougkwan@google.com>
6283
6284 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6285 .ARM.attributes section if we have not merged any input
6286 attributes sections.
6287
6288 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6289
6290 * arm.cc: Allow combining objects with no EABI version
6291 information.
6292
6293 2010-06-15 Rafael Espindola <espindola@google.com>
6294
6295 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6296
6297 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6298
6299 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6300 (struct iovec): Correct !HAVE_READV definition.
6301
6302 2010-06-10 Cary Coutant <ccoutant@google.com>
6303
6304 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6305 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6306 reloc sections.
6307 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6308
6309 PR 11683
6310 * symtab.h (Symbol::is_placeholder): New member function.
6311 * target-reloc.h (relocate_section): Check for placeholder symbols.
6312
6313 * testsuite/Makefile.am (plugin_test_8): New test.
6314 (plugin_test_9): New test.
6315 * testsuite/Makefile.in: Regenerate.
6316
6317 2010-06-09 Nick Clifton <nickc@redhat.com>
6318
6319 * yyscript.y (input_list_element): Allow strings prefixed with
6320 the '-' character. Treat these as libraries.
6321 * script.cc (script_add_library): New function. Adds a library
6322 specified by "-l<name>" found in an input script.
6323 * script-c.h: Add prototype for script_add_library.
6324
6325 2010-06-07 Doug Kwan <dougkwan@google.com>
6326
6327 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6328 Restrict stub-group size to be within long conditional branch
6329 range when working around cortex-A8 erratum.
6330
6331 2010-06-07 Damien Diederen <dd@crosstwine.com>
6332
6333 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6334 #ifdef typo.
6335
6336 2010-06-03 Sriraman Tallam <tmsriram@google.com>
6337
6338 PR gold/11658
6339 * output.cc
6340 (Output_section::Input_section_sort_entry::compare_section_ordering):
6341 Change to return non-zero correctly.
6342 (Output_section::Input_section_sort_section_order_index_compare
6343 ::operator()): Change to fix ambiguity in comparisons.
6344
6345 2010-06-01 Sriraman Tallam <tmsriram@google.com>
6346
6347 * gold.h (is_wildcard_string): New function.
6348 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6349 (Layout::layout_eh_frame): Ditto.
6350 (Layout::find_section_order_index): New method.
6351 (Layout::read_layout_from_file): New method.
6352 * layout.h (Layout::find_section_order_index): New method.
6353 (Layout::read_layout_from_file): New method.
6354 (Layout::input_section_position_): New private member.
6355 (Layout::input_section_glob_): New private member.
6356 * main.cc (main): Call read_layout_from_file here.
6357 * options.h (--section-ordering-file): New option.
6358 * output.cc (Output_section::input_section_order_specified_): New
6359 member.
6360 (Output_section::Output_section): Initialize new member.
6361 (Output_section::add_input_section): Add new parameter.
6362 Keep input sections when --section-ordering-file is used.
6363 (Output_section::set_final_data_size): Sort input sections when
6364 section ordering file is specified.
6365 (Output_section::Input_section_sort_entry): Add new parameter.
6366 Check sorting type.
6367 (Output_section::Input_section_sort_entry::compare_section_ordering):
6368 New method.
6369 (Output_section::Input_section_sort_compare::operator()): Change to
6370 consider section_order_index.
6371 (Output_section::Input_section_sort_init_fini_compare::operator()):
6372 Change to consider section_order_index.
6373 (Output_section::Input_section_sort_section_order_index_compare
6374 ::operator()): New method.
6375 (Output_section::sort_attached_input_sections): Change to sort
6376 according to section order when specified.
6377 (Output_section::add_input_section<32, true>): Add new parameter.
6378 (Output_section::add_input_section<64, true>): Add new parameter.
6379 (Output_section::add_input_section<32, false>): Add new parameter.
6380 (Output_section::add_input_section<64, false>): Add new parameter.
6381 * output.h (Output_section::add_input_section): Add new parameter.
6382 (Output_section::input_section_order_specified): New
6383 method.
6384 (Output_section::set_input_section_order_specified): New method.
6385 (Input_section::Input_section): Initialize section_order_index_.
6386 (Input_section::section_order_index): New method.
6387 (Input_section::set_section_order_index): New method.
6388 (Input_section::section_order_index_): New member.
6389 (Input_section::Input_section_sort_section_order_index_compare): New
6390 struct.
6391 (Output_section::input_section_order_specified_): New member.
6392 * script-sections.cc (is_wildcard_string): Delete and move modified
6393 method to gold.h.
6394 (Output_section_element_input::Output_section_element_input): Modify
6395 call to is_wildcard_string.
6396 (Output_section_element_input::Input_section_pattern
6397 ::Input_section_pattern): Ditto.
6398 (Output_section_element_input::Output_section_element_input): Ditto.
6399 * testsuite/Makefile.am (final_layout): New test case.
6400 * testsuite/Makefile.in: Regenerate.
6401 * testsuite/final_layout.cc: New file.
6402 * testsuite/final_layout.sh: New file.
6403
6404 2010-06-01 Rafael Espindola <espindola@google.com>
6405
6406 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6407
6408 2010-06-01 Rafael Espindola <espindola@google.com>
6409
6410 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6411 visibility of symbols.
6412
6413 2010-05-27 Doug Kwan <dougkwan@google.com>
6414
6415 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6416 from start of output section instead of address for a local symbol
6417 in a merged or relaxed section when doing a relocatable link.
6418
6419 2010-05-26 Rafael Espindola <espindola@google.com>
6420
6421 PR 11604
6422 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6423 adding sections the garbage collector removed.
6424 * gold/testsuite/Makefile.am: Add test.
6425 * gold/testsuite/Makefile.in: Regenerate.
6426 * gold/testsuite/plugin_test_7.sh: New.
6427 * gold/testsuite/plugin_test_7_1.c: New.
6428 * gold/testsuite/plugin_test_7_2.c: New.
6429
6430 2010-05-26 Rafael Espindola <espindola@google.com>
6431
6432 * script-sections.cc (Output_section_definition::set_section_addresses):
6433 Check for --section-start.
6434
6435 2010-05-26 Doug Kwan <dougkwan@google.com>
6436
6437 * arm.cc (Arm_scan_relocatable_relocs): New class.
6438 (Target_arm::relocate_special_relocatable): New method.
6439 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6440 (Arm_relocate_functions::thumb_branch_common): Same.
6441 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6442 instead of Default_scan_relocatable_relocs.
6443 * target-reloc.h (relocate_for_relocatable): Let target handle
6444 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6445 * target.h (Sized_target::relocate_special_relocatable): New method.
6446
6447 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6448
6449 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6450
6451 2010-05-23 Doug Kwan <dougkwan@google.com>
6452
6453 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6454 instead of a cast.
6455 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6456 with a direct branch, not a conditional branch, to a stub.
6457 * merge.cc (Output_merge_base::record_input_section): New method
6458 defintion.
6459 (Output_merge_data::do_add_input_section): Record input section if
6460 keeps-input-sections flag is set.
6461 (Output_merge_string::do_add_input_section): Ditto.
6462 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6463 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6464 INPUT_SECTIONS_.
6465 (Output_merge_base::keeps_input_sections,
6466 Output_merge_base::set_keeps_input_sections,
6467 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6468 method definitions.
6469 (Output_merge_base::Input_sections): New type declaration.
6470 (Output_merge_base::input_sections_begin,
6471 Output_merge_base::input_sections_end,
6472 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6473 (Output_merge_base::bool keeps_input_sections_,
6474 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6475 Output_merge_base::input_sections_): New data members.
6476 (Output_merge_data::do_set_keeps_input_sections): New method
6477 defintion.
6478 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6479 * output.cc (Output_section::Input_section::relobj): Move method
6480 defintion from class declaration to here and handle merge sections.
6481 (Output_section::Input_section::shndx): Ditto.
6482 (Output_section::Output_section): Remove initializations of removed
6483 data members and initialize new data member LOOKUP_MAPS_.
6484 (Output_section::add_input_section): Set keeps-input-sections flag
6485 for a newly created merge output section as appropriate. Adjust code
6486 to use Output_section_lookup_maps class.
6487 (Output_section::add_relaxed_input_section): Adjst code for lookup
6488 maps code refactoring.
6489 (Output_section::add_merge_input_section): Add a new parameter
6490 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6491 class. If adding input section to a newly created merge output
6492 section fails, remove the new merge section.
6493 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
6494 Adjust code for use of the Output_section_lookup_maps class.
6495 (Output_section::find_merge_section): Ditto.
6496 (Output_section::build_lookup_maps): New method defintion.
6497 (Output_section::find_relaxed_input_section): Adjust code to use
6498 Output_section_lookup_maps class.
6499 (Output_section::get_input_sections): Export merge sections. Adjust
6500 code to use Output_section_lookup_maps class.
6501 (Output_section:::add_script_input_section): Adjust code to use
6502 Output_section_lookup_maps class. Update lookup maps for merge
6503 sections also.
6504 (Output_section::discard_states): Use Output_section_lookup_maps.
6505 (Output_section::restore_states): Same.
6506 * output.h (Merge_section_properties): Move class defintion out of
6507 Output_section.
6508 (Output_section_lookup_maps): New class.
6509 (Output_section::Input_section::is_merge_section): New method
6510 defintion.
6511 (Output_section::Input_section::relobj): Move defintion out of class
6512 defintion. Declare method only.
6513 (Output_section::Input_section::shndx): Ditto.
6514 (Output_section::Input_section::output_merge_base): New method defintion.
6515 (Output_section::Input_section::u2_.pomb): New union field.
6516 (Output_section::Merge_section_by_properties_map,
6517 Output_section::Output_section_data_by_input_section_map,
6518 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6519 Remove types.
6520 (Output_section::add_merge_input_section): Add new parameter
6521 KEEPS_INPUT_SECTIONS.
6522 (Output_section::build_lookup_maps): New method declaration.
6523 (Output_section::merge_section_map_,
6524 Output_section::merge_section_by_properties_map_,
6525 Output_section::relaxed_input_section_map_,
6526 Output_section::is_relaxed_input_section_map_valid_): Remove data
6527 members.
6528 (Output_section::lookup_maps_): New data member.
6529
6530 2010-05-21 Doug Kwan <dougkwan@google.com>
6531
6532 PR gold/11619
6533 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6534 avoid a compilation error.
6535
6536 2010-05-19 Rafael Espindola <espindola@google.com>
6537
6538 * script-sections.cc (Output_section_definition::allocate_to_segment):
6539 Update the phdrs_list even when the output section is NULL.
6540 * testsuite/Makefile.am: Add test.
6541 * testsuite/Makefile.in: Regenerate.
6542 * testsuite/script_test_9.cc: New.
6543 * testsuite/script_test_9.sh: New.
6544 * testsuite/script_test_9.t: New.
6545
6546 2010-05-19 Doug Kwan <dougkwan@google.com>
6547
6548 * arm.cc (Arm_input_section::original_size): New method.
6549 (Arm_input_section::do_addralign): Add a cast.
6550 (Arm_input_section::do_output_offset): Remove static cast.
6551 (Arm_input_section::original_addralign,
6552 Arm_input_section::original_size_): Change type to uint32_t.
6553 (Arm_input_section::init): Add safe casts for section alignment
6554 and size.
6555 (Arm_input_section::set_final_data_size): Do not set address and
6556 offset of stub table.
6557 (Arm_output_section::fix_exidx_coverage): Change use of of
6558 Output_section::Simple_input_section to that of
6559 Output_section::Input_section.
6560 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6561 except for the first pass.
6562 * output.cc (Output_section::get_input_sections): Change type of
6563 input_sections to std::list<Input_section>.
6564 (Output_section::add_script_input_section): Rename from
6565 Output_section::add_simple_input_section. Change type of SIS
6566 parameter from Simple_input_section to Input_section.
6567 * output.h (Output_section::Simple_input_section): Remove class.
6568 (Output_section::Input_section): Change class visibility to public.
6569 (Output_section::Input_section::addralign): Use stored alignments
6570 for special input sections if set.
6571 (Output_section::Input_section::set_addralign): New method.
6572 (Output_section::get_input_sections): Change parameter type from
6573 list of Simple_input_section to list of Input_section.
6574 (Output_section::add_script_input_section): Rename from
6575 Output_section::add_simple_input_section. Change first parameter's
6576 type from Simple_input_section to Input_section and remove the
6577 second and third parameters.
6578 * script-sections.cc (Input_section::Input_section_list): Change
6579 type to list of Output_section::Input_section/
6580 (Input_section_info::Input_section_info): Change parameter type of
6581 INPUT_SECTION to Output_section::Input_section.
6582 (Input_section_info::input_section): Change return type.
6583 (Input_section_info::input_section_): Change type to
6584 Output_section::Input_section.
6585 (Output_section_element_input::set_section_addresses): Adjust code
6586 to use Output_section::Input_section instead of
6587 Output_section::Simple_input_section. Adjust code for renaming
6588 of Output_section::add_simple_input_section.
6589 (Orphan_output_section::set_section_addresses): Ditto.
6590
6591 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6592
6593 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6594 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6595
6596 2010-05-18 Rafael Espindola <espindola@google.com>
6597
6598 * options.cc (General_options::finalize): Handle -nostdlib.
6599 * options.h (nostdlib): New option.
6600 * script.cc (script_add_search_dir): Handle -nostdlib.
6601
6602 2010-05-12 Doug Kwan <dougkwan@google.com>
6603
6604 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6605 attributes section only if there no attributes section after merging.
6606 (Target_arm::merge_object_attributes): Move value of
6607 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
6608 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6609 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6610 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6611 and arm_attr_merge_7.stdout.
6612 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6613 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6614 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6615 arm_attr_merge_7b.o): New rules.
6616 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6617 arm_attr_merge_7
6618 * testsuite/Makefile.in: Regenerate.
6619 * testsuite/arm_attr_merge.sh: New file.
6620 * testsuite/arm_attr_merge_[67][ab].s: Same.
6621
6622 2010-05-05 Nick Clifton <nickc@redhat.com>
6623
6624 * po/es.po: Updated Spanish translation.
6625
6626 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6627
6628 * Makefile.am (install-exec-local): Properly install gold as
6629 default cross linker.
6630 * Makefile.in: Regenerated.
6631
6632 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6633 Nick Clifton <nickc@redhat.com>
6634
6635 * configure.ac (install_as_default): Define and set to false
6636 unless --enable-gold or --enable-gold=both/gold has been
6637 specified.
6638 * configure: Regenerate.
6639
6640 * Makefile.am (install-exec-local): Install the executable as
6641 'ld.gold'. If install_as_default is true then also install it as
6642 'ld'.
6643 * Makefile.in: Regenerated.
6644
6645 2010-04-24 Ian Lance Taylor <iant@google.com>
6646
6647 * layout.cc (Layout::layout_reloc): In relocatable link don't
6648 combine reloc sections for grouped sections.
6649
6650 2010-04-23 Sriraman Tallam <tmsriram@google.com>
6651
6652 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6653 sections that are not ordinary to icf.
6654 * icf.cc (get_section_contents): Handle relocation pointing to section
6655 with no object or shndx information.
6656 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6657 * testsuite/Makefile.in: Regenerate.
6658 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6659 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6660
6661 2010-04-22 Ian Lance Taylor <iant@google.com>
6662
6663 * expression.cc (Expression::Expression_eval_info): Add
6664 result_alignment_pointer field.
6665 (Expression::eval_with_dot): Add result_alignment_pointer
6666 parameter. Change all callers.
6667 (Expression::eval_maybe_dot): Likewise.
6668 (class Binary_expression): Add alignment_pointer parameter to
6669 left_value and right_value. Change all callers.
6670 (BINARY_EXPRESSION): Set result alignment.
6671 (class Trinary_expression): Add alignment_pointer parameter to
6672 arg2_value and arg3_value. Change all callers.
6673 (Trinary_cond::value): Set result alignment.
6674 (Max_expression::value, Min_expression::value): Likewise.
6675 (Align_expression::value): Likewise.
6676 * script-sections.cc (class Sections_element): Add dot_alignment
6677 parameter to set_section_addresses virtual function. Update
6678 instantiations.
6679 (class Output_section_element): Likewise.
6680 (Script_sections::create_segments): Add dot_alignment parameter.
6681 Change all callers.
6682 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6683 (Script_sections::set_phdrs_clause_addresses): Likewise.
6684 * script-sections.h: Update declarations.
6685 * script.h: Update declarations.
6686 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6687 min_p_align.
6688 * testsuite/script_test_3.t: Set large alignment.
6689 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6690 segment has expected alignment.
6691
6692 2010-04-22 Nick Clifton <nickc@redhat.com>
6693
6694 * po/gold.pot: Updated by the Translation project.
6695 * po/vi.po: Updated Vietnamese translation.
6696
6697 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6698
6699 * testsuite/Makefile.am (check_PROGRAMS): Add
6700 icf_virtual_function_folding_test.
6701 * testsuite/Makefile.in: Regenerated.
6702
6703 2010-04-15 Andrew Haley <aph@redhat.com>
6704
6705 * options.h (merge_exidx_entries): New option.
6706 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6707 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6708 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6709 (Target_arm::merge_exidx_entries): New function.
6710 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6711 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6712 to Arm_exidx_fixup constructor.
6713 Add new arg, merge_exidx_entries.
6714 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6715 Arm_output_section::fix_exidx_coverage.
6716
6717 2010-04-18 Sriraman Tallam <tmsriram@google.com>
6718
6719 * icf.cc (get_section_contents): Check for preemptible functions.
6720 Ignore addend when appropriate.
6721 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6722 section folded.
6723 (add_from_relobj): Check for section folded.
6724 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6725 * symtab.h (should_add_dynsym_entry): Add new parameter.
6726 * target-reloc.h (scan_relocs): Check for section folded.
6727 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6728 Check reloc types for function pointers in shared objects.
6729 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6730 case.
6731 (icf_preemptible_functions_test): New test case.
6732 (icf_string_merge_test): New test case.
6733 * testsuite.Makefile.in: Regenerate.
6734 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6735 bar_glob. Refactor code.
6736 * testsuite/icf_preemptible_functions_test.cc: New file.
6737 * testsuite/icf_preemptible_functions_test.sh: New file.
6738 * testsuite/icf_string_merge_test.cc: New file.
6739 * testsuite/icf_string_merge_test.sh: New file.
6740 * testsuite/icf_virtual_function_folding_test.cc: New file.
6741 * testsuite/icf_virtual_function_folding_test.sh: New file.
6742
6743 2010-04-14 Doug Kwan <dougkwan@google.com>
6744
6745 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6746 for local symbol recounting if we remove a section due to ICF.
6747 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6748 there are no regular objects in input.
6749
6750 2010-04-13 Doug Kwan <dougkwan@google.com>
6751
6752 * arm.cc (Arm_input_section::set_final_data_size): Compute
6753 accurate final data size instead of using current data size.
6754
6755 2010-04-09 Doug Kwan <dougkwan@google.com>
6756
6757 * layout.cc (Layout::choose_output_section): Handle script section
6758 types.
6759 (Layout::make_output_section_for_script): Add section type parameter.
6760 Handle script section types.
6761 * layout.h (Layout::make_output_section_for_script): Add section
6762 type parameter.
6763 * output.cc (Output_section::Output_section): Initialize data member
6764 is_noload_.
6765 (Output_section::do_reset_address_and_file_offset): Do not set address
6766 to 0 if section is a NOLOAD section.
6767 * output.h (Output_section::is_noload): New method.
6768 (Output_section::set_is_noload): Ditto.
6769 (Output_section::is_noload_): New data member.
6770 * script-c.h (Script_section_type): New enum type.
6771 (struct Parser_output_section_header): Add new file section_type.
6772 * script-sections.cc (Sections_element::output_section_name): Add
6773 parameter for returning script section type.
6774 (Output_section_definition::output_section_name): Ditto.
6775 (Output_section_definition::section_type)P; New method.
6776 (Output_section_definiton::script_section_type_name): Ditto.
6777 (Output_section_definition::script_section_type_): New data member.
6778 (Output_section_definition::Output_section_definition): Initialize
6779 data member Output_section_definition::script_section_type_.
6780 (Output_section_definition::create_sections): Pass script section type
6781 to Layout::make_output_section_for_script.
6782 (Output_section_definition::output_section_name): Return script
6783 section type to caller.
6784 (Output_section_definition::set_section_address): Do not advance
6785 dot value and load address if section type is NOLOAD. Set address
6786 of NOLOAD sections regardless of section flags.
6787 (Output_section_definition::print): Print section type if it is
6788 not SCRIPT_SECTION_TYPE_NONE.
6789 (Output_section_definition::section_type): New method.
6790 (Output_section_definition::script_section_type_name): Ditto.
6791 (Script_sections::output_section_name): Add new parameter
6792 PSECTION_TYPE for returning script section type. Pass it to
6793 section elements. Handle discard sections.
6794 (Sort_output_sections::operator()): Handle NOLOAD sections.
6795 * script-sections.h (Script_sections::Section_type): New enum type.
6796 (Script_sections::output_section_name): Add a new parameter for
6797 returning script section type.
6798 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6799 INFO and NOLOAD.
6800 * yyscript.y (union): Add new field SECTION_TYPE.
6801 (COPY, DSECT, INFO, NOLOAD): New tokens.
6802 (opt_address_and_section_type): Change type to output_section_header.
6803 (section_type): New non-terminal
6804 (section_header): Handle section type.
6805 (opt_address_and_section_type): Return section type value.
6806
6807 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6808
6809 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6810 * testsuite/plugin_common_test_2.c (foo): Likewise.
6811
6812 2010-04-08 Doug Kwan <dougkwan@google.com>
6813
6814 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6815 Output_merge_data.
6816 * output.cc (Output_section::add_merge_input_section): Simplify
6817 code and return status of Output_merge_base::add_input_section.
6818 Update merge section map only if Output_merge_base::add_input_section
6819 returns true.
6820
6821 2010-04-07 Doug Kwan <dougkwan@google.com>
6822
6823 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6824 if section is marked as containing instructions but has no mapping
6825 symbols.
6826 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6827 correct section index.
6828 (Arm_relobj::find_linked_text_section): Ditto.
6829
6830 2010-04-07 Cary Coutant <ccoutant@google.com>
6831
6832 * archive.cc (include_member): Destroy Read_symbols_data object before
6833 releasing file.
6834 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6835 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6836 (Read_symbols_data::~Read_symbols_data) New destructor.
6837 (Section_relocs::Section_relocs) New constructor.
6838 (Section_relocs::~Section_relocs) New destructor.
6839 (Read_relocs_data::Read_relocs_data) New constructor.
6840 (Read_relocs_data::~Read_relocs_data) New destructor.
6841 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6842 pointers to NULL after deleting.
6843
6844 2010-04-07 Doug Kwan <dougkwan@google.com>
6845
6846 * arm.cc: Replace "endianity" with "endianness" in comments.
6847 (Arm_exidx_cantunwind): Ditto.
6848 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6849 (Arm_relobj::merge_flags_and_attributes): New method.
6850 (Arm_relobj::merge_flags_and_attributes_): New data member.
6851 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6852 (Arm_relobj::scan_sections_for_stubs): Ditto.
6853 (Arm_relobj::do_read_symbols): Check to see if we really want to
6854 merge processor-specific flags and attributes. Exit early if
6855 an object is empty except for section names and the undefined symbol.
6856 (Target_arm::do_finalize_sections): Move check for ELF format to
6857 Arm_relobj::do_read_symbols. Merge processor specific flags and
6858 attributes from a regular object only when we have determined that
6859 it is aapropriate. Do not create an .ARM.attributes section in
6860 output if there is no regular input object.
6861 (Target_arm::merge_processor_specific_flags): Check
6862 --warn-mismatch before printing any error.
6863 (Target_arm::merge_object_attributes): Ditto.
6864 * gold.cc (queue_middle_tasks): Handle the case in which there is
6865 no regular object in input.
6866 * options.cc (General_options::parse_EB): New method.
6867 (General_options::parse_EL): Same.
6868 (General_options::General_options): Initialize endianness_.
6869 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6870 New options.
6871 (General_options::Endianness): New enum.
6872 (General_options::endianness): New method.
6873 (General_options::endianness_): New data member.
6874 * parameters.cc (Parameters::set_options): Check target endianness.
6875 (Parameters::set_target_once): Ditto.
6876 (Parameters::check_target_endianness): New method.
6877 (parameters_force_valid_target): If either -EL or -EB is specified,
6878 use it to define endianness of default target.
6879 * parameters.h (Parameters::check_target_endianness): New method
6880 declaration.
6881 * target.h (class Target): Change "endianity" to "endianness"
6882 in comments.
6883
6884 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6885
6886 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6887 * configure: Regenerate.
6888 * Makefile.in: Regenerate.
6889 * testsuite/Makefile.in: Regenerate.
6890
6891 2010-04-06 Cary Coutant <ccoutant@google.com>
6892
6893 gcc PR lto/42757
6894 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6895 prevailing definitions of common symbols.
6896 * testsuite/plugin_test_6.sh: New test case.
6897 * testsuite/plugin_common_test_1.c: New test case.
6898 * testsuite/plugin_common_test_2.c: New test case.
6899 * testsuite/Makefile.am (plugin_test_6): New test case.
6900 * testsuite/Makefile.in: Regenerate.
6901
6902 2010-04-06 Nick Clifton <nickc@redhat.com>
6903
6904 * po/vi.po: New Vietnamese translation.
6905
6906 2010-03-30 Doug Kwan <dougkwan@google.com>
6907
6908 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6909
6910 2010-03-25 Doug Kwan <dougkwan@google.com>
6911
6912 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6913 to avoid a conversion warning on a 32-bit host.
6914
6915 2010-03-24 Ian Lance Taylor <iant@google.com>
6916
6917 * testsuite/script_test_3.t: Add a TLS segment.
6918 * testsuite/Makefile.am (check_PROGRAMS): Add
6919 tls_phdrs_script_test.
6920 (tls_phdrs_script_test_SOURCES): Define.
6921 (tls_phdrs_script_test_DEPENDENCIES): Define.
6922 (tls_phdrs_script_test_LDFLAGS): Define.
6923 (tls_phdrs_script_test_LDADD): Define.
6924 * testsuite/Makefile.in: Rebuild.
6925
6926 2010-03-23 Cary Coutant <ccoutant@google.com>
6927
6928 * fileread.cc (find_or_make_view): Fix comment.
6929
6930 2010-03-23 Ian Lance Taylor <iant@google.com>
6931
6932 * script-sections.cc (class Orphan_section_placement): Define
6933 PLACE_TLS and PLACE_TLS_BSS.
6934 (Orphan_section_placement::Orphan_section_placement): Initialize
6935 new places.
6936 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6937 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6938 (tls_script_test_SOURCES): Define.
6939 (tls_script_test_DEPENDENCIES): Define.
6940 (tls_script_test_LDFLAGS): Define.
6941 (tls_script_test_LDADD): Define.
6942 * testsuite/Makefile.in: Rebuild.
6943
6944 2010-03-22 Doug Kwan <dougkwan@google.com>
6945
6946 * arm.cc (Arm_relocate_functions::abs8,
6947 Arm_relocate_functions::abs16): Use correct check for overflow
6948 specified in the ARM ELF specs.
6949 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6950 target of a BLX instruction specially.
6951 (Reloc_stub::stub_type_for_reloc): Ditto.
6952 (Relocate::relocate): Use symbolic names instead of numeric relocation
6953 codes to report error.
6954 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6955 workaround.
6956 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6957 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6958 thumb2_blx_out_of_range.stdout
6959 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6960 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6961 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6962 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6963 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6964 thumb2_blx_in_range, thumb2_blx_in_range.o,
6965 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6966 thumb2_blx_out_of_range.o): New rules.
6967 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
6968 thumb2_blx_in_range and thumb2_blx_out_of_range.
6969 * testsuite/Makefile.in: Regenerate.
6970 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6971 * testsuite/thumb_blx_in_range.s: New file.
6972 * testsuite/thumb_blx_out_of_range.s: New file.
6973
6974 2010-03-22 Rafael Espindola <espindola@google.com>
6975
6976 * archive.cc (Should_include): Move to archive.h.
6977 (should_include_member): Make it a member of Archive.
6978 (Lib_group): New.
6979 (Add_lib_group_symbols): New.
6980 * archive.h: Include options.h.
6981 (Archive_member): Moved from Archive.
6982 (Should_include): Moved from archive.cc.
6983 (Lib_group): New.
6984 (Add_lib_group_symbols): New.
6985 * dynobj.cc (do_should_include_member): New.
6986 * dynobj.h (do_should_include_member): New.
6987 * gold.cc (queue_initial_tasks): Update call to queue.
6988 * main.cc (main): Print lib group stats.
6989 * object.cc (do_should_include_member): New.
6990 * object.h: Include archive.h.
6991 (Object::should_include_member): New.
6992 (Object::do_should_include_member): New.
6993 (Sized_relobj::do_should_include_member): New.
6994 * options.cc (General_options::parse_start_lib): New.
6995 (General_options::parse_end_lib): New.
6996 (Input_arguments::add_file): Handle lib groups.
6997 (Input_arguments::start_group): Check we are not in a lib.
6998 (Input_arguments::start_lib): New.
6999 (Input_arguments::end_lib): New.
7000 * options.h (General_options): Add start_lib and end_lib.
7001 (Input_argument::lib_): New.
7002 (Input_argument::lib): New.
7003 (Input_argument::is_lib): New.
7004 (Input_file_lib): New.
7005 (Input_arguments::in_lib_): New.
7006 (Input_arguments::in_lib): New.
7007 (Input_arguments::start_lib): New.
7008 (Input_arguments::end_lib_): New.
7009 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7010 in unused members as preempted.
7011 (Sized_pluginobj::do_should_include_member): New.
7012 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7013 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7014 return the blocker.
7015 (Read_symbols::do_whole_lib_group): New.
7016 (Read_symbols::do_lib_group): New.
7017 (Read_symbols::do_read_symbols): Handle lib groups.
7018 (Read_symbols::get_name): Handle lib groups.
7019 * readsyms.h (Read_symbols): Add an archive member pointer.
7020 (Read_symbols::do_whole_lib_group): New.
7021 (Read_symbols::do_lib_group): New.
7022 (Read_symbols::member_): New.
7023 * script.cc (read_input_script): Update call to queue_soon.
7024
7025 2010-03-19 Doug Kwan <dougkwan@google.com>
7026
7027 * arm.cc (Stub_table::Stub_table): Initialize new data members
7028 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7029 (Stub_table::add_reloc_stub): Assign stub offset and update
7030 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7031 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7032 New data members.
7033 (Stub_table::update_data_size_and_addralign): Use
7034 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7035 instead of going over all reloc stubs.
7036 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
7037 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7038 Stringpool_template::offset_ to size of Stringpool_char.
7039 (Stringpool_template::new_key_offset): Remove code to initialize
7040 Stringpool_template::offset_.
7041 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7042 Stringpool_template::offset_ to zero.
7043
7044 2010-03-15 Doug Kwan <dougkwan@google.com>
7045
7046 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7047 offset_.
7048 (Stringpool_template::new_key_offset): New method.
7049 (Stringpool_template::add_string): Assign offsets when adding new
7050 strings.
7051 (Stringpool_template::set_string_offsets): Do not set string offsets
7052 when not optimizing.
7053 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7054 member size_.
7055 (Chunked_vector::clear): Clear size_.
7056 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7057 (Chunked_vector::size): Return size_.
7058 (Chunked_vector::push_back): Use size_ to find insert position.
7059 (Chunked_vector::size_): New data member.
7060 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7061 (Stringpool_template::new_key_offset): New method declaration.
7062 (Stringpool_template::offset_): New data member.
7063
7064 2010-03-15 Rafael Espindola <espindola@google.com>
7065
7066 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7067 Add_symbols' constructor.
7068 * readsyms.h (Add_symbols): Remove the input_group member.
7069
7070 2010-03-10 Ian Lance Taylor <iant@google.com>
7071
7072 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7073 target to ask whether a reference to a symbol requires a stack
7074 split.
7075 * target.h (Target::is_call_to_non_split): New function.
7076 (Target::do_is_call_to_non_split): Declare virtual function.
7077 * target.cc: Include "symtab.h".
7078 (Target::do_is_call_to_non_split): New function.
7079 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7080
7081 2010-03-10 Cary Coutant <ccoutant@google.com>
7082
7083 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7084 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7085 (File_read::open[2]): Add whole_file_view_ to list of views.
7086 (File_read::make_view): Remove test of whole_file_view_.
7087 (File_read::find_or_make_view): Create whole_file_view_ if
7088 necessary.
7089 (File_read::clear_views): Replace bool parameter with enum;
7090 adjust all callers. Don't delete views with permanent data;
7091 do delete cached views and views from archives if
7092 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7093 if clearing the corresponding view.
7094 * fileread.h (File_read::Clear_views_mode): New enum.
7095 (File_read::View::is_permanent_view): New method.
7096 (File_read::clear_views): Replace bool parameter
7097 with enum; adjust all callers.
7098 * options.h (General_options): Change keep_files_mapped option;
7099 add map_whole_files.
7100 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7101 releasing the file.
7102 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7103 the file.
7104
7105 2010-03-10 David S. Miller <davem@davemloft.net>
7106
7107 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7108
7109 2010-03-09 Sriraman Tallam <tmsriram@google.com>
7110
7111 * icf.cc (get_section_contents): Add '@' marker after processing the
7112 merge reloc.
7113
7114 2010-03-08 Doug Kwan <dougkwan@google.com>
7115
7116 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7117 due to a conversion warning.
7118 (Arm_relobj::update_output_local_symbol_count): Check for local
7119 symbol with unset output index.
7120
7121 2010-03-05 Ian Lance Taylor <iant@google.com>
7122
7123 * options.h (class General_options): Add --spare-dynamic-tags.
7124 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7125 --spare-dynamic-tags.
7126
7127 2010-03-05 Ian Lance Taylor <iant@google.com>
7128
7129 * incremental.cc: Include "libiberty.h".
7130
7131 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7132
7133 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7134 function, is_info_ member.
7135 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7136 (Versions::Versions): Update caller.
7137 (Versions::define_base_version): Likewise.
7138 (Versions::add_def): Likewise.
7139
7140 2010-03-03 Sriraman Tallam <tmsriram@google.com>
7141
7142 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7143 (Scan::possible_function_pointer_reloc): New function.
7144 (Scan::local_reloc_may_be_function_pointer): Change to call
7145 possible_function_pointer_reloc.
7146 (Scan::global_reloc_may_be_function_pointer): Ditto.
7147 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7148 relocations in ".data.rel.ro._ZTV" section.
7149 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7150 * testsuite/icf_safe_so_test.cc: Ditto.
7151 * testsuite/icf_safe_test.cc: Ditto.
7152 * testsuite/icf_safe_test.sh: Ditto.
7153
7154 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7155 Ian Lance Taylor <iant@google.com>
7156
7157 * target-reloc.h (relocate_section): Check the symbol table index
7158 for -1U before setting the local symbol index.
7159 (scan_relocatable_relocs): If copying the relocation, record that
7160 the local symbol is required.
7161 * object.h (Symbol_value::is_output_symtab_index_set): New
7162 function.
7163 (Symbol_value::may_be_discarded_from_output_symtab): New
7164 function.
7165 (Symbol_value::has_output_symtab_entry): New function.
7166 (Symbol_value::needs_output_symtab_entry): Remove.
7167 (Symbol_value::output_symtab_index): Make sure the symbol index is
7168 set.
7169 (Symbol_value::set_output_symtab_index): Make sure the symbol
7170 index is not set. Make sure the new index is valid.
7171 (Symbol_value::set_must_have_output_symtab_entry): New function.
7172 (Symbol_value::has_output_dynsym_entry): New function.
7173 (Symbol_value::set_output_dynsym_index): Make sure the new index
7174 is valid.
7175 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7176 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7177 local symbol if permitted.
7178 (Sized_relobj::do_finalize_local_symbols): Call
7179 is_output_symtab_index_set rather than needs_output_symtab_entry.
7180 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7181 rather than needs_output_symtab_entry. Call
7182 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7183 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7184 is_output_symtab_index_set rather than needs_output_symtab_entry.
7185 * testsuite/discard_locals_relocatable_test.c: New file.
7186 * testsuite/discard_locals_test.sh: Test -r.
7187 * testsuite/Makefile.am (check_DATA): Add
7188 discard_locals_relocatable_test1.syms,
7189 discard_local_relocatable_test2.syms.
7190 (MOSTLYCLEANFILES): Likewise. Also add
7191 discard_locals_relocatable_test1.lout and
7192 discard_locals_relocatable_test2.out.
7193 (discard_locals_relocatable_test1.syms): New target.
7194 (discard_locals_relocatable_test.o): New target.
7195 (discard_locals_relocatable_test1.out): New target.
7196 (discard_locals_relocatable_test2.syms): New target.
7197 (discard_locals_relocatable_test2.out): New target.
7198 (various): Add missing ../ld-new dependencies.
7199 * testsuite/Makefile.in: Rebuild.
7200
7201 2010-03-03 Nick Clifton <nickc@redhat.com>
7202
7203 * po/fi.po: New Finnish translation.
7204
7205 2010-03-01 Doug Kwan <dougkwan@google.com>
7206
7207 * layout.cc (Layout::Layout): Force section types of .init_array*,
7208 .preinit_array* and .fini_array* sections.
7209 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7210 Fix check of return value of std::string::find.().
7211 (Output_section::Input_section_sort_compare::operator()): Remove
7212 comment about .init_array.
7213 (Output_section::Input_section_sort_init_fini_compare::operator()):
7214 New method.
7215 (Output_section::sort_attached_input_sections): Handle .init_array
7216 and .fini_array specially.
7217 * output.h (Output_section::Inut_section_sort_compare): Update
7218 comment.
7219 (Output_section::Input_section_sort_init_fini_compare): New struct.
7220
7221 2010-02-26 Doug Kwan <dougkwan@google.com>
7222
7223 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7224 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7225 * testsuite/debug_msg.sh: Avoid matching source line number for
7226 use of global variable undef_int.
7227
7228 2010-02-26 Doug Kwan <dougkwan@google.com>
7229
7230 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7231 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7232 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7233 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7234 * options.cc (General_options::General_options): Initialize member
7235 fix_v4bx_.
7236 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7237 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7238 and rm_no_fix_v4bx.stdout
7239 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7240 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7241 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7242 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7243 and arm_no_fix_v4bx.
7244 * Makefile.in: Regenerate.
7245 * testsuite/arm_fix_v4bx.s: New file.
7246 * testsuite/arm_fix_v4bx.sh: Ditto.
7247
7248 2010-02-24 Doug Kwan <dougkwan@google.com>
7249
7250 * arm.cc (Target_arm::got_section): Make the .got section the first
7251 non RELRO section in the data segment.
7252 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7253 suffixes of section names.
7254
7255 2010-02-24 Doug Kwan <dougkwan@google.com>
7256
7257 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7258 flags and attributes merging if an input file is a binary file.
7259 * fileread.cc (Input_file::open): Record format of original file.
7260 * fileread.h (Input_file::Format): New enum type.
7261 (Input_file::Input_file): Initialize data member format_.
7262 (Input_file::format): New method definition.
7263 (Input_file::format_):: New data member.
7264
7265 2010-02-24 Doug Kwan <dougkwan@google.com>
7266
7267 * arm.cc (Arm_output_data_got): New class.
7268 (ARM_TCB_SIZE): New constant
7269 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7270 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7271 If user uses a script with a SECTIONS clause, issue only a warning
7272 for a misplaced EXIDX input section. Otherwise, issue an error.
7273 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
7274 garbage collection.
7275 (Target_arm::got_mode_index_entry): Handle static linking.
7276 (Target_arm::Scan::local): Ditto.
7277 (Target_arm::Scan::global): Ditto.
7278 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7279 all incorrectly implemented relocations.
7280 (Target_arm::fix_exidx_coverage): Pass layout to
7281 Arm_output_section::fix_exidx_coverage.
7282 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7283 from ".ARM.exidx." and ".ARM.extab.".
7284
7285 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7286
7287 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7288 section if it does not already exist.
7289 * attributes.cc (Attributes_section_data::Attributes_section_data):
7290 Don't crash if size is zero.
7291
7292 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7293 Ian Lance Taylor <iant@google.com>
7294
7295 * gold.cc (queue_middle_tasks): If no input files were opened,
7296 exit.
7297 * workqueue.h (Task_function::Task_function): Assert that there is
7298 a blocker.
7299
7300 2010-02-22 Doug Kwan <dougkwan@google.com>
7301
7302 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7303 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7304 types to avoid warnings due to different uint64_t implementations
7305 on different hosts.
7306
7307 2010-02-21 Doug Kwan <dougkwan@google.com>
7308
7309 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7310 handling of the maximum backward branch offset.
7311 (Arm_relocate_functions::thumb_branch_common): Ditto.
7312 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7313 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
7314 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
7315 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7316 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7317 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7318 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7319 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7320 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7321 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7322 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7323 thumb2_bl_out_of_range.o): New rules.
7324 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7325 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7326 thumb2_bl_out_of_range
7327 * testsuite/Makefile.in: Regenerate.
7328 * testsuite/arm_bl_in_range.s: New file.
7329 * testsuite/arm_bl_out_of_range.s: Ditto.
7330 * testsuite/arm_branch_in_range.sh: Ditto.
7331 * testsuite/arm_branch_range.t: Ditto.
7332 * testsuite/thumb2_branch_range.t: Ditto.
7333 * testsuite/thumb_bl_in_range.s: Ditto.
7334 * testsuite/thumb_bl_out_of_range.s: Ditto.
7335 * testsuite/thumb_branch_range.t: Ditto.
7336
7337 2010-02-20 Sriraman Tallam <tmsriram@google.com>
7338
7339 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7340 Add reloc offset information.
7341 * icf.cc (get_section_contents): Change iterators to point to the new
7342 vectors. Add reloc offset information to the contents.
7343 * icf.h (Icf::Sections_reachable_info): New typedef.
7344 (Icf::Sections_reachable_list): New typedef.
7345 (Icf::Offset_info): New typedef.
7346 (Icf::Reloc_info): New struct typedef.
7347 (Icf::Reloc_info_list): New typedef.
7348 (Icf::symbol_reloc_list): Delete method.
7349 (Icf::addend_reloc_list): Delete method.
7350 (Icf::section_reloc_list): Delete method.
7351 (Icf::reloc_info_list): New method.
7352 (Icf::reloc_info_list_): New member.
7353
7354 2010-02-19 Doug Kwan <dougkwan@google.com>
7355
7356 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7357 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7358 * arm.cc (Arm_relocation_functions): New forward declaration.
7359 (Target_arm::Target_arm): Initialize new data members
7360 got_mod_index_offset_ and tls_base_symbol_defined_.
7361 (Target_arm::Relocate::relocate_tls): New method.
7362 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7363 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7364 New methods.
7365 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
7366 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7367 (Target_arm::got_mod_index_offset_,
7368 Target_arm::tls_base_symbol_defined_): New data members.
7369 (Target_arm::Scan::local, Target::Scan::global,
7370 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7371 relocations.
7372
7373 2010-02-18 Doug Kwan <dougkwan@google.com>
7374
7375 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7376 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7377 text section as a parameter becuase some broken tools may not set
7378 the link in section header.
7379 (Target_arm::has_got_section): New method.
7380 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7381 without any mapping symbol as data only. Remove warning.
7382 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7383 link in its section header, try to discover the link by inspecting the
7384 REL31 relocation at the beginning of the section.
7385 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7386 in error message.
7387 (Target_arm::Scan::global): Treat any reference to the symbol
7388 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7389
7390 2010-02-12 Sriraman Tallam <tmsriram@google.com>
7391
7392 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7393 (Scan::global_reloc_may_be_function_pointer): New function.
7394 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7395 (Scan::global_reloc_may_be_function_pointer): New function.
7396 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7397 (Scan::global_reloc_may_be_function_pointer): New function.
7398 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7399 (Scan::global_reloc_may_be_function_pointer): New function.
7400 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7401 (Scan::global_reloc_may_be_function_pointer): New function.
7402 (Scan::possible_function_pointer_reloc): New function.
7403 (Target_x86_64::can_check_for_function_pointers): New function.
7404 * gc.h (gc_process_relocs): Scan relocation types to determine if
7405 function pointers were taken for targets that support it.
7406 * icf.cc (Icf::find_identical_sections): Include functions for
7407 folding in safe ICF whose pointer is not taken.
7408 * icf.h (Secn_fptr_taken_set): New typedef.
7409 (fptr_section_id_): New member.
7410 (section_has_function_pointers): New function.
7411 (set_section_has_function_pointers): New function.
7412 (check_section_for_function_pointers): New function.
7413 * options.h: Fix comment for safe ICF option.
7414 * target.h (can_check_for_function_pointers): New function.
7415 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7416 Modify icf_safe_test for X86-64.
7417 * testsuite/Makefile.in: Regenerate.
7418 * testsuite/icf_safe_so_test.cc: New file.
7419 * testsuite/icf_safe_so_test.sh: New file.
7420 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7421 (main): Change to take pointer to function kept_func_3.
7422 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7423 folding is done correctly for X86-64.
7424
7425 2010-02-12 David S. Miller <davem@davemloft.net>
7426
7427 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7428 is_symbolless parameter.
7429 (Output_reloc<SHT_REL>::is_symbolless): New.
7430 (Output_reloc<SHT_REL>::is_symbolless_): New.
7431 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7432 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7433 (Output_reloc<SHT_RELA>::is_symbolless): New.
7434 (Output_data_reloc::add_global): Handle is_symbolless.
7435 (Output_data_reloc::add_global_relative): Likewise.
7436 (Output_data_reloc::add_local): Likewise.
7437 (Output_data_reloc::add_local_relative): Likewise.
7438 (Output_data_reloc::add_symbolless_global_addend): New.
7439 (Output_data_reloc::add_symbolless_local_addend): New.
7440 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7441 is_symbolless.
7442 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7443 instead of ->is_relative_
7444 (Output_reloc::write): Likewise.
7445 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7446 (Output_reloc::write_rel): Simplify.
7447
7448 * sparc.cc (Target_sparc::Scan::local): Use
7449 ->add_symbolless_local_addend as needed.
7450 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7451 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7452 based upon relocation offset.
7453
7454 2010-02-11 Doug Kwan <dougkwan@google.com>
7455
7456 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7457 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7458 beginning of function.
7459 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7460 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7461 parameter is_32bit in calls to should_apply_static_reloc.
7462 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7463 (check_DATA): Add arm_abs_global.stdout.
7464 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7465 arm_abs_global.stdout): New rules.
7466 (MOSTLLYCLEANFILES): Add arm_abs_global
7467 * Makefile.in: Regenerate.
7468 * testsuite/arm_abs_global.s: New file.
7469 * testsuite/arm_abs_global.sh: Ditto.
7470 * testsuite/arm_abs_lib.s: Ditto.
7471
7472 2010-02-11 Ian Lance Taylor <iant@google.com>
7473
7474 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7475 Read_relocs task.
7476 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7477 Allocate_commons_task first.
7478 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7479 task, rather than symtab_lock_.
7480 (Gc_process_relocs::~Gc_process_relocs): New function.
7481 (Gc_process_relocs::is_runnable): Check this_blocker_.
7482 (Gc_process_relocs::locks): Use next_blocker_ rather than
7483 blocker_.
7484 (Scan_relocs::~Scan_relocs): New function.
7485 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7486 symtab_lock_.
7487 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7488 next_blocker_.
7489 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7490 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7491 constructor accordingly.
7492 (class Gc_process_relocs): Likewise.
7493 (class Scan_relocs): Likewise.
7494 * common.h (class Allocate_commons_task): Remove symtab_lock_
7495 field, and corresponding constructor parameter.
7496 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7497 symtab_lock_.
7498 (Allocate_commons_task::locks): Likewise.
7499
7500 2010-02-11 Ian Lance Taylor <iant@google.com>
7501
7502 * gold-threads.h (class Once): Define.
7503 (class Initialize_lock): Rewrite as child of Once.
7504 * gold-threads.cc (class Once_initialize): Define.
7505 (once_pointer_control): New static variable.
7506 (once_pointer, once_arg): New static variables.
7507 (c_run_once): New static function.
7508 (Once::Once, Once::run_once, Once::internal_run): New functions.
7509 (class Initialize_lock_once): Remove.
7510 (initialize_lock_control): Remove.
7511 (initialize_lock_pointer): Remove.
7512 (initialize_lock_once): Remove.
7513 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7514 (Initialize_lock::initialize): Rewrite.
7515 (Initialize_lock::do_run_once): New function.
7516 * archive.cc (Archive::interpret_header): Only clear name if it is
7517 not already empty.
7518 * fileread.cc: Include "gold-threads.h"
7519 (file_counts_lock): New static variable.
7520 (file_counts_initialize_lock): Likewise.
7521 (File_read::release): Only increment counts when using --stats.
7522 Use a lock around the increment.
7523 * parameters.cc (class Set_parameters_target_once): Define.
7524 (set_parameters_target_once): New static variable.
7525 (Parameters::Parameters): Move here from parameters.h.
7526 (Parameters::set_target): Rewrite.
7527 (Parameters::set_target_once): New function.
7528 (Parameters::clear_target): Move here and rewrite.
7529 * parameters.h (class Parameters): Update declarations. Add
7530 set_parameters_target_once_ field.
7531 (Parameters::Parameters): Move to parameters.cc.
7532 (Parameters::clear_target): Likewise.
7533 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7534 task.
7535 (Start_group::~Start_group): New function.
7536 (Start_group::is_runnable): New function.
7537 (Start_group::locks, Start_group::run): New functions.
7538 (Finish_group::run): Change saw_undefined to size_t.
7539 * readsyms.h (class Start_group): Define.
7540 (class Finish_group): Change saw_undefined_ field to size_t.
7541 (Finish_group::Finish_group): Remove saw_undefined and
7542 this_blocker parameters. Change all callers.
7543 (Finish_group::set_saw_undefined): New function.
7544 (Finish_group::set_blocker): New function.
7545 * symtab.h (class Symbol_table): Change saw_undefined to return
7546 size_t. Change saw_undefined_ field to size_t.
7547 * target-select.cc (Set_target_once::do_run_once): New function.
7548 (Target_selector::Target_selector): Initialize set_target_once_
7549 field. Don't initialize lock_ and initialize_lock_ fields.
7550 (Target_selector::instantiate_target): Rewrite.
7551 (Target_selector::set_target): New function.
7552 * target-select.h (class Set_target_once): Define.
7553 (class Target_selector): Update declarations. Make
7554 Set_target_once a friend. Remove lock_ and initialize_lock_
7555 fields. Add set_target_once_ field.
7556
7557 2010-02-10 Ian Lance Taylor <iant@google.com>
7558
7559 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7560 queueing any tasks.
7561 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7562 (queue_middle_tasks): Add all blockers before queueing any tasks.
7563 (queue_final_tasks): Likewise.
7564 * token.h (Task_token::add_blockers): New function.
7565 * object.h (Input_objects::number_of_relobjs): New function.
7566
7567 2010-02-10 Ian Lance Taylor <iant@google.com>
7568
7569 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7570 shared, not if not position independent.
7571 * x86_64.cc (Relocate::relocate_tls): Likewise.
7572 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7573 (tls_pie_pic_test): New target.
7574 * testsuite/Makefile.in: Rebuild.
7575
7576 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7577 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7578 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7579 * testsuite/Makefile.in: Rebuild.
7580
7581 2010-02-09 David S. Miller <davem@davemloft.net>
7582
7583 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7584 R_SPARC_RELATIVE using ->add_local_relative().
7585 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7586
7587 * output.h (Output_data_dynamic::add_section_size): New method
7588 that takes two Output_data objects.
7589 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7590 entry param. Handle it in initializers.
7591 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7592 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7593 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7594 arg.
7595 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7596 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7597 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7598 for dynrel_includes_plt.
7599 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7600 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7601 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7602 before .rela.plt
7603 (Target_sparc::do_finalize_sections): Update to pass true for
7604 dynrel_includes_plt.
7605 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7606 output before .rela.plt
7607 (Target_powerpc::do_finalize_sections): Update to pass true for
7608 dynrel_includes_plt when 32-bit.
7609
7610 2010-02-08 Doug Kwan <dougkwan@google.com>
7611
7612 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7613 method.
7614 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7615 Arm_relobj::scan_section_for_cortex_a8_stubs,
7616 Arm_relobj::do_relocation_section): Instead of calling
7617 Output_section::output_address, use faster
7618 Arm_relobj::simple_input_section_output_address.
7619
7620 2010-02-08 David S. Miller <davem@davemloft.net>
7621
7622 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7623 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7624 relocation helper function.
7625
7626 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7627 just like R_SPARC_GOT{10,13,22}.
7628 (Target_sparc::Scan::local): Likewise.
7629 (Target_sparc::Relocate:relocate): Likewise.
7630
7631 2010-02-06 Ian Lance Taylor <iant@google.com>
7632
7633 * configure.ac: Rewrite targetobjs duplicate removal code to use
7634 only shell constructs.
7635 * configure: Rebuild.
7636
7637 2010-02-05 Doug Kwan <dougkwan@google.com>
7638
7639 PR 11247
7640 * arm.cc (Arm_relobj::section_is_scannable): New method.
7641 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7642 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7643
7644 2010-02-04 Doug Kwan <dougkwan@google.com>
7645
7646 PR 11247
7647 * arm-reloc-property.cc (cstdio): Include.
7648 * configure.ac (targetobjs): Remove duplicates.
7649 * configure: Regenerate.
7650 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7651 big and little endian version for a given address size.
7652
7653 2010-02-03 Doug Kwan <dougkwan@google.com>
7654
7655 * arm-reloc-property.cc
7656 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7657 definition.
7658 * arm-reloc-property.h
7659 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7660 New method definition.
7661 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7662 declaration.
7663 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7664 overflow to N.
7665 (GOT_PREL): Change implemented to Y.
7666 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7667 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7668 (Arm_relocate_functions::movw_abs_nc): Remove method.
7669 (Arm_relocate_functions::movt_abs): Ditto.
7670 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7671 (Arm_relocate_functions::thm_movt_abs): Ditto.
7672 (Arm_relocate_functions::movw_rel_nc): Ditto.
7673 (Arm_relocate_functions::movw_rel): Ditto.
7674 (Arm_relocate_functions::movt_rel): Ditto.
7675 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7676 (Arm_relocate_functions:thm_movw_rel): Ditto.
7677 (Arm_relocate_functions:thm_movt_rel): Ditto.
7678 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7679 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7680 New method definitions.
7681 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7682 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7683 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7684 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7685 (Target_arm::Relocate::relocate): Check for non-static or
7686 unimplemented relocation code and exit early. Change calls to
7687 Target_arm::reloc_uses_thumb_bit and
7688 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7689 instead. Refactor code to handle similar relocations to increase
7690 code sharing. Remove check for unsupported relocation code in switch
7691 statement.
7692 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7693 relocation property table to find out size. Change error message to
7694 print out the name of a relocation code instead of the numeric value.
7695 (Target_arm::scan_reloc_for_stub): Use relocation property table
7696 instead of calling Target_arm::reloc_uses_thumb_bit().
7697
7698 2010-02-02 Doug Kwan <dougkwan@google.com>
7699
7700 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7701 types of relaxed input section.
7702
7703 2010-02-02 Doug Kwan <dougkwan@google.com>
7704
7705 * Makefile.am (HFILES): Add arm-reloc-property.h.
7706 (DEFFILES): New.
7707 (TARGETSOURCES): Add arm-reloc-property.cc
7708 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
7709 (libgold_a_SOURCES): $(DEFFILES)
7710 * Makefile.in: Regenerate.
7711 * arm-reloc-property.cc: New file.
7712 * arm-reloc-property.h: New file.
7713 * arm-reloc.def: New file.
7714 * arm.cc: Update comments.
7715 (arm-reloc-property.h): New included header.
7716 (arm_reloc_property_table): New global variable.
7717 (Target_arm::do_select_as_default_target): New method definition.
7718 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7719 arm-reloc-property to targ_extra_obj.
7720 * parameters.cc (set_parameters_target): Call
7721 Target::select_as_default_target().
7722 * target.h (Target::select_as_default_target): New method definition.
7723 (Target::do_select_as_default_target): Same.
7724
7725 2010-02-01 Doug Kwan <dougkwan@google.com>
7726
7727 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7728 first_output_text_section_.
7729 (Arm_exidx_fixup::first_output_text_section): New method definition.
7730 (Arm_exidx_fixup::first_output_text_section_): New data member.
7731 (Arm_exidx_fixup::process_exidx_section): Record the first text
7732 output section seen.
7733 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7734 and entsize in output section header.
7735
7736 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7737
7738 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7739 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7740 (Arm_relocate_functions::thm_alu11): New Method.
7741 (Arm_relocate_functions::thm_pc8): New Method.
7742 (Arm_relocate_functions::thm_pc12): New Method.
7743 (Target_arm::Scan::local): Handle the relocations.
7744 (Target_arm::Scan::global): Likewise.
7745 (Target_arm::Relocate::relocate): Likewise.
7746 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7747
7748 2010-01-29 Doug Kwan <dougkwan@google.com>
7749
7750 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7751 of relocation types as ld.
7752
7753 2010-01-29 Doug Kwan <dougkwan@google.com>
7754
7755 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7756 to public.
7757 (Arm_relocate_functions::thumb_branch_common): Ditto.
7758 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7759 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7760 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7761 Arm_relocate_functions::jump24): Remove.
7762 (Target_arm::Relocate::relocate): Adjust code to call
7763 Arm_relocation_functions::arm_branch_common and
7764 Arm_relocation_functions::thumb_branch_common instead of their removed
7765 wrappers. Merge switch-cases together to reduce source code size.
7766
7767 2010-01-29 Doug Kwan <dougkwan@google.com>
7768
7769 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7770 output_local_symbol_count_needs_update_.
7771 (Arm_relobj::output_local_symbol_count_needs_update,
7772 Arm_relobj::set_output_local_symbol_count_needs_update,
7773 Arm_relobj::update_output_local_symbol_count): New methods.
7774 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7775 member.
7776 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7777 of pointed function as in a R_ARM_PREL31 relocation.
7778 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7779 for output local symbol count updating.
7780 (Target_arm::do_relax): Update output local symbol counts in objects
7781 if necessary.
7782 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7783
7784 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7785
7786 * arm.cc: Added support for the ARM relocations:
7787 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7788 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7789 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7790 movw_prel_nc).
7791 (Arm_relocate_functions::movw_rel): New method.
7792 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7793 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7794 thm_movw_prel_nc).
7795 (Arm_relocate_functions::thm_movw_rel): New method.
7796 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7797 thm_movt_prel).
7798 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7799 relocations.
7800 (Target_arm::Scan::global): Likewise.
7801 (Target_arm::Relocate::relocate): Likewise.
7802 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7803 Likewise.
7804
7805 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7806
7807 * arm.cc: Added support for ARM group relocations.
7808 (Target_arm::reloc_needs_sym_origin): New method.
7809 (Arm_relocate_functions::calc_grp_kn): New method.
7810 (Arm_relocate_functions::calc_grp_residual): New method.
7811 (Arm_relocate_functions::calc_grp_gn): New method.
7812 (Arm_relocate_functions::arm_grp_alu): New Method.
7813 (Arm_relocate_functions::arm_grp_ldr): New Method.
7814 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7815 (Arm_relocate_functions::arm_grp_ldc): New Method.
7816 (Target_arm::Scan::local): Handle the ARM group relocations.
7817 (Target_arm::Scan::global): Likewise.
7818 (Target_arm::Relocate::relocate): Likewise.
7819 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7820 Likewise.
7821
7822 2010-01-26 Doug Kwan <dougkwan@google.com>
7823
7824 * arm.cc (set): Include.
7825 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7826 pointer type.
7827 (Arm_output_section::Text_section_list): New type.
7828 (Arm_output_section::append_text_sections_to_list): New method.
7829 (Arm_output_section::fix_exidx_coverage): Ditto.
7830 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
7831 (Arm_relobj::convert_input_section_to_relaxed_section): Use
7832 Relobj::set_section_offset() instead of
7833 Sized_relobj::invalidate_section_offset().
7834 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
7835 parameter for section headers. Ignore relocation sections for
7836 unallocated sections and EXIDX sections.
7837 (Target_arm::fix_exidx_coverage): New method.
7838 (Target_arm::output_section_address_less_than): New type.
7839 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7840 linked text section instead of the EXIDX section.
7841 (Arm_output_section::create_stub_group): Add an assertion to check
7842 that this is not an EXIDX output section.
7843 (Arm_output_section::append_text_sections_to_list): New method.
7844 (Arm_output_section::fix_exidx_coverage): Ditto.
7845 (Arm_relobj::scan_sections_for_stubs): Adjust call to
7846 Arm_relobj::section_needs_reloc_stub_scanning.
7847 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7848 first pass.
7849 (Target_arm::fix_exidx_coverage): New method.
7850 * object.h (Relobj::set_output_section): New method.
7851 (Sized_relobj::invalidate_section_offset): Remove method.
7852 (Sized_relobj::do_invalidate_section_offset): Remove method.
7853 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7854
7855 2010-01-25 Doug Kwan <dougkwan@google.com>
7856
7857 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7858 Fix warning due to signed and unsigned comparison on a 32-bit host.
7859
7860 2010-01-22 Doug Kwan <dougkwan@google.com>
7861
7862 * arm.cc (Target_arm::do_relax): Record an output section for section
7863 offset adjustment it contains any stub table that has changed.
7864 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7865 offsets in an output section if necessary.
7866 * output.cc (Output_section::Output_section): Initialize
7867 section_offsets_need_adjustments_.
7868 (Output_section::add_input_section_for_script): Renamed to
7869 Output_section::add_simple_input_section.
7870 (Output_section::save_states): Add a comment.
7871 (Output_section::discard_states): New method defintion.
7872 (Output_section::adjust_section_offsets): Same.
7873 * output.h (Output_section::add_input_section_for_script): Renamed to
7874 Output_section::add_simple_input_section.
7875 (Output_section::discard_states): New method declaration.
7876 (Output_section::adjust_section_offsets): Same.
7877 (Output_section::section_offsets_need_adjustment,
7878 Output_section::set_section_offsets_need_adjustment): New method
7879 definitions.
7880 (Output_section::section_offsets_need_adjustment_): New data member.
7881 * script-sections.cc
7882 (Output_section_element_input::set_section_address): Adjust code for
7883 renaming of Output_section::add_input_section_for_script.
7884 (Orphan_output_section::set_section_address): Same.
7885
7886 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7887
7888 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7889 Fix_v4bx enum values .
7890 * gold/options.h (General_options): New option definitions.
7891 (General_options::fix_v4bx): New method.
7892 (General_options::Fix_v4bx): New enum.
7893 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7894 (General_options::parse_fix_v4bx_interworking): New method.
7895
7896 2010-01-22 Doug Kwan <dougkwan@google.com>
7897
7898 * arm.cc (Arm_exidx_fixup): New class.
7899
7900 2010-01-21 Doug Kwan <dougkwan@google.com>
7901
7902 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7903 classes.
7904 (Arm_exidx_section_offset_map): New type.
7905
7906 2010-01-21 Doug Kwan <dougkwan@google.com>
7907
7908 * arm.cc (Arm_exidx_input_section): New class.
7909 (Arm_relobj::exidx_input_section_by_link,
7910 Arm_relobj::exidx_input_section_by_shndx,
7911 Arm_relobj::make_exidx_input_section): New methods.
7912 (read_arm_attributes_section): Remove.
7913 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7914 information about them.
7915 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7916 to here.
7917
7918 2010-01-20 Doug Kwan <dougkwan@google.com>
7919
7920 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7921 Input_section_specifier to Section_id.
7922 (Target_arm::new_arm_input_section: Adjust code for change of key
7923 type.
7924 (Target_arm::find_arm_input_section): Ditto.
7925 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7926 (Section_id): Remove.
7927 (Garbage_collection::Section_id_hash): Remove.
7928 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7929 (Section_id): Remove.
7930 (Icf::Section_id_hash): Remove.
7931 * object.h (Section_id, Const_section_id, Section_id_hash,
7932 Const_section_id_hash): New type definitions.
7933 * output.cc (Output_section::add_relaxed_input_section): Change to
7934 use Const_section_id instead of Input_section_specifier as key type.
7935 (Output_section::add_merge_input_section): Ditto.
7936 (Output_section::build_relaxation_map): Change to use Section_id
7937 instead of Input_section_specifier as key type.
7938 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7939 Ditto.
7940 (Output_section::convert_input_sections_to_relaxed_sections): Change
7941 to use Const_section_id instead of Input_section_specifier as key type.
7942 (Output_section::find_merge_section): Ditto.
7943 (Output_section::find_relaxed_input_section): Ditto.
7944 * output.h (Input_section_specifier): Remove class.
7945 (Output_section::Output_section_data_by_input_section_map): Change
7946 key type to Const_section_id.
7947 (Output_section::Output_relaxed_input_section_by_input_section_map):
7948 Ditto.
7949 (Output_section::Relaxation_map): Change key type to Section_id.
7950
7951 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7952
7953 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7954 (class Arm_v4bx_stub): New class.
7955 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7956 (Stub_factory::make_arm_v4bx_stub): New method.
7957 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7958 (Stub_table::empty): Handle v4bx stubs.
7959 (Stub_table::add_arm_v4bx_stub): New method.
7960 (Stub_table::find_arm_v4bx_stub): New method.
7961 (Arm_relocate_functions::v4bx): New method.
7962 (Target_arm::fix_v4bx): New method.
7963 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7964 (Stub_table::relocate_stubs): Likewise.
7965 (Stub_table::do_write): Likewise.
7966 (Stub_table::update_data_size_and_addralign): Likewise.
7967 (Stub_table::finalize_stubs): Likewise.
7968 (Target_arm::Scan::local): Likewise.
7969 (Target_arm::Scan::global): Likewise.
7970 (Target_arm::do_finalize_sections): Likewise.
7971 (Target_arm::Relocate::relocate): Likewise.
7972 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7973 Likewise.
7974 (Target_arm::scan_reloc_for_stub): Likewise.
7975 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7976
7977 2010-01-19 Ian Lance Taylor <iant@google.com>
7978
7979 * output.cc (Output_section_headers::do_sized_write): Write large
7980 segment count to sh_info field.
7981 (Output_file_header::do_sized_write): For large segment count,
7982 write PN_XNUM to e_phnum field.
7983
7984 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7985
7986 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7987 (Arm_relocate_functions::thm_jump8): New function.
7988 (Arm_relocate_functions::thm_jump11): New function.
7989 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7990 R_ARM_THM_JUMP11.
7991 (Target_arm::Scan::global): Likewise.
7992 (Target_arm::Relocate::relocate): Likewise.
7993 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7994 Likewise.
7995
7996 2010-01-14 Doug Kwan <dougkwan@google.com>
7997
7998 * arm.cc (map, utility): Include headers.
7999 (Target_arm::apply_cortex_a8_workaround): New method.
8000 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8001 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8002 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8003 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8004 the --[no-]fix-cortex-a8 command line options.
8005 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8006 (Target_arm::relocate_stub): Use addend in instruction template.
8007 * options.h (DEFINE_bool): Set the user-set flag.
8008 (General_options): Add --[no-]-fix-cortex options.
8009 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
8010 : Update fast look-up map after conversion.
8011
8012 2010-01-14 Sriraman Tallam <tmsriram@google.com>
8013
8014 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8015 in the first pass of do_layout.
8016
8017 2010-01-13 Doug Kwan <dougkwan@google.com>
8018
8019 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8020 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8021 apparent compiler problem of not folding static constant integral
8022 data members of elfcpp::Elf_sizes<32>.
8023
8024 2010-01-13 Doug Kwan <dougkwan@google.com>
8025
8026 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8027 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8028 Arm_relobj::scan_section_for_cortex_a8_erratum,
8029 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8030 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8031 sections to scan for relocation stubs into a new method
8032 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8033 relocation and Cortex-A8 stub scanning.
8034 (Target_arm::do_relax): Force stubs to be after stubbed sections
8035 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
8036 the beginning of a new relaxation pass. Update a comment.
8037 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8038
8039 2010-01-12 Ian Lance Taylor <iant@google.com>
8040
8041 * target-reloc.h (visibility_error): New inline function.
8042 (relocate_section): Call visibility_error.
8043 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8044 (MOSTLYCLEANFILES): Likewise.
8045 (protected_4_pic.o, protected_3.err): New targets.
8046 * testsuite/protected_4.cc: New file.
8047
8048 2010-01-12 Doug Kwan <dougkwan@google.com>
8049
8050 * arm.cc (Cortex_a8_reloc): New class.
8051 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8052 and cortex_a8_relocs_info_.
8053 (Target_arm::fix_cortex_a8): New method definition.
8054 (Target_arm::Cortex_a8_relocs_info): New type.
8055 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8056 New data member declarations.
8057 (Target_arm::scan_reloc_for_stub): Record information about
8058 relocations for THUMB branches that might be exempted from the
8059 Cortex-A8 workaround.
8060 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8061 at the beginning of a relaxation pass.
8062
8063 2010-01-12 Doug Kwan <dougkwan@google.com>
8064
8065 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8066 (Arm_relobj::Mapping_symbol_position,
8067 Arm_reloj::Mapping_symbol_position_less,
8068 Arm_relobj::Mapping_symbols_info): New types.
8069 (Target_arm::is_mapping_symbol_name): New method definition.
8070 (Arm_relobj::do_count_local_symbols): Save information about mapping
8071 symbols.
8072
8073 2010-01-11 Doug Kwan <dougkwan@google.com>
8074
8075 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8076 Arm_relocate_functions::thumb32_branch_upper,
8077 Arm_relocate_functions::thumb32_branch_lower,
8078 Arm_relocate_functions::thumb32_cond_branch_offset,
8079 Arm_relocate_functions::thumb32_cond_branch_upper,
8080 Arm_relocate_functions::thumb32_cond_branch_lower,
8081 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8082 branch offset encoding.
8083 (Arm_relocate_functions::thumb_branch_common): Use new branch
8084 offset encoding methods to avoid code duplication.
8085 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8086 (Stub_addend_reader::operator()): Use new branch encoding method
8087 to avoid code duplication.
8088
8089 2010-01-11 Doug Kwan <dougkwan@google.com>
8090
8091 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8092 (Target_arm::do_finalize_sections): Define special EXIDX section
8093 symbols only if referenced.
8094 * gc.h (Garbage_collection::add_reference): New method.
8095 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8096 code duplication.
8097
8098 2010-01-11 Ian Lance Taylor <iant@google.com>
8099
8100 * script.cc (Version_script_info::build_expression_list_lookup):
8101 Change complaing about duplicate wildcard match from error to
8102 warning.
8103
8104 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8105 of 2009-12-30.
8106 (Version_script_info::Version_script_info): Initialize globs_,
8107 default_version_, default_is_global_, and exact_. Don't
8108 initialize globals_ or locals_.
8109 (Version_script_info::build_lookup_tables): Build local symbols
8110 first.
8111 (Version_script_info::unquote): New function.
8112 (Version_script_info::add_exact_match): New function.
8113 (Version_script_info::build_expression_list_lookup): Remove lookup
8114 parameter. Add is_global parameter. Change all callers. Handle
8115 wildcard pattern specially. Unquote pattern. Call
8116 add_exact_match.
8117 (Version_script_info::get_name_to_match): New function.
8118 (Version_script_info::get_symbol_version): New function.
8119 (Version_script_info::get_symbol_version_helper): Remove.
8120 (Version_script_info::check_unmatched_names): Call unquote.
8121 * script.h (class Version_script_info): Change get_symbol_version
8122 to be non-inline and add is_global parameter; change all callers.
8123 Rewrite symbol_is_local. Update declarations. Define struct
8124 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8125 Remove globals_ and locals_ members. Add exact_, globs_,
8126 default_version_, is_global_.
8127 (Version_script_info::Glob): Remove pattern, add expression and
8128 is_global. Update constructor. Change all callers.
8129 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8130 default version.
8131 (Versions::symbol_section_contents): If a symbol is undefined, or
8132 defined in a dynamic object, set the version index to
8133 VER_NDX_LOCAL.
8134 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8135 symbol_is_local.
8136 (Symbol_table::add_from_pluginobj): Likewise.
8137 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8138
8139 2010-01-11 Doug Kwan <dougkwan@google.com>
8140
8141 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8142 (incremental_dump_LDADD): Add linking option for libintl.
8143 * Makefile.in: Regenerate.
8144
8145 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8146
8147 PR gold/11144
8148 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8149 instead of -Ds.
8150 * testsuite/Makefile.in: Regenerated.
8151
8152 2010-01-10 Doug Kwan <dougkwan@google.com>
8153
8154 * options.h (DEFINE_var): Use parentheses around argument varname__
8155 in macro body to avoid any unintended subsequent substitutions.
8156
8157 2010-01-10 Ian Lance Taylor <iant@google.com>
8158
8159 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8160 candidates before doing symbol resolution.
8161
8162 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8163 ODR candidates if only one is weak.
8164
8165 2010-01-08 Ian Lance Taylor <iant@google.com>
8166
8167 * script.cc (Version_script_info::build_expression_list_lookup):
8168 Don't warn about ambiguous version, just record the ambiguity.
8169 (Version_script_info::get_symbol_version_helper): Give error if
8170 version is ambiguous.
8171
8172 2010-01-08 Doug Kwan <dougkwan@google.com>
8173
8174 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
8175 prev_data_size_ and prev_addralign_. Remove initializer for
8176 deleted data member has_been_changed_.
8177 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8178 to determine if the table is empty.
8179 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8180 Remove.
8181 (Stub_table::add_reloc_stub): Define method in class definition
8182 instead of just declaring it there.
8183 (Stub_table::add_cortex_a8_stub): New method definition.
8184 (Stub_table::update_data_size_and_addralign): Ditto.
8185 (Stub_table::finalize_stubs): Ditto.
8186 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8187 (Stub_table::do_addralign_): Return address alignment in the
8188 (Stub_table::do_reset_address_and_file_offset): Define method in
8189 class definition instead of declaring it there. Set current data
8190 size to be the data size of the previous pass.
8191 (Stub_table::set_final_data_size): Use current data size as the
8192 final data size.
8193 (Stub_table::relocate_stub): Change parameter type of stub from
8194 Reloc_stub pointer to Stub pointer.
8195 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8196 (Stub_table::Cortex_a8_stub_list): New typedef.
8197 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8198 Stub_table::prev_addralign_): New data member.
8199 (Arm_relobj::Arm_relobj): Initialize data member
8200 section_has_cortex_a8_workaround_.
8201 (Arm_relobj::section_has_cortex_a8_workaround,
8202 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8203 definitions.
8204 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8205 declarations.
8206 (Target_arm::relocate_stub): Change parameter type of stub from
8207 Reloc_stub pointer to Stub pointer.
8208 (Insn_template::size, Insn_template::alignment): Handle
8209 THUMB16_SPECIAL_TYPE.
8210 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8211 Stub_table::update_data_size_and_addralign,
8212 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8213 definitions.
8214 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8215 (Stub_table::do_write): Ditto.
8216 (Target_arm::do_relax): Adjust code for changes in Stub_table.
8217
8218 2010-01-08 Ian Lance Taylor <iant@google.com>
8219
8220 PR 11108
8221 * symtab.h (class Symbol): Remove fields is_target_special_ and
8222 has_plt_offset_. Add field is_defined_in_discarded_section_.
8223 (Symbol::is_defined_in_discarded_section): New function.
8224 (Symbol::set_is_defined_in_discarded_section): New function.
8225 (Symbol::has_plt_offset): Rewrite.
8226 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8227 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8228 Don't initialize is_target_special_ or has_plt_offset_.
8229 Initialize is_defined_in_discarded_section_.
8230 (Symbol_table::add_from_relobj): If appropriate, set
8231 is_defined_in_discarded_section.
8232 * resolve.cc (Symbol::override_base_with_special): Don't test
8233 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8234 * target-reloc.h (relocate_section): Do special handling for
8235 symbols defined in discarded sections for global symbols as well
8236 as local symbols.
8237
8238 2010-01-08 Ian Lance Taylor <iant@google.com>
8239
8240 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8241 the SHT_SYMTAB case.
8242
8243 2010-01-08 Ian Lance Taylor <iant@google.com>
8244
8245 * object.cc (Sized_relobj::do_layout): Don't get confused if
8246 layout_eh_frame returns NULL.
8247
8248 2010-01-08 Ian Lance Taylor <iant@google.com>
8249
8250 PR 11084
8251 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8252 dynamic symbol table, use the normal symbol table.
8253 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8254 symbol table.
8255
8256 2010-01-08 Ian Lance Taylor <iant@google.com>
8257
8258 PR 11072
8259 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8260 sections.
8261
8262 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8263
8264 * version.cc (print_version): Change to "Copyright 2010".
8265
8266 2010-01-08 Ian Lance Taylor <iant@google.com>
8267
8268 PR 10287
8269 PR 11063
8270 * i386.cc (class Target_i386): Change return type of plt_section
8271 to be non-const.
8272 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8273 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8274 tls_desc_rel_ field.
8275 (Output_data_plt_i386::rel_tls_desc): New function.
8276 (Target_i386::rel_tls_desc_section): New function.
8277 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8278 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8279 R_386_TLS_DESC reloc in rel_tls_desc_section.
8280 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8281 Define struct Tlsdesc_info.
8282 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8283 (Target_x86_64::do_reloc_symbol_index): New function.
8284 (Target_x86_64::add_tlsdesc_info): New function.
8285 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8286 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8287 tlsdesc_rel_ field.
8288 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8289 all callers.
8290 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8291 (Target_x86_64::rela_tlsdesc_section): New function.
8292 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8293 handling.
8294 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8295 (Target_x86_64::do_reloc_addend): New function.
8296 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8297 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8298 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8299 (Output_reloc::type): New function.
8300 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8301 (Output_reloc::is_target_specific): New function.
8302 (Output_reloc::target_arg): New function.
8303 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8304 absolute relocs and target specific relocs.
8305 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8306 add_target_specific.
8307 (class Output_data_reloc) [SHT_RELA]: Likewise.
8308 * output.cc (Output_reloc::Output_reloc): Add four new versions
8309 for absolute relocs and target specific relocs.
8310 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8311 (Output_reloc::get_symbol_index): Likewise.
8312 (Output_reloc::local_section_offset): Check that local_sym_index_
8313 is not TARGET_CODE or 0.
8314 (Output_reloc::symbol_value): Likewise.
8315 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8316 reloc.
8317 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8318 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8319 functions.
8320 * layout.cc (add_target_dynamic_tags): Use output section for
8321 DT_PLTRELSZ and DT_JMPREL.
8322
8323 2010-01-07 Ian Lance Taylor <iant@google.com>
8324
8325 PR 11061
8326 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8327 function.
8328 (class Output_data_reloc_generic): Define.
8329 (class Output_data_reloc_base): Change base class to
8330 Output_data_reloc_generic. Change add() method to call
8331 bump_relative_reloc_count for a relative reloc. Remove
8332 sort_relocs_ field.
8333 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8334 to sort_relocs().
8335 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8336 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8337 appropriate.
8338 * layout.h (class Layout): Update declaration.
8339
8340 2010-01-07 Ian Lance Taylor <iant@google.com>
8341
8342 * output.h (class Output_data): Add const version of
8343 output_section and do_output_section.
8344 (class Output_section_data): Add const version of
8345 do_output_section.
8346 (class Output_section): Likewise.
8347 * layout.cc (Layout::add_target_dynamic_tags): New function.
8348 * layout.h (class Layout): Update declarations.
8349 * arm.cc (Target_arm::do_finalize_sections): Use
8350 add_target_dynamic_tags.
8351 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8352 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8353 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8354 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8355
8356 2010-01-07 Ian Lance Taylor <iant@google.com>
8357
8358 PR 11042
8359 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8360 object as needed.
8361
8362 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8363 Ian Lance Taylor <iant@google.com>
8364
8365 PR 11019
8366 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8367 Xindex::read_symtab_xindex.
8368
8369 2010-01-07 Doug Kwan <dougkwan@google.com>
8370
8371 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8372 (Insn_template::thumb16_bcond_insn): New method declaration.
8373 (Insn_template): Fix spelling.
8374 (Stub::thumb16_special): New method declaration.
8375 (Stub::do_write): Define virtual method which was previously pure
8376 virtual.
8377 (Stub::do_thumb16_special): New method declaration.
8378 (Stub::do_fixed_endian_write): New template member.
8379 (Reloc_stub::do_write): Remove.
8380 (Reloc_stub::do_fixed_endian_write): Remove.
8381 (Cortex_a8_stub): New class definition.
8382 (Stub_factory::make_cortex_a8_stub): New method definition.
8383 (Stub_factory::Stub_factory): Add missing static storage class
8384 qualifier for elf32_arm_stub_a8_veneer_blx.
8385
8386 2010-01-07 Ian Lance Taylor <iant@google.com>
8387
8388 PR 10980
8389 * options.h (class General_options): Add --warn-unresolved-symbols
8390 and --error-unresolved-symbols.
8391 * errors.cc (Errors::undefined_symbol): Implement
8392 --warn-unresolved-symbols.
8393
8394 * options.h (class General_options): Add -z text and -z textoff.
8395 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8396
8397 2010-01-06 Sriraman Tallam <tmsriram@google.com>
8398
8399 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8400 (Garbage_collection::cident_sections): New function.
8401 (Garbage_collection::add_cident_section): New function.
8402 (Garbage_collection::cident_sections_): New member.
8403 (gc_process_relocs): Add references to sections whose names are C
8404 identifiers.
8405 * gold.h (cident_section_start_prefix): New constant.
8406 (cident_section_stop_prefix): New constant.
8407 (is_cident): New function.
8408 * layout.cc (Layout::define_section_symbols): Replace string constants
8409 with the newly defined constants.
8410 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8411 C identifiers.
8412 * testsuite/Makefile.am: Add gc_orphan_section_test.
8413 * testsuite/Makefile.in: Regenerate.
8414 * testsuite/gc_orphan_section_test.cc: New file.
8415 * testsuite/gc_orphan_section_test.sh: New file.
8416
8417 2010-01-06 Ian Lance Taylor <iant@google.com>
8418
8419 PR 10980
8420 * options.h (class General_options): Add --warn-shared-textrel.
8421 * layout.cc (Layout::finish_dynamic_section): Implement
8422 --warn-shared-textrel.
8423
8424 PR 10980
8425 * options.h (class General_options): Add --warn-multiple-gp.
8426
8427 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8428
8429 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8430 $(THREADSLIB) and $(LIBDL).
8431 * Makefile.in: Rebuild.
8432
8433 2010-01-06 Ian Lance Taylor <iant@google.com>
8434
8435 PR 10980
8436 * options.cc (General_options::parse_section_start): New function.
8437 (General_options::section_start): New function.
8438 (General_options::General_options): Initialize all members.
8439 * options.h: Include <map>
8440 (class General_options): Add --section-start. Add section_starts_
8441 member.
8442 * layout.cc (Layout::attach_allocated_section_to_segment): If
8443 --section-start was used, set the address of the segment. Remove
8444 local sort_sections.
8445 (Layout::relaxation_loop_body): If the address of the load segment
8446 has been set by --section-start, don't use it.
8447 * output.h (Output_segment::update_flags_for_output_section): New
8448 function.
8449 * output.cc (Output_segment::add_output_section): Call
8450 update_flags_for_output_section.
8451
8452 2010-01-05 Ian Lance Taylor <iant@google.com>
8453
8454 PR 10980
8455 * options.h (class General_options): Add --undefined-version.
8456 * script.cc (struct Version_expression): Add was_matched_by_symbol
8457 field.
8458 (Version_script_info::matched_symbol): New function.
8459 (Version_script_info::get_symbol_version_helper): Call
8460 matched_symbol.
8461 (Version_script_info::check_unmatched_names): New function.
8462 * script.h (class Version_script_info): Update declarations.
8463 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8464
8465 * options.h (class General_options): Use DEFINE_bool_alias for
8466 allow_multiple_definition.
8467 * resolve.cc (Symbol_table::should_override): Don't test
8468 allow_multiple_definition.
8469
8470 PR 10980
8471 * options.h (class General_options): Add --cref.
8472 * main.cc (main): Print cref table if --cref. Don't close mapfile
8473 until after printing cref table.
8474 * cref.cc: Include "symtab.h".
8475 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8476 (Cref_table_compare::operator()): New function.
8477 (Cref_inputs::gather_cref): New function.
8478 (filecol): New static const.
8479 (Cref_inputs::print_cref): New function.
8480 (Cref::print_cref): New function.
8481 * cref.h: Include <cstdio>.
8482 (class Cref): Update declarations.
8483 * mapfile.h (Mapfile::file): New function.
8484 * object.h (class Object): Define Symbols. Declare virtual
8485 do_get_global_symbols.
8486 (Object::get_global_symbols): New function.
8487 * object.cc (Input_objects::add_object): Pass object to cref_ if
8488 --cref.
8489 (Input_objects::archive_start): Likewise.
8490 (Input_objects::archive_stop): Likewise.
8491 (Input_objects::print_cref): New function.
8492 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8493 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8494 --cref.
8495 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8496 function.
8497 * plugin.h (class Sized_pluginobj): Update declarations.
8498
8499 2010-01-05 Ian Lance Taylor <iant@google.com>
8500
8501 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8502 to is_default_version. Rename insdef to insdefault.
8503 (Symbol_table::add_from_relobj): Rename def to is_default_version
8504 and local to is_forced_local.
8505 (Symbol_table::add_from_pluginobj): Likewise.
8506 (Symbol_table::add_from_dynobj): Likewise.
8507 (Symbol_table::define_special_symbol): Rename insdef to
8508 insdefault.
8509
8510 2010-01-04 Ian Lance Taylor <iant@google.com>
8511
8512 PR 10980
8513 * options.h (class General_options): Add
8514 --allow-multiple-definition and -z muldefs.
8515 * resolve.cc (Symbol_table::should_override): Don't warn about a
8516 multiple symbol definition if --allow-multiple-definition or -z
8517 muldefs.
8518
8519 PR 10980
8520 * options.h (class General_options): Add --add-needed and
8521 --copy-dt-needed-entries. Tweak --as-needed help entry.
8522 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8523 error if --copy-dt-needed-entries aka --add-needed is used and
8524 would cause a change in behaviour.
8525
8526 PR 10980
8527 * options.h (class General_options): Add -G as a short version of
8528 --shared. Add no-op options -assert, -g, and -i.
8529
8530 2010-01-04 Sriraman Tallam <tmsriram@google.com>
8531
8532 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8533 check for .text or .gnu.linkonce.t sections.
8534 * icf.cc (Icf::find_identical_sections): Ditto.
8535 Change the detection for mangled function name within the section
8536 name.
8537 * icf.h (is_section_foldable_candidate): New function.
8538
8539 2009-12-30 Ian Lance Taylor <iant@google.com>
8540
8541 PR 10980
8542 * options.h (class General_options): Permit two dashes with
8543 --retain-symbols-file.
8544
8545 2009-12-30 Ian Lance Taylor <iant@google.com>
8546
8547 PR 10979
8548 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8549 don't put the file header and segment headers in the text
8550 segment.
8551
8552 PR 10979
8553 * common.cc (Sort_commons::operator()): Stabilize sort when both
8554 entries are NULL.
8555 (Symbol_table::do_allocate_commons_list): When allocating common
8556 symbols, skip a symbol which is no longer common.
8557 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8558 an object before checking its type.
8559 * testsuite/common_test_2.c: New file.
8560 * testsuite/common_test_3.c: New file.
8561 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8562 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8563 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8564 (common_test_2_pic.o, common_test_2.so): New targets.
8565 (common_test_3_pic.o, common_test_3.so): New targets.
8566 * testsuite/Makefile.in: Rebuild.
8567
8568 PR 10979
8569 * script.cc (read_input_script): If we see a new SECTIONS clause,
8570 and we have added an input section, give an error.
8571 * layout.h (class Layout): Add have_added_input_section function.
8572 Add have_added_input_section_ field.
8573 * layout.cc (Layout::Layout): Initialize
8574 have_added_input_section_.
8575 (Layout::layout): Set have_added_input_section_.
8576 (Layout::layout_eh_frame): Likewise.
8577
8578 2009-12-30 Ian Lance Taylor <iant@google.com>
8579
8580 PR 10931
8581 * options.h (class General_options): Add --sort-common option.
8582 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8583 * common.cc (Sort_common): Add sort_order parameter to
8584 constructor. Add sort_order_ field.
8585 (Sort_commons::operator): Check sort_order_.
8586 (Symbol_table::allocate_commons): Determine the sort order.
8587 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8588 Change all callers.
8589 (Symbol_table::do_allocate_commons_list): Likewise.
8590
8591 2009-12-30 Ian Lance Taylor <iant@google.com>
8592
8593 PR 10916
8594 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8595 symbols from this object, don't change the visibility of an
8596 undefined symbol.
8597 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8598
8599 2009-12-30 Ian Lance Taylor <iant@google.com>
8600
8601 PR 10861
8602 * script.h (class Version_script_info): Define Language enum.
8603 Update declarations. Define Glob, Exact, and Lookup types. Add
8604 new fields globals_, locals_, and is_finalized_.
8605 * script.cc: Various formatting fixes.
8606 (class Parser_closure): Change language_stack_ from a vector of
8607 std::string to one of Version_script_info::Language. Adjust all
8608 uses accordingly.
8609 (class Lazy_demangler): Remove.
8610 (struct Version_expression): Change language from std::string to
8611 Version_script_info::Language.
8612 (Version_script_info::Version_script_info): New function.
8613 (Version_script_info::~Version_script_info): Don't call clear.
8614 (Version_script_info::finalize): New function.
8615 (Version_script_info::build_lookup_tables): New function.
8616 (Version_script_info::build_expression_list_lookup): New
8617 function.
8618 (Version_script_info::get_symbol_version_helper): Rewrite to use
8619 lookup tables.
8620 (Version_script_info::print_expression_list): Adjust to use
8621 Version_script_info::Language.
8622 (script_push_lex_into_version_mode): Check that the version script
8623 has not been finalized.
8624 (version_script_push_lang): Change language string to
8625 Version_script_info::Language.
8626 * options.cc (Command_line::version_script): New function.
8627 * options.h (class General_options): Add finalize_dynamic_list
8628 function. Change version_script from declaration to definition.
8629 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8630 * testsuite/version_script.map: Remove duplicate def of foo.
8631 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8632 version_script.map.
8633 * testsuite/Makefile.in: Rebuild.
8634
8635 2009-12-30 Ian Lance Taylor <iant@google.com>
8636
8637 PR 10843
8638 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8639 if the input symbol index is 0, make the output symbol index 0.
8640
8641 2009-12-30 Ian Lance Taylor <iant@google.com>
8642
8643 PR 10670
8644 * options.h (class General_options): Add -x/--discard-all.
8645 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8646 --discard-all. If the local symbol needs a dynamic entry, check
8647 that before handling --discard-locals.
8648
8649 2009-12-30 Ian Lance Taylor <iant@google.com>
8650
8651 PR 10450
8652 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8653 flags to PF_R.
8654 (Output_segment::add_output_section): Don't change the flags if
8655 the type is PT_TLS.
8656
8657 PR 10450
8658 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8659 GNU hash table if they need a dynamic value. Otherwise, don't add
8660 them if they are defined in a dynamic object or are forced local.
8661
8662 2009-12-29 Ian Lance Taylor <iant@google.com>
8663
8664 PR 10450
8665 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8666 .gnu.hash table for a 32-bit target.
8667
8668 PR 10450
8669 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8670 regular and a dynamic object only needs a dynamic symbol table
8671 entry if it is externally visible.
8672
8673 PR 10450
8674 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8675 constructor. Add global_offset_table_ field.
8676 (Target_i386::got_section): Set global_offset_table_.
8677 (Target_i386::do_finalize_sections): Set global_offset_table_
8678 size.
8679 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8680 in constructor. Add global_offset_table_ field.
8681 (Target_x86_64::got_section): Set global_offset_table_.
8682 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8683 size.
8684
8685 * layout.cc (Layout::Layout): Initialize increase_relro_.
8686 (Layout::get_output_section): Add is_relro, is_last_relro, and
8687 is_first_non_relro parameters. Change all callers.
8688 (Layout::choose_output_section): Likewise.
8689 (Layout::add_output_section_data): Likewise.
8690 (Layout::make_output_section): Likewise.
8691 (Layout::set_segment_offsets): Clear increase_relro when using a
8692 linker script.
8693 * layout.h (class Layout): Add increase_relro method. Add
8694 increase_relro_ field. Update declarations.
8695 * output.cc (Output_section::Output_section): Initialize
8696 is_last_relro_ and is_first_non_relro_.
8697 (Output_segment::add_output_section): Group relro sections is
8698 do_sort is true. Handle is_last_relro and is_first_non_relro.
8699 (Output_segment::maximum_alignment): Remove relro handling.
8700 (Output_segment::set_section_addresses): Add increase_relro
8701 parameter. Change all callers. Add initial alignment to align
8702 relro sections on separate page. Remove old relro handling.
8703 (Output_segment::set_section_list_addresses): Remove in_relro
8704 parameter. Change all callers.
8705 (Output_segment::set_offset): Add increase parameter. Change all
8706 callers. Remove old relro handling.
8707 * output.h (class Output_section): Add new methods: is_last_relro,
8708 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8709 Add is_last_relro_ and is_first_non_relro_ fields.
8710 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8711 Create separate .got.plt section. Call increase_relro.
8712 * x86_64.cc (Target_x86_64::got_section): Likewise.
8713 * testsuite/relro_script_test.t: Add .got.plt.
8714
8715 PR 10450
8716 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8717 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8718 (Layout::finalize): Call set_dynamic_symbol_size.
8719 (Layout::set_dynamic_symbol_size): New function.
8720 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8721 set_dynamic_symbol_size.
8722
8723 PR 10450
8724 * output.h (class Output_section): Add is_entsize_zero_ field.
8725 * output.cc (Output_section::Output_section): Initialize
8726 is_entsize_zero_.
8727 (Output_section::set_entsize): If two different entsizes are
8728 requested, force it to zero.
8729 (Output_section::add_input_section): Set flags for .debug_str
8730 before updating section flags. Set entsize.
8731 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8732 and SHF_STRING if all input sections have those flags.
8733
8734 2009-12-29 Rafael Espindola <espindola@google.com>
8735
8736 * main.cc (main): Fix the sys time reporting.
8737 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8738 reporting.
8739
8740 2009-12-29 Sriraman Tallam <tmsriram@google.com>
8741
8742 * options.cc (General_options::parse_version): Allow -v to exit
8743 without an error if there is nothing to link.
8744
8745 2009-12-29 Ian Lance Taylor <iant@google.com>
8746
8747 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8748 using a version of gcc before 4.1.
8749 * configure: Rebuild.
8750
8751 2009-12-28 Chris Demetriou <cgd@google.com>
8752
8753 * attributes.cc (Output_attributes_section_data::do_write): Use
8754 std::vector::front rather than std::vector::data.
8755
8756 2009-12-28 Ian Lance Taylor <iant@google.com>
8757
8758 * symtab.h (class Symbol_table): Add enum Defined.
8759 * resolve.cc (Symbol_table::should_override): Add defined
8760 parameter. Change all callers. Test whether object is NULL
8761 before calling a method on it.
8762 (Symbol_table::report_resolve_problem): Add defined parameter.
8763 Change all callers.
8764 (Symbol_table::should_override_with_special): Likewise.
8765 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8766 parameter. Change all callers.
8767 (Symbol_table::do_define_in_output_data): Likewise.
8768 (Symbol_table::define_in_output_segment): Likewise.
8769 (Symbol_table::do_define_in_output_segment): Likewise.
8770 (Symbol_table::define_as_constant): Likewise.
8771 (Symbol_table::do_define_as_constant): Likewise.
8772 * script.h (class Symbol_assignment): Add is_defsym parameter to
8773 constructor; change all callers.
8774 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8775 parameter. Change all callers. Add is_defsym_ field.
8776 (class Parser_closure): Add parsing_defsym parameter to
8777 constructor; change all callers. Add parsing_defsym accessor
8778 function. Add parsing_defsym_ field.
8779
8780 2009-12-28 Ian Lance Taylor <iant@google.com>
8781
8782 * gold.cc (queue_middle_tasks): Fix formatting.
8783 * object.cc (Relobj::is_section_name_included): Likewise.
8784
8785 2009-12-23 Ian Lance Taylor <iant@google.com>
8786
8787 * i386.cc (Target_i386::do_calls_non_split): Recognize
8788 -fsplit-stack prologue for a function with a static chain.
8789 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8790 -fsplit-stack prologue when using %r11.
8791
8792 2009-12-21 Sriraman Tallam <tmsriram@google.com>
8793
8794 * options.cc (General_options::parse_version): Make -v continue and do
8795 the link like GNU ld does.
8796
8797 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
8798
8799 * Makefile.am (CCFILES): Add timer.cc.
8800 (HFILES): Add timer.h.
8801 * configure.ac: Check for sysconf and times.
8802 * main.cc: include timer.h.
8803 (main): Use Timer instead of get_run_time.
8804 * timer.cc: New.
8805 * timer.h: New.
8806 * workqueue.cc: include timer.h.
8807 (Workqueue::find_and_run_task):
8808 Report user, sys and wall time.
8809 * Makefile.in: Regenerate.
8810 * config.in: Regenerate.
8811 * configure: Regenerate.
8812
8813 2009-12-16 Doug Kwan <dougkwan@google.com>
8814
8815 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8816 sections.
8817 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8818 relaxed input sections.
8819 * output.cc (Output_section::find_relaxed_input_section): Change
8820 return type to Output_relaxed_input_section pointer. Adjust code
8821 for new type of relaxed_input_section_map_.
8822 * output.h (Output_section::find_relaxed_input_section): Change
8823 return type to Output_relaxed_input_section pointer.
8824 (Output_section::Output_relaxed_input_section_by_input_section_map):
8825 New type.
8826 (Output_section::relaxed_input_section_map_): Change type to
8827 Output_section::Output_relaxed_input_section_by_input_section_map.
8828 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8829 input section.
8830
8831 2009-12-15 Ian Lance Taylor <iant@google.com>
8832
8833 * layout.cc (Layout::create_shstrtab): Only write out after input
8834 sections if we are compressing debug sections.
8835
8836 2009-12-15 Ian Lance Taylor <iant@google.com>
8837
8838 * archive.cc (Archive::add_symbols): Only look up a symbol without
8839 a version if there is, in fact, a version.
8840
8841 2009-12-14 Ian Lance Taylor <iant@google.com>
8842
8843 Revert -Wshadow changes, all changes from:
8844 2009-12-11 Doug Kwan <dougkwan@google.com>
8845 2009-12-11 Nick Clifton <nickc@redhat.com>
8846 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8847
8848 2009-12-11 Doug Kwan <dougkwan@google.com>
8849
8850 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8851 due to -Wshadow.
8852 * attributes.cc (Object_attribute::size): Ditto.
8853 (Attributes_section_data::size): Ditto.
8854 (Attributes_section_data::Attributes_section_data): Ditto.
8855 (Output_attributes_section_data::do_write): Ditto.
8856 * attributes.h (Object_attribute::set_type): Ditto.
8857 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8858
8859 2009-12-11 Nick Clifton <nickc@redhat.com>
8860
8861 * archive.cc: Fix shadowed variable warnings.
8862 * arm.cc: Likewise.
8863 * compressed_output.cc: Likewise.
8864 * compressed_output.h: Likewise.
8865 * configure: Likewise.
8866 * dwarf_reader.cc: Likewise.
8867 * dynobj.cc: Likewise.
8868 * dynobj.h: Likewise.
8869 * ehframe.cc: Likewise.
8870 * ehframe.h: Likewise.
8871 * errors.cc: Likewise.
8872 * expression.cc: Likewise.
8873 * fileread.cc: Likewise.
8874 * fileread.h: Likewise.
8875 * freebsd.h: Likewise.
8876 * i386.cc: Likewise.
8877 * icf.cc: Likewise.
8878 * incremental.h: Likewise.
8879 * layout.cc: Likewise.
8880 * layout.h: Likewise.
8881 * mapfile.cc: Likewise.
8882 * merge.cc: Likewise.
8883 * merge.h: Likewise.
8884 * object.cc: Likewise.
8885 * object.h: Likewise.
8886 * options.h: Likewise.
8887 * output.cc: Likewise.
8888 * output.h: Likewise.
8889 * parameters.cc: Likewise.
8890 * plugin.cc: Likewise.
8891 * powerpc.cc: Likewise.
8892 * reduced_debug_output.cc: Likewise.
8893 * reduced_debug_output.h: Likewise.
8894 * reloc.cc: Likewise.
8895 * reloc.h: Likewise.
8896 * resolve.cc: Likewise.
8897 * script-sections.cc: Likewise.
8898 * script.cc: Likewise.
8899 * script.h: Likewise.
8900 * sparc.cc: Likewise.
8901 * symtab.cc: Likewise.
8902 * symtab.h: Likewise.
8903 * target-select.cc: Likewise.
8904 * target-select.h: Likewise.
8905 * token.h: Likewise.
8906 * workqueue.cc: Likewise.
8907 * workqueue.h: Likewise.
8908 * x86_64.cc: Likewise.
8909
8910 2009-12-10 Doug Kwan <dougkwan@google.com>
8911
8912 * arm.cc (attributes.h): New include.
8913 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8914 (Arm_relobj::~Arm_relobj): Delete object pointed by
8915 attributes_section_data_.
8916 (Arm_relobj::attributes_section_data): New method definition.
8917 (Arm_relobj::attributes_section_data_): New data member declaration.
8918 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8919 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8920 attributes_section_data_.
8921 (Arm_dynobj::attributes_section_data): New method definition.
8922 (Arm_dynobj::attributes_section_data_): New data member declaration.
8923 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8924 initialization value of may_use_blx_ to false.
8925 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
8926 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8927 object attributes to compute results instead of hard-coding.
8928 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8929 Target_arm::get_secondary_compatible_arch,
8930 Target_arm::set_secondary_compatible_arch
8931 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8932 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8933 New method declarations.
8934 (Target_arm::get_aeabi_object_attribute): New method definition.
8935 (Target_arm::attributes_section_data_): New data member declaration.
8936 (read_arm_attributes_section): New template definition.
8937 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8938 (Arm_dynobj::do_read_symbols): Ditto.
8939 (Target_arm::do_finalize_sections): Merge attributes sections from
8940 input. Check for BLX use after attributes section merging.
8941 Fix __exidx_start and __exidx_end visibility. Create an
8942 .ARM.attributes section if necessary.
8943 (Target_arm::get_secondary_compatible_arch,
8944 Target_arm::set_secondary_compatible_arch,
8945 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8946 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
8947 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
8948 New method definitions.
8949
8950 2009-12-09 Ian Lance Taylor <iant@google.com>
8951
8952 * plugin.cc (Plugin::load): Don't cast from void* to a function
8953 pointer.
8954
8955 2009-12-09 Ian Lance Taylor <iant@google.com>
8956
8957 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8958 information fields.
8959
8960 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8961
8962 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8963 Replace two_file_shared_1.so with two_file_shared_2.so.
8964 * testsuite/Makefile.in: Regenerated.
8965
8966 2009-12-08 Doug Kwan <dougkwan@google.com>
8967
8968 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8969 (HFILES): Add attributes.h and int_encoding.h.
8970 * Makefile.in: Regenerate.
8971 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8972 function definitions to int_encoding.cc
8973 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8974 prototypes to int_encoding.h
8975 * reduced_debug_output.cc (int_encoding.h): New include.
8976 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8977 function definitions to int_encoding.cc
8978 (insert_into_vector, read_from_pointer): Move template definitions to
8979 int_encoding.h
8980 * attributes.cc: New file.
8981 * attributes.h: New file.
8982 * int_encoding.cc: New file.
8983 * int_encoding.h: New file.
8984
8985 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
8986
8987 PR gold/11055
8988 * incremental-dump.cc (dump_incremental_inputs): New.
8989 (main): Use dump_incremental_inputs.
8990
8991 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8992
8993 PR gold/10893
8994 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8995 checking elfcpp::STT_FUNC.
8996 (Target_i386::Relocate::relocate): Likewise.
8997 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8998
8999 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9000 symbols from shared libraries into normal FUNC symbols.
9001
9002 * symtab.h (Symbol): Add is_func and use it.
9003
9004 2009-12-05 Doug Kwan <dougkwan@google.com>
9005
9006 * arm.cc (Target_arm::arm_info): Initialize new fields
9007 attributes_section and attributes_vendor.
9008 * i386.cc (Target_i386::i386_info): Same.
9009 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9010 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9011 fields attributes_section and attributes_vendor.
9012 * sparc.cc (Target_sparc::sparc_info): Same.
9013 * target.h (Target::attributes_section, Target::attributes_vendor,
9014 Target::is_attributes_section, Target::attribute_arg_type,
9015 Target::attributes_order): New method definitions.
9016 (Target::Target_info::attributes_section,
9017 Target::Target_info::attributes_vendor): New fields.
9018 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9019 virtual method definitions.
9020 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9021 attributes_section and attributes_vendor.
9022 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9023
9024 2009-12-05 Doug Kwan <dougkwan@google.com>
9025
9026 * arm.cc: Update comments about interworking and stub generation.
9027 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9028 considered as non-PIC.
9029 (Arm_relocate_functions::base_abs): Fix formatting.
9030 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9031 of function to use GOT entry address instead of offset.
9032 (Target_arm::Scan::global): Issue an error if a symbol would need a
9033 PLT does not get one because it is untyped. Remove code to create
9034 dynamic symbols for relative branches.
9035 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9036 takes unsigned integer instead of boolean.
9037
9038 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9039
9040 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9041 (two_file_test_LDADD): Likewise.
9042 (common_test_1_LDADD): Likewise.
9043 (exception_test_LDADD) Likewise.
9044 (weak_test_LDADD): Likewise.
9045 (many_sections_test_LDADD): Likewise.
9046 (initpri1_LDADD): Likewise.
9047 (script_test_1_LDADD): Likewise.
9048 (script_test_2_LDADD): Likewise.
9049 (justsyms_LDADD): Likewise.
9050 (binary_test_LDADD): Likewise.
9051 (large_LDADD): Likewise.
9052 * testsuite/Makefile.in: Regenerated.
9053
9054 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
9055
9056 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9057 (Symbol_table::override_with_special): Likewise.
9058 (Symbol_table::add_from_object): Likewise.
9059
9060 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9061
9062 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9063 Don't set the data_offset twice.
9064
9065 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9066
9067 * testsuite/Makefile.in: Regenerate.
9068
9069 2009-12-03 Doug Kwan <dougkwan@google.com>
9070
9071 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9072 (Target_arm::do_finalize_sections): Add parameter for symbol table
9073 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9074 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9075 parameter for symbol table pointer.
9076 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9077 an additional parameter for a pointer to symbol table.
9078 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9079 parameter for a symbol table pointer.
9080 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9081 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9082 Ditto.
9083 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9084 parameter for a symbol table pointer.
9085
9086 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
9087
9088 * incremental.cc (Incremental_inputs_header)
9089 (Incremental_inputs_header_write, Incremental_inputs_entry)
9090 (Incremental_inputs_entry_write): Move ...
9091 * incremental.h (Incremental_inputs_header)
9092 (Incremental_inputs_header_write, Incremental_inputs_entry)
9093 (Incremental_inputs_entry_write): here.
9094
9095 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9096
9097 * incremental.cc (make_sized_incremental_binary): Set the target.
9098 Error if it is incompatible.
9099 * output.h (Output_file): Add filename method.
9100
9101 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9102
9103 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9104 from the get_* methods.
9105
9106 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9107
9108 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9109 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9110 Write 0 for the data_offset of scripts.
9111
9112 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9113
9114 * testsuite/Makefile.am: Add the incremental_test.sh test.
9115 * testsuite/incremental_test.sh: New.
9116 * testsuite/incremental_test_1.c: New.
9117 * testsuite/incremental_test_2.c: New.
9118
9119 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
9120
9121 * incremental-dump.cc (main): Fix typos.
9122
9123 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
9124
9125 PR gold/11025
9126 * incremental-dump.cc (main): Use llu to print 64 bit values.
9127
9128 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9129 H.J. Lu <hongjiu.lu@intel.com>
9130
9131 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9132 $(LIBDL).
9133 (incremental_dump_LDADD): Likewise.
9134 * Makefile.in: Regenerated.
9135
9136 2009-11-25 Doug Kwan <dougkwan@google.com>
9137
9138 Revert:
9139
9140 2009-11-25 Doug Kwan <dougkwan@google.com>
9141
9142 * arm.cc (Target_arm::Target_arm): Move method definition
9143 outside of class definition. Add code to handle
9144 --target1-rel, --target1-abs and --target2= options.
9145 (Target_arm::get_reloc_reloc_type): Change method to be
9146 non-static and const.
9147 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9148 New data member declaration.
9149 (Target_arm::Scan::local, Target_arm::Scan::global,
9150 Target_arm::Relocate::relocate,
9151 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9152 Adjust call to Target_arm::get_real_reloc_type.
9153 (Target_arm::get_real_reloc_type): Use command line options
9154 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9155 * options.h (--target1-rel, --target1-abs, --target2): New
9156 ARM-only options.
9157
9158 2009-11-25 Doug Kwan <dougkwan@google.com>
9159
9160 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9161 class definition. Add code to handle --target1-rel, --target1-abs
9162 and --target2= options.
9163 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9164 and const.
9165 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9166 member declaration.
9167 (Target_arm::Scan::local, Target_arm::Scan::global,
9168 Target_arm::Relocate::relocate,
9169 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9170 call to Target_arm::get_real_reloc_type.
9171 (Target_arm::get_real_reloc_type): Use command line options to
9172 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9173 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9174 options.
9175
9176 2009-11-25 Doug Kwan <dougkwan@google.com>
9177
9178 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9179 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9180 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9181 formatting.
9182 (Arm_relocate_functions::thm_call): Replace body with a call to
9183 Arm_relocate_functions::thumb_branch_common.
9184 (Arm_relocate_functions::thm_jump24,
9185 Arm_relocate_functions::thm_xpc22): New method definitions.
9186 (Arm_relocate_functions::thumb_branch_common): New method definition.
9187 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9188 operator.
9189 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9190 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9191
9192 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9193
9194 * Makefile.am: Build incremental-dump
9195 * Makefile.in: Regenerate.
9196 * incremental-dump.cc: New.
9197 * incremental.cc (Incremental_inputs_header_data,
9198 Incremental_inputs_entry_data): Move to incremental.h
9199 * incremental.h: (Incremental_inputs_header_data,
9200 Incremental_inputs_entry_data): Move from incremental.cc
9201
9202 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9203
9204 * incremental.cc (Incremental_inputs_header,
9205 Incremental_inputs_header_write, Incremental_inputs_entry,
9206 Incremental_inputs_entry_write): Add a typedef with the data type.
9207
9208 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9209
9210 * incremental.cc (Incremental_inputs_header,
9211 Incremental_inputs_header_write, Incremental_inputs_entry,
9212 Incremental_inputs_entry_write): Update comment about which
9213 type has the filed descriptions.
9214
9215 2009-11-15 Doug Kwan <dougkwan@google.com>
9216
9217 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9218 (Arm_relocate_functions::arm_branch_common): Change method defintion
9219 in class definition to a method declaration and update list of formal
9220 parameters.
9221 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9222 Arm_relocation_functions::jump24): Adjust call to
9223 Arm_relocate_functions::arm_branch_common. Update list of formal
9224 parameters.
9225 (Arm_relocate_functions::xpc25): New method definition.
9226 (Arm_relocate_functions::arm_branch_common): Move method defintion
9227 out from class definition. Use stubs for mode-switching and extending
9228 branch ranges.
9229 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9230 specially. Change code to enable use of stubs in ARM branches.
9231
9232 2009-11-10 Doug Kwan <dougkwan@google.com>
9233
9234 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9235 in method declaration.
9236 (Target_arm::relocate_stub): New method declaration.
9237 (Target_arm::default_target): Change to return a pointer instead of
9238 a const reference.
9239 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9240 Target_arm::default_target.
9241 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9242 method definition.
9243 (Target_arm::relocate_section): Adjust view.
9244 (Target_arm::relocate_stub): New method definition.
9245
9246 2009-11-10 Doug Kwan <dougkwan@google.com>
9247
9248 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9249 a format warning.
9250 * incremental.cc (open_incremental_binary): Initialized local
9251 variables to avoid warnings.
9252 * object.cc (make_elf_object): Ditto.
9253 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9254 a format warning.
9255
9256 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9257
9258 PR gold/10930
9259 * testsuite/plugin_test.c: Include "config.h".
9260
9261 2009-11-09 Doug Kwan <dougkwan@google.com>
9262
9263 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9264 (arm_symbol_value): Remove.
9265 (Arm_relocate_functions::arm_branch_common,
9266 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9267 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9268 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9269 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9270 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9271 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9272 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9273 Arm_relocate_functions::thm_mobw_abs_nc,
9274 Arm_relocate_functions::thm_mov_abs,
9275 Arm_relocate_functions::movw_prel_nc,
9276 Arm_relocate_functions::thm_movt_abs,
9277 Arm_relocate_functions::movt_prel,
9278 Arm_relocate_functions::thm_movw_prel_nc,
9279 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9280 (Target_arm::Relocate::relocate): Only decompose address into two
9281 parts if relocation type uses the thumb-bit and pass the actual
9282 bit instead of a flag indicating that the thumb-bit is used. Adjust
9283 calls to methods in Arm_relocate_functions for this change.
9284
9285 2009-11-08 Ian Lance Taylor <iant@google.com>
9286
9287 PR 10925
9288 * reloc.cc: Instantiate
9289 Sized_relobj::initialize_input_to_output_maps and
9290 Sized_relobj:free_input_to_output_maps.
9291
9292 2009-11-06 Ian Lance Taylor <iant@google.com>
9293
9294 PR 10876
9295 * defstd.cc (in_segment): Set only_if_ref true for "end".
9296
9297 2009-11-06 Doug Kwan <dougkwan@google.com>
9298
9299 * arm.cc (class Reloc_stub): Correct a comment.
9300 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9301 (Target_arm::scan_section_for_stubs): New method declaration.
9302 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9303 Change methods from private to protected.
9304 (Target_arm::do_may_relax): New method definition.
9305 (Target_arm::do_relax, Target_arm::group_sections,
9306 Target_arm::scan_reloc_for_stub,
9307 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9308 (Target_arm::arm_input_section_map_): New data member declaration.
9309 (Target_arm::scan_reloc_for_stub,
9310 Target_arm::scan_reloc_section_for_stubs,
9311 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9312 Target_arm::do_relax): New method definitions.
9313
9314 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9315
9316 * configure.ac: Check for (struct stat)::st_mtim
9317 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9318 * config.in: Regenerate.
9319 * configure: Regenerate.
9320
9321 2009-11-05 Ian Lance Taylor <iant@google.com>
9322
9323 PR 10910
9324 * output.cc (Output_segment::add_output_section): Add missing
9325 return statement.
9326
9327 2009-11-04 Ian Lance Taylor <iant@google.com>
9328
9329 PR 10880
9330 * object.h (class Object): Add is_needed and set_is_needed
9331 methods. Add is_needed_ field. Make bool fields into bitfields.
9332 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9333 defined in a dynamic object and referenced by a regular object,
9334 set is_needed for the dynamic object.
9335 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9336 if the file is marked with as_needed and it is not needed.
9337
9338 2009-11-04 Ian Lance Taylor <iant@google.com>
9339
9340 PR 10887
9341 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9342 tags if data is discarded by linker script.
9343 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9344 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9345 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9346 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9347
9348 2009-11-04 Ian Lance Taylor <iant@google.com>
9349
9350 * layout.cc (Layout::get_output_section): Add is_interp and
9351 is_dynamic_linker_section parameters. Change all callers.
9352 (Layout::choose_output_section): Likewise.
9353 (Layout::make_output_section): Likewise.
9354 (Layout::add_output_section_data): Add is_dynamic_linker_section
9355 parameter. Change all callers.
9356 * layout.h (class Layout): Update declarations.
9357 * output.h (class Output_section): Add is_interp, set_is_interp,
9358 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9359 Add is_interp_, is_dynamic_linker_section_ fields. Change
9360 generate_code_fills_at_write_ to a bitfield.
9361 * output.cc (Output_section::Output_sections): Initialize new
9362 fields.
9363 (Output_segment::add_output_section): Add do_sort parameter.
9364 Change all callers.
9365
9366 2009-11-03 Ian Lance Taylor <iant@google.com>
9367
9368 PR 10860
9369 * options.h (class General_options): Add --warn-common.
9370 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9371 merging two common symbols.
9372 (Symbol_table::should_override): Handle --warn-common when merging
9373 a common symbol with a defined symbol. Use report_resolve_problem
9374 for multiple definitions.
9375 (Symbol_table::report_resolve_problem): New function.
9376 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9377
9378 2009-11-03 Doug Kwan <dougkwan@google.com>
9379
9380 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9381 stub_factory_.
9382 (Target_arm::stub_factory): New method definition.
9383 (Target_arm::new_arm_input_section,
9384 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9385 Target_arm::reloc_uses_thumb_bit): New method declarations.
9386 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
9387 New type definitions.
9388 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9389 member declarations.
9390 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9391 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9392 New method definitions.
9393
9394 2009-11-03 Ian Lance Taylor <iant@google.com>
9395
9396 * options.h (class General_options): Add --warn_constructors.
9397
9398 2009-11-03 Ian Lance Taylor <iant@google.com>
9399
9400 PR 10893
9401 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9402 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9403
9404 2009-11-03 Ian Lance Taylor <iant@google.com>
9405
9406 PR 10895
9407 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9408 --msgid-bugs-address.
9409 (install-pdf): New target.
9410 (install-data_yes): Look up one directory to find mkinstalldirs.
9411
9412 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9413
9414 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9415 tree.
9416
9417 2009-10-30 Doug Kwan <dougkwan@google.com>
9418
9419 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9420
9421 2009-10-30 Doug Kwan <dougkwan@google.com>
9422
9423 * arm.cc (Stub_addend_reader): New struct template definition
9424 and partial specializations.
9425 (Stub_addend_reader::operator()): New method definition for a
9426 partially specialized template.
9427
9428 2009-10-30 Doug Kwan <dougkwan@google.com>
9429
9430 * arm.cc (Arm_relobj::processor_specific_flags): New method
9431 definition.
9432 (Arm_relobj::do_read_symbols): New method declaration.
9433 (Arm_relobj::processor_specific_flags_): New data member declaration.
9434 (Arm_dynobj): New class definition.
9435 (Target_arm::do_finalize_sections): Add input_objects parameter.
9436 (Target_arm::do_adjust_elf_header): New method declaration.
9437 (Target_arm::are_eabi_versions_compatible,
9438 (Target_arm::merge_processor_specific_flags): New method declaration.
9439 (Target_arm::do_make_elf_object): New overloaded method definitions
9440 and declaration.
9441 (Arm_relobj::do_read_symbols): New method definition.
9442 (Arm_dynobj::do_read_symbols): Ditto.
9443 (Target_arm::do_finalize_sections): Add input_objects parameters.
9444 Merge processor-specific flags from all input objects.
9445 (Target_arm::are_eabi_versions_compatible,
9446 Target_arm::merge_processor_specific_flags,
9447 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9448 New method definitions.
9449 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9450 Input_objects pointer type parameter.
9451 * layout.cc (Layout::finalize): Pass input objects to target's.
9452 finalize_sections function.
9453 * output.cc (Output_file_header::do_sized_write): Set ELF file
9454 header's processor-specific flags.
9455 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9456 Input_objects pointer type parameter.
9457 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9458 * target.h (Input_objects): New forward class declaration.
9459 (Target::processor_specific_flags,
9460 Target::are_processor_specific_flags_sect): New method definitions.
9461 (Target::finalize_sections): Add input_objects parameter.
9462 (Target::Target): Initialize processor_specific_flags_ and
9463 are_processor_specific_flags_set_.
9464 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9465 parameter.
9466 (Target::set_processor_specific_flags): New method definition.
9467 (Target::processor_specific_flags_,
9468 Target::are_processor_specific_flags_set_): New data member
9469 declarations.
9470 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9471 Input_objects pointer type parameter.
9472
9473 2009-10-30 Doug Kwan <dougkwan@google.com>
9474
9475 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9476
9477 2009-10-28 Ian Lance Taylor <iant@google.com>
9478
9479 * object.h (class Relobj): Drop options parameter from
9480 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9481 do_scan_relocs, do_relocate. Change all callers.
9482 (class Sized_relobj): Drop options parameters from
9483 do_gc_process_relocs, do_scan_relocs, do_relocate,
9484 do_relocate_sections, relocate_sections, emit_relocs_scan,
9485 emit_relocs_scan_reltype. Change all callers.
9486 (struct Relocate_info): Remove options field and all references to
9487 it.
9488 * reloc.h (class Read_relocs): Remove options constructor
9489 parameter and options_ field. Change all callers.
9490 (class Gc_process_relocs, class Scan_relocs): Likewise.
9491 (class Relocate_task): Likewise.
9492 * target-reloc.h (scan_relocs): Remove options parameter. Change
9493 all callers.
9494 (scan_relocatable_relocs): Likewise.
9495 * target.h (class Sized_target): Remove options parameter from
9496 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9497 all callers.
9498 * gc.h (gc_process_relocs): Remove options parameter. Change all
9499 callers.
9500 * arm.cc: Update functions to remove options parameters.
9501 * i386.cc: Likewise.
9502 * powerpc.cc: Likewise.
9503 * sparc.cc: Likewise.
9504 * x86_64.cc: Likewise.
9505 * testsuite/testfile.cc: Likewise.
9506
9507 2009-10-28 Doug Kwan <dougkwan@google.com>
9508
9509 * arm.cc (Arm_relobj): New class definition.
9510 (Arm_relobj::scan_sections_for_stubs,
9511 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9512 New method definitions.
9513
9514 2009-10-28 Cary Coutant <ccoutant@google.com>
9515
9516 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9517 (Plugin::cleanup_done_): New member.
9518 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9519 (Plugin_manager::cleanup_done_): Remove.
9520 (Plugin_manager::add_input_file): Edit error message.
9521 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9522 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9523
9524 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9525
9526 * fileread.cc: (File_read::View::~View): Use the new
9527 data_ownership_ filed.
9528 (File_read::~File_read): Dispose the new whole_file_view_.
9529 (File_read::open): Mmap the whole file if needed.
9530 (File_read::open): Use whole_file_view_ instead of contents_.
9531 (File_read::find_view): Use whole_file_view_ if applicable.
9532 (File_read::do_read): Use whole_file_view_ instead of contents_.
9533 (File_read::make_view): Use whole_file_view_ instead of contents_,
9534 update File_read::View::View call.
9535 (File_read::find_or_make_view): Update File_read::View::View
9536 call.
9537 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9538 remove contents_
9539 (File_read::View::Data_ownership): New enum.
9540 (File_read::View::View): Replace bool mapped_ with Data_ownership
9541 argument.
9542 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9543 (File_read::View::data_ownership_): New field.
9544 (File_read::contents_): Remove (replaced by whole_file_view_).
9545 (File_read::whole_file_view_): New field.
9546 * options.h (class General_options): Add --keep-files-mapped.
9547
9548 2009-10-27 Cary Coutant <ccoutant@google.com>
9549
9550 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9551 * testsuite/Makefile.am (plugin_test_5): New test case.
9552 * testsuite/Makefile.in: Regenerate.
9553
9554 2009-10-25 Doug Kwan <dougkwan@google.com>
9555
9556 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9557 from private to protected to allow access by child class.
9558 (Sized_relobj::do_relocate_sections): New method declaration.
9559 (Sized_relobj::relocate_sections): Virtualize.
9560 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
9561 Sized_relobj::relocate_sections. Instantiate template explicitly
9562 for different target sizes and endianity.
9563
9564 2009-10-24 Doug Kwan <dougkwan@google.com>
9565
9566 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9567 (Arm_input_section::as_arm_input_section): New method.
9568 (Arm_output_section): New class definition.
9569 (Arm_output_section::create_stub_group,
9570 Arm_output_section::group_sections): New method definitions.
9571
9572 2009-10-22 Doug Kwan <dougkwan@google.com>
9573
9574 * arm.cc (Arm_input_section): New class definition.
9575 (Arm_input_section::init, Arm_input_section:do_write,
9576 Arm_input_section::set_final_data_size,
9577 Arm_input_section::do_reset_address_and_file_offset): New method
9578 definitions.
9579
9580 2009-10-21 Doug Kwan <dougkwan@google.com>
9581
9582 * arm.cc (Stub_table, Arm_input_section): New forward class
9583 declarations.
9584 (Stub_table): New class defintion.
9585 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9586 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9587 New method definition.
9588
9589 2009-10-21 Doug Kwan <dougkwan@google.com>
9590
9591 * arm.cc: Update copyright comments.
9592 (Target_arm): New forward class template declaration.
9593 (Arm_address): New type.
9594 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9595 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9596 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9597 constants.
9598 (Insn_template): Same.
9599 (DEF_STUBS): New macro.
9600 (Stub_type): New enum type.
9601 (Stub_template): New class definition.
9602 (Stub): Same.
9603 (Reloc_stub): Same.
9604 (Stub_factory): Same.
9605 (Target_arm::Target_arm): Initialize may_use_blx_ and
9606 should_force_pic_veneer_.
9607 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9608 Target_arm::should_force_pic_veneer,
9609 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9610 Target_arm::using_thumb_only, Target_arm:;default_target): New
9611 method defintions.
9612 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9613 New data member declarations.
9614 (Insn_template::size, Insn_template::alignment): New method defintions.
9615 (Stub_template::Stub_template): New method definition.
9616 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9617 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9618 (Stub_factory::Stub_factory): New method definition.
9619 * gold.h (string_hash): New template.
9620 * output.h (Input_section_specifier::hash_value): Use
9621 gold::string_hash.
9622 (Input_section_specifier::string_hash): Remove.
9623 * stringpool.cc (Stringpool_template::string_hash): Use
9624 gold::string_hash.
9625
9626 2009-10-20 Doug Kwan <dougkwan@google.com>
9627
9628 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9629 symbols of relaxed input sections.
9630 * output.h (Output_section::find_relaxed_input_section): Make
9631 method public.
9632
9633 2009-10-16 Doug Kwan <dougkwan@google.com>
9634
9635 * dynobj.cc (Versions::Versions): Initialize version_script_.
9636 Only insert base version symbol definition for a shared object
9637 if version script defines any version versions.
9638 (Versions::define_base_version): New method definition.
9639 (Versions::add_def): Check that base version is not needed.
9640 (Versions::add_need): Define base version lazily.
9641 * dynobj.h (Versions::define_base_version): New method declaration.
9642 (Versions::needs_base_version_): New data member declaration.
9643 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9644 (check_DATA): Add no_version_test.stdout.
9645 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9646 New make rules.
9647 * testsuite/Makefile.in: Regenerate.
9648 * testsuite/no_version_test.c: New file.
9649 * testsuite/no_version_test.sh: Ditto.
9650
9651 2009-10-16 Doug Kwan <dougkwan@google.com>
9652
9653 * expression.cc (class Segment_start_expression): New class definition.
9654 (Segment_start_expression::value): New method definition.
9655 (script_exp_function_segment_start): Return a new
9656 Segment_start_expression.
9657 * gold/script-c.h (script_saw_segment_start_expression): New function
9658 prototype.
9659 * script-sections.cc (Script_sections::Script_sections): Initialize
9660 SAW_SEGMENT_START_EXPRESSION_ to false.
9661 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9662 and -Tbbs options to specify section addresses if given in
9663 command line and no SEGMENT_START expression is seen in a script.
9664 * script-sections.h (Script_sections::saw_segment_start_expression,
9665 Script_sections::set_saw_segment_start_expression): New method
9666 definition.
9667 (Script_sections::saw_segment_start_expression_): New data member
9668 declaration.
9669 * script.cc (script_saw_segment_start_expression): New function.
9670 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9671 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9672 script_test_7.sh and script_test_8.sh.
9673 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9674 script_test_8.stdout.
9675 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9676 (script_test_6, script_test_6.stdout, script_test_7,
9677 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9678 * Makefile.in: Regenerate.
9679 * testsuite/script_test_6.sh: New file.
9680 * testsuite/script_test_6.t: Same.
9681 * testsuite/script_test_7.sh: Same.
9682 * testsuite/script_test_7.t: Same.
9683 * testsuite/script_test_8.sh: Same.
9684
9685 2009-10-16 Doug Kwan <dougkwan@google.com>
9686
9687 * output.cc (Output_segment::set_section_list_address): Cast
9688 expressions to unsigned long long type to avoid format warnings.
9689
9690 2009-10-15 Ian Lance Taylor <iant@google.com>
9691
9692 * script.cc (Script_options::add_symbol_assignment): Always add a
9693 dot assignment to script_sections_.
9694 * script-sections.cc (Script_sections::add_dot_assignment):
9695 Initialize if necessary.
9696
9697 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9698 program headers with no load segment if there is a linker script.
9699
9700 * layout.cc (Layout::set_segment_offsets): Align the file offset
9701 to the segment aligment for -N or -n with no load segment.
9702 * output.cc (Output_segment::add_output_section): Don't crash if
9703 the first section is a TLS section.
9704 (Output_segment::set_section_list_addresses): Print an error
9705 message if the address moves backward in a linker script.
9706 * script-sections.cc
9707 (Output_section_element_input::set_section_addresses): Don't
9708 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9709 (Orphan_output_section::set_section_addresses): Likewise.
9710
9711 2009-10-15 Doug Kwan <dougkwan@google.com>
9712
9713 * layout.cc (Layout::finish_dynamic_section): Generate tags
9714 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9715 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9716 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9717
9718 2009-10-14 Ian Lance Taylor <iant@google.com>
9719
9720 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9721 fields.
9722 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9723 data_shdr fields of relinfo.
9724 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9725 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9726 R_386_TLS_LDO_32, adjust based on section flags.
9727 (Target_i386::Relocate::fix_up_ldo): Remove.
9728
9729 2009-10-13 Ian Lance Taylor <iant@google.com>
9730
9731 Add support for -pie.
9732 * options.h (class General_options): Add -pie and
9733 --pic-executable.
9734 (General_options::output_is_position_independent): Test -pie.
9735 (General_options::output_is_executable): Return true if not shared
9736 and not relocatable.
9737 (General_options::output_is_pie): Remove.
9738 * options.cc (General_options::finalize): Reject incompatible uses
9739 of -pie.
9740 * gold.cc (queue_middle_tasks): A -pie link is not static.
9741 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9742 * symtab.cc (Symbol::final_value_is_known): Return false if
9743 output_is_position_independent.
9744 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9745 output_is_position_independent.
9746 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9747 output_is_position_independent.
9748 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9749 output_is_position_independent.
9750 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9751 two_file_pie_test.
9752 (basic_pie_test.o, basic_pie_test): New targets.
9753 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9754 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9755 (two_file_pie_test): New target.
9756 * testsuite/Makefile.in: Rebuild.
9757 * README: Remove note saying that -pie is not supported.
9758
9759 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9760
9761 * options.h (class General_options): Add -init and -fini.
9762 * layout.cc (Layout::finish_dynamic_section): Emit
9763 given init and fini functions.
9764
9765 2009-10-13 Sriraman Tallam <tmsriram@google.com>
9766
9767 * gc.h (gc_process_relocs): Check if icf is enabled using new
9768 function.
9769 * gold.cc (queue_initial_tasks): Likewise.
9770 (queue_middle_tasks): Likewise.
9771 * object.cc (do_layout): Likewise.
9772 * symtab.cc (is_section_folded): Likewise.
9773 * main.cc (main): Likewise.
9774 * reloc.cc (Read_relocs::run): Likewise.
9775 (Sized_relobj::do_scan_relocs): Likewise.
9776 * icf.cc (is_function_ctor_or_dtor): New function.
9777 (Icf::find_identical_sections): Check if function is ctor or dtor when
9778 safe icf is chosen.
9779 * options.h (General_options::icf): Change option to be an enum.
9780 (Icf_status): New enum.
9781 (icf_enabled): New method.
9782 (icf_safe_folding): New method.
9783 (set_icf_status): New method.
9784 (icf_status_): New variable.
9785 * (options.cc) (General_options::finalize): Set icf_status_.
9786 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9787 icf_test and icf_keep_unique_test to use the --icf enum flag.
9788 * testsuite/icf_safe_test.sh: New file.
9789 * testsuite/icf_safe_test.cc: New file.
9790
9791 2009-10-12 Sriraman Tallam <tmsriram@google.com>
9792
9793 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9794 includes to gc.h and icf.h.
9795 * arm.cc: Include gc.h.
9796 * gold.cc: Likewise.
9797 * i386.cc: Likewise.
9798 * powerpc.cc: Likewise.
9799 * sparc.cc: Likewise.
9800 * x86_64.cc: Likewise.
9801 * gc.h: Include icf.h.
9802
9803 2009-10-11 Ian Lance Taylor <iant@google.com>
9804
9805 * plugin.cc: Include "gold.h" before other header files.
9806
9807 2009-10-10 Chris Demetriou <cgd@google.com>
9808
9809 * options.h (Input_file_argument::Input_file_type): New enum.
9810 (Input_file_argument::is_lib_): Replace with...
9811 (Input_file_argument::type_): New member.
9812 (Input_file_argument::Input_file_argument): Take Input_file_type
9813 'type' rather than boolean 'is_lib' as second argument.
9814 (Input_file_argument::is_lib): Use type_.
9815 (Input_file_argument::is_searched_file): New function.
9816 (Input_file_argument::may_need_search): Handle is_searched_file.
9817 * options.cc (General_options::parse_library): Support -l:filename.
9818 (General_options::parse_just_symbols): Update for Input_file_argument
9819 changes.
9820 (Command_line::process): Likewise.
9821 * archive.cc (Archive::get_file_and_offset): Likewise.
9822 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9823 * script.cc (read_script_file, script_add_file): Likewise.
9824 * fileread.cc (Input_file::Input_file): Likewise.
9825 (Input_file::will_search_for): Handle is_searched_file.
9826 (Input_file::open): Likewise.
9827 * readsyms.cc (Read_symbols::get_name): Likewise.
9828 * testsuite/Makefile.am (searched_file_test): New test.
9829 * testsuite/Makefile.in: Regenerate.
9830 * testsuite/searched_file_test.cc: New file.
9831 * testsuite/searched_file_test_lib.cc: New file.
9832
9833 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9834 Ian Lance Taylor <iant@google.com>
9835
9836 * descriptor.cc: Include <cstdio> and "binary-io.h".
9837 (Descriptors::open): Open the files in binary mode always.
9838 * script.cc (Lex::get_token): Treat \r as whitespace.
9839
9840 2009-10-09 Ian Lance Taylor <iant@google.com>
9841
9842 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9843
9844 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9845 Ian Lance Taylor <iant@google.com>
9846
9847 * configure.ac: Check for readv function also.
9848 * fileread.cc (readv): Define if not HAVE_READV.
9849 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9850 does not exist.
9851 * config.in: Regenerate.
9852 * configure: Regenerate.
9853
9854 2009-10-09 Doug Kwan <dougkwan@google.com>
9855
9856 * layout.cc (Layout::make_output_section): Call target hook to make
9857 ordinary output section.
9858 (Layout::finalize): Adjust parameter list of call the
9859 Target::may_relax().
9860 * layout.h (class Layout::section_list): New method.
9861 * merge.h (Output_merge_base::entsize): Change visibility to public.
9862 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9863 New methods.
9864 (Output_merge_string::do_is_string): New method.
9865 * object.cc (Sized_relobj::do_setup): renamed from
9866 Sized_relobj::set_up.
9867 * object.h (Sized_relobj::adjust_shndx,
9868 Sized_relobj::initializ_input_to_output_maps,
9869 Sized_relobj::free_input_to_output_maps): Change visibilities to
9870 protected.
9871 (Sized_relobj::setup): Virtualize.
9872 (Sized_relobj::do_setup): New method declaration.
9873 (Sized_relobj::invalidate_section_offset,
9874 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9875 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9876 * options.cc (parse_int): New function.
9877 * options.h (parse_int): New declaration.
9878 (DEFINE_int): New macro.
9879 (stub_group_size): New option.
9880 * output.cc (Output_section::Output_section): Initialize memebers
9881 merge_section_map_, merge_section_by_properties_map_,
9882 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9883 (Output_section::add_input_section): Handled deferred code-fill
9884 generation and remove an old comment.
9885 (Output_section::add_relaxed_input_section): New method definition.
9886 (Output_section::add_merge_input_section): Use merge section by
9887 properties map to speed to search. Update merge section maps
9888 as appropriate.
9889 (Output_section::build_relaxation_map): New method definition.
9890 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9891 Same.
9892 (Output_section::relax_input_section): Renamed to
9893 Output_section::convert_input_sections_to_relaxed_sections and change
9894 interface to take a vector of pointers to relaxed sections.
9895 (Output_section::find_merge_section,
9896 Output_section::find_relaxed_input_section): New method definitions.
9897 (Output_section::is_input_address_mapped,
9898 Output_section::output_offset, Output_section::output_address):
9899 Use output section data maps to speed up searching.
9900 (Output_section::find_starting_output_address): Add comments.
9901 (Output_section::do_write,
9902 Output_section::write_to_postprocessing_buffer): Do code-fill
9903 generation as appropriate.
9904 (Output_section::get_input_sections): Invalidate relaxed input section
9905 map.
9906 (Output_section::restore_states): Adjust type of checkpoint .
9907 Invalidate relaxed input section map.
9908 * output.h (Output_merge_base): New class declaration.
9909 (Input_section_specifier): New class defintion.
9910 (class Output_relaxed_input_section) Change base class to
9911 Output_section_data_build.
9912 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9913 base class initializer.
9914 (Output_section::add_relaxed_input_section): New method declaration.
9915 (Output_section::Input_section): Change visibility to protected.
9916 (Output_section::Input_section::relobj,
9917 Output_section::Input_section::shndx): Handle relaxed input sections.
9918 Output_section::input_sections) Change visibility to protected. Also
9919 define overload to return a non-const pointer.
9920 (Output_section::Merge_section_properties): New class defintion.
9921 (Output_section::Merge_section_by_properties_map,
9922 Output_section::Output_section_data_by_input_section_map,
9923 Output_section::Relaxation_map): New types.
9924 (Output_section::relax_input_section): Rename method to
9925 Output_section::convert_input_sections_to_relaxed_sections and change
9926 interface to take a vector of relaxed section pointers.
9927 (Output_section::find_merge_section,
9928 Output_section::find_relaxed_input_section,
9929 Output_section::build_relaxation_map,
9930 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9931 New method declarations.
9932 (Output_section::merge_section_map_
9933 Output_section::merge_section_by_properties_map_,
9934 Output_section::relaxed_input_section_map_,
9935 Output_section::is_relaxed_input_section_map_valid_,
9936 Output_section::generate_code_fills_at_write_): New data members.
9937 * script-sections.cc
9938 (Output_section_element_input::set_section_addresses): Call
9939 current_data_size and addralign methods of relaxed input sections.
9940 (Orphan_output_section::set_section_addresses): Call current_data_size
9941 and addralign methods of relaxed input sections.
9942 * symtab.cc (Symbol_table::compute_final_value): Extract template
9943 from the body of Symbol_table::sized_finalize_symbol.
9944 (Symbol_table::sized_finalized_symbol): Call
9945 Symbol_table::compute_final_value.
9946 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9947 (Symbol_table::compute_final_value): New templated method declaration.
9948 * target.cc (Target::do_make_output_section): New method defintion.
9949 * target.h (Target::make_output_section): New method declaration.
9950 (Target::relax): Add more parameters for input objects, symbol table
9951 and layout. Adjust call to do_relax.
9952 (Target::do_make_output_section): New method declaration.
9953 (Target::do_relax): Add parameters for input objects, symbol table
9954 and layout.
9955
9956 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9957
9958 * pread.c: Include stdio.h.
9959
9960 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9961
9962 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9963 defined.
9964
9965 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9966
9967 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9968 Change read_shndx type to unsigned int.
9969 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9970 int.
9971 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9972 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9973 Change read_shndx type to unsigned int.
9974 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9975 int.
9976 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9977 * layout.cc (Layout::create_symtab_sections): Cast the result of
9978 local_symcount * symsize to off_t in the gold_assert.
9979
9980 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9981
9982 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9983 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9984 R_ARM_BASE_ABS.
9985 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9986 (Arm_relocate_functions::thm_abs5): New function.
9987 (Arm_relocate_functions::abs12): New function.
9988 (Arm_relocate_functions::abs16): New function.
9989 (Arm_relocate_functions::base_abs): New function.
9990 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9991 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9992 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9993 R_ARM_BASE_ABS.
9994 (Scan::global): Likewise.
9995 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9996 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9997 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9998 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9999 R_ARM_BASE_ABS.
10000
10001 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10002
10003 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10004 (Arm_relocate_functions::movt_prel): New function.
10005 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10006 (Arm_relocate_functions::thm_movt_prel): New function.
10007 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10008 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10009 (Scan::global, Relocate::relocate): Likewise.
10010 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10011
10012 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10013
10014 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10015 Incremental_checker.
10016 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10017 unsigned int.
10018 (class Incremental_inputs_header): New class.
10019 (Incremental_inputs_header_writer): Edit comment.
10020 (Incremental_inputs_entry): New class.
10021 (Incremental_inputs_entry_writer): Edit comment.
10022 (Sized_incremental_binary::do_find_incremental_inputs_section):
10023 Add *strtab_shndx parameter, fill it.
10024 (Sized_incremental_binary::do_check_inputs): New method.
10025 (Incremental_checker::can_incrementally_link_output_file): Use
10026 Sized_incremental_binary::check_inputs.
10027 (Incremental_inputs::report_command_line): Save command line in
10028 command_line_.
10029 * incremental.h:
10030 (Incremental_binary::find_incremental_inputs_section): New
10031 method.
10032 (Incremental_binary::do_find_incremental_inputs_section): Add
10033 strtab_shndx parameter.
10034 (Incremental_binary::do_check_inputs): New pure virtual method.
10035 (Sized_incremental_binary::do_check_inputs): Declare.
10036 (Incremental_checker::Incremental_checker): Add incremental_inputs
10037 parameter, use it to initialize incremental_inputs_.
10038 (Incremental_checker::incremental_inputs_): New field.
10039 (Incremental_checker::command_line): New method.
10040 (Incremental_checker::inputs): New method.
10041 (Incremental_checker::command_line_): New field.
10042
10043 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10044
10045 * incremental.cc: Include <cstdarg> and "target-select.h".
10046 (vexplain_no_incremental): New function.
10047 (explain_no_incremental): New function.
10048 (Incremental_binary::error): New method.
10049 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10050 method.
10051 (make_sized_incremental_binary): New function.
10052 (open_incremental_binary): New function.
10053 (can_incrementally_link_file): Add checks if output is ELF and has
10054 inputs section.
10055 * incremental.h: Include "elfcpp_file.h" and "output.h".
10056 (Incremental_binary): New class.
10057 (Sized_incremental_binary): New class.
10058 (open_incremental_binary): Declare.
10059 * object.cc (is_elf_object): Use
10060 elfcpp::Elf_recognizer::is_elf_file.
10061 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10062 * output.h (Output_file::filesize): New method.
10063
10064 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10065
10066 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10067 New function.
10068 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10069 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10070 function.
10071 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10072 function.
10073 (Arm_relocate_functions::movw_abs_nc): New function.
10074 (Arm_relocate_functions::movt_abs): New function.
10075 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10076 (Arm_relocate_functions::thm_movt_abs): New function.
10077 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10078 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10079 (Scan::global): Likewise.
10080 (Relocate::relocate): Likewise.
10081 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10082
10083 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10084
10085 * arm.cc (Arm_relocate_functions::got_prel) New function.
10086 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10087 (Relocate::relocate): Likewise.
10088 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10089
10090 2009-10-06 Ian Lance Taylor <iant@google.com>
10091
10092 * options.h (class General_options): Define
10093 split_stack_adjust_size parameter.
10094 * object.h (class Object): Add uses_split_stack_ and
10095 has_no_split_stack_ fields. Add uses_split_stack and
10096 has_no_split_stack accessor functions. Declare
10097 handle_split_stack_section.
10098 (class Reloc_symbol_changes): Define.
10099 (class Sized_relobj): Define Function_offsets. Declare
10100 split_stack_adjust, split_stack_adjust_reltype, and
10101 find_functions.
10102 * object.cc (Object::handle_split_stack_section): New function.
10103 (Sized_relobj::do_layout): Call handle_split_stack_section.
10104 * dynobj.cc (Sized_dynobj::do_layout): Call
10105 handle_split_stack_section.
10106 * reloc.cc (Sized_relobj::relocate_sections): Call
10107 split_stack_adjust for executable sections in split_stack
10108 objects. Pass reloc_map to relocate_section.
10109 (Sized_relobj::split_stack_adjust): New function.
10110 (Sized_relobj::split_stack_adjust_reltype): New function.
10111 (Sized_relobj::find_functions): New function.
10112 * target-reloc.h: Include "object.h".
10113 (relocate_section): Add reloc_symbol_changes parameter. Change
10114 all callers.
10115 * target.h (class Target): Add calls_non_split method. Declare
10116 do_calls_non_split virtual method. Declare match_view and
10117 set_view_to_nop.
10118 * target.cc: Include "elfcpp.h".
10119 (Target::do_calls_non_split): New function.
10120 (Target::match_view): New function.
10121 (Target::set_view_to_nop): New function.
10122 * gold.cc (queue_middle_tasks): Give an error if mixing
10123 split-stack and non-split-stack objects with -r.
10124 * i386.cc (Target_i386::relocate_section): Add
10125 reloc_symbol_changes parameter.
10126 (Target_i386::do_calls_non_split): New function.
10127 * x86_64.cc (Target_x86_64::relocate_section): Add
10128 reloc_symbol_changes parameter.
10129 (Target_x86_64::do_calls_non_split): New function.
10130 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10131 parameter.
10132 * powerpc.cc (Target_powerpc::relocate_section): Add
10133 reloc_symbol_changes parameter.
10134 * sparc.cc (Target_sparc::relocate_section): Add
10135 reloc_symbol_changes parameter.
10136 * configure.ac: Call AM_CONDITIONAL for the default target.
10137 * configure: Rebuild.
10138 * testsuite/Makefile.am (TEST_AS): New variable.
10139 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10140 (check_DATA): Add split_i386 and split_x86_64 files.
10141 (SPLIT_DEFSYMS): Define.
10142 (split_i386_[1234n].o): New targets.
10143 (split_i386_[124]): New targets.
10144 (split_i386_[1234r].stdout): New targets.
10145 (split_x86_64_[1234n].o): New targets.
10146 (split_x86_64_[124]): New targets.
10147 (split_x86_64_[1234r].stdout): New targets.
10148 (MOSTLYCLEANFILES): Add new executables.
10149 * testsuite/split_i386.sh: New file.
10150 * testsuite/split_x86_64.sh: New file.
10151 * testsuite/split_i386_1.s: New file.
10152 * testsuite/split_i386_2.s: New file.
10153 * testsuite/split_i386_3.s: New file.
10154 * testsuite/split_i386_4.s: New file.
10155 * testsuite/split_i386_n.s: New file.
10156 * testsuite/split_x86_64_1.s: New file.
10157 * testsuite/split_x86_64_2.s: New file.
10158 * testsuite/split_x86_64_3.s: New file.
10159 * testsuite/split_x86_64_4.s: New file.
10160 * testsuite/split_x86_64_n.s: New file.
10161 * testsuite/testfile.cc (Target_test): Update relocation_section
10162 function.
10163 * testsuite/Makefile.in: Rebuild.
10164
10165 2009-10-06 Ian Lance Taylor <iant@google.com>
10166
10167 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10168 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10169 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10170 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10171 the address on ldo_addrs_.
10172 (Target_i386::Relocate::fix_up_ldo): New function.
10173
10174 2009-10-06 Rafael Espindola <espindola@google.com>
10175
10176 * plugin.cc (add_input_library): New.
10177 (Plugin::load): Add add_input_library to tv.
10178 (Plugin_manager::add_input_file): Add the is_lib argument.
10179 (add_input_file): Update call to Plugin_manager::add_input_file.
10180 (add_input_library): New.
10181 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10182
10183 2009-09-30 Doug Kwan <dougkwan@google.com>
10184
10185 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10186 symbol and call Symbol::may_need_copy_reloc to determine if
10187 a copy reloc is needed.
10188 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10189 nocopyreloc is given in command line.
10190 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10191 given in command line.
10192 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10193 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10194 of the removed Target_i386::may_need_copy_reloc.
10195 * options.h (copyreloc): New option with default value false.
10196 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10197 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10198 instead of the removed Target_powerpc::may_need_copy_reloc.
10199 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10200 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10201 instead of the removed Target_sparc::may_need_copy_reloc.
10202 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10203 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10204 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10205 instead of the removed Target_x86_64::may_need_copy_reloc.
10206
10207 2009-09-30 Ian Lance Taylor <iant@google.com>
10208
10209 * object.h (class Object): Remove target_ field, and target,
10210 sized_target, and set_target methods.
10211 (Object::sized_target): Remove.
10212 (class Sized_relobj): Update declarations. Remove sized_target.
10213 * object.cc (Sized_relobj::setup): Remove target parameter.
10214 Change all callers.
10215 (Input_objects::add_object): Don't do anything with the target.
10216 (make_elf_sized_object): Add punconfigured parameter. Change all
10217 callers. Set or test parameter target.
10218 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10219 Change all callers.
10220 * parameters.cc (Parameters::set_target): Change parameter type to
10221 be non-const.
10222 (Parameters::default_target): Remove.
10223 (set_parameters_target): Change parameter type to be non-const.
10224 (parameters_force_valid_target): New function.
10225 (parameters_clear_target): New function.
10226 * parameters.h (class Parameters): Update declarations. Remove
10227 default_target method. Add sized_target and clear_target
10228 methods. Change target_ to be non-const.
10229 (set_parameters_target): Update declaration.
10230 (parameters_force_valid_target): Declare.
10231 (parameters_clear_target): Declare.
10232 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10233 as NULL if we aren't searching.
10234 (Add_symbols::run): Don't check for compatible target.
10235 * fileread.cc (Input_file::open_binary): Call
10236 parameters_force_valid_target.
10237 * gold.cc (queue_middle_tasks): Likewise.
10238 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10239 set_target on object.
10240 * dynobj.h (class Sized_dynobj): Update declarations.
10241 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10242 make_elf_object returns NULL.
10243 (Archive::include_member): Don't check whether object target is
10244 compatible.
10245 * output.cc (Output_section::add_input_section): Get target from
10246 parameters.
10247 (Output_section::relax_input_section): Likewise.
10248 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10249 parameters.
10250 (Sized_relobj::do_scan_relocs): Likewise.
10251 (Sized_relobj::relocate_sections): Likewise.
10252 * resolve.cc (Symbol_table::resolve): Likewise.
10253 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10254 parameter. Change all callers.
10255 (Symbol_table::add_from_object): Get target from parameters.
10256 (Symbol_table::add_from_relobj): Don't check object target.
10257 (Symbol_table::add_from_dynobj): Likewise.
10258 (Symbol_table::define_special_symbol): Get target from
10259 parameters.
10260 * symtab.h (class Symbol_table): Update declaration.
10261 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10262 parameter. Change all callers. Clear parameter target.
10263 (Binary_test): Test target here.
10264 * testsuite/object_unittest.cc (gold_testsuite): Remove
10265 target_test_pointer parameter. Change all callers.
10266 (Object_test): Test target here.
10267
10268 2009-09-26 Ian Lance Taylor <iant@google.com>
10269
10270 * testsuite/initpri1.c: Don't try to use constructor priorities if
10271 compiling with gcc before 4.3.
10272
10273 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10274
10275 * testsuite/retain_symbols_file_test.sh (check_present): Change
10276 output file name to retain_symbols_file_test.stdout.
10277 (check_absent): Likewise.
10278
10279 2009-09-18 Craig Silverstein <csilvers@google.com>
10280
10281 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10282 * options.cc: Include <cerrno> and <fstream>.
10283 (General_options::finalize): Parse -retain-symbols-file tag.
10284 * options.h: New flag.
10285 (General_options): New method should_retain_symbol, new
10286 variable symbols_to_retain.
10287 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10288 should_retain_symbol map.
10289 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10290 * testsuite/Makefile.in: Regenerate.
10291 * testsuite/retain_symbols_file_test.sh: New file.
10292
10293 2009-09-18 Nick Clifton <nickc@redhat.com>
10294
10295 * po/es.po: Updated Spanish translation.
10296
10297 2009-09-17 Doug Kwan <dougkwan@google.com>
10298
10299 * debug.h (DEBUG_RELAXATION): New constant.
10300 (DEBUG_ALL): Add DEBUG_RELAXATION.
10301 (debug_string_to_enum): Add relaxation debug option.
10302 * layout.cc
10303 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10304 Layout::Relaxation_debug_check::read_sections,
10305 Layout::Relaxation_debug_check::read_sections): New method definitions.
10306 (Layout::Layout): Initialize data members
10307 record_output_section_data_from_scrips_,
10308 script_output_section_data_list_ and relaxation_debug_check_.
10309 (Layout::save_segments, Layout::restore_segments,
10310 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10311 Layout::relaxation_loop_body): New method definitions.
10312 (Layout::finalize): Support relaxation. Move section layout code to
10313 Layout::relaxation_loop_body.
10314 (Layout::set_asection_address_from_script): Move code for orphan
10315 section placement out.
10316 (Layout::place_orphan_sections_in_script): New method definition.
10317 * layout.h (Output_segment_headers, Output_file_header):
10318 New forward class declarations.
10319 (Layout::~Layout): Define.
10320 (Layout::new_output_section_data_from_script): New method definition.
10321 (Layout::place_orphan_sections_in_script): New method declaration.
10322 (Layout::Segment_states): New type declaration.
10323 (Layout::save_segments, Layout::restore_segments,
10324 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10325 Layout::relaxation_loop_body): New method declarations.
10326 (Layout::Output_section_data_list): New type declaration.
10327 (Layout::Relaxation_debug_check): New class definition.
10328 (Layout::record_output_section_data_from_script_,
10329 Layout::script_output_section_data_list_, Layout::segment_states_,
10330 Layout::relaxation_debug_check_): New data members.
10331 * output.cc: (Output_section_headers::do_size): New method definition.
10332 (Output_section_headers::Output_section_headers): Move size
10333 computation to Output_section_headers::do_size.
10334 (Output_segment_headers::do_size): New method definition.
10335 (Output_file_header::Output_file_header): Move size computation to
10336 Output_file_header::do_size and call it.
10337 (Output_file_header::do_size): New method definition.
10338 (Output_data_group::Output_data_group): Adjust call to
10339 Output_section_data.
10340 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10341 (Output_symtab_xindex::do_write): Add array bound check.
10342 (Output_section::Input_section::print_to_mapfile): Handle
10343 RELAXED_INPUT_SECTION_CODE.
10344 (Output_section::Output_section): Initialize data member checkpoint_.
10345 (Output_section::~Output_section): Delete checkpoint object pointed
10346 by checkpoint_.
10347 (Output_section::add_input_section): Always add an Input_section if
10348 relaxing.
10349 (Output_section::add_merge_input_section): Add assert.
10350 (Output_section::relax_input_section): New method definition.
10351 (Output_section::set_final_data_size): Set load address to zero for
10352 an unallocated section.
10353 (Output_section::do_address_and_file_offset_have_reset_values):
10354 New method definition.
10355 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10356 Handle relaxed input section.
10357 (Output_section::sort_attached_input_sections): Checkpoint input
10358 section list lazily.
10359 (Output_section::get_input_sections): Change type of input_sections to
10360 list of Simple_input_section pointers. Checkpoint input section list
10361 lazily. Also handle relaxed input sections.
10362 (Output_section::add_input_section_for_script): Take a reference to
10363 a Simple_input_section object instead of Relobj pointer and section
10364 index as parameter. Handle relaxed input sections.
10365 (Output_section::save_states, Output_section::restore_states): New
10366 method definitions.
10367 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10368 (Output_data::is_data_size_fixed): New method definition.
10369 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10370 if it is fixed.
10371 (Output_data::address_and_file_offset_have_reset_values): New method
10372 definition.
10373 (Output_data::do_address_and_file_offset_have_reset_values): New method
10374 definition.
10375 (Output_data::set_data_size): Check that data size is not fixed.
10376 (Output_data::fix_data_size): New method definition.
10377 (Output_data::is_data_size_fixed_): New data member.
10378 (Output_section_headers::set_final_data_size): New method definition.
10379 (Output_section_headers::do_size): New method declaration.
10380 (Output_segment_headers::set_final_data_size): New method definition.
10381 (Output_segment_headers::do_size): New method declaration.
10382 (Output_file_header::set_final_data_size)::New method definition.
10383 (Output_file_header::do_size)::New method declaration.
10384 (Output_section_data::Output_section_data): Add new parameter
10385 is_data_size_fixed and use it to fix data size.
10386 (Output_data_const::Output_data_const): Adjust call to base class
10387 constructor and fix data size.
10388 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10389 base class constructor and fix data size.
10390 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10391 base class constructor and fix data size.
10392 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10393 class constructor and fix data size.
10394 (Output_data_group::set_final_data_size): New method definition.
10395 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10396 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10397 class constructor and fix data size.
10398 (Output_relaxed_input_section): New class definition.
10399 (Output_section::Simple_input_section): New class definition.
10400 (Output_section::get_input_sections): Adjust parameter list.
10401 (Output_section::add_input_section_for_script): Same.
10402 (Output_section::save_states, Output_section::restore_states,
10403 Output_section::do_address_and_file_offset_have_reset_values,
10404 (Output_section::Input_section::Input_section): Handle
10405 RELAXED_INPUT_SECTION_CODE. Add new overload for
10406 Output_relaxed_input_section.
10407 (Output_section::Input_section::is_input_section,
10408 Output_section::Input_section::set_output_section): Handle relaxed
10409 input section.
10410 (Output_section::Input_section::is_relaxed_input_section,
10411 Output_section::Input_section::output_section_data,
10412 Output_section::Input_section::relaxed_input_section): New method
10413 definitions.
10414 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10415 value.
10416 (Output_section::Input_section::u1_): Update comments.
10417 (Output_section::Input_section::u2_): Add new union member poris.
10418 (Output_section::Checkpoint_output_section): New classs definition.
10419 (Output_section::relax_input_section): New method declaration.
10420 (Output_section::checkpoint_): New data member.
10421 (Output_segment): Update comments.
10422 (Output_segment::Output_segment): Un-privatize copy constructor.
10423 (Output_segment::operator=): Un-privatize.
10424 * script-sections.cc (Output_section_element::Input_section_list):
10425 Change element type to Output_section::Simple_input_section.
10426 (Output_section_element_dot_assignment::set_section_addresses):
10427 Register output section data for relaxation clean up.
10428 (Output_data_exression::Output_data_expression): Adjust call to base
10429 constructor to fix data size.
10430 (Output_section_element_data::set_section_addresses): Register
10431 Output_data_expression object for relaxation clean up.
10432 (struct Input_section_info): Replace Relobj pointer and section index
10433 pair with Output_section::Simple_input_section and Convert struct to a
10434 class.
10435 (Input_section_sorter::operator()): Adjust access to
10436 Input_section_info data member to use accessors.
10437 (Output_section_element_input::set_section_addresses): Use layout
10438 parameter. Adjust code to use Output_section::Simple_input_section
10439 and Input_secction_info classes. Register filler for relaxation
10440 clean up.
10441 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10442 and section index pair with Output_section::Simple_input_section
10443 class. Adjust code accordingly.
10444 (Phdrs_element::release_segment): New method definition.
10445 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10446 segment list.
10447 (Script_sections::release_segments): New method definition.
10448 * gold/script-sections.h (Script_sections::release_segments): New
10449 method declaration.
10450 * gold/target.h (Target::may_relax, Target::relax,
10451 Target::do_may_relax, Target::do_relax): New method definitions.
10452
10453 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10454
10455 * arm.cc (has_signed_unsigned_overflow): New function.
10456 (Arm_relocate_functions::abs8): New function.
10457 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10458 (Target_arm::Scan::global): Likewise.
10459 (Target_arm::relocate::relocate): Likewise.
10460 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10461 Likewise.
10462
10463 2009-09-16 Cary Coutant <ccoutant@google.com>
10464
10465 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10466 * testsuite/Makefile.in: Regenerate.
10467
10468 2009-09-11 Nick Clifton <nickc@redhat.com>
10469
10470 * po/gold.pot: Updated by the Translation project.
10471
10472 2009-09-08 Cary Coutant <ccoutant@google.com>
10473
10474 * output.cc (Output_file::open): Add execute permission to empty file.
10475 * testsuite/Makefile.am (permission_test): New test.
10476 * testsuite/Makefile.in: Regenerate.
10477
10478 2009-09-02 Ian Lance Taylor <iant@google.com>
10479
10480 * output.cc (Output_file::resize): Call map_no_anonymous rather
10481 than map.
10482
10483 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10484
10485 * gold.cc: Include "incremental.h".
10486 (queue_initial_tasks): Call Incremental_checker methods.
10487 * incremental.cc: Include "output.h".
10488 (Incremental_checker::can_incrementally_link_output_file): New
10489 method.
10490 * incremental.h (Incremental_checker): New class.
10491
10492 * output.cc (Output_file::open_for_modification): New method.
10493 (Output_file::map_anonymous): Changed return type to bool. Record
10494 map in base_ field.
10495 (Output_file::map_no_anonymous): New method, broken out of map.
10496 (Output_file::map): Use map_no_anonymous and map_anonymous.
10497 * output.h (class Output_file): Update declarations.
10498
10499 2009-08-24 Cary Coutant <ccoutant@google.com>
10500
10501 * options.h (Command_line::Pre_options): New class.
10502 (Command_line::pre_options): New member.
10503 * options.cc (gold::options::ready_to_register): New variable.
10504 (One_option::register_option): Do nothing if not registering options.
10505 Assert if same short option registered twice.
10506 (General_options::General_options): Turn off option registration when
10507 done constructing.
10508 (Command_line::Pre_options::Pre_options): New constructor.
10509
10510 2009-08-24 Cary Coutant <ccoutant@google.com>
10511
10512 * options.h (General_options::no_keep_memory): Remove incorrect
10513 short option.
10514
10515 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10516
10517 * Makefile.am (am__skiplex, am__skipyacc): New.
10518 * Makefile.in: Regenerate.
10519
10520 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10521
10522 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10523 (INCLUDES): ... this.
10524 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10525 (AM_CPPFLAGS): Renamed from ...
10526 (INCLUDE): ... this.
10527 * Makefile.in, testsuite/Makefile.in: Regenerate.
10528
10529 * Makefile.in: Regenerate.
10530 * aclocal.m4: Likewise.
10531 * config.in: Likewise.
10532 * configure: Likewise.
10533 * testsuite/Makefile.in: Likewise.
10534
10535 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10536 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10537 * Makefile.in: Regenerate.
10538 * testsuite/Makefile.in: Regenerate.
10539
10540 2009-08-19 Cary Coutant <ccoutant@google.com>
10541
10542 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10543 symbols in shared libraries overridden by hidden or internal symbols
10544 in the main program.
10545
10546 2009-08-19 Chris Demetriou <cgd@google.com>
10547
10548 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10549 checking source file names in error messages.
10550
10551 2009-08-18 Doug Kwan <dougkwan@google.com>
10552
10553 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10554 an elcpp::Ehdr as parameter. Adjust call to set_target.
10555 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10556 an elfcpp::Ehdr as parameter.
10557 * object.cc (Object::set_target): Remove the version that looks up
10558 a target and sets it.
10559 (Sized_relobj::setup): Take a Target object instead of
10560 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10561 (make_elf_sized_object): Find target and ask target to
10562 make an ELF object.
10563 * object.h: (Object::set_target): Remove the version that looks up
10564 a target and sets it.
10565 (Sized_relobj::setup): Take a Target object instead of
10566 an elfcpp:Ehdr as parameter.
10567 * target.cc: Include dynobj.h.
10568 (Target::do_make_elf_object_implementation): New.
10569 (Target::do_make_elf_object): New.
10570 * target.h (Target::make_elf_object): New template declaration.
10571 (Target::do_make_elf_object): New method declarations.
10572 (Target::do_make_elf_object_implementation): New template declaration.
10573
10574 2009-08-14 Ian Lance Taylor <iant@google.com>
10575
10576 * gold.h (FUNCTION_NAME): Define.
10577 (gold_unreachable): Use FUNCTION_NAME.
10578
10579 2009-08-12 Sriraman Tallam <tmsriram@google.com>
10580
10581 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10582 symbol in the --keep-unique list is not found.
10583
10584 2009-08-12 Sriraman Tallam <tmsriram@google.com>
10585
10586 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10587 been maked as --keep-unique.
10588 (Icf::unfold_section): New function.
10589 * icf.h (Icf::unfold_section): New function.
10590 * options.h (General_options::keep_unique): New option.
10591 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10592 * testsuite/Makefile.in: Regenerate.
10593 * testsuite/icf_keep_unique_test.sh: New file.
10594 * testsuite/icf_keep_unique_test.cc: New file.
10595
10596 2009-08-12 Cary Coutant <ccoutant@google.com>
10597
10598 PR 10471
10599 * resolve.cc (Symbol_table::resolve): Check for references from
10600 dynamic objects to hidden and internal symbols.
10601 * testsuite/Makefile.am (hidden_test.sh): New test.
10602 * testsuite/Makefile.in: Regenerate.
10603 * testsuite/hidden_test.sh: New script.
10604 * testsuite/hidden_test_1.c: New test source.
10605 * testsuite/hidden_test_main.c: New test source.
10606
10607 2009-08-11 Doug Kwan <dougkwan@google.com>
10608
10609 * arm.cc: Update comments.
10610 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10611 segment to locate the .ARM.exidx section if present.
10612
10613 2009-08-09 Doug Kwan <dougkwan@google.com>
10614
10615 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10616 patch.
10617
10618 2009-08-07 Sriraman Tallam <tmsriram@google.com>
10619 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10620 compiler warnings.
10621
10622 2009-08-06 Sriraman Tallam <tmsriram@google.com>
10623
10624 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10625 valid tls_segment only for non-debug-section relocations.
10626 * testsuite/Makefile.am: Add gc_tls_test.
10627 * testsuite/Makefile.in: Regenerate.
10628 * testsuite/gc_tls_test.cc: New file.
10629 * testsuite/gc_tls_test.sh: New file.
10630
10631 2009-08-05 Sriraman Tallam <tmsriram@google.com>
10632
10633 * icf.cc: New file.
10634 * icf.h: New file.
10635 * Makefile.am (CCFILES): Add icf.cc.
10636 (HFILES): Add icf.h
10637 * Makefile.in: Regenerate.
10638 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10639 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10640 section, symbol and addend information for the relocs.
10641 * gold.cc (queue_middle_tasks): Call identical code folding.
10642 * gold.h: Add defines for multimap.
10643 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10644 to the call of finalize_local_symbols.
10645 * main.cc (main): Create object of class Icf.
10646 * object.cc (Sized_relobj::do_layout): Allow this function to be
10647 called twice during icf.
10648 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10649 to sections marked as identical by icf.
10650 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10651 when available.
10652 (Sized_relobj::do_section_entsize): New function.
10653 * object.h (Object::section_entsize): New function.
10654 (Object::do_section_entsize): New pure virtual function.
10655 (Relobj::finalize_local_symbols): Add new parameter.
10656 (Relobj::do_section_entsize): New function.
10657 * options.h (General_options::icf): New option.
10658 (General_options::icf_iterations): New option.
10659 (General_options::print_icf_sections): New option.
10660 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10661 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10662 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10663 icf.
10664 * symtab.cc (Symbol_table::is_section_folded): New function.
10665 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10666 to sections marked as identical by icf.
10667 * symtab.h (Symbol_table::set_icf): New function.
10668 (Symbol_table::icf): New function.
10669 (Symbol_table::is_section_folded): New function.
10670 (Symbol_table::icf_): New data member.
10671 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10672 * testsuite/Makefile.am: Add commands to build icf_test.
10673 * testsuite/Makefile.in: Regenerate.
10674 * testsuite/icf_test.sh: New file.
10675 * testsuite/icf_test.cc: New file.
10676
10677 2009-07-24 Chris Demetriou <cgd@google.com>
10678
10679 * layout.cc (is_compressible_debug_section): Fix incorrect
10680 comment about compressed section names.
10681
10682 2009-07-20 Ian Lance Taylor <ian@airs.com>
10683
10684 PR 10419
10685 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10686
10687 2009-07-16 Ian Lance Taylor <iant@google.com>
10688
10689 PR 10400
10690 * layout.h: #include <map>.
10691 (class Kept_section): Change from struct to class. Add accessors
10692 and setters. Add section size to Comdat_group mapping. Change
10693 Comdat_group to std::map. Add is_comdat_ field. Add
10694 linkonce_size field in union.
10695 (class Layout): Update declaration of find_or_add_kept_section.
10696 Don't declare find_kept_object.
10697 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10698 parameter. Add object, shndx, is_comdat, and is_group_name
10699 parameters. Change all callers. Adjust for new Kept_section.
10700 (Layout::find_kept_object): Remove.
10701 * object.cc (Sized_relobj::include_section_group): Update use of
10702 Kept_section. Rename secnum to shndx. Only record
10703 Kept_comdat_section if sections are the same size.
10704 (Sized_relobj::include_linkonce_section): Update use of
10705 Kept_section. Only record Kept_comdat_section if sections are the
10706 same size. Set size of linkonce section.
10707 (Sized_relobj::map_to_kept_section): Update call to
10708 get_kept_comdat_section.
10709 * object.h (class Sized_relobj): Rename fields in
10710 Kept_comdat_section to drop trailing underscores; change object
10711 field to Relobj*. Change Kept_comdat_section_table to store
10712 struct rather than pointer.
10713 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10714 Add kept_object and kept_shndx parameters. Change all callers.
10715 (Sized_relobj::get_kept_comdat_section): Change return type to
10716 bool. Add kept_object and kept_shndx parameters. Change all
10717 callers.
10718 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10719 Layout::find_or_add_kept_section.
10720
10721 2009-07-09 Ian Lance Taylor <iant@google.com>
10722
10723 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10724 Reserve space in the hash table.
10725
10726 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10727
10728 * fileread.cc (File_read::get_mtime): New method.
10729 * fileread.h (Timespec): New structure.
10730 (File_read::get_mtime): New method.
10731 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10732 Renamed from timestamp_nsec.
10733 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10734 Elf_Xword.
10735 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
10736 timestamp_nsec.
10737 (Incremental_inputs::report_archive): Save mtime; style fix.
10738 (Incremental_inputs::report_obejct): Save mtime; style fix.
10739 (Incremental_inputs::report_script): Save mtime; style fix.
10740 (Incremental_inputs::finalize_inputs): Style fix.
10741 (Incremental_inputs::finalize): Style fix.
10742 (Incremental_inputs::create_input_section_data): Store inputs
10743 mtime.
10744 * incremental.h (Incremental_inputs::report_script): Add mtime
10745 argument.
10746 (Incremental_inputs::Input_info::Input_info): Intialize only one
10747 union member.
10748 (Incremental_inputs::Input_info::archive): Move to nameless
10749 union.
10750 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10751 (Incremental_inputs::Input_info::script): Move to nameless union.
10752 (Incremental_inputs::mtime): New field.
10753 * script.cc (read_input_script): Pass file mtime to
10754 Incremental_input.
10755 * script.h (Script_info::inputs): Style fix.
10756
10757 2009-07-01 Ian Lance Taylor <ian@airs.com>
10758
10759 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10760 instead of 32.
10761
10762 2009-06-24 Ian Lance Taylor <iant@google.com>
10763
10764 PR 10156
10765 * layout.cc (Layout::choose_output_section): If we find an
10766 existing section, update the flags.
10767 (Layout::create_notes): New function, broken out of
10768 Layout::finalize.
10769 (Layout::finalize): Don't create note sections.
10770 (Layout::create_note): Don't crash if linker script discards
10771 section.
10772 (Layout::create_gold_note): Likewise.
10773 (Layout::create_build_id): Likewise. Don't set
10774 after_input_sections on the section.
10775 (Layout::create_executable_stack_info): Remove target parameter.
10776 Change caller.
10777 * layout.h (class Layout): Declare create_notes. Update
10778 declaration of create_executable_stack_info.
10779 * gold.cc (queue_middle_tasks): Call create_notes.
10780 * output.cc (Output_section::update_flags_for_input_section): Move
10781 here from output.h. If SHF_ALLOC flag is newly set, mark address
10782 invalid.
10783 * output.h (Output_data::mark_address_invalid): New function.
10784 (class Output_section): Only declare, not define,
10785 update_flags_for_input_section. Remove set_flags.
10786
10787 2009-06-24 Ian Lance Taylor <iant@google.com>
10788
10789 * script-sections.cc (Output_section_definition::
10790 set_section_addresses): Rename shadowing local load_address to
10791 laddr.
10792
10793 2009-06-24 Ian Lance Taylor <iant@google.com>
10794
10795 PR 10244
10796 * reloc.cc (relocate_sections): Skip empty relocation sections.
10797
10798 2009-06-23 Ian Lance Taylor <iant@google.com>
10799
10800 PR 10156
10801 * layout.cc (Layout::create_note): Use choose_output_section
10802 rather than make_output_section.
10803
10804 2009-06-23 Ian Lance Taylor <iant@google.com>
10805
10806 PR 10237
10807 * options.cc (General_options::parse_V): Set printed_version_.
10808 (General_options::General_options): Initialize printed_version_.
10809 * options.h (class General_options): Add printed_version_ field.
10810 * gold.cc (queue_initial_tasks): If there are no input files,
10811 don't give a fatal error if we printed the version information.
10812 (queue_middle_tasks): If using -r with a shared object, give a
10813 fatal error rather than an ordinary error.
10814
10815 2009-06-23 Ian Lance Taylor <iant@google.com>
10816
10817 PR 10219
10818 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10819 (Layout::make_output_section): Set have_stabstr_section_ if we see
10820 a .stab*str section.
10821 (Layout::finalize): Call link_stabs_sections.
10822 (Layout::link_stabs_sections): New file.
10823 * layout.h (class Layout): Add have_stabstr_section_ field.
10824 Declare link_stabs_sections.
10825
10826 2009-06-23 Doug Kwan <dougkwan@google.com>
10827
10828 * Makefile.am (libgold_a_LIBADD): New.
10829 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
10830 * Makefile.in: Regenerate.
10831 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10832 * configure: Regenerate.
10833 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10834 * fileread.cc: Include sys/state.h
10835 * gold.h: Declare memmem and strndup if found missing.
10836 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10837
10838 2009-06-23 Ian Lance Taylor <iant@google.com>
10839
10840 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10841 * configure: Rebuild.
10842
10843 2009-06-23 Ian Lance Taylor <iant@google.com>
10844
10845 PR 10147
10846 * object.cc (Object::section_contents): Don't try to get a view if
10847 the section has length zero.
10848 (Object::handle_gnu_warning_section): If the section is empty, use
10849 the name of the section as the warning.
10850
10851 2009-06-23 Ian Lance Taylor <iant@google.com>
10852
10853 PR 10133
10854 * stringpool.h (class Stringpool_template): Add optimize_ field.
10855 (Stringpool_template::set_optimize): New function.
10856 * stringpool.cc (Stringpool_template::Stringpool_template):
10857 Initialize optimize_ field.
10858 (Stringpool_template::set_string_offsets): Test local optimize
10859 fild rather than parameter.
10860 * layout.cc (Layout::Layout): Call set_optimize on the section
10861 name stringpool.
10862
10863 2009-06-22 Ian Lance Taylor <iant@google.com>
10864
10865 PR 10030
10866 * yyscript.y: Parse TARGET.
10867 * script.cc (script_set_target): New function.
10868 * script-c.h (script_set_target): Declare.
10869 * options.cc (General_options::string_to_object_format): Rename
10870 from string_to_object_format in anonymous namespace. Change
10871 callers.
10872 * options.h (class General_options): Declare
10873 string_to_object_format.
10874
10875 2009-06-22 Ian Lance Taylor <iant@google.com>
10876
10877 * script-sections.cc (Script_sections::create_segments): Don't put
10878 program headers in a PT_LOAD segment if -n or -N.
10879
10880 2009-06-22 Ian Lance Taylor <iant@google.com>
10881
10882 PR 10141
10883 * options.h (class General_options): Add -z lazy and -z now. Sort
10884 -z options into alphabetical order.
10885 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10886
10887 2009-06-21 Ian Lance Taylor <iant@google.com>
10888
10889 * layout.cc (Layout::make_output_section): Call
10890 Target::new_output_section.
10891 (Layout::attach_allocated_section_to_segment): Put large section
10892 sections in a separate load segment with the large segment flag
10893 set.
10894 (Layout::segment_precedes): Sort large data segments after other
10895 load segments.
10896 (align_file_offset): New static function.
10897 (Layout::set_segment_offsets): Use align_file_offset.
10898 * output.h (class Output_section): Add is_small_section_ and
10899 is_large_section_ fields.
10900 (Output_section::is_small_section): New function.
10901 (Output_section::set_is_small_section): New function.
10902 (Output_section::is_large_section): New function.
10903 (Output_section::set_is_large_section): New function.
10904 (Output_section::is_large_data_section): New function.
10905 (class Output_segment): Add is_large_data_segment_ field.
10906 (Output_segment::is_large_data_segment): New function.
10907 (Output_segment::set_is_large_data_segment): New function.
10908 * output.cc (Output_section::Output_section): Initialize new
10909 fields.
10910 (Output_segment::Output_segment): Likewise.
10911 (Output_segment::add_output_section): Add assertion that large
10912 data sections always go in large data segments. Force small data
10913 sections to the end of the list of data sections. Force small BSS
10914 sections to the start of the list of BSS sections. For large BSS
10915 sections to the end of the list of BSS sections.
10916 * symtab.h (class Symbol): Declare is_common_shndx.
10917 (Symbol::is_defined): Check Symbol::is_common_shndx.
10918 (Symbol::is_common): Likewise.
10919 (class Symbol_table): Define enum Commons_section_type. Update
10920 declarations. Add small_commons_ and large_commons_ fields.
10921 * symtab.cc (Symbol::is_common_shndx): New function.
10922 (Symbol_table::Symbol_table): Initialize new fields.
10923 (Symbol_table::add_from_object): Put small and large common
10924 symbols in the right list.
10925 (Symbol_table::sized_finalized_symbol): Check
10926 Symbol::is_common_shndx.
10927 (Symbol_table::sized_write_globals): Likewise.
10928 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10929 common symbol lists. Don't call do_allocate_commons_list if the
10930 list is empty.
10931 (Symbol_table::do_allocate_commons_list): Remove is_tls
10932 parameter. Add comons_section_type parameter. Change all
10933 callers. Handle small and large common symbols.
10934 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10935 Symbol::is_common_shndx.
10936 * resolve.cc (symbol_to_bits): Likewise.
10937 * target.h (Target::small_common_shndx): New function.
10938 (Target::small_common_section_flags): New function.
10939 (Target::large_common_shndx): New function.
10940 (Target::large_common_section_flags): New function.
10941 (Target::new_output_section): New function.
10942 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10943 small_common_section_flags, and large_common_section_flags
10944 fields.
10945 (Target::do_new_output_section): New virtual function.
10946 * arm.cc (Target_arm::arm_info): Initialize new fields.
10947 * i386.cc (Target_i386::i386_info): Likewise.
10948 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10949 Likewise.
10950 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10951 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10952 (Target_x86_64::do_new_output_section): New function.
10953 * configure.ac: Define conditional MCMODEL_MEDIUM.
10954 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10955 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10956 (large_LDFLAGS): Define.
10957 * testsuite/large.c: New file.
10958 * testsuite/testfile.cc (Target_test::test_target_info):
10959 Initialize new fields.
10960 * configure, testsuite/Makefile.in: Rebuild.
10961
10962 2009-06-05 Doug Kwan <dougkwan@google.com>
10963
10964 * Makefile.am (CCFILES): Add target.cc.
10965 * Makefile.in: Regenerate.
10966 * i386.cc (class Target_i386): Define new virtual method to
10967 override do_is_local_label_name in parent.
10968 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10969 local symbols if --discard-locals or -X is given.
10970 * options.h (class General_options): Declare new options
10971 '--discard-locals' and '-X' for discarding locals.
10972 * target.h (class Target): Define new methods is_local_label_name.
10973 Declare new virtual method do_is_local_label_name.
10974 * target.cc: New file.
10975 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10976 (check_SCRIPTS): Add discard_locals_test.sh.
10977 (check_DATA): Add discard_local_tests.syms.
10978 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10979 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10980 * testsuite/Makefile.in: Regenerate.
10981 * testsuite/discard_locals_test.c: New file.
10982 * testsuite/discard_locals_test.sh: Same.
10983
10984 2009-06-05 Doug Kwan <dougkwan@google.com>
10985
10986 * object.cc (Sized_relobj::Sized_relobj): Initialize
10987 discarded_eh_frame_shndx_ to -1U.
10988 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10989 section.
10990 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10991 a discarded .eh_frame section.
10992 (Sized_relobj::do_finalize_local_symbols): Ditto.
10993 * object.h (class Sized_relobj): Declare new member
10994 discarded_eh_frame_shndx_.
10995 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10996 (local_labels_test.o, local_labels_test): New rules.
10997 * testsuite/Makefile.in: Regenerate.
10998
10999 2009-06-04 Doug Kwan <dougkwan@google.com>
11000
11001 * layout.cc (Layout::section_name_mapping): Add mapping for
11002 special ARM sections.
11003
11004 2009-06-03 Doug Kwan <dougkwan@google.com>
11005
11006 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11007 (utils::has_overflow): Same.
11008
11009 2009-06-03 Ian Lance Taylor <iant@google.com>
11010
11011 * layout.cc (Layout::section_name_mapping): New array, replacing
11012 Layout::linkonce_mapping.
11013 (Layout::section_name_mapping_count): New variable, replacing
11014 Layout::linkonce_mapping_count.
11015 (Layout::linkonce_output_name): Remove.
11016 (Layout::output_section_name): Rewrite.
11017 * layout.h (class Layout): Rename Linkonce_mapping to
11018 Section_name_mapping, linkonce_mapping to section_name_mapping,
11019 linkonce_mapping_count to section_name_mapping_count. Don't
11020 declare linkonce_output_name.
11021
11022 2009-06-03 Doug Kwan <dougkwan@google.com>
11023
11024 * gold/arm.cc (namespace utils): New.
11025 (Target_arm::reloc_is_non_pic): Define new method.
11026 (class Arm_relocate_functions): New.
11027 (Target_arm::Relocate::relocate): Handle relocation types used by
11028 Android.
11029
11030 2009-06-03 Ian Lance Taylor <iant@google.com>
11031
11032 * arm.cc (Target_arm::scan::global): Use || instead of |.
11033
11034 2009-06-02 Doug Kwan <dougkwan@google.com>
11035
11036 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11037 issued_non_pic_error_.
11038 (class Target_arm::Scan): Declare new method check_non_pic.
11039 Define new method symbol_needs_plt_entry.
11040 Declare new data member issued_non_pic_error_.
11041 (class Target_arm::Relocate): Declare new method
11042 should_apply_static_reloc.
11043 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11044 (Target_arm::Scan::check_non_pic): Define new method.
11045 (Target_arm::Scan::local): Handle a small subset of reloc types used
11046 by Android.
11047 (Target_arm::Scan::local): Same.
11048 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11049
11050 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11051
11052 * incremental.cc (Incremental_inputs::report_command_line): Filter
11053 out --incremental-* options.
11054
11055 2009-05-29 Doug Kwan <dougkwan@google.com>
11056
11057 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11058 template class.
11059 (class Target_arm): Update comment.
11060 (Target_arm::Target_arm): Initialize new data members GOT_,
11061 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11062 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11063 and Target_arm::rel_dyn_section.
11064 Declare new_enum Target_arm::Got_type.
11065 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11066 and DYNBSS_.
11067 Update commments for member do_dynsym_value.
11068 (Target_arm::got_size, Target_arm::plt_section,
11069 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11070 new methods inside class defintion.
11071 (Target_arm::got_section): Define new method.
11072 (Target_arm::rel_dyn_section): Same.
11073 (Output_data_plt_arm): New template class.
11074 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11075 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11076 (Output_data_plt_arm::add_entry): Same.
11077 (Output_data_plt_arm::first_plt_entry): Define new
11078 static data member for PLT instruction template.
11079 (Output_data_plt_arm::plt_entry): Same.
11080 (Output_data_plt_arm::do_write): Define new method.
11081 (Target_arm::make_plt_entry): Same.
11082 (Target_arm::do_finalize_sections): Same.
11083 (Target_arm::do_dynsym_value): Same.
11084
11085 2009-05-28 Doug Kwan <dougkwan@google.com>
11086
11087 * Makefile.am (TARGETSOURCES): Add arm.cc.
11088 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11089 * Makefile.in: Regenerate.
11090 * arm.cc: New file.
11091 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11092
11093 2009-05-26 Doug Kwan <dougkwan@google.com>
11094
11095 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11096 (General_options::check_excluded_libs): Strip off directories in
11097 archive name before matching like GNU ld does.
11098 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11099 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11100 (exclude_libs_test_LDFLAGS): Add linker option
11101 -Wl,--exclude-libs,libexclude_libs_test_3
11102 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11103 an explicit archive without using -l.
11104 (alt/libexclude_libs_test_3.a): New make rule.
11105 * testsuite/Makefile.in: Regenerate.
11106 * testsuite/exclude_libs_test.c : Declare lib3_default().
11107 (main): Call it.
11108 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11109 * exclude_libs_test_3.c: New file.
11110
11111 2009-05-26 Nick Clifton <nickc@redhat.com>
11112
11113 * po/id.po: New Indonesian translation.
11114 * po/gold.pot: Updated template file.
11115
11116 2009-05-22 Sriraman Tallam <tmsriram@google.com>
11117
11118 * testsuite/Makefile.am: Add -ffunction-sections to compile
11119 gc_comdat_test files. Add -Wl,--gc-sections to build
11120 gc_comdat_test.
11121 * testsuite/Makefile.in: Regenerate.
11122 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11123
11124 2009-05-21 Sriraman Tallam <tmsriram@google.com>
11125
11126 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11127 kept comdat section was garbage collected.
11128 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11129 * testsuite/Makefile.in: Regenerate.
11130 * testsuite/gc_comdat_test.sh: New file.
11131 * testsuite/gc_comdat_test_1.cc: New file.
11132 * testsuite/gc_comdat_test_2.cc: New file.
11133
11134 2009-05-19 Doug Kwan <dougkwan@google.com>
11135
11136 * archive.cc (Archive::Archive): Move constructor from archive.h
11137 to here. Initialize no_export_.
11138 (Archive::get_elf_object_for_member): Set no_export flag of object.
11139 * archive.h (Archive::Archive): Move constructor body to
11140 archive.cc.
11141 (Archive::no_export): New method.
11142 (Archive::no_export_): New field.
11143 * object.h (Object::Object): Initialize no_export_ to false.
11144 (Object::no_export, Object::set_no_export): New methods.
11145 (Object::no_export_): New field.
11146 * options.cc (General_options::parse_exclude_libs): New method.
11147 (General_options::check_excluded_libs) Same.
11148 * options.h (exclude_libs): New option.
11149 (General_options::check_excluded_libs): New method declaration.
11150 (General_options::excluded_libs_): New field.
11151 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11152 default or protected visibility if an object has no-export flag set.
11153 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11154 (check_SCRIPTS): Add exclude_libs_test.sh.
11155 (check_DATA): Add exclude_libs_test.syms.
11156 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11157 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11158 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11159 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11160 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11161 libexclude_libs_test_2.a): New rules.
11162 * testsuite/Makefile.in: Regenerate.
11163 * testsuite/exclude_libs_test.c: New file.
11164 * testsuite/exclude_libs_test.sh: Ditto.
11165 * testsuite/exclude_libs_test_1.c: Ditto.
11166 * testsuite/exclude_libs_test_2.c: Ditto.
11167
11168 2009-05-15 Ian Lance Taylor <iant@google.com>
11169
11170 * configure.ac: Check for declarations for cases where libiberty.h
11171 checks HAVE_DECL_xxx.
11172 * configure, config.in: Rebuild.
11173
11174 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11175
11176 * gold.h (Incremental_argument_list): Remove (invalid) forward
11177 declaration.
11178 * incremental.cc (Incremental_inputs::report_achive): New method.
11179 (Incremental_inputs::report_object): New method.
11180 (Incremental_inputs::report_script): New method.
11181 (Incremental_inputs::finalize_inputs): New method.
11182 (Incremental_inputs::finalize): Call finalize_inputs().
11183 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11184 Create inputs entries.
11185 * incremental.h (Incremental_input_type): New enum.
11186 (Incremental_inputs::Incremental_input): Initialize new fields.
11187 (Incremental_inputs::report_inputs): New method.
11188 (Incremental_inputs::report_achive): New method.
11189 (Incremental_inputs::report_object): New method.
11190 (Incremental_inputs::report_script): New method.
11191 (Incremental_inputs::finalize_inputs): New method.
11192 (Incremental_inputs::Input_info): New struct.
11193 (Incremental_inputs::Input_info_map): New typedef.
11194 (Incremental_inputs::lock_): New field.
11195 (Incremental_inputs::Inputs_): New field.
11196 (Incremental_inputs::Inputs_map): New field.
11197 * main.cc (main): Call Incremental_input::report_inputs.
11198 * options.h (Input_argument_list): Typedef moved from
11199 Input_arguments.
11200 (Input_file_group::Files): Remove, use ::Input_argument_list.
11201 (Input_file_group::Input_argument_list): Remove, use
11202 ::Input_argument_list.
11203 * plugin.cc (Plugin_manager::add_input_file): Add error in
11204 incremental build.
11205 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11206 functions.
11207 * script.cc (read_input_script): Call
11208 Incremental_input::report_script.
11209 * script.h (Script_info): New class.
11210
11211 2009-04-27 Ian Lance Taylor <iant@google.com>
11212
11213 * x86_64.cc (do_adjust_output_section): Set entsize to
11214 plt_entry_size.
11215
11216 2009-04-23 Elliott Hughes <enh@google.com>
11217
11218 * output.cc (Output_file::close): After short writes, continue
11219 writing from the correct offset in the buffer being written.
11220
11221 2009-04-23 Chris Demetriou <cgd@google.com>
11222
11223 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11224 * configure: Regenerate.
11225 * config.in: Regenerate.
11226 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11227 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11228
11229 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11230
11231 * incremental.cc (Incremental_inputs_header_data): Renamed from
11232 Incremental_input_header_data.
11233 (Incremental_inputs_header_data::data_size): New field.
11234 (Incremental_inputs_header_data::put_input_file_count): Renamed
11235 from input_file_count.
11236 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11237 from command_line_offset.
11238 (Incremental_inputs_header_data::put_reserved): Renamed from
11239 put_reserved.
11240 (Incremental_inputs_entry_data): Renamed from
11241 Incremental_input_entry_data.
11242 (Incremental_inputs_entry_data::data_size): New field.
11243 (Incremental_inputs::report_command_line): New method.
11244 (Incremental_inputs::finalize): New method.
11245 (Incremental_inputs::create_incremental_inputs_data): New method.
11246 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11247 * incremental.h: New file.
11248 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
11249 (Layout::finalize): Create incremental inputs section in
11250 incremental builds.
11251 (Layout::create_incremental_info_sections): New method.
11252 * layout.h (Layout::incremental_inputs): New method.
11253 (Layout::create_incremental_info_sections): New method.
11254 (Layout::incremental_inputs_): New field.
11255 * main.cc (main): Notify Incremental_input of the command line.
11256
11257 2009-04-01 Ian Lance Taylor <iant@google.com>
11258 Mikolaj Zalewski <mikolajz@google.com>
11259
11260 * gold.h (reserve_unordered_map): Define, three versions, one for
11261 each version of Unordered_map.
11262 * layout.cc (Layout::Layout): Remove options parameter. Add
11263 number_of_input_files parameter. Don't initialize options_.
11264 Initialize number_of_input_files_ and resized_signatures_. Move
11265 sections_are_attached_.
11266 (Layout::layout_group): Reserve space for group_signatures_.
11267 (Layout::find_or_add_kept_section): Change name parameter to be a
11268 reference. Resize signatures_ map when it gets large enough.
11269 (Layout::layout_eh_frame): Use parameters->options() instead of
11270 this->options_.
11271 (Layout::make_output_section): Likewise.
11272 (Layout::attach_allocated_section_to_segment): Likewise.
11273 (Layout::finalize, Layout::create_executable_stack): Likewise.
11274 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11275 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11276 * layout.h (class Layout): Update declarations. Remove options_
11277 field. Add number_of_input_files_ and resized_signatures_
11278 fields. Move sections_are_attached_ field.
11279 * main.cc (main): Pass number of input files to Layout
11280 constructor. Don't pass options.
11281
11282 2009-03-30 Ian Lance Taylor <iant@google.com>
11283
11284 * ffsll.c (ffsll): Correct implementation.
11285
11286 2009-03-27 Ian Lance Taylor <iant@google.com>
11287
11288 * ffsll.c: New file.
11289 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11290 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11291 * ftruncate.c (ftruncate): Declare before definition.
11292 * mremap.c (mremap): Likewise.
11293 * pread.c (pread): Likewise.
11294 * configure, Makefile.in, config.in: Rebuild.
11295
11296 * mremap.c: New file.
11297 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11298 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11299 (mremap): Declare if HAVE_MREMAP is not defined.
11300 * configure, Makefile.in, config.in: Rebuild.
11301
11302 2009-03-27 Cary Coutant <ccoutant@google.com>
11303
11304 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11305 position independent.
11306 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11307 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11308
11309 2009-03-24 Cary Coutant <ccoutant@google.com>
11310
11311 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11312 an executable.
11313 (needs_dynamic_reloc): Likewise.
11314
11315 2009-03-24 Ian Lance Taylor <iant@google.com>
11316
11317 * yyscript.y (file_cmd): Recognize EXTERN.
11318 (extern_name_list, extern_name_list_body): New nonterminals.
11319 * script.cc (script_add_extern): Define.
11320 * script-c.h (script_add_extern): Declare.
11321
11322 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
11323
11324 * object.cc (is_elf_object): Define.
11325 * object.h (is_elf_object): Declare.
11326 * archive.cc (Archive::get_elf_object_for_member): Call
11327 is_elf_object.
11328 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
11329
11330 2009-03-24 Elliott Hughes <enh@google.com>
11331
11332 * output.cc (Output_file::map_anonymous): Define.
11333 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11334 try an anonymous one. Report the size if the mmap fails.
11335 * output.h (class Output_file): Declare map_anonymous.
11336
11337 2009-03-24 Ian Lance Taylor <iant@google.com>
11338
11339 * target-select.cc (instantiate_target): Don't acquire the lock if
11340 the instantiated_target_ field has already been set.
11341
11342 2009-03-23 Ian Lance Taylor <iant@google.com>
11343
11344 * gold-threads.h (class Initialize_lock): Define.
11345 * gold-threads.cc (class Initialize_lock_once): Define.
11346 (initialize_lock_control): New static variable.
11347 (initialize_lock_pointer): New static variable.
11348 (initialize_lock_once): New static function.
11349 (Initialize_lock::Initialize_lock): Define.
11350 (Initialize_lock::initialize): Define.
11351 * target-select.h: Include "gold-threads.h".
11352 (class Target_selector): Add lock_ and initialize_lock_ fields.
11353 Don't define instantiate_target, just declare it.
11354 * target-select.cc (Target_selector::Target_selector): Initialize
11355 new fields.
11356 (Target_selector::instantiate_target): Define.
11357 * descriptors.h: Include "gold-threads.h".
11358 (class Descriptors): Add initialize_lock_ field.
11359 * descriptors.cc (Descriptors::Descriptors): Initialize new
11360 field.
11361 (Descriptors::open): Use initialize_lock_ field
11362 * errors.h (class Errors): Add initialize_lock_ field.
11363 * errors.cc (Errors::Errors): Initialize new field.
11364 (Errors::initialize_lock): Use initialize_lock_ field.
11365 * powerpc.cc (class Target_selector_powerpc): Remove
11366 instantiated_target_ field. In do_recognize call
11367 instantiate_target rather than do_instantiate_target. In
11368 do_instantiate_target just allocate a new target.
11369 * sparc.cc (class Target_selector_sparc): Likewise.
11370
11371 * freebsd.h: New file.
11372 * i386.cc: Include "freebsd.h".
11373 (Target_i386): Derive from Target_freebsd rather than
11374 Sized_target.
11375 (Target_selector_i386): Derive from Target_selector_freebsd rather
11376 than Target_selector.
11377 * x86_64.cc: Include "freebsd.h".
11378 (Target_x86_64): Derive from Target_freebsd rather than
11379 Sized_target.
11380 (Target_selector_x86_64): Derive from Target_selector_freebsd
11381 rather than Target_selector.
11382 * target.h (class Target): Add adjust_elf_header and
11383 do_adjust_elf_header.
11384 * output.cc (Output_file_header:: do_sized_write): Call target
11385 adjust_elf_header routine.
11386 * configure.tgt: Set targ_osabi.
11387 * configure.ac: Define GOLD_DEFAULT_OSABI.
11388 * parameters.cc (Parameters::default_target): Pass
11389 GOLD_DEFAULT_OSABI to select_target.
11390 * target-select.h (class Target_selector): Make instantiate_target
11391 protected rather than private.
11392 * Makefile.am (HFILES): Add freebsd.h.
11393 * configure, Makefile.in, config.in: Rebuild.
11394
11395 * merge.cc (do_add_input_section): Correct pend value. Change
11396 message about last entry not being null terminated from error to
11397 warning.
11398
11399 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11400
11401 * incremental.cc: New file.
11402 * Makefile.am (CCFILES): Add incremental.cc.
11403 * Makefile.in: Rebuild.
11404
11405 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11406
11407 * layout.cc (Layout::output_section_name): Preserve names
11408 of '.note.' sections.
11409
11410 2009-03-19 Ian Lance Taylor <iant@google.com>
11411
11412 * descriptors.cc (Descriptors::open): Check that the options are
11413 valid before using them.
11414
11415 2009-03-18 Ian Lance Taylor <iant@google.com>
11416
11417 * script-sections.h: Include <list>.
11418 (class Script_sections): Change Sections_elements from std::vector
11419 to std::list. Typedef public Elements_iterator. Add
11420 orphan_section_placement_, data_segment_align_start_, and
11421 saw_data_segment_align_ fields. Remove data_segment_align_index_
11422 field.
11423 * script-sections.cc (class Orphan_section_placement): New class.
11424 (class Sections_element): Add virtual functions is_relro and
11425 orphan_section_init. Remove virtual function place_orphan_here.
11426 (class Output_section_definition): Add is_relro and
11427 orphan_section_init. Remove place_orphan_here.
11428 (class Orphan_output_section): Likewise.
11429 (Script_sections::Script_sections): Update for field changes.
11430 (Script_sections::data_segment_align): Set saw_data_segment_align_
11431 and data_segment_align_start_, not data_segment_align_index.
11432 (Script_sections::data_segment_relro_end): Check
11433 saw_data_segment_align_. Use data_segment_align_start_ rather
11434 than data_segment_align_index_.
11435 (Script_sections::place_orphan): Rewrite to use
11436 Orphan_section_placement.
11437
11438 2009-03-17 Ian Lance Taylor <iant@google.com>
11439
11440 * archive.cc (Archive::add_symbols): Check for a version attached
11441 to the symbol name in the archive map.
11442 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11443 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11444 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11445 (ver_test_11.a): New target.
11446 * testsuite/Makefile.in: Rebuild.
11447
11448 * configure.ac: Check for chsize and posix_fallocate. Replace
11449 ftruncate.
11450 * ftruncate.c: New file, from gnulib.
11451 * output.cc (posix_fallocate): Define dummy version if not
11452 HAVE_POSIX_FALLOCATE.
11453 (Output_file::map): Call posix_fallocate rather than lseek and
11454 write.
11455 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11456 * configure, Makefile.in, config.in: Rebuild.
11457
11458 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
11459
11460 * layout.h (Layout::create_note): Add section_name parameter.
11461 * layout.cc (Layout::create_note): Likewise.
11462 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
11463
11464 2009-03-17 Ian Lance Taylor <iant@google.com>
11465
11466 * descriptors.cc: Include "options.h".
11467 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11468 (Descriptors::open): Always use O_CLOEXEC when opening a new
11469 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11470 then set FD_CLOEXEC.
11471
11472 * sparc.cc (class Target_sparc): Add has_got_section.
11473 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11474 make sure we have a GOT section.
11475
11476 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11477 (Target_sparc::Scan::local): Likewise.
11478 (Target_sparc::Scan::global): Likewise.
11479 (Target_sparc::Relocate::relocate): Likewise.
11480 (Target_sparc::Relocate::relocate_tls): Likewise.
11481
11482 * symtab.cc (Symbol_table::define_default_version): New function,
11483 broken out of add_from_object.
11484 (Symbol_table::add_from_object): Call define_default_version.
11485 (Symbol_table::define_special_symbol): Add resolve_oldsym
11486 parameter. Change all callers. If the version for a symbol comes
11487 from a version script, resolve it with the symbol with the same
11488 name with no version. Also add the symbol without a version if
11489 appropriate.
11490 (do_define_in_output_data): If resolving with oldsym, don't delete
11491 sym.
11492 (do_define_in_output_segment): Likewise.
11493 (do_define_as_constant): Likewise.
11494 * symtab.h (class Symbol_table): Update declarations.
11495
11496 2009-03-13 Ian Lance Taylor <iant@google.com>
11497
11498 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11499 (Read_symbols::requeue): New function.
11500 (Read_symbols::do_read_symbols): If make_elf_object fails because
11501 the target type is not configured, and the file was searched for,
11502 issue a warning and retry with the next directory.
11503 (Add_symbols::run): If the file has an incompatible format, and
11504 it was searched for, requeue the Read_symbols task. On error,
11505 release the object.
11506 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11507 dirindex parameter to constructor. Change all callers. Declare
11508 incompatible_warning and requeue.
11509 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11510 input_argument_ and input_group_ fields. Add them to
11511 constructor. Change all callers.
11512 (class Read_script): Add dirindex_ field. Add it to constructor.
11513 Change all callers.
11514 * archive.cc (Archive::setup): Remove input_objects parameter.
11515 Change all callers.
11516 (Archive::get_file_and_offset): Likewise.
11517 (Archive::read_all_symbols): Likewise.
11518 (Archive::read_symbols): Likewise.
11519 (Archive::get_elf_object_for_member): Remove input_objects
11520 parameter. Add punconfigured parameter. Change all callers.
11521 (Archive::add_symbols): Change return type to bool. Check return
11522 value of include_member.
11523 (Archive::include_all_members): Likewise.
11524 (Archive::include_member): Change return type to bool. Return
11525 false if first included object has incompatible target. Set
11526 included_member_ field.
11527 (Add_archive_symbols::run): If add_symbols returns false, requeue
11528 Read_symbols task.
11529 * archive.h (class Archive): Add included_member_ field.
11530 Initialize it in constructor. Add input_file and searched_for
11531 methods. Update declarations.
11532 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11533 input_argument_ fields. Add them to constructor. Change all
11534 callers.
11535 * script.cc: Include "target-select.h".
11536 (class Parser_closure): Add skip_on_incompatible_target_ and
11537 found_incompatible_target_ fields. Add
11538 skip_on_incompatible_target parameter to constructor. Change all
11539 callers. Add methods skip_on_incompatible_target,
11540 clear_skip_on_incompatible_target, found_incompatible_target, and
11541 set_found_incompatible_target.
11542 (read_input_script): Add dirindex parameter. Change all callers.
11543 If parser finds an incompatible target, requeue Read_symbols
11544 task.
11545 (script_set_symbol): Clear skip_on_incompatible_target in
11546 closure.
11547 (script_add_assertion, script_parse_option): Likewise.
11548 (script_start_sections, script_add_phdr): Likewise.
11549 (script_check_output_format): New function.
11550 * script.h (read_input_script): Update declaration.
11551 * script-c.h (script_check_output_format): Declare.
11552 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11553 (ignore_cmd): Remove OUTPUT_FORMAT.
11554 * fileread.cc (Input_file::Input_file): Add explicit this.
11555 (Input_file::will_search_for): New function.
11556 (Input_file::open): Add pindex parameter. Change all callers.
11557 * fileread.h (class Input_file): Add input_file_argument method.
11558 Declare will_search_for. Update declarations.
11559 * object.cc (make_elf_object): Add punconfigured parameter.
11560 Change all callers.
11561 * object.h (class Object): Make input_file public. Add
11562 searched_for method.
11563 (make_elf_object): Update declaration.
11564 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11565 restart search.
11566 * dirsearch.h (class Dirsearch): Update declaration.
11567 * options.h (class General_options): Add --warn-search-mismatch.
11568 * parameters.cc (Parameters::is_compatible_target): New function.
11569 * parameters.h (class Parameters): Declare is_compatible_target.
11570 * workqueue.cc (Workqueue::add_blocker): New function.
11571 * workqueue.h (class Workqueue): Declare add_blocker.
11572
11573 * fileread.cc (Input_file::open): Remove options parameter.
11574 Change all callers.
11575 (Input_file::open_binary): Likewise.
11576 * script.cc (read_input_script): Likewise.
11577 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11578 options parameter from constructor. Change all callers.
11579 (class Read_script): Likewise.
11580 * fileread.h (class Input_file): Update declarations.
11581 * script.h (read_input_script): Update declaration.
11582
11583 2009-03-10 Nick Clifton <nickc@redhat.com>
11584
11585 * po/es.po: New Spanish translation.
11586
11587 2009-03-06 Cary Coutant <ccoutant@google.com>
11588
11589 * options.cc (parse_short_option): Keep dash_z from registering itself.
11590
11591 2009-03-03 Ian Lance Taylor <iant@google.com>
11592
11593 PR 9918
11594 * target-reloc.h (relocate_section): Pass output_section to
11595 relocate.
11596 * i386.cc (Target_i386::should_apply_static_reloc): Add
11597 output_section parameter. Change all callers.
11598 (Target_i386::Relocate::relocate): Add output_section parameter.
11599 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11600 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11601 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11602 * testsuite/two_file_shared.sh: New script.
11603 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11604 (check_DATA): Add two_file_shared.dbg.
11605 (two_file_shared.dbg): New target.
11606 * testsuite/Makefile.in: Rebuild.
11607
11608 2009-03-01 Ian Lance Taylor <iant@google.com>
11609
11610 * configure.ac: Check for byteswap.h.
11611 * configure: Rebuild.
11612 * config.in: Rebuild.
11613
11614 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11615
11616 * layout.cc (Layout::find_or_add_kept_section): New function.
11617 (Layout::add_comdat): Removed.
11618 * layout.h (struct Kept_section): Move out of class Layout.
11619 Remove trailing underscores from field names. Add group_sections
11620 field. Rename group_ field to is_group. Change all uses.
11621 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11622 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11623 comdat_groups_ field.
11624 (Sized_relobj::include_section_group): Use
11625 find_or_add_kept_section and Kept_section::group_sections.
11626 (Sized_relobj::include_linkonce_section): Likewise.
11627 * object.cc (class Sized_relobj): Don't define Comdat_group or
11628 Comdat_group_table. Remove find_comdat_group and
11629 add_comdat_group. Remove comdat_groups_ field.
11630 * plugin.cc (include_comdat_group): Use
11631 Layout::find_or_add_kept_section.
11632
11633 2009-02-28 Ian Lance Taylor <iant@google.com>
11634
11635 * README: --gc-sections and map files are now supported. Document
11636 some build requirements.
11637
11638 PR 6992
11639 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11640 relocatable link set the value of the section symbol to zero.
11641 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11642 relocatable link don't include the section address in the local
11643 symbol value.
11644
11645 2009-02-27 Ian Lance Taylor <iant@google.com>
11646
11647 PR 6811
11648 * options.h (class Search_directory): Add is_system_directory.
11649 (class General_options): Declare is_in_system_directory.
11650 * options.cc (get_relative_sysroot): Make static.
11651 (get_default_sysroot): Make static.
11652 (General_optoins::is_in_system_directory): New function.
11653 * fileread.cc (Input_file::is_in_system_directory): New function.
11654 * fileread.h (class Input_file): Declare is_in_system_directory.
11655 * object.h (class Object): Add is_in_system_directory.
11656 (class Input_objects): Remove system_library_directory_ field.
11657 * object.cc (Input_objects::add_object): Don't set
11658 system_library_directory_.
11659 (input_objects::found_in_system_library_directory): Remove.
11660 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11661 parameter. Change all callers.
11662 (Symbol_table::sized_write_globals): Likewise.
11663 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11664 Call Object::is_in_system_directory.
11665 * symtab.h (class Symbol_table): Update declarations.
11666
11667 PR 5990
11668 * descriptors.h (Open_descriptor): Add is_on_stack field.
11669 * descriptors.cc (Descriptors::open): If the descriptor is on the
11670 top of the stack, remove it. Initialize is_on_stack field.
11671 (Descriptors::release): Only add pod to stack if it is not on the
11672 stack already.
11673 (Descriptors::close_some_descriptor): Clear stack_next and
11674 is_on_stack fields.
11675
11676 PR 7091
11677 * output.cc (Output_section::find_starting_output_address): Rename
11678 from starting_output_address; add PADDR parameter; change return
11679 type.
11680 * output.h (class Output_section): Declare
11681 find_starting_output_address instead of starting_output_address.
11682 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11683 section symbol for which we can't find a merge section.
11684
11685 PR 9836
11686 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11687 hidden or internal, force the symbol to be local.
11688 * resolve.cc (Symbol::override_visibility): Define.
11689 (Symbol::override_base): Use override_visibility.
11690 (Symbol_table::resolve): Likewise.
11691 (Symbol::override_base_with_special): Likewise.
11692 (Symbol_table::override_with_special): If the visibility is hidden
11693 or internal, force the symbol to be local.
11694 * symtab.h (class Symbol): Add set_visibility and
11695 override_visibility.
11696 * testsuite/ver_test_1.sh: New file.
11697 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11698 (check_DATA): Add ver_test_1.syms.
11699 (ver_test_1.syms): New target.
11700 * testsuite/Makefile.in: Rebuild.
11701
11702 2009-02-25 Cary Coutant <ccoutant@google.com>
11703
11704 * layout.cc (Layout::choose_output_section): Don't rename sections
11705 when using a linker script that has a SECTIONS clause.
11706 * Makefile.in: Regenerate.
11707
11708 * testsuite/Makefile.am (script_test_5.sh): New test case.
11709 * testsuite/Makefile.in: Regenerate.
11710 * testsuite/script_test_5.cc: New file.
11711 * testsuite/script_test_5.sh: New file.
11712 * testsuite/script_test_5.t: New file.
11713
11714 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
11715
11716 * archive.cc (Archive::include_member): Update calls to add_symbols.
11717 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11718 the Layout argument.
11719 * dynobj.h (do_add_symbols): Add the Layout argument.
11720 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11721 Layout argument.
11722 * object.h (Object::add_symbols): Add the Layout argument.
11723 (Object::do_add_symbols): Add the Layout argument.
11724 (Sized_relobj::do_add_symbols): Add the Layout argument.
11725 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11726 Unify the two versions.
11727 (Add_plugin_symbols): Remove.
11728 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11729 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11730 (Add_plugin_symbols): Remove.
11731 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11732 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11733 (Add_symbols::run): Make it work with Pulginobj.
11734
11735 2009-02-06 Ian Lance Taylor <iant@google.com>
11736
11737 * object.cc (Sized_relobj::do_layout): Make info message start
11738 with lower case letter.
11739
11740 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11741
11742 * binary.cc: Fix file comment.
11743
11744 * options.h (enum Incremental_disposition): Define.
11745 (class General_options): Add new options: --incremental,
11746 --incremental_changed, --incremental_unchanged,
11747 --incremental_unknown. Add incremental_disposition_ and
11748 implicit_incremental_ fields.
11749 (General_options::incremental_disposition): New function.
11750 (class Position_dependent_options): Add incremental_disposition
11751 option.
11752 (Position_dependent_options::copy_from_options): Set incremental
11753 dispositions.
11754 * options.cc (General_options::parse_incremental_changed): New
11755 function.
11756 (General_options::parse_incremental_unchanged): New function.
11757 (General_options::parse_incremental_unknown): New function.
11758 (General_options::General_options): Initialize new fields
11759 incremental_disposition_ and implicit_incremental_.
11760 (General_options::finalize): Check for uasge of --incremental-*
11761 without --incremental.
11762
11763 2009-02-06 Chris Demetriou <cgd@google.com>
11764
11765 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11766 pointer and to report location as the file name associated with
11767 the symbol.
11768 (gold_undefined_symbol_at_location): New function to replace the
11769 old gold_undefined_symbol functionality.
11770 * target-reloc.h (relocate_section): Update to use
11771 gold_undefined_symbol_at_location.
11772 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11773 Call gold_undefined_symbol function rather than gold_error.
11774 * errors.h (Errors::undefined_symbol): Take location as a
11775 string, rather than calculating it from a relocation.
11776 * errors.cc (Errors::fatal): Print "fatal error:" before the
11777 formatted message.
11778 (Errors::error, Errors::error_at_location): Print "error: "
11779 before the formatted message.
11780 (Errors::undefined_symbol): Take location as a string, rather
11781 than calculating it from a relocation.
11782 (gold_undefined_symbol_at_location): New function akin to
11783 old gold_undefined_symbol, calculates location from relocation.
11784 (gold_undefined_symbol): Change to take only a Symbol pointer
11785 and to report location as the file name associated with the symbol.
11786 * testsuite/debug_msg.sh: Update for changed error messages.
11787 * testsuite/undef_symbol.sh: Likewise.
11788
11789 2009-02-04 Duncan Sands <baldrick@free.fr>
11790
11791 PR 9812
11792 * reduced_debug_output.h
11793 (Output_reduced_debug_abbrev_section::failed): Use format for
11794 gold_warning.
11795 (Output_reduced_debug_info_section::faild): Likewise.
11796
11797 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11798
11799 * script.cc (Lazy_demangler): New class.
11800 (Version_script_info::get_symbol_version_helper): Demangle a
11801 symbol only once.
11802
11803 2009-01-29 Cary Coutant <ccoutant@google.com>
11804
11805 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11806 to __tls_get_addr.
11807 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11808
11809 2009-01-28 Ian Lance Taylor <iant@google.com>
11810
11811 * version.cc (version_string): Bump to 1.9.
11812
11813 * gold.h: Include <cstring> and <stdint.h>.
11814 * version.cc: Include <cstdio>.
11815 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11816 warning.
11817 * reduced_debug_output.cc (insert_into_vector): Rename from
11818 Insert_into_vector; change all callers. Use Swap_unaligned to
11819 avoid aliasing issue; remove union since it is unnecessary.
11820
11821 2009-01-27 Sriraman Tallam <tmsriram@google.com>
11822
11823 * Makefile.am (CCFILES): Add gc.cc.
11824 (HFILES): Add gc.h.
11825 * Makefile.in: Regenerate.
11826 * gold.cc (Gc_runner): New class.
11827 (queue_initial_tasks): Call garbage collection related tasks
11828 when corresponding options are invoked.
11829 (queue_middle_gc_tasks): New function.
11830 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11831 processed early before laying out sections during garbage collection.
11832 * gold.h (queue_middle_gc_tasks): New function.
11833 (is_prefix_of): Move from "layout.cc".
11834 * i386.cc (Target_i386::gc_process_relocs): New function.
11835 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11836 * main.cc (main): Create object of class "Garbage_collection".
11837 * object.cc (Relobj::copy_symbols_data): New function.
11838 (Relobj::is_section_name_included): New function.
11839 (Sized_relobj::do_layout): Allow this function to be called twice
11840 during garbage collection and defer layout of section during the
11841 first call.
11842 * object.h (Relobj::get_symbols_data): New function.
11843 (Relobj::is_section_name_included): New function.
11844 (Relobj::copy_symbols_data): New function.
11845 (Relobj::set_symbols_data): New function.
11846 (Relobj::get_relocs_data): New function.
11847 (Relobj::set_relocs_data): New function.
11848 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11849 (Relobj::gc_process_relocs): New function.
11850 (Relobj::do_gc_process_relocs): New pure virtual function.
11851 (Relobj::sd_): New data member.
11852 (Sized_relobj::is_output_section_offset_invalid): New function.
11853 (Sized_relobj::do_gc_process_relocs): New function.
11854 * options.h (General_options::gc_sections): Modify to not be a no-op.
11855 (General_options::print_gc_sections): New option.
11856 * plugin.cc (Plugin_finish::run): Remove function call to
11857 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11858 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11859 * reloc.cc (Read_relocs::run): Add task to process relocs and
11860 determine unreferenced sections when doing garbage collection.
11861 (Gc_process_relocs): New class.
11862 (Sized_relobj::do_gc_process_relocs): New function.
11863 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11864 sections that are garbage collected.
11865 * reloc.h (Gc_process_relocs): New class.
11866 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11867 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11868 symbols whose corresponding sections are garbage collected.
11869 (Symbol_table::Symbol_table): Add new parameter for the garbage
11870 collection object.
11871 (Symbol_table::gc_mark_undef_symbols): New function.
11872 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11873 (Symbol_table::gc_mark_dyn_syms): New function.
11874 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11875 as garbage.
11876 (Symbol_table::add_from_object): Likewise.
11877 (Symbol_table::add_from_relobj): When building shared objects, do not
11878 treat externally visible symbols as garbage.
11879 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11880 table information for static and relocatable links.
11881 * symtab.h (Symbol_table::set_gc): New function.
11882 (Symbol_table::gc): New function.
11883 (Symbol_table::gc_mark_undef_symbols): New function.
11884 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11885 (Symbol_table::gc_mark_dyn_syms): New function.
11886 (Symbol_table::gc_): New data member.
11887 * target.h (Sized_target::gc_process_relocs): New pure virtual
11888 function.
11889 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11890 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11891
11892 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11893
11894 * options.h (General_options::gc_sections): Define as a no-op for now.
11895 (General_options::no_keep_memory): Ditto.
11896 (General_options::Bshareable): Define.
11897 * options.cc (General_options::finalize): Honor -Bshareable.
11898
11899 2009-01-20 Andreas Schwab <schwab@suse.de>
11900
11901 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11902 read the value in the contents, since we don't use it. Use the
11903 template endianness when writing.
11904 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11905
11906 2009-01-19 Andreas Schwab <schwab@suse.de>
11907
11908 * configure.tgt (powerpc64-*): Fix targ_obj.
11909
11910 2009-01-15 Ian Lance Taylor <iant@google.com>
11911
11912 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11913 local symbols when stripping all symbols.
11914
11915 2009-01-14 Cary Coutant <ccoutant@google.com>
11916
11917 * output.cc (Output_reloc): Add explicit instantiations.
11918
11919 2009-01-14 Cary Coutant <ccoutant@google.com>
11920
11921 * archive.cc (Archive::get_elf_object_for_member): Remove call
11922 to File_read::claim_for_plugin.
11923 * descriptors.cc (Descriptors::open): Remove reference to
11924 is_claimed.
11925 (Descriptors::claim_for_plugin): Remove.
11926 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11927 (Descriptors::is_claimed): Remove.
11928 (claim_descriptor_for_plugin): Remove.
11929 * fileread.cc (File_read::claim_for_plugin): Remove.
11930 * fileread.h (File_read::claim_for_plugin): Remove.
11931 (File_read::descriptor): Reopen descriptor if necessary.
11932 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11933 (Plugin_manager::all_symbols_read): Add task parameter. Change
11934 all callers.
11935 (Plugin_manager::get_input_file): New function.
11936 (Plugin_manager::release_input_file): New function.
11937 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11938 corresponding data member.
11939 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11940 and pass to base constructor. Change all callers.
11941 (get_input_file, release_input_file): New functions.
11942 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11943 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11944 (Plugin_manager::all_symbols_read): Add task parameter.
11945 (Plugin_manager::get_input_file): New function.
11946 (Plugin_manager::release_input_file): New function.
11947 (Plugin_manager::task_): New data member.
11948 (Pluginobj::Pluginobj): Add filesize parameter.
11949 (Pluginobj::filename): New function.
11950 (Pluginobj::descriptor): New function.
11951 (Pluginobj::filesize): New function.
11952 (Pluginobj::filesize_): New data member.
11953 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11954 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11955 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11956
11957 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11958 with archive libraries.
11959 * testsuite/Makefile.in: Regenerate.
11960 * testsuite/plugin_test.c (struct sym_info): New type.
11961 (get_input_file, release_input_file): New static variables.
11962 (onload): Capture new transfer vector entries.
11963 (claim_file_hook): Stop reading at end of file according to filesize.
11964 Factor out parsing of readelf output into separate function.
11965 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11966 APIs and get the source file name from the symbol table. Convert
11967 source file name to corresponding object file name. Print info
11968 message when adding new input files.
11969 (parse_readelf_line): New function.
11970 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11971 * testsuite/plugin_test_2.sh: Likewise.
11972 * testsuite/plugin_test_3.sh: Likewise.
11973 * testsuite/plugin_test_4.sh: New test case.
11974
11975 2009-01-07 Ian Lance Taylor <iant@google.com>
11976
11977 * version.cc (version_string): Bump to 1.8.
11978
11979 2008-12-23 Cary Coutant <ccoutant@google.com>
11980
11981 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11982 * plugin.cc (Plugin_manager::finish): Rename as
11983 layout_deferred_objects. Move cleanup to separate function.
11984 (Plugin_manager::cleanup): New function.
11985 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11986 separately.
11987 * plugin.h (Plugin_manager::finish): Rename as
11988 layout_deferred_objects.
11989 (Plugin_manager::cleanup): New function.
11990 (Plugin_manager::cleanup_done): New field.
11991
11992 2008-12-23 Cary Coutant <ccoutant@google.com>
11993
11994 * plugin.cc (is_visible_from_outside): New function.
11995 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11996 so we don't return "IR only" status for exported symbols or -r links.
11997
11998 * testsuite/Makefile.am (plugin_test_3): New test case.
11999 * testsuite/Makefile.in: Regenerate.
12000 * testsuite/plugin_test_3.sh: New file.
12001
12002 2008-12-22 Cary Coutant <ccoutant@google.com>
12003
12004 * object.cc (Sized_relobj::layout_section): New function.
12005 (Sized_relobj::do_layout): Defer layout of input sections until after
12006 plugin has provided replacement files.
12007 (Sized_relobj::do_layout_deferred_sections): New function.
12008 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12009 (Relobj::layout_deferred_sections): New function.
12010 (Relobj::do_layout_deferred_sections): New function.
12011 (Sized_relobj::do_layout_deferred_sections): New function.
12012 (Sized_relobj::layout_section): New function.
12013 (Sized_relobj::Deferred_layout): New structure.
12014 (Sized_relobj::deferred_layout_): New field.
12015 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12016 Change all callers. Layout deferred sections.
12017 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12018 references.
12019 (Plugin_hook::run): Move code from do_plugin_hook inline.
12020 (Plugin_hook::do_plugin_hook): Remove.
12021 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12022 (Plugin_manager::finish): Renamed, was cleanup.
12023 (Plugin_manager::should_defer_layout): New function.
12024 (Plugin_manager::add_deferred_layout_object): New function.
12025 (Plugin_manager::Deferred_layout_list): New type.
12026 (Plugin_manager::deferred_layout_objects_): New field.
12027 (Plugin_hook::do_plugin_hook): Remove.
12028
12029 2008-12-17 Ian Lance Taylor <iant@google.com>
12030
12031 * options.h (class General_options): Add --no case for
12032 --export-dynamic.
12033
12034 2008-12-16 Cary Coutant <ccoutant@google.com>
12035
12036 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12037 vector.
12038 (Plugin_manager::claim_file): Create plugin object even if
12039 plugin did not call the add_symbols callback.
12040 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12041 asking for more symbols than were added.
12042 * testsuite/Makefile.am (plugin_test_1): Add test case with
12043 no global symbols.
12044 (empty.syms): New target.
12045 * testsuite/Makefile.in: Regenerate.
12046 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12047 message. Don't call add_symbols if no globals.
12048 (all_symbols_read_hook): Don't provide replacement for empty
12049 claimed file.
12050
12051 2008-12-12 Ian Lance Taylor <iant@google.com>
12052
12053 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12054 r_type == 0 for a local symbol with r_sym == 0.
12055 (scan_relocatable_relocs): Pass r_sym to
12056 local_non_section_strategy.
12057 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12058 r_sym parameter.
12059
12060 * configure.ac: Update test for TLS descriptors: they are
12061 supported as of glibc 2.9.
12062 * configure: Rebuild.
12063
12064 2008-12-11 Ian Lance Taylor <iant@google.com>
12065
12066 PR 7091
12067 * target-reloc.h (Default_scan_relocatable_relocs): For each
12068 function, map r_type == 0 to RELOC_DISCARD.
12069
12070 2008-12-10 Cary Coutant <ccoutant@google.com>
12071
12072 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12073 object to override a kept COMDAT group from a plugin object.
12074
12075 2008-12-09 Ian Lance Taylor <iant@google.com>
12076
12077 PR 7088
12078 * yyscript.y (file_cmd): Handle INPUT.
12079
12080 * testsuite/initpri1.c: Change all declarations to be full
12081 prototypes by adding void, to avoid compiler warnings.
12082
12083 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
12084
12085 * options.cc (General_options::parse_plugin_opt): New.
12086 (General_options::add_plugin): The argument now is just the filename.
12087 (General_options::add_plugin_option): New.
12088 * options.h (plugin_opt): New.
12089 (add_plugin): Change argument name.
12090 (add_plugin_option): New.
12091 * plugin.cc (Plugin::load): Don't parse the plugin option.
12092 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12093 (Plugin::add_option): New.
12094 (Plugin::args_): Change type.
12095 (Plugin::filename_): New.
12096 (Plugin_manager::add_plugin_option): New.
12097 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12098 * testsuite/Makefile.in: Regenerate.
12099
12100 2008-12-05 Cary Coutant <ccoutant@google.com>
12101
12102 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12103 Handle --strip-lto-sections option.
12104 * options.h (strip_lto_sections): New option.
12105
12106 2008-12-01 Cary Coutant <ccoutant@google.com>
12107
12108 * plugin.cc (ld_plugin_message): Change format parameter to const.
12109 Fix mismatch between new[] and delete.
12110
12111 2008-11-14 Cary Coutant <ccoutant@google.com>
12112
12113 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12114 instead of -1U.
12115
12116 2008-11-05 Craig Silverstein <csilvers@google.com>
12117
12118 * options.cc (General_options::parse_dynamic_list): New function.
12119 * options.h (General_options): New flags dynamic_list,
12120 dynamic_list_data, dynamic_list_cpp_new, and
12121 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12122 (General_options::in_dynamic_list): New function.
12123 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12124 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12125 (Lex::can_continue_name): Likewise.
12126 (yylex): Likewise.
12127 (read_script_file): New parameter script_options.
12128 (read_dynamic_list): New function.
12129 (Script_options::define_dynamic_list): New function.
12130 (dynamic_list_keyword_parsecodes): New variable.
12131 (dynamic_list_keywords): New variable.
12132 * script.h (Script_options::define_dynamic_list): New function
12133 prototype.
12134 (read_dynamic_list): New function prototype.
12135 * symtab.cc (strprefix): New macro.
12136 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12137 dynamic_list_data, dynamic_list_cpp_new, and
12138 dynamic_list_cpp_typeinfo.
12139 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12140 (dynamic_list_expr): New rule.
12141 (dynamic_list_nodes): Likewise.
12142 (dynamic_list_node): Likewise.
12143 * testsuite/Makefile.am (dynamic_list): New test.
12144 * testsuite/Makefile.in: Regenerated.
12145 * testsuite/dynamic_list.t: New file.
12146 * testsuite/dynamic_list.sh: New file.
12147
12148 2008-11-05 Craig Silverstein <csilvers@google.com>
12149
12150 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12151 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12152 (t11_last): Likewise.
12153 * testsuite/ver_test_6.c (main): Likewise.
12154
12155 2008-10-07 Cary Coutant <ccoutant@google.com>
12156
12157 * options.c (General_options::finalize): Add check for -static and
12158 -shared.
12159 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12160 is not empty.
12161
12162 2008-10-02 Cary Coutant <ccoutant@google.com>
12163
12164 * plugin.cc (make_sized_plugin_object): Fix conditional
12165 compilation to work when not all targets are enabled.
12166
12167 2008-09-29 Cary Coutant <ccoutant@google.com>
12168
12169 * archive.cc (Archive::get_file_and_offset): Use filename instead
12170 of name to get library path.
12171 (Archive::include_member): Unlock external member of a thin archive.
12172
12173 * testsuite/Makefile.am (TEST_AR): New variable.
12174 (thin_archive_test_1): New test.
12175 (thin_archive_test_2): New test.
12176 * testsuite/Makefile.in: Regenerate.
12177 * testsuite/thin_archive_main.cc: New file.
12178 * testsuite/thin_archive_test_1.cc: New file.
12179 * testsuite/thin_archive_test_2.cc: New file.
12180 * testsuite/thin_archive_test_3.cc: New file.
12181 * testsuite/thin_archive_test_4.cc: New file.
12182
12183 2008-09-29 Cary Coutant <ccoutant@google.com>
12184
12185 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12186 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12187 instead of -1U.
12188 (Sized_relobj::do_finalize_local_symbols): Likewise.
12189 (Sized_relobj::map_to_kept_section): Likewise.
12190 * object.h (Sized_relobj::invalid_address): New constant.
12191 (Sized_relobj::do_output_section_offset): Check for invalid_address
12192 and return -1ULL.
12193 * output.cc (Output_reloc::local_section_offset): Use constant
12194 invalid_address instead of -1U.
12195 (Output_reloc::get_address): Likewise.
12196 (Output_section::output_address): Change -1U to -1ULL.
12197 * output.h (Output_reloc::invalid_address): New constant.
12198 * reloc.cc (Sized_relobj::write_sections): Use constant
12199 invalid_address instead of -1U.
12200 (Sized_relobj::relocate_sections): Likewise.
12201 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12202 values for merge sections.
12203 * target-reloc.h (relocate_for_relocatable): Use constant
12204 invalid_address instead of -1U.
12205
12206 2008-09-19 Cary Coutant <ccoutant@google.com>
12207
12208 Add plugin functionality for link-time optimization (LTO).
12209 * configure.ac (plugins): Add --enable-plugins option.
12210 * configure: Regenerate.
12211 * config.in: Regenerate.
12212 * Makefile.am (LIBDL): New variable.
12213 (CCFILES): Add plugin.cc.
12214 (HFILES): Add plugin.h.
12215 (ldadd_var): Add LIBDL.
12216 * Makefile.in: Regenerate.
12217
12218 * archive.cc: Include "plugin.h".
12219 (Archive::setup): Don't preread archive symbols when using a plugin.
12220 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12221 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12222 files.
12223 (Archive::include_member): Add symbols from plugin objects.
12224 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12225 * descriptors.cc (Descriptors::open): Check for file descriptors
12226 abandoned by plugins.
12227 (Descriptors::claim_for_plugin): New function.
12228 * descriptors.h (Descriptors::claim_for_plugin): New function.
12229 (Open_descriptor::is_claimed): New field.
12230 (claim_descriptor_for_plugin): New function.
12231 * fileread.cc (File_read::claim_for_plugin): New function.
12232 * fileread.h (File_read::claim_for_plugin): New function.
12233 (File_read::descriptor): New function.
12234 * gold.cc: Include "plugin.h".
12235 (queue_initial_tasks): Add task to call plugin hooks for generating
12236 new object files.
12237 * main.cc: Include "plugin.h".
12238 (main): Load plugin libraries.
12239 * object.h (Pluginobj): Declare.
12240 (Object::pluginobj): New function.
12241 (Object::do_pluginobj): New function.
12242 (Object::set_target): New function.
12243 * options.cc: Include "plugin.h".
12244 (General_options::parse_plugin): New function.
12245 (General_options::General_options): Initialize plugins_ field.
12246 (General_options::add_plugin): New function.
12247 * options.h (Plugin_manager): Declare.
12248 (General_options): Add --plugin option.
12249 (General_options::has_plugins): New function.
12250 (General_options::plugins): New function.
12251 (General_options::add_plugin): New function.
12252 (General_options::plugins_): New field.
12253 * plugin.cc: New file.
12254 * plugin.h: New file.
12255 * readsyms.cc: Include "plugin.h".
12256 (Read_symbols::do_read_symbols): Check for archive before checking
12257 for ELF file. Call plugin hooks to claim files.
12258 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12259 from a real object file; force override when processing replacement
12260 files.
12261 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12262 (Symbol::init_base_object): Likewise.
12263 (Symbol::init_base_output_data): Likewise.
12264 (Symbol::init_base_output_segment): Likewise.
12265 (Symbol::init_base_constant): Likewise.
12266 (Symbol::init_base_undefined): Likewise.
12267 (Symbol::output_section): Assert that object is not a plugin.
12268 (Symbol_table::add_from_pluginobj): New function.
12269 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12270 undefined.
12271 (Symbol_table::sized_write_globals): Likewise.
12272 (Symbol_table::add_from_pluginobj): Instantiate template.
12273 * symtab.h (Sized_pluginobj): Declare.
12274 (Symbol::in_real_elf): New function.
12275 (Symbol::set_in_real_elf): New function.
12276 (Symbol::in_real_elf_): New field.
12277 (Symbol_table::add_from_pluginobj): New function.
12278
12279 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12280 (LIBDL): New variable.
12281 (LDADD): Add LIBDL.
12282 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12283 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12284 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12285 (MOSTLYCLEANFILES): Likewise.
12286 * testsuite/Makefile.in: Regenerate.
12287 * testsuite/plugin_test.c: New file.
12288 * testsuite/plugin_test_1.sh: New file.
12289 * testsuite/plugin_test_2.sh: New file.
12290
12291 2008-09-16 Ian Lance Taylor <iant@google.com>
12292
12293 * target-reloc.h (relocate_section): Check whether a symbol is
12294 defined by the ABI before reporting an undefined symbol error.
12295 * target.h (Target::is_defined_by_abi): Make parameter const.
12296 (Target::do_is_defined_by_abi): Likewise.
12297 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12298 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12299 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12300 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12301 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12302 * testsuite/Makefile.in: Rebuild.
12303
12304 * fileread.cc (make_view): Add casts to avoid warning.
12305
12306 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12307
12308 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12309 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12310
12311 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12312
12313 * options.h (General_options::output_is_executable): New.
12314 (General_options::output_is_pie): New.
12315 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12316 for shared libraries.
12317 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12318
12319 2008-09-11 Chris Demetriou <cgd@google.com>
12320
12321 * options.h (origin): New -z option.
12322 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12323 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12324 in DT_FLAGS_1.
12325
12326 2008-09-05 Cary Coutant <ccoutant@google.com>
12327
12328 * fileread.cc (File_read::make_view): Add check for attempt to map
12329 beyond end of file.
12330
12331 2008-09-05 Cary Coutant <ccoutant@google.com>
12332
12333 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12334 explicit instantiations.
12335
12336 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12337
12338 PR gold/6858
12339 * options.cc (General_options::finalize): Allow undefined symbols
12340 in shlibs if linking -shared.
12341
12342 PR gold/6859
12343 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12344 symbols as not needing a dynsym entry.
12345
12346 2008-08-20 Craig Silverstein <csilvers@google.com>
12347
12348 * fileread.cc (File_read::open): Do not lock the file unless it
12349 was successfully opened.
12350
12351 2008-08-14 Cary Coutant <ccoutant@google.com>
12352
12353 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12354 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12355 * testsuite/tls_test.cc (struct int128): 128-bit struct
12356 for testing TLS relocs with non-zero addend.
12357 (v12): New TLS variable.
12358 (t12): New test.
12359 (t_last): Add check for v12.
12360 * testsuite/tls_test.h (t12): New function.
12361 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12362
12363 2008-08-13 Ian Lance Taylor <iant@google.com>
12364
12365 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12366 set tls_segment_ or relro_segment_.
12367 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12368 when appropriate.
12369 * output.h (Output_section::clear_is_relro): New function.
12370 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12371 sections specially even when output_data_ is empty.
12372 (Output_segment::maximum_alignment): When first section is relro,
12373 only force alignment for PT_LOAD segments.
12374 * script.cc (script_data_segment_align): New function.
12375 (script_data_segment_relro_end): New function.
12376 * script-c.h (script_data_segment_align): Declare.
12377 (script_data_segment_relro_end): Declare.
12378 * script-sections.h (class Script_sections): Declare
12379 data_segment_align and data_segment_relro_end. Add fields
12380 segment_align_index_ and saw_relro_end_.
12381 * script-sections.cc (class Sections_element): Add set_is_relro
12382 virtual function. Add new bool* parameter to place_orphan_here.
12383 Add get_output_section virtual function.
12384 (class Output_section_definition): Add set_is_relro. Add new
12385 bool* parameter to place_orphan_here. Add get_output_section.
12386 Add is_relro_ field.
12387 (Output_section_definition::Output_section_definition): Initialize
12388 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12389 and is_relro_ fields.
12390 (Output_section_definition::place_orphan_here): Add is_relro
12391 parameter.
12392 (Output_section_definition::set_section_addresses): Set relro for
12393 output section.
12394 (Output_section_definition::alternate_constraint): Likewise.
12395 (class Orphan_output_section): Add new bool* parameter to
12396 place_orphan_here. Add get_output_section.
12397 (Orphan_output_section::place_orphan_here): Add is_relro
12398 parameter.
12399 (Script_sections::Script_sections): Initialize
12400 data_segment_align_index_ and saw_relro_end_.
12401 (Script_sections::data_segment_align): New function.
12402 (Script_sections::data_segment_relro_end): New function.
12403 (Script_sections::place_orphan): Set or clear is_relro.
12404 (Script_sections::set_section_addresses): Force alignment of first
12405 TLS section.
12406 * yyscript.y (exp): Call script_data_segment_align and
12407 script_data_segment_relro_end.
12408 * testsuite/relro_script_test.t: New file.
12409 * testsuite/relro_test.cc (using_script): Declare.
12410 (t1, t2): Test using_script.
12411 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12412 (relro_script_test_SOURCES): Define.
12413 (relro_script_test_DEPENDENCIES): Define.
12414 (relro_script_test_LDFLAGS): Define.
12415 (relro_script_test_LDADD): Define.
12416 (relro_script_test.so): New target.
12417 * testsuite/Makefile.in: Rebuild.
12418
12419 2008-08-06 Cary Coutant <ccoutant@google.com>
12420
12421 * archive.cc (Archive::total_archives, Archive::total_members)
12422 (Archive::total_members_loaded): New variables.
12423 (Archive::setup): Add parameter. Add option to preread
12424 archive symbols.
12425 (Archive::read_armap): Add counter.
12426 (Archive::get_file_and_offset): New function.
12427 (Archive::get_elf_object_for_member): New function.
12428 (Archive::read_all_symbols): New function.
12429 (Archive::read_symbols): New function.
12430 (Archive::add_symbols): Add counters.
12431 (Archive::include_all_members): Use armap to find members if it's
12432 already built.
12433 (Archive::include_member): Skip reading symbols if already read.
12434 Factored code into Archive::get_file_and_offset and
12435 Archive::get_elf_object_for_member. Changed call to
12436 Mapfile::report_include_archive_member.
12437 (Archive::print_stats): New function.
12438 * archive.h: Declare Object and Read_symbols_data classes.
12439 (Archive::Archive): Add initializers for new members.
12440 (Archive::setup): Add parameter.
12441 (Archive::print_stats): New function.
12442 (Archive::total_archives, Archive::total_members)
12443 (Archive::total_members_loaded): New variables.
12444 (Archive::get_file_and_offset): New function.
12445 (Archive::get_elf_object_for_member): New function.
12446 (Archive::read_all_symbols): New function.
12447 (Archive::read_symbols): New function.
12448 (Archive::Archive_member): New class.
12449 (Archive::members_): New member.
12450 (Archive::num_members_): New member.
12451 * main.cc: Include archive.h.
12452 (main): Call Archive::print_stats.
12453 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12454 archive parameter; member_name is now the fully-decorated name.
12455 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12456 * options.h: (General_options): Add --preread-archive-symbols option.
12457 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12458 Archive::setup.
12459
12460 2008-08-04 Ian Lance Taylor <iant@google.com>
12461
12462 * symtab.h (Symbol::use_plt_offset): New function.
12463 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12464 * powerpc.cc (Relocate::relocate): Likewise.
12465 * sparc.cc (Relocate::relocate): Likewise.
12466 * x86_64.cc (Relocate::relocate): Likewise.
12467 * testsuite/weak_plt.sh: New test.
12468 * testsuite/weak_plt_main.cc: New test.
12469 * testsuite/weak_plt_shared.cc: New test.
12470 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12471 (check_PROGRAMS): Add weak_plt.
12472 (check_DATA): Add weak_plt_shared.so.
12473 (weak_plt_main_pic.o, weak_plt): New targets.
12474 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12475 * testsuite/Makefile.in: Rebuild.
12476
12477 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12478 gcctestdir/ld.
12479 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12480 * testsuite/Makefile.in: Rebuild.
12481
12482 2008-08-04 Alan Modra <amodra@bigpond.net.au>
12483
12484 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12485 * Makefile.in: Regenerate.
12486 * po/POTFILES.in: Regenerate.
12487
12488 2008-07-29 Ian Lance Taylor <iant@google.com>
12489
12490 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12491 symbols before other symbols.
12492 * testsuite/script_test_2.cc (test_addr): Declare.
12493 (test_addr_alias): Declare.
12494 (main): Check that test_addr and test_addr_alias have the right
12495 values.
12496 * testsuite/script_test_2.t: Define test_addr_alias and
12497 test_addr.
12498
12499 2008-07-24 Ian Lance Taylor <iant@google.com>
12500
12501 PR 5990
12502 * descriptors.cc: New file.
12503 * descriptors.h: New file.
12504 * gold-threads.h (class Hold_optional_lock): New class.
12505 * fileread.cc: Include "descriptors.h".
12506 (File_read::~File_read): Release descriptor rather than closing
12507 it.
12508 (File_read::open) [file]: Call open_descriptor rather than open.
12509 Set is_descriptor_opened_.
12510 (File_read::open) [memory]: Assert that descriptor is not open.
12511 (File_read::reopen_descriptor): New function.
12512 (File_read::release): Release descriptor.
12513 (File_read::do_read): Make non-const. Reopen descriptor.
12514 (File_read::read): Make non-const.
12515 (File_read::make_view): Reopen descriptor.
12516 (File_read::do_readv): Likewise.
12517 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12518 Update declarations.
12519 * layout.cc: Include "descriptors.h".
12520 (Layout::create_build_id): Use open_descriptor rather than open.
12521 * output.cc: Include "descriptors.h".
12522 (Output_file::open): Use open_descriptor rather than open.
12523 * archive.cc (Archive::const_iterator): Change Archive to be
12524 non-const.
12525 (Archive::begin, Archive::end): Make non-const.
12526 (Archive::count_members): Likewise.
12527 * archive.h (class Archive): Update declarations.
12528 * object.h (Object::read): Make non-const.
12529 * Makefile.am (CCFILES): Add descriptors.cc.
12530 (HFILES): Add descriptors.h.
12531 * Makefile.in: Rebuild.
12532
12533 PR 6716
12534 * gold.h: Always include <clocale>. Add Solaris workarounds
12535 following code in binutils/sysdep.h.
12536
12537 PR 6048
12538 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12539 this->eh_frame_hdr_ is NULL before using it.
12540
12541 * dynobj.cc (Versions::Versions): Update comment.
12542
12543 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12544 the base version name.
12545
12546 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12547 array size plus one.
12548 (Stringpool_template::set_string_offsets): Subtract one from key
12549 before using it as an array index.
12550 (Stringpool_template::get_offset_with_length): Likewise.
12551 (Stringpool_template::write_to_buffer): Likewise.
12552 * stringpool.h (Stringpool_template::get_offset_from_key):
12553 Likewise.
12554
12555 2008-07-23 Ian Lance Taylor <iant@google.com>
12556
12557 PR 6658
12558 * object.h (Merged_symbol_value::value): Do our best to handle a
12559 negative addend.
12560
12561 PR 6647
12562 * script.cc (Version_script_info::get_versions): Don't add empty
12563 version tag to return value.
12564 (Version_script_info::get_symbol_version_helper): Change return
12565 type to bool. Add pversion parameter. Change all callers.
12566 (script_register_vers_node): Don't require a non-NULL tag.
12567 * script.h (class Version_script_info): Update declarations.
12568 (Version_script_info::get_symbol_version): Change return type to
12569 bool. Add version parameter. Change all callers.
12570 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12571 handling. Handle an empty version from a version script.
12572 (Symbol_table::define_special_symbol): Likewise.
12573 * testsuite/ver_test_10.script: New file.
12574 * testsuite/ver_test_10.sh: New file.
12575 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12576 (check_DATA): Add ver_test_10.syms.
12577 (ver_test_10.syms, ver_test_10.so): New target.
12578 * testsuite/Makefile.in: Rebuild.
12579
12580 2008-07-23 Simon Baldwin <simonb@google.com>
12581
12582 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12583 to zero for undefined symbols from dynamic libraries.
12584
12585 2008-07-23 Ian Lance Taylor <iant@google.com>
12586
12587 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12588 Change all callers.
12589 * symtab.h (class Symbol_table): Update declaration.
12590 * testsuite/ver_test_9.cc: New file.
12591 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12592 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12593 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12594 (ver_test_9.so, ver_test_9.o): New targets.
12595 * testsuite/Makefile.in: Rebuild.
12596
12597 2008-07-22 Ian Lance Taylor <iant@google.com>
12598
12599 * options.h (class General_options): Define --check-sections.
12600 * layout.cc (Layout::set_segment_offsets): Handle
12601 --check-sections.
12602
12603 * options.h (class General_options): Define -n/--nmagic and
12604 -N/--omagic.
12605 * options.cc (General_options::finalize): For -n/--nmagic or
12606 -N/--omagic, set -static.
12607 * layout.cc (Layout::attach_allocated_section_to_segment): If
12608 -N/--omagic, don't put read-only and read-write sections in
12609 different segments.
12610 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12611 finding a read-only segment.
12612 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12613 don't set the minimum segment alignment to the common page size,
12614 and don't set the file offset to the address modulo the page size.
12615 * script-sections.cc (Script_sections::create_segments): If
12616 -n/--omagic, don't put read-only and read-write sections in
12617 different segments.
12618
12619 * cref.cc: New file.
12620 * cref.h: New file.
12621 * options.h (class General_options): Add --print-symbol-counts.
12622 * main.cc (main): Issue defined symbol report if requested.
12623 * archive.cc (Archive::interpret_header): Make into a const member
12624 function.
12625 (Archive::add_symbols): Call Input_objects::archive_start and
12626 archive_stop.
12627 (Archive::const_iterator): Define new class.
12628 (Archive::begin, Archive::end): New functions.
12629 (Archive::include_all_members): Rewrite to use iterator.
12630 (Archive::count_members): New function.
12631 * archive.h (class Archive): Update declarations.
12632 (Archive::filename): New function.
12633 * object.cc: Include "cref.h".
12634 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12635 (Sized_relobj::do_get_global_symbol_counts): New function.
12636 (Input_objects::add_object): Add object to cross-referencer.
12637 (Input_objects::archive_start): New function.
12638 (Input_objects::archive_stop): New function.
12639 (Input_objects::print_symbol_counts): New function.
12640 * object.h: Declare Cref and Archive.
12641 (Object::get_global_symbol_counts): New function.
12642 (Object::do_get_global_symbol_counts): New pure virtual function.
12643 (class Sized_relobj): Add defined_count_ field. Update
12644 declarations.
12645 (class Input_objects): Add cref_ field. Update constructor.
12646 Update declarations.
12647 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12648 defined_count_.
12649 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12650 symbol counts.
12651 (Sized_dynobj::do_get_global_symbol_counts): New function.
12652 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12653 defined_count_. Update declarations. Define Symbols typedef.
12654 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12655 parameter. Change all callers.
12656 (Symbol_table::add_from_dynobj): Add sympointers and defined
12657 parameters. Change all callers.
12658 * symtab.h (class Symbol_table): Update declarations.
12659 * Makefile.am (CCFILES): Add cref.cc.
12660 (HFILES): Add cref.h.
12661 * Makefile.in: Rebuild.
12662
12663 2008-07-22 Simon Baldwin <simonb@google.com>
12664
12665 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12666 to zero when writing undefined symbols.
12667
12668 2008-07-22 Ian Lance Taylor <iant@google.com>
12669
12670 * output.cc (Output_section::add_input_section): Don't try to
12671 merge empty merge sections.
12672
12673 2008-07-21 Craig Silverstein <csilvers@google.com>
12674
12675 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12676 Include symbol version in error message.
12677
12678 2008-07-20 Chris Demetriou <cgd@google.com>
12679
12680 * configure.ac (gold_cv_c_random_seed): New configured variable.
12681 (RANDOM_SEED_CFLAGS): New substituted variable.
12682 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12683 * configure: Rebuild.
12684 * Makefile.in: Likewise.
12685 * testsuite/Makefile.in: Likewise.
12686
12687 2008-07-18 Ian Lance Taylor <iant@google.com>
12688
12689 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12690 where we see NAME/NULL and NAME/VERSION as separate symbols.
12691 * testsuite/ver_test_main.cc (main): Call t4.
12692 (t4, t4_2a): Define.
12693 * testsuite/ver_test_2.cc (t4_2): Define.
12694 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12695 * testsuite/ver_test_4.cc (t4_2a): Define.
12696 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12697 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12698
12699 2008-07-17 Ian Lance Taylor <iant@google.com>
12700
12701 * dynobj.cc (Versions::add_def): If we give an error about a
12702 missing version, go ahead and create the version anyhow.
12703
12704 2008-07-10 Ian Lance Taylor <iant@google.com>
12705
12706 Handle output sections with more than 0x7fffffff bytes.
12707 * object.h (class Relobj): Change map_to_output_ to
12708 output_sections_, and just keep a section pointer. Change all
12709 uses. Move comdat group support to Sized_relobj.
12710 (Relobj::is_section_specially_mapped): Remove.
12711 (Relobj::output_section): Remove poff parameter. Change all
12712 callers.
12713 (Relobj::output_section_offset): New function.
12714 (Relobj::set_section_offset): Rewrite.
12715 (Relobj::map_to_output): Remove.
12716 (Relobj::output_sections): New function.
12717 (Relobj::do_output_section_offset): New pure virtual function.
12718 (Relobj::do_set_section_offset): Likewise.
12719 (class Sized_relobj): Add section_offsets_ field. Add comdat
12720 group support from Relobj. Update declarations.
12721 (Sized_relobj::get_output_section_offset): New function.
12722 (Sized_relobj::do_output_section_offset): New function.
12723 (Sized_relobj::do_set_section_offset): New function.
12724 * object.cc (Relobj::output_section_address): Remove.
12725 (Sized_relobj::Sized_relobj): Initialize new fields.
12726 (Sized_relobj::include_section_group): Cast find_kept_object to
12727 Sized_relobj.
12728 (Sized_relobj::include_linkonce_section): Likewise.
12729 (Sized_relobj::do_layout): Use separate arrays for output section
12730 and output offset.
12731 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12732 output_sections.
12733 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12734 output_sections and section_offsets.
12735 (Sized_relobj::write_local_symbols): Likewise.
12736 (map_to_kept_section): Compute output address directly.
12737 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12738 output_sections and section_offsets.
12739 (Sized_relobj::write_sections): Likewise.
12740 (Sized_relobj::relocate_sections): Likewise.
12741 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12742 * output.h (class Output_reloc): Update declarations. Change
12743 u2_.relobj to Sized_relobj*.
12744 (class Output_data_reloc): Change add functions to use
12745 Sized_relobj*.
12746 * output.cc (Output_reloc::Output_reloc): Change relobj to
12747 Sized_relobj*.
12748 (Output_reloc::local_section_offset): Change return type to
12749 Elf_Addr. Use get_output_section_offset.
12750 (Output_reloc::get_address): Likewise.
12751 (Output_section::is_input_address_mapped): Don't call
12752 is_section_specially_mapped.
12753 (Output_section::output_offset): Likewise.
12754 (Output_section::output_address): Likewise.
12755 (Output_section::starting_output_address): Likewise.
12756 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12757 parameter to Sized_relobj*.
12758 (Copy_relocs::need_copy_reloc): Likewise.
12759 (Copy_relocs::save): Likewise.
12760 * copy-relocs.h (class Copy_relocs): Update declarations.
12761 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12762 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12763 * target-reloc.h (relocate_for_relocatable): Change
12764 offset_in_output_section type to Elf_Addr. Change code that uses
12765 it as well.
12766 * layout.cc (Layout::layout): Always set *off.
12767 * mapfile.cc (Mapfile::print_input_section): Use
12768 output_section_offset.
12769 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12770 Sized_relobj*.
12771 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12772 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12773 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12774
12775 2008-07-03 Ian Lance Taylor <iant@google.com>
12776
12777 * layout.cc (Layout::include_section): Do not discard unrecognized
12778 SHT_STRTAB sections.
12779
12780 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12781
12782 * script.cc (Lex::can_continue_name): Make '?' allowable in
12783 version-script names.
12784 * testsuite/version_script.map: Change glob pattern to use '?'
12785
12786 2008-06-30 Manish Singh <yosh@gimp.org>
12787
12788 PR 6585
12789 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12790 Correct typo.
12791
12792 2008-06-30 Ian Lance Taylor <iant@google.com>
12793
12794 PR 6660
12795 PR 6682
12796 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12797 versions]: Don't try to read the value in the contents, since we
12798 don't use it. Use the template endianness when writing.
12799
12800 2008-06-25 Cary Coutant <ccoutant@google.com>
12801
12802 * fileread.cc (File_read::make_view): Assert on zero-length view.
12803 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12804 symbol table when there are no symbols to read.
12805
12806 2008-06-23 Craig Silverstein <csilvers@google.com>
12807
12808 * version.cc (version_string): Bump to 1.7
12809
12810 2008-06-18 Craig Silverstein <csilvers@google.com>
12811
12812 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12813 constant 0xFFFF to type Valtype.
12814 (Powerpc_relocate_functions::rel16_ha): Likewise.
12815
12816 2008-06-17 Ian Lance Taylor <iant@google.com>
12817
12818 * output.h (Output_section::Input_section): Initialize p2align_ to
12819 zero for Output_section_data constructors.
12820 (Output_section::Input_section::addralign): If not an input
12821 section, return the alignment of the Output_section_data.
12822 * testsuite/copy_test.cc: New file.
12823 * testsuite/copy_test_1.cc: New file.
12824 * testsuite/copy_test_2.cc: New file.
12825 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12826 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12827 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12828 (copy_test_1_pic.o, copy_test_1.so): New targets.
12829 (copy_test_2_pic.o, copy_test_2.so): New targets.
12830 * testsuite/Makefile.in: Rebuild.
12831
12832 * script-sections.cc (Script_sections::place_orphan): Initialize
12833 local variable exact.
12834
12835 2008-06-13 David Edelsohn <edelsohn@gnu.org>
12836
12837 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12838
12839 2008-06-12 David Edelsohn <edelsohn@gnu.org>
12840 David S. Miller <davem@davemloft.net>
12841
12842 * powerpc.cc: New file.
12843 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12844 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12845 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12846 * Makefile.in: Rebuild.
12847
12848 2008-06-09 Ian Lance Taylor <iant@google.com>
12849
12850 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12851 <exception>.
12852 (throwing, orig_terminate): New static variables.
12853 (terminate_handler): New static function.
12854 (t2): Set terminate handler.
12855
12856 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12857
12858 PR 6584
12859 * binary.cc (Binary_to_elf::sized_convert): Fix .data
12860 alignment.
12861
12862 2008-05-30 Cary Coutant <ccoutant@google.com>
12863
12864 * archive.cc (Archive::include_all_members) Correct to step
12865 over symbol table and extended name table in thin archives.
12866
12867 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12868
12869 PR 6407
12870 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12871 calculation.
12872
12873 2008-05-28 Caleb Howe <cshowe@google.com>
12874
12875 * reduced_debug_output.cc: New file.
12876 * reduced_debug_output.h: New file.
12877 * options.h (class General_options): Add --strip-debug-non-line.
12878 * options.cc (General_options::finalize): Add strip_debug_non_line
12879 to the strip heirarchy.
12880 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12881 fields.
12882 * layout.cc: Include "reduced_debug_output.h".
12883 (Layout::Layout): Initialize new fields.
12884 (line_only_debug_sections): New static array.
12885 (is_lines_only_debug_sections): New static inline function.
12886 (Layout::include_section): Handle --strip-debug-non-line.
12887 (Layout::make_output_section): If --strip-debug-non-line, build
12888 new output sections for .debug_abbrev and .debug_info.
12889 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12890 gold. Warn about possible overflow.
12891 (read_signed_LEB_128): Likewise.
12892 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12893 (read_signed_LEB_128): Declare.
12894 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12895 (HFILES): Add reduced_debug_output.h.
12896 * Makefile.in: Rebuild.
12897
12898 2008-05-21 Ian Lance Taylor <iant@google.com>
12899
12900 * mapfile.cc: New file.
12901 * mapfile.h: New file.
12902 * options.h (class General_options): Add -M/--print-map and -Map.
12903 * options.cc (General_options::finalize): Make -M equivalent to
12904 -Map -.
12905 * main.cc: Include <cstdio> and "mapfile.h".
12906 (main): Open mapfile if requested.
12907 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12908 constructor. Change caller.
12909 (queue_initial_tasks): Add mapfile parameter. Change caller.
12910 (queue_middle_tasks): Likewise.
12911 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12912 declarations.
12913 * archive.cc: Include "mapfile.h".
12914 (Archive::add_symbols): Add mapfile parameter. Change all
12915 callers. Pass mapfile, symbol, and reason to include_member.
12916 (Archive::include_all_members): Add mapfile parameter. Change all
12917 callers.
12918 (Archive::include_member): Add mapfile, sym, and why parameters.
12919 Change all callers. Report inclusion to map file.
12920 * archive.h: Include "fileread.h".
12921 (class Archive): Update declarations.
12922 (Archive::file): New const method.
12923 (class Add_archive_symbols): Add mapfile_ field. Update
12924 constructor. Change all callers.
12925 * readsyms.h (class Read_symbols): Likewise.
12926 (class Finish_group): Likewise.
12927 (class Read_script): Likewise.
12928 * common.cc: Include "mapfile.h".
12929 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12930 all callers.
12931 (Symbol_table::do_allocate_commons): Likewise.
12932 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12933 symbol allocation to mapfile.
12934 * common.h (class Allocate_commons_task): Add mapfile_ field.
12935 Update constructor. Change all callers.
12936 * symtab.h (class Symbol_table): Update declarations.
12937 * layout.cc: Include "mapfile.h".
12938 (Layout_task_runner::run): Print information to mapfile.
12939 (Layout::create_gold_note): Change Output_data_fixed_space to
12940 Output_data_zero_fill.
12941 (Layout::create_build_id): Likewise.
12942 (Layout::print_to_mapfile): New function.
12943 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12944 constructor. Change caller.
12945 (class Layout): Declare print_to_mapfile.
12946 * output.cc (Output_section::Input_section::print_to_mapfile): New
12947 function.
12948 (Output_section::add_input_section): If producing a map, always
12949 add to input_sections_ list.
12950 (Output_section::do_print_to_mapfile): New function.
12951 (Output_segment::print_sections_to_mapfile): New function.
12952 (Output_segment::print_section_list_to_mapfile): New function.
12953 * output.h: Include "mapfile.h".
12954 (Output_data::print_to_mapfile): New function.
12955 (Output_data::do_print_to_mapfile): New virtual function.
12956 (Output_segment_headers::do_print_to_mapfile): New function.
12957 (Output_file_header::do_print_to_mapfile): New function.
12958 (Output_data_const::do_print_to_mapfile): New function.
12959 (class Output_data_const_buffer): Add map_name_ field. Update
12960 constructor. Change all callers. Add do_print_to_mapfile
12961 function.
12962 (class Output_data_fixed_space): Likewise.
12963 (class Output_data_space): Likewise.
12964 (class Output_data_zero_fill): New class.
12965 (Output_data_strtab::do_print_to_mapfile): New function.
12966 (Output_data_reloc_base::do_print_to_mapfile): New function.
12967 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12968 (Output_data_group::do_print_to_mapfile): New function.
12969 (Output_data_got::do_print_to_mapfile): New function.
12970 (Output_data_dynamic::do_print_to_mapfile): New function.
12971 (Output_symtab_xindex::do_print_to_mapfile): New function.
12972 (class Output_section): Declare do_print_to_mapflie. Declare
12973 print_to_mapfile in Input_section.
12974 (class Output_segment): Declare new functions.
12975 * object.h (Sized_relobj::symbol_count): New function.
12976 * script-sections.cc
12977 (Output_section_element_dot_assignment::set_section_addresses):
12978 Change Output_data_fixed_space to Output_data_zero_fill.
12979 (Output_data_expression::do_print_to_mapfile): New function.
12980 * script.cc (read_input_script): Add mapfile parameter. Change
12981 all callers.
12982 * script.h (read_input_script): Update declaration.
12983 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12984 (Eh_frame::do_print_to_mapfile): New function.
12985 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12986 (Output_merge_string::do_print_to_mapfile): New function.
12987 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12988 function.
12989 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12990 function.
12991 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12992 function.
12993 * Makefile.am (CCFILES): Add mapfile.cc.
12994 (HFILES): Add mapfile.h.
12995 * Makefile.in: Rebuild.
12996
12997 2008-05-19 Ian Lance Taylor <iant@google.com>
12998
12999 * options.h (class General_options): Add -z relro.
13000 * layout.cc (Layout::Layout): Initialize relro_segment_.
13001 (Layout::add_output_section_data): Return the output section.
13002 (Layout::make_output_section): Rcognize relro sections and mark
13003 them appropriately.
13004 (Layout::attach_allocated_section_to_segment): Put relro sections
13005 in a PT_GNU_RELRO segment.
13006 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13007 section as relro.
13008 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13009 PT_TLS segments.
13010 (Layout::linkonce_mapping): Map d.rel.ro.local to
13011 .data.rel.ro.local.
13012 (Layout::output_section_name): Us .data.rel.ro.local for any
13013 section which begins with that.
13014 * layout.h (class Layout): Update add_output_section_data
13015 declaration. Add relro_segment_ field.
13016 * output.cc (Output_section::Output_section): Initialize is_relro_
13017 and is_relro_local_ fields.
13018 (Output_segment::add_output_section): Group relro sections.
13019 (Output_segment::is_first_section_relro): New function.
13020 (Output_segment::maximum_alignment): If there is a relro section,
13021 align the segment to the common page size.
13022 (Output_segment::set_section_addresses): Track whether we are
13023 looking at relro sections. If the last section is a relro
13024 section, align to the common page size.
13025 (Output_segment::set_section_list_addresses): Add in_relro
13026 parameter. Change all callers. Align to the page size when
13027 moving from relro to non-relro section.
13028 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13029 segment.
13030 * output.h (class Output_section): Add is_relro_ and
13031 is_relro_local_ fields.
13032 (Output_section::is_relro): New function.
13033 (Output_section::set_is_relro): New function.
13034 (Output_section::is_relro_local): New function.
13035 (Output_section::set_is_relro_local): New function.
13036 (class Output_segment): Update declarations.
13037 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13038 * sparc.cc (Target_sparc::got_section): Likewise.
13039 * x86_64.cc (Target_x86_64::got_section): Likewise.
13040 * testsuite/relro_test_main.cc: New file.
13041 * testsuite/relro_test.cc: New file.
13042 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13043 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13044 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13045 (relro_test.so, relro_test_pic.o): New targets.
13046 * testsuite/Makefile.in: Rebuild.
13047
13048 2008-05-16 Ian Lance Taylor <iant@google.com>
13049
13050 * output.cc (Output_segment::add_output_section): Remove front
13051 parameter.
13052 * output.h (class Output_segment): Remove
13053 add_initial_output_section and overloaded add_output_section.
13054 Update declaration of remaining add_output_section.
13055 * layout.cc (Layout::create_interp): Call add_output_section
13056 rather than add_initial_output_section.
13057 (Layout::finish_dynamic_section): Likewise.
13058
13059 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13060 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13061 know the dynamic type.
13062 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13063 field. Initialize it in constructor.
13064 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13065 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13066 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13067 reloc.
13068
13069 * output.cc (Output_reloc::get_address): Change return type to
13070 Elf_Addr.
13071 * output.h (class Output_reloc): Update get_address declaration.
13072 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13073 for section addresses.
13074
13075 2008-05-09 Ian Lance Taylor <iant@google.com>
13076
13077 PR 6493
13078 * gold.cc (gold_nomem): Use return value of write.
13079
13080 2008-05-08 Ian Lance Taylor <iant@google.com>
13081
13082 * symtab.c (Symbol::init_base_output_data): Add version
13083 parameter. Change all callers.
13084 (Symbol::init_base_output_segment): Likewise.
13085 (Symbol::init_base_constant): Likewise.
13086 (Symbol::init_base_undefined): Likewise.
13087 (Sized_symbol::init_output_data): Likewise.
13088 (Sized_symbol::init_output_segment): Likewise.
13089 (Sized_symbol::init_constant): Likewise.
13090 (Sized_symbol::init_undefined): Likewise.
13091 (Symbol_table::do_define_in_output_data): If the new symbol has a
13092 version, mark it as the default.
13093 (Symbol_table::do_define_in_output_segment): Likewise.
13094 (Symbol_table::do_define_as_constant): Likewise.
13095 * symtab.h (class Symbol): Update declarations.
13096 (class Sized_symbol): Likewise.
13097 * resolve.cc (Symbol::override_version): New function.
13098 (Symbol::override_base): Call override_version.
13099 (Symbol::override_base_with_special): Likewise.
13100 * testsuite/ver_script_8.script: New file.
13101 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13102 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13103 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13104 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13105
13106 2008-05-06 Ian Lance Taylor <iant@google.com>
13107
13108 PR 6049
13109 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13110 functions.
13111 (class General_options): Remove existing --undefined, and add
13112 --no-undefined instead. Add new --undefined as synonym for -u.
13113 * archive.cc (Archive::add_symbols): Check whether symbol was
13114 named with -u.
13115 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13116 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13117 all uses. Add IS_UNDEFINED. Update declarations to split
13118 different versions of init_base. Declare init_base_undefined.
13119 (Symbol::is_defined): Handle IS_UNDEFINED.
13120 (Symbol::is_undefined): Likewise.
13121 (Symbol::is_weak_undefined): Call is_undefined.
13122 (Symbol::is_absolute): Handle IS_CONSTANT.
13123 (class Sized_symbol): Update declarations to split different
13124 versions of init. Declare init_undefined.
13125 (class Symbol_table): Declare new functions.
13126 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13127 Change all callers.
13128 (Symbol::init_base_output_data): Likewise.
13129 (Symbol::init_base_output_segment): Likewise.
13130 (Symbol::init_base_constant): Likewise.
13131 (Symbol::init_base_undefined): New function.
13132 (Sized_symbol::init_object): Rename from init. Change all
13133 callers.
13134 (Sized_symbol::init_output_data): Likewise.
13135 (Sized_symbol::init_output_segment): Likewise.
13136 (Sized_symbol::init_constant): Likewise.
13137 (Sized_symbol::init_undefined): New function.
13138 (Symbol_table::add_undefined_symbols_from_command_line): New
13139 function.
13140 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13141 function.
13142 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13143 (Symbol::output_section): Likewise.
13144 (Symbol::set_output_section): Likewise.
13145 (Symbol_table::sized_finalize_symbol): Likewise.
13146 (Symbol_table::sized_write_globals): Likewise.
13147 * resolve.cc (Symbol_table::should_override): Likewise.
13148 (Symbol::override_base_with_special): Likewise.
13149
13150 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13151 symbol, change it to have default visibility.
13152 * testsuite/protected_1.cc: New file.
13153 * testsuite/protected_2.cc: New file.
13154 * testsuite/protected_3.cc: New file.
13155 * testsuite/protected_main_1.cc: New file.
13156 * testsuite/protected_main_2.cc: New file.
13157 * testsuite/protected_main_3.cc: New file.
13158 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13159 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13160 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13161 (protected_1.so): New target.
13162 (protected_1_pic.o, protected_2_pic.o): New targets.
13163 (protected_3_pic.o): New target.
13164 (check_PROGRAMS): Add protected_2.
13165 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13166 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13167 * testsuite/Makefile.in: Rebuild.
13168
13169 * options.h (DEFINE_var): Add set_user_set_##varname__.
13170 (DEFINE_bool_alias): New macro.
13171 (class General_options): Define -Bstatic using DEFINE_bool_alias
13172 rather than DEFINE_special. Add --undefined as an alias for -z
13173 defs.
13174 * options.cc (General_options::parse_Bstatic): Remove.
13175
13176 * options.h (class General_options): Add --fatal-warnings.
13177 * main.cc (main): Implement --fatal-warnings.
13178 * errors.h (Errors::warning_count): New function.
13179
13180 * options.h (class General_options): Add -Bsymbolic-functions.
13181 * symtab.h (Symbol::is_preemptible): Check for
13182 -Bsymbolic-functions.
13183
13184 2008-05-05 Ian Lance Taylor <iant@google.com>
13185
13186 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13187 as noVARNAME rather than no-VARNAME.
13188 (class General_options): Add option -z combreloc.
13189 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13190 get_address.
13191 (Output_reloc::sort_before) [SHT_REL]: New function.
13192 (Output_reloc::sort_before) [SHT_RELA]: New function.
13193 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13194 Sort_relocs_comparison.
13195 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13196 parameter. Change all callers.
13197 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13198 sort_relocs parameter. Change all callers.
13199 * output.cc (Output_reloc::get_address): New function, broken out
13200 of write_rel.
13201 (Output_reloc::write_rel): Call it.
13202 (Output_reloc::compare): New function.
13203 (Output_data_reloc_base::do_write): Optionally sort relocs.
13204
13205 * configure.ac: If targ_extra_obj is set, link it in.
13206 * configure.tgt: Initialize all variables.
13207 (x86_64*): Set targ_extra_obj and targ_extra_size.
13208 * configure: Rebuild.
13209
13210 * object.cc (Sized_relobj::include_section_group): Adjust section
13211 indexes read from group data. Build vector to pass to
13212 layout_group.
13213 * layout.cc (Layout::layout_group): Add flags and shndxes
13214 parameters. Remove contents parameter. Change caller. Update
13215 explicit instantiations.
13216 * layout.h (class Layout): Update layout_group declaration.
13217 * output.cc (Output_data_group::Output_data_group): Add flags and
13218 input_shndxes parameters. Remove contents parameter. Change
13219 caller.
13220 (Output_data_group::do_write): Change input_sections_ to
13221 input_shndxes_.
13222 * output.h (class Output_data_group): Update constructor
13223 declaration. Rename input_sections_ to input_shndxes_.
13224 * testsuite/many_sections_test.cc: Add template.
13225
13226 2008-04-30 Cary Coutant <ccoutant@google.com>
13227
13228 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13229
13230 * layout.cc (Layout::include_section): Refactored check for debug
13231 info section.
13232 (Layout::add_comdat): Add new parameters. Change type
13233 of signature parameter. Add object and shndx to signatures table.
13234 (Layout::find_kept_object): New function.
13235 * layout.h: Include <cstring>.
13236 (Layout::is_debug_info_section): New function.
13237 (Layout::add_comdat): Add new parameters.
13238 (Layout::find_kept_object): New function.
13239 (Layout::Kept_section): New struct.
13240 (Layout::Signatures): Change type of map range.
13241 * object.cc (Relobj::output_section_address): New function.
13242 (Sized_relobj::include_section_group): Add new parameters. Change
13243 calls to Layout::add_comdat. Change to build table of kept comdat
13244 groups and table mapping discarded sections to kept sections.
13245 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13246 (Sized_relobj::do_layout): Change calls to include_section_group and
13247 include_linkonce_section.
13248 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13249 value to zero when section is discarded.
13250 (Sized_relobj::map_to_kept_section): New function.
13251 * object.h (Relobj::output_section_address): New function.
13252 (Relobj::Comdat_group): New type.
13253 (Relobj::find_comdat_group): New function.
13254 (Relobj::Comdat_group_table): New type.
13255 (Relobj::Kept_comdat_section): New type.
13256 (Relobj::Kept_comdat_section_table): New type.
13257 (Relobj::add_comdat_group): New function.
13258 (Relobj::set_kept_comdat_section): New function.
13259 (Relobj::get_kept_comdat_section): New function.
13260 (Relobj::comdat_groups_): New field.
13261 (Relobj::kept_comdat_sections_): New field.
13262 (Symbol_value::input_value): Update comment.
13263 (Sized_relobj::map_to_kept_section) New function.
13264 (Sized_relobj::include_linkonce_section): Add new parameter.
13265 * target-reloc.h (Comdat_behavior): New type.
13266 (get_comdat_behavior): New function.
13267 (relocate_section): Add code to map a discarded section to the
13268 corresponding kept section when applying a relocation.
13269
13270 2008-04-30 Craig Silverstein <csilvers@google.com>
13271
13272 * dwarf_reader.cc (next_generation_count): New static var.
13273 (Addr2line_cache_entry): New struct.
13274 (addr2line_cache): New static var.
13275 (Dwarf_line_info::one_addr2line): Added caching.
13276 (Dwarf_line_info::clear_addr2line_cache): New function.
13277 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13278 cache-size parameter.
13279 (Dwarf_line_info::one_addr2line_cache): New function.
13280 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13281 new cache-size argument to one_addr2line(), and clear cache.
13282
13283 2008-04-28 Cary Coutant <ccoutant@google.com>
13284
13285 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13286 R_386_PC8 relocations.
13287
13288 2008-04-23 Ian Lance Taylor <iant@google.com>
13289
13290 * object.cc (Sized_relobj::include_section_group): Check for
13291 invalid section group.
13292
13293 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13294 header size.
13295
13296 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13297 than read for file header.
13298 * archive.cc (Archive::include_member): Likewise.
13299
13300 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
13301
13302 * aclocal.m4: Regenerate.
13303 * configure: Regenerate.
13304
13305 2008-04-19 Ian Lance Taylor <iant@google.com>
13306
13307 * version.cc (version_string): Bump to 1.6.
13308
13309 * testsuite/Makefile.am (many_sections_r_test): New target.
13310 (many_sections_r_test_SOURCES): Remove.
13311 (many_sections_r_test_DEPENDENCIES): Remove.
13312 (many_sections_r_test_LDFLAGS): Remove.
13313 (many_sections_r_test_LDADD): Remove.
13314
13315 * object.cc (Sized_relobj::do_add_symbols): Always pass
13316 local_symbol_count_ to add_from_relobj.
13317
13318 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13319 every thousand variables.
13320 * testsuite/Makefile.in: Rebuild.
13321
13322 * object.cc (Xindex::initialize_symtab_xindex): New function.
13323 (Xindex::read_symtab_xindex): New function.
13324 (Xindex::sym_xindex_to_shndx): New function.
13325 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13326 available.
13327 (Sized_relobj::do_initialize_xindex): New function.
13328 (Sized_relobj::do_read_symbols): Adjust section links.
13329 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13330 parameter. Change all callers.
13331 (Sized_relobj::include_section_group): Adjust section links and
13332 symbol section indexes.
13333 (Sized_relobj::do_layout): Adjust section links.
13334 (Sized_relobj::do_count_local_symbols): Adjust section links and
13335 symbol section indexes.
13336 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13337 ordinary and special symbols.
13338 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13339 dynsym_xindex parameters. Change all callers. Adjust section
13340 links. Use SHN_XINDEX when needed.
13341 (Sized_relobj::get_symbol_location_info): Adjust section links.
13342 Don't get fooled by special symbols.
13343 * object.h (class Xindex): Define.
13344 (class Object): Add xindex_ parameter. Declare virtual functoin
13345 do_initialize_xindex.
13346 (Object::adjust_sym_shndx): New function.
13347 (Object::set_xindex): New protected function.
13348 (class Symbol_value): Add is_ordinary_shndx_ field.
13349 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13350 (Symbol_value::value): Assert ordinary section.
13351 (Symbol_value::initialize_input_to_output_map): Likewise.
13352 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13353 Change all callers.
13354 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13355 all callers.
13356 (class Sized_relobj): Update declarations.
13357 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13358 parameter. Change all callers.
13359 (Sized_relobj::adjust_shndx): New function.
13360 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13361 field.
13362 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13363 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13364 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13365 (Sized_dynobj::read_dynsym_section): Adjust section links.
13366 (Sized_dynobj::read_dynamic): Likewise.
13367 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13368 section links.
13369 (Sized_dynobj::do_initialize_xindex): New function.
13370 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13371 do_initialize_xindex.
13372 (Sized_dynobj::adjust_shndx): New function.
13373 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13374 dynsym_xindex_ fields.
13375 (Layout::finalize): Add a call to set_section_indexes before
13376 creating the symtab sections.
13377 (Layout::set_section_indexes): Don't do anything if the section
13378 already has a section index.
13379 (Layout::create_symtab_sections): Add shnum parameter. Change
13380 caller. Create .symtab_shndx section if needed.
13381 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13382 caller.
13383 (Layout::allocated_output_section_count): New function.
13384 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13385 needed.
13386 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13387 fields. Update declarations.
13388 (Layout::symtab_xindex): New function.
13389 (Layout::dynsym_xindex): New function.
13390 (class Write_symbols_task): Add layout_ field.
13391 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13392 Change caller.
13393 * output.cc (Output_section_headers::Output_section_headers): Add
13394 shstrtab_section parameter. Change all callers.
13395 (Output_section_headers::do_sized_write): Store overflow values
13396 for section count and section string table section index in
13397 section header zero.
13398 (Output_file_header::do_sized_write): Check for overflow of
13399 section count and section string table section index.
13400 (Output_symtab_xindex::do_write): New function.
13401 (Output_symtab_xindex::endian_do_write): New function.
13402 * output.h (class Output_section_headers): Add shstrtab_section_.
13403 Update declarations.
13404 (class Output_symtab_xindex): Define.
13405 (Output_section::has_out_shndx): New function.
13406 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13407 field.
13408 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13409 Change all callers.
13410 (Sized_symbol::init): Likewise.
13411 (Symbol::output_section): Check for ordinary symbol.
13412 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13413 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13414 callers.
13415 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13416 Change all callers. Simplify handling of symbols from sections
13417 not included in the link.
13418 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13419 distinction.
13420 (Weak_alias_sorter::operator()): Assert that symbols are
13421 ordinary.
13422 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13423 distinction.
13424 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13425 parameters. Change all callers.
13426 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13427 symbol distinction. Use SHN_XINDEX when needed.
13428 (Symbol_table::write_section_symbol): Add symtab_xindex
13429 parameter. Change all callers.
13430 (Symbol_table::sized_write_section_symbol): Likewise. Use
13431 SHN_XINDEX when needed.
13432 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13433 declarations.
13434 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13435 (Symbol::is_defined): Check is_ordinary.
13436 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13437 (Symbol::is_absolute, Symbol::is_common): Likewise.
13438 (class Sized_symbol): Update declarations.
13439 (class Symbol_table): Update declarations.
13440 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13441 parameters. Change all callers.
13442 (Sized_symbol::override): Likewise.
13443 (Symbol_table::override): Likewise.
13444 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13445 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13446 is_ordinary, and orig_st_shndx parameters. Change all callers.
13447 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13448 to be in an ordinary section.
13449 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13450 object and is_ordinary parameters. Change all callers.
13451 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13452 Change all callers. Don't add undefined or non-ordinary symbols
13453 to reloc_map_.
13454 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13455 Change all callers.
13456 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13457 declarations.
13458 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13459 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13460 (Sized_relobj::relocate_sections): Likewise.
13461 * target-reloc.h (scan_relocs): Adjust section symbol index.
13462 (scan_relocatable_relocs): Likewise.
13463 * i386.cc (Scan::local): Check for ordinary symbols.
13464 * sparc.cc (Scan::local): Likewise.
13465 * x86_64.cc (Scan::local): Likewise.
13466 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13467 to symbol_section_and_value.
13468 * testsuite/many_sections_test.cc: New file.
13469 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13470 (check_PROGRAMS): Add many_sections_test.
13471 (many_sections_test_SOURCES): Define.
13472 (many_sections_test_DEPENDENCIES): Define.
13473 (many_sections_test_LDFLAGS): Define.
13474 (BUILT_SOURCES): Add many_sections_define.h.
13475 (many_sections_define.h): New target.
13476 (BUILT_SOURCES): Add many_sections_check.h.
13477 (many_sections_check.h): New target.
13478 (check_PROGRAMS): Add many_sections_r_test.
13479 (many_sections_r_test_SOURCES): Define.
13480 (many_sections_r_test_DEPENDENCIES): Define.
13481 (many_sections_r_test_LDFLAGS): Define.
13482 (many_sections_r_test_LDADD): Define.
13483 (many_sections_r_test.o): New target.
13484 * testsuite/Makefile.in: Rebuild.
13485
13486 2008-04-17 Cary Coutant <ccoutant@google.com>
13487
13488 * errors.cc (Errors::info): New function.
13489 (gold_info): New function.
13490 * errors.h (Errors::info): New function.
13491 * gold.h (gold_info): New function.
13492 * object.cc (Input_objects::add_object): Print trace output.
13493 * options.cc (options::parse_set): New function.
13494 (General_options::parse_wrap): Deleted.
13495 (General_options::General_options): Deleted initializer.
13496 * options.h (options::String_set): New typedef.
13497 (options::parse_set): New function.
13498 (DEFINE_set): New macro.
13499 (General_options::wrap): Changed to use DEFINE_set. Changed
13500 callers of any_wrap_symbols and is_wrap_symbol.
13501 (General_options::trace, General_options::trace_symbol):
13502 New options.
13503 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13504 (General_options::wrap_symbols_): Deleted.
13505 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13506
13507 2008-04-17 David S. Miller <davem@davemloft.net>
13508
13509 * options.cc (General_options::parse_V): New function.
13510 * options.h: Add entries for -V and -Qy.
13511
13512 2008-04-17 Ian Lance Taylor <iant@google.com>
13513
13514 * common.cc (Symbol_table::allocate_commons): Remove options
13515 parameter. Change caller.
13516 (Symbol_table::do_allocate_commons): Remove options parameter.
13517 Change caller. Just call do_allocate_commons_list twice.
13518 (Symbol_table::do_allocate_commons_list): New function, broken out
13519 of do_allocate_commons.
13520 * common.h (class Allocate_commons_task): Remove options_ field.
13521 Update constructor.
13522 * symtab.cc (Symbol_table::Symbol_table): Initialize
13523 tls_commons_.
13524 (Symbol_table::add_from_object): Put TLS common symbols on
13525 tls_commons_ list.
13526 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13527 which are IN_OUTPUT_DATA.
13528 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13529 allocate_commons and do_allocate_commons declarations. Declare
13530 do_allocate_commons_list.
13531 * gold.cc (queue_middle_tasks): Update creation of
13532 Allocate_commons_task to not pass options.
13533 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13534 (TLS_TEST_C_FLAGS): New variable.
13535 (tls_test_c_pic.o): New target.
13536 (tls_test_shared.so): Link in tls_test_c_pic.o.
13537 (tls_test_c_pic_ie.o): New target.
13538 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13539 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13540 (tls_test_c.o): New target.
13541 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13542 (tls_pic_test_LDADD): Likewise.
13543 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13544 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13545 (tls_test_c_gnu2.o): New target.
13546 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13547 tls_test_c_gnu2.o.
13548 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13549 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13550 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13551 * testsuite/tls_test.cc: Include "config.h".
13552 (t_last): Call t11_last.
13553 * testsuite/tls_test.h (t11, t11_last): Declare.
13554 * testsuite/tls_test_c.c: New file.
13555 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13556 * configure.ac: Check for OpenMP support.
13557 * configure, config.in, Makefile.in: Rebuild.
13558 * testsuite/Makefile.in: Rebuild.
13559
13560 2008-04-16 Cary Coutant <ccoutant@google.com>
13561
13562 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13563 (Target_i386::tls_base_symbol_defined_): New field.
13564 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13565 (Target_i386::Scan::global): Likewise.
13566 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13567 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13568 (Target_x86_64::tls_base_symbol_defined_): New field.
13569 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13570 (Target_x86_64::Scan::global): Likewise.
13571
13572 2008-04-16 Cary Coutant <ccoutant@google.com>
13573
13574 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13575 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13576 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13577 building shared libraries.
13578 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13579 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13580 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13581 * testsuite/Makefile.in: Rebuild.
13582 * testsuite/weak_undef.h: New file.
13583 * testsuite/weak_undef_file1.cc: Add extra test cases.
13584 * testsuite/weak_undef_file2.cc: Likewise.
13585 * testsuite/weak_undef_test.cc: Likewise.
13586
13587 2008-04-16 David S. Miller <davem@davemloft.net>
13588
13589 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13590 Add issued_non_pic_error_ field. Declare check_non_pic.
13591 (Target_sparc::Scan::check_non_pic): New function.
13592 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13593 (Target_sparc::Scan::global): Likewise.
13594
13595 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13596 * configure: Rebuild.
13597
13598 * options.h (DEFINE_enable): New macro.
13599 (new_dtags): New enable option.
13600 (initfirst, interpose, loadfltr, nodefaultlib,
13601 nodelete, nodlopen, nodump): New -z options.
13602 * layout.cc (Layout:finish_dynamic_section): If new
13603 dtags enabled, emit DT_RUNPATH. Also, emit a
13604 DT_FLAGS_1 containing any specified -z flags.
13605
13606 2008-04-16 Ian Lance Taylor <iant@google.com>
13607
13608 * copy-relocs.cc: New file.
13609 * copy-relocs.h: New file.
13610 * reloc.cc: Remove Copy_relocs code.
13611 * reloc.h: Likewise.
13612 * reloc-types.h (struct Reloc_types) [both versions]: Add
13613 get_reloc_addend_noerror.
13614 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13615 variants of add_global which take an addend which must be zero.
13616 * i386.cc: Include "copy-relocs.h".
13617 (class Target_i386): Change type of copy_relocs_ to variable,
13618 update initializer.
13619 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13620 Change all callers.
13621 (Target_i386::do_finalize_sections): Change handling of
13622 copy_relocs_.
13623 * sparc.cc: Include "copy-relocs.h".
13624 (class Target_sparc): Change type of copy_relocs_ to variable,
13625 update initializer.
13626 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13627 Change all callers.
13628 (Target_sparc::do_finalize_sections): Change handling of
13629 copy_relocs_.
13630 * x86_64.cc: Include "copy-relocs.h".
13631 (class Target_x86_64): Change type of copy_relocs_ to variable,
13632 update initializer.
13633 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13634 class. Change all callers.
13635 (Target_x86_64::do_finalize_sections): Change handling of
13636 copy_relocs_.
13637 * Makefile.am (CCFILES): Add copy-relocs.cc.
13638 (HFILES): Add copy-relocs.h.
13639
13640 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13641
13642 * testsuite/script_test_4.sh: Permit leading zeroes.
13643
13644 2008-04-15 Ian Lance Taylor <iant@google.com>
13645
13646 * script-sections.cc (Script_sections::create_segments): Use
13647 header_size_adjustment even when there is enough room for the
13648 headers.
13649 * testsuite/script_test_4.sh: New file.
13650 * testsuite/script_test_4.t: New file.
13651 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13652 (check_DATA): Add script_test_4.stdout.
13653 (MOSTLYCLEANFILES): Likewise.
13654 (script_test_4): New target.
13655 (script_test_4.stdout): New target.
13656 * testsuite/Makefile.in: Rebuild.
13657
13658 * sparc.cc: Add definitions for Output_data_plt_sparc class
13659 constants.
13660
13661 2008-04-14 David S. Miller <davem@davemloft.net>
13662
13663 * sparc.cc: New file.
13664 * Makefile.am (TARGETSOURCES): Add sparc.cc
13665 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13666 * configure.tgt: Document targ_extra_size and
13667 targ_extra_big_endian. Add entries for sparc-* and
13668 sparc64-*.
13669 * configure.ac: Handle targ_extra_size and
13670 targ_extra_big_endian.
13671 * Makefile.in: Rebuild.
13672 * configure: Likewise.
13673 * po/POTFILES.in: Likewise.
13674 * po/gold.pot: Likewise.
13675
13676 2008-04-14 Ian Lance Taylor <iant@google.com>
13677
13678 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13679 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13680 in the name/type/flags to section mapping. Don't call
13681 allocate_output_section.
13682 (Layout::choose_output_section): Change parameter from adjust_name
13683 to is_input_section. Don't permit input sections after sections
13684 are attached to segments. Don't call allocate_output_section.
13685 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13686 not write_enable_output_section.
13687 (Layout::make_output_section): Don't push to
13688 unattached_section_list_ nor call attach_to_segment. Call
13689 attach_section_to_segment if sections are attached.
13690 (Layout::attach_sections_to_segments): New function.
13691 (Layout::attach_section_to_segment): New function.
13692 (Layout::attach_allocated_section_to_segment): Rename from
13693 attach_to_segment. Remove flags parameter.
13694 (Layout::allocate_output_section): Remove function.
13695 (Layout::write_enable_output_section): Remove function.
13696 * layout.h (class Layout): Update for above changes. Add new
13697 field sections_are_attached_.
13698 * output.h (Output_section::update_flags_for_input_section): New
13699 function.
13700 * output.cc (Output_section::add_input_section): Call
13701 update_flags_for_input_section.
13702 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13703
13704 2008-04-11 Cary Coutant <ccoutant@google.com>
13705
13706 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13707 thought unnecessary.
13708 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13709
13710 2008-04-11 Ian Lance Taylor <iant@google.com>
13711
13712 * output.h (class Output_section_data): Remove inline definition
13713 of set_addralign.
13714 * output.cc (Output_section_data::set_addralign): New function.
13715
13716 2008-04-11 Cary Coutant <ccoutant@google.com>
13717
13718 Add support for TLS descriptors for i386 and x86_64.
13719 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13720 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13721 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13722 GOT_TYPE_TLS_DESC.
13723 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13724 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13725 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13726 relocations.
13727 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13728 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13729 Fix problem with initial-exec relocations.
13730 (Target_i386::Relocate::relocate_tls): Likewise.
13731 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13732 relaxation.
13733 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13734 support for section-plus-offset dynamic table entries.
13735 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13736 (Output_data_dynamic::Dynamic_entry): Add support for
13737 section-plus-offset dynamic table entries.
13738 (Output_data_dynamic::Classification): Likewise.
13739 (Output_data_dynamic::classification_): Renamed offset_.
13740 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13741 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13742 (Target_x86_64::make_plt_section): New function.
13743 (Target_x86_64::reserve_tlsdesc_entries): New function.
13744 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13745 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13746 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13747 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13748 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13749 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13750 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13751 add extra PLT entry for TLS descriptors.
13752 (Output_data_plt_x86_64::got_): New field.
13753 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13754 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13755 fields.
13756 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13757 descriptors.
13758 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13759 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13760 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13761 R_386_TLS_DESC_CALL relocations.
13762 (Target_x86_64::Scan::global): Likewise.
13763 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13764 for TLS descriptors.
13765 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13766 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13767 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13768 GD-to-IE relaxation.
13769 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13770 and TLS_DESCRIPTORS.
13771 * Makefile.in: Rebuild.
13772 * configure: Rebuild.
13773 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13774 (tls_test_shared2.so): New target.
13775 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13776 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13777 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13778 (tls_shared_gd_to_ie_test_LDADD): New variable.
13779 (tls_shared_gnu2_gd_to_ie_test): New target.
13780 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13781 New targets.
13782 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13783 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13784 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13785 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13786 (tls_shared_gnu2_test): New target.
13787 (tls_test_gnu2_shared.so): New target.
13788 (tls_shared_gnu2_test_SOURCES): New variable.
13789 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13790 (tls_shared_gnu2_test_LDFLAGS): New variable.
13791 (tls_shared_gnu2_test_LDADD): New variable.
13792 * testsuite/Makefile.in: Rebuild.
13793 * testsuite/Makefile.
13794
13795 2008-04-11 Ian Lance Taylor <iant@google.com>
13796
13797 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13798 justsyms.t.
13799 * testsuite/Makefile.in: Rebuild.
13800
13801 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13802 long.
13803 * testsuite/script_test_2.cc (main): Adjust test.
13804
13805 2008-04-11 David S. Miller <davem@davemloft.net>
13806 Ian Lance Taylor <iant@google.com>
13807
13808 * options.h (General_options): Add entries for '-Y' and
13809 '-relax'.
13810 * options.cc (General_options:finalize): If -Y was used, add those
13811 entries to the library path instead of the default "/lib" and
13812 "/usr/lib".
13813
13814 2008-04-11 David S. Miller <davem@davemloft.net>
13815
13816 * testsuite/justsyms.t: Start at 0x100.
13817 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
13818 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13819 long.
13820 * testsuite/script_test_2.cc: Adjust string and section length
13821 checks.
13822
13823 2008-04-09 Ian Lance Taylor <iant@google.com>
13824
13825 PR gold/5996
13826 * script-sections.cc (Sections_element::allocate_to_segment): Add
13827 orphan parameter.
13828 (Output_section_definition::allocate_to_segment): Likewise.
13829 (Orphan_output_section::allocate_to_segment): Likewise.
13830 (Script_sections::attach_sections_using_phdrs_clause): Don't
13831 propagate non-PT_LOAD segments to orphan sections.
13832 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13833 readelf rather than objdump.
13834 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13835 .interp section and PT_INTERP segment are the same size.
13836 * testsuite/Makefile.in: Rebuild.
13837
13838 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13839 aliases for symbols defined in the same object.
13840 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13841 (weak_alias_test_SOURCES): New variable.
13842 (weak_alias_test_DEPENDENCIES): New variable.
13843 (weak_alias_test_LDFLAGS): New variable.
13844 (weak_alias_test_LDADD): New variable.
13845 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13846 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13847 (weak_alias_test_3.o): New target.
13848 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13849 * testsuite/weak_alias_test_main.cc: New file.
13850 * testsuite/weak_alias_test_1.cc: New file.
13851 * testsuite/weak_alias_test_2.cc: New file.
13852 * testsuite/weak_alias_test_3.cc: New file.
13853
13854 2008-04-08 Ian Lance Taylor <iant@google.com>
13855
13856 * options.h (class General_options): Add --noinhibit-exec option.
13857 * main.cc (main): Check --noinhibit-exec.
13858
13859 * options.h (class General_options): Define --wrap as a special
13860 option. Add wrap_symbols_ field.
13861 (General_options::any_wrap_symbols): New function.
13862 (General_options::is_wrap_symbol): New function.
13863 * options.cc (General_options::parse_wrap): New function.
13864 (General_options::General_options): Initialize wrap_symbols_.
13865 * symtab.cc (Symbol_table::wrap_symbol): New function.
13866 (Symbol_table::add_from_object): Handle --wrap.
13867 * symtab.h (class Symbol_table): Declare wrap_symbol.
13868 * target.h (Target::wrap_char): New function.
13869 (Target::Target_info): Add wrap_char field.
13870 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13871 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13872 * testsuite/testfile.cc (Target_test::test_target_info):
13873 Likewise.
13874
13875 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13876 there is one.
13877
13878 * layout.h (class Layout): Add added_eh_frame_data_ field.
13879 * layout.cc (Layout::Layout): Initialize new field.
13880 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13881 output section until we find a section we merged successfully.
13882 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13883 that the size be non-zero.
13884
13885 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13886 qualifier.
13887
13888 2008-04-08 Craig Silverstein <csilvers@google.com>
13889
13890 * configure.ac: Export new conditional variable HAVE_ZLIB.
13891 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13892 on HAVE_ZLIB.
13893 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13894 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13895
13896 2008-04-07 Ian Lance Taylor <iant@google.com>
13897
13898 * version.cc (version_string): Set to "1.5".
13899
13900 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13901 Add issued_non_pic_error_ field. Declare check_non_pic.
13902 (Target_x86_64::Scan::check_non_pic): New function.
13903 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13904 (Target_x86_64::Scan::global): Likewise.
13905
13906 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13907 addend parameter. Change caller. Handle merge sections.
13908 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13909 Address to Addend. Don't add in the result of
13910 local_section_offset, pass down the addend and use the returned
13911 value.
13912 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13913 Update declarations of local_section_offset and symbol_value.
13914 * testsuite/two_file_test_1.cc (t18): New function.
13915 * testsuite/two_file_test_2.cc (f18): New function.
13916 * testsuite/two_file_test_main.cc (main): Call t18.
13917 * testsuite/two_file_test.h (t18, f18): Declare.
13918
13919 * configure.ac: Don't test for objdump, c++filt, or readelf.
13920 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13921 conditionals.
13922 (TEST_READELF): New variable.
13923 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13924 (check_PROGRAMS): Add two_file_strip_test.
13925 (two_file_strip_test): New target.
13926 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13927 (two_file_same_shared_strip_test_SOURCES): New variable.
13928 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13929 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13930 (two_file_same_shared_strip_test_LDADD): New variable.
13931 (two_file_shared_strip.so): New target.
13932 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13933 (ver_test_5.syms, ver_test_7.syms): Likewise.
13934 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13935 (strip_test_3.stdout): Use TEST_OBJDUMP.
13936 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13937
13938 2008-04-04 Cary Coutant <ccoutant@google.com>
13939
13940 * symtab.h (Symbol::is_weak_undefined): New function.
13941 (Symbol::is_strong_undefined): New function.
13942 (Symbol::is_absolute): New function.
13943 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13944 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13945 absolute symbols.
13946 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13947 (weak_undef_test): New target.
13948 * testsuite/Makefile.in: Rebuild.
13949 * testsuite/weak_undef_file1.cc: New file.
13950 * testsuite/weak_undef_file2.cc: New file.
13951 * testsuite/weak_undef_test.cc: New file.
13952
13953 2008-04-03 Craig Silverstein <csilvers@google.com>
13954
13955 * compressed_output.h (class Output_compressed_section): Use
13956 unsigned buffer.
13957 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13958 add zlib header.
13959 (zlib_compressed_suffix): Removed.
13960 (Output_compressed_section::set_final_data_size): Use unsigned
13961 buffers.
13962 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13963 Fix linker invocation.
13964 (flagstest_o_specialfile_and_compress_debug_sections):
13965 Likewise.
13966 * testsuite/Makefile.in: Regenerated.
13967
13968 2008-04-02 David S. Miller <davem@davemloft.net>
13969
13970 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13971 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13972
13973 2008-04-02 Craig Silverstein <csilvers@google.com>
13974
13975 * TODO: New file.
13976
13977 2008-04-02 Ian Lance Taylor <iant@google.com>
13978
13979 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13980 parameters. Update for new key type to views_. Change all
13981 callers.
13982 (File_read::read): Adjust for byteshift in returned view.
13983 (File_read::add_view): New function, broken out of
13984 find_and_make_view.
13985 (File_read::make_view): New function, broken out of
13986 find_and_make_view.
13987 (File_read::find_or_make_view): Add offset and aligned
13988 parameters. Rewrite accordingly. Change all callers.
13989 (File_read::get_view): Add offset and aligned parameters. Adjust
13990 for byteshift in return value.
13991 (File_read::get_lasting_view): Likewise.
13992 * fileread.h (class File_read): Update declarations.
13993 (class File_read::View): Add byteshift_ field. Add byteshift to
13994 constructor. Add byteshift method.
13995 * archive.h (Archive::clear_uncached_views): New function.
13996 (Archive::get_view): Add aligned parameter. Change all callers.
13997 * object.h (Object::get_view): Add aligned parameter. Change all
13998 callers.
13999 (Object::get_lasting_view): Likewise.
14000
14001 * fileread.cc (File_read::release): Don't call clear_views if
14002 there are multiple objects.
14003 * fileread.h (File_read::clear_uncached_views): New function.
14004 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14005 on the archive.
14006
14007 2008-03-31 Cary Coutant <ccoutant@google.com>
14008
14009 Add thin archive support.
14010 * archive.cc (Archive::armagt): New const.
14011 (Archive::setup): Remove task parameter and calls to unlock.
14012 (Archive::unlock_nested_archives): New function.
14013 (Archive::read_header): Add nested_off parameter. Change
14014 all callers.
14015 (Archive::interpret_header): Likewise.
14016 (Archive::include_all_members): Change to handle thin
14017 archives.
14018 (Archive::include_member): Likewise.
14019 * archive.h (Archive::Archive): Add new parameters and
14020 initializers.
14021 (Archive::armagt): New const.
14022 (Archive::setup): Remove task parameter.
14023 (Archive::unlock_nested_archives): New function.
14024 (Archive::read_header): Add nested_off parameter.
14025 (Archive::interpret_header): Likewise.
14026 (Archive::Nested_archive_table): New typedef.
14027 (Archive::is_thin_archive_): New field.
14028 (Archive::nested_archives_): New field.
14029 (Archive::options_): New field.
14030 (Archive::dirpath_): New field.
14031 (Archive::task_): New field.
14032 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14033 for thin archives. Pass additional parameters to
14034 Archive::Archive. Unlock the archive file after calling
14035 Archive::setup.
14036
14037 2008-03-29 Ian Lance Taylor <iant@google.com>
14038
14039 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14040 version symbol to be local.
14041 * testsuite/ver_test_4.sh: New file.
14042 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14043 (check_DATA): Add ver_test_4.syms.
14044 (ver_test_4.syms): New target.
14045 * testsuite/Makefile.in: Rebuild.
14046
14047 * output.cc
14048 (Output_section::Input_section_sort_entry::has_priority): New
14049 function.
14050 (Output_section::Input_section_sort_entry::match_file_name): New
14051 function.
14052 (Output_section::Input_section_sort_entry::match_section_name):
14053 Remove.
14054 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14055 Remove.
14056 (Output_section::Input_section_sort_entry::match_section_file):
14057 Remove.
14058 (Output_section::Input_section_sort_compare::operator()): Rewrite
14059 using new Input_section_sort_entry functions. Sort crtbegin and
14060 crtend first. Sort sections with no priority before sections with
14061 a priority.
14062 * testsuite/initpri1.c (d3): Check j != 4.
14063 (cd5): New constructor/destructor function.
14064 (main): Check j != 2.
14065
14066 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14067 new symbol when resolving, don't call set_is_default.
14068 * testsuite/ver_test_7.cc: New file.
14069 * testsuite/ver_test_7.sh: New file.
14070 * testsuite/Makefile.am (ver_test_7.so): New target.
14071 (ver_test_7.o): New target.
14072 (check_SCRIPTS): Add ver_test_7.sh.
14073 (check_DATA): Add ver_test_7.syms.
14074 (ver_test_7.syms): New target.
14075
14076 2008-03-28 Ian Lance Taylor <iant@google.com>
14077
14078 * layout.cc (Layout::layout): If we see an input section with a
14079 name that needs sorting, set the must_sort flag for the output
14080 section.
14081 (Layout::make_output_section): If the name of the output section
14082 indicates that it might require sorting, set the may_sort flag.
14083 * output.h (Output_section::may_sort_attached_input_sections): New
14084 function.
14085 (Output_section::set_may_sort_attached_input_sections): New
14086 function.
14087 (Output_section::must_sort_attached_input_sections): New
14088 function.
14089 (Output_section::set_must_sort_attached_input_sections): New
14090 function.
14091 (class Output_section): Declare Input_section_sort_entry. Define
14092 Input_section_sort_compare. Declare
14093 sort_attached_input_sections. Add new fields:
14094 may_sort_attached_input_sections_,
14095 must_sort_attached_input_sections_,
14096 attached_input_sections_are_sorted_.
14097 * output.cc (Output_section::Output_section): Initialize new
14098 fields.
14099 (Output_section::add_input_section): Add an entry to
14100 input_sections_ if may_sort or must_sort are true.
14101 (Output_section::set_final_data_size): Call
14102 sort_attached_input_sections if necessary.
14103 (Output_section::Input_section_sort_entry): Define new class.
14104 (Output_section::Input_section_sort_compare::operator()): New
14105 function.
14106 (Output_section::sort_attached_input_sections): New function.
14107 * configure.ac: Check whether the compiler supports constructor
14108 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14109 * testsuite/initpri1.c: New file.
14110 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14111 CONSTRUCTOR_PRIORITY.
14112 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14113 (initpri1_LDFLAGS): New variable.
14114 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14115
14116 2008-03-27 Ian Lance Taylor <iant@google.com>
14117
14118 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14119 * testsuite/common_test_1.c: New file.
14120 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14121 (common_test_1_SOURCES): New variable.
14122 (common_test_1_DEPENDENCIES): New variable.
14123 (common_test_1_LDFLAGS): New variable.
14124
14125 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14126 and commons_ correctly when NAME/VERSION does not override
14127 NAME/NULL.
14128 * testsuite/ver_test_6.c: New file.
14129 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14130 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14131 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14132
14133 2008-03-26 Ian Lance Taylor <iant@google.com>
14134
14135 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14136 of an undefined symbol from a version script.
14137 * testsuite/Makefile.am (ver_test_5.so): New target.
14138 (ver_test_5.o): New target.
14139 (check_SCRIPTS): Add ver_test_5.sh.
14140 (check_DATA): Add ver_test_5.syms.
14141 (ver_test_5.syms): New target.
14142 * testsuite/ver_test_5.cc: New file.
14143 * testsuite/ver_test_5.script: New file.
14144 * testsuite/ver_test_5.sh: New file.
14145 * Makefile.in, testsuite/Makefile.in: Rebuild.
14146
14147 PR gold/5986
14148 Fix problems building gold with gcc 4.3.0.
14149 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14150 (gold_error_at_location, gold_warning_at_location): Use it.
14151 * configure.ac: Check whether we can compile and use a template
14152 function with a printf attribute.
14153 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14154 when jumping over bytes.
14155 * object.cc: Instantiate Object::read_section_data.
14156 * debug.h: Include <cstring>
14157 * dwarf_reader.cc: Include <algorithm>
14158 * main.cc: Include <cstring>.
14159 * options.cc: Include <cstring>.
14160 * output.cc: Include <cstring>.
14161 * script.cc: Include <cstring>.
14162 * script.h: Include <string>.
14163 * symtab.cc: Include <cstring> and <algorithm>.
14164 * target-select.cc: Include <cstring>.
14165 * version.cc: Include <string>.
14166 * testsuite/testmain.cc: Include <cstdlib>.
14167 * configure, config.in: Rebuild.
14168
14169 2008-03-25 Ian Lance Taylor <iant@google.com>
14170
14171 * options.cc: Include "../bfd/bfdver.h".
14172 (options::help): Print bug reporting address.
14173
14174 * version.cc (print_version): Adjust output for current value of
14175 BFD_VERSION_STRING.
14176
14177 * NEWS: New file.
14178
14179 * options.cc (options::help): Print list of supported targets.
14180 * target-select.h: Include <vector>.
14181 (class Target_selector): Make machine_, size_, and is_big_endian_
14182 fields const. Add bfd_name_ and instantiated_target_ fields.
14183 (Target_selector::Target_selector): Add bfd_name parameter.
14184 (Target_selector::recognize): Make non-virtual, call
14185 do_recognize.
14186 (Target_selector::recognize_by_name): Make non-virtual, call
14187 do_recognize_by_name.
14188 (Target_selector::supported_names): New function.
14189 (Target_selector::bfd_name): New function.
14190 (Target_selector::do_instantiate_target): New pure virtual
14191 function.
14192 (Target_selector::do_recognize): New virtual function.
14193 (Target_selector::do_recognize_by_name): New virtual function.
14194 (Target_selector::instantiate_target): New private function.
14195 (supported_target_names): Declare.
14196 * target-select.cc (Target_selector::Target_selector): Update for
14197 new parameter and fields.
14198 (select_target_by_name): Check that the name matches before
14199 calling recognize_by_name.
14200 (supported_target_names): New function.
14201 * i386.cc (class Target_selector_i386): Update Target_selector
14202 constructor call. Remove recognize and recognize_by_name. Add
14203 do_instantiate_target.
14204 * x86_64.cc (class Target_selector_x86_64): Likewise.
14205 * testsuite/testfile.cc (class Target_selector_test): Update for
14206 changes to Target_selector.
14207
14208 * README: Rewrite, with some notes on unsupported features.
14209
14210 2008-03-24 Cary Coutant <ccoutant@google.com>
14211
14212 * i386.cc (Target_i386::Got_type): New enum declaration.
14213 (Target_i386::Scan::local): Updated callers of Output_data_got
14214 member functions.
14215 (Target_i386::Scan::global): Likewise.
14216 (Target_i386::Relocate::relocate): Likewise.
14217 (Target_i386::Relocate::relocate_tls): Likewise.
14218 * object.h (Got_offset_list): New class.
14219 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14220 (Sized_relobj::local_got_offset): Likewise.
14221 (Sized_relobj::set_local_got_offset): Likewise.
14222 (Sized_relobj::local_has_tls_got_offset): Removed.
14223 (Sized_relobj::local_tls_got_offset): Removed.
14224 (Sized_relobj::set_local_tls_got_offset): Removed.
14225 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14226 * output.cc (Output_data_got::add_global): Added got_type parameter.
14227 (Output_data_got::add_global_with_rel): Likewise.
14228 (Output_data_got::add_global_with_rela): Likewise.
14229 (Output_data_got::add_global_pair_with_rel): New function.
14230 (Output_data_got::add_global_pair_with_rela): New function.
14231 (Output_data_got::add_local): Added got_type parameter.
14232 (Output_data_got::add_local_with_rel): Likewise.
14233 (Output_data_got::add_local_with_rela): Likewise.
14234 (Output_data_got::add_local_pair_with_rel): New function.
14235 (Output_data_got::add_local_pair_with_rela): New function.
14236 (Output_data_got::add_global_tls): Removed.
14237 (Output_data_got::add_global_tls_with_rel): Removed.
14238 (Output_data_got::add_global_tls_with_rela): Removed.
14239 (Output_data_got::add_local_tls): Removed.
14240 (Output_data_got::add_local_tls_with_rel): Removed.
14241 (Output_data_got::add_local_tls_with_rela): Removed.
14242 * output.h (Output_data_got::add_global): Added got_type parameter.
14243 (Output_data_got::add_global_with_rel): Likewise.
14244 (Output_data_got::add_global_with_rela): Likewise.
14245 (Output_data_got::add_global_pair_with_rel): New function.
14246 (Output_data_got::add_global_pair_with_rela): New function.
14247 (Output_data_got::add_local): Added got_type parameter.
14248 (Output_data_got::add_local_with_rel): Likewise.
14249 (Output_data_got::add_local_with_rela): Likewise.
14250 (Output_data_got::add_local_pair_with_rel): New function.
14251 (Output_data_got::add_local_pair_with_rela): New function.
14252 (Output_data_got::add_global_tls): Removed.
14253 (Output_data_got::add_global_tls_with_rel): Removed.
14254 (Output_data_got::add_global_tls_with_rela): Removed.
14255 (Output_data_got::add_local_tls): Removed.
14256 (Output_data_got::add_local_tls_with_rel): Removed.
14257 (Output_data_got::add_local_tls_with_rela): Removed.
14258 * resolve.cc (Symbol::override_base_with_special): Removed
14259 reference to has_got_offset_ field.
14260 * symtab.cc (Symbol::init_fields): Replaced initialization
14261 of got_offset_ with got_offsets_. Removed initialization
14262 of has_got_offset_
14263 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
14264 (Symbol::got_offset): Likewise.
14265 (Symbol::set_got_offset): Likewise.
14266 (Symbol::has_tls_got_offset): Removed.
14267 (Symbol::tls_got_offset): Removed.
14268 (Symbol::set_tls_got_offset): Removed.
14269 (Symbol::got_offset_): Removed.
14270 (Symbol::tls_mod_got_offset_): Removed.
14271 (Symbol::tls_pair_got_offset_): Removed.
14272 (Symbol::got_offsets_): New field.
14273 (Symbol::has_got_offset): Removed.
14274 (Symbol::has_tls_mod_got_offset): Removed.
14275 (Symbol::has_tls_pair_got_offset): Removed.
14276 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14277 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14278 member functions.
14279 (Target_x86_64::Scan::global): Likewise.
14280 (Target_x86_64::Relocate::relocate): Likewise.
14281 (Target_x86_64::Relocate::relocate_tls): Likewise.
14282
14283 2008-03-25 Ben Elliston <bje@au.ibm.com>
14284
14285 * yyscript.y: Fix spelling error in comment.
14286
14287 2008-03-24 Ian Lance Taylor <iant@google.com>
14288
14289 * options.h (class General_options): Define build_id option.
14290 * layout.h (class Layout): Declare write_build_id, create_note,
14291 create_build_id. Add build_id_note_ member.
14292 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14293 "libiberty.h", "md5.h", "sha1.h".
14294 (Layout::Layout): Initialize eh_frame_data_,
14295 eh_frame_hdr_section_, and build_id_note_.
14296 (Layout::finalize): Call create_build_id.
14297 (Layout::create_note): New function, broken out of
14298 Layout::create_gold_note.
14299 (Layout::create_gold_note): Call create_note.
14300 (Layout::create_build_id): New function.
14301 (Layout::write_build_id): New function.
14302 (Close_task_runner::run): Call write_build_id.
14303
14304 * x86_64.cc: Correct license to GPLv3.
14305
14306 2008-03-23 Ian Lance Taylor <iant@google.com>
14307
14308 * options.cc: Include "demangle.h".
14309 (parse_optional_string): New function.
14310 (parse_long_option): Handle takes_optional_argument.
14311 (parse_short_option): Update dash_z initializer. Handle
14312 takes_optional_argument.
14313 (General_options::General_options): Initialize do_demangle_.
14314 (General_options::finalize): Set do_demangle_. Handle demangling
14315 style.
14316 * options.h (parse_optional_string): Declare.
14317 (struct One_option): Add optional_arg field. Update constructor.
14318 Update call constructor calls. Add takes_optional_argument
14319 function.
14320 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14321 (DEFINE_optional_string): Define.
14322 (General_options::demangle): Change from DEFINE_bool to
14323 DEFINE_optional_string.
14324 (General_options::no_demangle): New function.
14325 (General_options::do_demangle): New function.
14326 (General_options::set_do_demangle): New function.
14327 (General_options::execstack_status_): Move definition to end of
14328 class definition.
14329 (General_options::static_): Likewise.
14330 (General_options::do_demangle_): New field.
14331 * object.cc (big_endian>::get_symbol_location_info): Call
14332 Options::do_demangle, not Options::demangle.
14333 * symtab.cc (demangle): Likewise.
14334
14335 2008-03-22 Ian Lance Taylor <iant@google.com>
14336
14337 * gold.h: Include <cstddef> and <sys/types.h>
14338 * options.h: Include <cstring>.
14339
14340 2008-03-21 Ian Lance Taylor <iant@google.com>
14341
14342 * Added source code to GNU binutils.
14343 \f
14344 Copyright (C) 2008-2012 Free Software Foundation, Inc.
14345
14346 Copying and distribution of this file, with or without modification,
14347 are permitted in any medium without royalty provided the copyright
14348 notice and this notice are preserved.
14349
14350 Local Variables:
14351 mode: change-log
14352 left-margin: 8
14353 fill-column: 74
14354 version-control: never
14355 End: