* powerpc.cc (Stub_table::find_plt_call_entry): Make types
[binutils-gdb.git] / gold / ChangeLog
1 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2
3 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
4 used in declaration and definition consistent.
5 (Target_powerpc::symval_for_branch): Ditto.
6
7 2013-01-16 Sriraman Tallam <tmsriram@google.com>
8
9 * testsuite/plugin_final_layout.cc: Fix comment.
10
11 2013-01-16 Sriraman Tallam <tmsriram@google.com>
12
13 * layout.cc (Layout::layout): Do not do default sorting for
14 text sections when section ordering is specified.
15 (make_output_section): Ditto.
16 * testsuite/plugin_final_layout.cc: Name the function sections
17 to catch reordering issues.
18
19 2013-01-15 Alan Modra <amodra@gmail.com>
20
21 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
22 plt-thread-safe.
23
24 2013-01-15 Alan Modra <amodra@gmail.com>
25
26 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
27 * testsuite/Makefile.in: Regenerate.
28
29 2013-01-14 Alan Modra <amodra@gmail.com>
30
31 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
32 * testsuite/Makefile.in: Regenerate.
33
34 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
35
36 Fix mingw gold build with plugins enabled
37 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
38 * configure.ac: Export DLOPEN_LIBS and add headers check.
39 * plugin.cc: Handle non-dlfcn case.
40 * Makefile.in: Regenerate.
41 * config.in: Regenerate.
42 * configure: Regenerate.
43 * testsuite/Makefile.in: Regenerate.
44
45 2013-01-09 Sriraman Tallam <tmsriram@google.com>
46
47 * output.h (sort_attached_input_sections): Change to be public.
48 * script-sections.cc
49 (Output_section_definition::set_section_addresses): Sort
50 attached input sections according to section order before linker
51 script assigns section addresses.
52 (Orphan_output_section::set_section_addresses): Sort
53 attached input sections according to section order before linker
54 script assigns section addresses.
55 * Makefile.am (final_layout.sh): Use a simple linker script to
56 check if section ordering still works.
57 * Makefile.in: Regenerate.
58
59 2013-01-09 Ben Cheng <bccheng@google.com>
60
61 * arm.cc (Target_arm::attributes_accept_div): New function.
62 (Target_arm::attributes_forbid_div): New function.
63 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
64 attribute using the same new functions as what bfd/elf32_arm.c
65 does.
66
67 2013-01-07 Cary Coutant <ccoutant@google.com>
68
69 PR gold/14993
70 * output.cc (Output_section::add_input_section): For incremental
71 updates, don't track input sections that are allocated from patch
72 space.
73
74 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
75 Ian Lance Taylor <iant@google.com>
76
77 PR gold/14897
78 * configure.ac (--enable-ld): Removed.
79 (install_as_default): Set to yes only for --enable-gold=default
80 or --disable-ld.
81 * configure: Regenerated.
82
83 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
84
85 * options.h (General_options): Add -fuse-ld= for GCC linker
86 option compatibility.
87
88 2013-01-04 Cary Coutant <ccoutant@google.com>
89
90 * configure.ac: Fix typo restoring CXXFLAGS.
91 * configure: Regenerate.
92
93 2013-01-04 Cary Coutant <ccoutant@google.com>
94
95 * testsuite/Makefile.am (CXXLINK_S): New macro.
96 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
97 * testsuite/Makefile.in: Regenerate.
98
99 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
100
101 * version.cc (print_version): Update copyright year to 2013.
102
103 2012-12-20 Ian Lance Taylor <iant@google.com>
104
105 * layout.cc (Layout::special_ordering_of_input_section): New
106 function.
107 (Layout::layout): If input section requires special ordering, must
108 sort input sections.
109 (Layout::make_output_section): May sort .text input sections.
110 (Layout::is_section_name_prefix_grouped): Remove.
111 * layout.h (class Layout): Declare
112 special_ordering_of_input_section. Don't declare
113 is_section_name_prefix_grouped.
114 * output.cc (Output_section::add_input_section): Revert last
115 change.
116 (Output_section::Input_section_sort::match_file_name): Don't crash
117 if called on output section data.
118 (Output_section::Input_section_sort_compare): Sort based on
119 special ordering.
120 (Output_section::Input_section_sort_section_order_index_compare):
121 Revert last patch.
122 (Output_section::sort_attached_input_sections): Likewise.
123
124 2012-12-18 Sriraman Tallam <tmsriram@google.com>
125
126 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
127 * layout.h (Layout::is_section_name_prefix_grouped): New function.
128 * output.cc (Output_section::add_input_section): Check if section
129 name contains special prefix. Keep input sections to sort such
130 sections.
131 (Output_section::Input_section_sort_section_order_index_compare
132 ::operator()): Group sections according to prefixes.
133 (Output_section::sort_attached_input_sections): Add condition to
134 Input_section_entry constructor call.
135 * testsuite/Makefile.am (text_section_grouping): New test.
136 * testsuite/Makefile.in: Regenerate.
137 * testsuite/text_section_grouping.cc: New file.
138 * testsuite/text_section_grouping.sh: New file.
139
140 2012-12-17 Nick Clifton <nickc@redhat.com>
141
142 * Makefile.am: Add copyright notice.
143 * NEWS: Likewise.
144 * README: Likewise.
145 * configure.ac: Likewise.
146 * ftruncate.c: Likewise.
147 * Makefile.in: Regenerate.
148
149 2012-12-14 Cary Coutant <ccoutant@google.com>
150
151 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
152 --no-as-needed flag.
153 (exception_separate_shared_12_test): Likewise.
154 (incremental_copy_test): Likewise.
155 * testsuite/Makefile.in: Regenerate.
156
157 2012-12-14 Cary Coutant <ccoutant@google.com>
158
159 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
160 (Dwp_output_file::Dwp_index::enter_set): Add assert.
161
162 2012-12-12 Alan Modra <amodra@gmail.com>
163
164 * powerpc.cc (class Track_tls): New.
165 (class Relocate, class Scan): Inherit Track_tls.
166 (Target_powerpc::Scan::local, global): Track tls optimization
167 and avoid creating plt entry for __tls_get_addr if all uses
168 are optimized away.
169 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
170
171 2012-12-12 Alan Modra <amodra@gmail.com>
172
173 * options.h (General_options): Add --toc-sort/--no-toc-sort.
174 Replace no_toc_optimize with toc_optimize.
175 * output.h (Output_section::input_sections): Provide non-const variant.
176 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
177 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
178 accessors.
179 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
180 (class Sort_toc_sections): New.
181 (Target_powerpc::do_finalize_sections): Sort toc sections.
182 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
183
184 2012-12-10 Roland McGrath <mcgrathr@google.com>
185
186 * testsuite/binary_unittest.cc (read_all): New function.
187 (Sized_binary_test): Use it instead of ::read.
188 * fileread.cc (do_read): Don't assume pread always reads the whole
189 amount in a single call.
190
191 2012-12-10 Alan Modra <amodra@gmail.com>
192
193 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
194 Set EM_PPC64 or EM_PPC here.
195 (Target_selector_powerpc::do_recognize): Delete.
196
197 2012-12-10 Alan Modra <amodra@gmail.com>
198
199 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
200 stub_table_.
201 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
202
203 2012-12-07 Roland McGrath <mcgrathr@google.com>
204
205 * testsuite/binary_unittest.cc (Sized_binary_test):
206 Use open_descriptor rather than ::open.
207
208 2012-12-07 Alan Modra <amodra@gmail.com>
209
210 * powerpc.cc (Stub_table::do_write): Delete redundant Address
211 typedef and invalid_address constant.
212 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
213 instantiate constants.
214
215 2012-12-06 Roland McGrath <mcgrathr@google.com>
216
217 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
218 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
219 * aclocal.m4: Regenerate.
220 * configure: Regenerate.
221 * Makefile.in: Regenerate.
222 * testsuite/Makefile.in: Regenerate.
223
224 2012-12-07 Alan Modra <amodra@gmail.com>
225
226 * options.h (General_options): Add no_toc_optimize.
227 * powerpc.cc (ok_lo_toc_insn): New function.
228 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
229
230 2012-12-06 Alan Modra <amodra@gmail.com>
231
232 * options.h (General_options): Add plt_align, plt_static_chain,
233 plt_thread_safe. Update stub_group_size help text.
234 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
235 for new plt_thread_safe_ var.
236 (use_plt_offset): Correct comments.
237 (Target_powerpc::do_relax): Look for thread creation symbols to
238 determine default plt_thread_safe value. Clear plt call stubs
239 as well as branch stubs each iteration.
240 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
241 insn constants.
242 (l, hi, ha, write_insn): Move earlier.
243 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
244 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
245 plt stubs too.
246 (Stub_table::update_size): Adjust.
247 (Stub_table::prev_size, set_prev_size): Delete.
248 (Stub_table::stub_align): Let --plt-align affect result.
249 (Stub_table::plt_call_size): Calculate sizes for various stubs.
250 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
251 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
252 (Stub_table::do_write): Support more stub variants.
253
254 2012-12-04 Alan Modra <amodra@gmail.com>
255
256 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
257 (Target_powerpc::do_define_standard_symbols): New function.
258
259 2012-12-03 Alan Modra <amodra@gmail.com>
260
261 * output.h: Formatting, whitespace.
262
263 2012-12-03 Alan Modra <amodra@gmail.com>
264
265 * layout.h (Layout::get_executable_sections): Declare.
266 * layout.cc (Layout::get_executable_sections): New function.
267 * arm.cc (Target_arm::group_sections): Use it.
268 (Arm_output_section::group_sections): Delete now redundant test.
269 * output.cc (Output_reloc::Output_reloc): Add is_relative.
270 param to handle relative relocs.
271 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
272 (Output_data_reloc::add_absolute): Adjust.
273 (Output_data_reloc::add_relative): New function.
274 (Output_data::reset_data_size): New function.
275 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
276 (Output_section::set_addralign): New function.
277 (Output_section::checkpoint_set_addralign): New function.
278 (Output_section::clear_section_offsets_need_adjustment): New function.
279 (Output_section::input_sections): Make public.
280 * powerpc.cc (class Output_data_brlt_powerpc): New.
281 (class Stub_table, class Stub_control): New.
282 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
283 stub_table_, set_stub_table, stub_table): New vectors and accessor
284 functions.
285 (Target_powerpc::do_may_relax, do_relax, push_branch,
286 new_stub_table, stub_tables, brlt_section, group_sections,
287 add_branch_lookup_table, find_branch_lookup_table,
288 write_branch_lookup_table, make_brlt_section): New functions.
289 (Target_powerpc::struct Sort_sections, class Branch_info): New.
290 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
291 branch_info_): New vars.
292 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
293 make call stubs here.
294 (Output_data_glink): Remove all call stub handling from this class.
295 (Target_powerpc::Scan::local, global): Save interesting branch
296 relocs and relocs for ifunc. Adjust calls to plt entry functions.
297 (Target_powerpc::do_finalize_sections): Only make reg save/restore
298 functions on final link.
299 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
300 Handle long branch destinations too.
301 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
302 do_plt_address_for_local): Adjust lookup of plt call stubs.
303
304 2012-11-30 Alan Modra <amodra@gmail.com>
305
306 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
307 relocs against protected symbols when building 32-bit shared libs.
308
309 2012-11-30 Alan Modra <amodra@gmail.com>
310
311 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
312 param. Call got_section() to make .got. Update all callers
313 and their callers and so on.
314
315 2012-11-30 Alan Modra <amodra@gmail.com>
316
317 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
318 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
319 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
320 value if it already exists.
321
322 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
323
324 PR gold/14858
325 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
326
327 2012-11-14 Roland McGrath <mcgrathr@google.com>
328
329 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
330 than bfc instruction for data sandboxing.
331
332 2012-11-08 Alan Modra <amodra@gmail.com>
333
334 * po/POTFILES.in: Regenerate.
335
336 2012-11-05 Alan Modra <amodra@gmail.com>
337
338 * configure.ac: Apply 2012-09-10 change to config.in here.
339 * configure: Regenerate.
340
341 2012-11-05 Alan Modra <amodra@gmail.com>
342
343 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
344 (struct Opd_ent): Use "Address" rather than "Offset".
345 (Output_data_got_powerpc::got_base_offset): Return Valtype.
346 (Target_powerpc::got_section): Make public.
347 (Target_powerpc::scan_relocs): Move code setting symbols..
348 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
349 Create _SDA_BASE_ only when referenced.
350
351 2012-11-02 Roland McGrath <mcgrathr@google.com>
352
353 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
354 from last change.
355
356 2012-11-01 Roland McGrath <mcgrathr@google.com>
357
358 * target.h (Sized_target::relocate_relocs): Use Elf_Off
359 for offset_in_output_section parameter.
360 (Sized_target::relocate_special_relocatable): Likewise.
361 * arm.cc (Target_arm::relocate_relocs): Likewise.
362 (Target_arm::relocate_special_relocatable): Likewise.
363 * i386.cc (Target_i386::relocate_relocs): Likewise.
364 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
365 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
366 * target-reloc.h (relocate_relocs): Likewise.
367 * testsuite/testfile.cc (Target_test): Likewise.
368 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
369 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
370
371 * system.h: Move inclusion of <clocale> to after <libintl.h> in
372 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
373
374 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
375 parameter, which is unused in the [!F_SETFD] case.
376
377 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
378 SYMNDX to off_t before comparing it to this->data_size().
379 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
380 * incremental.cc (Output_section_incremental_inputs::do_write):
381 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
382
383 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
384
385 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
386
387 * gold.cc (Target_arm::do_adjust_elf_header): Add the
388 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
389 in EABI_VER5.
390
391 2012-10-29 Cary Coutant <ccoutant@google.com>
392
393 * dwp.cc (usage): Add file and exit status parameters;
394 add --help and --version options.
395 (print_version): New function.
396 (main): Add --help and --version options.
397
398 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
399
400 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
401 final_layout_sequence.txt.
402 * testsuite/Makefile.in: Regenerated.
403
404 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
405
406 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
407 COMPILE generated by automake.
408 (LINK1): Likewise.
409 (CXXCOMPILE1): Likewise.
410 (CXXLINK1): Likewise.
411 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
412 (LINK): Likewise.
413 (CXXCOMPILE): Likewise.
414 (CXXLINK): Likewise.
415 * testsuite/Makefile.in: Regenerated.
416
417 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
418
419 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
420 on bad fwrite return.
421
422 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
423
424 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
425 on val.
426
427 2012-10-23 Cary Coutant <ccoutant@google.com>
428
429 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
430 * testsuite/Makefile.in: Regenerate.
431 * testsuite/dwp_test.h: New source file.
432 * testsuite/dwp_test_1.cc: New source file.
433 * testsuite/dwp_test_1.s: New source file.
434 * testsuite/dwp_test_1.sh: New source file.
435 * testsuite/dwp_test_1b.cc: New source file.
436 * testsuite/dwp_test_1b.s: New source file.
437 * testsuite/dwp_test_2.cc: New source file.
438 * testsuite/dwp_test_2.s: New source file.
439 * testsuite/dwp_test_2.sh: New source file.
440 * testsuite/dwp_test_main.cc: New source file.
441 * testsuite/dwp_test_main.s: New source file.
442
443 2012-10-23 Cary Coutant <ccoutant@google.com>
444
445 * dwp.h: New header file.
446 * dwp.cc: New source file.
447 * gold.h: Move shared declarations to system.h.
448 * system.h: New header file.
449 * Makefile.am: Add dwp.
450 * Makefile.in: Regenerate.
451
452 2012-10-23 Cary Coutant <ccoutant@google.com>
453
454 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
455 Dwarf_info_reader::read_from_pointer.
456 (Dwarf_pubnames_table::read_header): Likewise.
457 (Dwarf_pubnames_table::next_name): Likewise.
458 (Dwarf_die::read_attributes): Likewise.
459 (Dwarf_die::skip_attributes): Likewise.
460 (Dwarf_info_reader::read_from_pointer): New function template.
461 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
462 (Dwarf_pubnames_table): Likewise.
463 (Dwarf_info_reader::read_from_pointer): New function template.
464 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
465 Dwarf_pubnames_table ctor.
466
467 2012-10-23 Cary Coutant <ccoutant@google.com>
468
469 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
470 abbrev_shndx.
471 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
472 abbrev_shndx_.
473 (Dwarf_info_reader::set_abbrev_shndx): New method.
474 (Dwarf_info_reader::abbrev_shndx_): New data member.
475
476 2012-10-23 Cary Coutant <ccoutant@google.com>
477
478 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
479 from object, not parameters.
480 (Dwarf_info_reader::parse): Likewise.
481 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
482 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
483 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
484 methods.
485
486 2012-10-23 Cary Coutant <ccoutant@google.com>
487
488 * fileread.cc (Input_file::Input_file): New constructor.
489 * fileread.h (class Input_file): Add new constructor.
490
491 2012-10-18 Alan Modra <amodra@gmail.com>
492
493 PR gold/14727
494 * object.cc (Relobj::is_section_name_included): Also match
495 .sdata personality section.
496
497 2012-10-18 Alan Modra <amodra@gmail.com>
498
499 * target-reloc.h (class Default_comdat_behavior): New, package up..
500 (get_comdat_behaviour): ..this.
501 (relocate_section): Add Relocate_comdat_behavior template arg,
502 adjust code to suit.
503 * arm.cc (Target_arm::relocate_section): Adjust to suit.
504 (Target_arm::scan_reloc_section): Likewise.
505 * i386.cc (Target_i386::relocate_section): Likewise.
506 * sparc.cc (Target_sparc::relocate_section): Likewise.
507 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
508 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
509 * powerpc.cc (class Relocate_comdat_behavior): New.
510 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
511 gold::relocate_section with new template arg.
512
513 2012-10-18 Alan Modra <amodra@gmail.com>
514
515 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
516 dynamic relocs for GOT_TPREL got entries, without symbol if
517 resolving locally.
518 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
519 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
520 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
521
522 2012-10-17 Alan Modra <amodra@gmail.com>
523
524 PR gold/14726
525 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
526
527 2012-10-16 Sriraman Tallam <tmsriram@google.com>
528
529 * layout.cc (Layout::include_section): Keep sections marked
530 SHF_EXCLUDE when doing relocatable links.
531
532 2012-10-16 Alan Modra <amodra@gmail.com>
533
534 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
535 (Target_powerpc::do_finalize_sections): Call it.
536 (Output_data_save_res): New class and supporting functions.
537 (Target_powerpc::symval_for_branch): Only look up .opd entry for
538 normal symbols defined in object files.
539
540 2012-10-12 Alan Modra <amodra@gmail.com>
541
542 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
543 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
544 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
545 section if scan_opd_relocs not yet called.
546 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
547
548 2012-10-12 Alan Modra <amodra@gmail.com>
549
550 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
551 add_local_ifunc_entry): Revert last change.
552 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
553
554 2012-10-05 Alan Modra <amodra@gmail.com>
555
556 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
557 do_plt_address_for_global): New functions.
558 (Output_data_got_powerpc::do_write): Don't segfault when linking
559 statically.
560 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
561 add_local_ifunc_entry): Return true on adding entry..
562 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
563 glink->add_entry call. Remove unused symtab param. Adjust calls.
564 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
565 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
566 set up symbols here.
567 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
568 syms here. Do so even when no .iplt. Don't segfault when linking
569 statically.
570 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
571 new variants without reloc param.
572 (Glink_sym_ent::Glink_sym_ent): Likewise.
573 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
574 reloc when refs will resolve to plt call stub.
575 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
576 R_PPC_PLTREL24 to resolve locally.
577 (Target_powerpc::Scan::global): Correct ifunc handling.
578 (Target_powerpc::Relocate::relocate): Correct local sym glink
579 lookup. Don't destroy "value" when we have a plt call stub,
580 and when checking plt call validity.
581 (Target_powerpc::do_dynsym_value): Simplify.
582
583 2012-10-05 Alan Modra <amodra@gmail.com>
584
585 * i386.cc (Output_data_plt_i386::address_for_global,
586 address_for_local): Add plt offset to returned value. Adjust uses.
587 * sparc.cc (Output_data_plt_sparc::address_for_global,
588 address_for_local): Likewise.
589 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
590 address_for_local): Likewise.
591 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
592 address_for_local): Likewise.
593 * target.h (Target::plt_address_for_global, plt_address_for_local):
594 Update comment.
595 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
596 (Output_data_got::Got_entry::write): Nor here.
597 * output.h: Comment fix.
598
599 2012-10-02 Jiong Wang <jiwang@tilera.com>
600
601 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
602 global_offset_table_ value for larget got.
603 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
604
605 2012-09-29 Alan Modra <amodra@gmail.com>
606
607 * powerpc.cc (Target_powerpc::iplt_): New output section.
608 (Target_powerpc::iplt_section, make_iplt_section,
609 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
610 (Target_powerpc::make_plt_entry): Handle ifunc syms.
611 Target_powerpc::plt_entry_count): Count iplt entries too.
612 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
613 reloc section in constructor. New params.
614 (Target_powerpc::make_plt_section): Create reloc section here instead.
615 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
616 functions.
617 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
618 (Output_data_glink::add_entry, find_entry): New functions to
619 deal with local syms.
620 (Glink_sym_ent): Add support for local syms.
621 (Output_data_glink::do_write): Handle ifunc plt entries.
622 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
623 (Target_powerpc::Scan::local, global): Handle ifunc syms.
624 (Target_powerpc::Relocate::relocate): Likewise.
625 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
626
627 2012-09-25 Alan Modra <amodra@gmail.com>
628
629 * object.h (Sized_relobj_file::adjust_local_symbol,
630 do_adjust_local_symbol): New functions.
631 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
632 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
633 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
634 and irregular opd entry spacing.
635 (Powerpc_relobj::do_read_relocs): Add opd size checks.
636 (Global_symbol_visitor_opd): New functor.
637 (Target_powerpc::do_finalize_sections): Omit global symbols defined
638 on deleted opd entries.
639
640 2012-09-15 Jiong Wang <jiwang@tilera.com>
641
642 * tilegx.cc: New file.
643 * Makefile.am (TARGETSOURCES): Add tilegx.cc
644 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
645 * configure.tgt: Add entries for tilegx*.
646 * configure.ac: Likewise.
647 * Makefile.in: Rebuild.
648 * configure: Likewise.
649 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
650 tilegx.
651
652 2012-09-13 Alan Modra <amodra@gmail.com>
653
654 * target-reloc.h (scan_relocs): Call scan.local for relocs
655 against symbols in discarded sections. Pass is_discarded
656 param.
657 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
658 Add is_discarded param.
659 * powerpc (Target_powerpc::Scan::local): Likewise. Use
660 is_discarded to flag opd entry as discarded. Don't emit dyn
661 relocs on such entries.
662 (Target_powerpc::Scan::global): Similarly detect and handle
663 such opd entries.
664 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
665 opd_ent_. Update all uses.
666 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
667 (Target_powerpc::relocate_section): Zero out discarded opd
668 entry relocs.
669
670 2012-09-12 Ian Lance Taylor <iant@google.com>
671
672 PR gold/14570
673 * output.cc: Rename Output_data_got template parameter from size
674 to got_size for all functions. Compile all variants of
675 Output_data_got.
676 (Output_data_got::Got_entry::write): Correct use of size for
677 symbol value. Use local_is_tls rather than casting to
678 Sized_relobj_file.
679 * object.h (class Object): Add local_is_tls and do_local_is_tls.
680 (class Sized_relobj_file): Add do_local_is_tls.
681 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
682
683 2012-09-11 Alan Modra <amodra@gmail.com>
684
685 PR gold/14566
686 * layout.cc (Layout::set_segment_offsets): When using
687 common-page-size alignment, ensure we are on a new max-page-size
688 page.
689 * output.cc (Output_segment::set_section_addresses): Use
690 abi_pagesize, not common_pagesize for relro boundary.
691 (Output_segment::set_offset): Likewise.
692
693 2012-09-11 Alan Modra <amodra@gmail.com>
694
695 * output.h (Output_data_got::add_global_tls, add_local_tls,
696 add_local_tls_pair): New functions.
697 (Output_data_got::add_local_pair_with_rel): Remove second
698 reloc param. Expand comment.
699 (Output_data_got::Got_entry): Rename use_plt_offset_ to
700 use_plt_or_tls_offset_, similarly for constructor param.
701 (Output_data_got::Got_entry::write): Add got_index param.
702 * output.cc (Output_data_got::add_global_tls, add_local_tls,
703 add_local_tls_pair): New functions.
704 (Output_data_got::Got_entry::write): Handle tls symbols
705 with use_plt_or_tls_offset_ set specially.
706 (Output_data_got::add_local_pair_with_rel): Only one reloc.
707 (Output_data_got::do_write): Replace iterator with index, pass
708 index to entry write function.
709 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
710 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
711 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
712 call.
713 * i386.cc (Target_i386::Scan::local): Likewise.
714 * sparc.cc (Target_sparc::Scan::local): Likewise.
715 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
716 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
717 do_tls_offset_for_global): New functions.
718 (Target_powerpc::Scan::local): Correct TLS relocations and got
719 entry values.
720 (Target_powerpc::Scan::global): Don't emit unnecessary
721 dynamic relocations on TLS GOT entries.
722
723 2012-09-10 Matthias Klose <doko@ubuntu.com>
724
725 * config.in: Disable sanity check for kfreebsd.
726
727 2012-09-10 Sterling Augustine <saugustine@google.com>
728
729 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
730 (Gdb_index::pubtypes_read): New parameter.
731 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
732 to calls.
733 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
734 pubtypes_object_.
735
736 2012-09-09 Alan Modra <amodra@gmail.com>
737
738 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
739 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
740 * gc.h (gc_process_relocs): Call target gc_add_reference.
741 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
742 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
743 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
744 unnecessary cast.
745 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
746 to cater for when we don't need code offset. Update use.
747 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
748 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
749 set_opd_valid): New functions.
750 (Target_powerpc::do_gc_add_reference): New function.
751 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
752 stashed refs.
753 (Target_powerpc::do_gc_mark_symbol): New function.
754
755 2012-09-06 Cary Coutant <ccoutant@google.com>
756
757 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
758 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
759 (Dwarf_die::skip_attributes): Likewise.
760 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
761 * testsuite/gdb_index_test.cc (inline_func_1): New function.
762 (main): Call it.
763 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
764
765 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
766
767 * testsuite/script_test_3.t: Add .got.plt output section
768 statement.
769 * testsuite/script_test_4.t: Likewise.
770
771 2012-09-05 Alan Modra <amodra@gmail.com>
772
773 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
774 update all uses and lose "enum" when using type.
775
776 2012-09-05 Alan Modra <amodra@gmail.com>
777
778 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
779 * configure: Regenerate.
780 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
781 (plugin_final_layout.stdout): Likewise.
782 (memory_test): Set page sizes to 0x1000.
783 * testsuite/Makefile.in: Regenerate.
784 * testsuite/discard_locals_test.sh: Add FIXME comment.
785 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
786 * testsuite/pr14265.t: Add .got output section statement.
787 * testsuite/script_test_2.t: Likewise.
788 * testsuite/script_test_3.t: Likewise.
789 * testsuite/script_test_4.t: Likewise.
790 * testsuite/script_test_5.t: Likewise.
791 * testsuite/script_test_6.t: Likewise.
792 * testsuite/script_test_7.t: Likewise.
793 * testsuite/script_test_9.t: Likewise.
794
795 2012-09-05 Alan Modra <amodra@gmail.com>
796
797 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
798 (Powerpc_relocate_functions::Status): New typedef.
799 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
800 (Target_powerpc::Scan::local): Handle REL64.
801 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
802 for REL32 and REL64.
803 (Target_powerpc::symval_for_branch): New function, extracted from..
804 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
805 checks. Report overflow errors.
806
807 2012-09-05 Alan Modra <amodra@gmail.com>
808
809 * object.h (Sized_relobj_file::emit_relocs): Delete.
810 (Sized_relobj_file::emit_relocs_reltype): Delete.
811 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
812 relocate_relocs for --emit-relocs.
813 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
814 * output.h: Update comment.
815 (Output_segment::first_section): New function.
816 (Output_segment::first_section_load_address): Use first_section.
817 * output.cc (Output_segment::first_section): New function extracted..
818 (Output_segment::first_section_load_address): ..from here. Delete.
819 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
820 * target.h (Sized_target::relocate_for_relocatable): Likewise.
821 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
822 adjust call to target.h function.
823 * i386.cc (Target_i386): Likewise.
824 * sparc.cc (Target_sparc): Likewise.
825 * x86_64.cc (Target_x86_64): Likewise.
826 * powerpc.cc (Target_powerpc): Likewise.
827 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
828 first tls section has section symbol for optimised local dynamic
829 output relocs.
830 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
831 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
832 optimised tls code.
833 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
834 Rename to relocate_relocs. Update error message.
835
836 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
837
838 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
839 --just-symbols.
840
841 2012-08-31 Alan Modra <amodra@gmail.com>
842
843 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
844 (Powerpc_relobj::toc_base_offset): New stub function.
845 (Target_powerpc): Add tp_offset, dtp_offset. Rename
846 got_mod_index_offset to tlsld_got_offset. Update all refs.
847 (Target_powerpc::Relocate::enum skip_tls): New.
848 (Target_powerpc::call_tls_get_addr_): New var.
849 (Target_powerpc::is_branch_reloc): Move to file scope.
850 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
851 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
852 New functions.
853 (Target_powerpc::enum Got_type): Delete old values, add new ones.
854 (powerpc_info): Correct common_pagesize for ppc64.
855 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
856 (Powerpc_relocate_functions): Add overflow check enums and functions.
857 Add non-shift version of rela, rela_ua. Delete all rel public
858 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
859 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
860 addr16_ha3, addr14 functions.
861 (Output_data_got_powerpc::add_constant_pair): New function.
862 (Output_data_got_powerpc::got_base_offset): Likewise.
863 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
864 (instruction constants): Sort, add some more.
865 (Output_data_glink::do_write): Add and use Address typedef. Use
866 object->toc_base_offset() stub for 64-bit.
867 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
868 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
869 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
870 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
871 Always treat .opd relocs as against locally defined symbol.
872 Correct condition for RELATIVE relocs.
873 (Target_powerpc::do_finalize_sections): Test for NULL sections.
874 (Target_powerpc::Relocate::relocate): Use plt call stub as value
875 for 32-bit syms with a plt entry. Correct ppc64 toc base
876 calculations. Handle TLS relocs, and more. Add overflow
877 checking and adjust for Powerpc_relocate_functions changes.
878 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
879 Reinstate --emit-relocs code with FIXME.
880
881 2012-08-30 Alan Modra <amodra@gmail.com>
882
883 * layout.cc (Layout::set_segment_offsets): Set p_align to
884 abi_pagesize, not common_pagesize.
885 (Layout::relaxation_loop_body): Similarly use abi_pagesize
886 to determine whether file header can go in segment.
887
888 2012-08-30 Alan Modra <amodra@gmail.com>
889
890 * output.h (Output_reloc::Output_reloc <output section>): Add
891 is_relative param. Adjust calls.
892 (Output_reloc::add_output_section_relative): New functions.
893 * output.cc (Output_reloc::Output_reloc <output section>): Handle
894 is_relative.
895 (Output_reloc::symbol_value): Handle SECTION_CODE.
896
897 2012-08-24 Sriraman Tallam <tmsriram@google.com>
898
899 * gold.cc (queue_middle_tasks): Call layout again when unique
900 segments for sections is desired.
901 * layout.cc (Layout::Layout): Initialize new members.
902 (Layout::get_output_section_flags): New function.
903 (Layout::choose_output_section): Call get_output_section_flags.
904 (Layout::layout): Make output section for mapping to a unique segment.
905 (Layout::insert_section_segment_map): New function.
906 (Layout::attach_allocated_section_to_segment): Make unique segment for
907 output sections marked so.
908 (Layout::segment_precedes): Check for unique segments when sorting.
909 * layout.h (Layout::Unique_segment_info): New struct.
910 (Layout::Section_segment_map): New typedef.
911 (Layout::insert_section_segment_map): New function.
912 (Layout::get_output_section_flags): New function.
913 (Layout::is_unique_segment_for_sections_specified): New function.
914 (Layout::set_unique_segment_for_sections_specified): New function.
915 (Layout::unique_segment_for_sections_specified_): New member.
916 (Layout::section_segment_map_): New member.
917 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
918 Rename is_gc_pass_one to is_pass_one.
919 Rename is_gc_pass_two to is_pass_two.
920 Rename is_gc_or_icf to is_two_pass.
921 Check for which pass based on whether symbols data is present.
922 Make it two pass when unique segments for sections is desired.
923 * output.cc (Output_section::Output_section): Initialize new
924 members.
925 * output.h (Output_section::is_unique_segment): New function.
926 (Output_section::set_is_unique_segment): New function.
927 (Output_section::is_unique_segment_): New member.
928 (Output_section::extra_segment_flags): New function.
929 (Output_section::set_extra_segment_flags): New function.
930 (Output_section::extra_segment_flags_): New member.
931 (Output_section::segment_alignment): New function.
932 (Output_section::set_segment_alignment): New function.
933 (Output_section::segment_alignment_): New member.
934 (Output_segment::Output_segment): Initialize is_unique_segment_.
935 (Output_segment::is_unique_segment): New function.
936 (Output_segment::set_is_unique_segment): New function.
937 (Output_segment::is_unique_segment_): New member.
938 * plugin.cc (allow_unique_segment_for_sections): New function.
939 (unique_segment_for_sections): New function.
940 (Plugin::load): Add new functions to transfer vector.
941 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
942 * Makefile.in: Regenerate.
943 * testsuite/plugin_final_layout.sh: Check if unique segment
944 functionality works.
945 * testsuite/plugin_section_order.c (onload): Check if new interfaces
946 are available.
947 (allow_unique_segment_for_sections): New global.
948 (unique_segment_for_sections): New global.
949 (claim_file_hook): Call allow_unique_segment_for_sections.
950 (all_symbols_read_hook): Call unique_segment_for_sections.
951
952 2012-08-22 Cary Coutant <ccoutant@google.com>
953
954 * layout.cc (Layout::include_section): Don't assert on GROUP
955 sections with --emit-relocs.
956
957 2012-08-21 Cary Coutant <ccoutant@google.com>
958
959 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
960 if --export-dynamic-symbol names an undef symbol.
961
962 2012-08-18 Alan Modra <amodra@gmail.com>
963
964 * powerpc.cc: Formatting and white space.
965 (Powerpc_relobj): Rename got2_section_ to special_.
966 Add opd_ent_shndx_ and opd_ent_off_ vectors.
967 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
968 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
969 (Target_powerpc): Add Address typedef and invalid_address. Use
970 throughout.
971 (Target_powerpc::is_branch_reloc): New function.
972 (Powerpc_relocate_functions): Add Address typedef, use throughout.
973 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
974 for dst_mask, value and addend.
975 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
976 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
977 (Output_data_glink::do_write): Correct toc base. Don't try to use
978 uint16_t for 24-bit offset. Use get_output_section_offset and
979 check return.
980 (Target_powerpc::Scan::local): Handle more relocs.
981 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
982 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
983 Plug in toc restoring insn after plt calls. Translate branches
984 to function descriptor symbols to corresponding entry point.
985 (Target_powerpc::relocate_for_relocatable): Check return from
986 get_output_section_offset.
987 * symtab.h: Comment typo.
988
989 2012-08-14 Ian Lance Taylor <iant@google.com>
990
991 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
992 unsupported_relocal_local to call unsupported_reloc_global.
993
994 2012-08-14 Nick Clifton <nickc@redhat.com>
995
996 PR ld/14265
997 * script-sections.cc (Sections_element::output_section_name): Add
998 keep return parameter.
999 (Output_section_element::match_name): Add keep return parameter.
1000 Return the value of the keep_ member.
1001 * script-sections.h (class Output_section): Update
1002 output_section_name prototype.
1003 * layout.cc (Layout::keep_input_section): New public member
1004 function.
1005 (Layout::choose_output_section): Pass keep parameter to
1006 output_section_name.
1007 * layout.h (class Layout): Add keep_input_section.
1008 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1009 sections.
1010 * testsuite/Makefile.am: Add a test.
1011 * testsuite/Makefile.in: Regenerate.
1012 * testsuite/pr14265.c: Source file for the test.
1013 * testsuite/pr14265.t: Linker script for the test.
1014 * testsuite/pr14265.sh: Shell script for the test.
1015
1016 2012-08-14 Alan Modra <amodra@gmail.com>
1017
1018 * target.h (Target::output_section_name): New function.
1019 (Target::do_output_section_name): New function.
1020 * layout.cc (Layout::choose_output_section): Call the above.
1021 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1022
1023 2012-08-14 Alan Modra <amodra@gmail.com>
1024
1025 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1026 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1027 for replace_constant call.
1028 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1029 (Output_data_glink::do_print_to_mapfile): New function.
1030 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1031 (Target_powerpc::Relocate::relocate): Likewise.
1032
1033 2012-08-14 Alan Modra <amodra@gmail.com>
1034
1035 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1036 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1037 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1038 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1039 all references to shndx_. Handle special case for R_PPC_PLTREL24
1040 here.
1041 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1042 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1043 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1044 here.
1045 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1046 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1047
1048 2012-08-12 Alan Modra <amodra@gmail.com>
1049
1050 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1051 (glink insn constants): Use uint32_t.
1052 (Output_data_glink::add_entry): Use insert, not [] operator.
1053
1054 2012-08-11 Alan Modra <amodra@gmail.com>
1055
1056 * object.h (Sized_relobj_file::find_shdr): New function.
1057 (Sized_relobj_file::find_special_sections): New function.
1058 * object.cc (Sized_relobj_file::find_shdr): New function.
1059 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1060 (Sized_relobj_file::find_special_sections): New function, split out..
1061 (Sized_relobj_file::do_read_symbols): ..from here.
1062 * output.h (Output_data_got::replace_constant): New function.
1063 (Output_data_got::num_entries): New function.
1064 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1065 (Output_data_got::got_offset): Protected rather than private.
1066 (Output_data_got::replace_got_entry): New function.
1067 * output.cc (Output_data_got::replace_got_entry): New function.
1068 * powerpc.cc (class Powerpc_relobj): New.
1069 (class Powerpc_relocate_functions): Delete all psymval variants or
1070 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1071 Implement _ha functions using corresponding _hi function.
1072 (Powerpc_relobj::find_special_sections): New function.
1073 (Target_powerpc::do_make_elf_object): New function.
1074 (class Output_data_got_powerpc): New.
1075 (class Output_data_glink): New.
1076 (class Powerpc_scan_relocatable_reloc): New.
1077 Many more changes througout file.
1078
1079 2012-08-09 Nick Clifton <nickc@redhat.com>
1080
1081 * po/vi.po: Updated Vietnamese translation.
1082
1083 2012-08-07 Ian Lance Taylor <iant@google.com>
1084
1085 * layout.cc (Layout::add_target_dynamic_tags): If
1086 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1087 plt_rel.
1088
1089 2012-07-30 Nick Clifton <nickc@redhat.com>
1090
1091 * po/gold.pot: Updated template.
1092 * po/es.po: Updated Spanish translation.
1093
1094 2012-07-18 Cary Coutant <ccoutant@google.com>
1095
1096 PR gold/14344
1097 * configure.ac: Add check for -gpubnames support.
1098 * configure: Regenerate.
1099 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1100 support; force -gno-pubnames.
1101 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1102 support.
1103 (gdb_index_test_4): New test.
1104 * testsuite/Makefile.in: Regenerate.
1105 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1106 * testsuite/gdb_index_test_2.sh: Likewise.
1107 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1108 * testsuite/gdb_index_test_4.sh: New script.
1109 * testsuite/gdb_index_test_comm.sh: New script with common code;
1110 don't look for space after colon.
1111
1112 2012-07-16 Sriraman Tallam <tmsriram@google.com>
1113
1114 * gold.cc (queue_middle_tasks): Update function order only after
1115 deferred objects due to plugins are processed.
1116
1117 2012-07-11 Ian Lance Taylor <iant@google.com>
1118
1119 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1120 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1121 (Target_arm::scan_reloc_for_stub): Likewise.
1122 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1123 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1124 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1125 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1126 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1127
1128 2012-07-10 Dodji Seketeli <dodji@redhat.com>
1129 Ian Lance Taylor <iant@google.com>
1130
1131 PR gold/14309
1132 * configure.ac: Test whether std::tr1::hash<off_t> works.
1133 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1134 needed.
1135 * output.h (class Output_fill): Add virtual destructor.
1136 * configure, config.in: Rebuild.
1137
1138 2012-06-22 Roland McGrath <mcgrathr@google.com>
1139
1140 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1141
1142 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1143
1144 * plugin.cc (Plugin::load): Handle position independent executables.
1145
1146 2012-06-06 Cary Coutant <ccoutant@google.com>
1147
1148 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1149 add .debug_macro.
1150 (lines_only_debug_sections): Likewise.
1151 (gdb_fast_lookup_sections): New static array.
1152 (is_gdb_debug_section): Rename formal parameter.
1153 (is_lines_only_debug_section): Likewise.
1154 (is_gdb_fast_lookup_section): New function.
1155 (Layout::include_section): Check for ".zdebug_" prefix; pass
1156 section name suffix to is_gdb_debug_section, et al.; check for
1157 fast-lookup sections when building .gdb_index.
1158 * options.h (--strip-debug-gdb): Update GDB version number.
1159
1160 2012-06-06 Cary Coutant <ccoutant@google.com>
1161
1162 * configure.ac: Add check for fallocate.
1163 * configure: Regenerate.
1164 * config.in: Regenerate.
1165
1166 * options.h (class General_options): Add --mmap-output-file and
1167 --posix-fallocate options.
1168 * output.cc: (posix_fallocate): Remove; replace with...
1169 (gold_fallocate): New function.
1170 (Output_file::map_no_anonymous): Call gold_fallocate.
1171 (Output_file::map): Check --mmap-output-file option.
1172
1173 2012-06-05 Jing Yu <jingyu@google.com>
1174
1175 * gold.h (textdomain): Add do {} to empty while(0).
1176 (bindtextdomain): Likewise.
1177
1178 2012-06-04 Cary Coutant <ccoutant@google.com>
1179
1180 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1181 has_dynsym_index.
1182
1183 2012-05-25 Sriraman Tallam <tmsriram@google.com>
1184
1185 * symtab.cc (Symbol_table::define_special_symbol):
1186 Initialize *poldsym to prevent uninitialized variable errors.
1187
1188 2012-05-23 Cary Coutant <ccoutant@google.com>
1189
1190 * layout.cc (Layout::section_name_mapping): Add rules to handle
1191 exact match on .data.rel.ro.local or .data.rel.ro.
1192 (Layout::output_section_name): Check for exact matches.
1193
1194 2012-05-23 Cary Coutant <ccoutant@google.com>
1195
1196 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1197 more carefully.
1198
1199 2012-05-22 Cary Coutant <ccoutant@google.com>
1200
1201 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1202 object before exporting symbol.
1203
1204 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1205
1206 * testsuite/tls_test.cc: Include "config.h" first.
1207 * testsuite/tls_test_c.c: Likewise.
1208
1209 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
1210 Nick Clifton <nickc@redhat.com>
1211
1212 PR 14072
1213 * configure.in: Add check that sysdep.h has been included before
1214 any system header files.
1215 * configure: Regenerate.
1216 * config.in: Regenerate.
1217
1218 2012-05-14 Cary Coutant <ccoutant@google.com>
1219
1220 * layout.cc (Layout::make_output_section): Mark .tdata section
1221 as RELRO.
1222 * testsuite/relro_test.cc: Add a TLS variable.
1223
1224 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1225
1226 PR gold/14091
1227 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1228 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1229 R_X86_64_64.
1230
1231 2012-05-08 Cary Coutant <ccoutant@google.com>
1232
1233 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1234 (lines_only_debug_sections): Likewise.
1235
1236 2012-05-02 Roland McGrath <mcgrathr@google.com>
1237
1238 * nacl.cc: New file.
1239 * nacl.h: New file.
1240 * Makefile.am (CCFILES, HFILES): Add them.
1241 * Makefile.in: Regenerate.
1242 * i386.cc (Output_data_plt_i386_nacl): New class.
1243 (Output_data_plt_i386_nacl_exec): New class.
1244 (Output_data_plt_i386_nacl_dyn): New class.
1245 (Target_i386_nacl): New class.
1246 (Target_selector_i386_nacl): New class.
1247 (target_selector_i386): Use it instead of Target_selector_i386.
1248 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1249 (Target_x86_64_nacl): New class.
1250 (Target_selector_x86_64_nacl): New class.
1251 (target_selector_x86_64, target_selector_x32): Use it instead of
1252 Target_selector_x86_64.
1253 * arm.cc (Output_data_plt_arm_nacl): New class.
1254 (Target_arm_nacl): New class.
1255 (Target_selector_arm_nacl): New class.
1256 (target_selector_arm, target_selector_armbe): Use it instead of
1257 Target_selector_arm.
1258
1259 * target-select.cc (select_target): Take new Input_file* and off_t
1260 arguments, pass them on to recognize method of selector.
1261 * object.cc (make_elf_sized_object): Update caller.
1262 * parameters.cc (parameters_force_valid_target): Likewise.
1263 * incremental.cc (make_sized_incremental_binary): Likewise.
1264 * target-select.h: Update decl.
1265 (Target_selector::recognize): Take new Input_file* argument,
1266 pass it on to do_recognize.
1267 (Target_selector::do_recognize): Take new Input_file* argument.
1268 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1269 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1270 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1271 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1272
1273 * target.h (Target::Target_info): New members isolate_execinstr
1274 and rosegment_gap.
1275 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1276 * arm.cc (Target_arm::arm_info): Update initializer.
1277 * i386.cc (Target_i386::i386_info): Likewise.
1278 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1279 * sparc.cc (Target_sparc::sparc_info): Likewise.
1280 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1281 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1282 * layout.cc (Layout::attach_allocated_section_to_segment):
1283 Take new const Target* argument. If target->isolate_execinstr(), act
1284 like --rosegment.
1285 (Layout::find_first_load_seg): Take new const Target* argument;
1286 if target->isolate_execinstr(), reject PF_X segments.
1287 (Layout::relaxation_loop_body): Update caller.
1288 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1289 reset file offset to zero when we hit LOAD_SEG, and then do a second
1290 loop over the segments before LOAD_SEG to reassign offsets after
1291 addresses have been determined. Handle target->rosegment_gap().
1292 (Layout::attach_section_to_segment): Take new const Target* argument;
1293 pass it to attach_allocated_section_to_segment.
1294 (Layout::make_output_section): Update caller.
1295 (Layout::attach_sections_to_segments): Take new const Target* argument;
1296 pass it to attach_section_to_segment.
1297 * gold.cc (queue_middle_tasks): Update caller.
1298 * layout.h (Layout): Update method decls with new arguments.
1299
1300 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1301 Target_info pointer to use.
1302 (Target_arm::do_make_data_plt): New virtual method.
1303 (Target_arm::make_data_plt): New method that calls it.
1304 (Target_arm::make_plt_entry): Use it.
1305 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1306 for the section alignment.
1307 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1308 method.
1309 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1310 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1311 method.
1312 (Output_data_plt_arm::get_plt_entry_size): Call it.
1313 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1314 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1315 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1316 method.
1317 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1318 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1319 method instead of sizeof(plt_entry).
1320 (Output_data_plt_arm::add_entry): Likewise.
1321 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1322 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1323 than static method.
1324 (Target_arm::plt_entry_size): Likewise.
1325 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1326 Move to ...
1327 (Output_data_plt_arm_standard): ... here, new class.
1328 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1329 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1330 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1331
1332 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1333 Take additional argument for the PLT entry size.
1334 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1335 Use get_plt_entry_size method rather than plt_entry_size variable.
1336 (Output_data_plt_x86_64::reserve_slot): Likewise.
1337 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1338 (Output_data_plt_x86_64::add_entry): Likewise.
1339 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1340 (Output_data_plt_x86_64::address_for_global): Likewise.
1341 (Output_data_plt_x86_64::address_for_local): Likewise.
1342 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1343 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1344 Make method non-static.
1345 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1346 method.
1347 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1348 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1349 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1350 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1351 virtual method.
1352 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1353 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1354 virtual method.
1355 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1356 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1357 virtual method.
1358 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1359 (Output_data_plt_x86_64::plt_entry_size)
1360 (Output_data_plt_x86_64::first_plt_entry)
1361 (Output_data_plt_x86_64::plt_entry)
1362 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1363 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1364 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1365 (Output_data_plt_x86_64_standard): ... here, new class.
1366 (Target_x86_64::Target_x86_64): Take optional argument for the
1367 Target_info pointer to use.
1368 (Target_x86_64::do_make_data_plt): New virtual method.
1369 (Target_x86_64::make_data_plt): New method to call it.
1370 (Target_x86_64::init_got_plt_for_update): Use that.
1371 Call this->plt_->add_eh_frame method here.
1372 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1373 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1374 rather than static method.
1375 (Target_x86_64::plt_entry_size): Likewise.
1376 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1377 rather than plt_entry_size variable. Move guts of PLT filling to...
1378 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1379 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1380 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1381
1382 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1383 additional argument for the section alignment.
1384 Don't do add_eh_frame_for_plt here.
1385 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1386 non-static. Use get_plt_entry_size method rather than plt_entry_size
1387 variable.
1388 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1389 method.
1390 (Output_data_plt_i386::get_plt_entry_size): Call it.
1391 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1392 (Output_data_plt_i386::add_eh_frame): New method to call it.
1393 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1394 method.
1395 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1396 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1397 method.
1398 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1399 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1400 method instead of plt_entry_size.
1401 (Output_data_plt_i386::plt_entry_size)
1402 (Output_data_plt_i386::plt_eh_frame_fde_size)
1403 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1404 (Output_data_plt_i386_standard): ... here, new class.
1405 (Output_data_plt_i386_exec): New class.
1406 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1407 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1408 (Output_data_plt_i386::exec_plt_entry): Move to ...
1409 (Output_data_plt_i386_exec::plt_entry): ... here.
1410 (Output_data_plt_i386_dyn): New class.
1411 (Output_data_plt_i386::first_plt_entry): Move to ...
1412 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1413 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1414 (Output_data_plt_i386_dyn::plt_entry): ... here.
1415 (Target_i386::Target_i386): Take optional argument for the Target_info
1416 pointer to use.
1417 (Target_i386::do_make_data_plt): New virtual method.
1418 (Target_i386::make_data_plt): New method to call it.
1419 (Target_i386::make_plt_section): Use that.
1420 Call this->plt_->add_eh_frame method here.
1421 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1422 rather than plt_entry_size variable.
1423 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1424 (Output_data_plt_i386::address_for_local): Likewise.
1425 (Output_data_plt_i386::do_write): Likewise.
1426 Move guts of PLT filling to...
1427 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1428 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1429 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1430 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1431
1432 2012-05-01 Cary Coutant <ccoutant@google.com>
1433
1434 * dwarf_reader.cc (Dwarf_die::read_attributes)
1435 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1436 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1437 * reduced_debug_output.cc
1438 (Output_reduced_debug_info_section::get_die_end): Remove
1439 DW_FORM_GNU_ref_index. Add default case.
1440
1441 2012-04-26 Mark Wielaard <mjw@redhat.com>
1442
1443 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1444 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1445 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1446 DW_AT_high_pc as offset from DW_AT_low_pc.
1447
1448 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1449 * testsuite/Makefile.in: Regenerate.
1450 * testsuite/gdb_index_test_3.c: New test source file.
1451 * testsuite/gdb_index_test_3.sh: New test source file.
1452
1453 2012-04-25 Ian Lance Taylor <iant@google.com>
1454
1455 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1456 pointer.
1457 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1458 as a class, not a struct.
1459 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1460 (Target_arm::apply_cortex_a8_workaround): Likewise.
1461 * gc.h: Declare Reloc_types as a struct, not a class.
1462 * object.h: Declare Symbols_data as a struct.
1463 * reloc.h: Declare Read_relocs_data as a struct.
1464 * target.h: Declare Relocate_info as a struct.
1465
1466 2012-04-24 David S. Miller <davem@davemloft.net>
1467
1468 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1469 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1470 and R_SPARC_WPLT30.
1471
1472 2012-04-24 Cary Coutant <ccoutant@google.com>
1473
1474 * incremental-dump.cc (find_input_containing_global): Replace
1475 magic number with symbolic constant.
1476 (dump_incremental_inputs): Update version number.
1477 * incremental.cc (Output_section_incremental_inputs): Update version
1478 number; import symbolic constants from Incremental_inputs_reader.
1479 (Incremental_inputs::create_data_sections): Align relocations
1480 section correctly for 64-bit targets.
1481 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1482 constants; add padding.
1483 (Output_section_incremental_inputs::write_header): Add assert for
1484 header_size.
1485 (Output_section_incremental_inputs::write_input_files): Add assert
1486 for input_entry_size.
1487 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1488 add assert for object_info_size, input_section_entry_size,
1489 global_sym_entry_size.
1490 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1491 for data structure sizes; use them.
1492 (Incremental_input_entry_reader): Import symbolic constants from
1493 Incremental_inputs_reader; use them.
1494
1495 2012-04-23 David S. Miller <davem@davemloft.net>
1496
1497 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1498 and elf_flags_set_.
1499 (Target_sparc::Target_sparc): Initialize new fields.
1500 (Target_sparc::do_make_elf_object): New function.
1501 (Target_sparc::do_adjust_elf_header): New function.
1502
1503 2012-04-23 Cary Coutant <ccoutant@google.com>
1504
1505 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1506 CU range table of gdb index.
1507
1508 2012-04-20 David S. Miller <davem@davemloft.net>
1509
1510 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1511 instead of false.
1512
1513 2012-04-16 David S. Miller <davem@davemloft.net>
1514
1515 * sparc.cc (Target_sparc::got_address): New function.
1516 (Sparc_relocate_functions::gdop_hix22): New function.
1517 (Sparc_relocate_functions::gdop_lox10): New function.
1518 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1519 relocs.
1520 (Target_sparc::Scan::local): Likewise if the global symbol is not
1521 preemptible and is not IFUNC.
1522 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1523 transformations for local and non-preemptible non-IFUNC global
1524 symbols.
1525
1526 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1527 writing out 64-bit part of ranges.
1528
1529 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1530 -fpic and -fpie respectively.
1531 * Makefile.in: Regenerate.
1532
1533 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1534 (Target_sparc::Target_sparc): Initialize new field.
1535 (Target_sparc::do_plt_section_for_global): New function.
1536 (Target_sparc::do_plt_section_for_local): New function.
1537 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1538 (Target_sparc::make_plt_section): New function, broken out of
1539 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1540 (Target_sparc::make_plt_entry): Call make_plt_section.
1541 (Target_sparc::make_local_ifunc_plt_entry): New function.
1542 (Target_sparc::rela_ifunc_section): New function.
1543 (Target_sparc::plt_section): Remove const.
1544 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1545 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1546 and ifunc_count_ fields.
1547 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1548 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1549 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1550 (Output_data_plt_sparc::rela_ifunc): New function.
1551 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1552 (Output_data_plt_sparc::has_ifunc_section): New function.
1553 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1554 (Output_data_plt_sparc::address_for_global): New function.
1555 (Output_data_plt_sparc::address_for_local): New function.
1556 (Output_data_plt_sparc::plt_index_to_offset): New function.
1557 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1558 and entry_count.
1559 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1560 entry_count.
1561 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1562 R_SPARC_JMP_IREL to switch.
1563 (Target_sparc::Scan::check_non_pic): Likewise.
1564 (Target_sparc::Scan::local): Handle IFUNC symbols.
1565 (Target_sparc::Scan::local): Likewise.
1566 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1567 and plt_address_for_local.
1568 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1569 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1570
1571 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1572 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1573 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1574 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1575 global relocs too.
1576 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1577 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1578 calls.
1579 * sparc.cc (Target_sparc::Scan::global): Likewise.
1580 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1581
1582 2012-04-16 Cary Coutant <ccoutant@google.com>
1583
1584 * archive.cc (Library_base::should_include_member): Check for
1585 --export-dynamic-symbol.
1586 * options.h (class General_options): Add --export-dynamic-symbol.
1587 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1588 --export-dynamic-symbol.
1589 (Symbol_table::gc_mark_undef_symbols): Likewise.
1590 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1591
1592 2012-04-12 David S. Miller <davem@davemloft.net>
1593
1594 * sparc.cc (Reloc::wdisp10): New relocation method.
1595 (Reloc::h34): Likewise.
1596 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1597 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1598 R_SPARC_WDISP10.
1599 (Target_sparc::Scan::local): Likewise.
1600 (Target_sparc::Scan::global): Likewise.
1601 (Target_sparc::Relocate::relocate): Likewise.
1602
1603 2012-04-09 Cary Coutant <ccoutant@google.com>
1604
1605 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1606 low_pc == 0.
1607
1608 2012-04-06 Ian Lance Taylor <iant@google.com>
1609
1610 * timer.cc: #include <unistd.h>.
1611
1612 2012-04-06 Roland McGrath <mcgrathr@google.com>
1613
1614 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1615 * config.in: Regenerate.
1616 * configure: Regenerate.
1617
1618 2012-04-05 Nick Clifton <nickc@redhat.com>
1619
1620 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1621 (AM_LC_MESSAGES): Add.
1622 * aclocal.m4: Regenerate.
1623 * config.in: Regenerate.
1624 * configure: Regenerate.
1625
1626 2012-03-21 Cary Coutant <ccoutant@google.com>
1627
1628 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1629 * Makefile.in: Regenerate.
1630 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1631 (Sized_elf_reloc_mapper::symbol_section): New function.
1632 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1633 (make_elf_reloc_mapper): New function.
1634 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1635 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1636 (Dwarf_abbrev_table::do_get_abbrev): New function.
1637 (Dwarf_ranges_table::read_ranges_table): New function.
1638 (Dwarf_ranges_table::read_range_list): New function.
1639 (Dwarf_pubnames_table::read_section): New function.
1640 (Dwarf_pubnames_table::read_header): New function.
1641 (Dwarf_pubnames_table::next_name): New function.
1642 (Dwarf_die::Dwarf_die): New function.
1643 (Dwarf_die::read_attributes): New function.
1644 (Dwarf_die::skip_attributes): New function.
1645 (Dwarf_die::set_name): New function.
1646 (Dwarf_die::set_linkage_name): New function.
1647 (Dwarf_die::attribute): New function.
1648 (Dwarf_die::string_attribute): New function.
1649 (Dwarf_die::int_attribute): New function.
1650 (Dwarf_die::uint_attribute): New function.
1651 (Dwarf_die::ref_attribute): New function.
1652 (Dwarf_die::child_offset): New function.
1653 (Dwarf_die::sibling_offset): New function.
1654 (Dwarf_info_reader::check_buffer): New function.
1655 (Dwarf_info_reader::parse): New function.
1656 (Dwarf_info_reader::do_parse): New function.
1657 (Dwarf_info_reader::do_read_string_table): New function.
1658 (Dwarf_info_reader::lookup_reloc): New function.
1659 (Dwarf_info_reader::get_string): New function.
1660 (Dwarf_info_reader::visit_compilation_unit): New function.
1661 (Dwarf_info_reader::visit_type_unit): New function.
1662 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1663 Sized_elf_reloc_mapper.
1664 (Sized_dwarf_line_info::symbol_section): Remove function.
1665 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1666 (Sized_dwarf_line_info::read_line_mappings): Remove object
1667 parameter, adjust callers.
1668 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1669 * dwarf_reader.h: Include <sys/types.h>.
1670 (class Track_relocs): Remove forward declaration.
1671 (class Elf_reloc_mapper): New class.
1672 (class Sized_elf_reloc_mapper): New class.
1673 (class Dwarf_abbrev_table): New class.
1674 (class Dwarf_range_list): New class.
1675 (class Dwarf_ranges_table): New class.
1676 (class Dwarf_pubnames_table): New class.
1677 (class Dwarf_die): New class.
1678 (class Dwarf_info_reader): New class.
1679 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1680 (Sized_dwarf_line_info::symbol_section): Remove member function.
1681 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1682 base class.
1683 * gdb-index.cc: New source file.
1684 * gdb-index.h: New source file.
1685 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1686 and .debug_types sections, call Layout::add_to_gdb_index.
1687 (Sized_relobj_incr::do_section_name): Implement.
1688 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1689 return type; Implement.
1690 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1691 return type.
1692 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1693 parameter list and return type.
1694 (Sized_incr_dynobj::do_section_contents): Likewise.
1695 * layout.cc: Include gdb-index.h.
1696 (Layout::Layout): Initialize gdb_index_data_.
1697 (Layout::init_fixed_output_section): Check for .gdb_index section.
1698 (Layout::add_to_gdb_index): New function. Instantiate.
1699 * layout.h: Add forward declaration for class Gdb_index.
1700 (Layout::add_to_gdb_index): New member function.
1701 (Layout::gdb_index_data_): New data member.
1702 * main.cc: Include gdb-index.h.
1703 (main): Print statistics for gdb index.
1704 * object.cc (Object::section_contents): Move code into
1705 do_section_contents.
1706 (need_decompressed_section): Check for sections needed when building
1707 gdb index.
1708 (build_compressed_section_map): Likewise.
1709 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1710 gdb index.
1711 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1712 sections; call Layout::add_to_gdb_index.
1713 (Sized_relobj_file::do_decompressed_section_contents): Call
1714 do_section_contents directly.
1715 * object.h (Object::do_section_contents): Adjust parameter list and
1716 return type.
1717 (Object::do_decompressed_section_contents): Call do_section_contents
1718 directly.
1719 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1720 return type.
1721 * options.h (class General_options): Add --gdb-index option.
1722 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1723 list and return type.
1724 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1725 * reloc.h (Track_relocs::checkpoint): New function.
1726 (Track_relocs::reset): New function.
1727
1728 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1729 New test cases.
1730 * testsuite/Makefile.in: Regenerate.
1731 * testsuite/gdb_index_test.cc: New test source file.
1732 * testsuite/gdb_index_test_1.sh: New test source file.
1733 * testsuite/gdb_index_test_2.sh: New test source file.
1734
1735 2012-03-19 Doug Kwan <dougkwan@google.com>
1736
1737 * arm.cc (Target_arm::do_define_standard_symbols): New method.
1738 (Target_arm::do_finalize_sections): Remove code which defines
1739 __exidx_start and __exidx_end. Make symbol table parameter
1740 anonymous as it is not used.
1741 * gold.cc (queue_middle_tasks): Call target hook to define any
1742 target-specific symbols.
1743 * target.h (Target::define_standard_symbols): New method.
1744 (Target::do_define_standard_symbols): Same.
1745 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1746 * testsuite/Makefile.in: Regenerate.
1747 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1748 and __exidx_end.
1749 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1750 relocations are generated for __exidx_start and __exidx_end.
1751
1752 2012-03-16 Doug Kwan <dougkwan@google.com>
1753
1754 * testsuite/Makefile.am: Disable test initpri3b.
1755 * testsuite/Makefile.in: Regenerate.
1756
1757 2012-03-15 Doug Kwan <dougkwan@google.com>
1758
1759 * arm.cc (Target_arm::got_section): Make .got section read-only
1760 if -z now is given.
1761
1762 2012-03-15 Ian Lance Taylor <iant@google.com>
1763
1764 PR gold/13850
1765 * layout.cc (Layout::make_output_section): Correctly mark
1766 SHT_INIT_ARRAY, et. al., as relro.
1767
1768 2012-03-14 Doug Kwan <dougkwan@google.com>
1769
1770 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1771 dynamic relocations for protected symbols in shared objects.
1772
1773 2012-03-13 Ian Lance Taylor <iant@google.com>
1774
1775 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1776 keep the larger alignment.
1777
1778 2012-03-12 Cary Coutant <ccoutant@google.com>
1779
1780 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1781 handling of DW_LNE_define_file.
1782
1783 2012-03-12 Cary Coutant <ccoutant@google.com>
1784
1785 * reduced_debug_output.cc
1786 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1787 codes to switch.
1788
1789 2012-02-29 Cary Coutant <ccoutant@google.com>
1790
1791 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1792
1793 2012-02-29 Cary Coutant <ccoutant@google.com>
1794
1795 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1796 Call Object::decompressed_section_contents.
1797 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1798 New dtor.
1799 (Sized_dwarf_line_info::buffer_start_): New data member.
1800 * merge.cc (Output_merge_data::do_add_input_section): Call
1801 Object::decompressed_section_contents.
1802 (Output_merge_string::do_add_input_section): Likewise.
1803 * object.cc (need_decompressed_section): New function.
1804 (build_compressed_section_map): Decompress sections needed later.
1805 (Sized_relobj_file::do_decompressed_section_contents): New function.
1806 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1807 * object.h (Object::decompressed_section_contents): New function.
1808 (Object::discard_decompressed_sections): New function.
1809 (Object::do_decompressed_section_contents): New function.
1810 (Object::do_discard_decompressed_sections): New function.
1811 (Compressed_section_info): New type.
1812 (Compressed_section_map): Include decompressed section contents.
1813 (Sized_relobj_file::do_decompressed_section_contents): New function.
1814 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1815
1816 2012-02-16 Cary Coutant <ccoutant@google.com>
1817
1818 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1819 * testsuite/Makefile.in: Regenerate.
1820
1821 2012-02-14 Cary Coutant <ccoutant@google.com>
1822
1823 * options.cc (General_options::finalize): Disallow -pie and -static.
1824
1825 2012-02-03 Doug Kwan <dougkwan@google.com>
1826
1827 * arm.cc (Arm_relocate_functions::abs8,
1828 Arm_relocate_functions::abs16): Use
1829 Bits::has_signed_unsigned_overflow32.
1830 (Arm_relocate_functions::thm_abs8): Correct range of
1831 overflow check.
1832 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1833 in assertions.
1834
1835 2012-02-02 Doug Kwan <dougkwan@google.com>
1836
1837 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1838 position independent outputs, not just shared objects.
1839
1840 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1841
1842 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1843 * configure: Regenerated.
1844
1845 2012-01-27 Ian Lance Taylor <iant@google.com>
1846
1847 * reloc.h (Bits): New class with static functions, copied from
1848 namespace utils in arm.cc.
1849 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1850 instead.
1851
1852 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1853
1854 * incremental.cc (write_info_blocks): Correct relocation offset.
1855
1856 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1857
1858 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1859 (Relocate::tls_gd_to_le): Likewise.
1860
1861 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1862
1863 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1864
1865 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1866
1867 * configure.ac: Check if -mcmodel=medium works.
1868 * configure: Regenerated.
1869
1870 2012-01-24 Cary Coutant <ccoutant@google.com>
1871
1872 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1873 definition and ...
1874 (read_unsigned_LEB_128_x): ... this new function.
1875 (read_signed_LEB_128): Replaced with inline definition and ...
1876 (read_signed_LEB_128_x): ... this new function.
1877 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1878 (read_unsigned_LEB_128): Add inline definition.
1879 (read_signed_LEB_128_x): New function.
1880 (read_signed_LEB_128): Add inline definition.
1881 * testsuite/Makefile.am (leb128_unittest): New unit test.
1882 * testsuite/Makefile.in: Regenerate.
1883 * testsuite/leb128_unittest.cc: New unit test.
1884
1885 2012-01-23 Ian Lance Taylor <iant@google.com>
1886
1887 PR gold/13617
1888 * i386.cc (Target_i386::do_code_fill): When using a jmp
1889 instruction, pad with nop instructions.
1890 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1891
1892 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1893
1894 * x86_64.cc (gc_process_relocs): Add typename on types used in
1895 template.
1896 (scan_relocs): Likewise.
1897 (relocate_section): Likewise.
1898 (apply_relocation): Likewise.
1899
1900 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1901
1902 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1903 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1904 under x32.
1905
1906 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1907
1908 * x86_64.cc: Initial support for x32.
1909
1910 2012-01-03 Cary Coutant <ccoutant@google.com>
1911
1912 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1913 Use abstract base class for GOT.
1914 * gold/output.h (class Output_data_got_base): New abstract base class.
1915 (class Output_data_got): Derive from new base class, adjust ctors.
1916 (Output_data_got::reserve_slot): Make virtual; rename to
1917 do_reserve_slot; Adjust callers.
1918 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1919 pointer to abstract base class.
1920 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1921
1922 2011-12-18 Ian Lance Taylor <iant@google.com>
1923
1924 * object.h (Relobj::local_symbol_value): New function.
1925 (Relobj::local_plt_offset): New function.
1926 (Relobj::local_has_got_offset): New function.
1927 (Relobj::local_got_offset): New function.
1928 (Relobj::set_local_got_offset): New function.
1929 (Relobj::do_local_symbol_value): New pure virtual function.
1930 (Relobj::do_local_plt_offset): Likewise.
1931 (Relobj::do_local_has_got_offset): Likewise.
1932 (Relobj::do_local_got_offset): Likewise.
1933 (Relobj::do_set_local_got_offset): Likewise.
1934 (Sized_relobj::do_local_has_got_offset): Rename from
1935 local_has_got_offset.
1936 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1937 (Sized_relobj::do_set_local_got_offset): Rename from
1938 set_local_got_offset.
1939 (Sized_relobj_file::do_local_plt_offset): Rename from
1940 local_plt_offset.
1941 (Sized_relobj_file::do_local_symbol_value): New function.
1942 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1943 local_plt_offset.
1944 * output.cc (Output_data_got::Got_entry::write): Change object to
1945 Relobj. Use local_symbol_value.
1946 (Output_data_got::add_global_with_rel): Change rel_dyn to
1947 Output_data_reloc_generic*. Use add_global_generic.
1948 (Output_data_got::add_global_with_rela): Remove. Change all
1949 callers to use add_global_with_rel.
1950 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1951 Output_data_reloc_generic*. Use add_global_generic.
1952 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1953 callers to use add_global_pair_with_rel.
1954 (Output_data_got::add_local): Change object to Relobj*.
1955 (Output_data_got::add_local_plt): Likewise.
1956 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1957 change rel_dyn to Output_data_reloc_generic*. Use
1958 add_local_generic.
1959 (Output_data_got::add_local_with_rela): Remove. Change all
1960 callers to use all_local_with_rel.
1961 (Output_data_got::add_local_pair_with_rel): Change object to
1962 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1963 add_output_section_generic.
1964 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1965 callers to use add_local_pair_with_rel.
1966 (Output_data_got::reserve_local): Change object to Relobj*.
1967 * output.h: (class Output_data_reloc_generic): Add pure virtual
1968 declarations for add_global_generic, add_local_generic,
1969 add_output_section_generic.
1970 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1971 functions for Output_data_reloc_generic. Update declarations for
1972 changes listed in output.cc.
1973 (class Output_data_got): Change template parameter to got_size.
1974 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1975 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1976 function.
1977 (Sized_relobj_incr::do_local_plt_offset): New function.
1978 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1979 add_global_generic.
1980
1981 2011-12-17 Cary Coutant <ccoutant@google.com>
1982
1983 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1984 * resolve.cc (Symbol_table::resolve): Likewise.
1985 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1986 arrays.
1987 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1988
1989 2011-12-16 Ian Lance Taylor <iant@google.com>
1990
1991 * output.h (Output_data_reloc_generic::add): Only call
1992 add_dynamic_reloc if this is a dynamic reloc section.
1993
1994 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1995
1996 PR gold/13505
1997 * target-reloc.h (apply_relocation): Replace <64, false> with
1998 <size, big_endian>.
1999
2000 2011-11-25 Nick Clifton <nickc@redhat.com>
2001
2002 * po/it.po: New Italian translation.
2003
2004 2011-11-17 Sterling Augustine <saugustine@google.com>
2005
2006 * script.cc (script_include_directive): Implement.
2007 (read_script_file): New local variables name and search_path. Update
2008 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2009 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2010 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2011
2012 2011-11-11 Sterling Augustine <saugustine@google.com>
2013
2014 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2015 (file_or_sections_cmd): Likewise.
2016
2017 2011-11-11 Doug Kwan <dougkwan@google.com>
2018
2019 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2020 if --just-symbols is given.
2021
2022 2011-11-10 Doug Kwan <dougkwan@google.com>
2023
2024 PR gold/13362
2025 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2026 when processing data relocs.
2027 * reloc.h (Relocate_functions::rel_unaligned): New method.
2028 (Relocate_functions::pcrel_unaligned): Ditto.
2029 (Relocate_functions::rel32_unaligned): Ditto.
2030 (Relocate_functions::pcrel32_unaligned): Ditto.
2031
2032 2011-11-09 Doug Kwan <dougkwan@google.com>
2033
2034 PR gold/13362
2035 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2036 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2037 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2038 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2039 (Relocate_functions::rel_unaligned): New.
2040 (Relocate_functions::rel32_unaligned): New.
2041 * target-reloc.h (relocate_for_relocatable): Add code to handle
2042 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2043 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2044 arm_unaligned_reloc_r): New targets.
2045 * testsuite/Makefile.in: Regenerate.
2046 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2047 linking.
2048
2049 2011-11-02 Ian Lance Taylor <iant@google.com>
2050
2051 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2052 NATIVE_LINKER.
2053 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2054 * options.cc (General_options::finalize): Use library search path
2055 from configure script if specified. If not native and no sysroot,
2056 only search TOOLLIBDIR.
2057 * options.h (Search_directory::Search_directory): Change name to
2058 const std::string&.
2059 (General_options::add_to_library_path_with_sysroot): Change arg to
2060 const std::string&.
2061 * configure, Makefile.in, config.in: Rebuild.
2062
2063 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2064
2065 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2066 we are working around the ARM1176 Erratum.
2067 * options.h (General_options::fix_arm1176): Add option.
2068 * testsuite/Makefile.am: Add testcases, and keep current ones
2069 working.
2070 * testsuite/Makefile.in: Regenerate.
2071 * testsuite/arm_fix_1176.s: New file.
2072 * testsuite/arm_fix_1176.sh: Likewise.
2073
2074 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2075
2076 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2077 may_use_blx_.
2078 (Target_arm::may_use_blx): Remove method.
2079 (Target_arm::set_may_use_blx): Likewise.
2080 (Target_arm::may_use_v4t_interworking): New method.
2081 (Target_arm::may_use_v5t_interworking): Likewise.
2082 (Target_arm::may_use_blx_): Remove member variable.
2083 (Arm_relocate_functions::arm_branch_common): Check for v5T
2084 interworking.
2085 (Arm_relocate_functions::thumb_branch_common): Likewise.
2086 (Reloc_stub::stub_type_for_reloc): Likewise.
2087 (Target_arm::do_finalize_sections): Correct interworking checks.
2088 * testsuite/Makefile.am: Add new tests.
2089 * testsuite/Makefile.in: Regenerate.
2090 * testsuite/arm_farcall_arm_arm.s: New test.
2091 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2092 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2093 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2094 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2095 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2096 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2097 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2098
2099 2011-10-31 Cary Coutant <ccoutant@google.com>
2100
2101 PR gold/13023
2102 * expression.cc (Expression::eval_with_dot): Add
2103 is_section_dot_assignment parameter.
2104 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2105 absolute and assigning to dot within a section.
2106 * script-sections.cc
2107 (Output_section_element_assignment::set_section_addresses): Pass
2108 dot_section to set_if_absolute.
2109 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2110 as is_section_dot_assignment flag to eval_with_dot.
2111 (Output_section_element_dot_assignment::set_section_addresses):
2112 Likewise.
2113 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2114 parameter. Also set value if relative to dot_section; set the
2115 symbol's output_section.
2116 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2117 parameter. Adjust all callers.
2118 (Expression::eval_maybe_dot): Likewise.
2119 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2120 Adjust all callers.
2121 * testsuite/script_test_2.t: Test assignment of an absolute value
2122 to dot within an output section element.
2123
2124 2011-10-31 Cary Coutant <ccoutant@google.com>
2125
2126 * options.h (class General_options): Add --[no-]gnu-unique options.
2127 * symtab.cc (Symbol_table::sized_write_globals): Convert
2128 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2129
2130 2011-10-31 Cary Coutant <ccoutant@google.com>
2131
2132 PR gold/13359
2133 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2134 unnecessary assertion.
2135 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2136
2137 2011-10-31 Sriraman Tallam <tmsriram@google.com>
2138
2139 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2140 gc_mark_symbol.
2141 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2142 gc_mark_symbol.
2143 Change to just keep the section associated with symbol.
2144 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2145 they are externally visible and --export-dynamic is turned on.
2146 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2147
2148 2011-10-19 Ian Lance Taylor <iant@google.com>
2149
2150 PR gold/13163
2151 * script-sections.cc
2152 (Output_section_element_dot_assignment::needs_output_section): New
2153 function.
2154
2155 2011-10-19 Ian Lance Taylor <iant@google.com>
2156
2157 PR gold/13204
2158 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2159 --section-start option was seen.
2160 * options.h (General_options::any_section_start): New function.
2161
2162 2011-10-18 David S. Miller <davem@davemloft.net>
2163
2164 PR binutils/13301
2165 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2166 member to track relocation locations that have moved during TLS
2167 reloc optimizations.
2168 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2169 (Target_sparc::Relocate::relocate): Adjust view down by 4
2170 bytes if it matches reloc_adjust_addr_.
2171 (Target_sparc::Relocate::relocate_tls): Always move the
2172 __tls_get_addr call delay slot instruction forward 4 bytes when
2173 performing relaxation.
2174
2175 2011-10-18 Cary Coutant <ccoutant@google.com>
2176
2177 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2178 (Output_file::map_no_anonymous): Check for non-zero
2179 return code from posix_fallocate.
2180
2181 2011-10-17 Cary Coutant <ccoutant@google.com>
2182
2183 PR gold/13245
2184 * plugin.cc (is_visible_from_outside): Check for symbols
2185 referenced from dynamic objects.
2186 * resolve.cc (Symbol_table::resolve): Don't count references
2187 from dynamic objects as references from real ELF files.
2188 * testsuite/plugin_test_2.sh: Adjust expected result.
2189
2190 2011-10-17 Cary Coutant <ccoutant@google.com>
2191
2192 * gold.cc: Include timer.h.
2193 (queue_middle_tasks): Stamp time.
2194 (queue_final_tasks): Likewise.
2195 * main.cc (main): Store timer in parameters. Print timers
2196 for each pass.
2197 * parameters.cc (Parameters::Parameters): Initialize timer_.
2198 (Parameters::set_timer): New function.
2199 (set_parameters_timer): New function.
2200 * parameters.h (Parameters::set_timer): New function.
2201 (Parameters::timer): New function.
2202 (Parameters::timer_): New data member.
2203 (set_parameters_timer): New function.
2204 * timer.cc (Timer::stamp): New function.
2205 (Timer::get_pass_time): New function.
2206 * timer.h (Timer::stamp): New function.
2207 (Timer::get_pass_time): New function.
2208 (Timer::pass_times_): New data member.
2209
2210 2011-10-17 Cary Coutant <ccoutant@google.com>
2211
2212 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2213 task for members of lib groups.
2214
2215 2011-10-17 Cary Coutant <ccoutant@google.com>
2216
2217 PR gold/13288
2218 * fileread.cc (File_read::find_view): Add assert.
2219 (File_read::make_view): Move bounds check (replace with assert)...
2220 (File_read::find_or_make_view): ... to here.
2221
2222 2011-10-12 Cary Coutant <ccoutant@google.com>
2223
2224 * output.cc (Output_file::open_base_file): Handle case where
2225 ::read returns less than requested size.
2226
2227 2011-10-10 Cary Coutant <ccoutant@google.com>
2228
2229 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
2230 Initialize defined_count_.
2231 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2232 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2233 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2234 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2235 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
2236 * incremental.h (Sized_relobj_incr::defined_count_): New data
2237 member.
2238 (Sized_incr_dynobj::defined_count_): New data member.
2239 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
2240 Return zeroes instead of internal error.
2241
2242 2011-10-10 Cary Coutant <ccoutant@google.com>
2243
2244 PR gold/13249
2245 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
2246 (Output_reloc::symbol_value): Return PLT offset if flag is set.
2247 * output.h (class Output_reloc): Add use_plt_offset flag.
2248 (Output_reloc::type_): Adjust size of bit field.
2249 (Output_reloc::use_plt_offset_): New bit field.
2250 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2251 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2252 flag. Adjust all callers.
2253 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
2254 creating RELATIVE relocations.
2255
2256 2011-10-10 Nick Clifton <nickc@redhat.com>
2257
2258 * po/es.po: Updated Spanish translation.
2259 * po/fi.po: Updated Finnish translation.
2260
2261 2011-10-03 Diego Novillo <dnovillo@google.com>
2262
2263 * options.cc (parse_uint): Fix dereference of RETVAL.
2264
2265 2011-09-29 Sriraman Tallam <tmsriram@google.com>
2266
2267 * layout.h (section_order_map_): New member.
2268 (get_section_order_map): New member function.
2269 * output.cc (Output_section::add_input_section): Check for patterns
2270 only when --section-ordering-file is specified.
2271 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2272 output_sections have been formed.
2273 * layout.cc (Layout_Layout): Initialize section_order_map_.
2274 * plugin.cc (update_section_order): Store order in order_map. Do not
2275 update the order.
2276 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2277 * testsuite/Makefile.in: Regenerate.
2278 * testsuite/plugin_section_order.c: New file.
2279 * testsuite/plugin_final_layout.cc: New file.
2280 * testsuite/plugin_final_layout.sh: New file.
2281
2282 2011-09-29 Cary Coutant <ccoutant@google.com>
2283
2284 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2285 Check for NULL.
2286 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
2287 symbols during incremental update.
2288 (Symbol_table::add_from_dynobj): Likewise.
2289
2290 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2291 Ian Lance Taylor <iant@google.com>
2292
2293 * symtab.cc (Symbol_table::define_special_symbol): Always
2294 canonicalize version string.
2295
2296 2011-09-26 Cary Coutant <ccoutant@google.com>
2297
2298 * gold.cc (queue_initial_tasks): Move option checks ...
2299 * options.cc (General_options::finalize): ... to here. Disable
2300 some options; make others fatal.
2301
2302 2011-09-26 Cary Coutant <ccoutant@google.com>
2303
2304 gcc PR lto/47247
2305 * plugin.cc (get_symbols_v2): New function.
2306 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2307 (is_referenced_from_outside): New function.
2308 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2309 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2310 (get_symbols): Pass version parameter.
2311 (get_symbols_v2): New function.
2312 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2313 parameter.
2314 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2315 (onload): Add LDPT_GET_SYMBOLS_V2.
2316 (all_symbols_read_hook): Use get_symbols_v2; check for
2317 LDPR_PREVAILING_DEF_IRONLY_EXP.
2318 * testsuite/plugin_test_3.sh: Update expected results.
2319
2320 2011-09-23 Simon Baldwin <simonb@google.com>
2321
2322 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2323 configuration options.
2324 * configure: Regenerate.
2325 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2326 * Makefile.in: Regenerate.
2327 * testsuite/Makefile.in: Regenerate.
2328
2329 2011-09-19 Sriraman Tallam <tmsriram@google.com>
2330
2331 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2332
2333 2011-09-19 Cary Coutant <ccoutant@google.com>
2334
2335 * incremental.cc (can_incremental_update): Fix typo in comment.
2336 * incremental.h (can_incremental_update): Likewise.
2337
2338 2011-09-18 Cary Coutant <ccoutant@google.com>
2339
2340 * incremental.cc (can_incremental_update): New function.
2341 * incremental.h (can_incremental_update): New function.
2342 * layout.cc (Layout::init_fixed_output_section): Call it.
2343 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2344 * object.cc (Sized_relobj_file::do_layout): Call
2345 can_incremental_update.
2346
2347 2011-09-13 Cary Coutant <ccoutant@google.com>
2348
2349 * configure.ac: Check for glibc support for gnu_indirect_function
2350 support with static linking, setting automake conditional
2351 IFUNC_STATIC.
2352 * Makefile.in: Regenerate.
2353 * configure: Regenerate.
2354
2355 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2356 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2357 for IFUNC_STATIC.
2358 * testsuite/Makefile.in: Regenerate.
2359
2360 2011-09-13 Cary Coutant <ccoutant@google.com>
2361
2362 * incremental.cc (Sized_relobj_incr::do_layout): Call
2363 report_comdat_group for kept comdat sections.
2364 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2365 * testsuite/Makefile.in: Regenerate.
2366 * testsuite/incr_comdat_test_1.cc: New source file.
2367 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2368 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2369 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2370
2371 2011-09-13 Ian Lance Taylor <iant@google.com>
2372
2373 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2374 variable external_symbols_offset.
2375
2376 2011-09-12 Ian Lance Taylor <iant@google.com>
2377
2378 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2379 triggered if object has no symbols.
2380
2381 2011-09-09 David S. Miller <davem@davemloft.net>
2382
2383 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2384 (Output_fill_debug_line::do_write): Likewise.
2385
2386 2011-08-29 Cary Coutant <ccoutant@google.com>
2387
2388 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2389 casts to match formatting specs.
2390 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2391
2392 2011-08-26 Cary Coutant <ccoutant@google.com>
2393
2394 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2395 remaining hole size when allocating.
2396 (Layout::make_output_section): Set fill methods for debug sections.
2397 * layout.h (Free_list::Free_list_node): Move from private to
2398 public.
2399 (Free_list::set_min_hole_size): New function.
2400 (Free_list::begin, Free_list::end): New functions.
2401 (Free_list::min_hole_): New data member.
2402 * output.cc: Include dwarf.h.
2403 (Output_fill_debug_info::do_minimum_hole_size): New function.
2404 (Output_fill_debug_info::do_write): New function.
2405 (Output_fill_debug_line::do_minimum_hole_size): New function.
2406 (Output_fill_debug_line::do_write): New function.
2407 (Output_section::Output_section): Initialize new data member.
2408 (Output_section::set_final_data_size): Ensure patch space is larger
2409 than minimum hole size.
2410 (Output_section::do_write): Fill holes in debug sections.
2411 * output.h (Output_fill): New class.
2412 (Output_fill_debug_info): New class.
2413 (Output_fill_debug_line): New class.
2414 (Output_section::set_free_space_fill): New function.
2415 (Output_section::free_space_fill_): New data member.
2416 * testsuite/Makefile.am (incremental_test_3): Add
2417 --incremental-patch option.
2418 (incremental_test_4): Likewise.
2419 (incremental_test_5): Likewise.
2420 (incremental_test_6): Likewise.
2421 (incremental_copy_test): Likewise.
2422 (incremental_common_test_1): Likewise.
2423 * testsuite/Makefile.in: Regenerate.
2424
2425 2011-08-26 Nick Clifton <nickc@redhat.com>
2426
2427 * po/es.po: Updated Spanish translation.
2428
2429 2011-08-01 Cary Coutant <ccoutant@google.com>
2430
2431 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2432 * gold/testsuite/Makefile.in: Regenerate.
2433 * gold/testsuite/justsyms_exec.c: New source file.
2434 * gold/testsuite/justsyms_lib.c: New source file.
2435
2436 2011-08-01 Cary Coutant <ccoutant@google.com>
2437
2438 * layout.cc (Layout::set_segment_offsets): Don't realign text
2439 segment if -Ttext was specified.
2440 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2441 file type.
2442 * object.h (Sized_relobj_file::e_type): New function.
2443 (Sized_relobj_file::e_type_): New data member.
2444 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2445 base address for ET_EXEC files.
2446 * target.cc (Target::do_make_elf_object_implementation): Allow
2447 ET_EXEC files with --just-symbols option.
2448
2449 2011-07-28 Cary Coutant <ccoutant@google.com>
2450
2451 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2452 Add thread_number parameter.
2453 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2454 * workqueue-threads.cc
2455 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2456 current thread if its thread number is greater than desired thread
2457 count.
2458 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2459 Add thread_number parameter.
2460 (Workqueue::should_cancel_thread): Likewise.
2461 (Workqueue::find_runnable_or_wait): Pass thread_number to
2462 should_cancel_thread.
2463 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2464 parameter.
2465
2466 2011-07-22 Sriraman Tallam <tmsriram@google.com>
2467
2468 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2469 only after checking if it cannot be forced local.
2470 * symtab.h (is_externally_visible): Check if the symbol is not forced
2471 local.
2472
2473 2011-07-15 Ian Lance Taylor <iant@google.com>
2474
2475 * options.h (class General_options): Add --print-output-format.
2476 Move -EL next to -EB, for better --help output.
2477 * target-select.cc: Include <cstdio>, "options.h", and
2478 "parameters.h".
2479 (Target_selector::do_target_bfd_name): New function.
2480 (print_output_format): New function.
2481 * target-select.h (class Target_selector): Update declarations.
2482 (Target_selector::target_bfd_name): New function.
2483 (print_output_format): Declare.
2484 * main.cc: Include "target-select.h".
2485 (main): Handle --print-output-format.
2486 * gold.cc: Include "target-select.h".
2487 (queue_initial_tasks): Handle --print-output-format when there are
2488 no input files.
2489 * parameters.cc (parameters_force_valid_target): Give a better
2490 error message if -EB/-EL does not match target.
2491 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2492 function.
2493
2494 2011-07-15 Ian Lance Taylor <iant@google.com>
2495
2496 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2497 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2498 (Output_data_plt_i386::do_write): Write address of .dynamic
2499 section to first entry in .got.plt section.
2500 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2501 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2502 Initialize layout_.
2503 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2504 section to first entry in .got.plt section.
2505 * layout.h (Layout::dynamic_section): New function.
2506
2507 2011-07-13 Sriraman Tallam <tmsriram@google.com>
2508
2509 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2510 to claim_file call.
2511 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2512 input_section_position_, and input_section_glob_.
2513 (read_layout_from_file): Call function section_ordering_specified.
2514 * layout.h (is_section_ordering_specified): New function.
2515 (section_ordering_specified): New function.
2516 (section_ordering_specified_): New boolean member.
2517 * main.cc(main): Call load_plugins after layout object is defined.
2518 * output.cc (Output_section::add_input_section): Use
2519 function section_ordering_specified to check if section ordering is
2520 needed.
2521 * output.cc (Output_section::add_relaxed_input_section): Use
2522 function section_ordering_specified to check if section ordering is
2523 needed.
2524 (Output_section::update_section_layout): New function.
2525 (Output_section::sort_attached_input_sections): Check if input section
2526 must be reordered.
2527 * output.h (Output_section::update_section_layout): New function.
2528 * plugin.cc (get_section_count): New function.
2529 (get_section_type): New function.
2530 (get_section_name): New function.
2531 (get_section_contents): New function.
2532 (update_section_order): New function.
2533 (allow_section_ordering): New function.
2534 (Plugin::load): Add the new interfaces to the transfer vector.
2535 (Plugin_manager::load_plugins): New parameter.
2536 (Plugin_manager::all_symbols_read): New parameter.
2537 (Plugin_manager::claim_file): New parameter. Save the elf object for
2538 unclaimed objects.
2539 (Plugin_manager::get_elf_object): New function.
2540 (Plugin_manager::get_view): Change to directly use the bool to check
2541 if get_view is called from claim_file_hook.
2542 * plugin.h (input_objects): New function
2543 (Plugin__manager::load_plugins): New parameter.
2544 (Plugin_manager::claim_file): New parameter.
2545 (Plugin_manager::get_elf_object): New function.
2546 (Plugin_manager::in_claim_file_handler): New function.
2547 (Plugin_manager::in_claim_file_handler_): New member.
2548 (layout): New function.
2549 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2550 handler with an extra parameter. Make the elf object before calling
2551 claim_file handler.
2552 * testsuite/plugin_test.c (get_section_count): New function pointer.
2553 (get_section_type): New function pointer.
2554 (get_section_name): New function pointer.
2555 (get_section_contents): New function pointer.
2556 (update_section_order): New function pointer.
2557 (allow_section_ordering): New function pointer.
2558 (onload): Check if the new interfaces exist.
2559
2560 2011-07-13 Ian Lance Taylor <iant@google.com>
2561
2562 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2563 relro section.
2564 * x86_64.cc (Target_x86_64::got_section): Likewise.
2565 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2566 (relro_now_test_SOURCES): New variable.
2567 (relro_now_test_DEPENDENCIES): New variable.
2568 (relro_now_test_LDFLAGS): New variable.
2569 (relro_now_test_LDADD): New variable.
2570 (relro_now_test.so): New target.
2571 * testsuite/Makefile.in: Rebuild.
2572
2573 2011-07-12 Ian Lance Taylor <iant@google.com>
2574
2575 PR gold/12980
2576 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2577 GLOB_DAT relocation rather than a RELATIVE relocation for a
2578 protected symbol when creating a shared library.
2579 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2580 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2581 * testsuite/protected_main_1.cc (main): Test that protected
2582 function has same address.
2583
2584 2011-07-11 Ian Lance Taylor <iant@google.com>
2585
2586 PR gold/12979
2587 * options.h (class General_options): Add -Bgroup.
2588 * options.cc (General_options::finalize): If -Bgroup is set,
2589 default to --unresolved-symbols=report-all.
2590 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2591 * target-reloc.h (issue_undefined_symbol_error): Handle
2592 --unresolved-symbols=report-all.
2593
2594 2011-07-08 Ian Lance Taylor <iant@google.com>
2595
2596 PR gold/11985
2597 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2598 if linker script discards key sections.
2599 (Layout::create_dynamic_symtab): Likewise.
2600 (Layout::assign_local_dynsym_offsets): Likewise.
2601 (Layout::sized_create_version_sections): Likewise.
2602 (Layout::create_interp): Likewise.
2603 (Layout::finish_dynamic_section): Likewise.
2604 (Layout::set_dynamic_symbol_size): Likewise.
2605
2606 2011-07-08 Ian Lance Taylor <iant@google.com>
2607
2608 PR gold/12386
2609 * options.h (class General_options): Add --unresolved-symbols.
2610 * target-reloc.h (issue_undefined_symbol_error): Check
2611 --unresolved-symbols. Add comments.
2612
2613 2011-07-08 Ian Lance Taylor <iant@google.com>
2614
2615 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2616 expression more complex.
2617
2618 2011-07-08 Ian Lance Taylor <iant@google.com>
2619
2620 PR gold/11317
2621 * target-reloc.h (issue_undefined_symbol_error): New inline
2622 function, broken out of relocate_section.
2623 (relocate_section): Call issue_undefined_symbol_error.
2624 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2625 there is no TLS segment if we are about to issue an undefined
2626 symbol error.
2627 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2628
2629 2011-07-08 Ian Lance Taylor <iant@google.com>
2630
2631 PR gold/12279
2632 * resolve.cc (Symbol_table::should_override): Add fromtype
2633 parameter. Change all callers. Give error when linking together
2634 TLS and non-TLS symbol.
2635 (Symbol_table::should_override_with_special): Add fromtype
2636 parameter. Change all callers.
2637 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2638 there is no TLS segment if we have reported some errors.
2639 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2640
2641 2011-07-08 Ian Lance Taylor <iant@google.com>
2642
2643 PR gold/12372
2644 * target.h (Target::plt_address_for_global): New function.
2645 (Target::plt_address_for_local): New function.
2646 (Target::plt_section_for_global): Remove.
2647 (Target::plt_section_for_local): Remove.
2648 (Target::do_plt_address_for_global): New virtual function.
2649 (Target::do_plt_address_for_local): New virtual function.
2650 (Target::do_plt_section_for_global): Remove.
2651 (Target::do_plt_section_for_local): Remove.
2652 (Target::register_global_plt_entry): Add Symbol_table and Layout
2653 parameters.
2654 * output.cc (Output_data_got::Got_entry::write): Use
2655 plt_address_for_global and plt_address_for_local.
2656 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2657 address of output section.
2658 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2659 got_irelative_, and irelative_count_ fields. Update
2660 declarations.
2661 (Output_data_plt_i386::has_irelative_section): New function.
2662 (Output_data_plt_i386::entry_count): Add irelative_count_.
2663 (Output_data_plt_i386::set_final_data_size): Likewise.
2664 (class Target_i386): Add got_irelative_ and rel_irelative_
2665 fields. Update declarations.
2666 (Target_i386::Target_i386): Initialize new fields.
2667 (Target_i386::do_plt_address_for_global): New function replacing
2668 do_plt_section_for_global.
2669 (Target_i386::do_plt_address_for_local): New function replacing
2670 do_plt_section_for_local.
2671 (Target_i386::got_section): Create got_irelative_.
2672 (Target_i386::rel_irelative_section): New function.
2673 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2674 fields. Don't define __rel_iplt_{start,end}.
2675 (Output_data_plt_i386::add_entry): Add symtab and layout
2676 parameters. Change all callers. Use different PLT and GOT for
2677 IFUNC symbols.
2678 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2679 layout parameters. Change all callers. Use different PLT and
2680 GOT.
2681 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2682 (Output_data_plt_i386::rel_irelative): New function.
2683 (Output_data_plt_i386::address_for_global): New function.
2684 (Output_data_plt_i386::address_for_local): New function.
2685 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2686 IRELATIVE GOT when changing IFUNC GOT entries.
2687 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2688 reloc.
2689 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2690 if we didn't create an IRELATIVE GOT.
2691 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2692 plt_address_for_local.
2693 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2694 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2695 got_irelative_, and irelative_count_ fields. Update
2696 declarations.
2697 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2698 Initialize new fields. Remove symtab parameter. Change all
2699 callers.
2700 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2701 irelative_count_.
2702 (Output_data_plt_x86_64::has_irelative_section): New function.
2703 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2704 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2705 fields. Update declarations.
2706 (Target_x86_64::Target_x86_64): Initialize new fields.
2707 (Target_x86_64::do_plt_address_for_global): New function replacing
2708 do_plt_section_for_global.
2709 (Target_x86_64::do_plt_address_for_local): New function replacing
2710 do_plt_section_for_local.
2711 (Target_x86_64::got_section): Create got_irelative_.
2712 (Target_x86_64::rela_irelative_section): New function.
2713 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2714 all callers. Don't create __rel_iplt_{start,end}.
2715 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2716 parameters. Change all callers. Use different PLT and GOT for
2717 IFUNC symbols.
2718 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2719 layout parameters. Change all callers. Use different PLT and
2720 GOT.
2721 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2722 parameters. Change all callers. Use different PLT and GOT for
2723 IFUNC symbols.
2724 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2725 (Output_data_plt_x86_64::rela_irelative): New function.
2726 (Output_data_plt_x86_64::address_for_global): New function.
2727 (Output_data_plt_x86_64::address_for_local): New function.
2728 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2729 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2730 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2731 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2732 parameters.
2733 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2734 reloc.
2735 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2736 symbols if we didn't create an IRELATIVE GOT.
2737 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2738 plt_address_for_local.
2739 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2740 * testsuite/ifuncvar1.c: New test file.
2741 * testsuite/ifuncvar2.c: New test file.
2742 * testsuite/ifuncvar3.c: New test file.
2743 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2744 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2745 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2746 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2747 * testsuite/Makefile.in: Rebuild.
2748
2749 2011-07-07 Cary Coutant <ccoutant@google.com>
2750
2751 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2752 (two_file_test_1_ndebug.o): Likewise.
2753 (two_file_test_1b_ndebug.o): Likewise.
2754 (two_file_test_2_ndebug.o): Likewise.
2755 (two_file_test_main_ndebug.o): Likewise.
2756 (incremental_test_2): Link with no-debug versions.
2757
2758 2011-07-06 Cary Coutant <ccoutant@google.com>
2759
2760 * gold/incremental.cc
2761 (Output_section_incremental_inputs::write_info_blocks): Check for
2762 hidden and internal symbols.
2763
2764 2011-07-06 Cary Coutant <ccoutant@google.com>
2765
2766 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2767 Check disposition for startup file.
2768 (Incremental_inputs::report_command_line): Ignore
2769 --incremental-startup-unchanged option.
2770 * options.cc (General_options::parse_incremental_startup_unchanged):
2771 New function.
2772 (General_options::General_options): Initialize new data member.
2773 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2774 (General_options): Add --incremental-startup-unchanged option.
2775 (General_options::incremental_startup_disposition): New function.
2776 (General_options::incremental_startup_disposition_): New data member.
2777
2778 2011-07-06 Cary Coutant <ccoutant@google.com>
2779
2780 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2781 input file index to Script_info ctor.
2782 (Sized_incremental_binary::do_file_has_changed): Find the
2783 command-line argument for files named in scripts.
2784 * incremental.h (Script_info::Script_info): New ctor
2785 with input file index.
2786 (Script_info::input_file_index): New function.
2787 (Script_info::input_file_index_): New data member.
2788 (Incremental_binary::get_library): Add const.
2789 (Incremental_binary::get_script_info): Add const.
2790 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2791 * testsuite/Makefile.am (incremental_test_5): New test case.
2792 (incremental_test_6): New test case.
2793 * testsuite/Makefile.in: Regenerate.
2794
2795 2011-07-06 Cary Coutant <ccoutant@google.com>
2796
2797 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2798 debug output when command lines differ.
2799
2800 2011-07-06 Cary Coutant <ccoutant@google.com>
2801
2802 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2803 --incremental-patch option.
2804 * layout.cc (Free_list::allocate): Extend allocation beyond original
2805 end if enabled.
2806 (Layout::make_output_section): Mark sections that should get
2807 patch space.
2808 * options.cc (parse_percent): New function.
2809 * options.h (parse_percent): New function.
2810 (DEFINE_percent): New macro.
2811 (General_options): Add --incremental-patch option.
2812 * output.cc (Output_section::Output_section): Initialize new data
2813 members.
2814 (Output_section::add_input_section): Print section name when out
2815 of patch space.
2816 (Output_section::add_output_section_data): Likewise.
2817 (Output_section::set_final_data_size): Add patch space when
2818 doing --incremental-full.
2819 (Output_section::do_reset_address_and_file_offset): Remove patch
2820 space.
2821 (Output_segment::set_section_list_addresses): Print debug output
2822 only if --incremental-update.
2823 * output.h (Output_section::set_is_patch_space_allowed): New function.
2824 (Output_section::is_patch_space_allowed_): New data member.
2825 (Output_section::patch_space_): New data member.
2826 * parameters.cc (Parameters::incremental_full): New function.
2827 * parameters.h (Parameters::incremental_full): New function
2828 * testsuite/Makefile.am (incremental_test_2): Add test for
2829 --incremental-patch option.
2830 * testsuite/Makefile.in: Regenerate.
2831 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2832 (t18): Remove function body.
2833
2834 2011-07-05 Doug Kwan <dougkwan@google.com>
2835
2836 PR gold/12771
2837 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2838 Arm_Address type for relocation result.
2839 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2840 overflow check.
2841 (Arm_relocate_functions::abs32): Use unaligned access.
2842 (Arm_relocate_functions::rel32): Ditto.
2843 (Arm_relocate_functions::prel31): Ditto.
2844 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2845 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2846 static data relocations.
2847 * testsuite/Makefile.in: Regnerate.
2848 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2849
2850 2011-07-05 Ian Lance Taylor <iant@google.com>
2851
2852 PR gold/12392
2853 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2854 symbols if necessary.
2855 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2856
2857 2011-07-05 Ian Lance Taylor <iant@google.com>
2858
2859 PR gold/12952
2860 * resolve.cc (Symbol::override_base_with_special): Simply override
2861 version with special symbol version, ignoring previous version.
2862
2863 2011-07-05 Ian Lance Taylor <iant@google.com>
2864
2865 * object.cc (Sized_relobj_file::include_section_group): Add
2866 information to comment about signature location.
2867
2868 2011-07-02 Ian Lance Taylor <iant@google.com>
2869
2870 PR gold/12957
2871 * options.h (class General_options): Add -f and -F.
2872 * options.cc (General_options::finalize): Fatal error if -f/-F
2873 are used without -shared.
2874 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2875
2876 2011-07-02 Ian Lance Taylor <iant@google.com>
2877
2878 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2879
2880 2011-07-01 Ian Lance Taylor <iant@google.com>
2881
2882 PR gold/12525
2883 PR gold/12952
2884 * resolve.cc (Symbol::override_base_with_special): Don't override
2885 the version if the overriding symbol has a different name.
2886 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2887 all callers. If we give an error about an undefined version,
2888 define the base version if necessary.
2889 * dynobj.h (class Versions): Update declaration.
2890 * testsuite/weak_alias_test_5.cc: New file.
2891 * testsuite/weak_alias_test.script: New file.
2892 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2893 and versioned_alias have the right value, and call t2.
2894 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2895 weak_alias_test_5.so.
2896 (weak_alias_test_LDADD): Likewise.
2897 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2898 * testsuite/Makefile.in: Rebuild.
2899
2900 2011-07-01 Ian Lance Taylor <iant@google.com>
2901
2902 PR gold/12525
2903 * options.h (class General_options): Support -z notext.
2904 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2905 -Wl,-z,notext.
2906 (two_file_shared_nonpic.so): Likewise.
2907 (two_file_shared_mixed.so): Likewise.
2908 (two_file_shared_mixed_1.so): Likewise.
2909 (weak_undef_lib_nonpic.so): Likewise.
2910 (alt/weak_undef_lib_nonpic.so): Likewise.
2911 (tls_test_shared_nonpic.so): Likewise.
2912 * testsuite/Makefile.in: Rebuild.
2913
2914 2011-07-01 Ian Lance Taylor <iant@google.com>
2915
2916 PR gold/12525
2917 * configure.ac: Test whether static linking works, setting
2918 the automake conditional HAVE_STATIC.
2919 * testsuite/Makefile.am: Disable tests using -static if
2920 HAVE_STATIC is not true.
2921 * configure, testsuite/Makefile.in: Rebuild.
2922
2923 2011-07-01 Ian Lance Taylor <iant@google.com>
2924
2925 PR gold/12525
2926 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2927 Assert if we see DW_EH_PE_indirect.
2928 * target.h (Target::ehframe_datarel_base): New function.
2929 (Target::do_ehframe_datarel_base): New target function.
2930 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2931 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2932 function.
2933
2934 2011-07-01 Ian Lance Taylor <iant@google.com>
2935
2936 PR gold/12571
2937 * options.h (class General_options): Add
2938 --ld-generated-unwind-info.
2939 * ehframe.cc (Fde::write): Add address parameter. Change all
2940 callers. If associated with PLT, fill in address and size.
2941 (Cie::set_output_offset): Only add merge mapping if there is an
2942 object.
2943 (Cie::write): Add address parameter. Change all callers.
2944 (Eh_frame::add_ehframe_for_plt): New function.
2945 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2946 input_offset_ fields into union u_, with new plt field.
2947 (Fde::Fde): Adjust for new union field.
2948 (Fde::Fde) [Output_data version]: New constructor.
2949 (Fde::add_mapping): Only add merge mapping if there is an object.
2950 (class Cie): Update declarations.
2951 (class Eh_frame): Declare add_ehframe_for_plt.
2952 * layout.cc (Layout::layout_eh_frame): Break out code into
2953 make_eh_frame_section, and call it.
2954 (Layout::make_eh_frame_section): New function.
2955 (Layout::add_eh_frame_for_plt): New function.
2956 * layout.h (class Layout): Update declarations.
2957 * merge.cc (Merge_map::add_mapping): Add assertion.
2958 * i386.cc: Include "dwarf.h".
2959 (class Output_data_plt_i386): Make first_plt_entry,
2960 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2961 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2962 and plt_eh_frame_fde.
2963 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2964 boundary. Call add_eh_frame_for_plt if appropriate.
2965 * x86_64.cc: Include "dwarf.h".
2966 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2967 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2968 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2969 and plt_eh_frame_fde.
2970 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2971 appropriate.
2972
2973 2011-06-29 Ian Lance Taylor <iant@google.com>
2974
2975 PR gold/12629
2976 * object.cc (Sized_relobj_file::layout_section): Change shdr
2977 parameter to be const.
2978 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2979 out of do_layout.
2980 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2981 appropriate. Call layout_eh_frame_section.
2982 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2983 sections.
2984 * object.h (class Sized_relobj_file): Update declarations.
2985
2986 2011-06-29 Ian Lance Taylor <iant@google.com>
2987
2988 PR gold/12652
2989 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2990 modifier.
2991 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2992
2993 2011-06-29 Ian Lance Taylor <iant@google.com>
2994
2995 PR gold/12675
2996 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2997 SHT_X86_64_UNWIND.
2998 * layout.cc (Layout::layout_eh_frame): Likewise.
2999
3000 2011-06-29 Ian Lance Taylor <iant@google.com>
3001
3002 PR gold/12695
3003 * layout.cc (Layout::symtab_section_shndx): New function.
3004 * layout.h (class Layout): Declare symtab_section_shndx.
3005 * output.cc (Output_section::write_header): Call it.
3006
3007 2011-06-29 Ian Lance Taylor <iant@google.com>
3008
3009 PR gold/12818
3010 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3011 symbols which are not used in a relocation.
3012
3013 2011-06-28 Ian Lance Taylor <iant@google.com>
3014
3015 PR gold/12898
3016 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3017 script create indistinguishable segments.
3018 (Layout::set_segment_offsets): Use stable_sort when sorting
3019 segments. Pass this to Compare_segments constructor.
3020 * layout.h (class Layout): Make segment_precedes non-static.
3021 (class Compare_segments): Change from struct to class. Add
3022 layout_ field. Add constructor.
3023 * script-sections.cc
3024 (Script_sections::attach_sections_using_phdrs_clause): Rename
3025 local orphan to is_orphan. Don't report failure to put empty
3026 section in segment. On attachment failure, report name of
3027 section, and attach to first PT_LOAD segment.
3028
3029 2011-06-28 Ian Lance Taylor <iant@google.com>
3030
3031 PR gold/12934
3032 * target-select.cc (Target_selector::Target_selector): Add
3033 emulation parameter. Change all callers.
3034 (select_target_by_bfd_name): Rename from select_target_by_name.
3035 Change all callers.
3036 (select_target_by_emulation): New function.
3037 (supported_emulation_names): New function.
3038 * target-select.h (class Target_selector): Add emulation_ field.
3039 Update declarations.
3040 (Target_selector::recognize_by_bfd_name): Rename from
3041 recognize_by_name. Change all callers.
3042 (Target_selector::supported_bfd_names): Rename from
3043 supported_names. Change all callers.
3044 (Target_selector::recognize_by_emulation): New function.
3045 (Target_selector::supported_emulations): New function.
3046 (Target_selector::emulation): New function.
3047 (Target_selector::do_recognize_by_bfd_name): Rename from
3048 do_recognize_by_name. Change all callers.
3049 (Target_selector::do_supported_bfd_names): Rename from
3050 do_supported_names. Change all callers.
3051 (Target_selector::do_recognize_by_emulation): New function.
3052 (Target_selector::do_supported_emulations): New function.
3053 (select_target_by_bfd_name): Change name in declaration.
3054 (select_target_by_emulation): Declare.
3055 (supported_emulation_names): Declare.
3056 * parameters.cc (parameters_force_valid_target): Try to find
3057 target based on emulation from -m option.
3058 * options.h (class General_options): Change doc string for -m.
3059 * options.cc (help): Print emulations.
3060 (General_options::parse_V): Likewise.
3061 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3062 Add emulation parameter. Change all callers.
3063
3064 2011-06-28 Ian Lance Taylor <iant@google.com>
3065
3066 * target.h (class Target): Add osabi_ field.
3067 (Target::osabi): New function.
3068 (Target::set_osabi): New function.
3069 (Target::Target): Initialize osabi_.
3070 (Target::do_adjust_elf_header): Make pure virtual.
3071 (Sized_target::do_adjust_elf_header): Declare.
3072 * target.cc (Sized_target::do_adjust_elf_header): New function.
3073 (class Sized_target): Instantiate all versions.
3074 * freebsd.h (class Target_freebsd): Remove.
3075 (Target_selector_freebsd::do_recognize): Call set_osabi on
3076 Target.
3077 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3078 (Target_selector_freebsd::set_osabi): Remove.
3079 * i386.cc (class Target_i386): Inherit from Sized_target rather
3080 than Target_freebsd.
3081 * x86_64.cc (class Target_x86_64): Likewise.
3082
3083 2011-06-28 Ian Lance Taylor <iant@google.com>
3084
3085 * target.h (Target::can_check_for_function_pointers): Rewrite.
3086 Make non-virtual.
3087 (Target::can_icf_inline_merge_sections): Likewise.
3088 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3089 (Target::Target_info): Add can_icf_inline_merge_sections field.
3090 (Target::do_can_check_for_function_pointers): New virtual
3091 function.
3092 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3093 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3094 from can_check_for_function_pointers, move in file.
3095 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3096 section_may_have_icf_unsafe_poineters, move in file.
3097 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3098 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3099 Rename from can_check_for_function_pointers, move in file.
3100 (Target_i386::can_icf_inline_merge_sections): Remove.
3101 (Target_i386::i386_info): Initialize
3102 can_icf_inline_merge_sections.
3103 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3104 Initialize can_icf_inline_merge_sections.
3105 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3106 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3107 Rename from can_check_for_function_pointers, move in file.
3108 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3109 (Target_x86_64::x86_64_info): Initialize
3110 can_icf_inline_merge_sections.
3111 * testsuite/testfile.cc (Target_test::test_target_info):
3112 Likewise.
3113 * icf.cc (get_section_contents): Correct formatting.
3114
3115 2011-06-27 Ian Lance Taylor <iant@google.com>
3116
3117 * symtab.cc (Symbol::versioned_name): New function.
3118 (Symbol_table::add_to_final_symtab): Use versioned_name when
3119 appropriate.
3120 (Symbol_table::sized_write_symbol): Likewise.
3121 * symtab.h (class Symbol): Declare versioned_name.
3122 * stringpool.h (class Stringpool_template): Add variant of add
3123 which takes a std::basic_string.
3124 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3125 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3126 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3127 (ver_test_12.o): New target.
3128 * testsuite/Makefile.in: Rebuild.
3129
3130 2011-06-27 Doug Kwan <dougkwan@google.com>
3131
3132 * arm.cc (Arm_relocate_functions::thm_jump8,
3133 Arm_relocate_functions::thm_jump11): Use a wider signed
3134 type to compute offset.
3135 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3136 arm_thm_jump8.
3137 * testsuite/Makefile.in: Regenerate.
3138 * testsuite/arm_branch_in_range.sh: Check test results of
3139 arm_thm_jump11 and arm_thm_jump8.
3140 * testsuite/arm_thm_jump11.s: New test source file.
3141 * testsuite/arm_thm_jump11.t: New linker script.
3142 * testsuite/arm_thm_jump8.s: New test source file.
3143 * testsuite/arm_thm_jump8.t: New linker script.
3144
3145 2011-06-24 Ian Lance Taylor <iant@google.com>
3146
3147 * layout.cc: Include "object.h".
3148 (ctors_sections_in_init_array): New static variable.
3149 (Layout::is_ctors_in_init_array): New function.
3150 (Layout::layout): Add entry to ctors_sections_in_init_array if
3151 appropriate.
3152 * layout.h (class Layout): Declare is_ctors_in_init_array.
3153 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3154 is_ctors_reverse_view is set.
3155 (Sized_relobj_file::write_sections): Add layout parameter. Change
3156 all callers. Set is_ctors_reverse_view field of View_size.
3157 (Sized_relobj_file::reverse_words): New function.
3158 * object.h (Sized_relobj_file::View_size): Add
3159 is_ctors_reverse_view field.
3160 (class Sized_relobj_file): Update declarations.
3161 * testsuite/initpri3.c: New test.
3162 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3163 initpri3b.
3164 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3165 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3166 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3167 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3168 * testsuite/Makefile.in: Rebuild.
3169
3170 2011-06-24 Cary Coutant <ccoutant@google.com>
3171
3172 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3173 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3174 (debug_msg_cdebug.err): New targets.
3175 * testsuite/Makefile.in: Regenerate.
3176 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3177 Fix checks for link with shared library.
3178
3179 2011-06-24 Doug Kwan <dougkwan@google.com>
3180
3181 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3182 skip empty text sections.
3183 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3184
3185 2011-06-22 Ian Lance Taylor <iant@google.com>
3186
3187 PR gold/12910
3188 * options.h (class General_options): Add --ctors-in-init-array.
3189 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3190 friends as SHT_PROGBITS for merging sections.
3191 (Layout::layout): Remove special handling of .init_array and
3192 friends. Don't sort if doing relocatable link. Sort for .ctors
3193 and .dtors if ctors_in_init_array.
3194 (Layout::make_output_section): Force correct section types for
3195 .init_array and friends. Don't sort if doing relocatable link,
3196 Don't sort .ctors and .dtors if ctors_in_init_array.
3197 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3198 (Layout::output_section_name): Add relobj parameter. Change all
3199 callers. Handle .ctors. and .dtors. in code rather than table.
3200 Handle .ctors and .dtors if ctors_in_init_array.
3201 (Layout::match_file_name): New function, moved from output.cc.
3202 * layout.h (class Layout): Update declarations.
3203 * output.cc: Include "layout.h".
3204 (Input_section_sort_entry::get_priority): New function.
3205 (Input_section_sort_entry::match_file_name): Just call
3206 Layout::match_file_name.
3207 (Output_section::Input_section_sort_init_fini_compare::operator()):
3208 Handle .ctors and .dtors. Sort by explicit priority rather than
3209 by name.
3210 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3211 * testsuite/initpri2.c: New test.
3212 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3213 (check_PROGRAMS): Add initpri2.
3214 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3215 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3216 * configure, testsuite/Makefile.in: Rebuild.
3217
3218 2011-06-19 Ian Lance Taylor <iant@google.com>
3219
3220 PR gold/12880
3221 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3222 .interp section to a PT_INTERP segment even if we have seen a
3223 --dynamic-linker option. Don't do it if we have seen a PHDRS
3224 clause in a linker script.
3225 (Layout::finalize): Don't create a .interp section if we've
3226 already create a PT_INTERP segment.
3227 (Layout::create_interp): Always call choose_output_section (revert
3228 patch of 2011-06-17). Don't create PT_INTERP segment.
3229 * script-sections.cc
3230 (Script_sections::create_note_and_tls_segments): Add a .interp
3231 section to a PT_INTERP segment even if we have seen a
3232 --dynamic-linker option.
3233
3234 2011-06-18 Ian Lance Taylor <iant@google.com>
3235
3236 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3237 merely because a non-PT_LOAD segment has a dynamic reloc.
3238
3239 2011-06-18 Ian Lance Taylor <iant@google.com>
3240
3241 * layout.cc (Layout::finish_dynamic_section): Don't create
3242 DT_FLAGS entry if not needed.
3243
3244 2011-06-18 Ian Lance Taylor <iant@google.com>
3245
3246 PR gold/12745
3247 * layout.cc (Layout::layout_eh_frame): Correct handling of
3248 writable .eh_frame section.
3249
3250 2011-06-17 Ian Lance Taylor <iant@google.com>
3251
3252 PR gold/12893
3253 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3254 symbol is redefined with the exact same object and value.
3255
3256 2011-06-17 Ian Lance Taylor <iant@google.com>
3257
3258 PR gold/12880
3259 * layout.h (class Layout): Add interp_segment_ field.
3260 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3261 (Layout::attach_allocated_section_to_segment): If making shared
3262 library, put .interp section in PT_INTERP segment.
3263 (Layout::finalize): Also call create_interp if -dynamic-linker
3264 option was used.
3265 (Layout::create_interp): Assert that there is no PT_INTERP
3266 segment. If not using a SECTIONS clause, use make_output_section.
3267 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3268 * script-sections.cc
3269 (Script_sections::create_note_and_tls_segments): If making shared
3270 library, put .interp section in PT_INTERP segment.
3271
3272 2011-06-17 Ian Lance Taylor <iant@google.com>
3273
3274 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3275 when making a shared library.
3276
3277 2011-06-17 Ian Lance Taylor <iant@google.com>
3278
3279 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3280 parameter. Change all callers. Don't issue warning about PC32
3281 against locally defined symbol.
3282
3283 2011-06-16 Ian Lance Taylor <iant@google.com>
3284
3285 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3286 occurs in same object.
3287
3288 2011-06-14 Alan Modra <amodra@gmail.com>
3289
3290 * po/POTFILES.in: Regenerate.
3291
3292 2011-06-09 Ian Lance Taylor <iant@google.com>
3293
3294 * script-sections.cc
3295 (Orphan_output_section::set_section_addresses): For a relocatable
3296 link set address to 0.
3297
3298 2011-06-09 Cary Coutant <ccoutant@google.com>
3299
3300 PR gold/12804
3301 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3302 used with --compress-debug-sections.
3303 * gold/object.cc (Sized_relobj_file::do_layout): Report
3304 uncompressed size of compressed input sections.
3305
3306 2011-06-08 Cary Coutant <ccoutant@google.com>
3307
3308 PR gold/12804
3309 * testsuite/two_file_test_2_v1.cc: Change initialization of
3310 v2 to keep it in .data.
3311
3312 2011-06-07 Cary Coutant <ccoutant@google.com>
3313
3314 * common.cc (Symbol_table::do_allocate_commons_list): Call
3315 gold_fallback.
3316 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3317 (Errors::fallback): New function.
3318 (gold_fallback): New function.
3319 * errors.h (Errors::fallback): New function.
3320 * gold.cc (gold_exit): Change status parameter to enum; adjust
3321 all callers.
3322 (queue_initial_tasks): Call gold_fallback.
3323 * gold.h: Include cstdlib.
3324 (Exit_status): New enum type.
3325 (gold_exit): Change status parameter to enum.
3326 (gold_fallback): New function.
3327 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3328 (Layout::create_symtab_sections): Likewise.
3329 (Layout::create_shdrs): Likewise.
3330 * main.cc (main): Adjust call to gold_exit.
3331 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3332 (Output_data_got::add_got_entry_pair): Likewise.
3333 (Output_section::add_input_section): Likewise.
3334 (Output_section::add_output_section_data): Likewise.
3335 (Output_segment::set_section_list_addresses): Likewise.
3336 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3337
3338 2011-06-07 Cary Coutant <ccoutant@google.com>
3339
3340 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3341 for incremental links.
3342 * output.cc (Output_segment::set_section_list_addresses): Remove
3343 FIXME and test for TLS or BSS.
3344
3345 2011-06-07 Cary Coutant <ccoutant@google.com>
3346
3347 * testsuite/Makefile.am: Add incremental_copy_test,
3348 incremental_common_test_1.
3349 * testsuite/Makefile.in: Regenerate.
3350 * testsuite/common_test_1_v1.c: New source file.
3351 * testsuite/common_test_1_v2.c: New source file.
3352 * testsuite/copy_test_v1.cc: New source file.
3353
3354 2011-06-07 Cary Coutant <ccoutant@google.com>
3355
3356 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3357 update, allocate common from bss section's free list.
3358 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3359 linker-defined symbols.
3360 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3361 Skip GOT and PLT entries that are no longer referenced.
3362 (Output_section_incremental_inputs::write_info_blocks): Mark
3363 linker-defined symbols.
3364 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3365 * output.cc (Output_section::allocate): New function.
3366 * output.h (Output_section::allocate): New function.
3367 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3368 linker-defined symbols.
3369 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3370 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3371 (Symbol::init_base_output_data): Likewise.
3372 (Symbol::init_base_output_segment): Likewise.
3373 (Symbol::init_base_constant): Likewise.
3374 (Sized_symbol::init_output_data): Likewise.
3375 (Sized_symbol::init_output_segment): Likewise.
3376 (Sized_symbol::init_constant): Likewise.
3377 (Symbol_table::do_define_in_output_data): Likewise.
3378 (Symbol_table::do_define_in_output_segment): Likewise.
3379 (Symbol_table::do_define_as_constant): Likewise.
3380 * symtab.h (Symbol::is_predefined): New function.
3381 (Symbol::init_base_output_data): Add is_predefined parameter.
3382 (Symbol::init_base_output_segment): Likewise.
3383 (Symbol::init_base_constant): Likewise.
3384 (Symbol::is_predefined_): New data member.
3385 (Sized_symbol::init_output_data): Add is_predefined parameter.
3386 (Sized_symbol::init_output_segment): Likewise.
3387 (Sized_symbol::init_constant): Likewise.
3388 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3389
3390 2011-06-07 Cary Coutant <ccoutant@google.com>
3391
3392 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3393 instead of emit_copy_reloc.
3394 (Copy_relocs::emit_copy_reloc): Refactor.
3395 (Copy_relocs::make_copy_reloc): New function.
3396 (Copy_relocs::add_copy_reloc): Remove.
3397 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3398 section.
3399 (Copy_relocs::make_copy_reloc): New function.
3400 (Copy_relocs::add_copy_reloc): Remove.
3401 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3402 unchanged input files.
3403 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3404 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3405 Reserve BSS space for COPY relocations.
3406 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3407 (Output_section_incremental_inputs::write_info_blocks): Record
3408 whether a symbol is copied from a shared object.
3409 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3410 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3411 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3412 (Incremental_input_entry_reader::get_output_symbol_index): Add
3413 is_copy parameter.
3414 (Incremental_binary::emit_copy_relocs): New function.
3415 (Incremental_binary::do_emit_copy_relocs): New function.
3416 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3417 new data member.
3418 (Sized_incremental_binary::add_copy_reloc): New function.
3419 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3420 (Sized_incremental_binary::Copy_reloc): New struct.
3421 (Sized_incremental_binary::Copy_relocs): New typedef.
3422 (Sized_incremental_binary::copy_relocs_): New data member.
3423 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3424 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3425 * target.h (Sized_target::emit_copy_reloc): New function.
3426 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3427
3428 2011-06-02 Cary Coutant <ccoutant@google.com>
3429
3430 PR gold/12163
3431 * gold/archive.cc (Archive::Archive): Initialize new data member.
3432 (Archive::include_all_members): Return if archive has already been
3433 included.
3434 * gold/archive.h (Archive::include_all_members_): New data member.
3435
3436 2011-06-02 Nick Clifton <nickc@redhat.com>
3437
3438 * dynobj.h: Fix spelling mistake in comment.
3439 * output.cc: Likewise.
3440
3441 2011-05-31 Doug Kwan <dougkwan@google.com>
3442 Asier Llano
3443
3444 PR gold/12826
3445 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
3446 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3447 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3448 redundant arm_exidx_test.so.
3449 * testsuite/Makefile.in: Regenerate.
3450 (check_SCRIPTS): Add pr12826.sh
3451 (check_DATA): Add pr12826.stdout
3452 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3453 * testsuite/pr12826.sh: New file.
3454 * testsuite/pr12826_1.s: Ditto.
3455 * testsuite/pr12826_1.s: Ditto.
3456
3457 2011-05-30 Ian Lance Taylor <iant@google.com>
3458
3459 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3460 sections.
3461
3462 2011-05-29 Ian Lance Taylor <iant@google.com>
3463
3464 PR gold/12804
3465 * testsuite/Makefile.am: Use different file name for two_file_test
3466 temporary file for each incremental test.
3467 * testsuite/Makefile.in: Rebuild.
3468
3469 2011-05-29 Ian Lance Taylor <iant@google.com>
3470
3471 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3472 binary input file is empty.
3473
3474 2011-05-27 Ian Lance Taylor <iant@google.com>
3475
3476 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3477 (ver_test_9.so): Likewise.
3478 * testsuite/Makefile.in: Rebuild.
3479
3480 2011-05-26 Cary Coutant <ccoutant@google.com>
3481
3482 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3483 * incremental.cc (Incremental_inputs::report_input_section): Fix
3484 comment, indentation.
3485 (Incremental_inputs::report_comdat_group): New function.
3486 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3487 of data for incremental input file entry.
3488 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3489 group count, COMDAT group signatures.
3490 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3491 an unchanged input file.
3492 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3493 Initialize new data member.
3494 (Incremental_object_entry::add_comdat_group): New function.
3495 (Incremental_object_entry::get_comdat_group_count): New function.
3496 (Incremental_object_entry::get_comdat_signature_key): New function.
3497 (Incremental_object_entry::groups_): New data member.
3498 (Incremental_inputs::report_comdat_group): New function.
3499 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3500 data for incremental input file entry.
3501 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3502 (Incremental_input_entry_reader::get_input_section): Adjust size of
3503 data for incremental input file entry.
3504 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3505 (Incremental_input_entry_reader::get_comdat_group_signature): New
3506 function.
3507 * object.cc (Sized_relobj::include_section_group): Report kept
3508 COMDAT groups for incremental links.
3509
3510 2011-05-24 David Meyer <pdox@google.com>
3511
3512 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3513 with name parameter. Add found_name parameter.
3514 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3515 * dirsearch.h (class Dirsearch): Update declaration.
3516
3517 2011-05-24 Ian Lance Taylor <iant@google.com>
3518
3519 * archive.cc (Library_base::should_include_member): Pull in object
3520 from archive if it defines the entry symbol.
3521 * parameters.cc (Parameters::entry): New function.
3522 * parameters.h (class Parameters): Declare entry.
3523 * output.h (class Output_file_header): Remove entry_ field.
3524 * output.cc (Output_file_header::Output_file_header): Remove entry
3525 parameter. Change all callers.
3526 (Output_file_header::entry): Use parameters->entry.
3527 * gold.cc (queue_middle_tasks): Likewise.
3528 * plugin.cc (Plugin_hook::run): Likewise.
3529
3530 2011-05-24 Cary Coutant <ccoutant@google.com>
3531
3532 * gold.cc (queue_initial_tasks): Pass incremental base filename
3533 to Output_file::open_base_file; don't print error message.
3534 * incremental-dump.cc (main): Adjust call to
3535 Output_file::open_for_modification.
3536 * incremental-dump.cc (main): Likewise.
3537 * incremental.cc (Incremental_inputs::report_command_line):
3538 Ignore --incremental-base option when comparing command lines.
3539 Ignore parameter when given as separate argument.
3540 * options.h (class General_options): Add --incremental-base.
3541 * output.cc (Output_file::Output_file):
3542 (Output_file::open_base_file): Add base_name and writable parameters;
3543 read base file into new file; print error message here.
3544 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3545 callers.
3546 * output.h (Output_file::open_for_modification): Rename to...
3547 (Output_file::open_base_file): ...this; add base_name and
3548 writable parameters; adjust all callers.
3549 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3550 callers.
3551 * testsuite/Makefile.am (incremental_test_4): Test
3552 --incremental-base.
3553 * testsuite/Makefile.in: Regenerate.
3554
3555 2011-05-24 Cary Coutant <ccoutant@google.com>
3556
3557 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3558 incremental_test_4.
3559 * testsuite/Makefile.in: Regenerate.
3560 * testsuite/two_file_test_1_v1.cc: New test source file.
3561 * testsuite/two_file_test_1b_v1.cc: New test source file.
3562 * testsuite/two_file_test_2_v1.cc: New test source file.
3563
3564 2011-05-24 Cary Coutant <ccoutant@google.com>
3565
3566 * dynobj.h (Dynobj::do_dynobj): New function.
3567 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3568 flag and soname for shared objects.
3569 * incremental.cc (Incremental_inputs::report_object): Make
3570 either Incremental_object_entry or Incremental_dynobj_entry; add
3571 soname to string table.
3572 (Incremental_inputs::report_input_section): Add assertion.
3573 (Output_section_incremental_inputs::set_final_data_size): Adjust
3574 type of input file entry for shared libraries; adjust size of
3575 shared library info entry.
3576 (Output_section_incremental_inputs::write_input_files): Write
3577 as_needed flag for shared libraries.
3578 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3579 of input file entry for shared libraries; write soname.
3580 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3581 soname from incremental info.
3582 * incremental.h (enum Incremental_input_flags): Add
3583 INCREMENTAL_INPUT_AS_NEEDED.
3584 (Incremental_input_entry::Incremental_input_entry): Initialize new
3585 data member.
3586 (Incremental_input_entry::set_as_needed): New function.
3587 (Incremental_input_entry::as_needed): New function.
3588 (Incremental_input_entry::do_dynobj_entry): New function.
3589 (Incremental_input_entry::as_needed_): New data member.
3590 (Incremental_object_entry::Incremental_object_entry): Don't check
3591 for shared library.
3592 (Incremental_object_entry::do_type): Likewise.
3593 (class Incremental_dynobj_entry): New class.
3594 (Incremental_input_entry_reader::as_needed): New function.
3595 (Incremental_input_entry_reader::get_soname): New function.
3596 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3597 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3598 size of shared library info entry.
3599 * layout.cc (Layout::finish_dynamic_section): Don't test for
3600 incremental link when adding DT_NEEDED entries.
3601 * object.h (Object::Object): Initialize new data member.
3602 (Object::dynobj): New function.
3603 (Object::set_as_needed): New function.
3604 (Object::as_needed): New function.
3605 (Object::do_dynobj): New function.
3606 (Object::as_needed_): New data member.
3607
3608 2011-05-24 Cary Coutant <ccoutant@google.com>
3609
3610 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3611 info; adjust display of GOT entries.
3612 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3613 vector of input objects; remove file_status_.
3614 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3615 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3616 got_plt reader; call target hooks to reserve GOT entries.
3617 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3618 of input file info header and GOT info entry.
3619 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3620 relocation info.
3621 (Got_plt_view_info::got_descriptor): Remove.
3622 (Got_plt_view_info::sym_index): New data member.
3623 (Got_plt_view_info::input_index): New data member.
3624 (Local_got_offset_visitor::visit): Write input file index.
3625 (Global_got_offset_visitor::visit): Write 0 for input file index.
3626 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3627 with sym_index and input_index.
3628 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3629 incremental info GOT entry; replace got_descriptor with input_index.
3630 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3631 map from input file index to object.
3632 (Sized_relobj_incr::do_layout): Replace direct data member reference
3633 with accessor function.
3634 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3635 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3636 Adjust size of input file info header.
3637 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3638 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3639 (Incremental_input_entry_reader::get_input_section): Adjust size of
3640 input file info header.
3641 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3642 of incremental info GOT entry.
3643 (Incremental_got_plt_reader::get_got_desc): Remove.
3644 (Incremental_got_plt_reader::get_got_symndx): New function.
3645 (Incremental_got_plt_reader::get_got_input_index): New function.
3646 (Sized_incremental_binary::Sized_incremental_binary): Remove
3647 file_status_; add input_objects_.
3648 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3649 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3650 (Sized_incremental_binary::file_is_unchanged): Remove.
3651 (Sized_incremental_binary::set_input_object): New function.
3652 (Sized_incremental_binary::input_object): New function.
3653 (Sized_incremental_binary::file_status_): Remove.
3654 (Sized_incremental_binary::input_objects_): New data member.
3655 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3656 references.
3657 (Sized_relobj_incr::invalid_address): Move to base class.
3658 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3659 class.
3660 (Sized_relobj_incr::do_output_section_offset): Likewise.
3661 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3662 (Sized_relobj_incr::section_offsets_): Likewise.
3663 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3664 function.
3665 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3666 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3667 with accessor function.
3668 (Sized_relobj_file::do_layout): Likewise.
3669 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3670 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3671 (Sized_relobj_file::compute_final_local_value): Replace refs to
3672 section_offsets_ with accessor function.
3673 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3674 * object.h (Relobj::Relobj): Initialize new data members.
3675 (Relobj::add_dyn_reloc): New function.
3676 (Relobj::first_dyn_reloc): New function.
3677 (Relobj::dyn_reloc_count): New function.
3678 (Relobj::first_dyn_reloc_): New data member.
3679 (Relobj::dyn_reloc_count_): New data member.
3680 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3681 references.
3682 (Sized_relobj::Address): New typedef.
3683 (Sized_relobj::invalid_address): Move here from child class.
3684 (Sized_relobj::Sized_relobj): Initialize new data members.
3685 (Sized_relobj::sized_relobj): New function.
3686 (Sized_relobj::is_output_section_offset_invalid): Move here from
3687 child class.
3688 (Sized_relobj::get_output_section_offset): Likewise.
3689 (Sized_relobj::local_has_got_offset): Likewise.
3690 (Sized_relobj::local_got_offset): Likewise.
3691 (Sized_relobj::set_local_got_offset): Likewise.
3692 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3693 (Sized_relobj::clear_got_offsets): New function.
3694 (Sized_relobj::section_offsets): Move here from child class.
3695 (Sized_relobj::do_output_section_offset): Likewise.
3696 (Sized_relobj::do_set_section_offset): Likewise.
3697 (Sized_relobj::Local_got_offsets): Likewise.
3698 (Sized_relobj::local_got_offsets_): Likewise.
3699 (Sized_relobj::section_offsets_): Likewise.
3700 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3701 references.
3702 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3703 class.
3704 (Sized_relobj_file::sized_relobj): New function
3705 (Sized_relobj_file::local_has_got_offset): Move to base class.
3706 (Sized_relobj_file::local_got_offset): Likewise.
3707 (Sized_relobj_file::set_local_got_offset): Likewise.
3708 (Sized_relobj_file::get_output_section_offset): Likewise.
3709 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3710 (Sized_relobj_file::do_output_section_offset): Likewise.
3711 (Sized_relobj_file::do_set_section_offset): Likewise.
3712 (Sized_relobj_file::Local_got_offsets): Likewise.
3713 (Sized_relobj_file::local_got_offsets_): Likewise.
3714 (Sized_relobj_file::section_offsets_): Likewise.
3715 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3716 (all constructors).
3717 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3718 (Output_reloc::get_symbol_index): Likewise.
3719 (Output_reloc::local_section_offset): Likewise.
3720 (Output_reloc::get_address): Likewise.
3721 (Output_reloc::symbol_value): Likewise.
3722 (Output_data_got::reserve_slot): Move to class definition.
3723 (Output_data_got::reserve_local): New function.
3724 (Output_data_got::reserve_slot_for_global): Remove.
3725 (Output_data_got::reserve_global): New function.
3726 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3727 (all constructors, two instantiations).
3728 (Output_reloc::get_relobj): New function (two instantiations).
3729 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3730 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3731 (Output_data_reloc::add_global): Adjust type of relobj.
3732 (Output_data_reloc::add_global_relative): Likewise.
3733 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3734 (Output_data_reloc::add_local): Likewise.
3735 (Output_data_reloc::add_local_relative): Likewise.
3736 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3737 (Output_data_reloc::add_local_section): Likewise.
3738 (Output_data_reloc::add_output_section): Likewise.
3739 (Output_data_reloc::add_absolute): Likewise.
3740 (Output_data_reloc::add_target_specific): Likewise.
3741 (Output_data_got::reserve_slot): Move definition here.
3742 (Output_data_got::reserve_local): New function.
3743 (Output_data_got::reserve_global): New function.
3744 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3745 section_offsets_ with accessor function.
3746 (Sized_relobj_file::write_sections): Likewise.
3747 (Sized_relobj_file::do_relocate_sections): Likewise.
3748 * target.h (Sized_target::reserve_local_got_entry): New function.
3749 (Sized_target::reserve_global_got_entry): New function.
3750 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3751 (Target_x86_64::reserve_global_got_entry): New function.
3752 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3753
3754 2011-05-23 Cary Coutant <ccoutant@google.com>
3755
3756 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3757 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3758 bit when checking got_type.
3759 * incremental.cc (Sized_incremental_binary::setup_readers):
3760 Store symbol table and string table locations; initialize bit vector
3761 of file status flags.
3762 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3763 unchanged files.
3764 (Sized_incremental_binary::do_process_got_plt): New function.
3765 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3766 (Output_section_incremental_inputs::set_final_data_size): Record
3767 file index for each input file.
3768 (Output_section_incremental_inputs::write_got_plt): Store file index
3769 instead of input entry offset for each GOT entry.
3770 * incremental.h
3771 (Incremental_input_entry::Incremental_input_entry): Initialize new
3772 data member.
3773 (Incremental_input_entry::set_offset): Store file index.
3774 (Incremental_input_entry::get_file_index): New function.
3775 (Incremental_input_entry::file_index_): New data member.
3776 (Incremental_binary::process_got_plt): New function.
3777 (Incremental_binary::do_process_got_plt): New function.
3778 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3779 data members.
3780 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3781 (Sized_incremental_binary::set_file_is_unchanged): New function.
3782 (Sized_incremental_binary::file_is_unchanged): New function.
3783 (Sized_incremental_binary::do_process_got_plt): New function.
3784 (Sized_incremental_binary::file_status_): New data member.
3785 (Sized_incremental_binary::main_symtab_loc_): New data member.
3786 (Sized_incremental_binary::main_strtab_loc_): New data member.
3787 * output.cc (Output_data_got::Got_entry::write): Add case
3788 RESERVED_CODE.
3789 (Output_data_got::add_global): Call add_got_entry.
3790 (Output_data_got::add_global_plt): Likewise.
3791 (Output_data_got::add_global_with_rel): Likewise.
3792 (Output_data_got::add_global_with_rela): Likewise.
3793 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3794 (Output_data_got::add_global_pair_with_rela): Likewise.
3795 (Output_data_got::add_local): Call add_got_entry.
3796 (Output_data_got::add_local_plt): Likewise.
3797 (Output_data_got::add_local_with_rel): Likewise.
3798 (Output_data_got::add_local_with_rela): Likewise.
3799 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3800 (Output_data_got::add_local_pair_with_rela): Likewise.
3801 (Output_data_got::reserve_slot): New function.
3802 (Output_data_got::reserve_slot_for_global): New function.
3803 (Output_data_got::add_got_entry): New function.
3804 (Output_data_got::add_got_entry_pair): New function.
3805 (Output_section::add_output_section_data): Edit FIXME.
3806 * output.h
3807 (Output_section_data_build::Output_section_data_build): New
3808 constructor with size parameter.
3809 (Output_data_space::Output_data_space): Likewise.
3810 (Output_data_got::Output_data_got): Initialize new data member; new
3811 constructor with size parameter.
3812 (Output_data_got::add_constant): Call add_got_entry.
3813 (Output_data_got::reserve_slot): New function.
3814 (Output_data_got::reserve_slot_for_global): New function.
3815 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3816 (Output_data_got::add_got_entry): New function.
3817 (Output_data_got::add_got_entry_pair): New function.
3818 (Output_data_got::free_list_): New data member.
3819 * target.h (Sized_target::init_got_plt_for_update): New function.
3820 (Sized_target::register_global_plt_entry): New function.
3821 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3822 Initialize new data member; call init; add constructor with PLT count.
3823 (Output_data_plt_x86_64::init): New function.
3824 (Output_data_plt_x86_64::add_relocation): New function.
3825 (Output_data_plt_x86_64::reserve_slot): New function.
3826 (Output_data_plt_x86_64::free_list_): New data member.
3827 (Target_x86_64::init_got_plt_for_update): New function.
3828 (Target_x86_64::register_global_plt_entry): New function.
3829 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3830 incremental updates.
3831 (Output_data_plt_x86_64::add_relocation): New function.
3832 * testsuite/object_unittest.cc (Object_test): Set default options.
3833
3834 2011-05-16 Ian Lance Taylor <iant@google.com>
3835
3836 * options.h (class General_options): Make -i a synonym for -r.
3837
3838 2011-05-16 Ian Lance Taylor <iant@google.com>
3839
3840 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3841
3842 2011-05-10 Cary Coutant <ccoutant@google.com>
3843
3844 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3845 strip_all (-s).
3846
3847 2011-05-06 Ian Lance Taylor <iant@google.com>
3848
3849 * layout.cc (Layout::layout): If the output section flags change,
3850 update the ordering.
3851
3852 2011-04-25 Cary Coutant <ccoutant@google.com>
3853
3854 * incremental-dump.cc (dump_incremental_inputs): Print local
3855 symbol info for each input file.
3856 * incremental.cc
3857 (Output_section_incremental_inputs::set_final_data_size): Add local
3858 symbol info to input file entries in incremental info.
3859 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3860 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3861 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3862 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3863 implementation.
3864 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3865 (Sized_incr_relobj::do_relocate): Write the local symbols.
3866 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3867 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3868 Adjust size of input file header.
3869 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3870 (Incremental_inputs_reader::get_local_symbol_count): New function.
3871 (Incremental_inputs_reader::get_input_section): Adjust size of input
3872 file header.
3873 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3874 (Sized_incr_relobj::This): New typedef.
3875 (Sized_incr_relobj::sym_size): New const data member.
3876 (Sized_incr_relobj::Local_symbol): New struct.
3877 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3878 (Sized_incr_relobj::do_local_symbol_offset): New function.
3879 (Sized_incr_relobj::local_symbol_count_): New data member.
3880 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3881 (Sized_incr_relobj::local_symbol_index_): New data member.
3882 (Sized_incr_relobj::local_symbol_offset_): New data member.
3883 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3884 (Sized_incr_relobj::local_symbols_): New data member.
3885 * object.h (Relobj::output_local_symbol_count): New function.
3886 (Relobj::local_symbol_offset): New function.
3887 (Relobj::do_output_local_symbol_count): New function.
3888 (Relobj::do_local_symbol_offset): New function.
3889 (Sized_relobj::do_output_local_symbol_count): New function.
3890 (Sized_relobj::do_local_symbol_offset): New function.
3891
3892 2011-04-22 Vladimir Simonov <sv@sw.ru>
3893
3894 * descriptors.cc (set_close_on_exec): New function.
3895 (Descriptors::open): Use set_close_on_exec.
3896 * output.cc (S_ISLNK): Define if not defined.
3897
3898 2011-04-22 Cary Coutant <ccoutant@google.com>
3899
3900 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3901 global symbol map.
3902 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3903 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3904 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3905 relocations.
3906 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3907 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3908 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3909 * incremental.h
3910 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3911 function.
3912 (Incremental_binary::apply_incremental_relocs): New function.
3913 (Incremental_binary::do_apply_incremental_relocs): New function.
3914 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3915 data member.
3916 (Sized_incremental_binary::add_global_symbol): New function.
3917 (Sized_incremental_binary::global_symbol): New function.
3918 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3919 (Sized_incremental_binary::symbol_map_): New data member.
3920 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3921 * target.h (Sized_target::apply_relocation): New function.
3922 * target-reloc.h (apply_relocation): New function.
3923 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3924
3925 2011-04-22 Doug Kwan <dougkwan@google.com>
3926
3927 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3928 flag of a SHT_ARM_EXIDX section.
3929 * testsuite/Makefile.am (arm_exidx_test): New test rules.
3930 * testsuite/Makefile.in: Regenerate.
3931 * testsuite/arm_exidx_test.s: New file.
3932 * testsuite/arm_exidx_test.sh: Same.
3933
3934 2011-04-20 Cary Coutant <ccoutant@google.com>
3935
3936 PR gold/12689
3937 * archive.h (Incremental_archive_entry::Archive_member):
3938 Initialize arg_serial_ (second constructor).
3939
3940 2011-04-17 Ian Lance Taylor <iant@google.com>
3941
3942 * object.cc (Relocate_info::location): Simplify location string.
3943 * errors.cc (Errors::error_at_location): Don't print program
3944 name.
3945 (Errors::warning_at_location): Likewise.
3946 (Errors::undefined_symbol): Likewise.
3947 * testsuite/debug_msg.sh: Update accordingly.
3948
3949 2011-04-14 Cary Coutant <ccoutant@google.com>
3950
3951 * gold/layout.cc (Layout::symtab_section_offset): New function.
3952 * gold/layout.h (Layout::symtab_section_offset): New function.
3953 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3954
3955 2011-04-12 Ian Lance Taylor <iant@google.com>
3956
3957 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3958 with MREMAP_MAYMOVE.
3959 * output.h (class Output_file): Add map_is_allocated_ field.
3960 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3961 not available, provide stubs. If mremap is not available, #define
3962 it to gold_mremap.
3963 (MREMAP_MAYMOVE): Define if not defined.
3964 (Output_file::Output_file): Initialize map_is_allocated_.
3965 (Output_file::resize): Check map_is_allocated_.
3966 (Output_file::map_anonymous): If mmap fails, use malloc.
3967 (Output_file::unmap): Don't do anything for an anonymous map.
3968 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3969 is not available, provide stubs.
3970 (File_read::View::~View): Use free rather than delete[].
3971 (File_read::make_view): Use malloc rather than new[]. If mmap
3972 fails, use malloc.
3973 (File_read::find_or_make_view): Use malloc rather than new[].
3974 * gold.h: Remove HAVE_REMAP code.
3975 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3976 exists. Rename mremap to gold_mremap. If mmap is not available
3977 don't do anything.
3978 * configure, config.in: Rebuild.
3979
3980 2011-04-11 Ian Lance Taylor <iant@google.com>
3981
3982 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3983 initialize local variable v.
3984
3985 2011-04-11 Cary Coutant <ccoutant@google.com>
3986
3987 * archive.cc (Archive::include_member): Adjust call to
3988 report_object.
3989 (Add_archive_symbols::run): Track argument serial numbers.
3990 (Lib_group::include_member): Likewise.
3991 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3992 * archive.h (Incremental_archive_entry::Archive_member):
3993 Initialize arg_serial_.
3994 (Archive_member::arg_serial_): New data member.
3995 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3996 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3997 incremental link.
3998 (Sized_dynobj::do_for_all_local_got_entries): New function.
3999 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4000 function.
4001 * fileread.cc (get_mtime): New function.
4002 * fileread.h (get_mtime): New function.
4003 * gold.cc (queue_initial_tasks): Check for incremental update.
4004 (process_incremental_input): New function.
4005 (queue_middle_tasks): Don't force valid target for incremental
4006 update.
4007 * incremental-dump.cc (find_input_containing_global): Adjust
4008 size of symbol info entry.
4009 (dump_incremental_inputs): Dump argument serial number and
4010 in_system_directory flag; bias shndx by 1; print symbol names
4011 when dumping per-file symbol lists; use new symbol info readers.
4012 * incremental.cc
4013 (Output_section_incremental_inputs:update_data_size): New function.
4014 (Sized_incremental_binary::setup_readers): Setup input readers
4015 for each input file; build maps for files added from libraries
4016 and scripts.
4017 (Sized_incremental_binary::check_input_args): New function.
4018 (Sized_incremental_binary::do_check_inputs): Build map of argument
4019 serial numbers to input arguments.
4020 (Sized_incremental_binary::do_file_has_changed): Rename
4021 do_file_is_unchanged to this; compare file modification times.
4022 (Sized_incremental_binary::do_init_layout): New function.
4023 (Sized_incremental_binary::do_reserve_layout): New function.
4024 (Sized_incremental_binary::do_get_input_reader): Remove.
4025 (Sized_incremental_binary::get_symtab_view): New function.
4026 (Incremental_checker::can_incrementally_link_output_file): Remove.
4027 (Incremental_inputs::report_command_line): Exclude --debug options.
4028 (Incremental_inputs::report_archive_begin): Add parameter; track
4029 argument serial numbers; don't put input file entry for archive
4030 before archive members.
4031 (Incremental_inputs::report_archive_end): Put input file entry
4032 for archive after archive members.
4033 (Incremental_inputs::report_object): Add parameter; track argument
4034 serial numbers and in_system_directory flag.
4035 (Incremental_inputs::report_script): Add parameter; track argument
4036 serial numbers.
4037 (Output_section_incremental_inputs::set_final_data_size): Adjust
4038 size of symbol info entry; check for forwarding symbols.
4039 (Output_section_incremental_inputs::write_input_files): Write
4040 in_system_directory flag and argument serial number.
4041 (Output_section_incremental_inputs::write_info_blocks): Map section
4042 indices between incremental info and original input file; store
4043 input section index for each symbol.
4044 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4045 change operator() to visit().
4046 (class Global_got_offset_visitor): Likewise.
4047 (class Global_symbol_visitor_got_plt):
4048 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4049 classes.
4050 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4051 (Sized_incr_relobj::do_read_symbols): New function.
4052 (Sized_incr_relobj::do_layout): New function.
4053 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4054 (Sized_incr_relobj::do_add_symbols): New function.
4055 (Sized_incr_relobj::do_should_include_member): New function.
4056 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4057 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4058 (Sized_incr_relobj::do_section_size): New function.
4059 (Sized_incr_relobj::do_section_name): New function.
4060 (Sized_incr_relobj::do_section_contents): New function.
4061 (Sized_incr_relobj::do_section_flags): New function.
4062 (Sized_incr_relobj::do_section_entsize): New function.
4063 (Sized_incr_relobj::do_section_address): New function.
4064 (Sized_incr_relobj::do_section_type): New function.
4065 (Sized_incr_relobj::do_section_link): New function.
4066 (Sized_incr_relobj::do_section_info): New function.
4067 (Sized_incr_relobj::do_section_addralign): New function.
4068 (Sized_incr_relobj::do_initialize_xindex): New function.
4069 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4070 (Sized_incr_relobj::do_read_relocs): New function.
4071 (Sized_incr_relobj::do_gc_process_relocs): New function.
4072 (Sized_incr_relobj::do_scan_relocs): New function.
4073 (Sized_incr_relobj::do_count_local_symbols): New function.
4074 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4075 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4076 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4077 (Sized_incr_relobj::do_relocate): New function.
4078 (Sized_incr_relobj::do_set_section_offset): New function.
4079 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4080 (Sized_incr_dynobj::do_read_symbols): New function.
4081 (Sized_incr_dynobj::do_layout): New function.
4082 (Sized_incr_dynobj::do_add_symbols): New function.
4083 (Sized_incr_dynobj::do_should_include_member): New function.
4084 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4085 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4086 (Sized_incr_dynobj::do_section_size): New function.
4087 (Sized_incr_dynobj::do_section_name): New function.
4088 (Sized_incr_dynobj::do_section_contents): New function.
4089 (Sized_incr_dynobj::do_section_flags): New function.
4090 (Sized_incr_dynobj::do_section_entsize): New function.
4091 (Sized_incr_dynobj::do_section_address): New function.
4092 (Sized_incr_dynobj::do_section_type): New function.
4093 (Sized_incr_dynobj::do_section_link): New function.
4094 (Sized_incr_dynobj::do_section_info): New function.
4095 (Sized_incr_dynobj::do_section_addralign): New function.
4096 (Sized_incr_dynobj::do_initialize_xindex): New function.
4097 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4098 (make_sized_incremental_object): New function.
4099 (Incremental_library::copy_unused_symbols): New function.
4100 (Incremental_library::do_for_all_unused_symbols): New function.
4101 * incremental.h (enum Incremental_input_flags): New type.
4102 (class Incremental_checker): Remove.
4103 (Incremental_input_entry::Incremental_input_entry): Add argument
4104 serial number.
4105 (Incremental_input_entry::arg_serial): New function.
4106 (Incremental_input_entry::set_is_in_system_directory): New function.
4107 (Incremental_input_entry::is_in_system_directory): New function.
4108 (Incremental_input_entry::arg_serial_): New data member.
4109 (Incremental_input_entry::is_in_system_directory_): New data member.
4110 (class Script_info): Move here from script.h.
4111 (Script_info::Script_info): Add filename parameter.
4112 (Script_info::filename): New function.
4113 (Script_info::filename_): New data member.
4114 (Incremental_script_entry::Incremental_script_entry): Add argument
4115 serial number.
4116 (Incremental_object_entry::Incremental_object_entry): Likewise.
4117 (Incremental_object_entry::add_input_section): Build list of input
4118 sections with map to original shndx.
4119 (Incremental_object_entry::get_input_section_index): New function.
4120 (Incremental_object_entry::shndx_): New data member.
4121 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4122 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4123 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4124 serial number.
4125 (Incremental_inputs::report_archive_begin): Likewise.
4126 (Incremental_inputs::report_object): Likewise.
4127 (Incremental_inputs::report_script): Likewise.
4128 (class Incremental_global_symbol_reader): New class.
4129 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4130 and store flags and input file type.
4131 (Incremental_input_entry_reader::arg_serial): New function.
4132 (Incremental_input_entry_reader::type): Extract type from flags.
4133 (Incremental_input_entry_reader::is_in_system_directory): New function.
4134 (Incremental_input_entry_reader::get_input_section_count): Call
4135 accessor function for type.
4136 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4137 function for type; adjust size of global symbol entry.
4138 (Incremental_input_entry_reader::get_global_symbol_count): Call
4139 accessor function for type.
4140 (Incremental_input_entry_reader::get_object_count): Likewise.
4141 (Incremental_input_entry_reader::get_object_offset): Likewise.
4142 (Incremental_input_entry_reader::get_member_count): Likewise.
4143 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4144 (Incremental_input_entry_reader::get_member_offset): Likewise.
4145 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4146 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4147 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4148 (Incremental_input_entry_reader::get_global_symbol_reader): New
4149 function.
4150 (Incremental_input_entry_reader::get_output_symbol_index): New
4151 function.
4152 (Incremental_input_entry_reader::type_): Remove.
4153 (Incremental_input_entry_reader::flags_): New data member.
4154 (Incremental_inputs_reader::input_file_offset): New function.
4155 (Incremental_inputs_reader::input_file_index): New function.
4156 (Incremental_inputs_reader::input_file): Call input_file_offset.
4157 (Incremental_inputs_reader::input_file_at_offset): New function.
4158 (Incremental_relocs_reader::get_r_type): Reformat.
4159 (Incremental_relocs_reader::get_r_shndx): Reformat.
4160 (Incremental_relocs_reader::get_r_offset): Reformat.
4161 (Incremental_relocs_reader::data): New function.
4162 (Incremental_binary::Incremental_binary): Initialize new data members.
4163 (Incremental_binary::check_inputs): Add cmdline parameter.
4164 (Incremental_binary::file_is_unchanged): Remove.
4165 (Input_reader::arg_serial): New function.
4166 (Input_reader::get_unused_symbol_count): New function.
4167 (Input_reader::get_unused_symbol): New function.
4168 (Input_reader::do_arg_serial): New function.
4169 (Input_reader::do_get_unused_symbol_count): New function.
4170 (Input_reader::do_get_unused_symbol): New function.
4171 (Incremental_binary::input_file_count): New function.
4172 (Incremental_binary::get_input_reader): Change signature to use
4173 index instead of filename.
4174 (Incremental_binary::file_has_changed): New function.
4175 (Incremental_binary::get_input_argument): New function.
4176 (Incremental_binary::get_library): New function.
4177 (Incremental_binary::get_script_info): New function.
4178 (Incremental_binary::init_layout): New function.
4179 (Incremental_binary::reserve_layout): New function.
4180 (Incremental_binary::output_file): New function.
4181 (Incremental_binary::do_check_inputs): New function.
4182 (Incremental_binary::do_file_is_unchanged): Remove.
4183 (Incremental_binary::do_file_has_changed): New function.
4184 (Incremental_binary::do_init_layout): New function.
4185 (Incremental_binary::do_reserve_layout): New function.
4186 (Incremental_binary::do_input_file_count): New function.
4187 (Incremental_binary::do_get_input_reader): Change signature.
4188 (Incremental_binary::input_args_map_): New data member.
4189 (Incremental_binary::library_map_): New data member.
4190 (Incremental_binary::script_map_): New data member.
4191 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4192 new data members.
4193 (Sized_incremental_binary::output_section): New function.
4194 (Sized_incremental_binary::inputs_reader): Add const.
4195 (Sized_incremental_binary::symtab_reader): Add const.
4196 (Sized_incremental_binary::relocs_reader): Add const.
4197 (Sized_incremental_binary::got_plt_reader): Add const.
4198 (Sized_incremental_binary::get_symtab_view): New function.
4199 (Sized_incremental_binary::Inputs_reader): New typedef.
4200 (Sized_incremental_binary::Input_entry_reader): New typedef.
4201 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4202 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4203 (Sized_incremental_binary::do_file_has_changed): New function.
4204 (Sized_incremental_binary::do_init_layout): New function.
4205 (Sized_incremental_binary::do_reserve_layout): New function.
4206 (Sized_input_reader::Inputs_reader): Remove.
4207 (Sized_input_reader::Input_entry_reader): Remove.
4208 (Sized_input_reader::do_arg_serial): New function.
4209 (Sized_input_reader::do_get_unused_symbol_count): New function.
4210 (Sized_input_reader::do_get_unused_symbol): New function.
4211 (Sized_incremental_binary::do_input_file_count): New function.
4212 (Sized_incremental_binary::do_get_input_reader): Change signature;
4213 use index instead of filename.
4214 (Sized_incremental_binary::section_map_): New data member.
4215 (Sized_incremental_binary::input_entry_readers_): New data member.
4216 (class Sized_incr_relobj): New class.
4217 (class Sized_incr_dynobj): New class.
4218 (make_sized_incremental_object): New function.
4219 (class Incremental_library): New class.
4220 * layout.cc (Free_list::num_lists): New static data member.
4221 (Free_list::num_nodes): New static data member.
4222 (Free_list::num_removes): New static data member.
4223 (Free_list::num_remove_visits): New static data member.
4224 (Free_list::num_allocates): New static data member.
4225 (Free_list::num_allocate_visits): New static data member.
4226 (Free_list::init): New function.
4227 (Free_list::remove): New function.
4228 (Free_list::allocate): New function.
4229 (Free_list::dump): New function.
4230 (Free_list::print_stats): New function.
4231 (Layout_task_runner::run): Resize output file for incremental updates.
4232 (Layout::Layout): Initialize new data members.
4233 (Layout::set_incremental_base): New function.
4234 (Layout::init_fixed_output_section): New function.
4235 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4236 incremental updates.
4237 (Layout::create_gold_note): Do not create gold note section for
4238 incremental updates.
4239 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4240 for incremental updates.
4241 (Layout::set_section_offsets): For incremental updates, allocate space
4242 from free list.
4243 (Layout::create_symtab_sections): Layout with offsets relative to
4244 start of section; for incremental updates, allocate space from free
4245 list.
4246 (Layout::create_shdrs): For incremental updates, allocate space from
4247 free list.
4248 (Layout::finish_dynamic_section): For incremental updates, do not
4249 check --as-needed (fixed in subsequent patch).
4250 * layout.h (class Free_list): New class.
4251 (Layout::set_incremental_base): New function.
4252 (Layout::incremental_base): New function.
4253 (Layout::init_fixed_output_section): New function.
4254 (Layout::allocate): New function.
4255 (Layout::incremental_base_): New data member.
4256 (Layout::free_list_): New data member.
4257 * main.cc (main): Print Free_list statistics.
4258 * object.cc (Relobj::finalize_incremental_relocs): Add
4259 clear_counts parameter; clear counts only when clear_counts is set.
4260 (Sized_relobj::Sized_relobj): Initialize new base class.
4261 (Sized_relobj::do_layout): Don't report special sections.
4262 (Sized_relobj::do_for_all_local_got_entries): New function.
4263 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4264 symtab_off to all symbol table offsets.
4265 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4266 * object.h (class Got_offset_list): Move to top of file.
4267 (Object::Object): Allow case where input_file == NULL.
4268 (Object::~Object): Likewise.
4269 (Object::input_file): Assert that input_file != NULL.
4270 (Object::lock): Allow case where input_file == NULL.
4271 (Object::unlock): Likewise.
4272 (Object::is_locked): Likewise.
4273 (Object::token): Likewise.
4274 (Object::release): Likewise.
4275 (Object::is_incremental): New function.
4276 (Object::get_mtime): New function.
4277 (Object::for_all_local_got_entries): New function.
4278 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4279 (Object::set_is_in_system_directory): New function.
4280 (Object::is_in_system_directory): New function.
4281 (Object::do_is_incremental): New function.
4282 (Object::do_get_mtime): New function.
4283 (Object::do_for_all_local_got_entries): New function.
4284 (Object::is_in_system_directory_): New data member.
4285 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4286 (class Sized_relobj_base): New class.
4287 (class Sized_relobj): Derive from Sized_relobj_base.
4288 (class Sized_relobj::Symbols): Redeclare from base class.
4289 (class Sized_relobj::local_got_offset_list): Remove.
4290 (class Sized_relobj::Output_sections): Redeclare from base class.
4291 (class Sized_relobj::do_for_all_local_got_entries): New function.
4292 (class Sized_relobj::write_local_symbols): Add offset parameter.
4293 (class Sized_relobj::local_symbol_offset_): Update comment.
4294 (class Sized_relobj::local_dynsym_offset_): Update comment.
4295 * options.cc (Input_arguments::add_file): Remove const.
4296 * options.h (Input_file_argument::Input_file_argument):
4297 Initialize arg_serial_ (all constructors).
4298 (Input_file_argument::set_arg_serial): New function.
4299 (Input_file_argument::arg_serial): New function.
4300 (Input_file_argument::arg_serial_): New data member.
4301 (Input_arguments::Input_arguments): Initialize file_count_.
4302 (Input_arguments::add_file): Remove const.
4303 (Input_arguments::number_of_input_files): New function.
4304 (Input_arguments::file_count_): New data member.
4305 (Command_line::number_of_input_files): Call
4306 Input_arguments::number_of_input_files.
4307 * output.cc (Output_segment_headers::Output_segment_headers):
4308 Set current size.
4309 (Output_section::Input_section::current_data_size): New function.
4310 (Output_section::Output_section): Initialize new data members.
4311 (Output_section::add_input_section): Don't do merge sections for
4312 an incremental link; allocate space from free list for an
4313 incremental update.
4314 (Output_section::add_output_section_data): Allocate space from
4315 free list for an incremental update.
4316 (Output_section::update_data_size): New function.
4317 (Output_section::set_fixed_layout): New function.
4318 (Output_section::reserve): New function.
4319 (Output_segment::set_section_addresses): Remove const.
4320 (Output_segment::set_section_list_addresses): Remove const; allocate
4321 space from free list for an incremental update.
4322 (Output_segment::set_offset): Adjust size of RELRO segment for an
4323 incremental update.
4324 * output.h (Output_data::current_data_size): Move here from
4325 child classes.
4326 (Output_data::pre_finalize_data_size): New function.
4327 (Output_data::update_data_size): New function.
4328 (Output_section_headers::update_data_size): new function.
4329 (Output_section_data_build::current_data_size): Move to Output_data.
4330 (Output_data_strtab::update_data_size): New function.
4331 (Output_section::current_data_size): Move to Output_data.
4332 (Output_section::set_fixed_layout): New function.
4333 (Output_section::has_fixed_layout): New function.
4334 (Output_section::reserve): New function.
4335 (Output_section::update_data_size): New function.
4336 (Output_section::has_fixed_layout_): New data member.
4337 (Output_section::free_list_): New data member.
4338 (Output_segment::set_section_addresses): Remove const.
4339 (Output_segment::set_section_list_addresses): Remove const.
4340 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4341 New function.
4342 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4343 New function.
4344 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4345 parameter when calling Add_symbols constructor; store argument
4346 serial number for members of a lib group.
4347 (Add_symbols::locks): Allow case where token == NULL.
4348 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4349 (Read_member::~Read_member): New function.
4350 (Read_member::is_runnable): New function.
4351 (Read_member::locks): New function.
4352 (Read_member::run): New function.
4353 (Check_script::~Check_script): New function.
4354 (Check_script::is_runnable): New function.
4355 (Check_script::locks): New function.
4356 (Check_script::run): New function.
4357 (Check_library::~Check_library): New function.
4358 (Check_library::is_runnable): New function.
4359 (Check_library::locks): New function.
4360 (Check_library::run): New function.
4361 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4362 (Add_symbols::library_): New data member.
4363 (class Read_member): New class.
4364 (class Check_script): New class.
4365 (class Check_library): New class.
4366 * reloc.cc (Read_relocs::is_runnable): Allow case where
4367 token == NULL.
4368 (Read_relocs::locks): Likewise.
4369 (Scan_relocs::locks): Likewise.
4370 (Relocate_task::locks): Likewise.
4371 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4372 to clear counters.
4373 (Sized_relobj::incremental_relocs_scan): Fix comment.
4374 (Sized_relobj::do_relocate): Pass output file offset to
4375 write_local_symbols.
4376 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4377 from class declaration.
4378 * script.cc (read_input_script): Allocate Script_info; pass
4379 argument serial number to report_script.
4380 * script.h (class Script_info): Move to incremental.h.
4381 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4382 * symtab.h (Symbol_table::add_from_incrobj): New function.
4383 (Symbol_table::set_file_offset): New function.
4384
4385 2011-04-05 Cary Coutant <ccoutant@google.com>
4386
4387 * incremental-dump.cc (dump_incremental_inputs): Change signature
4388 to take a Sized_incremental_binary; change caller. Use readers
4389 in Sized_incremental_binary.
4390 * incremental.cc
4391 (Sized_incremental_binary::find_incremental_inputs_sections):
4392 Rename do_find_incremental_inputs_sections to this.
4393 (Sized_incremental_binary::setup_readers): New function.
4394 (Sized_incremental_binary::do_check_inputs): Check
4395 has_incremental_info_ flag; move setup code to setup_readers;
4396 use input readers.
4397 (Sized_incremental_binary::do_file_is_unchanged): New function.
4398 (Sized_incremental_binary::do_get_input_reader): New function.
4399 * incremental.h (class Incremental_binary): Move to end of file.
4400 (Incremental_binary::file_is_unchanged): New function.
4401 (Incremental_binary::do_file_is_unchanged): New function.
4402 (Incremental_binary::Input_reader): New class.
4403 (Incremental_binary::get_input_reader): New function.
4404 (class Sized_incremental_binary): Move to end of file.
4405 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4406 input section reader classes.
4407 (Sized_incremental_binary::has_incremental_info): New function.
4408 (Sized_incremental_binary::inputs_reader): New function.
4409 (Sized_incremental_binary::symtab_reader): New function.
4410 (Sized_incremental_binary::relocs_reader): New function.
4411 (Sized_incremental_binary::got_plt_reader): New function.
4412 (Sized_incremental_binary::do_file_is_unchanged): New function.
4413 (Sized_incremental_binary::Sized_input_reader): New class.
4414 (Sized_incremental_binary::get_input_reader): New function.
4415 (Sized_incremental_binary::find_incremental_inputs_sections):
4416 Rename do_find_incremental_inputs_sections to this.
4417 (Sized_incremental_binary::setup_readers): New function.
4418 (Sized_incremental_binary::has_incremental_info_): New data member.
4419 (Sized_incremental_binary::inputs_reader_): New data member.
4420 (Sized_incremental_binary::symtab_reader_): New data member.
4421 (Sized_incremental_binary::relocs_reader_): New data member.
4422 (Sized_incremental_binary::got_plt_reader_): New data member.
4423 (Sized_incremental_binary::current_input_file_): New data member.
4424
4425 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4426
4427 PR gold/12640
4428 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4429 violation.
4430
4431 2011-03-30 Cary Coutant <ccoutant@google.com>
4432
4433 * archive.cc (Archive::include_member): Adjust call to report_object.
4434 (Add_archive_symbols::run): Add script_info to call to
4435 report_archive_begin.
4436 (Lib_group::include_member): Adjust call to report_object.
4437 (Add_lib_group_symbols::run): Adjust call to report_object.
4438 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4439 blocks. Add object count for script input files.
4440 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4441 script_info parameter; change all callers.
4442 (Incremental_inputs::report_object): Add script_info parameter;
4443 change all callers.
4444 (Incremental_inputs::report_script): Store backpointer to
4445 incremental info entry.
4446 (Output_section_incremental_inputs::set_final_data_size): Record
4447 additional information for scripts.
4448 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4449 * incremental.h (Incremental_script_entry::add_object): New function.
4450 (Incremental_script_entry::get_object_count): New function.
4451 (Incremental_script_entry::get_object): New function.
4452 (Incremental_script_entry::objects_): New data member; adjust
4453 constructor.
4454 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4455 (Incremental_inputs::report_object): Add script_info parameter.
4456 (Incremental_inputs_reader::get_object_count): New function.
4457 (Incremental_inputs_reader::get_object_offset): New function.
4458 * options.cc (Input_arguments::add_file): Return reference to
4459 new input argument.
4460 * options.h (Input_argument::set_script_info): New function.
4461 (Input_argument::script_info): New function.
4462 (Input_argument::script_info_): New data member; adjust all
4463 constructors.
4464 (Input_file_group::add_file): Return reference to new input argument.
4465 (Input_file_lib::add_file): Likewise.
4466 (Input_arguments::add_file): Likewise.
4467 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4468 * script.cc (Parser_closure::Parser_closure): Add script_info
4469 parameter; adjust all callers.
4470 (Parser_closure::script_info): New function.
4471 (Parser_closure::script_info_): New data member.
4472 (read_input_script): Report scripts earlier to incremental info.
4473 (script_add_file): Set script_info in Input_argument.
4474 (script_add_library): Likewise.
4475 * script.h (Script_options::Script_info): Rewrite class.
4476
4477 2011-03-29 Cary Coutant <ccoutant@google.com>
4478
4479 * archive.cc (Library_base::should_include_member): Move
4480 method here from class Archive.
4481 (Archive::Archive): Initialize base class.
4482 (Archive::should_include_member): Move to base class.
4483 (Archive::do_for_all_unused_symbols): New function.
4484 (Add_archive_symbols::run): Remove redundant access to
4485 incremental_inputs.
4486 (Lib_group::Lib_group): Initialize base class.
4487 (Lib_group::do_filename): New function.
4488 (Lib_group::include_member): Pass pointer to Lib_group to
4489 report_object.
4490 (Lib_group::do_for_all_unused_symbols): New function.
4491 (Add_lib_group_symbols::run): Report archive information for
4492 incremental links.
4493 * archive.h (class Library_base): New base class.
4494 (class Archive): Derive from Library_base.
4495 (Archive::filename): Move to base class.
4496 (Archive::set_incremental_info): Likewise.
4497 (Archive::incremental_info): Likewise.
4498 (Archive::Should_include): Likewise.
4499 (Archive::should_include_member): Likewise.
4500 (Archive::Armap_entry): Remove.
4501 (Archive::Unused_symbol_iterator): Remove.
4502 (Archive::unused_symbols_begin): Remove.
4503 (Archive::unused_symbols_end): Remove.
4504 (Archive::do_filename): New function.
4505 (Archive::do_get_mtime): New function.
4506 (Archive::do_for_all_unused_symbols): New function.
4507 (Archive::task_): Move to base class.
4508 (Archive::incremental_info_): Likewise.
4509 (class Lib_group): Derive from Library_base.
4510 (Lib_group::do_filename): New function.
4511 (Lib_group::do_get_mtime): New function.
4512 (Lib_group::do_for_all_unused_symbols): New function.
4513 (Lib_group::task_): Move to base class.
4514 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4515 function.
4516 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4517 function.
4518 * incremental.cc (Incremental_inputs::report_archive_begin):
4519 Use Library_base; call library's get_mtime; add incremental inputs
4520 entry before members.
4521 (class Unused_symbol_visitor): New class.
4522 (Incremental_inputs::report_archive_end): Use Library_base; use
4523 visitor class to record unused symbols; don't add incremental inputs
4524 entry after members.
4525 (Incremental_inputs::report_object): Use Library_base.
4526 * incremental.h
4527 (Incremental_archive_entry::Incremental_archive_entry): Remove
4528 unused Archive parameter.
4529 (Incremental_inputs::report_archive_begin): Use Library_base.
4530 (Incremental_inputs::report_archive_end): Likewise.
4531 (Incremental_inputs::report_object): Likewise.
4532 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4533 function.
4534 * object.h (Object::for_all_global_symbols): New function.
4535 (Object::do_for_all_global_symbols): New function.
4536 (Sized_relobj::do_for_all_global_symbols): New function.
4537 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4538 function.
4539 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4540 function.
4541
4542 2011-03-27 Ian Lance Taylor <iant@google.com>
4543
4544 * archive.cc (Archive::interpret_header): Return -1 if something
4545 goes wrong. Change callers accordingly.
4546
4547 2011-03-25 Cary Coutant <ccoutant@google.com>
4548
4549 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4550 * testsuite/Makefile.in: Regenerate.
4551
4552 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
4553
4554 * plugin.cc (get_view): New.
4555 (Plugin::load): Pass get_view to the plugin.
4556 (Plugin_manager::get_view): New.
4557
4558 2011-03-21 Ian Lance Taylor <iant@google.com>
4559
4560 * testsuite/final_layout.sh: Rewrite to not use dc.
4561 * testsuite/relro_test.sh: Fail if dc is not present.
4562
4563 2011-03-21 Sriraman Tallam <tmsriram@google.com>
4564
4565 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4566 Change == to -eq.
4567 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4568 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4569 Change == to -eq.
4570 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4571 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4572
4573 2011-03-14 Ian Lance Taylor <iant@google.com>
4574
4575 * script-sections.cc (Sort_output_sections::script_compare):
4576 Rename from is_before, change return type.
4577 (Sort_output_sections::operator()): Adjust accordingly.
4578
4579 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4580
4581 PR gold/12572
4582 * testsuite/odr_violation2.cc: Add comment to make all error line
4583 numbers double digits.
4584 * testsuite/debug_msg.sh: Adjust expected errors.
4585
4586 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4587
4588 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4589 but mark earlier ones as non-canonical
4590 (offset_to_iterator): Update search target and example
4591 (do_addr2line): Return extra lines in a vector*
4592 (format_file_lineno): Extract from do_addr2line
4593 (one_addr2line): Add vector* out-param
4594 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4595 when a lineno entry appeared last for its instruction
4596 (Dwarf_line_info): Add vector* out-param
4597 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4598 * symtab.cc (Odr_violation_compare): Include the lineno in the
4599 comparison again.
4600 (linenos_from_loc): New. Combine the canonical line for an
4601 address with its other lines.
4602 (True_if_intersect): New. Helper functor to make
4603 std::set_intersection a query.
4604 (detect_odr_violations): Compare sets of lines instead of just
4605 one line for each function. This became less deterministic, but
4606 has fewer false positives.
4607 * symtab.h: Declarations.
4608 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4609 mix an optimized and non-optimized object in the same binary
4610 (odr_violation2.so): Same.
4611 * testsuite/Makefile.in: Regenerate from Makefile.am.
4612 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4613 * testsuite/debug_msg.sh: Update line numbers and add
4614 assertions.
4615 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4616 non-optimized context.
4617 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4618 isn't inlined, and use OdrDerived in an optimized context.
4619 * testsuite/odr_header1.h: Defines OdrDerived, where
4620 optimization will change the
4621 first-instruction-in-the-destructor's file and line number.
4622 * testsuite/odr_header2.h: Defines OdrBase.
4623
4624 2011-03-09 Ian Lance Taylor <iant@google.com>
4625
4626 * fileread.cc (File_read::clear_views): Don't delete the whole
4627 file view.
4628
4629 2011-03-08 Ian Lance Taylor <iant@google.com>
4630
4631 PR gold/12525
4632 * fileread.cc: #include <climits>.
4633 (GOLD_IOV_MAX): Define.
4634 (File_read::read_multiple): Limit number of entries by iov_max.
4635 * fileread.h (class File_read): Always set max_readv_entries to
4636 128.
4637
4638 2011-03-07 Ian Lance Taylor <iant@google.com>
4639
4640 PR gold/12525
4641 * options.h (class General_options): Add -dy and -dn.
4642
4643 2011-03-02 Cary Coutant <ccoutant@google.com>
4644
4645 * testsuite/script_test_9.t: Add TLS segment.
4646
4647 2011-03-02 Simon Baldwin <simonb@google.com>
4648
4649 * configure.ac: Add check for gnu_indirect_function support in
4650 the toolchain building binutils.
4651 * configure: Rebuild.
4652
4653 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
4654
4655 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4656 plugin only symbols.
4657 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4658 in plugin files as not needed in the symbol table.
4659
4660 2011-02-11 Sriraman Tallam <tmsriram@google.com>
4661
4662 * output.cc (Output_section::add_input_section): Delay fill
4663 generation for section ordering.
4664
4665 2011-02-09 Ian Lance Taylor <iant@google.com>
4666
4667 PR gold/12316
4668 * object.h (class Sized_relobj): Remove clear_local_symbols.
4669 * reloc.cc (Sized_relobj::do_relocate): Don't call
4670 clear_local_symbols.
4671
4672 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
4673
4674 * plugin.cc (is_visible_from_outside): Return true for symbols
4675 in the -u option.
4676
4677 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4678
4679 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4680 filename.
4681
4682 2011-02-02 Sriraman Tallam <tmsriram@google.com>
4683
4684 * icf.h (is_section_foldable_candidate): Change type of parameter
4685 to std::string.
4686 * icf.cc (Icf::find_identical_sections): Change type of local variable
4687 section_name to be std::string.
4688 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4689
4690 2011-01-25 Ian Lance Taylor <iant@google.com>
4691
4692 * script.cc (script_add_extern): Rewrite to use
4693 add_symbol_reference.
4694
4695 2011-01-25 Doug Kwan <dougkwan@google.com>
4696
4697 * icf.cc (get_section_contents): Always lock section's object.
4698
4699 2011-01-24 Ian Lance Taylor <iant@google.com>
4700
4701 * options.h (class General_options): Accept
4702 --no-detect-odr-violations.
4703
4704 2011-01-24 Ian Lance Taylor <iant@google.com>
4705
4706 * version.cc (version_string): Bump to 1.11.
4707
4708 2011-01-24 Ian Lance Taylor <iant@google.com>
4709
4710 * plugin.cc (class Plugin_rescan): Define new class.
4711 (Plugin_manager::claim_file): Set any_claimed_.
4712 (Plugin_manager::save_archive): New function.
4713 (Plugin_manager::save_input_group): New function.
4714 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4715 necessary.
4716 (Plugin_manager::new_undefined_symbol): New function.
4717 (Plugin_manager::rescan): New function.
4718 (Plugin_manager::rescannable_defines): New function.
4719 (Plugin_manager::add_input_file): Set any_added_.
4720 * plugin.h (class Plugin_manager): define new fields rescannable_,
4721 undefined_symbols_, any_claimed_, and any_added_. Declare
4722 Plugin_rescan as friend. Declare new functions.
4723 (Plugin_manager::Rescannable): Define type.
4724 (Plugin_manager::Rescannable_list): Define type.
4725 (Plugin_manager::Undefined_symbol_list): Define type.
4726 (Plugin_manager::Plugin_manager): Initialize new fields.
4727 * archive.cc (Archive::defines_symbol): New function.
4728 (Add_archive_symbols::run): Pass archive to plugins if any.
4729 * archive.h (class Archive): Declare defines_symbol.
4730 * readsyms.cc (Input_group::~Input_group): New function.
4731 (Finish_group::run): Pass input_group to plugins if any.
4732 * readsyms.h (class Input_group): Declare destructor.
4733 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4734 any.
4735
4736 2011-01-10 Ian Lance Taylor <iant@google.com>
4737
4738 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4739 section as relro.
4740 (Layout::set_segment_offsets): Reset increase_relro before calling
4741 set_section_addresses a second time.
4742
4743 2011-01-04 Cary Coutant <ccoutant@google.com>
4744
4745 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4746 sections before NOBITS sections.
4747
4748 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4749
4750 * version.cc (print_version): Update copyright to 2011.
4751
4752 2010-12-23 Cary Coutant <ccoutant@google.com>
4753
4754 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4755 of OS to this->add. Add OD parameter to second form of the function.
4756
4757 2010-12-20 Ian Lance Taylor <iant@google.com>
4758
4759 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4760 second of two consecutive entries with same offset.
4761
4762 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4763
4764 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4765 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4766 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4767 to avoid unneeded links against $(LDADD).
4768 * testsuite/Makefile.in: Regenerate.
4769
4770 2010-12-15 Ian Lance Taylor <iant@google.com>
4771
4772 PR gold/12324
4773 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4774 for R_X86_64_32 and R_X86_64_PC32.
4775 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4776 ver_matching_def_pic.o.
4777 (ver_matching_def_pic.o): New target.
4778
4779 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4780
4781 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4782 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4783 Move definition before File_read::View member definitions.
4784 (File_read::View::~View): Initialize and hold lock before
4785 updating current_mapped_bytes.
4786
4787 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4788
4789 * dwarf_reader.cc: Remove outdated comment.
4790 * gold-threads.cc: Fix typo in error message.
4791 * archive.cc: Fix typos in comments.
4792 * archive.h: Likewise.
4793 * arm-reloc-property.cc: Likewise.
4794 * arm-reloc-property.h: Likewise.
4795 * arm-reloc.def: Likewise.
4796 * arm.cc: Likewise.
4797 * attributes.h: Likewise.
4798 * cref.cc: Likewise.
4799 * ehframe.cc: Likewise.
4800 * fileread.h: Likewise.
4801 * gold.h: Likewise.
4802 * i386.cc: Likewise.
4803 * icf.cc: Likewise.
4804 * incremental.h: Likewise.
4805 * int_encoding.cc: Likewise.
4806 * layout.h: Likewise.
4807 * main.cc: Likewise.
4808 * merge.h: Likewise.
4809 * object.cc: Likewise.
4810 * object.h: Likewise.
4811 * options.cc: Likewise.
4812 * readsyms.cc: Likewise.
4813 * reduced_debug_output.cc: Likewise.
4814 * reloc.cc: Likewise.
4815 * script-sections.cc: Likewise.
4816 * sparc.cc: Likewise.
4817 * symtab.h: Likewise.
4818 * target-reloc.h: Likewise.
4819 * target.cc: Likewise.
4820 * target.h: Likewise.
4821 * timer.cc: Likewise.
4822 * timer.h: Likewise.
4823 * x86_64.cc: Likewise.
4824
4825 2010-12-09 Cary Coutant <ccoutant@google.com>
4826
4827 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4828 stack.
4829 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4830 parameter; change all callers.
4831 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4832 * options.h (warn_execstack): New option.
4833
4834 2010-12-07 Doug Kwan <dougkwan@google.com>
4835
4836 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4837 like function call relocations.
4838
4839 2010-12-07 Ian Lance Taylor <iant@google.com>
4840
4841 * archive.cc (Archive::get_elf_object_for_member): Permit
4842 punconfigured to be NULL.
4843 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4844 (Archive::include_member): Pass NULL to get_elf_object_for_member
4845 if we searched for the archive and this is the first included
4846 object.
4847
4848 2010-12-01 Ian Lance Taylor <iant@google.com>
4849
4850 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4851 track_relocs_type_ field.
4852 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4853 Set track_relocs_type_.
4854 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4855 contents when using RELA relocs.
4856 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4857 reloc_map_.
4858 * reloc.cc (Track_relocs::next_addend): New function.
4859 * reloc.h (class Track_relocs): Declare next_addend.
4860
4861 2010-12-01 Ian Lance Taylor <iant@google.com>
4862
4863 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4864 virtual destructor.
4865
4866 2010-12-01 Ian Lance Taylor <iant@google.com>
4867
4868 * README: Update compilers known to work and fail.
4869
4870 2010-11-23 Matthias Klose <doko@ubuntu.com>
4871
4872 * configure.in: For --enable-gold, handle value `default' instead of
4873 `both*'. Always install ld as ld.bfd, install as ld if gold is
4874 not the default.
4875 * configure: Regenerate.
4876
4877 2010-11-18 Doug Kwan <dougkwan@google.com>
4878
4879 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4880 and right_alignment to be zero. Store result alignment only if it is
4881 greater than existing alignment.
4882
4883 2010-11-16 Cary Coutant <ccoutant@google.com>
4884
4885 PR gold/12220
4886 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4887 Check for ".zdebug_line".
4888
4889 2010-11-16 Doug Kwan <dougkwan@google.com>
4890 Cary Coutant <ccoutant@google.com>
4891
4892 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4893 by reference; adjust all callers.
4894 * output.cc (Output_segment::set_section_addresses): Adjust references
4895 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4896 list is empty.
4897 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4898 end at page boundary.
4899
4900 2010-11-16 Cary Coutant <ccoutant@google.com>
4901
4902 PR gold/12220
4903 * layout.cc (Layout::choose_output_section): Transform names of
4904 compressed sections even when using a script with a SECTIONS clause.
4905 (Layout::output_section_name): Remove code to transform
4906 compressed debug section names.
4907 * output.cc (Output_section::add_input_section): Use uncompressed
4908 section size when tracking input sections.
4909
4910 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4911
4912 * symtab.h (Symbol::NON_PIC_REF): Remove.
4913 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4914 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4915 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4916 (Symbol::use_plt_offset): Take a flags argument and pass it
4917 directly to needs_dynamic_reloc. Restrict check for undefined
4918 weak symbols to function calls.
4919 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4920 (Target_arm::Scan::global): Use it.
4921 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4922 (Target_arm::Relocate::relocate): Likewise.
4923 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4924 parameter with an r_type parameter. Use get_reference_flags
4925 to get the flags.
4926 (Target_arm::Relocate::relocate): Update accordingly.
4927 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4928 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4929 (Target_i386::Scan::global): Likewise.
4930 (Target_i386::Relocate::relocate): Likewise.
4931 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4932 parameter with an r_type parameter. Use get_reference_flags
4933 to get the flags.
4934 (Target_i386::Relocate::relocate): Update accordingly.
4935 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4936 (Target_powerpc::Scan::global): Use it.
4937 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4938 (Target_powerpc::Relocate::relocate): Likewise.
4939 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4940 (Target_sparc::Scan::global): Use it.
4941 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4942 (Target_sparc::Relocate::relocate): Likewise.
4943 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4944 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4945 (Target_x86_64::Scan::global): Likewise.
4946 (Target_x86_64::Relocate::relocate): Likewise.
4947
4948 2010-11-08 Doug Kwan <dougkwan@google.com>
4949 Cary Coutant <ccoutant@google.com>
4950
4951 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4952 (Arm_exidx_merge_section::section_contents_): New data member.
4953 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4954 (Arm_input_section::~Arm_input_section): De-allocate memory.
4955 (Arm_input_section::original_contents_): New data member.
4956 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4957 in parameters instead of calling Object::section_contents without
4958 locking.
4959 (Arm_output_section::group_section): New parameter TASK. Pass it
4960 to callees that need locking objects.
4961 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4962 to lock EXIDX input sections. Fix a formatting issue. Call
4963 Arm_exidx_merged_section::build_contents to create merged section
4964 contents.
4965 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4966 to lock object of stub table owner.
4967 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4968 TEXT_SIZE to initialize data member TEXT_SIZE_.
4969 (Arm_exidx_input_section::addralign): Fix typo in comment.
4970 (Arm_exidx_input_section::text_size): New method.
4971 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4972 that require locking objects. Lock objects before scanning for stubs
4973 and updating local symbols.
4974 (Arm_input_section<big_endian>::init): Copy contents of original
4975 input section.
4976 (Arm_input_section<big_endian>::do_write): Use saved contents of
4977 original input section instead of calling Object::section_contents
4978 without locking.
4979 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4980 size without calling Object::section_size().
4981 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4982 for size. Allocate a buffer for merged EXIDX entries.
4983 (Arm_exidx_merged_section::build_contents): New method.
4984 (Arm_exidx_merged_section::do_write): Move merge section contents
4985 building code to Arm_exidx_merged_section::build_contetns. Write
4986 out contetns in buffer instead of building it on the fly.
4987 (Arm_relobj::make_exidx_input_section): Also pass text section size
4988 to Arm_exidx_input_section constructor.
4989 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4990 (Arm_dynobj::do_read_symbols): Fix memory leak.
4991 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4992 * target.h: (class Task): Add forward declaration.
4993 (Target::relax): Add new parameter TASK and pass it to
4994 Target::do_relax().
4995 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4996
4997 2010-11-05 Cary Coutant <ccoutant@google.com>
4998
4999 PR gold/10708
5000 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5001 object when reading from the file.
5002 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5003 second layout pass.
5004 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5005 when reading section contents.
5006 (get_section_contents): Likewise.
5007 (icf::find_identical_sections): Likewise.
5008 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5009 object when reading from the file.
5010 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5011 the object when doing deferred section layout.
5012
5013 2010-11-03 Nick Clifton <nickc@redhat.com>
5014
5015 PR gold/12001
5016 * script.h (class Symbol_assignment: name): New member. Returns
5017 the name of the symbol.
5018 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5019 Returns true if the given symbol name is on the list of
5020 assignments wating to be processed.
5021 * archive.cc (should_incldue_member): If the symbol is undefined,
5022 check to see if it is on the list of symbols pending assignment.
5023
5024 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5025
5026 * script-sections.cc (Script_sections::find_memory_region): Check
5027 for a NULL output section pointer.
5028
5029 2010-10-29 Doug Kwan <dougkwan@google.com>
5030
5031 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5032 Output_section::add_relaxed_input_section.
5033 * output.cc (Output_section::add_relaxed_input_section): Add new
5034 arguments LAYOUT and NAME. Set section order index.
5035 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5036 Copy section order index.
5037 * output.h (Output_section::add_relaxed_input_section): Add new
5038 arguments LAYOUT and NAME.
5039
5040 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5041
5042 * testsuite/Makefile.am: Move gcctestdir/ld rule to
5043 NATIVE_OR_CROSS_LINKER.
5044 * testsuite/Makefile.in: Regenerate.
5045
5046 2010-10-20 Doug Kwan <dougkwan@google.com>
5047
5048 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5049 without SHF_LINK_ORDER flags.
5050 * layout.cc (Layout::choose_output_section): Do not filter
5051 SHF_LINK_ORDER flag in a relocatable link.
5052
5053 2010-10-17 Cary Coutant <ccoutant@google.com>
5054
5055 * output.h (Output_segment::set_section_addresses): Change function
5056 signature. Update all callers.
5057 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5058 sections.
5059 (Output_segment::set_section_addresses): Align after last TLS
5060 section. Add padding before last relro section instead of after.
5061
5062 2010-10-17 Doug Kwan <dougkwan@google.com>
5063
5064 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5065 GOT output section to be writable.
5066
5067 2010-10-14 Cary Coutant <ccoutant@google.com>
5068
5069 * debug.h (DEBUG_INCREMENTAL): New flag.
5070 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5071 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5072 mode.
5073 * incremental.cc (report_command_line): Ignore all forms of
5074 --incremental.
5075 * layout.cc (Layout::Layout): Check parameters for incremental link
5076 mode.
5077 * options.cc (General_options::parse_incremental): New function.
5078 (General_options::parse_no_incremental): New function.
5079 (General_options::parse_incremental_full): New function.
5080 (General_options::parse_incremental_update): New function.
5081 (General_options::incremental_mode_): New data member.
5082 (General_options::finalize): Check incremental_mode_.
5083 * options.h (General_options): Update help text for --incremental.
5084 Add --no-incremental, --incremental-full, --incremental-update.
5085 (General_options::Incremental_mode): New enum type.
5086 (General_options::incremental_mode): New function.
5087 (General_options::incremental_mode_): New data member.
5088 * parameters.cc (Parameters::incremental_mode_): New data member.
5089 (Parameters::set_options): Set incremental_mode_.
5090 (Parameters::set_incremental_full): New function.
5091 (Parameters::incremental): New function.
5092 (Parameters::incremental_update): New function.
5093 (set_parameters_incremental_full): New function.
5094 * parameters.h (Parameters::set_incremental_full): New function.
5095 (Parameters::incremental): New function.
5096 (Parameters::incremental_update): New function.
5097 (Parameters::incremental_mode_): New data member.
5098 (set_parameters_incremental_full): New function.
5099 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5100 incremental link mode.
5101 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5102 (Sized_relobj::do_relocate_sections): Likewise.
5103 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5104 option.
5105 * testsuite/Makefile.in: Regenerate.
5106 * testsuite/incremental_test.sh: Filter all forms of --incremental.
5107
5108 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5109
5110 * script-sections.h (class Script_sections): Make
5111 Sections_elements typedef public.
5112 * script-sections.cc (class Sort_output_sections): Add elements_
5113 field. Add constructor which sets it; change all callers.
5114 (Sort_output_sections::is_before): New function.
5115 (Sort_output_sections::operator()): Call is_before.
5116 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5117 conditional.
5118 * testsuite/script_test_10.sh: New test. Test script section
5119 order.
5120 * testsuite/script_test_10.t: Likewise.
5121 * testsuite/script_test_10.s: Likewise.
5122 * testsuite/Makefile.am: Wrap the cross linker tests and the
5123 common tests into NATIVE_OR_CROSS_LINKER.
5124 (check_SCRIPTS): Add script_test_10.sh.
5125 (check_DATA): Add script_test_10.stdout.
5126 (script_test_10.o, script_test_10): New targets.
5127 (script_test_10.stdout): New target.
5128 * configure, testsuite/Makefile.in: Regenerate.
5129
5130 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5131
5132 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5133 error for the deprecated relocations.
5134 (Target_arm::Scan::global): Likewise.
5135 (Target_arm::Relocate::relocate): Likewise.
5136
5137 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5138
5139 * fileread.cc (Input_file::find_file): Initialize *found_name
5140 and *namep when using the fallback search for case 4.
5141
5142 2010-10-11 Cary Coutant <ccoutant@google.com>
5143
5144 * options.h (class General_options): Redefine -z lazy as an alias for
5145 the negation of -z now.
5146
5147 2010-10-11 Ian Lance Taylor <iant@google.com>
5148
5149 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5150 binding.
5151
5152 2010-10-06 Nick Clifton <nickc@redhat.com>
5153
5154 * script-sections.cc(class Memory_region): Remove
5155 current_lma_offset_ field. Rename current_vma_offset_ to
5156 current_offset_. Add last_section_ field.
5157 (Memory_region::get_current_vma_address): Rename to
5158 get_current_address.
5159 (Memory_region::get_current_lma_address): Delete.
5160 (Memory_region::increment_vma_offset): Rename to
5161 increment_offset.
5162 (Memory_region::increment_lma_offset): Delete.
5163 (Memory_region::attributes_compatible): New method. Returns
5164 true if the provided section is compatible with the region.
5165 (Memory_region::get_last_section): New method. Returns the last
5166 section to use the region.
5167 (Memory_region::set_last_section): New method. Stores the last
5168 section to use the region.
5169 (Script_sections::block_in_region): New method. Returns true if
5170 a block of memory is contained within a region.
5171 (Script_sections::find_memory_region): New method. Locates a
5172 memory region to be used to set a VMA or LMA address.
5173 (Output_section_definition::set_section_addresses): Add code to
5174 check for addresses set by memory regions.
5175 (Output_segment::set_section_addresses): Remove memory region
5176 walking code.
5177 (Script_sections::create_segment): Add a warning if a header
5178 segment is created outside of any region.
5179 * script-sections.h (class Script_sections): Add prototypes for
5180 find_memory_region and block_in_region methods.
5181 * testsuite/memory_test.s: Use .long instead of .word.
5182 * testsuite/memory_test.t: Add some more output sections.
5183 * testsuite/memory_test.sh: Update expected output.
5184
5185 2010-10-02 Doug Kwan <dougkwan@google.com>
5186
5187 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5188 defintion to symtab.h
5189 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5190 declaration to defintion.
5191
5192 2010-10-01 Nick Clifton <nickc@redhat.com>
5193
5194 * expression.cc (eval): Replace dummy argument with NULL.
5195 (eval_maybe_dot): Check for a NULL result section pointer.
5196 (Symbol_expression::value): Likewise.
5197 (Dot_expression::value): Likewise.
5198 (BINARY_EXPRESSION): Likewise.
5199 (Max_expression::value): Likewise.
5200 (Min_expression::value): Likewise.
5201 (Absolute_expression::value): Likewise.
5202 (Addr_expression::value_from_output_section): Likewise.
5203 (Loaddddr_expression::value_from_output_section): Likewise.
5204 (Segment_start_expression::value): Likewise.
5205 * script-sections.cc
5206 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5207 argument with NULL.
5208 (Sections_elememt_dot_assignment::set_section_addresses):
5209 Likewise.
5210 (Output_data_expression::do_write_to_buffer): Likewise.
5211 (Output_section_definition::finalize_symbols): Likewise.
5212 (Output_section_definition::set_section_addresses): Likewise.
5213
5214 2010-09-30 Doug Kwan <dougkwan@google.com>
5215
5216 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5217
5218 2010-09-28 Sriraman Tallam <tmsriram@google.com>
5219
5220 * target.h (Target::can_icf_inline_merge_sections): New virtual
5221 function.
5222 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5223 virtual function.
5224 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5225 virtual function.
5226 * icf.cc (get_section_contents): Inline merge sections only when
5227 target allows it.
5228
5229 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5230
5231 * configure: Regenerate.
5232
5233 2010-09-17 Ian Lance Taylor <iant@google.com>
5234
5235 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
5236 * testsuite/Makefile.am (memory_test.o): New target.
5237 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5238 memory_test.t.
5239 * testsuite/Makefile.in: Rebuild.
5240
5241 2010-09-17 Doug Kwan <dougkwan@google.com>
5242
5243 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5244 defintion if relocation uses GOT entries of the symbol.
5245 * testsuite/icf_safe_test.sh: Fix test.
5246 * testsuite/icf_safe_so_test.sh: Fix test.
5247
5248 2010-09-16 Cary Coutant <ccoutant@google.com>
5249
5250 * script_sections.cc (class Memory_region): Remove "NULL" from
5251 vector initializations.
5252
5253 2010-09-15 Cary Coutant <ccoutant@google.com>
5254
5255 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5256 Resolve forwarding symbols.
5257
5258 2010-09-15 Doug Kwan <dougkwan@google.com>
5259
5260 * gold/testsuite/script_test_3.t: Add ARM special sections.
5261 * gold/testsuite/script_test_4.t: Same.
5262 * gold/testsuite/script_test_5.t: Same.
5263 * gold/testsuite/script_test_6.t: Same.
5264 * gold/testsuite/script_test_7.t: Same.
5265 * gold/testsuite/script_test_7.t: Same.
5266 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5267
5268 2010-09-14 Cary Coutant <ccoutant@google.com>
5269
5270 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5271 (Target_x86_64::Relocate::relocate_tls): Replace check for
5272 saw_tls_block_reloc_ with test for executable section.
5273
5274 2010-09-12 Cary Coutant <ccoutant@google.com>
5275
5276 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5277 position-independent executables to shared libraries need dynamic
5278 relocations.
5279 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5280 position-independent executables.
5281 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5282 * testsuite/Makefile.in: Regenerate.
5283
5284 2010-09-10 Nick Clifton <nickc@redhat.com>
5285
5286 PR gold/11997
5287 * testsuite/memory_test.t: Discard any sections that are not
5288 needed.
5289
5290 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5291
5292 PR gold/11996
5293 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5294 "This::" to work around a bug in gcc 4.2.
5295
5296 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5297
5298 2010-09-09 Rafael Espindola <espindola@google.com>
5299
5300 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5301 sections with different PF_X flags in the same segment.
5302 (Layout::find_first_load_seg): Search all segments to find the first
5303 one.
5304 * options.h (rosegment): New.
5305
5306 2010-09-08 Rafael Espindola <espindola@google.com>
5307
5308 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
5309
5310 2010-09-08 Doug Kwan <dougkwan@google.com>
5311
5312 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5313 (Arm_relobj::do_relocate_sections): Add new parameter for output
5314 file to match the parent.
5315 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5316 of local symbols instead of input values. Update code to track
5317 changes in gold::relocate_section.
5318 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5319 (Sized_relobj::compute_final_local_value_internal): New methods.
5320 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5321 body into private version of Sized_relobj::compute_final_local_value.
5322 Call the inline method.
5323 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5324 merged symbol value if there is one.
5325 (Symbol_value::has_output_value): New method defintiion.
5326 (Sized_relobj::Compute_final_local_value_status): New enum type.
5327 (Sized_relobj::compute_final_local_value): New methods.
5328 (Sized_relobj::compute_final_local_value_internal): New methods.
5329 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5330 and arm_cortex_a8.sh.
5331 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5332 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5333 New tests.
5334 * Makefile.in: Regenerate.
5335 * testsuite/arm_bl_out_of_range.s: Update test.
5336 * testsuite/thumb_bl_out_of_range.s: Ditto.
5337 * testsuite/thumb_blx_out_of_range.s: Ditto.
5338 * testsuite/arm_branch_out_of_range.sh: New file.
5339 * testsuite/arm_cortex_a8.sh: Ditto.
5340 * testsuite/arm_cortex_a8_b.s: Ditto.
5341 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5342 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5343 * testsuite/arm_cortex_a8_bl.s: Ditto.
5344 * testsuite/arm_cortex_a8_blx.s: Ditto.
5345 * testsuite/arm_cortex_a8_local.s: Ditto.
5346 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5347 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5348
5349 2010-09-08 Rafael Espindola <espindola@google.com>
5350
5351 * Makefile.am (memory_test.stdout): Run readelf with -W.
5352 * Makefile.in: Regenerate.
5353 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5354 64 bit output.
5355
5356 2010-09-08 Rafael Espindola <espindola@google.com>
5357
5358 * script-sections.cc (Script_sections::add_memory_region): Convert
5359 field precision to int.
5360 * script.cc (script_set_section_region, script_set_section_region):
5361 Convert field precision to int.
5362
5363 2010-09-08 Rafael Espindola <espindola@google.com>
5364
5365 * arm.cc (do_finalize_sections): Create the __exidx_start and
5366 __exdix_end symbols even when the section is missing.
5367
5368 2010-09-08 Nick Clifton <nickc@redhat.com>
5369
5370 * README: Remove claim that MEMORY is not supported.
5371 * expression.cc (script_exp_function_origin)
5372 (script_exp_function_length): Move from here to ...
5373 * script.cc: ... here.
5374 (script_set_section_region, script_add_memory)
5375 (script_parse_memory_attr, script_include_directive): New
5376 functions.
5377 * script-sections.cc
5378 (class Memory_region): New class.
5379 (class Output_section_definition): Add set_memory_region,
5380 set_section_vma, set_section_lma and get_section_name methods.
5381 (class Script_Sections): Add add_memory_region,
5382 find_memory_region, find_memory_region_origin,
5383 find_memory_region_length and set_memory_region methods.
5384 Have set_section_addresses method walk the list of set memory
5385 regions.
5386 Extend the print methos to display memory regions.
5387 * script-sections.h: Add prototypes for new methods.
5388 Add enum for MEMORY region attributes.
5389 * yyscript.y: Add support for parsing MEMORY regions.
5390 * script-c.h: Add prototypes for new functions.
5391 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5392 * testsuite/Makefile.in: Regenerate.
5393 * testsuite/memory_test.sh: New script.
5394 * testsuite/memory_test.s: New assembler source file.
5395 * testsuite/memory_test.t: New linker script.
5396
5397 2010-08-27 Doug Kwan <dougkwan@google.com>
5398
5399 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5400 reference override an existing dynamic weak reference.
5401 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5402 * testsuite/Makefile.in: Regenerate.
5403 * testsuite/dyn_weak_ref.sh: New file.
5404 * testsuite/dyn_weak_ref_1.c: Ditto.
5405 * testsuite/dyn_weak_ref_2.c: Ditto.
5406
5407 2010-08-27 Ian Lance Taylor <iant@google.com>
5408
5409 * incremental.h (class Incremental_input_entry): Add virtual
5410 destructor.
5411
5412 2010-08-27 Ian Lance Taylor <iant@google.com>
5413
5414 * testsuite/start_lib_test_3.c: Mark t3 as used.
5415
5416 2010-08-27 Nick Clifton <nickc@redhat.com>
5417
5418 * options.cc (version_script): Fix small typo in previous
5419 whitespace tidyup.
5420
5421 2010-08-25 Nick Clifton <nickc@redhat.com>
5422
5423 * archive.cc: Formatting fixes: Remove whitespace between
5424 typename and following asterisk. Remove whitespace between
5425 function name and opening parenthesis.
5426 * archive.h: Likewise.
5427 * arm.cc: Likewise.
5428 * attributes.cc: Likewise.
5429 * attributes.h: Likewise.
5430 * common.cc: Likewise.
5431 * copy-relocs.cc: Likewise.
5432 * dirsearch.h: Likewise.
5433 * dynobj.cc: Likewise.
5434 * ehframe.cc: Likewise.
5435 * ehframe.h: Likewise.
5436 * expression.cc: Likewise.
5437 * fileread.cc: Likewise.
5438 * fileread.h: Likewise.
5439 * gc.h: Likewise.
5440 * gold-threads.cc: Likewise.
5441 * gold.cc: Likewise.
5442 * i386.cc: Likewise.
5443 * icf.h: Likewise.
5444 * incremental-dump.cc: Likewise.
5445 * incremental.cc: Likewise.
5446 * layout.cc: Likewise.
5447 * layout.h: Likewise.
5448 * main.cc: Likewise.
5449 * merge.cc: Likewise.
5450 * merge.h: Likewise.
5451 * object.cc: Likewise.
5452 * object.h: Likewise.
5453 * options.cc: Likewise.
5454 * options.h: Likewise.
5455 * output.cc: Likewise.
5456 * output.h: Likewise.
5457 * plugin.cc: Likewise.
5458 * plugin.h: Likewise.
5459 * powerpc.cc: Likewise.
5460 * reloc.cc: Likewise.
5461 * script-c.h: Likewise.
5462 * script-sections.cc: Likewise.
5463 * script.cc: Likewise.
5464 * stringpool.cc: Likewise.
5465 * symtab.cc: Likewise.
5466 * symtab.h: Likewise.
5467 * target.cc: Likewise.
5468 * timer.cc: Likewise.
5469 * timer.h: Likewise.
5470 * version.cc: Likewise.
5471 * x86_64.cc: Likewise.
5472
5473 2010-08-24 Nick Clifton <nickc@redhat.com>
5474
5475 PR 11899
5476 * layout.cc (segment_precedes): Sort segments by their physical
5477 addresses, if they have been set.
5478
5479 2010-08-23 Cary Coutant <ccoutant@google.com>
5480
5481 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5482 symbols data.
5483 (Lib_group::include_member): Unlock object after deleting its
5484 symbols data.
5485 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5486 the bug fixed here.
5487
5488 2010-08-19 Neil Vachharajani <nvachhar@google.com>
5489 Cary Coutant <ccoutant@google.com>
5490
5491 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5492 constructor, and set_blocker.
5493 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5494 readsyms_blocker_.
5495 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5496 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5497 * testsuite/Makefile.am (start_lib_test): New test case.
5498 * testsuite/Makefile.in: Regenerate.
5499 * testsuite/start_lib_test_main.c: New file.
5500 * testsuite/start_lib_test_1.c: New file.
5501 * testsuite/start_lib_test_2.c: New file.
5502 * testsuite/start_lib_test_3.c: New file.
5503
5504 2010-08-19 Ian Lance Taylor <iant@google.com>
5505
5506 * Makefile.in: Rebuild with automake 1.11.1.
5507 * aclocal.m4: Likewise.
5508 * testsuite/Makefile.in: Likewise.
5509
5510 2010-08-19 Ian Lance Taylor <iant@google.com>
5511
5512 PR 10893
5513 * i386.cc (class Output_data_plt_i386): Update declarations.
5514 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5515 local_ifuncs_ fields.
5516 (Target_i386::do_plt_section_for_global): New function.
5517 (Target_i386::do_plt_section_for_local): New function.
5518 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5519 parameter; change all callers. Initialize global_ifuncs_ and
5520 local_ifuncs_. If doing a static link define __rel_iplt_start and
5521 __rel_iplt_end.
5522 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5523 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5524 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5525 symbols.
5526 (Target_i386::make_plt_section): New function, broken out of
5527 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5528 (Target_i386::make_plt_entry): Call make_plt_section.
5529 (Target_i386::make_local_ifunc_plt_entry): New function.
5530 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5531 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5532 R_386_IRELATIVE to switch.
5533 (Target_i386::Scan::global): Likewise.
5534 (Target_i386::Relocate::relocate): Likewise.
5535 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5536 switch.
5537 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5538 (Target_x86_64::do_plt_section_for_global): New function.
5539 (Target_x86_64::do_plt_section_for_local): New function.
5540 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5541 parameter; change all callers. If doing a static link define
5542 __rela_iplt_start and __rela_iplt_end.
5543 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5544 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5545 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5546 to point to .plt.
5547 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5548 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5549 switch.
5550 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5551 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5552 R_X86_64_IRELATIVE to switch.
5553 (Target_x86_64::Scan::global): Likewise.
5554 (Target_x86_64::Relocate::relocate): Likewise.
5555 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5556 switch.
5557 * target.h (class Target): Add plt_section_for_global and
5558 plt_section_for_local functions. Add do_plt_section_for_global
5559 and do_plt_section_for_local virtual functions.
5560 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5561 clarifying comments.
5562 (Symbol::use_plt_offset): Handle IFUNC symbol.
5563 * object.cc (Sized_relobj::Sized_relobj): Initialize
5564 local_plt_offsets_.
5565 (Sized_relobj::local_has_plt_offset): New function.
5566 (Sized_relobj::local_plt_offset): New function.
5567 (Sized_relobj::set_local_plt_offset): New function.
5568 (Sized_relobj::do_count): Handle IFUNC symbol.
5569 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5570 a bit away from input_shndx_ field. Add set_is_func_symbol and
5571 is_ifunc_symbol functions.
5572 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5573 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5574 local_plt_offsets_ field.
5575 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5576 * output.h (class Output_section_data): Add non-const
5577 output_section function.
5578 (class Output_data_got): Update declarations.
5579 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5580 Add use_plt_offset parameter to global and local constructors.
5581 Change all callers. Change local_sym_index_ field to 31 bits.
5582 Change GSYM_CODE and CONSTANT_CODE accordingly.
5583 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5584 doing a static link don't set sh_link field.
5585 (Output_data_got::Got_entry::write): Use PLT offset if
5586 appropriate.
5587 (Output_data_got::add_global_plt): New function.
5588 (Output_data_got::add_local_plt): New function.
5589 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5590 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5591 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5592 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5593 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5594 IFUNC conditional.
5595 * testsuite/ifunc-sel.h: New file.
5596 * testsuite/ifuncmain1.c: New file.
5597 * testsuite/ifuncmain1vis.c: New file.
5598 * testsuite/ifuncmod1.c: New file.
5599 * testsuite/ifuncdep2.c: New file.
5600 * testsuite/ifuncmain2.c: New file.
5601 * testsuite/ifuncmain3.c: New file.
5602 * testsuite/ifuncmod3.c: New file.
5603 * testsuite/ifuncmain4.c: New file.
5604 * testsuite/ifuncmain5.c: New file.
5605 * testsuite/ifuncmod5.c: New file.
5606 * testsuite/ifuncmain6pie.c: New file.
5607 * testsuite/ifuncmod6.c: New file.
5608 * testsuite/ifuncmain7.c: New file.
5609 * configure, testsuite/Makefile.in: Rebuild.
5610
5611 2010-08-18 Ian Lance Taylor <iant@google.com>
5612
5613 * incremental.cc
5614 (Output_section_incremental_inputs::write_input_files): Add cast
5615 to avoid signed/unsigned comparison warning.
5616 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5617
5618 2010-08-12 Cary Coutant <ccoutant@google.com>
5619
5620 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5621
5622 2010-08-13 Ian Lance Taylor <iant@google.com>
5623
5624 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5625
5626 2010-08-12 Cary Coutant <ccoutant@google.com>
5627 Doug Kwan <dougkwan@google.com>
5628
5629 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5630 defintion overrides non-weak undef, remember that the original undef
5631 is not weak.
5632 * symtab.cc (Symbol_table::sized_write_global): For undef without
5633 an original weak binding, set binding to global in output.
5634 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5635 * testsuite/Makefile.in: Regenerate.
5636 * testsuite/strong_ref_weak_def.sh: New file.
5637 * testsuite/strong_ref_weak_def_1.c: Ditto.
5638 * testsuite/strong_ref_weak_def_2.c: Ditto.
5639
5640 2010-08-12 Cary Coutant <ccoutant@google.com>
5641
5642 * testsuite/incremental_test.sh: Rewrite.
5643 * testsuite/incremental_test_1.c: Rewrite.
5644 * testsuite/incremental_test_2.c: Rewrite.
5645
5646 2010-08-12 Cary Coutant <ccoutant@google.com>
5647
5648 * arm.cc (Target_arm::got_size): Add const.
5649 (Target_arm::got_entry_count): New function.
5650 (Target_arm::plt_entry_count): New function.
5651 (Target_arm::first_plt_entry_offset): New function.
5652 (Target_arm::plt_entry_size): New function.
5653 (Output_data_plt_arm::entry_count): New function.
5654 (Output_data_plt_arm::first_plt_entry_offset): New function.
5655 (Output_data_plt_arm::get_plt_entry_size): New function.
5656 * i386.cc (Target_i386::got_size): Add const.
5657 (Target_i386::got_entry_count): New function.
5658 (Target_i386::plt_entry_count): New function.
5659 (Target_i386::first_plt_entry_offset): New function.
5660 (Target_i386::plt_entry_size): New function.
5661 (Output_data_plt_i386::entry_count): New function.
5662 (Output_data_plt_i386::first_plt_entry_offset): New function.
5663 (Output_data_plt_i386::get_plt_entry_size): New function.
5664 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5665 find_incremental_inputs_sections. Dump incremental_got_plt section.
5666 * incremental.cc: Include target.h.
5667 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5668 parameter. Adjust all callers. Find incremental_got_plt section.
5669 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5670 section.
5671 (Output_section_incremental_inputs::set_final_data_size): Calculate
5672 size of incremental_got_plt section.
5673 (Output_section_incremental_inputs::do_write): Write the
5674 incremental_got_plt section.
5675 (Got_plt_view_info): New struct.
5676 (Local_got_offset_visitor): New class.
5677 (Global_got_offset_visitor): New class.
5678 (Global_symbol_visitor_got_plt): New class.
5679 (Output_section_incremental_inputs::write_got_plt): New function.
5680 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5681 Add parameter. Adjust all callers.
5682 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5683 (Incremental_inputs::got_plt_section): New function.
5684 (Incremental_inputs::got_plt_section_): New data member.
5685 (Incremental_got_plt_reader): New class.
5686 * layout.cc (Layout::create_incremental_info_sections): Add the
5687 incremental_got_plt section.
5688 * object.h (Got_offset_list::get_list): New function.
5689 (Got offset_list::for_all_got_offsets): New function.
5690 (Sized_relobj::local_got_offset_list): New function.
5691 * powerpc.cc (Target_powerpc::got_size): Add const.
5692 (Target_powerpc::got_entry_count): New function.
5693 (Target_powerpc::plt_entry_count): New function.
5694 (Target_powerpc::first_plt_entry_offset): New function.
5695 (Target_powerpc::plt_entry_size): New function.
5696 (Output_data_plt_powerpc::entry_count): New function.
5697 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5698 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5699 * sparc.cc (Target_sparc::got_size): Add const.
5700 (Target_sparc::got_entry_count): New function.
5701 (Target_sparc::plt_entry_count): New function.
5702 (Target_sparc::first_plt_entry_offset): New function.
5703 (Target_sparc::plt_entry_size): New function.
5704 (Output_data_plt_sparc::entry_count): New function.
5705 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5706 (Output_data_plt_sparc::get_plt_entry_size): New function.
5707 * symtab.h (Symbol::got_offset_list): New function.
5708 (Symbol_table::for_all_symbols): New function.
5709 * target.h (Sized_target::got_entry_count): New function.
5710 (Sized_target::plt_entry_count): New function.
5711 (Sized_target::plt_entry_size): New function.
5712 * x86_64.cc (Target_x86_64::got_size): Add const.
5713 (Target_x86_64::got_entry_count): New function.
5714 (Target_x86_64::plt_entry_count): New function.
5715 (Target_x86_64::first_plt_entry_offset): New function.
5716 (Target_x86_64::plt_entry_size): New function.
5717 (Output_data_plt_x86_64::entry_count): New function.
5718 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5719 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5720
5721 2010-08-12 Cary Coutant <ccoutant@google.com>
5722
5723 * archive.cc: Include incremental.h.
5724 (Archive::Archive): Initialize incremental_info_.
5725 (Archive::include_member): Record archive members in incremental info.
5726 (Add_archive_symbols::run): Record begin and end of an archive in
5727 incremental info.
5728 (Lib_group::include_member): Record objects in incremental info.
5729 * archive.h (Incremental_archive_entry): Forward declaration.
5730 (Archive::set_incremental_info): New member function.
5731 (Archive::incremental_info): New member function.
5732 (Archive::Unused_symbol_iterator): New class.
5733 (Archive::unused_symbols_begin): New member function.
5734 (Archive::unused_symbols_end): New member function.
5735 (Archive::incremental_info_): New data member.
5736 * incremental-dump.cc (find_input_containing_global): New function.
5737 (dump_incremental_inputs): Dump new incremental info sections.
5738 * incremental.cc: Include symtab.h.
5739 (Output_section_incremental_inputs): New class.
5740 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5741 new incremental info sections.
5742 (Sized_incremental_binary::do_check_inputs): Likewise.
5743 (Incremental_inputs::report_archive): Remove.
5744 (Incremental_inputs::report_archive_begin): New function.
5745 (Incremental_inputs::report_archive_end): New function.
5746 (Incremental_inputs::report_object): New function.
5747 (Incremental_inputs::finalize_inputs): Remove.
5748 (Incremental_inputs::report_input_section): New function.
5749 (Incremental_inputs::report_script): Rewrite.
5750 (Incremental_inputs::finalize): Do nothing but finalize string table.
5751 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5752 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5753 (Incremental_inputs::create_data_sections): New function.
5754 (Incremental_inputs::relocs_entsize): New function.
5755 (Output_section_incremental_inputs::set_final_data_size): New function.
5756 (Output_section_incremental_inputs::do_write): New function.
5757 (Output_section_incremental_inputs::write_header): New function.
5758 (Output_section_incremental_inputs::write_input_files): New function.
5759 (Output_section_incremental_inputs::write_info_blocks): New function.
5760 (Output_section_incremental_inputs::write_symtab): New function.
5761 * incremental.h (Incremental_script_entry): Forward declaration.
5762 (Incremental_object_entry): Forward declaration.
5763 (Incremental_archive_entry): Forward declaration.
5764 (Incremental_inputs): Forward declaration.
5765 (Incremental_inputs_header_data): Remove.
5766 (Incremental_inputs_header): Remove.
5767 (Incremental_inputs_header_write): Remove.
5768 (Incremental_inputs_entry_data): Remove.
5769 (Incremental_inputs_entry): Remove.
5770 (Incremental_inputs_entry_write): Remove.
5771 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5772 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5773 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5774 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5775 Likewise.
5776 (Incremental_input_entry): New class.
5777 (Incremental_script_entry): New class.
5778 (Incremental_object_entry): New class.
5779 (Incremental_archive_entry): New class.
5780 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5781 (Incremental_inputs::report_inputs): Remove.
5782 (Incremental_inputs::report_archive): Remove.
5783 (Incremental_inputs::report_archive_begin): New function.
5784 (Incremental_inputs::report_archive_end): New function.
5785 (Incremental_inputs::report_object): Change prototype.
5786 (Incremental_inputs::report_input_section): New function.
5787 (Incremental_inputs::report_script): Change prototype.
5788 (Incremental_inputs::get_reloc_count): New function.
5789 (Incremental_inputs::set_reloc_count): New function.
5790 (Incremental_inputs::create_data_sections): New function.
5791 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5792 (Incremental_inputs::inputs_section): New function.
5793 (Incremental_inputs::symtab_section): New function.
5794 (Incremental_inputs::relocs_section): New function.
5795 (Incremental_inputs::get_stringpool): Add const.
5796 (Incremental_inputs::command_line): Add const.
5797 (Incremental_inputs::inputs): Remove.
5798 (Incremental_inputs::command_line_key): New function.
5799 (Incremental_inputs::input_file_count): New function.
5800 (Incremental_inputs::input_files): New function.
5801 (Incremental_inputs::relocs_entsize): New function.
5802 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5803 (Incremental_inputs::finalize_inputs): Remove.
5804 (Incremental_inputs::Input_info): Remove.
5805 (Incremental_inputs::lock_): Remove.
5806 (Incremental_inputs::inputs_): Change type.
5807 (Incremental_inputs::inputs_map_): Remove.
5808 (Incremental_inputs::current_object_entry_): New data member.
5809 (Incremental_inputs::inputs_section_): New data member.
5810 (Incremental_inputs::symtab_section_): New data member.
5811 (Incremental_inputs::relocs_section_): New data member.
5812 (Incremental_inputs::reloc_count_): New data member.
5813 (Incremental_inputs_reader): New class.
5814 (Incremental_symtab_reader): New class.
5815 (Incremental_relocs_reader): New class.
5816 * layout.cc (Layout::finalize): Move finalization of incremental info
5817 and creation of incremental info sections to follow finalization of
5818 symbol table. Set offsets for postprocessing sections.
5819 (Layout::create_incremental_info_sections): Call
5820 Incremental_inputs::create_data_sections. Add incremental symtab
5821 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5822 sections to layout after input sections.
5823 * layout.h (struct Timespec): Forward declaration.
5824 (Layout::incremental_inputs): Add const.
5825 (Layout::create_incremental_info_sections): Add parameter.
5826 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5827 * object.cc: Include incremental.h.
5828 (Relobj::finalize_incremental_relocs): New function.
5829 (Sized_relobj::do_layout): Record input sections in incremental info.
5830 * object.h (Object::output_section): New function.
5831 (Object::output_section_offset): Moved from Relobj.
5832 (Object::get_incremental_reloc_base): New function.
5833 (Object::get_incremental_reloc_count): New function.
5834 (Object::do_output_section): New function.
5835 (Object::do_output_section_offset): Moved from Relobj.
5836 (Object::do_get_incremental_reloc_base): New function.
5837 (Object::do_get_incremental_reloc_count): New function.
5838 (Object::Object): Initialize new data members.
5839 (Relobj::output_section): Renamed do_output_section and moved to
5840 protected.
5841 (Relobj::output_section_offset): Moved to Object.
5842 (Relobj::do_get_incremental_reloc_base): New function.
5843 (Relobj::do_get_incremental_reloc_count): New function.
5844 (Relobj::allocate_incremental_reloc_counts): New function.
5845 (Relobj::count_incremental_reloc): New function.
5846 (Relobj::finalize_incremental_relocs): New function.
5847 (Relobj::next_incremental_reloc_index): New function.
5848 (Relobj::reloc_counts_): New data member.
5849 (Relobj::reloc_bases_): New data member.
5850 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5851 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5852 (Sized_relobj::incremental_relocs_scan): New function.
5853 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5854 (Sized_relobj::incremental_relocs_write): New function.
5855 (Sized_relobj::incremental_relocs_write_reltype): New function.
5856 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5857 incremental link.
5858 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5859 archives and object files elsewhere.
5860 (Add_symbols::run): Report object files here.
5861 (Finish_group::run): Report end of archive at end of group.
5862 * reloc.cc: Include layout.h, incremental.h.
5863 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5864 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5865 (Sized_relobj::incremental_relocs_scan): New function.
5866 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5867 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5868 (Sized_relobj::incremental_relocs_write): New function.
5869 (Sized_relobj::incremental_relocs_write_reltype): New function.
5870 * script.cc (read_input_script): Rewrite test for incremental link.
5871 Change call to Incremental_inputs::report_script.
5872 * symtab.h (Symbol_table::first_global_index): New function.
5873 (Symbol_table::output_count): New function.
5874
5875 2010-08-12 Doug Kwan <dougkwan@google.com>
5876
5877 * arm.cc (Target_arm::merge_object_attributes): Check command line
5878 options --no-wchar-size-warning and --no-enum-size-warning.
5879 * options.h (General_options): Add ld-compatible options
5880 --no-enum-size-warning and --no-wchar-size-warning.
5881
5882 2010-08-04 Ian Lance Taylor <iant@google.com>
5883
5884 * x86_64.cc (Target_x86_64::Scan::local): Use
5885 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5886 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5887 (Target_x86_64::Scan::global): Likewise.
5888 (Target_x86_64::Relocate::relocate): Likewise.
5889 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5890 Likewise.
5891
5892 2010-08-03 Cary Coutant <ccoutant@google.com>
5893
5894 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5895 to reserve space in merged_strings vector. Keep total input size
5896 for stats.
5897 (Output_merge_string::do_print_merge_stats): Print total input size.
5898 * merge.h (Output_merge_string): Add input_size_ field.
5899 * stringpool.cc (Stringpool_template::string_length): Move
5900 implementations out of Stringpool_template class and place in
5901 stringpool.h.
5902 * stringpool.h (string_length): Move out of Stringpool_template.
5903
5904 2010-08-03 Ian Lance Taylor <iant@google.com>
5905
5906 PR 11712
5907 * layout.cc (relaxation_loop_body): If address of load segment is
5908 set, adjust address to include headers if possible.
5909
5910 2010-08-03 Ian Lance Taylor <iant@google.com>
5911
5912 * version.cc (version_string): Bump to 1.10.
5913
5914 2010-08-03 Ian Lance Taylor <iant@google.com>
5915
5916 PR 11805
5917 * layout.h (enum Output_section_order): Define.
5918 (class Layout): Update declarations.
5919 * layout.cc (Layout::get_output_section): Add order parameter.
5920 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5921 is_first_non_relro parameters. Change all callers.
5922 (Layout::choose_output_section): Likewise.
5923 (Layout::add_output_section_data): Likewise.
5924 (Layout::make_output_section): Likewise. Set order.
5925 (Layout::default_section_order): New function.
5926 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5927 * output.cc (Output_section::Output_section): Initialize order_.
5928 Don't initialize deleted fields.
5929 (Output_segment::Output_segment): Don't initialize deleted
5930 fields.
5931 (Output_segment::add_output_section_to_load): New function
5932 replacing add_output_section. Change all callers to call this or
5933 add_output_section_to_nonload.
5934 (Output_segment::add_output_section_to_nonload): New function.
5935 (Output_segment::remove_output_section): Rewrite.
5936 (Output_segment::add_initial_output_data): Likewise.
5937 (Output_segment::has_any_data_sections): Likewise.
5938 (Output_segment::is_first_section_relro): Likewise.
5939 (Output_segment::maximum_alignment): Likewise.
5940 (Output_segment::has_dynamic_reloc): New function replacing
5941 dynamic_reloc_count. Change all callers.
5942 (Output_segment::has_dynamic_reloc_list): New function replacing
5943 dynamic_reloc_count_list. Change all callers.
5944 (Output_segment::set_section_addresses): Rewrite.
5945 (Output_segment::set_offset): Rewrite.
5946 (Output_segment::find_first_and_last_list): Remove.
5947 (Output_segment::set_tls_offsets): Rewrite.
5948 (Output_segment::first_section_load_address): Likewise.
5949 (Output_segment::output_section_count): Likewise.
5950 (Output_segment::section_with_lowest_load_address): Likewise.
5951 (Output_segment::write_section_headers): Likewise.
5952 (Output_segment::print_sections_to_map): Likewise.
5953 * output.h (class Output_data): Remove dynamic_reloc_count_
5954 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5955 (Output_data::add_dynamic_reloc): Rewrite.
5956 (Output_data::has_dynamic_reloc): New function.
5957 (Output_data::dynamic_reloc_count): Remove.
5958 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5959 is_last_relro_, is_first_non_relro_, is_interp_,
5960 is_dynamic_linker_section_ fields. Add order and set_order
5961 functions. Remove is_relro_local, set_is_relro_local,
5962 is_last_relro, set_is_last_relro, is_first_non_relro,
5963 set_is_first_non_relro functions, is_interp, set_is_interp,
5964 is_dynamic_linker_section, and set_is_dynamic_linker_section
5965 functions.
5966 (class Output_segment): Change Output_data_list from std::list to
5967 std:;vector. Add output_lists_ field. Remove output_data_ and
5968 output_bss_ fields. Update declarations.
5969
5970 2010-08-02 Ian Lance Taylor <iant@google.com>
5971
5972 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5973 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5974 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5975
5976 2010-08-02 Ian Lance Taylor <iant@google.com>
5977
5978 PR 11855
5979 * script.cc (Script_options::Script_options): Initialize
5980 symbol_definitions_ and symbol_references_.
5981 (Script_options::add_symbol_assignment): Update
5982 symbol_definitions_ and symbol_references_.
5983 (Script_options::add_symbol_reference): New function.
5984 (script_symbol): New function.
5985 * script.h (class Script_options): Add symbol_definitions_ and
5986 symbol_references_ fields.
5987 (Script_options::referenced_const_iterator): New type.
5988 (Script_options::referenced_begin): New function.
5989 (Script_options::referenced_end): New function.
5990 (Script_options::is_referenced): New function.
5991 (Script_options::any_unreferenced): New function.
5992 * script-c.h (script_symbol): Declare.
5993 * yyscript.y (exp): Call script_symbol.
5994 * symtab.cc: Include "script.h".
5995 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5996 Change all callers. Check symbols referenced by scripts.
5997 (Symbol_table::add_undefined_symbols_from_command_line): Add
5998 layout parameter. Change all callers.
5999 (Symbol_table::do_add_undefined_symbols_from_command_line):
6000 Likewise. Break out loop body. Check symbols referenced by
6001 scripts.
6002 (Symbol_table::add_undefined_symbol_from_command_line): New
6003 function broken out of
6004 do_add_undefined_symbols_from_command_line.
6005 * symtab.h (class Symbol_table): Update declarations.
6006 * archive.cc: Include "layout.h".
6007 (Archive::should_include_member): Add layout parameter. Change
6008 all callers. Check for symbol mentioned in expression.
6009 * archive.h (class Archive): Update declaration.
6010 * object.cc (Sized_relobj::do_should_include_member): Add layout
6011 parameter.
6012 * object.h (Object::should_include_member): Add layout parameter.
6013 Change all callers.
6014 (Object::do_should_include_member): Add layout parameter.
6015 (class Sized_relobj): Update declaration.
6016 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6017 parameter.
6018 * dynobj.h (class Sized_dynobj): Update declaration.
6019 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6020 layout parameter.
6021 * plugin.h (class Sized_pluginobj): Update declaration.
6022
6023 2010-08-02 Ian Lance Taylor <iant@google.com>
6024
6025 PR 11866
6026 * output.cc (Output_segment::set_offset): Search for the first and
6027 last sections rather than assuming that the list is in order.
6028 (Output_segment::find_first_and_last_list): New function.
6029 * output.h (class Output_segment): Update declarations.
6030 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6031 (relro_strip_test_SOURCES): New variable.
6032 (relro_strip_test_DEPENDENCIES): New variable.
6033 (relro_strip_test_LDFLAGS): New variable.
6034 (relro_strip_test_LDADD): New variable.
6035 (relro_strip_test.so): New target.
6036
6037 2010-08-02 Ian Lance Taylor <iant@google.com>
6038
6039 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6040 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6041 (Target_i386::got_tlsdesc_section): New function.
6042 (Target_i386::got_section): Create space for GOT entries for
6043 TLSDESC relocations.
6044 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6045 R_386_TLS_GOTDESC.
6046 (Target_i386::Scan::global): Likewise.
6047 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6048 using TLSDESC GOT.
6049 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6050 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6051 (Target_x86_64::got_tlsdesc_section): New function.
6052 (Target_x86_64::got_section): Create space for GOT entries for
6053 TLSDESC relocations.
6054 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6055 R_386_TLS_GOTDESC.
6056 (Target_x86_64::Scan::global): Likewise.
6057 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6058 using TLSDESC GOT.
6059
6060 2010-08-02 Ian Lance Taylor <iant@google.com>
6061
6062 * testsuite/final_layout.sh: Use dc to convert from hex to
6063 decimal.
6064
6065 2010-07-29 Sriraman Tallam <tmsriram@google.com>
6066
6067 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6068 paramter to the call to gold::gc_process_relocs.
6069 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6070 paramter to the call to gold::gc_process_relocs.
6071 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6072 parameter to the call to gold::gc_process_relocs.
6073 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6074 template parameter to the call to gold::gc_process_relocs.
6075 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6076 paramter to the call to gold::gc_process_relocs.
6077 * gc.h (get_embedded_addend_size): New function.
6078 (gc_process_relocs): Save the size of the reloc for use by ICF.
6079 * icf.cc (get_section_contents): Get the addend from the text section
6080 for SHT_REL relocation sections.
6081 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6082 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6083 * int_encoding.h (read_from_pointer): New overloaded function.
6084 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6085 * testsuite/icf_sht_rel_addend_test.sh: New file.
6086 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6087 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6088
6089 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6090
6091 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6092 * Makefile.in: Regenerate.
6093 * testsuite/Makefile.in: Regenerate.
6094
6095 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6096
6097 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6098 * gold/testsuite/debug_msg.cc: Likewise.
6099 * gold/testsuite/odr_violation1.cc
6100 * gold/testsuite/odr_violation2.cc
6101
6102 2010-07-21 Cary Coutant <ccoutant@google.com>
6103
6104 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6105 string, and length fields.
6106 (Output_merge_string::Merged_strings_list): New type.
6107 (Output_merge_string::Merged_strings_lists): New typedef.
6108 (Output_merge_string): Replace merged_strings_ with
6109 merged_strings_lists_.
6110 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6111 Merged_strings_list per input object and section. Don't store pointer
6112 to the string. Don't store length with each merged string entry.
6113 (Output_merge_string::finalize_merged_data): Loop over list of merged
6114 strings lists. Recompute length of each merged string.
6115
6116 2010-07-15 Cary Coutant <ccoutant@google.com>
6117
6118 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6119 here.
6120
6121 2010-07-14 Ian Lance Taylor <iant@google.com>
6122
6123 * descriptors.cc (Descriptors::open): Report correct name in error
6124 message.
6125
6126 2010-07-13 Doug Kwan <dougkwan@google.com>
6127
6128 * arm.cc (Arm_input_section::Arm_input_section): For a
6129 SHT_ARM_EXIDX section, always keeps the input sections.
6130 (Arm_input_section::set_exidx_section_link): New method.
6131 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6132 has_errors_ to false.
6133 (Arm_exidx_input_section::has_errors,
6134 Arm_exidx_input_section::set_has_errors): New methods.
6135 (Arm_exidx_input_section::has_errors_): New data member.
6136 (Arm_relobj::get_exidx_shndx_list): New method.
6137 (Arm_output_section::append_text_sections_to_list): Do not skip
6138 section without SHF_EXECINSTR.
6139 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6140 errors.
6141 (Arm_relobj::make_exidx_input_section): Add new parameter for text
6142 section header. Make error messages more verbose. Check for
6143 a non-executable section linked to an EXIDX section.
6144 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6145 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6146 check that there is no deferred EXIDX section if we exit early.
6147 Instead of not making an EXIDX section in case of an error, make one
6148 and set the has_errors flag of it.
6149 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6150 in a relocatable link.
6151 (Target_arm::do_relax): Look for the EXIDX output section instead of
6152 assuming that it is called .ARM.exidx.
6153 (Target_arm::fix_exidx_coverage): Add a new parameter for input
6154 section list. Do not check for SHF_EXECINSTR section flags but
6155 skip any input section with errors.
6156 * output.cc (Output_section::Output_section): Initialize
6157 always_keeps_input_sections_ to false.
6158 (Output_section::add_input_section): Check for
6159 always_keeps_input_sections_.
6160 * output.h (Output_section::always_keeps_input_sections,
6161 Output_section::set_always_keeps_input_sections): New methods.
6162 (Output_section::always_keeps_input_sections): New data member.
6163
6164 2010-07-13 Rafael Espindola <espindola@google.com>
6165
6166 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6167 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6168
6169 2010-07-13 Philip Herron <herron.philip@googlemail.com>
6170 Ian Lance Taylor <iant@google.com>
6171
6172 * output.h (Output_section_lookup_maps::add_merge_section):
6173 Correct check of whether value was inserted.
6174 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6175 (Output_section_lookup_maps::add_relaxed_input_section):
6176 Likewise.
6177 * arm.cc (Target_arm::got_section): Remove used local os.
6178 * i386.cc (Target_i386::got_section): Likewise.
6179 * x86_64.cc (Target_x86_64::got_section): Likewise.
6180 * sparc.cc (Target_sparc::got_section): Likewise.
6181 (Target_sparc::relocate): Remove unused local have_got_offset.
6182 * powerpc.cc (Target_powerpc::relocate): Likewise.
6183
6184 2010-07-13 Ian Lance Taylor <iant@google.com>
6185
6186 * compressed_output.cc (zlib_decompress): Fix signature in
6187 !HAVE_ZLIB_H case.
6188
6189 * archive.cc (Archive::include_member): Unlock an external member
6190 of a thin archive. Don't bother to delete an object we know is
6191 NULL.
6192
6193 2010-07-12 Cary Coutant <ccoutant@google.com>
6194
6195 * compressed_output.cc (zlib_decompress): New function.
6196 (get_uncompressed_size): New function.
6197 (decompress_input_section): New function.
6198 * compressed_output.h (get_uncompressed_size): New function.
6199 (decompress_input_section): New function.
6200 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6201 Handle compressed debug sections.
6202 * layout.cc (is_compressed_debug_section): New function.
6203 (Layout::output_section_name): Map compressed section names to
6204 canonical names.
6205 * layout.h (is_compressed_debug_section): New function.
6206 (is_debug_info_section): Recognize compressed debug sections.
6207 * merge.cc: Include compressed_output.h.
6208 (Output_merge_data::do_add_input_section): Handle compressed
6209 debug sections.
6210 (Output_merge_string::do_add_input_section): Handle compressed
6211 debug sections.
6212 * object.cc: Include compressed_output.h.
6213 (Sized_relobj::Sized_relobj): Initialize new data members.
6214 (build_compressed_section_map): New function.
6215 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6216 * object.h (Object::section_is_compressed): New method.
6217 (Object::do_section_is_compressed): New method.
6218 (Sized_relobj::Compressed_section_map): New type.
6219 (Sized_relobj::do_section_is_compressed): New method.
6220 (Sized_relobj::compressed_sections_): New data member.
6221 * output.cc (Output_section::add_input_section): Handle compressed
6222 debug sections.
6223 * reloc.cc: Include compressed_output.h.
6224 (Sized_relobj::write_sections): Handle compressed debug sections.
6225
6226 2010-07-08 Cary Coutant <ccoutant@google.com>
6227
6228 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6229 weak when resolving to a dynamic def.
6230 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6231 for weak undef/dynamic def cases. Adjust callers.
6232 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6233 undef_binding_weak_.
6234 (Symbol_table::sized_write_globals): Adjust symbol binding.
6235 (Symbol_table::sized_write_symbol): Add binding parameter.
6236 * symtab.h (Symbol::set_undef_binding): New method.
6237 (Symbol::is_undef_binding_weak): New method.
6238 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6239 (Symbol_table::should_override): Add new parameter.
6240 (Symbol_table::sized_write_symbol): Add new parameter.
6241
6242 * testsuite/weak_undef_file1.cc: Add new test case.
6243 * testsuite/weak_undef_file2.cc: Fix header comment.
6244 * testsuite/weak_undef_test.cc: Add new test case.
6245
6246 2010-06-29 Doug Kwan <dougkwan@google.com>
6247
6248 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6249 Initialize USE_SYMBOL_.
6250 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6251 definition.
6252 (Arm_reloc_property::uses_symbol_): New data member declaration.
6253 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6254 uses symbol value and symbol is undefined but not weakly undefined.
6255
6256 2010-06-28 Rafael Espindola <espindola@google.com>
6257
6258 * plugin.cc (Plugin::load): Use dlerror.
6259
6260 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6261
6262 * symtab.cc (detect_odr_violations): When reporting an ODR
6263 violation, report an object where the symbol is defined.
6264
6265 2010-06-25 Doug Kwan <dougkwan@google.com>
6266
6267 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6268 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6269 definition.
6270 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6271 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6272 target hook to detect function points.
6273 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6274 * icf.h (Icf::check_section_for_function_pointers): Change type of
6275 parameter SECTION_NAME to const reference to std::string. Use
6276 target hook to determine if section may have unsafe pointers.
6277 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6278 method definition.
6279
6280 2010-06-21 Rafael Espindola <espindola@google.com>
6281
6282 * fileread.cc (Input_file::find_fie): New
6283 (Input_file::open): Use Input_file::find_fie.
6284 * fileread.h (Input_file::find_fie): New
6285 * plugin.cc (set_extra_library_path): New.
6286 (Plugin::load): Add set_extra_library_path to the transfer vector.
6287 (Plugin_manager::set_extra_library_path): New.
6288 (Plugin_manager::add_input_file): Use the extra search path if set.
6289 (set_extra_library_path(): New.
6290 * plugin.h (Plugin_manager): Add set_extra_library_path and
6291 extra_search_path_.
6292
6293 2010-06-19 Cary Coutant <ccoutant@google.com>
6294
6295 * layout.cc (gdb_sections): Add .debug_types.
6296 (lines_only_debug_sections): Likewise.
6297
6298 2010-06-18 Rafael Espindola <espindola@google.com>
6299
6300 * plugin.cc (add_input_file,add_input_library)
6301 (Plugin_manager::add_input_file): Make filename arguments const.
6302 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6303 const.
6304
6305 2010-06-16 Doug Kwan <dougkwan@google.com>
6306
6307 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6308 .ARM.attributes section if we have not merged any input
6309 attributes sections.
6310
6311 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6312
6313 * arm.cc: Allow combining objects with no EABI version
6314 information.
6315
6316 2010-06-15 Rafael Espindola <espindola@google.com>
6317
6318 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6319
6320 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6321
6322 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6323 (struct iovec): Correct !HAVE_READV definition.
6324
6325 2010-06-10 Cary Coutant <ccoutant@google.com>
6326
6327 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6328 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6329 reloc sections.
6330 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6331
6332 PR 11683
6333 * symtab.h (Symbol::is_placeholder): New member function.
6334 * target-reloc.h (relocate_section): Check for placeholder symbols.
6335
6336 * testsuite/Makefile.am (plugin_test_8): New test.
6337 (plugin_test_9): New test.
6338 * testsuite/Makefile.in: Regenerate.
6339
6340 2010-06-09 Nick Clifton <nickc@redhat.com>
6341
6342 * yyscript.y (input_list_element): Allow strings prefixed with
6343 the '-' character. Treat these as libraries.
6344 * script.cc (script_add_library): New function. Adds a library
6345 specified by "-l<name>" found in an input script.
6346 * script-c.h: Add prototype for script_add_library.
6347
6348 2010-06-07 Doug Kwan <dougkwan@google.com>
6349
6350 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6351 Restrict stub-group size to be within long conditional branch
6352 range when working around cortex-A8 erratum.
6353
6354 2010-06-07 Damien Diederen <dd@crosstwine.com>
6355
6356 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6357 #ifdef typo.
6358
6359 2010-06-03 Sriraman Tallam <tmsriram@google.com>
6360
6361 PR gold/11658
6362 * output.cc
6363 (Output_section::Input_section_sort_entry::compare_section_ordering):
6364 Change to return non-zero correctly.
6365 (Output_section::Input_section_sort_section_order_index_compare
6366 ::operator()): Change to fix ambiguity in comparisons.
6367
6368 2010-06-01 Sriraman Tallam <tmsriram@google.com>
6369
6370 * gold.h (is_wildcard_string): New function.
6371 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6372 (Layout::layout_eh_frame): Ditto.
6373 (Layout::find_section_order_index): New method.
6374 (Layout::read_layout_from_file): New method.
6375 * layout.h (Layout::find_section_order_index): New method.
6376 (Layout::read_layout_from_file): New method.
6377 (Layout::input_section_position_): New private member.
6378 (Layout::input_section_glob_): New private member.
6379 * main.cc (main): Call read_layout_from_file here.
6380 * options.h (--section-ordering-file): New option.
6381 * output.cc (Output_section::input_section_order_specified_): New
6382 member.
6383 (Output_section::Output_section): Initialize new member.
6384 (Output_section::add_input_section): Add new parameter.
6385 Keep input sections when --section-ordering-file is used.
6386 (Output_section::set_final_data_size): Sort input sections when
6387 section ordering file is specified.
6388 (Output_section::Input_section_sort_entry): Add new parameter.
6389 Check sorting type.
6390 (Output_section::Input_section_sort_entry::compare_section_ordering):
6391 New method.
6392 (Output_section::Input_section_sort_compare::operator()): Change to
6393 consider section_order_index.
6394 (Output_section::Input_section_sort_init_fini_compare::operator()):
6395 Change to consider section_order_index.
6396 (Output_section::Input_section_sort_section_order_index_compare
6397 ::operator()): New method.
6398 (Output_section::sort_attached_input_sections): Change to sort
6399 according to section order when specified.
6400 (Output_section::add_input_section<32, true>): Add new parameter.
6401 (Output_section::add_input_section<64, true>): Add new parameter.
6402 (Output_section::add_input_section<32, false>): Add new parameter.
6403 (Output_section::add_input_section<64, false>): Add new parameter.
6404 * output.h (Output_section::add_input_section): Add new parameter.
6405 (Output_section::input_section_order_specified): New
6406 method.
6407 (Output_section::set_input_section_order_specified): New method.
6408 (Input_section::Input_section): Initialize section_order_index_.
6409 (Input_section::section_order_index): New method.
6410 (Input_section::set_section_order_index): New method.
6411 (Input_section::section_order_index_): New member.
6412 (Input_section::Input_section_sort_section_order_index_compare): New
6413 struct.
6414 (Output_section::input_section_order_specified_): New member.
6415 * script-sections.cc (is_wildcard_string): Delete and move modified
6416 method to gold.h.
6417 (Output_section_element_input::Output_section_element_input): Modify
6418 call to is_wildcard_string.
6419 (Output_section_element_input::Input_section_pattern
6420 ::Input_section_pattern): Ditto.
6421 (Output_section_element_input::Output_section_element_input): Ditto.
6422 * testsuite/Makefile.am (final_layout): New test case.
6423 * testsuite/Makefile.in: Regenerate.
6424 * testsuite/final_layout.cc: New file.
6425 * testsuite/final_layout.sh: New file.
6426
6427 2010-06-01 Rafael Espindola <espindola@google.com>
6428
6429 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6430
6431 2010-06-01 Rafael Espindola <espindola@google.com>
6432
6433 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6434 visibility of symbols.
6435
6436 2010-05-27 Doug Kwan <dougkwan@google.com>
6437
6438 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6439 from start of output section instead of address for a local symbol
6440 in a merged or relaxed section when doing a relocatable link.
6441
6442 2010-05-26 Rafael Espindola <espindola@google.com>
6443
6444 PR 11604
6445 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6446 adding sections the garbage collector removed.
6447 * gold/testsuite/Makefile.am: Add test.
6448 * gold/testsuite/Makefile.in: Regenerate.
6449 * gold/testsuite/plugin_test_7.sh: New.
6450 * gold/testsuite/plugin_test_7_1.c: New.
6451 * gold/testsuite/plugin_test_7_2.c: New.
6452
6453 2010-05-26 Rafael Espindola <espindola@google.com>
6454
6455 * script-sections.cc (Output_section_definition::set_section_addresses):
6456 Check for --section-start.
6457
6458 2010-05-26 Doug Kwan <dougkwan@google.com>
6459
6460 * arm.cc (Arm_scan_relocatable_relocs): New class.
6461 (Target_arm::relocate_special_relocatable): New method.
6462 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6463 (Arm_relocate_functions::thumb_branch_common): Same.
6464 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6465 instead of Default_scan_relocatable_relocs.
6466 * target-reloc.h (relocate_for_relocatable): Let target handle
6467 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6468 * target.h (Sized_target::relocate_special_relocatable): New method.
6469
6470 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6471
6472 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6473
6474 2010-05-23 Doug Kwan <dougkwan@google.com>
6475
6476 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6477 instead of a cast.
6478 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6479 with a direct branch, not a conditional branch, to a stub.
6480 * merge.cc (Output_merge_base::record_input_section): New method
6481 defintion.
6482 (Output_merge_data::do_add_input_section): Record input section if
6483 keeps-input-sections flag is set.
6484 (Output_merge_string::do_add_input_section): Ditto.
6485 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6486 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6487 INPUT_SECTIONS_.
6488 (Output_merge_base::keeps_input_sections,
6489 Output_merge_base::set_keeps_input_sections,
6490 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6491 method definitions.
6492 (Output_merge_base::Input_sections): New type declaration.
6493 (Output_merge_base::input_sections_begin,
6494 Output_merge_base::input_sections_end,
6495 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6496 (Output_merge_base::bool keeps_input_sections_,
6497 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6498 Output_merge_base::input_sections_): New data members.
6499 (Output_merge_data::do_set_keeps_input_sections): New method
6500 defintion.
6501 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6502 * output.cc (Output_section::Input_section::relobj): Move method
6503 defintion from class declaration to here and handle merge sections.
6504 (Output_section::Input_section::shndx): Ditto.
6505 (Output_section::Output_section): Remove initializations of removed
6506 data members and initialize new data member LOOKUP_MAPS_.
6507 (Output_section::add_input_section): Set keeps-input-sections flag
6508 for a newly created merge output section as appropriate. Adjust code
6509 to use Output_section_lookup_maps class.
6510 (Output_section::add_relaxed_input_section): Adjst code for lookup
6511 maps code refactoring.
6512 (Output_section::add_merge_input_section): Add a new parameter
6513 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6514 class. If adding input section to a newly created merge output
6515 section fails, remove the new merge section.
6516 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
6517 Adjust code for use of the Output_section_lookup_maps class.
6518 (Output_section::find_merge_section): Ditto.
6519 (Output_section::build_lookup_maps): New method defintion.
6520 (Output_section::find_relaxed_input_section): Adjust code to use
6521 Output_section_lookup_maps class.
6522 (Output_section::get_input_sections): Export merge sections. Adjust
6523 code to use Output_section_lookup_maps class.
6524 (Output_section:::add_script_input_section): Adjust code to use
6525 Output_section_lookup_maps class. Update lookup maps for merge
6526 sections also.
6527 (Output_section::discard_states): Use Output_section_lookup_maps.
6528 (Output_section::restore_states): Same.
6529 * output.h (Merge_section_properties): Move class defintion out of
6530 Output_section.
6531 (Output_section_lookup_maps): New class.
6532 (Output_section::Input_section::is_merge_section): New method
6533 defintion.
6534 (Output_section::Input_section::relobj): Move defintion out of class
6535 defintion. Declare method only.
6536 (Output_section::Input_section::shndx): Ditto.
6537 (Output_section::Input_section::output_merge_base): New method defintion.
6538 (Output_section::Input_section::u2_.pomb): New union field.
6539 (Output_section::Merge_section_by_properties_map,
6540 Output_section::Output_section_data_by_input_section_map,
6541 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6542 Remove types.
6543 (Output_section::add_merge_input_section): Add new parameter
6544 KEEPS_INPUT_SECTIONS.
6545 (Output_section::build_lookup_maps): New method declaration.
6546 (Output_section::merge_section_map_,
6547 Output_section::merge_section_by_properties_map_,
6548 Output_section::relaxed_input_section_map_,
6549 Output_section::is_relaxed_input_section_map_valid_): Remove data
6550 members.
6551 (Output_section::lookup_maps_): New data member.
6552
6553 2010-05-21 Doug Kwan <dougkwan@google.com>
6554
6555 PR gold/11619
6556 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6557 avoid a compilation error.
6558
6559 2010-05-19 Rafael Espindola <espindola@google.com>
6560
6561 * script-sections.cc (Output_section_definition::allocate_to_segment):
6562 Update the phdrs_list even when the output section is NULL.
6563 * testsuite/Makefile.am: Add test.
6564 * testsuite/Makefile.in: Regenerate.
6565 * testsuite/script_test_9.cc: New.
6566 * testsuite/script_test_9.sh: New.
6567 * testsuite/script_test_9.t: New.
6568
6569 2010-05-19 Doug Kwan <dougkwan@google.com>
6570
6571 * arm.cc (Arm_input_section::original_size): New method.
6572 (Arm_input_section::do_addralign): Add a cast.
6573 (Arm_input_section::do_output_offset): Remove static cast.
6574 (Arm_input_section::original_addralign,
6575 Arm_input_section::original_size_): Change type to uint32_t.
6576 (Arm_input_section::init): Add safe casts for section alignment
6577 and size.
6578 (Arm_input_section::set_final_data_size): Do not set address and
6579 offset of stub table.
6580 (Arm_output_section::fix_exidx_coverage): Change use of of
6581 Output_section::Simple_input_section to that of
6582 Output_section::Input_section.
6583 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6584 except for the first pass.
6585 * output.cc (Output_section::get_input_sections): Change type of
6586 input_sections to std::list<Input_section>.
6587 (Output_section::add_script_input_section): Rename from
6588 Output_section::add_simple_input_section. Change type of SIS
6589 parameter from Simple_input_section to Input_section.
6590 * output.h (Output_section::Simple_input_section): Remove class.
6591 (Output_section::Input_section): Change class visibility to public.
6592 (Output_section::Input_section::addralign): Use stored alignments
6593 for special input sections if set.
6594 (Output_section::Input_section::set_addralign): New method.
6595 (Output_section::get_input_sections): Change parameter type from
6596 list of Simple_input_section to list of Input_section.
6597 (Output_section::add_script_input_section): Rename from
6598 Output_section::add_simple_input_section. Change first parameter's
6599 type from Simple_input_section to Input_section and remove the
6600 second and third parameters.
6601 * script-sections.cc (Input_section::Input_section_list): Change
6602 type to list of Output_section::Input_section/
6603 (Input_section_info::Input_section_info): Change parameter type of
6604 INPUT_SECTION to Output_section::Input_section.
6605 (Input_section_info::input_section): Change return type.
6606 (Input_section_info::input_section_): Change type to
6607 Output_section::Input_section.
6608 (Output_section_element_input::set_section_addresses): Adjust code
6609 to use Output_section::Input_section instead of
6610 Output_section::Simple_input_section. Adjust code for renaming
6611 of Output_section::add_simple_input_section.
6612 (Orphan_output_section::set_section_addresses): Ditto.
6613
6614 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6615
6616 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6617 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6618
6619 2010-05-18 Rafael Espindola <espindola@google.com>
6620
6621 * options.cc (General_options::finalize): Handle -nostdlib.
6622 * options.h (nostdlib): New option.
6623 * script.cc (script_add_search_dir): Handle -nostdlib.
6624
6625 2010-05-12 Doug Kwan <dougkwan@google.com>
6626
6627 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6628 attributes section only if there no attributes section after merging.
6629 (Target_arm::merge_object_attributes): Move value of
6630 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
6631 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6632 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6633 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6634 and arm_attr_merge_7.stdout.
6635 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6636 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6637 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6638 arm_attr_merge_7b.o): New rules.
6639 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6640 arm_attr_merge_7
6641 * testsuite/Makefile.in: Regenerate.
6642 * testsuite/arm_attr_merge.sh: New file.
6643 * testsuite/arm_attr_merge_[67][ab].s: Same.
6644
6645 2010-05-05 Nick Clifton <nickc@redhat.com>
6646
6647 * po/es.po: Updated Spanish translation.
6648
6649 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6650
6651 * Makefile.am (install-exec-local): Properly install gold as
6652 default cross linker.
6653 * Makefile.in: Regenerated.
6654
6655 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6656 Nick Clifton <nickc@redhat.com>
6657
6658 * configure.ac (install_as_default): Define and set to false
6659 unless --enable-gold or --enable-gold=both/gold has been
6660 specified.
6661 * configure: Regenerate.
6662
6663 * Makefile.am (install-exec-local): Install the executable as
6664 'ld.gold'. If install_as_default is true then also install it as
6665 'ld'.
6666 * Makefile.in: Regenerated.
6667
6668 2010-04-24 Ian Lance Taylor <iant@google.com>
6669
6670 * layout.cc (Layout::layout_reloc): In relocatable link don't
6671 combine reloc sections for grouped sections.
6672
6673 2010-04-23 Sriraman Tallam <tmsriram@google.com>
6674
6675 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6676 sections that are not ordinary to icf.
6677 * icf.cc (get_section_contents): Handle relocation pointing to section
6678 with no object or shndx information.
6679 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6680 * testsuite/Makefile.in: Regenerate.
6681 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6682 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6683
6684 2010-04-22 Ian Lance Taylor <iant@google.com>
6685
6686 * expression.cc (Expression::Expression_eval_info): Add
6687 result_alignment_pointer field.
6688 (Expression::eval_with_dot): Add result_alignment_pointer
6689 parameter. Change all callers.
6690 (Expression::eval_maybe_dot): Likewise.
6691 (class Binary_expression): Add alignment_pointer parameter to
6692 left_value and right_value. Change all callers.
6693 (BINARY_EXPRESSION): Set result alignment.
6694 (class Trinary_expression): Add alignment_pointer parameter to
6695 arg2_value and arg3_value. Change all callers.
6696 (Trinary_cond::value): Set result alignment.
6697 (Max_expression::value, Min_expression::value): Likewise.
6698 (Align_expression::value): Likewise.
6699 * script-sections.cc (class Sections_element): Add dot_alignment
6700 parameter to set_section_addresses virtual function. Update
6701 instantiations.
6702 (class Output_section_element): Likewise.
6703 (Script_sections::create_segments): Add dot_alignment parameter.
6704 Change all callers.
6705 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6706 (Script_sections::set_phdrs_clause_addresses): Likewise.
6707 * script-sections.h: Update declarations.
6708 * script.h: Update declarations.
6709 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6710 min_p_align.
6711 * testsuite/script_test_3.t: Set large alignment.
6712 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6713 segment has expected alignment.
6714
6715 2010-04-22 Nick Clifton <nickc@redhat.com>
6716
6717 * po/gold.pot: Updated by the Translation project.
6718 * po/vi.po: Updated Vietnamese translation.
6719
6720 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6721
6722 * testsuite/Makefile.am (check_PROGRAMS): Add
6723 icf_virtual_function_folding_test.
6724 * testsuite/Makefile.in: Regenerated.
6725
6726 2010-04-15 Andrew Haley <aph@redhat.com>
6727
6728 * options.h (merge_exidx_entries): New option.
6729 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6730 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6731 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6732 (Target_arm::merge_exidx_entries): New function.
6733 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6734 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6735 to Arm_exidx_fixup constructor.
6736 Add new arg, merge_exidx_entries.
6737 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6738 Arm_output_section::fix_exidx_coverage.
6739
6740 2010-04-18 Sriraman Tallam <tmsriram@google.com>
6741
6742 * icf.cc (get_section_contents): Check for preemptible functions.
6743 Ignore addend when appropriate.
6744 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6745 section folded.
6746 (add_from_relobj): Check for section folded.
6747 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6748 * symtab.h (should_add_dynsym_entry): Add new parameter.
6749 * target-reloc.h (scan_relocs): Check for section folded.
6750 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6751 Check reloc types for function pointers in shared objects.
6752 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6753 case.
6754 (icf_preemptible_functions_test): New test case.
6755 (icf_string_merge_test): New test case.
6756 * testsuite.Makefile.in: Regenerate.
6757 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6758 bar_glob. Refactor code.
6759 * testsuite/icf_preemptible_functions_test.cc: New file.
6760 * testsuite/icf_preemptible_functions_test.sh: New file.
6761 * testsuite/icf_string_merge_test.cc: New file.
6762 * testsuite/icf_string_merge_test.sh: New file.
6763 * testsuite/icf_virtual_function_folding_test.cc: New file.
6764 * testsuite/icf_virtual_function_folding_test.sh: New file.
6765
6766 2010-04-14 Doug Kwan <dougkwan@google.com>
6767
6768 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6769 for local symbol recounting if we remove a section due to ICF.
6770 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6771 there are no regular objects in input.
6772
6773 2010-04-13 Doug Kwan <dougkwan@google.com>
6774
6775 * arm.cc (Arm_input_section::set_final_data_size): Compute
6776 accurate final data size instead of using current data size.
6777
6778 2010-04-09 Doug Kwan <dougkwan@google.com>
6779
6780 * layout.cc (Layout::choose_output_section): Handle script section
6781 types.
6782 (Layout::make_output_section_for_script): Add section type parameter.
6783 Handle script section types.
6784 * layout.h (Layout::make_output_section_for_script): Add section
6785 type parameter.
6786 * output.cc (Output_section::Output_section): Initialize data member
6787 is_noload_.
6788 (Output_section::do_reset_address_and_file_offset): Do not set address
6789 to 0 if section is a NOLOAD section.
6790 * output.h (Output_section::is_noload): New method.
6791 (Output_section::set_is_noload): Ditto.
6792 (Output_section::is_noload_): New data member.
6793 * script-c.h (Script_section_type): New enum type.
6794 (struct Parser_output_section_header): Add new file section_type.
6795 * script-sections.cc (Sections_element::output_section_name): Add
6796 parameter for returning script section type.
6797 (Output_section_definition::output_section_name): Ditto.
6798 (Output_section_definition::section_type)P; New method.
6799 (Output_section_definiton::script_section_type_name): Ditto.
6800 (Output_section_definition::script_section_type_): New data member.
6801 (Output_section_definition::Output_section_definition): Initialize
6802 data member Output_section_definition::script_section_type_.
6803 (Output_section_definition::create_sections): Pass script section type
6804 to Layout::make_output_section_for_script.
6805 (Output_section_definition::output_section_name): Return script
6806 section type to caller.
6807 (Output_section_definition::set_section_address): Do not advance
6808 dot value and load address if section type is NOLOAD. Set address
6809 of NOLOAD sections regardless of section flags.
6810 (Output_section_definition::print): Print section type if it is
6811 not SCRIPT_SECTION_TYPE_NONE.
6812 (Output_section_definition::section_type): New method.
6813 (Output_section_definition::script_section_type_name): Ditto.
6814 (Script_sections::output_section_name): Add new parameter
6815 PSECTION_TYPE for returning script section type. Pass it to
6816 section elements. Handle discard sections.
6817 (Sort_output_sections::operator()): Handle NOLOAD sections.
6818 * script-sections.h (Script_sections::Section_type): New enum type.
6819 (Script_sections::output_section_name): Add a new parameter for
6820 returning script section type.
6821 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6822 INFO and NOLOAD.
6823 * yyscript.y (union): Add new field SECTION_TYPE.
6824 (COPY, DSECT, INFO, NOLOAD): New tokens.
6825 (opt_address_and_section_type): Change type to output_section_header.
6826 (section_type): New non-terminal
6827 (section_header): Handle section type.
6828 (opt_address_and_section_type): Return section type value.
6829
6830 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6831
6832 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6833 * testsuite/plugin_common_test_2.c (foo): Likewise.
6834
6835 2010-04-08 Doug Kwan <dougkwan@google.com>
6836
6837 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6838 Output_merge_data.
6839 * output.cc (Output_section::add_merge_input_section): Simplify
6840 code and return status of Output_merge_base::add_input_section.
6841 Update merge section map only if Output_merge_base::add_input_section
6842 returns true.
6843
6844 2010-04-07 Doug Kwan <dougkwan@google.com>
6845
6846 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6847 if section is marked as containing instructions but has no mapping
6848 symbols.
6849 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6850 correct section index.
6851 (Arm_relobj::find_linked_text_section): Ditto.
6852
6853 2010-04-07 Cary Coutant <ccoutant@google.com>
6854
6855 * archive.cc (include_member): Destroy Read_symbols_data object before
6856 releasing file.
6857 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6858 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6859 (Read_symbols_data::~Read_symbols_data) New destructor.
6860 (Section_relocs::Section_relocs) New constructor.
6861 (Section_relocs::~Section_relocs) New destructor.
6862 (Read_relocs_data::Read_relocs_data) New constructor.
6863 (Read_relocs_data::~Read_relocs_data) New destructor.
6864 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6865 pointers to NULL after deleting.
6866
6867 2010-04-07 Doug Kwan <dougkwan@google.com>
6868
6869 * arm.cc: Replace "endianity" with "endianness" in comments.
6870 (Arm_exidx_cantunwind): Ditto.
6871 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6872 (Arm_relobj::merge_flags_and_attributes): New method.
6873 (Arm_relobj::merge_flags_and_attributes_): New data member.
6874 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6875 (Arm_relobj::scan_sections_for_stubs): Ditto.
6876 (Arm_relobj::do_read_symbols): Check to see if we really want to
6877 merge processor-specific flags and attributes. Exit early if
6878 an object is empty except for section names and the undefined symbol.
6879 (Target_arm::do_finalize_sections): Move check for ELF format to
6880 Arm_relobj::do_read_symbols. Merge processor specific flags and
6881 attributes from a regular object only when we have determined that
6882 it is aapropriate. Do not create an .ARM.attributes section in
6883 output if there is no regular input object.
6884 (Target_arm::merge_processor_specific_flags): Check
6885 --warn-mismatch before printing any error.
6886 (Target_arm::merge_object_attributes): Ditto.
6887 * gold.cc (queue_middle_tasks): Handle the case in which there is
6888 no regular object in input.
6889 * options.cc (General_options::parse_EB): New method.
6890 (General_options::parse_EL): Same.
6891 (General_options::General_options): Initialize endianness_.
6892 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6893 New options.
6894 (General_options::Endianness): New enum.
6895 (General_options::endianness): New method.
6896 (General_options::endianness_): New data member.
6897 * parameters.cc (Parameters::set_options): Check target endianness.
6898 (Parameters::set_target_once): Ditto.
6899 (Parameters::check_target_endianness): New method.
6900 (parameters_force_valid_target): If either -EL or -EB is specified,
6901 use it to define endianness of default target.
6902 * parameters.h (Parameters::check_target_endianness): New method
6903 declaration.
6904 * target.h (class Target): Change "endianity" to "endianness"
6905 in comments.
6906
6907 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6908
6909 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6910 * configure: Regenerate.
6911 * Makefile.in: Regenerate.
6912 * testsuite/Makefile.in: Regenerate.
6913
6914 2010-04-06 Cary Coutant <ccoutant@google.com>
6915
6916 gcc PR lto/42757
6917 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6918 prevailing definitions of common symbols.
6919 * testsuite/plugin_test_6.sh: New test case.
6920 * testsuite/plugin_common_test_1.c: New test case.
6921 * testsuite/plugin_common_test_2.c: New test case.
6922 * testsuite/Makefile.am (plugin_test_6): New test case.
6923 * testsuite/Makefile.in: Regenerate.
6924
6925 2010-04-06 Nick Clifton <nickc@redhat.com>
6926
6927 * po/vi.po: New Vietnamese translation.
6928
6929 2010-03-30 Doug Kwan <dougkwan@google.com>
6930
6931 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6932
6933 2010-03-25 Doug Kwan <dougkwan@google.com>
6934
6935 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6936 to avoid a conversion warning on a 32-bit host.
6937
6938 2010-03-24 Ian Lance Taylor <iant@google.com>
6939
6940 * testsuite/script_test_3.t: Add a TLS segment.
6941 * testsuite/Makefile.am (check_PROGRAMS): Add
6942 tls_phdrs_script_test.
6943 (tls_phdrs_script_test_SOURCES): Define.
6944 (tls_phdrs_script_test_DEPENDENCIES): Define.
6945 (tls_phdrs_script_test_LDFLAGS): Define.
6946 (tls_phdrs_script_test_LDADD): Define.
6947 * testsuite/Makefile.in: Rebuild.
6948
6949 2010-03-23 Cary Coutant <ccoutant@google.com>
6950
6951 * fileread.cc (find_or_make_view): Fix comment.
6952
6953 2010-03-23 Ian Lance Taylor <iant@google.com>
6954
6955 * script-sections.cc (class Orphan_section_placement): Define
6956 PLACE_TLS and PLACE_TLS_BSS.
6957 (Orphan_section_placement::Orphan_section_placement): Initialize
6958 new places.
6959 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6960 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6961 (tls_script_test_SOURCES): Define.
6962 (tls_script_test_DEPENDENCIES): Define.
6963 (tls_script_test_LDFLAGS): Define.
6964 (tls_script_test_LDADD): Define.
6965 * testsuite/Makefile.in: Rebuild.
6966
6967 2010-03-22 Doug Kwan <dougkwan@google.com>
6968
6969 * arm.cc (Arm_relocate_functions::abs8,
6970 Arm_relocate_functions::abs16): Use correct check for overflow
6971 specified in the ARM ELF specs.
6972 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6973 target of a BLX instruction specially.
6974 (Reloc_stub::stub_type_for_reloc): Ditto.
6975 (Relocate::relocate): Use symbolic names instead of numeric relocation
6976 codes to report error.
6977 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6978 workaround.
6979 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6980 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6981 thumb2_blx_out_of_range.stdout
6982 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6983 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6984 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6985 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6986 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6987 thumb2_blx_in_range, thumb2_blx_in_range.o,
6988 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6989 thumb2_blx_out_of_range.o): New rules.
6990 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
6991 thumb2_blx_in_range and thumb2_blx_out_of_range.
6992 * testsuite/Makefile.in: Regenerate.
6993 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6994 * testsuite/thumb_blx_in_range.s: New file.
6995 * testsuite/thumb_blx_out_of_range.s: New file.
6996
6997 2010-03-22 Rafael Espindola <espindola@google.com>
6998
6999 * archive.cc (Should_include): Move to archive.h.
7000 (should_include_member): Make it a member of Archive.
7001 (Lib_group): New.
7002 (Add_lib_group_symbols): New.
7003 * archive.h: Include options.h.
7004 (Archive_member): Moved from Archive.
7005 (Should_include): Moved from archive.cc.
7006 (Lib_group): New.
7007 (Add_lib_group_symbols): New.
7008 * dynobj.cc (do_should_include_member): New.
7009 * dynobj.h (do_should_include_member): New.
7010 * gold.cc (queue_initial_tasks): Update call to queue.
7011 * main.cc (main): Print lib group stats.
7012 * object.cc (do_should_include_member): New.
7013 * object.h: Include archive.h.
7014 (Object::should_include_member): New.
7015 (Object::do_should_include_member): New.
7016 (Sized_relobj::do_should_include_member): New.
7017 * options.cc (General_options::parse_start_lib): New.
7018 (General_options::parse_end_lib): New.
7019 (Input_arguments::add_file): Handle lib groups.
7020 (Input_arguments::start_group): Check we are not in a lib.
7021 (Input_arguments::start_lib): New.
7022 (Input_arguments::end_lib): New.
7023 * options.h (General_options): Add start_lib and end_lib.
7024 (Input_argument::lib_): New.
7025 (Input_argument::lib): New.
7026 (Input_argument::is_lib): New.
7027 (Input_file_lib): New.
7028 (Input_arguments::in_lib_): New.
7029 (Input_arguments::in_lib): New.
7030 (Input_arguments::start_lib): New.
7031 (Input_arguments::end_lib_): New.
7032 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7033 in unused members as preempted.
7034 (Sized_pluginobj::do_should_include_member): New.
7035 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7036 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7037 return the blocker.
7038 (Read_symbols::do_whole_lib_group): New.
7039 (Read_symbols::do_lib_group): New.
7040 (Read_symbols::do_read_symbols): Handle lib groups.
7041 (Read_symbols::get_name): Handle lib groups.
7042 * readsyms.h (Read_symbols): Add an archive member pointer.
7043 (Read_symbols::do_whole_lib_group): New.
7044 (Read_symbols::do_lib_group): New.
7045 (Read_symbols::member_): New.
7046 * script.cc (read_input_script): Update call to queue_soon.
7047
7048 2010-03-19 Doug Kwan <dougkwan@google.com>
7049
7050 * arm.cc (Stub_table::Stub_table): Initialize new data members
7051 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7052 (Stub_table::add_reloc_stub): Assign stub offset and update
7053 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7054 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7055 New data members.
7056 (Stub_table::update_data_size_and_addralign): Use
7057 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7058 instead of going over all reloc stubs.
7059 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
7060 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7061 Stringpool_template::offset_ to size of Stringpool_char.
7062 (Stringpool_template::new_key_offset): Remove code to initialize
7063 Stringpool_template::offset_.
7064 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7065 Stringpool_template::offset_ to zero.
7066
7067 2010-03-15 Doug Kwan <dougkwan@google.com>
7068
7069 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7070 offset_.
7071 (Stringpool_template::new_key_offset): New method.
7072 (Stringpool_template::add_string): Assign offsets when adding new
7073 strings.
7074 (Stringpool_template::set_string_offsets): Do not set string offsets
7075 when not optimizing.
7076 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7077 member size_.
7078 (Chunked_vector::clear): Clear size_.
7079 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7080 (Chunked_vector::size): Return size_.
7081 (Chunked_vector::push_back): Use size_ to find insert position.
7082 (Chunked_vector::size_): New data member.
7083 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7084 (Stringpool_template::new_key_offset): New method declaration.
7085 (Stringpool_template::offset_): New data member.
7086
7087 2010-03-15 Rafael Espindola <espindola@google.com>
7088
7089 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7090 Add_symbols' constructor.
7091 * readsyms.h (Add_symbols): Remove the input_group member.
7092
7093 2010-03-10 Ian Lance Taylor <iant@google.com>
7094
7095 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7096 target to ask whether a reference to a symbol requires a stack
7097 split.
7098 * target.h (Target::is_call_to_non_split): New function.
7099 (Target::do_is_call_to_non_split): Declare virtual function.
7100 * target.cc: Include "symtab.h".
7101 (Target::do_is_call_to_non_split): New function.
7102 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7103
7104 2010-03-10 Cary Coutant <ccoutant@google.com>
7105
7106 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7107 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7108 (File_read::open[2]): Add whole_file_view_ to list of views.
7109 (File_read::make_view): Remove test of whole_file_view_.
7110 (File_read::find_or_make_view): Create whole_file_view_ if
7111 necessary.
7112 (File_read::clear_views): Replace bool parameter with enum;
7113 adjust all callers. Don't delete views with permanent data;
7114 do delete cached views and views from archives if
7115 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7116 if clearing the corresponding view.
7117 * fileread.h (File_read::Clear_views_mode): New enum.
7118 (File_read::View::is_permanent_view): New method.
7119 (File_read::clear_views): Replace bool parameter
7120 with enum; adjust all callers.
7121 * options.h (General_options): Change keep_files_mapped option;
7122 add map_whole_files.
7123 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7124 releasing the file.
7125 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7126 the file.
7127
7128 2010-03-10 David S. Miller <davem@davemloft.net>
7129
7130 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7131
7132 2010-03-09 Sriraman Tallam <tmsriram@google.com>
7133
7134 * icf.cc (get_section_contents): Add '@' marker after processing the
7135 merge reloc.
7136
7137 2010-03-08 Doug Kwan <dougkwan@google.com>
7138
7139 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7140 due to a conversion warning.
7141 (Arm_relobj::update_output_local_symbol_count): Check for local
7142 symbol with unset output index.
7143
7144 2010-03-05 Ian Lance Taylor <iant@google.com>
7145
7146 * options.h (class General_options): Add --spare-dynamic-tags.
7147 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7148 --spare-dynamic-tags.
7149
7150 2010-03-05 Ian Lance Taylor <iant@google.com>
7151
7152 * incremental.cc: Include "libiberty.h".
7153
7154 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7155
7156 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7157 function, is_info_ member.
7158 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7159 (Versions::Versions): Update caller.
7160 (Versions::define_base_version): Likewise.
7161 (Versions::add_def): Likewise.
7162
7163 2010-03-03 Sriraman Tallam <tmsriram@google.com>
7164
7165 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7166 (Scan::possible_function_pointer_reloc): New function.
7167 (Scan::local_reloc_may_be_function_pointer): Change to call
7168 possible_function_pointer_reloc.
7169 (Scan::global_reloc_may_be_function_pointer): Ditto.
7170 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7171 relocations in ".data.rel.ro._ZTV" section.
7172 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7173 * testsuite/icf_safe_so_test.cc: Ditto.
7174 * testsuite/icf_safe_test.cc: Ditto.
7175 * testsuite/icf_safe_test.sh: Ditto.
7176
7177 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7178 Ian Lance Taylor <iant@google.com>
7179
7180 * target-reloc.h (relocate_section): Check the symbol table index
7181 for -1U before setting the local symbol index.
7182 (scan_relocatable_relocs): If copying the relocation, record that
7183 the local symbol is required.
7184 * object.h (Symbol_value::is_output_symtab_index_set): New
7185 function.
7186 (Symbol_value::may_be_discarded_from_output_symtab): New
7187 function.
7188 (Symbol_value::has_output_symtab_entry): New function.
7189 (Symbol_value::needs_output_symtab_entry): Remove.
7190 (Symbol_value::output_symtab_index): Make sure the symbol index is
7191 set.
7192 (Symbol_value::set_output_symtab_index): Make sure the symbol
7193 index is not set. Make sure the new index is valid.
7194 (Symbol_value::set_must_have_output_symtab_entry): New function.
7195 (Symbol_value::has_output_dynsym_entry): New function.
7196 (Symbol_value::set_output_dynsym_index): Make sure the new index
7197 is valid.
7198 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7199 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7200 local symbol if permitted.
7201 (Sized_relobj::do_finalize_local_symbols): Call
7202 is_output_symtab_index_set rather than needs_output_symtab_entry.
7203 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7204 rather than needs_output_symtab_entry. Call
7205 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7206 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7207 is_output_symtab_index_set rather than needs_output_symtab_entry.
7208 * testsuite/discard_locals_relocatable_test.c: New file.
7209 * testsuite/discard_locals_test.sh: Test -r.
7210 * testsuite/Makefile.am (check_DATA): Add
7211 discard_locals_relocatable_test1.syms,
7212 discard_local_relocatable_test2.syms.
7213 (MOSTLYCLEANFILES): Likewise. Also add
7214 discard_locals_relocatable_test1.lout and
7215 discard_locals_relocatable_test2.out.
7216 (discard_locals_relocatable_test1.syms): New target.
7217 (discard_locals_relocatable_test.o): New target.
7218 (discard_locals_relocatable_test1.out): New target.
7219 (discard_locals_relocatable_test2.syms): New target.
7220 (discard_locals_relocatable_test2.out): New target.
7221 (various): Add missing ../ld-new dependencies.
7222 * testsuite/Makefile.in: Rebuild.
7223
7224 2010-03-03 Nick Clifton <nickc@redhat.com>
7225
7226 * po/fi.po: New Finnish translation.
7227
7228 2010-03-01 Doug Kwan <dougkwan@google.com>
7229
7230 * layout.cc (Layout::Layout): Force section types of .init_array*,
7231 .preinit_array* and .fini_array* sections.
7232 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7233 Fix check of return value of std::string::find.().
7234 (Output_section::Input_section_sort_compare::operator()): Remove
7235 comment about .init_array.
7236 (Output_section::Input_section_sort_init_fini_compare::operator()):
7237 New method.
7238 (Output_section::sort_attached_input_sections): Handle .init_array
7239 and .fini_array specially.
7240 * output.h (Output_section::Inut_section_sort_compare): Update
7241 comment.
7242 (Output_section::Input_section_sort_init_fini_compare): New struct.
7243
7244 2010-02-26 Doug Kwan <dougkwan@google.com>
7245
7246 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7247 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7248 * testsuite/debug_msg.sh: Avoid matching source line number for
7249 use of global variable undef_int.
7250
7251 2010-02-26 Doug Kwan <dougkwan@google.com>
7252
7253 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7254 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7255 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7256 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7257 * options.cc (General_options::General_options): Initialize member
7258 fix_v4bx_.
7259 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7260 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7261 and rm_no_fix_v4bx.stdout
7262 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7263 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7264 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7265 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7266 and arm_no_fix_v4bx.
7267 * Makefile.in: Regenerate.
7268 * testsuite/arm_fix_v4bx.s: New file.
7269 * testsuite/arm_fix_v4bx.sh: Ditto.
7270
7271 2010-02-24 Doug Kwan <dougkwan@google.com>
7272
7273 * arm.cc (Target_arm::got_section): Make the .got section the first
7274 non RELRO section in the data segment.
7275 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7276 suffixes of section names.
7277
7278 2010-02-24 Doug Kwan <dougkwan@google.com>
7279
7280 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7281 flags and attributes merging if an input file is a binary file.
7282 * fileread.cc (Input_file::open): Record format of original file.
7283 * fileread.h (Input_file::Format): New enum type.
7284 (Input_file::Input_file): Initialize data member format_.
7285 (Input_file::format): New method definition.
7286 (Input_file::format_):: New data member.
7287
7288 2010-02-24 Doug Kwan <dougkwan@google.com>
7289
7290 * arm.cc (Arm_output_data_got): New class.
7291 (ARM_TCB_SIZE): New constant
7292 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7293 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7294 If user uses a script with a SECTIONS clause, issue only a warning
7295 for a misplaced EXIDX input section. Otherwise, issue an error.
7296 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
7297 garbage collection.
7298 (Target_arm::got_mode_index_entry): Handle static linking.
7299 (Target_arm::Scan::local): Ditto.
7300 (Target_arm::Scan::global): Ditto.
7301 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7302 all incorrectly implemented relocations.
7303 (Target_arm::fix_exidx_coverage): Pass layout to
7304 Arm_output_section::fix_exidx_coverage.
7305 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7306 from ".ARM.exidx." and ".ARM.extab.".
7307
7308 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7309
7310 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7311 section if it does not already exist.
7312 * attributes.cc (Attributes_section_data::Attributes_section_data):
7313 Don't crash if size is zero.
7314
7315 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7316 Ian Lance Taylor <iant@google.com>
7317
7318 * gold.cc (queue_middle_tasks): If no input files were opened,
7319 exit.
7320 * workqueue.h (Task_function::Task_function): Assert that there is
7321 a blocker.
7322
7323 2010-02-22 Doug Kwan <dougkwan@google.com>
7324
7325 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7326 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7327 types to avoid warnings due to different uint64_t implementations
7328 on different hosts.
7329
7330 2010-02-21 Doug Kwan <dougkwan@google.com>
7331
7332 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7333 handling of the maximum backward branch offset.
7334 (Arm_relocate_functions::thumb_branch_common): Ditto.
7335 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7336 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
7337 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
7338 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7339 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7340 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7341 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7342 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7343 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7344 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7345 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7346 thumb2_bl_out_of_range.o): New rules.
7347 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7348 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7349 thumb2_bl_out_of_range
7350 * testsuite/Makefile.in: Regenerate.
7351 * testsuite/arm_bl_in_range.s: New file.
7352 * testsuite/arm_bl_out_of_range.s: Ditto.
7353 * testsuite/arm_branch_in_range.sh: Ditto.
7354 * testsuite/arm_branch_range.t: Ditto.
7355 * testsuite/thumb2_branch_range.t: Ditto.
7356 * testsuite/thumb_bl_in_range.s: Ditto.
7357 * testsuite/thumb_bl_out_of_range.s: Ditto.
7358 * testsuite/thumb_branch_range.t: Ditto.
7359
7360 2010-02-20 Sriraman Tallam <tmsriram@google.com>
7361
7362 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7363 Add reloc offset information.
7364 * icf.cc (get_section_contents): Change iterators to point to the new
7365 vectors. Add reloc offset information to the contents.
7366 * icf.h (Icf::Sections_reachable_info): New typedef.
7367 (Icf::Sections_reachable_list): New typedef.
7368 (Icf::Offset_info): New typedef.
7369 (Icf::Reloc_info): New struct typedef.
7370 (Icf::Reloc_info_list): New typedef.
7371 (Icf::symbol_reloc_list): Delete method.
7372 (Icf::addend_reloc_list): Delete method.
7373 (Icf::section_reloc_list): Delete method.
7374 (Icf::reloc_info_list): New method.
7375 (Icf::reloc_info_list_): New member.
7376
7377 2010-02-19 Doug Kwan <dougkwan@google.com>
7378
7379 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7380 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7381 * arm.cc (Arm_relocation_functions): New forward declaration.
7382 (Target_arm::Target_arm): Initialize new data members
7383 got_mod_index_offset_ and tls_base_symbol_defined_.
7384 (Target_arm::Relocate::relocate_tls): New method.
7385 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7386 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7387 New methods.
7388 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
7389 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7390 (Target_arm::got_mod_index_offset_,
7391 Target_arm::tls_base_symbol_defined_): New data members.
7392 (Target_arm::Scan::local, Target::Scan::global,
7393 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7394 relocations.
7395
7396 2010-02-18 Doug Kwan <dougkwan@google.com>
7397
7398 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7399 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7400 text section as a parameter becuase some broken tools may not set
7401 the link in section header.
7402 (Target_arm::has_got_section): New method.
7403 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7404 without any mapping symbol as data only. Remove warning.
7405 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7406 link in its section header, try to discover the link by inspecting the
7407 REL31 relocation at the beginning of the section.
7408 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7409 in error message.
7410 (Target_arm::Scan::global): Treat any reference to the symbol
7411 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7412
7413 2010-02-12 Sriraman Tallam <tmsriram@google.com>
7414
7415 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7416 (Scan::global_reloc_may_be_function_pointer): New function.
7417 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7418 (Scan::global_reloc_may_be_function_pointer): New function.
7419 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7420 (Scan::global_reloc_may_be_function_pointer): New function.
7421 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7422 (Scan::global_reloc_may_be_function_pointer): New function.
7423 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7424 (Scan::global_reloc_may_be_function_pointer): New function.
7425 (Scan::possible_function_pointer_reloc): New function.
7426 (Target_x86_64::can_check_for_function_pointers): New function.
7427 * gc.h (gc_process_relocs): Scan relocation types to determine if
7428 function pointers were taken for targets that support it.
7429 * icf.cc (Icf::find_identical_sections): Include functions for
7430 folding in safe ICF whose pointer is not taken.
7431 * icf.h (Secn_fptr_taken_set): New typedef.
7432 (fptr_section_id_): New member.
7433 (section_has_function_pointers): New function.
7434 (set_section_has_function_pointers): New function.
7435 (check_section_for_function_pointers): New function.
7436 * options.h: Fix comment for safe ICF option.
7437 * target.h (can_check_for_function_pointers): New function.
7438 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7439 Modify icf_safe_test for X86-64.
7440 * testsuite/Makefile.in: Regenerate.
7441 * testsuite/icf_safe_so_test.cc: New file.
7442 * testsuite/icf_safe_so_test.sh: New file.
7443 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7444 (main): Change to take pointer to function kept_func_3.
7445 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7446 folding is done correctly for X86-64.
7447
7448 2010-02-12 David S. Miller <davem@davemloft.net>
7449
7450 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7451 is_symbolless parameter.
7452 (Output_reloc<SHT_REL>::is_symbolless): New.
7453 (Output_reloc<SHT_REL>::is_symbolless_): New.
7454 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7455 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7456 (Output_reloc<SHT_RELA>::is_symbolless): New.
7457 (Output_data_reloc::add_global): Handle is_symbolless.
7458 (Output_data_reloc::add_global_relative): Likewise.
7459 (Output_data_reloc::add_local): Likewise.
7460 (Output_data_reloc::add_local_relative): Likewise.
7461 (Output_data_reloc::add_symbolless_global_addend): New.
7462 (Output_data_reloc::add_symbolless_local_addend): New.
7463 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7464 is_symbolless.
7465 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7466 instead of ->is_relative_
7467 (Output_reloc::write): Likewise.
7468 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7469 (Output_reloc::write_rel): Simplify.
7470
7471 * sparc.cc (Target_sparc::Scan::local): Use
7472 ->add_symbolless_local_addend as needed.
7473 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7474 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7475 based upon relocation offset.
7476
7477 2010-02-11 Doug Kwan <dougkwan@google.com>
7478
7479 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7480 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7481 beginning of function.
7482 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7483 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7484 parameter is_32bit in calls to should_apply_static_reloc.
7485 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7486 (check_DATA): Add arm_abs_global.stdout.
7487 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7488 arm_abs_global.stdout): New rules.
7489 (MOSTLLYCLEANFILES): Add arm_abs_global
7490 * Makefile.in: Regenerate.
7491 * testsuite/arm_abs_global.s: New file.
7492 * testsuite/arm_abs_global.sh: Ditto.
7493 * testsuite/arm_abs_lib.s: Ditto.
7494
7495 2010-02-11 Ian Lance Taylor <iant@google.com>
7496
7497 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7498 Read_relocs task.
7499 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7500 Allocate_commons_task first.
7501 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7502 task, rather than symtab_lock_.
7503 (Gc_process_relocs::~Gc_process_relocs): New function.
7504 (Gc_process_relocs::is_runnable): Check this_blocker_.
7505 (Gc_process_relocs::locks): Use next_blocker_ rather than
7506 blocker_.
7507 (Scan_relocs::~Scan_relocs): New function.
7508 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7509 symtab_lock_.
7510 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7511 next_blocker_.
7512 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7513 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7514 constructor accordingly.
7515 (class Gc_process_relocs): Likewise.
7516 (class Scan_relocs): Likewise.
7517 * common.h (class Allocate_commons_task): Remove symtab_lock_
7518 field, and corresponding constructor parameter.
7519 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7520 symtab_lock_.
7521 (Allocate_commons_task::locks): Likewise.
7522
7523 2010-02-11 Ian Lance Taylor <iant@google.com>
7524
7525 * gold-threads.h (class Once): Define.
7526 (class Initialize_lock): Rewrite as child of Once.
7527 * gold-threads.cc (class Once_initialize): Define.
7528 (once_pointer_control): New static variable.
7529 (once_pointer, once_arg): New static variables.
7530 (c_run_once): New static function.
7531 (Once::Once, Once::run_once, Once::internal_run): New functions.
7532 (class Initialize_lock_once): Remove.
7533 (initialize_lock_control): Remove.
7534 (initialize_lock_pointer): Remove.
7535 (initialize_lock_once): Remove.
7536 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7537 (Initialize_lock::initialize): Rewrite.
7538 (Initialize_lock::do_run_once): New function.
7539 * archive.cc (Archive::interpret_header): Only clear name if it is
7540 not already empty.
7541 * fileread.cc: Include "gold-threads.h"
7542 (file_counts_lock): New static variable.
7543 (file_counts_initialize_lock): Likewise.
7544 (File_read::release): Only increment counts when using --stats.
7545 Use a lock around the increment.
7546 * parameters.cc (class Set_parameters_target_once): Define.
7547 (set_parameters_target_once): New static variable.
7548 (Parameters::Parameters): Move here from parameters.h.
7549 (Parameters::set_target): Rewrite.
7550 (Parameters::set_target_once): New function.
7551 (Parameters::clear_target): Move here and rewrite.
7552 * parameters.h (class Parameters): Update declarations. Add
7553 set_parameters_target_once_ field.
7554 (Parameters::Parameters): Move to parameters.cc.
7555 (Parameters::clear_target): Likewise.
7556 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7557 task.
7558 (Start_group::~Start_group): New function.
7559 (Start_group::is_runnable): New function.
7560 (Start_group::locks, Start_group::run): New functions.
7561 (Finish_group::run): Change saw_undefined to size_t.
7562 * readsyms.h (class Start_group): Define.
7563 (class Finish_group): Change saw_undefined_ field to size_t.
7564 (Finish_group::Finish_group): Remove saw_undefined and
7565 this_blocker parameters. Change all callers.
7566 (Finish_group::set_saw_undefined): New function.
7567 (Finish_group::set_blocker): New function.
7568 * symtab.h (class Symbol_table): Change saw_undefined to return
7569 size_t. Change saw_undefined_ field to size_t.
7570 * target-select.cc (Set_target_once::do_run_once): New function.
7571 (Target_selector::Target_selector): Initialize set_target_once_
7572 field. Don't initialize lock_ and initialize_lock_ fields.
7573 (Target_selector::instantiate_target): Rewrite.
7574 (Target_selector::set_target): New function.
7575 * target-select.h (class Set_target_once): Define.
7576 (class Target_selector): Update declarations. Make
7577 Set_target_once a friend. Remove lock_ and initialize_lock_
7578 fields. Add set_target_once_ field.
7579
7580 2010-02-10 Ian Lance Taylor <iant@google.com>
7581
7582 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7583 queueing any tasks.
7584 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7585 (queue_middle_tasks): Add all blockers before queueing any tasks.
7586 (queue_final_tasks): Likewise.
7587 * token.h (Task_token::add_blockers): New function.
7588 * object.h (Input_objects::number_of_relobjs): New function.
7589
7590 2010-02-10 Ian Lance Taylor <iant@google.com>
7591
7592 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7593 shared, not if not position independent.
7594 * x86_64.cc (Relocate::relocate_tls): Likewise.
7595 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7596 (tls_pie_pic_test): New target.
7597 * testsuite/Makefile.in: Rebuild.
7598
7599 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7600 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7601 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7602 * testsuite/Makefile.in: Rebuild.
7603
7604 2010-02-09 David S. Miller <davem@davemloft.net>
7605
7606 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7607 R_SPARC_RELATIVE using ->add_local_relative().
7608 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7609
7610 * output.h (Output_data_dynamic::add_section_size): New method
7611 that takes two Output_data objects.
7612 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7613 entry param. Handle it in initializers.
7614 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7615 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7616 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7617 arg.
7618 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7619 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7620 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7621 for dynrel_includes_plt.
7622 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7623 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7624 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7625 before .rela.plt
7626 (Target_sparc::do_finalize_sections): Update to pass true for
7627 dynrel_includes_plt.
7628 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7629 output before .rela.plt
7630 (Target_powerpc::do_finalize_sections): Update to pass true for
7631 dynrel_includes_plt when 32-bit.
7632
7633 2010-02-08 Doug Kwan <dougkwan@google.com>
7634
7635 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7636 method.
7637 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7638 Arm_relobj::scan_section_for_cortex_a8_stubs,
7639 Arm_relobj::do_relocation_section): Instead of calling
7640 Output_section::output_address, use faster
7641 Arm_relobj::simple_input_section_output_address.
7642
7643 2010-02-08 David S. Miller <davem@davemloft.net>
7644
7645 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7646 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7647 relocation helper function.
7648
7649 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7650 just like R_SPARC_GOT{10,13,22}.
7651 (Target_sparc::Scan::local): Likewise.
7652 (Target_sparc::Relocate:relocate): Likewise.
7653
7654 2010-02-06 Ian Lance Taylor <iant@google.com>
7655
7656 * configure.ac: Rewrite targetobjs duplicate removal code to use
7657 only shell constructs.
7658 * configure: Rebuild.
7659
7660 2010-02-05 Doug Kwan <dougkwan@google.com>
7661
7662 PR 11247
7663 * arm.cc (Arm_relobj::section_is_scannable): New method.
7664 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7665 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7666
7667 2010-02-04 Doug Kwan <dougkwan@google.com>
7668
7669 PR 11247
7670 * arm-reloc-property.cc (cstdio): Include.
7671 * configure.ac (targetobjs): Remove duplicates.
7672 * configure: Regenerate.
7673 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7674 big and little endian version for a given address size.
7675
7676 2010-02-03 Doug Kwan <dougkwan@google.com>
7677
7678 * arm-reloc-property.cc
7679 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7680 definition.
7681 * arm-reloc-property.h
7682 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7683 New method definition.
7684 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7685 declaration.
7686 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7687 overflow to N.
7688 (GOT_PREL): Change implemented to Y.
7689 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7690 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7691 (Arm_relocate_functions::movw_abs_nc): Remove method.
7692 (Arm_relocate_functions::movt_abs): Ditto.
7693 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7694 (Arm_relocate_functions::thm_movt_abs): Ditto.
7695 (Arm_relocate_functions::movw_rel_nc): Ditto.
7696 (Arm_relocate_functions::movw_rel): Ditto.
7697 (Arm_relocate_functions::movt_rel): Ditto.
7698 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7699 (Arm_relocate_functions:thm_movw_rel): Ditto.
7700 (Arm_relocate_functions:thm_movt_rel): Ditto.
7701 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7702 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7703 New method definitions.
7704 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7705 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7706 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7707 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7708 (Target_arm::Relocate::relocate): Check for non-static or
7709 unimplemented relocation code and exit early. Change calls to
7710 Target_arm::reloc_uses_thumb_bit and
7711 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7712 instead. Refactor code to handle similar relocations to increase
7713 code sharing. Remove check for unsupported relocation code in switch
7714 statement.
7715 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7716 relocation property table to find out size. Change error message to
7717 print out the name of a relocation code instead of the numeric value.
7718 (Target_arm::scan_reloc_for_stub): Use relocation property table
7719 instead of calling Target_arm::reloc_uses_thumb_bit().
7720
7721 2010-02-02 Doug Kwan <dougkwan@google.com>
7722
7723 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7724 types of relaxed input section.
7725
7726 2010-02-02 Doug Kwan <dougkwan@google.com>
7727
7728 * Makefile.am (HFILES): Add arm-reloc-property.h.
7729 (DEFFILES): New.
7730 (TARGETSOURCES): Add arm-reloc-property.cc
7731 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
7732 (libgold_a_SOURCES): $(DEFFILES)
7733 * Makefile.in: Regenerate.
7734 * arm-reloc-property.cc: New file.
7735 * arm-reloc-property.h: New file.
7736 * arm-reloc.def: New file.
7737 * arm.cc: Update comments.
7738 (arm-reloc-property.h): New included header.
7739 (arm_reloc_property_table): New global variable.
7740 (Target_arm::do_select_as_default_target): New method definition.
7741 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7742 arm-reloc-property to targ_extra_obj.
7743 * parameters.cc (set_parameters_target): Call
7744 Target::select_as_default_target().
7745 * target.h (Target::select_as_default_target): New method definition.
7746 (Target::do_select_as_default_target): Same.
7747
7748 2010-02-01 Doug Kwan <dougkwan@google.com>
7749
7750 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7751 first_output_text_section_.
7752 (Arm_exidx_fixup::first_output_text_section): New method definition.
7753 (Arm_exidx_fixup::first_output_text_section_): New data member.
7754 (Arm_exidx_fixup::process_exidx_section): Record the first text
7755 output section seen.
7756 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7757 and entsize in output section header.
7758
7759 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7760
7761 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7762 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7763 (Arm_relocate_functions::thm_alu11): New Method.
7764 (Arm_relocate_functions::thm_pc8): New Method.
7765 (Arm_relocate_functions::thm_pc12): New Method.
7766 (Target_arm::Scan::local): Handle the relocations.
7767 (Target_arm::Scan::global): Likewise.
7768 (Target_arm::Relocate::relocate): Likewise.
7769 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7770
7771 2010-01-29 Doug Kwan <dougkwan@google.com>
7772
7773 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7774 of relocation types as ld.
7775
7776 2010-01-29 Doug Kwan <dougkwan@google.com>
7777
7778 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7779 to public.
7780 (Arm_relocate_functions::thumb_branch_common): Ditto.
7781 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7782 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7783 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7784 Arm_relocate_functions::jump24): Remove.
7785 (Target_arm::Relocate::relocate): Adjust code to call
7786 Arm_relocation_functions::arm_branch_common and
7787 Arm_relocation_functions::thumb_branch_common instead of their removed
7788 wrappers. Merge switch-cases together to reduce source code size.
7789
7790 2010-01-29 Doug Kwan <dougkwan@google.com>
7791
7792 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7793 output_local_symbol_count_needs_update_.
7794 (Arm_relobj::output_local_symbol_count_needs_update,
7795 Arm_relobj::set_output_local_symbol_count_needs_update,
7796 Arm_relobj::update_output_local_symbol_count): New methods.
7797 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7798 member.
7799 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7800 of pointed function as in a R_ARM_PREL31 relocation.
7801 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7802 for output local symbol count updating.
7803 (Target_arm::do_relax): Update output local symbol counts in objects
7804 if necessary.
7805 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7806
7807 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7808
7809 * arm.cc: Added support for the ARM relocations:
7810 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7811 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7812 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7813 movw_prel_nc).
7814 (Arm_relocate_functions::movw_rel): New method.
7815 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7816 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7817 thm_movw_prel_nc).
7818 (Arm_relocate_functions::thm_movw_rel): New method.
7819 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7820 thm_movt_prel).
7821 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7822 relocations.
7823 (Target_arm::Scan::global): Likewise.
7824 (Target_arm::Relocate::relocate): Likewise.
7825 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7826 Likewise.
7827
7828 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7829
7830 * arm.cc: Added support for ARM group relocations.
7831 (Target_arm::reloc_needs_sym_origin): New method.
7832 (Arm_relocate_functions::calc_grp_kn): New method.
7833 (Arm_relocate_functions::calc_grp_residual): New method.
7834 (Arm_relocate_functions::calc_grp_gn): New method.
7835 (Arm_relocate_functions::arm_grp_alu): New Method.
7836 (Arm_relocate_functions::arm_grp_ldr): New Method.
7837 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7838 (Arm_relocate_functions::arm_grp_ldc): New Method.
7839 (Target_arm::Scan::local): Handle the ARM group relocations.
7840 (Target_arm::Scan::global): Likewise.
7841 (Target_arm::Relocate::relocate): Likewise.
7842 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7843 Likewise.
7844
7845 2010-01-26 Doug Kwan <dougkwan@google.com>
7846
7847 * arm.cc (set): Include.
7848 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7849 pointer type.
7850 (Arm_output_section::Text_section_list): New type.
7851 (Arm_output_section::append_text_sections_to_list): New method.
7852 (Arm_output_section::fix_exidx_coverage): Ditto.
7853 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
7854 (Arm_relobj::convert_input_section_to_relaxed_section): Use
7855 Relobj::set_section_offset() instead of
7856 Sized_relobj::invalidate_section_offset().
7857 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
7858 parameter for section headers. Ignore relocation sections for
7859 unallocated sections and EXIDX sections.
7860 (Target_arm::fix_exidx_coverage): New method.
7861 (Target_arm::output_section_address_less_than): New type.
7862 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7863 linked text section instead of the EXIDX section.
7864 (Arm_output_section::create_stub_group): Add an assertion to check
7865 that this is not an EXIDX output section.
7866 (Arm_output_section::append_text_sections_to_list): New method.
7867 (Arm_output_section::fix_exidx_coverage): Ditto.
7868 (Arm_relobj::scan_sections_for_stubs): Adjust call to
7869 Arm_relobj::section_needs_reloc_stub_scanning.
7870 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7871 first pass.
7872 (Target_arm::fix_exidx_coverage): New method.
7873 * object.h (Relobj::set_output_section): New method.
7874 (Sized_relobj::invalidate_section_offset): Remove method.
7875 (Sized_relobj::do_invalidate_section_offset): Remove method.
7876 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7877
7878 2010-01-25 Doug Kwan <dougkwan@google.com>
7879
7880 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7881 Fix warning due to signed and unsigned comparison on a 32-bit host.
7882
7883 2010-01-22 Doug Kwan <dougkwan@google.com>
7884
7885 * arm.cc (Target_arm::do_relax): Record an output section for section
7886 offset adjustment it contains any stub table that has changed.
7887 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7888 offsets in an output section if necessary.
7889 * output.cc (Output_section::Output_section): Initialize
7890 section_offsets_need_adjustments_.
7891 (Output_section::add_input_section_for_script): Renamed to
7892 Output_section::add_simple_input_section.
7893 (Output_section::save_states): Add a comment.
7894 (Output_section::discard_states): New method defintion.
7895 (Output_section::adjust_section_offsets): Same.
7896 * output.h (Output_section::add_input_section_for_script): Renamed to
7897 Output_section::add_simple_input_section.
7898 (Output_section::discard_states): New method declaration.
7899 (Output_section::adjust_section_offsets): Same.
7900 (Output_section::section_offsets_need_adjustment,
7901 Output_section::set_section_offsets_need_adjustment): New method
7902 definitions.
7903 (Output_section::section_offsets_need_adjustment_): New data member.
7904 * script-sections.cc
7905 (Output_section_element_input::set_section_address): Adjust code for
7906 renaming of Output_section::add_input_section_for_script.
7907 (Orphan_output_section::set_section_address): Same.
7908
7909 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7910
7911 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7912 Fix_v4bx enum values .
7913 * gold/options.h (General_options): New option definitions.
7914 (General_options::fix_v4bx): New method.
7915 (General_options::Fix_v4bx): New enum.
7916 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7917 (General_options::parse_fix_v4bx_interworking): New method.
7918
7919 2010-01-22 Doug Kwan <dougkwan@google.com>
7920
7921 * arm.cc (Arm_exidx_fixup): New class.
7922
7923 2010-01-21 Doug Kwan <dougkwan@google.com>
7924
7925 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7926 classes.
7927 (Arm_exidx_section_offset_map): New type.
7928
7929 2010-01-21 Doug Kwan <dougkwan@google.com>
7930
7931 * arm.cc (Arm_exidx_input_section): New class.
7932 (Arm_relobj::exidx_input_section_by_link,
7933 Arm_relobj::exidx_input_section_by_shndx,
7934 Arm_relobj::make_exidx_input_section): New methods.
7935 (read_arm_attributes_section): Remove.
7936 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7937 information about them.
7938 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7939 to here.
7940
7941 2010-01-20 Doug Kwan <dougkwan@google.com>
7942
7943 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7944 Input_section_specifier to Section_id.
7945 (Target_arm::new_arm_input_section: Adjust code for change of key
7946 type.
7947 (Target_arm::find_arm_input_section): Ditto.
7948 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7949 (Section_id): Remove.
7950 (Garbage_collection::Section_id_hash): Remove.
7951 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7952 (Section_id): Remove.
7953 (Icf::Section_id_hash): Remove.
7954 * object.h (Section_id, Const_section_id, Section_id_hash,
7955 Const_section_id_hash): New type definitions.
7956 * output.cc (Output_section::add_relaxed_input_section): Change to
7957 use Const_section_id instead of Input_section_specifier as key type.
7958 (Output_section::add_merge_input_section): Ditto.
7959 (Output_section::build_relaxation_map): Change to use Section_id
7960 instead of Input_section_specifier as key type.
7961 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7962 Ditto.
7963 (Output_section::convert_input_sections_to_relaxed_sections): Change
7964 to use Const_section_id instead of Input_section_specifier as key type.
7965 (Output_section::find_merge_section): Ditto.
7966 (Output_section::find_relaxed_input_section): Ditto.
7967 * output.h (Input_section_specifier): Remove class.
7968 (Output_section::Output_section_data_by_input_section_map): Change
7969 key type to Const_section_id.
7970 (Output_section::Output_relaxed_input_section_by_input_section_map):
7971 Ditto.
7972 (Output_section::Relaxation_map): Change key type to Section_id.
7973
7974 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7975
7976 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7977 (class Arm_v4bx_stub): New class.
7978 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7979 (Stub_factory::make_arm_v4bx_stub): New method.
7980 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7981 (Stub_table::empty): Handle v4bx stubs.
7982 (Stub_table::add_arm_v4bx_stub): New method.
7983 (Stub_table::find_arm_v4bx_stub): New method.
7984 (Arm_relocate_functions::v4bx): New method.
7985 (Target_arm::fix_v4bx): New method.
7986 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7987 (Stub_table::relocate_stubs): Likewise.
7988 (Stub_table::do_write): Likewise.
7989 (Stub_table::update_data_size_and_addralign): Likewise.
7990 (Stub_table::finalize_stubs): Likewise.
7991 (Target_arm::Scan::local): Likewise.
7992 (Target_arm::Scan::global): Likewise.
7993 (Target_arm::do_finalize_sections): Likewise.
7994 (Target_arm::Relocate::relocate): Likewise.
7995 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7996 Likewise.
7997 (Target_arm::scan_reloc_for_stub): Likewise.
7998 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7999
8000 2010-01-19 Ian Lance Taylor <iant@google.com>
8001
8002 * output.cc (Output_section_headers::do_sized_write): Write large
8003 segment count to sh_info field.
8004 (Output_file_header::do_sized_write): For large segment count,
8005 write PN_XNUM to e_phnum field.
8006
8007 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8008
8009 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8010 (Arm_relocate_functions::thm_jump8): New function.
8011 (Arm_relocate_functions::thm_jump11): New function.
8012 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8013 R_ARM_THM_JUMP11.
8014 (Target_arm::Scan::global): Likewise.
8015 (Target_arm::Relocate::relocate): Likewise.
8016 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8017 Likewise.
8018
8019 2010-01-14 Doug Kwan <dougkwan@google.com>
8020
8021 * arm.cc (map, utility): Include headers.
8022 (Target_arm::apply_cortex_a8_workaround): New method.
8023 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8024 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8025 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8026 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8027 the --[no-]fix-cortex-a8 command line options.
8028 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8029 (Target_arm::relocate_stub): Use addend in instruction template.
8030 * options.h (DEFINE_bool): Set the user-set flag.
8031 (General_options): Add --[no-]-fix-cortex options.
8032 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
8033 : Update fast look-up map after conversion.
8034
8035 2010-01-14 Sriraman Tallam <tmsriram@google.com>
8036
8037 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8038 in the first pass of do_layout.
8039
8040 2010-01-13 Doug Kwan <dougkwan@google.com>
8041
8042 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8043 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8044 apparent compiler problem of not folding static constant integral
8045 data members of elfcpp::Elf_sizes<32>.
8046
8047 2010-01-13 Doug Kwan <dougkwan@google.com>
8048
8049 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8050 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8051 Arm_relobj::scan_section_for_cortex_a8_erratum,
8052 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8053 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8054 sections to scan for relocation stubs into a new method
8055 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8056 relocation and Cortex-A8 stub scanning.
8057 (Target_arm::do_relax): Force stubs to be after stubbed sections
8058 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
8059 the beginning of a new relaxation pass. Update a comment.
8060 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8061
8062 2010-01-12 Ian Lance Taylor <iant@google.com>
8063
8064 * target-reloc.h (visibility_error): New inline function.
8065 (relocate_section): Call visibility_error.
8066 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8067 (MOSTLYCLEANFILES): Likewise.
8068 (protected_4_pic.o, protected_3.err): New targets.
8069 * testsuite/protected_4.cc: New file.
8070
8071 2010-01-12 Doug Kwan <dougkwan@google.com>
8072
8073 * arm.cc (Cortex_a8_reloc): New class.
8074 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8075 and cortex_a8_relocs_info_.
8076 (Target_arm::fix_cortex_a8): New method definition.
8077 (Target_arm::Cortex_a8_relocs_info): New type.
8078 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8079 New data member declarations.
8080 (Target_arm::scan_reloc_for_stub): Record information about
8081 relocations for THUMB branches that might be exempted from the
8082 Cortex-A8 workaround.
8083 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8084 at the beginning of a relaxation pass.
8085
8086 2010-01-12 Doug Kwan <dougkwan@google.com>
8087
8088 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8089 (Arm_relobj::Mapping_symbol_position,
8090 Arm_reloj::Mapping_symbol_position_less,
8091 Arm_relobj::Mapping_symbols_info): New types.
8092 (Target_arm::is_mapping_symbol_name): New method definition.
8093 (Arm_relobj::do_count_local_symbols): Save information about mapping
8094 symbols.
8095
8096 2010-01-11 Doug Kwan <dougkwan@google.com>
8097
8098 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8099 Arm_relocate_functions::thumb32_branch_upper,
8100 Arm_relocate_functions::thumb32_branch_lower,
8101 Arm_relocate_functions::thumb32_cond_branch_offset,
8102 Arm_relocate_functions::thumb32_cond_branch_upper,
8103 Arm_relocate_functions::thumb32_cond_branch_lower,
8104 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8105 branch offset encoding.
8106 (Arm_relocate_functions::thumb_branch_common): Use new branch
8107 offset encoding methods to avoid code duplication.
8108 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8109 (Stub_addend_reader::operator()): Use new branch encoding method
8110 to avoid code duplication.
8111
8112 2010-01-11 Doug Kwan <dougkwan@google.com>
8113
8114 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8115 (Target_arm::do_finalize_sections): Define special EXIDX section
8116 symbols only if referenced.
8117 * gc.h (Garbage_collection::add_reference): New method.
8118 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8119 code duplication.
8120
8121 2010-01-11 Ian Lance Taylor <iant@google.com>
8122
8123 * script.cc (Version_script_info::build_expression_list_lookup):
8124 Change complaing about duplicate wildcard match from error to
8125 warning.
8126
8127 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8128 of 2009-12-30.
8129 (Version_script_info::Version_script_info): Initialize globs_,
8130 default_version_, default_is_global_, and exact_. Don't
8131 initialize globals_ or locals_.
8132 (Version_script_info::build_lookup_tables): Build local symbols
8133 first.
8134 (Version_script_info::unquote): New function.
8135 (Version_script_info::add_exact_match): New function.
8136 (Version_script_info::build_expression_list_lookup): Remove lookup
8137 parameter. Add is_global parameter. Change all callers. Handle
8138 wildcard pattern specially. Unquote pattern. Call
8139 add_exact_match.
8140 (Version_script_info::get_name_to_match): New function.
8141 (Version_script_info::get_symbol_version): New function.
8142 (Version_script_info::get_symbol_version_helper): Remove.
8143 (Version_script_info::check_unmatched_names): Call unquote.
8144 * script.h (class Version_script_info): Change get_symbol_version
8145 to be non-inline and add is_global parameter; change all callers.
8146 Rewrite symbol_is_local. Update declarations. Define struct
8147 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8148 Remove globals_ and locals_ members. Add exact_, globs_,
8149 default_version_, is_global_.
8150 (Version_script_info::Glob): Remove pattern, add expression and
8151 is_global. Update constructor. Change all callers.
8152 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8153 default version.
8154 (Versions::symbol_section_contents): If a symbol is undefined, or
8155 defined in a dynamic object, set the version index to
8156 VER_NDX_LOCAL.
8157 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8158 symbol_is_local.
8159 (Symbol_table::add_from_pluginobj): Likewise.
8160 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8161
8162 2010-01-11 Doug Kwan <dougkwan@google.com>
8163
8164 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8165 (incremental_dump_LDADD): Add linking option for libintl.
8166 * Makefile.in: Regenerate.
8167
8168 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8169
8170 PR gold/11144
8171 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8172 instead of -Ds.
8173 * testsuite/Makefile.in: Regenerated.
8174
8175 2010-01-10 Doug Kwan <dougkwan@google.com>
8176
8177 * options.h (DEFINE_var): Use parentheses around argument varname__
8178 in macro body to avoid any unintended subsequent substitutions.
8179
8180 2010-01-10 Ian Lance Taylor <iant@google.com>
8181
8182 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8183 candidates before doing symbol resolution.
8184
8185 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8186 ODR candidates if only one is weak.
8187
8188 2010-01-08 Ian Lance Taylor <iant@google.com>
8189
8190 * script.cc (Version_script_info::build_expression_list_lookup):
8191 Don't warn about ambiguous version, just record the ambiguity.
8192 (Version_script_info::get_symbol_version_helper): Give error if
8193 version is ambiguous.
8194
8195 2010-01-08 Doug Kwan <dougkwan@google.com>
8196
8197 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
8198 prev_data_size_ and prev_addralign_. Remove initializer for
8199 deleted data member has_been_changed_.
8200 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8201 to determine if the table is empty.
8202 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8203 Remove.
8204 (Stub_table::add_reloc_stub): Define method in class definition
8205 instead of just declaring it there.
8206 (Stub_table::add_cortex_a8_stub): New method definition.
8207 (Stub_table::update_data_size_and_addralign): Ditto.
8208 (Stub_table::finalize_stubs): Ditto.
8209 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8210 (Stub_table::do_addralign_): Return address alignment in the
8211 (Stub_table::do_reset_address_and_file_offset): Define method in
8212 class definition instead of declaring it there. Set current data
8213 size to be the data size of the previous pass.
8214 (Stub_table::set_final_data_size): Use current data size as the
8215 final data size.
8216 (Stub_table::relocate_stub): Change parameter type of stub from
8217 Reloc_stub pointer to Stub pointer.
8218 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8219 (Stub_table::Cortex_a8_stub_list): New typedef.
8220 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8221 Stub_table::prev_addralign_): New data member.
8222 (Arm_relobj::Arm_relobj): Initialize data member
8223 section_has_cortex_a8_workaround_.
8224 (Arm_relobj::section_has_cortex_a8_workaround,
8225 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8226 definitions.
8227 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8228 declarations.
8229 (Target_arm::relocate_stub): Change parameter type of stub from
8230 Reloc_stub pointer to Stub pointer.
8231 (Insn_template::size, Insn_template::alignment): Handle
8232 THUMB16_SPECIAL_TYPE.
8233 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8234 Stub_table::update_data_size_and_addralign,
8235 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8236 definitions.
8237 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8238 (Stub_table::do_write): Ditto.
8239 (Target_arm::do_relax): Adjust code for changes in Stub_table.
8240
8241 2010-01-08 Ian Lance Taylor <iant@google.com>
8242
8243 PR 11108
8244 * symtab.h (class Symbol): Remove fields is_target_special_ and
8245 has_plt_offset_. Add field is_defined_in_discarded_section_.
8246 (Symbol::is_defined_in_discarded_section): New function.
8247 (Symbol::set_is_defined_in_discarded_section): New function.
8248 (Symbol::has_plt_offset): Rewrite.
8249 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8250 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8251 Don't initialize is_target_special_ or has_plt_offset_.
8252 Initialize is_defined_in_discarded_section_.
8253 (Symbol_table::add_from_relobj): If appropriate, set
8254 is_defined_in_discarded_section.
8255 * resolve.cc (Symbol::override_base_with_special): Don't test
8256 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8257 * target-reloc.h (relocate_section): Do special handling for
8258 symbols defined in discarded sections for global symbols as well
8259 as local symbols.
8260
8261 2010-01-08 Ian Lance Taylor <iant@google.com>
8262
8263 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8264 the SHT_SYMTAB case.
8265
8266 2010-01-08 Ian Lance Taylor <iant@google.com>
8267
8268 * object.cc (Sized_relobj::do_layout): Don't get confused if
8269 layout_eh_frame returns NULL.
8270
8271 2010-01-08 Ian Lance Taylor <iant@google.com>
8272
8273 PR 11084
8274 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8275 dynamic symbol table, use the normal symbol table.
8276 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8277 symbol table.
8278
8279 2010-01-08 Ian Lance Taylor <iant@google.com>
8280
8281 PR 11072
8282 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8283 sections.
8284
8285 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8286
8287 * version.cc (print_version): Change to "Copyright 2010".
8288
8289 2010-01-08 Ian Lance Taylor <iant@google.com>
8290
8291 PR 10287
8292 PR 11063
8293 * i386.cc (class Target_i386): Change return type of plt_section
8294 to be non-const.
8295 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8296 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8297 tls_desc_rel_ field.
8298 (Output_data_plt_i386::rel_tls_desc): New function.
8299 (Target_i386::rel_tls_desc_section): New function.
8300 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8301 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8302 R_386_TLS_DESC reloc in rel_tls_desc_section.
8303 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8304 Define struct Tlsdesc_info.
8305 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8306 (Target_x86_64::do_reloc_symbol_index): New function.
8307 (Target_x86_64::add_tlsdesc_info): New function.
8308 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8309 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8310 tlsdesc_rel_ field.
8311 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8312 all callers.
8313 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8314 (Target_x86_64::rela_tlsdesc_section): New function.
8315 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8316 handling.
8317 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8318 (Target_x86_64::do_reloc_addend): New function.
8319 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8320 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8321 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8322 (Output_reloc::type): New function.
8323 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8324 (Output_reloc::is_target_specific): New function.
8325 (Output_reloc::target_arg): New function.
8326 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8327 absolute relocs and target specific relocs.
8328 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8329 add_target_specific.
8330 (class Output_data_reloc) [SHT_RELA]: Likewise.
8331 * output.cc (Output_reloc::Output_reloc): Add four new versions
8332 for absolute relocs and target specific relocs.
8333 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8334 (Output_reloc::get_symbol_index): Likewise.
8335 (Output_reloc::local_section_offset): Check that local_sym_index_
8336 is not TARGET_CODE or 0.
8337 (Output_reloc::symbol_value): Likewise.
8338 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8339 reloc.
8340 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8341 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8342 functions.
8343 * layout.cc (add_target_dynamic_tags): Use output section for
8344 DT_PLTRELSZ and DT_JMPREL.
8345
8346 2010-01-07 Ian Lance Taylor <iant@google.com>
8347
8348 PR 11061
8349 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8350 function.
8351 (class Output_data_reloc_generic): Define.
8352 (class Output_data_reloc_base): Change base class to
8353 Output_data_reloc_generic. Change add() method to call
8354 bump_relative_reloc_count for a relative reloc. Remove
8355 sort_relocs_ field.
8356 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8357 to sort_relocs().
8358 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8359 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8360 appropriate.
8361 * layout.h (class Layout): Update declaration.
8362
8363 2010-01-07 Ian Lance Taylor <iant@google.com>
8364
8365 * output.h (class Output_data): Add const version of
8366 output_section and do_output_section.
8367 (class Output_section_data): Add const version of
8368 do_output_section.
8369 (class Output_section): Likewise.
8370 * layout.cc (Layout::add_target_dynamic_tags): New function.
8371 * layout.h (class Layout): Update declarations.
8372 * arm.cc (Target_arm::do_finalize_sections): Use
8373 add_target_dynamic_tags.
8374 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8375 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8376 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8377 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8378
8379 2010-01-07 Ian Lance Taylor <iant@google.com>
8380
8381 PR 11042
8382 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8383 object as needed.
8384
8385 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8386 Ian Lance Taylor <iant@google.com>
8387
8388 PR 11019
8389 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8390 Xindex::read_symtab_xindex.
8391
8392 2010-01-07 Doug Kwan <dougkwan@google.com>
8393
8394 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8395 (Insn_template::thumb16_bcond_insn): New method declaration.
8396 (Insn_template): Fix spelling.
8397 (Stub::thumb16_special): New method declaration.
8398 (Stub::do_write): Define virtual method which was previously pure
8399 virtual.
8400 (Stub::do_thumb16_special): New method declaration.
8401 (Stub::do_fixed_endian_write): New template member.
8402 (Reloc_stub::do_write): Remove.
8403 (Reloc_stub::do_fixed_endian_write): Remove.
8404 (Cortex_a8_stub): New class definition.
8405 (Stub_factory::make_cortex_a8_stub): New method definition.
8406 (Stub_factory::Stub_factory): Add missing static storage class
8407 qualifier for elf32_arm_stub_a8_veneer_blx.
8408
8409 2010-01-07 Ian Lance Taylor <iant@google.com>
8410
8411 PR 10980
8412 * options.h (class General_options): Add --warn-unresolved-symbols
8413 and --error-unresolved-symbols.
8414 * errors.cc (Errors::undefined_symbol): Implement
8415 --warn-unresolved-symbols.
8416
8417 * options.h (class General_options): Add -z text and -z textoff.
8418 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8419
8420 2010-01-06 Sriraman Tallam <tmsriram@google.com>
8421
8422 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8423 (Garbage_collection::cident_sections): New function.
8424 (Garbage_collection::add_cident_section): New function.
8425 (Garbage_collection::cident_sections_): New member.
8426 (gc_process_relocs): Add references to sections whose names are C
8427 identifiers.
8428 * gold.h (cident_section_start_prefix): New constant.
8429 (cident_section_stop_prefix): New constant.
8430 (is_cident): New function.
8431 * layout.cc (Layout::define_section_symbols): Replace string constants
8432 with the newly defined constants.
8433 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8434 C identifiers.
8435 * testsuite/Makefile.am: Add gc_orphan_section_test.
8436 * testsuite/Makefile.in: Regenerate.
8437 * testsuite/gc_orphan_section_test.cc: New file.
8438 * testsuite/gc_orphan_section_test.sh: New file.
8439
8440 2010-01-06 Ian Lance Taylor <iant@google.com>
8441
8442 PR 10980
8443 * options.h (class General_options): Add --warn-shared-textrel.
8444 * layout.cc (Layout::finish_dynamic_section): Implement
8445 --warn-shared-textrel.
8446
8447 PR 10980
8448 * options.h (class General_options): Add --warn-multiple-gp.
8449
8450 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8451
8452 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8453 $(THREADSLIB) and $(LIBDL).
8454 * Makefile.in: Rebuild.
8455
8456 2010-01-06 Ian Lance Taylor <iant@google.com>
8457
8458 PR 10980
8459 * options.cc (General_options::parse_section_start): New function.
8460 (General_options::section_start): New function.
8461 (General_options::General_options): Initialize all members.
8462 * options.h: Include <map>
8463 (class General_options): Add --section-start. Add section_starts_
8464 member.
8465 * layout.cc (Layout::attach_allocated_section_to_segment): If
8466 --section-start was used, set the address of the segment. Remove
8467 local sort_sections.
8468 (Layout::relaxation_loop_body): If the address of the load segment
8469 has been set by --section-start, don't use it.
8470 * output.h (Output_segment::update_flags_for_output_section): New
8471 function.
8472 * output.cc (Output_segment::add_output_section): Call
8473 update_flags_for_output_section.
8474
8475 2010-01-05 Ian Lance Taylor <iant@google.com>
8476
8477 PR 10980
8478 * options.h (class General_options): Add --undefined-version.
8479 * script.cc (struct Version_expression): Add was_matched_by_symbol
8480 field.
8481 (Version_script_info::matched_symbol): New function.
8482 (Version_script_info::get_symbol_version_helper): Call
8483 matched_symbol.
8484 (Version_script_info::check_unmatched_names): New function.
8485 * script.h (class Version_script_info): Update declarations.
8486 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8487
8488 * options.h (class General_options): Use DEFINE_bool_alias for
8489 allow_multiple_definition.
8490 * resolve.cc (Symbol_table::should_override): Don't test
8491 allow_multiple_definition.
8492
8493 PR 10980
8494 * options.h (class General_options): Add --cref.
8495 * main.cc (main): Print cref table if --cref. Don't close mapfile
8496 until after printing cref table.
8497 * cref.cc: Include "symtab.h".
8498 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8499 (Cref_table_compare::operator()): New function.
8500 (Cref_inputs::gather_cref): New function.
8501 (filecol): New static const.
8502 (Cref_inputs::print_cref): New function.
8503 (Cref::print_cref): New function.
8504 * cref.h: Include <cstdio>.
8505 (class Cref): Update declarations.
8506 * mapfile.h (Mapfile::file): New function.
8507 * object.h (class Object): Define Symbols. Declare virtual
8508 do_get_global_symbols.
8509 (Object::get_global_symbols): New function.
8510 * object.cc (Input_objects::add_object): Pass object to cref_ if
8511 --cref.
8512 (Input_objects::archive_start): Likewise.
8513 (Input_objects::archive_stop): Likewise.
8514 (Input_objects::print_cref): New function.
8515 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8516 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8517 --cref.
8518 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8519 function.
8520 * plugin.h (class Sized_pluginobj): Update declarations.
8521
8522 2010-01-05 Ian Lance Taylor <iant@google.com>
8523
8524 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8525 to is_default_version. Rename insdef to insdefault.
8526 (Symbol_table::add_from_relobj): Rename def to is_default_version
8527 and local to is_forced_local.
8528 (Symbol_table::add_from_pluginobj): Likewise.
8529 (Symbol_table::add_from_dynobj): Likewise.
8530 (Symbol_table::define_special_symbol): Rename insdef to
8531 insdefault.
8532
8533 2010-01-04 Ian Lance Taylor <iant@google.com>
8534
8535 PR 10980
8536 * options.h (class General_options): Add
8537 --allow-multiple-definition and -z muldefs.
8538 * resolve.cc (Symbol_table::should_override): Don't warn about a
8539 multiple symbol definition if --allow-multiple-definition or -z
8540 muldefs.
8541
8542 PR 10980
8543 * options.h (class General_options): Add --add-needed and
8544 --copy-dt-needed-entries. Tweak --as-needed help entry.
8545 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8546 error if --copy-dt-needed-entries aka --add-needed is used and
8547 would cause a change in behaviour.
8548
8549 PR 10980
8550 * options.h (class General_options): Add -G as a short version of
8551 --shared. Add no-op options -assert, -g, and -i.
8552
8553 2010-01-04 Sriraman Tallam <tmsriram@google.com>
8554
8555 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8556 check for .text or .gnu.linkonce.t sections.
8557 * icf.cc (Icf::find_identical_sections): Ditto.
8558 Change the detection for mangled function name within the section
8559 name.
8560 * icf.h (is_section_foldable_candidate): New function.
8561
8562 2009-12-30 Ian Lance Taylor <iant@google.com>
8563
8564 PR 10980
8565 * options.h (class General_options): Permit two dashes with
8566 --retain-symbols-file.
8567
8568 2009-12-30 Ian Lance Taylor <iant@google.com>
8569
8570 PR 10979
8571 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8572 don't put the file header and segment headers in the text
8573 segment.
8574
8575 PR 10979
8576 * common.cc (Sort_commons::operator()): Stabilize sort when both
8577 entries are NULL.
8578 (Symbol_table::do_allocate_commons_list): When allocating common
8579 symbols, skip a symbol which is no longer common.
8580 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8581 an object before checking its type.
8582 * testsuite/common_test_2.c: New file.
8583 * testsuite/common_test_3.c: New file.
8584 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8585 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8586 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8587 (common_test_2_pic.o, common_test_2.so): New targets.
8588 (common_test_3_pic.o, common_test_3.so): New targets.
8589 * testsuite/Makefile.in: Rebuild.
8590
8591 PR 10979
8592 * script.cc (read_input_script): If we see a new SECTIONS clause,
8593 and we have added an input section, give an error.
8594 * layout.h (class Layout): Add have_added_input_section function.
8595 Add have_added_input_section_ field.
8596 * layout.cc (Layout::Layout): Initialize
8597 have_added_input_section_.
8598 (Layout::layout): Set have_added_input_section_.
8599 (Layout::layout_eh_frame): Likewise.
8600
8601 2009-12-30 Ian Lance Taylor <iant@google.com>
8602
8603 PR 10931
8604 * options.h (class General_options): Add --sort-common option.
8605 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8606 * common.cc (Sort_common): Add sort_order parameter to
8607 constructor. Add sort_order_ field.
8608 (Sort_commons::operator): Check sort_order_.
8609 (Symbol_table::allocate_commons): Determine the sort order.
8610 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8611 Change all callers.
8612 (Symbol_table::do_allocate_commons_list): Likewise.
8613
8614 2009-12-30 Ian Lance Taylor <iant@google.com>
8615
8616 PR 10916
8617 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8618 symbols from this object, don't change the visibility of an
8619 undefined symbol.
8620 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8621
8622 2009-12-30 Ian Lance Taylor <iant@google.com>
8623
8624 PR 10861
8625 * script.h (class Version_script_info): Define Language enum.
8626 Update declarations. Define Glob, Exact, and Lookup types. Add
8627 new fields globals_, locals_, and is_finalized_.
8628 * script.cc: Various formatting fixes.
8629 (class Parser_closure): Change language_stack_ from a vector of
8630 std::string to one of Version_script_info::Language. Adjust all
8631 uses accordingly.
8632 (class Lazy_demangler): Remove.
8633 (struct Version_expression): Change language from std::string to
8634 Version_script_info::Language.
8635 (Version_script_info::Version_script_info): New function.
8636 (Version_script_info::~Version_script_info): Don't call clear.
8637 (Version_script_info::finalize): New function.
8638 (Version_script_info::build_lookup_tables): New function.
8639 (Version_script_info::build_expression_list_lookup): New
8640 function.
8641 (Version_script_info::get_symbol_version_helper): Rewrite to use
8642 lookup tables.
8643 (Version_script_info::print_expression_list): Adjust to use
8644 Version_script_info::Language.
8645 (script_push_lex_into_version_mode): Check that the version script
8646 has not been finalized.
8647 (version_script_push_lang): Change language string to
8648 Version_script_info::Language.
8649 * options.cc (Command_line::version_script): New function.
8650 * options.h (class General_options): Add finalize_dynamic_list
8651 function. Change version_script from declaration to definition.
8652 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8653 * testsuite/version_script.map: Remove duplicate def of foo.
8654 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8655 version_script.map.
8656 * testsuite/Makefile.in: Rebuild.
8657
8658 2009-12-30 Ian Lance Taylor <iant@google.com>
8659
8660 PR 10843
8661 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8662 if the input symbol index is 0, make the output symbol index 0.
8663
8664 2009-12-30 Ian Lance Taylor <iant@google.com>
8665
8666 PR 10670
8667 * options.h (class General_options): Add -x/--discard-all.
8668 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8669 --discard-all. If the local symbol needs a dynamic entry, check
8670 that before handling --discard-locals.
8671
8672 2009-12-30 Ian Lance Taylor <iant@google.com>
8673
8674 PR 10450
8675 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8676 flags to PF_R.
8677 (Output_segment::add_output_section): Don't change the flags if
8678 the type is PT_TLS.
8679
8680 PR 10450
8681 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8682 GNU hash table if they need a dynamic value. Otherwise, don't add
8683 them if they are defined in a dynamic object or are forced local.
8684
8685 2009-12-29 Ian Lance Taylor <iant@google.com>
8686
8687 PR 10450
8688 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8689 .gnu.hash table for a 32-bit target.
8690
8691 PR 10450
8692 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8693 regular and a dynamic object only needs a dynamic symbol table
8694 entry if it is externally visible.
8695
8696 PR 10450
8697 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8698 constructor. Add global_offset_table_ field.
8699 (Target_i386::got_section): Set global_offset_table_.
8700 (Target_i386::do_finalize_sections): Set global_offset_table_
8701 size.
8702 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8703 in constructor. Add global_offset_table_ field.
8704 (Target_x86_64::got_section): Set global_offset_table_.
8705 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8706 size.
8707
8708 * layout.cc (Layout::Layout): Initialize increase_relro_.
8709 (Layout::get_output_section): Add is_relro, is_last_relro, and
8710 is_first_non_relro parameters. Change all callers.
8711 (Layout::choose_output_section): Likewise.
8712 (Layout::add_output_section_data): Likewise.
8713 (Layout::make_output_section): Likewise.
8714 (Layout::set_segment_offsets): Clear increase_relro when using a
8715 linker script.
8716 * layout.h (class Layout): Add increase_relro method. Add
8717 increase_relro_ field. Update declarations.
8718 * output.cc (Output_section::Output_section): Initialize
8719 is_last_relro_ and is_first_non_relro_.
8720 (Output_segment::add_output_section): Group relro sections is
8721 do_sort is true. Handle is_last_relro and is_first_non_relro.
8722 (Output_segment::maximum_alignment): Remove relro handling.
8723 (Output_segment::set_section_addresses): Add increase_relro
8724 parameter. Change all callers. Add initial alignment to align
8725 relro sections on separate page. Remove old relro handling.
8726 (Output_segment::set_section_list_addresses): Remove in_relro
8727 parameter. Change all callers.
8728 (Output_segment::set_offset): Add increase parameter. Change all
8729 callers. Remove old relro handling.
8730 * output.h (class Output_section): Add new methods: is_last_relro,
8731 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8732 Add is_last_relro_ and is_first_non_relro_ fields.
8733 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8734 Create separate .got.plt section. Call increase_relro.
8735 * x86_64.cc (Target_x86_64::got_section): Likewise.
8736 * testsuite/relro_script_test.t: Add .got.plt.
8737
8738 PR 10450
8739 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8740 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8741 (Layout::finalize): Call set_dynamic_symbol_size.
8742 (Layout::set_dynamic_symbol_size): New function.
8743 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8744 set_dynamic_symbol_size.
8745
8746 PR 10450
8747 * output.h (class Output_section): Add is_entsize_zero_ field.
8748 * output.cc (Output_section::Output_section): Initialize
8749 is_entsize_zero_.
8750 (Output_section::set_entsize): If two different entsizes are
8751 requested, force it to zero.
8752 (Output_section::add_input_section): Set flags for .debug_str
8753 before updating section flags. Set entsize.
8754 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8755 and SHF_STRING if all input sections have those flags.
8756
8757 2009-12-29 Rafael Espindola <espindola@google.com>
8758
8759 * main.cc (main): Fix the sys time reporting.
8760 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8761 reporting.
8762
8763 2009-12-29 Sriraman Tallam <tmsriram@google.com>
8764
8765 * options.cc (General_options::parse_version): Allow -v to exit
8766 without an error if there is nothing to link.
8767
8768 2009-12-29 Ian Lance Taylor <iant@google.com>
8769
8770 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8771 using a version of gcc before 4.1.
8772 * configure: Rebuild.
8773
8774 2009-12-28 Chris Demetriou <cgd@google.com>
8775
8776 * attributes.cc (Output_attributes_section_data::do_write): Use
8777 std::vector::front rather than std::vector::data.
8778
8779 2009-12-28 Ian Lance Taylor <iant@google.com>
8780
8781 * symtab.h (class Symbol_table): Add enum Defined.
8782 * resolve.cc (Symbol_table::should_override): Add defined
8783 parameter. Change all callers. Test whether object is NULL
8784 before calling a method on it.
8785 (Symbol_table::report_resolve_problem): Add defined parameter.
8786 Change all callers.
8787 (Symbol_table::should_override_with_special): Likewise.
8788 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8789 parameter. Change all callers.
8790 (Symbol_table::do_define_in_output_data): Likewise.
8791 (Symbol_table::define_in_output_segment): Likewise.
8792 (Symbol_table::do_define_in_output_segment): Likewise.
8793 (Symbol_table::define_as_constant): Likewise.
8794 (Symbol_table::do_define_as_constant): Likewise.
8795 * script.h (class Symbol_assignment): Add is_defsym parameter to
8796 constructor; change all callers.
8797 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8798 parameter. Change all callers. Add is_defsym_ field.
8799 (class Parser_closure): Add parsing_defsym parameter to
8800 constructor; change all callers. Add parsing_defsym accessor
8801 function. Add parsing_defsym_ field.
8802
8803 2009-12-28 Ian Lance Taylor <iant@google.com>
8804
8805 * gold.cc (queue_middle_tasks): Fix formatting.
8806 * object.cc (Relobj::is_section_name_included): Likewise.
8807
8808 2009-12-23 Ian Lance Taylor <iant@google.com>
8809
8810 * i386.cc (Target_i386::do_calls_non_split): Recognize
8811 -fsplit-stack prologue for a function with a static chain.
8812 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8813 -fsplit-stack prologue when using %r11.
8814
8815 2009-12-21 Sriraman Tallam <tmsriram@google.com>
8816
8817 * options.cc (General_options::parse_version): Make -v continue and do
8818 the link like GNU ld does.
8819
8820 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
8821
8822 * Makefile.am (CCFILES): Add timer.cc.
8823 (HFILES): Add timer.h.
8824 * configure.ac: Check for sysconf and times.
8825 * main.cc: include timer.h.
8826 (main): Use Timer instead of get_run_time.
8827 * timer.cc: New.
8828 * timer.h: New.
8829 * workqueue.cc: include timer.h.
8830 (Workqueue::find_and_run_task):
8831 Report user, sys and wall time.
8832 * Makefile.in: Regenerate.
8833 * config.in: Regenerate.
8834 * configure: Regenerate.
8835
8836 2009-12-16 Doug Kwan <dougkwan@google.com>
8837
8838 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8839 sections.
8840 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8841 relaxed input sections.
8842 * output.cc (Output_section::find_relaxed_input_section): Change
8843 return type to Output_relaxed_input_section pointer. Adjust code
8844 for new type of relaxed_input_section_map_.
8845 * output.h (Output_section::find_relaxed_input_section): Change
8846 return type to Output_relaxed_input_section pointer.
8847 (Output_section::Output_relaxed_input_section_by_input_section_map):
8848 New type.
8849 (Output_section::relaxed_input_section_map_): Change type to
8850 Output_section::Output_relaxed_input_section_by_input_section_map.
8851 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8852 input section.
8853
8854 2009-12-15 Ian Lance Taylor <iant@google.com>
8855
8856 * layout.cc (Layout::create_shstrtab): Only write out after input
8857 sections if we are compressing debug sections.
8858
8859 2009-12-15 Ian Lance Taylor <iant@google.com>
8860
8861 * archive.cc (Archive::add_symbols): Only look up a symbol without
8862 a version if there is, in fact, a version.
8863
8864 2009-12-14 Ian Lance Taylor <iant@google.com>
8865
8866 Revert -Wshadow changes, all changes from:
8867 2009-12-11 Doug Kwan <dougkwan@google.com>
8868 2009-12-11 Nick Clifton <nickc@redhat.com>
8869 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8870
8871 2009-12-11 Doug Kwan <dougkwan@google.com>
8872
8873 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8874 due to -Wshadow.
8875 * attributes.cc (Object_attribute::size): Ditto.
8876 (Attributes_section_data::size): Ditto.
8877 (Attributes_section_data::Attributes_section_data): Ditto.
8878 (Output_attributes_section_data::do_write): Ditto.
8879 * attributes.h (Object_attribute::set_type): Ditto.
8880 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8881
8882 2009-12-11 Nick Clifton <nickc@redhat.com>
8883
8884 * archive.cc: Fix shadowed variable warnings.
8885 * arm.cc: Likewise.
8886 * compressed_output.cc: Likewise.
8887 * compressed_output.h: Likewise.
8888 * configure: Likewise.
8889 * dwarf_reader.cc: Likewise.
8890 * dynobj.cc: Likewise.
8891 * dynobj.h: Likewise.
8892 * ehframe.cc: Likewise.
8893 * ehframe.h: Likewise.
8894 * errors.cc: Likewise.
8895 * expression.cc: Likewise.
8896 * fileread.cc: Likewise.
8897 * fileread.h: Likewise.
8898 * freebsd.h: Likewise.
8899 * i386.cc: Likewise.
8900 * icf.cc: Likewise.
8901 * incremental.h: Likewise.
8902 * layout.cc: Likewise.
8903 * layout.h: Likewise.
8904 * mapfile.cc: Likewise.
8905 * merge.cc: Likewise.
8906 * merge.h: Likewise.
8907 * object.cc: Likewise.
8908 * object.h: Likewise.
8909 * options.h: Likewise.
8910 * output.cc: Likewise.
8911 * output.h: Likewise.
8912 * parameters.cc: Likewise.
8913 * plugin.cc: Likewise.
8914 * powerpc.cc: Likewise.
8915 * reduced_debug_output.cc: Likewise.
8916 * reduced_debug_output.h: Likewise.
8917 * reloc.cc: Likewise.
8918 * reloc.h: Likewise.
8919 * resolve.cc: Likewise.
8920 * script-sections.cc: Likewise.
8921 * script.cc: Likewise.
8922 * script.h: Likewise.
8923 * sparc.cc: Likewise.
8924 * symtab.cc: Likewise.
8925 * symtab.h: Likewise.
8926 * target-select.cc: Likewise.
8927 * target-select.h: Likewise.
8928 * token.h: Likewise.
8929 * workqueue.cc: Likewise.
8930 * workqueue.h: Likewise.
8931 * x86_64.cc: Likewise.
8932
8933 2009-12-10 Doug Kwan <dougkwan@google.com>
8934
8935 * arm.cc (attributes.h): New include.
8936 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8937 (Arm_relobj::~Arm_relobj): Delete object pointed by
8938 attributes_section_data_.
8939 (Arm_relobj::attributes_section_data): New method definition.
8940 (Arm_relobj::attributes_section_data_): New data member declaration.
8941 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8942 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8943 attributes_section_data_.
8944 (Arm_dynobj::attributes_section_data): New method definition.
8945 (Arm_dynobj::attributes_section_data_): New data member declaration.
8946 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8947 initialization value of may_use_blx_ to false.
8948 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
8949 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8950 object attributes to compute results instead of hard-coding.
8951 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8952 Target_arm::get_secondary_compatible_arch,
8953 Target_arm::set_secondary_compatible_arch
8954 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8955 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8956 New method declarations.
8957 (Target_arm::get_aeabi_object_attribute): New method definition.
8958 (Target_arm::attributes_section_data_): New data member declaration.
8959 (read_arm_attributes_section): New template definition.
8960 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8961 (Arm_dynobj::do_read_symbols): Ditto.
8962 (Target_arm::do_finalize_sections): Merge attributes sections from
8963 input. Check for BLX use after attributes section merging.
8964 Fix __exidx_start and __exidx_end visibility. Create an
8965 .ARM.attributes section if necessary.
8966 (Target_arm::get_secondary_compatible_arch,
8967 Target_arm::set_secondary_compatible_arch,
8968 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8969 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
8970 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
8971 New method definitions.
8972
8973 2009-12-09 Ian Lance Taylor <iant@google.com>
8974
8975 * plugin.cc (Plugin::load): Don't cast from void* to a function
8976 pointer.
8977
8978 2009-12-09 Ian Lance Taylor <iant@google.com>
8979
8980 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8981 information fields.
8982
8983 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8984
8985 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8986 Replace two_file_shared_1.so with two_file_shared_2.so.
8987 * testsuite/Makefile.in: Regenerated.
8988
8989 2009-12-08 Doug Kwan <dougkwan@google.com>
8990
8991 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8992 (HFILES): Add attributes.h and int_encoding.h.
8993 * Makefile.in: Regenerate.
8994 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8995 function definitions to int_encoding.cc
8996 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8997 prototypes to int_encoding.h
8998 * reduced_debug_output.cc (int_encoding.h): New include.
8999 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9000 function definitions to int_encoding.cc
9001 (insert_into_vector, read_from_pointer): Move template definitions to
9002 int_encoding.h
9003 * attributes.cc: New file.
9004 * attributes.h: New file.
9005 * int_encoding.cc: New file.
9006 * int_encoding.h: New file.
9007
9008 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
9009
9010 PR gold/11055
9011 * incremental-dump.cc (dump_incremental_inputs): New.
9012 (main): Use dump_incremental_inputs.
9013
9014 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9015
9016 PR gold/10893
9017 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9018 checking elfcpp::STT_FUNC.
9019 (Target_i386::Relocate::relocate): Likewise.
9020 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9021
9022 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9023 symbols from shared libraries into normal FUNC symbols.
9024
9025 * symtab.h (Symbol): Add is_func and use it.
9026
9027 2009-12-05 Doug Kwan <dougkwan@google.com>
9028
9029 * arm.cc (Target_arm::arm_info): Initialize new fields
9030 attributes_section and attributes_vendor.
9031 * i386.cc (Target_i386::i386_info): Same.
9032 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9033 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9034 fields attributes_section and attributes_vendor.
9035 * sparc.cc (Target_sparc::sparc_info): Same.
9036 * target.h (Target::attributes_section, Target::attributes_vendor,
9037 Target::is_attributes_section, Target::attribute_arg_type,
9038 Target::attributes_order): New method definitions.
9039 (Target::Target_info::attributes_section,
9040 Target::Target_info::attributes_vendor): New fields.
9041 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9042 virtual method definitions.
9043 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9044 attributes_section and attributes_vendor.
9045 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9046
9047 2009-12-05 Doug Kwan <dougkwan@google.com>
9048
9049 * arm.cc: Update comments about interworking and stub generation.
9050 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9051 considered as non-PIC.
9052 (Arm_relocate_functions::base_abs): Fix formatting.
9053 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9054 of function to use GOT entry address instead of offset.
9055 (Target_arm::Scan::global): Issue an error if a symbol would need a
9056 PLT does not get one because it is untyped. Remove code to create
9057 dynamic symbols for relative branches.
9058 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9059 takes unsigned integer instead of boolean.
9060
9061 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9062
9063 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9064 (two_file_test_LDADD): Likewise.
9065 (common_test_1_LDADD): Likewise.
9066 (exception_test_LDADD) Likewise.
9067 (weak_test_LDADD): Likewise.
9068 (many_sections_test_LDADD): Likewise.
9069 (initpri1_LDADD): Likewise.
9070 (script_test_1_LDADD): Likewise.
9071 (script_test_2_LDADD): Likewise.
9072 (justsyms_LDADD): Likewise.
9073 (binary_test_LDADD): Likewise.
9074 (large_LDADD): Likewise.
9075 * testsuite/Makefile.in: Regenerated.
9076
9077 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
9078
9079 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9080 (Symbol_table::override_with_special): Likewise.
9081 (Symbol_table::add_from_object): Likewise.
9082
9083 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9084
9085 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9086 Don't set the data_offset twice.
9087
9088 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9089
9090 * testsuite/Makefile.in: Regenerate.
9091
9092 2009-12-03 Doug Kwan <dougkwan@google.com>
9093
9094 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9095 (Target_arm::do_finalize_sections): Add parameter for symbol table
9096 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9097 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9098 parameter for symbol table pointer.
9099 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9100 an additional parameter for a pointer to symbol table.
9101 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9102 parameter for a symbol table pointer.
9103 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9104 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9105 Ditto.
9106 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9107 parameter for a symbol table pointer.
9108
9109 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
9110
9111 * incremental.cc (Incremental_inputs_header)
9112 (Incremental_inputs_header_write, Incremental_inputs_entry)
9113 (Incremental_inputs_entry_write): Move ...
9114 * incremental.h (Incremental_inputs_header)
9115 (Incremental_inputs_header_write, Incremental_inputs_entry)
9116 (Incremental_inputs_entry_write): here.
9117
9118 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9119
9120 * incremental.cc (make_sized_incremental_binary): Set the target.
9121 Error if it is incompatible.
9122 * output.h (Output_file): Add filename method.
9123
9124 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9125
9126 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9127 from the get_* methods.
9128
9129 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9130
9131 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9132 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9133 Write 0 for the data_offset of scripts.
9134
9135 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9136
9137 * testsuite/Makefile.am: Add the incremental_test.sh test.
9138 * testsuite/incremental_test.sh: New.
9139 * testsuite/incremental_test_1.c: New.
9140 * testsuite/incremental_test_2.c: New.
9141
9142 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
9143
9144 * incremental-dump.cc (main): Fix typos.
9145
9146 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
9147
9148 PR gold/11025
9149 * incremental-dump.cc (main): Use llu to print 64 bit values.
9150
9151 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9152 H.J. Lu <hongjiu.lu@intel.com>
9153
9154 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9155 $(LIBDL).
9156 (incremental_dump_LDADD): Likewise.
9157 * Makefile.in: Regenerated.
9158
9159 2009-11-25 Doug Kwan <dougkwan@google.com>
9160
9161 Revert:
9162
9163 2009-11-25 Doug Kwan <dougkwan@google.com>
9164
9165 * arm.cc (Target_arm::Target_arm): Move method definition
9166 outside of class definition. Add code to handle
9167 --target1-rel, --target1-abs and --target2= options.
9168 (Target_arm::get_reloc_reloc_type): Change method to be
9169 non-static and const.
9170 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9171 New data member declaration.
9172 (Target_arm::Scan::local, Target_arm::Scan::global,
9173 Target_arm::Relocate::relocate,
9174 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9175 Adjust call to Target_arm::get_real_reloc_type.
9176 (Target_arm::get_real_reloc_type): Use command line options
9177 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9178 * options.h (--target1-rel, --target1-abs, --target2): New
9179 ARM-only options.
9180
9181 2009-11-25 Doug Kwan <dougkwan@google.com>
9182
9183 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9184 class definition. Add code to handle --target1-rel, --target1-abs
9185 and --target2= options.
9186 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9187 and const.
9188 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9189 member declaration.
9190 (Target_arm::Scan::local, Target_arm::Scan::global,
9191 Target_arm::Relocate::relocate,
9192 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9193 call to Target_arm::get_real_reloc_type.
9194 (Target_arm::get_real_reloc_type): Use command line options to
9195 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9196 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9197 options.
9198
9199 2009-11-25 Doug Kwan <dougkwan@google.com>
9200
9201 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9202 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9203 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9204 formatting.
9205 (Arm_relocate_functions::thm_call): Replace body with a call to
9206 Arm_relocate_functions::thumb_branch_common.
9207 (Arm_relocate_functions::thm_jump24,
9208 Arm_relocate_functions::thm_xpc22): New method definitions.
9209 (Arm_relocate_functions::thumb_branch_common): New method definition.
9210 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9211 operator.
9212 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9213 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9214
9215 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9216
9217 * Makefile.am: Build incremental-dump
9218 * Makefile.in: Regenerate.
9219 * incremental-dump.cc: New.
9220 * incremental.cc (Incremental_inputs_header_data,
9221 Incremental_inputs_entry_data): Move to incremental.h
9222 * incremental.h: (Incremental_inputs_header_data,
9223 Incremental_inputs_entry_data): Move from incremental.cc
9224
9225 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9226
9227 * incremental.cc (Incremental_inputs_header,
9228 Incremental_inputs_header_write, Incremental_inputs_entry,
9229 Incremental_inputs_entry_write): Add a typedef with the data type.
9230
9231 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9232
9233 * incremental.cc (Incremental_inputs_header,
9234 Incremental_inputs_header_write, Incremental_inputs_entry,
9235 Incremental_inputs_entry_write): Update comment about which
9236 type has the filed descriptions.
9237
9238 2009-11-15 Doug Kwan <dougkwan@google.com>
9239
9240 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9241 (Arm_relocate_functions::arm_branch_common): Change method defintion
9242 in class definition to a method declaration and update list of formal
9243 parameters.
9244 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9245 Arm_relocation_functions::jump24): Adjust call to
9246 Arm_relocate_functions::arm_branch_common. Update list of formal
9247 parameters.
9248 (Arm_relocate_functions::xpc25): New method definition.
9249 (Arm_relocate_functions::arm_branch_common): Move method defintion
9250 out from class definition. Use stubs for mode-switching and extending
9251 branch ranges.
9252 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9253 specially. Change code to enable use of stubs in ARM branches.
9254
9255 2009-11-10 Doug Kwan <dougkwan@google.com>
9256
9257 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9258 in method declaration.
9259 (Target_arm::relocate_stub): New method declaration.
9260 (Target_arm::default_target): Change to return a pointer instead of
9261 a const reference.
9262 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9263 Target_arm::default_target.
9264 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9265 method definition.
9266 (Target_arm::relocate_section): Adjust view.
9267 (Target_arm::relocate_stub): New method definition.
9268
9269 2009-11-10 Doug Kwan <dougkwan@google.com>
9270
9271 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9272 a format warning.
9273 * incremental.cc (open_incremental_binary): Initialized local
9274 variables to avoid warnings.
9275 * object.cc (make_elf_object): Ditto.
9276 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9277 a format warning.
9278
9279 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9280
9281 PR gold/10930
9282 * testsuite/plugin_test.c: Include "config.h".
9283
9284 2009-11-09 Doug Kwan <dougkwan@google.com>
9285
9286 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9287 (arm_symbol_value): Remove.
9288 (Arm_relocate_functions::arm_branch_common,
9289 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9290 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9291 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9292 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9293 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9294 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9295 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9296 Arm_relocate_functions::thm_mobw_abs_nc,
9297 Arm_relocate_functions::thm_mov_abs,
9298 Arm_relocate_functions::movw_prel_nc,
9299 Arm_relocate_functions::thm_movt_abs,
9300 Arm_relocate_functions::movt_prel,
9301 Arm_relocate_functions::thm_movw_prel_nc,
9302 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9303 (Target_arm::Relocate::relocate): Only decompose address into two
9304 parts if relocation type uses the thumb-bit and pass the actual
9305 bit instead of a flag indicating that the thumb-bit is used. Adjust
9306 calls to methods in Arm_relocate_functions for this change.
9307
9308 2009-11-08 Ian Lance Taylor <iant@google.com>
9309
9310 PR 10925
9311 * reloc.cc: Instantiate
9312 Sized_relobj::initialize_input_to_output_maps and
9313 Sized_relobj:free_input_to_output_maps.
9314
9315 2009-11-06 Ian Lance Taylor <iant@google.com>
9316
9317 PR 10876
9318 * defstd.cc (in_segment): Set only_if_ref true for "end".
9319
9320 2009-11-06 Doug Kwan <dougkwan@google.com>
9321
9322 * arm.cc (class Reloc_stub): Correct a comment.
9323 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9324 (Target_arm::scan_section_for_stubs): New method declaration.
9325 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9326 Change methods from private to protected.
9327 (Target_arm::do_may_relax): New method definition.
9328 (Target_arm::do_relax, Target_arm::group_sections,
9329 Target_arm::scan_reloc_for_stub,
9330 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9331 (Target_arm::arm_input_section_map_): New data member declaration.
9332 (Target_arm::scan_reloc_for_stub,
9333 Target_arm::scan_reloc_section_for_stubs,
9334 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9335 Target_arm::do_relax): New method definitions.
9336
9337 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9338
9339 * configure.ac: Check for (struct stat)::st_mtim
9340 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9341 * config.in: Regenerate.
9342 * configure: Regenerate.
9343
9344 2009-11-05 Ian Lance Taylor <iant@google.com>
9345
9346 PR 10910
9347 * output.cc (Output_segment::add_output_section): Add missing
9348 return statement.
9349
9350 2009-11-04 Ian Lance Taylor <iant@google.com>
9351
9352 PR 10880
9353 * object.h (class Object): Add is_needed and set_is_needed
9354 methods. Add is_needed_ field. Make bool fields into bitfields.
9355 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9356 defined in a dynamic object and referenced by a regular object,
9357 set is_needed for the dynamic object.
9358 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9359 if the file is marked with as_needed and it is not needed.
9360
9361 2009-11-04 Ian Lance Taylor <iant@google.com>
9362
9363 PR 10887
9364 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9365 tags if data is discarded by linker script.
9366 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9367 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9368 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9369 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9370
9371 2009-11-04 Ian Lance Taylor <iant@google.com>
9372
9373 * layout.cc (Layout::get_output_section): Add is_interp and
9374 is_dynamic_linker_section parameters. Change all callers.
9375 (Layout::choose_output_section): Likewise.
9376 (Layout::make_output_section): Likewise.
9377 (Layout::add_output_section_data): Add is_dynamic_linker_section
9378 parameter. Change all callers.
9379 * layout.h (class Layout): Update declarations.
9380 * output.h (class Output_section): Add is_interp, set_is_interp,
9381 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9382 Add is_interp_, is_dynamic_linker_section_ fields. Change
9383 generate_code_fills_at_write_ to a bitfield.
9384 * output.cc (Output_section::Output_sections): Initialize new
9385 fields.
9386 (Output_segment::add_output_section): Add do_sort parameter.
9387 Change all callers.
9388
9389 2009-11-03 Ian Lance Taylor <iant@google.com>
9390
9391 PR 10860
9392 * options.h (class General_options): Add --warn-common.
9393 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9394 merging two common symbols.
9395 (Symbol_table::should_override): Handle --warn-common when merging
9396 a common symbol with a defined symbol. Use report_resolve_problem
9397 for multiple definitions.
9398 (Symbol_table::report_resolve_problem): New function.
9399 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9400
9401 2009-11-03 Doug Kwan <dougkwan@google.com>
9402
9403 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9404 stub_factory_.
9405 (Target_arm::stub_factory): New method definition.
9406 (Target_arm::new_arm_input_section,
9407 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9408 Target_arm::reloc_uses_thumb_bit): New method declarations.
9409 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
9410 New type definitions.
9411 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9412 member declarations.
9413 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9414 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9415 New method definitions.
9416
9417 2009-11-03 Ian Lance Taylor <iant@google.com>
9418
9419 * options.h (class General_options): Add --warn_constructors.
9420
9421 2009-11-03 Ian Lance Taylor <iant@google.com>
9422
9423 PR 10893
9424 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9425 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9426
9427 2009-11-03 Ian Lance Taylor <iant@google.com>
9428
9429 PR 10895
9430 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9431 --msgid-bugs-address.
9432 (install-pdf): New target.
9433 (install-data_yes): Look up one directory to find mkinstalldirs.
9434
9435 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9436
9437 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9438 tree.
9439
9440 2009-10-30 Doug Kwan <dougkwan@google.com>
9441
9442 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9443
9444 2009-10-30 Doug Kwan <dougkwan@google.com>
9445
9446 * arm.cc (Stub_addend_reader): New struct template definition
9447 and partial specializations.
9448 (Stub_addend_reader::operator()): New method definition for a
9449 partially specialized template.
9450
9451 2009-10-30 Doug Kwan <dougkwan@google.com>
9452
9453 * arm.cc (Arm_relobj::processor_specific_flags): New method
9454 definition.
9455 (Arm_relobj::do_read_symbols): New method declaration.
9456 (Arm_relobj::processor_specific_flags_): New data member declaration.
9457 (Arm_dynobj): New class definition.
9458 (Target_arm::do_finalize_sections): Add input_objects parameter.
9459 (Target_arm::do_adjust_elf_header): New method declaration.
9460 (Target_arm::are_eabi_versions_compatible,
9461 (Target_arm::merge_processor_specific_flags): New method declaration.
9462 (Target_arm::do_make_elf_object): New overloaded method definitions
9463 and declaration.
9464 (Arm_relobj::do_read_symbols): New method definition.
9465 (Arm_dynobj::do_read_symbols): Ditto.
9466 (Target_arm::do_finalize_sections): Add input_objects parameters.
9467 Merge processor-specific flags from all input objects.
9468 (Target_arm::are_eabi_versions_compatible,
9469 Target_arm::merge_processor_specific_flags,
9470 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9471 New method definitions.
9472 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9473 Input_objects pointer type parameter.
9474 * layout.cc (Layout::finalize): Pass input objects to target's.
9475 finalize_sections function.
9476 * output.cc (Output_file_header::do_sized_write): Set ELF file
9477 header's processor-specific flags.
9478 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9479 Input_objects pointer type parameter.
9480 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9481 * target.h (Input_objects): New forward class declaration.
9482 (Target::processor_specific_flags,
9483 Target::are_processor_specific_flags_sect): New method definitions.
9484 (Target::finalize_sections): Add input_objects parameter.
9485 (Target::Target): Initialize processor_specific_flags_ and
9486 are_processor_specific_flags_set_.
9487 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9488 parameter.
9489 (Target::set_processor_specific_flags): New method definition.
9490 (Target::processor_specific_flags_,
9491 Target::are_processor_specific_flags_set_): New data member
9492 declarations.
9493 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9494 Input_objects pointer type parameter.
9495
9496 2009-10-30 Doug Kwan <dougkwan@google.com>
9497
9498 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9499
9500 2009-10-28 Ian Lance Taylor <iant@google.com>
9501
9502 * object.h (class Relobj): Drop options parameter from
9503 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9504 do_scan_relocs, do_relocate. Change all callers.
9505 (class Sized_relobj): Drop options parameters from
9506 do_gc_process_relocs, do_scan_relocs, do_relocate,
9507 do_relocate_sections, relocate_sections, emit_relocs_scan,
9508 emit_relocs_scan_reltype. Change all callers.
9509 (struct Relocate_info): Remove options field and all references to
9510 it.
9511 * reloc.h (class Read_relocs): Remove options constructor
9512 parameter and options_ field. Change all callers.
9513 (class Gc_process_relocs, class Scan_relocs): Likewise.
9514 (class Relocate_task): Likewise.
9515 * target-reloc.h (scan_relocs): Remove options parameter. Change
9516 all callers.
9517 (scan_relocatable_relocs): Likewise.
9518 * target.h (class Sized_target): Remove options parameter from
9519 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9520 all callers.
9521 * gc.h (gc_process_relocs): Remove options parameter. Change all
9522 callers.
9523 * arm.cc: Update functions to remove options parameters.
9524 * i386.cc: Likewise.
9525 * powerpc.cc: Likewise.
9526 * sparc.cc: Likewise.
9527 * x86_64.cc: Likewise.
9528 * testsuite/testfile.cc: Likewise.
9529
9530 2009-10-28 Doug Kwan <dougkwan@google.com>
9531
9532 * arm.cc (Arm_relobj): New class definition.
9533 (Arm_relobj::scan_sections_for_stubs,
9534 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9535 New method definitions.
9536
9537 2009-10-28 Cary Coutant <ccoutant@google.com>
9538
9539 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9540 (Plugin::cleanup_done_): New member.
9541 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9542 (Plugin_manager::cleanup_done_): Remove.
9543 (Plugin_manager::add_input_file): Edit error message.
9544 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9545 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9546
9547 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9548
9549 * fileread.cc: (File_read::View::~View): Use the new
9550 data_ownership_ filed.
9551 (File_read::~File_read): Dispose the new whole_file_view_.
9552 (File_read::open): Mmap the whole file if needed.
9553 (File_read::open): Use whole_file_view_ instead of contents_.
9554 (File_read::find_view): Use whole_file_view_ if applicable.
9555 (File_read::do_read): Use whole_file_view_ instead of contents_.
9556 (File_read::make_view): Use whole_file_view_ instead of contents_,
9557 update File_read::View::View call.
9558 (File_read::find_or_make_view): Update File_read::View::View
9559 call.
9560 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9561 remove contents_
9562 (File_read::View::Data_ownership): New enum.
9563 (File_read::View::View): Replace bool mapped_ with Data_ownership
9564 argument.
9565 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9566 (File_read::View::data_ownership_): New field.
9567 (File_read::contents_): Remove (replaced by whole_file_view_).
9568 (File_read::whole_file_view_): New field.
9569 * options.h (class General_options): Add --keep-files-mapped.
9570
9571 2009-10-27 Cary Coutant <ccoutant@google.com>
9572
9573 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9574 * testsuite/Makefile.am (plugin_test_5): New test case.
9575 * testsuite/Makefile.in: Regenerate.
9576
9577 2009-10-25 Doug Kwan <dougkwan@google.com>
9578
9579 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9580 from private to protected to allow access by child class.
9581 (Sized_relobj::do_relocate_sections): New method declaration.
9582 (Sized_relobj::relocate_sections): Virtualize.
9583 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
9584 Sized_relobj::relocate_sections. Instantiate template explicitly
9585 for different target sizes and endianity.
9586
9587 2009-10-24 Doug Kwan <dougkwan@google.com>
9588
9589 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9590 (Arm_input_section::as_arm_input_section): New method.
9591 (Arm_output_section): New class definition.
9592 (Arm_output_section::create_stub_group,
9593 Arm_output_section::group_sections): New method definitions.
9594
9595 2009-10-22 Doug Kwan <dougkwan@google.com>
9596
9597 * arm.cc (Arm_input_section): New class definition.
9598 (Arm_input_section::init, Arm_input_section:do_write,
9599 Arm_input_section::set_final_data_size,
9600 Arm_input_section::do_reset_address_and_file_offset): New method
9601 definitions.
9602
9603 2009-10-21 Doug Kwan <dougkwan@google.com>
9604
9605 * arm.cc (Stub_table, Arm_input_section): New forward class
9606 declarations.
9607 (Stub_table): New class defintion.
9608 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9609 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9610 New method definition.
9611
9612 2009-10-21 Doug Kwan <dougkwan@google.com>
9613
9614 * arm.cc: Update copyright comments.
9615 (Target_arm): New forward class template declaration.
9616 (Arm_address): New type.
9617 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9618 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9619 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9620 constants.
9621 (Insn_template): Same.
9622 (DEF_STUBS): New macro.
9623 (Stub_type): New enum type.
9624 (Stub_template): New class definition.
9625 (Stub): Same.
9626 (Reloc_stub): Same.
9627 (Stub_factory): Same.
9628 (Target_arm::Target_arm): Initialize may_use_blx_ and
9629 should_force_pic_veneer_.
9630 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9631 Target_arm::should_force_pic_veneer,
9632 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9633 Target_arm::using_thumb_only, Target_arm:;default_target): New
9634 method defintions.
9635 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9636 New data member declarations.
9637 (Insn_template::size, Insn_template::alignment): New method defintions.
9638 (Stub_template::Stub_template): New method definition.
9639 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9640 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9641 (Stub_factory::Stub_factory): New method definition.
9642 * gold.h (string_hash): New template.
9643 * output.h (Input_section_specifier::hash_value): Use
9644 gold::string_hash.
9645 (Input_section_specifier::string_hash): Remove.
9646 * stringpool.cc (Stringpool_template::string_hash): Use
9647 gold::string_hash.
9648
9649 2009-10-20 Doug Kwan <dougkwan@google.com>
9650
9651 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9652 symbols of relaxed input sections.
9653 * output.h (Output_section::find_relaxed_input_section): Make
9654 method public.
9655
9656 2009-10-16 Doug Kwan <dougkwan@google.com>
9657
9658 * dynobj.cc (Versions::Versions): Initialize version_script_.
9659 Only insert base version symbol definition for a shared object
9660 if version script defines any version versions.
9661 (Versions::define_base_version): New method definition.
9662 (Versions::add_def): Check that base version is not needed.
9663 (Versions::add_need): Define base version lazily.
9664 * dynobj.h (Versions::define_base_version): New method declaration.
9665 (Versions::needs_base_version_): New data member declaration.
9666 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9667 (check_DATA): Add no_version_test.stdout.
9668 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9669 New make rules.
9670 * testsuite/Makefile.in: Regenerate.
9671 * testsuite/no_version_test.c: New file.
9672 * testsuite/no_version_test.sh: Ditto.
9673
9674 2009-10-16 Doug Kwan <dougkwan@google.com>
9675
9676 * expression.cc (class Segment_start_expression): New class definition.
9677 (Segment_start_expression::value): New method definition.
9678 (script_exp_function_segment_start): Return a new
9679 Segment_start_expression.
9680 * gold/script-c.h (script_saw_segment_start_expression): New function
9681 prototype.
9682 * script-sections.cc (Script_sections::Script_sections): Initialize
9683 SAW_SEGMENT_START_EXPRESSION_ to false.
9684 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9685 and -Tbbs options to specify section addresses if given in
9686 command line and no SEGMENT_START expression is seen in a script.
9687 * script-sections.h (Script_sections::saw_segment_start_expression,
9688 Script_sections::set_saw_segment_start_expression): New method
9689 definition.
9690 (Script_sections::saw_segment_start_expression_): New data member
9691 declaration.
9692 * script.cc (script_saw_segment_start_expression): New function.
9693 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9694 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9695 script_test_7.sh and script_test_8.sh.
9696 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9697 script_test_8.stdout.
9698 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9699 (script_test_6, script_test_6.stdout, script_test_7,
9700 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9701 * Makefile.in: Regenerate.
9702 * testsuite/script_test_6.sh: New file.
9703 * testsuite/script_test_6.t: Same.
9704 * testsuite/script_test_7.sh: Same.
9705 * testsuite/script_test_7.t: Same.
9706 * testsuite/script_test_8.sh: Same.
9707
9708 2009-10-16 Doug Kwan <dougkwan@google.com>
9709
9710 * output.cc (Output_segment::set_section_list_address): Cast
9711 expressions to unsigned long long type to avoid format warnings.
9712
9713 2009-10-15 Ian Lance Taylor <iant@google.com>
9714
9715 * script.cc (Script_options::add_symbol_assignment): Always add a
9716 dot assignment to script_sections_.
9717 * script-sections.cc (Script_sections::add_dot_assignment):
9718 Initialize if necessary.
9719
9720 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9721 program headers with no load segment if there is a linker script.
9722
9723 * layout.cc (Layout::set_segment_offsets): Align the file offset
9724 to the segment aligment for -N or -n with no load segment.
9725 * output.cc (Output_segment::add_output_section): Don't crash if
9726 the first section is a TLS section.
9727 (Output_segment::set_section_list_addresses): Print an error
9728 message if the address moves backward in a linker script.
9729 * script-sections.cc
9730 (Output_section_element_input::set_section_addresses): Don't
9731 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9732 (Orphan_output_section::set_section_addresses): Likewise.
9733
9734 2009-10-15 Doug Kwan <dougkwan@google.com>
9735
9736 * layout.cc (Layout::finish_dynamic_section): Generate tags
9737 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9738 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9739 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9740
9741 2009-10-14 Ian Lance Taylor <iant@google.com>
9742
9743 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9744 fields.
9745 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9746 data_shdr fields of relinfo.
9747 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9748 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9749 R_386_TLS_LDO_32, adjust based on section flags.
9750 (Target_i386::Relocate::fix_up_ldo): Remove.
9751
9752 2009-10-13 Ian Lance Taylor <iant@google.com>
9753
9754 Add support for -pie.
9755 * options.h (class General_options): Add -pie and
9756 --pic-executable.
9757 (General_options::output_is_position_independent): Test -pie.
9758 (General_options::output_is_executable): Return true if not shared
9759 and not relocatable.
9760 (General_options::output_is_pie): Remove.
9761 * options.cc (General_options::finalize): Reject incompatible uses
9762 of -pie.
9763 * gold.cc (queue_middle_tasks): A -pie link is not static.
9764 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9765 * symtab.cc (Symbol::final_value_is_known): Return false if
9766 output_is_position_independent.
9767 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9768 output_is_position_independent.
9769 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9770 output_is_position_independent.
9771 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9772 output_is_position_independent.
9773 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9774 two_file_pie_test.
9775 (basic_pie_test.o, basic_pie_test): New targets.
9776 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9777 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9778 (two_file_pie_test): New target.
9779 * testsuite/Makefile.in: Rebuild.
9780 * README: Remove note saying that -pie is not supported.
9781
9782 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9783
9784 * options.h (class General_options): Add -init and -fini.
9785 * layout.cc (Layout::finish_dynamic_section): Emit
9786 given init and fini functions.
9787
9788 2009-10-13 Sriraman Tallam <tmsriram@google.com>
9789
9790 * gc.h (gc_process_relocs): Check if icf is enabled using new
9791 function.
9792 * gold.cc (queue_initial_tasks): Likewise.
9793 (queue_middle_tasks): Likewise.
9794 * object.cc (do_layout): Likewise.
9795 * symtab.cc (is_section_folded): Likewise.
9796 * main.cc (main): Likewise.
9797 * reloc.cc (Read_relocs::run): Likewise.
9798 (Sized_relobj::do_scan_relocs): Likewise.
9799 * icf.cc (is_function_ctor_or_dtor): New function.
9800 (Icf::find_identical_sections): Check if function is ctor or dtor when
9801 safe icf is chosen.
9802 * options.h (General_options::icf): Change option to be an enum.
9803 (Icf_status): New enum.
9804 (icf_enabled): New method.
9805 (icf_safe_folding): New method.
9806 (set_icf_status): New method.
9807 (icf_status_): New variable.
9808 * (options.cc) (General_options::finalize): Set icf_status_.
9809 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9810 icf_test and icf_keep_unique_test to use the --icf enum flag.
9811 * testsuite/icf_safe_test.sh: New file.
9812 * testsuite/icf_safe_test.cc: New file.
9813
9814 2009-10-12 Sriraman Tallam <tmsriram@google.com>
9815
9816 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9817 includes to gc.h and icf.h.
9818 * arm.cc: Include gc.h.
9819 * gold.cc: Likewise.
9820 * i386.cc: Likewise.
9821 * powerpc.cc: Likewise.
9822 * sparc.cc: Likewise.
9823 * x86_64.cc: Likewise.
9824 * gc.h: Include icf.h.
9825
9826 2009-10-11 Ian Lance Taylor <iant@google.com>
9827
9828 * plugin.cc: Include "gold.h" before other header files.
9829
9830 2009-10-10 Chris Demetriou <cgd@google.com>
9831
9832 * options.h (Input_file_argument::Input_file_type): New enum.
9833 (Input_file_argument::is_lib_): Replace with...
9834 (Input_file_argument::type_): New member.
9835 (Input_file_argument::Input_file_argument): Take Input_file_type
9836 'type' rather than boolean 'is_lib' as second argument.
9837 (Input_file_argument::is_lib): Use type_.
9838 (Input_file_argument::is_searched_file): New function.
9839 (Input_file_argument::may_need_search): Handle is_searched_file.
9840 * options.cc (General_options::parse_library): Support -l:filename.
9841 (General_options::parse_just_symbols): Update for Input_file_argument
9842 changes.
9843 (Command_line::process): Likewise.
9844 * archive.cc (Archive::get_file_and_offset): Likewise.
9845 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9846 * script.cc (read_script_file, script_add_file): Likewise.
9847 * fileread.cc (Input_file::Input_file): Likewise.
9848 (Input_file::will_search_for): Handle is_searched_file.
9849 (Input_file::open): Likewise.
9850 * readsyms.cc (Read_symbols::get_name): Likewise.
9851 * testsuite/Makefile.am (searched_file_test): New test.
9852 * testsuite/Makefile.in: Regenerate.
9853 * testsuite/searched_file_test.cc: New file.
9854 * testsuite/searched_file_test_lib.cc: New file.
9855
9856 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9857 Ian Lance Taylor <iant@google.com>
9858
9859 * descriptor.cc: Include <cstdio> and "binary-io.h".
9860 (Descriptors::open): Open the files in binary mode always.
9861 * script.cc (Lex::get_token): Treat \r as whitespace.
9862
9863 2009-10-09 Ian Lance Taylor <iant@google.com>
9864
9865 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9866
9867 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9868 Ian Lance Taylor <iant@google.com>
9869
9870 * configure.ac: Check for readv function also.
9871 * fileread.cc (readv): Define if not HAVE_READV.
9872 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9873 does not exist.
9874 * config.in: Regenerate.
9875 * configure: Regenerate.
9876
9877 2009-10-09 Doug Kwan <dougkwan@google.com>
9878
9879 * layout.cc (Layout::make_output_section): Call target hook to make
9880 ordinary output section.
9881 (Layout::finalize): Adjust parameter list of call the
9882 Target::may_relax().
9883 * layout.h (class Layout::section_list): New method.
9884 * merge.h (Output_merge_base::entsize): Change visibility to public.
9885 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9886 New methods.
9887 (Output_merge_string::do_is_string): New method.
9888 * object.cc (Sized_relobj::do_setup): renamed from
9889 Sized_relobj::set_up.
9890 * object.h (Sized_relobj::adjust_shndx,
9891 Sized_relobj::initializ_input_to_output_maps,
9892 Sized_relobj::free_input_to_output_maps): Change visibilities to
9893 protected.
9894 (Sized_relobj::setup): Virtualize.
9895 (Sized_relobj::do_setup): New method declaration.
9896 (Sized_relobj::invalidate_section_offset,
9897 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9898 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9899 * options.cc (parse_int): New function.
9900 * options.h (parse_int): New declaration.
9901 (DEFINE_int): New macro.
9902 (stub_group_size): New option.
9903 * output.cc (Output_section::Output_section): Initialize memebers
9904 merge_section_map_, merge_section_by_properties_map_,
9905 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9906 (Output_section::add_input_section): Handled deferred code-fill
9907 generation and remove an old comment.
9908 (Output_section::add_relaxed_input_section): New method definition.
9909 (Output_section::add_merge_input_section): Use merge section by
9910 properties map to speed to search. Update merge section maps
9911 as appropriate.
9912 (Output_section::build_relaxation_map): New method definition.
9913 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9914 Same.
9915 (Output_section::relax_input_section): Renamed to
9916 Output_section::convert_input_sections_to_relaxed_sections and change
9917 interface to take a vector of pointers to relaxed sections.
9918 (Output_section::find_merge_section,
9919 Output_section::find_relaxed_input_section): New method definitions.
9920 (Output_section::is_input_address_mapped,
9921 Output_section::output_offset, Output_section::output_address):
9922 Use output section data maps to speed up searching.
9923 (Output_section::find_starting_output_address): Add comments.
9924 (Output_section::do_write,
9925 Output_section::write_to_postprocessing_buffer): Do code-fill
9926 generation as appropriate.
9927 (Output_section::get_input_sections): Invalidate relaxed input section
9928 map.
9929 (Output_section::restore_states): Adjust type of checkpoint .
9930 Invalidate relaxed input section map.
9931 * output.h (Output_merge_base): New class declaration.
9932 (Input_section_specifier): New class defintion.
9933 (class Output_relaxed_input_section) Change base class to
9934 Output_section_data_build.
9935 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9936 base class initializer.
9937 (Output_section::add_relaxed_input_section): New method declaration.
9938 (Output_section::Input_section): Change visibility to protected.
9939 (Output_section::Input_section::relobj,
9940 Output_section::Input_section::shndx): Handle relaxed input sections.
9941 Output_section::input_sections) Change visibility to protected. Also
9942 define overload to return a non-const pointer.
9943 (Output_section::Merge_section_properties): New class defintion.
9944 (Output_section::Merge_section_by_properties_map,
9945 Output_section::Output_section_data_by_input_section_map,
9946 Output_section::Relaxation_map): New types.
9947 (Output_section::relax_input_section): Rename method to
9948 Output_section::convert_input_sections_to_relaxed_sections and change
9949 interface to take a vector of relaxed section pointers.
9950 (Output_section::find_merge_section,
9951 Output_section::find_relaxed_input_section,
9952 Output_section::build_relaxation_map,
9953 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9954 New method declarations.
9955 (Output_section::merge_section_map_
9956 Output_section::merge_section_by_properties_map_,
9957 Output_section::relaxed_input_section_map_,
9958 Output_section::is_relaxed_input_section_map_valid_,
9959 Output_section::generate_code_fills_at_write_): New data members.
9960 * script-sections.cc
9961 (Output_section_element_input::set_section_addresses): Call
9962 current_data_size and addralign methods of relaxed input sections.
9963 (Orphan_output_section::set_section_addresses): Call current_data_size
9964 and addralign methods of relaxed input sections.
9965 * symtab.cc (Symbol_table::compute_final_value): Extract template
9966 from the body of Symbol_table::sized_finalize_symbol.
9967 (Symbol_table::sized_finalized_symbol): Call
9968 Symbol_table::compute_final_value.
9969 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9970 (Symbol_table::compute_final_value): New templated method declaration.
9971 * target.cc (Target::do_make_output_section): New method defintion.
9972 * target.h (Target::make_output_section): New method declaration.
9973 (Target::relax): Add more parameters for input objects, symbol table
9974 and layout. Adjust call to do_relax.
9975 (Target::do_make_output_section): New method declaration.
9976 (Target::do_relax): Add parameters for input objects, symbol table
9977 and layout.
9978
9979 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9980
9981 * pread.c: Include stdio.h.
9982
9983 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9984
9985 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9986 defined.
9987
9988 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9989
9990 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9991 Change read_shndx type to unsigned int.
9992 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9993 int.
9994 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9995 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9996 Change read_shndx type to unsigned int.
9997 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9998 int.
9999 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10000 * layout.cc (Layout::create_symtab_sections): Cast the result of
10001 local_symcount * symsize to off_t in the gold_assert.
10002
10003 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10004
10005 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10006 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10007 R_ARM_BASE_ABS.
10008 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10009 (Arm_relocate_functions::thm_abs5): New function.
10010 (Arm_relocate_functions::abs12): New function.
10011 (Arm_relocate_functions::abs16): New function.
10012 (Arm_relocate_functions::base_abs): New function.
10013 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10014 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10015 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10016 R_ARM_BASE_ABS.
10017 (Scan::global): Likewise.
10018 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10019 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10020 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10021 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10022 R_ARM_BASE_ABS.
10023
10024 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10025
10026 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10027 (Arm_relocate_functions::movt_prel): New function.
10028 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10029 (Arm_relocate_functions::thm_movt_prel): New function.
10030 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10031 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10032 (Scan::global, Relocate::relocate): Likewise.
10033 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10034
10035 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10036
10037 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10038 Incremental_checker.
10039 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10040 unsigned int.
10041 (class Incremental_inputs_header): New class.
10042 (Incremental_inputs_header_writer): Edit comment.
10043 (Incremental_inputs_entry): New class.
10044 (Incremental_inputs_entry_writer): Edit comment.
10045 (Sized_incremental_binary::do_find_incremental_inputs_section):
10046 Add *strtab_shndx parameter, fill it.
10047 (Sized_incremental_binary::do_check_inputs): New method.
10048 (Incremental_checker::can_incrementally_link_output_file): Use
10049 Sized_incremental_binary::check_inputs.
10050 (Incremental_inputs::report_command_line): Save command line in
10051 command_line_.
10052 * incremental.h:
10053 (Incremental_binary::find_incremental_inputs_section): New
10054 method.
10055 (Incremental_binary::do_find_incremental_inputs_section): Add
10056 strtab_shndx parameter.
10057 (Incremental_binary::do_check_inputs): New pure virtual method.
10058 (Sized_incremental_binary::do_check_inputs): Declare.
10059 (Incremental_checker::Incremental_checker): Add incremental_inputs
10060 parameter, use it to initialize incremental_inputs_.
10061 (Incremental_checker::incremental_inputs_): New field.
10062 (Incremental_checker::command_line): New method.
10063 (Incremental_checker::inputs): New method.
10064 (Incremental_checker::command_line_): New field.
10065
10066 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10067
10068 * incremental.cc: Include <cstdarg> and "target-select.h".
10069 (vexplain_no_incremental): New function.
10070 (explain_no_incremental): New function.
10071 (Incremental_binary::error): New method.
10072 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10073 method.
10074 (make_sized_incremental_binary): New function.
10075 (open_incremental_binary): New function.
10076 (can_incrementally_link_file): Add checks if output is ELF and has
10077 inputs section.
10078 * incremental.h: Include "elfcpp_file.h" and "output.h".
10079 (Incremental_binary): New class.
10080 (Sized_incremental_binary): New class.
10081 (open_incremental_binary): Declare.
10082 * object.cc (is_elf_object): Use
10083 elfcpp::Elf_recognizer::is_elf_file.
10084 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10085 * output.h (Output_file::filesize): New method.
10086
10087 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10088
10089 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10090 New function.
10091 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10092 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10093 function.
10094 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10095 function.
10096 (Arm_relocate_functions::movw_abs_nc): New function.
10097 (Arm_relocate_functions::movt_abs): New function.
10098 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10099 (Arm_relocate_functions::thm_movt_abs): New function.
10100 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10101 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10102 (Scan::global): Likewise.
10103 (Relocate::relocate): Likewise.
10104 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10105
10106 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10107
10108 * arm.cc (Arm_relocate_functions::got_prel) New function.
10109 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10110 (Relocate::relocate): Likewise.
10111 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10112
10113 2009-10-06 Ian Lance Taylor <iant@google.com>
10114
10115 * options.h (class General_options): Define
10116 split_stack_adjust_size parameter.
10117 * object.h (class Object): Add uses_split_stack_ and
10118 has_no_split_stack_ fields. Add uses_split_stack and
10119 has_no_split_stack accessor functions. Declare
10120 handle_split_stack_section.
10121 (class Reloc_symbol_changes): Define.
10122 (class Sized_relobj): Define Function_offsets. Declare
10123 split_stack_adjust, split_stack_adjust_reltype, and
10124 find_functions.
10125 * object.cc (Object::handle_split_stack_section): New function.
10126 (Sized_relobj::do_layout): Call handle_split_stack_section.
10127 * dynobj.cc (Sized_dynobj::do_layout): Call
10128 handle_split_stack_section.
10129 * reloc.cc (Sized_relobj::relocate_sections): Call
10130 split_stack_adjust for executable sections in split_stack
10131 objects. Pass reloc_map to relocate_section.
10132 (Sized_relobj::split_stack_adjust): New function.
10133 (Sized_relobj::split_stack_adjust_reltype): New function.
10134 (Sized_relobj::find_functions): New function.
10135 * target-reloc.h: Include "object.h".
10136 (relocate_section): Add reloc_symbol_changes parameter. Change
10137 all callers.
10138 * target.h (class Target): Add calls_non_split method. Declare
10139 do_calls_non_split virtual method. Declare match_view and
10140 set_view_to_nop.
10141 * target.cc: Include "elfcpp.h".
10142 (Target::do_calls_non_split): New function.
10143 (Target::match_view): New function.
10144 (Target::set_view_to_nop): New function.
10145 * gold.cc (queue_middle_tasks): Give an error if mixing
10146 split-stack and non-split-stack objects with -r.
10147 * i386.cc (Target_i386::relocate_section): Add
10148 reloc_symbol_changes parameter.
10149 (Target_i386::do_calls_non_split): New function.
10150 * x86_64.cc (Target_x86_64::relocate_section): Add
10151 reloc_symbol_changes parameter.
10152 (Target_x86_64::do_calls_non_split): New function.
10153 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10154 parameter.
10155 * powerpc.cc (Target_powerpc::relocate_section): Add
10156 reloc_symbol_changes parameter.
10157 * sparc.cc (Target_sparc::relocate_section): Add
10158 reloc_symbol_changes parameter.
10159 * configure.ac: Call AM_CONDITIONAL for the default target.
10160 * configure: Rebuild.
10161 * testsuite/Makefile.am (TEST_AS): New variable.
10162 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10163 (check_DATA): Add split_i386 and split_x86_64 files.
10164 (SPLIT_DEFSYMS): Define.
10165 (split_i386_[1234n].o): New targets.
10166 (split_i386_[124]): New targets.
10167 (split_i386_[1234r].stdout): New targets.
10168 (split_x86_64_[1234n].o): New targets.
10169 (split_x86_64_[124]): New targets.
10170 (split_x86_64_[1234r].stdout): New targets.
10171 (MOSTLYCLEANFILES): Add new executables.
10172 * testsuite/split_i386.sh: New file.
10173 * testsuite/split_x86_64.sh: New file.
10174 * testsuite/split_i386_1.s: New file.
10175 * testsuite/split_i386_2.s: New file.
10176 * testsuite/split_i386_3.s: New file.
10177 * testsuite/split_i386_4.s: New file.
10178 * testsuite/split_i386_n.s: New file.
10179 * testsuite/split_x86_64_1.s: New file.
10180 * testsuite/split_x86_64_2.s: New file.
10181 * testsuite/split_x86_64_3.s: New file.
10182 * testsuite/split_x86_64_4.s: New file.
10183 * testsuite/split_x86_64_n.s: New file.
10184 * testsuite/testfile.cc (Target_test): Update relocation_section
10185 function.
10186 * testsuite/Makefile.in: Rebuild.
10187
10188 2009-10-06 Ian Lance Taylor <iant@google.com>
10189
10190 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10191 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10192 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10193 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10194 the address on ldo_addrs_.
10195 (Target_i386::Relocate::fix_up_ldo): New function.
10196
10197 2009-10-06 Rafael Espindola <espindola@google.com>
10198
10199 * plugin.cc (add_input_library): New.
10200 (Plugin::load): Add add_input_library to tv.
10201 (Plugin_manager::add_input_file): Add the is_lib argument.
10202 (add_input_file): Update call to Plugin_manager::add_input_file.
10203 (add_input_library): New.
10204 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10205
10206 2009-09-30 Doug Kwan <dougkwan@google.com>
10207
10208 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10209 symbol and call Symbol::may_need_copy_reloc to determine if
10210 a copy reloc is needed.
10211 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10212 nocopyreloc is given in command line.
10213 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10214 given in command line.
10215 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10216 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10217 of the removed Target_i386::may_need_copy_reloc.
10218 * options.h (copyreloc): New option with default value false.
10219 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10220 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10221 instead of the removed Target_powerpc::may_need_copy_reloc.
10222 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10223 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10224 instead of the removed Target_sparc::may_need_copy_reloc.
10225 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10226 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10227 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10228 instead of the removed Target_x86_64::may_need_copy_reloc.
10229
10230 2009-09-30 Ian Lance Taylor <iant@google.com>
10231
10232 * object.h (class Object): Remove target_ field, and target,
10233 sized_target, and set_target methods.
10234 (Object::sized_target): Remove.
10235 (class Sized_relobj): Update declarations. Remove sized_target.
10236 * object.cc (Sized_relobj::setup): Remove target parameter.
10237 Change all callers.
10238 (Input_objects::add_object): Don't do anything with the target.
10239 (make_elf_sized_object): Add punconfigured parameter. Change all
10240 callers. Set or test parameter target.
10241 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10242 Change all callers.
10243 * parameters.cc (Parameters::set_target): Change parameter type to
10244 be non-const.
10245 (Parameters::default_target): Remove.
10246 (set_parameters_target): Change parameter type to be non-const.
10247 (parameters_force_valid_target): New function.
10248 (parameters_clear_target): New function.
10249 * parameters.h (class Parameters): Update declarations. Remove
10250 default_target method. Add sized_target and clear_target
10251 methods. Change target_ to be non-const.
10252 (set_parameters_target): Update declaration.
10253 (parameters_force_valid_target): Declare.
10254 (parameters_clear_target): Declare.
10255 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10256 as NULL if we aren't searching.
10257 (Add_symbols::run): Don't check for compatible target.
10258 * fileread.cc (Input_file::open_binary): Call
10259 parameters_force_valid_target.
10260 * gold.cc (queue_middle_tasks): Likewise.
10261 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10262 set_target on object.
10263 * dynobj.h (class Sized_dynobj): Update declarations.
10264 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10265 make_elf_object returns NULL.
10266 (Archive::include_member): Don't check whether object target is
10267 compatible.
10268 * output.cc (Output_section::add_input_section): Get target from
10269 parameters.
10270 (Output_section::relax_input_section): Likewise.
10271 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10272 parameters.
10273 (Sized_relobj::do_scan_relocs): Likewise.
10274 (Sized_relobj::relocate_sections): Likewise.
10275 * resolve.cc (Symbol_table::resolve): Likewise.
10276 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10277 parameter. Change all callers.
10278 (Symbol_table::add_from_object): Get target from parameters.
10279 (Symbol_table::add_from_relobj): Don't check object target.
10280 (Symbol_table::add_from_dynobj): Likewise.
10281 (Symbol_table::define_special_symbol): Get target from
10282 parameters.
10283 * symtab.h (class Symbol_table): Update declaration.
10284 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10285 parameter. Change all callers. Clear parameter target.
10286 (Binary_test): Test target here.
10287 * testsuite/object_unittest.cc (gold_testsuite): Remove
10288 target_test_pointer parameter. Change all callers.
10289 (Object_test): Test target here.
10290
10291 2009-09-26 Ian Lance Taylor <iant@google.com>
10292
10293 * testsuite/initpri1.c: Don't try to use constructor priorities if
10294 compiling with gcc before 4.3.
10295
10296 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10297
10298 * testsuite/retain_symbols_file_test.sh (check_present): Change
10299 output file name to retain_symbols_file_test.stdout.
10300 (check_absent): Likewise.
10301
10302 2009-09-18 Craig Silverstein <csilvers@google.com>
10303
10304 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10305 * options.cc: Include <cerrno> and <fstream>.
10306 (General_options::finalize): Parse -retain-symbols-file tag.
10307 * options.h: New flag.
10308 (General_options): New method should_retain_symbol, new
10309 variable symbols_to_retain.
10310 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10311 should_retain_symbol map.
10312 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10313 * testsuite/Makefile.in: Regenerate.
10314 * testsuite/retain_symbols_file_test.sh: New file.
10315
10316 2009-09-18 Nick Clifton <nickc@redhat.com>
10317
10318 * po/es.po: Updated Spanish translation.
10319
10320 2009-09-17 Doug Kwan <dougkwan@google.com>
10321
10322 * debug.h (DEBUG_RELAXATION): New constant.
10323 (DEBUG_ALL): Add DEBUG_RELAXATION.
10324 (debug_string_to_enum): Add relaxation debug option.
10325 * layout.cc
10326 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10327 Layout::Relaxation_debug_check::read_sections,
10328 Layout::Relaxation_debug_check::read_sections): New method definitions.
10329 (Layout::Layout): Initialize data members
10330 record_output_section_data_from_scrips_,
10331 script_output_section_data_list_ and relaxation_debug_check_.
10332 (Layout::save_segments, Layout::restore_segments,
10333 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10334 Layout::relaxation_loop_body): New method definitions.
10335 (Layout::finalize): Support relaxation. Move section layout code to
10336 Layout::relaxation_loop_body.
10337 (Layout::set_asection_address_from_script): Move code for orphan
10338 section placement out.
10339 (Layout::place_orphan_sections_in_script): New method definition.
10340 * layout.h (Output_segment_headers, Output_file_header):
10341 New forward class declarations.
10342 (Layout::~Layout): Define.
10343 (Layout::new_output_section_data_from_script): New method definition.
10344 (Layout::place_orphan_sections_in_script): New method declaration.
10345 (Layout::Segment_states): New type declaration.
10346 (Layout::save_segments, Layout::restore_segments,
10347 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10348 Layout::relaxation_loop_body): New method declarations.
10349 (Layout::Output_section_data_list): New type declaration.
10350 (Layout::Relaxation_debug_check): New class definition.
10351 (Layout::record_output_section_data_from_script_,
10352 Layout::script_output_section_data_list_, Layout::segment_states_,
10353 Layout::relaxation_debug_check_): New data members.
10354 * output.cc: (Output_section_headers::do_size): New method definition.
10355 (Output_section_headers::Output_section_headers): Move size
10356 computation to Output_section_headers::do_size.
10357 (Output_segment_headers::do_size): New method definition.
10358 (Output_file_header::Output_file_header): Move size computation to
10359 Output_file_header::do_size and call it.
10360 (Output_file_header::do_size): New method definition.
10361 (Output_data_group::Output_data_group): Adjust call to
10362 Output_section_data.
10363 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10364 (Output_symtab_xindex::do_write): Add array bound check.
10365 (Output_section::Input_section::print_to_mapfile): Handle
10366 RELAXED_INPUT_SECTION_CODE.
10367 (Output_section::Output_section): Initialize data member checkpoint_.
10368 (Output_section::~Output_section): Delete checkpoint object pointed
10369 by checkpoint_.
10370 (Output_section::add_input_section): Always add an Input_section if
10371 relaxing.
10372 (Output_section::add_merge_input_section): Add assert.
10373 (Output_section::relax_input_section): New method definition.
10374 (Output_section::set_final_data_size): Set load address to zero for
10375 an unallocated section.
10376 (Output_section::do_address_and_file_offset_have_reset_values):
10377 New method definition.
10378 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10379 Handle relaxed input section.
10380 (Output_section::sort_attached_input_sections): Checkpoint input
10381 section list lazily.
10382 (Output_section::get_input_sections): Change type of input_sections to
10383 list of Simple_input_section pointers. Checkpoint input section list
10384 lazily. Also handle relaxed input sections.
10385 (Output_section::add_input_section_for_script): Take a reference to
10386 a Simple_input_section object instead of Relobj pointer and section
10387 index as parameter. Handle relaxed input sections.
10388 (Output_section::save_states, Output_section::restore_states): New
10389 method definitions.
10390 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10391 (Output_data::is_data_size_fixed): New method definition.
10392 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10393 if it is fixed.
10394 (Output_data::address_and_file_offset_have_reset_values): New method
10395 definition.
10396 (Output_data::do_address_and_file_offset_have_reset_values): New method
10397 definition.
10398 (Output_data::set_data_size): Check that data size is not fixed.
10399 (Output_data::fix_data_size): New method definition.
10400 (Output_data::is_data_size_fixed_): New data member.
10401 (Output_section_headers::set_final_data_size): New method definition.
10402 (Output_section_headers::do_size): New method declaration.
10403 (Output_segment_headers::set_final_data_size): New method definition.
10404 (Output_segment_headers::do_size): New method declaration.
10405 (Output_file_header::set_final_data_size)::New method definition.
10406 (Output_file_header::do_size)::New method declaration.
10407 (Output_section_data::Output_section_data): Add new parameter
10408 is_data_size_fixed and use it to fix data size.
10409 (Output_data_const::Output_data_const): Adjust call to base class
10410 constructor and fix data size.
10411 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10412 base class constructor and fix data size.
10413 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10414 base class constructor and fix data size.
10415 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10416 class constructor and fix data size.
10417 (Output_data_group::set_final_data_size): New method definition.
10418 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10419 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10420 class constructor and fix data size.
10421 (Output_relaxed_input_section): New class definition.
10422 (Output_section::Simple_input_section): New class definition.
10423 (Output_section::get_input_sections): Adjust parameter list.
10424 (Output_section::add_input_section_for_script): Same.
10425 (Output_section::save_states, Output_section::restore_states,
10426 Output_section::do_address_and_file_offset_have_reset_values,
10427 (Output_section::Input_section::Input_section): Handle
10428 RELAXED_INPUT_SECTION_CODE. Add new overload for
10429 Output_relaxed_input_section.
10430 (Output_section::Input_section::is_input_section,
10431 Output_section::Input_section::set_output_section): Handle relaxed
10432 input section.
10433 (Output_section::Input_section::is_relaxed_input_section,
10434 Output_section::Input_section::output_section_data,
10435 Output_section::Input_section::relaxed_input_section): New method
10436 definitions.
10437 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10438 value.
10439 (Output_section::Input_section::u1_): Update comments.
10440 (Output_section::Input_section::u2_): Add new union member poris.
10441 (Output_section::Checkpoint_output_section): New classs definition.
10442 (Output_section::relax_input_section): New method declaration.
10443 (Output_section::checkpoint_): New data member.
10444 (Output_segment): Update comments.
10445 (Output_segment::Output_segment): Un-privatize copy constructor.
10446 (Output_segment::operator=): Un-privatize.
10447 * script-sections.cc (Output_section_element::Input_section_list):
10448 Change element type to Output_section::Simple_input_section.
10449 (Output_section_element_dot_assignment::set_section_addresses):
10450 Register output section data for relaxation clean up.
10451 (Output_data_exression::Output_data_expression): Adjust call to base
10452 constructor to fix data size.
10453 (Output_section_element_data::set_section_addresses): Register
10454 Output_data_expression object for relaxation clean up.
10455 (struct Input_section_info): Replace Relobj pointer and section index
10456 pair with Output_section::Simple_input_section and Convert struct to a
10457 class.
10458 (Input_section_sorter::operator()): Adjust access to
10459 Input_section_info data member to use accessors.
10460 (Output_section_element_input::set_section_addresses): Use layout
10461 parameter. Adjust code to use Output_section::Simple_input_section
10462 and Input_secction_info classes. Register filler for relaxation
10463 clean up.
10464 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10465 and section index pair with Output_section::Simple_input_section
10466 class. Adjust code accordingly.
10467 (Phdrs_element::release_segment): New method definition.
10468 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10469 segment list.
10470 (Script_sections::release_segments): New method definition.
10471 * gold/script-sections.h (Script_sections::release_segments): New
10472 method declaration.
10473 * gold/target.h (Target::may_relax, Target::relax,
10474 Target::do_may_relax, Target::do_relax): New method definitions.
10475
10476 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10477
10478 * arm.cc (has_signed_unsigned_overflow): New function.
10479 (Arm_relocate_functions::abs8): New function.
10480 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10481 (Target_arm::Scan::global): Likewise.
10482 (Target_arm::relocate::relocate): Likewise.
10483 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10484 Likewise.
10485
10486 2009-09-16 Cary Coutant <ccoutant@google.com>
10487
10488 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10489 * testsuite/Makefile.in: Regenerate.
10490
10491 2009-09-11 Nick Clifton <nickc@redhat.com>
10492
10493 * po/gold.pot: Updated by the Translation project.
10494
10495 2009-09-08 Cary Coutant <ccoutant@google.com>
10496
10497 * output.cc (Output_file::open): Add execute permission to empty file.
10498 * testsuite/Makefile.am (permission_test): New test.
10499 * testsuite/Makefile.in: Regenerate.
10500
10501 2009-09-02 Ian Lance Taylor <iant@google.com>
10502
10503 * output.cc (Output_file::resize): Call map_no_anonymous rather
10504 than map.
10505
10506 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10507
10508 * gold.cc: Include "incremental.h".
10509 (queue_initial_tasks): Call Incremental_checker methods.
10510 * incremental.cc: Include "output.h".
10511 (Incremental_checker::can_incrementally_link_output_file): New
10512 method.
10513 * incremental.h (Incremental_checker): New class.
10514
10515 * output.cc (Output_file::open_for_modification): New method.
10516 (Output_file::map_anonymous): Changed return type to bool. Record
10517 map in base_ field.
10518 (Output_file::map_no_anonymous): New method, broken out of map.
10519 (Output_file::map): Use map_no_anonymous and map_anonymous.
10520 * output.h (class Output_file): Update declarations.
10521
10522 2009-08-24 Cary Coutant <ccoutant@google.com>
10523
10524 * options.h (Command_line::Pre_options): New class.
10525 (Command_line::pre_options): New member.
10526 * options.cc (gold::options::ready_to_register): New variable.
10527 (One_option::register_option): Do nothing if not registering options.
10528 Assert if same short option registered twice.
10529 (General_options::General_options): Turn off option registration when
10530 done constructing.
10531 (Command_line::Pre_options::Pre_options): New constructor.
10532
10533 2009-08-24 Cary Coutant <ccoutant@google.com>
10534
10535 * options.h (General_options::no_keep_memory): Remove incorrect
10536 short option.
10537
10538 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10539
10540 * Makefile.am (am__skiplex, am__skipyacc): New.
10541 * Makefile.in: Regenerate.
10542
10543 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10544
10545 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10546 (INCLUDES): ... this.
10547 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10548 (AM_CPPFLAGS): Renamed from ...
10549 (INCLUDE): ... this.
10550 * Makefile.in, testsuite/Makefile.in: Regenerate.
10551
10552 * Makefile.in: Regenerate.
10553 * aclocal.m4: Likewise.
10554 * config.in: Likewise.
10555 * configure: Likewise.
10556 * testsuite/Makefile.in: Likewise.
10557
10558 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10559 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10560 * Makefile.in: Regenerate.
10561 * testsuite/Makefile.in: Regenerate.
10562
10563 2009-08-19 Cary Coutant <ccoutant@google.com>
10564
10565 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10566 symbols in shared libraries overridden by hidden or internal symbols
10567 in the main program.
10568
10569 2009-08-19 Chris Demetriou <cgd@google.com>
10570
10571 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10572 checking source file names in error messages.
10573
10574 2009-08-18 Doug Kwan <dougkwan@google.com>
10575
10576 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10577 an elcpp::Ehdr as parameter. Adjust call to set_target.
10578 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10579 an elfcpp::Ehdr as parameter.
10580 * object.cc (Object::set_target): Remove the version that looks up
10581 a target and sets it.
10582 (Sized_relobj::setup): Take a Target object instead of
10583 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10584 (make_elf_sized_object): Find target and ask target to
10585 make an ELF object.
10586 * object.h: (Object::set_target): Remove the version that looks up
10587 a target and sets it.
10588 (Sized_relobj::setup): Take a Target object instead of
10589 an elfcpp:Ehdr as parameter.
10590 * target.cc: Include dynobj.h.
10591 (Target::do_make_elf_object_implementation): New.
10592 (Target::do_make_elf_object): New.
10593 * target.h (Target::make_elf_object): New template declaration.
10594 (Target::do_make_elf_object): New method declarations.
10595 (Target::do_make_elf_object_implementation): New template declaration.
10596
10597 2009-08-14 Ian Lance Taylor <iant@google.com>
10598
10599 * gold.h (FUNCTION_NAME): Define.
10600 (gold_unreachable): Use FUNCTION_NAME.
10601
10602 2009-08-12 Sriraman Tallam <tmsriram@google.com>
10603
10604 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10605 symbol in the --keep-unique list is not found.
10606
10607 2009-08-12 Sriraman Tallam <tmsriram@google.com>
10608
10609 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10610 been maked as --keep-unique.
10611 (Icf::unfold_section): New function.
10612 * icf.h (Icf::unfold_section): New function.
10613 * options.h (General_options::keep_unique): New option.
10614 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10615 * testsuite/Makefile.in: Regenerate.
10616 * testsuite/icf_keep_unique_test.sh: New file.
10617 * testsuite/icf_keep_unique_test.cc: New file.
10618
10619 2009-08-12 Cary Coutant <ccoutant@google.com>
10620
10621 PR 10471
10622 * resolve.cc (Symbol_table::resolve): Check for references from
10623 dynamic objects to hidden and internal symbols.
10624 * testsuite/Makefile.am (hidden_test.sh): New test.
10625 * testsuite/Makefile.in: Regenerate.
10626 * testsuite/hidden_test.sh: New script.
10627 * testsuite/hidden_test_1.c: New test source.
10628 * testsuite/hidden_test_main.c: New test source.
10629
10630 2009-08-11 Doug Kwan <dougkwan@google.com>
10631
10632 * arm.cc: Update comments.
10633 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10634 segment to locate the .ARM.exidx section if present.
10635
10636 2009-08-09 Doug Kwan <dougkwan@google.com>
10637
10638 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10639 patch.
10640
10641 2009-08-07 Sriraman Tallam <tmsriram@google.com>
10642 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10643 compiler warnings.
10644
10645 2009-08-06 Sriraman Tallam <tmsriram@google.com>
10646
10647 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10648 valid tls_segment only for non-debug-section relocations.
10649 * testsuite/Makefile.am: Add gc_tls_test.
10650 * testsuite/Makefile.in: Regenerate.
10651 * testsuite/gc_tls_test.cc: New file.
10652 * testsuite/gc_tls_test.sh: New file.
10653
10654 2009-08-05 Sriraman Tallam <tmsriram@google.com>
10655
10656 * icf.cc: New file.
10657 * icf.h: New file.
10658 * Makefile.am (CCFILES): Add icf.cc.
10659 (HFILES): Add icf.h
10660 * Makefile.in: Regenerate.
10661 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10662 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10663 section, symbol and addend information for the relocs.
10664 * gold.cc (queue_middle_tasks): Call identical code folding.
10665 * gold.h: Add defines for multimap.
10666 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10667 to the call of finalize_local_symbols.
10668 * main.cc (main): Create object of class Icf.
10669 * object.cc (Sized_relobj::do_layout): Allow this function to be
10670 called twice during icf.
10671 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10672 to sections marked as identical by icf.
10673 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10674 when available.
10675 (Sized_relobj::do_section_entsize): New function.
10676 * object.h (Object::section_entsize): New function.
10677 (Object::do_section_entsize): New pure virtual function.
10678 (Relobj::finalize_local_symbols): Add new parameter.
10679 (Relobj::do_section_entsize): New function.
10680 * options.h (General_options::icf): New option.
10681 (General_options::icf_iterations): New option.
10682 (General_options::print_icf_sections): New option.
10683 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10684 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10685 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10686 icf.
10687 * symtab.cc (Symbol_table::is_section_folded): New function.
10688 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10689 to sections marked as identical by icf.
10690 * symtab.h (Symbol_table::set_icf): New function.
10691 (Symbol_table::icf): New function.
10692 (Symbol_table::is_section_folded): New function.
10693 (Symbol_table::icf_): New data member.
10694 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10695 * testsuite/Makefile.am: Add commands to build icf_test.
10696 * testsuite/Makefile.in: Regenerate.
10697 * testsuite/icf_test.sh: New file.
10698 * testsuite/icf_test.cc: New file.
10699
10700 2009-07-24 Chris Demetriou <cgd@google.com>
10701
10702 * layout.cc (is_compressible_debug_section): Fix incorrect
10703 comment about compressed section names.
10704
10705 2009-07-20 Ian Lance Taylor <ian@airs.com>
10706
10707 PR 10419
10708 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10709
10710 2009-07-16 Ian Lance Taylor <iant@google.com>
10711
10712 PR 10400
10713 * layout.h: #include <map>.
10714 (class Kept_section): Change from struct to class. Add accessors
10715 and setters. Add section size to Comdat_group mapping. Change
10716 Comdat_group to std::map. Add is_comdat_ field. Add
10717 linkonce_size field in union.
10718 (class Layout): Update declaration of find_or_add_kept_section.
10719 Don't declare find_kept_object.
10720 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10721 parameter. Add object, shndx, is_comdat, and is_group_name
10722 parameters. Change all callers. Adjust for new Kept_section.
10723 (Layout::find_kept_object): Remove.
10724 * object.cc (Sized_relobj::include_section_group): Update use of
10725 Kept_section. Rename secnum to shndx. Only record
10726 Kept_comdat_section if sections are the same size.
10727 (Sized_relobj::include_linkonce_section): Update use of
10728 Kept_section. Only record Kept_comdat_section if sections are the
10729 same size. Set size of linkonce section.
10730 (Sized_relobj::map_to_kept_section): Update call to
10731 get_kept_comdat_section.
10732 * object.h (class Sized_relobj): Rename fields in
10733 Kept_comdat_section to drop trailing underscores; change object
10734 field to Relobj*. Change Kept_comdat_section_table to store
10735 struct rather than pointer.
10736 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10737 Add kept_object and kept_shndx parameters. Change all callers.
10738 (Sized_relobj::get_kept_comdat_section): Change return type to
10739 bool. Add kept_object and kept_shndx parameters. Change all
10740 callers.
10741 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10742 Layout::find_or_add_kept_section.
10743
10744 2009-07-09 Ian Lance Taylor <iant@google.com>
10745
10746 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10747 Reserve space in the hash table.
10748
10749 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10750
10751 * fileread.cc (File_read::get_mtime): New method.
10752 * fileread.h (Timespec): New structure.
10753 (File_read::get_mtime): New method.
10754 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10755 Renamed from timestamp_nsec.
10756 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10757 Elf_Xword.
10758 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
10759 timestamp_nsec.
10760 (Incremental_inputs::report_archive): Save mtime; style fix.
10761 (Incremental_inputs::report_obejct): Save mtime; style fix.
10762 (Incremental_inputs::report_script): Save mtime; style fix.
10763 (Incremental_inputs::finalize_inputs): Style fix.
10764 (Incremental_inputs::finalize): Style fix.
10765 (Incremental_inputs::create_input_section_data): Store inputs
10766 mtime.
10767 * incremental.h (Incremental_inputs::report_script): Add mtime
10768 argument.
10769 (Incremental_inputs::Input_info::Input_info): Intialize only one
10770 union member.
10771 (Incremental_inputs::Input_info::archive): Move to nameless
10772 union.
10773 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10774 (Incremental_inputs::Input_info::script): Move to nameless union.
10775 (Incremental_inputs::mtime): New field.
10776 * script.cc (read_input_script): Pass file mtime to
10777 Incremental_input.
10778 * script.h (Script_info::inputs): Style fix.
10779
10780 2009-07-01 Ian Lance Taylor <ian@airs.com>
10781
10782 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10783 instead of 32.
10784
10785 2009-06-24 Ian Lance Taylor <iant@google.com>
10786
10787 PR 10156
10788 * layout.cc (Layout::choose_output_section): If we find an
10789 existing section, update the flags.
10790 (Layout::create_notes): New function, broken out of
10791 Layout::finalize.
10792 (Layout::finalize): Don't create note sections.
10793 (Layout::create_note): Don't crash if linker script discards
10794 section.
10795 (Layout::create_gold_note): Likewise.
10796 (Layout::create_build_id): Likewise. Don't set
10797 after_input_sections on the section.
10798 (Layout::create_executable_stack_info): Remove target parameter.
10799 Change caller.
10800 * layout.h (class Layout): Declare create_notes. Update
10801 declaration of create_executable_stack_info.
10802 * gold.cc (queue_middle_tasks): Call create_notes.
10803 * output.cc (Output_section::update_flags_for_input_section): Move
10804 here from output.h. If SHF_ALLOC flag is newly set, mark address
10805 invalid.
10806 * output.h (Output_data::mark_address_invalid): New function.
10807 (class Output_section): Only declare, not define,
10808 update_flags_for_input_section. Remove set_flags.
10809
10810 2009-06-24 Ian Lance Taylor <iant@google.com>
10811
10812 * script-sections.cc (Output_section_definition::
10813 set_section_addresses): Rename shadowing local load_address to
10814 laddr.
10815
10816 2009-06-24 Ian Lance Taylor <iant@google.com>
10817
10818 PR 10244
10819 * reloc.cc (relocate_sections): Skip empty relocation sections.
10820
10821 2009-06-23 Ian Lance Taylor <iant@google.com>
10822
10823 PR 10156
10824 * layout.cc (Layout::create_note): Use choose_output_section
10825 rather than make_output_section.
10826
10827 2009-06-23 Ian Lance Taylor <iant@google.com>
10828
10829 PR 10237
10830 * options.cc (General_options::parse_V): Set printed_version_.
10831 (General_options::General_options): Initialize printed_version_.
10832 * options.h (class General_options): Add printed_version_ field.
10833 * gold.cc (queue_initial_tasks): If there are no input files,
10834 don't give a fatal error if we printed the version information.
10835 (queue_middle_tasks): If using -r with a shared object, give a
10836 fatal error rather than an ordinary error.
10837
10838 2009-06-23 Ian Lance Taylor <iant@google.com>
10839
10840 PR 10219
10841 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10842 (Layout::make_output_section): Set have_stabstr_section_ if we see
10843 a .stab*str section.
10844 (Layout::finalize): Call link_stabs_sections.
10845 (Layout::link_stabs_sections): New file.
10846 * layout.h (class Layout): Add have_stabstr_section_ field.
10847 Declare link_stabs_sections.
10848
10849 2009-06-23 Doug Kwan <dougkwan@google.com>
10850
10851 * Makefile.am (libgold_a_LIBADD): New.
10852 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
10853 * Makefile.in: Regenerate.
10854 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10855 * configure: Regenerate.
10856 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10857 * fileread.cc: Include sys/state.h
10858 * gold.h: Declare memmem and strndup if found missing.
10859 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10860
10861 2009-06-23 Ian Lance Taylor <iant@google.com>
10862
10863 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10864 * configure: Rebuild.
10865
10866 2009-06-23 Ian Lance Taylor <iant@google.com>
10867
10868 PR 10147
10869 * object.cc (Object::section_contents): Don't try to get a view if
10870 the section has length zero.
10871 (Object::handle_gnu_warning_section): If the section is empty, use
10872 the name of the section as the warning.
10873
10874 2009-06-23 Ian Lance Taylor <iant@google.com>
10875
10876 PR 10133
10877 * stringpool.h (class Stringpool_template): Add optimize_ field.
10878 (Stringpool_template::set_optimize): New function.
10879 * stringpool.cc (Stringpool_template::Stringpool_template):
10880 Initialize optimize_ field.
10881 (Stringpool_template::set_string_offsets): Test local optimize
10882 fild rather than parameter.
10883 * layout.cc (Layout::Layout): Call set_optimize on the section
10884 name stringpool.
10885
10886 2009-06-22 Ian Lance Taylor <iant@google.com>
10887
10888 PR 10030
10889 * yyscript.y: Parse TARGET.
10890 * script.cc (script_set_target): New function.
10891 * script-c.h (script_set_target): Declare.
10892 * options.cc (General_options::string_to_object_format): Rename
10893 from string_to_object_format in anonymous namespace. Change
10894 callers.
10895 * options.h (class General_options): Declare
10896 string_to_object_format.
10897
10898 2009-06-22 Ian Lance Taylor <iant@google.com>
10899
10900 * script-sections.cc (Script_sections::create_segments): Don't put
10901 program headers in a PT_LOAD segment if -n or -N.
10902
10903 2009-06-22 Ian Lance Taylor <iant@google.com>
10904
10905 PR 10141
10906 * options.h (class General_options): Add -z lazy and -z now. Sort
10907 -z options into alphabetical order.
10908 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10909
10910 2009-06-21 Ian Lance Taylor <iant@google.com>
10911
10912 * layout.cc (Layout::make_output_section): Call
10913 Target::new_output_section.
10914 (Layout::attach_allocated_section_to_segment): Put large section
10915 sections in a separate load segment with the large segment flag
10916 set.
10917 (Layout::segment_precedes): Sort large data segments after other
10918 load segments.
10919 (align_file_offset): New static function.
10920 (Layout::set_segment_offsets): Use align_file_offset.
10921 * output.h (class Output_section): Add is_small_section_ and
10922 is_large_section_ fields.
10923 (Output_section::is_small_section): New function.
10924 (Output_section::set_is_small_section): New function.
10925 (Output_section::is_large_section): New function.
10926 (Output_section::set_is_large_section): New function.
10927 (Output_section::is_large_data_section): New function.
10928 (class Output_segment): Add is_large_data_segment_ field.
10929 (Output_segment::is_large_data_segment): New function.
10930 (Output_segment::set_is_large_data_segment): New function.
10931 * output.cc (Output_section::Output_section): Initialize new
10932 fields.
10933 (Output_segment::Output_segment): Likewise.
10934 (Output_segment::add_output_section): Add assertion that large
10935 data sections always go in large data segments. Force small data
10936 sections to the end of the list of data sections. Force small BSS
10937 sections to the start of the list of BSS sections. For large BSS
10938 sections to the end of the list of BSS sections.
10939 * symtab.h (class Symbol): Declare is_common_shndx.
10940 (Symbol::is_defined): Check Symbol::is_common_shndx.
10941 (Symbol::is_common): Likewise.
10942 (class Symbol_table): Define enum Commons_section_type. Update
10943 declarations. Add small_commons_ and large_commons_ fields.
10944 * symtab.cc (Symbol::is_common_shndx): New function.
10945 (Symbol_table::Symbol_table): Initialize new fields.
10946 (Symbol_table::add_from_object): Put small and large common
10947 symbols in the right list.
10948 (Symbol_table::sized_finalized_symbol): Check
10949 Symbol::is_common_shndx.
10950 (Symbol_table::sized_write_globals): Likewise.
10951 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10952 common symbol lists. Don't call do_allocate_commons_list if the
10953 list is empty.
10954 (Symbol_table::do_allocate_commons_list): Remove is_tls
10955 parameter. Add comons_section_type parameter. Change all
10956 callers. Handle small and large common symbols.
10957 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10958 Symbol::is_common_shndx.
10959 * resolve.cc (symbol_to_bits): Likewise.
10960 * target.h (Target::small_common_shndx): New function.
10961 (Target::small_common_section_flags): New function.
10962 (Target::large_common_shndx): New function.
10963 (Target::large_common_section_flags): New function.
10964 (Target::new_output_section): New function.
10965 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10966 small_common_section_flags, and large_common_section_flags
10967 fields.
10968 (Target::do_new_output_section): New virtual function.
10969 * arm.cc (Target_arm::arm_info): Initialize new fields.
10970 * i386.cc (Target_i386::i386_info): Likewise.
10971 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10972 Likewise.
10973 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10974 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10975 (Target_x86_64::do_new_output_section): New function.
10976 * configure.ac: Define conditional MCMODEL_MEDIUM.
10977 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10978 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10979 (large_LDFLAGS): Define.
10980 * testsuite/large.c: New file.
10981 * testsuite/testfile.cc (Target_test::test_target_info):
10982 Initialize new fields.
10983 * configure, testsuite/Makefile.in: Rebuild.
10984
10985 2009-06-05 Doug Kwan <dougkwan@google.com>
10986
10987 * Makefile.am (CCFILES): Add target.cc.
10988 * Makefile.in: Regenerate.
10989 * i386.cc (class Target_i386): Define new virtual method to
10990 override do_is_local_label_name in parent.
10991 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10992 local symbols if --discard-locals or -X is given.
10993 * options.h (class General_options): Declare new options
10994 '--discard-locals' and '-X' for discarding locals.
10995 * target.h (class Target): Define new methods is_local_label_name.
10996 Declare new virtual method do_is_local_label_name.
10997 * target.cc: New file.
10998 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10999 (check_SCRIPTS): Add discard_locals_test.sh.
11000 (check_DATA): Add discard_local_tests.syms.
11001 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11002 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11003 * testsuite/Makefile.in: Regenerate.
11004 * testsuite/discard_locals_test.c: New file.
11005 * testsuite/discard_locals_test.sh: Same.
11006
11007 2009-06-05 Doug Kwan <dougkwan@google.com>
11008
11009 * object.cc (Sized_relobj::Sized_relobj): Initialize
11010 discarded_eh_frame_shndx_ to -1U.
11011 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11012 section.
11013 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11014 a discarded .eh_frame section.
11015 (Sized_relobj::do_finalize_local_symbols): Ditto.
11016 * object.h (class Sized_relobj): Declare new member
11017 discarded_eh_frame_shndx_.
11018 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11019 (local_labels_test.o, local_labels_test): New rules.
11020 * testsuite/Makefile.in: Regenerate.
11021
11022 2009-06-04 Doug Kwan <dougkwan@google.com>
11023
11024 * layout.cc (Layout::section_name_mapping): Add mapping for
11025 special ARM sections.
11026
11027 2009-06-03 Doug Kwan <dougkwan@google.com>
11028
11029 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11030 (utils::has_overflow): Same.
11031
11032 2009-06-03 Ian Lance Taylor <iant@google.com>
11033
11034 * layout.cc (Layout::section_name_mapping): New array, replacing
11035 Layout::linkonce_mapping.
11036 (Layout::section_name_mapping_count): New variable, replacing
11037 Layout::linkonce_mapping_count.
11038 (Layout::linkonce_output_name): Remove.
11039 (Layout::output_section_name): Rewrite.
11040 * layout.h (class Layout): Rename Linkonce_mapping to
11041 Section_name_mapping, linkonce_mapping to section_name_mapping,
11042 linkonce_mapping_count to section_name_mapping_count. Don't
11043 declare linkonce_output_name.
11044
11045 2009-06-03 Doug Kwan <dougkwan@google.com>
11046
11047 * gold/arm.cc (namespace utils): New.
11048 (Target_arm::reloc_is_non_pic): Define new method.
11049 (class Arm_relocate_functions): New.
11050 (Target_arm::Relocate::relocate): Handle relocation types used by
11051 Android.
11052
11053 2009-06-03 Ian Lance Taylor <iant@google.com>
11054
11055 * arm.cc (Target_arm::scan::global): Use || instead of |.
11056
11057 2009-06-02 Doug Kwan <dougkwan@google.com>
11058
11059 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11060 issued_non_pic_error_.
11061 (class Target_arm::Scan): Declare new method check_non_pic.
11062 Define new method symbol_needs_plt_entry.
11063 Declare new data member issued_non_pic_error_.
11064 (class Target_arm::Relocate): Declare new method
11065 should_apply_static_reloc.
11066 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11067 (Target_arm::Scan::check_non_pic): Define new method.
11068 (Target_arm::Scan::local): Handle a small subset of reloc types used
11069 by Android.
11070 (Target_arm::Scan::local): Same.
11071 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11072
11073 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11074
11075 * incremental.cc (Incremental_inputs::report_command_line): Filter
11076 out --incremental-* options.
11077
11078 2009-05-29 Doug Kwan <dougkwan@google.com>
11079
11080 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11081 template class.
11082 (class Target_arm): Update comment.
11083 (Target_arm::Target_arm): Initialize new data members GOT_,
11084 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11085 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11086 and Target_arm::rel_dyn_section.
11087 Declare new_enum Target_arm::Got_type.
11088 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11089 and DYNBSS_.
11090 Update commments for member do_dynsym_value.
11091 (Target_arm::got_size, Target_arm::plt_section,
11092 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11093 new methods inside class defintion.
11094 (Target_arm::got_section): Define new method.
11095 (Target_arm::rel_dyn_section): Same.
11096 (Output_data_plt_arm): New template class.
11097 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11098 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11099 (Output_data_plt_arm::add_entry): Same.
11100 (Output_data_plt_arm::first_plt_entry): Define new
11101 static data member for PLT instruction template.
11102 (Output_data_plt_arm::plt_entry): Same.
11103 (Output_data_plt_arm::do_write): Define new method.
11104 (Target_arm::make_plt_entry): Same.
11105 (Target_arm::do_finalize_sections): Same.
11106 (Target_arm::do_dynsym_value): Same.
11107
11108 2009-05-28 Doug Kwan <dougkwan@google.com>
11109
11110 * Makefile.am (TARGETSOURCES): Add arm.cc.
11111 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11112 * Makefile.in: Regenerate.
11113 * arm.cc: New file.
11114 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11115
11116 2009-05-26 Doug Kwan <dougkwan@google.com>
11117
11118 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11119 (General_options::check_excluded_libs): Strip off directories in
11120 archive name before matching like GNU ld does.
11121 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11122 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11123 (exclude_libs_test_LDFLAGS): Add linker option
11124 -Wl,--exclude-libs,libexclude_libs_test_3
11125 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11126 an explicit archive without using -l.
11127 (alt/libexclude_libs_test_3.a): New make rule.
11128 * testsuite/Makefile.in: Regenerate.
11129 * testsuite/exclude_libs_test.c : Declare lib3_default().
11130 (main): Call it.
11131 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11132 * exclude_libs_test_3.c: New file.
11133
11134 2009-05-26 Nick Clifton <nickc@redhat.com>
11135
11136 * po/id.po: New Indonesian translation.
11137 * po/gold.pot: Updated template file.
11138
11139 2009-05-22 Sriraman Tallam <tmsriram@google.com>
11140
11141 * testsuite/Makefile.am: Add -ffunction-sections to compile
11142 gc_comdat_test files. Add -Wl,--gc-sections to build
11143 gc_comdat_test.
11144 * testsuite/Makefile.in: Regenerate.
11145 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11146
11147 2009-05-21 Sriraman Tallam <tmsriram@google.com>
11148
11149 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11150 kept comdat section was garbage collected.
11151 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11152 * testsuite/Makefile.in: Regenerate.
11153 * testsuite/gc_comdat_test.sh: New file.
11154 * testsuite/gc_comdat_test_1.cc: New file.
11155 * testsuite/gc_comdat_test_2.cc: New file.
11156
11157 2009-05-19 Doug Kwan <dougkwan@google.com>
11158
11159 * archive.cc (Archive::Archive): Move constructor from archive.h
11160 to here. Initialize no_export_.
11161 (Archive::get_elf_object_for_member): Set no_export flag of object.
11162 * archive.h (Archive::Archive): Move constructor body to
11163 archive.cc.
11164 (Archive::no_export): New method.
11165 (Archive::no_export_): New field.
11166 * object.h (Object::Object): Initialize no_export_ to false.
11167 (Object::no_export, Object::set_no_export): New methods.
11168 (Object::no_export_): New field.
11169 * options.cc (General_options::parse_exclude_libs): New method.
11170 (General_options::check_excluded_libs) Same.
11171 * options.h (exclude_libs): New option.
11172 (General_options::check_excluded_libs): New method declaration.
11173 (General_options::excluded_libs_): New field.
11174 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11175 default or protected visibility if an object has no-export flag set.
11176 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11177 (check_SCRIPTS): Add exclude_libs_test.sh.
11178 (check_DATA): Add exclude_libs_test.syms.
11179 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11180 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11181 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11182 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11183 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11184 libexclude_libs_test_2.a): New rules.
11185 * testsuite/Makefile.in: Regenerate.
11186 * testsuite/exclude_libs_test.c: New file.
11187 * testsuite/exclude_libs_test.sh: Ditto.
11188 * testsuite/exclude_libs_test_1.c: Ditto.
11189 * testsuite/exclude_libs_test_2.c: Ditto.
11190
11191 2009-05-15 Ian Lance Taylor <iant@google.com>
11192
11193 * configure.ac: Check for declarations for cases where libiberty.h
11194 checks HAVE_DECL_xxx.
11195 * configure, config.in: Rebuild.
11196
11197 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11198
11199 * gold.h (Incremental_argument_list): Remove (invalid) forward
11200 declaration.
11201 * incremental.cc (Incremental_inputs::report_achive): New method.
11202 (Incremental_inputs::report_object): New method.
11203 (Incremental_inputs::report_script): New method.
11204 (Incremental_inputs::finalize_inputs): New method.
11205 (Incremental_inputs::finalize): Call finalize_inputs().
11206 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11207 Create inputs entries.
11208 * incremental.h (Incremental_input_type): New enum.
11209 (Incremental_inputs::Incremental_input): Initialize new fields.
11210 (Incremental_inputs::report_inputs): New method.
11211 (Incremental_inputs::report_achive): New method.
11212 (Incremental_inputs::report_object): New method.
11213 (Incremental_inputs::report_script): New method.
11214 (Incremental_inputs::finalize_inputs): New method.
11215 (Incremental_inputs::Input_info): New struct.
11216 (Incremental_inputs::Input_info_map): New typedef.
11217 (Incremental_inputs::lock_): New field.
11218 (Incremental_inputs::Inputs_): New field.
11219 (Incremental_inputs::Inputs_map): New field.
11220 * main.cc (main): Call Incremental_input::report_inputs.
11221 * options.h (Input_argument_list): Typedef moved from
11222 Input_arguments.
11223 (Input_file_group::Files): Remove, use ::Input_argument_list.
11224 (Input_file_group::Input_argument_list): Remove, use
11225 ::Input_argument_list.
11226 * plugin.cc (Plugin_manager::add_input_file): Add error in
11227 incremental build.
11228 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11229 functions.
11230 * script.cc (read_input_script): Call
11231 Incremental_input::report_script.
11232 * script.h (Script_info): New class.
11233
11234 2009-04-27 Ian Lance Taylor <iant@google.com>
11235
11236 * x86_64.cc (do_adjust_output_section): Set entsize to
11237 plt_entry_size.
11238
11239 2009-04-23 Elliott Hughes <enh@google.com>
11240
11241 * output.cc (Output_file::close): After short writes, continue
11242 writing from the correct offset in the buffer being written.
11243
11244 2009-04-23 Chris Demetriou <cgd@google.com>
11245
11246 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11247 * configure: Regenerate.
11248 * config.in: Regenerate.
11249 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11250 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11251
11252 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11253
11254 * incremental.cc (Incremental_inputs_header_data): Renamed from
11255 Incremental_input_header_data.
11256 (Incremental_inputs_header_data::data_size): New field.
11257 (Incremental_inputs_header_data::put_input_file_count): Renamed
11258 from input_file_count.
11259 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11260 from command_line_offset.
11261 (Incremental_inputs_header_data::put_reserved): Renamed from
11262 put_reserved.
11263 (Incremental_inputs_entry_data): Renamed from
11264 Incremental_input_entry_data.
11265 (Incremental_inputs_entry_data::data_size): New field.
11266 (Incremental_inputs::report_command_line): New method.
11267 (Incremental_inputs::finalize): New method.
11268 (Incremental_inputs::create_incremental_inputs_data): New method.
11269 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11270 * incremental.h: New file.
11271 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
11272 (Layout::finalize): Create incremental inputs section in
11273 incremental builds.
11274 (Layout::create_incremental_info_sections): New method.
11275 * layout.h (Layout::incremental_inputs): New method.
11276 (Layout::create_incremental_info_sections): New method.
11277 (Layout::incremental_inputs_): New field.
11278 * main.cc (main): Notify Incremental_input of the command line.
11279
11280 2009-04-01 Ian Lance Taylor <iant@google.com>
11281 Mikolaj Zalewski <mikolajz@google.com>
11282
11283 * gold.h (reserve_unordered_map): Define, three versions, one for
11284 each version of Unordered_map.
11285 * layout.cc (Layout::Layout): Remove options parameter. Add
11286 number_of_input_files parameter. Don't initialize options_.
11287 Initialize number_of_input_files_ and resized_signatures_. Move
11288 sections_are_attached_.
11289 (Layout::layout_group): Reserve space for group_signatures_.
11290 (Layout::find_or_add_kept_section): Change name parameter to be a
11291 reference. Resize signatures_ map when it gets large enough.
11292 (Layout::layout_eh_frame): Use parameters->options() instead of
11293 this->options_.
11294 (Layout::make_output_section): Likewise.
11295 (Layout::attach_allocated_section_to_segment): Likewise.
11296 (Layout::finalize, Layout::create_executable_stack): Likewise.
11297 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11298 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11299 * layout.h (class Layout): Update declarations. Remove options_
11300 field. Add number_of_input_files_ and resized_signatures_
11301 fields. Move sections_are_attached_ field.
11302 * main.cc (main): Pass number of input files to Layout
11303 constructor. Don't pass options.
11304
11305 2009-03-30 Ian Lance Taylor <iant@google.com>
11306
11307 * ffsll.c (ffsll): Correct implementation.
11308
11309 2009-03-27 Ian Lance Taylor <iant@google.com>
11310
11311 * ffsll.c: New file.
11312 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11313 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11314 * ftruncate.c (ftruncate): Declare before definition.
11315 * mremap.c (mremap): Likewise.
11316 * pread.c (pread): Likewise.
11317 * configure, Makefile.in, config.in: Rebuild.
11318
11319 * mremap.c: New file.
11320 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11321 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11322 (mremap): Declare if HAVE_MREMAP is not defined.
11323 * configure, Makefile.in, config.in: Rebuild.
11324
11325 2009-03-27 Cary Coutant <ccoutant@google.com>
11326
11327 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11328 position independent.
11329 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11330 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11331
11332 2009-03-24 Cary Coutant <ccoutant@google.com>
11333
11334 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11335 an executable.
11336 (needs_dynamic_reloc): Likewise.
11337
11338 2009-03-24 Ian Lance Taylor <iant@google.com>
11339
11340 * yyscript.y (file_cmd): Recognize EXTERN.
11341 (extern_name_list, extern_name_list_body): New nonterminals.
11342 * script.cc (script_add_extern): Define.
11343 * script-c.h (script_add_extern): Declare.
11344
11345 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
11346
11347 * object.cc (is_elf_object): Define.
11348 * object.h (is_elf_object): Declare.
11349 * archive.cc (Archive::get_elf_object_for_member): Call
11350 is_elf_object.
11351 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
11352
11353 2009-03-24 Elliott Hughes <enh@google.com>
11354
11355 * output.cc (Output_file::map_anonymous): Define.
11356 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11357 try an anonymous one. Report the size if the mmap fails.
11358 * output.h (class Output_file): Declare map_anonymous.
11359
11360 2009-03-24 Ian Lance Taylor <iant@google.com>
11361
11362 * target-select.cc (instantiate_target): Don't acquire the lock if
11363 the instantiated_target_ field has already been set.
11364
11365 2009-03-23 Ian Lance Taylor <iant@google.com>
11366
11367 * gold-threads.h (class Initialize_lock): Define.
11368 * gold-threads.cc (class Initialize_lock_once): Define.
11369 (initialize_lock_control): New static variable.
11370 (initialize_lock_pointer): New static variable.
11371 (initialize_lock_once): New static function.
11372 (Initialize_lock::Initialize_lock): Define.
11373 (Initialize_lock::initialize): Define.
11374 * target-select.h: Include "gold-threads.h".
11375 (class Target_selector): Add lock_ and initialize_lock_ fields.
11376 Don't define instantiate_target, just declare it.
11377 * target-select.cc (Target_selector::Target_selector): Initialize
11378 new fields.
11379 (Target_selector::instantiate_target): Define.
11380 * descriptors.h: Include "gold-threads.h".
11381 (class Descriptors): Add initialize_lock_ field.
11382 * descriptors.cc (Descriptors::Descriptors): Initialize new
11383 field.
11384 (Descriptors::open): Use initialize_lock_ field
11385 * errors.h (class Errors): Add initialize_lock_ field.
11386 * errors.cc (Errors::Errors): Initialize new field.
11387 (Errors::initialize_lock): Use initialize_lock_ field.
11388 * powerpc.cc (class Target_selector_powerpc): Remove
11389 instantiated_target_ field. In do_recognize call
11390 instantiate_target rather than do_instantiate_target. In
11391 do_instantiate_target just allocate a new target.
11392 * sparc.cc (class Target_selector_sparc): Likewise.
11393
11394 * freebsd.h: New file.
11395 * i386.cc: Include "freebsd.h".
11396 (Target_i386): Derive from Target_freebsd rather than
11397 Sized_target.
11398 (Target_selector_i386): Derive from Target_selector_freebsd rather
11399 than Target_selector.
11400 * x86_64.cc: Include "freebsd.h".
11401 (Target_x86_64): Derive from Target_freebsd rather than
11402 Sized_target.
11403 (Target_selector_x86_64): Derive from Target_selector_freebsd
11404 rather than Target_selector.
11405 * target.h (class Target): Add adjust_elf_header and
11406 do_adjust_elf_header.
11407 * output.cc (Output_file_header:: do_sized_write): Call target
11408 adjust_elf_header routine.
11409 * configure.tgt: Set targ_osabi.
11410 * configure.ac: Define GOLD_DEFAULT_OSABI.
11411 * parameters.cc (Parameters::default_target): Pass
11412 GOLD_DEFAULT_OSABI to select_target.
11413 * target-select.h (class Target_selector): Make instantiate_target
11414 protected rather than private.
11415 * Makefile.am (HFILES): Add freebsd.h.
11416 * configure, Makefile.in, config.in: Rebuild.
11417
11418 * merge.cc (do_add_input_section): Correct pend value. Change
11419 message about last entry not being null terminated from error to
11420 warning.
11421
11422 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11423
11424 * incremental.cc: New file.
11425 * Makefile.am (CCFILES): Add incremental.cc.
11426 * Makefile.in: Rebuild.
11427
11428 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11429
11430 * layout.cc (Layout::output_section_name): Preserve names
11431 of '.note.' sections.
11432
11433 2009-03-19 Ian Lance Taylor <iant@google.com>
11434
11435 * descriptors.cc (Descriptors::open): Check that the options are
11436 valid before using them.
11437
11438 2009-03-18 Ian Lance Taylor <iant@google.com>
11439
11440 * script-sections.h: Include <list>.
11441 (class Script_sections): Change Sections_elements from std::vector
11442 to std::list. Typedef public Elements_iterator. Add
11443 orphan_section_placement_, data_segment_align_start_, and
11444 saw_data_segment_align_ fields. Remove data_segment_align_index_
11445 field.
11446 * script-sections.cc (class Orphan_section_placement): New class.
11447 (class Sections_element): Add virtual functions is_relro and
11448 orphan_section_init. Remove virtual function place_orphan_here.
11449 (class Output_section_definition): Add is_relro and
11450 orphan_section_init. Remove place_orphan_here.
11451 (class Orphan_output_section): Likewise.
11452 (Script_sections::Script_sections): Update for field changes.
11453 (Script_sections::data_segment_align): Set saw_data_segment_align_
11454 and data_segment_align_start_, not data_segment_align_index.
11455 (Script_sections::data_segment_relro_end): Check
11456 saw_data_segment_align_. Use data_segment_align_start_ rather
11457 than data_segment_align_index_.
11458 (Script_sections::place_orphan): Rewrite to use
11459 Orphan_section_placement.
11460
11461 2009-03-17 Ian Lance Taylor <iant@google.com>
11462
11463 * archive.cc (Archive::add_symbols): Check for a version attached
11464 to the symbol name in the archive map.
11465 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11466 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11467 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11468 (ver_test_11.a): New target.
11469 * testsuite/Makefile.in: Rebuild.
11470
11471 * configure.ac: Check for chsize and posix_fallocate. Replace
11472 ftruncate.
11473 * ftruncate.c: New file, from gnulib.
11474 * output.cc (posix_fallocate): Define dummy version if not
11475 HAVE_POSIX_FALLOCATE.
11476 (Output_file::map): Call posix_fallocate rather than lseek and
11477 write.
11478 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11479 * configure, Makefile.in, config.in: Rebuild.
11480
11481 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
11482
11483 * layout.h (Layout::create_note): Add section_name parameter.
11484 * layout.cc (Layout::create_note): Likewise.
11485 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
11486
11487 2009-03-17 Ian Lance Taylor <iant@google.com>
11488
11489 * descriptors.cc: Include "options.h".
11490 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11491 (Descriptors::open): Always use O_CLOEXEC when opening a new
11492 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11493 then set FD_CLOEXEC.
11494
11495 * sparc.cc (class Target_sparc): Add has_got_section.
11496 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11497 make sure we have a GOT section.
11498
11499 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11500 (Target_sparc::Scan::local): Likewise.
11501 (Target_sparc::Scan::global): Likewise.
11502 (Target_sparc::Relocate::relocate): Likewise.
11503 (Target_sparc::Relocate::relocate_tls): Likewise.
11504
11505 * symtab.cc (Symbol_table::define_default_version): New function,
11506 broken out of add_from_object.
11507 (Symbol_table::add_from_object): Call define_default_version.
11508 (Symbol_table::define_special_symbol): Add resolve_oldsym
11509 parameter. Change all callers. If the version for a symbol comes
11510 from a version script, resolve it with the symbol with the same
11511 name with no version. Also add the symbol without a version if
11512 appropriate.
11513 (do_define_in_output_data): If resolving with oldsym, don't delete
11514 sym.
11515 (do_define_in_output_segment): Likewise.
11516 (do_define_as_constant): Likewise.
11517 * symtab.h (class Symbol_table): Update declarations.
11518
11519 2009-03-13 Ian Lance Taylor <iant@google.com>
11520
11521 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11522 (Read_symbols::requeue): New function.
11523 (Read_symbols::do_read_symbols): If make_elf_object fails because
11524 the target type is not configured, and the file was searched for,
11525 issue a warning and retry with the next directory.
11526 (Add_symbols::run): If the file has an incompatible format, and
11527 it was searched for, requeue the Read_symbols task. On error,
11528 release the object.
11529 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11530 dirindex parameter to constructor. Change all callers. Declare
11531 incompatible_warning and requeue.
11532 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11533 input_argument_ and input_group_ fields. Add them to
11534 constructor. Change all callers.
11535 (class Read_script): Add dirindex_ field. Add it to constructor.
11536 Change all callers.
11537 * archive.cc (Archive::setup): Remove input_objects parameter.
11538 Change all callers.
11539 (Archive::get_file_and_offset): Likewise.
11540 (Archive::read_all_symbols): Likewise.
11541 (Archive::read_symbols): Likewise.
11542 (Archive::get_elf_object_for_member): Remove input_objects
11543 parameter. Add punconfigured parameter. Change all callers.
11544 (Archive::add_symbols): Change return type to bool. Check return
11545 value of include_member.
11546 (Archive::include_all_members): Likewise.
11547 (Archive::include_member): Change return type to bool. Return
11548 false if first included object has incompatible target. Set
11549 included_member_ field.
11550 (Add_archive_symbols::run): If add_symbols returns false, requeue
11551 Read_symbols task.
11552 * archive.h (class Archive): Add included_member_ field.
11553 Initialize it in constructor. Add input_file and searched_for
11554 methods. Update declarations.
11555 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11556 input_argument_ fields. Add them to constructor. Change all
11557 callers.
11558 * script.cc: Include "target-select.h".
11559 (class Parser_closure): Add skip_on_incompatible_target_ and
11560 found_incompatible_target_ fields. Add
11561 skip_on_incompatible_target parameter to constructor. Change all
11562 callers. Add methods skip_on_incompatible_target,
11563 clear_skip_on_incompatible_target, found_incompatible_target, and
11564 set_found_incompatible_target.
11565 (read_input_script): Add dirindex parameter. Change all callers.
11566 If parser finds an incompatible target, requeue Read_symbols
11567 task.
11568 (script_set_symbol): Clear skip_on_incompatible_target in
11569 closure.
11570 (script_add_assertion, script_parse_option): Likewise.
11571 (script_start_sections, script_add_phdr): Likewise.
11572 (script_check_output_format): New function.
11573 * script.h (read_input_script): Update declaration.
11574 * script-c.h (script_check_output_format): Declare.
11575 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11576 (ignore_cmd): Remove OUTPUT_FORMAT.
11577 * fileread.cc (Input_file::Input_file): Add explicit this.
11578 (Input_file::will_search_for): New function.
11579 (Input_file::open): Add pindex parameter. Change all callers.
11580 * fileread.h (class Input_file): Add input_file_argument method.
11581 Declare will_search_for. Update declarations.
11582 * object.cc (make_elf_object): Add punconfigured parameter.
11583 Change all callers.
11584 * object.h (class Object): Make input_file public. Add
11585 searched_for method.
11586 (make_elf_object): Update declaration.
11587 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11588 restart search.
11589 * dirsearch.h (class Dirsearch): Update declaration.
11590 * options.h (class General_options): Add --warn-search-mismatch.
11591 * parameters.cc (Parameters::is_compatible_target): New function.
11592 * parameters.h (class Parameters): Declare is_compatible_target.
11593 * workqueue.cc (Workqueue::add_blocker): New function.
11594 * workqueue.h (class Workqueue): Declare add_blocker.
11595
11596 * fileread.cc (Input_file::open): Remove options parameter.
11597 Change all callers.
11598 (Input_file::open_binary): Likewise.
11599 * script.cc (read_input_script): Likewise.
11600 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11601 options parameter from constructor. Change all callers.
11602 (class Read_script): Likewise.
11603 * fileread.h (class Input_file): Update declarations.
11604 * script.h (read_input_script): Update declaration.
11605
11606 2009-03-10 Nick Clifton <nickc@redhat.com>
11607
11608 * po/es.po: New Spanish translation.
11609
11610 2009-03-06 Cary Coutant <ccoutant@google.com>
11611
11612 * options.cc (parse_short_option): Keep dash_z from registering itself.
11613
11614 2009-03-03 Ian Lance Taylor <iant@google.com>
11615
11616 PR 9918
11617 * target-reloc.h (relocate_section): Pass output_section to
11618 relocate.
11619 * i386.cc (Target_i386::should_apply_static_reloc): Add
11620 output_section parameter. Change all callers.
11621 (Target_i386::Relocate::relocate): Add output_section parameter.
11622 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11623 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11624 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11625 * testsuite/two_file_shared.sh: New script.
11626 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11627 (check_DATA): Add two_file_shared.dbg.
11628 (two_file_shared.dbg): New target.
11629 * testsuite/Makefile.in: Rebuild.
11630
11631 2009-03-01 Ian Lance Taylor <iant@google.com>
11632
11633 * configure.ac: Check for byteswap.h.
11634 * configure: Rebuild.
11635 * config.in: Rebuild.
11636
11637 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11638
11639 * layout.cc (Layout::find_or_add_kept_section): New function.
11640 (Layout::add_comdat): Removed.
11641 * layout.h (struct Kept_section): Move out of class Layout.
11642 Remove trailing underscores from field names. Add group_sections
11643 field. Rename group_ field to is_group. Change all uses.
11644 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11645 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11646 comdat_groups_ field.
11647 (Sized_relobj::include_section_group): Use
11648 find_or_add_kept_section and Kept_section::group_sections.
11649 (Sized_relobj::include_linkonce_section): Likewise.
11650 * object.cc (class Sized_relobj): Don't define Comdat_group or
11651 Comdat_group_table. Remove find_comdat_group and
11652 add_comdat_group. Remove comdat_groups_ field.
11653 * plugin.cc (include_comdat_group): Use
11654 Layout::find_or_add_kept_section.
11655
11656 2009-02-28 Ian Lance Taylor <iant@google.com>
11657
11658 * README: --gc-sections and map files are now supported. Document
11659 some build requirements.
11660
11661 PR 6992
11662 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11663 relocatable link set the value of the section symbol to zero.
11664 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11665 relocatable link don't include the section address in the local
11666 symbol value.
11667
11668 2009-02-27 Ian Lance Taylor <iant@google.com>
11669
11670 PR 6811
11671 * options.h (class Search_directory): Add is_system_directory.
11672 (class General_options): Declare is_in_system_directory.
11673 * options.cc (get_relative_sysroot): Make static.
11674 (get_default_sysroot): Make static.
11675 (General_optoins::is_in_system_directory): New function.
11676 * fileread.cc (Input_file::is_in_system_directory): New function.
11677 * fileread.h (class Input_file): Declare is_in_system_directory.
11678 * object.h (class Object): Add is_in_system_directory.
11679 (class Input_objects): Remove system_library_directory_ field.
11680 * object.cc (Input_objects::add_object): Don't set
11681 system_library_directory_.
11682 (input_objects::found_in_system_library_directory): Remove.
11683 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11684 parameter. Change all callers.
11685 (Symbol_table::sized_write_globals): Likewise.
11686 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11687 Call Object::is_in_system_directory.
11688 * symtab.h (class Symbol_table): Update declarations.
11689
11690 PR 5990
11691 * descriptors.h (Open_descriptor): Add is_on_stack field.
11692 * descriptors.cc (Descriptors::open): If the descriptor is on the
11693 top of the stack, remove it. Initialize is_on_stack field.
11694 (Descriptors::release): Only add pod to stack if it is not on the
11695 stack already.
11696 (Descriptors::close_some_descriptor): Clear stack_next and
11697 is_on_stack fields.
11698
11699 PR 7091
11700 * output.cc (Output_section::find_starting_output_address): Rename
11701 from starting_output_address; add PADDR parameter; change return
11702 type.
11703 * output.h (class Output_section): Declare
11704 find_starting_output_address instead of starting_output_address.
11705 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11706 section symbol for which we can't find a merge section.
11707
11708 PR 9836
11709 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11710 hidden or internal, force the symbol to be local.
11711 * resolve.cc (Symbol::override_visibility): Define.
11712 (Symbol::override_base): Use override_visibility.
11713 (Symbol_table::resolve): Likewise.
11714 (Symbol::override_base_with_special): Likewise.
11715 (Symbol_table::override_with_special): If the visibility is hidden
11716 or internal, force the symbol to be local.
11717 * symtab.h (class Symbol): Add set_visibility and
11718 override_visibility.
11719 * testsuite/ver_test_1.sh: New file.
11720 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11721 (check_DATA): Add ver_test_1.syms.
11722 (ver_test_1.syms): New target.
11723 * testsuite/Makefile.in: Rebuild.
11724
11725 2009-02-25 Cary Coutant <ccoutant@google.com>
11726
11727 * layout.cc (Layout::choose_output_section): Don't rename sections
11728 when using a linker script that has a SECTIONS clause.
11729 * Makefile.in: Regenerate.
11730
11731 * testsuite/Makefile.am (script_test_5.sh): New test case.
11732 * testsuite/Makefile.in: Regenerate.
11733 * testsuite/script_test_5.cc: New file.
11734 * testsuite/script_test_5.sh: New file.
11735 * testsuite/script_test_5.t: New file.
11736
11737 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
11738
11739 * archive.cc (Archive::include_member): Update calls to add_symbols.
11740 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11741 the Layout argument.
11742 * dynobj.h (do_add_symbols): Add the Layout argument.
11743 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11744 Layout argument.
11745 * object.h (Object::add_symbols): Add the Layout argument.
11746 (Object::do_add_symbols): Add the Layout argument.
11747 (Sized_relobj::do_add_symbols): Add the Layout argument.
11748 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11749 Unify the two versions.
11750 (Add_plugin_symbols): Remove.
11751 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11752 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11753 (Add_plugin_symbols): Remove.
11754 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11755 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11756 (Add_symbols::run): Make it work with Pulginobj.
11757
11758 2009-02-06 Ian Lance Taylor <iant@google.com>
11759
11760 * object.cc (Sized_relobj::do_layout): Make info message start
11761 with lower case letter.
11762
11763 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11764
11765 * binary.cc: Fix file comment.
11766
11767 * options.h (enum Incremental_disposition): Define.
11768 (class General_options): Add new options: --incremental,
11769 --incremental_changed, --incremental_unchanged,
11770 --incremental_unknown. Add incremental_disposition_ and
11771 implicit_incremental_ fields.
11772 (General_options::incremental_disposition): New function.
11773 (class Position_dependent_options): Add incremental_disposition
11774 option.
11775 (Position_dependent_options::copy_from_options): Set incremental
11776 dispositions.
11777 * options.cc (General_options::parse_incremental_changed): New
11778 function.
11779 (General_options::parse_incremental_unchanged): New function.
11780 (General_options::parse_incremental_unknown): New function.
11781 (General_options::General_options): Initialize new fields
11782 incremental_disposition_ and implicit_incremental_.
11783 (General_options::finalize): Check for uasge of --incremental-*
11784 without --incremental.
11785
11786 2009-02-06 Chris Demetriou <cgd@google.com>
11787
11788 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11789 pointer and to report location as the file name associated with
11790 the symbol.
11791 (gold_undefined_symbol_at_location): New function to replace the
11792 old gold_undefined_symbol functionality.
11793 * target-reloc.h (relocate_section): Update to use
11794 gold_undefined_symbol_at_location.
11795 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11796 Call gold_undefined_symbol function rather than gold_error.
11797 * errors.h (Errors::undefined_symbol): Take location as a
11798 string, rather than calculating it from a relocation.
11799 * errors.cc (Errors::fatal): Print "fatal error:" before the
11800 formatted message.
11801 (Errors::error, Errors::error_at_location): Print "error: "
11802 before the formatted message.
11803 (Errors::undefined_symbol): Take location as a string, rather
11804 than calculating it from a relocation.
11805 (gold_undefined_symbol_at_location): New function akin to
11806 old gold_undefined_symbol, calculates location from relocation.
11807 (gold_undefined_symbol): Change to take only a Symbol pointer
11808 and to report location as the file name associated with the symbol.
11809 * testsuite/debug_msg.sh: Update for changed error messages.
11810 * testsuite/undef_symbol.sh: Likewise.
11811
11812 2009-02-04 Duncan Sands <baldrick@free.fr>
11813
11814 PR 9812
11815 * reduced_debug_output.h
11816 (Output_reduced_debug_abbrev_section::failed): Use format for
11817 gold_warning.
11818 (Output_reduced_debug_info_section::faild): Likewise.
11819
11820 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11821
11822 * script.cc (Lazy_demangler): New class.
11823 (Version_script_info::get_symbol_version_helper): Demangle a
11824 symbol only once.
11825
11826 2009-01-29 Cary Coutant <ccoutant@google.com>
11827
11828 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11829 to __tls_get_addr.
11830 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11831
11832 2009-01-28 Ian Lance Taylor <iant@google.com>
11833
11834 * version.cc (version_string): Bump to 1.9.
11835
11836 * gold.h: Include <cstring> and <stdint.h>.
11837 * version.cc: Include <cstdio>.
11838 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11839 warning.
11840 * reduced_debug_output.cc (insert_into_vector): Rename from
11841 Insert_into_vector; change all callers. Use Swap_unaligned to
11842 avoid aliasing issue; remove union since it is unnecessary.
11843
11844 2009-01-27 Sriraman Tallam <tmsriram@google.com>
11845
11846 * Makefile.am (CCFILES): Add gc.cc.
11847 (HFILES): Add gc.h.
11848 * Makefile.in: Regenerate.
11849 * gold.cc (Gc_runner): New class.
11850 (queue_initial_tasks): Call garbage collection related tasks
11851 when corresponding options are invoked.
11852 (queue_middle_gc_tasks): New function.
11853 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11854 processed early before laying out sections during garbage collection.
11855 * gold.h (queue_middle_gc_tasks): New function.
11856 (is_prefix_of): Move from "layout.cc".
11857 * i386.cc (Target_i386::gc_process_relocs): New function.
11858 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11859 * main.cc (main): Create object of class "Garbage_collection".
11860 * object.cc (Relobj::copy_symbols_data): New function.
11861 (Relobj::is_section_name_included): New function.
11862 (Sized_relobj::do_layout): Allow this function to be called twice
11863 during garbage collection and defer layout of section during the
11864 first call.
11865 * object.h (Relobj::get_symbols_data): New function.
11866 (Relobj::is_section_name_included): New function.
11867 (Relobj::copy_symbols_data): New function.
11868 (Relobj::set_symbols_data): New function.
11869 (Relobj::get_relocs_data): New function.
11870 (Relobj::set_relocs_data): New function.
11871 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11872 (Relobj::gc_process_relocs): New function.
11873 (Relobj::do_gc_process_relocs): New pure virtual function.
11874 (Relobj::sd_): New data member.
11875 (Sized_relobj::is_output_section_offset_invalid): New function.
11876 (Sized_relobj::do_gc_process_relocs): New function.
11877 * options.h (General_options::gc_sections): Modify to not be a no-op.
11878 (General_options::print_gc_sections): New option.
11879 * plugin.cc (Plugin_finish::run): Remove function call to
11880 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11881 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11882 * reloc.cc (Read_relocs::run): Add task to process relocs and
11883 determine unreferenced sections when doing garbage collection.
11884 (Gc_process_relocs): New class.
11885 (Sized_relobj::do_gc_process_relocs): New function.
11886 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11887 sections that are garbage collected.
11888 * reloc.h (Gc_process_relocs): New class.
11889 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11890 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11891 symbols whose corresponding sections are garbage collected.
11892 (Symbol_table::Symbol_table): Add new parameter for the garbage
11893 collection object.
11894 (Symbol_table::gc_mark_undef_symbols): New function.
11895 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11896 (Symbol_table::gc_mark_dyn_syms): New function.
11897 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11898 as garbage.
11899 (Symbol_table::add_from_object): Likewise.
11900 (Symbol_table::add_from_relobj): When building shared objects, do not
11901 treat externally visible symbols as garbage.
11902 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11903 table information for static and relocatable links.
11904 * symtab.h (Symbol_table::set_gc): New function.
11905 (Symbol_table::gc): New function.
11906 (Symbol_table::gc_mark_undef_symbols): New function.
11907 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11908 (Symbol_table::gc_mark_dyn_syms): New function.
11909 (Symbol_table::gc_): New data member.
11910 * target.h (Sized_target::gc_process_relocs): New pure virtual
11911 function.
11912 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11913 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11914
11915 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11916
11917 * options.h (General_options::gc_sections): Define as a no-op for now.
11918 (General_options::no_keep_memory): Ditto.
11919 (General_options::Bshareable): Define.
11920 * options.cc (General_options::finalize): Honor -Bshareable.
11921
11922 2009-01-20 Andreas Schwab <schwab@suse.de>
11923
11924 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11925 read the value in the contents, since we don't use it. Use the
11926 template endianness when writing.
11927 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11928
11929 2009-01-19 Andreas Schwab <schwab@suse.de>
11930
11931 * configure.tgt (powerpc64-*): Fix targ_obj.
11932
11933 2009-01-15 Ian Lance Taylor <iant@google.com>
11934
11935 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11936 local symbols when stripping all symbols.
11937
11938 2009-01-14 Cary Coutant <ccoutant@google.com>
11939
11940 * output.cc (Output_reloc): Add explicit instantiations.
11941
11942 2009-01-14 Cary Coutant <ccoutant@google.com>
11943
11944 * archive.cc (Archive::get_elf_object_for_member): Remove call
11945 to File_read::claim_for_plugin.
11946 * descriptors.cc (Descriptors::open): Remove reference to
11947 is_claimed.
11948 (Descriptors::claim_for_plugin): Remove.
11949 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11950 (Descriptors::is_claimed): Remove.
11951 (claim_descriptor_for_plugin): Remove.
11952 * fileread.cc (File_read::claim_for_plugin): Remove.
11953 * fileread.h (File_read::claim_for_plugin): Remove.
11954 (File_read::descriptor): Reopen descriptor if necessary.
11955 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11956 (Plugin_manager::all_symbols_read): Add task parameter. Change
11957 all callers.
11958 (Plugin_manager::get_input_file): New function.
11959 (Plugin_manager::release_input_file): New function.
11960 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11961 corresponding data member.
11962 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11963 and pass to base constructor. Change all callers.
11964 (get_input_file, release_input_file): New functions.
11965 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11966 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11967 (Plugin_manager::all_symbols_read): Add task parameter.
11968 (Plugin_manager::get_input_file): New function.
11969 (Plugin_manager::release_input_file): New function.
11970 (Plugin_manager::task_): New data member.
11971 (Pluginobj::Pluginobj): Add filesize parameter.
11972 (Pluginobj::filename): New function.
11973 (Pluginobj::descriptor): New function.
11974 (Pluginobj::filesize): New function.
11975 (Pluginobj::filesize_): New data member.
11976 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11977 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11978 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11979
11980 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11981 with archive libraries.
11982 * testsuite/Makefile.in: Regenerate.
11983 * testsuite/plugin_test.c (struct sym_info): New type.
11984 (get_input_file, release_input_file): New static variables.
11985 (onload): Capture new transfer vector entries.
11986 (claim_file_hook): Stop reading at end of file according to filesize.
11987 Factor out parsing of readelf output into separate function.
11988 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11989 APIs and get the source file name from the symbol table. Convert
11990 source file name to corresponding object file name. Print info
11991 message when adding new input files.
11992 (parse_readelf_line): New function.
11993 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11994 * testsuite/plugin_test_2.sh: Likewise.
11995 * testsuite/plugin_test_3.sh: Likewise.
11996 * testsuite/plugin_test_4.sh: New test case.
11997
11998 2009-01-07 Ian Lance Taylor <iant@google.com>
11999
12000 * version.cc (version_string): Bump to 1.8.
12001
12002 2008-12-23 Cary Coutant <ccoutant@google.com>
12003
12004 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12005 * plugin.cc (Plugin_manager::finish): Rename as
12006 layout_deferred_objects. Move cleanup to separate function.
12007 (Plugin_manager::cleanup): New function.
12008 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12009 separately.
12010 * plugin.h (Plugin_manager::finish): Rename as
12011 layout_deferred_objects.
12012 (Plugin_manager::cleanup): New function.
12013 (Plugin_manager::cleanup_done): New field.
12014
12015 2008-12-23 Cary Coutant <ccoutant@google.com>
12016
12017 * plugin.cc (is_visible_from_outside): New function.
12018 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12019 so we don't return "IR only" status for exported symbols or -r links.
12020
12021 * testsuite/Makefile.am (plugin_test_3): New test case.
12022 * testsuite/Makefile.in: Regenerate.
12023 * testsuite/plugin_test_3.sh: New file.
12024
12025 2008-12-22 Cary Coutant <ccoutant@google.com>
12026
12027 * object.cc (Sized_relobj::layout_section): New function.
12028 (Sized_relobj::do_layout): Defer layout of input sections until after
12029 plugin has provided replacement files.
12030 (Sized_relobj::do_layout_deferred_sections): New function.
12031 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12032 (Relobj::layout_deferred_sections): New function.
12033 (Relobj::do_layout_deferred_sections): New function.
12034 (Sized_relobj::do_layout_deferred_sections): New function.
12035 (Sized_relobj::layout_section): New function.
12036 (Sized_relobj::Deferred_layout): New structure.
12037 (Sized_relobj::deferred_layout_): New field.
12038 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12039 Change all callers. Layout deferred sections.
12040 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12041 references.
12042 (Plugin_hook::run): Move code from do_plugin_hook inline.
12043 (Plugin_hook::do_plugin_hook): Remove.
12044 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12045 (Plugin_manager::finish): Renamed, was cleanup.
12046 (Plugin_manager::should_defer_layout): New function.
12047 (Plugin_manager::add_deferred_layout_object): New function.
12048 (Plugin_manager::Deferred_layout_list): New type.
12049 (Plugin_manager::deferred_layout_objects_): New field.
12050 (Plugin_hook::do_plugin_hook): Remove.
12051
12052 2008-12-17 Ian Lance Taylor <iant@google.com>
12053
12054 * options.h (class General_options): Add --no case for
12055 --export-dynamic.
12056
12057 2008-12-16 Cary Coutant <ccoutant@google.com>
12058
12059 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12060 vector.
12061 (Plugin_manager::claim_file): Create plugin object even if
12062 plugin did not call the add_symbols callback.
12063 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12064 asking for more symbols than were added.
12065 * testsuite/Makefile.am (plugin_test_1): Add test case with
12066 no global symbols.
12067 (empty.syms): New target.
12068 * testsuite/Makefile.in: Regenerate.
12069 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12070 message. Don't call add_symbols if no globals.
12071 (all_symbols_read_hook): Don't provide replacement for empty
12072 claimed file.
12073
12074 2008-12-12 Ian Lance Taylor <iant@google.com>
12075
12076 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12077 r_type == 0 for a local symbol with r_sym == 0.
12078 (scan_relocatable_relocs): Pass r_sym to
12079 local_non_section_strategy.
12080 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12081 r_sym parameter.
12082
12083 * configure.ac: Update test for TLS descriptors: they are
12084 supported as of glibc 2.9.
12085 * configure: Rebuild.
12086
12087 2008-12-11 Ian Lance Taylor <iant@google.com>
12088
12089 PR 7091
12090 * target-reloc.h (Default_scan_relocatable_relocs): For each
12091 function, map r_type == 0 to RELOC_DISCARD.
12092
12093 2008-12-10 Cary Coutant <ccoutant@google.com>
12094
12095 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12096 object to override a kept COMDAT group from a plugin object.
12097
12098 2008-12-09 Ian Lance Taylor <iant@google.com>
12099
12100 PR 7088
12101 * yyscript.y (file_cmd): Handle INPUT.
12102
12103 * testsuite/initpri1.c: Change all declarations to be full
12104 prototypes by adding void, to avoid compiler warnings.
12105
12106 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
12107
12108 * options.cc (General_options::parse_plugin_opt): New.
12109 (General_options::add_plugin): The argument now is just the filename.
12110 (General_options::add_plugin_option): New.
12111 * options.h (plugin_opt): New.
12112 (add_plugin): Change argument name.
12113 (add_plugin_option): New.
12114 * plugin.cc (Plugin::load): Don't parse the plugin option.
12115 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12116 (Plugin::add_option): New.
12117 (Plugin::args_): Change type.
12118 (Plugin::filename_): New.
12119 (Plugin_manager::add_plugin_option): New.
12120 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12121 * testsuite/Makefile.in: Regenerate.
12122
12123 2008-12-05 Cary Coutant <ccoutant@google.com>
12124
12125 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12126 Handle --strip-lto-sections option.
12127 * options.h (strip_lto_sections): New option.
12128
12129 2008-12-01 Cary Coutant <ccoutant@google.com>
12130
12131 * plugin.cc (ld_plugin_message): Change format parameter to const.
12132 Fix mismatch between new[] and delete.
12133
12134 2008-11-14 Cary Coutant <ccoutant@google.com>
12135
12136 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12137 instead of -1U.
12138
12139 2008-11-05 Craig Silverstein <csilvers@google.com>
12140
12141 * options.cc (General_options::parse_dynamic_list): New function.
12142 * options.h (General_options): New flags dynamic_list,
12143 dynamic_list_data, dynamic_list_cpp_new, and
12144 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12145 (General_options::in_dynamic_list): New function.
12146 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12147 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12148 (Lex::can_continue_name): Likewise.
12149 (yylex): Likewise.
12150 (read_script_file): New parameter script_options.
12151 (read_dynamic_list): New function.
12152 (Script_options::define_dynamic_list): New function.
12153 (dynamic_list_keyword_parsecodes): New variable.
12154 (dynamic_list_keywords): New variable.
12155 * script.h (Script_options::define_dynamic_list): New function
12156 prototype.
12157 (read_dynamic_list): New function prototype.
12158 * symtab.cc (strprefix): New macro.
12159 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12160 dynamic_list_data, dynamic_list_cpp_new, and
12161 dynamic_list_cpp_typeinfo.
12162 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12163 (dynamic_list_expr): New rule.
12164 (dynamic_list_nodes): Likewise.
12165 (dynamic_list_node): Likewise.
12166 * testsuite/Makefile.am (dynamic_list): New test.
12167 * testsuite/Makefile.in: Regenerated.
12168 * testsuite/dynamic_list.t: New file.
12169 * testsuite/dynamic_list.sh: New file.
12170
12171 2008-11-05 Craig Silverstein <csilvers@google.com>
12172
12173 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12174 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12175 (t11_last): Likewise.
12176 * testsuite/ver_test_6.c (main): Likewise.
12177
12178 2008-10-07 Cary Coutant <ccoutant@google.com>
12179
12180 * options.c (General_options::finalize): Add check for -static and
12181 -shared.
12182 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12183 is not empty.
12184
12185 2008-10-02 Cary Coutant <ccoutant@google.com>
12186
12187 * plugin.cc (make_sized_plugin_object): Fix conditional
12188 compilation to work when not all targets are enabled.
12189
12190 2008-09-29 Cary Coutant <ccoutant@google.com>
12191
12192 * archive.cc (Archive::get_file_and_offset): Use filename instead
12193 of name to get library path.
12194 (Archive::include_member): Unlock external member of a thin archive.
12195
12196 * testsuite/Makefile.am (TEST_AR): New variable.
12197 (thin_archive_test_1): New test.
12198 (thin_archive_test_2): New test.
12199 * testsuite/Makefile.in: Regenerate.
12200 * testsuite/thin_archive_main.cc: New file.
12201 * testsuite/thin_archive_test_1.cc: New file.
12202 * testsuite/thin_archive_test_2.cc: New file.
12203 * testsuite/thin_archive_test_3.cc: New file.
12204 * testsuite/thin_archive_test_4.cc: New file.
12205
12206 2008-09-29 Cary Coutant <ccoutant@google.com>
12207
12208 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12209 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12210 instead of -1U.
12211 (Sized_relobj::do_finalize_local_symbols): Likewise.
12212 (Sized_relobj::map_to_kept_section): Likewise.
12213 * object.h (Sized_relobj::invalid_address): New constant.
12214 (Sized_relobj::do_output_section_offset): Check for invalid_address
12215 and return -1ULL.
12216 * output.cc (Output_reloc::local_section_offset): Use constant
12217 invalid_address instead of -1U.
12218 (Output_reloc::get_address): Likewise.
12219 (Output_section::output_address): Change -1U to -1ULL.
12220 * output.h (Output_reloc::invalid_address): New constant.
12221 * reloc.cc (Sized_relobj::write_sections): Use constant
12222 invalid_address instead of -1U.
12223 (Sized_relobj::relocate_sections): Likewise.
12224 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12225 values for merge sections.
12226 * target-reloc.h (relocate_for_relocatable): Use constant
12227 invalid_address instead of -1U.
12228
12229 2008-09-19 Cary Coutant <ccoutant@google.com>
12230
12231 Add plugin functionality for link-time optimization (LTO).
12232 * configure.ac (plugins): Add --enable-plugins option.
12233 * configure: Regenerate.
12234 * config.in: Regenerate.
12235 * Makefile.am (LIBDL): New variable.
12236 (CCFILES): Add plugin.cc.
12237 (HFILES): Add plugin.h.
12238 (ldadd_var): Add LIBDL.
12239 * Makefile.in: Regenerate.
12240
12241 * archive.cc: Include "plugin.h".
12242 (Archive::setup): Don't preread archive symbols when using a plugin.
12243 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12244 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12245 files.
12246 (Archive::include_member): Add symbols from plugin objects.
12247 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12248 * descriptors.cc (Descriptors::open): Check for file descriptors
12249 abandoned by plugins.
12250 (Descriptors::claim_for_plugin): New function.
12251 * descriptors.h (Descriptors::claim_for_plugin): New function.
12252 (Open_descriptor::is_claimed): New field.
12253 (claim_descriptor_for_plugin): New function.
12254 * fileread.cc (File_read::claim_for_plugin): New function.
12255 * fileread.h (File_read::claim_for_plugin): New function.
12256 (File_read::descriptor): New function.
12257 * gold.cc: Include "plugin.h".
12258 (queue_initial_tasks): Add task to call plugin hooks for generating
12259 new object files.
12260 * main.cc: Include "plugin.h".
12261 (main): Load plugin libraries.
12262 * object.h (Pluginobj): Declare.
12263 (Object::pluginobj): New function.
12264 (Object::do_pluginobj): New function.
12265 (Object::set_target): New function.
12266 * options.cc: Include "plugin.h".
12267 (General_options::parse_plugin): New function.
12268 (General_options::General_options): Initialize plugins_ field.
12269 (General_options::add_plugin): New function.
12270 * options.h (Plugin_manager): Declare.
12271 (General_options): Add --plugin option.
12272 (General_options::has_plugins): New function.
12273 (General_options::plugins): New function.
12274 (General_options::add_plugin): New function.
12275 (General_options::plugins_): New field.
12276 * plugin.cc: New file.
12277 * plugin.h: New file.
12278 * readsyms.cc: Include "plugin.h".
12279 (Read_symbols::do_read_symbols): Check for archive before checking
12280 for ELF file. Call plugin hooks to claim files.
12281 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12282 from a real object file; force override when processing replacement
12283 files.
12284 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12285 (Symbol::init_base_object): Likewise.
12286 (Symbol::init_base_output_data): Likewise.
12287 (Symbol::init_base_output_segment): Likewise.
12288 (Symbol::init_base_constant): Likewise.
12289 (Symbol::init_base_undefined): Likewise.
12290 (Symbol::output_section): Assert that object is not a plugin.
12291 (Symbol_table::add_from_pluginobj): New function.
12292 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12293 undefined.
12294 (Symbol_table::sized_write_globals): Likewise.
12295 (Symbol_table::add_from_pluginobj): Instantiate template.
12296 * symtab.h (Sized_pluginobj): Declare.
12297 (Symbol::in_real_elf): New function.
12298 (Symbol::set_in_real_elf): New function.
12299 (Symbol::in_real_elf_): New field.
12300 (Symbol_table::add_from_pluginobj): New function.
12301
12302 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12303 (LIBDL): New variable.
12304 (LDADD): Add LIBDL.
12305 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12306 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12307 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12308 (MOSTLYCLEANFILES): Likewise.
12309 * testsuite/Makefile.in: Regenerate.
12310 * testsuite/plugin_test.c: New file.
12311 * testsuite/plugin_test_1.sh: New file.
12312 * testsuite/plugin_test_2.sh: New file.
12313
12314 2008-09-16 Ian Lance Taylor <iant@google.com>
12315
12316 * target-reloc.h (relocate_section): Check whether a symbol is
12317 defined by the ABI before reporting an undefined symbol error.
12318 * target.h (Target::is_defined_by_abi): Make parameter const.
12319 (Target::do_is_defined_by_abi): Likewise.
12320 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12321 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12322 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12323 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12324 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12325 * testsuite/Makefile.in: Rebuild.
12326
12327 * fileread.cc (make_view): Add casts to avoid warning.
12328
12329 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12330
12331 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12332 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12333
12334 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12335
12336 * options.h (General_options::output_is_executable): New.
12337 (General_options::output_is_pie): New.
12338 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12339 for shared libraries.
12340 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12341
12342 2008-09-11 Chris Demetriou <cgd@google.com>
12343
12344 * options.h (origin): New -z option.
12345 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12346 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12347 in DT_FLAGS_1.
12348
12349 2008-09-05 Cary Coutant <ccoutant@google.com>
12350
12351 * fileread.cc (File_read::make_view): Add check for attempt to map
12352 beyond end of file.
12353
12354 2008-09-05 Cary Coutant <ccoutant@google.com>
12355
12356 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12357 explicit instantiations.
12358
12359 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12360
12361 PR gold/6858
12362 * options.cc (General_options::finalize): Allow undefined symbols
12363 in shlibs if linking -shared.
12364
12365 PR gold/6859
12366 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12367 symbols as not needing a dynsym entry.
12368
12369 2008-08-20 Craig Silverstein <csilvers@google.com>
12370
12371 * fileread.cc (File_read::open): Do not lock the file unless it
12372 was successfully opened.
12373
12374 2008-08-14 Cary Coutant <ccoutant@google.com>
12375
12376 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12377 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12378 * testsuite/tls_test.cc (struct int128): 128-bit struct
12379 for testing TLS relocs with non-zero addend.
12380 (v12): New TLS variable.
12381 (t12): New test.
12382 (t_last): Add check for v12.
12383 * testsuite/tls_test.h (t12): New function.
12384 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12385
12386 2008-08-13 Ian Lance Taylor <iant@google.com>
12387
12388 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12389 set tls_segment_ or relro_segment_.
12390 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12391 when appropriate.
12392 * output.h (Output_section::clear_is_relro): New function.
12393 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12394 sections specially even when output_data_ is empty.
12395 (Output_segment::maximum_alignment): When first section is relro,
12396 only force alignment for PT_LOAD segments.
12397 * script.cc (script_data_segment_align): New function.
12398 (script_data_segment_relro_end): New function.
12399 * script-c.h (script_data_segment_align): Declare.
12400 (script_data_segment_relro_end): Declare.
12401 * script-sections.h (class Script_sections): Declare
12402 data_segment_align and data_segment_relro_end. Add fields
12403 segment_align_index_ and saw_relro_end_.
12404 * script-sections.cc (class Sections_element): Add set_is_relro
12405 virtual function. Add new bool* parameter to place_orphan_here.
12406 Add get_output_section virtual function.
12407 (class Output_section_definition): Add set_is_relro. Add new
12408 bool* parameter to place_orphan_here. Add get_output_section.
12409 Add is_relro_ field.
12410 (Output_section_definition::Output_section_definition): Initialize
12411 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12412 and is_relro_ fields.
12413 (Output_section_definition::place_orphan_here): Add is_relro
12414 parameter.
12415 (Output_section_definition::set_section_addresses): Set relro for
12416 output section.
12417 (Output_section_definition::alternate_constraint): Likewise.
12418 (class Orphan_output_section): Add new bool* parameter to
12419 place_orphan_here. Add get_output_section.
12420 (Orphan_output_section::place_orphan_here): Add is_relro
12421 parameter.
12422 (Script_sections::Script_sections): Initialize
12423 data_segment_align_index_ and saw_relro_end_.
12424 (Script_sections::data_segment_align): New function.
12425 (Script_sections::data_segment_relro_end): New function.
12426 (Script_sections::place_orphan): Set or clear is_relro.
12427 (Script_sections::set_section_addresses): Force alignment of first
12428 TLS section.
12429 * yyscript.y (exp): Call script_data_segment_align and
12430 script_data_segment_relro_end.
12431 * testsuite/relro_script_test.t: New file.
12432 * testsuite/relro_test.cc (using_script): Declare.
12433 (t1, t2): Test using_script.
12434 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12435 (relro_script_test_SOURCES): Define.
12436 (relro_script_test_DEPENDENCIES): Define.
12437 (relro_script_test_LDFLAGS): Define.
12438 (relro_script_test_LDADD): Define.
12439 (relro_script_test.so): New target.
12440 * testsuite/Makefile.in: Rebuild.
12441
12442 2008-08-06 Cary Coutant <ccoutant@google.com>
12443
12444 * archive.cc (Archive::total_archives, Archive::total_members)
12445 (Archive::total_members_loaded): New variables.
12446 (Archive::setup): Add parameter. Add option to preread
12447 archive symbols.
12448 (Archive::read_armap): Add counter.
12449 (Archive::get_file_and_offset): New function.
12450 (Archive::get_elf_object_for_member): New function.
12451 (Archive::read_all_symbols): New function.
12452 (Archive::read_symbols): New function.
12453 (Archive::add_symbols): Add counters.
12454 (Archive::include_all_members): Use armap to find members if it's
12455 already built.
12456 (Archive::include_member): Skip reading symbols if already read.
12457 Factored code into Archive::get_file_and_offset and
12458 Archive::get_elf_object_for_member. Changed call to
12459 Mapfile::report_include_archive_member.
12460 (Archive::print_stats): New function.
12461 * archive.h: Declare Object and Read_symbols_data classes.
12462 (Archive::Archive): Add initializers for new members.
12463 (Archive::setup): Add parameter.
12464 (Archive::print_stats): New function.
12465 (Archive::total_archives, Archive::total_members)
12466 (Archive::total_members_loaded): New variables.
12467 (Archive::get_file_and_offset): New function.
12468 (Archive::get_elf_object_for_member): New function.
12469 (Archive::read_all_symbols): New function.
12470 (Archive::read_symbols): New function.
12471 (Archive::Archive_member): New class.
12472 (Archive::members_): New member.
12473 (Archive::num_members_): New member.
12474 * main.cc: Include archive.h.
12475 (main): Call Archive::print_stats.
12476 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12477 archive parameter; member_name is now the fully-decorated name.
12478 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12479 * options.h: (General_options): Add --preread-archive-symbols option.
12480 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12481 Archive::setup.
12482
12483 2008-08-04 Ian Lance Taylor <iant@google.com>
12484
12485 * symtab.h (Symbol::use_plt_offset): New function.
12486 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12487 * powerpc.cc (Relocate::relocate): Likewise.
12488 * sparc.cc (Relocate::relocate): Likewise.
12489 * x86_64.cc (Relocate::relocate): Likewise.
12490 * testsuite/weak_plt.sh: New test.
12491 * testsuite/weak_plt_main.cc: New test.
12492 * testsuite/weak_plt_shared.cc: New test.
12493 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12494 (check_PROGRAMS): Add weak_plt.
12495 (check_DATA): Add weak_plt_shared.so.
12496 (weak_plt_main_pic.o, weak_plt): New targets.
12497 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12498 * testsuite/Makefile.in: Rebuild.
12499
12500 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12501 gcctestdir/ld.
12502 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12503 * testsuite/Makefile.in: Rebuild.
12504
12505 2008-08-04 Alan Modra <amodra@bigpond.net.au>
12506
12507 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12508 * Makefile.in: Regenerate.
12509 * po/POTFILES.in: Regenerate.
12510
12511 2008-07-29 Ian Lance Taylor <iant@google.com>
12512
12513 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12514 symbols before other symbols.
12515 * testsuite/script_test_2.cc (test_addr): Declare.
12516 (test_addr_alias): Declare.
12517 (main): Check that test_addr and test_addr_alias have the right
12518 values.
12519 * testsuite/script_test_2.t: Define test_addr_alias and
12520 test_addr.
12521
12522 2008-07-24 Ian Lance Taylor <iant@google.com>
12523
12524 PR 5990
12525 * descriptors.cc: New file.
12526 * descriptors.h: New file.
12527 * gold-threads.h (class Hold_optional_lock): New class.
12528 * fileread.cc: Include "descriptors.h".
12529 (File_read::~File_read): Release descriptor rather than closing
12530 it.
12531 (File_read::open) [file]: Call open_descriptor rather than open.
12532 Set is_descriptor_opened_.
12533 (File_read::open) [memory]: Assert that descriptor is not open.
12534 (File_read::reopen_descriptor): New function.
12535 (File_read::release): Release descriptor.
12536 (File_read::do_read): Make non-const. Reopen descriptor.
12537 (File_read::read): Make non-const.
12538 (File_read::make_view): Reopen descriptor.
12539 (File_read::do_readv): Likewise.
12540 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12541 Update declarations.
12542 * layout.cc: Include "descriptors.h".
12543 (Layout::create_build_id): Use open_descriptor rather than open.
12544 * output.cc: Include "descriptors.h".
12545 (Output_file::open): Use open_descriptor rather than open.
12546 * archive.cc (Archive::const_iterator): Change Archive to be
12547 non-const.
12548 (Archive::begin, Archive::end): Make non-const.
12549 (Archive::count_members): Likewise.
12550 * archive.h (class Archive): Update declarations.
12551 * object.h (Object::read): Make non-const.
12552 * Makefile.am (CCFILES): Add descriptors.cc.
12553 (HFILES): Add descriptors.h.
12554 * Makefile.in: Rebuild.
12555
12556 PR 6716
12557 * gold.h: Always include <clocale>. Add Solaris workarounds
12558 following code in binutils/sysdep.h.
12559
12560 PR 6048
12561 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12562 this->eh_frame_hdr_ is NULL before using it.
12563
12564 * dynobj.cc (Versions::Versions): Update comment.
12565
12566 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12567 the base version name.
12568
12569 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12570 array size plus one.
12571 (Stringpool_template::set_string_offsets): Subtract one from key
12572 before using it as an array index.
12573 (Stringpool_template::get_offset_with_length): Likewise.
12574 (Stringpool_template::write_to_buffer): Likewise.
12575 * stringpool.h (Stringpool_template::get_offset_from_key):
12576 Likewise.
12577
12578 2008-07-23 Ian Lance Taylor <iant@google.com>
12579
12580 PR 6658
12581 * object.h (Merged_symbol_value::value): Do our best to handle a
12582 negative addend.
12583
12584 PR 6647
12585 * script.cc (Version_script_info::get_versions): Don't add empty
12586 version tag to return value.
12587 (Version_script_info::get_symbol_version_helper): Change return
12588 type to bool. Add pversion parameter. Change all callers.
12589 (script_register_vers_node): Don't require a non-NULL tag.
12590 * script.h (class Version_script_info): Update declarations.
12591 (Version_script_info::get_symbol_version): Change return type to
12592 bool. Add version parameter. Change all callers.
12593 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12594 handling. Handle an empty version from a version script.
12595 (Symbol_table::define_special_symbol): Likewise.
12596 * testsuite/ver_test_10.script: New file.
12597 * testsuite/ver_test_10.sh: New file.
12598 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12599 (check_DATA): Add ver_test_10.syms.
12600 (ver_test_10.syms, ver_test_10.so): New target.
12601 * testsuite/Makefile.in: Rebuild.
12602
12603 2008-07-23 Simon Baldwin <simonb@google.com>
12604
12605 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12606 to zero for undefined symbols from dynamic libraries.
12607
12608 2008-07-23 Ian Lance Taylor <iant@google.com>
12609
12610 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12611 Change all callers.
12612 * symtab.h (class Symbol_table): Update declaration.
12613 * testsuite/ver_test_9.cc: New file.
12614 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12615 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12616 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12617 (ver_test_9.so, ver_test_9.o): New targets.
12618 * testsuite/Makefile.in: Rebuild.
12619
12620 2008-07-22 Ian Lance Taylor <iant@google.com>
12621
12622 * options.h (class General_options): Define --check-sections.
12623 * layout.cc (Layout::set_segment_offsets): Handle
12624 --check-sections.
12625
12626 * options.h (class General_options): Define -n/--nmagic and
12627 -N/--omagic.
12628 * options.cc (General_options::finalize): For -n/--nmagic or
12629 -N/--omagic, set -static.
12630 * layout.cc (Layout::attach_allocated_section_to_segment): If
12631 -N/--omagic, don't put read-only and read-write sections in
12632 different segments.
12633 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12634 finding a read-only segment.
12635 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12636 don't set the minimum segment alignment to the common page size,
12637 and don't set the file offset to the address modulo the page size.
12638 * script-sections.cc (Script_sections::create_segments): If
12639 -n/--omagic, don't put read-only and read-write sections in
12640 different segments.
12641
12642 * cref.cc: New file.
12643 * cref.h: New file.
12644 * options.h (class General_options): Add --print-symbol-counts.
12645 * main.cc (main): Issue defined symbol report if requested.
12646 * archive.cc (Archive::interpret_header): Make into a const member
12647 function.
12648 (Archive::add_symbols): Call Input_objects::archive_start and
12649 archive_stop.
12650 (Archive::const_iterator): Define new class.
12651 (Archive::begin, Archive::end): New functions.
12652 (Archive::include_all_members): Rewrite to use iterator.
12653 (Archive::count_members): New function.
12654 * archive.h (class Archive): Update declarations.
12655 (Archive::filename): New function.
12656 * object.cc: Include "cref.h".
12657 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12658 (Sized_relobj::do_get_global_symbol_counts): New function.
12659 (Input_objects::add_object): Add object to cross-referencer.
12660 (Input_objects::archive_start): New function.
12661 (Input_objects::archive_stop): New function.
12662 (Input_objects::print_symbol_counts): New function.
12663 * object.h: Declare Cref and Archive.
12664 (Object::get_global_symbol_counts): New function.
12665 (Object::do_get_global_symbol_counts): New pure virtual function.
12666 (class Sized_relobj): Add defined_count_ field. Update
12667 declarations.
12668 (class Input_objects): Add cref_ field. Update constructor.
12669 Update declarations.
12670 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12671 defined_count_.
12672 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12673 symbol counts.
12674 (Sized_dynobj::do_get_global_symbol_counts): New function.
12675 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12676 defined_count_. Update declarations. Define Symbols typedef.
12677 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12678 parameter. Change all callers.
12679 (Symbol_table::add_from_dynobj): Add sympointers and defined
12680 parameters. Change all callers.
12681 * symtab.h (class Symbol_table): Update declarations.
12682 * Makefile.am (CCFILES): Add cref.cc.
12683 (HFILES): Add cref.h.
12684 * Makefile.in: Rebuild.
12685
12686 2008-07-22 Simon Baldwin <simonb@google.com>
12687
12688 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12689 to zero when writing undefined symbols.
12690
12691 2008-07-22 Ian Lance Taylor <iant@google.com>
12692
12693 * output.cc (Output_section::add_input_section): Don't try to
12694 merge empty merge sections.
12695
12696 2008-07-21 Craig Silverstein <csilvers@google.com>
12697
12698 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12699 Include symbol version in error message.
12700
12701 2008-07-20 Chris Demetriou <cgd@google.com>
12702
12703 * configure.ac (gold_cv_c_random_seed): New configured variable.
12704 (RANDOM_SEED_CFLAGS): New substituted variable.
12705 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12706 * configure: Rebuild.
12707 * Makefile.in: Likewise.
12708 * testsuite/Makefile.in: Likewise.
12709
12710 2008-07-18 Ian Lance Taylor <iant@google.com>
12711
12712 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12713 where we see NAME/NULL and NAME/VERSION as separate symbols.
12714 * testsuite/ver_test_main.cc (main): Call t4.
12715 (t4, t4_2a): Define.
12716 * testsuite/ver_test_2.cc (t4_2): Define.
12717 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12718 * testsuite/ver_test_4.cc (t4_2a): Define.
12719 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12720 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12721
12722 2008-07-17 Ian Lance Taylor <iant@google.com>
12723
12724 * dynobj.cc (Versions::add_def): If we give an error about a
12725 missing version, go ahead and create the version anyhow.
12726
12727 2008-07-10 Ian Lance Taylor <iant@google.com>
12728
12729 Handle output sections with more than 0x7fffffff bytes.
12730 * object.h (class Relobj): Change map_to_output_ to
12731 output_sections_, and just keep a section pointer. Change all
12732 uses. Move comdat group support to Sized_relobj.
12733 (Relobj::is_section_specially_mapped): Remove.
12734 (Relobj::output_section): Remove poff parameter. Change all
12735 callers.
12736 (Relobj::output_section_offset): New function.
12737 (Relobj::set_section_offset): Rewrite.
12738 (Relobj::map_to_output): Remove.
12739 (Relobj::output_sections): New function.
12740 (Relobj::do_output_section_offset): New pure virtual function.
12741 (Relobj::do_set_section_offset): Likewise.
12742 (class Sized_relobj): Add section_offsets_ field. Add comdat
12743 group support from Relobj. Update declarations.
12744 (Sized_relobj::get_output_section_offset): New function.
12745 (Sized_relobj::do_output_section_offset): New function.
12746 (Sized_relobj::do_set_section_offset): New function.
12747 * object.cc (Relobj::output_section_address): Remove.
12748 (Sized_relobj::Sized_relobj): Initialize new fields.
12749 (Sized_relobj::include_section_group): Cast find_kept_object to
12750 Sized_relobj.
12751 (Sized_relobj::include_linkonce_section): Likewise.
12752 (Sized_relobj::do_layout): Use separate arrays for output section
12753 and output offset.
12754 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12755 output_sections.
12756 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12757 output_sections and section_offsets.
12758 (Sized_relobj::write_local_symbols): Likewise.
12759 (map_to_kept_section): Compute output address directly.
12760 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12761 output_sections and section_offsets.
12762 (Sized_relobj::write_sections): Likewise.
12763 (Sized_relobj::relocate_sections): Likewise.
12764 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12765 * output.h (class Output_reloc): Update declarations. Change
12766 u2_.relobj to Sized_relobj*.
12767 (class Output_data_reloc): Change add functions to use
12768 Sized_relobj*.
12769 * output.cc (Output_reloc::Output_reloc): Change relobj to
12770 Sized_relobj*.
12771 (Output_reloc::local_section_offset): Change return type to
12772 Elf_Addr. Use get_output_section_offset.
12773 (Output_reloc::get_address): Likewise.
12774 (Output_section::is_input_address_mapped): Don't call
12775 is_section_specially_mapped.
12776 (Output_section::output_offset): Likewise.
12777 (Output_section::output_address): Likewise.
12778 (Output_section::starting_output_address): Likewise.
12779 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12780 parameter to Sized_relobj*.
12781 (Copy_relocs::need_copy_reloc): Likewise.
12782 (Copy_relocs::save): Likewise.
12783 * copy-relocs.h (class Copy_relocs): Update declarations.
12784 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12785 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12786 * target-reloc.h (relocate_for_relocatable): Change
12787 offset_in_output_section type to Elf_Addr. Change code that uses
12788 it as well.
12789 * layout.cc (Layout::layout): Always set *off.
12790 * mapfile.cc (Mapfile::print_input_section): Use
12791 output_section_offset.
12792 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12793 Sized_relobj*.
12794 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12795 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12796 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12797
12798 2008-07-03 Ian Lance Taylor <iant@google.com>
12799
12800 * layout.cc (Layout::include_section): Do not discard unrecognized
12801 SHT_STRTAB sections.
12802
12803 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12804
12805 * script.cc (Lex::can_continue_name): Make '?' allowable in
12806 version-script names.
12807 * testsuite/version_script.map: Change glob pattern to use '?'
12808
12809 2008-06-30 Manish Singh <yosh@gimp.org>
12810
12811 PR 6585
12812 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12813 Correct typo.
12814
12815 2008-06-30 Ian Lance Taylor <iant@google.com>
12816
12817 PR 6660
12818 PR 6682
12819 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12820 versions]: Don't try to read the value in the contents, since we
12821 don't use it. Use the template endianness when writing.
12822
12823 2008-06-25 Cary Coutant <ccoutant@google.com>
12824
12825 * fileread.cc (File_read::make_view): Assert on zero-length view.
12826 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12827 symbol table when there are no symbols to read.
12828
12829 2008-06-23 Craig Silverstein <csilvers@google.com>
12830
12831 * version.cc (version_string): Bump to 1.7
12832
12833 2008-06-18 Craig Silverstein <csilvers@google.com>
12834
12835 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12836 constant 0xFFFF to type Valtype.
12837 (Powerpc_relocate_functions::rel16_ha): Likewise.
12838
12839 2008-06-17 Ian Lance Taylor <iant@google.com>
12840
12841 * output.h (Output_section::Input_section): Initialize p2align_ to
12842 zero for Output_section_data constructors.
12843 (Output_section::Input_section::addralign): If not an input
12844 section, return the alignment of the Output_section_data.
12845 * testsuite/copy_test.cc: New file.
12846 * testsuite/copy_test_1.cc: New file.
12847 * testsuite/copy_test_2.cc: New file.
12848 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12849 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12850 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12851 (copy_test_1_pic.o, copy_test_1.so): New targets.
12852 (copy_test_2_pic.o, copy_test_2.so): New targets.
12853 * testsuite/Makefile.in: Rebuild.
12854
12855 * script-sections.cc (Script_sections::place_orphan): Initialize
12856 local variable exact.
12857
12858 2008-06-13 David Edelsohn <edelsohn@gnu.org>
12859
12860 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12861
12862 2008-06-12 David Edelsohn <edelsohn@gnu.org>
12863 David S. Miller <davem@davemloft.net>
12864
12865 * powerpc.cc: New file.
12866 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12867 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12868 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12869 * Makefile.in: Rebuild.
12870
12871 2008-06-09 Ian Lance Taylor <iant@google.com>
12872
12873 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12874 <exception>.
12875 (throwing, orig_terminate): New static variables.
12876 (terminate_handler): New static function.
12877 (t2): Set terminate handler.
12878
12879 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12880
12881 PR 6584
12882 * binary.cc (Binary_to_elf::sized_convert): Fix .data
12883 alignment.
12884
12885 2008-05-30 Cary Coutant <ccoutant@google.com>
12886
12887 * archive.cc (Archive::include_all_members) Correct to step
12888 over symbol table and extended name table in thin archives.
12889
12890 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12891
12892 PR 6407
12893 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12894 calculation.
12895
12896 2008-05-28 Caleb Howe <cshowe@google.com>
12897
12898 * reduced_debug_output.cc: New file.
12899 * reduced_debug_output.h: New file.
12900 * options.h (class General_options): Add --strip-debug-non-line.
12901 * options.cc (General_options::finalize): Add strip_debug_non_line
12902 to the strip heirarchy.
12903 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12904 fields.
12905 * layout.cc: Include "reduced_debug_output.h".
12906 (Layout::Layout): Initialize new fields.
12907 (line_only_debug_sections): New static array.
12908 (is_lines_only_debug_sections): New static inline function.
12909 (Layout::include_section): Handle --strip-debug-non-line.
12910 (Layout::make_output_section): If --strip-debug-non-line, build
12911 new output sections for .debug_abbrev and .debug_info.
12912 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12913 gold. Warn about possible overflow.
12914 (read_signed_LEB_128): Likewise.
12915 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12916 (read_signed_LEB_128): Declare.
12917 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12918 (HFILES): Add reduced_debug_output.h.
12919 * Makefile.in: Rebuild.
12920
12921 2008-05-21 Ian Lance Taylor <iant@google.com>
12922
12923 * mapfile.cc: New file.
12924 * mapfile.h: New file.
12925 * options.h (class General_options): Add -M/--print-map and -Map.
12926 * options.cc (General_options::finalize): Make -M equivalent to
12927 -Map -.
12928 * main.cc: Include <cstdio> and "mapfile.h".
12929 (main): Open mapfile if requested.
12930 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12931 constructor. Change caller.
12932 (queue_initial_tasks): Add mapfile parameter. Change caller.
12933 (queue_middle_tasks): Likewise.
12934 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12935 declarations.
12936 * archive.cc: Include "mapfile.h".
12937 (Archive::add_symbols): Add mapfile parameter. Change all
12938 callers. Pass mapfile, symbol, and reason to include_member.
12939 (Archive::include_all_members): Add mapfile parameter. Change all
12940 callers.
12941 (Archive::include_member): Add mapfile, sym, and why parameters.
12942 Change all callers. Report inclusion to map file.
12943 * archive.h: Include "fileread.h".
12944 (class Archive): Update declarations.
12945 (Archive::file): New const method.
12946 (class Add_archive_symbols): Add mapfile_ field. Update
12947 constructor. Change all callers.
12948 * readsyms.h (class Read_symbols): Likewise.
12949 (class Finish_group): Likewise.
12950 (class Read_script): Likewise.
12951 * common.cc: Include "mapfile.h".
12952 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12953 all callers.
12954 (Symbol_table::do_allocate_commons): Likewise.
12955 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12956 symbol allocation to mapfile.
12957 * common.h (class Allocate_commons_task): Add mapfile_ field.
12958 Update constructor. Change all callers.
12959 * symtab.h (class Symbol_table): Update declarations.
12960 * layout.cc: Include "mapfile.h".
12961 (Layout_task_runner::run): Print information to mapfile.
12962 (Layout::create_gold_note): Change Output_data_fixed_space to
12963 Output_data_zero_fill.
12964 (Layout::create_build_id): Likewise.
12965 (Layout::print_to_mapfile): New function.
12966 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12967 constructor. Change caller.
12968 (class Layout): Declare print_to_mapfile.
12969 * output.cc (Output_section::Input_section::print_to_mapfile): New
12970 function.
12971 (Output_section::add_input_section): If producing a map, always
12972 add to input_sections_ list.
12973 (Output_section::do_print_to_mapfile): New function.
12974 (Output_segment::print_sections_to_mapfile): New function.
12975 (Output_segment::print_section_list_to_mapfile): New function.
12976 * output.h: Include "mapfile.h".
12977 (Output_data::print_to_mapfile): New function.
12978 (Output_data::do_print_to_mapfile): New virtual function.
12979 (Output_segment_headers::do_print_to_mapfile): New function.
12980 (Output_file_header::do_print_to_mapfile): New function.
12981 (Output_data_const::do_print_to_mapfile): New function.
12982 (class Output_data_const_buffer): Add map_name_ field. Update
12983 constructor. Change all callers. Add do_print_to_mapfile
12984 function.
12985 (class Output_data_fixed_space): Likewise.
12986 (class Output_data_space): Likewise.
12987 (class Output_data_zero_fill): New class.
12988 (Output_data_strtab::do_print_to_mapfile): New function.
12989 (Output_data_reloc_base::do_print_to_mapfile): New function.
12990 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12991 (Output_data_group::do_print_to_mapfile): New function.
12992 (Output_data_got::do_print_to_mapfile): New function.
12993 (Output_data_dynamic::do_print_to_mapfile): New function.
12994 (Output_symtab_xindex::do_print_to_mapfile): New function.
12995 (class Output_section): Declare do_print_to_mapflie. Declare
12996 print_to_mapfile in Input_section.
12997 (class Output_segment): Declare new functions.
12998 * object.h (Sized_relobj::symbol_count): New function.
12999 * script-sections.cc
13000 (Output_section_element_dot_assignment::set_section_addresses):
13001 Change Output_data_fixed_space to Output_data_zero_fill.
13002 (Output_data_expression::do_print_to_mapfile): New function.
13003 * script.cc (read_input_script): Add mapfile parameter. Change
13004 all callers.
13005 * script.h (read_input_script): Update declaration.
13006 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13007 (Eh_frame::do_print_to_mapfile): New function.
13008 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13009 (Output_merge_string::do_print_to_mapfile): New function.
13010 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13011 function.
13012 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13013 function.
13014 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13015 function.
13016 * Makefile.am (CCFILES): Add mapfile.cc.
13017 (HFILES): Add mapfile.h.
13018 * Makefile.in: Rebuild.
13019
13020 2008-05-19 Ian Lance Taylor <iant@google.com>
13021
13022 * options.h (class General_options): Add -z relro.
13023 * layout.cc (Layout::Layout): Initialize relro_segment_.
13024 (Layout::add_output_section_data): Return the output section.
13025 (Layout::make_output_section): Rcognize relro sections and mark
13026 them appropriately.
13027 (Layout::attach_allocated_section_to_segment): Put relro sections
13028 in a PT_GNU_RELRO segment.
13029 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13030 section as relro.
13031 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13032 PT_TLS segments.
13033 (Layout::linkonce_mapping): Map d.rel.ro.local to
13034 .data.rel.ro.local.
13035 (Layout::output_section_name): Us .data.rel.ro.local for any
13036 section which begins with that.
13037 * layout.h (class Layout): Update add_output_section_data
13038 declaration. Add relro_segment_ field.
13039 * output.cc (Output_section::Output_section): Initialize is_relro_
13040 and is_relro_local_ fields.
13041 (Output_segment::add_output_section): Group relro sections.
13042 (Output_segment::is_first_section_relro): New function.
13043 (Output_segment::maximum_alignment): If there is a relro section,
13044 align the segment to the common page size.
13045 (Output_segment::set_section_addresses): Track whether we are
13046 looking at relro sections. If the last section is a relro
13047 section, align to the common page size.
13048 (Output_segment::set_section_list_addresses): Add in_relro
13049 parameter. Change all callers. Align to the page size when
13050 moving from relro to non-relro section.
13051 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13052 segment.
13053 * output.h (class Output_section): Add is_relro_ and
13054 is_relro_local_ fields.
13055 (Output_section::is_relro): New function.
13056 (Output_section::set_is_relro): New function.
13057 (Output_section::is_relro_local): New function.
13058 (Output_section::set_is_relro_local): New function.
13059 (class Output_segment): Update declarations.
13060 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13061 * sparc.cc (Target_sparc::got_section): Likewise.
13062 * x86_64.cc (Target_x86_64::got_section): Likewise.
13063 * testsuite/relro_test_main.cc: New file.
13064 * testsuite/relro_test.cc: New file.
13065 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13066 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13067 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13068 (relro_test.so, relro_test_pic.o): New targets.
13069 * testsuite/Makefile.in: Rebuild.
13070
13071 2008-05-16 Ian Lance Taylor <iant@google.com>
13072
13073 * output.cc (Output_segment::add_output_section): Remove front
13074 parameter.
13075 * output.h (class Output_segment): Remove
13076 add_initial_output_section and overloaded add_output_section.
13077 Update declaration of remaining add_output_section.
13078 * layout.cc (Layout::create_interp): Call add_output_section
13079 rather than add_initial_output_section.
13080 (Layout::finish_dynamic_section): Likewise.
13081
13082 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13083 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13084 know the dynamic type.
13085 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13086 field. Initialize it in constructor.
13087 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13088 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13089 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13090 reloc.
13091
13092 * output.cc (Output_reloc::get_address): Change return type to
13093 Elf_Addr.
13094 * output.h (class Output_reloc): Update get_address declaration.
13095 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13096 for section addresses.
13097
13098 2008-05-09 Ian Lance Taylor <iant@google.com>
13099
13100 PR 6493
13101 * gold.cc (gold_nomem): Use return value of write.
13102
13103 2008-05-08 Ian Lance Taylor <iant@google.com>
13104
13105 * symtab.c (Symbol::init_base_output_data): Add version
13106 parameter. Change all callers.
13107 (Symbol::init_base_output_segment): Likewise.
13108 (Symbol::init_base_constant): Likewise.
13109 (Symbol::init_base_undefined): Likewise.
13110 (Sized_symbol::init_output_data): Likewise.
13111 (Sized_symbol::init_output_segment): Likewise.
13112 (Sized_symbol::init_constant): Likewise.
13113 (Sized_symbol::init_undefined): Likewise.
13114 (Symbol_table::do_define_in_output_data): If the new symbol has a
13115 version, mark it as the default.
13116 (Symbol_table::do_define_in_output_segment): Likewise.
13117 (Symbol_table::do_define_as_constant): Likewise.
13118 * symtab.h (class Symbol): Update declarations.
13119 (class Sized_symbol): Likewise.
13120 * resolve.cc (Symbol::override_version): New function.
13121 (Symbol::override_base): Call override_version.
13122 (Symbol::override_base_with_special): Likewise.
13123 * testsuite/ver_script_8.script: New file.
13124 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13125 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13126 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13127 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13128
13129 2008-05-06 Ian Lance Taylor <iant@google.com>
13130
13131 PR 6049
13132 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13133 functions.
13134 (class General_options): Remove existing --undefined, and add
13135 --no-undefined instead. Add new --undefined as synonym for -u.
13136 * archive.cc (Archive::add_symbols): Check whether symbol was
13137 named with -u.
13138 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13139 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13140 all uses. Add IS_UNDEFINED. Update declarations to split
13141 different versions of init_base. Declare init_base_undefined.
13142 (Symbol::is_defined): Handle IS_UNDEFINED.
13143 (Symbol::is_undefined): Likewise.
13144 (Symbol::is_weak_undefined): Call is_undefined.
13145 (Symbol::is_absolute): Handle IS_CONSTANT.
13146 (class Sized_symbol): Update declarations to split different
13147 versions of init. Declare init_undefined.
13148 (class Symbol_table): Declare new functions.
13149 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13150 Change all callers.
13151 (Symbol::init_base_output_data): Likewise.
13152 (Symbol::init_base_output_segment): Likewise.
13153 (Symbol::init_base_constant): Likewise.
13154 (Symbol::init_base_undefined): New function.
13155 (Sized_symbol::init_object): Rename from init. Change all
13156 callers.
13157 (Sized_symbol::init_output_data): Likewise.
13158 (Sized_symbol::init_output_segment): Likewise.
13159 (Sized_symbol::init_constant): Likewise.
13160 (Sized_symbol::init_undefined): New function.
13161 (Symbol_table::add_undefined_symbols_from_command_line): New
13162 function.
13163 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13164 function.
13165 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13166 (Symbol::output_section): Likewise.
13167 (Symbol::set_output_section): Likewise.
13168 (Symbol_table::sized_finalize_symbol): Likewise.
13169 (Symbol_table::sized_write_globals): Likewise.
13170 * resolve.cc (Symbol_table::should_override): Likewise.
13171 (Symbol::override_base_with_special): Likewise.
13172
13173 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13174 symbol, change it to have default visibility.
13175 * testsuite/protected_1.cc: New file.
13176 * testsuite/protected_2.cc: New file.
13177 * testsuite/protected_3.cc: New file.
13178 * testsuite/protected_main_1.cc: New file.
13179 * testsuite/protected_main_2.cc: New file.
13180 * testsuite/protected_main_3.cc: New file.
13181 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13182 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13183 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13184 (protected_1.so): New target.
13185 (protected_1_pic.o, protected_2_pic.o): New targets.
13186 (protected_3_pic.o): New target.
13187 (check_PROGRAMS): Add protected_2.
13188 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13189 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13190 * testsuite/Makefile.in: Rebuild.
13191
13192 * options.h (DEFINE_var): Add set_user_set_##varname__.
13193 (DEFINE_bool_alias): New macro.
13194 (class General_options): Define -Bstatic using DEFINE_bool_alias
13195 rather than DEFINE_special. Add --undefined as an alias for -z
13196 defs.
13197 * options.cc (General_options::parse_Bstatic): Remove.
13198
13199 * options.h (class General_options): Add --fatal-warnings.
13200 * main.cc (main): Implement --fatal-warnings.
13201 * errors.h (Errors::warning_count): New function.
13202
13203 * options.h (class General_options): Add -Bsymbolic-functions.
13204 * symtab.h (Symbol::is_preemptible): Check for
13205 -Bsymbolic-functions.
13206
13207 2008-05-05 Ian Lance Taylor <iant@google.com>
13208
13209 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13210 as noVARNAME rather than no-VARNAME.
13211 (class General_options): Add option -z combreloc.
13212 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13213 get_address.
13214 (Output_reloc::sort_before) [SHT_REL]: New function.
13215 (Output_reloc::sort_before) [SHT_RELA]: New function.
13216 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13217 Sort_relocs_comparison.
13218 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13219 parameter. Change all callers.
13220 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13221 sort_relocs parameter. Change all callers.
13222 * output.cc (Output_reloc::get_address): New function, broken out
13223 of write_rel.
13224 (Output_reloc::write_rel): Call it.
13225 (Output_reloc::compare): New function.
13226 (Output_data_reloc_base::do_write): Optionally sort relocs.
13227
13228 * configure.ac: If targ_extra_obj is set, link it in.
13229 * configure.tgt: Initialize all variables.
13230 (x86_64*): Set targ_extra_obj and targ_extra_size.
13231 * configure: Rebuild.
13232
13233 * object.cc (Sized_relobj::include_section_group): Adjust section
13234 indexes read from group data. Build vector to pass to
13235 layout_group.
13236 * layout.cc (Layout::layout_group): Add flags and shndxes
13237 parameters. Remove contents parameter. Change caller. Update
13238 explicit instantiations.
13239 * layout.h (class Layout): Update layout_group declaration.
13240 * output.cc (Output_data_group::Output_data_group): Add flags and
13241 input_shndxes parameters. Remove contents parameter. Change
13242 caller.
13243 (Output_data_group::do_write): Change input_sections_ to
13244 input_shndxes_.
13245 * output.h (class Output_data_group): Update constructor
13246 declaration. Rename input_sections_ to input_shndxes_.
13247 * testsuite/many_sections_test.cc: Add template.
13248
13249 2008-04-30 Cary Coutant <ccoutant@google.com>
13250
13251 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13252
13253 * layout.cc (Layout::include_section): Refactored check for debug
13254 info section.
13255 (Layout::add_comdat): Add new parameters. Change type
13256 of signature parameter. Add object and shndx to signatures table.
13257 (Layout::find_kept_object): New function.
13258 * layout.h: Include <cstring>.
13259 (Layout::is_debug_info_section): New function.
13260 (Layout::add_comdat): Add new parameters.
13261 (Layout::find_kept_object): New function.
13262 (Layout::Kept_section): New struct.
13263 (Layout::Signatures): Change type of map range.
13264 * object.cc (Relobj::output_section_address): New function.
13265 (Sized_relobj::include_section_group): Add new parameters. Change
13266 calls to Layout::add_comdat. Change to build table of kept comdat
13267 groups and table mapping discarded sections to kept sections.
13268 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13269 (Sized_relobj::do_layout): Change calls to include_section_group and
13270 include_linkonce_section.
13271 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13272 value to zero when section is discarded.
13273 (Sized_relobj::map_to_kept_section): New function.
13274 * object.h (Relobj::output_section_address): New function.
13275 (Relobj::Comdat_group): New type.
13276 (Relobj::find_comdat_group): New function.
13277 (Relobj::Comdat_group_table): New type.
13278 (Relobj::Kept_comdat_section): New type.
13279 (Relobj::Kept_comdat_section_table): New type.
13280 (Relobj::add_comdat_group): New function.
13281 (Relobj::set_kept_comdat_section): New function.
13282 (Relobj::get_kept_comdat_section): New function.
13283 (Relobj::comdat_groups_): New field.
13284 (Relobj::kept_comdat_sections_): New field.
13285 (Symbol_value::input_value): Update comment.
13286 (Sized_relobj::map_to_kept_section) New function.
13287 (Sized_relobj::include_linkonce_section): Add new parameter.
13288 * target-reloc.h (Comdat_behavior): New type.
13289 (get_comdat_behavior): New function.
13290 (relocate_section): Add code to map a discarded section to the
13291 corresponding kept section when applying a relocation.
13292
13293 2008-04-30 Craig Silverstein <csilvers@google.com>
13294
13295 * dwarf_reader.cc (next_generation_count): New static var.
13296 (Addr2line_cache_entry): New struct.
13297 (addr2line_cache): New static var.
13298 (Dwarf_line_info::one_addr2line): Added caching.
13299 (Dwarf_line_info::clear_addr2line_cache): New function.
13300 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13301 cache-size parameter.
13302 (Dwarf_line_info::one_addr2line_cache): New function.
13303 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13304 new cache-size argument to one_addr2line(), and clear cache.
13305
13306 2008-04-28 Cary Coutant <ccoutant@google.com>
13307
13308 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13309 R_386_PC8 relocations.
13310
13311 2008-04-23 Ian Lance Taylor <iant@google.com>
13312
13313 * object.cc (Sized_relobj::include_section_group): Check for
13314 invalid section group.
13315
13316 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13317 header size.
13318
13319 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13320 than read for file header.
13321 * archive.cc (Archive::include_member): Likewise.
13322
13323 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
13324
13325 * aclocal.m4: Regenerate.
13326 * configure: Regenerate.
13327
13328 2008-04-19 Ian Lance Taylor <iant@google.com>
13329
13330 * version.cc (version_string): Bump to 1.6.
13331
13332 * testsuite/Makefile.am (many_sections_r_test): New target.
13333 (many_sections_r_test_SOURCES): Remove.
13334 (many_sections_r_test_DEPENDENCIES): Remove.
13335 (many_sections_r_test_LDFLAGS): Remove.
13336 (many_sections_r_test_LDADD): Remove.
13337
13338 * object.cc (Sized_relobj::do_add_symbols): Always pass
13339 local_symbol_count_ to add_from_relobj.
13340
13341 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13342 every thousand variables.
13343 * testsuite/Makefile.in: Rebuild.
13344
13345 * object.cc (Xindex::initialize_symtab_xindex): New function.
13346 (Xindex::read_symtab_xindex): New function.
13347 (Xindex::sym_xindex_to_shndx): New function.
13348 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13349 available.
13350 (Sized_relobj::do_initialize_xindex): New function.
13351 (Sized_relobj::do_read_symbols): Adjust section links.
13352 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13353 parameter. Change all callers.
13354 (Sized_relobj::include_section_group): Adjust section links and
13355 symbol section indexes.
13356 (Sized_relobj::do_layout): Adjust section links.
13357 (Sized_relobj::do_count_local_symbols): Adjust section links and
13358 symbol section indexes.
13359 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13360 ordinary and special symbols.
13361 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13362 dynsym_xindex parameters. Change all callers. Adjust section
13363 links. Use SHN_XINDEX when needed.
13364 (Sized_relobj::get_symbol_location_info): Adjust section links.
13365 Don't get fooled by special symbols.
13366 * object.h (class Xindex): Define.
13367 (class Object): Add xindex_ parameter. Declare virtual functoin
13368 do_initialize_xindex.
13369 (Object::adjust_sym_shndx): New function.
13370 (Object::set_xindex): New protected function.
13371 (class Symbol_value): Add is_ordinary_shndx_ field.
13372 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13373 (Symbol_value::value): Assert ordinary section.
13374 (Symbol_value::initialize_input_to_output_map): Likewise.
13375 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13376 Change all callers.
13377 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13378 all callers.
13379 (class Sized_relobj): Update declarations.
13380 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13381 parameter. Change all callers.
13382 (Sized_relobj::adjust_shndx): New function.
13383 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13384 field.
13385 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13386 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13387 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13388 (Sized_dynobj::read_dynsym_section): Adjust section links.
13389 (Sized_dynobj::read_dynamic): Likewise.
13390 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13391 section links.
13392 (Sized_dynobj::do_initialize_xindex): New function.
13393 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13394 do_initialize_xindex.
13395 (Sized_dynobj::adjust_shndx): New function.
13396 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13397 dynsym_xindex_ fields.
13398 (Layout::finalize): Add a call to set_section_indexes before
13399 creating the symtab sections.
13400 (Layout::set_section_indexes): Don't do anything if the section
13401 already has a section index.
13402 (Layout::create_symtab_sections): Add shnum parameter. Change
13403 caller. Create .symtab_shndx section if needed.
13404 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13405 caller.
13406 (Layout::allocated_output_section_count): New function.
13407 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13408 needed.
13409 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13410 fields. Update declarations.
13411 (Layout::symtab_xindex): New function.
13412 (Layout::dynsym_xindex): New function.
13413 (class Write_symbols_task): Add layout_ field.
13414 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13415 Change caller.
13416 * output.cc (Output_section_headers::Output_section_headers): Add
13417 shstrtab_section parameter. Change all callers.
13418 (Output_section_headers::do_sized_write): Store overflow values
13419 for section count and section string table section index in
13420 section header zero.
13421 (Output_file_header::do_sized_write): Check for overflow of
13422 section count and section string table section index.
13423 (Output_symtab_xindex::do_write): New function.
13424 (Output_symtab_xindex::endian_do_write): New function.
13425 * output.h (class Output_section_headers): Add shstrtab_section_.
13426 Update declarations.
13427 (class Output_symtab_xindex): Define.
13428 (Output_section::has_out_shndx): New function.
13429 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13430 field.
13431 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13432 Change all callers.
13433 (Sized_symbol::init): Likewise.
13434 (Symbol::output_section): Check for ordinary symbol.
13435 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13436 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13437 callers.
13438 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13439 Change all callers. Simplify handling of symbols from sections
13440 not included in the link.
13441 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13442 distinction.
13443 (Weak_alias_sorter::operator()): Assert that symbols are
13444 ordinary.
13445 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13446 distinction.
13447 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13448 parameters. Change all callers.
13449 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13450 symbol distinction. Use SHN_XINDEX when needed.
13451 (Symbol_table::write_section_symbol): Add symtab_xindex
13452 parameter. Change all callers.
13453 (Symbol_table::sized_write_section_symbol): Likewise. Use
13454 SHN_XINDEX when needed.
13455 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13456 declarations.
13457 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13458 (Symbol::is_defined): Check is_ordinary.
13459 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13460 (Symbol::is_absolute, Symbol::is_common): Likewise.
13461 (class Sized_symbol): Update declarations.
13462 (class Symbol_table): Update declarations.
13463 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13464 parameters. Change all callers.
13465 (Sized_symbol::override): Likewise.
13466 (Symbol_table::override): Likewise.
13467 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13468 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13469 is_ordinary, and orig_st_shndx parameters. Change all callers.
13470 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13471 to be in an ordinary section.
13472 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13473 object and is_ordinary parameters. Change all callers.
13474 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13475 Change all callers. Don't add undefined or non-ordinary symbols
13476 to reloc_map_.
13477 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13478 Change all callers.
13479 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13480 declarations.
13481 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13482 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13483 (Sized_relobj::relocate_sections): Likewise.
13484 * target-reloc.h (scan_relocs): Adjust section symbol index.
13485 (scan_relocatable_relocs): Likewise.
13486 * i386.cc (Scan::local): Check for ordinary symbols.
13487 * sparc.cc (Scan::local): Likewise.
13488 * x86_64.cc (Scan::local): Likewise.
13489 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13490 to symbol_section_and_value.
13491 * testsuite/many_sections_test.cc: New file.
13492 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13493 (check_PROGRAMS): Add many_sections_test.
13494 (many_sections_test_SOURCES): Define.
13495 (many_sections_test_DEPENDENCIES): Define.
13496 (many_sections_test_LDFLAGS): Define.
13497 (BUILT_SOURCES): Add many_sections_define.h.
13498 (many_sections_define.h): New target.
13499 (BUILT_SOURCES): Add many_sections_check.h.
13500 (many_sections_check.h): New target.
13501 (check_PROGRAMS): Add many_sections_r_test.
13502 (many_sections_r_test_SOURCES): Define.
13503 (many_sections_r_test_DEPENDENCIES): Define.
13504 (many_sections_r_test_LDFLAGS): Define.
13505 (many_sections_r_test_LDADD): Define.
13506 (many_sections_r_test.o): New target.
13507 * testsuite/Makefile.in: Rebuild.
13508
13509 2008-04-17 Cary Coutant <ccoutant@google.com>
13510
13511 * errors.cc (Errors::info): New function.
13512 (gold_info): New function.
13513 * errors.h (Errors::info): New function.
13514 * gold.h (gold_info): New function.
13515 * object.cc (Input_objects::add_object): Print trace output.
13516 * options.cc (options::parse_set): New function.
13517 (General_options::parse_wrap): Deleted.
13518 (General_options::General_options): Deleted initializer.
13519 * options.h (options::String_set): New typedef.
13520 (options::parse_set): New function.
13521 (DEFINE_set): New macro.
13522 (General_options::wrap): Changed to use DEFINE_set. Changed
13523 callers of any_wrap_symbols and is_wrap_symbol.
13524 (General_options::trace, General_options::trace_symbol):
13525 New options.
13526 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13527 (General_options::wrap_symbols_): Deleted.
13528 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13529
13530 2008-04-17 David S. Miller <davem@davemloft.net>
13531
13532 * options.cc (General_options::parse_V): New function.
13533 * options.h: Add entries for -V and -Qy.
13534
13535 2008-04-17 Ian Lance Taylor <iant@google.com>
13536
13537 * common.cc (Symbol_table::allocate_commons): Remove options
13538 parameter. Change caller.
13539 (Symbol_table::do_allocate_commons): Remove options parameter.
13540 Change caller. Just call do_allocate_commons_list twice.
13541 (Symbol_table::do_allocate_commons_list): New function, broken out
13542 of do_allocate_commons.
13543 * common.h (class Allocate_commons_task): Remove options_ field.
13544 Update constructor.
13545 * symtab.cc (Symbol_table::Symbol_table): Initialize
13546 tls_commons_.
13547 (Symbol_table::add_from_object): Put TLS common symbols on
13548 tls_commons_ list.
13549 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13550 which are IN_OUTPUT_DATA.
13551 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13552 allocate_commons and do_allocate_commons declarations. Declare
13553 do_allocate_commons_list.
13554 * gold.cc (queue_middle_tasks): Update creation of
13555 Allocate_commons_task to not pass options.
13556 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13557 (TLS_TEST_C_FLAGS): New variable.
13558 (tls_test_c_pic.o): New target.
13559 (tls_test_shared.so): Link in tls_test_c_pic.o.
13560 (tls_test_c_pic_ie.o): New target.
13561 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13562 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13563 (tls_test_c.o): New target.
13564 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13565 (tls_pic_test_LDADD): Likewise.
13566 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13567 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13568 (tls_test_c_gnu2.o): New target.
13569 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13570 tls_test_c_gnu2.o.
13571 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13572 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13573 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13574 * testsuite/tls_test.cc: Include "config.h".
13575 (t_last): Call t11_last.
13576 * testsuite/tls_test.h (t11, t11_last): Declare.
13577 * testsuite/tls_test_c.c: New file.
13578 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13579 * configure.ac: Check for OpenMP support.
13580 * configure, config.in, Makefile.in: Rebuild.
13581 * testsuite/Makefile.in: Rebuild.
13582
13583 2008-04-16 Cary Coutant <ccoutant@google.com>
13584
13585 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13586 (Target_i386::tls_base_symbol_defined_): New field.
13587 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13588 (Target_i386::Scan::global): Likewise.
13589 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13590 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13591 (Target_x86_64::tls_base_symbol_defined_): New field.
13592 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13593 (Target_x86_64::Scan::global): Likewise.
13594
13595 2008-04-16 Cary Coutant <ccoutant@google.com>
13596
13597 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13598 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13599 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13600 building shared libraries.
13601 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13602 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13603 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13604 * testsuite/Makefile.in: Rebuild.
13605 * testsuite/weak_undef.h: New file.
13606 * testsuite/weak_undef_file1.cc: Add extra test cases.
13607 * testsuite/weak_undef_file2.cc: Likewise.
13608 * testsuite/weak_undef_test.cc: Likewise.
13609
13610 2008-04-16 David S. Miller <davem@davemloft.net>
13611
13612 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13613 Add issued_non_pic_error_ field. Declare check_non_pic.
13614 (Target_sparc::Scan::check_non_pic): New function.
13615 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13616 (Target_sparc::Scan::global): Likewise.
13617
13618 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13619 * configure: Rebuild.
13620
13621 * options.h (DEFINE_enable): New macro.
13622 (new_dtags): New enable option.
13623 (initfirst, interpose, loadfltr, nodefaultlib,
13624 nodelete, nodlopen, nodump): New -z options.
13625 * layout.cc (Layout:finish_dynamic_section): If new
13626 dtags enabled, emit DT_RUNPATH. Also, emit a
13627 DT_FLAGS_1 containing any specified -z flags.
13628
13629 2008-04-16 Ian Lance Taylor <iant@google.com>
13630
13631 * copy-relocs.cc: New file.
13632 * copy-relocs.h: New file.
13633 * reloc.cc: Remove Copy_relocs code.
13634 * reloc.h: Likewise.
13635 * reloc-types.h (struct Reloc_types) [both versions]: Add
13636 get_reloc_addend_noerror.
13637 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13638 variants of add_global which take an addend which must be zero.
13639 * i386.cc: Include "copy-relocs.h".
13640 (class Target_i386): Change type of copy_relocs_ to variable,
13641 update initializer.
13642 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13643 Change all callers.
13644 (Target_i386::do_finalize_sections): Change handling of
13645 copy_relocs_.
13646 * sparc.cc: Include "copy-relocs.h".
13647 (class Target_sparc): Change type of copy_relocs_ to variable,
13648 update initializer.
13649 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13650 Change all callers.
13651 (Target_sparc::do_finalize_sections): Change handling of
13652 copy_relocs_.
13653 * x86_64.cc: Include "copy-relocs.h".
13654 (class Target_x86_64): Change type of copy_relocs_ to variable,
13655 update initializer.
13656 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13657 class. Change all callers.
13658 (Target_x86_64::do_finalize_sections): Change handling of
13659 copy_relocs_.
13660 * Makefile.am (CCFILES): Add copy-relocs.cc.
13661 (HFILES): Add copy-relocs.h.
13662
13663 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13664
13665 * testsuite/script_test_4.sh: Permit leading zeroes.
13666
13667 2008-04-15 Ian Lance Taylor <iant@google.com>
13668
13669 * script-sections.cc (Script_sections::create_segments): Use
13670 header_size_adjustment even when there is enough room for the
13671 headers.
13672 * testsuite/script_test_4.sh: New file.
13673 * testsuite/script_test_4.t: New file.
13674 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13675 (check_DATA): Add script_test_4.stdout.
13676 (MOSTLYCLEANFILES): Likewise.
13677 (script_test_4): New target.
13678 (script_test_4.stdout): New target.
13679 * testsuite/Makefile.in: Rebuild.
13680
13681 * sparc.cc: Add definitions for Output_data_plt_sparc class
13682 constants.
13683
13684 2008-04-14 David S. Miller <davem@davemloft.net>
13685
13686 * sparc.cc: New file.
13687 * Makefile.am (TARGETSOURCES): Add sparc.cc
13688 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13689 * configure.tgt: Document targ_extra_size and
13690 targ_extra_big_endian. Add entries for sparc-* and
13691 sparc64-*.
13692 * configure.ac: Handle targ_extra_size and
13693 targ_extra_big_endian.
13694 * Makefile.in: Rebuild.
13695 * configure: Likewise.
13696 * po/POTFILES.in: Likewise.
13697 * po/gold.pot: Likewise.
13698
13699 2008-04-14 Ian Lance Taylor <iant@google.com>
13700
13701 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13702 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13703 in the name/type/flags to section mapping. Don't call
13704 allocate_output_section.
13705 (Layout::choose_output_section): Change parameter from adjust_name
13706 to is_input_section. Don't permit input sections after sections
13707 are attached to segments. Don't call allocate_output_section.
13708 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13709 not write_enable_output_section.
13710 (Layout::make_output_section): Don't push to
13711 unattached_section_list_ nor call attach_to_segment. Call
13712 attach_section_to_segment if sections are attached.
13713 (Layout::attach_sections_to_segments): New function.
13714 (Layout::attach_section_to_segment): New function.
13715 (Layout::attach_allocated_section_to_segment): Rename from
13716 attach_to_segment. Remove flags parameter.
13717 (Layout::allocate_output_section): Remove function.
13718 (Layout::write_enable_output_section): Remove function.
13719 * layout.h (class Layout): Update for above changes. Add new
13720 field sections_are_attached_.
13721 * output.h (Output_section::update_flags_for_input_section): New
13722 function.
13723 * output.cc (Output_section::add_input_section): Call
13724 update_flags_for_input_section.
13725 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13726
13727 2008-04-11 Cary Coutant <ccoutant@google.com>
13728
13729 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13730 thought unnecessary.
13731 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13732
13733 2008-04-11 Ian Lance Taylor <iant@google.com>
13734
13735 * output.h (class Output_section_data): Remove inline definition
13736 of set_addralign.
13737 * output.cc (Output_section_data::set_addralign): New function.
13738
13739 2008-04-11 Cary Coutant <ccoutant@google.com>
13740
13741 Add support for TLS descriptors for i386 and x86_64.
13742 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13743 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13744 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13745 GOT_TYPE_TLS_DESC.
13746 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13747 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13748 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13749 relocations.
13750 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13751 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13752 Fix problem with initial-exec relocations.
13753 (Target_i386::Relocate::relocate_tls): Likewise.
13754 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13755 relaxation.
13756 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13757 support for section-plus-offset dynamic table entries.
13758 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13759 (Output_data_dynamic::Dynamic_entry): Add support for
13760 section-plus-offset dynamic table entries.
13761 (Output_data_dynamic::Classification): Likewise.
13762 (Output_data_dynamic::classification_): Renamed offset_.
13763 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13764 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13765 (Target_x86_64::make_plt_section): New function.
13766 (Target_x86_64::reserve_tlsdesc_entries): New function.
13767 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13768 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13769 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13770 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13771 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13772 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13773 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13774 add extra PLT entry for TLS descriptors.
13775 (Output_data_plt_x86_64::got_): New field.
13776 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13777 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13778 fields.
13779 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13780 descriptors.
13781 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13782 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13783 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13784 R_386_TLS_DESC_CALL relocations.
13785 (Target_x86_64::Scan::global): Likewise.
13786 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13787 for TLS descriptors.
13788 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13789 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13790 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13791 GD-to-IE relaxation.
13792 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13793 and TLS_DESCRIPTORS.
13794 * Makefile.in: Rebuild.
13795 * configure: Rebuild.
13796 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13797 (tls_test_shared2.so): New target.
13798 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13799 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13800 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13801 (tls_shared_gd_to_ie_test_LDADD): New variable.
13802 (tls_shared_gnu2_gd_to_ie_test): New target.
13803 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13804 New targets.
13805 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13806 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13807 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13808 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13809 (tls_shared_gnu2_test): New target.
13810 (tls_test_gnu2_shared.so): New target.
13811 (tls_shared_gnu2_test_SOURCES): New variable.
13812 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13813 (tls_shared_gnu2_test_LDFLAGS): New variable.
13814 (tls_shared_gnu2_test_LDADD): New variable.
13815 * testsuite/Makefile.in: Rebuild.
13816 * testsuite/Makefile.
13817
13818 2008-04-11 Ian Lance Taylor <iant@google.com>
13819
13820 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13821 justsyms.t.
13822 * testsuite/Makefile.in: Rebuild.
13823
13824 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13825 long.
13826 * testsuite/script_test_2.cc (main): Adjust test.
13827
13828 2008-04-11 David S. Miller <davem@davemloft.net>
13829 Ian Lance Taylor <iant@google.com>
13830
13831 * options.h (General_options): Add entries for '-Y' and
13832 '-relax'.
13833 * options.cc (General_options:finalize): If -Y was used, add those
13834 entries to the library path instead of the default "/lib" and
13835 "/usr/lib".
13836
13837 2008-04-11 David S. Miller <davem@davemloft.net>
13838
13839 * testsuite/justsyms.t: Start at 0x100.
13840 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
13841 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13842 long.
13843 * testsuite/script_test_2.cc: Adjust string and section length
13844 checks.
13845
13846 2008-04-09 Ian Lance Taylor <iant@google.com>
13847
13848 PR gold/5996
13849 * script-sections.cc (Sections_element::allocate_to_segment): Add
13850 orphan parameter.
13851 (Output_section_definition::allocate_to_segment): Likewise.
13852 (Orphan_output_section::allocate_to_segment): Likewise.
13853 (Script_sections::attach_sections_using_phdrs_clause): Don't
13854 propagate non-PT_LOAD segments to orphan sections.
13855 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13856 readelf rather than objdump.
13857 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13858 .interp section and PT_INTERP segment are the same size.
13859 * testsuite/Makefile.in: Rebuild.
13860
13861 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13862 aliases for symbols defined in the same object.
13863 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13864 (weak_alias_test_SOURCES): New variable.
13865 (weak_alias_test_DEPENDENCIES): New variable.
13866 (weak_alias_test_LDFLAGS): New variable.
13867 (weak_alias_test_LDADD): New variable.
13868 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13869 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13870 (weak_alias_test_3.o): New target.
13871 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13872 * testsuite/weak_alias_test_main.cc: New file.
13873 * testsuite/weak_alias_test_1.cc: New file.
13874 * testsuite/weak_alias_test_2.cc: New file.
13875 * testsuite/weak_alias_test_3.cc: New file.
13876
13877 2008-04-08 Ian Lance Taylor <iant@google.com>
13878
13879 * options.h (class General_options): Add --noinhibit-exec option.
13880 * main.cc (main): Check --noinhibit-exec.
13881
13882 * options.h (class General_options): Define --wrap as a special
13883 option. Add wrap_symbols_ field.
13884 (General_options::any_wrap_symbols): New function.
13885 (General_options::is_wrap_symbol): New function.
13886 * options.cc (General_options::parse_wrap): New function.
13887 (General_options::General_options): Initialize wrap_symbols_.
13888 * symtab.cc (Symbol_table::wrap_symbol): New function.
13889 (Symbol_table::add_from_object): Handle --wrap.
13890 * symtab.h (class Symbol_table): Declare wrap_symbol.
13891 * target.h (Target::wrap_char): New function.
13892 (Target::Target_info): Add wrap_char field.
13893 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13894 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13895 * testsuite/testfile.cc (Target_test::test_target_info):
13896 Likewise.
13897
13898 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13899 there is one.
13900
13901 * layout.h (class Layout): Add added_eh_frame_data_ field.
13902 * layout.cc (Layout::Layout): Initialize new field.
13903 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13904 output section until we find a section we merged successfully.
13905 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13906 that the size be non-zero.
13907
13908 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13909 qualifier.
13910
13911 2008-04-08 Craig Silverstein <csilvers@google.com>
13912
13913 * configure.ac: Export new conditional variable HAVE_ZLIB.
13914 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13915 on HAVE_ZLIB.
13916 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13917 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13918
13919 2008-04-07 Ian Lance Taylor <iant@google.com>
13920
13921 * version.cc (version_string): Set to "1.5".
13922
13923 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13924 Add issued_non_pic_error_ field. Declare check_non_pic.
13925 (Target_x86_64::Scan::check_non_pic): New function.
13926 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13927 (Target_x86_64::Scan::global): Likewise.
13928
13929 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13930 addend parameter. Change caller. Handle merge sections.
13931 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13932 Address to Addend. Don't add in the result of
13933 local_section_offset, pass down the addend and use the returned
13934 value.
13935 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13936 Update declarations of local_section_offset and symbol_value.
13937 * testsuite/two_file_test_1.cc (t18): New function.
13938 * testsuite/two_file_test_2.cc (f18): New function.
13939 * testsuite/two_file_test_main.cc (main): Call t18.
13940 * testsuite/two_file_test.h (t18, f18): Declare.
13941
13942 * configure.ac: Don't test for objdump, c++filt, or readelf.
13943 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13944 conditionals.
13945 (TEST_READELF): New variable.
13946 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13947 (check_PROGRAMS): Add two_file_strip_test.
13948 (two_file_strip_test): New target.
13949 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13950 (two_file_same_shared_strip_test_SOURCES): New variable.
13951 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13952 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13953 (two_file_same_shared_strip_test_LDADD): New variable.
13954 (two_file_shared_strip.so): New target.
13955 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13956 (ver_test_5.syms, ver_test_7.syms): Likewise.
13957 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13958 (strip_test_3.stdout): Use TEST_OBJDUMP.
13959 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13960
13961 2008-04-04 Cary Coutant <ccoutant@google.com>
13962
13963 * symtab.h (Symbol::is_weak_undefined): New function.
13964 (Symbol::is_strong_undefined): New function.
13965 (Symbol::is_absolute): New function.
13966 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13967 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13968 absolute symbols.
13969 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13970 (weak_undef_test): New target.
13971 * testsuite/Makefile.in: Rebuild.
13972 * testsuite/weak_undef_file1.cc: New file.
13973 * testsuite/weak_undef_file2.cc: New file.
13974 * testsuite/weak_undef_test.cc: New file.
13975
13976 2008-04-03 Craig Silverstein <csilvers@google.com>
13977
13978 * compressed_output.h (class Output_compressed_section): Use
13979 unsigned buffer.
13980 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13981 add zlib header.
13982 (zlib_compressed_suffix): Removed.
13983 (Output_compressed_section::set_final_data_size): Use unsigned
13984 buffers.
13985 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13986 Fix linker invocation.
13987 (flagstest_o_specialfile_and_compress_debug_sections):
13988 Likewise.
13989 * testsuite/Makefile.in: Regenerated.
13990
13991 2008-04-02 David S. Miller <davem@davemloft.net>
13992
13993 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13994 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13995
13996 2008-04-02 Craig Silverstein <csilvers@google.com>
13997
13998 * TODO: New file.
13999
14000 2008-04-02 Ian Lance Taylor <iant@google.com>
14001
14002 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14003 parameters. Update for new key type to views_. Change all
14004 callers.
14005 (File_read::read): Adjust for byteshift in returned view.
14006 (File_read::add_view): New function, broken out of
14007 find_and_make_view.
14008 (File_read::make_view): New function, broken out of
14009 find_and_make_view.
14010 (File_read::find_or_make_view): Add offset and aligned
14011 parameters. Rewrite accordingly. Change all callers.
14012 (File_read::get_view): Add offset and aligned parameters. Adjust
14013 for byteshift in return value.
14014 (File_read::get_lasting_view): Likewise.
14015 * fileread.h (class File_read): Update declarations.
14016 (class File_read::View): Add byteshift_ field. Add byteshift to
14017 constructor. Add byteshift method.
14018 * archive.h (Archive::clear_uncached_views): New function.
14019 (Archive::get_view): Add aligned parameter. Change all callers.
14020 * object.h (Object::get_view): Add aligned parameter. Change all
14021 callers.
14022 (Object::get_lasting_view): Likewise.
14023
14024 * fileread.cc (File_read::release): Don't call clear_views if
14025 there are multiple objects.
14026 * fileread.h (File_read::clear_uncached_views): New function.
14027 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14028 on the archive.
14029
14030 2008-03-31 Cary Coutant <ccoutant@google.com>
14031
14032 Add thin archive support.
14033 * archive.cc (Archive::armagt): New const.
14034 (Archive::setup): Remove task parameter and calls to unlock.
14035 (Archive::unlock_nested_archives): New function.
14036 (Archive::read_header): Add nested_off parameter. Change
14037 all callers.
14038 (Archive::interpret_header): Likewise.
14039 (Archive::include_all_members): Change to handle thin
14040 archives.
14041 (Archive::include_member): Likewise.
14042 * archive.h (Archive::Archive): Add new parameters and
14043 initializers.
14044 (Archive::armagt): New const.
14045 (Archive::setup): Remove task parameter.
14046 (Archive::unlock_nested_archives): New function.
14047 (Archive::read_header): Add nested_off parameter.
14048 (Archive::interpret_header): Likewise.
14049 (Archive::Nested_archive_table): New typedef.
14050 (Archive::is_thin_archive_): New field.
14051 (Archive::nested_archives_): New field.
14052 (Archive::options_): New field.
14053 (Archive::dirpath_): New field.
14054 (Archive::task_): New field.
14055 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14056 for thin archives. Pass additional parameters to
14057 Archive::Archive. Unlock the archive file after calling
14058 Archive::setup.
14059
14060 2008-03-29 Ian Lance Taylor <iant@google.com>
14061
14062 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14063 version symbol to be local.
14064 * testsuite/ver_test_4.sh: New file.
14065 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14066 (check_DATA): Add ver_test_4.syms.
14067 (ver_test_4.syms): New target.
14068 * testsuite/Makefile.in: Rebuild.
14069
14070 * output.cc
14071 (Output_section::Input_section_sort_entry::has_priority): New
14072 function.
14073 (Output_section::Input_section_sort_entry::match_file_name): New
14074 function.
14075 (Output_section::Input_section_sort_entry::match_section_name):
14076 Remove.
14077 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14078 Remove.
14079 (Output_section::Input_section_sort_entry::match_section_file):
14080 Remove.
14081 (Output_section::Input_section_sort_compare::operator()): Rewrite
14082 using new Input_section_sort_entry functions. Sort crtbegin and
14083 crtend first. Sort sections with no priority before sections with
14084 a priority.
14085 * testsuite/initpri1.c (d3): Check j != 4.
14086 (cd5): New constructor/destructor function.
14087 (main): Check j != 2.
14088
14089 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14090 new symbol when resolving, don't call set_is_default.
14091 * testsuite/ver_test_7.cc: New file.
14092 * testsuite/ver_test_7.sh: New file.
14093 * testsuite/Makefile.am (ver_test_7.so): New target.
14094 (ver_test_7.o): New target.
14095 (check_SCRIPTS): Add ver_test_7.sh.
14096 (check_DATA): Add ver_test_7.syms.
14097 (ver_test_7.syms): New target.
14098
14099 2008-03-28 Ian Lance Taylor <iant@google.com>
14100
14101 * layout.cc (Layout::layout): If we see an input section with a
14102 name that needs sorting, set the must_sort flag for the output
14103 section.
14104 (Layout::make_output_section): If the name of the output section
14105 indicates that it might require sorting, set the may_sort flag.
14106 * output.h (Output_section::may_sort_attached_input_sections): New
14107 function.
14108 (Output_section::set_may_sort_attached_input_sections): New
14109 function.
14110 (Output_section::must_sort_attached_input_sections): New
14111 function.
14112 (Output_section::set_must_sort_attached_input_sections): New
14113 function.
14114 (class Output_section): Declare Input_section_sort_entry. Define
14115 Input_section_sort_compare. Declare
14116 sort_attached_input_sections. Add new fields:
14117 may_sort_attached_input_sections_,
14118 must_sort_attached_input_sections_,
14119 attached_input_sections_are_sorted_.
14120 * output.cc (Output_section::Output_section): Initialize new
14121 fields.
14122 (Output_section::add_input_section): Add an entry to
14123 input_sections_ if may_sort or must_sort are true.
14124 (Output_section::set_final_data_size): Call
14125 sort_attached_input_sections if necessary.
14126 (Output_section::Input_section_sort_entry): Define new class.
14127 (Output_section::Input_section_sort_compare::operator()): New
14128 function.
14129 (Output_section::sort_attached_input_sections): New function.
14130 * configure.ac: Check whether the compiler supports constructor
14131 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14132 * testsuite/initpri1.c: New file.
14133 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14134 CONSTRUCTOR_PRIORITY.
14135 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14136 (initpri1_LDFLAGS): New variable.
14137 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14138
14139 2008-03-27 Ian Lance Taylor <iant@google.com>
14140
14141 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14142 * testsuite/common_test_1.c: New file.
14143 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14144 (common_test_1_SOURCES): New variable.
14145 (common_test_1_DEPENDENCIES): New variable.
14146 (common_test_1_LDFLAGS): New variable.
14147
14148 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14149 and commons_ correctly when NAME/VERSION does not override
14150 NAME/NULL.
14151 * testsuite/ver_test_6.c: New file.
14152 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14153 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14154 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14155
14156 2008-03-26 Ian Lance Taylor <iant@google.com>
14157
14158 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14159 of an undefined symbol from a version script.
14160 * testsuite/Makefile.am (ver_test_5.so): New target.
14161 (ver_test_5.o): New target.
14162 (check_SCRIPTS): Add ver_test_5.sh.
14163 (check_DATA): Add ver_test_5.syms.
14164 (ver_test_5.syms): New target.
14165 * testsuite/ver_test_5.cc: New file.
14166 * testsuite/ver_test_5.script: New file.
14167 * testsuite/ver_test_5.sh: New file.
14168 * Makefile.in, testsuite/Makefile.in: Rebuild.
14169
14170 PR gold/5986
14171 Fix problems building gold with gcc 4.3.0.
14172 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14173 (gold_error_at_location, gold_warning_at_location): Use it.
14174 * configure.ac: Check whether we can compile and use a template
14175 function with a printf attribute.
14176 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14177 when jumping over bytes.
14178 * object.cc: Instantiate Object::read_section_data.
14179 * debug.h: Include <cstring>
14180 * dwarf_reader.cc: Include <algorithm>
14181 * main.cc: Include <cstring>.
14182 * options.cc: Include <cstring>.
14183 * output.cc: Include <cstring>.
14184 * script.cc: Include <cstring>.
14185 * script.h: Include <string>.
14186 * symtab.cc: Include <cstring> and <algorithm>.
14187 * target-select.cc: Include <cstring>.
14188 * version.cc: Include <string>.
14189 * testsuite/testmain.cc: Include <cstdlib>.
14190 * configure, config.in: Rebuild.
14191
14192 2008-03-25 Ian Lance Taylor <iant@google.com>
14193
14194 * options.cc: Include "../bfd/bfdver.h".
14195 (options::help): Print bug reporting address.
14196
14197 * version.cc (print_version): Adjust output for current value of
14198 BFD_VERSION_STRING.
14199
14200 * NEWS: New file.
14201
14202 * options.cc (options::help): Print list of supported targets.
14203 * target-select.h: Include <vector>.
14204 (class Target_selector): Make machine_, size_, and is_big_endian_
14205 fields const. Add bfd_name_ and instantiated_target_ fields.
14206 (Target_selector::Target_selector): Add bfd_name parameter.
14207 (Target_selector::recognize): Make non-virtual, call
14208 do_recognize.
14209 (Target_selector::recognize_by_name): Make non-virtual, call
14210 do_recognize_by_name.
14211 (Target_selector::supported_names): New function.
14212 (Target_selector::bfd_name): New function.
14213 (Target_selector::do_instantiate_target): New pure virtual
14214 function.
14215 (Target_selector::do_recognize): New virtual function.
14216 (Target_selector::do_recognize_by_name): New virtual function.
14217 (Target_selector::instantiate_target): New private function.
14218 (supported_target_names): Declare.
14219 * target-select.cc (Target_selector::Target_selector): Update for
14220 new parameter and fields.
14221 (select_target_by_name): Check that the name matches before
14222 calling recognize_by_name.
14223 (supported_target_names): New function.
14224 * i386.cc (class Target_selector_i386): Update Target_selector
14225 constructor call. Remove recognize and recognize_by_name. Add
14226 do_instantiate_target.
14227 * x86_64.cc (class Target_selector_x86_64): Likewise.
14228 * testsuite/testfile.cc (class Target_selector_test): Update for
14229 changes to Target_selector.
14230
14231 * README: Rewrite, with some notes on unsupported features.
14232
14233 2008-03-24 Cary Coutant <ccoutant@google.com>
14234
14235 * i386.cc (Target_i386::Got_type): New enum declaration.
14236 (Target_i386::Scan::local): Updated callers of Output_data_got
14237 member functions.
14238 (Target_i386::Scan::global): Likewise.
14239 (Target_i386::Relocate::relocate): Likewise.
14240 (Target_i386::Relocate::relocate_tls): Likewise.
14241 * object.h (Got_offset_list): New class.
14242 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14243 (Sized_relobj::local_got_offset): Likewise.
14244 (Sized_relobj::set_local_got_offset): Likewise.
14245 (Sized_relobj::local_has_tls_got_offset): Removed.
14246 (Sized_relobj::local_tls_got_offset): Removed.
14247 (Sized_relobj::set_local_tls_got_offset): Removed.
14248 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14249 * output.cc (Output_data_got::add_global): Added got_type parameter.
14250 (Output_data_got::add_global_with_rel): Likewise.
14251 (Output_data_got::add_global_with_rela): Likewise.
14252 (Output_data_got::add_global_pair_with_rel): New function.
14253 (Output_data_got::add_global_pair_with_rela): New function.
14254 (Output_data_got::add_local): Added got_type parameter.
14255 (Output_data_got::add_local_with_rel): Likewise.
14256 (Output_data_got::add_local_with_rela): Likewise.
14257 (Output_data_got::add_local_pair_with_rel): New function.
14258 (Output_data_got::add_local_pair_with_rela): New function.
14259 (Output_data_got::add_global_tls): Removed.
14260 (Output_data_got::add_global_tls_with_rel): Removed.
14261 (Output_data_got::add_global_tls_with_rela): Removed.
14262 (Output_data_got::add_local_tls): Removed.
14263 (Output_data_got::add_local_tls_with_rel): Removed.
14264 (Output_data_got::add_local_tls_with_rela): Removed.
14265 * output.h (Output_data_got::add_global): Added got_type parameter.
14266 (Output_data_got::add_global_with_rel): Likewise.
14267 (Output_data_got::add_global_with_rela): Likewise.
14268 (Output_data_got::add_global_pair_with_rel): New function.
14269 (Output_data_got::add_global_pair_with_rela): New function.
14270 (Output_data_got::add_local): Added got_type parameter.
14271 (Output_data_got::add_local_with_rel): Likewise.
14272 (Output_data_got::add_local_with_rela): Likewise.
14273 (Output_data_got::add_local_pair_with_rel): New function.
14274 (Output_data_got::add_local_pair_with_rela): New function.
14275 (Output_data_got::add_global_tls): Removed.
14276 (Output_data_got::add_global_tls_with_rel): Removed.
14277 (Output_data_got::add_global_tls_with_rela): Removed.
14278 (Output_data_got::add_local_tls): Removed.
14279 (Output_data_got::add_local_tls_with_rel): Removed.
14280 (Output_data_got::add_local_tls_with_rela): Removed.
14281 * resolve.cc (Symbol::override_base_with_special): Removed
14282 reference to has_got_offset_ field.
14283 * symtab.cc (Symbol::init_fields): Replaced initialization
14284 of got_offset_ with got_offsets_. Removed initialization
14285 of has_got_offset_
14286 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
14287 (Symbol::got_offset): Likewise.
14288 (Symbol::set_got_offset): Likewise.
14289 (Symbol::has_tls_got_offset): Removed.
14290 (Symbol::tls_got_offset): Removed.
14291 (Symbol::set_tls_got_offset): Removed.
14292 (Symbol::got_offset_): Removed.
14293 (Symbol::tls_mod_got_offset_): Removed.
14294 (Symbol::tls_pair_got_offset_): Removed.
14295 (Symbol::got_offsets_): New field.
14296 (Symbol::has_got_offset): Removed.
14297 (Symbol::has_tls_mod_got_offset): Removed.
14298 (Symbol::has_tls_pair_got_offset): Removed.
14299 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14300 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14301 member functions.
14302 (Target_x86_64::Scan::global): Likewise.
14303 (Target_x86_64::Relocate::relocate): Likewise.
14304 (Target_x86_64::Relocate::relocate_tls): Likewise.
14305
14306 2008-03-25 Ben Elliston <bje@au.ibm.com>
14307
14308 * yyscript.y: Fix spelling error in comment.
14309
14310 2008-03-24 Ian Lance Taylor <iant@google.com>
14311
14312 * options.h (class General_options): Define build_id option.
14313 * layout.h (class Layout): Declare write_build_id, create_note,
14314 create_build_id. Add build_id_note_ member.
14315 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14316 "libiberty.h", "md5.h", "sha1.h".
14317 (Layout::Layout): Initialize eh_frame_data_,
14318 eh_frame_hdr_section_, and build_id_note_.
14319 (Layout::finalize): Call create_build_id.
14320 (Layout::create_note): New function, broken out of
14321 Layout::create_gold_note.
14322 (Layout::create_gold_note): Call create_note.
14323 (Layout::create_build_id): New function.
14324 (Layout::write_build_id): New function.
14325 (Close_task_runner::run): Call write_build_id.
14326
14327 * x86_64.cc: Correct license to GPLv3.
14328
14329 2008-03-23 Ian Lance Taylor <iant@google.com>
14330
14331 * options.cc: Include "demangle.h".
14332 (parse_optional_string): New function.
14333 (parse_long_option): Handle takes_optional_argument.
14334 (parse_short_option): Update dash_z initializer. Handle
14335 takes_optional_argument.
14336 (General_options::General_options): Initialize do_demangle_.
14337 (General_options::finalize): Set do_demangle_. Handle demangling
14338 style.
14339 * options.h (parse_optional_string): Declare.
14340 (struct One_option): Add optional_arg field. Update constructor.
14341 Update call constructor calls. Add takes_optional_argument
14342 function.
14343 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14344 (DEFINE_optional_string): Define.
14345 (General_options::demangle): Change from DEFINE_bool to
14346 DEFINE_optional_string.
14347 (General_options::no_demangle): New function.
14348 (General_options::do_demangle): New function.
14349 (General_options::set_do_demangle): New function.
14350 (General_options::execstack_status_): Move definition to end of
14351 class definition.
14352 (General_options::static_): Likewise.
14353 (General_options::do_demangle_): New field.
14354 * object.cc (big_endian>::get_symbol_location_info): Call
14355 Options::do_demangle, not Options::demangle.
14356 * symtab.cc (demangle): Likewise.
14357
14358 2008-03-22 Ian Lance Taylor <iant@google.com>
14359
14360 * gold.h: Include <cstddef> and <sys/types.h>
14361 * options.h: Include <cstring>.
14362
14363 2008-03-21 Ian Lance Taylor <iant@google.com>
14364
14365 * Added source code to GNU binutils.
14366 \f
14367 Copyright (C) 2008-2012 Free Software Foundation, Inc.
14368
14369 Copying and distribution of this file, with or without modification,
14370 are permitted in any medium without royalty provided the copyright
14371 notice and this notice are preserved.
14372
14373 Local Variables:
14374 mode: change-log
14375 left-margin: 8
14376 fill-column: 74
14377 version-control: never
14378 End: