*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
7c381248
ST
12013-01-16 Sriraman Tallam <tmsriram@google.com>
2
3 * layout.cc (Layout::layout): Do not do default sorting for
4 text sections when section ordering is specified.
5 (make_output_section): Ditto.
6 * testsuite/plugin_final_layout.cc: Name the function sections
7 to catch reordering issues.
8
e2458743
AM
92013-01-15 Alan Modra <amodra@gmail.com>
10
11 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
12 plt-thread-safe.
13
431ed302
AM
142013-01-15 Alan Modra <amodra@gmail.com>
15
16 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
17 * testsuite/Makefile.in: Regenerate.
18
0ec6429b
AM
192013-01-14 Alan Modra <amodra@gmail.com>
20
21 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
22 * testsuite/Makefile.in: Regenerate.
23
0bf402d5
ILT
242013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
25
26 Fix mingw gold build with plugins enabled
27 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
28 * configure.ac: Export DLOPEN_LIBS and add headers check.
29 * plugin.cc: Handle non-dlfcn case.
30 * Makefile.in: Regenerate.
31 * config.in: Regenerate.
32 * configure: Regenerate.
33 * testsuite/Makefile.in: Regenerate.
34
9e9143bc
ST
352013-01-09 Sriraman Tallam <tmsriram@google.com>
36
37 * output.h (sort_attached_input_sections): Change to be public.
38 * script-sections.cc
39 (Output_section_definition::set_section_addresses): Sort
40 attached input sections according to section order before linker
41 script assigns section addresses.
42 (Orphan_output_section::set_section_addresses): Sort
43 attached input sections according to section order before linker
44 script assigns section addresses.
45 * Makefile.am (final_layout.sh): Use a simple linker script to
46 check if section ordering still works.
47 * Makefile.in: Regenerate.
48
679af368
ILT
492013-01-09 Ben Cheng <bccheng@google.com>
50
51 * arm.cc (Target_arm::attributes_accept_div): New function.
52 (Target_arm::attributes_forbid_div): New function.
53 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
54 attribute using the same new functions as what bfd/elf32_arm.c
55 does.
56
3136a00e
CC
572013-01-07 Cary Coutant <ccoutant@google.com>
58
59 PR gold/14993
60 * output.cc (Output_section::add_input_section): For incremental
61 updates, don't track input sections that are allocated from patch
62 space.
63
f2a6224b
L
642013-01-07 H.J. Lu <hongjiu.lu@intel.com>
65 Ian Lance Taylor <iant@google.com>
66
67 PR gold/14897
68 * configure.ac (--enable-ld): Removed.
69 (install_as_default): Set to yes only for --enable-gold=default
70 or --disable-ld.
71 * configure: Regenerated.
72
4f46f626
L
732013-01-07 H.J. Lu <hongjiu.lu@intel.com>
74
75 * options.h (General_options): Add -fuse-ld= for GCC linker
76 option compatibility.
77
26e4ef59
CC
782013-01-04 Cary Coutant <ccoutant@google.com>
79
80 * configure.ac: Fix typo restoring CXXFLAGS.
81 * configure: Regenerate.
82
3d587466
CC
832013-01-04 Cary Coutant <ccoutant@google.com>
84
4f46f626
L
85 * testsuite/Makefile.am (CXXLINK_S): New macro.
86 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
87 * testsuite/Makefile.in: Regenerate.
3d587466 88
44db6695
L
892013-01-02 H.J. Lu <hongjiu.lu@intel.com>
90
91 * version.cc (print_version): Update copyright year to 2013.
92
edcac0c1
ILT
932012-12-20 Ian Lance Taylor <iant@google.com>
94
95 * layout.cc (Layout::special_ordering_of_input_section): New
96 function.
97 (Layout::layout): If input section requires special ordering, must
98 sort input sections.
99 (Layout::make_output_section): May sort .text input sections.
100 (Layout::is_section_name_prefix_grouped): Remove.
101 * layout.h (class Layout): Declare
102 special_ordering_of_input_section. Don't declare
103 is_section_name_prefix_grouped.
104 * output.cc (Output_section::add_input_section): Revert last
105 change.
106 (Output_section::Input_section_sort::match_file_name): Don't crash
107 if called on output section data.
108 (Output_section::Input_section_sort_compare): Sort based on
109 special ordering.
110 (Output_section::Input_section_sort_section_order_index_compare):
111 Revert last patch.
112 (Output_section::sort_attached_input_sections): Likewise.
113
28f2a4ac
ST
1142012-12-18 Sriraman Tallam <tmsriram@google.com>
115
edcac0c1 116 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
117 * layout.h (Layout::is_section_name_prefix_grouped): New function.
118 * output.cc (Output_section::add_input_section): Check if section
119 name contains special prefix. Keep input sections to sort such
120 sections.
121 (Output_section::Input_section_sort_section_order_index_compare
122 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
123 (Output_section::sort_attached_input_sections): Add condition to
124 Input_section_entry constructor call.
28f2a4ac
ST
125 * testsuite/Makefile.am (text_section_grouping): New test.
126 * testsuite/Makefile.in: Regenerate.
127 * testsuite/text_section_grouping.cc: New file.
128 * testsuite/text_section_grouping.sh: New file.
129
5bf135a7
NC
1302012-12-17 Nick Clifton <nickc@redhat.com>
131
132 * Makefile.am: Add copyright notice.
133 * NEWS: Likewise.
134 * README: Likewise.
135 * configure.ac: Likewise.
136 * ftruncate.c: Likewise.
137 * Makefile.in: Regenerate.
138
59965708
CC
1392012-12-14 Cary Coutant <ccoutant@google.com>
140
141 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
142 --no-as-needed flag.
143 (exception_separate_shared_12_test): Likewise.
144 (incremental_copy_test): Likewise.
145 * testsuite/Makefile.in: Regenerate.
146
2a77e2ab
CC
1472012-12-14 Cary Coutant <ccoutant@google.com>
148
149 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
150 (Dwp_output_file::Dwp_index::enter_set): Add assert.
151
e3deeb9c
AM
1522012-12-12 Alan Modra <amodra@gmail.com>
153
154 * powerpc.cc (class Track_tls): New.
155 (class Relocate, class Scan): Inherit Track_tls.
156 (Target_powerpc::Scan::local, global): Track tls optimization
157 and avoid creating plt entry for __tls_get_addr if all uses
158 are optimized away.
159 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
160
d8f5a274
AM
1612012-12-12 Alan Modra <amodra@gmail.com>
162
163 * options.h (General_options): Add --toc-sort/--no-toc-sort.
164 Replace no_toc_optimize with toc_optimize.
165 * output.h (Output_section::input_sections): Provide non-const variant.
166 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
167 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
168 accessors.
169 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
170 (class Sort_toc_sections): New.
171 (Target_powerpc::do_finalize_sections): Sort toc sections.
172 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
173
4c8a1de1
RM
1742012-12-10 Roland McGrath <mcgrathr@google.com>
175
176 * testsuite/binary_unittest.cc (read_all): New function.
177 (Sized_binary_test): Use it instead of ::read.
178 * fileread.cc (do_read): Don't assume pread always reads the whole
179 amount in a single call.
180
edc27beb
AM
1812012-12-10 Alan Modra <amodra@gmail.com>
182
183 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
184 Set EM_PPC64 or EM_PPC here.
185 (Target_selector_powerpc::do_recognize): Delete.
186
906b9150
AM
1872012-12-10 Alan Modra <amodra@gmail.com>
188
189 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
190 stub_table_.
191 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
192
418c15ae
RM
1932012-12-07 Roland McGrath <mcgrathr@google.com>
194
195 * testsuite/binary_unittest.cc (Sized_binary_test):
196 Use open_descriptor rather than ::open.
197
decdd3bc
AM
1982012-12-07 Alan Modra <amodra@gmail.com>
199
200 * powerpc.cc (Stub_table::do_write): Delete redundant Address
201 typedef and invalid_address constant.
202 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
203 instantiate constants.
204
db399005
ILT
2052012-12-06 Roland McGrath <mcgrathr@google.com>
206
207 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
208 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
209 * aclocal.m4: Regenerate.
210 * configure: Regenerate.
211 * Makefile.in: Regenerate.
212 * testsuite/Makefile.in: Regenerate.
213
aba6bc71
AM
2142012-12-07 Alan Modra <amodra@gmail.com>
215
216 * options.h (General_options): Add no_toc_optimize.
217 * powerpc.cc (ok_lo_toc_insn): New function.
218 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
219
9e69ed50
AM
2202012-12-06 Alan Modra <amodra@gmail.com>
221
222 * options.h (General_options): Add plt_align, plt_static_chain,
223 plt_thread_safe. Update stub_group_size help text.
224 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
225 for new plt_thread_safe_ var.
226 (use_plt_offset): Correct comments.
227 (Target_powerpc::do_relax): Look for thread creation symbols to
228 determine default plt_thread_safe value. Clear plt call stubs
229 as well as branch stubs each iteration.
230 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
231 insn constants.
232 (l, hi, ha, write_insn): Move earlier.
233 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
234 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
235 plt stubs too.
236 (Stub_table::update_size): Adjust.
237 (Stub_table::prev_size, set_prev_size): Delete.
238 (Stub_table::stub_align): Let --plt-align affect result.
239 (Stub_table::plt_call_size): Calculate sizes for various stubs.
240 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
241 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
242 (Stub_table::do_write): Support more stub variants.
243
f43ba157
AM
2442012-12-04 Alan Modra <amodra@gmail.com>
245
246 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
247 (Target_powerpc::do_define_standard_symbols): New function.
248
34171bc5
AM
2492012-12-03 Alan Modra <amodra@gmail.com>
250
251 * output.h: Formatting, whitespace.
252
dc9589e9 2532012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
254
255 * layout.h (Layout::get_executable_sections): Declare.
256 * layout.cc (Layout::get_executable_sections): New function.
257 * arm.cc (Target_arm::group_sections): Use it.
258 (Arm_output_section::group_sections): Delete now redundant test.
259 * output.cc (Output_reloc::Output_reloc): Add is_relative.
260 param to handle relative relocs.
261 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
262 (Output_data_reloc::add_absolute): Adjust.
263 (Output_data_reloc::add_relative): New function.
264 (Output_data::reset_data_size): New function.
265 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
266 (Output_section::set_addralign): New function.
267 (Output_section::checkpoint_set_addralign): New function.
268 (Output_section::clear_section_offsets_need_adjustment): New function.
269 (Output_section::input_sections): Make public.
270 * powerpc.cc (class Output_data_brlt_powerpc): New.
271 (class Stub_table, class Stub_control): New.
272 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
273 stub_table_, set_stub_table, stub_table): New vectors and accessor
274 functions.
275 (Target_powerpc::do_may_relax, do_relax, push_branch,
276 new_stub_table, stub_tables, brlt_section, group_sections,
277 add_branch_lookup_table, find_branch_lookup_table,
278 write_branch_lookup_table, make_brlt_section): New functions.
279 (Target_powerpc::struct Sort_sections, class Branch_info): New.
280 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
281 branch_info_): New vars.
282 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
283 make call stubs here.
284 (Output_data_glink): Remove all call stub handling from this class.
285 (Target_powerpc::Scan::local, global): Save interesting branch
286 relocs and relocs for ifunc. Adjust calls to plt entry functions.
287 (Target_powerpc::do_finalize_sections): Only make reg save/restore
288 functions on final link.
289 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
290 Handle long branch destinations too.
291 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
292 do_plt_address_for_local): Adjust lookup of plt call stubs.
293
627b30b7
AM
2942012-11-30 Alan Modra <amodra@gmail.com>
295
296 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
297 relocs against protected symbols when building 32-bit shared libs.
298
40b469d7
AM
2992012-11-30 Alan Modra <amodra@gmail.com>
300
301 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
302 param. Call got_section() to make .got. Update all callers
303 and their callers and so on.
304
bb66a627
AM
3052012-11-30 Alan Modra <amodra@gmail.com>
306
307 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
308 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
309 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
310 value if it already exists.
311
d2cf1c6c
L
3122012-11-19 H.J. Lu <hongjiu.lu@intel.com>
313
314 PR gold/14858
315 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
316
edccdf7c
RM
3172012-11-14 Roland McGrath <mcgrathr@google.com>
318
319 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
320 than bfc instruction for data sandboxing.
321
6febeb74
AM
3222012-11-08 Alan Modra <amodra@gmail.com>
323
324 * po/POTFILES.in: Regenerate.
325
0a6f1bf2
AM
3262012-11-05 Alan Modra <amodra@gmail.com>
327
328 * configure.ac: Apply 2012-09-10 change to config.in here.
329 * configure: Regenerate.
330
26a4e9cb
AM
3312012-11-05 Alan Modra <amodra@gmail.com>
332
333 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
334 (struct Opd_ent): Use "Address" rather than "Offset".
335 (Output_data_got_powerpc::got_base_offset): Return Valtype.
336 (Target_powerpc::got_section): Make public.
337 (Target_powerpc::scan_relocs): Move code setting symbols..
338 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
339 Create _SDA_BASE_ only when referenced.
340
cc928013
RM
3412012-11-02 Roland McGrath <mcgrathr@google.com>
342
343 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
344 from last change.
345
50ed5eb1
RM
3462012-11-01 Roland McGrath <mcgrathr@google.com>
347
62fe925a
RM
348 * target.h (Sized_target::relocate_relocs): Use Elf_Off
349 for offset_in_output_section parameter.
350 (Sized_target::relocate_special_relocatable): Likewise.
351 * arm.cc (Target_arm::relocate_relocs): Likewise.
352 (Target_arm::relocate_special_relocatable): Likewise.
353 * i386.cc (Target_i386::relocate_relocs): Likewise.
354 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
355 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
356 * target-reloc.h (relocate_relocs): Likewise.
357 * testsuite/testfile.cc (Target_test): Likewise.
358 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
359 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
360
361 * system.h: Move inclusion of <clocale> to after <libintl.h> in
362 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
363
364 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
365 parameter, which is unused in the [!F_SETFD] case.
366
50ed5eb1
RM
367 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
368 SYMNDX to off_t before comparing it to this->data_size().
369 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
370 * incremental.cc (Output_section_incremental_inputs::do_write):
371 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
372
2cadc0bf
RM
373 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
374
3bfcb652
NC
3752012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
376
377 * gold.cc (Target_arm::do_adjust_elf_header): Add the
378 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
379 in EABI_VER5.
380
c1a8d56e
CC
3812012-10-29 Cary Coutant <ccoutant@google.com>
382
383 * dwp.cc (usage): Add file and exit status parameters;
384 add --help and --version options.
385 (print_version): New function.
386 (main): Add --help and --version options.
387
b2490a7b
L
3882012-10-25 H.J. Lu <hongjiu.lu@intel.com>
389
390 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
391 final_layout_sequence.txt.
392 * testsuite/Makefile.in: Regenerated.
393
aa543512
L
3942012-10-25 H.J. Lu <hongjiu.lu@intel.com>
395
396 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
397 COMPILE generated by automake.
398 (LINK1): Likewise.
399 (CXXCOMPILE1): Likewise.
400 (CXXLINK1): Likewise.
401 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
402 (LINK): Likewise.
403 (CXXCOMPILE): Likewise.
404 (CXXLINK): Likewise.
405 * testsuite/Makefile.in: Regenerated.
406
d361fafb
L
4072012-10-25 H.J. Lu <hongjiu.lu@intel.com>
408
409 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
410 on bad fwrite return.
411
598c7410
L
4122012-10-25 H.J. Lu <hongjiu.lu@intel.com>
413
414 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
415 on val.
416
35c813e2
CC
4172012-10-23 Cary Coutant <ccoutant@google.com>
418
419 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
420 * testsuite/Makefile.in: Regenerate.
421 * testsuite/dwp_test.h: New source file.
422 * testsuite/dwp_test_1.cc: New source file.
423 * testsuite/dwp_test_1.s: New source file.
424 * testsuite/dwp_test_1.sh: New source file.
425 * testsuite/dwp_test_1b.cc: New source file.
426 * testsuite/dwp_test_1b.s: New source file.
427 * testsuite/dwp_test_2.cc: New source file.
428 * testsuite/dwp_test_2.s: New source file.
429 * testsuite/dwp_test_2.sh: New source file.
430 * testsuite/dwp_test_main.cc: New source file.
431 * testsuite/dwp_test_main.s: New source file.
432
77429909
CC
4332012-10-23 Cary Coutant <ccoutant@google.com>
434
435 * dwp.h: New header file.
436 * dwp.cc: New source file.
437 * gold.h: Move shared declarations to system.h.
438 * system.h: New header file.
439 * Makefile.am: Add dwp.
440 * Makefile.in: Regenerate.
441
ed5d6712
CC
4422012-10-23 Cary Coutant <ccoutant@google.com>
443
444 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
445 Dwarf_info_reader::read_from_pointer.
446 (Dwarf_pubnames_table::read_header): Likewise.
447 (Dwarf_pubnames_table::next_name): Likewise.
448 (Dwarf_die::read_attributes): Likewise.
449 (Dwarf_die::skip_attributes): Likewise.
450 (Dwarf_info_reader::read_from_pointer): New function template.
451 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
452 (Dwarf_pubnames_table): Likewise.
453 (Dwarf_info_reader::read_from_pointer): New function template.
454 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
455 Dwarf_pubnames_table ctor.
456
8787852d
CC
4572012-10-23 Cary Coutant <ccoutant@google.com>
458
459 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
460 abbrev_shndx.
461 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
462 abbrev_shndx_.
463 (Dwarf_info_reader::set_abbrev_shndx): New method.
464 (Dwarf_info_reader::abbrev_shndx_): New data member.
465
9fc236f3
CC
4662012-10-23 Cary Coutant <ccoutant@google.com>
467
468 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
469 from object, not parameters.
470 (Dwarf_info_reader::parse): Likewise.
471 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
472 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
473 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
474 methods.
475
effe8365
CC
4762012-10-23 Cary Coutant <ccoutant@google.com>
477
478 * fileread.cc (Input_file::Input_file): New constructor.
479 * fileread.h (class Input_file): Add new constructor.
480
1698990d
AM
4812012-10-18 Alan Modra <amodra@gmail.com>
482
483 PR gold/14727
484 * object.cc (Relobj::is_section_name_included): Also match
485 .sdata personality section.
486
168a4726
AM
4872012-10-18 Alan Modra <amodra@gmail.com>
488
489 * target-reloc.h (class Default_comdat_behavior): New, package up..
490 (get_comdat_behaviour): ..this.
491 (relocate_section): Add Relocate_comdat_behavior template arg,
492 adjust code to suit.
493 * arm.cc (Target_arm::relocate_section): Adjust to suit.
494 (Target_arm::scan_reloc_section): Likewise.
495 * i386.cc (Target_i386::relocate_section): Likewise.
496 * sparc.cc (Target_sparc::relocate_section): Likewise.
497 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
498 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
499 * powerpc.cc (class Relocate_comdat_behavior): New.
500 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
501 gold::relocate_section with new template arg.
502
acc276d8
AM
5032012-10-18 Alan Modra <amodra@gmail.com>
504
505 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
506 dynamic relocs for GOT_TPREL got entries, without symbol if
507 resolving locally.
508 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
509 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
510 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
511
e10f9870
AM
5122012-10-17 Alan Modra <amodra@gmail.com>
513
514 PR gold/14726
515 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
516
ae034989
ST
5172012-10-16 Sriraman Tallam <tmsriram@google.com>
518
519 * layout.cc (Layout::include_section): Keep sections marked
520 SHF_EXCLUDE when doing relocatable links.
521
f3a0ed29
AM
5222012-10-16 Alan Modra <amodra@gmail.com>
523
524 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
525 (Target_powerpc::do_finalize_sections): Call it.
526 (Output_data_save_res): New class and supporting functions.
527 (Target_powerpc::symval_for_branch): Only look up .opd entry for
528 normal symbols defined in object files.
529
c6de8ed4
AM
5302012-10-12 Alan Modra <amodra@gmail.com>
531
532 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
533 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
534 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
535 section if scan_opd_relocs not yet called.
536 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
537
03e25981
AM
5382012-10-12 Alan Modra <amodra@gmail.com>
539
540 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
541 add_local_ifunc_entry): Revert last change.
542 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
543
c9824451
AM
5442012-10-05 Alan Modra <amodra@gmail.com>
545
546 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
547 do_plt_address_for_global): New functions.
548 (Output_data_got_powerpc::do_write): Don't segfault when linking
549 statically.
550 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
551 add_local_ifunc_entry): Return true on adding entry..
552 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
553 glink->add_entry call. Remove unused symtab param. Adjust calls.
554 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
555 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
556 set up symbols here.
557 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
558 syms here. Do so even when no .iplt. Don't segfault when linking
559 statically.
560 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
561 new variants without reloc param.
562 (Glink_sym_ent::Glink_sym_ent): Likewise.
563 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
564 reloc when refs will resolve to plt call stub.
565 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
566 R_PPC_PLTREL24 to resolve locally.
567 (Target_powerpc::Scan::global): Correct ifunc handling.
568 (Target_powerpc::Relocate::relocate): Correct local sym glink
569 lookup. Don't destroy "value" when we have a plt call stub,
570 and when checking plt call validity.
571 (Target_powerpc::do_dynsym_value): Simplify.
572
19fec8c1
AM
5732012-10-05 Alan Modra <amodra@gmail.com>
574
575 * i386.cc (Output_data_plt_i386::address_for_global,
576 address_for_local): Add plt offset to returned value. Adjust uses.
577 * sparc.cc (Output_data_plt_sparc::address_for_global,
578 address_for_local): Likewise.
579 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
580 address_for_local): Likewise.
581 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
582 address_for_local): Likewise.
583 * target.h (Target::plt_address_for_global, plt_address_for_local):
584 Update comment.
585 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
586 (Output_data_got::Got_entry::write): Nor here.
587 * output.h: Comment fix.
588
e867b647
WL
5892012-10-02 Jiong Wang <jiwang@tilera.com>
590
591 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
592 global_offset_table_ value for larget got.
593 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
594
e5d5f5ed
AM
5952012-09-29 Alan Modra <amodra@gmail.com>
596
597 * powerpc.cc (Target_powerpc::iplt_): New output section.
598 (Target_powerpc::iplt_section, make_iplt_section,
599 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
600 (Target_powerpc::make_plt_entry): Handle ifunc syms.
601 Target_powerpc::plt_entry_count): Count iplt entries too.
602 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
603 reloc section in constructor. New params.
604 (Target_powerpc::make_plt_section): Create reloc section here instead.
605 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
606 functions.
607 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
608 (Output_data_glink::add_entry, find_entry): New functions to
609 deal with local syms.
610 (Glink_sym_ent): Add support for local syms.
611 (Output_data_glink::do_write): Handle ifunc plt entries.
612 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
613 (Target_powerpc::Scan::local, global): Handle ifunc syms.
614 (Target_powerpc::Relocate::relocate): Likewise.
615 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
616
ec4dbad3
AM
6172012-09-25 Alan Modra <amodra@gmail.com>
618
619 * object.h (Sized_relobj_file::adjust_local_symbol,
620 do_adjust_local_symbol): New functions.
621 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
622 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
623 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
624 and irregular opd entry spacing.
625 (Powerpc_relobj::do_read_relocs): Add opd size checks.
626 (Global_symbol_visitor_opd): New functor.
627 (Target_powerpc::do_finalize_sections): Omit global symbols defined
628 on deleted opd entries.
629
5c0b3823
WL
6302012-09-15 Jiong Wang <jiwang@tilera.com>
631
632 * tilegx.cc: New file.
633 * Makefile.am (TARGETSOURCES): Add tilegx.cc
634 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
635 * configure.tgt: Add entries for tilegx*.
636 * configure.ac: Likewise.
637 * Makefile.in: Rebuild.
638 * configure: Likewise.
639 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
640 tilegx.
641
bfdfa4cd
AM
6422012-09-13 Alan Modra <amodra@gmail.com>
643
644 * target-reloc.h (scan_relocs): Call scan.local for relocs
645 against symbols in discarded sections. Pass is_discarded
646 param.
647 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
648 Add is_discarded param.
649 * powerpc (Target_powerpc::Scan::local): Likewise. Use
650 is_discarded to flag opd entry as discarded. Don't emit dyn
651 relocs on such entries.
652 (Target_powerpc::Scan::global): Similarly detect and handle
653 such opd entries.
654 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
655 opd_ent_. Update all uses.
656 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
657 (Target_powerpc::relocate_section): Zero out discarded opd
658 entry relocs.
659
d77a0555
ILT
6602012-09-12 Ian Lance Taylor <iant@google.com>
661
662 PR gold/14570
663 * output.cc: Rename Output_data_got template parameter from size
664 to got_size for all functions. Compile all variants of
665 Output_data_got.
666 (Output_data_got::Got_entry::write): Correct use of size for
667 symbol value. Use local_is_tls rather than casting to
668 Sized_relobj_file.
669 * object.h (class Object): Add local_is_tls and do_local_is_tls.
670 (class Sized_relobj_file): Add do_local_is_tls.
671 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
672
815a1205
AM
6732012-09-11 Alan Modra <amodra@gmail.com>
674
675 PR gold/14566
676 * layout.cc (Layout::set_segment_offsets): When using
677 common-page-size alignment, ensure we are on a new max-page-size
678 page.
679 * output.cc (Output_segment::set_section_addresses): Use
680 abi_pagesize, not common_pagesize for relro boundary.
681 (Output_segment::set_offset): Likewise.
682
bd73a62d
AM
6832012-09-11 Alan Modra <amodra@gmail.com>
684
685 * output.h (Output_data_got::add_global_tls, add_local_tls,
686 add_local_tls_pair): New functions.
687 (Output_data_got::add_local_pair_with_rel): Remove second
688 reloc param. Expand comment.
689 (Output_data_got::Got_entry): Rename use_plt_offset_ to
690 use_plt_or_tls_offset_, similarly for constructor param.
691 (Output_data_got::Got_entry::write): Add got_index param.
692 * output.cc (Output_data_got::add_global_tls, add_local_tls,
693 add_local_tls_pair): New functions.
694 (Output_data_got::Got_entry::write): Handle tls symbols
695 with use_plt_or_tls_offset_ set specially.
696 (Output_data_got::add_local_pair_with_rel): Only one reloc.
697 (Output_data_got::do_write): Replace iterator with index, pass
698 index to entry write function.
699 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
700 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
701 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
702 call.
703 * i386.cc (Target_i386::Scan::local): Likewise.
704 * sparc.cc (Target_sparc::Scan::local): Likewise.
705 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
706 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
707 do_tls_offset_for_global): New functions.
708 (Target_powerpc::Scan::local): Correct TLS relocations and got
709 entry values.
710 (Target_powerpc::Scan::global): Don't emit unnecessary
711 dynamic relocations on TLS GOT entries.
712
00716ab1
AM
7132012-09-10 Matthias Klose <doko@ubuntu.com>
714
715 * config.in: Disable sanity check for kfreebsd.
716
c891b3f9
SA
7172012-09-10 Sterling Augustine <saugustine@google.com>
718
719 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
720 (Gdb_index::pubtypes_read): New parameter.
721 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
722 to calls.
723 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
724 pubtypes_object_.
725
e81fea4d
AM
7262012-09-09 Alan Modra <amodra@gmail.com>
727
728 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
729 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
730 * gc.h (gc_process_relocs): Call target gc_add_reference.
731 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
732 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
733 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
734 unnecessary cast.
735 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
736 to cater for when we don't need code offset. Update use.
737 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
738 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
739 set_opd_valid): New functions.
740 (Target_powerpc::do_gc_add_reference): New function.
741 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
742 stashed refs.
743 (Target_powerpc::do_gc_mark_symbol): New function.
744
d2d60eef
CC
7452012-09-06 Cary Coutant <ccoutant@google.com>
746
747 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
748 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
749 (Dwarf_die::skip_attributes): Likewise.
750 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
751 * testsuite/gdb_index_test.cc (inline_func_1): New function.
752 (main): Call it.
753 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
754
32ed4573
L
7552012-09-05 H.J. Lu <hongjiu.lu@intel.com>
756
757 * testsuite/script_test_3.t: Add .got.plt output section
758 statement.
759 * testsuite/script_test_4.t: Likewise.
760
f4baf0d4
AM
7612012-09-05 Alan Modra <amodra@gmail.com>
762
763 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
764 update all uses and lose "enum" when using type.
765
864a1b56
AM
7662012-09-05 Alan Modra <amodra@gmail.com>
767
768 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
769 * configure: Regenerate.
770 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
771 (plugin_final_layout.stdout): Likewise.
772 (memory_test): Set page sizes to 0x1000.
773 * testsuite/Makefile.in: Regenerate.
774 * testsuite/discard_locals_test.sh: Add FIXME comment.
775 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
776 * testsuite/pr14265.t: Add .got output section statement.
777 * testsuite/script_test_2.t: Likewise.
778 * testsuite/script_test_3.t: Likewise.
779 * testsuite/script_test_4.t: Likewise.
780 * testsuite/script_test_5.t: Likewise.
781 * testsuite/script_test_6.t: Likewise.
782 * testsuite/script_test_7.t: Likewise.
783 * testsuite/script_test_9.t: Likewise.
784
3ea0a085
AM
7852012-09-05 Alan Modra <amodra@gmail.com>
786
787 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
788 (Powerpc_relocate_functions::Status): New typedef.
789 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
790 (Target_powerpc::Scan::local): Handle REL64.
791 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
792 for REL32 and REL64.
793 (Target_powerpc::symval_for_branch): New function, extracted from..
794 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
795 checks. Report overflow errors.
796
7404fe1b
AM
7972012-09-05 Alan Modra <amodra@gmail.com>
798
799 * object.h (Sized_relobj_file::emit_relocs): Delete.
800 (Sized_relobj_file::emit_relocs_reltype): Delete.
801 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
802 relocate_relocs for --emit-relocs.
803 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
804 * output.h: Update comment.
805 (Output_segment::first_section): New function.
806 (Output_segment::first_section_load_address): Use first_section.
807 * output.cc (Output_segment::first_section): New function extracted..
808 (Output_segment::first_section_load_address): ..from here. Delete.
809 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
810 * target.h (Sized_target::relocate_for_relocatable): Likewise.
811 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
812 adjust call to target.h function.
813 * i386.cc (Target_i386): Likewise.
814 * sparc.cc (Target_sparc): Likewise.
815 * x86_64.cc (Target_x86_64): Likewise.
816 * powerpc.cc (Target_powerpc): Likewise.
817 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
818 first tls section has section symbol for optimised local dynamic
819 output relocs.
820 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
821 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
822 optimised tls code.
823 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
824 Rename to relocate_relocs. Update error message.
825
957564c9
AS
8262012-09-04 Andreas Schwab <schwab@linux-m68k.org>
827
828 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
829 --just-symbols.
830
dd93cd0a
AM
8312012-08-31 Alan Modra <amodra@gmail.com>
832
833 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
834 (Powerpc_relobj::toc_base_offset): New stub function.
835 (Target_powerpc): Add tp_offset, dtp_offset. Rename
836 got_mod_index_offset to tlsld_got_offset. Update all refs.
837 (Target_powerpc::Relocate::enum skip_tls): New.
838 (Target_powerpc::call_tls_get_addr_): New var.
839 (Target_powerpc::is_branch_reloc): Move to file scope.
840 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
841 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
842 New functions.
843 (Target_powerpc::enum Got_type): Delete old values, add new ones.
844 (powerpc_info): Correct common_pagesize for ppc64.
845 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
846 (Powerpc_relocate_functions): Add overflow check enums and functions.
847 Add non-shift version of rela, rela_ua. Delete all rel public
848 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
849 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
850 addr16_ha3, addr14 functions.
851 (Output_data_got_powerpc::add_constant_pair): New function.
852 (Output_data_got_powerpc::got_base_offset): Likewise.
853 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
854 (instruction constants): Sort, add some more.
855 (Output_data_glink::do_write): Add and use Address typedef. Use
856 object->toc_base_offset() stub for 64-bit.
857 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
858 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
859 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
860 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
861 Always treat .opd relocs as against locally defined symbol.
862 Correct condition for RELATIVE relocs.
863 (Target_powerpc::do_finalize_sections): Test for NULL sections.
864 (Target_powerpc::Relocate::relocate): Use plt call stub as value
865 for 32-bit syms with a plt entry. Correct ppc64 toc base
866 calculations. Handle TLS relocs, and more. Add overflow
867 checking and adjust for Powerpc_relocate_functions changes.
868 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
869 Reinstate --emit-relocs code with FIXME.
870
a1373b60
AM
8712012-08-30 Alan Modra <amodra@gmail.com>
872
873 * layout.cc (Layout::set_segment_offsets): Set p_align to
874 abi_pagesize, not common_pagesize.
875 (Layout::relaxation_loop_body): Similarly use abi_pagesize
876 to determine whether file header can go in segment.
877
703d02da
AM
8782012-08-30 Alan Modra <amodra@gmail.com>
879
880 * output.h (Output_reloc::Output_reloc <output section>): Add
881 is_relative param. Adjust calls.
882 (Output_reloc::add_output_section_relative): New functions.
883 * output.cc (Output_reloc::Output_reloc <output section>): Handle
884 is_relative.
885 (Output_reloc::symbol_value): Handle SECTION_CODE.
886
16164a6b
ST
8872012-08-24 Sriraman Tallam <tmsriram@google.com>
888
889 * gold.cc (queue_middle_tasks): Call layout again when unique
890 segments for sections is desired.
891 * layout.cc (Layout::Layout): Initialize new members.
892 (Layout::get_output_section_flags): New function.
893 (Layout::choose_output_section): Call get_output_section_flags.
894 (Layout::layout): Make output section for mapping to a unique segment.
895 (Layout::insert_section_segment_map): New function.
896 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 897 output sections marked so.
16164a6b
ST
898 (Layout::segment_precedes): Check for unique segments when sorting.
899 * layout.h (Layout::Unique_segment_info): New struct.
900 (Layout::Section_segment_map): New typedef.
901 (Layout::insert_section_segment_map): New function.
902 (Layout::get_output_section_flags): New function.
903 (Layout::is_unique_segment_for_sections_specified): New function.
904 (Layout::set_unique_segment_for_sections_specified): New function.
905 (Layout::unique_segment_for_sections_specified_): New member.
906 (Layout::section_segment_map_): New member.
907 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
908 Rename is_gc_pass_one to is_pass_one.
909 Rename is_gc_pass_two to is_pass_two.
910 Rename is_gc_or_icf to is_two_pass.
911 Check for which pass based on whether symbols data is present.
912 Make it two pass when unique segments for sections is desired.
913 * output.cc (Output_section::Output_section): Initialize new
914 members.
915 * output.h (Output_section::is_unique_segment): New function.
916 (Output_section::set_is_unique_segment): New function.
917 (Output_section::is_unique_segment_): New member.
918 (Output_section::extra_segment_flags): New function.
919 (Output_section::set_extra_segment_flags): New function.
920 (Output_section::extra_segment_flags_): New member.
921 (Output_section::segment_alignment): New function.
922 (Output_section::set_segment_alignment): New function.
923 (Output_section::segment_alignment_): New member.
924 (Output_segment::Output_segment): Initialize is_unique_segment_.
925 (Output_segment::is_unique_segment): New function.
926 (Output_segment::set_is_unique_segment): New function.
927 (Output_segment::is_unique_segment_): New member.
928 * plugin.cc (allow_unique_segment_for_sections): New function.
929 (unique_segment_for_sections): New function.
930 (Plugin::load): Add new functions to transfer vector.
931 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
932 * Makefile.in: Regenerate.
933 * testsuite/plugin_final_layout.sh: Check if unique segment
934 functionality works.
935 * testsuite/plugin_section_order.c (onload): Check if new interfaces
936 are available.
937 (allow_unique_segment_for_sections): New global.
938 (unique_segment_for_sections): New global.
939 (claim_file_hook): Call allow_unique_segment_for_sections.
940 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 941
1e2bee4f
CC
9422012-08-22 Cary Coutant <ccoutant@google.com>
943
944 * layout.cc (Layout::include_section): Don't assert on GROUP
945 sections with --emit-relocs.
946
1d5dfe78
CC
9472012-08-21 Cary Coutant <ccoutant@google.com>
948
949 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
950 if --export-dynamic-symbol names an undef symbol.
951
c9269dff
AM
9522012-08-18 Alan Modra <amodra@gmail.com>
953
954 * powerpc.cc: Formatting and white space.
955 (Powerpc_relobj): Rename got2_section_ to special_.
956 Add opd_ent_shndx_ and opd_ent_off_ vectors.
957 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
958 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
959 (Target_powerpc): Add Address typedef and invalid_address. Use
960 throughout.
961 (Target_powerpc::is_branch_reloc): New function.
962 (Powerpc_relocate_functions): Add Address typedef, use throughout.
963 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
964 for dst_mask, value and addend.
965 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
966 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
967 (Output_data_glink::do_write): Correct toc base. Don't try to use
968 uint16_t for 24-bit offset. Use get_output_section_offset and
969 check return.
970 (Target_powerpc::Scan::local): Handle more relocs.
971 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
972 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
973 Plug in toc restoring insn after plt calls. Translate branches
974 to function descriptor symbols to corresponding entry point.
975 (Target_powerpc::relocate_for_relocatable): Check return from
976 get_output_section_offset.
977 * symtab.h: Comment typo.
978
b1759dce
ILT
9792012-08-14 Ian Lance Taylor <iant@google.com>
980
981 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
982 unsupported_relocal_local to call unsupported_reloc_global.
983
b9b2ae8b
NC
9842012-08-14 Nick Clifton <nickc@redhat.com>
985
986 PR ld/14265
987 * script-sections.cc (Sections_element::output_section_name): Add
988 keep return parameter.
989 (Output_section_element::match_name): Add keep return parameter.
990 Return the value of the keep_ member.
991 * script-sections.h (class Output_section): Update
992 output_section_name prototype.
993 * layout.cc (Layout::keep_input_section): New public member
994 function.
995 (Layout::choose_output_section): Pass keep parameter to
996 output_section_name.
997 * layout.h (class Layout): Add keep_input_section.
998 * object.cc (Sized_relobj_file::do_layout): Check for kept input
999 sections.
1000 * testsuite/Makefile.am: Add a test.
1001 * testsuite/Makefile.in: Regenerate.
1002 * testsuite/pr14265.c: Source file for the test.
1003 * testsuite/pr14265.t: Linker script for the test.
1004 * testsuite/pr14265.sh: Shell script for the test.
1005
921b5322
AM
10062012-08-14 Alan Modra <amodra@gmail.com>
1007
1008 * target.h (Target::output_section_name): New function.
1009 (Target::do_output_section_name): New function.
1010 * layout.cc (Layout::choose_output_section): Call the above.
1011 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1012
6ce78956
AM
10132012-08-14 Alan Modra <amodra@gmail.com>
1014
1015 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1016 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1017 for replace_constant call.
1018 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1019 (Output_data_glink::do_print_to_mapfile): New function.
1020 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1021 (Target_powerpc::Relocate::relocate): Likewise.
1022
d1a8cabd
AM
10232012-08-14 Alan Modra <amodra@gmail.com>
1024
1025 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1026 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1027 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1028 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1029 all references to shndx_. Handle special case for R_PPC_PLTREL24
1030 here.
1031 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1032 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1033 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1034 here.
1035 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1036 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1037
d83ce4e3
AM
10382012-08-12 Alan Modra <amodra@gmail.com>
1039
1040 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1041 (glink insn constants): Use uint32_t.
1042 (Output_data_glink::add_entry): Use insert, not [] operator.
1043
cf43a2fe
AM
10442012-08-11 Alan Modra <amodra@gmail.com>
1045
1046 * object.h (Sized_relobj_file::find_shdr): New function.
1047 (Sized_relobj_file::find_special_sections): New function.
1048 * object.cc (Sized_relobj_file::find_shdr): New function.
1049 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1050 (Sized_relobj_file::find_special_sections): New function, split out..
1051 (Sized_relobj_file::do_read_symbols): ..from here.
1052 * output.h (Output_data_got::replace_constant): New function.
1053 (Output_data_got::num_entries): New function.
1054 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1055 (Output_data_got::got_offset): Protected rather than private.
1056 (Output_data_got::replace_got_entry): New function.
1057 * output.cc (Output_data_got::replace_got_entry): New function.
1058 * powerpc.cc (class Powerpc_relobj): New.
1059 (class Powerpc_relocate_functions): Delete all psymval variants or
1060 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1061 Implement _ha functions using corresponding _hi function.
1062 (Powerpc_relobj::find_special_sections): New function.
1063 (Target_powerpc::do_make_elf_object): New function.
1064 (class Output_data_got_powerpc): New.
1065 (class Output_data_glink): New.
1066 (class Powerpc_scan_relocatable_reloc): New.
1067 Many more changes througout file.
1068
3c892704
NC
10692012-08-09 Nick Clifton <nickc@redhat.com>
1070
1071 * po/vi.po: Updated Vietnamese translation.
1072
82435b3b
ILT
10732012-08-07 Ian Lance Taylor <iant@google.com>
1074
1075 * layout.cc (Layout::add_target_dynamic_tags): If
1076 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1077 plt_rel.
1078
a6dc81d2
NC
10792012-07-30 Nick Clifton <nickc@redhat.com>
1080
1081 * po/gold.pot: Updated template.
1082 * po/es.po: Updated Spanish translation.
1083
f1415016
CC
10842012-07-18 Cary Coutant <ccoutant@google.com>
1085
1086 PR gold/14344
1087 * configure.ac: Add check for -gpubnames support.
1088 * configure: Regenerate.
1089 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1090 support; force -gno-pubnames.
1091 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1092 support.
1093 (gdb_index_test_4): New test.
1094 * testsuite/Makefile.in: Regenerate.
1095 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1096 * testsuite/gdb_index_test_2.sh: Likewise.
1097 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1098 * testsuite/gdb_index_test_4.sh: New script.
1099 * testsuite/gdb_index_test_comm.sh: New script with common code;
1100 don't look for space after colon.
1101
b7fd7c37
ST
11022012-07-16 Sriraman Tallam <tmsriram@google.com>
1103
1104 * gold.cc (queue_middle_tasks): Update function order only after
1105 deferred objects due to plugins are processed.
1106
1f3212db
ILT
11072012-07-11 Ian Lance Taylor <iant@google.com>
1108
1109 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1110 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1111 (Target_arm::scan_reloc_for_stub): Likewise.
1112 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1113 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1114 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1115 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1116 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1117
81c82a68
ILT
11182012-07-10 Dodji Seketeli <dodji@redhat.com>
1119 Ian Lance Taylor <iant@google.com>
1120
1121 PR gold/14309
1122 * configure.ac: Test whether std::tr1::hash<off_t> works.
1123 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1124 needed.
1125 * output.h (class Output_fill): Add virtual destructor.
1126 * configure, config.in: Rebuild.
1127
eabc84f4
RM
11282012-06-22 Roland McGrath <mcgrathr@google.com>
1129
1130 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1131
370e30b6
RÁE
11322012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1133
1134 * plugin.cc (Plugin::load): Handle position independent executables.
1135
fb1b895d
CC
11362012-06-06 Cary Coutant <ccoutant@google.com>
1137
1138 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1139 add .debug_macro.
1140 (lines_only_debug_sections): Likewise.
1141 (gdb_fast_lookup_sections): New static array.
1142 (is_gdb_debug_section): Rename formal parameter.
1143 (is_lines_only_debug_section): Likewise.
1144 (is_gdb_fast_lookup_section): New function.
1145 (Layout::include_section): Check for ".zdebug_" prefix; pass
1146 section name suffix to is_gdb_debug_section, et al.; check for
1147 fast-lookup sections when building .gdb_index.
1148 * options.h (--strip-debug-gdb): Update GDB version number.
1149
7c0640fa
CC
11502012-06-06 Cary Coutant <ccoutant@google.com>
1151
1152 * configure.ac: Add check for fallocate.
1153 * configure: Regenerate.
1154 * config.in: Regenerate.
1155
1156 * options.h (class General_options): Add --mmap-output-file and
1157 --posix-fallocate options.
1158 * output.cc: (posix_fallocate): Remove; replace with...
1159 (gold_fallocate): New function.
1160 (Output_file::map_no_anonymous): Call gold_fallocate.
1161 (Output_file::map): Check --mmap-output-file option.
1162
2a49eb69
DK
11632012-06-05 Jing Yu <jingyu@google.com>
1164
1165 * gold.h (textdomain): Add do {} to empty while(0).
1166 (bindtextdomain): Likewise.
1167
fad072ac
CC
11682012-06-04 Cary Coutant <ccoutant@google.com>
1169
1170 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1171 has_dynsym_index.
1172
8cc69fb6
ST
11732012-05-25 Sriraman Tallam <tmsriram@google.com>
1174
1175 * symtab.cc (Symbol_table::define_special_symbol):
1176 Initialize *poldsym to prevent uninitialized variable errors.
1177
1be75daa
CC
11782012-05-23 Cary Coutant <ccoutant@google.com>
1179
1180 * layout.cc (Layout::section_name_mapping): Add rules to handle
1181 exact match on .data.rel.ro.local or .data.rel.ro.
1182 (Layout::output_section_name): Check for exact matches.
1183
9b689de0
CC
11842012-05-23 Cary Coutant <ccoutant@google.com>
1185
1186 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1187 more carefully.
1188
b24fdbf5
CC
11892012-05-22 Cary Coutant <ccoutant@google.com>
1190
1191 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1192 object before exporting symbol.
1193
e550e1a2
L
11942012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1195
1196 * testsuite/tls_test.cc: Include "config.h" first.
1197 * testsuite/tls_test_c.c: Likewise.
1198
df7b86aa
NC
11992012-05-17 Daniel Richard G. <skunk@iskunk.org>
1200 Nick Clifton <nickc@redhat.com>
1201
1202 PR 14072
1203 * configure.in: Add check that sysdep.h has been included before
1204 any system header files.
1205 * configure: Regenerate.
1206 * config.in: Regenerate.
1207
1007b503
CC
12082012-05-14 Cary Coutant <ccoutant@google.com>
1209
1210 * layout.cc (Layout::make_output_section): Mark .tdata section
1211 as RELRO.
1212 * testsuite/relro_test.cc: Add a TLS variable.
1213
fd885f3a
L
12142012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1215
1216 PR gold/14091
1217 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1218 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1219 R_X86_64_64.
1220
80f5885c
CC
12212012-05-08 Cary Coutant <ccoutant@google.com>
1222
1223 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1224 (lines_only_debug_sections): Likewise.
1225
2e702c99
RM
12262012-05-02 Roland McGrath <mcgrathr@google.com>
1227
1228 * nacl.cc: New file.
1229 * nacl.h: New file.
1230 * Makefile.am (CCFILES, HFILES): Add them.
1231 * Makefile.in: Regenerate.
1232 * i386.cc (Output_data_plt_i386_nacl): New class.
1233 (Output_data_plt_i386_nacl_exec): New class.
1234 (Output_data_plt_i386_nacl_dyn): New class.
1235 (Target_i386_nacl): New class.
1236 (Target_selector_i386_nacl): New class.
1237 (target_selector_i386): Use it instead of Target_selector_i386.
1238 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1239 (Target_x86_64_nacl): New class.
1240 (Target_selector_x86_64_nacl): New class.
1241 (target_selector_x86_64, target_selector_x32): Use it instead of
1242 Target_selector_x86_64.
1243 * arm.cc (Output_data_plt_arm_nacl): New class.
1244 (Target_arm_nacl): New class.
1245 (Target_selector_arm_nacl): New class.
1246 (target_selector_arm, target_selector_armbe): Use it instead of
1247 Target_selector_arm.
1248
1249 * target-select.cc (select_target): Take new Input_file* and off_t
1250 arguments, pass them on to recognize method of selector.
1251 * object.cc (make_elf_sized_object): Update caller.
1252 * parameters.cc (parameters_force_valid_target): Likewise.
1253 * incremental.cc (make_sized_incremental_binary): Likewise.
1254 * target-select.h: Update decl.
1255 (Target_selector::recognize): Take new Input_file* argument,
1256 pass it on to do_recognize.
1257 (Target_selector::do_recognize): Take new Input_file* argument.
1258 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1259 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1260 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1261 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1262
1263 * target.h (Target::Target_info): New members isolate_execinstr
1264 and rosegment_gap.
1265 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1266 * arm.cc (Target_arm::arm_info): Update initializer.
1267 * i386.cc (Target_i386::i386_info): Likewise.
1268 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1269 * sparc.cc (Target_sparc::sparc_info): Likewise.
1270 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1271 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1272 * layout.cc (Layout::attach_allocated_section_to_segment):
1273 Take new const Target* argument. If target->isolate_execinstr(), act
1274 like --rosegment.
1275 (Layout::find_first_load_seg): Take new const Target* argument;
1276 if target->isolate_execinstr(), reject PF_X segments.
1277 (Layout::relaxation_loop_body): Update caller.
1278 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1279 reset file offset to zero when we hit LOAD_SEG, and then do a second
1280 loop over the segments before LOAD_SEG to reassign offsets after
1281 addresses have been determined. Handle target->rosegment_gap().
1282 (Layout::attach_section_to_segment): Take new const Target* argument;
1283 pass it to attach_allocated_section_to_segment.
1284 (Layout::make_output_section): Update caller.
1285 (Layout::attach_sections_to_segments): Take new const Target* argument;
1286 pass it to attach_section_to_segment.
1287 * gold.cc (queue_middle_tasks): Update caller.
1288 * layout.h (Layout): Update method decls with new arguments.
1289
1290 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1291 Target_info pointer to use.
1292 (Target_arm::do_make_data_plt): New virtual method.
1293 (Target_arm::make_data_plt): New method that calls it.
1294 (Target_arm::make_plt_entry): Use it.
1295 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1296 for the section alignment.
1297 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1298 method.
1299 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1300 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1301 method.
1302 (Output_data_plt_arm::get_plt_entry_size): Call it.
1303 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1304 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1305 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1306 method.
1307 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1308 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1309 method instead of sizeof(plt_entry).
1310 (Output_data_plt_arm::add_entry): Likewise.
1311 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1312 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1313 than static method.
1314 (Target_arm::plt_entry_size): Likewise.
1315 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1316 Move to ...
1317 (Output_data_plt_arm_standard): ... here, new class.
1318 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1319 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1320 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1321
1322 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1323 Take additional argument for the PLT entry size.
1324 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1325 Use get_plt_entry_size method rather than plt_entry_size variable.
1326 (Output_data_plt_x86_64::reserve_slot): Likewise.
1327 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1328 (Output_data_plt_x86_64::add_entry): Likewise.
1329 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1330 (Output_data_plt_x86_64::address_for_global): Likewise.
1331 (Output_data_plt_x86_64::address_for_local): Likewise.
1332 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1333 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1334 Make method non-static.
1335 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1336 method.
1337 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1338 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1339 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1340 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1341 virtual method.
1342 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1343 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1344 virtual method.
1345 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1346 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1347 virtual method.
1348 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1349 (Output_data_plt_x86_64::plt_entry_size)
1350 (Output_data_plt_x86_64::first_plt_entry)
1351 (Output_data_plt_x86_64::plt_entry)
1352 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1353 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1354 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1355 (Output_data_plt_x86_64_standard): ... here, new class.
1356 (Target_x86_64::Target_x86_64): Take optional argument for the
1357 Target_info pointer to use.
1358 (Target_x86_64::do_make_data_plt): New virtual method.
1359 (Target_x86_64::make_data_plt): New method to call it.
1360 (Target_x86_64::init_got_plt_for_update): Use that.
1361 Call this->plt_->add_eh_frame method here.
1362 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1363 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1364 rather than static method.
1365 (Target_x86_64::plt_entry_size): Likewise.
1366 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1367 rather than plt_entry_size variable. Move guts of PLT filling to...
1368 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1369 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1370 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1371
1372 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1373 additional argument for the section alignment.
1374 Don't do add_eh_frame_for_plt here.
1375 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1376 non-static. Use get_plt_entry_size method rather than plt_entry_size
1377 variable.
1378 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1379 method.
1380 (Output_data_plt_i386::get_plt_entry_size): Call it.
1381 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1382 (Output_data_plt_i386::add_eh_frame): New method to call it.
1383 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1384 method.
1385 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1386 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1387 method.
1388 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1389 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1390 method instead of plt_entry_size.
1391 (Output_data_plt_i386::plt_entry_size)
1392 (Output_data_plt_i386::plt_eh_frame_fde_size)
1393 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1394 (Output_data_plt_i386_standard): ... here, new class.
1395 (Output_data_plt_i386_exec): New class.
1396 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1397 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1398 (Output_data_plt_i386::exec_plt_entry): Move to ...
1399 (Output_data_plt_i386_exec::plt_entry): ... here.
1400 (Output_data_plt_i386_dyn): New class.
1401 (Output_data_plt_i386::first_plt_entry): Move to ...
1402 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1403 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1404 (Output_data_plt_i386_dyn::plt_entry): ... here.
1405 (Target_i386::Target_i386): Take optional argument for the Target_info
1406 pointer to use.
1407 (Target_i386::do_make_data_plt): New virtual method.
1408 (Target_i386::make_data_plt): New method to call it.
1409 (Target_i386::make_plt_section): Use that.
1410 Call this->plt_->add_eh_frame method here.
1411 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1412 rather than plt_entry_size variable.
1413 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1414 (Output_data_plt_i386::address_for_local): Likewise.
1415 (Output_data_plt_i386::do_write): Likewise.
1416 Move guts of PLT filling to...
1417 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1418 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1419 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1420 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1421
b9b9f2ee
CC
14222012-05-01 Cary Coutant <ccoutant@google.com>
1423
1424 * dwarf_reader.cc (Dwarf_die::read_attributes)
1425 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1426 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1427 * reduced_debug_output.cc
1428 (Output_reduced_debug_info_section::get_die_end): Remove
1429 DW_FORM_GNU_ref_index. Add default case.
1430
57923f48
MW
14312012-04-26 Mark Wielaard <mjw@redhat.com>
1432
1433 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1434 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1435 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1436 DW_AT_high_pc as offset from DW_AT_low_pc.
1437
1438 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1439 * testsuite/Makefile.in: Regenerate.
1440 * testsuite/gdb_index_test_3.c: New test source file.
1441 * testsuite/gdb_index_test_3.sh: New test source file.
1442
2c54b4f4
ILT
14432012-04-25 Ian Lance Taylor <iant@google.com>
1444
1445 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1446 pointer.
1447 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1448 as a class, not a struct.
1449 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1450 (Target_arm::apply_cortex_a8_workaround): Likewise.
1451 * gc.h: Declare Reloc_types as a struct, not a class.
1452 * object.h: Declare Symbols_data as a struct.
1453 * reloc.h: Declare Read_relocs_data as a struct.
1454 * target.h: Declare Relocate_info as a struct.
1455
a5a5f7a3
DM
14562012-04-24 David S. Miller <davem@davemloft.net>
1457
1458 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1459 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1460 and R_SPARC_WPLT30.
1461
f038d496
CC
14622012-04-24 Cary Coutant <ccoutant@google.com>
1463
1464 * incremental-dump.cc (find_input_containing_global): Replace
1465 magic number with symbolic constant.
1466 (dump_incremental_inputs): Update version number.
1467 * incremental.cc (Output_section_incremental_inputs): Update version
1468 number; import symbolic constants from Incremental_inputs_reader.
1469 (Incremental_inputs::create_data_sections): Align relocations
1470 section correctly for 64-bit targets.
1471 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1472 constants; add padding.
1473 (Output_section_incremental_inputs::write_header): Add assert for
1474 header_size.
1475 (Output_section_incremental_inputs::write_input_files): Add assert
1476 for input_entry_size.
1477 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1478 add assert for object_info_size, input_section_entry_size,
1479 global_sym_entry_size.
1480 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1481 for data structure sizes; use them.
1482 (Incremental_input_entry_reader): Import symbolic constants from
1483 Incremental_inputs_reader; use them.
1484
a4d85145
DM
14852012-04-23 David S. Miller <davem@davemloft.net>
1486
1487 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1488 and elf_flags_set_.
1489 (Target_sparc::Target_sparc): Initialize new fields.
1490 (Target_sparc::do_make_elf_object): New function.
1491 (Target_sparc::do_adjust_elf_header): New function.
1492
1d509098
CC
14932012-04-23 Cary Coutant <ccoutant@google.com>
1494
1495 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1496 CU range table of gdb index.
1497
7ebeff7f
DM
14982012-04-20 David S. Miller <davem@davemloft.net>
1499
1500 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1501 instead of false.
1502
13cf9988
DM
15032012-04-16 David S. Miller <davem@davemloft.net>
1504
2a1079e8
DM
1505 * sparc.cc (Target_sparc::got_address): New function.
1506 (Sparc_relocate_functions::gdop_hix22): New function.
1507 (Sparc_relocate_functions::gdop_lox10): New function.
1508 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1509 relocs.
1510 (Target_sparc::Scan::local): Likewise if the global symbol is not
1511 preemptible and is not IFUNC.
1512 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1513 transformations for local and non-preemptible non-IFUNC global
1514 symbols.
1515
0bc964fc
DM
1516 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1517 writing out 64-bit part of ranges.
1518
661d7a80
DM
1519 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1520 -fpic and -fpie respectively.
1521 * Makefile.in: Regenerate.
1522
8c2bf391
DM
1523 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1524 (Target_sparc::Target_sparc): Initialize new field.
1525 (Target_sparc::do_plt_section_for_global): New function.
1526 (Target_sparc::do_plt_section_for_local): New function.
1527 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1528 (Target_sparc::make_plt_section): New function, broken out of
1529 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1530 (Target_sparc::make_plt_entry): Call make_plt_section.
1531 (Target_sparc::make_local_ifunc_plt_entry): New function.
1532 (Target_sparc::rela_ifunc_section): New function.
1533 (Target_sparc::plt_section): Remove const.
1534 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1535 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1536 and ifunc_count_ fields.
1537 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1538 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1539 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1540 (Output_data_plt_sparc::rela_ifunc): New function.
1541 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1542 (Output_data_plt_sparc::has_ifunc_section): New function.
1543 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1544 (Output_data_plt_sparc::address_for_global): New function.
1545 (Output_data_plt_sparc::address_for_local): New function.
1546 (Output_data_plt_sparc::plt_index_to_offset): New function.
1547 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1548 and entry_count.
1549 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1550 entry_count.
1551 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1552 R_SPARC_JMP_IREL to switch.
1553 (Target_sparc::Scan::check_non_pic): Likewise.
1554 (Target_sparc::Scan::local): Handle IFUNC symbols.
1555 (Target_sparc::Scan::local): Likewise.
1556 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1557 and plt_address_for_local.
1558 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1559 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1560
13cf9988
DM
1561 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1562 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1563 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1564 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1565 global relocs too.
1566 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1567 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1568 calls.
1569 * sparc.cc (Target_sparc::Scan::global): Likewise.
1570 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1571
31821be0
CC
15722012-04-16 Cary Coutant <ccoutant@google.com>
1573
1574 * archive.cc (Library_base::should_include_member): Check for
1575 --export-dynamic-symbol.
1576 * options.h (class General_options): Add --export-dynamic-symbol.
1577 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1578 --export-dynamic-symbol.
1579 (Symbol_table::gc_mark_undef_symbols): Likewise.
1580 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1581
2615994e
DM
15822012-04-12 David S. Miller <davem@davemloft.net>
1583
1584 * sparc.cc (Reloc::wdisp10): New relocation method.
1585 (Reloc::h34): Likewise.
1586 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1587 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1588 R_SPARC_WDISP10.
1589 (Target_sparc::Scan::local): Likewise.
1590 (Target_sparc::Scan::global): Likewise.
1591 (Target_sparc::Relocate::relocate): Likewise.
1592
6782735d
CC
15932012-04-09 Cary Coutant <ccoutant@google.com>
1594
1595 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1596 low_pc == 0.
1597
8c7a0b00
ILT
15982012-04-06 Ian Lance Taylor <iant@google.com>
1599
1600 * timer.cc: #include <unistd.h>.
1601
58797674
RM
16022012-04-06 Roland McGrath <mcgrathr@google.com>
1603
1604 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1605 * config.in: Regenerate.
1606 * configure: Regenerate.
1607
44350750
NC
16082012-04-05 Nick Clifton <nickc@redhat.com>
1609
1610 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1611 (AM_LC_MESSAGES): Add.
1612 * aclocal.m4: Regenerate.
1613 * config.in: Regenerate.
1614 * configure: Regenerate.
1615
c1027032
CC
16162012-03-21 Cary Coutant <ccoutant@google.com>
1617
1618 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1619 * Makefile.in: Regenerate.
1620 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1621 (Sized_elf_reloc_mapper::symbol_section): New function.
1622 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1623 (make_elf_reloc_mapper): New function.
1624 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1625 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1626 (Dwarf_abbrev_table::do_get_abbrev): New function.
1627 (Dwarf_ranges_table::read_ranges_table): New function.
1628 (Dwarf_ranges_table::read_range_list): New function.
1629 (Dwarf_pubnames_table::read_section): New function.
1630 (Dwarf_pubnames_table::read_header): New function.
1631 (Dwarf_pubnames_table::next_name): New function.
1632 (Dwarf_die::Dwarf_die): New function.
1633 (Dwarf_die::read_attributes): New function.
1634 (Dwarf_die::skip_attributes): New function.
1635 (Dwarf_die::set_name): New function.
1636 (Dwarf_die::set_linkage_name): New function.
1637 (Dwarf_die::attribute): New function.
1638 (Dwarf_die::string_attribute): New function.
1639 (Dwarf_die::int_attribute): New function.
1640 (Dwarf_die::uint_attribute): New function.
1641 (Dwarf_die::ref_attribute): New function.
1642 (Dwarf_die::child_offset): New function.
1643 (Dwarf_die::sibling_offset): New function.
1644 (Dwarf_info_reader::check_buffer): New function.
1645 (Dwarf_info_reader::parse): New function.
1646 (Dwarf_info_reader::do_parse): New function.
1647 (Dwarf_info_reader::do_read_string_table): New function.
1648 (Dwarf_info_reader::lookup_reloc): New function.
1649 (Dwarf_info_reader::get_string): New function.
1650 (Dwarf_info_reader::visit_compilation_unit): New function.
1651 (Dwarf_info_reader::visit_type_unit): New function.
1652 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1653 Sized_elf_reloc_mapper.
1654 (Sized_dwarf_line_info::symbol_section): Remove function.
1655 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1656 (Sized_dwarf_line_info::read_line_mappings): Remove object
1657 parameter, adjust callers.
1658 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1659 * dwarf_reader.h: Include <sys/types.h>.
1660 (class Track_relocs): Remove forward declaration.
1661 (class Elf_reloc_mapper): New class.
1662 (class Sized_elf_reloc_mapper): New class.
1663 (class Dwarf_abbrev_table): New class.
1664 (class Dwarf_range_list): New class.
1665 (class Dwarf_ranges_table): New class.
1666 (class Dwarf_pubnames_table): New class.
1667 (class Dwarf_die): New class.
1668 (class Dwarf_info_reader): New class.
1669 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1670 (Sized_dwarf_line_info::symbol_section): Remove member function.
1671 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1672 base class.
1673 * gdb-index.cc: New source file.
1674 * gdb-index.h: New source file.
1675 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1676 and .debug_types sections, call Layout::add_to_gdb_index.
1677 (Sized_relobj_incr::do_section_name): Implement.
1678 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1679 return type; Implement.
1680 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1681 return type.
1682 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1683 parameter list and return type.
1684 (Sized_incr_dynobj::do_section_contents): Likewise.
1685 * layout.cc: Include gdb-index.h.
1686 (Layout::Layout): Initialize gdb_index_data_.
1687 (Layout::init_fixed_output_section): Check for .gdb_index section.
1688 (Layout::add_to_gdb_index): New function. Instantiate.
1689 * layout.h: Add forward declaration for class Gdb_index.
1690 (Layout::add_to_gdb_index): New member function.
1691 (Layout::gdb_index_data_): New data member.
1692 * main.cc: Include gdb-index.h.
1693 (main): Print statistics for gdb index.
1694 * object.cc (Object::section_contents): Move code into
1695 do_section_contents.
1696 (need_decompressed_section): Check for sections needed when building
1697 gdb index.
1698 (build_compressed_section_map): Likewise.
1699 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1700 gdb index.
1701 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1702 sections; call Layout::add_to_gdb_index.
1703 (Sized_relobj_file::do_decompressed_section_contents): Call
1704 do_section_contents directly.
1705 * object.h (Object::do_section_contents): Adjust parameter list and
1706 return type.
1707 (Object::do_decompressed_section_contents): Call do_section_contents
1708 directly.
1709 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1710 return type.
1711 * options.h (class General_options): Add --gdb-index option.
1712 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1713 list and return type.
1714 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1715 * reloc.h (Track_relocs::checkpoint): New function.
1716 (Track_relocs::reset): New function.
1717
1718 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1719 New test cases.
1720 * testsuite/Makefile.in: Regenerate.
1721 * testsuite/gdb_index_test.cc: New test source file.
1722 * testsuite/gdb_index_test_1.sh: New test source file.
1723 * testsuite/gdb_index_test_2.sh: New test source file.
1724
647f1574
DK
17252012-03-19 Doug Kwan <dougkwan@google.com>
1726
1727 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1728 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1729 __exidx_start and __exidx_end. Make symbol table parameter
1730 anonymous as it is not used.
1731 * gold.cc (queue_middle_tasks): Call target hook to define any
1732 target-specific symbols.
1733 * target.h (Target::define_standard_symbols): New method.
1734 (Target::do_define_standard_symbols): Same.
1735 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1736 * testsuite/Makefile.in: Regenerate.
1737 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1738 and __exidx_end.
1739 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1740 relocations are generated for __exidx_start and __exidx_end.
1741
7c6109da
DK
17422012-03-16 Doug Kwan <dougkwan@google.com>
1743
1744 * testsuite/Makefile.am: Disable test initpri3b.
1745 * testsuite/Makefile.in: Regenerate.
1746
7b8957f8
DK
17472012-03-15 Doug Kwan <dougkwan@google.com>
1748
1749 * arm.cc (Target_arm::got_section): Make .got section read-only
1750 if -z now is given.
1751
14dc9ef7
ILT
17522012-03-15 Ian Lance Taylor <iant@google.com>
1753
1754 PR gold/13850
1755 * layout.cc (Layout::make_output_section): Correctly mark
1756 SHT_INIT_ARRAY, et. al., as relro.
1757
fa40b62a
DK
17582012-03-14 Doug Kwan <dougkwan@google.com>
1759
1760 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1761 dynamic relocations for protected symbols in shared objects.
1762
fd325007
ILT
17632012-03-13 Ian Lance Taylor <iant@google.com>
1764
1765 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1766 keep the larger alignment.
1767
e8dd54e1
CC
17682012-03-12 Cary Coutant <ccoutant@google.com>
1769
1770 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1771 handling of DW_LNE_define_file.
1772
feb5f3b0
CC
17732012-03-12 Cary Coutant <ccoutant@google.com>
1774
1775 * reduced_debug_output.cc
1776 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1777 codes to switch.
1778
a1fb4256
CC
17792012-02-29 Cary Coutant <ccoutant@google.com>
1780
1781 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1782
5dd8762a
CC
17832012-02-29 Cary Coutant <ccoutant@google.com>
1784
1785 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1786 Call Object::decompressed_section_contents.
1787 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1788 New dtor.
1789 (Sized_dwarf_line_info::buffer_start_): New data member.
1790 * merge.cc (Output_merge_data::do_add_input_section): Call
1791 Object::decompressed_section_contents.
1792 (Output_merge_string::do_add_input_section): Likewise.
1793 * object.cc (need_decompressed_section): New function.
1794 (build_compressed_section_map): Decompress sections needed later.
1795 (Sized_relobj_file::do_decompressed_section_contents): New function.
1796 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1797 * object.h (Object::decompressed_section_contents): New function.
1798 (Object::discard_decompressed_sections): New function.
1799 (Object::do_decompressed_section_contents): New function.
1800 (Object::do_discard_decompressed_sections): New function.
1801 (Compressed_section_info): New type.
1802 (Compressed_section_map): Include decompressed section contents.
1803 (Sized_relobj_file::do_decompressed_section_contents): New function.
1804 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1805
7b5de7ee
CC
18062012-02-16 Cary Coutant <ccoutant@google.com>
1807
1808 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1809 * testsuite/Makefile.in: Regenerate.
1810
f9fa4a63
CC
18112012-02-14 Cary Coutant <ccoutant@google.com>
1812
1813 * options.cc (General_options::finalize): Disallow -pie and -static.
1814
2c175ebc
DK
18152012-02-03 Doug Kwan <dougkwan@google.com>
1816
1817 * arm.cc (Arm_relocate_functions::abs8,
1818 Arm_relocate_functions::abs16): Use
1819 Bits::has_signed_unsigned_overflow32.
1820 (Arm_relocate_functions::thm_abs8): Correct range of
1821 overflow check.
1822 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1823 in assertions.
1824
90cff06f
DK
18252012-02-02 Doug Kwan <dougkwan@google.com>
1826
1827 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1828 position independent outputs, not just shared objects.
1829
63887f3d
L
18302012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1831
1832 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1833 * configure: Regenerated.
1834
bef2b434
ILT
18352012-01-27 Ian Lance Taylor <iant@google.com>
1836
1837 * reloc.h (Bits): New class with static functions, copied from
1838 namespace utils in arm.cc.
1839 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1840 instead.
1841
c335b55d
L
18422012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1843
1844 * incremental.cc (write_info_blocks): Correct relocation offset.
1845
41194d9f
L
18462012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1847
1848 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1849 (Relocate::tls_gd_to_le): Likewise.
1850
1bae613c
L
18512012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1852
1853 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1854
24482ca0
L
18552012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1856
1857 * configure.ac: Check if -mcmodel=medium works.
1858 * configure: Regenerated.
1859
c2c7840a
CC
18602012-01-24 Cary Coutant <ccoutant@google.com>
1861
1862 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1863 definition and ...
1864 (read_unsigned_LEB_128_x): ... this new function.
1865 (read_signed_LEB_128): Replaced with inline definition and ...
1866 (read_signed_LEB_128_x): ... this new function.
1867 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1868 (read_unsigned_LEB_128): Add inline definition.
1869 (read_signed_LEB_128_x): New function.
1870 (read_signed_LEB_128): Add inline definition.
1871 * testsuite/Makefile.am (leb128_unittest): New unit test.
1872 * testsuite/Makefile.in: Regenerate.
1873 * testsuite/leb128_unittest.cc: New unit test.
1874
833de760 18752012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1876
1877 PR gold/13617
1878 * i386.cc (Target_i386::do_code_fill): When using a jmp
1879 instruction, pad with nop instructions.
1880 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1881
618d6666
L
18822012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1883
1884 * x86_64.cc (gc_process_relocs): Add typename on types used in
1885 template.
1886 (scan_relocs): Likewise.
1887 (relocate_section): Likewise.
1888 (apply_relocation): Likewise.
1889
3660ff06
L
18902012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1891
1892 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1893 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1894 under x32.
1895
fc51264f
L
18962012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1897
1898 * x86_64.cc: Initial support for x32.
1899
dd74ae06
CC
19002012-01-03 Cary Coutant <ccoutant@google.com>
1901
1902 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1903 Use abstract base class for GOT.
1904 * gold/output.h (class Output_data_got_base): New abstract base class.
1905 (class Output_data_got): Derive from new base class, adjust ctors.
1906 (Output_data_got::reserve_slot): Make virtual; rename to
1907 do_reserve_slot; Adjust callers.
1908 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1909 pointer to abstract base class.
1910 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1911
83896202
ILT
19122011-12-18 Ian Lance Taylor <iant@google.com>
1913
1914 * object.h (Relobj::local_symbol_value): New function.
1915 (Relobj::local_plt_offset): New function.
1916 (Relobj::local_has_got_offset): New function.
1917 (Relobj::local_got_offset): New function.
1918 (Relobj::set_local_got_offset): New function.
1919 (Relobj::do_local_symbol_value): New pure virtual function.
1920 (Relobj::do_local_plt_offset): Likewise.
1921 (Relobj::do_local_has_got_offset): Likewise.
1922 (Relobj::do_local_got_offset): Likewise.
1923 (Relobj::do_set_local_got_offset): Likewise.
1924 (Sized_relobj::do_local_has_got_offset): Rename from
1925 local_has_got_offset.
1926 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1927 (Sized_relobj::do_set_local_got_offset): Rename from
1928 set_local_got_offset.
1929 (Sized_relobj_file::do_local_plt_offset): Rename from
1930 local_plt_offset.
1931 (Sized_relobj_file::do_local_symbol_value): New function.
1932 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1933 local_plt_offset.
1934 * output.cc (Output_data_got::Got_entry::write): Change object to
1935 Relobj. Use local_symbol_value.
1936 (Output_data_got::add_global_with_rel): Change rel_dyn to
1937 Output_data_reloc_generic*. Use add_global_generic.
1938 (Output_data_got::add_global_with_rela): Remove. Change all
1939 callers to use add_global_with_rel.
1940 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1941 Output_data_reloc_generic*. Use add_global_generic.
1942 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1943 callers to use add_global_pair_with_rel.
1944 (Output_data_got::add_local): Change object to Relobj*.
1945 (Output_data_got::add_local_plt): Likewise.
1946 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1947 change rel_dyn to Output_data_reloc_generic*. Use
1948 add_local_generic.
1949 (Output_data_got::add_local_with_rela): Remove. Change all
1950 callers to use all_local_with_rel.
1951 (Output_data_got::add_local_pair_with_rel): Change object to
1952 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1953 add_output_section_generic.
1954 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1955 callers to use add_local_pair_with_rel.
1956 (Output_data_got::reserve_local): Change object to Relobj*.
1957 * output.h: (class Output_data_reloc_generic): Add pure virtual
1958 declarations for add_global_generic, add_local_generic,
1959 add_output_section_generic.
1960 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1961 functions for Output_data_reloc_generic. Update declarations for
1962 changes listed in output.cc.
1963 (class Output_data_got): Change template parameter to got_size.
1964 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1965 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1966 function.
1967 (Sized_relobj_incr::do_local_plt_offset): New function.
1968 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1969 add_global_generic.
1970
76677ad0
CC
19712011-12-17 Cary Coutant <ccoutant@google.com>
1972
1973 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1974 * resolve.cc (Symbol_table::resolve): Likewise.
1975 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1976 arrays.
1977 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1978
8b8dd8d5
ILT
19792011-12-16 Ian Lance Taylor <iant@google.com>
1980
1981 * output.h (Output_data_reloc_generic::add): Only call
1982 add_dynamic_reloc if this is a dynamic reloc section.
1983
d55525b9
L
19842011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1985
1986 PR gold/13505
1987 * target-reloc.h (apply_relocation): Replace <64, false> with
1988 <size, big_endian>.
1989
ff81c7c1
NC
19902011-11-25 Nick Clifton <nickc@redhat.com>
1991
1992 * po/it.po: New Italian translation.
1993
628f39be
SA
19942011-11-17 Sterling Augustine <saugustine@google.com>
1995
1996 * script.cc (script_include_directive): Implement.
1997 (read_script_file): New local variables name and search_path. Update
1998 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1999 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2000 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2001
98ef3ea4
SA
20022011-11-11 Sterling Augustine <saugustine@google.com>
2003
2004 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2005 (file_or_sections_cmd): Likewise.
2006
f4a8b6d7
DK
20072011-11-11 Doug Kwan <dougkwan@google.com>
2008
2009 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2010 if --just-symbols is given.
2011
29ab395d
DK
20122011-11-10 Doug Kwan <dougkwan@google.com>
2013
2014 PR gold/13362
2015 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2016 when processing data relocs.
2017 * reloc.h (Relocate_functions::rel_unaligned): New method.
2018 (Relocate_functions::pcrel_unaligned): Ditto.
2019 (Relocate_functions::rel32_unaligned): Ditto.
2020 (Relocate_functions::pcrel32_unaligned): Ditto.
2021
2c339f71
DK
20222011-11-09 Doug Kwan <dougkwan@google.com>
2023
2024 PR gold/13362
2025 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2026 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2027 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2028 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2029 (Relocate_functions::rel_unaligned): New.
2030 (Relocate_functions::rel32_unaligned): New.
2031 * target-reloc.h (relocate_for_relocatable): Add code to handle
2032 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2033 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2034 arm_unaligned_reloc_r): New targets.
2035 * testsuite/Makefile.in: Regenerate.
2036 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2037 linking.
2038
3f3cddf1
ILT
20392011-11-02 Ian Lance Taylor <iant@google.com>
2040
2041 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2042 NATIVE_LINKER.
2043 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2044 * options.cc (General_options::finalize): Use library search path
2045 from configure script if specified. If not native and no sysroot,
2046 only search TOOLLIBDIR.
2047 * options.h (Search_directory::Search_directory): Change name to
2048 const std::string&.
2049 (General_options::add_to_library_path_with_sysroot): Change arg to
2050 const std::string&.
2051 * configure, Makefile.in, config.in: Rebuild.
2052
a8e2273b
ILT
20532011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2054
2055 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2056 we are working around the ARM1176 Erratum.
2057 * options.h (General_options::fix_arm1176): Add option.
2058 * testsuite/Makefile.am: Add testcases, and keep current ones
2059 working.
2060 * testsuite/Makefile.in: Regenerate.
2061 * testsuite/arm_fix_1176.s: New file.
2062 * testsuite/arm_fix_1176.sh: Likewise.
2063
cd6eab1c
ILT
20642011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2065
2066 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2067 may_use_blx_.
2068 (Target_arm::may_use_blx): Remove method.
2069 (Target_arm::set_may_use_blx): Likewise.
2070 (Target_arm::may_use_v4t_interworking): New method.
2071 (Target_arm::may_use_v5t_interworking): Likewise.
2072 (Target_arm::may_use_blx_): Remove member variable.
2073 (Arm_relocate_functions::arm_branch_common): Check for v5T
2074 interworking.
2075 (Arm_relocate_functions::thumb_branch_common): Likewise.
2076 (Reloc_stub::stub_type_for_reloc): Likewise.
2077 (Target_arm::do_finalize_sections): Correct interworking checks.
2078 * testsuite/Makefile.am: Add new tests.
2079 * testsuite/Makefile.in: Regenerate.
2080 * testsuite/arm_farcall_arm_arm.s: New test.
2081 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2082 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2083 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2084 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2085 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2086 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2087 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2088
286adcf4
CC
20892011-10-31 Cary Coutant <ccoutant@google.com>
2090
2091 PR gold/13023
2092 * expression.cc (Expression::eval_with_dot): Add
2093 is_section_dot_assignment parameter.
2094 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2095 absolute and assigning to dot within a section.
2096 * script-sections.cc
2097 (Output_section_element_assignment::set_section_addresses): Pass
2098 dot_section to set_if_absolute.
2099 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2100 as is_section_dot_assignment flag to eval_with_dot.
2101 (Output_section_element_dot_assignment::set_section_addresses):
2102 Likewise.
2103 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2104 parameter. Also set value if relative to dot_section; set the
2105 symbol's output_section.
2106 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2107 parameter. Adjust all callers.
2108 (Expression::eval_maybe_dot): Likewise.
2109 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2110 Adjust all callers.
2111 * testsuite/script_test_2.t: Test assignment of an absolute value
2112 to dot within an output section element.
2113
9634ed06
CC
21142011-10-31 Cary Coutant <ccoutant@google.com>
2115
2116 * options.h (class General_options): Add --[no-]gnu-unique options.
2117 * symtab.cc (Symbol_table::sized_write_globals): Convert
2118 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2119
de4101c7
CC
21202011-10-31 Cary Coutant <ccoutant@google.com>
2121
2122 PR gold/13359
2123 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2124 unnecessary assertion.
2125 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2126
7257cc92
ST
21272011-10-31 Sriraman Tallam <tmsriram@google.com>
2128
2129 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2130 gc_mark_symbol.
2131 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2132 gc_mark_symbol.
2133 Change to just keep the section associated with symbol.
2134 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2135 they are externally visible and --export-dynamic is turned on.
2136 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2137
bfc34b3f
ILT
21382011-10-19 Ian Lance Taylor <iant@google.com>
2139
2140 PR gold/13163
2141 * script-sections.cc
2142 (Output_section_element_dot_assignment::needs_output_section): New
2143 function.
2144
ea0d8c47
ILT
21452011-10-19 Ian Lance Taylor <iant@google.com>
2146
2147 PR gold/13204
2148 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2149 --section-start option was seen.
2150 * options.h (General_options::any_section_start): New function.
2151
abd242a9
DM
21522011-10-18 David S. Miller <davem@davemloft.net>
2153
2154 PR binutils/13301
2155 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2156 member to track relocation locations that have moved during TLS
2157 reloc optimizations.
2158 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2159 (Target_sparc::Relocate::relocate): Adjust view down by 4
2160 bytes if it matches reloc_adjust_addr_.
2161 (Target_sparc::Relocate::relocate_tls): Always move the
2162 __tls_get_addr call delay slot instruction forward 4 bytes when
2163 performing relaxation.
2164
bab9090f
CC
21652011-10-18 Cary Coutant <ccoutant@google.com>
2166
2167 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2168 (Output_file::map_no_anonymous): Check for non-zero
2169 return code from posix_fallocate.
2170
f7c5b166
CC
21712011-10-17 Cary Coutant <ccoutant@google.com>
2172
2173 PR gold/13245
2174 * plugin.cc (is_visible_from_outside): Check for symbols
2175 referenced from dynamic objects.
2176 * resolve.cc (Symbol_table::resolve): Don't count references
2177 from dynamic objects as references from real ELF files.
2178 * testsuite/plugin_test_2.sh: Adjust expected result.
2179
b490c0bb
CC
21802011-10-17 Cary Coutant <ccoutant@google.com>
2181
2182 * gold.cc: Include timer.h.
2183 (queue_middle_tasks): Stamp time.
2184 (queue_final_tasks): Likewise.
2185 * main.cc (main): Store timer in parameters. Print timers
2186 for each pass.
2187 * parameters.cc (Parameters::Parameters): Initialize timer_.
2188 (Parameters::set_timer): New function.
2189 (set_parameters_timer): New function.
2190 * parameters.h (Parameters::set_timer): New function.
2191 (Parameters::timer): New function.
2192 (Parameters::timer_): New data member.
2193 (set_parameters_timer): New function.
2194 * timer.cc (Timer::stamp): New function.
2195 (Timer::get_pass_time): New function.
2196 * timer.h (Timer::stamp): New function.
2197 (Timer::get_pass_time): New function.
2198 (Timer::pass_times_): New data member.
2199
f475cf7b
CC
22002011-10-17 Cary Coutant <ccoutant@google.com>
2201
2202 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2203 task for members of lib groups.
2204
cdd7e244
CC
22052011-10-17 Cary Coutant <ccoutant@google.com>
2206
2207 PR gold/13288
4f95c8b4 2208 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
2209 (File_read::make_view): Move bounds check (replace with assert)...
2210 (File_read::find_or_make_view): ... to here.
2211
dfb45471
CC
22122011-10-12 Cary Coutant <ccoutant@google.com>
2213
4f95c8b4 2214 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2215 ::read returns less than requested size.
2216
53bbcc1b
CC
22172011-10-10 Cary Coutant <ccoutant@google.com>
2218
4f95c8b4 2219 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2220 Initialize defined_count_.
2221 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2222 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2223 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2224 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2225 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2226 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2227 member.
2228 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2229 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2230 Return zeroes instead of internal error.
2231
397b129b
CC
22322011-10-10 Cary Coutant <ccoutant@google.com>
2233
2234 PR gold/13249
4f95c8b4 2235 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2236 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2237 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2238 (Output_reloc::type_): Adjust size of bit field.
2239 (Output_reloc::use_plt_offset_): New bit field.
2240 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2241 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2242 flag. Adjust all callers.
4f95c8b4 2243 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2244 creating RELATIVE relocations.
2245
d5698657
NC
22462011-10-10 Nick Clifton <nickc@redhat.com>
2247
2248 * po/es.po: Updated Spanish translation.
2249 * po/fi.po: Updated Finnish translation.
2250
6a59a5c2
DN
22512011-10-03 Diego Novillo <dnovillo@google.com>
2252
2253 * options.cc (parse_uint): Fix dereference of RETVAL.
2254
f0558624
ST
22552011-09-29 Sriraman Tallam <tmsriram@google.com>
2256
2257 * layout.h (section_order_map_): New member.
2258 (get_section_order_map): New member function.
2259 * output.cc (Output_section::add_input_section): Check for patterns
2260 only when --section-ordering-file is specified.
2261 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2262 output_sections have been formed.
2263 * layout.cc (Layout_Layout): Initialize section_order_map_.
2264 * plugin.cc (update_section_order): Store order in order_map. Do not
2265 update the order.
2266 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2267 * testsuite/Makefile.in: Regenerate.
2268 * testsuite/plugin_section_order.c: New file.
2269 * testsuite/plugin_final_layout.cc: New file.
2270 * testsuite/plugin_final_layout.sh: New file.
2271
a7dac153
CC
22722011-09-29 Cary Coutant <ccoutant@google.com>
2273
4f95c8b4 2274 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2275 Check for NULL.
4f95c8b4 2276 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2277 symbols during incremental update.
2278 (Symbol_table::add_from_dynobj): Likewise.
2279
eebd87a5
ILT
22802011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2281 Ian Lance Taylor <iant@google.com>
2282
2283 * symtab.cc (Symbol_table::define_special_symbol): Always
2284 canonicalize version string.
2285
403a3331
CC
22862011-09-26 Cary Coutant <ccoutant@google.com>
2287
4f95c8b4
CC
2288 * gold.cc (queue_initial_tasks): Move option checks ...
2289 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2290 some options; make others fatal.
2291
235061c2
CC
22922011-09-26 Cary Coutant <ccoutant@google.com>
2293
2294 gcc PR lto/47247
2295 * plugin.cc (get_symbols_v2): New function.
2296 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2297 (is_referenced_from_outside): New function.
2298 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2299 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2300 (get_symbols): Pass version parameter.
2301 (get_symbols_v2): New function.
2302 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2303 parameter.
2304 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2305 (onload): Add LDPT_GET_SYMBOLS_V2.
2306 (all_symbols_read_hook): Use get_symbols_v2; check for
2307 LDPR_PREVAILING_DEF_IRONLY_EXP.
2308 * testsuite/plugin_test_3.sh: Update expected results.
2309
dc87f620
ILT
23102011-09-23 Simon Baldwin <simonb@google.com>
2311
2312 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2313 configuration options.
2314 * configure: Regenerate.
2315 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2316 * Makefile.in: Regenerate.
2317 * testsuite/Makefile.in: Regenerate.
2318
a8279f82
ST
23192011-09-19 Sriraman Tallam <tmsriram@google.com>
2320
2321 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2322
0c9350c8
CC
23232011-09-19 Cary Coutant <ccoutant@google.com>
2324
2325 * incremental.cc (can_incremental_update): Fix typo in comment.
2326 * incremental.h (can_incremental_update): Likewise.
2327
aa06ae28
CC
23282011-09-18 Cary Coutant <ccoutant@google.com>
2329
2330 * incremental.cc (can_incremental_update): New function.
2331 * incremental.h (can_incremental_update): New function.
2332 * layout.cc (Layout::init_fixed_output_section): Call it.
2333 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2334 * object.cc (Sized_relobj_file::do_layout): Call
2335 can_incremental_update.
2336
ebb300b2
CC
23372011-09-13 Cary Coutant <ccoutant@google.com>
2338
2339 * configure.ac: Check for glibc support for gnu_indirect_function
2340 support with static linking, setting automake conditional
2341 IFUNC_STATIC.
2342 * Makefile.in: Regenerate.
2343 * configure: Regenerate.
2344
2345 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2346 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2347 for IFUNC_STATIC.
2348 * testsuite/Makefile.in: Regenerate.
2349
1206d0d5
CC
23502011-09-13 Cary Coutant <ccoutant@google.com>
2351
2352 * incremental.cc (Sized_relobj_incr::do_layout): Call
2353 report_comdat_group for kept comdat sections.
2354 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2355 * testsuite/Makefile.in: Regenerate.
2356 * testsuite/incr_comdat_test_1.cc: New source file.
2357 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2358 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2359 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2360
40b29874
ILT
23612011-09-13 Ian Lance Taylor <iant@google.com>
2362
2363 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2364 variable external_symbols_offset.
2365
1b045aac
ILT
23662011-09-12 Ian Lance Taylor <iant@google.com>
2367
2368 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2369 triggered if object has no symbols.
2370
24c6c55a
DM
23712011-09-09 David S. Miller <davem@davemloft.net>
2372
2373 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2374 (Output_fill_debug_line::do_write): Likewise.
2375
66570254
CC
23762011-08-29 Cary Coutant <ccoutant@google.com>
2377
2378 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2379 casts to match formatting specs.
2380 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2381
8ea8cd50
CC
23822011-08-26 Cary Coutant <ccoutant@google.com>
2383
2384 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2385 remaining hole size when allocating.
2386 (Layout::make_output_section): Set fill methods for debug sections.
2387 * layout.h (Free_list::Free_list_node): Move from private to
2388 public.
2389 (Free_list::set_min_hole_size): New function.
2390 (Free_list::begin, Free_list::end): New functions.
2391 (Free_list::min_hole_): New data member.
2392 * output.cc: Include dwarf.h.
2393 (Output_fill_debug_info::do_minimum_hole_size): New function.
2394 (Output_fill_debug_info::do_write): New function.
2395 (Output_fill_debug_line::do_minimum_hole_size): New function.
2396 (Output_fill_debug_line::do_write): New function.
2397 (Output_section::Output_section): Initialize new data member.
2398 (Output_section::set_final_data_size): Ensure patch space is larger
2399 than minimum hole size.
2400 (Output_section::do_write): Fill holes in debug sections.
2401 * output.h (Output_fill): New class.
2402 (Output_fill_debug_info): New class.
2403 (Output_fill_debug_line): New class.
2404 (Output_section::set_free_space_fill): New function.
2405 (Output_section::free_space_fill_): New data member.
2406 * testsuite/Makefile.am (incremental_test_3): Add
2407 --incremental-patch option.
2408 (incremental_test_4): Likewise.
2409 (incremental_test_5): Likewise.
2410 (incremental_test_6): Likewise.
2411 (incremental_copy_test): Likewise.
2412 (incremental_common_test_1): Likewise.
2413 * testsuite/Makefile.in: Regenerate.
2414
7cf80422
NC
24152011-08-26 Nick Clifton <nickc@redhat.com>
2416
2417 * po/es.po: Updated Spanish translation.
2418
c3f7b0e5
CC
24192011-08-01 Cary Coutant <ccoutant@google.com>
2420
2421 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2422 * gold/testsuite/Makefile.in: Regenerate.
2423 * gold/testsuite/justsyms_exec.c: New source file.
2424 * gold/testsuite/justsyms_lib.c: New source file.
2425
9590bf25
CC
24262011-08-01 Cary Coutant <ccoutant@google.com>
2427
2428 * layout.cc (Layout::set_segment_offsets): Don't realign text
2429 segment if -Ttext was specified.
2430 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2431 file type.
2432 * object.h (Sized_relobj_file::e_type): New function.
2433 (Sized_relobj_file::e_type_): New data member.
2434 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2435 base address for ET_EXEC files.
2436 * target.cc (Target::do_make_elf_object_implementation): Allow
2437 ET_EXEC files with --just-symbols option.
2438
dcd8d12e
CC
24392011-07-28 Cary Coutant <ccoutant@google.com>
2440
2441 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2442 Add thread_number parameter.
2443 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2444 * workqueue-threads.cc
2445 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2446 current thread if its thread number is greater than desired thread
2447 count.
2448 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2449 Add thread_number parameter.
2450 (Workqueue::should_cancel_thread): Likewise.
2451 (Workqueue::find_runnable_or_wait): Pass thread_number to
2452 should_cancel_thread.
2453 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2454 parameter.
2455
804eb480
ST
24562011-07-22 Sriraman Tallam <tmsriram@google.com>
2457
2458 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2459 only after checking if it cannot be forced local.
2460 * symtab.h (is_externally_visible): Check if the symbol is not forced
2461 local.
2462
f1ddb600
ILT
24632011-07-15 Ian Lance Taylor <iant@google.com>
2464
2465 * options.h (class General_options): Add --print-output-format.
2466 Move -EL next to -EB, for better --help output.
2467 * target-select.cc: Include <cstdio>, "options.h", and
2468 "parameters.h".
2469 (Target_selector::do_target_bfd_name): New function.
2470 (print_output_format): New function.
2471 * target-select.h (class Target_selector): Update declarations.
2472 (Target_selector::target_bfd_name): New function.
2473 (print_output_format): Declare.
2474 * main.cc: Include "target-select.h".
2475 (main): Handle --print-output-format.
2476 * gold.cc: Include "target-select.h".
2477 (queue_initial_tasks): Handle --print-output-format when there are
2478 no input files.
2479 * parameters.cc (parameters_force_valid_target): Give a better
2480 error message if -EB/-EL does not match target.
2481 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2482 function.
2483
7d172687
ILT
24842011-07-15 Ian Lance Taylor <iant@google.com>
2485
2486 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2487 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2488 (Output_data_plt_i386::do_write): Write address of .dynamic
2489 section to first entry in .got.plt section.
2490 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2491 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2492 Initialize layout_.
2493 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2494 section to first entry in .got.plt section.
2495 * layout.h (Layout::dynamic_section): New function.
2496
e9552f7e
ST
24972011-07-13 Sriraman Tallam <tmsriram@google.com>
2498
2499 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2500 to claim_file call.
2501 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2502 input_section_position_, and input_section_glob_.
2503 (read_layout_from_file): Call function section_ordering_specified.
2504 * layout.h (is_section_ordering_specified): New function.
2505 (section_ordering_specified): New function.
2506 (section_ordering_specified_): New boolean member.
2507 * main.cc(main): Call load_plugins after layout object is defined.
2508 * output.cc (Output_section::add_input_section): Use
2509 function section_ordering_specified to check if section ordering is
2510 needed.
2511 * output.cc (Output_section::add_relaxed_input_section): Use
2512 function section_ordering_specified to check if section ordering is
2513 needed.
2514 (Output_section::update_section_layout): New function.
2515 (Output_section::sort_attached_input_sections): Check if input section
2516 must be reordered.
2517 * output.h (Output_section::update_section_layout): New function.
2518 * plugin.cc (get_section_count): New function.
2519 (get_section_type): New function.
2520 (get_section_name): New function.
2521 (get_section_contents): New function.
2522 (update_section_order): New function.
58797674 2523 (allow_section_ordering): New function.
e9552f7e
ST
2524 (Plugin::load): Add the new interfaces to the transfer vector.
2525 (Plugin_manager::load_plugins): New parameter.
2526 (Plugin_manager::all_symbols_read): New parameter.
2527 (Plugin_manager::claim_file): New parameter. Save the elf object for
2528 unclaimed objects.
2529 (Plugin_manager::get_elf_object): New function.
2530 (Plugin_manager::get_view): Change to directly use the bool to check
2531 if get_view is called from claim_file_hook.
2532 * plugin.h (input_objects): New function
2533 (Plugin__manager::load_plugins): New parameter.
2534 (Plugin_manager::claim_file): New parameter.
2535 (Plugin_manager::get_elf_object): New function.
2536 (Plugin_manager::in_claim_file_handler): New function.
2537 (Plugin_manager::in_claim_file_handler_): New member.
2538 (layout): New function.
2539 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2540 handler with an extra parameter. Make the elf object before calling
2541 claim_file handler.
2542 * testsuite/plugin_test.c (get_section_count): New function pointer.
2543 (get_section_type): New function pointer.
2544 (get_section_name): New function pointer.
2545 (get_section_contents): New function pointer.
2546 (update_section_order): New function pointer.
2547 (allow_section_ordering): New function pointer.
2548 (onload): Check if the new interfaces exist.
2549
9446efde
ILT
25502011-07-13 Ian Lance Taylor <iant@google.com>
2551
2552 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2553 relro section.
2554 * x86_64.cc (Target_x86_64::got_section): Likewise.
2555 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2556 (relro_now_test_SOURCES): New variable.
2557 (relro_now_test_DEPENDENCIES): New variable.
2558 (relro_now_test_LDFLAGS): New variable.
2559 (relro_now_test_LDADD): New variable.
2560 (relro_now_test.so): New target.
2561 * testsuite/Makefile.in: Rebuild.
2562
07aa62f2
ILT
25632011-07-12 Ian Lance Taylor <iant@google.com>
2564
2565 PR gold/12980
2566 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2567 GLOB_DAT relocation rather than a RELATIVE relocation for a
2568 protected symbol when creating a shared library.
2569 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2570 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2571 * testsuite/protected_main_1.cc (main): Test that protected
2572 function has same address.
2573
e2153196
ILT
25742011-07-11 Ian Lance Taylor <iant@google.com>
2575
2576 PR gold/12979
2577 * options.h (class General_options): Add -Bgroup.
2578 * options.cc (General_options::finalize): If -Bgroup is set,
2579 default to --unresolved-symbols=report-all.
2580 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2581 * target-reloc.h (issue_undefined_symbol_error): Handle
2582 --unresolved-symbols=report-all.
2583
6daf5215
ILT
25842011-07-08 Ian Lance Taylor <iant@google.com>
2585
2586 PR gold/11985
2587 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2588 if linker script discards key sections.
2589 (Layout::create_dynamic_symtab): Likewise.
2590 (Layout::assign_local_dynsym_offsets): Likewise.
2591 (Layout::sized_create_version_sections): Likewise.
2592 (Layout::create_interp): Likewise.
2593 (Layout::finish_dynamic_section): Likewise.
2594 (Layout::set_dynamic_symbol_size): Likewise.
2595
beabb2c6
ILT
25962011-07-08 Ian Lance Taylor <iant@google.com>
2597
2598 PR gold/12386
2599 * options.h (class General_options): Add --unresolved-symbols.
2600 * target-reloc.h (issue_undefined_symbol_error): Check
2601 --unresolved-symbols. Add comments.
2602
9c16daf1
ILT
26032011-07-08 Ian Lance Taylor <iant@google.com>
2604
2605 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2606 expression more complex.
2607
191f1a2d
ILT
26082011-07-08 Ian Lance Taylor <iant@google.com>
2609
2610 PR gold/11317
2611 * target-reloc.h (issue_undefined_symbol_error): New inline
2612 function, broken out of relocate_section.
2613 (relocate_section): Call issue_undefined_symbol_error.
2614 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2615 there is no TLS segment if we are about to issue an undefined
2616 symbol error.
2617 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2618
62855347
ILT
26192011-07-08 Ian Lance Taylor <iant@google.com>
2620
2621 PR gold/12279
2622 * resolve.cc (Symbol_table::should_override): Add fromtype
2623 parameter. Change all callers. Give error when linking together
2624 TLS and non-TLS symbol.
2625 (Symbol_table::should_override_with_special): Add fromtype
2626 parameter. Change all callers.
2627 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2628 there is no TLS segment if we have reported some errors.
2629 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2630
67181c72
ILT
26312011-07-08 Ian Lance Taylor <iant@google.com>
2632
2633 PR gold/12372
2634 * target.h (Target::plt_address_for_global): New function.
2635 (Target::plt_address_for_local): New function.
2636 (Target::plt_section_for_global): Remove.
2637 (Target::plt_section_for_local): Remove.
2638 (Target::do_plt_address_for_global): New virtual function.
2639 (Target::do_plt_address_for_local): New virtual function.
2640 (Target::do_plt_section_for_global): Remove.
2641 (Target::do_plt_section_for_local): Remove.
2642 (Target::register_global_plt_entry): Add Symbol_table and Layout
2643 parameters.
2644 * output.cc (Output_data_got::Got_entry::write): Use
2645 plt_address_for_global and plt_address_for_local.
2646 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2647 address of output section.
2648 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2649 got_irelative_, and irelative_count_ fields. Update
2650 declarations.
2651 (Output_data_plt_i386::has_irelative_section): New function.
2652 (Output_data_plt_i386::entry_count): Add irelative_count_.
2653 (Output_data_plt_i386::set_final_data_size): Likewise.
2654 (class Target_i386): Add got_irelative_ and rel_irelative_
2655 fields. Update declarations.
2656 (Target_i386::Target_i386): Initialize new fields.
2657 (Target_i386::do_plt_address_for_global): New function replacing
2658 do_plt_section_for_global.
2659 (Target_i386::do_plt_address_for_local): New function replacing
2660 do_plt_section_for_local.
2661 (Target_i386::got_section): Create got_irelative_.
2662 (Target_i386::rel_irelative_section): New function.
2663 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2664 fields. Don't define __rel_iplt_{start,end}.
2665 (Output_data_plt_i386::add_entry): Add symtab and layout
2666 parameters. Change all callers. Use different PLT and GOT for
2667 IFUNC symbols.
2668 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2669 layout parameters. Change all callers. Use different PLT and
2670 GOT.
2671 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2672 (Output_data_plt_i386::rel_irelative): New function.
2673 (Output_data_plt_i386::address_for_global): New function.
2674 (Output_data_plt_i386::address_for_local): New function.
2675 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2676 IRELATIVE GOT when changing IFUNC GOT entries.
2677 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2678 reloc.
2679 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2680 if we didn't create an IRELATIVE GOT.
2681 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2682 plt_address_for_local.
2683 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2684 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2685 got_irelative_, and irelative_count_ fields. Update
2686 declarations.
2687 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2688 Initialize new fields. Remove symtab parameter. Change all
2689 callers.
2690 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2691 irelative_count_.
2692 (Output_data_plt_x86_64::has_irelative_section): New function.
2693 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2694 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2695 fields. Update declarations.
2696 (Target_x86_64::Target_x86_64): Initialize new fields.
2697 (Target_x86_64::do_plt_address_for_global): New function replacing
2698 do_plt_section_for_global.
2699 (Target_x86_64::do_plt_address_for_local): New function replacing
2700 do_plt_section_for_local.
2701 (Target_x86_64::got_section): Create got_irelative_.
2702 (Target_x86_64::rela_irelative_section): New function.
2703 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2704 all callers. Don't create __rel_iplt_{start,end}.
2705 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2706 parameters. Change all callers. Use different PLT and GOT for
2707 IFUNC symbols.
2708 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2709 layout parameters. Change all callers. Use different PLT and
2710 GOT.
2711 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2712 parameters. Change all callers. Use different PLT and GOT for
2713 IFUNC symbols.
2714 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2715 (Output_data_plt_x86_64::rela_irelative): New function.
2716 (Output_data_plt_x86_64::address_for_global): New function.
2717 (Output_data_plt_x86_64::address_for_local): New function.
2718 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2719 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2720 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2721 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2722 parameters.
2723 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2724 reloc.
2725 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2726 symbols if we didn't create an IRELATIVE GOT.
2727 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2728 plt_address_for_local.
2729 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2730 * testsuite/ifuncvar1.c: New test file.
2731 * testsuite/ifuncvar2.c: New test file.
2732 * testsuite/ifuncvar3.c: New test file.
2733 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2734 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2735 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2736 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2737 * testsuite/Makefile.in: Rebuild.
2738
33c15b45
CC
27392011-07-07 Cary Coutant <ccoutant@google.com>
2740
2741 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2742 (two_file_test_1_ndebug.o): Likewise.
2743 (two_file_test_1b_ndebug.o): Likewise.
2744 (two_file_test_2_ndebug.o): Likewise.
2745 (two_file_test_main_ndebug.o): Likewise.
2746 (incremental_test_2): Link with no-debug versions.
2747
f48b5fb7
CC
27482011-07-06 Cary Coutant <ccoutant@google.com>
2749
2750 * gold/incremental.cc
2751 (Output_section_incremental_inputs::write_info_blocks): Check for
2752 hidden and internal symbols.
2753
221597a5
CC
27542011-07-06 Cary Coutant <ccoutant@google.com>
2755
2756 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2757 Check disposition for startup file.
2758 (Incremental_inputs::report_command_line): Ignore
2759 --incremental-startup-unchanged option.
2760 * options.cc (General_options::parse_incremental_startup_unchanged):
2761 New function.
2762 (General_options::General_options): Initialize new data member.
2763 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2764 (General_options): Add --incremental-startup-unchanged option.
2765 (General_options::incremental_startup_disposition): New function.
2766 (General_options::incremental_startup_disposition_): New data member.
2767
e24719f6
CC
27682011-07-06 Cary Coutant <ccoutant@google.com>
2769
2770 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2771 input file index to Script_info ctor.
2772 (Sized_incremental_binary::do_file_has_changed): Find the
2773 command-line argument for files named in scripts.
2774 * incremental.h (Script_info::Script_info): New ctor
2775 with input file index.
2776 (Script_info::input_file_index): New function.
2777 (Script_info::input_file_index_): New data member.
2778 (Incremental_binary::get_library): Add const.
2779 (Incremental_binary::get_script_info): Add const.
2780 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2781 * testsuite/Makefile.am (incremental_test_5): New test case.
2782 (incremental_test_6): New test case.
2783 * testsuite/Makefile.in: Regenerate.
2784
8f7c81e8
CC
27852011-07-06 Cary Coutant <ccoutant@google.com>
2786
2787 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2788 debug output when command lines differ.
2789
9fbd3822
CC
27902011-07-06 Cary Coutant <ccoutant@google.com>
2791
2792 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2793 --incremental-patch option.
2794 * layout.cc (Free_list::allocate): Extend allocation beyond original
2795 end if enabled.
2796 (Layout::make_output_section): Mark sections that should get
2797 patch space.
2798 * options.cc (parse_percent): New function.
2799 * options.h (parse_percent): New function.
2800 (DEFINE_percent): New macro.
2801 (General_options): Add --incremental-patch option.
2802 * output.cc (Output_section::Output_section): Initialize new data
2803 members.
2804 (Output_section::add_input_section): Print section name when out
2805 of patch space.
2806 (Output_section::add_output_section_data): Likewise.
2807 (Output_section::set_final_data_size): Add patch space when
2808 doing --incremental-full.
2809 (Output_section::do_reset_address_and_file_offset): Remove patch
2810 space.
2811 (Output_segment::set_section_list_addresses): Print debug output
2812 only if --incremental-update.
2813 * output.h (Output_section::set_is_patch_space_allowed): New function.
2814 (Output_section::is_patch_space_allowed_): New data member.
2815 (Output_section::patch_space_): New data member.
2816 * parameters.cc (Parameters::incremental_full): New function.
2817 * parameters.h (Parameters::incremental_full): New function
2818 * testsuite/Makefile.am (incremental_test_2): Add test for
2819 --incremental-patch option.
2820 * testsuite/Makefile.in: Regenerate.
2821 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2822 (t18): Remove function body.
2823
f6cccc2c
DK
28242011-07-05 Doug Kwan <dougkwan@google.com>
2825
2826 PR gold/12771
2827 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2828 Arm_Address type for relocation result.
2829 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2830 overflow check.
2831 (Arm_relocate_functions::abs32): Use unaligned access.
2832 (Arm_relocate_functions::rel32): Ditto.
2833 (Arm_relocate_functions::prel31): Ditto.
2834 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2835 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2836 static data relocations.
2837 * testsuite/Makefile.in: Regnerate.
2838 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2839
28a13fec
ILT
28402011-07-05 Ian Lance Taylor <iant@google.com>
2841
2842 PR gold/12392
2843 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2844 symbols if necessary.
2845 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2846
24d47b34
ILT
28472011-07-05 Ian Lance Taylor <iant@google.com>
2848
2849 PR gold/12952
2850 * resolve.cc (Symbol::override_base_with_special): Simply override
2851 version with special symbol version, ignoring previous version.
2852
41f9cbbe
ILT
28532011-07-05 Ian Lance Taylor <iant@google.com>
2854
2855 * object.cc (Sized_relobj_file::include_section_group): Add
2856 information to comment about signature location.
2857
886288f1
ILT
28582011-07-02 Ian Lance Taylor <iant@google.com>
2859
2860 PR gold/12957
2861 * options.h (class General_options): Add -f and -F.
2862 * options.cc (General_options::finalize): Fatal error if -f/-F
2863 are used without -shared.
2864 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2865
ae3a6d4f
ILT
28662011-07-02 Ian Lance Taylor <iant@google.com>
2867
2868 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2869
21131061
ILT
28702011-07-01 Ian Lance Taylor <iant@google.com>
2871
2872 PR gold/12525
2873 PR gold/12952
2874 * resolve.cc (Symbol::override_base_with_special): Don't override
2875 the version if the overriding symbol has a different name.
2876 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2877 all callers. If we give an error about an undefined version,
2878 define the base version if necessary.
2879 * dynobj.h (class Versions): Update declaration.
2880 * testsuite/weak_alias_test_5.cc: New file.
2881 * testsuite/weak_alias_test.script: New file.
2882 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2883 and versioned_alias have the right value, and call t2.
2884 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2885 weak_alias_test_5.so.
2886 (weak_alias_test_LDADD): Likewise.
2887 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2888 * testsuite/Makefile.in: Rebuild.
2889
611062c0
ILT
28902011-07-01 Ian Lance Taylor <iant@google.com>
2891
2892 PR gold/12525
2893 * options.h (class General_options): Support -z notext.
2894 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2895 -Wl,-z,notext.
2896 (two_file_shared_nonpic.so): Likewise.
2897 (two_file_shared_mixed.so): Likewise.
2898 (two_file_shared_mixed_1.so): Likewise.
2899 (weak_undef_lib_nonpic.so): Likewise.
2900 (alt/weak_undef_lib_nonpic.so): Likewise.
2901 (tls_test_shared_nonpic.so): Likewise.
2902 * testsuite/Makefile.in: Rebuild.
2903
328c7c2f
ILT
29042011-07-01 Ian Lance Taylor <iant@google.com>
2905
2906 PR gold/12525
2907 * configure.ac: Test whether static linking works, setting
2908 the automake conditional HAVE_STATIC.
2909 * testsuite/Makefile.am: Disable tests using -static if
2910 HAVE_STATIC is not true.
2911 * configure, testsuite/Makefile.in: Rebuild.
2912
02d7cd44
ILT
29132011-07-01 Ian Lance Taylor <iant@google.com>
2914
2915 PR gold/12525
2916 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2917 Assert if we see DW_EH_PE_indirect.
2918 * target.h (Target::ehframe_datarel_base): New function.
2919 (Target::do_ehframe_datarel_base): New target function.
2920 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2921 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2922 function.
2923
07a60597
ILT
29242011-07-01 Ian Lance Taylor <iant@google.com>
2925
2926 PR gold/12571
2927 * options.h (class General_options): Add
2928 --ld-generated-unwind-info.
2929 * ehframe.cc (Fde::write): Add address parameter. Change all
2930 callers. If associated with PLT, fill in address and size.
2931 (Cie::set_output_offset): Only add merge mapping if there is an
2932 object.
2933 (Cie::write): Add address parameter. Change all callers.
2934 (Eh_frame::add_ehframe_for_plt): New function.
2935 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2936 input_offset_ fields into union u_, with new plt field.
2937 (Fde::Fde): Adjust for new union field.
2938 (Fde::Fde) [Output_data version]: New constructor.
2939 (Fde::add_mapping): Only add merge mapping if there is an object.
2940 (class Cie): Update declarations.
2941 (class Eh_frame): Declare add_ehframe_for_plt.
2942 * layout.cc (Layout::layout_eh_frame): Break out code into
2943 make_eh_frame_section, and call it.
2944 (Layout::make_eh_frame_section): New function.
2945 (Layout::add_eh_frame_for_plt): New function.
2946 * layout.h (class Layout): Update declarations.
2947 * merge.cc (Merge_map::add_mapping): Add assertion.
2948 * i386.cc: Include "dwarf.h".
2949 (class Output_data_plt_i386): Make first_plt_entry,
2950 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2951 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2952 and plt_eh_frame_fde.
2953 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2954 boundary. Call add_eh_frame_for_plt if appropriate.
2955 * x86_64.cc: Include "dwarf.h".
2956 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2957 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2958 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2959 and plt_eh_frame_fde.
2960 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2961 appropriate.
2962
14788a3f
ILT
29632011-06-29 Ian Lance Taylor <iant@google.com>
2964
2965 PR gold/12629
2966 * object.cc (Sized_relobj_file::layout_section): Change shdr
2967 parameter to be const.
2968 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2969 out of do_layout.
2970 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2971 appropriate. Call layout_eh_frame_section.
2972 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2973 sections.
2974 * object.h (class Sized_relobj_file): Update declarations.
2975
6c21fce1
ILT
29762011-06-29 Ian Lance Taylor <iant@google.com>
2977
37e41b03 2978 PR gold/12652
6c21fce1
ILT
2979 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2980 modifier.
2981 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2982
4d5e4e62
ILT
29832011-06-29 Ian Lance Taylor <iant@google.com>
2984
2985 PR gold/12675
2986 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2987 SHT_X86_64_UNWIND.
2988 * layout.cc (Layout::layout_eh_frame): Likewise.
2989
886f533a
ILT
29902011-06-29 Ian Lance Taylor <iant@google.com>
2991
2992 PR gold/12695
2993 * layout.cc (Layout::symtab_section_shndx): New function.
2994 * layout.h (class Layout): Declare symtab_section_shndx.
2995 * output.cc (Output_section::write_header): Call it.
2996
f3ae1b28
ILT
29972011-06-29 Ian Lance Taylor <iant@google.com>
2998
2999 PR gold/12818
3000 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3001 symbols which are not used in a relocation.
3002
aecf301f
ILT
30032011-06-28 Ian Lance Taylor <iant@google.com>
3004
3005 PR gold/12898
3006 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3007 script create indistinguishable segments.
3008 (Layout::set_segment_offsets): Use stable_sort when sorting
3009 segments. Pass this to Compare_segments constructor.
3010 * layout.h (class Layout): Make segment_precedes non-static.
3011 (class Compare_segments): Change from struct to class. Add
3012 layout_ field. Add constructor.
3013 * script-sections.cc
3014 (Script_sections::attach_sections_using_phdrs_clause): Rename
3015 local orphan to is_orphan. Don't report failure to put empty
3016 section in segment. On attachment failure, report name of
3017 section, and attach to first PT_LOAD segment.
3018
03ef7571
ILT
30192011-06-28 Ian Lance Taylor <iant@google.com>
3020
3021 PR gold/12934
3022 * target-select.cc (Target_selector::Target_selector): Add
3023 emulation parameter. Change all callers.
3024 (select_target_by_bfd_name): Rename from select_target_by_name.
3025 Change all callers.
3026 (select_target_by_emulation): New function.
3027 (supported_emulation_names): New function.
3028 * target-select.h (class Target_selector): Add emulation_ field.
3029 Update declarations.
3030 (Target_selector::recognize_by_bfd_name): Rename from
3031 recognize_by_name. Change all callers.
3032 (Target_selector::supported_bfd_names): Rename from
3033 supported_names. Change all callers.
3034 (Target_selector::recognize_by_emulation): New function.
3035 (Target_selector::supported_emulations): New function.
3036 (Target_selector::emulation): New function.
3037 (Target_selector::do_recognize_by_bfd_name): Rename from
3038 do_recognize_by_name. Change all callers.
3039 (Target_selector::do_supported_bfd_names): Rename from
3040 do_supported_names. Change all callers.
3041 (Target_selector::do_recognize_by_emulation): New function.
3042 (Target_selector::do_supported_emulations): New function.
3043 (select_target_by_bfd_name): Change name in declaration.
3044 (select_target_by_emulation): Declare.
3045 (supported_emulation_names): Declare.
3046 * parameters.cc (parameters_force_valid_target): Try to find
3047 target based on emulation from -m option.
3048 * options.h (class General_options): Change doc string for -m.
3049 * options.cc (help): Print emulations.
3050 (General_options::parse_V): Likewise.
3051 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3052 Add emulation parameter. Change all callers.
3053
200b2bb9
ILT
30542011-06-28 Ian Lance Taylor <iant@google.com>
3055
3056 * target.h (class Target): Add osabi_ field.
3057 (Target::osabi): New function.
3058 (Target::set_osabi): New function.
3059 (Target::Target): Initialize osabi_.
3060 (Target::do_adjust_elf_header): Make pure virtual.
3061 (Sized_target::do_adjust_elf_header): Declare.
3062 * target.cc (Sized_target::do_adjust_elf_header): New function.
3063 (class Sized_target): Instantiate all versions.
3064 * freebsd.h (class Target_freebsd): Remove.
3065 (Target_selector_freebsd::do_recognize): Call set_osabi on
3066 Target.
3067 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3068 (Target_selector_freebsd::set_osabi): Remove.
3069 * i386.cc (class Target_i386): Inherit from Sized_target rather
3070 than Target_freebsd.
3071 * x86_64.cc (class Target_x86_64): Likewise.
3072
b3ce541e
ILT
30732011-06-28 Ian Lance Taylor <iant@google.com>
3074
3075 * target.h (Target::can_check_for_function_pointers): Rewrite.
3076 Make non-virtual.
3077 (Target::can_icf_inline_merge_sections): Likewise.
3078 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3079 (Target::Target_info): Add can_icf_inline_merge_sections field.
3080 (Target::do_can_check_for_function_pointers): New virtual
3081 function.
3082 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3083 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3084 from can_check_for_function_pointers, move in file.
3085 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3086 section_may_have_icf_unsafe_poineters, move in file.
3087 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3088 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3089 Rename from can_check_for_function_pointers, move in file.
3090 (Target_i386::can_icf_inline_merge_sections): Remove.
3091 (Target_i386::i386_info): Initialize
3092 can_icf_inline_merge_sections.
3093 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3094 Initialize can_icf_inline_merge_sections.
3095 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3096 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3097 Rename from can_check_for_function_pointers, move in file.
3098 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3099 (Target_x86_64::x86_64_info): Initialize
3100 can_icf_inline_merge_sections.
3101 * testsuite/testfile.cc (Target_test::test_target_info):
3102 Likewise.
3103 * icf.cc (get_section_contents): Correct formatting.
3104
6d1c4efb
ILT
31052011-06-27 Ian Lance Taylor <iant@google.com>
3106
3107 * symtab.cc (Symbol::versioned_name): New function.
3108 (Symbol_table::add_to_final_symtab): Use versioned_name when
3109 appropriate.
3110 (Symbol_table::sized_write_symbol): Likewise.
3111 * symtab.h (class Symbol): Declare versioned_name.
3112 * stringpool.h (class Stringpool_template): Add variant of add
3113 which takes a std::basic_string.
3114 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3115 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3116 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3117 (ver_test_12.o): New target.
3118 * testsuite/Makefile.in: Rebuild.
3119
57eb9b50
DK
31202011-06-27 Doug Kwan <dougkwan@google.com>
3121
3122 * arm.cc (Arm_relocate_functions::thm_jump8,
3123 Arm_relocate_functions::thm_jump11): Use a wider signed
3124 type to compute offset.
3125 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3126 arm_thm_jump8.
3127 * testsuite/Makefile.in: Regenerate.
3128 * testsuite/arm_branch_in_range.sh: Check test results of
3129 arm_thm_jump11 and arm_thm_jump8.
3130 * testsuite/arm_thm_jump11.s: New test source file.
3131 * testsuite/arm_thm_jump11.t: New linker script.
3132 * testsuite/arm_thm_jump8.s: New test source file.
3133 * testsuite/arm_thm_jump8.t: New linker script.
3134
487b39df
ILT
31352011-06-24 Ian Lance Taylor <iant@google.com>
3136
3137 * layout.cc: Include "object.h".
3138 (ctors_sections_in_init_array): New static variable.
3139 (Layout::is_ctors_in_init_array): New function.
3140 (Layout::layout): Add entry to ctors_sections_in_init_array if
3141 appropriate.
3142 * layout.h (class Layout): Declare is_ctors_in_init_array.
3143 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3144 is_ctors_reverse_view is set.
3145 (Sized_relobj_file::write_sections): Add layout parameter. Change
3146 all callers. Set is_ctors_reverse_view field of View_size.
3147 (Sized_relobj_file::reverse_words): New function.
3148 * object.h (Sized_relobj_file::View_size): Add
3149 is_ctors_reverse_view field.
3150 (class Sized_relobj_file): Update declarations.
3151 * testsuite/initpri3.c: New test.
3152 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3153 initpri3b.
3154 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3155 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3156 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3157 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3158 * testsuite/Makefile.in: Rebuild.
3159
472076e4
CC
31602011-06-24 Cary Coutant <ccoutant@google.com>
3161
3162 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3163 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3164 (debug_msg_cdebug.err): New targets.
3165 * testsuite/Makefile.in: Regenerate.
3166 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3167 Fix checks for link with shared library.
3168
a60af0db
DK
31692011-06-24 Doug Kwan <dougkwan@google.com>
3170
3171 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3172 skip empty text sections.
3173 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3174
5393d741
ILT
31752011-06-22 Ian Lance Taylor <iant@google.com>
3176
3177 PR gold/12910
3178 * options.h (class General_options): Add --ctors-in-init-array.
3179 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3180 friends as SHT_PROGBITS for merging sections.
3181 (Layout::layout): Remove special handling of .init_array and
3182 friends. Don't sort if doing relocatable link. Sort for .ctors
3183 and .dtors if ctors_in_init_array.
3184 (Layout::make_output_section): Force correct section types for
3185 .init_array and friends. Don't sort if doing relocatable link,
3186 Don't sort .ctors and .dtors if ctors_in_init_array.
3187 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3188 (Layout::output_section_name): Add relobj parameter. Change all
3189 callers. Handle .ctors. and .dtors. in code rather than table.
3190 Handle .ctors and .dtors if ctors_in_init_array.
3191 (Layout::match_file_name): New function, moved from output.cc.
3192 * layout.h (class Layout): Update declarations.
3193 * output.cc: Include "layout.h".
3194 (Input_section_sort_entry::get_priority): New function.
3195 (Input_section_sort_entry::match_file_name): Just call
3196 Layout::match_file_name.
3197 (Output_section::Input_section_sort_init_fini_compare::operator()):
3198 Handle .ctors and .dtors. Sort by explicit priority rather than
3199 by name.
3200 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3201 * testsuite/initpri2.c: New test.
3202 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3203 (check_PROGRAMS): Add initpri2.
3204 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3205 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3206 * configure, testsuite/Makefile.in: Rebuild.
3207
e1f74f98
ILT
32082011-06-19 Ian Lance Taylor <iant@google.com>
3209
3210 PR gold/12880
3211 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3212 .interp section to a PT_INTERP segment even if we have seen a
3213 --dynamic-linker option. Don't do it if we have seen a PHDRS
3214 clause in a linker script.
3215 (Layout::finalize): Don't create a .interp section if we've
3216 already create a PT_INTERP segment.
3217 (Layout::create_interp): Always call choose_output_section (revert
3218 patch of 2011-06-17). Don't create PT_INTERP segment.
3219 * script-sections.cc
3220 (Script_sections::create_note_and_tls_segments): Add a .interp
3221 section to a PT_INTERP segment even if we have seen a
3222 --dynamic-linker option.
3223
766f91bb
ILT
32242011-06-18 Ian Lance Taylor <iant@google.com>
3225
3226 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3227 merely because a non-PT_LOAD segment has a dynamic reloc.
3228
0d212c3a
ILT
32292011-06-18 Ian Lance Taylor <iant@google.com>
3230
3231 * layout.cc (Layout::finish_dynamic_section): Don't create
3232 DT_FLAGS entry if not needed.
3233
911a5072
ILT
32342011-06-18 Ian Lance Taylor <iant@google.com>
3235
3236 PR gold/12745
3237 * layout.cc (Layout::layout_eh_frame): Correct handling of
3238 writable .eh_frame section.
3239
534b4e5f
ILT
32402011-06-17 Ian Lance Taylor <iant@google.com>
3241
3242 PR gold/12893
3243 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3244 symbol is redefined with the exact same object and value.
3245
10b4f102
ILT
32462011-06-17 Ian Lance Taylor <iant@google.com>
3247
3248 PR gold/12880
3249 * layout.h (class Layout): Add interp_segment_ field.
3250 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3251 (Layout::attach_allocated_section_to_segment): If making shared
3252 library, put .interp section in PT_INTERP segment.
3253 (Layout::finalize): Also call create_interp if -dynamic-linker
3254 option was used.
3255 (Layout::create_interp): Assert that there is no PT_INTERP
3256 segment. If not using a SECTIONS clause, use make_output_section.
3257 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3258 * script-sections.cc
3259 (Script_sections::create_note_and_tls_segments): If making shared
3260 library, put .interp section in PT_INTERP segment.
3261
a29b0dad
ILT
32622011-06-17 Ian Lance Taylor <iant@google.com>
3263
e588ea8d
ILT
3264 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3265 when making a shared library.
3266
32672011-06-17 Ian Lance Taylor <iant@google.com>
3268
3269 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3270 parameter. Change all callers. Don't issue warning about PC32
3271 against locally defined symbol.
a29b0dad 3272
9d3b0698
ILT
32732011-06-16 Ian Lance Taylor <iant@google.com>
3274
3275 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3276 occurs in same object.
3277
85b0f90c
AM
32782011-06-14 Alan Modra <amodra@gmail.com>
3279
3280 * po/POTFILES.in: Regenerate.
3281
a94907d9
ILT
32822011-06-09 Ian Lance Taylor <iant@google.com>
3283
3284 * script-sections.cc
3285 (Orphan_output_section::set_section_addresses): For a relocatable
3286 link set address to 0.
3287
4fb3a1c3
CC
32882011-06-09 Cary Coutant <ccoutant@google.com>
3289
3290 PR gold/12804
3291 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3292 used with --compress-debug-sections.
3293 * gold/object.cc (Sized_relobj_file::do_layout): Report
3294 uncompressed size of compressed input sections.
3295
61220854
CC
32962011-06-08 Cary Coutant <ccoutant@google.com>
3297
3298 PR gold/12804
3299 * testsuite/two_file_test_2_v1.cc: Change initialization of
3300 v2 to keep it in .data.
3301
e6455dfb
CC
33022011-06-07 Cary Coutant <ccoutant@google.com>
3303
3304 * common.cc (Symbol_table::do_allocate_commons_list): Call
3305 gold_fallback.
3306 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3307 (Errors::fallback): New function.
3308 (gold_fallback): New function.
3309 * errors.h (Errors::fallback): New function.
3310 * gold.cc (gold_exit): Change status parameter to enum; adjust
3311 all callers.
3312 (queue_initial_tasks): Call gold_fallback.
3313 * gold.h: Include cstdlib.
3314 (Exit_status): New enum type.
3315 (gold_exit): Change status parameter to enum.
3316 (gold_fallback): New function.
3317 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3318 (Layout::create_symtab_sections): Likewise.
3319 (Layout::create_shdrs): Likewise.
3320 * main.cc (main): Adjust call to gold_exit.
3321 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3322 (Output_data_got::add_got_entry_pair): Likewise.
3323 (Output_section::add_input_section): Likewise.
3324 (Output_section::add_output_section_data): Likewise.
3325 (Output_segment::set_section_list_addresses): Likewise.
3326 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3327
fb0e076f
CC
33282011-06-07 Cary Coutant <ccoutant@google.com>
3329
3330 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3331 for incremental links.
3332 * output.cc (Output_segment::set_section_list_addresses): Remove
3333 FIXME and test for TLS or BSS.
3334
a5ee4d5d
CC
33352011-06-07 Cary Coutant <ccoutant@google.com>
3336
3337 * testsuite/Makefile.am: Add incremental_copy_test,
3338 incremental_common_test_1.
3339 * testsuite/Makefile.in: Regenerate.
3340 * testsuite/common_test_1_v1.c: New source file.
3341 * testsuite/common_test_1_v2.c: New source file.
3342 * testsuite/copy_test_v1.cc: New source file.
3343
5146f448
CC
33442011-06-07 Cary Coutant <ccoutant@google.com>
3345
3346 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3347 update, allocate common from bss section's free list.
3348 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3349 linker-defined symbols.
3350 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3351 Skip GOT and PLT entries that are no longer referenced.
3352 (Output_section_incremental_inputs::write_info_blocks): Mark
3353 linker-defined symbols.
3354 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3355 * output.cc (Output_section::allocate): New function.
3356 * output.h (Output_section::allocate): New function.
3357 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3358 linker-defined symbols.
3359 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3360 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3361 (Symbol::init_base_output_data): Likewise.
3362 (Symbol::init_base_output_segment): Likewise.
3363 (Symbol::init_base_constant): Likewise.
3364 (Sized_symbol::init_output_data): Likewise.
3365 (Sized_symbol::init_output_segment): Likewise.
3366 (Sized_symbol::init_constant): Likewise.
3367 (Symbol_table::do_define_in_output_data): Likewise.
3368 (Symbol_table::do_define_in_output_segment): Likewise.
3369 (Symbol_table::do_define_as_constant): Likewise.
3370 * symtab.h (Symbol::is_predefined): New function.
3371 (Symbol::init_base_output_data): Add is_predefined parameter.
3372 (Symbol::init_base_output_segment): Likewise.
3373 (Symbol::init_base_constant): Likewise.
3374 (Symbol::is_predefined_): New data member.
3375 (Sized_symbol::init_output_data): Add is_predefined parameter.
3376 (Sized_symbol::init_output_segment): Likewise.
3377 (Sized_symbol::init_constant): Likewise.
3378 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3379
26d3c67d
CC
33802011-06-07 Cary Coutant <ccoutant@google.com>
3381
3382 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3383 instead of emit_copy_reloc.
3384 (Copy_relocs::emit_copy_reloc): Refactor.
3385 (Copy_relocs::make_copy_reloc): New function.
3386 (Copy_relocs::add_copy_reloc): Remove.
3387 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3388 section.
3389 (Copy_relocs::make_copy_reloc): New function.
3390 (Copy_relocs::add_copy_reloc): Remove.
3391 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3392 unchanged input files.
3393 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3394 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3395 Reserve BSS space for COPY relocations.
3396 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3397 (Output_section_incremental_inputs::write_info_blocks): Record
3398 whether a symbol is copied from a shared object.
3399 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3400 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3401 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3402 (Incremental_input_entry_reader::get_output_symbol_index): Add
3403 is_copy parameter.
3404 (Incremental_binary::emit_copy_relocs): New function.
3405 (Incremental_binary::do_emit_copy_relocs): New function.
3406 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3407 new data member.
3408 (Sized_incremental_binary::add_copy_reloc): New function.
3409 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3410 (Sized_incremental_binary::Copy_reloc): New struct.
3411 (Sized_incremental_binary::Copy_relocs): New typedef.
3412 (Sized_incremental_binary::copy_relocs_): New data member.
3413 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3414 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3415 * target.h (Sized_target::emit_copy_reloc): New function.
3416 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3417
7cdb37d9
CC
34182011-06-02 Cary Coutant <ccoutant@google.com>
3419
3420 PR gold/12163
3421 * gold/archive.cc (Archive::Archive): Initialize new data member.
3422 (Archive::include_all_members): Return if archive has already been
3423 included.
3424 * gold/archive.h (Archive::include_all_members_): New data member.
3425
cc643b88
NC
34262011-06-02 Nick Clifton <nickc@redhat.com>
3427
3428 * dynobj.h: Fix spelling mistake in comment.
3429 * output.cc: Likewise.
3430
f62a3ca7 34312011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3432 Asier Llano
f62a3ca7
DK
3433
3434 PR gold/12826
cc643b88 3435 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3436 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3437 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3438 redundant arm_exidx_test.so.
3439 * testsuite/Makefile.in: Regenerate.
3440 (check_SCRIPTS): Add pr12826.sh
3441 (check_DATA): Add pr12826.stdout
3442 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3443 * testsuite/pr12826.sh: New file.
3444 * testsuite/pr12826_1.s: Ditto.
3445 * testsuite/pr12826_1.s: Ditto.
3446
8dbe1edc
ILT
34472011-05-30 Ian Lance Taylor <iant@google.com>
3448
3449 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3450 sections.
3451
c49875be
ILT
34522011-05-29 Ian Lance Taylor <iant@google.com>
3453
3454 PR gold/12804
3455 * testsuite/Makefile.am: Use different file name for two_file_test
3456 temporary file for each incremental test.
3457 * testsuite/Makefile.in: Rebuild.
3458
69d53f7a
ILT
34592011-05-29 Ian Lance Taylor <iant@google.com>
3460
3461 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3462 binary input file is empty.
3463
41d0ab5f
ILT
34642011-05-27 Ian Lance Taylor <iant@google.com>
3465
3466 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3467 (ver_test_9.so): Likewise.
3468 * testsuite/Makefile.in: Rebuild.
3469
89d8a36b
CC
34702011-05-26 Cary Coutant <ccoutant@google.com>
3471
3472 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3473 * incremental.cc (Incremental_inputs::report_input_section): Fix
3474 comment, indentation.
3475 (Incremental_inputs::report_comdat_group): New function.
3476 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3477 of data for incremental input file entry.
3478 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3479 group count, COMDAT group signatures.
3480 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3481 an unchanged input file.
3482 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3483 Initialize new data member.
3484 (Incremental_object_entry::add_comdat_group): New function.
3485 (Incremental_object_entry::get_comdat_group_count): New function.
3486 (Incremental_object_entry::get_comdat_signature_key): New function.
3487 (Incremental_object_entry::groups_): New data member.
3488 (Incremental_inputs::report_comdat_group): New function.
3489 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3490 data for incremental input file entry.
3491 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3492 (Incremental_input_entry_reader::get_input_section): Adjust size of
3493 data for incremental input file entry.
3494 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3495 (Incremental_input_entry_reader::get_comdat_group_signature): New
3496 function.
3497 * object.cc (Sized_relobj::include_section_group): Report kept
3498 COMDAT groups for incremental links.
3499
1706a06f
ILT
35002011-05-24 David Meyer <pdox@google.com>
3501
3502 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3503 with name parameter. Add found_name parameter.
3504 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3505 * dirsearch.h (class Dirsearch): Update declaration.
3506
a10ae760
ILT
35072011-05-24 Ian Lance Taylor <iant@google.com>
3508
3509 * archive.cc (Library_base::should_include_member): Pull in object
3510 from archive if it defines the entry symbol.
3511 * parameters.cc (Parameters::entry): New function.
3512 * parameters.h (class Parameters): Declare entry.
3513 * output.h (class Output_file_header): Remove entry_ field.
3514 * output.cc (Output_file_header::Output_file_header): Remove entry
3515 parameter. Change all callers.
3516 (Output_file_header::entry): Use parameters->entry.
3517 * gold.cc (queue_middle_tasks): Likewise.
3518 * plugin.cc (Plugin_hook::run): Likewise.
3519
aa92d6ed
CC
35202011-05-24 Cary Coutant <ccoutant@google.com>
3521
3522 * gold.cc (queue_initial_tasks): Pass incremental base filename
3523 to Output_file::open_base_file; don't print error message.
3524 * incremental-dump.cc (main): Adjust call to
3525 Output_file::open_for_modification.
3526 * incremental-dump.cc (main): Likewise.
3527 * incremental.cc (Incremental_inputs::report_command_line):
3528 Ignore --incremental-base option when comparing command lines.
3529 Ignore parameter when given as separate argument.
3530 * options.h (class General_options): Add --incremental-base.
3531 * output.cc (Output_file::Output_file):
3532 (Output_file::open_base_file): Add base_name and writable parameters;
3533 read base file into new file; print error message here.
3534 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3535 callers.
3536 * output.h (Output_file::open_for_modification): Rename to...
3537 (Output_file::open_base_file): ...this; add base_name and
3538 writable parameters; adjust all callers.
3539 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3540 callers.
3541 * testsuite/Makefile.am (incremental_test_4): Test
3542 --incremental-base.
3543 * testsuite/Makefile.in: Regenerate.
3544
2eedd706
CC
35452011-05-24 Cary Coutant <ccoutant@google.com>
3546
3547 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3548 incremental_test_4.
3549 * testsuite/Makefile.in: Regenerate.
3550 * testsuite/two_file_test_1_v1.cc: New test source file.
3551 * testsuite/two_file_test_1b_v1.cc: New test source file.
3552 * testsuite/two_file_test_2_v1.cc: New test source file.
3553
0f1c85a6
CC
35542011-05-24 Cary Coutant <ccoutant@google.com>
3555
3556 * dynobj.h (Dynobj::do_dynobj): New function.
3557 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3558 flag and soname for shared objects.
3559 * incremental.cc (Incremental_inputs::report_object): Make
3560 either Incremental_object_entry or Incremental_dynobj_entry; add
3561 soname to string table.
3562 (Incremental_inputs::report_input_section): Add assertion.
3563 (Output_section_incremental_inputs::set_final_data_size): Adjust
3564 type of input file entry for shared libraries; adjust size of
3565 shared library info entry.
3566 (Output_section_incremental_inputs::write_input_files): Write
3567 as_needed flag for shared libraries.
3568 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3569 of input file entry for shared libraries; write soname.
3570 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3571 soname from incremental info.
3572 * incremental.h (enum Incremental_input_flags): Add
3573 INCREMENTAL_INPUT_AS_NEEDED.
3574 (Incremental_input_entry::Incremental_input_entry): Initialize new
3575 data member.
3576 (Incremental_input_entry::set_as_needed): New function.
3577 (Incremental_input_entry::as_needed): New function.
3578 (Incremental_input_entry::do_dynobj_entry): New function.
3579 (Incremental_input_entry::as_needed_): New data member.
3580 (Incremental_object_entry::Incremental_object_entry): Don't check
3581 for shared library.
3582 (Incremental_object_entry::do_type): Likewise.
3583 (class Incremental_dynobj_entry): New class.
3584 (Incremental_input_entry_reader::as_needed): New function.
3585 (Incremental_input_entry_reader::get_soname): New function.
3586 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3587 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3588 size of shared library info entry.
58797674 3589 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3590 incremental link when adding DT_NEEDED entries.
3591 * object.h (Object::Object): Initialize new data member.
3592 (Object::dynobj): New function.
3593 (Object::set_as_needed): New function.
3594 (Object::as_needed): New function.
3595 (Object::do_dynobj): New function.
3596 (Object::as_needed_): New data member.
3597
6fa2a40b
CC
35982011-05-24 Cary Coutant <ccoutant@google.com>
3599
3600 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3601 info; adjust display of GOT entries.
3602 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3603 vector of input objects; remove file_status_.
3604 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3605 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3606 got_plt reader; call target hooks to reserve GOT entries.
3607 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3608 of input file info header and GOT info entry.
3609 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3610 relocation info.
3611 (Got_plt_view_info::got_descriptor): Remove.
3612 (Got_plt_view_info::sym_index): New data member.
3613 (Got_plt_view_info::input_index): New data member.
3614 (Local_got_offset_visitor::visit): Write input file index.
3615 (Global_got_offset_visitor::visit): Write 0 for input file index.
3616 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3617 with sym_index and input_index.
3618 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3619 incremental info GOT entry; replace got_descriptor with input_index.
3620 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3621 map from input file index to object.
3622 (Sized_relobj_incr::do_layout): Replace direct data member reference
3623 with accessor function.
3624 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3625 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3626 Adjust size of input file info header.
3627 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3628 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3629 (Incremental_input_entry_reader::get_input_section): Adjust size of
3630 input file info header.
3631 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3632 of incremental info GOT entry.
3633 (Incremental_got_plt_reader::get_got_desc): Remove.
3634 (Incremental_got_plt_reader::get_got_symndx): New function.
3635 (Incremental_got_plt_reader::get_got_input_index): New function.
3636 (Sized_incremental_binary::Sized_incremental_binary): Remove
3637 file_status_; add input_objects_.
3638 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3639 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3640 (Sized_incremental_binary::file_is_unchanged): Remove.
3641 (Sized_incremental_binary::set_input_object): New function.
3642 (Sized_incremental_binary::input_object): New function.
3643 (Sized_incremental_binary::file_status_): Remove.
3644 (Sized_incremental_binary::input_objects_): New data member.
3645 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3646 references.
3647 (Sized_relobj_incr::invalid_address): Move to base class.
3648 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3649 class.
3650 (Sized_relobj_incr::do_output_section_offset): Likewise.
3651 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3652 (Sized_relobj_incr::section_offsets_): Likewise.
3653 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3654 function.
3655 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3656 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3657 with accessor function.
3658 (Sized_relobj_file::do_layout): Likewise.
3659 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3660 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3661 (Sized_relobj_file::compute_final_local_value): Replace refs to
3662 section_offsets_ with accessor function.
3663 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3664 * object.h (Relobj::Relobj): Initialize new data members.
3665 (Relobj::add_dyn_reloc): New function.
3666 (Relobj::first_dyn_reloc): New function.
3667 (Relobj::dyn_reloc_count): New function.
3668 (Relobj::first_dyn_reloc_): New data member.
3669 (Relobj::dyn_reloc_count_): New data member.
3670 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3671 references.
3672 (Sized_relobj::Address): New typedef.
3673 (Sized_relobj::invalid_address): Move here from child class.
3674 (Sized_relobj::Sized_relobj): Initialize new data members.
3675 (Sized_relobj::sized_relobj): New function.
3676 (Sized_relobj::is_output_section_offset_invalid): Move here from
3677 child class.
3678 (Sized_relobj::get_output_section_offset): Likewise.
3679 (Sized_relobj::local_has_got_offset): Likewise.
3680 (Sized_relobj::local_got_offset): Likewise.
3681 (Sized_relobj::set_local_got_offset): Likewise.
3682 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3683 (Sized_relobj::clear_got_offsets): New function.
3684 (Sized_relobj::section_offsets): Move here from child class.
3685 (Sized_relobj::do_output_section_offset): Likewise.
3686 (Sized_relobj::do_set_section_offset): Likewise.
3687 (Sized_relobj::Local_got_offsets): Likewise.
3688 (Sized_relobj::local_got_offsets_): Likewise.
3689 (Sized_relobj::section_offsets_): Likewise.
3690 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3691 references.
3692 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3693 class.
3694 (Sized_relobj_file::sized_relobj): New function
3695 (Sized_relobj_file::local_has_got_offset): Move to base class.
3696 (Sized_relobj_file::local_got_offset): Likewise.
3697 (Sized_relobj_file::set_local_got_offset): Likewise.
3698 (Sized_relobj_file::get_output_section_offset): Likewise.
3699 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3700 (Sized_relobj_file::do_output_section_offset): Likewise.
3701 (Sized_relobj_file::do_set_section_offset): Likewise.
3702 (Sized_relobj_file::Local_got_offsets): Likewise.
3703 (Sized_relobj_file::local_got_offsets_): Likewise.
3704 (Sized_relobj_file::section_offsets_): Likewise.
3705 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3706 (all constructors).
3707 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3708 (Output_reloc::get_symbol_index): Likewise.
3709 (Output_reloc::local_section_offset): Likewise.
3710 (Output_reloc::get_address): Likewise.
3711 (Output_reloc::symbol_value): Likewise.
3712 (Output_data_got::reserve_slot): Move to class definition.
3713 (Output_data_got::reserve_local): New function.
3714 (Output_data_got::reserve_slot_for_global): Remove.
3715 (Output_data_got::reserve_global): New function.
3716 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3717 (all constructors, two instantiations).
3718 (Output_reloc::get_relobj): New function (two instantiations).
3719 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3720 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3721 (Output_data_reloc::add_global): Adjust type of relobj.
3722 (Output_data_reloc::add_global_relative): Likewise.
3723 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3724 (Output_data_reloc::add_local): Likewise.
3725 (Output_data_reloc::add_local_relative): Likewise.
3726 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3727 (Output_data_reloc::add_local_section): Likewise.
3728 (Output_data_reloc::add_output_section): Likewise.
3729 (Output_data_reloc::add_absolute): Likewise.
3730 (Output_data_reloc::add_target_specific): Likewise.
3731 (Output_data_got::reserve_slot): Move definition here.
3732 (Output_data_got::reserve_local): New function.
3733 (Output_data_got::reserve_global): New function.
3734 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3735 section_offsets_ with accessor function.
3736 (Sized_relobj_file::write_sections): Likewise.
3737 (Sized_relobj_file::do_relocate_sections): Likewise.
3738 * target.h (Sized_target::reserve_local_got_entry): New function.
3739 (Sized_target::reserve_global_got_entry): New function.
3740 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3741 (Target_x86_64::reserve_global_got_entry): New function.
3742 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3743
4829d394
CC
37442011-05-23 Cary Coutant <ccoutant@google.com>
3745
3746 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3747 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3748 bit when checking got_type.
3749 * incremental.cc (Sized_incremental_binary::setup_readers):
3750 Store symbol table and string table locations; initialize bit vector
3751 of file status flags.
3752 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3753 unchanged files.
3754 (Sized_incremental_binary::do_process_got_plt): New function.
3755 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3756 (Output_section_incremental_inputs::set_final_data_size): Record
3757 file index for each input file.
3758 (Output_section_incremental_inputs::write_got_plt): Store file index
3759 instead of input entry offset for each GOT entry.
3760 * incremental.h
3761 (Incremental_input_entry::Incremental_input_entry): Initialize new
3762 data member.
3763 (Incremental_input_entry::set_offset): Store file index.
3764 (Incremental_input_entry::get_file_index): New function.
3765 (Incremental_input_entry::file_index_): New data member.
3766 (Incremental_binary::process_got_plt): New function.
3767 (Incremental_binary::do_process_got_plt): New function.
3768 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3769 data members.
3770 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3771 (Sized_incremental_binary::set_file_is_unchanged): New function.
3772 (Sized_incremental_binary::file_is_unchanged): New function.
3773 (Sized_incremental_binary::do_process_got_plt): New function.
3774 (Sized_incremental_binary::file_status_): New data member.
3775 (Sized_incremental_binary::main_symtab_loc_): New data member.
3776 (Sized_incremental_binary::main_strtab_loc_): New data member.
3777 * output.cc (Output_data_got::Got_entry::write): Add case
3778 RESERVED_CODE.
3779 (Output_data_got::add_global): Call add_got_entry.
3780 (Output_data_got::add_global_plt): Likewise.
3781 (Output_data_got::add_global_with_rel): Likewise.
3782 (Output_data_got::add_global_with_rela): Likewise.
3783 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3784 (Output_data_got::add_global_pair_with_rela): Likewise.
3785 (Output_data_got::add_local): Call add_got_entry.
3786 (Output_data_got::add_local_plt): Likewise.
3787 (Output_data_got::add_local_with_rel): Likewise.
3788 (Output_data_got::add_local_with_rela): Likewise.
3789 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3790 (Output_data_got::add_local_pair_with_rela): Likewise.
3791 (Output_data_got::reserve_slot): New function.
3792 (Output_data_got::reserve_slot_for_global): New function.
3793 (Output_data_got::add_got_entry): New function.
3794 (Output_data_got::add_got_entry_pair): New function.
3795 (Output_section::add_output_section_data): Edit FIXME.
3796 * output.h
3797 (Output_section_data_build::Output_section_data_build): New
3798 constructor with size parameter.
3799 (Output_data_space::Output_data_space): Likewise.
3800 (Output_data_got::Output_data_got): Initialize new data member; new
3801 constructor with size parameter.
3802 (Output_data_got::add_constant): Call add_got_entry.
3803 (Output_data_got::reserve_slot): New function.
3804 (Output_data_got::reserve_slot_for_global): New function.
3805 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3806 (Output_data_got::add_got_entry): New function.
3807 (Output_data_got::add_got_entry_pair): New function.
3808 (Output_data_got::free_list_): New data member.
3809 * target.h (Sized_target::init_got_plt_for_update): New function.
3810 (Sized_target::register_global_plt_entry): New function.
3811 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3812 Initialize new data member; call init; add constructor with PLT count.
3813 (Output_data_plt_x86_64::init): New function.
3814 (Output_data_plt_x86_64::add_relocation): New function.
3815 (Output_data_plt_x86_64::reserve_slot): New function.
3816 (Output_data_plt_x86_64::free_list_): New data member.
3817 (Target_x86_64::init_got_plt_for_update): New function.
3818 (Target_x86_64::register_global_plt_entry): New function.
3819 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3820 incremental updates.
3821 (Output_data_plt_x86_64::add_relocation): New function.
3822 * testsuite/object_unittest.cc (Object_test): Set default options.
3823
ec69d6da
ILT
38242011-05-16 Ian Lance Taylor <iant@google.com>
3825
3826 * options.h (class General_options): Make -i a synonym for -r.
3827
732e31de
ILT
38282011-05-16 Ian Lance Taylor <iant@google.com>
3829
3830 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3831
403676b5
CC
38322011-05-10 Cary Coutant <ccoutant@google.com>
3833
3834 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3835 strip_all (-s).
3836
5b7b7d6e
ILT
38372011-05-06 Ian Lance Taylor <iant@google.com>
3838
3839 * layout.cc (Layout::layout): If the output section flags change,
3840 update the ordering.
3841
f0f9babf
CC
38422011-04-25 Cary Coutant <ccoutant@google.com>
3843
3844 * incremental-dump.cc (dump_incremental_inputs): Print local
3845 symbol info for each input file.
3846 * incremental.cc
3847 (Output_section_incremental_inputs::set_final_data_size): Add local
3848 symbol info to input file entries in incremental info.
3849 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3850 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3851 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3852 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3853 implementation.
3854 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3855 (Sized_incr_relobj::do_relocate): Write the local symbols.
3856 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3857 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3858 Adjust size of input file header.
3859 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3860 (Incremental_inputs_reader::get_local_symbol_count): New function.
3861 (Incremental_inputs_reader::get_input_section): Adjust size of input
3862 file header.
3863 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3864 (Sized_incr_relobj::This): New typedef.
3865 (Sized_incr_relobj::sym_size): New const data member.
3866 (Sized_incr_relobj::Local_symbol): New struct.
3867 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3868 (Sized_incr_relobj::do_local_symbol_offset): New function.
3869 (Sized_incr_relobj::local_symbol_count_): New data member.
3870 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3871 (Sized_incr_relobj::local_symbol_index_): New data member.
3872 (Sized_incr_relobj::local_symbol_offset_): New data member.
3873 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3874 (Sized_incr_relobj::local_symbols_): New data member.
3875 * object.h (Relobj::output_local_symbol_count): New function.
3876 (Relobj::local_symbol_offset): New function.
3877 (Relobj::do_output_local_symbol_count): New function.
3878 (Relobj::do_local_symbol_offset): New function.
3879 (Sized_relobj::do_output_local_symbol_count): New function.
3880 (Sized_relobj::do_local_symbol_offset): New function.
3881
d0a9ace3
ILT
38822011-04-22 Vladimir Simonov <sv@sw.ru>
3883
3884 * descriptors.cc (set_close_on_exec): New function.
3885 (Descriptors::open): Use set_close_on_exec.
3886 * output.cc (S_ISLNK): Define if not defined.
3887
94a3fc8b
CC
38882011-04-22 Cary Coutant <ccoutant@google.com>
3889
3890 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3891 global symbol map.
3892 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3893 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3894 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3895 relocations.
3896 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3897 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3898 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3899 * incremental.h
3900 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3901 function.
3902 (Incremental_binary::apply_incremental_relocs): New function.
3903 (Incremental_binary::do_apply_incremental_relocs): New function.
3904 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3905 data member.
3906 (Sized_incremental_binary::add_global_symbol): New function.
3907 (Sized_incremental_binary::global_symbol): New function.
3908 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3909 (Sized_incremental_binary::symbol_map_): New data member.
3910 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3911 * target.h (Sized_target::apply_relocation): New function.
3912 * target-reloc.h (apply_relocation): New function.
3913 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3914
c87e4302
DK
39152011-04-22 Doug Kwan <dougkwan@google.com>
3916
3917 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3918 flag of a SHT_ARM_EXIDX section.
2e702c99 3919 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3920 * testsuite/Makefile.in: Regenerate.
3921 * testsuite/arm_exidx_test.s: New file.
3922 * testsuite/arm_exidx_test.sh: Same.
3923
e7782cf6
CC
39242011-04-20 Cary Coutant <ccoutant@google.com>
3925
3926 PR gold/12689
3927 * archive.h (Incremental_archive_entry::Archive_member):
3928 Initialize arg_serial_ (second constructor).
3929
308ecdc7
ILT
39302011-04-17 Ian Lance Taylor <iant@google.com>
3931
3932 * object.cc (Relocate_info::location): Simplify location string.
3933 * errors.cc (Errors::error_at_location): Don't print program
3934 name.
3935 (Errors::warning_at_location): Likewise.
3936 (Errors::undefined_symbol): Likewise.
3937 * testsuite/debug_msg.sh: Update accordingly.
3938
bec5b579
CC
39392011-04-14 Cary Coutant <ccoutant@google.com>
3940
3941 * gold/layout.cc (Layout::symtab_section_offset): New function.
3942 * gold/layout.h (Layout::symtab_section_offset): New function.
3943 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3944
88597d34
ILT
39452011-04-12 Ian Lance Taylor <iant@google.com>
3946
3947 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3948 with MREMAP_MAYMOVE.
3949 * output.h (class Output_file): Add map_is_allocated_ field.
3950 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3951 not available, provide stubs. If mremap is not available, #define
3952 it to gold_mremap.
3953 (MREMAP_MAYMOVE): Define if not defined.
3954 (Output_file::Output_file): Initialize map_is_allocated_.
3955 (Output_file::resize): Check map_is_allocated_.
3956 (Output_file::map_anonymous): If mmap fails, use malloc.
3957 (Output_file::unmap): Don't do anything for an anonymous map.
3958 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3959 is not available, provide stubs.
3960 (File_read::View::~View): Use free rather than delete[].
3961 (File_read::make_view): Use malloc rather than new[]. If mmap
3962 fails, use malloc.
3963 (File_read::find_or_make_view): Use malloc rather than new[].
3964 * gold.h: Remove HAVE_REMAP code.
3965 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3966 exists. Rename mremap to gold_mremap. If mmap is not available
3967 don't do anything.
3968 * configure, config.in: Rebuild.
3969
11e361bc
ILT
39702011-04-11 Ian Lance Taylor <iant@google.com>
3971
3972 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3973 initialize local variable v.
3974
cdc29364
CC
39752011-04-11 Cary Coutant <ccoutant@google.com>
3976
3977 * archive.cc (Archive::include_member): Adjust call to
3978 report_object.
3979 (Add_archive_symbols::run): Track argument serial numbers.
3980 (Lib_group::include_member): Likewise.
3981 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3982 * archive.h (Incremental_archive_entry::Archive_member):
3983 Initialize arg_serial_.
3984 (Archive_member::arg_serial_): New data member.
3985 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3986 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3987 incremental link.
3988 (Sized_dynobj::do_for_all_local_got_entries): New function.
3989 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3990 function.
3991 * fileread.cc (get_mtime): New function.
3992 * fileread.h (get_mtime): New function.
3993 * gold.cc (queue_initial_tasks): Check for incremental update.
3994 (process_incremental_input): New function.
3995 (queue_middle_tasks): Don't force valid target for incremental
3996 update.
3997 * incremental-dump.cc (find_input_containing_global): Adjust
3998 size of symbol info entry.
3999 (dump_incremental_inputs): Dump argument serial number and
4000 in_system_directory flag; bias shndx by 1; print symbol names
4001 when dumping per-file symbol lists; use new symbol info readers.
4002 * incremental.cc
4003 (Output_section_incremental_inputs:update_data_size): New function.
4004 (Sized_incremental_binary::setup_readers): Setup input readers
4005 for each input file; build maps for files added from libraries
4006 and scripts.
4007 (Sized_incremental_binary::check_input_args): New function.
4008 (Sized_incremental_binary::do_check_inputs): Build map of argument
4009 serial numbers to input arguments.
4010 (Sized_incremental_binary::do_file_has_changed): Rename
4011 do_file_is_unchanged to this; compare file modification times.
4012 (Sized_incremental_binary::do_init_layout): New function.
4013 (Sized_incremental_binary::do_reserve_layout): New function.
4014 (Sized_incremental_binary::do_get_input_reader): Remove.
4015 (Sized_incremental_binary::get_symtab_view): New function.
4016 (Incremental_checker::can_incrementally_link_output_file): Remove.
4017 (Incremental_inputs::report_command_line): Exclude --debug options.
4018 (Incremental_inputs::report_archive_begin): Add parameter; track
4019 argument serial numbers; don't put input file entry for archive
4020 before archive members.
4021 (Incremental_inputs::report_archive_end): Put input file entry
4022 for archive after archive members.
4023 (Incremental_inputs::report_object): Add parameter; track argument
4024 serial numbers and in_system_directory flag.
4025 (Incremental_inputs::report_script): Add parameter; track argument
4026 serial numbers.
4027 (Output_section_incremental_inputs::set_final_data_size): Adjust
4028 size of symbol info entry; check for forwarding symbols.
4029 (Output_section_incremental_inputs::write_input_files): Write
4030 in_system_directory flag and argument serial number.
4031 (Output_section_incremental_inputs::write_info_blocks): Map section
4032 indices between incremental info and original input file; store
4033 input section index for each symbol.
4034 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4035 change operator() to visit().
4036 (class Global_got_offset_visitor): Likewise.
4037 (class Global_symbol_visitor_got_plt):
4038 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4039 classes.
4040 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4041 (Sized_incr_relobj::do_read_symbols): New function.
4042 (Sized_incr_relobj::do_layout): New function.
4043 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4044 (Sized_incr_relobj::do_add_symbols): New function.
4045 (Sized_incr_relobj::do_should_include_member): New function.
4046 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4047 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4048 (Sized_incr_relobj::do_section_size): New function.
4049 (Sized_incr_relobj::do_section_name): New function.
4050 (Sized_incr_relobj::do_section_contents): New function.
4051 (Sized_incr_relobj::do_section_flags): New function.
4052 (Sized_incr_relobj::do_section_entsize): New function.
4053 (Sized_incr_relobj::do_section_address): New function.
4054 (Sized_incr_relobj::do_section_type): New function.
4055 (Sized_incr_relobj::do_section_link): New function.
4056 (Sized_incr_relobj::do_section_info): New function.
4057 (Sized_incr_relobj::do_section_addralign): New function.
4058 (Sized_incr_relobj::do_initialize_xindex): New function.
4059 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4060 (Sized_incr_relobj::do_read_relocs): New function.
4061 (Sized_incr_relobj::do_gc_process_relocs): New function.
4062 (Sized_incr_relobj::do_scan_relocs): New function.
4063 (Sized_incr_relobj::do_count_local_symbols): New function.
4064 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4065 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4066 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4067 (Sized_incr_relobj::do_relocate): New function.
4068 (Sized_incr_relobj::do_set_section_offset): New function.
4069 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4070 (Sized_incr_dynobj::do_read_symbols): New function.
4071 (Sized_incr_dynobj::do_layout): New function.
4072 (Sized_incr_dynobj::do_add_symbols): New function.
4073 (Sized_incr_dynobj::do_should_include_member): New function.
4074 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4075 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4076 (Sized_incr_dynobj::do_section_size): New function.
4077 (Sized_incr_dynobj::do_section_name): New function.
4078 (Sized_incr_dynobj::do_section_contents): New function.
4079 (Sized_incr_dynobj::do_section_flags): New function.
4080 (Sized_incr_dynobj::do_section_entsize): New function.
4081 (Sized_incr_dynobj::do_section_address): New function.
4082 (Sized_incr_dynobj::do_section_type): New function.
4083 (Sized_incr_dynobj::do_section_link): New function.
4084 (Sized_incr_dynobj::do_section_info): New function.
4085 (Sized_incr_dynobj::do_section_addralign): New function.
4086 (Sized_incr_dynobj::do_initialize_xindex): New function.
4087 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4088 (make_sized_incremental_object): New function.
4089 (Incremental_library::copy_unused_symbols): New function.
4090 (Incremental_library::do_for_all_unused_symbols): New function.
4091 * incremental.h (enum Incremental_input_flags): New type.
4092 (class Incremental_checker): Remove.
4093 (Incremental_input_entry::Incremental_input_entry): Add argument
4094 serial number.
4095 (Incremental_input_entry::arg_serial): New function.
4096 (Incremental_input_entry::set_is_in_system_directory): New function.
4097 (Incremental_input_entry::is_in_system_directory): New function.
4098 (Incremental_input_entry::arg_serial_): New data member.
4099 (Incremental_input_entry::is_in_system_directory_): New data member.
4100 (class Script_info): Move here from script.h.
4101 (Script_info::Script_info): Add filename parameter.
4102 (Script_info::filename): New function.
4103 (Script_info::filename_): New data member.
4104 (Incremental_script_entry::Incremental_script_entry): Add argument
4105 serial number.
4106 (Incremental_object_entry::Incremental_object_entry): Likewise.
4107 (Incremental_object_entry::add_input_section): Build list of input
4108 sections with map to original shndx.
4109 (Incremental_object_entry::get_input_section_index): New function.
4110 (Incremental_object_entry::shndx_): New data member.
4111 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4112 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4113 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4114 serial number.
4115 (Incremental_inputs::report_archive_begin): Likewise.
4116 (Incremental_inputs::report_object): Likewise.
4117 (Incremental_inputs::report_script): Likewise.
4118 (class Incremental_global_symbol_reader): New class.
4119 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4120 and store flags and input file type.
4121 (Incremental_input_entry_reader::arg_serial): New function.
4122 (Incremental_input_entry_reader::type): Extract type from flags.
4123 (Incremental_input_entry_reader::is_in_system_directory): New function.
4124 (Incremental_input_entry_reader::get_input_section_count): Call
4125 accessor function for type.
4126 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4127 function for type; adjust size of global symbol entry.
4128 (Incremental_input_entry_reader::get_global_symbol_count): Call
4129 accessor function for type.
4130 (Incremental_input_entry_reader::get_object_count): Likewise.
4131 (Incremental_input_entry_reader::get_object_offset): Likewise.
4132 (Incremental_input_entry_reader::get_member_count): Likewise.
4133 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4134 (Incremental_input_entry_reader::get_member_offset): Likewise.
4135 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4136 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4137 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4138 (Incremental_input_entry_reader::get_global_symbol_reader): New
4139 function.
4140 (Incremental_input_entry_reader::get_output_symbol_index): New
4141 function.
4142 (Incremental_input_entry_reader::type_): Remove.
4143 (Incremental_input_entry_reader::flags_): New data member.
4144 (Incremental_inputs_reader::input_file_offset): New function.
4145 (Incremental_inputs_reader::input_file_index): New function.
4146 (Incremental_inputs_reader::input_file): Call input_file_offset.
4147 (Incremental_inputs_reader::input_file_at_offset): New function.
4148 (Incremental_relocs_reader::get_r_type): Reformat.
4149 (Incremental_relocs_reader::get_r_shndx): Reformat.
4150 (Incremental_relocs_reader::get_r_offset): Reformat.
4151 (Incremental_relocs_reader::data): New function.
4152 (Incremental_binary::Incremental_binary): Initialize new data members.
4153 (Incremental_binary::check_inputs): Add cmdline parameter.
4154 (Incremental_binary::file_is_unchanged): Remove.
4155 (Input_reader::arg_serial): New function.
4156 (Input_reader::get_unused_symbol_count): New function.
4157 (Input_reader::get_unused_symbol): New function.
4158 (Input_reader::do_arg_serial): New function.
4159 (Input_reader::do_get_unused_symbol_count): New function.
4160 (Input_reader::do_get_unused_symbol): New function.
4161 (Incremental_binary::input_file_count): New function.
4162 (Incremental_binary::get_input_reader): Change signature to use
4163 index instead of filename.
4164 (Incremental_binary::file_has_changed): New function.
4165 (Incremental_binary::get_input_argument): New function.
4166 (Incremental_binary::get_library): New function.
4167 (Incremental_binary::get_script_info): New function.
4168 (Incremental_binary::init_layout): New function.
4169 (Incremental_binary::reserve_layout): New function.
4170 (Incremental_binary::output_file): New function.
4171 (Incremental_binary::do_check_inputs): New function.
4172 (Incremental_binary::do_file_is_unchanged): Remove.
4173 (Incremental_binary::do_file_has_changed): New function.
4174 (Incremental_binary::do_init_layout): New function.
4175 (Incremental_binary::do_reserve_layout): New function.
4176 (Incremental_binary::do_input_file_count): New function.
4177 (Incremental_binary::do_get_input_reader): Change signature.
4178 (Incremental_binary::input_args_map_): New data member.
4179 (Incremental_binary::library_map_): New data member.
4180 (Incremental_binary::script_map_): New data member.
4181 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4182 new data members.
4183 (Sized_incremental_binary::output_section): New function.
4184 (Sized_incremental_binary::inputs_reader): Add const.
4185 (Sized_incremental_binary::symtab_reader): Add const.
4186 (Sized_incremental_binary::relocs_reader): Add const.
4187 (Sized_incremental_binary::got_plt_reader): Add const.
4188 (Sized_incremental_binary::get_symtab_view): New function.
4189 (Sized_incremental_binary::Inputs_reader): New typedef.
4190 (Sized_incremental_binary::Input_entry_reader): New typedef.
4191 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4192 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4193 (Sized_incremental_binary::do_file_has_changed): New function.
4194 (Sized_incremental_binary::do_init_layout): New function.
4195 (Sized_incremental_binary::do_reserve_layout): New function.
4196 (Sized_input_reader::Inputs_reader): Remove.
4197 (Sized_input_reader::Input_entry_reader): Remove.
4198 (Sized_input_reader::do_arg_serial): New function.
4199 (Sized_input_reader::do_get_unused_symbol_count): New function.
4200 (Sized_input_reader::do_get_unused_symbol): New function.
4201 (Sized_incremental_binary::do_input_file_count): New function.
4202 (Sized_incremental_binary::do_get_input_reader): Change signature;
4203 use index instead of filename.
4204 (Sized_incremental_binary::section_map_): New data member.
4205 (Sized_incremental_binary::input_entry_readers_): New data member.
4206 (class Sized_incr_relobj): New class.
4207 (class Sized_incr_dynobj): New class.
4208 (make_sized_incremental_object): New function.
4209 (class Incremental_library): New class.
4210 * layout.cc (Free_list::num_lists): New static data member.
4211 (Free_list::num_nodes): New static data member.
4212 (Free_list::num_removes): New static data member.
4213 (Free_list::num_remove_visits): New static data member.
4214 (Free_list::num_allocates): New static data member.
4215 (Free_list::num_allocate_visits): New static data member.
4216 (Free_list::init): New function.
4217 (Free_list::remove): New function.
4218 (Free_list::allocate): New function.
4219 (Free_list::dump): New function.
4220 (Free_list::print_stats): New function.
4221 (Layout_task_runner::run): Resize output file for incremental updates.
4222 (Layout::Layout): Initialize new data members.
4223 (Layout::set_incremental_base): New function.
4224 (Layout::init_fixed_output_section): New function.
4225 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4226 incremental updates.
4227 (Layout::create_gold_note): Do not create gold note section for
4228 incremental updates.
4229 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4230 for incremental updates.
4231 (Layout::set_section_offsets): For incremental updates, allocate space
4232 from free list.
4233 (Layout::create_symtab_sections): Layout with offsets relative to
4234 start of section; for incremental updates, allocate space from free
4235 list.
4236 (Layout::create_shdrs): For incremental updates, allocate space from
4237 free list.
4238 (Layout::finish_dynamic_section): For incremental updates, do not
4239 check --as-needed (fixed in subsequent patch).
4240 * layout.h (class Free_list): New class.
4241 (Layout::set_incremental_base): New function.
4242 (Layout::incremental_base): New function.
4243 (Layout::init_fixed_output_section): New function.
4244 (Layout::allocate): New function.
4245 (Layout::incremental_base_): New data member.
4246 (Layout::free_list_): New data member.
4247 * main.cc (main): Print Free_list statistics.
4248 * object.cc (Relobj::finalize_incremental_relocs): Add
4249 clear_counts parameter; clear counts only when clear_counts is set.
4250 (Sized_relobj::Sized_relobj): Initialize new base class.
4251 (Sized_relobj::do_layout): Don't report special sections.
4252 (Sized_relobj::do_for_all_local_got_entries): New function.
4253 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4254 symtab_off to all symbol table offsets.
4255 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4256 * object.h (class Got_offset_list): Move to top of file.
4257 (Object::Object): Allow case where input_file == NULL.
4258 (Object::~Object): Likewise.
4259 (Object::input_file): Assert that input_file != NULL.
4260 (Object::lock): Allow case where input_file == NULL.
4261 (Object::unlock): Likewise.
4262 (Object::is_locked): Likewise.
4263 (Object::token): Likewise.
4264 (Object::release): Likewise.
4265 (Object::is_incremental): New function.
4266 (Object::get_mtime): New function.
4267 (Object::for_all_local_got_entries): New function.
4268 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4269 (Object::set_is_in_system_directory): New function.
4270 (Object::is_in_system_directory): New function.
4271 (Object::do_is_incremental): New function.
4272 (Object::do_get_mtime): New function.
4273 (Object::do_for_all_local_got_entries): New function.
4274 (Object::is_in_system_directory_): New data member.
4275 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4276 (class Sized_relobj_base): New class.
4277 (class Sized_relobj): Derive from Sized_relobj_base.
4278 (class Sized_relobj::Symbols): Redeclare from base class.
4279 (class Sized_relobj::local_got_offset_list): Remove.
4280 (class Sized_relobj::Output_sections): Redeclare from base class.
4281 (class Sized_relobj::do_for_all_local_got_entries): New function.
4282 (class Sized_relobj::write_local_symbols): Add offset parameter.
4283 (class Sized_relobj::local_symbol_offset_): Update comment.
4284 (class Sized_relobj::local_dynsym_offset_): Update comment.
4285 * options.cc (Input_arguments::add_file): Remove const.
4286 * options.h (Input_file_argument::Input_file_argument):
4287 Initialize arg_serial_ (all constructors).
4288 (Input_file_argument::set_arg_serial): New function.
4289 (Input_file_argument::arg_serial): New function.
4290 (Input_file_argument::arg_serial_): New data member.
4291 (Input_arguments::Input_arguments): Initialize file_count_.
4292 (Input_arguments::add_file): Remove const.
4293 (Input_arguments::number_of_input_files): New function.
4294 (Input_arguments::file_count_): New data member.
4295 (Command_line::number_of_input_files): Call
4296 Input_arguments::number_of_input_files.
4297 * output.cc (Output_segment_headers::Output_segment_headers):
4298 Set current size.
4299 (Output_section::Input_section::current_data_size): New function.
4300 (Output_section::Output_section): Initialize new data members.
4301 (Output_section::add_input_section): Don't do merge sections for
4302 an incremental link; allocate space from free list for an
4303 incremental update.
4304 (Output_section::add_output_section_data): Allocate space from
4305 free list for an incremental update.
4306 (Output_section::update_data_size): New function.
4307 (Output_section::set_fixed_layout): New function.
4308 (Output_section::reserve): New function.
4309 (Output_segment::set_section_addresses): Remove const.
4310 (Output_segment::set_section_list_addresses): Remove const; allocate
4311 space from free list for an incremental update.
4312 (Output_segment::set_offset): Adjust size of RELRO segment for an
4313 incremental update.
4314 * output.h (Output_data::current_data_size): Move here from
4315 child classes.
4316 (Output_data::pre_finalize_data_size): New function.
4317 (Output_data::update_data_size): New function.
4318 (Output_section_headers::update_data_size): new function.
4319 (Output_section_data_build::current_data_size): Move to Output_data.
4320 (Output_data_strtab::update_data_size): New function.
4321 (Output_section::current_data_size): Move to Output_data.
4322 (Output_section::set_fixed_layout): New function.
4323 (Output_section::has_fixed_layout): New function.
4324 (Output_section::reserve): New function.
4325 (Output_section::update_data_size): New function.
4326 (Output_section::has_fixed_layout_): New data member.
4327 (Output_section::free_list_): New data member.
4328 (Output_segment::set_section_addresses): Remove const.
4329 (Output_segment::set_section_list_addresses): Remove const.
4330 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4331 New function.
4332 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4333 New function.
4334 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4335 parameter when calling Add_symbols constructor; store argument
4336 serial number for members of a lib group.
4337 (Add_symbols::locks): Allow case where token == NULL.
4338 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4339 (Read_member::~Read_member): New function.
4340 (Read_member::is_runnable): New function.
4341 (Read_member::locks): New function.
4342 (Read_member::run): New function.
4343 (Check_script::~Check_script): New function.
4344 (Check_script::is_runnable): New function.
4345 (Check_script::locks): New function.
4346 (Check_script::run): New function.
4347 (Check_library::~Check_library): New function.
4348 (Check_library::is_runnable): New function.
4349 (Check_library::locks): New function.
4350 (Check_library::run): New function.
4351 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4352 (Add_symbols::library_): New data member.
4353 (class Read_member): New class.
4354 (class Check_script): New class.
4355 (class Check_library): New class.
4356 * reloc.cc (Read_relocs::is_runnable): Allow case where
4357 token == NULL.
4358 (Read_relocs::locks): Likewise.
4359 (Scan_relocs::locks): Likewise.
4360 (Relocate_task::locks): Likewise.
4361 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4362 to clear counters.
4363 (Sized_relobj::incremental_relocs_scan): Fix comment.
4364 (Sized_relobj::do_relocate): Pass output file offset to
4365 write_local_symbols.
4366 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4367 from class declaration.
4368 * script.cc (read_input_script): Allocate Script_info; pass
4369 argument serial number to report_script.
4370 * script.h (class Script_info): Move to incremental.h.
4371 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4372 * symtab.h (Symbol_table::add_from_incrobj): New function.
4373 (Symbol_table::set_file_offset): New function.
4374
b961d0d7
CC
43752011-04-05 Cary Coutant <ccoutant@google.com>
4376
4377 * incremental-dump.cc (dump_incremental_inputs): Change signature
4378 to take a Sized_incremental_binary; change caller. Use readers
4379 in Sized_incremental_binary.
4380 * incremental.cc
4381 (Sized_incremental_binary::find_incremental_inputs_sections):
4382 Rename do_find_incremental_inputs_sections to this.
4383 (Sized_incremental_binary::setup_readers): New function.
4384 (Sized_incremental_binary::do_check_inputs): Check
4385 has_incremental_info_ flag; move setup code to setup_readers;
4386 use input readers.
4387 (Sized_incremental_binary::do_file_is_unchanged): New function.
4388 (Sized_incremental_binary::do_get_input_reader): New function.
4389 * incremental.h (class Incremental_binary): Move to end of file.
4390 (Incremental_binary::file_is_unchanged): New function.
4391 (Incremental_binary::do_file_is_unchanged): New function.
4392 (Incremental_binary::Input_reader): New class.
4393 (Incremental_binary::get_input_reader): New function.
4394 (class Sized_incremental_binary): Move to end of file.
4395 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4396 input section reader classes.
4397 (Sized_incremental_binary::has_incremental_info): New function.
4398 (Sized_incremental_binary::inputs_reader): New function.
4399 (Sized_incremental_binary::symtab_reader): New function.
4400 (Sized_incremental_binary::relocs_reader): New function.
4401 (Sized_incremental_binary::got_plt_reader): New function.
4402 (Sized_incremental_binary::do_file_is_unchanged): New function.
4403 (Sized_incremental_binary::Sized_input_reader): New class.
4404 (Sized_incremental_binary::get_input_reader): New function.
4405 (Sized_incremental_binary::find_incremental_inputs_sections):
4406 Rename do_find_incremental_inputs_sections to this.
4407 (Sized_incremental_binary::setup_readers): New function.
4408 (Sized_incremental_binary::has_incremental_info_): New data member.
4409 (Sized_incremental_binary::inputs_reader_): New data member.
4410 (Sized_incremental_binary::symtab_reader_): New data member.
4411 (Sized_incremental_binary::relocs_reader_): New data member.
4412 (Sized_incremental_binary::got_plt_reader_): New data member.
4413 (Sized_incremental_binary::current_input_file_): New data member.
4414
a869183f
PP
44152011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4416
4417 PR gold/12640
4418 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4419 violation.
4420
44212011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4422
4423 * archive.cc (Archive::include_member): Adjust call to report_object.
4424 (Add_archive_symbols::run): Add script_info to call to
4425 report_archive_begin.
4426 (Lib_group::include_member): Adjust call to report_object.
4427 (Add_lib_group_symbols::run): Adjust call to report_object.
4428 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4429 blocks. Add object count for script input files.
4430 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4431 script_info parameter; change all callers.
4432 (Incremental_inputs::report_object): Add script_info parameter;
4433 change all callers.
4434 (Incremental_inputs::report_script): Store backpointer to
4435 incremental info entry.
4436 (Output_section_incremental_inputs::set_final_data_size): Record
4437 additional information for scripts.
4438 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4439 * incremental.h (Incremental_script_entry::add_object): New function.
4440 (Incremental_script_entry::get_object_count): New function.
4441 (Incremental_script_entry::get_object): New function.
4442 (Incremental_script_entry::objects_): New data member; adjust
4443 constructor.
4444 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4445 (Incremental_inputs::report_object): Add script_info parameter.
4446 (Incremental_inputs_reader::get_object_count): New function.
4447 (Incremental_inputs_reader::get_object_offset): New function.
4448 * options.cc (Input_arguments::add_file): Return reference to
4449 new input argument.
4450 * options.h (Input_argument::set_script_info): New function.
4451 (Input_argument::script_info): New function.
4452 (Input_argument::script_info_): New data member; adjust all
4453 constructors.
4454 (Input_file_group::add_file): Return reference to new input argument.
4455 (Input_file_lib::add_file): Likewise.
4456 (Input_arguments::add_file): Likewise.
4457 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4458 * script.cc (Parser_closure::Parser_closure): Add script_info
4459 parameter; adjust all callers.
4460 (Parser_closure::script_info): New function.
4461 (Parser_closure::script_info_): New data member.
4462 (read_input_script): Report scripts earlier to incremental info.
4463 (script_add_file): Set script_info in Input_argument.
4464 (script_add_library): Likewise.
4465 * script.h (Script_options::Script_info): Rewrite class.
4466
a869183f 44672011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4468
4469 * archive.cc (Library_base::should_include_member): Move
4470 method here from class Archive.
4471 (Archive::Archive): Initialize base class.
4472 (Archive::should_include_member): Move to base class.
4473 (Archive::do_for_all_unused_symbols): New function.
4474 (Add_archive_symbols::run): Remove redundant access to
4475 incremental_inputs.
4476 (Lib_group::Lib_group): Initialize base class.
4477 (Lib_group::do_filename): New function.
4478 (Lib_group::include_member): Pass pointer to Lib_group to
4479 report_object.
4480 (Lib_group::do_for_all_unused_symbols): New function.
4481 (Add_lib_group_symbols::run): Report archive information for
4482 incremental links.
4483 * archive.h (class Library_base): New base class.
4484 (class Archive): Derive from Library_base.
4485 (Archive::filename): Move to base class.
4486 (Archive::set_incremental_info): Likewise.
4487 (Archive::incremental_info): Likewise.
4488 (Archive::Should_include): Likewise.
4489 (Archive::should_include_member): Likewise.
4490 (Archive::Armap_entry): Remove.
4491 (Archive::Unused_symbol_iterator): Remove.
4492 (Archive::unused_symbols_begin): Remove.
4493 (Archive::unused_symbols_end): Remove.
4494 (Archive::do_filename): New function.
4495 (Archive::do_get_mtime): New function.
4496 (Archive::do_for_all_unused_symbols): New function.
4497 (Archive::task_): Move to base class.
4498 (Archive::incremental_info_): Likewise.
4499 (class Lib_group): Derive from Library_base.
4500 (Lib_group::do_filename): New function.
4501 (Lib_group::do_get_mtime): New function.
4502 (Lib_group::do_for_all_unused_symbols): New function.
4503 (Lib_group::task_): Move to base class.
4504 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4505 function.
4506 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4507 function.
4508 * incremental.cc (Incremental_inputs::report_archive_begin):
4509 Use Library_base; call library's get_mtime; add incremental inputs
4510 entry before members.
4511 (class Unused_symbol_visitor): New class.
4512 (Incremental_inputs::report_archive_end): Use Library_base; use
4513 visitor class to record unused symbols; don't add incremental inputs
4514 entry after members.
4515 (Incremental_inputs::report_object): Use Library_base.
4516 * incremental.h
4517 (Incremental_archive_entry::Incremental_archive_entry): Remove
4518 unused Archive parameter.
4519 (Incremental_inputs::report_archive_begin): Use Library_base.
4520 (Incremental_inputs::report_archive_end): Likewise.
4521 (Incremental_inputs::report_object): Likewise.
4522 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4523 function.
4524 * object.h (Object::for_all_global_symbols): New function.
4525 (Object::do_for_all_global_symbols): New function.
4526 (Sized_relobj::do_for_all_global_symbols): New function.
4527 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4528 function.
4529 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4530 function.
4531
61ab3e40
ILT
45322011-03-27 Ian Lance Taylor <iant@google.com>
4533
4534 * archive.cc (Archive::interpret_header): Return -1 if something
4535 goes wrong. Change callers accordingly.
4536
30e1f9e6
CC
45372011-03-25 Cary Coutant <ccoutant@google.com>
4538
4539 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4540 * testsuite/Makefile.in: Regenerate.
4541
9370ce59 45422011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4543
4544 * plugin.cc (get_view): New.
4545 (Plugin::load): Pass get_view to the plugin.
4546 (Plugin_manager::get_view): New.
4547
9312bb0a
ILT
45482011-03-21 Ian Lance Taylor <iant@google.com>
4549
4550 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4551 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4552
7e12ba9e
ST
45532011-03-21 Sriraman Tallam <tmsriram@google.com>
4554
4555 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4556 Change == to -eq.
4557 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4558 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4559 Change == to -eq.
4560 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4561 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4562
fd7a005d
ILT
45632011-03-14 Ian Lance Taylor <iant@google.com>
4564
4565 * script-sections.cc (Sort_output_sections::script_compare):
4566 Rename from is_before, change return type.
4567 (Sort_output_sections::operator()): Adjust accordingly.
4568
ed16fd1b
ILT
45692011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4570
4571 PR gold/12572
4572 * testsuite/odr_violation2.cc: Add comment to make all error line
4573 numbers double digits.
4574 * testsuite/debug_msg.sh: Adjust expected errors.
4575
71ff8986
ILT
45762011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4577
4578 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4579 but mark earlier ones as non-canonical
4580 (offset_to_iterator): Update search target and example
4581 (do_addr2line): Return extra lines in a vector*
4582 (format_file_lineno): Extract from do_addr2line
4583 (one_addr2line): Add vector* out-param
4584 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4585 when a lineno entry appeared last for its instruction
4586 (Dwarf_line_info): Add vector* out-param
4587 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4588 * symtab.cc (Odr_violation_compare): Include the lineno in the
4589 comparison again.
4590 (linenos_from_loc): New. Combine the canonical line for an
4591 address with its other lines.
4592 (True_if_intersect): New. Helper functor to make
4593 std::set_intersection a query.
4594 (detect_odr_violations): Compare sets of lines instead of just
4595 one line for each function. This became less deterministic, but
4596 has fewer false positives.
4597 * symtab.h: Declarations.
4598 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4599 mix an optimized and non-optimized object in the same binary
4600 (odr_violation2.so): Same.
4601 * testsuite/Makefile.in: Regenerate from Makefile.am.
4602 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4603 * testsuite/debug_msg.sh: Update line numbers and add
4604 assertions.
4605 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4606 non-optimized context.
4607 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4608 isn't inlined, and use OdrDerived in an optimized context.
4609 * testsuite/odr_header1.h: Defines OdrDerived, where
4610 optimization will change the
4611 first-instruction-in-the-destructor's file and line number.
4612 * testsuite/odr_header2.h: Defines OdrBase.
4613
a19fefdc
ILT
46142011-03-09 Ian Lance Taylor <iant@google.com>
4615
4616 * fileread.cc (File_read::clear_views): Don't delete the whole
4617 file view.
4618
ecb351e9
ILT
46192011-03-08 Ian Lance Taylor <iant@google.com>
4620
4621 PR gold/12525
4622 * fileread.cc: #include <climits>.
4623 (GOLD_IOV_MAX): Define.
4624 (File_read::read_multiple): Limit number of entries by iov_max.
4625 * fileread.h (class File_read): Always set max_readv_entries to
4626 128.
4627
b821d13c
ILT
46282011-03-07 Ian Lance Taylor <iant@google.com>
4629
4630 PR gold/12525
4631 * options.h (class General_options): Add -dy and -dn.
4632
89243142
CC
46332011-03-02 Cary Coutant <ccoutant@google.com>
4634
4635 * testsuite/script_test_9.t: Add TLS segment.
4636
d0773f31
ILT
46372011-03-02 Simon Baldwin <simonb@google.com>
4638
4639 * configure.ac: Add check for gnu_indirect_function support in
4640 the toolchain building binutils.
4641 * configure: Rebuild.
4642
9370ce59 46432011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4644
4645 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4646 plugin only symbols.
4647 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4648 in plugin files as not needed in the symbol table.
4649
4cf7a849
ST
46502011-02-11 Sriraman Tallam <tmsriram@google.com>
4651
4652 * output.cc (Output_section::add_input_section): Delay fill
4653 generation for section ordering.
4654
b578bd7d
ILT
46552011-02-09 Ian Lance Taylor <iant@google.com>
4656
4657 PR gold/12316
4658 * object.h (class Sized_relobj): Remove clear_local_symbols.
4659 * reloc.cc (Sized_relobj::do_relocate): Don't call
4660 clear_local_symbols.
4661
9370ce59 46622011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4663
4664 * plugin.cc (is_visible_from_outside): Return true for symbols
4665 in the -u option.
4666
55382fb7
ILT
46672011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4668
4669 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4670 filename.
4671
4e271fff
ST
46722011-02-02 Sriraman Tallam <tmsriram@google.com>
4673
4674 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4675 to std::string.
4e271fff 4676 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4677 section_name to be std::string.
4e271fff
ST
4678 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4679
d433c3ac
ILT
46802011-01-25 Ian Lance Taylor <iant@google.com>
4681
4682 * script.cc (script_add_extern): Rewrite to use
4683 add_symbol_reference.
4684
880473a6
DK
46852011-01-25 Doug Kwan <dougkwan@google.com>
4686
d433c3ac 4687 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4688
f30f86fa
ILT
46892011-01-24 Ian Lance Taylor <iant@google.com>
4690
4691 * options.h (class General_options): Accept
4692 --no-detect-odr-violations.
4693
8e51a0b9
ILT
46942011-01-24 Ian Lance Taylor <iant@google.com>
4695
4696 * version.cc (version_string): Bump to 1.11.
4697
0f3b89d8
ILT
46982011-01-24 Ian Lance Taylor <iant@google.com>
4699
4700 * plugin.cc (class Plugin_rescan): Define new class.
4701 (Plugin_manager::claim_file): Set any_claimed_.
4702 (Plugin_manager::save_archive): New function.
4703 (Plugin_manager::save_input_group): New function.
4704 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4705 necessary.
4706 (Plugin_manager::new_undefined_symbol): New function.
4707 (Plugin_manager::rescan): New function.
4708 (Plugin_manager::rescannable_defines): New function.
4709 (Plugin_manager::add_input_file): Set any_added_.
4710 * plugin.h (class Plugin_manager): define new fields rescannable_,
4711 undefined_symbols_, any_claimed_, and any_added_. Declare
4712 Plugin_rescan as friend. Declare new functions.
4713 (Plugin_manager::Rescannable): Define type.
4714 (Plugin_manager::Rescannable_list): Define type.
4715 (Plugin_manager::Undefined_symbol_list): Define type.
4716 (Plugin_manager::Plugin_manager): Initialize new fields.
4717 * archive.cc (Archive::defines_symbol): New function.
4718 (Add_archive_symbols::run): Pass archive to plugins if any.
4719 * archive.h (class Archive): Declare defines_symbol.
4720 * readsyms.cc (Input_group::~Input_group): New function.
4721 (Finish_group::run): Pass input_group to plugins if any.
4722 * readsyms.h (class Input_group): Declare destructor.
4723 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4724 any.
4725
3bb951e5
ILT
47262011-01-10 Ian Lance Taylor <iant@google.com>
4727
4728 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4729 section as relro.
4730 (Layout::set_segment_offsets): Reset increase_relro before calling
4731 set_section_addresses a second time.
4732
0aa45fac
CC
47332011-01-04 Cary Coutant <ccoutant@google.com>
4734
4735 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4736 sections before NOBITS sections.
4737
0db46eb4
L
47382011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4739
4740 * version.cc (print_version): Update copyright to 2011.
4741
829c9745
CC
47422010-12-23 Cary Coutant <ccoutant@google.com>
4743
4744 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4745 of OS to this->add. Add OD parameter to second form of the function.
4746
7500420b
ILT
47472010-12-20 Ian Lance Taylor <iant@google.com>
4748
4749 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4750 second of two consecutive entries with same offset.
4751
f8e9a930
RW
47522010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4753
4754 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4755 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4756 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4757 to avoid unneeded links against $(LDADD).
4758 * testsuite/Makefile.in: Regenerate.
4759
2fbb4320
ILT
47602010-12-15 Ian Lance Taylor <iant@google.com>
4761
4762 PR gold/12324
4763 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4764 for R_X86_64_32 and R_X86_64_PC32.
4765 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4766 ver_matching_def_pic.o.
4767 (ver_matching_def_pic.o): New target.
4768
fedb228d
RW
47692010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4770
4771 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4772 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4773 Move definition before File_read::View member definitions.
4774 (File_read::View::~View): Initialize and hold lock before
4775 updating current_mapped_bytes.
4776
9b547ce6
RW
47772010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4778
4779 * dwarf_reader.cc: Remove outdated comment.
4780 * gold-threads.cc: Fix typo in error message.
4781 * archive.cc: Fix typos in comments.
4782 * archive.h: Likewise.
4783 * arm-reloc-property.cc: Likewise.
4784 * arm-reloc-property.h: Likewise.
4785 * arm-reloc.def: Likewise.
4786 * arm.cc: Likewise.
4787 * attributes.h: Likewise.
4788 * cref.cc: Likewise.
4789 * ehframe.cc: Likewise.
4790 * fileread.h: Likewise.
4791 * gold.h: Likewise.
4792 * i386.cc: Likewise.
4793 * icf.cc: Likewise.
4794 * incremental.h: Likewise.
4795 * int_encoding.cc: Likewise.
4796 * layout.h: Likewise.
4797 * main.cc: Likewise.
4798 * merge.h: Likewise.
4799 * object.cc: Likewise.
4800 * object.h: Likewise.
4801 * options.cc: Likewise.
4802 * readsyms.cc: Likewise.
4803 * reduced_debug_output.cc: Likewise.
4804 * reloc.cc: Likewise.
4805 * script-sections.cc: Likewise.
4806 * sparc.cc: Likewise.
4807 * symtab.h: Likewise.
4808 * target-reloc.h: Likewise.
4809 * target.cc: Likewise.
4810 * target.h: Likewise.
4811 * timer.cc: Likewise.
4812 * timer.h: Likewise.
4813 * x86_64.cc: Likewise.
4814
83e17bd5
CC
48152010-12-09 Cary Coutant <ccoutant@google.com>
4816
4817 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4818 stack.
4819 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4820 parameter; change all callers.
4821 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4822 * options.h (warn_execstack): New option.
4823
017257f8
DK
48242010-12-07 Doug Kwan <dougkwan@google.com>
4825
4826 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4827 like function call relocations.
4828
c20cbc06
ILT
48292010-12-07 Ian Lance Taylor <iant@google.com>
4830
4831 * archive.cc (Archive::get_elf_object_for_member): Permit
4832 punconfigured to be NULL.
4833 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4834 (Archive::include_member): Pass NULL to get_elf_object_for_member
4835 if we searched for the archive and this is the first included
4836 object.
4837
4dbfafcc
ILT
48382010-12-01 Ian Lance Taylor <iant@google.com>
4839
4840 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4841 track_relocs_type_ field.
4842 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4843 Set track_relocs_type_.
4844 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4845 contents when using RELA relocs.
4846 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4847 reloc_map_.
4848 * reloc.cc (Track_relocs::next_addend): New function.
4849 * reloc.h (class Track_relocs): Declare next_addend.
4850
e5e19edd
ILT
48512010-12-01 Ian Lance Taylor <iant@google.com>
4852
4853 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4854 virtual destructor.
4855
9a5ce24c
ILT
48562010-12-01 Ian Lance Taylor <iant@google.com>
4857
4858 * README: Update compilers known to work and fail.
4859
c7791212
NC
48602010-11-23 Matthias Klose <doko@ubuntu.com>
4861
4862 * configure.in: For --enable-gold, handle value `default' instead of
4863 `both*'. Always install ld as ld.bfd, install as ld if gold is
4864 not the default.
4865 * configure: Regenerate.
4866
0ad220c9
DK
48672010-11-18 Doug Kwan <dougkwan@google.com>
4868
4869 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4870 and right_alignment to be zero. Store result alignment only if it is
4871 greater than existing alignment.
4872
ab8056e0
CC
48732010-11-16 Cary Coutant <ccoutant@google.com>
4874
4875 PR gold/12220
4876 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4877 Check for ".zdebug_line".
4878
fd064a5b
CC
48792010-11-16 Doug Kwan <dougkwan@google.com>
4880 Cary Coutant <ccoutant@google.com>
4881
4882 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4883 by reference; adjust all callers.
4884 * output.cc (Output_segment::set_section_addresses): Adjust references
4885 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4886 list is empty.
4887 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4888 end at page boundary.
4889
6fc6ea19
CC
48902010-11-16 Cary Coutant <ccoutant@google.com>
4891
4892 PR gold/12220
4893 * layout.cc (Layout::choose_output_section): Transform names of
4894 compressed sections even when using a script with a SECTIONS clause.
4895 (Layout::output_section_name): Remove code to transform
4896 compressed debug section names.
4897 * output.cc (Output_section::add_input_section): Use uncompressed
4898 section size when tracking input sections.
4899
95a2c8d6
RS
49002010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4901
4902 * symtab.h (Symbol::NON_PIC_REF): Remove.
4903 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4904 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4905 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4906 (Symbol::use_plt_offset): Take a flags argument and pass it
4907 directly to needs_dynamic_reloc. Restrict check for undefined
4908 weak symbols to function calls.
4909 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4910 (Target_arm::Scan::global): Use it.
4911 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4912 (Target_arm::Relocate::relocate): Likewise.
4913 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4914 parameter with an r_type parameter. Use get_reference_flags
4915 to get the flags.
4916 (Target_arm::Relocate::relocate): Update accordingly.
4917 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4918 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4919 (Target_i386::Scan::global): Likewise.
4920 (Target_i386::Relocate::relocate): Likewise.
4921 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4922 parameter with an r_type parameter. Use get_reference_flags
4923 to get the flags.
4924 (Target_i386::Relocate::relocate): Update accordingly.
4925 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4926 (Target_powerpc::Scan::global): Use it.
4927 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4928 (Target_powerpc::Relocate::relocate): Likewise.
4929 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4930 (Target_sparc::Scan::global): Use it.
4931 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4932 (Target_sparc::Relocate::relocate): Likewise.
4933 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4934 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4935 (Target_x86_64::Scan::global): Likewise.
4936 (Target_x86_64::Relocate::relocate): Likewise.
4937
f625ae50
DK
49382010-11-08 Doug Kwan <dougkwan@google.com>
4939 Cary Coutant <ccoutant@google.com>
4940
4941 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4942 (Arm_exidx_merge_section::section_contents_): New data member.
4943 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4944 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4945 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4946 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4947 in parameters instead of calling Object::section_contents without
4948 locking.
4949 (Arm_output_section::group_section): New parameter TASK. Pass it
4950 to callees that need locking objects.
4951 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4952 to lock EXIDX input sections. Fix a formatting issue. Call
4953 Arm_exidx_merged_section::build_contents to create merged section
4954 contents.
4955 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4956 to lock object of stub table owner.
4957 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4958 TEXT_SIZE to initialize data member TEXT_SIZE_.
4959 (Arm_exidx_input_section::addralign): Fix typo in comment.
4960 (Arm_exidx_input_section::text_size): New method.
4961 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4962 that require locking objects. Lock objects before scanning for stubs
4963 and updating local symbols.
4964 (Arm_input_section<big_endian>::init): Copy contents of original
4965 input section.
2e702c99 4966 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4967 original input section instead of calling Object::section_contents
4968 without locking.
4969 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4970 size without calling Object::section_size().
4971 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4972 for size. Allocate a buffer for merged EXIDX entries.
4973 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4974 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4975 building code to Arm_exidx_merged_section::build_contetns. Write
4976 out contetns in buffer instead of building it on the fly.
4977 (Arm_relobj::make_exidx_input_section): Also pass text section size
4978 to Arm_exidx_input_section constructor.
4979 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4980 (Arm_dynobj::do_read_symbols): Fix memory leak.
4981 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4982 * target.h: (class Task): Add forward declaration.
4983 (Target::relax): Add new parameter TASK and pass it to
4984 Target::do_relax().
4985 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4986
5f9bcf58
CC
49872010-11-05 Cary Coutant <ccoutant@google.com>
4988
4989 PR gold/10708
4990 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4991 object when reading from the file.
4992 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4993 second layout pass.
4994 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4995 when reading section contents.
4996 (get_section_contents): Likewise.
4997 (icf::find_identical_sections): Likewise.
4998 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4999 object when reading from the file.
5000 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5001 the object when doing deferred section layout.
5002
e597fa08
NC
50032010-11-03 Nick Clifton <nickc@redhat.com>
5004
5005 PR gold/12001
5006 * script.h (class Symbol_assignment: name): New member. Returns
5007 the name of the symbol.
5008 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5009 Returns true if the given symbol name is on the list of
5010 assignments wating to be processed.
5011 * archive.cc (should_incldue_member): If the symbol is undefined,
5012 check to see if it is on the list of symbols pending assignment.
5013
3f9a3278
ILT
50142010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5015
5016 * script-sections.cc (Script_sections::find_memory_region): Check
5017 for a NULL output section pointer.
5018
d06fb4d1
DK
50192010-10-29 Doug Kwan <dougkwan@google.com>
5020
5021 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5022 Output_section::add_relaxed_input_section.
5023 * output.cc (Output_section::add_relaxed_input_section): Add new
5024 arguments LAYOUT and NAME. Set section order index.
5025 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5026 Copy section order index.
5027 * output.h (Output_section::add_relaxed_input_section): Add new
5028 arguments LAYOUT and NAME.
5029
90e24de5
ILT
50302010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5031
5032 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5033 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5034 * testsuite/Makefile.in: Regenerate.
5035
c9484ea5
DK
50362010-10-20 Doug Kwan <dougkwan@google.com>
5037
5038 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5039 without SHF_LINK_ORDER flags.
5040 * layout.cc (Layout::choose_output_section): Do not filter
5041 SHF_LINK_ORDER flag in a relocatable link.
5042
5bc2f5be
CC
50432010-10-17 Cary Coutant <ccoutant@google.com>
5044
5045 * output.h (Output_segment::set_section_addresses): Change function
5046 signature. Update all callers.
5047 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5048 sections.
5049 (Output_segment::set_section_addresses): Align after last TLS
5050 section. Add padding before last relro section instead of after.
5051
0c91cf04
DK
50522010-10-17 Doug Kwan <dougkwan@google.com>
5053
5054 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5055 GOT output section to be writable.
5056
8c21d9d3
CC
50572010-10-14 Cary Coutant <ccoutant@google.com>
5058
5059 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5060 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5061 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5062 mode.
5063 * incremental.cc (report_command_line): Ignore all forms of
5064 --incremental.
5065 * layout.cc (Layout::Layout): Check parameters for incremental link
5066 mode.
5067 * options.cc (General_options::parse_incremental): New function.
5068 (General_options::parse_no_incremental): New function.
5069 (General_options::parse_incremental_full): New function.
5070 (General_options::parse_incremental_update): New function.
5071 (General_options::incremental_mode_): New data member.
5072 (General_options::finalize): Check incremental_mode_.
5073 * options.h (General_options): Update help text for --incremental.
5074 Add --no-incremental, --incremental-full, --incremental-update.
5075 (General_options::Incremental_mode): New enum type.
5076 (General_options::incremental_mode): New function.
5077 (General_options::incremental_mode_): New data member.
5078 * parameters.cc (Parameters::incremental_mode_): New data member.
5079 (Parameters::set_options): Set incremental_mode_.
5080 (Parameters::set_incremental_full): New function.
5081 (Parameters::incremental): New function.
5082 (Parameters::incremental_update): New function.
5083 (set_parameters_incremental_full): New function.
5084 * parameters.h (Parameters::set_incremental_full): New function.
5085 (Parameters::incremental): New function.
5086 (Parameters::incremental_update): New function.
5087 (Parameters::incremental_mode_): New data member.
5088 (set_parameters_incremental_full): New function.
5089 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5090 incremental link mode.
5091 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5092 (Sized_relobj::do_relocate_sections): Likewise.
5093 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5094 option.
5095 * testsuite/Makefile.in: Regenerate.
5096 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5097
bb32aa18 50982010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5099
5100 * script-sections.h (class Script_sections): Make
5101 Sections_elements typedef public.
5102 * script-sections.cc (class Sort_output_sections): Add elements_
5103 field. Add constructor which sets it; change all callers.
5104 (Sort_output_sections::is_before): New function.
5105 (Sort_output_sections::operator()): Call is_before.
5106 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5107 conditional.
5108 * testsuite/script_test_10.sh: New test. Test script section
5109 order.
5110 * testsuite/script_test_10.t: Likewise.
5111 * testsuite/script_test_10.s: Likewise.
5112 * testsuite/Makefile.am: Wrap the cross linker tests and the
5113 common tests into NATIVE_OR_CROSS_LINKER.
5114 (check_SCRIPTS): Add script_test_10.sh.
5115 (check_DATA): Add script_test_10.stdout.
5116 (script_test_10.o, script_test_10): New targets.
5117 (script_test_10.stdout): New target.
5118 * configure, testsuite/Makefile.in: Regenerate.
5119
3cef7179
ILT
51202010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5121
5122 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5123 error for the deprecated relocations.
5124 (Target_arm::Scan::global): Likewise.
5125 (Target_arm::Relocate::relocate): Likewise.
5126
7411e9a8
RS
51272010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5128
5129 * fileread.cc (Input_file::find_file): Initialize *found_name
5130 and *namep when using the fallback search for case 4.
5131
6a9da32a
CC
51322010-10-11 Cary Coutant <ccoutant@google.com>
5133
5134 * options.h (class General_options): Redefine -z lazy as an alias for
5135 the negation of -z now.
5136
ac897c20
ILT
51372010-10-11 Ian Lance Taylor <iant@google.com>
5138
5139 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5140 binding.
5141
ea5cae92
NC
51422010-10-06 Nick Clifton <nickc@redhat.com>
5143
5144 * script-sections.cc(class Memory_region): Remove
5145 current_lma_offset_ field. Rename current_vma_offset_ to
5146 current_offset_. Add last_section_ field.
5147 (Memory_region::get_current_vma_address): Rename to
5148 get_current_address.
5149 (Memory_region::get_current_lma_address): Delete.
5150 (Memory_region::increment_vma_offset): Rename to
5151 increment_offset.
5152 (Memory_region::increment_lma_offset): Delete.
5153 (Memory_region::attributes_compatible): New method. Returns
5154 true if the provided section is compatible with the region.
5155 (Memory_region::get_last_section): New method. Returns the last
5156 section to use the region.
5157 (Memory_region::set_last_section): New method. Stores the last
5158 section to use the region.
5159 (Script_sections::block_in_region): New method. Returns true if
5160 a block of memory is contained within a region.
5161 (Script_sections::find_memory_region): New method. Locates a
5162 memory region to be used to set a VMA or LMA address.
5163 (Output_section_definition::set_section_addresses): Add code to
5164 check for addresses set by memory regions.
5165 (Output_segment::set_section_addresses): Remove memory region
5166 walking code.
5167 (Script_sections::create_segment): Add a warning if a header
5168 segment is created outside of any region.
5169 * script-sections.h (class Script_sections): Add prototypes for
5170 find_memory_region and block_in_region methods.
5171 * testsuite/memory_test.s: Use .long instead of .word.
5172 * testsuite/memory_test.t: Add some more output sections.
5173 * testsuite/memory_test.sh: Update expected output.
5174
a9bfd952
DK
51752010-10-02 Doug Kwan <dougkwan@google.com>
5176
5177 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5178 defintion to symtab.h
5179 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5180 declaration to defintion.
5181
bacff3ab
NC
51822010-10-01 Nick Clifton <nickc@redhat.com>
5183
5184 * expression.cc (eval): Replace dummy argument with NULL.
5185 (eval_maybe_dot): Check for a NULL result section pointer.
5186 (Symbol_expression::value): Likewise.
5187 (Dot_expression::value): Likewise.
5188 (BINARY_EXPRESSION): Likewise.
5189 (Max_expression::value): Likewise.
5190 (Min_expression::value): Likewise.
5191 (Absolute_expression::value): Likewise.
5192 (Addr_expression::value_from_output_section): Likewise.
5193 (Loaddddr_expression::value_from_output_section): Likewise.
5194 (Segment_start_expression::value): Likewise.
5195 * script-sections.cc
5196 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5197 argument with NULL.
5198 (Sections_elememt_dot_assignment::set_section_addresses):
5199 Likewise.
5200 (Output_data_expression::do_write_to_buffer): Likewise.
5201 (Output_section_definition::finalize_symbols): Likewise.
5202 (Output_section_definition::set_section_addresses): Likewise.
5203
f81bc8b5
DK
52042010-09-30 Doug Kwan <dougkwan@google.com>
5205
5206 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5207
c95e9f27
ST
52082010-09-28 Sriraman Tallam <tmsriram@google.com>
5209
5210 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 5211 function.
c95e9f27
ST
5212 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5213 virtual function.
5214 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5215 virtual function.
5216 * icf.cc (get_section_contents): Inline merge sections only when
5217 target allows it.
5218
3cac54d2
RW
52192010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5220
5221 * configure: Regenerate.
5222
2904037a
ILT
52232010-09-17 Ian Lance Taylor <iant@google.com>
5224
5225 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5226 * testsuite/Makefile.am (memory_test.o): New target.
5227 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5228 memory_test.t.
5229 * testsuite/Makefile.in: Rebuild.
2904037a 5230
bca7fb63
DK
52312010-09-17 Doug Kwan <dougkwan@google.com>
5232
5233 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5234 defintion if relocation uses GOT entries of the symbol.
5235 * testsuite/icf_safe_test.sh: Fix test.
5236 * testsuite/icf_safe_so_test.sh: Fix test.
5237
4ef28648
CC
52382010-09-16 Cary Coutant <ccoutant@google.com>
5239
5240 * script_sections.cc (class Memory_region): Remove "NULL" from
5241 vector initializations.
5242
793990de
CC
52432010-09-15 Cary Coutant <ccoutant@google.com>
5244
5245 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5246 Resolve forwarding symbols.
5247
81e015e2
DK
52482010-09-15 Doug Kwan <dougkwan@google.com>
5249
5250 * gold/testsuite/script_test_3.t: Add ARM special sections.
5251 * gold/testsuite/script_test_4.t: Same.
5252 * gold/testsuite/script_test_5.t: Same.
5253 * gold/testsuite/script_test_6.t: Same.
5254 * gold/testsuite/script_test_7.t: Same.
5255 * gold/testsuite/script_test_7.t: Same.
5256 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5257
36171d64
CC
52582010-09-14 Cary Coutant <ccoutant@google.com>
5259
5260 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5261 (Target_x86_64::Relocate::relocate_tls): Replace check for
5262 saw_tls_block_reloc_ with test for executable section.
5263
d89051bd
CC
52642010-09-12 Cary Coutant <ccoutant@google.com>
5265
5266 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5267 position-independent executables to shared libraries need dynamic
5268 relocations.
5269 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5270 position-independent executables.
5271 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5272 * testsuite/Makefile.in: Regenerate.
5273
fca41f0f
NC
52742010-09-10 Nick Clifton <nickc@redhat.com>
5275
5276 PR gold/11997
5277 * testsuite/memory_test.t: Discard any sections that are not
5278 needed.
5279
6695e4b3
L
52802010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5281
5282 PR gold/11996
5283 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5284 "This::" to work around a bug in gcc 4.2.
5285
5286 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5287
0f72bf6f
RÁE
52882010-09-09 Rafael Espindola <espindola@google.com>
5289
5290 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5291 sections with different PF_X flags in the same segment.
5292 (Layout::find_first_load_seg): Search all segments to find the first
5293 one.
5294 * options.h (rosegment): New.
5295
52962010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5297
05a79166 5298 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5299
aa98ff75
DK
53002010-09-08 Doug Kwan <dougkwan@google.com>
5301
5302 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5303 (Arm_relobj::do_relocate_sections): Add new parameter for output
5304 file to match the parent.
5305 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5306 of local symbols instead of input values. Update code to track
5307 changes in gold::relocate_section.
5308 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5309 (Sized_relobj::compute_final_local_value_internal): New methods.
5310 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5311 body into private version of Sized_relobj::compute_final_local_value.
5312 Call the inline method.
5313 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5314 merged symbol value if there is one.
5315 (Symbol_value::has_output_value): New method defintiion.
5316 (Sized_relobj::Compute_final_local_value_status): New enum type.
5317 (Sized_relobj::compute_final_local_value): New methods.
5318 (Sized_relobj::compute_final_local_value_internal): New methods.
5319 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5320 and arm_cortex_a8.sh.
5321 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5322 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5323 New tests.
5324 * Makefile.in: Regenerate.
5325 * testsuite/arm_bl_out_of_range.s: Update test.
5326 * testsuite/thumb_bl_out_of_range.s: Ditto.
5327 * testsuite/thumb_blx_out_of_range.s: Ditto.
5328 * testsuite/arm_branch_out_of_range.sh: New file.
5329 * testsuite/arm_cortex_a8.sh: Ditto.
5330 * testsuite/arm_cortex_a8_b.s: Ditto.
5331 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5332 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5333 * testsuite/arm_cortex_a8_bl.s: Ditto.
5334 * testsuite/arm_cortex_a8_blx.s: Ditto.
5335 * testsuite/arm_cortex_a8_local.s: Ditto.
5336 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5337 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5338
05a79166
L
53392010-09-08 Rafael Espindola <espindola@google.com>
5340
5341 * Makefile.am (memory_test.stdout): Run readelf with -W.
5342 * Makefile.in: Regenerate.
5343 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5344 64 bit output.
5345
33dbc701
RÁE
53462010-09-08 Rafael Espindola <espindola@google.com>
5347
5348 * script-sections.cc (Script_sections::add_memory_region): Convert
5349 field precision to int.
5350 * script.cc (script_set_section_region, script_set_section_region):
5351 Convert field precision to int.
5352
731ca54a
RÁE
53532010-09-08 Rafael Espindola <espindola@google.com>
5354
5355 * arm.cc (do_finalize_sections): Create the __exidx_start and
5356 __exdix_end symbols even when the section is missing.
5357
7f8cd844
NC
53582010-09-08 Nick Clifton <nickc@redhat.com>
5359
5360 * README: Remove claim that MEMORY is not supported.
5361 * expression.cc (script_exp_function_origin)
5362 (script_exp_function_length): Move from here to ...
5363 * script.cc: ... here.
5364 (script_set_section_region, script_add_memory)
5365 (script_parse_memory_attr, script_include_directive): New
5366 functions.
5367 * script-sections.cc
5368 (class Memory_region): New class.
5369 (class Output_section_definition): Add set_memory_region,
5370 set_section_vma, set_section_lma and get_section_name methods.
5371 (class Script_Sections): Add add_memory_region,
5372 find_memory_region, find_memory_region_origin,
5373 find_memory_region_length and set_memory_region methods.
5374 Have set_section_addresses method walk the list of set memory
5375 regions.
5376 Extend the print methos to display memory regions.
5377 * script-sections.h: Add prototypes for new methods.
5378 Add enum for MEMORY region attributes.
5379 * yyscript.y: Add support for parsing MEMORY regions.
5380 * script-c.h: Add prototypes for new functions.
5381 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5382 * testsuite/Makefile.in: Regenerate.
5383 * testsuite/memory_test.sh: New script.
5384 * testsuite/memory_test.s: New assembler source file.
5385 * testsuite/memory_test.t: New linker script.
5386
a4649286
DK
53872010-08-27 Doug Kwan <dougkwan@google.com>
5388
5389 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5390 reference override an existing dynamic weak reference.
5391 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5392 * testsuite/Makefile.in: Regenerate.
5393 * testsuite/dyn_weak_ref.sh: New file.
5394 * testsuite/dyn_weak_ref_1.c: Ditto.
5395 * testsuite/dyn_weak_ref_2.c: Ditto.
5396
b56648ad
ILT
53972010-08-27 Ian Lance Taylor <iant@google.com>
5398
5399 * incremental.h (class Incremental_input_entry): Add virtual
5400 destructor.
5401
809313cb
ILT
54022010-08-27 Ian Lance Taylor <iant@google.com>
5403
5404 * testsuite/start_lib_test_3.c: Mark t3 as used.
5405
11e32464
NC
54062010-08-27 Nick Clifton <nickc@redhat.com>
5407
5408 * options.cc (version_script): Fix small typo in previous
5409 whitespace tidyup.
5410
ca09d69a
NC
54112010-08-25 Nick Clifton <nickc@redhat.com>
5412
5413 * archive.cc: Formatting fixes: Remove whitespace between
5414 typename and following asterisk. Remove whitespace between
5415 function name and opening parenthesis.
5416 * archive.h: Likewise.
5417 * arm.cc: Likewise.
5418 * attributes.cc: Likewise.
5419 * attributes.h: Likewise.
5420 * common.cc: Likewise.
5421 * copy-relocs.cc: Likewise.
5422 * dirsearch.h: Likewise.
5423 * dynobj.cc: Likewise.
5424 * ehframe.cc: Likewise.
5425 * ehframe.h: Likewise.
5426 * expression.cc: Likewise.
5427 * fileread.cc: Likewise.
5428 * fileread.h: Likewise.
5429 * gc.h: Likewise.
5430 * gold-threads.cc: Likewise.
5431 * gold.cc: Likewise.
5432 * i386.cc: Likewise.
5433 * icf.h: Likewise.
5434 * incremental-dump.cc: Likewise.
5435 * incremental.cc: Likewise.
5436 * layout.cc: Likewise.
5437 * layout.h: Likewise.
5438 * main.cc: Likewise.
5439 * merge.cc: Likewise.
5440 * merge.h: Likewise.
5441 * object.cc: Likewise.
5442 * object.h: Likewise.
5443 * options.cc: Likewise.
5444 * options.h: Likewise.
5445 * output.cc: Likewise.
5446 * output.h: Likewise.
5447 * plugin.cc: Likewise.
5448 * plugin.h: Likewise.
5449 * powerpc.cc: Likewise.
5450 * reloc.cc: Likewise.
5451 * script-c.h: Likewise.
5452 * script-sections.cc: Likewise.
5453 * script.cc: Likewise.
5454 * stringpool.cc: Likewise.
5455 * symtab.cc: Likewise.
5456 * symtab.h: Likewise.
5457 * target.cc: Likewise.
5458 * timer.cc: Likewise.
5459 * timer.h: Likewise.
5460 * version.cc: Likewise.
5461 * x86_64.cc: Likewise.
5462
b8fa8750
NC
54632010-08-24 Nick Clifton <nickc@redhat.com>
5464
5465 PR 11899
5466 * layout.cc (segment_precedes): Sort segments by their physical
5467 addresses, if they have been set.
5468
9919d93b
CC
54692010-08-23 Cary Coutant <ccoutant@google.com>
5470
5471 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5472 symbols data.
5473 (Lib_group::include_member): Unlock object after deleting its
5474 symbols data.
5475 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5476 the bug fixed here.
5477
97b4be1c
CC
54782010-08-19 Neil Vachharajani <nvachhar@google.com>
5479 Cary Coutant <ccoutant@google.com>
5480
5481 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5482 constructor, and set_blocker.
5483 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5484 readsyms_blocker_.
5485 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5486 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5487 * testsuite/Makefile.am (start_lib_test): New test case.
5488 * testsuite/Makefile.in: Regenerate.
5489 * testsuite/start_lib_test_main.c: New file.
5490 * testsuite/start_lib_test_1.c: New file.
5491 * testsuite/start_lib_test_2.c: New file.
5492 * testsuite/start_lib_test_3.c: New file.
5493
dd0b1884
ILT
54942010-08-19 Ian Lance Taylor <iant@google.com>
5495
5496 * Makefile.in: Rebuild with automake 1.11.1.
5497 * aclocal.m4: Likewise.
5498 * testsuite/Makefile.in: Likewise.
5499
7223e9ca
ILT
55002010-08-19 Ian Lance Taylor <iant@google.com>
5501
5502 PR 10893
5503 * i386.cc (class Output_data_plt_i386): Update declarations.
5504 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5505 local_ifuncs_ fields.
5506 (Target_i386::do_plt_section_for_global): New function.
5507 (Target_i386::do_plt_section_for_local): New function.
5508 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5509 parameter; change all callers. Initialize global_ifuncs_ and
5510 local_ifuncs_. If doing a static link define __rel_iplt_start and
5511 __rel_iplt_end.
5512 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5513 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5514 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5515 symbols.
5516 (Target_i386::make_plt_section): New function, broken out of
5517 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5518 (Target_i386::make_plt_entry): Call make_plt_section.
5519 (Target_i386::make_local_ifunc_plt_entry): New function.
5520 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5521 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5522 R_386_IRELATIVE to switch.
5523 (Target_i386::Scan::global): Likewise.
5524 (Target_i386::Relocate::relocate): Likewise.
5525 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5526 switch.
5527 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5528 (Target_x86_64::do_plt_section_for_global): New function.
5529 (Target_x86_64::do_plt_section_for_local): New function.
5530 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5531 parameter; change all callers. If doing a static link define
5532 __rela_iplt_start and __rela_iplt_end.
5533 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5534 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5535 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5536 to point to .plt.
5537 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5538 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5539 switch.
5540 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5541 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5542 R_X86_64_IRELATIVE to switch.
5543 (Target_x86_64::Scan::global): Likewise.
5544 (Target_x86_64::Relocate::relocate): Likewise.
5545 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5546 switch.
5547 * target.h (class Target): Add plt_section_for_global and
5548 plt_section_for_local functions. Add do_plt_section_for_global
5549 and do_plt_section_for_local virtual functions.
5550 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5551 clarifying comments.
5552 (Symbol::use_plt_offset): Handle IFUNC symbol.
5553 * object.cc (Sized_relobj::Sized_relobj): Initialize
5554 local_plt_offsets_.
5555 (Sized_relobj::local_has_plt_offset): New function.
5556 (Sized_relobj::local_plt_offset): New function.
5557 (Sized_relobj::set_local_plt_offset): New function.
5558 (Sized_relobj::do_count): Handle IFUNC symbol.
5559 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5560 a bit away from input_shndx_ field. Add set_is_func_symbol and
5561 is_ifunc_symbol functions.
5562 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5563 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5564 local_plt_offsets_ field.
5565 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5566 * output.h (class Output_section_data): Add non-const
5567 output_section function.
5568 (class Output_data_got): Update declarations.
5569 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5570 Add use_plt_offset parameter to global and local constructors.
5571 Change all callers. Change local_sym_index_ field to 31 bits.
5572 Change GSYM_CODE and CONSTANT_CODE accordingly.
5573 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5574 doing a static link don't set sh_link field.
5575 (Output_data_got::Got_entry::write): Use PLT offset if
5576 appropriate.
5577 (Output_data_got::add_global_plt): New function.
5578 (Output_data_got::add_local_plt): New function.
5579 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5580 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5581 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5582 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5583 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5584 IFUNC conditional.
5585 * testsuite/ifunc-sel.h: New file.
5586 * testsuite/ifuncmain1.c: New file.
5587 * testsuite/ifuncmain1vis.c: New file.
5588 * testsuite/ifuncmod1.c: New file.
5589 * testsuite/ifuncdep2.c: New file.
5590 * testsuite/ifuncmain2.c: New file.
5591 * testsuite/ifuncmain3.c: New file.
5592 * testsuite/ifuncmod3.c: New file.
5593 * testsuite/ifuncmain4.c: New file.
5594 * testsuite/ifuncmain5.c: New file.
5595 * testsuite/ifuncmod5.c: New file.
5596 * testsuite/ifuncmain6pie.c: New file.
5597 * testsuite/ifuncmod6.c: New file.
5598 * testsuite/ifuncmain7.c: New file.
5599 * configure, testsuite/Makefile.in: Rebuild.
5600
56f75c03
ILT
56012010-08-18 Ian Lance Taylor <iant@google.com>
5602
5603 * incremental.cc
5604 (Output_section_incremental_inputs::write_input_files): Add cast
5605 to avoid signed/unsigned comparison warning.
5606 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5607
55455f89
CC
56082010-08-12 Cary Coutant <ccoutant@google.com>
5609
5610 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5611
e2054bcb
ILT
56122010-08-13 Ian Lance Taylor <iant@google.com>
5613
5614 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5615
74f67560
DK
56162010-08-12 Cary Coutant <ccoutant@google.com>
5617 Doug Kwan <dougkwan@google.com>
5618
5619 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5620 defintion overrides non-weak undef, remember that the original undef
5621 is not weak.
5622 * symtab.cc (Symbol_table::sized_write_global): For undef without
5623 an original weak binding, set binding to global in output.
5624 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5625 * testsuite/Makefile.in: Regenerate.
5626 * testsuite/strong_ref_weak_def.sh: New file.
5627 * testsuite/strong_ref_weak_def_1.c: Ditto.
5628 * testsuite/strong_ref_weak_def_2.c: Ditto.
5629
d1238d12
CC
56302010-08-12 Cary Coutant <ccoutant@google.com>
5631
5632 * testsuite/incremental_test.sh: Rewrite.
5633 * testsuite/incremental_test_1.c: Rewrite.
5634 * testsuite/incremental_test_2.c: Rewrite.
5635
0e70b911
CC
56362010-08-12 Cary Coutant <ccoutant@google.com>
5637
5638 * arm.cc (Target_arm::got_size): Add const.
5639 (Target_arm::got_entry_count): New function.
5640 (Target_arm::plt_entry_count): New function.
5641 (Target_arm::first_plt_entry_offset): New function.
5642 (Target_arm::plt_entry_size): New function.
5643 (Output_data_plt_arm::entry_count): New function.
5644 (Output_data_plt_arm::first_plt_entry_offset): New function.
5645 (Output_data_plt_arm::get_plt_entry_size): New function.
5646 * i386.cc (Target_i386::got_size): Add const.
5647 (Target_i386::got_entry_count): New function.
5648 (Target_i386::plt_entry_count): New function.
5649 (Target_i386::first_plt_entry_offset): New function.
5650 (Target_i386::plt_entry_size): New function.
5651 (Output_data_plt_i386::entry_count): New function.
5652 (Output_data_plt_i386::first_plt_entry_offset): New function.
5653 (Output_data_plt_i386::get_plt_entry_size): New function.
5654 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5655 find_incremental_inputs_sections. Dump incremental_got_plt section.
5656 * incremental.cc: Include target.h.
5657 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5658 parameter. Adjust all callers. Find incremental_got_plt section.
5659 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5660 section.
5661 (Output_section_incremental_inputs::set_final_data_size): Calculate
5662 size of incremental_got_plt section.
5663 (Output_section_incremental_inputs::do_write): Write the
5664 incremental_got_plt section.
5665 (Got_plt_view_info): New struct.
5666 (Local_got_offset_visitor): New class.
5667 (Global_got_offset_visitor): New class.
5668 (Global_symbol_visitor_got_plt): New class.
5669 (Output_section_incremental_inputs::write_got_plt): New function.
5670 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5671 Add parameter. Adjust all callers.
5672 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5673 (Incremental_inputs::got_plt_section): New function.
5674 (Incremental_inputs::got_plt_section_): New data member.
5675 (Incremental_got_plt_reader): New class.
5676 * layout.cc (Layout::create_incremental_info_sections): Add the
5677 incremental_got_plt section.
5678 * object.h (Got_offset_list::get_list): New function.
5679 (Got offset_list::for_all_got_offsets): New function.
5680 (Sized_relobj::local_got_offset_list): New function.
5681 * powerpc.cc (Target_powerpc::got_size): Add const.
5682 (Target_powerpc::got_entry_count): New function.
5683 (Target_powerpc::plt_entry_count): New function.
5684 (Target_powerpc::first_plt_entry_offset): New function.
5685 (Target_powerpc::plt_entry_size): New function.
5686 (Output_data_plt_powerpc::entry_count): New function.
5687 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5688 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5689 * sparc.cc (Target_sparc::got_size): Add const.
5690 (Target_sparc::got_entry_count): New function.
5691 (Target_sparc::plt_entry_count): New function.
5692 (Target_sparc::first_plt_entry_offset): New function.
5693 (Target_sparc::plt_entry_size): New function.
5694 (Output_data_plt_sparc::entry_count): New function.
5695 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5696 (Output_data_plt_sparc::get_plt_entry_size): New function.
5697 * symtab.h (Symbol::got_offset_list): New function.
5698 (Symbol_table::for_all_symbols): New function.
5699 * target.h (Sized_target::got_entry_count): New function.
5700 (Sized_target::plt_entry_count): New function.
5701 (Sized_target::plt_entry_size): New function.
5702 * x86_64.cc (Target_x86_64::got_size): Add const.
5703 (Target_x86_64::got_entry_count): New function.
5704 (Target_x86_64::plt_entry_count): New function.
5705 (Target_x86_64::first_plt_entry_offset): New function.
5706 (Target_x86_64::plt_entry_size): New function.
5707 (Output_data_plt_x86_64::entry_count): New function.
5708 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5709 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5710
09ec0418
CC
57112010-08-12 Cary Coutant <ccoutant@google.com>
5712
5713 * archive.cc: Include incremental.h.
5714 (Archive::Archive): Initialize incremental_info_.
5715 (Archive::include_member): Record archive members in incremental info.
5716 (Add_archive_symbols::run): Record begin and end of an archive in
5717 incremental info.
5718 (Lib_group::include_member): Record objects in incremental info.
5719 * archive.h (Incremental_archive_entry): Forward declaration.
5720 (Archive::set_incremental_info): New member function.
5721 (Archive::incremental_info): New member function.
5722 (Archive::Unused_symbol_iterator): New class.
5723 (Archive::unused_symbols_begin): New member function.
5724 (Archive::unused_symbols_end): New member function.
5725 (Archive::incremental_info_): New data member.
5726 * incremental-dump.cc (find_input_containing_global): New function.
5727 (dump_incremental_inputs): Dump new incremental info sections.
5728 * incremental.cc: Include symtab.h.
5729 (Output_section_incremental_inputs): New class.
5730 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5731 new incremental info sections.
5732 (Sized_incremental_binary::do_check_inputs): Likewise.
5733 (Incremental_inputs::report_archive): Remove.
5734 (Incremental_inputs::report_archive_begin): New function.
5735 (Incremental_inputs::report_archive_end): New function.
5736 (Incremental_inputs::report_object): New function.
5737 (Incremental_inputs::finalize_inputs): Remove.
5738 (Incremental_inputs::report_input_section): New function.
5739 (Incremental_inputs::report_script): Rewrite.
5740 (Incremental_inputs::finalize): Do nothing but finalize string table.
5741 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5742 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5743 (Incremental_inputs::create_data_sections): New function.
5744 (Incremental_inputs::relocs_entsize): New function.
5745 (Output_section_incremental_inputs::set_final_data_size): New function.
5746 (Output_section_incremental_inputs::do_write): New function.
5747 (Output_section_incremental_inputs::write_header): New function.
5748 (Output_section_incremental_inputs::write_input_files): New function.
5749 (Output_section_incremental_inputs::write_info_blocks): New function.
5750 (Output_section_incremental_inputs::write_symtab): New function.
5751 * incremental.h (Incremental_script_entry): Forward declaration.
5752 (Incremental_object_entry): Forward declaration.
5753 (Incremental_archive_entry): Forward declaration.
5754 (Incremental_inputs): Forward declaration.
5755 (Incremental_inputs_header_data): Remove.
5756 (Incremental_inputs_header): Remove.
5757 (Incremental_inputs_header_write): Remove.
5758 (Incremental_inputs_entry_data): Remove.
5759 (Incremental_inputs_entry): Remove.
5760 (Incremental_inputs_entry_write): Remove.
5761 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5762 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5763 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5764 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5765 Likewise.
5766 (Incremental_input_entry): New class.
5767 (Incremental_script_entry): New class.
5768 (Incremental_object_entry): New class.
5769 (Incremental_archive_entry): New class.
5770 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5771 (Incremental_inputs::report_inputs): Remove.
5772 (Incremental_inputs::report_archive): Remove.
5773 (Incremental_inputs::report_archive_begin): New function.
5774 (Incremental_inputs::report_archive_end): New function.
5775 (Incremental_inputs::report_object): Change prototype.
5776 (Incremental_inputs::report_input_section): New function.
5777 (Incremental_inputs::report_script): Change prototype.
5778 (Incremental_inputs::get_reloc_count): New function.
5779 (Incremental_inputs::set_reloc_count): New function.
5780 (Incremental_inputs::create_data_sections): New function.
5781 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5782 (Incremental_inputs::inputs_section): New function.
5783 (Incremental_inputs::symtab_section): New function.
5784 (Incremental_inputs::relocs_section): New function.
5785 (Incremental_inputs::get_stringpool): Add const.
5786 (Incremental_inputs::command_line): Add const.
5787 (Incremental_inputs::inputs): Remove.
5788 (Incremental_inputs::command_line_key): New function.
5789 (Incremental_inputs::input_file_count): New function.
5790 (Incremental_inputs::input_files): New function.
5791 (Incremental_inputs::relocs_entsize): New function.
5792 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5793 (Incremental_inputs::finalize_inputs): Remove.
5794 (Incremental_inputs::Input_info): Remove.
5795 (Incremental_inputs::lock_): Remove.
5796 (Incremental_inputs::inputs_): Change type.
5797 (Incremental_inputs::inputs_map_): Remove.
5798 (Incremental_inputs::current_object_entry_): New data member.
5799 (Incremental_inputs::inputs_section_): New data member.
5800 (Incremental_inputs::symtab_section_): New data member.
5801 (Incremental_inputs::relocs_section_): New data member.
5802 (Incremental_inputs::reloc_count_): New data member.
5803 (Incremental_inputs_reader): New class.
5804 (Incremental_symtab_reader): New class.
5805 (Incremental_relocs_reader): New class.
5806 * layout.cc (Layout::finalize): Move finalization of incremental info
5807 and creation of incremental info sections to follow finalization of
5808 symbol table. Set offsets for postprocessing sections.
5809 (Layout::create_incremental_info_sections): Call
5810 Incremental_inputs::create_data_sections. Add incremental symtab
5811 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5812 sections to layout after input sections.
5813 * layout.h (struct Timespec): Forward declaration.
5814 (Layout::incremental_inputs): Add const.
5815 (Layout::create_incremental_info_sections): Add parameter.
5816 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5817 * object.cc: Include incremental.h.
5818 (Relobj::finalize_incremental_relocs): New function.
5819 (Sized_relobj::do_layout): Record input sections in incremental info.
5820 * object.h (Object::output_section): New function.
5821 (Object::output_section_offset): Moved from Relobj.
5822 (Object::get_incremental_reloc_base): New function.
5823 (Object::get_incremental_reloc_count): New function.
5824 (Object::do_output_section): New function.
5825 (Object::do_output_section_offset): Moved from Relobj.
5826 (Object::do_get_incremental_reloc_base): New function.
5827 (Object::do_get_incremental_reloc_count): New function.
5828 (Object::Object): Initialize new data members.
5829 (Relobj::output_section): Renamed do_output_section and moved to
5830 protected.
5831 (Relobj::output_section_offset): Moved to Object.
5832 (Relobj::do_get_incremental_reloc_base): New function.
5833 (Relobj::do_get_incremental_reloc_count): New function.
5834 (Relobj::allocate_incremental_reloc_counts): New function.
5835 (Relobj::count_incremental_reloc): New function.
5836 (Relobj::finalize_incremental_relocs): New function.
5837 (Relobj::next_incremental_reloc_index): New function.
5838 (Relobj::reloc_counts_): New data member.
5839 (Relobj::reloc_bases_): New data member.
5840 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5841 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5842 (Sized_relobj::incremental_relocs_scan): New function.
5843 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5844 (Sized_relobj::incremental_relocs_write): New function.
5845 (Sized_relobj::incremental_relocs_write_reltype): New function.
5846 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5847 incremental link.
5848 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5849 archives and object files elsewhere.
5850 (Add_symbols::run): Report object files here.
5851 (Finish_group::run): Report end of archive at end of group.
5852 * reloc.cc: Include layout.h, incremental.h.
5853 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5854 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5855 (Sized_relobj::incremental_relocs_scan): New function.
5856 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5857 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5858 (Sized_relobj::incremental_relocs_write): New function.
5859 (Sized_relobj::incremental_relocs_write_reltype): New function.
5860 * script.cc (read_input_script): Rewrite test for incremental link.
5861 Change call to Incremental_inputs::report_script.
5862 * symtab.h (Symbol_table::first_global_index): New function.
5863 (Symbol_table::output_count): New function.
5864
ce0d1972
DK
58652010-08-12 Doug Kwan <dougkwan@google.com>
5866
5867 * arm.cc (Target_arm::merge_object_attributes): Check command line
5868 options --no-wchar-size-warning and --no-enum-size-warning.
5869 * options.h (General_options): Add ld-compatible options
5870 --no-enum-size-warning and --no-wchar-size-warning.
5871
6e5710ce
ILT
58722010-08-04 Ian Lance Taylor <iant@google.com>
5873
5874 * x86_64.cc (Target_x86_64::Scan::local): Use
5875 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5876 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5877 (Target_x86_64::Scan::global): Likewise.
5878 (Target_x86_64::Relocate::relocate): Likewise.
5879 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5880 Likewise.
5881
fef830db
CC
58822010-08-03 Cary Coutant <ccoutant@google.com>
5883
5884 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5885 to reserve space in merged_strings vector. Keep total input size
5886 for stats.
5887 (Output_merge_string::do_print_merge_stats): Print total input size.
5888 * merge.h (Output_merge_string): Add input_size_ field.
5889 * stringpool.cc (Stringpool_template::string_length): Move
5890 implementations out of Stringpool_template class and place in
5891 stringpool.h.
5892 * stringpool.h (string_length): Move out of Stringpool_template.
5893
1e3811b0
ILT
58942010-08-03 Ian Lance Taylor <iant@google.com>
5895
5896 PR 11712
5897 * layout.cc (relaxation_loop_body): If address of load segment is
5898 set, adjust address to include headers if possible.
5899
7af0c620
ILT
59002010-08-03 Ian Lance Taylor <iant@google.com>
5901
5902 * version.cc (version_string): Bump to 1.10.
5903
22f0da72
ILT
59042010-08-03 Ian Lance Taylor <iant@google.com>
5905
5906 PR 11805
5907 * layout.h (enum Output_section_order): Define.
5908 (class Layout): Update declarations.
5909 * layout.cc (Layout::get_output_section): Add order parameter.
5910 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5911 is_first_non_relro parameters. Change all callers.
5912 (Layout::choose_output_section): Likewise.
5913 (Layout::add_output_section_data): Likewise.
5914 (Layout::make_output_section): Likewise. Set order.
5915 (Layout::default_section_order): New function.
5916 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5917 * output.cc (Output_section::Output_section): Initialize order_.
5918 Don't initialize deleted fields.
5919 (Output_segment::Output_segment): Don't initialize deleted
5920 fields.
5921 (Output_segment::add_output_section_to_load): New function
5922 replacing add_output_section. Change all callers to call this or
5923 add_output_section_to_nonload.
5924 (Output_segment::add_output_section_to_nonload): New function.
5925 (Output_segment::remove_output_section): Rewrite.
5926 (Output_segment::add_initial_output_data): Likewise.
5927 (Output_segment::has_any_data_sections): Likewise.
5928 (Output_segment::is_first_section_relro): Likewise.
5929 (Output_segment::maximum_alignment): Likewise.
5930 (Output_segment::has_dynamic_reloc): New function replacing
5931 dynamic_reloc_count. Change all callers.
5932 (Output_segment::has_dynamic_reloc_list): New function replacing
5933 dynamic_reloc_count_list. Change all callers.
5934 (Output_segment::set_section_addresses): Rewrite.
5935 (Output_segment::set_offset): Rewrite.
5936 (Output_segment::find_first_and_last_list): Remove.
5937 (Output_segment::set_tls_offsets): Rewrite.
5938 (Output_segment::first_section_load_address): Likewise.
5939 (Output_segment::output_section_count): Likewise.
5940 (Output_segment::section_with_lowest_load_address): Likewise.
5941 (Output_segment::write_section_headers): Likewise.
5942 (Output_segment::print_sections_to_map): Likewise.
5943 * output.h (class Output_data): Remove dynamic_reloc_count_
5944 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5945 (Output_data::add_dynamic_reloc): Rewrite.
5946 (Output_data::has_dynamic_reloc): New function.
5947 (Output_data::dynamic_reloc_count): Remove.
5948 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5949 is_last_relro_, is_first_non_relro_, is_interp_,
5950 is_dynamic_linker_section_ fields. Add order and set_order
5951 functions. Remove is_relro_local, set_is_relro_local,
5952 is_last_relro, set_is_last_relro, is_first_non_relro,
5953 set_is_first_non_relro functions, is_interp, set_is_interp,
5954 is_dynamic_linker_section, and set_is_dynamic_linker_section
5955 functions.
5956 (class Output_segment): Change Output_data_list from std::list to
5957 std:;vector. Add output_lists_ field. Remove output_data_ and
5958 output_bss_ fields. Update declarations.
5959
3ff2ccb0
ILT
59602010-08-02 Ian Lance Taylor <iant@google.com>
5961
5962 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5963 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5964 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5965
88a4108b
ILT
59662010-08-02 Ian Lance Taylor <iant@google.com>
5967
5968 PR 11855
5969 * script.cc (Script_options::Script_options): Initialize
5970 symbol_definitions_ and symbol_references_.
5971 (Script_options::add_symbol_assignment): Update
5972 symbol_definitions_ and symbol_references_.
5973 (Script_options::add_symbol_reference): New function.
5974 (script_symbol): New function.
5975 * script.h (class Script_options): Add symbol_definitions_ and
5976 symbol_references_ fields.
5977 (Script_options::referenced_const_iterator): New type.
5978 (Script_options::referenced_begin): New function.
5979 (Script_options::referenced_end): New function.
5980 (Script_options::is_referenced): New function.
5981 (Script_options::any_unreferenced): New function.
5982 * script-c.h (script_symbol): Declare.
5983 * yyscript.y (exp): Call script_symbol.
5984 * symtab.cc: Include "script.h".
5985 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5986 Change all callers. Check symbols referenced by scripts.
5987 (Symbol_table::add_undefined_symbols_from_command_line): Add
5988 layout parameter. Change all callers.
5989 (Symbol_table::do_add_undefined_symbols_from_command_line):
5990 Likewise. Break out loop body. Check symbols referenced by
5991 scripts.
5992 (Symbol_table::add_undefined_symbol_from_command_line): New
5993 function broken out of
5994 do_add_undefined_symbols_from_command_line.
5995 * symtab.h (class Symbol_table): Update declarations.
5996 * archive.cc: Include "layout.h".
5997 (Archive::should_include_member): Add layout parameter. Change
5998 all callers. Check for symbol mentioned in expression.
5999 * archive.h (class Archive): Update declaration.
6000 * object.cc (Sized_relobj::do_should_include_member): Add layout
6001 parameter.
6002 * object.h (Object::should_include_member): Add layout parameter.
6003 Change all callers.
6004 (Object::do_should_include_member): Add layout parameter.
6005 (class Sized_relobj): Update declaration.
6006 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6007 parameter.
6008 * dynobj.h (class Sized_dynobj): Update declaration.
6009 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6010 layout parameter.
6011 * plugin.h (class Sized_pluginobj): Update declaration.
6012
5f1ab67a
ILT
60132010-08-02 Ian Lance Taylor <iant@google.com>
6014
6015 PR 11866
6016 * output.cc (Output_segment::set_offset): Search for the first and
6017 last sections rather than assuming that the list is in order.
6018 (Output_segment::find_first_and_last_list): New function.
6019 * output.h (class Output_segment): Update declarations.
6020 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6021 (relro_strip_test_SOURCES): New variable.
6022 (relro_strip_test_DEPENDENCIES): New variable.
6023 (relro_strip_test_LDFLAGS): New variable.
6024 (relro_strip_test_LDADD): New variable.
6025 (relro_strip_test.so): New target.
6026
a8df5856
ILT
60272010-08-02 Ian Lance Taylor <iant@google.com>
6028
6029 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6030 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6031 (Target_i386::got_tlsdesc_section): New function.
6032 (Target_i386::got_section): Create space for GOT entries for
6033 TLSDESC relocations.
6034 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6035 R_386_TLS_GOTDESC.
6036 (Target_i386::Scan::global): Likewise.
6037 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6038 using TLSDESC GOT.
6039 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6040 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6041 (Target_x86_64::got_tlsdesc_section): New function.
6042 (Target_x86_64::got_section): Create space for GOT entries for
6043 TLSDESC relocations.
6044 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6045 R_386_TLS_GOTDESC.
6046 (Target_x86_64::Scan::global): Likewise.
6047 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6048 using TLSDESC GOT.
6049
0c10a0a6
ILT
60502010-08-02 Ian Lance Taylor <iant@google.com>
6051
6052 * testsuite/final_layout.sh: Use dc to convert from hex to
6053 decimal.
6054
41cbeecc
ST
60552010-07-29 Sriraman Tallam <tmsriram@google.com>
6056
6057 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6058 paramter to the call to gold::gc_process_relocs.
6059 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6060 paramter to the call to gold::gc_process_relocs.
6061 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6062 parameter to the call to gold::gc_process_relocs.
6063 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6064 template parameter to the call to gold::gc_process_relocs.
6065 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6066 paramter to the call to gold::gc_process_relocs.
6067 * gc.h (get_embedded_addend_size): New function.
6068 (gc_process_relocs): Save the size of the reloc for use by ICF.
6069 * icf.cc (get_section_contents): Get the addend from the text section
6070 for SHT_REL relocation sections.
6071 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6072 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6073 * int_encoding.h (read_from_pointer): New overloaded function.
6074 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6075 * testsuite/icf_sht_rel_addend_test.sh: New file.
6076 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6077 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6078
6ea55b82
RW
60792010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6080
6081 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6082 * Makefile.in: Regenerate.
6083 * testsuite/Makefile.in: Regenerate.
6084
9691462b
ILT
60852010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6086
6087 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6088 * gold/testsuite/debug_msg.cc: Likewise.
6089 * gold/testsuite/odr_violation1.cc
6090 * gold/testsuite/odr_violation2.cc
6091
76897331
CC
60922010-07-21 Cary Coutant <ccoutant@google.com>
6093
6094 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6095 string, and length fields.
6096 (Output_merge_string::Merged_strings_list): New type.
6097 (Output_merge_string::Merged_strings_lists): New typedef.
6098 (Output_merge_string): Replace merged_strings_ with
6099 merged_strings_lists_.
6100 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6101 Merged_strings_list per input object and section. Don't store pointer
6102 to the string. Don't store length with each merged string entry.
6103 (Output_merge_string::finalize_merged_data): Loop over list of merged
6104 strings lists. Recompute length of each merged string.
6105
78384e8f
CC
61062010-07-15 Cary Coutant <ccoutant@google.com>
6107
6108 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6109 here.
6110
783659f9
ILT
61112010-07-14 Ian Lance Taylor <iant@google.com>
6112
6113 * descriptors.cc (Descriptors::open): Report correct name in error
6114 message.
6115
131687b4
DK
61162010-07-13 Doug Kwan <dougkwan@google.com>
6117
6118 * arm.cc (Arm_input_section::Arm_input_section): For a
6119 SHT_ARM_EXIDX section, always keeps the input sections.
6120 (Arm_input_section::set_exidx_section_link): New method.
6121 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6122 has_errors_ to false.
6123 (Arm_exidx_input_section::has_errors,
6124 Arm_exidx_input_section::set_has_errors): New methods.
6125 (Arm_exidx_input_section::has_errors_): New data member.
6126 (Arm_relobj::get_exidx_shndx_list): New method.
6127 (Arm_output_section::append_text_sections_to_list): Do not skip
6128 section without SHF_EXECINSTR.
6129 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6130 errors.
2e702c99 6131 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6132 section header. Make error messages more verbose. Check for
6133 a non-executable section linked to an EXIDX section.
6134 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6135 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6136 check that there is no deferred EXIDX section if we exit early.
6137 Instead of not making an EXIDX section in case of an error, make one
6138 and set the has_errors flag of it.
6139 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6140 in a relocatable link.
6141 (Target_arm::do_relax): Look for the EXIDX output section instead of
6142 assuming that it is called .ARM.exidx.
2e702c99 6143 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6144 section list. Do not check for SHF_EXECINSTR section flags but
6145 skip any input section with errors.
6146 * output.cc (Output_section::Output_section): Initialize
6147 always_keeps_input_sections_ to false.
6148 (Output_section::add_input_section): Check for
6149 always_keeps_input_sections_.
6150 * output.h (Output_section::always_keeps_input_sections,
6151 Output_section::set_always_keeps_input_sections): New methods.
6152 (Output_section::always_keeps_input_sections): New data member.
6153
69517287
RÁE
61542010-07-13 Rafael Espindola <espindola@google.com>
6155
6156 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6157 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6158
82742395
ILT
61592010-07-13 Philip Herron <herron.philip@googlemail.com>
6160 Ian Lance Taylor <iant@google.com>
6161
6162 * output.h (Output_section_lookup_maps::add_merge_section):
6163 Correct check of whether value was inserted.
6164 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6165 (Output_section_lookup_maps::add_relaxed_input_section):
6166 Likewise.
6167 * arm.cc (Target_arm::got_section): Remove used local os.
6168 * i386.cc (Target_i386::got_section): Likewise.
6169 * x86_64.cc (Target_x86_64::got_section): Likewise.
6170 * sparc.cc (Target_sparc::got_section): Likewise.
6171 (Target_sparc::relocate): Remove unused local have_got_offset.
6172 * powerpc.cc (Target_powerpc::relocate): Likewise.
6173
f2d707b5
ILT
61742010-07-13 Ian Lance Taylor <iant@google.com>
6175
241531d6
ILT
6176 * compressed_output.cc (zlib_decompress): Fix signature in
6177 !HAVE_ZLIB_H case.
6178
f2d707b5
ILT
6179 * archive.cc (Archive::include_member): Unlock an external member
6180 of a thin archive. Don't bother to delete an object we know is
6181 NULL.
6182
a2e47362
CC
61832010-07-12 Cary Coutant <ccoutant@google.com>
6184
6185 * compressed_output.cc (zlib_decompress): New function.
6186 (get_uncompressed_size): New function.
6187 (decompress_input_section): New function.
6188 * compressed_output.h (get_uncompressed_size): New function.
6189 (decompress_input_section): New function.
6190 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6191 Handle compressed debug sections.
6192 * layout.cc (is_compressed_debug_section): New function.
6193 (Layout::output_section_name): Map compressed section names to
6194 canonical names.
6195 * layout.h (is_compressed_debug_section): New function.
6196 (is_debug_info_section): Recognize compressed debug sections.
6197 * merge.cc: Include compressed_output.h.
6198 (Output_merge_data::do_add_input_section): Handle compressed
6199 debug sections.
6200 (Output_merge_string::do_add_input_section): Handle compressed
6201 debug sections.
6202 * object.cc: Include compressed_output.h.
6203 (Sized_relobj::Sized_relobj): Initialize new data members.
6204 (build_compressed_section_map): New function.
6205 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6206 * object.h (Object::section_is_compressed): New method.
6207 (Object::do_section_is_compressed): New method.
6208 (Sized_relobj::Compressed_section_map): New type.
6209 (Sized_relobj::do_section_is_compressed): New method.
6210 (Sized_relobj::compressed_sections_): New data member.
6211 * output.cc (Output_section::add_input_section): Handle compressed
6212 debug sections.
6213 * reloc.cc: Include compressed_output.h.
6214 (Sized_relobj::write_sections): Handle compressed debug sections.
6215
ce279a62
CC
62162010-07-08 Cary Coutant <ccoutant@google.com>
6217
6218 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6219 weak when resolving to a dynamic def.
6220 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6221 for weak undef/dynamic def cases. Adjust callers.
6222 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6223 undef_binding_weak_.
6224 (Symbol_table::sized_write_globals): Adjust symbol binding.
6225 (Symbol_table::sized_write_symbol): Add binding parameter.
6226 * symtab.h (Symbol::set_undef_binding): New method.
6227 (Symbol::is_undef_binding_weak): New method.
6228 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6229 (Symbol_table::should_override): Add new parameter.
6230 (Symbol_table::sized_write_symbol): Add new parameter.
6231
6232 * testsuite/weak_undef_file1.cc: Add new test case.
6233 * testsuite/weak_undef_file2.cc: Fix header comment.
6234 * testsuite/weak_undef_test.cc: Add new test case.
6235
b2286c10
DK
62362010-06-29 Doug Kwan <dougkwan@google.com>
6237
6238 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6239 Initialize USE_SYMBOL_.
6240 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6241 definition.
6242 (Arm_reloc_property::uses_symbol_): New data member declaration.
6243 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6244 uses symbol value and symbol is undefined but not weakly undefined.
6245
4802450a
RÁE
62462010-06-28 Rafael Espindola <espindola@google.com>
6247
6248 * plugin.cc (Plugin::load): Use dlerror.
6249
e5ca47ba
ILT
62502010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6251
6252 * symtab.cc (detect_odr_violations): When reporting an ODR
6253 violation, report an object where the symbol is defined.
6254
8a75a161
DK
62552010-06-25 Doug Kwan <dougkwan@google.com>
6256
6257 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6258 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6259 definition.
6260 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6261 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6262 target hook to detect function points.
6263 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6264 * icf.h (Icf::check_section_for_function_pointers): Change type of
6265 parameter SECTION_NAME to const reference to std::string. Use
6266 target hook to determine if section may have unsafe pointers.
6267 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6268 method definition.
6269
42218b9f
RÁE
62702010-06-21 Rafael Espindola <espindola@google.com>
6271
6272 * fileread.cc (Input_file::find_fie): New
6273 (Input_file::open): Use Input_file::find_fie.
6274 * fileread.h (Input_file::find_fie): New
6275 * plugin.cc (set_extra_library_path): New.
6276 (Plugin::load): Add set_extra_library_path to the transfer vector.
6277 (Plugin_manager::set_extra_library_path): New.
6278 (Plugin_manager::add_input_file): Use the extra search path if set.
6279 (set_extra_library_path(): New.
6280 * plugin.h (Plugin_manager): Add set_extra_library_path and
6281 extra_search_path_.
6282
a0506cca
CC
62832010-06-19 Cary Coutant <ccoutant@google.com>
6284
6285 * layout.cc (gdb_sections): Add .debug_types.
6286 (lines_only_debug_sections): Likewise.
6287
6508b958
RÁE
62882010-06-18 Rafael Espindola <espindola@google.com>
6289
6290 * plugin.cc (add_input_file,add_input_library)
6291 (Plugin_manager::add_input_file): Make filename arguments const.
6292 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6293 const.
6294
3e235302
DK
62952010-06-16 Doug Kwan <dougkwan@google.com>
6296
6297 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6298 .ARM.attributes section if we have not merged any input
6299 attributes sections.
6300
106e8a6c
DK
63012010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6302
6303 * arm.cc: Allow combining objects with no EABI version
6304 information.
6305
91ff43fe
RÁE
63062010-06-15 Rafael Espindola <espindola@google.com>
6307
6308 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6309
68ed838c
ILT
63102010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6311
6312 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6313 (struct iovec): Correct !HAVE_READV definition.
6314
f3a2388f
CC
63152010-06-10 Cary Coutant <ccoutant@google.com>
6316
6317 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6318 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6319 reloc sections.
6320 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6321
6322 PR 11683
6323 * symtab.h (Symbol::is_placeholder): New member function.
6324 * target-reloc.h (relocate_section): Check for placeholder symbols.
6325
6326 * testsuite/Makefile.am (plugin_test_8): New test.
6327 (plugin_test_9): New test.
6328 * testsuite/Makefile.in: Regenerate.
6329
e1df38aa
NC
63302010-06-09 Nick Clifton <nickc@redhat.com>
6331
6332 * yyscript.y (input_list_element): Allow strings prefixed with
6333 the '-' character. Treat these as libraries.
6334 * script.cc (script_add_library): New function. Adds a library
6335 specified by "-l<name>" found in an input script.
6336 * script-c.h: Add prototype for script_add_library.
6337
25bbe950
DK
63382010-06-07 Doug Kwan <dougkwan@google.com>
6339
6340 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6341 Restrict stub-group size to be within long conditional branch
6342 range when working around cortex-A8 erratum.
6343
0f32ea4c
ILT
63442010-06-07 Damien Diederen <dd@crosstwine.com>
6345
6346 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6347 #ifdef typo.
6348
8fe2a369
ST
63492010-06-03 Sriraman Tallam <tmsriram@google.com>
6350
6351 PR gold/11658
6352 * output.cc
6353 (Output_section::Input_section_sort_entry::compare_section_ordering):
6354 Change to return non-zero correctly.
6355 (Output_section::Input_section_sort_section_order_index_compare
6356 ::operator()): Change to fix ambiguity in comparisons.
6357
6e9ba2ca
ST
63582010-06-01 Sriraman Tallam <tmsriram@google.com>
6359
6360 * gold.h (is_wildcard_string): New function.
6361 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6362 (Layout::layout_eh_frame): Ditto.
6363 (Layout::find_section_order_index): New method.
6364 (Layout::read_layout_from_file): New method.
6365 * layout.h (Layout::find_section_order_index): New method.
6366 (Layout::read_layout_from_file): New method.
6367 (Layout::input_section_position_): New private member.
6368 (Layout::input_section_glob_): New private member.
6369 * main.cc (main): Call read_layout_from_file here.
6370 * options.h (--section-ordering-file): New option.
6371 * output.cc (Output_section::input_section_order_specified_): New
6372 member.
6373 (Output_section::Output_section): Initialize new member.
6374 (Output_section::add_input_section): Add new parameter.
6375 Keep input sections when --section-ordering-file is used.
6376 (Output_section::set_final_data_size): Sort input sections when
6377 section ordering file is specified.
6378 (Output_section::Input_section_sort_entry): Add new parameter.
6379 Check sorting type.
6380 (Output_section::Input_section_sort_entry::compare_section_ordering):
6381 New method.
6382 (Output_section::Input_section_sort_compare::operator()): Change to
6383 consider section_order_index.
6384 (Output_section::Input_section_sort_init_fini_compare::operator()):
6385 Change to consider section_order_index.
6386 (Output_section::Input_section_sort_section_order_index_compare
6387 ::operator()): New method.
6388 (Output_section::sort_attached_input_sections): Change to sort
6389 according to section order when specified.
e1df38aa
NC
6390 (Output_section::add_input_section<32, true>): Add new parameter.
6391 (Output_section::add_input_section<64, true>): Add new parameter.
6392 (Output_section::add_input_section<32, false>): Add new parameter.
6393 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6394 * output.h (Output_section::add_input_section): Add new parameter.
6395 (Output_section::input_section_order_specified): New
6396 method.
6397 (Output_section::set_input_section_order_specified): New method.
6398 (Input_section::Input_section): Initialize section_order_index_.
6399 (Input_section::section_order_index): New method.
6400 (Input_section::set_section_order_index): New method.
6401 (Input_section::section_order_index_): New member.
6402 (Input_section::Input_section_sort_section_order_index_compare): New
6403 struct.
6404 (Output_section::input_section_order_specified_): New member.
6405 * script-sections.cc (is_wildcard_string): Delete and move modified
6406 method to gold.h.
6407 (Output_section_element_input::Output_section_element_input): Modify
6408 call to is_wildcard_string.
6409 (Output_section_element_input::Input_section_pattern
6410 ::Input_section_pattern): Ditto.
6411 (Output_section_element_input::Output_section_element_input): Ditto.
6412 * testsuite/Makefile.am (final_layout): New test case.
6413 * testsuite/Makefile.in: Regenerate.
6414 * testsuite/final_layout.cc: New file.
6415 * testsuite/final_layout.sh: New file.
6416
3537c84b
RÁE
64172010-06-01 Rafael Espindola <espindola@google.com>
6418
6419 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6420
105b6afd
RÁE
64212010-06-01 Rafael Espindola <espindola@google.com>
6422
6423 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6424 visibility of symbols.
6425
29e11421
DK
64262010-05-27 Doug Kwan <dougkwan@google.com>
6427
6428 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6429 from start of output section instead of address for a local symbol
6430 in a merged or relaxed section when doing a relocatable link.
6431
5e0f337e
RÁE
64322010-05-26 Rafael Espindola <espindola@google.com>
6433
703d02da 6434 PR 11604
5e0f337e
RÁE
6435 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6436 adding sections the garbage collector removed.
6437 * gold/testsuite/Makefile.am: Add test.
6438 * gold/testsuite/Makefile.in: Regenerate.
6439 * gold/testsuite/plugin_test_7.sh: New.
6440 * gold/testsuite/plugin_test_7_1.c: New.
6441 * gold/testsuite/plugin_test_7_2.c: New.
6442
f4187277
RÁE
64432010-05-26 Rafael Espindola <espindola@google.com>
6444
6445 * script-sections.cc (Output_section_definition::set_section_addresses):
6446 Check for --section-start.
6447
5c388529
DK
64482010-05-26 Doug Kwan <dougkwan@google.com>
6449
6450 * arm.cc (Arm_scan_relocatable_relocs): New class.
6451 (Target_arm::relocate_special_relocatable): New method.
6452 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6453 (Arm_relocate_functions::thumb_branch_common): Same.
6454 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6455 instead of Default_scan_relocatable_relocs.
6456 * target-reloc.h (relocate_for_relocatable): Let target handle
6457 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6458 * target.h (Sized_target::relocate_special_relocatable): New method.
6459
bca1c3ae
ILT
64602010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6461
6462 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6463
0439c796
DK
64642010-05-23 Doug Kwan <dougkwan@google.com>
6465
6466 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6467 instead of a cast.
6468 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6469 with a direct branch, not a conditional branch, to a stub.
6470 * merge.cc (Output_merge_base::record_input_section): New method
6471 defintion.
6472 (Output_merge_data::do_add_input_section): Record input section if
6473 keeps-input-sections flag is set.
6474 (Output_merge_string::do_add_input_section): Ditto.
6475 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6476 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6477 INPUT_SECTIONS_.
6478 (Output_merge_base::keeps_input_sections,
6479 Output_merge_base::set_keeps_input_sections,
6480 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6481 method definitions.
6482 (Output_merge_base::Input_sections): New type declaration.
6483 (Output_merge_base::input_sections_begin,
6484 Output_merge_base::input_sections_end,
6485 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6486 (Output_merge_base::bool keeps_input_sections_,
6487 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6488 Output_merge_base::input_sections_): New data members.
6489 (Output_merge_data::do_set_keeps_input_sections): New method
6490 defintion.
6491 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6492 * output.cc (Output_section::Input_section::relobj): Move method
6493 defintion from class declaration to here and handle merge sections.
6494 (Output_section::Input_section::shndx): Ditto.
6495 (Output_section::Output_section): Remove initializations of removed
6496 data members and initialize new data member LOOKUP_MAPS_.
6497 (Output_section::add_input_section): Set keeps-input-sections flag
6498 for a newly created merge output section as appropriate. Adjust code
6499 to use Output_section_lookup_maps class.
6500 (Output_section::add_relaxed_input_section): Adjst code for lookup
6501 maps code refactoring.
2e702c99 6502 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6503 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6504 class. If adding input section to a newly created merge output
6505 section fails, remove the new merge section.
6506 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6507 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6508 (Output_section::find_merge_section): Ditto.
0439c796 6509 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6510 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6511 Output_section_lookup_maps class.
6512 (Output_section::get_input_sections): Export merge sections. Adjust
6513 code to use Output_section_lookup_maps class.
6514 (Output_section:::add_script_input_section): Adjust code to use
6515 Output_section_lookup_maps class. Update lookup maps for merge
6516 sections also.
6517 (Output_section::discard_states): Use Output_section_lookup_maps.
6518 (Output_section::restore_states): Same.
6519 * output.h (Merge_section_properties): Move class defintion out of
6520 Output_section.
6521 (Output_section_lookup_maps): New class.
6522 (Output_section::Input_section::is_merge_section): New method
6523 defintion.
6524 (Output_section::Input_section::relobj): Move defintion out of class
6525 defintion. Declare method only.
6526 (Output_section::Input_section::shndx): Ditto.
6527 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6528 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6529 (Output_section::Merge_section_by_properties_map,
6530 Output_section::Output_section_data_by_input_section_map,
6531 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6532 Remove types.
2e702c99 6533 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6534 KEEPS_INPUT_SECTIONS.
6535 (Output_section::build_lookup_maps): New method declaration.
6536 (Output_section::merge_section_map_,
6537 Output_section::merge_section_by_properties_map_,
6538 Output_section::relaxed_input_section_map_,
6539 Output_section::is_relaxed_input_section_map_valid_): Remove data
6540 members.
6541 (Output_section::lookup_maps_): New data member.
6542
76295588
L
65432010-05-21 Doug Kwan <dougkwan@google.com>
6544
6545 PR gold/11619
6546 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6547 avoid a compilation error.
6548
d103a984
RÁE
65492010-05-19 Rafael Espindola <espindola@google.com>
6550
6551 * script-sections.cc (Output_section_definition::allocate_to_segment):
6552 Update the phdrs_list even when the output section is NULL.
6553 * testsuite/Makefile.am: Add test.
6554 * testsuite/Makefile.in: Regenerate.
6555 * testsuite/script_test_9.cc: New.
6556 * testsuite/script_test_9.sh: New.
6557 * testsuite/script_test_9.t: New.
6558
6625d24e
DK
65592010-05-19 Doug Kwan <dougkwan@google.com>
6560
6561 * arm.cc (Arm_input_section::original_size): New method.
6562 (Arm_input_section::do_addralign): Add a cast.
6563 (Arm_input_section::do_output_offset): Remove static cast.
6564 (Arm_input_section::original_addralign,
6565 Arm_input_section::original_size_): Change type to uint32_t.
6566 (Arm_input_section::init): Add safe casts for section alignment
6567 and size.
6568 (Arm_input_section::set_final_data_size): Do not set address and
6569 offset of stub table.
6570 (Arm_output_section::fix_exidx_coverage): Change use of of
6571 Output_section::Simple_input_section to that of
6572 Output_section::Input_section.
6573 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6574 except for the first pass.
6575 * output.cc (Output_section::get_input_sections): Change type of
6576 input_sections to std::list<Input_section>.
6577 (Output_section::add_script_input_section): Rename from
6578 Output_section::add_simple_input_section. Change type of SIS
6579 parameter from Simple_input_section to Input_section.
6580 * output.h (Output_section::Simple_input_section): Remove class.
6581 (Output_section::Input_section): Change class visibility to public.
6582 (Output_section::Input_section::addralign): Use stored alignments
6583 for special input sections if set.
6584 (Output_section::Input_section::set_addralign): New method.
6585 (Output_section::get_input_sections): Change parameter type from
6586 list of Simple_input_section to list of Input_section.
6587 (Output_section::add_script_input_section): Rename from
6588 Output_section::add_simple_input_section. Change first parameter's
6589 type from Simple_input_section to Input_section and remove the
6590 second and third parameters.
6591 * script-sections.cc (Input_section::Input_section_list): Change
6592 type to list of Output_section::Input_section/
6593 (Input_section_info::Input_section_info): Change parameter type of
6594 INPUT_SECTION to Output_section::Input_section.
6595 (Input_section_info::input_section): Change return type.
6596 (Input_section_info::input_section_): Change type to
6597 Output_section::Input_section.
6598 (Output_section_element_input::set_section_addresses): Adjust code
6599 to use Output_section::Input_section instead of
6600 Output_section::Simple_input_section. Adjust code for renaming
6601 of Output_section::add_simple_input_section.
6602 (Orphan_output_section::set_section_addresses): Ditto.
6603
e1e82ea4
RW
66042010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6605
6606 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6607 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6608
91e75c8a
RÁE
66092010-05-18 Rafael Espindola <espindola@google.com>
6610
6611 * options.cc (General_options::finalize): Handle -nostdlib.
6612 * options.h (nostdlib): New option.
6613 * script.cc (script_add_search_dir): Handle -nostdlib.
6614
da59ad79
DK
66152010-05-12 Doug Kwan <dougkwan@google.com>
6616
6617 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6618 attributes section only if there no attributes section after merging.
6619 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6620 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6621 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6622 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6623 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6624 and arm_attr_merge_7.stdout.
6625 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6626 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6627 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6628 arm_attr_merge_7b.o): New rules.
6629 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6630 arm_attr_merge_7
6631 * testsuite/Makefile.in: Regenerate.
6632 * testsuite/arm_attr_merge.sh: New file.
6633 * testsuite/arm_attr_merge_[67][ab].s: Same.
6634
3e01a7fd
NC
66352010-05-05 Nick Clifton <nickc@redhat.com>
6636
6637 * po/es.po: Updated Spanish translation.
6638
7ad2014a
L
66392010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6640
6641 * Makefile.am (install-exec-local): Properly install gold as
6642 default cross linker.
6643 * Makefile.in: Regenerated.
6644
4fda8867
NC
66452010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6646 Nick Clifton <nickc@redhat.com>
6647
6648 * configure.ac (install_as_default): Define and set to false
6649 unless --enable-gold or --enable-gold=both/gold has been
6650 specified.
6651 * configure: Regenerate.
6652
6653 * Makefile.am (install-exec-local): Install the executable as
6654 'ld.gold'. If install_as_default is true then also install it as
6655 'ld'.
6656 * Makefile.in: Regenerated.
6657
bd288ea2
ILT
66582010-04-24 Ian Lance Taylor <iant@google.com>
6659
6660 * layout.cc (Layout::layout_reloc): In relocatable link don't
6661 combine reloc sections for grouped sections.
6662
ef38fd8a
ST
66632010-04-23 Sriraman Tallam <tmsriram@google.com>
6664
6665 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6666 sections that are not ordinary to icf.
6667 * icf.cc (get_section_contents): Handle relocation pointing to section
6668 with no object or shndx information.
6669 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6670 * testsuite/Makefile.in: Regenerate.
6671 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6672 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6673
f6973bdc
ILT
66742010-04-22 Ian Lance Taylor <iant@google.com>
6675
6676 * expression.cc (Expression::Expression_eval_info): Add
6677 result_alignment_pointer field.
6678 (Expression::eval_with_dot): Add result_alignment_pointer
6679 parameter. Change all callers.
6680 (Expression::eval_maybe_dot): Likewise.
6681 (class Binary_expression): Add alignment_pointer parameter to
6682 left_value and right_value. Change all callers.
6683 (BINARY_EXPRESSION): Set result alignment.
6684 (class Trinary_expression): Add alignment_pointer parameter to
6685 arg2_value and arg3_value. Change all callers.
6686 (Trinary_cond::value): Set result alignment.
6687 (Max_expression::value, Min_expression::value): Likewise.
6688 (Align_expression::value): Likewise.
6689 * script-sections.cc (class Sections_element): Add dot_alignment
6690 parameter to set_section_addresses virtual function. Update
6691 instantiations.
6692 (class Output_section_element): Likewise.
6693 (Script_sections::create_segments): Add dot_alignment parameter.
6694 Change all callers.
6695 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6696 (Script_sections::set_phdrs_clause_addresses): Likewise.
6697 * script-sections.h: Update declarations.
6698 * script.h: Update declarations.
6699 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6700 min_p_align.
6701 * testsuite/script_test_3.t: Set large alignment.
6702 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6703 segment has expected alignment.
6704
9c9c98a5
NC
67052010-04-22 Nick Clifton <nickc@redhat.com>
6706
6707 * po/gold.pot: Updated by the Translation project.
6708 * po/vi.po: Updated Vietnamese translation.
6709
2253bfba
L
67102010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6711
6712 * testsuite/Makefile.am (check_PROGRAMS): Add
6713 icf_virtual_function_folding_test.
6714 * testsuite/Makefile.in: Regenerated.
6715
85fdf906
AH
67162010-04-15 Andrew Haley <aph@redhat.com>
6717
6718 * options.h (merge_exidx_entries): New option.
6719 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6720 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6721 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6722 (Target_arm::merge_exidx_entries): New function.
6723 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6724 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6725 to Arm_exidx_fixup constructor.
6726 Add new arg, merge_exidx_entries.
6727 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6728 Arm_output_section::fix_exidx_coverage.
6729
ce97fa81
ST
67302010-04-18 Sriraman Tallam <tmsriram@google.com>
6731
6732 * icf.cc (get_section_contents): Check for preemptible functions.
6733 Ignore addend when appropriate.
6734 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6735 section folded.
6736 (add_from_relobj): Check for section folded.
6737 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6738 * symtab.h (should_add_dynsym_entry): Add new parameter.
6739 * target-reloc.h (scan_relocs): Check for section folded.
6740 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6741 Check reloc types for function pointers in shared objects.
6742 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6743 case.
6744 (icf_preemptible_functions_test): New test case.
6745 (icf_string_merge_test): New test case.
6746 * testsuite.Makefile.in: Regenerate.
6747 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6748 bar_glob. Refactor code.
6749 * testsuite/icf_preemptible_functions_test.cc: New file.
6750 * testsuite/icf_preemptible_functions_test.sh: New file.
6751 * testsuite/icf_string_merge_test.cc: New file.
6752 * testsuite/icf_string_merge_test.sh: New file.
6753 * testsuite/icf_virtual_function_folding_test.cc: New file.
6754 * testsuite/icf_virtual_function_folding_test.sh: New file.
6755
04ceb17c
DK
67562010-04-14 Doug Kwan <dougkwan@google.com>
6757
6758 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6759 for local symbol recounting if we remove a section due to ICF.
6760 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6761 there are no regular objects in input.
6762
153e7da4
DK
67632010-04-13 Doug Kwan <dougkwan@google.com>
6764
6765 * arm.cc (Arm_input_section::set_final_data_size): Compute
6766 accurate final data size instead of using current data size.
6767
4dbd9faf
DK
67682010-04-09 Doug Kwan <dougkwan@google.com>
6769
6770 * layout.cc (Layout::choose_output_section): Handle script section
6771 types.
6772 (Layout::make_output_section_for_script): Add section type parameter.
6773 Handle script section types.
6774 * layout.h (Layout::make_output_section_for_script): Add section
6775 type parameter.
6776 * output.cc (Output_section::Output_section): Initialize data member
6777 is_noload_.
6778 (Output_section::do_reset_address_and_file_offset): Do not set address
6779 to 0 if section is a NOLOAD section.
6780 * output.h (Output_section::is_noload): New method.
6781 (Output_section::set_is_noload): Ditto.
6782 (Output_section::is_noload_): New data member.
6783 * script-c.h (Script_section_type): New enum type.
6784 (struct Parser_output_section_header): Add new file section_type.
6785 * script-sections.cc (Sections_element::output_section_name): Add
6786 parameter for returning script section type.
6787 (Output_section_definition::output_section_name): Ditto.
6788 (Output_section_definition::section_type)P; New method.
6789 (Output_section_definiton::script_section_type_name): Ditto.
6790 (Output_section_definition::script_section_type_): New data member.
6791 (Output_section_definition::Output_section_definition): Initialize
6792 data member Output_section_definition::script_section_type_.
6793 (Output_section_definition::create_sections): Pass script section type
6794 to Layout::make_output_section_for_script.
6795 (Output_section_definition::output_section_name): Return script
6796 section type to caller.
6797 (Output_section_definition::set_section_address): Do not advance
6798 dot value and load address if section type is NOLOAD. Set address
6799 of NOLOAD sections regardless of section flags.
6800 (Output_section_definition::print): Print section type if it is
6801 not SCRIPT_SECTION_TYPE_NONE.
6802 (Output_section_definition::section_type): New method.
6803 (Output_section_definition::script_section_type_name): Ditto.
6804 (Script_sections::output_section_name): Add new parameter
6805 PSECTION_TYPE for returning script section type. Pass it to
6806 section elements. Handle discard sections.
6807 (Sort_output_sections::operator()): Handle NOLOAD sections.
6808 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6809 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6810 returning script section type.
6811 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6812 INFO and NOLOAD.
6813 * yyscript.y (union): Add new field SECTION_TYPE.
6814 (COPY, DSECT, INFO, NOLOAD): New tokens.
6815 (opt_address_and_section_type): Change type to output_section_header.
6816 (section_type): New non-terminal
6817 (section_header): Handle section type.
2253bfba 6818 (opt_address_and_section_type): Return section type value.
4dbd9faf 6819
721ea635
L
68202010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6821
6822 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6823 * testsuite/plugin_common_test_2.c (foo): Likewise.
6824
6bf924b0
DK
68252010-04-08 Doug Kwan <dougkwan@google.com>
6826
6827 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6828 Output_merge_data.
6829 * output.cc (Output_section::add_merge_input_section): Simplify
6830 code and return status of Output_merge_base::add_input_section.
e1df38aa 6831 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6832 returns true.
6833
24af6f92
DK
68342010-04-07 Doug Kwan <dougkwan@google.com>
6835
6836 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6837 if section is marked as containing instructions but has no mapping
6838 symbols.
6839 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6840 correct section index.
6841 (Arm_relobj::find_linked_text_section): Ditto.
6842
00698fc5
CC
68432010-04-07 Cary Coutant <ccoutant@google.com>
6844
6845 * archive.cc (include_member): Destroy Read_symbols_data object before
6846 releasing file.
6847 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6848 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6849 (Read_symbols_data::~Read_symbols_data) New destructor.
6850 (Section_relocs::Section_relocs) New constructor.
6851 (Section_relocs::~Section_relocs) New destructor.
6852 (Read_relocs_data::Read_relocs_data) New constructor.
6853 (Read_relocs_data::~Read_relocs_data) New destructor.
6854 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6855 pointers to NULL after deleting.
6856
7296d933
DK
68572010-04-07 Doug Kwan <dougkwan@google.com>
6858
6859 * arm.cc: Replace "endianity" with "endianness" in comments.
6860 (Arm_exidx_cantunwind): Ditto.
6861 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6862 (Arm_relobj::merge_flags_and_attributes): New method.
6863 (Arm_relobj::merge_flags_and_attributes_): New data member.
6864 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6865 (Arm_relobj::scan_sections_for_stubs): Ditto.
6866 (Arm_relobj::do_read_symbols): Check to see if we really want to
6867 merge processor-specific flags and attributes. Exit early if
6868 an object is empty except for section names and the undefined symbol.
6869 (Target_arm::do_finalize_sections): Move check for ELF format to
6870 Arm_relobj::do_read_symbols. Merge processor specific flags and
6871 attributes from a regular object only when we have determined that
6872 it is aapropriate. Do not create an .ARM.attributes section in
6873 output if there is no regular input object.
6874 (Target_arm::merge_processor_specific_flags): Check
6875 --warn-mismatch before printing any error.
6876 (Target_arm::merge_object_attributes): Ditto.
6877 * gold.cc (queue_middle_tasks): Handle the case in which there is
6878 no regular object in input.
6879 * options.cc (General_options::parse_EB): New method.
6880 (General_options::parse_EL): Same.
6881 (General_options::General_options): Initialize endianness_.
6882 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6883 New options.
6884 (General_options::Endianness): New enum.
6885 (General_options::endianness): New method.
6886 (General_options::endianness_): New data member.
6887 * parameters.cc (Parameters::set_options): Check target endianness.
6888 (Parameters::set_target_once): Ditto.
6889 (Parameters::check_target_endianness): New method.
6890 (parameters_force_valid_target): If either -EL or -EB is specified,
6891 use it to define endianness of default target.
6892 * parameters.h (Parameters::check_target_endianness): New method
6893 declaration.
6894 * target.h (class Target): Change "endianity" to "endianness"
6895 in comments.
6896
efc8d4f2
RW
68972010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6898
6899 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6900 * configure: Regenerate.
6901 * Makefile.in: Regenerate.
6902 * testsuite/Makefile.in: Regenerate.
6903
be234d88
CC
69042010-04-06 Cary Coutant <ccoutant@google.com>
6905
6906 gcc PR lto/42757
6907 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6908 prevailing definitions of common symbols.
6909 * testsuite/plugin_test_6.sh: New test case.
6910 * testsuite/plugin_common_test_1.c: New test case.
6911 * testsuite/plugin_common_test_2.c: New test case.
6912 * testsuite/Makefile.am (plugin_test_6): New test case.
6913 * testsuite/Makefile.in: Regenerate.
6914
bd32c6bd
NC
69152010-04-06 Nick Clifton <nickc@redhat.com>
6916
6917 * po/vi.po: New Vietnamese translation.
6918
323c532f
DK
69192010-03-30 Doug Kwan <dougkwan@google.com>
6920
6921 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6922
4fcd97eb
DK
69232010-03-25 Doug Kwan <dougkwan@google.com>
6924
6925 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6926 to avoid a conversion warning on a 32-bit host.
6927
4ebf39db
ILT
69282010-03-24 Ian Lance Taylor <iant@google.com>
6929
6930 * testsuite/script_test_3.t: Add a TLS segment.
6931 * testsuite/Makefile.am (check_PROGRAMS): Add
6932 tls_phdrs_script_test.
6933 (tls_phdrs_script_test_SOURCES): Define.
6934 (tls_phdrs_script_test_DEPENDENCIES): Define.
6935 (tls_phdrs_script_test_LDFLAGS): Define.
6936 (tls_phdrs_script_test_LDADD): Define.
6937 * testsuite/Makefile.in: Rebuild.
6938
4a599bdd
CC
69392010-03-23 Cary Coutant <ccoutant@google.com>
6940
6941 * fileread.cc (find_or_make_view): Fix comment.
6942
6c93b22c
ILT
69432010-03-23 Ian Lance Taylor <iant@google.com>
6944
6945 * script-sections.cc (class Orphan_section_placement): Define
6946 PLACE_TLS and PLACE_TLS_BSS.
6947 (Orphan_section_placement::Orphan_section_placement): Initialize
6948 new places.
6949 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6950 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6951 (tls_script_test_SOURCES): Define.
6952 (tls_script_test_DEPENDENCIES): Define.
6953 (tls_script_test_LDFLAGS): Define.
6954 (tls_script_test_LDADD): Define.
6955 * testsuite/Makefile.in: Rebuild.
6956
a2c7281b
DK
69572010-03-22 Doug Kwan <dougkwan@google.com>
6958
6959 * arm.cc (Arm_relocate_functions::abs8,
6960 Arm_relocate_functions::abs16): Use correct check for overflow
6961 specified in the ARM ELF specs.
6962 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6963 target of a BLX instruction specially.
6964 (Reloc_stub::stub_type_for_reloc): Ditto.
6965 (Relocate::relocate): Use symbolic names instead of numeric relocation
6966 codes to report error.
6967 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6968 workaround.
6969 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6970 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6971 thumb2_blx_out_of_range.stdout
6972 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6973 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6974 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6975 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6976 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6977 thumb2_blx_in_range, thumb2_blx_in_range.o,
6978 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6979 thumb2_blx_out_of_range.o): New rules.
2e702c99 6980 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6981 thumb2_blx_in_range and thumb2_blx_out_of_range.
6982 * testsuite/Makefile.in: Regenerate.
6983 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6984 * testsuite/thumb_blx_in_range.s: New file.
6985 * testsuite/thumb_blx_out_of_range.s: New file.
6986
b0193076
RÁE
69872010-03-22 Rafael Espindola <espindola@google.com>
6988
6989 * archive.cc (Should_include): Move to archive.h.
6990 (should_include_member): Make it a member of Archive.
6991 (Lib_group): New.
6992 (Add_lib_group_symbols): New.
6993 * archive.h: Include options.h.
6994 (Archive_member): Moved from Archive.
6995 (Should_include): Moved from archive.cc.
6996 (Lib_group): New.
6997 (Add_lib_group_symbols): New.
6998 * dynobj.cc (do_should_include_member): New.
6999 * dynobj.h (do_should_include_member): New.
7000 * gold.cc (queue_initial_tasks): Update call to queue.
7001 * main.cc (main): Print lib group stats.
7002 * object.cc (do_should_include_member): New.
7003 * object.h: Include archive.h.
7004 (Object::should_include_member): New.
7005 (Object::do_should_include_member): New.
7006 (Sized_relobj::do_should_include_member): New.
7007 * options.cc (General_options::parse_start_lib): New.
7008 (General_options::parse_end_lib): New.
7009 (Input_arguments::add_file): Handle lib groups.
7010 (Input_arguments::start_group): Check we are not in a lib.
7011 (Input_arguments::start_lib): New.
7012 (Input_arguments::end_lib): New.
7013 * options.h (General_options): Add start_lib and end_lib.
7014 (Input_argument::lib_): New.
7015 (Input_argument::lib): New.
7016 (Input_argument::is_lib): New.
7017 (Input_file_lib): New.
7018 (Input_arguments::in_lib_): New.
7019 (Input_arguments::in_lib): New.
7020 (Input_arguments::start_lib): New.
7021 (Input_arguments::end_lib_): New.
7022 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7023 in unused members as preempted.
7024 (Sized_pluginobj::do_should_include_member): New.
7025 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7026 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7027 return the blocker.
7028 (Read_symbols::do_whole_lib_group): New.
7029 (Read_symbols::do_lib_group): New.
7030 (Read_symbols::do_read_symbols): Handle lib groups.
7031 (Read_symbols::get_name): Handle lib groups.
7032 * readsyms.h (Read_symbols): Add an archive member pointer.
7033 (Read_symbols::do_whole_lib_group): New.
7034 (Read_symbols::do_lib_group): New.
7035 (Read_symbols::member_): New.
7036 * script.cc (read_input_script): Update call to queue_soon.
7037
d099120c
DK
70382010-03-19 Doug Kwan <dougkwan@google.com>
7039
7040 * arm.cc (Stub_table::Stub_table): Initialize new data members
7041 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7042 (Stub_table::add_reloc_stub): Assign stub offset and update
7043 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7044 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7045 New data members.
2e702c99 7046 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7047 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7048 instead of going over all reloc stubs.
2e702c99 7049 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7050 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7051 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7052 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7053 Stringpool_template::offset_.
7054 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7055 Stringpool_template::offset_ to zero.
7056
1aa37384
DK
70572010-03-15 Doug Kwan <dougkwan@google.com>
7058
7059 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7060 offset_.
7061 (Stringpool_template::new_key_offset): New method.
7062 (Stringpool_template::add_string): Assign offsets when adding new
7063 strings.
7064 (Stringpool_template::set_string_offsets): Do not set string offsets
7065 when not optimizing.
7066 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7067 member size_.
2e702c99
RM
7068 (Chunked_vector::clear): Clear size_.
7069 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7070 (Chunked_vector::size): Return size_.
7071 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7072 (Chunked_vector::size_): New data member.
1aa37384
DK
7073 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7074 (Stringpool_template::new_key_offset): New method declaration.
7075 (Stringpool_template::offset_): New data member.
7076
b672b057
RÁE
70772010-03-15 Rafael Espindola <espindola@google.com>
7078
7079 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7080 Add_symbols' constructor.
7081 * readsyms.h (Add_symbols): Remove the input_group member.
7082
b6848d3c
ILT
70832010-03-10 Ian Lance Taylor <iant@google.com>
7084
7085 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7086 target to ask whether a reference to a symbol requires a stack
7087 split.
7088 * target.h (Target::is_call_to_non_split): New function.
7089 (Target::do_is_call_to_non_split): Declare virtual function.
7090 * target.cc: Include "symtab.h".
7091 (Target::do_is_call_to_non_split): New function.
7092 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7093
a2a5469e
CC
70942010-03-10 Cary Coutant <ccoutant@google.com>
7095
7096 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7097 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7098 (File_read::open[2]): Add whole_file_view_ to list of views.
7099 (File_read::make_view): Remove test of whole_file_view_.
7100 (File_read::find_or_make_view): Create whole_file_view_ if
7101 necessary.
7102 (File_read::clear_views): Replace bool parameter with enum;
7103 adjust all callers. Don't delete views with permanent data;
7104 do delete cached views and views from archives if
7105 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7106 if clearing the corresponding view.
7107 * fileread.h (File_read::Clear_views_mode): New enum.
7108 (File_read::View::is_permanent_view): New method.
7109 (File_read::clear_views): Replace bool parameter
7110 with enum; adjust all callers.
7111 * options.h (General_options): Change keep_files_mapped option;
7112 add map_whole_files.
7113 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7114 releasing the file.
7115 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7116 the file.
7117
8861f32b
DM
71182010-03-10 David S. Miller <davem@davemloft.net>
7119
7120 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7121
d62d0f5f
ST
71222010-03-09 Sriraman Tallam <tmsriram@google.com>
7123
7124 * icf.cc (get_section_contents): Add '@' marker after processing the
7125 merge reloc.
7126
9177756d
DK
71272010-03-08 Doug Kwan <dougkwan@google.com>
7128
7129 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7130 due to a conversion warning.
7131 (Arm_relobj::update_output_local_symbol_count): Check for local
7132 symbol with unset output index.
7133
9e9e071b
ILT
71342010-03-05 Ian Lance Taylor <iant@google.com>
7135
7136 * options.h (class General_options): Add --spare-dynamic-tags.
7137 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7138 --spare-dynamic-tags.
7139
a81ee015
ILT
71402010-03-05 Ian Lance Taylor <iant@google.com>
7141
7142 * incremental.cc: Include "libiberty.h".
7143
44ec90b9
RO
71442010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7145
7146 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7147 function, is_info_ member.
7148 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7149 (Versions::Versions): Update caller.
7150 (Versions::define_base_version): Likewise.
7151 (Versions::add_def): Likewise.
7152
0897ed3b
ST
71532010-03-03 Sriraman Tallam <tmsriram@google.com>
7154
7155 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7156 (Scan::possible_function_pointer_reloc): New function.
7157 (Scan::local_reloc_may_be_function_pointer): Change to call
7158 possible_function_pointer_reloc.
7159 (Scan::global_reloc_may_be_function_pointer): Ditto.
7160 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7161 relocations in ".data.rel.ro._ZTV" section.
7162 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7163 * testsuite/icf_safe_so_test.cc: Ditto.
7164 * testsuite/icf_safe_test.cc: Ditto.
7165 * testsuite/icf_safe_test.sh: Ditto.
7166
d3bbad62
ILT
71672010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7168 Ian Lance Taylor <iant@google.com>
7169
7170 * target-reloc.h (relocate_section): Check the symbol table index
7171 for -1U before setting the local symbol index.
7172 (scan_relocatable_relocs): If copying the relocation, record that
7173 the local symbol is required.
7174 * object.h (Symbol_value::is_output_symtab_index_set): New
7175 function.
7176 (Symbol_value::may_be_discarded_from_output_symtab): New
7177 function.
7178 (Symbol_value::has_output_symtab_entry): New function.
7179 (Symbol_value::needs_output_symtab_entry): Remove.
7180 (Symbol_value::output_symtab_index): Make sure the symbol index is
7181 set.
7182 (Symbol_value::set_output_symtab_index): Make sure the symbol
7183 index is not set. Make sure the new index is valid.
7184 (Symbol_value::set_must_have_output_symtab_entry): New function.
7185 (Symbol_value::has_output_dynsym_entry): New function.
7186 (Symbol_value::set_output_dynsym_index): Make sure the new index
7187 is valid.
7188 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7189 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7190 local symbol if permitted.
7191 (Sized_relobj::do_finalize_local_symbols): Call
7192 is_output_symtab_index_set rather than needs_output_symtab_entry.
7193 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7194 rather than needs_output_symtab_entry. Call
7195 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7196 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7197 is_output_symtab_index_set rather than needs_output_symtab_entry.
7198 * testsuite/discard_locals_relocatable_test.c: New file.
7199 * testsuite/discard_locals_test.sh: Test -r.
7200 * testsuite/Makefile.am (check_DATA): Add
7201 discard_locals_relocatable_test1.syms,
7202 discard_local_relocatable_test2.syms.
7203 (MOSTLYCLEANFILES): Likewise. Also add
7204 discard_locals_relocatable_test1.lout and
7205 discard_locals_relocatable_test2.out.
7206 (discard_locals_relocatable_test1.syms): New target.
7207 (discard_locals_relocatable_test.o): New target.
7208 (discard_locals_relocatable_test1.out): New target.
7209 (discard_locals_relocatable_test2.syms): New target.
7210 (discard_locals_relocatable_test2.out): New target.
7211 (various): Add missing ../ld-new dependencies.
7212 * testsuite/Makefile.in: Rebuild.
7213
7e8ccf26
NC
72142010-03-03 Nick Clifton <nickc@redhat.com>
7215
7216 * po/fi.po: New Finnish translation.
7217
2a0ff005
DK
72182010-03-01 Doug Kwan <dougkwan@google.com>
7219
7220 * layout.cc (Layout::Layout): Force section types of .init_array*,
7221 .preinit_array* and .fini_array* sections.
7222 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7223 Fix check of return value of std::string::find.().
7224 (Output_section::Input_section_sort_compare::operator()): Remove
7225 comment about .init_array.
7226 (Output_section::Input_section_sort_init_fini_compare::operator()):
7227 New method.
7228 (Output_section::sort_attached_input_sections): Handle .init_array
7229 and .fini_array specially.
7230 * output.h (Output_section::Inut_section_sort_compare): Update
7231 comment.
7232 (Output_section::Input_section_sort_init_fini_compare): New struct.
7233
c3e4ae29
DK
72342010-02-26 Doug Kwan <dougkwan@google.com>
7235
7236 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7237 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7238 * testsuite/debug_msg.sh: Avoid matching source line number for
7239 use of global variable undef_int.
7240
2fd9ae7a
DK
72412010-02-26 Doug Kwan <dougkwan@google.com>
7242
7243 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7244 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7245 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7246 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7247 * options.cc (General_options::General_options): Initialize member
7248 fix_v4bx_.
7249 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7250 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7251 and rm_no_fix_v4bx.stdout
7252 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7253 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7254 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7255 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7256 and arm_no_fix_v4bx.
7257 * Makefile.in: Regenerate.
7258 * testsuite/arm_fix_v4bx.s: New file.
7259 * testsuite/arm_fix_v4bx.sh: Ditto.
7260
67ec7d0b
DK
72612010-02-24 Doug Kwan <dougkwan@google.com>
7262
7263 * arm.cc (Target_arm::got_section): Make the .got section the first
7264 non RELRO section in the data segment.
7265 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7266 suffixes of section names.
7267
10165461
DK
72682010-02-24 Doug Kwan <dougkwan@google.com>
7269
7270 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7271 flags and attributes merging if an input file is a binary file.
7272 * fileread.cc (Input_file::open): Record format of original file.
7273 * fileread.h (Input_file::Format): New enum type.
2e702c99 7274 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7275 (Input_file::format): New method definition.
7276 (Input_file::format_):: New data member.
7277
4a54abbb
DK
72782010-02-24 Doug Kwan <dougkwan@google.com>
7279
7280 * arm.cc (Arm_output_data_got): New class.
7281 (ARM_TCB_SIZE): New constant
7282 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7283 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7284 If user uses a script with a SECTIONS clause, issue only a warning
7285 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7286 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7287 garbage collection.
7288 (Target_arm::got_mode_index_entry): Handle static linking.
7289 (Target_arm::Scan::local): Ditto.
7290 (Target_arm::Scan::global): Ditto.
7291 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7292 all incorrectly implemented relocations.
e1df38aa 7293 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7294 Arm_output_section::fix_exidx_coverage.
7295 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7296 from ".ARM.exidx." and ".ARM.extab.".
7297
ca419a6f
ILT
72982010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7299
7300 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7301 section if it does not already exist.
7302 * attributes.cc (Attributes_section_data::Attributes_section_data):
7303 Don't crash if size is zero.
7304
135b9c78
ILT
73052010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7306 Ian Lance Taylor <iant@google.com>
7307
7308 * gold.cc (queue_middle_tasks): If no input files were opened,
7309 exit.
7310 * workqueue.h (Task_function::Task_function): Assert that there is
7311 a blocker.
7312
bb0bfe4f
DK
73132010-02-22 Doug Kwan <dougkwan@google.com>
7314
7315 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7316 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7317 types to avoid warnings due to different uint64_t implementations
7318 on different hosts.
7319
2a2b6d42
DK
73202010-02-21 Doug Kwan <dougkwan@google.com>
7321
7322 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7323 handling of the maximum backward branch offset.
2e702c99 7324 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7325 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7326 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7327 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7328 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7329 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7330 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7331 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7332 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7333 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7334 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7335 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7336 thumb2_bl_out_of_range.o): New rules.
7337 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7338 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7339 thumb2_bl_out_of_range
7340 * testsuite/Makefile.in: Regenerate.
7341 * testsuite/arm_bl_in_range.s: New file.
7342 * testsuite/arm_bl_out_of_range.s: Ditto.
7343 * testsuite/arm_branch_in_range.sh: Ditto.
7344 * testsuite/arm_branch_range.t: Ditto.
7345 * testsuite/thumb2_branch_range.t: Ditto.
7346 * testsuite/thumb_bl_in_range.s: Ditto.
7347 * testsuite/thumb_bl_out_of_range.s: Ditto.
7348 * testsuite/thumb_branch_range.t: Ditto.
7349
b487ad64
ST
73502010-02-20 Sriraman Tallam <tmsriram@google.com>
7351
7352 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7353 Add reloc offset information.
7354 * icf.cc (get_section_contents): Change iterators to point to the new
7355 vectors. Add reloc offset information to the contents.
7356 * icf.h (Icf::Sections_reachable_info): New typedef.
7357 (Icf::Sections_reachable_list): New typedef.
7358 (Icf::Offset_info): New typedef.
7359 (Icf::Reloc_info): New struct typedef.
7360 (Icf::Reloc_info_list): New typedef.
7361 (Icf::symbol_reloc_list): Delete method.
7362 (Icf::addend_reloc_list): Delete method.
7363 (Icf::section_reloc_list): Delete method.
7364 (Icf::reloc_info_list): New method.
7365 (Icf::reloc_info_list_): New member.
7366
f96accdf
DK
73672010-02-19 Doug Kwan <dougkwan@google.com>
7368
7369 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7370 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7371 * arm.cc (Arm_relocation_functions): New forward declaration.
7372 (Target_arm::Target_arm): Initialize new data members
7373 got_mod_index_offset_ and tls_base_symbol_defined_.
7374 (Target_arm::Relocate::relocate_tls): New method.
7375 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7376 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7377 New methods.
2e702c99 7378 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7379 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7380 (Target_arm::got_mod_index_offset_,
7381 Target_arm::tls_base_symbol_defined_): New data members.
7382 (Target_arm::Scan::local, Target::Scan::global,
7383 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7384 relocations.
7385
c8761b9a
DK
73862010-02-18 Doug Kwan <dougkwan@google.com>
7387
7388 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7389 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7390 text section as a parameter becuase some broken tools may not set
7391 the link in section header.
7392 (Target_arm::has_got_section): New method.
7393 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7394 without any mapping symbol as data only. Remove warning.
7395 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7396 link in its section header, try to discover the link by inspecting the
7397 REL31 relocation at the beginning of the section.
7398 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7399 in error message.
7400 (Target_arm::Scan::global): Treat any reference to the symbol
7401 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7402
21bb3914
ST
74032010-02-12 Sriraman Tallam <tmsriram@google.com>
7404
7405 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7406 (Scan::global_reloc_may_be_function_pointer): New function.
7407 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7408 (Scan::global_reloc_may_be_function_pointer): New function.
7409 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7410 (Scan::global_reloc_may_be_function_pointer): New function.
7411 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7412 (Scan::global_reloc_may_be_function_pointer): New function.
7413 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7414 (Scan::global_reloc_may_be_function_pointer): New function.
7415 (Scan::possible_function_pointer_reloc): New function.
7416 (Target_x86_64::can_check_for_function_pointers): New function.
7417 * gc.h (gc_process_relocs): Scan relocation types to determine if
7418 function pointers were taken for targets that support it.
7419 * icf.cc (Icf::find_identical_sections): Include functions for
7420 folding in safe ICF whose pointer is not taken.
7421 * icf.h (Secn_fptr_taken_set): New typedef.
7422 (fptr_section_id_): New member.
7423 (section_has_function_pointers): New function.
7424 (set_section_has_function_pointers): New function.
7425 (check_section_for_function_pointers): New function.
7426 * options.h: Fix comment for safe ICF option.
7427 * target.h (can_check_for_function_pointers): New function.
7428 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7429 Modify icf_safe_test for X86-64.
7430 * testsuite/Makefile.in: Regenerate.
7431 * testsuite/icf_safe_so_test.cc: New file.
7432 * testsuite/icf_safe_so_test.sh: New file.
7433 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7434 (main): Change to take pointer to function kept_func_3.
7435 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7436 folding is done correctly for X86-64.
7437
0da6fa6c
DM
74382010-02-12 David S. Miller <davem@davemloft.net>
7439
7440 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7441 is_symbolless parameter.
7442 (Output_reloc<SHT_REL>::is_symbolless): New.
7443 (Output_reloc<SHT_REL>::is_symbolless_): New.
7444 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7445 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7446 (Output_reloc<SHT_RELA>::is_symbolless): New.
7447 (Output_data_reloc::add_global): Handle is_symbolless.
7448 (Output_data_reloc::add_global_relative): Likewise.
7449 (Output_data_reloc::add_local): Likewise.
7450 (Output_data_reloc::add_local_relative): Likewise.
7451 (Output_data_reloc::add_symbolless_global_addend): New.
7452 (Output_data_reloc::add_symbolless_local_addend): New.
7453 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7454 is_symbolless.
7455 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7456 instead of ->is_relative_
7457 (Output_reloc::write): Likewise.
7458 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7459 (Output_reloc::write_rel): Simplify.
7460
7461 * sparc.cc (Target_sparc::Scan::local): Use
7462 ->add_symbolless_local_addend as needed.
7463 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7464 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7465 based upon relocation offset.
7466
e4782e83
DK
74672010-02-11 Doug Kwan <dougkwan@google.com>
7468
7469 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7470 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7471 beginning of function.
7472 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7473 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7474 parameter is_32bit in calls to should_apply_static_reloc.
7475 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7476 (check_DATA): Add arm_abs_global.stdout.
7477 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7478 arm_abs_global.stdout): New rules.
7479 (MOSTLLYCLEANFILES): Add arm_abs_global
7480 * Makefile.in: Regenerate.
7481 * testsuite/arm_abs_global.s: New file.
7482 * testsuite/arm_abs_global.sh: Ditto.
7483 * testsuite/arm_abs_lib.s: Ditto.
7484
93ceb764
ILT
74852010-02-11 Ian Lance Taylor <iant@google.com>
7486
7487 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7488 Read_relocs task.
7489 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7490 Allocate_commons_task first.
7491 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7492 task, rather than symtab_lock_.
7493 (Gc_process_relocs::~Gc_process_relocs): New function.
7494 (Gc_process_relocs::is_runnable): Check this_blocker_.
7495 (Gc_process_relocs::locks): Use next_blocker_ rather than
7496 blocker_.
7497 (Scan_relocs::~Scan_relocs): New function.
7498 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7499 symtab_lock_.
7500 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7501 next_blocker_.
7502 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7503 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7504 constructor accordingly.
7505 (class Gc_process_relocs): Likewise.
7506 (class Scan_relocs): Likewise.
7507 * common.h (class Allocate_commons_task): Remove symtab_lock_
7508 field, and corresponding constructor parameter.
7509 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7510 symtab_lock_.
7511 (Allocate_commons_task::locks): Likewise.
7512
114dfbe1
ILT
75132010-02-11 Ian Lance Taylor <iant@google.com>
7514
7515 * gold-threads.h (class Once): Define.
7516 (class Initialize_lock): Rewrite as child of Once.
7517 * gold-threads.cc (class Once_initialize): Define.
7518 (once_pointer_control): New static variable.
7519 (once_pointer, once_arg): New static variables.
7520 (c_run_once): New static function.
7521 (Once::Once, Once::run_once, Once::internal_run): New functions.
7522 (class Initialize_lock_once): Remove.
7523 (initialize_lock_control): Remove.
7524 (initialize_lock_pointer): Remove.
7525 (initialize_lock_once): Remove.
7526 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7527 (Initialize_lock::initialize): Rewrite.
7528 (Initialize_lock::do_run_once): New function.
7529 * archive.cc (Archive::interpret_header): Only clear name if it is
7530 not already empty.
7531 * fileread.cc: Include "gold-threads.h"
7532 (file_counts_lock): New static variable.
7533 (file_counts_initialize_lock): Likewise.
7534 (File_read::release): Only increment counts when using --stats.
7535 Use a lock around the increment.
7536 * parameters.cc (class Set_parameters_target_once): Define.
7537 (set_parameters_target_once): New static variable.
7538 (Parameters::Parameters): Move here from parameters.h.
7539 (Parameters::set_target): Rewrite.
7540 (Parameters::set_target_once): New function.
7541 (Parameters::clear_target): Move here and rewrite.
7542 * parameters.h (class Parameters): Update declarations. Add
7543 set_parameters_target_once_ field.
7544 (Parameters::Parameters): Move to parameters.cc.
7545 (Parameters::clear_target): Likewise.
7546 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7547 task.
7548 (Start_group::~Start_group): New function.
7549 (Start_group::is_runnable): New function.
7550 (Start_group::locks, Start_group::run): New functions.
7551 (Finish_group::run): Change saw_undefined to size_t.
7552 * readsyms.h (class Start_group): Define.
7553 (class Finish_group): Change saw_undefined_ field to size_t.
7554 (Finish_group::Finish_group): Remove saw_undefined and
7555 this_blocker parameters. Change all callers.
7556 (Finish_group::set_saw_undefined): New function.
7557 (Finish_group::set_blocker): New function.
7558 * symtab.h (class Symbol_table): Change saw_undefined to return
7559 size_t. Change saw_undefined_ field to size_t.
7560 * target-select.cc (Set_target_once::do_run_once): New function.
7561 (Target_selector::Target_selector): Initialize set_target_once_
7562 field. Don't initialize lock_ and initialize_lock_ fields.
7563 (Target_selector::instantiate_target): Rewrite.
7564 (Target_selector::set_target): New function.
7565 * target-select.h (class Set_target_once): Define.
7566 (class Target_selector): Update declarations. Make
7567 Set_target_once a friend. Remove lock_ and initialize_lock_
7568 fields. Add set_target_once_ field.
7569
fa17a3f4
ILT
75702010-02-10 Ian Lance Taylor <iant@google.com>
7571
7572 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7573 queueing any tasks.
7574 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7575 (queue_middle_tasks): Add all blockers before queueing any tasks.
7576 (queue_final_tasks): Likewise.
7577 * token.h (Task_token::add_blockers): New function.
7578 * object.h (Input_objects::number_of_relobjs): New function.
7579
c7177d31
ILT
75802010-02-10 Ian Lance Taylor <iant@google.com>
7581
5de0e392
ILT
7582 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7583 shared, not if not position independent.
7584 * x86_64.cc (Relocate::relocate_tls): Likewise.
7585 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7586 (tls_pie_pic_test): New target.
7587 * testsuite/Makefile.in: Rebuild.
7588
c7177d31
ILT
7589 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7590 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7591 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7592 * testsuite/Makefile.in: Rebuild.
7593
684b268a
DM
75942010-02-09 David S. Miller <davem@davemloft.net>
7595
7596 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7597 R_SPARC_RELATIVE using ->add_local_relative().
7598 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7599
612a8d3d
DM
7600 * output.h (Output_data_dynamic::add_section_size): New method
7601 that takes two Output_data objects.
7602 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7603 entry param. Handle it in initializers.
7604 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7605 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7606 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7607 arg.
7608 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7609 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7610 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7611 for dynrel_includes_plt.
7612 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7613 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7614 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7615 before .rela.plt
7616 (Target_sparc::do_finalize_sections): Update to pass true for
7617 dynrel_includes_plt.
7618 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7619 output before .rela.plt
7620 (Target_powerpc::do_finalize_sections): Update to pass true for
7621 dynrel_includes_plt when 32-bit.
7622
cb1be87e
DK
76232010-02-08 Doug Kwan <dougkwan@google.com>
7624
7625 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7626 method.
7627 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7628 Arm_relobj::scan_section_for_cortex_a8_stubs,
7629 Arm_relobj::do_relocation_section): Instead of calling
7630 Output_section::output_address, use faster
7631 Arm_relobj::simple_input_section_output_address.
7632
705b5121
DM
76332010-02-08 David S. Miller <davem@davemloft.net>
7634
7635 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7636 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7637 relocation helper function.
7638
024c4466
DM
7639 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7640 just like R_SPARC_GOT{10,13,22}.
7641 (Target_sparc::Scan::local): Likewise.
7642 (Target_sparc::Relocate:relocate): Likewise.
7643
9109c078
ILT
76442010-02-06 Ian Lance Taylor <iant@google.com>
7645
7646 * configure.ac: Rewrite targetobjs duplicate removal code to use
7647 only shell constructs.
7648 * configure: Rebuild.
7649
cf846138
DK
76502010-02-05 Doug Kwan <dougkwan@google.com>
7651
7652 PR 11247
7653 * arm.cc (Arm_relobj::section_is_scannable): New method.
7654 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7655 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7656
6cfaf60b
DK
76572010-02-04 Doug Kwan <dougkwan@google.com>
7658
7659 PR 11247
7660 * arm-reloc-property.cc (cstdio): Include.
7661 * configure.ac (targetobjs): Remove duplicates.
7662 * configure: Regenerate.
7663 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7664 big and little endian version for a given address size.
7665
5c57f1be
DK
76662010-02-03 Doug Kwan <dougkwan@google.com>
7667
7668 * arm-reloc-property.cc
7669 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7670 definition.
7671 * arm-reloc-property.h
7672 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7673 New method definition.
7674 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7675 declaration.
7676 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7677 overflow to N.
7678 (GOT_PREL): Change implemented to Y.
7679 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7680 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7681 (Arm_relocate_functions::movw_abs_nc): Remove method.
7682 (Arm_relocate_functions::movt_abs): Ditto.
7683 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7684 (Arm_relocate_functions::thm_movt_abs): Ditto.
7685 (Arm_relocate_functions::movw_rel_nc): Ditto.
7686 (Arm_relocate_functions::movw_rel): Ditto.
7687 (Arm_relocate_functions::movt_rel): Ditto.
7688 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7689 (Arm_relocate_functions:thm_movw_rel): Ditto.
7690 (Arm_relocate_functions:thm_movt_rel): Ditto.
7691 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7692 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7693 New method definitions.
7694 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7695 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7696 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7697 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7698 (Target_arm::Relocate::relocate): Check for non-static or
7699 unimplemented relocation code and exit early. Change calls to
7700 Target_arm::reloc_uses_thumb_bit and
7701 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7702 instead. Refactor code to handle similar relocations to increase
7703 code sharing. Remove check for unsupported relocation code in switch
7704 statement.
7705 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7706 relocation property table to find out size. Change error message to
7707 print out the name of a relocation code instead of the numeric value.
7708 (Target_arm::scan_reloc_for_stub): Use relocation property table
7709 instead of calling Target_arm::reloc_uses_thumb_bit().
7710
218c5831
DK
77112010-02-02 Doug Kwan <dougkwan@google.com>
7712
7713 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7714 types of relaxed input section.
7715
0d31c79d
DK
77162010-02-02 Doug Kwan <dougkwan@google.com>
7717
7718 * Makefile.am (HFILES): Add arm-reloc-property.h.
7719 (DEFFILES): New.
2e702c99
RM
7720 (TARGETSOURCES): Add arm-reloc-property.cc
7721 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7722 (libgold_a_SOURCES): $(DEFFILES)
7723 * Makefile.in: Regenerate.
7724 * arm-reloc-property.cc: New file.
7725 * arm-reloc-property.h: New file.
7726 * arm-reloc.def: New file.
7727 * arm.cc: Update comments.
7728 (arm-reloc-property.h): New included header.
7729 (arm_reloc_property_table): New global variable.
7730 (Target_arm::do_select_as_default_target): New method definition.
7731 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7732 arm-reloc-property to targ_extra_obj.
7733 * parameters.cc (set_parameters_target): Call
7734 Target::select_as_default_target().
7735 * target.h (Target::select_as_default_target): New method definition.
7736 (Target::do_select_as_default_target): Same.
7737
546c7457
DK
77382010-02-01 Doug Kwan <dougkwan@google.com>
7739
7740 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7741 first_output_text_section_.
7742 (Arm_exidx_fixup::first_output_text_section): New method definition.
7743 (Arm_exidx_fixup::first_output_text_section_): New data member.
7744 (Arm_exidx_fixup::process_exidx_section): Record the first text
7745 output section seen.
7746 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7747 and entsize in output section header.
7748
11b861d5
DK
77492010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7750
7751 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7752 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7753 (Arm_relocate_functions::thm_alu11): New Method.
7754 (Arm_relocate_functions::thm_pc8): New Method.
7755 (Arm_relocate_functions::thm_pc12): New Method.
7756 (Target_arm::Scan::local): Handle the relocations.
7757 (Target_arm::Scan::global): Likewise.
7758 (Target_arm::Relocate::relocate): Likewise.
7759 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7760
c9a2c125
DK
77612010-01-29 Doug Kwan <dougkwan@google.com>
7762
7763 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7764 of relocation types as ld.
7765
1521477a
DK
77662010-01-29 Doug Kwan <dougkwan@google.com>
7767
7768 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7769 to public.
7770 (Arm_relocate_functions::thumb_branch_common): Ditto.
7771 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7772 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7773 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7774 Arm_relocate_functions::jump24): Remove.
7775 (Target_arm::Relocate::relocate): Adjust code to call
7776 Arm_relocation_functions::arm_branch_common and
7777 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7778 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7779
e7eca48c
DK
77802010-01-29 Doug Kwan <dougkwan@google.com>
7781
7782 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7783 output_local_symbol_count_needs_update_.
7784 (Arm_relobj::output_local_symbol_count_needs_update,
7785 Arm_relobj::set_output_local_symbol_count_needs_update,
7786 Arm_relobj::update_output_local_symbol_count): New methods.
7787 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7788 member.
7789 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7790 of pointed function as in a R_ARM_PREL31 relocation.
7791 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7792 for output local symbol count updating.
7793 (Target_arm::do_relax): Update output local symbol counts in objects
7794 if necessary.
7795 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7796
02961d7e
ILT
77972010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7798
7799 * arm.cc: Added support for the ARM relocations:
7800 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7801 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7802 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7803 movw_prel_nc).
7804 (Arm_relocate_functions::movw_rel): New method.
7805 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7806 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7807 thm_movw_prel_nc).
7808 (Arm_relocate_functions::thm_movw_rel): New method.
7809 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7810 thm_movt_prel).
7811 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7812 relocations.
7813 (Target_arm::Scan::global): Likewise.
7814 (Target_arm::Relocate::relocate): Likewise.
7815 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7816 Likewise.
7817
b10d2873
ILT
78182010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7819
7820 * arm.cc: Added support for ARM group relocations.
7821 (Target_arm::reloc_needs_sym_origin): New method.
7822 (Arm_relocate_functions::calc_grp_kn): New method.
7823 (Arm_relocate_functions::calc_grp_residual): New method.
7824 (Arm_relocate_functions::calc_grp_gn): New method.
7825 (Arm_relocate_functions::arm_grp_alu): New Method.
7826 (Arm_relocate_functions::arm_grp_ldr): New Method.
7827 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7828 (Arm_relocate_functions::arm_grp_ldc): New Method.
7829 (Target_arm::Scan::local): Handle the ARM group relocations.
7830 (Target_arm::Scan::global): Likewise.
7831 (Target_arm::Relocate::relocate): Likewise.
7832 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7833 Likewise.
7834
2b328d4e
DK
78352010-01-26 Doug Kwan <dougkwan@google.com>
7836
7837 * arm.cc (set): Include.
7838 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7839 pointer type.
2e702c99 7840 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7841 (Arm_output_section::append_text_sections_to_list): New method.
7842 (Arm_output_section::fix_exidx_coverage): Ditto.
7843 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7844 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7845 Relobj::set_section_offset() instead of
7846 Sized_relobj::invalidate_section_offset().
2e702c99 7847 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7848 parameter for section headers. Ignore relocation sections for
7849 unallocated sections and EXIDX sections.
7850 (Target_arm::fix_exidx_coverage): New method.
7851 (Target_arm::output_section_address_less_than): New type.
7852 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7853 linked text section instead of the EXIDX section.
7854 (Arm_output_section::create_stub_group): Add an assertion to check
7855 that this is not an EXIDX output section.
7856 (Arm_output_section::append_text_sections_to_list): New method.
7857 (Arm_output_section::fix_exidx_coverage): Ditto.
7858 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7859 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7860 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7861 first pass.
7862 (Target_arm::fix_exidx_coverage): New method.
7863 * object.h (Relobj::set_output_section): New method.
7864 (Sized_relobj::invalidate_section_offset): Remove method.
7865 (Sized_relobj::do_invalidate_section_offset): Remove method.
7866 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7867
c7f3c371
DK
78682010-01-25 Doug Kwan <dougkwan@google.com>
7869
7870 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7871 Fix warning due to signed and unsigned comparison on a 32-bit host.
7872
8923b24c
DK
78732010-01-22 Doug Kwan <dougkwan@google.com>
7874
7875 * arm.cc (Target_arm::do_relax): Record an output section for section
7876 offset adjustment it contains any stub table that has changed.
7877 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7878 offsets in an output section if necessary.
7879 * output.cc (Output_section::Output_section): Initialize
7880 section_offsets_need_adjustments_.
7881 (Output_section::add_input_section_for_script): Renamed to
7882 Output_section::add_simple_input_section.
7883 (Output_section::save_states): Add a comment.
7884 (Output_section::discard_states): New method defintion.
7885 (Output_section::adjust_section_offsets): Same.
7886 * output.h (Output_section::add_input_section_for_script): Renamed to
7887 Output_section::add_simple_input_section.
7888 (Output_section::discard_states): New method declaration.
7889 (Output_section::adjust_section_offsets): Same.
7890 (Output_section::section_offsets_need_adjustment,
7891 Output_section::set_section_offsets_need_adjustment): New method
7892 definitions.
7893 (Output_section::section_offsets_need_adjustment_): New data member.
7894 * script-sections.cc
7895 (Output_section_element_input::set_section_address): Adjust code for
7896 renaming of Output_section::add_input_section_for_script.
7897 (Orphan_output_section::set_section_address): Same.
7898
9b2fd367
DK
78992010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7900
7901 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7902 Fix_v4bx enum values .
7903 * gold/options.h (General_options): New option definitions.
7904 (General_options::fix_v4bx): New method.
7905 (General_options::Fix_v4bx): New enum.
7906 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7907 (General_options::parse_fix_v4bx_interworking): New method.
7908
80d0d023
DK
79092010-01-22 Doug Kwan <dougkwan@google.com>
7910
7911 * arm.cc (Arm_exidx_fixup): New class.
7912
af2cdeae
DK
79132010-01-21 Doug Kwan <dougkwan@google.com>
7914
7915 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7916 classes.
7917 (Arm_exidx_section_offset_map): New type.
7918
993d07c1
DK
79192010-01-21 Doug Kwan <dougkwan@google.com>
7920
7921 * arm.cc (Arm_exidx_input_section): New class.
7922 (Arm_relobj::exidx_input_section_by_link,
7923 Arm_relobj::exidx_input_section_by_shndx,
7924 Arm_relobj::make_exidx_input_section): New methods.
7925 (read_arm_attributes_section): Remove.
7926 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7927 information about them.
7928 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7929 to here.
7930
5ac169d4
DK
79312010-01-20 Doug Kwan <dougkwan@google.com>
7932
7933 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7934 Input_section_specifier to Section_id.
7935 (Target_arm::new_arm_input_section: Adjust code for change of key
7936 type.
7937 (Target_arm::find_arm_input_section): Ditto.
7938 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7939 (Section_id): Remove.
7940 (Garbage_collection::Section_id_hash): Remove.
7941 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7942 (Section_id): Remove.
7943 (Icf::Section_id_hash): Remove.
7944 * object.h (Section_id, Const_section_id, Section_id_hash,
7945 Const_section_id_hash): New type definitions.
7946 * output.cc (Output_section::add_relaxed_input_section): Change to
7947 use Const_section_id instead of Input_section_specifier as key type.
7948 (Output_section::add_merge_input_section): Ditto.
7949 (Output_section::build_relaxation_map): Change to use Section_id
7950 instead of Input_section_specifier as key type.
2e702c99 7951 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7952 Ditto.
7953 (Output_section::convert_input_sections_to_relaxed_sections): Change
7954 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7955 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7956 (Output_section::find_relaxed_input_section): Ditto.
7957 * output.h (Input_section_specifier): Remove class.
7958 (Output_section::Output_section_data_by_input_section_map): Change
7959 key type to Const_section_id.
7960 (Output_section::Output_relaxed_input_section_by_input_section_map):
7961 Ditto.
7962 (Output_section::Relaxation_map): Change key type to Section_id.
7963
a2162063
ILT
79642010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7965
7966 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7967 (class Arm_v4bx_stub): New class.
7968 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7969 (Stub_factory::make_arm_v4bx_stub): New method.
7970 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7971 (Stub_table::empty): Handle v4bx stubs.
7972 (Stub_table::add_arm_v4bx_stub): New method.
7973 (Stub_table::find_arm_v4bx_stub): New method.
7974 (Arm_relocate_functions::v4bx): New method.
7975 (Target_arm::fix_v4bx): New method.
7976 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7977 (Stub_table::relocate_stubs): Likewise.
7978 (Stub_table::do_write): Likewise.
7979 (Stub_table::update_data_size_and_addralign): Likewise.
7980 (Stub_table::finalize_stubs): Likewise.
7981 (Target_arm::Scan::local): Likewise.
7982 (Target_arm::Scan::global): Likewise.
7983 (Target_arm::do_finalize_sections): Likewise.
7984 (Target_arm::Relocate::relocate): Likewise.
7985 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7986 Likewise.
7987 (Target_arm::scan_reloc_for_stub): Likewise.
7988 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7989
5696ab0b
ILT
79902010-01-19 Ian Lance Taylor <iant@google.com>
7991
7992 * output.cc (Output_section_headers::do_sized_write): Write large
7993 segment count to sh_info field.
7994 (Output_file_header::do_sized_write): For large segment count,
7995 write PN_XNUM to e_phnum field.
7996
800d0f56
ILT
79972010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7998
7999 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8000 (Arm_relocate_functions::thm_jump8): New function.
8001 (Arm_relocate_functions::thm_jump11): New function.
8002 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8003 R_ARM_THM_JUMP11.
8004 (Target_arm::Scan::global): Likewise.
8005 (Target_arm::Relocate::relocate): Likewise.
8006 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8007 Likewise.
8008
41263c05
DK
80092010-01-14 Doug Kwan <dougkwan@google.com>
8010
8011 * arm.cc (map, utility): Include headers.
8012 (Target_arm::apply_cortex_a8_workaround): New method.
8013 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8014 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8015 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8016 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8017 the --[no-]fix-cortex-a8 command line options.
8018 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8019 (Target_arm::relocate_stub): Use addend in instruction template.
8020 * options.h (DEFINE_bool): Set the user-set flag.
8021 (General_options): Add --[no-]-fix-cortex options.
8022 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8023 : Update fast look-up map after conversion.
41263c05 8024
459e9b03
ST
80252010-01-14 Sriraman Tallam <tmsriram@google.com>
8026
8027 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8028 in the first pass of do_layout.
8029
b521dfe4
DK
80302010-01-13 Doug Kwan <dougkwan@google.com>
8031
8032 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8033 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8034 apparent compiler problem of not folding static constant integral
8035 data members of elfcpp::Elf_sizes<32>.
8036
44272192
DK
80372010-01-13 Doug Kwan <dougkwan@google.com>
8038
8039 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8040 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8041 Arm_relobj::scan_section_for_cortex_a8_erratum,
8042 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8043 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8044 sections to scan for relocation stubs into a new method
8045 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8046 relocation and Cortex-A8 stub scanning.
8047 (Target_arm::do_relax): Force stubs to be after stubbed sections
8048 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8049 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8050 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8051
44b71ece
ILT
80522010-01-12 Ian Lance Taylor <iant@google.com>
8053
8054 * target-reloc.h (visibility_error): New inline function.
8055 (relocate_section): Call visibility_error.
8056 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8057 (MOSTLYCLEANFILES): Likewise.
8058 (protected_4_pic.o, protected_3.err): New targets.
8059 * testsuite/protected_4.cc: New file.
8060
a120bc7f
DK
80612010-01-12 Doug Kwan <dougkwan@google.com>
8062
8063 * arm.cc (Cortex_a8_reloc): New class.
8064 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8065 and cortex_a8_relocs_info_.
8066 (Target_arm::fix_cortex_a8): New method definition.
8067 (Target_arm::Cortex_a8_relocs_info): New type.
8068 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8069 New data member declarations.
8070 (Target_arm::scan_reloc_for_stub): Record information about
8071 relocations for THUMB branches that might be exempted from the
8072 Cortex-A8 workaround.
8073 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8074 at the beginning of a relaxation pass.
8075
20138696
DK
80762010-01-12 Doug Kwan <dougkwan@google.com>
8077
8078 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8079 (Arm_relobj::Mapping_symbol_position,
8080 Arm_reloj::Mapping_symbol_position_less,
8081 Arm_relobj::Mapping_symbols_info): New types.
8082 (Target_arm::is_mapping_symbol_name): New method definition.
8083 (Arm_relobj::do_count_local_symbols): Save information about mapping
8084 symbols.
8085
089d69dc
DK
80862010-01-11 Doug Kwan <dougkwan@google.com>
8087
8088 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8089 Arm_relocate_functions::thumb32_branch_upper,
8090 Arm_relocate_functions::thumb32_branch_lower,
8091 Arm_relocate_functions::thumb32_cond_branch_offset,
8092 Arm_relocate_functions::thumb32_cond_branch_upper,
8093 Arm_relocate_functions::thumb32_cond_branch_lower,
8094 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8095 branch offset encoding.
8096 (Arm_relocate_functions::thumb_branch_common): Use new branch
8097 offset encoding methods to avoid code duplication.
8098 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8099 (Stub_addend_reader::operator()): Use new branch encoding method
8100 to avoid code duplication.
8101
99e5bff2
DK
81022010-01-11 Doug Kwan <dougkwan@google.com>
8103
8104 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8105 (Target_arm::do_finalize_sections): Define special EXIDX section
8106 symbols only if referenced.
8107 * gc.h (Garbage_collection::add_reference): New method.
8108 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8109 code duplication.
8110
98e090bd
ILT
81112010-01-11 Ian Lance Taylor <iant@google.com>
8112
d0a91bd8
ILT
8113 * script.cc (Version_script_info::build_expression_list_lookup):
8114 Change complaing about duplicate wildcard match from error to
8115 warning.
8116
98e090bd
ILT
8117 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8118 of 2009-12-30.
8119 (Version_script_info::Version_script_info): Initialize globs_,
8120 default_version_, default_is_global_, and exact_. Don't
8121 initialize globals_ or locals_.
8122 (Version_script_info::build_lookup_tables): Build local symbols
8123 first.
8124 (Version_script_info::unquote): New function.
8125 (Version_script_info::add_exact_match): New function.
8126 (Version_script_info::build_expression_list_lookup): Remove lookup
8127 parameter. Add is_global parameter. Change all callers. Handle
8128 wildcard pattern specially. Unquote pattern. Call
8129 add_exact_match.
8130 (Version_script_info::get_name_to_match): New function.
8131 (Version_script_info::get_symbol_version): New function.
8132 (Version_script_info::get_symbol_version_helper): Remove.
8133 (Version_script_info::check_unmatched_names): Call unquote.
8134 * script.h (class Version_script_info): Change get_symbol_version
8135 to be non-inline and add is_global parameter; change all callers.
8136 Rewrite symbol_is_local. Update declarations. Define struct
8137 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8138 Remove globals_ and locals_ members. Add exact_, globs_,
8139 default_version_, is_global_.
8140 (Version_script_info::Glob): Remove pattern, add expression and
8141 is_global. Update constructor. Change all callers.
8142 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8143 default version.
8144 (Versions::symbol_section_contents): If a symbol is undefined, or
8145 defined in a dynamic object, set the version index to
8146 VER_NDX_LOCAL.
8147 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8148 symbol_is_local.
8149 (Symbol_table::add_from_pluginobj): Likewise.
8150 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8151
d56962d3
DK
81522010-01-11 Doug Kwan <dougkwan@google.com>
8153
8154 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8155 (incremental_dump_LDADD): Add linking option for libintl.
8156 * Makefile.in: Regenerate.
8157
94e6ee91
L
81582010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8159
8160 PR gold/11144
8161 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8162 instead of -Ds.
8163 * testsuite/Makefile.in: Regenerated.
8164
e96c574b
DK
81652010-01-10 Doug Kwan <dougkwan@google.com>
8166
8167 * options.h (DEFINE_var): Use parentheses around argument varname__
8168 in macro body to avoid any unintended subsequent substitutions.
8169
7198066b
ILT
81702010-01-10 Ian Lance Taylor <iant@google.com>
8171
ba4d53bf
ILT
8172 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8173 candidates before doing symbol resolution.
8174
7198066b
ILT
8175 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8176 ODR candidates if only one is weak.
8177
a2beed37
ILT
81782010-01-08 Ian Lance Taylor <iant@google.com>
8179
8180 * script.cc (Version_script_info::build_expression_list_lookup):
8181 Don't warn about ambiguous version, just record the ambiguity.
8182 (Version_script_info::get_symbol_version_helper): Give error if
8183 version is ambiguous.
8184
2fb7225c
DK
81852010-01-08 Doug Kwan <dougkwan@google.com>
8186
8187 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
8188 prev_data_size_ and prev_addralign_. Remove initializer for
8189 deleted data member has_been_changed_.
8190 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8191 to determine if the table is empty.
8192 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8193 Remove.
8194 (Stub_table::add_reloc_stub): Define method in class definition
8195 instead of just declaring it there.
8196 (Stub_table::add_cortex_a8_stub): New method definition.
8197 (Stub_table::update_data_size_and_addralign): Ditto.
8198 (Stub_table::finalize_stubs): Ditto.
8199 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8200 (Stub_table::do_addralign_): Return address alignment in the
8201 (Stub_table::do_reset_address_and_file_offset): Define method in
8202 class definition instead of declaring it there. Set current data
8203 size to be the data size of the previous pass.
8204 (Stub_table::set_final_data_size): Use current data size as the
8205 final data size.
8206 (Stub_table::relocate_stub): Change parameter type of stub from
8207 Reloc_stub pointer to Stub pointer.
8208 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8209 (Stub_table::Cortex_a8_stub_list): New typedef.
8210 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8211 Stub_table::prev_addralign_): New data member.
8212 (Arm_relobj::Arm_relobj): Initialize data member
8213 section_has_cortex_a8_workaround_.
8214 (Arm_relobj::section_has_cortex_a8_workaround,
8215 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8216 definitions.
8217 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8218 declarations.
8219 (Target_arm::relocate_stub): Change parameter type of stub from
8220 Reloc_stub pointer to Stub pointer.
8221 (Insn_template::size, Insn_template::alignment): Handle
8222 THUMB16_SPECIAL_TYPE.
8223 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8224 Stub_table::update_data_size_and_addralign,
8225 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8226 definitions.
8227 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8228 (Stub_table::do_write): Ditto.
8229 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8230
880cd20d
ILT
82312010-01-08 Ian Lance Taylor <iant@google.com>
8232
8233 PR 11108
8234 * symtab.h (class Symbol): Remove fields is_target_special_ and
8235 has_plt_offset_. Add field is_defined_in_discarded_section_.
8236 (Symbol::is_defined_in_discarded_section): New function.
8237 (Symbol::set_is_defined_in_discarded_section): New function.
8238 (Symbol::has_plt_offset): Rewrite.
8239 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8240 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8241 Don't initialize is_target_special_ or has_plt_offset_.
8242 Initialize is_defined_in_discarded_section_.
8243 (Symbol_table::add_from_relobj): If appropriate, set
8244 is_defined_in_discarded_section.
8245 * resolve.cc (Symbol::override_base_with_special): Don't test
8246 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8247 * target-reloc.h (relocate_section): Do special handling for
8248 symbols defined in discarded sections for global symbols as well
8249 as local symbols.
8250
2703e3eb
ILT
82512010-01-08 Ian Lance Taylor <iant@google.com>
8252
8253 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8254 the SHT_SYMTAB case.
8255
339d40a3
ILT
82562010-01-08 Ian Lance Taylor <iant@google.com>
8257
8258 * object.cc (Sized_relobj::do_layout): Don't get confused if
8259 layout_eh_frame returns NULL.
8260
abecea76
ILT
82612010-01-08 Ian Lance Taylor <iant@google.com>
8262
8263 PR 11084
8264 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8265 dynamic symbol table, use the normal symbol table.
8266 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8267 symbol table.
8268
6b7dd3f3
ILT
82692010-01-08 Ian Lance Taylor <iant@google.com>
8270
8271 PR 11072
8272 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8273 sections.
8274
36c50e63
L
82752010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8276
8277 * version.cc (print_version): Change to "Copyright 2010".
8278
e291e7b9
ILT
82792010-01-08 Ian Lance Taylor <iant@google.com>
8280
8281 PR 10287
8282 PR 11063
8283 * i386.cc (class Target_i386): Change return type of plt_section
8284 to be non-const.
8285 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8286 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8287 tls_desc_rel_ field.
8288 (Output_data_plt_i386::rel_tls_desc): New function.
8289 (Target_i386::rel_tls_desc_section): New function.
8290 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8291 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8292 R_386_TLS_DESC reloc in rel_tls_desc_section.
8293 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8294 Define struct Tlsdesc_info.
8295 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8296 (Target_x86_64::do_reloc_symbol_index): New function.
8297 (Target_x86_64::add_tlsdesc_info): New function.
8298 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8299 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8300 tlsdesc_rel_ field.
8301 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8302 all callers.
8303 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8304 (Target_x86_64::rela_tlsdesc_section): New function.
8305 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8306 handling.
8307 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8308 (Target_x86_64::do_reloc_addend): New function.
8309 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8310 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8311 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8312 (Output_reloc::type): New function.
8313 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8314 (Output_reloc::is_target_specific): New function.
8315 (Output_reloc::target_arg): New function.
8316 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8317 absolute relocs and target specific relocs.
8318 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8319 add_target_specific.
8320 (class Output_data_reloc) [SHT_RELA]: Likewise.
8321 * output.cc (Output_reloc::Output_reloc): Add four new versions
8322 for absolute relocs and target specific relocs.
8323 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8324 (Output_reloc::get_symbol_index): Likewise.
8325 (Output_reloc::local_section_offset): Check that local_sym_index_
8326 is not TARGET_CODE or 0.
8327 (Output_reloc::symbol_value): Likewise.
8328 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8329 reloc.
8330 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8331 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8332 functions.
8333 * layout.cc (add_target_dynamic_tags): Use output section for
8334 DT_PLTRELSZ and DT_JMPREL.
8335
3a44184e
ILT
83362010-01-07 Ian Lance Taylor <iant@google.com>
8337
8338 PR 11061
8339 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8340 function.
8341 (class Output_data_reloc_generic): Define.
8342 (class Output_data_reloc_base): Change base class to
8343 Output_data_reloc_generic. Change add() method to call
8344 bump_relative_reloc_count for a relative reloc. Remove
8345 sort_relocs_ field.
8346 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8347 to sort_relocs().
8348 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8349 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8350 appropriate.
8351 * layout.h (class Layout): Update declaration.
8352
ea715a34
ILT
83532010-01-07 Ian Lance Taylor <iant@google.com>
8354
8355 * output.h (class Output_data): Add const version of
8356 output_section and do_output_section.
8357 (class Output_section_data): Add const version of
8358 do_output_section.
8359 (class Output_section): Likewise.
8360 * layout.cc (Layout::add_target_dynamic_tags): New function.
8361 * layout.h (class Layout): Update declarations.
8362 * arm.cc (Target_arm::do_finalize_sections): Use
8363 add_target_dynamic_tags.
8364 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8365 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8366 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8367 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8368
659948a4
ILT
83692010-01-07 Ian Lance Taylor <iant@google.com>
8370
8371 PR 11042
8372 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8373 object as needed.
8374
9d3b86f6
ILT
83752010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8376 Ian Lance Taylor <iant@google.com>
8377
8378 PR 11019
8379 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8380 Xindex::read_symtab_xindex.
8381
bb0d3eb0
DK
83822010-01-07 Doug Kwan <dougkwan@google.com>
8383
8384 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8385 (Insn_template::thumb16_bcond_insn): New method declaration.
8386 (Insn_template): Fix spelling.
8387 (Stub::thumb16_special): New method declaration.
8388 (Stub::do_write): Define virtual method which was previously pure
8389 virtual.
8390 (Stub::do_thumb16_special): New method declaration.
8391 (Stub::do_fixed_endian_write): New template member.
8392 (Reloc_stub::do_write): Remove.
8393 (Reloc_stub::do_fixed_endian_write): Remove.
8394 (Cortex_a8_stub): New class definition.
8395 (Stub_factory::make_cortex_a8_stub): New method definition.
8396 (Stub_factory::Stub_factory): Add missing static storage class
8397 qualifier for elf32_arm_stub_a8_veneer_blx.
8398
ffeef7df
ILT
83992010-01-07 Ian Lance Taylor <iant@google.com>
8400
dc3f80fe
ILT
8401 PR 10980
8402 * options.h (class General_options): Add --warn-unresolved-symbols
8403 and --error-unresolved-symbols.
8404 * errors.cc (Errors::undefined_symbol): Implement
8405 --warn-unresolved-symbols.
8406
ffeef7df
ILT
8407 * options.h (class General_options): Add -z text and -z textoff.
8408 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8409
f1ec9ded
ST
84102010-01-06 Sriraman Tallam <tmsriram@google.com>
8411
8412 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8413 (Garbage_collection::cident_sections): New function.
8414 (Garbage_collection::add_cident_section): New function.
8415 (Garbage_collection::cident_sections_): New member.
8416 (gc_process_relocs): Add references to sections whose names are C
8417 identifiers.
8418 * gold.h (cident_section_start_prefix): New constant.
8419 (cident_section_stop_prefix): New constant.
8420 (is_cident): New function.
8421 * layout.cc (Layout::define_section_symbols): Replace string constants
8422 with the newly defined constants.
8423 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8424 C identifiers.
8425 * testsuite/Makefile.am: Add gc_orphan_section_test.
8426 * testsuite/Makefile.in: Regenerate.
8427 * testsuite/gc_orphan_section_test.cc: New file.
8428 * testsuite/gc_orphan_section_test.sh: New file.
8429
6eda8c29
ILT
84302010-01-06 Ian Lance Taylor <iant@google.com>
8431
b9674e17
ILT
8432 PR 10980
8433 * options.h (class General_options): Add --warn-shared-textrel.
8434 * layout.cc (Layout::finish_dynamic_section): Implement
8435 --warn-shared-textrel.
8436
6eda8c29
ILT
8437 PR 10980
8438 * options.h (class General_options): Add --warn-multiple-gp.
8439
32dcd44e
ILT
84402010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8441
8442 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8443 $(THREADSLIB) and $(LIBDL).
8444 * Makefile.in: Rebuild.
8445
a192ba05
ILT
84462010-01-06 Ian Lance Taylor <iant@google.com>
8447
8448 PR 10980
8449 * options.cc (General_options::parse_section_start): New function.
8450 (General_options::section_start): New function.
8451 (General_options::General_options): Initialize all members.
8452 * options.h: Include <map>
8453 (class General_options): Add --section-start. Add section_starts_
8454 member.
8455 * layout.cc (Layout::attach_allocated_section_to_segment): If
8456 --section-start was used, set the address of the segment. Remove
8457 local sort_sections.
8458 (Layout::relaxation_loop_body): If the address of the load segment
8459 has been set by --section-start, don't use it.
8460 * output.h (Output_segment::update_flags_for_output_section): New
8461 function.
8462 * output.cc (Output_segment::add_output_section): Call
8463 update_flags_for_output_section.
8464
dde3f402
ILT
84652010-01-05 Ian Lance Taylor <iant@google.com>
8466
62dfdd4d
ILT
8467 PR 10980
8468 * options.h (class General_options): Add --undefined-version.
8469 * script.cc (struct Version_expression): Add was_matched_by_symbol
8470 field.
8471 (Version_script_info::matched_symbol): New function.
8472 (Version_script_info::get_symbol_version_helper): Call
8473 matched_symbol.
8474 (Version_script_info::check_unmatched_names): New function.
8475 * script.h (class Version_script_info): Update declarations.
8476 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8477
9c4ae156
ILT
8478 * options.h (class General_options): Use DEFINE_bool_alias for
8479 allow_multiple_definition.
8480 * resolve.cc (Symbol_table::should_override): Don't test
8481 allow_multiple_definition.
8482
dde3f402
ILT
8483 PR 10980
8484 * options.h (class General_options): Add --cref.
8485 * main.cc (main): Print cref table if --cref. Don't close mapfile
8486 until after printing cref table.
8487 * cref.cc: Include "symtab.h".
8488 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8489 (Cref_table_compare::operator()): New function.
8490 (Cref_inputs::gather_cref): New function.
8491 (filecol): New static const.
8492 (Cref_inputs::print_cref): New function.
8493 (Cref::print_cref): New function.
8494 * cref.h: Include <cstdio>.
8495 (class Cref): Update declarations.
8496 * mapfile.h (Mapfile::file): New function.
8497 * object.h (class Object): Define Symbols. Declare virtual
8498 do_get_global_symbols.
8499 (Object::get_global_symbols): New function.
8500 * object.cc (Input_objects::add_object): Pass object to cref_ if
8501 --cref.
8502 (Input_objects::archive_start): Likewise.
8503 (Input_objects::archive_stop): Likewise.
8504 (Input_objects::print_cref): New function.
8505 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8506 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8507 --cref.
8508 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8509 function.
8510 * plugin.h (class Sized_pluginobj): Update declarations.
8511
8781f709
ILT
85122010-01-05 Ian Lance Taylor <iant@google.com>
8513
8514 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8515 to is_default_version. Rename insdef to insdefault.
8516 (Symbol_table::add_from_relobj): Rename def to is_default_version
8517 and local to is_forced_local.
8518 (Symbol_table::add_from_pluginobj): Likewise.
8519 (Symbol_table::add_from_dynobj): Likewise.
8520 (Symbol_table::define_special_symbol): Rename insdef to
8521 insdefault.
8522
fe35d28d
ILT
85232010-01-04 Ian Lance Taylor <iant@google.com>
8524
30bc8c46
ILT
8525 PR 10980
8526 * options.h (class General_options): Add
8527 --allow-multiple-definition and -z muldefs.
8528 * resolve.cc (Symbol_table::should_override): Don't warn about a
8529 multiple symbol definition if --allow-multiple-definition or -z
8530 muldefs.
8531
7eaea549
ILT
8532 PR 10980
8533 * options.h (class General_options): Add --add-needed and
8534 --copy-dt-needed-entries. Tweak --as-needed help entry.
8535 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8536 error if --copy-dt-needed-entries aka --add-needed is used and
8537 would cause a change in behaviour.
8538
fe35d28d
ILT
8539 PR 10980
8540 * options.h (class General_options): Add -G as a short version of
8541 --shared. Add no-op options -assert, -g, and -i.
8542
55a2bb35
ST
85432010-01-04 Sriraman Tallam <tmsriram@google.com>
8544
8545 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8546 check for .text or .gnu.linkonce.t sections.
8547 * icf.cc (Icf::find_identical_sections): Ditto.
8548 Change the detection for mangled function name within the section
8549 name.
8550 * icf.h (is_section_foldable_candidate): New function.
8551
719328e1
ILT
85522009-12-30 Ian Lance Taylor <iant@google.com>
8553
8554 PR 10980
8555 * options.h (class General_options): Permit two dashes with
8556 --retain-symbols-file.
8557
d7bb5745
ILT
85582009-12-30 Ian Lance Taylor <iant@google.com>
8559
403a15dd
ILT
8560 PR 10979
8561 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8562 don't put the file header and segment headers in the text
8563 segment.
8564
eda294df
ILT
8565 PR 10979
8566 * common.cc (Sort_commons::operator()): Stabilize sort when both
8567 entries are NULL.
8568 (Symbol_table::do_allocate_commons_list): When allocating common
8569 symbols, skip a symbol which is no longer common.
8570 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8571 an object before checking its type.
8572 * testsuite/common_test_2.c: New file.
8573 * testsuite/common_test_3.c: New file.
8574 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8575 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8576 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8577 (common_test_2_pic.o, common_test_2.so): New targets.
8578 (common_test_3_pic.o, common_test_3.so): New targets.
8579 * testsuite/Makefile.in: Rebuild.
8580
d7bb5745
ILT
8581 PR 10979
8582 * script.cc (read_input_script): If we see a new SECTIONS clause,
8583 and we have added an input section, give an error.
8584 * layout.h (class Layout): Add have_added_input_section function.
8585 Add have_added_input_section_ field.
8586 * layout.cc (Layout::Layout): Initialize
8587 have_added_input_section_.
8588 (Layout::layout): Set have_added_input_section_.
8589 (Layout::layout_eh_frame): Likewise.
8590
fc59c572
ILT
85912009-12-30 Ian Lance Taylor <iant@google.com>
8592
8593 PR 10931
8594 * options.h (class General_options): Add --sort-common option.
8595 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8596 * common.cc (Sort_common): Add sort_order parameter to
8597 constructor. Add sort_order_ field.
8598 (Sort_commons::operator): Check sort_order_.
8599 (Symbol_table::allocate_commons): Determine the sort order.
8600 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8601 Change all callers.
8602 (Symbol_table::do_allocate_commons_list): Likewise.
8603
1c74fab0
ILT
86042009-12-30 Ian Lance Taylor <iant@google.com>
8605
8606 PR 10916
8607 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8608 symbols from this object, don't change the visibility of an
8609 undefined symbol.
8610 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8611
6affe781
ILT
86122009-12-30 Ian Lance Taylor <iant@google.com>
8613
8614 PR 10861
8615 * script.h (class Version_script_info): Define Language enum.
8616 Update declarations. Define Glob, Exact, and Lookup types. Add
8617 new fields globals_, locals_, and is_finalized_.
8618 * script.cc: Various formatting fixes.
8619 (class Parser_closure): Change language_stack_ from a vector of
8620 std::string to one of Version_script_info::Language. Adjust all
8621 uses accordingly.
8622 (class Lazy_demangler): Remove.
8623 (struct Version_expression): Change language from std::string to
8624 Version_script_info::Language.
8625 (Version_script_info::Version_script_info): New function.
8626 (Version_script_info::~Version_script_info): Don't call clear.
8627 (Version_script_info::finalize): New function.
8628 (Version_script_info::build_lookup_tables): New function.
8629 (Version_script_info::build_expression_list_lookup): New
8630 function.
8631 (Version_script_info::get_symbol_version_helper): Rewrite to use
8632 lookup tables.
8633 (Version_script_info::print_expression_list): Adjust to use
8634 Version_script_info::Language.
8635 (script_push_lex_into_version_mode): Check that the version script
8636 has not been finalized.
8637 (version_script_push_lang): Change language string to
8638 Version_script_info::Language.
8639 * options.cc (Command_line::version_script): New function.
8640 * options.h (class General_options): Add finalize_dynamic_list
8641 function. Change version_script from declaration to definition.
8642 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8643 * testsuite/version_script.map: Remove duplicate def of foo.
8644 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8645 version_script.map.
8646 * testsuite/Makefile.in: Rebuild.
8647
818bf354
ILT
86482009-12-30 Ian Lance Taylor <iant@google.com>
8649
8650 PR 10843
8651 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8652 if the input symbol index is 0, make the output symbol index 0.
8653
ebcc8304
ILT
86542009-12-30 Ian Lance Taylor <iant@google.com>
8655
8656 PR 10670
8657 * options.h (class General_options): Add -x/--discard-all.
8658 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8659 --discard-all. If the local symbol needs a dynamic entry, check
8660 that before handling --discard-locals.
8661
176fe33f
ILT
86622009-12-30 Ian Lance Taylor <iant@google.com>
8663
bb321bb1
ILT
8664 PR 10450
8665 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8666 flags to PF_R.
8667 (Output_segment::add_output_section): Don't change the flags if
8668 the type is PT_TLS.
8669
176fe33f
ILT
8670 PR 10450
8671 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8672 GNU hash table if they need a dynamic value. Otherwise, don't add
8673 them if they are defined in a dynamic object or are forced local.
8674
e8cd95c7
ILT
86752009-12-29 Ian Lance Taylor <iant@google.com>
8676
1b81fb71
ILT
8677 PR 10450
8678 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8679 .gnu.hash table for a 32-bit target.
8680
8d6d383d
ILT
8681 PR 10450
8682 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8683 regular and a dynamic object only needs a dynamic symbol table
8684 entry if it is externally visible.
8685
e785ec03
ILT
8686 PR 10450
8687 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8688 constructor. Add global_offset_table_ field.
8689 (Target_i386::got_section): Set global_offset_table_.
8690 (Target_i386::do_finalize_sections): Set global_offset_table_
8691 size.
8692 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8693 in constructor. Add global_offset_table_ field.
8694 (Target_x86_64::got_section): Set global_offset_table_.
8695 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8696 size.
8697
1a2dff53
ILT
8698 * layout.cc (Layout::Layout): Initialize increase_relro_.
8699 (Layout::get_output_section): Add is_relro, is_last_relro, and
8700 is_first_non_relro parameters. Change all callers.
8701 (Layout::choose_output_section): Likewise.
8702 (Layout::add_output_section_data): Likewise.
8703 (Layout::make_output_section): Likewise.
8704 (Layout::set_segment_offsets): Clear increase_relro when using a
8705 linker script.
8706 * layout.h (class Layout): Add increase_relro method. Add
8707 increase_relro_ field. Update declarations.
8708 * output.cc (Output_section::Output_section): Initialize
8709 is_last_relro_ and is_first_non_relro_.
8710 (Output_segment::add_output_section): Group relro sections is
8711 do_sort is true. Handle is_last_relro and is_first_non_relro.
8712 (Output_segment::maximum_alignment): Remove relro handling.
8713 (Output_segment::set_section_addresses): Add increase_relro
8714 parameter. Change all callers. Add initial alignment to align
8715 relro sections on separate page. Remove old relro handling.
8716 (Output_segment::set_section_list_addresses): Remove in_relro
8717 parameter. Change all callers.
8718 (Output_segment::set_offset): Add increase parameter. Change all
8719 callers. Remove old relro handling.
8720 * output.h (class Output_section): Add new methods: is_last_relro,
8721 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8722 Add is_last_relro_ and is_first_non_relro_ fields.
8723 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8724 Create separate .got.plt section. Call increase_relro.
8725 * x86_64.cc (Target_x86_64::got_section): Likewise.
8726 * testsuite/relro_script_test.t: Add .got.plt.
8727
f0ba79e2
ILT
8728 PR 10450
8729 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8730 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8731 (Layout::finalize): Call set_dynamic_symbol_size.
8732 (Layout::set_dynamic_symbol_size): New function.
8733 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8734 set_dynamic_symbol_size.
8735
e8cd95c7
ILT
8736 PR 10450
8737 * output.h (class Output_section): Add is_entsize_zero_ field.
8738 * output.cc (Output_section::Output_section): Initialize
8739 is_entsize_zero_.
8740 (Output_section::set_entsize): If two different entsizes are
8741 requested, force it to zero.
8742 (Output_section::add_input_section): Set flags for .debug_str
8743 before updating section flags. Set entsize.
8744 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8745 and SHF_STRING if all input sections have those flags.
8746
3e1b9a8a
RÁE
87472009-12-29 Rafael Espindola <espindola@google.com>
8748
8749 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8750 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8751 reporting.
3e1b9a8a 8752
3dcad376
ST
87532009-12-29 Sriraman Tallam <tmsriram@google.com>
8754
8755 * options.cc (General_options::parse_version): Allow -v to exit
8756 without an error if there is nothing to link.
8757
084e2665
ILT
87582009-12-29 Ian Lance Taylor <iant@google.com>
8759
8760 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8761 using a version of gcc before 4.1.
8762 * configure: Rebuild.
8763
250acde3
CD
87642009-12-28 Chris Demetriou <cgd@google.com>
8765
8766 * attributes.cc (Output_attributes_section_data::do_write): Use
8767 std::vector::front rather than std::vector::data.
8768
99fff23b
ILT
87692009-12-28 Ian Lance Taylor <iant@google.com>
8770
8771 * symtab.h (class Symbol_table): Add enum Defined.
8772 * resolve.cc (Symbol_table::should_override): Add defined
8773 parameter. Change all callers. Test whether object is NULL
8774 before calling a method on it.
8775 (Symbol_table::report_resolve_problem): Add defined parameter.
8776 Change all callers.
8777 (Symbol_table::should_override_with_special): Likewise.
8778 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8779 parameter. Change all callers.
8780 (Symbol_table::do_define_in_output_data): Likewise.
8781 (Symbol_table::define_in_output_segment): Likewise.
8782 (Symbol_table::do_define_in_output_segment): Likewise.
8783 (Symbol_table::define_as_constant): Likewise.
8784 (Symbol_table::do_define_as_constant): Likewise.
8785 * script.h (class Symbol_assignment): Add is_defsym parameter to
8786 constructor; change all callers.
8787 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8788 parameter. Change all callers. Add is_defsym_ field.
8789 (class Parser_closure): Add parsing_defsym parameter to
8790 constructor; change all callers. Add parsing_defsym accessor
8791 function. Add parsing_defsym_ field.
8792
556bd683
ILT
87932009-12-28 Ian Lance Taylor <iant@google.com>
8794
8795 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8796 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8797
1782c879
ILT
87982009-12-23 Ian Lance Taylor <iant@google.com>
8799
8800 * i386.cc (Target_i386::do_calls_non_split): Recognize
8801 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8802 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8803 -fsplit-stack prologue when using %r11.
1782c879 8804
329ca2b1
ST
88052009-12-21 Sriraman Tallam <tmsriram@google.com>
8806
8807 * options.cc (General_options::parse_version): Make -v continue and do
8808 the link like GNU ld does.
8809
d675ff46
RÁE
88102009-12-17 Rafael Avila de Espindola <espindola@google.com>
8811
8812 * Makefile.am (CCFILES): Add timer.cc.
8813 (HFILES): Add timer.h.
8814 * configure.ac: Check for sysconf and times.
8815 * main.cc: include timer.h.
8816 (main): Use Timer instead of get_run_time.
8817 * timer.cc: New.
8818 * timer.h: New.
8819 * workqueue.cc: include timer.h.
8820 (Workqueue::find_and_run_task):
8821 Report user, sys and wall time.
8822 * Makefile.in: Regenerate.
8823 * config.in: Regenerate.
8824 * configure: Regenerate.
8825
d6344fb5
DK
88262009-12-16 Doug Kwan <dougkwan@google.com>
8827
8828 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8829 sections.
8830 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8831 relaxed input sections.
8832 * output.cc (Output_section::find_relaxed_input_section): Change
8833 return type to Output_relaxed_input_section pointer. Adjust code
8834 for new type of relaxed_input_section_map_.
8835 * output.h (Output_section::find_relaxed_input_section): Change
8836 return type to Output_relaxed_input_section pointer.
8837 (Output_section::Output_relaxed_input_section_by_input_section_map):
8838 New type.
8839 (Output_section::relaxed_input_section_map_): Change type to
8840 Output_section::Output_relaxed_input_section_by_input_section_map.
8841 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8842 input section.
8843
0e0d5469
ILT
88442009-12-15 Ian Lance Taylor <iant@google.com>
8845
8846 * layout.cc (Layout::create_shstrtab): Only write out after input
8847 sections if we are compressing debug sections.
8848
0649a889
ILT
88492009-12-15 Ian Lance Taylor <iant@google.com>
8850
8851 * archive.cc (Archive::add_symbols): Only look up a symbol without
8852 a version if there is, in fact, a version.
8853
2ea97941
ILT
88542009-12-14 Ian Lance Taylor <iant@google.com>
8855
8856 Revert -Wshadow changes, all changes from:
8857 2009-12-11 Doug Kwan <dougkwan@google.com>
8858 2009-12-11 Nick Clifton <nickc@redhat.com>
8859 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8860
b0eec2cc
DK
88612009-12-11 Doug Kwan <dougkwan@google.com>
8862
8863 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8864 due to -Wshadow.
8865 * attributes.cc (Object_attribute::size): Ditto.
8866 (Attributes_section_data::size): Ditto.
8867 (Attributes_section_data::Attributes_section_data): Ditto.
8868 (Output_attributes_section_data::do_write): Ditto.
8869 * attributes.h (Object_attribute::set_type): Ditto.
8870 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8871
91d6fa6a
NC
88722009-12-11 Nick Clifton <nickc@redhat.com>
8873
8874 * archive.cc: Fix shadowed variable warnings.
8875 * arm.cc: Likewise.
8876 * compressed_output.cc: Likewise.
8877 * compressed_output.h: Likewise.
8878 * configure: Likewise.
8879 * dwarf_reader.cc: Likewise.
8880 * dynobj.cc: Likewise.
8881 * dynobj.h: Likewise.
8882 * ehframe.cc: Likewise.
8883 * ehframe.h: Likewise.
8884 * errors.cc: Likewise.
8885 * expression.cc: Likewise.
8886 * fileread.cc: Likewise.
8887 * fileread.h: Likewise.
8888 * freebsd.h: Likewise.
8889 * i386.cc: Likewise.
8890 * icf.cc: Likewise.
8891 * incremental.h: Likewise.
8892 * layout.cc: Likewise.
8893 * layout.h: Likewise.
8894 * mapfile.cc: Likewise.
8895 * merge.cc: Likewise.
8896 * merge.h: Likewise.
8897 * object.cc: Likewise.
8898 * object.h: Likewise.
8899 * options.h: Likewise.
8900 * output.cc: Likewise.
8901 * output.h: Likewise.
8902 * parameters.cc: Likewise.
8903 * plugin.cc: Likewise.
8904 * powerpc.cc: Likewise.
8905 * reduced_debug_output.cc: Likewise.
8906 * reduced_debug_output.h: Likewise.
8907 * reloc.cc: Likewise.
8908 * reloc.h: Likewise.
8909 * resolve.cc: Likewise.
8910 * script-sections.cc: Likewise.
8911 * script.cc: Likewise.
8912 * script.h: Likewise.
8913 * sparc.cc: Likewise.
8914 * symtab.cc: Likewise.
8915 * symtab.h: Likewise.
8916 * target-select.cc: Likewise.
8917 * target-select.h: Likewise.
8918 * token.h: Likewise.
8919 * workqueue.cc: Likewise.
8920 * workqueue.h: Likewise.
8921 * x86_64.cc: Likewise.
8922
a0351a69
DK
89232009-12-10 Doug Kwan <dougkwan@google.com>
8924
8925 * arm.cc (attributes.h): New include.
8926 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8927 (Arm_relobj::~Arm_relobj): Delete object pointed by
8928 attributes_section_data_.
8929 (Arm_relobj::attributes_section_data): New method definition.
8930 (Arm_relobj::attributes_section_data_): New data member declaration.
8931 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8932 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8933 attributes_section_data_.
8934 (Arm_dynobj::attributes_section_data): New method definition.
8935 (Arm_dynobj::attributes_section_data_): New data member declaration.
8936 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8937 initialization value of may_use_blx_ to false.
2e702c99 8938 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8939 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8940 object attributes to compute results instead of hard-coding.
8941 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8942 Target_arm::get_secondary_compatible_arch,
8943 Target_arm::set_secondary_compatible_arch
8944 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8945 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8946 New method declarations.
8947 (Target_arm::get_aeabi_object_attribute): New method definition.
8948 (Target_arm::attributes_section_data_): New data member declaration.
8949 (read_arm_attributes_section): New template definition.
8950 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8951 (Arm_dynobj::do_read_symbols): Ditto.
8952 (Target_arm::do_finalize_sections): Merge attributes sections from
8953 input. Check for BLX use after attributes section merging.
8954 Fix __exidx_start and __exidx_end visibility. Create an
8955 .ARM.attributes section if necessary.
8956 (Target_arm::get_secondary_compatible_arch,
8957 Target_arm::set_secondary_compatible_arch,
8958 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8959 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8960 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8961 New method definitions.
8962
b59befec
ILT
89632009-12-09 Ian Lance Taylor <iant@google.com>
8964
8965 * plugin.cc (Plugin::load): Don't cast from void* to a function
8966 pointer.
8967
1276bc89
ILT
89682009-12-09 Ian Lance Taylor <iant@google.com>
8969
8970 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8971 information fields.
8972
2f2de248
L
89732009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8974
8975 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8976 Replace two_file_shared_1.so with two_file_shared_2.so.
8977 * testsuite/Makefile.in: Regenerated.
8978
4f787271
DK
89792009-12-08 Doug Kwan <dougkwan@google.com>
8980
8981 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8982 (HFILES): Add attributes.h and int_encoding.h.
8983 * Makefile.in: Regenerate.
8984 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8985 function definitions to int_encoding.cc
8986 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8987 prototypes to int_encoding.h
8988 * reduced_debug_output.cc (int_encoding.h): New include.
8989 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8990 function definitions to int_encoding.cc
8991 (insert_into_vector, read_from_pointer): Move template definitions to
8992 int_encoding.h
8993 * attributes.cc: New file.
8994 * attributes.h: New file.
8995 * int_encoding.cc: New file.
8996 * int_encoding.h: New file.
8997
20b52f1a
RÁE
89982009-12-07 Rafael Avila de Espindola <espindola@google.com>
8999
9000 PR gold/11055
9001 * incremental-dump.cc (dump_incremental_inputs): New.
9002 (main): Use dump_incremental_inputs.
9003
53d7974c
L
90042009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9005
9006 PR gold/10893
9007 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9008 checking elfcpp::STT_FUNC.
9009 (Target_i386::Relocate::relocate): Likewise.
9010 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9011
9012 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9013 symbols from shared libraries into normal FUNC symbols.
9014
9015 * symtab.h (Symbol): Add is_func and use it.
9016
05a352e6
DK
90172009-12-05 Doug Kwan <dougkwan@google.com>
9018
9019 * arm.cc (Target_arm::arm_info): Initialize new fields
9020 attributes_section and attributes_vendor.
9021 * i386.cc (Target_i386::i386_info): Same.
9022 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9023 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9024 fields attributes_section and attributes_vendor.
53d7974c 9025 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9026 * target.h (Target::attributes_section, Target::attributes_vendor,
9027 Target::is_attributes_section, Target::attribute_arg_type,
9028 Target::attributes_order): New method definitions.
9029 (Target::Target_info::attributes_section,
9030 Target::Target_info::attributes_vendor): New fields.
9031 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9032 virtual method definitions.
9033 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9034 attributes_section and attributes_vendor.
9035 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9036
f4e5969c
DK
90372009-12-05 Doug Kwan <dougkwan@google.com>
9038
9039 * arm.cc: Update comments about interworking and stub generation.
9040 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9041 considered as non-PIC.
9042 (Arm_relocate_functions::base_abs): Fix formatting.
9043 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9044 of function to use GOT entry address instead of offset.
9045 (Target_arm::Scan::global): Issue an error if a symbol would need a
9046 PLT does not get one because it is untyped. Remove code to create
9047 dynamic symbols for relative branches.
9048 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9049 takes unsigned integer instead of boolean.
9050
1abce4a6
L
90512009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9052
9053 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9054 (two_file_test_LDADD): Likewise.
9055 (common_test_1_LDADD): Likewise.
9056 (exception_test_LDADD) Likewise.
9057 (weak_test_LDADD): Likewise.
9058 (many_sections_test_LDADD): Likewise.
9059 (initpri1_LDADD): Likewise.
9060 (script_test_1_LDADD): Likewise.
9061 (script_test_2_LDADD): Likewise.
9062 (justsyms_LDADD): Likewise.
9063 (binary_test_LDADD): Likewise.
9064 (large_LDADD): Likewise.
9065 * testsuite/Makefile.in: Regenerated.
9066
adcf2816 90672009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9068
adcf2816
L
9069 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9070 (Symbol_table::override_with_special): Likewise.
9071 (Symbol_table::add_from_object): Likewise.
9072
28e67f5d
RÁE
90732009-12-04 Rafael Avila de Espindola <espindola@google.com>
9074
9075 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9076 Don't set the data_offset twice.
9077
ae10a101
RÁE
90782009-12-04 Rafael Avila de Espindola <espindola@google.com>
9079
9080 * testsuite/Makefile.in: Regenerate.
9081
f59f41f3
DK
90822009-12-03 Doug Kwan <dougkwan@google.com>
9083
9084 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9085 (Target_arm::do_finalize_sections): Add parameter for symbol table
9086 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9087 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9088 parameter for symbol table pointer.
9089 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9090 an additional parameter for a pointer to symbol table.
9091 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9092 parameter for a symbol table pointer.
9093 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9094 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9095 Ditto.
9096 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9097 parameter for a symbol table pointer.
9098
ca55d848
RÁE
90992009-12-03 Rafael Avila de Espindola <espindola@google.com>
9100
9101 * incremental.cc (Incremental_inputs_header)
9102 (Incremental_inputs_header_write, Incremental_inputs_entry)
9103 (Incremental_inputs_entry_write): Move ...
9104 * incremental.h (Incremental_inputs_header)
9105 (Incremental_inputs_header_write, Incremental_inputs_entry)
9106 (Incremental_inputs_entry_write): here.
9107
3aec4f9c
RÁE
91082009-12-02 Rafael Avila de Espindola <espindola@google.com>
9109
9110 * incremental.cc (make_sized_incremental_binary): Set the target.
9111 Error if it is incompatible.
9112 * output.h (Output_file): Add filename method.
9113
9c0ae74d
RÁE
91142009-12-02 Rafael Avila de Espindola <espindola@google.com>
9115
9116 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9117 from the get_* methods.
9118
a45500ae
RÁE
91192009-12-02 Rafael Avila de Espindola <espindola@google.com>
9120
9121 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9122 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9123 Write 0 for the data_offset of scripts.
9124
325e6408
RÁE
91252009-12-02 Rafael Avila de Espindola <espindola@google.com>
9126
9127 * testsuite/Makefile.am: Add the incremental_test.sh test.
9128 * testsuite/incremental_test.sh: New.
9129 * testsuite/incremental_test_1.c: New.
9130 * testsuite/incremental_test_2.c: New.
9131
954c3e2e
RÁE
91322009-12-01 Rafael Avila de Espindola <espindola@google.com>
9133
703d02da 9134 * incremental-dump.cc (main): Fix typos.
954c3e2e 9135
f8086623
RÁE
91362009-11-27 Rafael Avila de Espindola <espindola@google.com>
9137
9138 PR gold/11025
9139 * incremental-dump.cc (main): Use llu to print 64 bit values.
9140
3b0dd6ac
L
91412009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9142 H.J. Lu <hongjiu.lu@intel.com>
9143
9144 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9145 $(LIBDL).
9146 (incremental_dump_LDADD): Likewise.
9147 * Makefile.in: Regenerated.
9148
a6d1ef57 91492009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9150
a6d1ef57
DK
9151 Revert:
9152
9153 2009-11-25 Doug Kwan <dougkwan@google.com>
9154
9155 * arm.cc (Target_arm::Target_arm): Move method definition
9156 outside of class definition. Add code to handle
9157 --target1-rel, --target1-abs and --target2= options.
9158 (Target_arm::get_reloc_reloc_type): Change method to be
9159 non-static and const.
9160 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9161 New data member declaration.
9162 (Target_arm::Scan::local, Target_arm::Scan::global,
9163 Target_arm::Relocate::relocate,
9164 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9165 Adjust call to Target_arm::get_real_reloc_type.
9166 (Target_arm::get_real_reloc_type): Use command line options
9167 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9168 * options.h (--target1-rel, --target1-abs, --target2): New
9169 ARM-only options.
9170
50aeb7d4
DK
91712009-11-25 Doug Kwan <dougkwan@google.com>
9172
9173 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9174 class definition. Add code to handle --target1-rel, --target1-abs
9175 and --target2= options.
9176 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9177 and const.
9178 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9179 member declaration.
9180 (Target_arm::Scan::local, Target_arm::Scan::global,
9181 Target_arm::Relocate::relocate,
9182 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9183 call to Target_arm::get_real_reloc_type.
9184 (Target_arm::get_real_reloc_type): Use command line options to
9185 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9186 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9187 options.
9188
51938283
DK
91892009-11-25 Doug Kwan <dougkwan@google.com>
9190
9191 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9192 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9193 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9194 formatting.
9195 (Arm_relocate_functions::thm_call): Replace body with a call to
9196 Arm_relocate_functions::thumb_branch_common.
9197 (Arm_relocate_functions::thm_jump24,
9198 Arm_relocate_functions::thm_xpc22): New method definitions.
9199 (Arm_relocate_functions::thumb_branch_common): New method definition.
9200 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9201 operator.
9202 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9203 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9204
e2b8f3c4
RÁE
92052009-11-24 Rafael Avila de Espindola <espindola@google.com>
9206
9207 * Makefile.am: Build incremental-dump
9208 * Makefile.in: Regenerate.
9209 * incremental-dump.cc: New.
9210 * incremental.cc (Incremental_inputs_header_data,
9211 Incremental_inputs_entry_data): Move to incremental.h
9212 * incremental.h: (Incremental_inputs_header_data,
9213 Incremental_inputs_entry_data): Move from incremental.cc
9214
bcba9aec
RÁE
92152009-11-24 Rafael Avila de Espindola <espindola@google.com>
9216
9217 * incremental.cc (Incremental_inputs_header,
9218 Incremental_inputs_header_write, Incremental_inputs_entry,
9219 Incremental_inputs_entry_write): Add a typedef with the data type.
9220
7c3afe08
RÁE
92212009-11-24 Rafael Avila de Espindola <espindola@google.com>
9222
9223 * incremental.cc (Incremental_inputs_header,
9224 Incremental_inputs_header_write, Incremental_inputs_entry,
9225 Incremental_inputs_entry_write): Update comment about which
9226 type has the filed descriptions.
9227
d204b6e9
DK
92282009-11-15 Doug Kwan <dougkwan@google.com>
9229
9230 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9231 (Arm_relocate_functions::arm_branch_common): Change method defintion
9232 in class definition to a method declaration and update list of formal
9233 parameters.
9234 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9235 Arm_relocation_functions::jump24): Adjust call to
9236 Arm_relocate_functions::arm_branch_common. Update list of formal
9237 parameters.
9238 (Arm_relocate_functions::xpc25): New method definition.
9239 (Arm_relocate_functions::arm_branch_common): Move method defintion
9240 out from class definition. Use stubs for mode-switching and extending
9241 branch ranges.
9242 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9243 specially. Change code to enable use of stubs in ARM branches.
9244
43d12afe
DK
92452009-11-10 Doug Kwan <dougkwan@google.com>
9246
9247 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9248 in method declaration.
9249 (Target_arm::relocate_stub): New method declaration.
9250 (Target_arm::default_target): Change to return a pointer instead of
9251 a const reference.
9252 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9253 Target_arm::default_target.
9254 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9255 method definition.
9256 (Target_arm::relocate_section): Adjust view.
9257 (Target_arm::relocate_stub): New method definition.
9258
ac33a407
DK
92592009-11-10 Doug Kwan <dougkwan@google.com>
9260
9261 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9262 a format warning.
9263 * incremental.cc (open_incremental_binary): Initialized local
9264 variables to avoid warnings.
9265 * object.cc (make_elf_object): Ditto.
9266 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9267 a format warning.
e1df38aa 9268
88ee28e9
L
9269009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9270
9271 PR gold/10930
9272 * testsuite/plugin_test.c: Include "config.h".
9273
2daedcd6
DK
92742009-11-09 Doug Kwan <dougkwan@google.com>
9275
9276 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9277 (arm_symbol_value): Remove.
9278 (Arm_relocate_functions::arm_branch_common,
9279 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9280 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9281 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9282 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9283 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9284 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9285 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9286 Arm_relocate_functions::thm_mobw_abs_nc,
9287 Arm_relocate_functions::thm_mov_abs,
9288 Arm_relocate_functions::movw_prel_nc,
9289 Arm_relocate_functions::thm_movt_abs,
9290 Arm_relocate_functions::movt_prel,
9291 Arm_relocate_functions::thm_movw_prel_nc,
9292 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9293 (Target_arm::Relocate::relocate): Only decompose address into two
9294 parts if relocation type uses the thumb-bit and pass the actual
9295 bit instead of a flag indicating that the thumb-bit is used. Adjust
9296 calls to methods in Arm_relocate_functions for this change.
9297
1276bc89 92982009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9299
9300 PR 10925
9301 * reloc.cc: Instantiate
9302 Sized_relobj::initialize_input_to_output_maps and
9303 Sized_relobj:free_input_to_output_maps.
9304
e53ad1b5
ILT
93052009-11-06 Ian Lance Taylor <iant@google.com>
9306
9307 PR 10876
9308 * defstd.cc (in_segment): Set only_if_ref true for "end".
9309
eb44217c
DK
93102009-11-06 Doug Kwan <dougkwan@google.com>
9311
9312 * arm.cc (class Reloc_stub): Correct a comment.
9313 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9314 (Target_arm::scan_section_for_stubs): New method declaration.
9315 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9316 Change methods from private to protected.
9317 (Target_arm::do_may_relax): New method definition.
9318 (Target_arm::do_relax, Target_arm::group_sections,
9319 Target_arm::scan_reloc_for_stub,
9320 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9321 (Target_arm::arm_input_section_map_): New data member declaration.
9322 (Target_arm::scan_reloc_for_stub,
9323 Target_arm::scan_reloc_section_for_stubs,
9324 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9325 Target_arm::do_relax): New method definitions.
9326
5d329b7d
ILT
93272009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9328
9329 * configure.ac: Check for (struct stat)::st_mtim
9330 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9331 * config.in: Regenerate.
9332 * configure: Regenerate.
9333
96a0d71b
ILT
93342009-11-05 Ian Lance Taylor <iant@google.com>
9335
9336 PR 10910
9337 * output.cc (Output_segment::add_output_section): Add missing
9338 return statement.
9339
594c8e5e
ILT
93402009-11-04 Ian Lance Taylor <iant@google.com>
9341
9342 PR 10880
9343 * object.h (class Object): Add is_needed and set_is_needed
9344 methods. Add is_needed_ field. Make bool fields into bitfields.
9345 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9346 defined in a dynamic object and referenced by a regular object,
9347 set is_needed for the dynamic object.
9348 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9349 if the file is marked with as_needed and it is not needed.
9350
22b127cc
ILT
93512009-11-04 Ian Lance Taylor <iant@google.com>
9352
9353 PR 10887
9354 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9355 tags if data is discarded by linker script.
9356 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9357 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9358 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9359 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9360
f5c870d2
ILT
93612009-11-04 Ian Lance Taylor <iant@google.com>
9362
9363 * layout.cc (Layout::get_output_section): Add is_interp and
9364 is_dynamic_linker_section parameters. Change all callers.
9365 (Layout::choose_output_section): Likewise.
9366 (Layout::make_output_section): Likewise.
9367 (Layout::add_output_section_data): Add is_dynamic_linker_section
9368 parameter. Change all callers.
9369 * layout.h (class Layout): Update declarations.
9370 * output.h (class Output_section): Add is_interp, set_is_interp,
9371 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9372 Add is_interp_, is_dynamic_linker_section_ fields. Change
9373 generate_code_fills_at_write_ to a bitfield.
9374 * output.cc (Output_section::Output_sections): Initialize new
9375 fields.
9376 (Output_segment::add_output_section): Add do_sort parameter.
9377 Change all callers.
9378
1ae4d23b
ILT
93792009-11-03 Ian Lance Taylor <iant@google.com>
9380
9381 PR 10860
9382 * options.h (class General_options): Add --warn-common.
9383 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9384 merging two common symbols.
9385 (Symbol_table::should_override): Handle --warn-common when merging
9386 a common symbol with a defined symbol. Use report_resolve_problem
9387 for multiple definitions.
9388 (Symbol_table::report_resolve_problem): New function.
9389 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9390
55da9579
DK
93912009-11-03 Doug Kwan <dougkwan@google.com>
9392
9393 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9394 stub_factory_.
9395 (Target_arm::stub_factory): New method definition.
9396 (Target_arm::new_arm_input_section,
9397 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9398 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9399 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9400 New type definitions.
9401 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9402 member declarations.
9403 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9404 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9405 New method definitions.
9406
37a9ac43
ILT
94072009-11-03 Ian Lance Taylor <iant@google.com>
9408
9409 * options.h (class General_options): Add --warn_constructors.
9410
b3d6a3d4
ILT
94112009-11-03 Ian Lance Taylor <iant@google.com>
9412
9413 PR 10893
9414 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9415 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9416
934b01dd
ILT
94172009-11-03 Ian Lance Taylor <iant@google.com>
9418
9419 PR 10895
9420 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9421 --msgid-bugs-address.
9422 (install-pdf): New target.
9423 (install-data_yes): Look up one directory to find mkinstalldirs.
9424
03c1939b
L
94252009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9426
9427 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9428 tree.
9429
ebd95253
DK
94302009-10-30 Doug Kwan <dougkwan@google.com>
9431
9432 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9433
e9bbb538
DK
94342009-10-30 Doug Kwan <dougkwan@google.com>
9435
9436 * arm.cc (Stub_addend_reader): New struct template definition
9437 and partial specializations.
9438 (Stub_addend_reader::operator()): New method definition for a
9439 partially specialized template.
9440
d5b40221
DK
94412009-10-30 Doug Kwan <dougkwan@google.com>
9442
9443 * arm.cc (Arm_relobj::processor_specific_flags): New method
9444 definition.
9445 (Arm_relobj::do_read_symbols): New method declaration.
9446 (Arm_relobj::processor_specific_flags_): New data member declaration.
9447 (Arm_dynobj): New class definition.
9448 (Target_arm::do_finalize_sections): Add input_objects parameter.
9449 (Target_arm::do_adjust_elf_header): New method declaration.
9450 (Target_arm::are_eabi_versions_compatible,
9451 (Target_arm::merge_processor_specific_flags): New method declaration.
9452 (Target_arm::do_make_elf_object): New overloaded method definitions
9453 and declaration.
9454 (Arm_relobj::do_read_symbols): New method definition.
9455 (Arm_dynobj::do_read_symbols): Ditto.
9456 (Target_arm::do_finalize_sections): Add input_objects parameters.
9457 Merge processor-specific flags from all input objects.
9458 (Target_arm::are_eabi_versions_compatible,
9459 Target_arm::merge_processor_specific_flags,
9460 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9461 New method definitions.
9462 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9463 Input_objects pointer type parameter.
9464 * layout.cc (Layout::finalize): Pass input objects to target's.
9465 finalize_sections function.
9466 * output.cc (Output_file_header::do_sized_write): Set ELF file
9467 header's processor-specific flags.
9468 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9469 Input_objects pointer type parameter.
9470 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9471 * target.h (Input_objects): New forward class declaration.
9472 (Target::processor_specific_flags,
9473 Target::are_processor_specific_flags_sect): New method definitions.
9474 (Target::finalize_sections): Add input_objects parameter.
9475 (Target::Target): Initialize processor_specific_flags_ and
9476 are_processor_specific_flags_set_.
9477 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9478 parameter.
9479 (Target::set_processor_specific_flags): New method definition.
9480 (Target::processor_specific_flags_,
9481 Target::are_processor_specific_flags_set_): New data member
9482 declarations.
9483 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9484 Input_objects pointer type parameter.
9485
ebabffbd
DK
94862009-10-30 Doug Kwan <dougkwan@google.com>
9487
9488 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9489
ad0f2072
ILT
94902009-10-28 Ian Lance Taylor <iant@google.com>
9491
9492 * object.h (class Relobj): Drop options parameter from
9493 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9494 do_scan_relocs, do_relocate. Change all callers.
9495 (class Sized_relobj): Drop options parameters from
9496 do_gc_process_relocs, do_scan_relocs, do_relocate,
9497 do_relocate_sections, relocate_sections, emit_relocs_scan,
9498 emit_relocs_scan_reltype. Change all callers.
9499 (struct Relocate_info): Remove options field and all references to
9500 it.
9501 * reloc.h (class Read_relocs): Remove options constructor
9502 parameter and options_ field. Change all callers.
9503 (class Gc_process_relocs, class Scan_relocs): Likewise.
9504 (class Relocate_task): Likewise.
9505 * target-reloc.h (scan_relocs): Remove options parameter. Change
9506 all callers.
9507 (scan_relocatable_relocs): Likewise.
9508 * target.h (class Sized_target): Remove options parameter from
9509 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9510 all callers.
9511 * gc.h (gc_process_relocs): Remove options parameter. Change all
9512 callers.
9513 * arm.cc: Update functions to remove options parameters.
9514 * i386.cc: Likewise.
9515 * powerpc.cc: Likewise.
9516 * sparc.cc: Likewise.
9517 * x86_64.cc: Likewise.
9518 * testsuite/testfile.cc: Likewise.
9519
8ffa3667
DK
95202009-10-28 Doug Kwan <dougkwan@google.com>
9521
9522 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9523 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9524 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9525 New method definitions.
9526
40f36857
CC
95272009-10-28 Cary Coutant <ccoutant@google.com>
9528
9529 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9530 (Plugin::cleanup_done_): New member.
9531 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9532 (Plugin_manager::cleanup_done_): Remove.
9533 (Plugin_manager::add_input_file): Edit error message.
9534 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9535 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9536
2c849493
ILT
95372009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9538
9539 * fileread.cc: (File_read::View::~View): Use the new
9540 data_ownership_ filed.
9541 (File_read::~File_read): Dispose the new whole_file_view_.
9542 (File_read::open): Mmap the whole file if needed.
9543 (File_read::open): Use whole_file_view_ instead of contents_.
9544 (File_read::find_view): Use whole_file_view_ if applicable.
9545 (File_read::do_read): Use whole_file_view_ instead of contents_.
9546 (File_read::make_view): Use whole_file_view_ instead of contents_,
9547 update File_read::View::View call.
9548 (File_read::find_or_make_view): Update File_read::View::View
9549 call.
9550 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9551 remove contents_
9552 (File_read::View::Data_ownership): New enum.
9553 (File_read::View::View): Replace bool mapped_ with Data_ownership
9554 argument.
9555 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9556 (File_read::View::data_ownership_): New field.
9557 (File_read::contents_): Remove (replaced by whole_file_view_).
9558 (File_read::whole_file_view_): New field.
9559 * options.h (class General_options): Add --keep-files-mapped.
9560
24998053
CC
95612009-10-27 Cary Coutant <ccoutant@google.com>
9562
9563 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9564 * testsuite/Makefile.am (plugin_test_5): New test case.
9565 * testsuite/Makefile.in: Regenerate.
9566
72adc4fa
DK
95672009-10-25 Doug Kwan <dougkwan@google.com>
9568
9569 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9570 from private to protected to allow access by child class.
9571 (Sized_relobj::do_relocate_sections): New method declaration.
9572 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9573 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9574 Sized_relobj::relocate_sections. Instantiate template explicitly
9575 for different target sizes and endianity.
9576
07f508a2
DK
95772009-10-24 Doug Kwan <dougkwan@google.com>
9578
9579 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9580 (Arm_input_section::as_arm_input_section): New method.
9581 (Arm_output_section): New class definition.
9582 (Arm_output_section::create_stub_group,
9583 Arm_output_section::group_sections): New method definitions.
9584
10ad9fe5
DK
95852009-10-22 Doug Kwan <dougkwan@google.com>
9586
9587 * arm.cc (Arm_input_section): New class definition.
9588 (Arm_input_section::init, Arm_input_section:do_write,
9589 Arm_input_section::set_final_data_size,
9590 Arm_input_section::do_reset_address_and_file_offset): New method
9591 definitions.
9592
56ee5e00
DK
95932009-10-21 Doug Kwan <dougkwan@google.com>
9594
9595 * arm.cc (Stub_table, Arm_input_section): New forward class
9596 declarations.
9597 (Stub_table): New class defintion.
9598 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9599 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9600 New method definition.
9601
b569affa
DK
96022009-10-21 Doug Kwan <dougkwan@google.com>
9603
9604 * arm.cc: Update copyright comments.
9605 (Target_arm): New forward class template declaration.
9606 (Arm_address): New type.
9607 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9608 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9609 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9610 constants.
9611 (Insn_template): Same.
9612 (DEF_STUBS): New macro.
9613 (Stub_type): New enum type.
9614 (Stub_template): New class definition.
9615 (Stub): Same.
9616 (Reloc_stub): Same.
9617 (Stub_factory): Same.
9618 (Target_arm::Target_arm): Initialize may_use_blx_ and
9619 should_force_pic_veneer_.
9620 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9621 Target_arm::should_force_pic_veneer,
9622 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9623 Target_arm::using_thumb_only, Target_arm:;default_target): New
9624 method defintions.
9625 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9626 New data member declarations.
9627 (Insn_template::size, Insn_template::alignment): New method defintions.
9628 (Stub_template::Stub_template): New method definition.
9629 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9630 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9631 (Stub_factory::Stub_factory): New method definition.
9632 * gold.h (string_hash): New template.
9633 * output.h (Input_section_specifier::hash_value): Use
9634 gold::string_hash.
9635 (Input_section_specifier::string_hash): Remove.
9636 * stringpool.cc (Stringpool_template::string_hash): Use
9637 gold::string_hash.
9638
6c172549
DK
96392009-10-20 Doug Kwan <dougkwan@google.com>
9640
9641 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9642 symbols of relaxed input sections.
9643 * output.h (Output_section::find_relaxed_input_section): Make
9644 method public.
9645
c5617f2f
DK
96462009-10-16 Doug Kwan <dougkwan@google.com>
9647
9648 * dynobj.cc (Versions::Versions): Initialize version_script_.
9649 Only insert base version symbol definition for a shared object
9650 if version script defines any version versions.
9651 (Versions::define_base_version): New method definition.
9652 (Versions::add_def): Check that base version is not needed.
9653 (Versions::add_need): Define base version lazily.
9654 * dynobj.h (Versions::define_base_version): New method declaration.
9655 (Versions::needs_base_version_): New data member declaration.
9656 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9657 (check_DATA): Add no_version_test.stdout.
9658 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9659 New make rules.
9660 * testsuite/Makefile.in: Regenerate.
9661 * testsuite/no_version_test.c: New file.
9662 * testsuite/no_version_test.sh: Ditto.
9663
3c12dcdb
DK
96642009-10-16 Doug Kwan <dougkwan@google.com>
9665
9666 * expression.cc (class Segment_start_expression): New class definition.
9667 (Segment_start_expression::value): New method definition.
9668 (script_exp_function_segment_start): Return a new
9669 Segment_start_expression.
9670 * gold/script-c.h (script_saw_segment_start_expression): New function
9671 prototype.
9672 * script-sections.cc (Script_sections::Script_sections): Initialize
9673 SAW_SEGMENT_START_EXPRESSION_ to false.
9674 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9675 and -Tbbs options to specify section addresses if given in
9676 command line and no SEGMENT_START expression is seen in a script.
9677 * script-sections.h (Script_sections::saw_segment_start_expression,
9678 Script_sections::set_saw_segment_start_expression): New method
9679 definition.
9680 (Script_sections::saw_segment_start_expression_): New data member
9681 declaration.
9682 * script.cc (script_saw_segment_start_expression): New function.
9683 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9684 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9685 script_test_7.sh and script_test_8.sh.
9686 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9687 script_test_8.stdout.
9688 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9689 (script_test_6, script_test_6.stdout, script_test_7,
9690 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9691 * Makefile.in: Regenerate.
9692 * testsuite/script_test_6.sh: New file.
9693 * testsuite/script_test_6.t: Same.
9694 * testsuite/script_test_7.sh: Same.
9695 * testsuite/script_test_7.t: Same.
9696 * testsuite/script_test_8.sh: Same.
9697
64b1ae37
DK
96982009-10-16 Doug Kwan <dougkwan@google.com>
9699
9700 * output.cc (Output_segment::set_section_list_address): Cast
9701 expressions to unsigned long long type to avoid format warnings.
9702
661be1e2
ILT
97032009-10-15 Ian Lance Taylor <iant@google.com>
9704
12edd763 9705 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9706 dot assignment to script_sections_.
12edd763
ILT
9707 * script-sections.cc (Script_sections::add_dot_assignment):
9708 Initialize if necessary.
9709
68b6574b
ILT
9710 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9711 program headers with no load segment if there is a linker script.
9712
661be1e2
ILT
9713 * layout.cc (Layout::set_segment_offsets): Align the file offset
9714 to the segment aligment for -N or -n with no load segment.
9715 * output.cc (Output_segment::add_output_section): Don't crash if
9716 the first section is a TLS section.
9717 (Output_segment::set_section_list_addresses): Print an error
9718 message if the address moves backward in a linker script.
9719 * script-sections.cc
9720 (Output_section_element_input::set_section_addresses): Don't
9721 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9722 (Orphan_output_section::set_section_addresses): Likewise.
9723
f15f61a7
DK
97242009-10-15 Doug Kwan <dougkwan@google.com>
9725
9726 * layout.cc (Layout::finish_dynamic_section): Generate tags
9727 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9728 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9729 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9730
82bb573a
ILT
97312009-10-14 Ian Lance Taylor <iant@google.com>
9732
9733 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9734 fields.
9735 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9736 data_shdr fields of relinfo.
9737 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9738 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9739 R_386_TLS_LDO_32, adjust based on section flags.
9740 (Target_i386::Relocate::fix_up_ldo): Remove.
9741
374ad285
ILT
97422009-10-13 Ian Lance Taylor <iant@google.com>
9743
9744 Add support for -pie.
9745 * options.h (class General_options): Add -pie and
9746 --pic-executable.
9747 (General_options::output_is_position_independent): Test -pie.
9748 (General_options::output_is_executable): Return true if not shared
9749 and not relocatable.
9750 (General_options::output_is_pie): Remove.
9751 * options.cc (General_options::finalize): Reject incompatible uses
9752 of -pie.
9753 * gold.cc (queue_middle_tasks): A -pie link is not static.
9754 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9755 * symtab.cc (Symbol::final_value_is_known): Return false if
9756 output_is_position_independent.
9757 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9758 output_is_position_independent.
9759 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9760 output_is_position_independent.
9761 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9762 output_is_position_independent.
9763 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9764 two_file_pie_test.
9765 (basic_pie_test.o, basic_pie_test): New targets.
9766 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9767 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9768 (two_file_pie_test): New target.
9769 * testsuite/Makefile.in: Rebuild.
9770 * README: Remove note saying that -pie is not supported.
9771
c6585162
ILT
97722009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9773
9774 * options.h (class General_options): Add -init and -fini.
9775 * layout.cc (Layout::finish_dynamic_section): Emit
9776 given init and fini functions.
9777
032ce4e9
ST
97782009-10-13 Sriraman Tallam <tmsriram@google.com>
9779
9780 * gc.h (gc_process_relocs): Check if icf is enabled using new
9781 function.
9782 * gold.cc (queue_initial_tasks): Likewise.
9783 (queue_middle_tasks): Likewise.
9784 * object.cc (do_layout): Likewise.
9785 * symtab.cc (is_section_folded): Likewise.
9786 * main.cc (main): Likewise.
9787 * reloc.cc (Read_relocs::run): Likewise.
9788 (Sized_relobj::do_scan_relocs): Likewise.
9789 * icf.cc (is_function_ctor_or_dtor): New function.
9790 (Icf::find_identical_sections): Check if function is ctor or dtor when
9791 safe icf is chosen.
9792 * options.h (General_options::icf): Change option to be an enum.
9793 (Icf_status): New enum.
9794 (icf_enabled): New method.
9795 (icf_safe_folding): New method.
9796 (set_icf_status): New method.
9797 (icf_status_): New variable.
9798 * (options.cc) (General_options::finalize): Set icf_status_.
9799 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9800 icf_test and icf_keep_unique_test to use the --icf enum flag.
9801 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9802 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9803
f345227a
ST
98042009-10-12 Sriraman Tallam <tmsriram@google.com>
9805
9806 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9807 includes to gc.h and icf.h.
9808 * arm.cc: Include gc.h.
9809 * gold.cc: Likewise.
9810 * i386.cc: Likewise.
9811 * powerpc.cc: Likewise.
9812 * sparc.cc: Likewise.
9813 * x86_64.cc: Likewise.
9814 * gc.h: Include icf.h.
9815
1c7814ed
ILT
98162009-10-11 Ian Lance Taylor <iant@google.com>
9817
9818 * plugin.cc: Include "gold.h" before other header files.
9819
ae3b5189
CD
98202009-10-10 Chris Demetriou <cgd@google.com>
9821
9822 * options.h (Input_file_argument::Input_file_type): New enum.
9823 (Input_file_argument::is_lib_): Replace with...
9824 (Input_file_argument::type_): New member.
9825 (Input_file_argument::Input_file_argument): Take Input_file_type
9826 'type' rather than boolean 'is_lib' as second argument.
9827 (Input_file_argument::is_lib): Use type_.
9828 (Input_file_argument::is_searched_file): New function.
9829 (Input_file_argument::may_need_search): Handle is_searched_file.
9830 * options.cc (General_options::parse_library): Support -l:filename.
9831 (General_options::parse_just_symbols): Update for Input_file_argument
9832 changes.
9833 (Command_line::process): Likewise.
9834 * archive.cc (Archive::get_file_and_offset): Likewise.
9835 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9836 * script.cc (read_script_file, script_add_file): Likewise.
9837 * fileread.cc (Input_file::Input_file): Likewise.
9838 (Input_file::will_search_for): Handle is_searched_file.
9839 (Input_file::open): Likewise.
9840 * readsyms.cc (Read_symbols::get_name): Likewise.
9841 * testsuite/Makefile.am (searched_file_test): New test.
9842 * testsuite/Makefile.in: Regenerate.
9843 * testsuite/searched_file_test.cc: New file.
9844 * testsuite/searched_file_test_lib.cc: New file.
9845
f3048a1d
ILT
98462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9847 Ian Lance Taylor <iant@google.com>
9848
9849 * descriptor.cc: Include <cstdio> and "binary-io.h".
9850 (Descriptors::open): Open the files in binary mode always.
9851 * script.cc (Lex::get_token): Treat \r as whitespace.
9852
d4780e57
ILT
98532009-10-09 Ian Lance Taylor <iant@google.com>
9854
9855 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9856
d9a893b8
ILT
98572009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9858 Ian Lance Taylor <iant@google.com>
9859
9860 * configure.ac: Check for readv function also.
9861 * fileread.cc (readv): Define if not HAVE_READV.
9862 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9863 does not exist.
9864 * config.in: Regenerate.
9865 * configure: Regenerate.
9866
c0a62865
DK
98672009-10-09 Doug Kwan <dougkwan@google.com>
9868
9869 * layout.cc (Layout::make_output_section): Call target hook to make
9870 ordinary output section.
9871 (Layout::finalize): Adjust parameter list of call the
9872 Target::may_relax().
9873 * layout.h (class Layout::section_list): New method.
9874 * merge.h (Output_merge_base::entsize): Change visibility to public.
9875 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9876 New methods.
9877 (Output_merge_string::do_is_string): New method.
9878 * object.cc (Sized_relobj::do_setup): renamed from
9879 Sized_relobj::set_up.
9880 * object.h (Sized_relobj::adjust_shndx,
9881 Sized_relobj::initializ_input_to_output_maps,
9882 Sized_relobj::free_input_to_output_maps): Change visibilities to
9883 protected.
9884 (Sized_relobj::setup): Virtualize.
9885 (Sized_relobj::do_setup): New method declaration.
9886 (Sized_relobj::invalidate_section_offset,
9887 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9888 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9889 * options.cc (parse_int): New function.
9890 * options.h (parse_int): New declaration.
9891 (DEFINE_int): New macro.
9892 (stub_group_size): New option.
9893 * output.cc (Output_section::Output_section): Initialize memebers
9894 merge_section_map_, merge_section_by_properties_map_,
9895 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9896 (Output_section::add_input_section): Handled deferred code-fill
9897 generation and remove an old comment.
9898 (Output_section::add_relaxed_input_section): New method definition.
9899 (Output_section::add_merge_input_section): Use merge section by
9900 properties map to speed to search. Update merge section maps
9901 as appropriate.
9902 (Output_section::build_relaxation_map): New method definition.
9903 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9904 Same.
9905 (Output_section::relax_input_section): Renamed to
9906 Output_section::convert_input_sections_to_relaxed_sections and change
9907 interface to take a vector of pointers to relaxed sections.
9908 (Output_section::find_merge_section,
9909 Output_section::find_relaxed_input_section): New method definitions.
9910 (Output_section::is_input_address_mapped,
9911 Output_section::output_offset, Output_section::output_address):
9912 Use output section data maps to speed up searching.
9913 (Output_section::find_starting_output_address): Add comments.
9914 (Output_section::do_write,
9915 Output_section::write_to_postprocessing_buffer): Do code-fill
9916 generation as appropriate.
9917 (Output_section::get_input_sections): Invalidate relaxed input section
9918 map.
9919 (Output_section::restore_states): Adjust type of checkpoint .
9920 Invalidate relaxed input section map.
9921 * output.h (Output_merge_base): New class declaration.
9922 (Input_section_specifier): New class defintion.
9923 (class Output_relaxed_input_section) Change base class to
9924 Output_section_data_build.
9925 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9926 base class initializer.
9927 (Output_section::add_relaxed_input_section): New method declaration.
9928 (Output_section::Input_section): Change visibility to protected.
2e702c99 9929 (Output_section::Input_section::relobj,
c0a62865
DK
9930 Output_section::Input_section::shndx): Handle relaxed input sections.
9931 Output_section::input_sections) Change visibility to protected. Also
9932 define overload to return a non-const pointer.
9933 (Output_section::Merge_section_properties): New class defintion.
9934 (Output_section::Merge_section_by_properties_map,
9935 Output_section::Output_section_data_by_input_section_map,
9936 Output_section::Relaxation_map): New types.
9937 (Output_section::relax_input_section): Rename method to
9938 Output_section::convert_input_sections_to_relaxed_sections and change
9939 interface to take a vector of relaxed section pointers.
9940 (Output_section::find_merge_section,
9941 Output_section::find_relaxed_input_section,
9942 Output_section::build_relaxation_map,
9943 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9944 New method declarations.
9945 (Output_section::merge_section_map_
9946 Output_section::merge_section_by_properties_map_,
9947 Output_section::relaxed_input_section_map_,
9948 Output_section::is_relaxed_input_section_map_valid_,
9949 Output_section::generate_code_fills_at_write_): New data members.
9950 * script-sections.cc
9951 (Output_section_element_input::set_section_addresses): Call
9952 current_data_size and addralign methods of relaxed input sections.
9953 (Orphan_output_section::set_section_addresses): Call current_data_size
9954 and addralign methods of relaxed input sections.
9955 * symtab.cc (Symbol_table::compute_final_value): Extract template
9956 from the body of Symbol_table::sized_finalize_symbol.
9957 (Symbol_table::sized_finalized_symbol): Call
9958 Symbol_table::compute_final_value.
9959 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9960 (Symbol_table::compute_final_value): New templated method declaration.
9961 * target.cc (Target::do_make_output_section): New method defintion.
9962 * target.h (Target::make_output_section): New method declaration.
9963 (Target::relax): Add more parameters for input objects, symbol table
9964 and layout. Adjust call to do_relax.
9965 (Target::do_make_output_section): New method declaration.
9966 (Target::do_relax): Add parameters for input objects, symbol table
9967 and layout.
9968
d446d6c4
ILT
99692009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9970
9971 * pread.c: Include stdio.h.
9972
bc06c745
ILT
99732009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9974
9975 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9976 defined.
9977
75aea3d0
ILT
99782009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9979
9980 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9981 Change read_shndx type to unsigned int.
9982 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9983 int.
9984 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9985 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9986 Change read_shndx type to unsigned int.
9987 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9988 int.
9989 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9990 * layout.cc (Layout::create_symtab_sections): Cast the result of
9991 local_symcount * symsize to off_t in the gold_assert.
9992
be8fcb75
ILT
99932009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9994
9995 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9996 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9997 R_ARM_BASE_ABS.
9998 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9999 (Arm_relocate_functions::thm_abs5): New function.
10000 (Arm_relocate_functions::abs12): New function.
10001 (Arm_relocate_functions::abs16): New function.
10002 (Arm_relocate_functions::base_abs): New function.
10003 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10004 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10005 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10006 R_ARM_BASE_ABS.
10007 (Scan::global): Likewise.
10008 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10009 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10010 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10011 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10012 R_ARM_BASE_ABS.
10013
c2a122b6
ILT
100142009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10015
10016 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10017 (Arm_relocate_functions::movt_prel): New function.
10018 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10019 (Arm_relocate_functions::thm_movt_prel): New function.
10020 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10021 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10022 (Scan::global, Relocate::relocate): Likewise.
10023 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10024
c4aa1e2d
ILT
100252009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10026
10027 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10028 Incremental_checker.
10029 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10030 unsigned int.
10031 (class Incremental_inputs_header): New class.
10032 (Incremental_inputs_header_writer): Edit comment.
10033 (Incremental_inputs_entry): New class.
10034 (Incremental_inputs_entry_writer): Edit comment.
10035 (Sized_incremental_binary::do_find_incremental_inputs_section):
10036 Add *strtab_shndx parameter, fill it.
10037 (Sized_incremental_binary::do_check_inputs): New method.
10038 (Incremental_checker::can_incrementally_link_output_file): Use
10039 Sized_incremental_binary::check_inputs.
10040 (Incremental_inputs::report_command_line): Save command line in
10041 command_line_.
10042 * incremental.h:
10043 (Incremental_binary::find_incremental_inputs_section): New
10044 method.
10045 (Incremental_binary::do_find_incremental_inputs_section): Add
10046 strtab_shndx parameter.
10047 (Incremental_binary::do_check_inputs): New pure virtual method.
10048 (Sized_incremental_binary::do_check_inputs): Declare.
10049 (Incremental_checker::Incremental_checker): Add incremental_inputs
10050 parameter, use it to initialize incremental_inputs_.
10051 (Incremental_checker::incremental_inputs_): New field.
10052 (Incremental_checker::command_line): New method.
10053 (Incremental_checker::inputs): New method.
10054 (Incremental_checker::command_line_): New field.
10055
c549a694
ILT
100562009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10057
10058 * incremental.cc: Include <cstdarg> and "target-select.h".
10059 (vexplain_no_incremental): New function.
10060 (explain_no_incremental): New function.
10061 (Incremental_binary::error): New method.
10062 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10063 method.
10064 (make_sized_incremental_binary): New function.
10065 (open_incremental_binary): New function.
10066 (can_incrementally_link_file): Add checks if output is ELF and has
10067 inputs section.
10068 * incremental.h: Include "elfcpp_file.h" and "output.h".
10069 (Incremental_binary): New class.
10070 (Sized_incremental_binary): New class.
10071 (open_incremental_binary): Declare.
10072 * object.cc (is_elf_object): Use
10073 elfcpp::Elf_recognizer::is_elf_file.
10074 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10075 * output.h (Output_file::filesize): New method.
10076
fd3c5f0b
ILT
100772009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10078
10079 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10080 New function.
10081 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10082 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10083 function.
10084 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10085 function.
10086 (Arm_relocate_functions::movw_abs_nc): New function.
10087 (Arm_relocate_functions::movt_abs): New function.
10088 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10089 (Arm_relocate_functions::thm_movt_abs): New function.
10090 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10091 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10092 (Scan::global): Likewise.
10093 (Relocate::relocate): Likewise.
10094 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10095
7f5309a5
ILT
100962009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10097
10098 * arm.cc (Arm_relocate_functions::got_prel) New function.
10099 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10100 (Relocate::relocate): Likewise.
10101 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10102
364c7fa5
ILT
101032009-10-06 Ian Lance Taylor <iant@google.com>
10104
10105 * options.h (class General_options): Define
10106 split_stack_adjust_size parameter.
10107 * object.h (class Object): Add uses_split_stack_ and
10108 has_no_split_stack_ fields. Add uses_split_stack and
10109 has_no_split_stack accessor functions. Declare
10110 handle_split_stack_section.
10111 (class Reloc_symbol_changes): Define.
10112 (class Sized_relobj): Define Function_offsets. Declare
10113 split_stack_adjust, split_stack_adjust_reltype, and
10114 find_functions.
10115 * object.cc (Object::handle_split_stack_section): New function.
10116 (Sized_relobj::do_layout): Call handle_split_stack_section.
10117 * dynobj.cc (Sized_dynobj::do_layout): Call
10118 handle_split_stack_section.
10119 * reloc.cc (Sized_relobj::relocate_sections): Call
10120 split_stack_adjust for executable sections in split_stack
10121 objects. Pass reloc_map to relocate_section.
10122 (Sized_relobj::split_stack_adjust): New function.
10123 (Sized_relobj::split_stack_adjust_reltype): New function.
10124 (Sized_relobj::find_functions): New function.
10125 * target-reloc.h: Include "object.h".
10126 (relocate_section): Add reloc_symbol_changes parameter. Change
10127 all callers.
10128 * target.h (class Target): Add calls_non_split method. Declare
10129 do_calls_non_split virtual method. Declare match_view and
10130 set_view_to_nop.
10131 * target.cc: Include "elfcpp.h".
10132 (Target::do_calls_non_split): New function.
10133 (Target::match_view): New function.
10134 (Target::set_view_to_nop): New function.
10135 * gold.cc (queue_middle_tasks): Give an error if mixing
10136 split-stack and non-split-stack objects with -r.
10137 * i386.cc (Target_i386::relocate_section): Add
10138 reloc_symbol_changes parameter.
10139 (Target_i386::do_calls_non_split): New function.
10140 * x86_64.cc (Target_x86_64::relocate_section): Add
10141 reloc_symbol_changes parameter.
10142 (Target_x86_64::do_calls_non_split): New function.
10143 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10144 parameter.
10145 * powerpc.cc (Target_powerpc::relocate_section): Add
10146 reloc_symbol_changes parameter.
10147 * sparc.cc (Target_sparc::relocate_section): Add
10148 reloc_symbol_changes parameter.
10149 * configure.ac: Call AM_CONDITIONAL for the default target.
10150 * configure: Rebuild.
10151 * testsuite/Makefile.am (TEST_AS): New variable.
10152 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10153 (check_DATA): Add split_i386 and split_x86_64 files.
10154 (SPLIT_DEFSYMS): Define.
10155 (split_i386_[1234n].o): New targets.
10156 (split_i386_[124]): New targets.
10157 (split_i386_[1234r].stdout): New targets.
10158 (split_x86_64_[1234n].o): New targets.
10159 (split_x86_64_[124]): New targets.
10160 (split_x86_64_[1234r].stdout): New targets.
10161 (MOSTLYCLEANFILES): Add new executables.
10162 * testsuite/split_i386.sh: New file.
10163 * testsuite/split_x86_64.sh: New file.
10164 * testsuite/split_i386_1.s: New file.
10165 * testsuite/split_i386_2.s: New file.
10166 * testsuite/split_i386_3.s: New file.
10167 * testsuite/split_i386_4.s: New file.
10168 * testsuite/split_i386_n.s: New file.
10169 * testsuite/split_x86_64_1.s: New file.
10170 * testsuite/split_x86_64_2.s: New file.
10171 * testsuite/split_x86_64_3.s: New file.
10172 * testsuite/split_x86_64_4.s: New file.
10173 * testsuite/split_x86_64_n.s: New file.
10174 * testsuite/testfile.cc (Target_test): Update relocation_section
10175 function.
10176 * testsuite/Makefile.in: Rebuild.
10177
e8a9fcda
ILT
101782009-10-06 Ian Lance Taylor <iant@google.com>
10179
10180 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10181 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10182 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10183 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10184 the address on ldo_addrs_.
10185 (Target_i386::Relocate::fix_up_ldo): New function.
10186
e99daf92
ILT
101872009-10-06 Rafael Espindola <espindola@google.com>
10188
10189 * plugin.cc (add_input_library): New.
10190 (Plugin::load): Add add_input_library to tv.
10191 (Plugin_manager::add_input_file): Add the is_lib argument.
10192 (add_input_file): Update call to Plugin_manager::add_input_file.
10193 (add_input_library): New.
10194 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10195
966d4097
DK
101962009-09-30 Doug Kwan <dougkwan@google.com>
10197
10198 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10199 symbol and call Symbol::may_need_copy_reloc to determine if
10200 a copy reloc is needed.
10201 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10202 nocopyreloc is given in command line.
10203 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10204 given in command line.
10205 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10206 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10207 of the removed Target_i386::may_need_copy_reloc.
10208 * options.h (copyreloc): New option with default value false.
10209 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10210 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10211 instead of the removed Target_powerpc::may_need_copy_reloc.
10212 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10213 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10214 instead of the removed Target_sparc::may_need_copy_reloc.
10215 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10216 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10217 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10218 instead of the removed Target_x86_64::may_need_copy_reloc.
10219
029ba973
ILT
102202009-09-30 Ian Lance Taylor <iant@google.com>
10221
10222 * object.h (class Object): Remove target_ field, and target,
10223 sized_target, and set_target methods.
10224 (Object::sized_target): Remove.
10225 (class Sized_relobj): Update declarations. Remove sized_target.
10226 * object.cc (Sized_relobj::setup): Remove target parameter.
10227 Change all callers.
10228 (Input_objects::add_object): Don't do anything with the target.
10229 (make_elf_sized_object): Add punconfigured parameter. Change all
10230 callers. Set or test parameter target.
10231 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10232 Change all callers.
10233 * parameters.cc (Parameters::set_target): Change parameter type to
10234 be non-const.
10235 (Parameters::default_target): Remove.
10236 (set_parameters_target): Change parameter type to be non-const.
10237 (parameters_force_valid_target): New function.
10238 (parameters_clear_target): New function.
10239 * parameters.h (class Parameters): Update declarations. Remove
10240 default_target method. Add sized_target and clear_target
10241 methods. Change target_ to be non-const.
10242 (set_parameters_target): Update declaration.
10243 (parameters_force_valid_target): Declare.
10244 (parameters_clear_target): Declare.
10245 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10246 as NULL if we aren't searching.
10247 (Add_symbols::run): Don't check for compatible target.
10248 * fileread.cc (Input_file::open_binary): Call
10249 parameters_force_valid_target.
10250 * gold.cc (queue_middle_tasks): Likewise.
10251 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10252 set_target on object.
10253 * dynobj.h (class Sized_dynobj): Update declarations.
10254 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10255 make_elf_object returns NULL.
10256 (Archive::include_member): Don't check whether object target is
10257 compatible.
10258 * output.cc (Output_section::add_input_section): Get target from
10259 parameters.
10260 (Output_section::relax_input_section): Likewise.
10261 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10262 parameters.
10263 (Sized_relobj::do_scan_relocs): Likewise.
10264 (Sized_relobj::relocate_sections): Likewise.
10265 * resolve.cc (Symbol_table::resolve): Likewise.
10266 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10267 parameter. Change all callers.
10268 (Symbol_table::add_from_object): Get target from parameters.
10269 (Symbol_table::add_from_relobj): Don't check object target.
10270 (Symbol_table::add_from_dynobj): Likewise.
10271 (Symbol_table::define_special_symbol): Get target from
10272 parameters.
10273 * symtab.h (class Symbol_table): Update declaration.
10274 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10275 parameter. Change all callers. Clear parameter target.
10276 (Binary_test): Test target here.
10277 * testsuite/object_unittest.cc (gold_testsuite): Remove
10278 target_test_pointer parameter. Change all callers.
10279 (Object_test): Test target here.
10280
a6a22b83
ILT
102812009-09-26 Ian Lance Taylor <iant@google.com>
10282
10283 * testsuite/initpri1.c: Don't try to use constructor priorities if
10284 compiling with gcc before 4.3.
10285
6a8f49fe
ILT
102862009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10287
10288 * testsuite/retain_symbols_file_test.sh (check_present): Change
10289 output file name to retain_symbols_file_test.stdout.
10290 (check_absent): Likewise.
10291
8c604651
CS
102922009-09-18 Craig Silverstein <csilvers@google.com>
10293
10294 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10295 * options.cc: Include <cerrno> and <fstream>.
10296 (General_options::finalize): Parse -retain-symbols-file tag.
10297 * options.h: New flag.
10298 (General_options): New method should_retain_symbol, new
10299 variable symbols_to_retain.
10300 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10301 should_retain_symbol map.
10302 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10303 * testsuite/Makefile.in: Regenerate.
10304 * testsuite/retain_symbols_file_test.sh: New file.
10305
ca58b19f
NC
103062009-09-18 Nick Clifton <nickc@redhat.com>
10307
10308 * po/es.po: Updated Spanish translation.
10309
20e6d0d6
DK
103102009-09-17 Doug Kwan <dougkwan@google.com>
10311
10312 * debug.h (DEBUG_RELAXATION): New constant.
10313 (DEBUG_ALL): Add DEBUG_RELAXATION.
10314 (debug_string_to_enum): Add relaxation debug option.
10315 * layout.cc
10316 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10317 Layout::Relaxation_debug_check::read_sections,
10318 Layout::Relaxation_debug_check::read_sections): New method definitions.
10319 (Layout::Layout): Initialize data members
10320 record_output_section_data_from_scrips_,
10321 script_output_section_data_list_ and relaxation_debug_check_.
10322 (Layout::save_segments, Layout::restore_segments,
10323 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10324 Layout::relaxation_loop_body): New method definitions.
10325 (Layout::finalize): Support relaxation. Move section layout code to
10326 Layout::relaxation_loop_body.
10327 (Layout::set_asection_address_from_script): Move code for orphan
10328 section placement out.
10329 (Layout::place_orphan_sections_in_script): New method definition.
10330 * layout.h (Output_segment_headers, Output_file_header):
10331 New forward class declarations.
10332 (Layout::~Layout): Define.
10333 (Layout::new_output_section_data_from_script): New method definition.
10334 (Layout::place_orphan_sections_in_script): New method declaration.
10335 (Layout::Segment_states): New type declaration.
10336 (Layout::save_segments, Layout::restore_segments,
10337 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10338 Layout::relaxation_loop_body): New method declarations.
10339 (Layout::Output_section_data_list): New type declaration.
10340 (Layout::Relaxation_debug_check): New class definition.
10341 (Layout::record_output_section_data_from_script_,
10342 Layout::script_output_section_data_list_, Layout::segment_states_,
10343 Layout::relaxation_debug_check_): New data members.
10344 * output.cc: (Output_section_headers::do_size): New method definition.
10345 (Output_section_headers::Output_section_headers): Move size
10346 computation to Output_section_headers::do_size.
10347 (Output_segment_headers::do_size): New method definition.
e1df38aa 10348 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10349 Output_file_header::do_size and call it.
10350 (Output_file_header::do_size): New method definition.
10351 (Output_data_group::Output_data_group): Adjust call to
10352 Output_section_data.
10353 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10354 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10355 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10356 RELAXED_INPUT_SECTION_CODE.
10357 (Output_section::Output_section): Initialize data member checkpoint_.
10358 (Output_section::~Output_section): Delete checkpoint object pointed
10359 by checkpoint_.
10360 (Output_section::add_input_section): Always add an Input_section if
10361 relaxing.
10362 (Output_section::add_merge_input_section): Add assert.
10363 (Output_section::relax_input_section): New method definition.
10364 (Output_section::set_final_data_size): Set load address to zero for
10365 an unallocated section.
10366 (Output_section::do_address_and_file_offset_have_reset_values):
10367 New method definition.
10368 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10369 Handle relaxed input section.
10370 (Output_section::sort_attached_input_sections): Checkpoint input
10371 section list lazily.
10372 (Output_section::get_input_sections): Change type of input_sections to
10373 list of Simple_input_section pointers. Checkpoint input section list
10374 lazily. Also handle relaxed input sections.
10375 (Output_section::add_input_section_for_script): Take a reference to
10376 a Simple_input_section object instead of Relobj pointer and section
10377 index as parameter. Handle relaxed input sections.
10378 (Output_section::save_states, Output_section::restore_states): New
10379 method definitions.
10380 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10381 (Output_data::is_data_size_fixed): New method definition.
10382 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10383 if it is fixed.
10384 (Output_data::address_and_file_offset_have_reset_values): New method
10385 definition.
10386 (Output_data::do_address_and_file_offset_have_reset_values): New method
10387 definition.
10388 (Output_data::set_data_size): Check that data size is not fixed.
10389 (Output_data::fix_data_size): New method definition.
10390 (Output_data::is_data_size_fixed_): New data member.
10391 (Output_section_headers::set_final_data_size): New method definition.
10392 (Output_section_headers::do_size): New method declaration.
10393 (Output_segment_headers::set_final_data_size): New method definition.
10394 (Output_segment_headers::do_size): New method declaration.
10395 (Output_file_header::set_final_data_size)::New method definition.
10396 (Output_file_header::do_size)::New method declaration.
10397 (Output_section_data::Output_section_data): Add new parameter
10398 is_data_size_fixed and use it to fix data size.
10399 (Output_data_const::Output_data_const): Adjust call to base class
10400 constructor and fix data size.
10401 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10402 base class constructor and fix data size.
10403 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10404 base class constructor and fix data size.
10405 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10406 class constructor and fix data size.
10407 (Output_data_group::set_final_data_size): New method definition.
10408 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10409 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10410 class constructor and fix data size.
10411 (Output_relaxed_input_section): New class definition.
10412 (Output_section::Simple_input_section): New class definition.
10413 (Output_section::get_input_sections): Adjust parameter list.
10414 (Output_section::add_input_section_for_script): Same.
10415 (Output_section::save_states, Output_section::restore_states,
10416 Output_section::do_address_and_file_offset_have_reset_values,
10417 (Output_section::Input_section::Input_section): Handle
10418 RELAXED_INPUT_SECTION_CODE. Add new overload for
10419 Output_relaxed_input_section.
10420 (Output_section::Input_section::is_input_section,
10421 Output_section::Input_section::set_output_section): Handle relaxed
10422 input section.
10423 (Output_section::Input_section::is_relaxed_input_section,
10424 Output_section::Input_section::output_section_data,
10425 Output_section::Input_section::relaxed_input_section): New method
10426 definitions.
10427 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10428 value.
10429 (Output_section::Input_section::u1_): Update comments.
10430 (Output_section::Input_section::u2_): Add new union member poris.
10431 (Output_section::Checkpoint_output_section): New classs definition.
10432 (Output_section::relax_input_section): New method declaration.
10433 (Output_section::checkpoint_): New data member.
10434 (Output_segment): Update comments.
10435 (Output_segment::Output_segment): Un-privatize copy constructor.
10436 (Output_segment::operator=): Un-privatize.
10437 * script-sections.cc (Output_section_element::Input_section_list):
10438 Change element type to Output_section::Simple_input_section.
10439 (Output_section_element_dot_assignment::set_section_addresses):
10440 Register output section data for relaxation clean up.
10441 (Output_data_exression::Output_data_expression): Adjust call to base
10442 constructor to fix data size.
10443 (Output_section_element_data::set_section_addresses): Register
10444 Output_data_expression object for relaxation clean up.
10445 (struct Input_section_info): Replace Relobj pointer and section index
10446 pair with Output_section::Simple_input_section and Convert struct to a
10447 class.
10448 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10449 Input_section_info data member to use accessors.
20e6d0d6
DK
10450 (Output_section_element_input::set_section_addresses): Use layout
10451 parameter. Adjust code to use Output_section::Simple_input_section
10452 and Input_secction_info classes. Register filler for relaxation
10453 clean up.
10454 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10455 and section index pair with Output_section::Simple_input_section
10456 class. Adjust code accordingly.
10457 (Phdrs_element::release_segment): New method definition.
10458 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10459 segment list.
10460 (Script_sections::release_segments): New method definition.
10461 * gold/script-sections.h (Script_sections::release_segments): New
10462 method declaration.
10463 * gold/target.h (Target::may_relax, Target::relax,
10464 Target::do_may_relax, Target::do_relax): New method definitions.
10465
5e445df6
ILT
104662009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10467
10468 * arm.cc (has_signed_unsigned_overflow): New function.
10469 (Arm_relocate_functions::abs8): New function.
10470 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10471 (Target_arm::Scan::global): Likewise.
10472 (Target_arm::relocate::relocate): Likewise.
10473 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10474 Likewise.
10475
8c604651 104762009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10477
10478 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10479 * testsuite/Makefile.in: Regenerate.
10480
1e9cc1c2
NC
104812009-09-11 Nick Clifton <nickc@redhat.com>
10482
10483 * po/gold.pot: Updated by the Translation project.
10484
6a89f575
CC
104852009-09-08 Cary Coutant <ccoutant@google.com>
10486
10487 * output.cc (Output_file::open): Add execute permission to empty file.
10488 * testsuite/Makefile.am (permission_test): New test.
10489 * testsuite/Makefile.in: Regenerate.
10490
fdcac5af
ILT
104912009-09-02 Ian Lance Taylor <iant@google.com>
10492
10493 * output.cc (Output_file::resize): Call map_no_anonymous rather
10494 than map.
10495
44453f85
ILT
104962009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10497
10498 * gold.cc: Include "incremental.h".
10499 (queue_initial_tasks): Call Incremental_checker methods.
10500 * incremental.cc: Include "output.h".
10501 (Incremental_checker::can_incrementally_link_output_file): New
10502 method.
10503 * incremental.h (Incremental_checker): New class.
10504
10505 * output.cc (Output_file::open_for_modification): New method.
10506 (Output_file::map_anonymous): Changed return type to bool. Record
10507 map in base_ field.
10508 (Output_file::map_no_anonymous): New method, broken out of map.
10509 (Output_file::map): Use map_no_anonymous and map_anonymous.
10510 * output.h (class Output_file): Update declarations.
10511
293c1386
CC
105122009-08-24 Cary Coutant <ccoutant@google.com>
10513
10514 * options.h (Command_line::Pre_options): New class.
10515 (Command_line::pre_options): New member.
10516 * options.cc (gold::options::ready_to_register): New variable.
10517 (One_option::register_option): Do nothing if not registering options.
10518 Assert if same short option registered twice.
10519 (General_options::General_options): Turn off option registration when
10520 done constructing.
10521 (Command_line::Pre_options::Pre_options): New constructor.
10522
f773f3d2
CC
105232009-08-24 Cary Coutant <ccoutant@google.com>
10524
06a73cfe
CC
10525 * options.h (General_options::no_keep_memory): Remove incorrect
10526 short option.
f773f3d2 10527
a15af8e2
RW
105282009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10529
10530 * Makefile.am (am__skiplex, am__skipyacc): New.
10531 * Makefile.in: Regenerate.
10532
c462b41b
RW
105332009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10534
14ec8efd
RW
10535 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10536 (INCLUDES): ... this.
10537 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10538 (AM_CPPFLAGS): Renamed from ...
10539 (INCLUDE): ... this.
10540 * Makefile.in, testsuite/Makefile.in: Regenerate.
10541
81ecdfbb
RW
10542 * Makefile.in: Regenerate.
10543 * aclocal.m4: Likewise.
10544 * config.in: Likewise.
10545 * configure: Likewise.
10546 * testsuite/Makefile.in: Likewise.
10547
c462b41b
RW
10548 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10549 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10550 * Makefile.in: Regenerate.
10551 * testsuite/Makefile.in: Regenerate.
10552
2da73f13
CC
105532009-08-19 Cary Coutant <ccoutant@google.com>
10554
10555 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10556 symbols in shared libraries overridden by hidden or internal symbols
10557 in the main program.
10558
2db70501
CD
105592009-08-19 Chris Demetriou <cgd@google.com>
10560
10561 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10562 checking source file names in error messages.
10563
f733487b
DK
105642009-08-18 Doug Kwan <dougkwan@google.com>
10565
10566 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10567 an elcpp::Ehdr as parameter. Adjust call to set_target.
10568 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10569 an elfcpp::Ehdr as parameter.
10570 * object.cc (Object::set_target): Remove the version that looks up
10571 a target and sets it.
10572 (Sized_relobj::setup): Take a Target object instead of
10573 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10574 (make_elf_sized_object): Find target and ask target to
10575 make an ELF object.
10576 * object.h: (Object::set_target): Remove the version that looks up
10577 a target and sets it.
10578 (Sized_relobj::setup): Take a Target object instead of
10579 an elfcpp:Ehdr as parameter.
10580 * target.cc: Include dynobj.h.
10581 (Target::do_make_elf_object_implementation): New.
2e702c99 10582 (Target::do_make_elf_object): New.
f733487b
DK
10583 * target.h (Target::make_elf_object): New template declaration.
10584 (Target::do_make_elf_object): New method declarations.
10585 (Target::do_make_elf_object_implementation): New template declaration.
10586
cc70f101
ILT
105872009-08-14 Ian Lance Taylor <iant@google.com>
10588
10589 * gold.h (FUNCTION_NAME): Define.
10590 (gold_unreachable): Use FUNCTION_NAME.
10591
ef5e0cb1
ST
105922009-08-12 Sriraman Tallam <tmsriram@google.com>
10593
10594 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10595 symbol in the --keep-unique list is not found.
10596
48c187ce
ST
105972009-08-12 Sriraman Tallam <tmsriram@google.com>
10598
10599 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10600 been maked as --keep-unique.
10601 (Icf::unfold_section): New function.
10602 * icf.h (Icf::unfold_section): New function.
10603 * options.h (General_options::keep_unique): New option.
10604 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10605 * testsuite/Makefile.in: Regenerate.
10606 * testsuite/icf_keep_unique_test.sh: New file.
10607 * testsuite/icf_keep_unique_test.cc: New file.
10608
645afe0c
CC
106092009-08-12 Cary Coutant <ccoutant@google.com>
10610
10611 PR 10471
10612 * resolve.cc (Symbol_table::resolve): Check for references from
10613 dynamic objects to hidden and internal symbols.
10614 * testsuite/Makefile.am (hidden_test.sh): New test.
10615 * testsuite/Makefile.in: Regenerate.
10616 * testsuite/hidden_test.sh: New script.
10617 * testsuite/hidden_test_1.c: New test source.
10618 * testsuite/hidden_test_main.c: New test source.
10619
11af873f
DK
106202009-08-11 Doug Kwan <dougkwan@google.com>
10621
10622 * arm.cc: Update comments.
10623 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10624 segment to locate the .ARM.exidx section if present.
10625
b9f7d72d
DK
106262009-08-09 Doug Kwan <dougkwan@google.com>
10627
10628 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10629 patch.
10630
ddd3c53c
ST
106312009-08-07 Sriraman Tallam <tmsriram@google.com>
10632 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10633 compiler warnings.
10634
27721062
ST
106352009-08-06 Sriraman Tallam <tmsriram@google.com>
10636
10637 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10638 valid tls_segment only for non-debug-section relocations.
10639 * testsuite/Makefile.am: Add gc_tls_test.
10640 * testsuite/Makefile.in: Regenerate.
10641 * testsuite/gc_tls_test.cc: New file.
10642 * testsuite/gc_tls_test.sh: New file.
10643
ef15dade 106442009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10645
ef15dade
ST
10646 * icf.cc: New file.
10647 * icf.h: New file.
10648 * Makefile.am (CCFILES): Add icf.cc.
10649 (HFILES): Add icf.h
10650 * Makefile.in: Regenerate.
10651 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10652 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10653 section, symbol and addend information for the relocs.
10654 * gold.cc (queue_middle_tasks): Call identical code folding.
10655 * gold.h: Add defines for multimap.
10656 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10657 to the call of finalize_local_symbols.
10658 * main.cc (main): Create object of class Icf.
10659 * object.cc (Sized_relobj::do_layout): Allow this function to be
10660 called twice during icf.
10661 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10662 to sections marked as identical by icf.
10663 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10664 when available.
10665 (Sized_relobj::do_section_entsize): New function.
10666 * object.h (Object::section_entsize): New function.
10667 (Object::do_section_entsize): New pure virtual function.
10668 (Relobj::finalize_local_symbols): Add new parameter.
10669 (Relobj::do_section_entsize): New function.
10670 * options.h (General_options::icf): New option.
10671 (General_options::icf_iterations): New option.
10672 (General_options::print_icf_sections): New option.
10673 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10674 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10675 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10676 icf.
10677 * symtab.cc (Symbol_table::is_section_folded): New function.
10678 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10679 to sections marked as identical by icf.
10680 * symtab.h (Symbol_table::set_icf): New function.
10681 (Symbol_table::icf): New function.
10682 (Symbol_table::is_section_folded): New function.
10683 (Symbol_table::icf_): New data member.
10684 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10685 * testsuite/Makefile.am: Add commands to build icf_test.
10686 * testsuite/Makefile.in: Regenerate.
10687 * testsuite/icf_test.sh: New file.
10688 * testsuite/icf_test.cc: New file.
10689
c3b65ac4
CD
106902009-07-24 Chris Demetriou <cgd@google.com>
10691
10692 * layout.cc (is_compressible_debug_section): Fix incorrect
10693 comment about compressed section names.
10694
1caf2c51
ILT
106952009-07-20 Ian Lance Taylor <ian@airs.com>
10696
10697 PR 10419
10698 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10699
1ef4d87f
ILT
107002009-07-16 Ian Lance Taylor <iant@google.com>
10701
10702 PR 10400
10703 * layout.h: #include <map>.
10704 (class Kept_section): Change from struct to class. Add accessors
10705 and setters. Add section size to Comdat_group mapping. Change
10706 Comdat_group to std::map. Add is_comdat_ field. Add
10707 linkonce_size field in union.
10708 (class Layout): Update declaration of find_or_add_kept_section.
10709 Don't declare find_kept_object.
10710 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10711 parameter. Add object, shndx, is_comdat, and is_group_name
10712 parameters. Change all callers. Adjust for new Kept_section.
10713 (Layout::find_kept_object): Remove.
10714 * object.cc (Sized_relobj::include_section_group): Update use of
10715 Kept_section. Rename secnum to shndx. Only record
10716 Kept_comdat_section if sections are the same size.
10717 (Sized_relobj::include_linkonce_section): Update use of
10718 Kept_section. Only record Kept_comdat_section if sections are the
10719 same size. Set size of linkonce section.
10720 (Sized_relobj::map_to_kept_section): Update call to
10721 get_kept_comdat_section.
10722 * object.h (class Sized_relobj): Rename fields in
10723 Kept_comdat_section to drop trailing underscores; change object
10724 field to Relobj*. Change Kept_comdat_section_table to store
10725 struct rather than pointer.
10726 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10727 Add kept_object and kept_shndx parameters. Change all callers.
10728 (Sized_relobj::get_kept_comdat_section): Change return type to
10729 bool. Add kept_object and kept_shndx parameters. Change all
10730 callers.
10731 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10732 Layout::find_or_add_kept_section.
10733
37c3b7b0
ILT
107342009-07-09 Ian Lance Taylor <iant@google.com>
10735
10736 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10737 Reserve space in the hash table.
10738
98fa85cb
ILT
107392009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10740
10741 * fileread.cc (File_read::get_mtime): New method.
10742 * fileread.h (Timespec): New structure.
10743 (File_read::get_mtime): New method.
10744 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10745 Renamed from timestamp_nsec.
10746 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10747 Elf_Xword.
e1df38aa 10748 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10749 timestamp_nsec.
e1df38aa 10750 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10751 (Incremental_inputs::report_obejct): Save mtime; style fix.
10752 (Incremental_inputs::report_script): Save mtime; style fix.
10753 (Incremental_inputs::finalize_inputs): Style fix.
10754 (Incremental_inputs::finalize): Style fix.
10755 (Incremental_inputs::create_input_section_data): Store inputs
10756 mtime.
10757 * incremental.h (Incremental_inputs::report_script): Add mtime
10758 argument.
10759 (Incremental_inputs::Input_info::Input_info): Intialize only one
10760 union member.
10761 (Incremental_inputs::Input_info::archive): Move to nameless
10762 union.
10763 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10764 (Incremental_inputs::Input_info::script): Move to nameless union.
10765 (Incremental_inputs::mtime): New field.
10766 * script.cc (read_input_script): Pass file mtime to
10767 Incremental_input.
10768 * script.h (Script_info::inputs): Style fix.
10769
c9d70757
ILT
107702009-07-01 Ian Lance Taylor <ian@airs.com>
10771
10772 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10773 instead of 32.
10774
9c547ec3
ILT
107752009-06-24 Ian Lance Taylor <iant@google.com>
10776
10777 PR 10156
10778 * layout.cc (Layout::choose_output_section): If we find an
10779 existing section, update the flags.
10780 (Layout::create_notes): New function, broken out of
10781 Layout::finalize.
10782 (Layout::finalize): Don't create note sections.
10783 (Layout::create_note): Don't crash if linker script discards
10784 section.
10785 (Layout::create_gold_note): Likewise.
10786 (Layout::create_build_id): Likewise. Don't set
10787 after_input_sections on the section.
10788 (Layout::create_executable_stack_info): Remove target parameter.
10789 Change caller.
10790 * layout.h (class Layout): Declare create_notes. Update
10791 declaration of create_executable_stack_info.
10792 * gold.cc (queue_middle_tasks): Call create_notes.
10793 * output.cc (Output_section::update_flags_for_input_section): Move
10794 here from output.h. If SHF_ALLOC flag is newly set, mark address
10795 invalid.
10796 * output.h (Output_data::mark_address_invalid): New function.
10797 (class Output_section): Only declare, not define,
10798 update_flags_for_input_section. Remove set_flags.
10799
55458500
ILT
108002009-06-24 Ian Lance Taylor <iant@google.com>
10801
10802 * script-sections.cc (Output_section_definition::
10803 set_section_addresses): Rename shadowing local load_address to
10804 laddr.
10805
1307d6cd
ILT
108062009-06-24 Ian Lance Taylor <iant@google.com>
10807
10808 PR 10244
10809 * reloc.cc (relocate_sections): Skip empty relocation sections.
10810
ec3f783e
ILT
108112009-06-23 Ian Lance Taylor <iant@google.com>
10812
10813 PR 10156
10814 * layout.cc (Layout::create_note): Use choose_output_section
10815 rather than make_output_section.
10816
459c9f1c
ILT
108172009-06-23 Ian Lance Taylor <iant@google.com>
10818
10819 PR 10237
10820 * options.cc (General_options::parse_V): Set printed_version_.
10821 (General_options::General_options): Initialize printed_version_.
10822 * options.h (class General_options): Add printed_version_ field.
10823 * gold.cc (queue_initial_tasks): If there are no input files,
10824 don't give a fatal error if we printed the version information.
10825 (queue_middle_tasks): If using -r with a shared object, give a
10826 fatal error rather than an ordinary error.
10827
1518dc8f
ILT
108282009-06-23 Ian Lance Taylor <iant@google.com>
10829
10830 PR 10219
10831 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10832 (Layout::make_output_section): Set have_stabstr_section_ if we see
10833 a .stab*str section.
10834 (Layout::finalize): Call link_stabs_sections.
10835 (Layout::link_stabs_sections): New file.
10836 * layout.h (class Layout): Add have_stabstr_section_ field.
10837 Declare link_stabs_sections.
10838
3d857b98
DK
108392009-06-23 Doug Kwan <dougkwan@google.com>
10840
10841 * Makefile.am (libgold_a_LIBADD): New.
10842 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10843 * Makefile.in: Regenerate.
3d857b98
DK
10844 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10845 * configure: Regenerate.
10846 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10847 * fileread.cc: Include sys/state.h
10848 * gold.h: Declare memmem and strndup if found missing.
10849 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10850
0639a6f6
ILT
108512009-06-23 Ian Lance Taylor <iant@google.com>
10852
10853 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10854 * configure: Rebuild.
10855
8d63875c
ILT
108562009-06-23 Ian Lance Taylor <iant@google.com>
10857
10858 PR 10147
10859 * object.cc (Object::section_contents): Don't try to get a view if
10860 the section has length zero.
10861 (Object::handle_gnu_warning_section): If the section is empty, use
10862 the name of the section as the warning.
10863
f7c8a183
ILT
108642009-06-23 Ian Lance Taylor <iant@google.com>
10865
10866 PR 10133
10867 * stringpool.h (class Stringpool_template): Add optimize_ field.
10868 (Stringpool_template::set_optimize): New function.
10869 * stringpool.cc (Stringpool_template::Stringpool_template):
10870 Initialize optimize_ field.
10871 (Stringpool_template::set_string_offsets): Test local optimize
10872 fild rather than parameter.
10873 * layout.cc (Layout::Layout): Call set_optimize on the section
10874 name stringpool.
10875
e6a307ba
ILT
108762009-06-22 Ian Lance Taylor <iant@google.com>
10877
10878 PR 10030
10879 * yyscript.y: Parse TARGET.
10880 * script.cc (script_set_target): New function.
10881 * script-c.h (script_set_target): Declare.
10882 * options.cc (General_options::string_to_object_format): Rename
10883 from string_to_object_format in anonymous namespace. Change
10884 callers.
10885 * options.h (class General_options): Declare
10886 string_to_object_format.
10887
3ee173de
ILT
108882009-06-22 Ian Lance Taylor <iant@google.com>
10889
10890 * script-sections.cc (Script_sections::create_segments): Don't put
10891 program headers in a PT_LOAD segment if -n or -N.
10892
108932009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10894
10895 PR 10141
10896 * options.h (class General_options): Add -z lazy and -z now. Sort
10897 -z options into alphabetical order.
10898 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10899
cd6739a1 109002009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10901
10902 * layout.cc (Layout::make_output_section): Call
10903 Target::new_output_section.
10904 (Layout::attach_allocated_section_to_segment): Put large section
10905 sections in a separate load segment with the large segment flag
10906 set.
10907 (Layout::segment_precedes): Sort large data segments after other
10908 load segments.
10909 (align_file_offset): New static function.
10910 (Layout::set_segment_offsets): Use align_file_offset.
10911 * output.h (class Output_section): Add is_small_section_ and
10912 is_large_section_ fields.
10913 (Output_section::is_small_section): New function.
10914 (Output_section::set_is_small_section): New function.
10915 (Output_section::is_large_section): New function.
10916 (Output_section::set_is_large_section): New function.
10917 (Output_section::is_large_data_section): New function.
10918 (class Output_segment): Add is_large_data_segment_ field.
10919 (Output_segment::is_large_data_segment): New function.
10920 (Output_segment::set_is_large_data_segment): New function.
10921 * output.cc (Output_section::Output_section): Initialize new
10922 fields.
10923 (Output_segment::Output_segment): Likewise.
10924 (Output_segment::add_output_section): Add assertion that large
10925 data sections always go in large data segments. Force small data
10926 sections to the end of the list of data sections. Force small BSS
10927 sections to the start of the list of BSS sections. For large BSS
10928 sections to the end of the list of BSS sections.
10929 * symtab.h (class Symbol): Declare is_common_shndx.
10930 (Symbol::is_defined): Check Symbol::is_common_shndx.
10931 (Symbol::is_common): Likewise.
10932 (class Symbol_table): Define enum Commons_section_type. Update
10933 declarations. Add small_commons_ and large_commons_ fields.
10934 * symtab.cc (Symbol::is_common_shndx): New function.
10935 (Symbol_table::Symbol_table): Initialize new fields.
10936 (Symbol_table::add_from_object): Put small and large common
10937 symbols in the right list.
10938 (Symbol_table::sized_finalized_symbol): Check
10939 Symbol::is_common_shndx.
10940 (Symbol_table::sized_write_globals): Likewise.
10941 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10942 common symbol lists. Don't call do_allocate_commons_list if the
10943 list is empty.
10944 (Symbol_table::do_allocate_commons_list): Remove is_tls
10945 parameter. Add comons_section_type parameter. Change all
10946 callers. Handle small and large common symbols.
10947 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10948 Symbol::is_common_shndx.
10949 * resolve.cc (symbol_to_bits): Likewise.
10950 * target.h (Target::small_common_shndx): New function.
10951 (Target::small_common_section_flags): New function.
10952 (Target::large_common_shndx): New function.
10953 (Target::large_common_section_flags): New function.
10954 (Target::new_output_section): New function.
10955 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10956 small_common_section_flags, and large_common_section_flags
10957 fields.
10958 (Target::do_new_output_section): New virtual function.
10959 * arm.cc (Target_arm::arm_info): Initialize new fields.
10960 * i386.cc (Target_i386::i386_info): Likewise.
10961 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10962 Likewise.
10963 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10964 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10965 (Target_x86_64::do_new_output_section): New function.
10966 * configure.ac: Define conditional MCMODEL_MEDIUM.
10967 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10968 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10969 (large_LDFLAGS): Define.
10970 * testsuite/large.c: New file.
10971 * testsuite/testfile.cc (Target_test::test_target_info):
10972 Initialize new fields.
10973 * configure, testsuite/Makefile.in: Rebuild.
10974
bb04269c
DK
109752009-06-05 Doug Kwan <dougkwan@google.com>
10976
10977 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10978 * Makefile.in: Regenerate.
bb04269c
DK
10979 * i386.cc (class Target_i386): Define new virtual method to
10980 override do_is_local_label_name in parent.
10981 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10982 local symbols if --discard-locals or -X is given.
10983 * options.h (class General_options): Declare new options
10984 '--discard-locals' and '-X' for discarding locals.
10985 * target.h (class Target): Define new methods is_local_label_name.
10986 Declare new virtual method do_is_local_label_name.
10987 * target.cc: New file.
10988 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10989 (check_SCRIPTS): Add discard_locals_test.sh.
10990 (check_DATA): Add discard_local_tests.syms.
10991 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10992 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10993 * testsuite/Makefile.in: Regenerate.
10994 * testsuite/discard_locals_test.c: New file.
10995 * testsuite/discard_locals_test.sh: Same.
10996
805bb01c
DK
109972009-06-05 Doug Kwan <dougkwan@google.com>
10998
10999 * object.cc (Sized_relobj::Sized_relobj): Initialize
11000 discarded_eh_frame_shndx_ to -1U.
11001 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11002 section.
11003 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11004 a discarded .eh_frame section.
11005 (Sized_relobj::do_finalize_local_symbols): Ditto.
11006 * object.h (class Sized_relobj): Declare new member
11007 discarded_eh_frame_shndx_.
11008 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11009 (local_labels_test.o, local_labels_test): New rules.
11010 * testsuite/Makefile.in: Regenerate.
11011
1dcd334d
DK
110122009-06-04 Doug Kwan <dougkwan@google.com>
11013
11014 * layout.cc (Layout::section_name_mapping): Add mapping for
11015 special ARM sections.
11016
96d49306
DK
110172009-06-03 Doug Kwan <dougkwan@google.com>
11018
11019 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11020 (utils::has_overflow): Same.
11021
dff16297
ILT
110222009-06-03 Ian Lance Taylor <iant@google.com>
11023
11024 * layout.cc (Layout::section_name_mapping): New array, replacing
11025 Layout::linkonce_mapping.
11026 (Layout::section_name_mapping_count): New variable, replacing
11027 Layout::linkonce_mapping_count.
11028 (Layout::linkonce_output_name): Remove.
11029 (Layout::output_section_name): Rewrite.
11030 * layout.h (class Layout): Rename Linkonce_mapping to
11031 Section_name_mapping, linkonce_mapping to section_name_mapping,
11032 linkonce_mapping_count to section_name_mapping_count. Don't
11033 declare linkonce_output_name.
11034
c121c671
DK
110352009-06-03 Doug Kwan <dougkwan@google.com>
11036
11037 * gold/arm.cc (namespace utils): New.
11038 (Target_arm::reloc_is_non_pic): Define new method.
11039 (class Arm_relocate_functions): New.
11040 (Target_arm::Relocate::relocate): Handle relocation types used by
11041 Android.
11042
07800fab
ILT
110432009-06-03 Ian Lance Taylor <iant@google.com>
11044
11045 * arm.cc (Target_arm::scan::global): Use || instead of |.
11046
c121c671
DK
110472009-06-02 Doug Kwan <dougkwan@google.com>
11048
11049 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11050 issued_non_pic_error_.
11051 (class Target_arm::Scan): Declare new method check_non_pic.
11052 Define new method symbol_needs_plt_entry.
11053 Declare new data member issued_non_pic_error_.
11054 (class Target_arm::Relocate): Declare new method
11055 should_apply_static_reloc.
11056 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11057 (Target_arm::Scan::check_non_pic): Define new method.
11058 (Target_arm::Scan::local): Handle a small subset of reloc types used
11059 by Android.
11060 (Target_arm::Scan::local): Same.
11061 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11062
b19b0c6d
ILT
110632009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11064
11065 * incremental.cc (Incremental_inputs::report_command_line): Filter
11066 out --incremental-* options.
11067
94cdfcff
DK
110682009-05-29 Doug Kwan <dougkwan@google.com>
11069
11070 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11071 template class.
11072 (class Target_arm): Update comment.
11073 (Target_arm::Target_arm): Initialize new data members GOT_,
11074 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11075 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11076 and Target_arm::rel_dyn_section.
11077 Declare new_enum Target_arm::Got_type.
11078 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11079 and DYNBSS_.
11080 Update commments for member do_dynsym_value.
11081 (Target_arm::got_size, Target_arm::plt_section,
11082 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11083 new methods inside class defintion.
11084 (Target_arm::got_section): Define new method.
11085 (Target_arm::rel_dyn_section): Same.
11086 (Output_data_plt_arm): New template class.
11087 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11088 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11089 (Output_data_plt_arm::add_entry): Same.
11090 (Output_data_plt_arm::first_plt_entry): Define new
11091 static data member for PLT instruction template.
11092 (Output_data_plt_arm::plt_entry): Same.
11093 (Output_data_plt_arm::do_write): Define new method.
11094 (Target_arm::make_plt_entry): Same.
11095 (Target_arm::do_finalize_sections): Same.
11096 (Target_arm::do_dynsym_value): Same.
11097
4a657b0d
DK
110982009-05-28 Doug Kwan <dougkwan@google.com>
11099
11100 * Makefile.am (TARGETSOURCES): Add arm.cc.
11101 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11102 * Makefile.in: Regenerate.
11103 * arm.cc: New file.
11104 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11105
e7ae8c36
DK
111062009-05-26 Doug Kwan <dougkwan@google.com>
11107
11108 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11109 (General_options::check_excluded_libs): Strip off directories in
11110 archive name before matching like GNU ld does.
11111 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11112 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11113 (exclude_libs_test_LDFLAGS): Add linker option
11114 -Wl,--exclude-libs,libexclude_libs_test_3
11115 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11116 an explicit archive without using -l.
11117 (alt/libexclude_libs_test_3.a): New make rule.
11118 * testsuite/Makefile.in: Regenerate.
11119 * testsuite/exclude_libs_test.c : Declare lib3_default().
11120 (main): Call it.
11121 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11122 * exclude_libs_test_3.c: New file.
11123
f12e7348
NC
111242009-05-26 Nick Clifton <nickc@redhat.com>
11125
11126 * po/id.po: New Indonesian translation.
11127 * po/gold.pot: Updated template file.
11128
4daadc0d
ST
111292009-05-22 Sriraman Tallam <tmsriram@google.com>
11130
e1df38aa 11131 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11132 gc_comdat_test files. Add -Wl,--gc-sections to build
11133 gc_comdat_test.
11134 * testsuite/Makefile.in: Regenerate.
11135 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11136
531813ad
ST
111372009-05-21 Sriraman Tallam <tmsriram@google.com>
11138
11139 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11140 kept comdat section was garbage collected.
11141 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11142 * testsuite/Makefile.in: Regenerate.
11143 * testsuite/gc_comdat_test.sh: New file.
11144 * testsuite/gc_comdat_test_1.cc: New file.
11145 * testsuite/gc_comdat_test_2.cc: New file.
11146
65514900
CC
111472009-05-19 Doug Kwan <dougkwan@google.com>
11148
11149 * archive.cc (Archive::Archive): Move constructor from archive.h
11150 to here. Initialize no_export_.
11151 (Archive::get_elf_object_for_member): Set no_export flag of object.
11152 * archive.h (Archive::Archive): Move constructor body to
11153 archive.cc.
11154 (Archive::no_export): New method.
11155 (Archive::no_export_): New field.
11156 * object.h (Object::Object): Initialize no_export_ to false.
11157 (Object::no_export, Object::set_no_export): New methods.
11158 (Object::no_export_): New field.
11159 * options.cc (General_options::parse_exclude_libs): New method.
11160 (General_options::check_excluded_libs) Same.
11161 * options.h (exclude_libs): New option.
11162 (General_options::check_excluded_libs): New method declaration.
11163 (General_options::excluded_libs_): New field.
11164 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11165 default or protected visibility if an object has no-export flag set.
11166 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11167 (check_SCRIPTS): Add exclude_libs_test.sh.
11168 (check_DATA): Add exclude_libs_test.syms.
11169 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11170 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11171 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11172 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11173 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11174 libexclude_libs_test_2.a): New rules.
11175 * testsuite/Makefile.in: Regenerate.
11176 * testsuite/exclude_libs_test.c: New file.
11177 * testsuite/exclude_libs_test.sh: Ditto.
11178 * testsuite/exclude_libs_test_1.c: Ditto.
11179 * testsuite/exclude_libs_test_2.c: Ditto.
11180
1b77ea50
ILT
111812009-05-15 Ian Lance Taylor <iant@google.com>
11182
11183 * configure.ac: Check for declarations for cases where libiberty.h
11184 checks HAVE_DECL_xxx.
11185 * configure, config.in: Rebuild.
11186
072fe7ce
ILT
111872009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11188
11189 * gold.h (Incremental_argument_list): Remove (invalid) forward
11190 declaration.
11191 * incremental.cc (Incremental_inputs::report_achive): New method.
11192 (Incremental_inputs::report_object): New method.
11193 (Incremental_inputs::report_script): New method.
11194 (Incremental_inputs::finalize_inputs): New method.
11195 (Incremental_inputs::finalize): Call finalize_inputs().
11196 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11197 Create inputs entries.
11198 * incremental.h (Incremental_input_type): New enum.
11199 (Incremental_inputs::Incremental_input): Initialize new fields.
11200 (Incremental_inputs::report_inputs): New method.
11201 (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::Input_info): New struct.
11206 (Incremental_inputs::Input_info_map): New typedef.
11207 (Incremental_inputs::lock_): New field.
11208 (Incremental_inputs::Inputs_): New field.
11209 (Incremental_inputs::Inputs_map): New field.
11210 * main.cc (main): Call Incremental_input::report_inputs.
11211 * options.h (Input_argument_list): Typedef moved from
11212 Input_arguments.
11213 (Input_file_group::Files): Remove, use ::Input_argument_list.
11214 (Input_file_group::Input_argument_list): Remove, use
11215 ::Input_argument_list.
11216 * plugin.cc (Plugin_manager::add_input_file): Add error in
11217 incremental build.
11218 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11219 functions.
11220 * script.cc (read_input_script): Call
11221 Incremental_input::report_script.
11222 * script.h (Script_info): New class.
11223
b0481b0b
ILT
112242009-04-27 Ian Lance Taylor <iant@google.com>
11225
11226 * x86_64.cc (do_adjust_output_section): Set entsize to
11227 plt_entry_size.
11228
b22a5a41 112292009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11230
11231 * output.cc (Output_file::close): After short writes, continue
11232 writing from the correct offset in the buffer being written.
11233
40fde488
CD
112342009-04-23 Chris Demetriou <cgd@google.com>
11235
11236 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11237 * configure: Regenerate.
11238 * config.in: Regenerate.
11239 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11240 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11241
3ce2c28e
ILT
112422009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11243
11244 * incremental.cc (Incremental_inputs_header_data): Renamed from
11245 Incremental_input_header_data.
11246 (Incremental_inputs_header_data::data_size): New field.
11247 (Incremental_inputs_header_data::put_input_file_count): Renamed
11248 from input_file_count.
11249 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11250 from command_line_offset.
11251 (Incremental_inputs_header_data::put_reserved): Renamed from
11252 put_reserved.
11253 (Incremental_inputs_entry_data): Renamed from
11254 Incremental_input_entry_data.
11255 (Incremental_inputs_entry_data::data_size): New field.
11256 (Incremental_inputs::report_command_line): New method.
11257 (Incremental_inputs::finalize): New method.
11258 (Incremental_inputs::create_incremental_inputs_data): New method.
11259 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11260 * incremental.h: New file.
11261 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11262 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11263 incremental builds.
703d02da 11264 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11265 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11266 (Layout::create_incremental_info_sections): New method.
11267 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11268 * main.cc (main): Notify Incremental_input of the command line.
11269
e55bde5e
ILT
112702009-04-01 Ian Lance Taylor <iant@google.com>
11271 Mikolaj Zalewski <mikolajz@google.com>
11272
11273 * gold.h (reserve_unordered_map): Define, three versions, one for
11274 each version of Unordered_map.
11275 * layout.cc (Layout::Layout): Remove options parameter. Add
11276 number_of_input_files parameter. Don't initialize options_.
11277 Initialize number_of_input_files_ and resized_signatures_. Move
11278 sections_are_attached_.
11279 (Layout::layout_group): Reserve space for group_signatures_.
11280 (Layout::find_or_add_kept_section): Change name parameter to be a
11281 reference. Resize signatures_ map when it gets large enough.
11282 (Layout::layout_eh_frame): Use parameters->options() instead of
11283 this->options_.
11284 (Layout::make_output_section): Likewise.
11285 (Layout::attach_allocated_section_to_segment): Likewise.
11286 (Layout::finalize, Layout::create_executable_stack): Likewise.
11287 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11288 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11289 * layout.h (class Layout): Update declarations. Remove options_
11290 field. Add number_of_input_files_ and resized_signatures_
11291 fields. Move sections_are_attached_ field.
11292 * main.cc (main): Pass number of input files to Layout
11293 constructor. Don't pass options.
11294
154b857c
ILT
112952009-03-30 Ian Lance Taylor <iant@google.com>
11296
11297 * ffsll.c (ffsll): Correct implementation.
11298
2f35ab9b
ILT
112992009-03-27 Ian Lance Taylor <iant@google.com>
11300
fd03461a
ILT
11301 * ffsll.c: New file.
11302 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11303 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11304 * ftruncate.c (ftruncate): Declare before definition.
11305 * mremap.c (mremap): Likewise.
11306 * pread.c (pread): Likewise.
11307 * configure, Makefile.in, config.in: Rebuild.
11308
2f35ab9b
ILT
11309 * mremap.c: New file.
11310 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11311 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11312 (mremap): Declare if HAVE_MREMAP is not defined.
11313 * configure, Makefile.in, config.in: Rebuild.
11314
33aea2fd
CC
113152009-03-27 Cary Coutant <ccoutant@google.com>
11316
11317 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11318 position independent.
11319 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11320 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11321
6d479619
CC
113222009-03-24 Cary Coutant <ccoutant@google.com>
11323
11324 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11325 an executable.
11326 (needs_dynamic_reloc): Likewise.
11327
afc06bb8
ILT
113282009-03-24 Ian Lance Taylor <iant@google.com>
11329
11330 * yyscript.y (file_cmd): Recognize EXTERN.
11331 (extern_name_list, extern_name_list_body): New nonterminals.
11332 * script.cc (script_add_extern): Define.
11333 * script-c.h (script_add_extern): Declare.
11334
f6060a4d
ILT
113352009-03-24 Rafael Avila de Espindola <espindola@google.com>
11336
11337 * object.cc (is_elf_object): Define.
11338 * object.h (is_elf_object): Declare.
11339 * archive.cc (Archive::get_elf_object_for_member): Call
11340 is_elf_object.
33aea2fd 11341 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11342
26736d8e
ILT
113432009-03-24 Elliott Hughes <enh@google.com>
11344
11345 * output.cc (Output_file::map_anonymous): Define.
11346 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11347 try an anonymous one. Report the size if the mmap fails.
11348 * output.h (class Output_file): Declare map_anonymous.
11349
22fd9730
ILT
113502009-03-24 Ian Lance Taylor <iant@google.com>
11351
11352 * target-select.cc (instantiate_target): Don't acquire the lock if
11353 the instantiated_target_ field has already been set.
11354
cb010894
ILT
113552009-03-23 Ian Lance Taylor <iant@google.com>
11356
7f055c20
ILT
11357 * gold-threads.h (class Initialize_lock): Define.
11358 * gold-threads.cc (class Initialize_lock_once): Define.
11359 (initialize_lock_control): New static variable.
11360 (initialize_lock_pointer): New static variable.
11361 (initialize_lock_once): New static function.
11362 (Initialize_lock::Initialize_lock): Define.
11363 (Initialize_lock::initialize): Define.
11364 * target-select.h: Include "gold-threads.h".
11365 (class Target_selector): Add lock_ and initialize_lock_ fields.
11366 Don't define instantiate_target, just declare it.
11367 * target-select.cc (Target_selector::Target_selector): Initialize
11368 new fields.
11369 (Target_selector::instantiate_target): Define.
11370 * descriptors.h: Include "gold-threads.h".
11371 (class Descriptors): Add initialize_lock_ field.
11372 * descriptors.cc (Descriptors::Descriptors): Initialize new
11373 field.
11374 (Descriptors::open): Use initialize_lock_ field
11375 * errors.h (class Errors): Add initialize_lock_ field.
11376 * errors.cc (Errors::Errors): Initialize new field.
11377 (Errors::initialize_lock): Use initialize_lock_ field.
11378 * powerpc.cc (class Target_selector_powerpc): Remove
11379 instantiated_target_ field. In do_recognize call
11380 instantiate_target rather than do_instantiate_target. In
11381 do_instantiate_target just allocate a new target.
11382 * sparc.cc (class Target_selector_sparc): Likewise.
11383
36959681
ILT
11384 * freebsd.h: New file.
11385 * i386.cc: Include "freebsd.h".
11386 (Target_i386): Derive from Target_freebsd rather than
11387 Sized_target.
11388 (Target_selector_i386): Derive from Target_selector_freebsd rather
11389 than Target_selector.
11390 * x86_64.cc: Include "freebsd.h".
11391 (Target_x86_64): Derive from Target_freebsd rather than
11392 Sized_target.
11393 (Target_selector_x86_64): Derive from Target_selector_freebsd
11394 rather than Target_selector.
11395 * target.h (class Target): Add adjust_elf_header and
11396 do_adjust_elf_header.
11397 * output.cc (Output_file_header:: do_sized_write): Call target
11398 adjust_elf_header routine.
11399 * configure.tgt: Set targ_osabi.
11400 * configure.ac: Define GOLD_DEFAULT_OSABI.
11401 * parameters.cc (Parameters::default_target): Pass
11402 GOLD_DEFAULT_OSABI to select_target.
11403 * target-select.h (class Target_selector): Make instantiate_target
11404 protected rather than private.
11405 * Makefile.am (HFILES): Add freebsd.h.
11406 * configure, Makefile.in, config.in: Rebuild.
11407
cb010894
ILT
11408 * merge.cc (do_add_input_section): Correct pend value. Change
11409 message about last entry not being null terminated from error to
11410 warning.
11411
0e879927
ILT
114122009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11413
11414 * incremental.cc: New file.
11415 * Makefile.am (CCFILES): Add incremental.cc.
11416 * Makefile.in: Rebuild.
11417
41105937
PP
114182009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11419
11420 * layout.cc (Layout::output_section_name): Preserve names
11421 of '.note.' sections.
e1df38aa 11422
60439920
ILT
114232009-03-19 Ian Lance Taylor <iant@google.com>
11424
11425 * descriptors.cc (Descriptors::open): Check that the options are
11426 valid before using them.
11427
0d371ad3
ILT
114282009-03-18 Ian Lance Taylor <iant@google.com>
11429
11430 * script-sections.h: Include <list>.
11431 (class Script_sections): Change Sections_elements from std::vector
11432 to std::list. Typedef public Elements_iterator. Add
11433 orphan_section_placement_, data_segment_align_start_, and
11434 saw_data_segment_align_ fields. Remove data_segment_align_index_
11435 field.
11436 * script-sections.cc (class Orphan_section_placement): New class.
11437 (class Sections_element): Add virtual functions is_relro and
11438 orphan_section_init. Remove virtual function place_orphan_here.
11439 (class Output_section_definition): Add is_relro and
11440 orphan_section_init. Remove place_orphan_here.
11441 (class Orphan_output_section): Likewise.
11442 (Script_sections::Script_sections): Update for field changes.
11443 (Script_sections::data_segment_align): Set saw_data_segment_align_
11444 and data_segment_align_start_, not data_segment_align_index.
11445 (Script_sections::data_segment_relro_end): Check
11446 saw_data_segment_align_. Use data_segment_align_start_ rather
11447 than data_segment_align_index_.
11448 (Script_sections::place_orphan): Rewrite to use
11449 Orphan_section_placement.
11450
9201d894
ILT
114512009-03-17 Ian Lance Taylor <iant@google.com>
11452
9c5b8369
ILT
11453 * archive.cc (Archive::add_symbols): Check for a version attached
11454 to the symbol name in the archive map.
11455 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11456 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11457 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11458 (ver_test_11.a): New target.
11459 * testsuite/Makefile.in: Rebuild.
11460
9201d894
ILT
11461 * configure.ac: Check for chsize and posix_fallocate. Replace
11462 ftruncate.
11463 * ftruncate.c: New file, from gnulib.
11464 * output.cc (posix_fallocate): Define dummy version if not
11465 HAVE_POSIX_FALLOCATE.
11466 (Output_file::map): Call posix_fallocate rather than lseek and
11467 write.
11468 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11469 * configure, Makefile.in, config.in: Rebuild.
11470
ef4ab7a8 114712009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11472
ef4ab7a8
PP
11473 * layout.h (Layout::create_note): Add section_name parameter.
11474 * layout.cc (Layout::create_note): Likewise.
11475 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11476
8c500701
ILT
114772009-03-17 Ian Lance Taylor <iant@google.com>
11478
e85b18e1
ILT
11479 * descriptors.cc: Include "options.h".
11480 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11481 (Descriptors::open): Always use O_CLOEXEC when opening a new
11482 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11483 then set FD_CLOEXEC.
11484
9efe6174
ILT
11485 * sparc.cc (class Target_sparc): Add has_got_section.
11486 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11487 make sure we have a GOT section.
11488
11489 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11490 (Target_sparc::Scan::local): Likewise.
11491 (Target_sparc::Scan::global): Likewise.
11492 (Target_sparc::Relocate::relocate): Likewise.
11493 (Target_sparc::Relocate::relocate_tls): Likewise.
11494
8c500701
ILT
11495 * symtab.cc (Symbol_table::define_default_version): New function,
11496 broken out of add_from_object.
11497 (Symbol_table::add_from_object): Call define_default_version.
11498 (Symbol_table::define_special_symbol): Add resolve_oldsym
11499 parameter. Change all callers. If the version for a symbol comes
11500 from a version script, resolve it with the symbol with the same
11501 name with no version. Also add the symbol without a version if
11502 appropriate.
11503 (do_define_in_output_data): If resolving with oldsym, don't delete
11504 sym.
11505 (do_define_in_output_segment): Likewise.
11506 (do_define_as_constant): Likewise.
11507 * symtab.h (class Symbol_table): Update declarations.
11508
f1ed28fb
ILT
115092009-03-13 Ian Lance Taylor <iant@google.com>
11510
15f8229b
ILT
11511 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11512 (Read_symbols::requeue): New function.
11513 (Read_symbols::do_read_symbols): If make_elf_object fails because
11514 the target type is not configured, and the file was searched for,
11515 issue a warning and retry with the next directory.
11516 (Add_symbols::run): If the file has an incompatible format, and
11517 it was searched for, requeue the Read_symbols task. On error,
11518 release the object.
11519 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11520 dirindex parameter to constructor. Change all callers. Declare
11521 incompatible_warning and requeue.
11522 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11523 input_argument_ and input_group_ fields. Add them to
11524 constructor. Change all callers.
11525 (class Read_script): Add dirindex_ field. Add it to constructor.
11526 Change all callers.
11527 * archive.cc (Archive::setup): Remove input_objects parameter.
11528 Change all callers.
11529 (Archive::get_file_and_offset): Likewise.
11530 (Archive::read_all_symbols): Likewise.
11531 (Archive::read_symbols): Likewise.
11532 (Archive::get_elf_object_for_member): Remove input_objects
11533 parameter. Add punconfigured parameter. Change all callers.
11534 (Archive::add_symbols): Change return type to bool. Check return
11535 value of include_member.
11536 (Archive::include_all_members): Likewise.
11537 (Archive::include_member): Change return type to bool. Return
11538 false if first included object has incompatible target. Set
11539 included_member_ field.
11540 (Add_archive_symbols::run): If add_symbols returns false, requeue
11541 Read_symbols task.
11542 * archive.h (class Archive): Add included_member_ field.
11543 Initialize it in constructor. Add input_file and searched_for
11544 methods. Update declarations.
11545 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11546 input_argument_ fields. Add them to constructor. Change all
11547 callers.
11548 * script.cc: Include "target-select.h".
11549 (class Parser_closure): Add skip_on_incompatible_target_ and
11550 found_incompatible_target_ fields. Add
11551 skip_on_incompatible_target parameter to constructor. Change all
11552 callers. Add methods skip_on_incompatible_target,
11553 clear_skip_on_incompatible_target, found_incompatible_target, and
11554 set_found_incompatible_target.
11555 (read_input_script): Add dirindex parameter. Change all callers.
11556 If parser finds an incompatible target, requeue Read_symbols
11557 task.
11558 (script_set_symbol): Clear skip_on_incompatible_target in
11559 closure.
11560 (script_add_assertion, script_parse_option): Likewise.
11561 (script_start_sections, script_add_phdr): Likewise.
11562 (script_check_output_format): New function.
11563 * script.h (read_input_script): Update declaration.
11564 * script-c.h (script_check_output_format): Declare.
11565 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11566 (ignore_cmd): Remove OUTPUT_FORMAT.
11567 * fileread.cc (Input_file::Input_file): Add explicit this.
11568 (Input_file::will_search_for): New function.
11569 (Input_file::open): Add pindex parameter. Change all callers.
11570 * fileread.h (class Input_file): Add input_file_argument method.
11571 Declare will_search_for. Update declarations.
11572 * object.cc (make_elf_object): Add punconfigured parameter.
11573 Change all callers.
11574 * object.h (class Object): Make input_file public. Add
11575 searched_for method.
11576 (make_elf_object): Update declaration.
11577 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11578 restart search.
11579 * dirsearch.h (class Dirsearch): Update declaration.
11580 * options.h (class General_options): Add --warn-search-mismatch.
11581 * parameters.cc (Parameters::is_compatible_target): New function.
11582 * parameters.h (class Parameters): Declare is_compatible_target.
11583 * workqueue.cc (Workqueue::add_blocker): New function.
11584 * workqueue.h (class Workqueue): Declare add_blocker.
11585
f1ed28fb
ILT
11586 * fileread.cc (Input_file::open): Remove options parameter.
11587 Change all callers.
11588 (Input_file::open_binary): Likewise.
11589 * script.cc (read_input_script): Likewise.
11590 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11591 options parameter from constructor. Change all callers.
11592 (class Read_script): Likewise.
11593 * fileread.h (class Input_file): Update declarations.
11594 * script.h (read_input_script): Update declaration.
11595
34dd024a
NC
115962009-03-10 Nick Clifton <nickc@redhat.com>
11597
11598 * po/es.po: New Spanish translation.
11599
6d71b17c
CC
116002009-03-06 Cary Coutant <ccoutant@google.com>
11601
11602 * options.cc (parse_short_option): Keep dash_z from registering itself.
11603
031cdbed
ILT
116042009-03-03 Ian Lance Taylor <iant@google.com>
11605
11606 PR 9918
11607 * target-reloc.h (relocate_section): Pass output_section to
11608 relocate.
11609 * i386.cc (Target_i386::should_apply_static_reloc): Add
11610 output_section parameter. Change all callers.
11611 (Target_i386::Relocate::relocate): Add output_section parameter.
11612 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11613 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11614 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11615 * testsuite/two_file_shared.sh: New script.
11616 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11617 (check_DATA): Add two_file_shared.dbg.
11618 (two_file_shared.dbg): New target.
11619 * testsuite/Makefile.in: Rebuild.
11620
15d5fa16
ILT
116212009-03-01 Ian Lance Taylor <iant@google.com>
11622
11623 * configure.ac: Check for byteswap.h.
11624 * configure: Rebuild.
11625 * config.in: Rebuild.
11626
8a4c0b0d
ILT
116272009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11628
11629 * layout.cc (Layout::find_or_add_kept_section): New function.
11630 (Layout::add_comdat): Removed.
11631 * layout.h (struct Kept_section): Move out of class Layout.
11632 Remove trailing underscores from field names. Add group_sections
11633 field. Rename group_ field to is_group. Change all uses.
11634 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11635 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11636 comdat_groups_ field.
11637 (Sized_relobj::include_section_group): Use
11638 find_or_add_kept_section and Kept_section::group_sections.
11639 (Sized_relobj::include_linkonce_section): Likewise.
11640 * object.cc (class Sized_relobj): Don't define Comdat_group or
11641 Comdat_group_table. Remove find_comdat_group and
11642 add_comdat_group. Remove comdat_groups_ field.
11643 * plugin.cc (include_comdat_group): Use
11644 Layout::find_or_add_kept_section.
11645
b4ecf66b
ILT
116462009-02-28 Ian Lance Taylor <iant@google.com>
11647
14359ca0
ILT
11648 * README: --gc-sections and map files are now supported. Document
11649 some build requirements.
11650
b4ecf66b
ILT
11651 PR 6992
11652 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11653 relocatable link set the value of the section symbol to zero.
11654 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11655 relocatable link don't include the section address in the local
11656 symbol value.
11657
0602e05a
ILT
116582009-02-27 Ian Lance Taylor <iant@google.com>
11659
fd9d194f
ILT
11660 PR 6811
11661 * options.h (class Search_directory): Add is_system_directory.
11662 (class General_options): Declare is_in_system_directory.
11663 * options.cc (get_relative_sysroot): Make static.
11664 (get_default_sysroot): Make static.
11665 (General_optoins::is_in_system_directory): New function.
11666 * fileread.cc (Input_file::is_in_system_directory): New function.
11667 * fileread.h (class Input_file): Declare is_in_system_directory.
11668 * object.h (class Object): Add is_in_system_directory.
11669 (class Input_objects): Remove system_library_directory_ field.
11670 * object.cc (Input_objects::add_object): Don't set
11671 system_library_directory_.
11672 (input_objects::found_in_system_library_directory): Remove.
11673 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11674 parameter. Change all callers.
11675 (Symbol_table::sized_write_globals): Likewise.
11676 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11677 Call Object::is_in_system_directory.
11678 * symtab.h (class Symbol_table): Update declarations.
11679
61edd21f
ILT
11680 PR 5990
11681 * descriptors.h (Open_descriptor): Add is_on_stack field.
11682 * descriptors.cc (Descriptors::open): If the descriptor is on the
11683 top of the stack, remove it. Initialize is_on_stack field.
11684 (Descriptors::release): Only add pod to stack if it is not on the
11685 stack already.
11686 (Descriptors::close_some_descriptor): Clear stack_next and
11687 is_on_stack fields.
11688
e29e076a
ILT
11689 PR 7091
11690 * output.cc (Output_section::find_starting_output_address): Rename
11691 from starting_output_address; add PADDR parameter; change return
11692 type.
11693 * output.h (class Output_section): Declare
11694 find_starting_output_address instead of starting_output_address.
11695 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11696 section symbol for which we can't find a merge section.
11697
0602e05a
ILT
11698 PR 9836
11699 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11700 hidden or internal, force the symbol to be local.
11701 * resolve.cc (Symbol::override_visibility): Define.
11702 (Symbol::override_base): Use override_visibility.
11703 (Symbol_table::resolve): Likewise.
11704 (Symbol::override_base_with_special): Likewise.
11705 (Symbol_table::override_with_special): If the visibility is hidden
11706 or internal, force the symbol to be local.
11707 * symtab.h (class Symbol): Add set_visibility and
11708 override_visibility.
11709 * testsuite/ver_test_1.sh: New file.
11710 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11711 (check_DATA): Add ver_test_1.syms.
11712 (ver_test_1.syms): New target.
11713 * testsuite/Makefile.in: Rebuild.
11714
401a9a73
CC
117152009-02-25 Cary Coutant <ccoutant@google.com>
11716
11717 * layout.cc (Layout::choose_output_section): Don't rename sections
11718 when using a linker script that has a SECTIONS clause.
11719 * Makefile.in: Regenerate.
11720
11721 * testsuite/Makefile.am (script_test_5.sh): New test case.
11722 * testsuite/Makefile.in: Regenerate.
11723 * testsuite/script_test_5.cc: New file.
11724 * testsuite/script_test_5.sh: New file.
11725 * testsuite/script_test_5.t: New file.
11726
f488e4b0
CC
117272009-02-13 Rafael Avila de Espindola <espindola@google.com>
11728
11729 * archive.cc (Archive::include_member): Update calls to add_symbols.
11730 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11731 the Layout argument.
11732 * dynobj.h (do_add_symbols): Add the Layout argument.
11733 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11734 Layout argument.
11735 * object.h (Object::add_symbols): Add the Layout argument.
11736 (Object::do_add_symbols): Add the Layout argument.
11737 (Sized_relobj::do_add_symbols): Add the Layout argument.
11738 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11739 Unify the two versions.
11740 (Add_plugin_symbols): Remove.
11741 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11742 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11743 (Add_plugin_symbols): Remove.
11744 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11745 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11746 (Add_symbols::run): Make it work with Pulginobj.
11747
89dd1680
ILT
117482009-02-06 Ian Lance Taylor <iant@google.com>
11749
11750 * object.cc (Sized_relobj::do_layout): Make info message start
11751 with lower case letter.
11752
266d0a74
ILT
117532009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11754
602b464e
ILT
11755 * binary.cc: Fix file comment.
11756
266d0a74
ILT
11757 * options.h (enum Incremental_disposition): Define.
11758 (class General_options): Add new options: --incremental,
11759 --incremental_changed, --incremental_unchanged,
11760 --incremental_unknown. Add incremental_disposition_ and
11761 implicit_incremental_ fields.
11762 (General_options::incremental_disposition): New function.
11763 (class Position_dependent_options): Add incremental_disposition
11764 option.
11765 (Position_dependent_options::copy_from_options): Set incremental
11766 dispositions.
11767 * options.cc (General_options::parse_incremental_changed): New
11768 function.
2e702c99
RM
11769 (General_options::parse_incremental_unchanged): New function.
11770 (General_options::parse_incremental_unknown): New function.
11771 (General_options::General_options): Initialize new fields
266d0a74 11772 incremental_disposition_ and implicit_incremental_.
2e702c99 11773 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11774 without --incremental.
11775
f073bbf7
CD
117762009-02-06 Chris Demetriou <cgd@google.com>
11777
11778 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11779 pointer and to report location as the file name associated with
11780 the symbol.
11781 (gold_undefined_symbol_at_location): New function to replace the
11782 old gold_undefined_symbol functionality.
11783 * target-reloc.h (relocate_section): Update to use
11784 gold_undefined_symbol_at_location.
11785 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11786 Call gold_undefined_symbol function rather than gold_error.
11787 * errors.h (Errors::undefined_symbol): Take location as a
11788 string, rather than calculating it from a relocation.
11789 * errors.cc (Errors::fatal): Print "fatal error:" before the
11790 formatted message.
11791 (Errors::error, Errors::error_at_location): Print "error: "
11792 before the formatted message.
11793 (Errors::undefined_symbol): Take location as a string, rather
11794 than calculating it from a relocation.
11795 (gold_undefined_symbol_at_location): New function akin to
11796 old gold_undefined_symbol, calculates location from relocation.
11797 (gold_undefined_symbol): Change to take only a Symbol pointer
11798 and to report location as the file name associated with the symbol.
11799 * testsuite/debug_msg.sh: Update for changed error messages.
11800 * testsuite/undef_symbol.sh: Likewise.
11801
8e94a90c
ILT
118022009-02-04 Duncan Sands <baldrick@free.fr>
11803
11804 PR 9812
11805 * reduced_debug_output.h
11806 (Output_reduced_debug_abbrev_section::failed): Use format for
11807 gold_warning.
11808 (Output_reduced_debug_info_section::faild): Likewise.
11809
88a0e15b
ILT
118102009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11811
11812 * script.cc (Lazy_demangler): New class.
2e702c99 11813 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11814 symbol only once.
11815
5efc7cd2
CC
118162009-01-29 Cary Coutant <ccoutant@google.com>
11817
11818 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11819 to __tls_get_addr.
11820 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11821
e0ebcf42
ILT
118222009-01-28 Ian Lance Taylor <iant@google.com>
11823
5efc7cd2 11824 * version.cc (version_string): Bump to 1.9.
75fe7426 11825
e0ebcf42
ILT
11826 * gold.h: Include <cstring> and <stdint.h>.
11827 * version.cc: Include <cstdio>.
11828 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11829 warning.
11830 * reduced_debug_output.cc (insert_into_vector): Rename from
11831 Insert_into_vector; change all callers. Use Swap_unaligned to
11832 avoid aliasing issue; remove union since it is unnecessary.
11833
8e2813be 118342009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11835
11836 * Makefile.am (CCFILES): Add gc.cc.
11837 (HFILES): Add gc.h.
11838 * Makefile.in: Regenerate.
11839 * gold.cc (Gc_runner): New class.
11840 (queue_initial_tasks): Call garbage collection related tasks
11841 when corresponding options are invoked.
11842 (queue_middle_gc_tasks): New function.
11843 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11844 processed early before laying out sections during garbage collection.
11845 * gold.h (queue_middle_gc_tasks): New function.
11846 (is_prefix_of): Move from "layout.cc".
11847 * i386.cc (Target_i386::gc_process_relocs): New function.
11848 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11849 * main.cc (main): Create object of class "Garbage_collection".
11850 * object.cc (Relobj::copy_symbols_data): New function.
11851 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11852 (Sized_relobj::do_layout): Allow this function to be called twice
11853 during garbage collection and defer layout of section during the
6d03d481
ST
11854 first call.
11855 * object.h (Relobj::get_symbols_data): New function.
11856 (Relobj::is_section_name_included): New function.
11857 (Relobj::copy_symbols_data): New function.
11858 (Relobj::set_symbols_data): New function.
11859 (Relobj::get_relocs_data): New function.
11860 (Relobj::set_relocs_data): New function.
11861 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11862 (Relobj::gc_process_relocs): New function.
11863 (Relobj::do_gc_process_relocs): New pure virtual function.
11864 (Relobj::sd_): New data member.
11865 (Sized_relobj::is_output_section_offset_invalid): New function.
11866 (Sized_relobj::do_gc_process_relocs): New function.
11867 * options.h (General_options::gc_sections): Modify to not be a no-op.
11868 (General_options::print_gc_sections): New option.
11869 * plugin.cc (Plugin_finish::run): Remove function call to
11870 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11871 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11872 * reloc.cc (Read_relocs::run): Add task to process relocs and
11873 determine unreferenced sections when doing garbage collection.
11874 (Gc_process_relocs): New class.
11875 (Sized_relobj::do_gc_process_relocs): New function.
11876 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11877 sections that are garbage collected.
11878 * reloc.h (Gc_process_relocs): New class.
11879 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11880 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11881 symbols whose corresponding sections are garbage collected.
11882 (Symbol_table::Symbol_table): Add new parameter for the garbage
11883 collection object.
11884 (Symbol_table::gc_mark_undef_symbols): New function.
11885 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11886 (Symbol_table::gc_mark_dyn_syms): New function.
11887 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11888 as garbage.
11889 (Symbol_table::add_from_object): Likewise.
11890 (Symbol_table::add_from_relobj): When building shared objects, do not
11891 treat externally visible symbols as garbage.
11892 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11893 table information for static and relocatable links.
11894 * symtab.h (Symbol_table::set_gc): New function.
11895 (Symbol_table::gc): New function.
11896 (Symbol_table::gc_mark_undef_symbols): New function.
11897 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11898 (Symbol_table::gc_mark_dyn_syms): New function.
11899 (Symbol_table::gc_): New data member.
e1df38aa 11900 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11901 function.
11902 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11903 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11904
3b293544
CF
119052009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11906
11907 * options.h (General_options::gc_sections): Define as a no-op for now.
11908 (General_options::no_keep_memory): Ditto.
11909 (General_options::Bshareable): Define.
11910 * options.cc (General_options::finalize): Honor -Bshareable.
11911
83d22aa8
AS
119122009-01-20 Andreas Schwab <schwab@suse.de>
11913
11914 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11915 read the value in the contents, since we don't use it. Use the
11916 template endianness when writing.
11917 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11918
cd536b21
AS
119192009-01-19 Andreas Schwab <schwab@suse.de>
11920
11921 * configure.tgt (powerpc64-*): Fix targ_obj.
11922
99e9a495
ILT
119232009-01-15 Ian Lance Taylor <iant@google.com>
11924
11925 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11926 local symbols when stripping all symbols.
11927
bbbfea06
CC
119282009-01-14 Cary Coutant <ccoutant@google.com>
11929
99e9a495 11930 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11931
0f7c0701
CC
119322009-01-14 Cary Coutant <ccoutant@google.com>
11933
11934 * archive.cc (Archive::get_elf_object_for_member): Remove call
11935 to File_read::claim_for_plugin.
11936 * descriptors.cc (Descriptors::open): Remove reference to
11937 is_claimed.
11938 (Descriptors::claim_for_plugin): Remove.
11939 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11940 (Descriptors::is_claimed): Remove.
11941 (claim_descriptor_for_plugin): Remove.
11942 * fileread.cc (File_read::claim_for_plugin): Remove.
11943 * fileread.h (File_read::claim_for_plugin): Remove.
11944 (File_read::descriptor): Reopen descriptor if necessary.
11945 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11946 (Plugin_manager::all_symbols_read): Add task parameter. Change
11947 all callers.
11948 (Plugin_manager::get_input_file): New function.
11949 (Plugin_manager::release_input_file): New function.
11950 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11951 corresponding data member.
11952 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11953 and pass to base constructor. Change all callers.
11954 (get_input_file, release_input_file): New functions.
11955 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11956 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11957 (Plugin_manager::all_symbols_read): Add task parameter.
11958 (Plugin_manager::get_input_file): New function.
11959 (Plugin_manager::release_input_file): New function.
11960 (Plugin_manager::task_): New data member.
11961 (Pluginobj::Pluginobj): Add filesize parameter.
11962 (Pluginobj::filename): New function.
11963 (Pluginobj::descriptor): New function.
11964 (Pluginobj::filesize): New function.
11965 (Pluginobj::filesize_): New data member.
11966 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11967 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11968 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11969
11970 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11971 with archive libraries.
11972 * testsuite/Makefile.in: Regenerate.
11973 * testsuite/plugin_test.c (struct sym_info): New type.
11974 (get_input_file, release_input_file): New static variables.
11975 (onload): Capture new transfer vector entries.
11976 (claim_file_hook): Stop reading at end of file according to filesize.
11977 Factor out parsing of readelf output into separate function.
11978 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11979 APIs and get the source file name from the symbol table. Convert
11980 source file name to corresponding object file name. Print info
11981 message when adding new input files.
11982 (parse_readelf_line): New function.
11983 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11984 * testsuite/plugin_test_2.sh: Likewise.
11985 * testsuite/plugin_test_3.sh: Likewise.
11986 * testsuite/plugin_test_4.sh: New test case.
11987
62a6d109
ILT
119882009-01-07 Ian Lance Taylor <iant@google.com>
11989
11990 * version.cc (version_string): Bump to 1.8.
11991
483620e8
CC
119922008-12-23 Cary Coutant <ccoutant@google.com>
11993
11994 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11995 * plugin.cc (Plugin_manager::finish): Rename as
11996 layout_deferred_objects. Move cleanup to separate function.
11997 (Plugin_manager::cleanup): New function.
11998 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11999 separately.
12000 * plugin.h (Plugin_manager::finish): Rename as
12001 layout_deferred_objects.
12002 (Plugin_manager::cleanup): New function.
12003 (Plugin_manager::cleanup_done): New field.
12004
d66a9eb3
CC
120052008-12-23 Cary Coutant <ccoutant@google.com>
12006
12007 * plugin.cc (is_visible_from_outside): New function.
12008 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12009 so we don't return "IR only" status for exported symbols or -r links.
12010
12011 * testsuite/Makefile.am (plugin_test_3): New test case.
12012 * testsuite/Makefile.in: Regenerate.
12013 * testsuite/plugin_test_3.sh: New file.
12014
5995b570
CC
120152008-12-22 Cary Coutant <ccoutant@google.com>
12016
12017 * object.cc (Sized_relobj::layout_section): New function.
12018 (Sized_relobj::do_layout): Defer layout of input sections until after
12019 plugin has provided replacement files.
12020 (Sized_relobj::do_layout_deferred_sections): New function.
12021 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12022 (Relobj::layout_deferred_sections): New function.
12023 (Relobj::do_layout_deferred_sections): New function.
12024 (Sized_relobj::do_layout_deferred_sections): New function.
12025 (Sized_relobj::layout_section): New function.
12026 (Sized_relobj::Deferred_layout): New structure.
12027 (Sized_relobj::deferred_layout_): New field.
12028 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12029 Change all callers. Layout deferred sections.
12030 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12031 references.
12032 (Plugin_hook::run): Move code from do_plugin_hook inline.
12033 (Plugin_hook::do_plugin_hook): Remove.
12034 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12035 (Plugin_manager::finish): Renamed, was cleanup.
12036 (Plugin_manager::should_defer_layout): New function.
12037 (Plugin_manager::add_deferred_layout_object): New function.
12038 (Plugin_manager::Deferred_layout_list): New type.
12039 (Plugin_manager::deferred_layout_objects_): New field.
12040 (Plugin_hook::do_plugin_hook): Remove.
12041
ee769c88
ILT
120422008-12-17 Ian Lance Taylor <iant@google.com>
12043
12044 * options.h (class General_options): Add --no case for
12045 --export-dynamic.
12046
abc8dcba
CC
120472008-12-16 Cary Coutant <ccoutant@google.com>
12048
12049 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12050 vector.
12051 (Plugin_manager::claim_file): Create plugin object even if
12052 plugin did not call the add_symbols callback.
12053 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12054 asking for more symbols than were added.
12055 * testsuite/Makefile.am (plugin_test_1): Add test case with
12056 no global symbols.
12057 (empty.syms): New target.
12058 * testsuite/Makefile.in: Regenerate.
12059 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12060 message. Don't call add_symbols if no globals.
12061 (all_symbols_read_hook): Don't provide replacement for empty
12062 claimed file.
12063
b0074644
ILT
120642008-12-12 Ian Lance Taylor <iant@google.com>
12065
68943102
ILT
12066 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12067 r_type == 0 for a local symbol with r_sym == 0.
12068 (scan_relocatable_relocs): Pass r_sym to
12069 local_non_section_strategy.
12070 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12071 r_sym parameter.
12072
b0074644
ILT
12073 * configure.ac: Update test for TLS descriptors: they are
12074 supported as of glibc 2.9.
12075 * configure: Rebuild.
12076
c2508178
ILT
120772008-12-11 Ian Lance Taylor <iant@google.com>
12078
12079 PR 7091
12080 * target-reloc.h (Default_scan_relocatable_relocs): For each
12081 function, map r_type == 0 to RELOC_DISCARD.
12082
2756a258
CC
120832008-12-10 Cary Coutant <ccoutant@google.com>
12084
12085 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12086 object to override a kept COMDAT group from a plugin object.
12087
bb6f53d3
ILT
120882008-12-09 Ian Lance Taylor <iant@google.com>
12089
fbc558e1
ILT
12090 PR 7088
12091 * yyscript.y (file_cmd): Handle INPUT.
12092
bb6f53d3
ILT
12093 * testsuite/initpri1.c: Change all declarations to be full
12094 prototypes by adding void, to avoid compiler warnings.
12095
4674ecfc
CC
120962008-12-05 Rafael Avila de Espindola <espindola@google.com>
12097
12098 * options.cc (General_options::parse_plugin_opt): New.
12099 (General_options::add_plugin): The argument now is just the filename.
12100 (General_options::add_plugin_option): New.
12101 * options.h (plugin_opt): New.
12102 (add_plugin): Change argument name.
12103 (add_plugin_option): New.
12104 * plugin.cc (Plugin::load): Don't parse the plugin option.
12105 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12106 (Plugin::add_option): New.
12107 (Plugin::args_): Change type.
12108 (Plugin::filename_): New.
12109 (Plugin_manager::add_plugin_option): New.
12110 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12111 * testsuite/Makefile.in: Regenerate.
12112
fd06b4aa
CC
121132008-12-05 Cary Coutant <ccoutant@google.com>
12114
12115 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12116 Handle --strip-lto-sections option.
12117 * options.h (strip_lto_sections): New option.
12118
6c52134c
CC
121192008-12-01 Cary Coutant <ccoutant@google.com>
12120
12121 * plugin.cc (ld_plugin_message): Change format parameter to const.
12122 Fix mismatch between new[] and delete.
12123
a45248e0
CC
121242008-11-14 Cary Coutant <ccoutant@google.com>
12125
12126 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12127 instead of -1U.
12128
c82fbeee
CS
121292008-11-05 Craig Silverstein <csilvers@google.com>
12130
12131 * options.cc (General_options::parse_dynamic_list): New function.
12132 * options.h (General_options): New flags dynamic_list,
12133 dynamic_list_data, dynamic_list_cpp_new, and
12134 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12135 (General_options::in_dynamic_list): New function.
12136 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12137 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12138 (Lex::can_continue_name): Likewise.
12139 (yylex): Likewise.
12140 (read_script_file): New parameter script_options.
12141 (read_dynamic_list): New function.
12142 (Script_options::define_dynamic_list): New function.
12143 (dynamic_list_keyword_parsecodes): New variable.
12144 (dynamic_list_keywords): New variable.
12145 * script.h (Script_options::define_dynamic_list): New function
12146 prototype.
12147 (read_dynamic_list): New function prototype.
12148 * symtab.cc (strprefix): New macro.
12149 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12150 dynamic_list_data, dynamic_list_cpp_new, and
12151 dynamic_list_cpp_typeinfo.
12152 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12153 (dynamic_list_expr): New rule.
12154 (dynamic_list_nodes): Likewise.
12155 (dynamic_list_node): Likewise.
12156 * testsuite/Makefile.am (dynamic_list): New test.
12157 * testsuite/Makefile.in: Regenerated.
12158 * testsuite/dynamic_list.t: New file.
12159 * testsuite/dynamic_list.sh: New file.
12160
e0bb29a5
CS
121612008-11-05 Craig Silverstein <csilvers@google.com>
12162
12163 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12164 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12165 (t11_last): Likewise.
12166 * testsuite/ver_test_6.c (main): Likewise.
12167
4e1e25e0
CC
121682008-10-07 Cary Coutant <ccoutant@google.com>
12169
12170 * options.c (General_options::finalize): Add check for -static and
12171 -shared.
12172 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12173 is not empty.
12174
92f03fcb
CC
121752008-10-02 Cary Coutant <ccoutant@google.com>
12176
12177 * plugin.cc (make_sized_plugin_object): Fix conditional
12178 compilation to work when not all targets are enabled.
12179
fbd8a257
CC
121802008-09-29 Cary Coutant <ccoutant@google.com>
12181
12182 * archive.cc (Archive::get_file_and_offset): Use filename instead
12183 of name to get library path.
12184 (Archive::include_member): Unlock external member of a thin archive.
12185
12186 * testsuite/Makefile.am (TEST_AR): New variable.
12187 (thin_archive_test_1): New test.
12188 (thin_archive_test_2): New test.
81636b3f
CC
12189 * testsuite/Makefile.in: Regenerate.
12190 * testsuite/thin_archive_main.cc: New file.
12191 * testsuite/thin_archive_test_1.cc: New file.
12192 * testsuite/thin_archive_test_2.cc: New file.
12193 * testsuite/thin_archive_test_3.cc: New file.
12194 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 12195
eff45813
CC
121962008-09-29 Cary Coutant <ccoutant@google.com>
12197
12198 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12199 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12200 instead of -1U.
12201 (Sized_relobj::do_finalize_local_symbols): Likewise.
12202 (Sized_relobj::map_to_kept_section): Likewise.
12203 * object.h (Sized_relobj::invalid_address): New constant.
12204 (Sized_relobj::do_output_section_offset): Check for invalid_address
12205 and return -1ULL.
12206 * output.cc (Output_reloc::local_section_offset): Use constant
12207 invalid_address instead of -1U.
12208 (Output_reloc::get_address): Likewise.
12209 (Output_section::output_address): Change -1U to -1ULL.
12210 * output.h (Output_reloc::invalid_address): New constant.
12211 * reloc.cc (Sized_relobj::write_sections): Use constant
12212 invalid_address instead of -1U.
12213 (Sized_relobj::relocate_sections): Likewise.
12214 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12215 values for merge sections.
12216 * target-reloc.h (relocate_for_relocatable): Use constant
12217 invalid_address instead of -1U.
12218
89fc3421
CC
122192008-09-19 Cary Coutant <ccoutant@google.com>
12220
12221 Add plugin functionality for link-time optimization (LTO).
12222 * configure.ac (plugins): Add --enable-plugins option.
12223 * configure: Regenerate.
12224 * config.in: Regenerate.
12225 * Makefile.am (LIBDL): New variable.
12226 (CCFILES): Add plugin.cc.
12227 (HFILES): Add plugin.h.
12228 (ldadd_var): Add LIBDL.
12229 * Makefile.in: Regenerate.
12230
12231 * archive.cc: Include "plugin.h".
12232 (Archive::setup): Don't preread archive symbols when using a plugin.
12233 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12234 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12235 files.
12236 (Archive::include_member): Add symbols from plugin objects.
12237 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12238 * descriptors.cc (Descriptors::open): Check for file descriptors
12239 abandoned by plugins.
12240 (Descriptors::claim_for_plugin): New function.
12241 * descriptors.h (Descriptors::claim_for_plugin): New function.
12242 (Open_descriptor::is_claimed): New field.
12243 (claim_descriptor_for_plugin): New function.
12244 * fileread.cc (File_read::claim_for_plugin): New function.
12245 * fileread.h (File_read::claim_for_plugin): New function.
12246 (File_read::descriptor): New function.
12247 * gold.cc: Include "plugin.h".
12248 (queue_initial_tasks): Add task to call plugin hooks for generating
12249 new object files.
12250 * main.cc: Include "plugin.h".
12251 (main): Load plugin libraries.
12252 * object.h (Pluginobj): Declare.
12253 (Object::pluginobj): New function.
12254 (Object::do_pluginobj): New function.
12255 (Object::set_target): New function.
12256 * options.cc: Include "plugin.h".
12257 (General_options::parse_plugin): New function.
12258 (General_options::General_options): Initialize plugins_ field.
12259 (General_options::add_plugin): New function.
12260 * options.h (Plugin_manager): Declare.
12261 (General_options): Add --plugin option.
12262 (General_options::has_plugins): New function.
12263 (General_options::plugins): New function.
12264 (General_options::add_plugin): New function.
12265 (General_options::plugins_): New field.
12266 * plugin.cc: New file.
12267 * plugin.h: New file.
12268 * readsyms.cc: Include "plugin.h".
12269 (Read_symbols::do_read_symbols): Check for archive before checking
12270 for ELF file. Call plugin hooks to claim files.
12271 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12272 from a real object file; force override when processing replacement
12273 files.
12274 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12275 (Symbol::init_base_object): Likewise.
12276 (Symbol::init_base_output_data): Likewise.
12277 (Symbol::init_base_output_segment): Likewise.
12278 (Symbol::init_base_constant): Likewise.
12279 (Symbol::init_base_undefined): Likewise.
12280 (Symbol::output_section): Assert that object is not a plugin.
12281 (Symbol_table::add_from_pluginobj): New function.
12282 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12283 undefined.
12284 (Symbol_table::sized_write_globals): Likewise.
12285 (Symbol_table::add_from_pluginobj): Instantiate template.
12286 * symtab.h (Sized_pluginobj): Declare.
12287 (Symbol::in_real_elf): New function.
12288 (Symbol::set_in_real_elf): New function.
12289 (Symbol::in_real_elf_): New field.
12290 (Symbol_table::add_from_pluginobj): New function.
12291
12292 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12293 (LIBDL): New variable.
12294 (LDADD): Add LIBDL.
12295 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12296 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12297 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12298 (MOSTLYCLEANFILES): Likewise.
12299 * testsuite/Makefile.in: Regenerate.
12300 * testsuite/plugin_test.c: New file.
12301 * testsuite/plugin_test_1.sh: New file.
12302 * testsuite/plugin_test_2.sh: New file.
12303
de31bda5
ILT
123042008-09-16 Ian Lance Taylor <iant@google.com>
12305
9c2d0ef9
ILT
12306 * target-reloc.h (relocate_section): Check whether a symbol is
12307 defined by the ABI before reporting an undefined symbol error.
12308 * target.h (Target::is_defined_by_abi): Make parameter const.
12309 (Target::do_is_defined_by_abi): Likewise.
12310 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12311 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12312 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12313 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12314 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12315 * testsuite/Makefile.in: Rebuild.
12316
de31bda5
ILT
12317 * fileread.cc (make_view): Add casts to avoid warning.
12318
9fa33bee
AO
123192008-09-16 Alexandre Oliva <aoliva@redhat.com>
12320
12321 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12322 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12323
183fd0e3
AO
123242008-09-16 Alexandre Oliva <aoliva@redhat.com>
12325
12326 * options.h (General_options::output_is_executable): New.
12327 (General_options::output_is_pie): New.
12328 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12329 for shared libraries.
12330 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12331
7be8330a
CD
123322008-09-11 Chris Demetriou <cgd@google.com>
12333
12334 * options.h (origin): New -z option.
12335 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12336 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12337 in DT_FLAGS_1.
12338
a9caad02
CC
123392008-09-05 Cary Coutant <ccoutant@google.com>
12340
12341 * fileread.cc (File_read::make_view): Add check for attempt to map
12342 beyond end of file.
12343
ae6dce4d
CC
123442008-09-05 Cary Coutant <ccoutant@google.com>
12345
12346 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12347 explicit instantiations.
12348
d7ab2a47
KVH
123492008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12350
12351 PR gold/6858
12352 * options.cc (General_options::finalize): Allow undefined symbols
12353 in shlibs if linking -shared.
12354
12355 PR gold/6859
12356 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12357 symbols as not needing a dynsym entry.
12358
1e52a9c1
CS
123592008-08-20 Craig Silverstein <csilvers@google.com>
12360
12361 * fileread.cc (File_read::open): Do not lock the file unless it
12362 was successfully opened.
12363
d85c80a3
CC
123642008-08-14 Cary Coutant <ccoutant@google.com>
12365
12366 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12367 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12368 * testsuite/tls_test.cc (struct int128): 128-bit struct
12369 for testing TLS relocs with non-zero addend.
12370 (v12): New TLS variable.
12371 (t12): New test.
12372 (t_last): Add check for v12.
12373 * testsuite/tls_test.h (t12): New function.
12374 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12375
2d924fd9
ILT
123762008-08-13 Ian Lance Taylor <iant@google.com>
12377
12378 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12379 set tls_segment_ or relro_segment_.
12380 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12381 when appropriate.
12382 * output.h (Output_section::clear_is_relro): New function.
12383 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12384 sections specially even when output_data_ is empty.
12385 (Output_segment::maximum_alignment): When first section is relro,
12386 only force alignment for PT_LOAD segments.
12387 * script.cc (script_data_segment_align): New function.
12388 (script_data_segment_relro_end): New function.
12389 * script-c.h (script_data_segment_align): Declare.
12390 (script_data_segment_relro_end): Declare.
12391 * script-sections.h (class Script_sections): Declare
12392 data_segment_align and data_segment_relro_end. Add fields
12393 segment_align_index_ and saw_relro_end_.
12394 * script-sections.cc (class Sections_element): Add set_is_relro
12395 virtual function. Add new bool* parameter to place_orphan_here.
12396 Add get_output_section virtual function.
12397 (class Output_section_definition): Add set_is_relro. Add new
12398 bool* parameter to place_orphan_here. Add get_output_section.
12399 Add is_relro_ field.
12400 (Output_section_definition::Output_section_definition): Initialize
12401 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12402 and is_relro_ fields.
12403 (Output_section_definition::place_orphan_here): Add is_relro
12404 parameter.
12405 (Output_section_definition::set_section_addresses): Set relro for
12406 output section.
12407 (Output_section_definition::alternate_constraint): Likewise.
12408 (class Orphan_output_section): Add new bool* parameter to
12409 place_orphan_here. Add get_output_section.
12410 (Orphan_output_section::place_orphan_here): Add is_relro
12411 parameter.
12412 (Script_sections::Script_sections): Initialize
12413 data_segment_align_index_ and saw_relro_end_.
12414 (Script_sections::data_segment_align): New function.
12415 (Script_sections::data_segment_relro_end): New function.
12416 (Script_sections::place_orphan): Set or clear is_relro.
12417 (Script_sections::set_section_addresses): Force alignment of first
12418 TLS section.
12419 * yyscript.y (exp): Call script_data_segment_align and
12420 script_data_segment_relro_end.
12421 * testsuite/relro_script_test.t: New file.
12422 * testsuite/relro_test.cc (using_script): Declare.
12423 (t1, t2): Test using_script.
12424 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12425 (relro_script_test_SOURCES): Define.
12426 (relro_script_test_DEPENDENCIES): Define.
12427 (relro_script_test_LDFLAGS): Define.
12428 (relro_script_test_LDADD): Define.
12429 (relro_script_test.so): New target.
12430 * testsuite/Makefile.in: Rebuild.
12431
f827c9a9
CC
124322008-08-06 Cary Coutant <ccoutant@google.com>
12433
12434 * archive.cc (Archive::total_archives, Archive::total_members)
12435 (Archive::total_members_loaded): New variables.
12436 (Archive::setup): Add parameter. Add option to preread
12437 archive symbols.
12438 (Archive::read_armap): Add counter.
12439 (Archive::get_file_and_offset): New function.
12440 (Archive::get_elf_object_for_member): New function.
12441 (Archive::read_all_symbols): New function.
12442 (Archive::read_symbols): New function.
12443 (Archive::add_symbols): Add counters.
12444 (Archive::include_all_members): Use armap to find members if it's
12445 already built.
12446 (Archive::include_member): Skip reading symbols if already read.
12447 Factored code into Archive::get_file_and_offset and
12448 Archive::get_elf_object_for_member. Changed call to
12449 Mapfile::report_include_archive_member.
12450 (Archive::print_stats): New function.
12451 * archive.h: Declare Object and Read_symbols_data classes.
12452 (Archive::Archive): Add initializers for new members.
12453 (Archive::setup): Add parameter.
12454 (Archive::print_stats): New function.
12455 (Archive::total_archives, Archive::total_members)
12456 (Archive::total_members_loaded): New variables.
12457 (Archive::get_file_and_offset): New function.
12458 (Archive::get_elf_object_for_member): New function.
12459 (Archive::read_all_symbols): New function.
12460 (Archive::read_symbols): New function.
12461 (Archive::Archive_member): New class.
12462 (Archive::members_): New member.
12463 (Archive::num_members_): New member.
12464 * main.cc: Include archive.h.
12465 (main): Call Archive::print_stats.
12466 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12467 archive parameter; member_name is now the fully-decorated name.
12468 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12469 * options.h: (General_options): Add --preread-archive-symbols option.
12470 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12471 Archive::setup.
12472
de4c45bd
ILT
124732008-08-04 Ian Lance Taylor <iant@google.com>
12474
12475 * symtab.h (Symbol::use_plt_offset): New function.
12476 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12477 * powerpc.cc (Relocate::relocate): Likewise.
12478 * sparc.cc (Relocate::relocate): Likewise.
12479 * x86_64.cc (Relocate::relocate): Likewise.
12480 * testsuite/weak_plt.sh: New test.
12481 * testsuite/weak_plt_main.cc: New test.
12482 * testsuite/weak_plt_shared.cc: New test.
12483 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12484 (check_PROGRAMS): Add weak_plt.
12485 (check_DATA): Add weak_plt_shared.so.
12486 (weak_plt_main_pic.o, weak_plt): New targets.
12487 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12488 * testsuite/Makefile.in: Rebuild.
12489
12490 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12491 gcctestdir/ld.
12492 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12493 * testsuite/Makefile.in: Rebuild.
12494
323ee3f4
AM
124952008-08-04 Alan Modra <amodra@bigpond.net.au>
12496
12497 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12498 * Makefile.in: Regenerate.
12499 * po/POTFILES.in: Regenerate.
12500
7c07ecec
ILT
125012008-07-29 Ian Lance Taylor <iant@google.com>
12502
12503 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12504 symbols before other symbols.
12505 * testsuite/script_test_2.cc (test_addr): Declare.
12506 (test_addr_alias): Declare.
12507 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12508 values.
7c07ecec
ILT
12509 * testsuite/script_test_2.t: Define test_addr_alias and
12510 test_addr.
12511
5778530e
ILT
125122008-07-24 Ian Lance Taylor <iant@google.com>
12513
2a00e4fb
ILT
12514 PR 5990
12515 * descriptors.cc: New file.
12516 * descriptors.h: New file.
12517 * gold-threads.h (class Hold_optional_lock): New class.
12518 * fileread.cc: Include "descriptors.h".
12519 (File_read::~File_read): Release descriptor rather than closing
12520 it.
12521 (File_read::open) [file]: Call open_descriptor rather than open.
12522 Set is_descriptor_opened_.
12523 (File_read::open) [memory]: Assert that descriptor is not open.
12524 (File_read::reopen_descriptor): New function.
12525 (File_read::release): Release descriptor.
12526 (File_read::do_read): Make non-const. Reopen descriptor.
12527 (File_read::read): Make non-const.
12528 (File_read::make_view): Reopen descriptor.
12529 (File_read::do_readv): Likewise.
12530 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12531 Update declarations.
12532 * layout.cc: Include "descriptors.h".
12533 (Layout::create_build_id): Use open_descriptor rather than open.
12534 * output.cc: Include "descriptors.h".
12535 (Output_file::open): Use open_descriptor rather than open.
12536 * archive.cc (Archive::const_iterator): Change Archive to be
12537 non-const.
12538 (Archive::begin, Archive::end): Make non-const.
12539 (Archive::count_members): Likewise.
12540 * archive.h (class Archive): Update declarations.
12541 * object.h (Object::read): Make non-const.
12542 * Makefile.am (CCFILES): Add descriptors.cc.
12543 (HFILES): Add descriptors.h.
12544 * Makefile.in: Rebuild.
12545
801647d1
ILT
12546 PR 6716
12547 * gold.h: Always include <clocale>. Add Solaris workarounds
12548 following code in binutils/sysdep.h.
12549
5edd166e
ILT
12550 PR 6048
12551 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12552 this->eh_frame_hdr_ is NULL before using it.
12553
c89ad728
ILT
12554 * dynobj.cc (Versions::Versions): Update comment.
12555
aa86f06b
ILT
12556 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12557 the base version name.
12558
5778530e
ILT
12559 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12560 array size plus one.
12561 (Stringpool_template::set_string_offsets): Subtract one from key
12562 before using it as an array index.
12563 (Stringpool_template::get_offset_with_length): Likewise.
12564 (Stringpool_template::write_to_buffer): Likewise.
12565 * stringpool.h (Stringpool_template::get_offset_from_key):
12566 Likewise.
12567
057ead22
ILT
125682008-07-23 Ian Lance Taylor <iant@google.com>
12569
7f649c59
ILT
12570 PR 6658
12571 * object.h (Merged_symbol_value::value): Do our best to handle a
12572 negative addend.
12573
057ead22
ILT
12574 PR 6647
12575 * script.cc (Version_script_info::get_versions): Don't add empty
12576 version tag to return value.
12577 (Version_script_info::get_symbol_version_helper): Change return
12578 type to bool. Add pversion parameter. Change all callers.
12579 (script_register_vers_node): Don't require a non-NULL tag.
12580 * script.h (class Version_script_info): Update declarations.
12581 (Version_script_info::get_symbol_version): Change return type to
12582 bool. Add version parameter. Change all callers.
12583 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12584 handling. Handle an empty version from a version script.
12585 (Symbol_table::define_special_symbol): Likewise.
12586 * testsuite/ver_test_10.script: New file.
12587 * testsuite/ver_test_10.sh: New file.
12588 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12589 (check_DATA): Add ver_test_10.syms.
12590 (ver_test_10.syms, ver_test_10.so): New target.
12591 * testsuite/Makefile.in: Rebuild.
12592
58e54ac2
CD
125932008-07-23 Simon Baldwin <simonb@google.com>
12594
12595 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12596 to zero for undefined symbols from dynamic libraries.
12597
95d14cd3
ILT
125982008-07-23 Ian Lance Taylor <iant@google.com>
12599
12600 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12601 Change all callers.
12602 * symtab.h (class Symbol_table): Update declaration.
12603 * testsuite/ver_test_9.cc: New file.
12604 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12605 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12606 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12607 (ver_test_9.so, ver_test_9.o): New targets.
12608 * testsuite/Makefile.in: Rebuild.
12609
92de84a6
ILT
126102008-07-22 Ian Lance Taylor <iant@google.com>
12611
34810851
ILT
12612 * options.h (class General_options): Define --check-sections.
12613 * layout.cc (Layout::set_segment_offsets): Handle
12614 --check-sections.
12615
af6156ef
ILT
12616 * options.h (class General_options): Define -n/--nmagic and
12617 -N/--omagic.
12618 * options.cc (General_options::finalize): For -n/--nmagic or
12619 -N/--omagic, set -static.
12620 * layout.cc (Layout::attach_allocated_section_to_segment): If
12621 -N/--omagic, don't put read-only and read-write sections in
12622 different segments.
12623 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12624 finding a read-only segment.
12625 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12626 don't set the minimum segment alignment to the common page size,
12627 and don't set the file offset to the address modulo the page size.
12628 * script-sections.cc (Script_sections::create_segments): If
12629 -n/--omagic, don't put read-only and read-write sections in
12630 different segments.
12631
92de84a6
ILT
12632 * cref.cc: New file.
12633 * cref.h: New file.
12634 * options.h (class General_options): Add --print-symbol-counts.
12635 * main.cc (main): Issue defined symbol report if requested.
12636 * archive.cc (Archive::interpret_header): Make into a const member
12637 function.
12638 (Archive::add_symbols): Call Input_objects::archive_start and
12639 archive_stop.
12640 (Archive::const_iterator): Define new class.
12641 (Archive::begin, Archive::end): New functions.
12642 (Archive::include_all_members): Rewrite to use iterator.
12643 (Archive::count_members): New function.
12644 * archive.h (class Archive): Update declarations.
12645 (Archive::filename): New function.
12646 * object.cc: Include "cref.h".
12647 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12648 (Sized_relobj::do_get_global_symbol_counts): New function.
12649 (Input_objects::add_object): Add object to cross-referencer.
12650 (Input_objects::archive_start): New function.
12651 (Input_objects::archive_stop): New function.
12652 (Input_objects::print_symbol_counts): New function.
12653 * object.h: Declare Cref and Archive.
12654 (Object::get_global_symbol_counts): New function.
12655 (Object::do_get_global_symbol_counts): New pure virtual function.
12656 (class Sized_relobj): Add defined_count_ field. Update
12657 declarations.
12658 (class Input_objects): Add cref_ field. Update constructor.
12659 Update declarations.
12660 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12661 defined_count_.
12662 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12663 symbol counts.
12664 (Sized_dynobj::do_get_global_symbol_counts): New function.
12665 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12666 defined_count_. Update declarations. Define Symbols typedef.
12667 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12668 parameter. Change all callers.
12669 (Symbol_table::add_from_dynobj): Add sympointers and defined
12670 parameters. Change all callers.
12671 * symtab.h (class Symbol_table): Update declarations.
12672 * Makefile.am (CCFILES): Add cref.cc.
12673 (HFILES): Add cref.h.
12674 * Makefile.in: Rebuild.
12675
3f7c5e1d
CD
126762008-07-22 Simon Baldwin <simonb@google.com>
12677
12678 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12679 to zero when writing undefined symbols.
12680
e0b64032
ILT
126812008-07-22 Ian Lance Taylor <iant@google.com>
12682
12683 * output.cc (Output_section::add_input_section): Don't try to
12684 merge empty merge sections.
12685
096b02cf
CS
126862008-07-21 Craig Silverstein <csilvers@google.com>
12687
12688 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12689 Include symbol version in error message.
cd536b21 12690
1d1f116d
CD
126912008-07-20 Chris Demetriou <cgd@google.com>
12692
cd536b21 12693 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12694 (RANDOM_SEED_CFLAGS): New substituted variable.
12695 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12696 * configure: Rebuild.
12697 * Makefile.in: Likewise.
12698 * testsuite/Makefile.in: Likewise.
12699
a18f591e
ILT
127002008-07-18 Ian Lance Taylor <iant@google.com>
12701
12702 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12703 where we see NAME/NULL and NAME/VERSION as separate symbols.
12704 * testsuite/ver_test_main.cc (main): Call t4.
12705 (t4, t4_2a): Define.
12706 * testsuite/ver_test_2.cc (t4_2): Define.
12707 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12708 * testsuite/ver_test_4.cc (t4_2a): Define.
12709 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12710 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12711
c6e3f6ed
ILT
127122008-07-17 Ian Lance Taylor <iant@google.com>
12713
12714 * dynobj.cc (Versions::add_def): If we give an error about a
12715 missing version, go ahead and create the version anyhow.
12716
ef9beddf
ILT
127172008-07-10 Ian Lance Taylor <iant@google.com>
12718
12719 Handle output sections with more than 0x7fffffff bytes.
12720 * object.h (class Relobj): Change map_to_output_ to
12721 output_sections_, and just keep a section pointer. Change all
12722 uses. Move comdat group support to Sized_relobj.
12723 (Relobj::is_section_specially_mapped): Remove.
12724 (Relobj::output_section): Remove poff parameter. Change all
12725 callers.
12726 (Relobj::output_section_offset): New function.
12727 (Relobj::set_section_offset): Rewrite.
12728 (Relobj::map_to_output): Remove.
12729 (Relobj::output_sections): New function.
12730 (Relobj::do_output_section_offset): New pure virtual function.
12731 (Relobj::do_set_section_offset): Likewise.
12732 (class Sized_relobj): Add section_offsets_ field. Add comdat
12733 group support from Relobj. Update declarations.
12734 (Sized_relobj::get_output_section_offset): New function.
12735 (Sized_relobj::do_output_section_offset): New function.
12736 (Sized_relobj::do_set_section_offset): New function.
12737 * object.cc (Relobj::output_section_address): Remove.
12738 (Sized_relobj::Sized_relobj): Initialize new fields.
12739 (Sized_relobj::include_section_group): Cast find_kept_object to
12740 Sized_relobj.
12741 (Sized_relobj::include_linkonce_section): Likewise.
12742 (Sized_relobj::do_layout): Use separate arrays for output section
12743 and output offset.
12744 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12745 output_sections.
12746 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12747 output_sections and section_offsets.
12748 (Sized_relobj::write_local_symbols): Likewise.
12749 (map_to_kept_section): Compute output address directly.
12750 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12751 output_sections and section_offsets.
12752 (Sized_relobj::write_sections): Likewise.
12753 (Sized_relobj::relocate_sections): Likewise.
12754 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12755 * output.h (class Output_reloc): Update declarations. Change
12756 u2_.relobj to Sized_relobj*.
12757 (class Output_data_reloc): Change add functions to use
12758 Sized_relobj*.
12759 * output.cc (Output_reloc::Output_reloc): Change relobj to
12760 Sized_relobj*.
12761 (Output_reloc::local_section_offset): Change return type to
12762 Elf_Addr. Use get_output_section_offset.
12763 (Output_reloc::get_address): Likewise.
12764 (Output_section::is_input_address_mapped): Don't call
12765 is_section_specially_mapped.
12766 (Output_section::output_offset): Likewise.
12767 (Output_section::output_address): Likewise.
12768 (Output_section::starting_output_address): Likewise.
12769 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12770 parameter to Sized_relobj*.
12771 (Copy_relocs::need_copy_reloc): Likewise.
12772 (Copy_relocs::save): Likewise.
12773 * copy-relocs.h (class Copy_relocs): Update declarations.
12774 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12775 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12776 * target-reloc.h (relocate_for_relocatable): Change
12777 offset_in_output_section type to Elf_Addr. Change code that uses
12778 it as well.
12779 * layout.cc (Layout::layout): Always set *off.
12780 * mapfile.cc (Mapfile::print_input_section): Use
12781 output_section_offset.
12782 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12783 Sized_relobj*.
12784 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12785 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12786 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12787
5cb66f97
ILT
127882008-07-03 Ian Lance Taylor <iant@google.com>
12789
12790 * layout.cc (Layout::include_section): Do not discard unrecognized
12791 SHT_STRTAB sections.
12792
afe47622
CS
127932008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12794
12795 * script.cc (Lex::can_continue_name): Make '?' allowable in
12796 version-script names.
12797 * testsuite/version_script.map: Change glob pattern to use '?'
12798
5adf9721
ILT
127992008-06-30 Manish Singh <yosh@gimp.org>
12800
12801 PR 6585
12802 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12803 Correct typo.
12804
e6fde208
ILT
128052008-06-30 Ian Lance Taylor <iant@google.com>
12806
12807 PR 6660
12808 PR 6682
12809 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12810 versions]: Don't try to read the value in the contents, since we
12811 don't use it. Use the template endianness when writing.
12812
3f2e6a2d
CC
128132008-06-25 Cary Coutant <ccoutant@google.com>
12814
12815 * fileread.cc (File_read::make_view): Assert on zero-length view.
12816 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12817 symbol table when there are no symbols to read.
12818
c43d3a48
CS
128192008-06-23 Craig Silverstein <csilvers@google.com>
12820
12821 * version.cc (version_string): Bump to 1.7
12822
5f494ea0
CS
128232008-06-18 Craig Silverstein <csilvers@google.com>
12824
12825 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12826 constant 0xFFFF to type Valtype.
12827 (Powerpc_relocate_functions::rel16_ha): Likewise.
12828
c42e122e
ILT
128292008-06-17 Ian Lance Taylor <iant@google.com>
12830
f34787f8
ILT
12831 * output.h (Output_section::Input_section): Initialize p2align_ to
12832 zero for Output_section_data constructors.
12833 (Output_section::Input_section::addralign): If not an input
12834 section, return the alignment of the Output_section_data.
12835 * testsuite/copy_test.cc: New file.
12836 * testsuite/copy_test_1.cc: New file.
12837 * testsuite/copy_test_2.cc: New file.
12838 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12839 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12840 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12841 (copy_test_1_pic.o, copy_test_1.so): New targets.
12842 (copy_test_2_pic.o, copy_test_2.so): New targets.
12843 * testsuite/Makefile.in: Rebuild.
12844
c42e122e
ILT
12845 * script-sections.cc (Script_sections::place_orphan): Initialize
12846 local variable exact.
12847
ce3ac18a
DE
128482008-06-13 David Edelsohn <edelsohn@gnu.org>
12849
12850 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12851
42cacb20
DE
128522008-06-12 David Edelsohn <edelsohn@gnu.org>
12853 David S. Miller <davem@davemloft.net>
12854
12855 * powerpc.cc: New file.
12856 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12857 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12858 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12859 * Makefile.in: Rebuild.
12860
7b308235
ILT
128612008-06-09 Ian Lance Taylor <iant@google.com>
12862
12863 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12864 <exception>.
12865 (throwing, orig_terminate): New static variables.
12866 (terminate_handler): New static function.
12867 (t2): Set terminate handler.
12868
f0b886e3
ILT
128692008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12870
12871 PR 6584
cd536b21 12872 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12873 alignment.
12874
3e90f135
CC
128752008-05-30 Cary Coutant <ccoutant@google.com>
12876
12877 * archive.cc (Archive::include_all_members) Correct to step
12878 over symbol table and extended name table in thin archives.
12879
e09ad04a
ILT
128802008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12881
12882 PR 6407
12883 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12884 calculation.
12885
62b01cb5
ILT
128862008-05-28 Caleb Howe <cshowe@google.com>
12887
12888 * reduced_debug_output.cc: New file.
12889 * reduced_debug_output.h: New file.
92de84a6 12890 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12891 * options.cc (General_options::finalize): Add strip_debug_non_line
12892 to the strip heirarchy.
12893 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12894 fields.
12895 * layout.cc: Include "reduced_debug_output.h".
12896 (Layout::Layout): Initialize new fields.
12897 (line_only_debug_sections): New static array.
12898 (is_lines_only_debug_sections): New static inline function.
12899 (Layout::include_section): Handle --strip-debug-non-line.
12900 (Layout::make_output_section): If --strip-debug-non-line, build
12901 new output sections for .debug_abbrev and .debug_info.
12902 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12903 gold. Warn about possible overflow.
12904 (read_signed_LEB_128): Likewise.
12905 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12906 (read_signed_LEB_128): Declare.
12907 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12908 (HFILES): Add reduced_debug_output.h.
12909 * Makefile.in: Rebuild.
12910
7d9e3d98
ILT
129112008-05-21 Ian Lance Taylor <iant@google.com>
12912
12913 * mapfile.cc: New file.
12914 * mapfile.h: New file.
12915 * options.h (class General_options): Add -M/--print-map and -Map.
12916 * options.cc (General_options::finalize): Make -M equivalent to
12917 -Map -.
12918 * main.cc: Include <cstdio> and "mapfile.h".
12919 (main): Open mapfile if requested.
12920 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12921 constructor. Change caller.
12922 (queue_initial_tasks): Add mapfile parameter. Change caller.
12923 (queue_middle_tasks): Likewise.
12924 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12925 declarations.
12926 * archive.cc: Include "mapfile.h".
12927 (Archive::add_symbols): Add mapfile parameter. Change all
12928 callers. Pass mapfile, symbol, and reason to include_member.
12929 (Archive::include_all_members): Add mapfile parameter. Change all
12930 callers.
12931 (Archive::include_member): Add mapfile, sym, and why parameters.
12932 Change all callers. Report inclusion to map file.
12933 * archive.h: Include "fileread.h".
12934 (class Archive): Update declarations.
12935 (Archive::file): New const method.
12936 (class Add_archive_symbols): Add mapfile_ field. Update
12937 constructor. Change all callers.
12938 * readsyms.h (class Read_symbols): Likewise.
12939 (class Finish_group): Likewise.
12940 (class Read_script): Likewise.
12941 * common.cc: Include "mapfile.h".
12942 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12943 all callers.
12944 (Symbol_table::do_allocate_commons): Likewise.
12945 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12946 symbol allocation to mapfile.
12947 * common.h (class Allocate_commons_task): Add mapfile_ field.
12948 Update constructor. Change all callers.
12949 * symtab.h (class Symbol_table): Update declarations.
12950 * layout.cc: Include "mapfile.h".
12951 (Layout_task_runner::run): Print information to mapfile.
12952 (Layout::create_gold_note): Change Output_data_fixed_space to
12953 Output_data_zero_fill.
12954 (Layout::create_build_id): Likewise.
12955 (Layout::print_to_mapfile): New function.
12956 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12957 constructor. Change caller.
12958 (class Layout): Declare print_to_mapfile.
12959 * output.cc (Output_section::Input_section::print_to_mapfile): New
12960 function.
12961 (Output_section::add_input_section): If producing a map, always
12962 add to input_sections_ list.
12963 (Output_section::do_print_to_mapfile): New function.
12964 (Output_segment::print_sections_to_mapfile): New function.
12965 (Output_segment::print_section_list_to_mapfile): New function.
12966 * output.h: Include "mapfile.h".
12967 (Output_data::print_to_mapfile): New function.
12968 (Output_data::do_print_to_mapfile): New virtual function.
12969 (Output_segment_headers::do_print_to_mapfile): New function.
12970 (Output_file_header::do_print_to_mapfile): New function.
12971 (Output_data_const::do_print_to_mapfile): New function.
12972 (class Output_data_const_buffer): Add map_name_ field. Update
12973 constructor. Change all callers. Add do_print_to_mapfile
12974 function.
12975 (class Output_data_fixed_space): Likewise.
12976 (class Output_data_space): Likewise.
12977 (class Output_data_zero_fill): New class.
12978 (Output_data_strtab::do_print_to_mapfile): New function.
12979 (Output_data_reloc_base::do_print_to_mapfile): New function.
12980 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12981 (Output_data_group::do_print_to_mapfile): New function.
12982 (Output_data_got::do_print_to_mapfile): New function.
12983 (Output_data_dynamic::do_print_to_mapfile): New function.
12984 (Output_symtab_xindex::do_print_to_mapfile): New function.
12985 (class Output_section): Declare do_print_to_mapflie. Declare
12986 print_to_mapfile in Input_section.
12987 (class Output_segment): Declare new functions.
12988 * object.h (Sized_relobj::symbol_count): New function.
12989 * script-sections.cc
12990 (Output_section_element_dot_assignment::set_section_addresses):
12991 Change Output_data_fixed_space to Output_data_zero_fill.
12992 (Output_data_expression::do_print_to_mapfile): New function.
12993 * script.cc (read_input_script): Add mapfile parameter. Change
12994 all callers.
12995 * script.h (read_input_script): Update declaration.
12996 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12997 (Eh_frame::do_print_to_mapfile): New function.
12998 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12999 (Output_merge_string::do_print_to_mapfile): New function.
13000 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13001 function.
13002 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13003 function.
13004 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13005 function.
13006 * Makefile.am (CCFILES): Add mapfile.cc.
13007 (HFILES): Add mapfile.h.
13008 * Makefile.in: Rebuild.
13009
9f1d377b
ILT
130102008-05-19 Ian Lance Taylor <iant@google.com>
13011
13012 * options.h (class General_options): Add -z relro.
13013 * layout.cc (Layout::Layout): Initialize relro_segment_.
13014 (Layout::add_output_section_data): Return the output section.
13015 (Layout::make_output_section): Rcognize relro sections and mark
13016 them appropriately.
13017 (Layout::attach_allocated_section_to_segment): Put relro sections
13018 in a PT_GNU_RELRO segment.
13019 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13020 section as relro.
13021 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13022 PT_TLS segments.
13023 (Layout::linkonce_mapping): Map d.rel.ro.local to
13024 .data.rel.ro.local.
13025 (Layout::output_section_name): Us .data.rel.ro.local for any
13026 section which begins with that.
13027 * layout.h (class Layout): Update add_output_section_data
13028 declaration. Add relro_segment_ field.
13029 * output.cc (Output_section::Output_section): Initialize is_relro_
13030 and is_relro_local_ fields.
13031 (Output_segment::add_output_section): Group relro sections.
13032 (Output_segment::is_first_section_relro): New function.
13033 (Output_segment::maximum_alignment): If there is a relro section,
13034 align the segment to the common page size.
13035 (Output_segment::set_section_addresses): Track whether we are
13036 looking at relro sections. If the last section is a relro
13037 section, align to the common page size.
13038 (Output_segment::set_section_list_addresses): Add in_relro
13039 parameter. Change all callers. Align to the page size when
13040 moving from relro to non-relro section.
13041 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13042 segment.
13043 * output.h (class Output_section): Add is_relro_ and
13044 is_relro_local_ fields.
13045 (Output_section::is_relro): New function.
13046 (Output_section::set_is_relro): New function.
13047 (Output_section::is_relro_local): New function.
13048 (Output_section::set_is_relro_local): New function.
13049 (class Output_segment): Update declarations.
13050 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13051 * sparc.cc (Target_sparc::got_section): Likewise.
13052 * x86_64.cc (Target_x86_64::got_section): Likewise.
13053 * testsuite/relro_test_main.cc: New file.
13054 * testsuite/relro_test.cc: New file.
13055 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13056 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13057 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13058 (relro_test.so, relro_test_pic.o): New targets.
13059 * testsuite/Makefile.in: Rebuild.
13060
a984ee1d
ILT
130612008-05-16 Ian Lance Taylor <iant@google.com>
13062
01676dcd
ILT
13063 * output.cc (Output_segment::add_output_section): Remove front
13064 parameter.
13065 * output.h (class Output_segment): Remove
13066 add_initial_output_section and overloaded add_output_section.
13067 Update declaration of remaining add_output_section.
13068 * layout.cc (Layout::create_interp): Call add_output_section
13069 rather than add_initial_output_section.
13070 (Layout::finish_dynamic_section): Likewise.
13071
497897f9
ILT
13072 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13073 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13074 know the dynamic type.
13075 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13076 field. Initialize it in constructor.
13077 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13078 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13079 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13080 reloc.
13081
a984ee1d
ILT
13082 * output.cc (Output_reloc::get_address): Change return type to
13083 Elf_Addr.
13084 * output.h (class Output_reloc): Update get_address declaration.
13085 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13086 for section addresses.
13087
55ba0940
ILT
130882008-05-09 Ian Lance Taylor <iant@google.com>
13089
13090 PR 6493
13091 * gold.cc (gold_nomem): Use return value of write.
13092
75517b77
ILT
130932008-05-08 Ian Lance Taylor <iant@google.com>
13094
13095 * symtab.c (Symbol::init_base_output_data): Add version
13096 parameter. Change all callers.
13097 (Symbol::init_base_output_segment): Likewise.
13098 (Symbol::init_base_constant): Likewise.
13099 (Symbol::init_base_undefined): Likewise.
13100 (Sized_symbol::init_output_data): Likewise.
13101 (Sized_symbol::init_output_segment): Likewise.
13102 (Sized_symbol::init_constant): Likewise.
13103 (Sized_symbol::init_undefined): Likewise.
13104 (Symbol_table::do_define_in_output_data): If the new symbol has a
13105 version, mark it as the default.
13106 (Symbol_table::do_define_in_output_segment): Likewise.
13107 (Symbol_table::do_define_as_constant): Likewise.
13108 * symtab.h (class Symbol): Update declarations.
13109 (class Sized_symbol): Likewise.
13110 * resolve.cc (Symbol::override_version): New function.
c42e122e 13111 (Symbol::override_base): Call override_version.
75517b77
ILT
13112 (Symbol::override_base_with_special): Likewise.
13113 * testsuite/ver_script_8.script: New file.
13114 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13115 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13116 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13117 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13118
f1f70eae
ILT
131192008-05-06 Ian Lance Taylor <iant@google.com>
13120
f3e9c5c5
ILT
13121 PR 6049
13122 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13123 functions.
13124 (class General_options): Remove existing --undefined, and add
13125 --no-undefined instead. Add new --undefined as synonym for -u.
13126 * archive.cc (Archive::add_symbols): Check whether symbol was
13127 named with -u.
13128 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13129 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13130 all uses. Add IS_UNDEFINED. Update declarations to split
13131 different versions of init_base. Declare init_base_undefined.
13132 (Symbol::is_defined): Handle IS_UNDEFINED.
13133 (Symbol::is_undefined): Likewise.
13134 (Symbol::is_weak_undefined): Call is_undefined.
13135 (Symbol::is_absolute): Handle IS_CONSTANT.
13136 (class Sized_symbol): Update declarations to split different
13137 versions of init. Declare init_undefined.
13138 (class Symbol_table): Declare new functions.
13139 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13140 Change all callers.
13141 (Symbol::init_base_output_data): Likewise.
13142 (Symbol::init_base_output_segment): Likewise.
13143 (Symbol::init_base_constant): Likewise.
13144 (Symbol::init_base_undefined): New function.
13145 (Sized_symbol::init_object): Rename from init. Change all
13146 callers.
13147 (Sized_symbol::init_output_data): Likewise.
13148 (Sized_symbol::init_output_segment): Likewise.
13149 (Sized_symbol::init_constant): Likewise.
13150 (Sized_symbol::init_undefined): New function.
13151 (Symbol_table::add_undefined_symbols_from_command_line): New
13152 function.
13153 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13154 function.
13155 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13156 (Symbol::output_section): Likewise.
13157 (Symbol::set_output_section): Likewise.
13158 (Symbol_table::sized_finalize_symbol): Likewise.
13159 (Symbol_table::sized_write_globals): Likewise.
13160 * resolve.cc (Symbol_table::should_override): Likewise.
13161 (Symbol::override_base_with_special): Likewise.
13162
8bdcdf2c
ILT
13163 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13164 symbol, change it to have default visibility.
13165 * testsuite/protected_1.cc: New file.
13166 * testsuite/protected_2.cc: New file.
13167 * testsuite/protected_3.cc: New file.
13168 * testsuite/protected_main_1.cc: New file.
13169 * testsuite/protected_main_2.cc: New file.
13170 * testsuite/protected_main_3.cc: New file.
13171 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13172 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13173 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13174 (protected_1.so): New target.
13175 (protected_1_pic.o, protected_2_pic.o): New targets.
13176 (protected_3_pic.o): New target.
13177 (check_PROGRAMS): Add protected_2.
13178 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13179 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13180 * testsuite/Makefile.in: Rebuild.
13181
2b706932
ILT
13182 * options.h (DEFINE_var): Add set_user_set_##varname__.
13183 (DEFINE_bool_alias): New macro.
13184 (class General_options): Define -Bstatic using DEFINE_bool_alias
13185 rather than DEFINE_special. Add --undefined as an alias for -z
13186 defs.
13187 * options.cc (General_options::parse_Bstatic): Remove.
13188
d82a5bcc
ILT
13189 * options.h (class General_options): Add --fatal-warnings.
13190 * main.cc (main): Implement --fatal-warnings.
13191 * errors.h (Errors::warning_count): New function.
13192
f1f70eae
ILT
13193 * options.h (class General_options): Add -Bsymbolic-functions.
13194 * symtab.h (Symbol::is_preemptible): Check for
13195 -Bsymbolic-functions.
13196
8825ac63
ILT
131972008-05-05 Ian Lance Taylor <iant@google.com>
13198
d98bc257
ILT
13199 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13200 as noVARNAME rather than no-VARNAME.
13201 (class General_options): Add option -z combreloc.
13202 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13203 get_address.
13204 (Output_reloc::sort_before) [SHT_REL]: New function.
13205 (Output_reloc::sort_before) [SHT_RELA]: New function.
13206 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13207 Sort_relocs_comparison.
13208 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13209 parameter. Change all callers.
13210 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13211 sort_relocs parameter. Change all callers.
13212 * output.cc (Output_reloc::get_address): New function, broken out
13213 of write_rel.
13214 (Output_reloc::write_rel): Call it.
13215 (Output_reloc::compare): New function.
13216 (Output_data_reloc_base::do_write): Optionally sort relocs.
13217
60b2b4e7
ILT
13218 * configure.ac: If targ_extra_obj is set, link it in.
13219 * configure.tgt: Initialize all variables.
13220 (x86_64*): Set targ_extra_obj and targ_extra_size.
13221 * configure: Rebuild.
13222
8825ac63
ILT
13223 * object.cc (Sized_relobj::include_section_group): Adjust section
13224 indexes read from group data. Build vector to pass to
13225 layout_group.
13226 * layout.cc (Layout::layout_group): Add flags and shndxes
13227 parameters. Remove contents parameter. Change caller. Update
13228 explicit instantiations.
13229 * layout.h (class Layout): Update layout_group declaration.
13230 * output.cc (Output_data_group::Output_data_group): Add flags and
13231 input_shndxes parameters. Remove contents parameter. Change
13232 caller.
13233 (Output_data_group::do_write): Change input_sections_ to
13234 input_shndxes_.
13235 * output.h (class Output_data_group): Update constructor
13236 declaration. Rename input_sections_ to input_shndxes_.
13237 * testsuite/many_sections_test.cc: Add template.
13238
e94cf127
CC
132392008-04-30 Cary Coutant <ccoutant@google.com>
13240
4418b2d5
CC
13241 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13242
e94cf127
CC
13243 * layout.cc (Layout::include_section): Refactored check for debug
13244 info section.
13245 (Layout::add_comdat): Add new parameters. Change type
13246 of signature parameter. Add object and shndx to signatures table.
13247 (Layout::find_kept_object): New function.
13248 * layout.h: Include <cstring>.
13249 (Layout::is_debug_info_section): New function.
13250 (Layout::add_comdat): Add new parameters.
13251 (Layout::find_kept_object): New function.
13252 (Layout::Kept_section): New struct.
13253 (Layout::Signatures): Change type of map range.
13254 * object.cc (Relobj::output_section_address): New function.
13255 (Sized_relobj::include_section_group): Add new parameters. Change
13256 calls to Layout::add_comdat. Change to build table of kept comdat
13257 groups and table mapping discarded sections to kept sections.
13258 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13259 (Sized_relobj::do_layout): Change calls to include_section_group and
13260 include_linkonce_section.
13261 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13262 value to zero when section is discarded.
13263 (Sized_relobj::map_to_kept_section): New function.
13264 * object.h (Relobj::output_section_address): New function.
13265 (Relobj::Comdat_group): New type.
13266 (Relobj::find_comdat_group): New function.
13267 (Relobj::Comdat_group_table): New type.
13268 (Relobj::Kept_comdat_section): New type.
13269 (Relobj::Kept_comdat_section_table): New type.
13270 (Relobj::add_comdat_group): New function.
13271 (Relobj::set_kept_comdat_section): New function.
13272 (Relobj::get_kept_comdat_section): New function.
13273 (Relobj::comdat_groups_): New field.
13274 (Relobj::kept_comdat_sections_): New field.
13275 (Symbol_value::input_value): Update comment.
13276 (Sized_relobj::map_to_kept_section) New function.
13277 (Sized_relobj::include_linkonce_section): Add new parameter.
13278 * target-reloc.h (Comdat_behavior): New type.
13279 (get_comdat_behavior): New function.
13280 (relocate_section): Add code to map a discarded section to the
13281 corresponding kept section when applying a relocation.
13282
e4e5049b
CS
132832008-04-30 Craig Silverstein <csilvers@google.com>
13284
13285 * dwarf_reader.cc (next_generation_count): New static var.
13286 (Addr2line_cache_entry): New struct.
13287 (addr2line_cache): New static var.
13288 (Dwarf_line_info::one_addr2line): Added caching.
13289 (Dwarf_line_info::clear_addr2line_cache): New function.
13290 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13291 cache-size parameter.
13292 (Dwarf_line_info::one_addr2line_cache): New function.
13293 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13294 new cache-size argument to one_addr2line(), and clear cache.
13295
d09e9154
CC
132962008-04-28 Cary Coutant <ccoutant@google.com>
13297
13298 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13299 R_386_PC8 relocations.
13300
7ef73768
ILT
133012008-04-23 Ian Lance Taylor <iant@google.com>
13302
55438702
ILT
13303 * object.cc (Sized_relobj::include_section_group): Check for
13304 invalid section group.
13305
c165fb93
ILT
13306 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13307 header size.
13308
7ef73768
ILT
13309 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13310 than read for file header.
13311 * archive.cc (Archive::include_member): Likewise.
13312
6194aaab
L
133132008-04-23 Paolo Bonzini <bonzini@gnu.org>
13314
13315 * aclocal.m4: Regenerate.
13316 * configure: Regenerate.
13317
d491d34e
ILT
133182008-04-19 Ian Lance Taylor <iant@google.com>
13319
5ea2bac6
ILT
13320 * version.cc (version_string): Bump to 1.6.
13321
7bc3e21a
ILT
13322 * testsuite/Makefile.am (many_sections_r_test): New target.
13323 (many_sections_r_test_SOURCES): Remove.
13324 (many_sections_r_test_DEPENDENCIES): Remove.
13325 (many_sections_r_test_LDFLAGS): Remove.
13326 (many_sections_r_test_LDADD): Remove.
13327
7fcd3aa9
ILT
13328 * object.cc (Sized_relobj::do_add_symbols): Always pass
13329 local_symbol_count_ to add_from_relobj.
13330
4c94d6ae
ILT
13331 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13332 every thousand variables.
13333 * testsuite/Makefile.in: Rebuild.
13334
d491d34e
ILT
13335 * object.cc (Xindex::initialize_symtab_xindex): New function.
13336 (Xindex::read_symtab_xindex): New function.
13337 (Xindex::sym_xindex_to_shndx): New function.
13338 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13339 available.
13340 (Sized_relobj::do_initialize_xindex): New function.
13341 (Sized_relobj::do_read_symbols): Adjust section links.
13342 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13343 parameter. Change all callers.
13344 (Sized_relobj::include_section_group): Adjust section links and
13345 symbol section indexes.
13346 (Sized_relobj::do_layout): Adjust section links.
13347 (Sized_relobj::do_count_local_symbols): Adjust section links and
13348 symbol section indexes.
13349 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13350 ordinary and special symbols.
13351 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13352 dynsym_xindex parameters. Change all callers. Adjust section
13353 links. Use SHN_XINDEX when needed.
13354 (Sized_relobj::get_symbol_location_info): Adjust section links.
13355 Don't get fooled by special symbols.
13356 * object.h (class Xindex): Define.
13357 (class Object): Add xindex_ parameter. Declare virtual functoin
13358 do_initialize_xindex.
13359 (Object::adjust_sym_shndx): New function.
13360 (Object::set_xindex): New protected function.
13361 (class Symbol_value): Add is_ordinary_shndx_ field.
13362 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13363 (Symbol_value::value): Assert ordinary section.
13364 (Symbol_value::initialize_input_to_output_map): Likewise.
13365 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13366 Change all callers.
13367 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13368 all callers.
13369 (class Sized_relobj): Update declarations.
13370 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13371 parameter. Change all callers.
13372 (Sized_relobj::adjust_shndx): New function.
13373 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13374 field.
13375 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13376 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13377 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13378 (Sized_dynobj::read_dynsym_section): Adjust section links.
13379 (Sized_dynobj::read_dynamic): Likewise.
13380 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13381 section links.
13382 (Sized_dynobj::do_initialize_xindex): New function.
13383 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13384 do_initialize_xindex.
13385 (Sized_dynobj::adjust_shndx): New function.
13386 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13387 dynsym_xindex_ fields.
13388 (Layout::finalize): Add a call to set_section_indexes before
13389 creating the symtab sections.
13390 (Layout::set_section_indexes): Don't do anything if the section
13391 already has a section index.
13392 (Layout::create_symtab_sections): Add shnum parameter. Change
13393 caller. Create .symtab_shndx section if needed.
13394 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13395 caller.
13396 (Layout::allocated_output_section_count): New function.
13397 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13398 needed.
13399 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13400 fields. Update declarations.
13401 (Layout::symtab_xindex): New function.
13402 (Layout::dynsym_xindex): New function.
13403 (class Write_symbols_task): Add layout_ field.
13404 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13405 Change caller.
13406 * output.cc (Output_section_headers::Output_section_headers): Add
13407 shstrtab_section parameter. Change all callers.
13408 (Output_section_headers::do_sized_write): Store overflow values
13409 for section count and section string table section index in
13410 section header zero.
13411 (Output_file_header::do_sized_write): Check for overflow of
13412 section count and section string table section index.
13413 (Output_symtab_xindex::do_write): New function.
13414 (Output_symtab_xindex::endian_do_write): New function.
13415 * output.h (class Output_section_headers): Add shstrtab_section_.
13416 Update declarations.
13417 (class Output_symtab_xindex): Define.
13418 (Output_section::has_out_shndx): New function.
13419 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13420 field.
13421 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13422 Change all callers.
13423 (Sized_symbol::init): Likewise.
13424 (Symbol::output_section): Check for ordinary symbol.
13425 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13426 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13427 callers.
13428 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13429 Change all callers. Simplify handling of symbols from sections
13430 not included in the link.
13431 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13432 distinction.
13433 (Weak_alias_sorter::operator()): Assert that symbols are
13434 ordinary.
13435 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13436 distinction.
13437 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13438 parameters. Change all callers.
13439 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13440 symbol distinction. Use SHN_XINDEX when needed.
13441 (Symbol_table::write_section_symbol): Add symtab_xindex
13442 parameter. Change all callers.
13443 (Symbol_table::sized_write_section_symbol): Likewise. Use
13444 SHN_XINDEX when needed.
13445 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13446 declarations.
13447 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13448 (Symbol::is_defined): Check is_ordinary.
13449 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13450 (Symbol::is_absolute, Symbol::is_common): Likewise.
13451 (class Sized_symbol): Update declarations.
13452 (class Symbol_table): Update declarations.
13453 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13454 parameters. Change all callers.
13455 (Sized_symbol::override): Likewise.
13456 (Symbol_table::override): Likewise.
13457 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13458 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13459 is_ordinary, and orig_st_shndx parameters. Change all callers.
13460 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13461 to be in an ordinary section.
13462 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13463 object and is_ordinary parameters. Change all callers.
13464 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13465 Change all callers. Don't add undefined or non-ordinary symbols
13466 to reloc_map_.
13467 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13468 Change all callers.
13469 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13470 declarations.
13471 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13472 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13473 (Sized_relobj::relocate_sections): Likewise.
13474 * target-reloc.h (scan_relocs): Adjust section symbol index.
13475 (scan_relocatable_relocs): Likewise.
13476 * i386.cc (Scan::local): Check for ordinary symbols.
13477 * sparc.cc (Scan::local): Likewise.
13478 * x86_64.cc (Scan::local): Likewise.
13479 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13480 to symbol_section_and_value.
13481 * testsuite/many_sections_test.cc: New file.
13482 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13483 (check_PROGRAMS): Add many_sections_test.
13484 (many_sections_test_SOURCES): Define.
13485 (many_sections_test_DEPENDENCIES): Define.
13486 (many_sections_test_LDFLAGS): Define.
13487 (BUILT_SOURCES): Add many_sections_define.h.
13488 (many_sections_define.h): New target.
13489 (BUILT_SOURCES): Add many_sections_check.h.
13490 (many_sections_check.h): New target.
13491 (check_PROGRAMS): Add many_sections_r_test.
13492 (many_sections_r_test_SOURCES): Define.
13493 (many_sections_r_test_DEPENDENCIES): Define.
13494 (many_sections_r_test_LDFLAGS): Define.
13495 (many_sections_r_test_LDADD): Define.
13496 (many_sections_r_test.o): New target.
13497 * testsuite/Makefile.in: Rebuild.
13498
c5818ff1
CC
134992008-04-17 Cary Coutant <ccoutant@google.com>
13500
13501 * errors.cc (Errors::info): New function.
13502 (gold_info): New function.
13503 * errors.h (Errors::info): New function.
13504 * gold.h (gold_info): New function.
13505 * object.cc (Input_objects::add_object): Print trace output.
13506 * options.cc (options::parse_set): New function.
13507 (General_options::parse_wrap): Deleted.
13508 (General_options::General_options): Deleted initializer.
13509 * options.h (options::String_set): New typedef.
13510 (options::parse_set): New function.
13511 (DEFINE_set): New macro.
13512 (General_options::wrap): Changed to use DEFINE_set. Changed
13513 callers of any_wrap_symbols and is_wrap_symbol.
13514 (General_options::trace, General_options::trace_symbol):
13515 New options.
13516 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13517 (General_options::wrap_symbols_): Deleted.
13518 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13519
b5be4a7c
DM
135202008-04-17 David S. Miller <davem@davemloft.net>
13521
13522 * options.cc (General_options::parse_V): New function.
13523 * options.h: Add entries for -V and -Qy.
13524
155a0dd7
ILT
135252008-04-17 Ian Lance Taylor <iant@google.com>
13526
13527 * common.cc (Symbol_table::allocate_commons): Remove options
13528 parameter. Change caller.
13529 (Symbol_table::do_allocate_commons): Remove options parameter.
13530 Change caller. Just call do_allocate_commons_list twice.
13531 (Symbol_table::do_allocate_commons_list): New function, broken out
13532 of do_allocate_commons.
13533 * common.h (class Allocate_commons_task): Remove options_ field.
13534 Update constructor.
13535 * symtab.cc (Symbol_table::Symbol_table): Initialize
13536 tls_commons_.
13537 (Symbol_table::add_from_object): Put TLS common symbols on
13538 tls_commons_ list.
13539 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13540 which are IN_OUTPUT_DATA.
13541 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13542 allocate_commons and do_allocate_commons declarations. Declare
13543 do_allocate_commons_list.
13544 * gold.cc (queue_middle_tasks): Update creation of
13545 Allocate_commons_task to not pass options.
13546 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13547 (TLS_TEST_C_FLAGS): New variable.
13548 (tls_test_c_pic.o): New target.
13549 (tls_test_shared.so): Link in tls_test_c_pic.o.
13550 (tls_test_c_pic_ie.o): New target.
13551 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13552 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13553 (tls_test_c.o): New target.
13554 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13555 (tls_pic_test_LDADD): Likewise.
13556 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13557 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13558 (tls_test_c_gnu2.o): New target.
13559 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13560 tls_test_c_gnu2.o.
13561 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13562 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13563 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13564 * testsuite/tls_test.cc: Include "config.h".
13565 (t_last): Call t11_last.
13566 * testsuite/tls_test.h (t11, t11_last): Declare.
13567 * testsuite/tls_test_c.c: New file.
13568 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13569 * configure.ac: Check for OpenMP support.
13570 * configure, config.in, Makefile.in: Rebuild.
13571 * testsuite/Makefile.in: Rebuild.
13572
edfbb029
CC
135732008-04-16 Cary Coutant <ccoutant@google.com>
13574
13575 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13576 (Target_i386::tls_base_symbol_defined_): New field.
13577 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13578 (Target_i386::Scan::global): Likewise.
13579 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13580 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13581 (Target_x86_64::tls_base_symbol_defined_): New field.
13582 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13583 (Target_x86_64::Scan::global): Likewise.
13584
f3c69fca
CC
135852008-04-16 Cary Coutant <ccoutant@google.com>
13586
13587 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13588 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13589 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13590 building shared libraries.
13591 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13592 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13593 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13594 * testsuite/Makefile.in: Rebuild.
13595 * testsuite/weak_undef.h: New file.
13596 * testsuite/weak_undef_file1.cc: Add extra test cases.
13597 * testsuite/weak_undef_file2.cc: Likewise.
13598 * testsuite/weak_undef_test.cc: Likewise.
13599
7c414435
DM
136002008-04-16 David S. Miller <davem@davemloft.net>
13601
32b769e1
DM
13602 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13603 Add issued_non_pic_error_ field. Declare check_non_pic.
13604 (Target_sparc::Scan::check_non_pic): New function.
13605 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13606 (Target_sparc::Scan::global): Likewise.
13607
11936fb1
DM
13608 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13609 * configure: Rebuild.
13610
7c414435
DM
13611 * options.h (DEFINE_enable): New macro.
13612 (new_dtags): New enable option.
13613 (initfirst, interpose, loadfltr, nodefaultlib,
13614 nodelete, nodlopen, nodump): New -z options.
13615 * layout.cc (Layout:finish_dynamic_section): If new
13616 dtags enabled, emit DT_RUNPATH. Also, emit a
13617 DT_FLAGS_1 containing any specified -z flags.
13618
85c7bf8b
ILT
136192008-04-16 Ian Lance Taylor <iant@google.com>
13620
12c0daef
ILT
13621 * copy-relocs.cc: New file.
13622 * copy-relocs.h: New file.
13623 * reloc.cc: Remove Copy_relocs code.
13624 * reloc.h: Likewise.
13625 * reloc-types.h (struct Reloc_types) [both versions]: Add
13626 get_reloc_addend_noerror.
13627 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13628 variants of add_global which take an addend which must be zero.
13629 * i386.cc: Include "copy-relocs.h".
13630 (class Target_i386): Change type of copy_relocs_ to variable,
13631 update initializer.
13632 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13633 Change all callers.
13634 (Target_i386::do_finalize_sections): Change handling of
13635 copy_relocs_.
13636 * sparc.cc: Include "copy-relocs.h".
13637 (class Target_sparc): Change type of copy_relocs_ to variable,
13638 update initializer.
13639 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13640 Change all callers.
13641 (Target_sparc::do_finalize_sections): Change handling of
13642 copy_relocs_.
13643 * x86_64.cc: Include "copy-relocs.h".
13644 (class Target_x86_64): Change type of copy_relocs_ to variable,
13645 update initializer.
13646 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13647 class. Change all callers.
13648 (Target_x86_64::do_finalize_sections): Change handling of
13649 copy_relocs_.
13650 * Makefile.am (CCFILES): Add copy-relocs.cc.
13651 (HFILES): Add copy-relocs.h.
13652
4f4995b6
ILT
13653 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13654
85c7bf8b
ILT
13655 * testsuite/script_test_4.sh: Permit leading zeroes.
13656
4f2a9edd
ILT
136572008-04-15 Ian Lance Taylor <iant@google.com>
13658
e6188289
ILT
13659 * script-sections.cc (Script_sections::create_segments): Use
13660 header_size_adjustment even when there is enough room for the
13661 headers.
13662 * testsuite/script_test_4.sh: New file.
13663 * testsuite/script_test_4.t: New file.
13664 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13665 (check_DATA): Add script_test_4.stdout.
13666 (MOSTLYCLEANFILES): Likewise.
13667 (script_test_4): New target.
13668 (script_test_4.stdout): New target.
13669 * testsuite/Makefile.in: Rebuild.
13670
4f2a9edd
ILT
13671 * sparc.cc: Add definitions for Output_data_plt_sparc class
13672 constants.
13673
f5314dd5
DM
136742008-04-14 David S. Miller <davem@davemloft.net>
13675
13676 * sparc.cc: New file.
13677 * Makefile.am (TARGETSOURCES): Add sparc.cc
13678 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13679 * configure.tgt: Document targ_extra_size and
13680 targ_extra_big_endian. Add entries for sparc-* and
13681 sparc64-*.
13682 * configure.ac: Handle targ_extra_size and
13683 targ_extra_big_endian.
13684 * Makefile.in: Rebuild.
13685 * configure: Likewise.
13686 * po/POTFILES.in: Likewise.
13687 * po/gold.pot: Likewise.
13688
154e0e9a
ILT
136892008-04-14 Ian Lance Taylor <iant@google.com>
13690
13691 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13692 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13693 in the name/type/flags to section mapping. Don't call
13694 allocate_output_section.
13695 (Layout::choose_output_section): Change parameter from adjust_name
13696 to is_input_section. Don't permit input sections after sections
13697 are attached to segments. Don't call allocate_output_section.
13698 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13699 not write_enable_output_section.
13700 (Layout::make_output_section): Don't push to
13701 unattached_section_list_ nor call attach_to_segment. Call
13702 attach_section_to_segment if sections are attached.
13703 (Layout::attach_sections_to_segments): New function.
13704 (Layout::attach_section_to_segment): New function.
13705 (Layout::attach_allocated_section_to_segment): Rename from
13706 attach_to_segment. Remove flags parameter.
13707 (Layout::allocate_output_section): Remove function.
13708 (Layout::write_enable_output_section): Remove function.
13709 * layout.h (class Layout): Update for above changes. Add new
13710 field sections_are_attached_.
13711 * output.h (Output_section::update_flags_for_input_section): New
13712 function.
13713 * output.cc (Output_section::add_input_section): Call
13714 update_flags_for_input_section.
13715 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13716
009a67a2
CC
137172008-04-11 Cary Coutant <ccoutant@google.com>
13718
13719 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13720 thought unnecessary.
13721 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13722
759b1a24
ILT
137232008-04-11 Ian Lance Taylor <iant@google.com>
13724
13725 * output.h (class Output_section_data): Remove inline definition
13726 of set_addralign.
13727 * output.cc (Output_section_data::set_addralign): New function.
13728
c2b45e22
CC
137292008-04-11 Cary Coutant <ccoutant@google.com>
13730
13731 Add support for TLS descriptors for i386 and x86_64.
13732 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13733 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13734 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13735 GOT_TYPE_TLS_DESC.
13736 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13737 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13738 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13739 relocations.
13740 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13741 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13742 Fix problem with initial-exec relocations.
13743 (Target_i386::Relocate::relocate_tls): Likewise.
13744 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13745 relaxation.
13746 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13747 support for section-plus-offset dynamic table entries.
13748 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13749 (Output_data_dynamic::Dynamic_entry): Add support for
13750 section-plus-offset dynamic table entries.
13751 (Output_data_dynamic::Classification): Likewise.
13752 (Output_data_dynamic::classification_): Renamed offset_.
13753 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13754 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13755 (Target_x86_64::make_plt_section): New function.
13756 (Target_x86_64::reserve_tlsdesc_entries): New function.
13757 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13758 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13759 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13760 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13761 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13762 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13763 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13764 add extra PLT entry for TLS descriptors.
13765 (Output_data_plt_x86_64::got_): New field.
13766 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13767 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13768 fields.
13769 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13770 descriptors.
13771 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13772 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13773 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13774 R_386_TLS_DESC_CALL relocations.
13775 (Target_x86_64::Scan::global): Likewise.
13776 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13777 for TLS descriptors.
13778 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13779 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13780 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13781 GD-to-IE relaxation.
13782 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13783 and TLS_DESCRIPTORS.
13784 * Makefile.in: Rebuild.
13785 * configure: Rebuild.
13786 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13787 (tls_test_shared2.so): New target.
13788 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13789 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13790 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13791 (tls_shared_gd_to_ie_test_LDADD): New variable.
13792 (tls_shared_gnu2_gd_to_ie_test): New target.
13793 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13794 New targets.
13795 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13796 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13797 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13798 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13799 (tls_shared_gnu2_test): New target.
13800 (tls_test_gnu2_shared.so): New target.
13801 (tls_shared_gnu2_test_SOURCES): New variable.
13802 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13803 (tls_shared_gnu2_test_LDFLAGS): New variable.
13804 (tls_shared_gnu2_test_LDADD): New variable.
13805 * testsuite/Makefile.in: Rebuild.
13806 * testsuite/Makefile.
13807
83bfb6b7
ILT
138082008-04-11 Ian Lance Taylor <iant@google.com>
13809
13810 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13811 justsyms.t.
13812 * testsuite/Makefile.in: Rebuild.
13813
13814 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13815 long.
13816 * testsuite/script_test_2.cc (main): Adjust test.
13817
706e1f5e
ILT
138182008-04-11 David S. Miller <davem@davemloft.net>
13819 Ian Lance Taylor <iant@google.com>
13820
13821 * options.h (General_options): Add entries for '-Y' and
13822 '-relax'.
13823 * options.cc (General_options:finalize): If -Y was used, add those
13824 entries to the library path instead of the default "/lib" and
13825 "/usr/lib".
13826
7c98e6bb
DM
138272008-04-11 David S. Miller <davem@davemloft.net>
13828
13829 * testsuite/justsyms.t: Start at 0x100.
13830 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13831 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13832 long.
13833 * testsuite/script_test_2.cc: Adjust string and section length
13834 checks.
7c98e6bb 13835
99a37bfd
ILT
138362008-04-09 Ian Lance Taylor <iant@google.com>
13837
2cefc357
ILT
13838 PR gold/5996
13839 * script-sections.cc (Sections_element::allocate_to_segment): Add
13840 orphan parameter.
13841 (Output_section_definition::allocate_to_segment): Likewise.
13842 (Orphan_output_section::allocate_to_segment): Likewise.
13843 (Script_sections::attach_sections_using_phdrs_clause): Don't
13844 propagate non-PT_LOAD segments to orphan sections.
13845 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13846 readelf rather than objdump.
13847 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13848 .interp section and PT_INTERP segment are the same size.
13849 * testsuite/Makefile.in: Rebuild.
13850
99a37bfd
ILT
13851 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13852 aliases for symbols defined in the same object.
13853 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13854 (weak_alias_test_SOURCES): New variable.
13855 (weak_alias_test_DEPENDENCIES): New variable.
13856 (weak_alias_test_LDFLAGS): New variable.
13857 (weak_alias_test_LDADD): New variable.
13858 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13859 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13860 (weak_alias_test_3.o): New target.
13861 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13862 * testsuite/weak_alias_test_main.cc: New file.
13863 * testsuite/weak_alias_test_1.cc: New file.
13864 * testsuite/weak_alias_test_2.cc: New file.
13865 * testsuite/weak_alias_test_3.cc: New file.
13866
780e49c5
ILT
138672008-04-08 Ian Lance Taylor <iant@google.com>
13868
cdb0b8f5
ILT
13869 * options.h (class General_options): Add --noinhibit-exec option.
13870 * main.cc (main): Check --noinhibit-exec.
13871
0864d551
ILT
13872 * options.h (class General_options): Define --wrap as a special
13873 option. Add wrap_symbols_ field.
13874 (General_options::any_wrap_symbols): New function.
13875 (General_options::is_wrap_symbol): New function.
13876 * options.cc (General_options::parse_wrap): New function.
13877 (General_options::General_options): Initialize wrap_symbols_.
13878 * symtab.cc (Symbol_table::wrap_symbol): New function.
13879 (Symbol_table::add_from_object): Handle --wrap.
13880 * symtab.h (class Symbol_table): Declare wrap_symbol.
13881 * target.h (Target::wrap_char): New function.
13882 (Target::Target_info): Add wrap_char field.
13883 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13884 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13885 * testsuite/testfile.cc (Target_test::test_target_info):
13886 Likewise.
13887
789aa6de
ILT
13888 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13889 there is one.
13890
2c38906f
ILT
13891 * layout.h (class Layout): Add added_eh_frame_data_ field.
13892 * layout.cc (Layout::Layout): Initialize new field.
13893 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13894 output section until we find a section we merged successfully.
13895 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13896 that the size be non-zero.
13897
780e49c5
ILT
13898 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13899 qualifier.
13900
7fcd0256
ILT
139012008-04-08 Craig Silverstein <csilvers@google.com>
13902
13903 * configure.ac: Export new conditional variable HAVE_ZLIB.
13904 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13905 on HAVE_ZLIB.
13906 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13907 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13908
6835af53
ILT
139092008-04-07 Ian Lance Taylor <iant@google.com>
13910
e24f324c
ILT
13911 * version.cc (version_string): Set to "1.5".
13912
a036edd8
ILT
13913 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13914 Add issued_non_pic_error_ field. Declare check_non_pic.
13915 (Target_x86_64::Scan::check_non_pic): New function.
13916 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13917 (Target_x86_64::Scan::global): Likewise.
13918
624f8810
ILT
13919 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13920 addend parameter. Change caller. Handle merge sections.
13921 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13922 Address to Addend. Don't add in the result of
13923 local_section_offset, pass down the addend and use the returned
13924 value.
13925 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13926 Update declarations of local_section_offset and symbol_value.
13927 * testsuite/two_file_test_1.cc (t18): New function.
13928 * testsuite/two_file_test_2.cc (f18): New function.
13929 * testsuite/two_file_test_main.cc (main): Call t18.
13930 * testsuite/two_file_test.h (t18, f18): Declare.
13931
6835af53
ILT
13932 * configure.ac: Don't test for objdump, c++filt, or readelf.
13933 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13934 conditionals.
13935 (TEST_READELF): New variable.
13936 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13937 (check_PROGRAMS): Add two_file_strip_test.
13938 (two_file_strip_test): New target.
13939 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13940 (two_file_same_shared_strip_test_SOURCES): New variable.
13941 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13942 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13943 (two_file_same_shared_strip_test_LDADD): New variable.
13944 (two_file_shared_strip.so): New target.
13945 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13946 (ver_test_5.syms, ver_test_7.syms): Likewise.
13947 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13948 (strip_test_3.stdout): Use TEST_OBJDUMP.
13949 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13950
86925eef
CC
139512008-04-04 Cary Coutant <ccoutant@google.com>
13952
13953 * symtab.h (Symbol::is_weak_undefined): New function.
13954 (Symbol::is_strong_undefined): New function.
13955 (Symbol::is_absolute): New function.
13956 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13957 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13958 absolute symbols.
13959 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13960 (weak_undef_test): New target.
13961 * testsuite/Makefile.in: Rebuild.
13962 * testsuite/weak_undef_file1.cc: New file.
13963 * testsuite/weak_undef_file2.cc: New file.
13964 * testsuite/weak_undef_test.cc: New file.
13965
126f3ece
ILT
139662008-04-03 Craig Silverstein <csilvers@google.com>
13967
13968 * compressed_output.h (class Output_compressed_section): Use
13969 unsigned buffer.
13970 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13971 add zlib header.
13972 (zlib_compressed_suffix): Removed.
13973 (Output_compressed_section::set_final_data_size): Use unsigned
13974 buffers.
13975 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13976 Fix linker invocation.
13977 (flagstest_o_specialfile_and_compress_debug_sections):
13978 Likewise.
13979 * testsuite/Makefile.in: Regenerated.
13980
deae2a14
DM
139812008-04-02 David S. Miller <davem@davemloft.net>
13982
13983 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13984 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13985
70752818
ILT
139862008-04-02 Craig Silverstein <csilvers@google.com>
13987
13988 * TODO: New file.
13989
39d0cb0e
ILT
139902008-04-02 Ian Lance Taylor <iant@google.com>
13991
13992 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13993 parameters. Update for new key type to views_. Change all
13994 callers.
13995 (File_read::read): Adjust for byteshift in returned view.
13996 (File_read::add_view): New function, broken out of
13997 find_and_make_view.
13998 (File_read::make_view): New function, broken out of
13999 find_and_make_view.
14000 (File_read::find_or_make_view): Add offset and aligned
14001 parameters. Rewrite accordingly. Change all callers.
14002 (File_read::get_view): Add offset and aligned parameters. Adjust
14003 for byteshift in return value.
14004 (File_read::get_lasting_view): Likewise.
14005 * fileread.h (class File_read): Update declarations.
14006 (class File_read::View): Add byteshift_ field. Add byteshift to
14007 constructor. Add byteshift method.
14008 * archive.h (Archive::clear_uncached_views): New function.
14009 (Archive::get_view): Add aligned parameter. Change all callers.
14010 * object.h (Object::get_view): Add aligned parameter. Change all
14011 callers.
14012 (Object::get_lasting_view): Likewise.
14013
14014 * fileread.cc (File_read::release): Don't call clear_views if
14015 there are multiple objects.
14016 * fileread.h (File_read::clear_uncached_views): New function.
14017 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14018 on the archive.
14019
a1207466
CC
140202008-03-31 Cary Coutant <ccoutant@google.com>
14021
14022 Add thin archive support.
14023 * archive.cc (Archive::armagt): New const.
14024 (Archive::setup): Remove task parameter and calls to unlock.
14025 (Archive::unlock_nested_archives): New function.
14026 (Archive::read_header): Add nested_off parameter. Change
14027 all callers.
14028 (Archive::interpret_header): Likewise.
14029 (Archive::include_all_members): Change to handle thin
14030 archives.
14031 (Archive::include_member): Likewise.
14032 * archive.h (Archive::Archive): Add new parameters and
14033 initializers.
14034 (Archive::armagt): New const.
14035 (Archive::setup): Remove task parameter.
14036 (Archive::unlock_nested_archives): New function.
14037 (Archive::read_header): Add nested_off parameter.
14038 (Archive::interpret_header): Likewise.
14039 (Archive::Nested_archive_table): New typedef.
14040 (Archive::is_thin_archive_): New field.
14041 (Archive::nested_archives_): New field.
14042 (Archive::options_): New field.
14043 (Archive::dirpath_): New field.
14044 (Archive::task_): New field.
14045 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14046 for thin archives. Pass additional parameters to
14047 Archive::Archive. Unlock the archive file after calling
14048 Archive::setup.
cd536b21 14049
479f6503
ILT
140502008-03-29 Ian Lance Taylor <iant@google.com>
14051
686c8caf
ILT
14052 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14053 version symbol to be local.
14054 * testsuite/ver_test_4.sh: New file.
14055 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14056 (check_DATA): Add ver_test_4.syms.
14057 (ver_test_4.syms): New target.
14058 * testsuite/Makefile.in: Rebuild.
14059
ab794b6b
ILT
14060 * output.cc
14061 (Output_section::Input_section_sort_entry::has_priority): New
14062 function.
14063 (Output_section::Input_section_sort_entry::match_file_name): New
14064 function.
14065 (Output_section::Input_section_sort_entry::match_section_name):
14066 Remove.
14067 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14068 Remove.
14069 (Output_section::Input_section_sort_entry::match_section_file):
14070 Remove.
14071 (Output_section::Input_section_sort_compare::operator()): Rewrite
14072 using new Input_section_sort_entry functions. Sort crtbegin and
14073 crtend first. Sort sections with no priority before sections with
14074 a priority.
14075 * testsuite/initpri1.c (d3): Check j != 4.
14076 (cd5): New constructor/destructor function.
14077 (main): Check j != 2.
14078
479f6503
ILT
14079 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14080 new symbol when resolving, don't call set_is_default.
14081 * testsuite/ver_test_7.cc: New file.
14082 * testsuite/ver_test_7.sh: New file.
14083 * testsuite/Makefile.am (ver_test_7.so): New target.
14084 (ver_test_7.o): New target.
14085 (check_SCRIPTS): Add ver_test_7.sh.
14086 (check_DATA): Add ver_test_7.syms.
14087 (ver_test_7.syms): New target.
14088
2fd32231
ILT
140892008-03-28 Ian Lance Taylor <iant@google.com>
14090
14091 * layout.cc (Layout::layout): If we see an input section with a
14092 name that needs sorting, set the must_sort flag for the output
14093 section.
14094 (Layout::make_output_section): If the name of the output section
14095 indicates that it might require sorting, set the may_sort flag.
14096 * output.h (Output_section::may_sort_attached_input_sections): New
14097 function.
14098 (Output_section::set_may_sort_attached_input_sections): New
14099 function.
14100 (Output_section::must_sort_attached_input_sections): New
14101 function.
14102 (Output_section::set_must_sort_attached_input_sections): New
14103 function.
14104 (class Output_section): Declare Input_section_sort_entry. Define
14105 Input_section_sort_compare. Declare
14106 sort_attached_input_sections. Add new fields:
14107 may_sort_attached_input_sections_,
14108 must_sort_attached_input_sections_,
14109 attached_input_sections_are_sorted_.
14110 * output.cc (Output_section::Output_section): Initialize new
14111 fields.
14112 (Output_section::add_input_section): Add an entry to
14113 input_sections_ if may_sort or must_sort are true.
14114 (Output_section::set_final_data_size): Call
14115 sort_attached_input_sections if necessary.
14116 (Output_section::Input_section_sort_entry): Define new class.
14117 (Output_section::Input_section_sort_compare::operator()): New
14118 function.
14119 (Output_section::sort_attached_input_sections): New function.
14120 * configure.ac: Check whether the compiler supports constructor
14121 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14122 * testsuite/initpri1.c: New file.
14123 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14124 CONSTRUCTOR_PRIORITY.
14125 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14126 (initpri1_LDFLAGS): New variable.
14127 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14128
18e6b24e
ILT
141292008-03-27 Ian Lance Taylor <iant@google.com>
14130
49bdd526
ILT
14131 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14132 * testsuite/common_test_1.c: New file.
14133 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14134 (common_test_1_SOURCES): New variable.
14135 (common_test_1_DEPENDENCIES): New variable.
14136 (common_test_1_LDFLAGS): New variable.
14137
18e6b24e
ILT
14138 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14139 and commons_ correctly when NAME/VERSION does not override
14140 NAME/NULL.
14141 * testsuite/ver_test_6.c: New file.
14142 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14143 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14144 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14145
04bf7072
ILT
141462008-03-26 Ian Lance Taylor <iant@google.com>
14147
5871526f
ILT
14148 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14149 of an undefined symbol from a version script.
14150 * testsuite/Makefile.am (ver_test_5.so): New target.
14151 (ver_test_5.o): New target.
14152 (check_SCRIPTS): Add ver_test_5.sh.
14153 (check_DATA): Add ver_test_5.syms.
14154 (ver_test_5.syms): New target.
14155 * testsuite/ver_test_5.cc: New file.
14156 * testsuite/ver_test_5.script: New file.
14157 * testsuite/ver_test_5.sh: New file.
14158 * Makefile.in, testsuite/Makefile.in: Rebuild.
14159
04bf7072
ILT
14160 PR gold/5986
14161 Fix problems building gold with gcc 4.3.0.
14162 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14163 (gold_error_at_location, gold_warning_at_location): Use it.
14164 * configure.ac: Check whether we can compile and use a template
14165 function with a printf attribute.
14166 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14167 when jumping over bytes.
14168 * object.cc: Instantiate Object::read_section_data.
14169 * debug.h: Include <cstring>
14170 * dwarf_reader.cc: Include <algorithm>
14171 * main.cc: Include <cstring>.
14172 * options.cc: Include <cstring>.
14173 * output.cc: Include <cstring>.
14174 * script.cc: Include <cstring>.
14175 * script.h: Include <string>.
14176 * symtab.cc: Include <cstring> and <algorithm>.
14177 * target-select.cc: Include <cstring>.
14178 * version.cc: Include <string>.
14179 * testsuite/testmain.cc: Include <cstdlib>.
14180 * configure, config.in: Rebuild.
14181
874c5b28
ILT
141822008-03-25 Ian Lance Taylor <iant@google.com>
14183
819d6c3a
ILT
14184 * options.cc: Include "../bfd/bfdver.h".
14185 (options::help): Print bug reporting address.
14186
f4b2c6f5
ILT
14187 * version.cc (print_version): Adjust output for current value of
14188 BFD_VERSION_STRING.
14189
14190 * NEWS: New file.
14191
e96caa79
ILT
14192 * options.cc (options::help): Print list of supported targets.
14193 * target-select.h: Include <vector>.
14194 (class Target_selector): Make machine_, size_, and is_big_endian_
14195 fields const. Add bfd_name_ and instantiated_target_ fields.
14196 (Target_selector::Target_selector): Add bfd_name parameter.
14197 (Target_selector::recognize): Make non-virtual, call
14198 do_recognize.
14199 (Target_selector::recognize_by_name): Make non-virtual, call
14200 do_recognize_by_name.
14201 (Target_selector::supported_names): New function.
14202 (Target_selector::bfd_name): New function.
14203 (Target_selector::do_instantiate_target): New pure virtual
14204 function.
14205 (Target_selector::do_recognize): New virtual function.
14206 (Target_selector::do_recognize_by_name): New virtual function.
14207 (Target_selector::instantiate_target): New private function.
14208 (supported_target_names): Declare.
14209 * target-select.cc (Target_selector::Target_selector): Update for
14210 new parameter and fields.
14211 (select_target_by_name): Check that the name matches before
14212 calling recognize_by_name.
14213 (supported_target_names): New function.
14214 * i386.cc (class Target_selector_i386): Update Target_selector
14215 constructor call. Remove recognize and recognize_by_name. Add
14216 do_instantiate_target.
14217 * x86_64.cc (class Target_selector_x86_64): Likewise.
14218 * testsuite/testfile.cc (class Target_selector_test): Update for
14219 changes to Target_selector.
14220
874c5b28
ILT
14221 * README: Rewrite, with some notes on unsupported features.
14222
0a65a3a7
CC
142232008-03-24 Cary Coutant <ccoutant@google.com>
14224
14225 * i386.cc (Target_i386::Got_type): New enum declaration.
14226 (Target_i386::Scan::local): Updated callers of Output_data_got
14227 member functions.
14228 (Target_i386::Scan::global): Likewise.
14229 (Target_i386::Relocate::relocate): Likewise.
14230 (Target_i386::Relocate::relocate_tls): Likewise.
14231 * object.h (Got_offset_list): New class.
14232 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14233 (Sized_relobj::local_got_offset): Likewise.
14234 (Sized_relobj::set_local_got_offset): Likewise.
14235 (Sized_relobj::local_has_tls_got_offset): Removed.
14236 (Sized_relobj::local_tls_got_offset): Removed.
14237 (Sized_relobj::set_local_tls_got_offset): Removed.
14238 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14239 * output.cc (Output_data_got::add_global): Added got_type parameter.
14240 (Output_data_got::add_global_with_rel): Likewise.
14241 (Output_data_got::add_global_with_rela): Likewise.
14242 (Output_data_got::add_global_pair_with_rel): New function.
14243 (Output_data_got::add_global_pair_with_rela): New function.
14244 (Output_data_got::add_local): Added got_type parameter.
14245 (Output_data_got::add_local_with_rel): Likewise.
14246 (Output_data_got::add_local_with_rela): Likewise.
14247 (Output_data_got::add_local_pair_with_rel): New function.
14248 (Output_data_got::add_local_pair_with_rela): New function.
14249 (Output_data_got::add_global_tls): Removed.
14250 (Output_data_got::add_global_tls_with_rel): Removed.
14251 (Output_data_got::add_global_tls_with_rela): Removed.
14252 (Output_data_got::add_local_tls): Removed.
14253 (Output_data_got::add_local_tls_with_rel): Removed.
14254 (Output_data_got::add_local_tls_with_rela): Removed.
14255 * output.h (Output_data_got::add_global): Added got_type parameter.
14256 (Output_data_got::add_global_with_rel): Likewise.
14257 (Output_data_got::add_global_with_rela): Likewise.
14258 (Output_data_got::add_global_pair_with_rel): New function.
14259 (Output_data_got::add_global_pair_with_rela): New function.
14260 (Output_data_got::add_local): Added got_type parameter.
14261 (Output_data_got::add_local_with_rel): Likewise.
14262 (Output_data_got::add_local_with_rela): Likewise.
14263 (Output_data_got::add_local_pair_with_rel): New function.
14264 (Output_data_got::add_local_pair_with_rela): New function.
14265 (Output_data_got::add_global_tls): Removed.
14266 (Output_data_got::add_global_tls_with_rel): Removed.
14267 (Output_data_got::add_global_tls_with_rela): Removed.
14268 (Output_data_got::add_local_tls): Removed.
14269 (Output_data_got::add_local_tls_with_rel): Removed.
14270 (Output_data_got::add_local_tls_with_rela): Removed.
14271 * resolve.cc (Symbol::override_base_with_special): Removed
14272 reference to has_got_offset_ field.
14273 * symtab.cc (Symbol::init_fields): Replaced initialization
14274 of got_offset_ with got_offsets_. Removed initialization
14275 of has_got_offset_
53fcba31 14276 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14277 (Symbol::got_offset): Likewise.
14278 (Symbol::set_got_offset): Likewise.
14279 (Symbol::has_tls_got_offset): Removed.
14280 (Symbol::tls_got_offset): Removed.
14281 (Symbol::set_tls_got_offset): Removed.
14282 (Symbol::got_offset_): Removed.
14283 (Symbol::tls_mod_got_offset_): Removed.
14284 (Symbol::tls_pair_got_offset_): Removed.
14285 (Symbol::got_offsets_): New field.
14286 (Symbol::has_got_offset): Removed.
14287 (Symbol::has_tls_mod_got_offset): Removed.
14288 (Symbol::has_tls_pair_got_offset): Removed.
14289 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14290 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14291 member functions.
14292 (Target_x86_64::Scan::global): Likewise.
14293 (Target_x86_64::Relocate::relocate): Likewise.
14294 (Target_x86_64::Relocate::relocate_tls): Likewise.
14295
bd52eafb
BE
142962008-03-25 Ben Elliston <bje@au.ibm.com>
14297
14298 * yyscript.y: Fix spelling error in comment.
14299
8b105e34
ILT
143002008-03-24 Ian Lance Taylor <iant@google.com>
14301
8ed814a9
ILT
14302 * options.h (class General_options): Define build_id option.
14303 * layout.h (class Layout): Declare write_build_id, create_note,
14304 create_build_id. Add build_id_note_ member.
14305 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14306 "libiberty.h", "md5.h", "sha1.h".
14307 (Layout::Layout): Initialize eh_frame_data_,
14308 eh_frame_hdr_section_, and build_id_note_.
14309 (Layout::finalize): Call create_build_id.
14310 (Layout::create_note): New function, broken out of
14311 Layout::create_gold_note.
14312 (Layout::create_gold_note): Call create_note.
14313 (Layout::create_build_id): New function.
14314 (Layout::write_build_id): New function.
14315 (Close_task_runner::run): Call write_build_id.
14316
8b105e34
ILT
14317 * x86_64.cc: Correct license to GPLv3.
14318
086a1841
ILT
143192008-03-23 Ian Lance Taylor <iant@google.com>
14320
14321 * options.cc: Include "demangle.h".
14322 (parse_optional_string): New function.
14323 (parse_long_option): Handle takes_optional_argument.
14324 (parse_short_option): Update dash_z initializer. Handle
14325 takes_optional_argument.
14326 (General_options::General_options): Initialize do_demangle_.
14327 (General_options::finalize): Set do_demangle_. Handle demangling
14328 style.
14329 * options.h (parse_optional_string): Declare.
14330 (struct One_option): Add optional_arg field. Update constructor.
14331 Update call constructor calls. Add takes_optional_argument
14332 function.
14333 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14334 (DEFINE_optional_string): Define.
14335 (General_options::demangle): Change from DEFINE_bool to
14336 DEFINE_optional_string.
14337 (General_options::no_demangle): New function.
14338 (General_options::do_demangle): New function.
14339 (General_options::set_do_demangle): New function.
14340 (General_options::execstack_status_): Move definition to end of
14341 class definition.
14342 (General_options::static_): Likewise.
14343 (General_options::do_demangle_): New field.
14344 * object.cc (big_endian>::get_symbol_location_info): Call
14345 Options::do_demangle, not Options::demangle.
14346 * symtab.cc (demangle): Likewise.
14347
cbb93e63
ILT
143482008-03-22 Ian Lance Taylor <iant@google.com>
14349
14350 * gold.h: Include <cstddef> and <sys/types.h>
14351 * options.h: Include <cstring>.
14352
ec531623
ILT
143532008-03-21 Ian Lance Taylor <iant@google.com>
14354
14355 * Added source code to GNU binutils.
752937aa
NC
14356\f
14357Copyright (C) 2008-2012 Free Software Foundation, Inc.
14358
14359Copying and distribution of this file, with or without modification,
14360are permitted in any medium without royalty provided the copyright
14361notice and this notice are preserved.
14362
14363Local Variables:
14364mode: change-log
14365left-margin: 8
14366fill-column: 74
14367version-control: never
14368End:
This page took 0.934069 seconds and 4 git commands to generate.